/* ─────────────────────────────────────────────────────────────
   HR Blizz · Instaroll walkthrough — mirrors the real Payroll
   admin console. Reuses .bp-frame / pac-* chrome. Tokens from the
   HRB design system (colors_and_type.css).
   ──────────────────────────────────────────────────────────── */

.iw-section {
  background: transparent;
  border-top: 0;
  border-bottom: 0;
  min-height: 0;
  padding: clamp(8px, 2vh, 22px) 0;
}
.iw-stepper.bp-stepper { margin-top: 0; }
.iw-stepper .bp-stepper-li.is-todo:hover { border-color: var(--rule-strong); color: var(--ink); }
/* Stepper — always single row with horizontal scroll if it overflows */
.iw-stepper.bp-stepper {
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}
.iw-stepper.bp-stepper::-webkit-scrollbar { height: 4px; }
.iw-stepper.bp-stepper::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 4px; }
.iw-stepper .bp-stepper-li { flex: 0 0 auto !important; scroll-snap-align: start; white-space: nowrap; }

/* Tables — allow horizontal scroll on narrow screens */
.iw-paytable, .iw-gtn-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* frame · no separate topbar row — sidebar + content only */
.iw-frame,
.iw-frame.pac-shell {
  aspect-ratio: 1320 / 640;
  grid-template-columns: 224px 1fr;
  box-shadow: none;
  border: 1px solid var(--rule-strong, #B8C1D1);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "sb ct";
  max-height: none;
  min-height: 0;
}
/* Taller frame below laptop width so the dashboard content has room (was cramped on iPad) */
@media (max-width: 1024px) {
  .iw-frame, .iw-frame.pac-shell { aspect-ratio: 1180 / 760; }
}
@media (max-width: 760px) {
  .iw-frame, .iw-frame.pac-shell { aspect-ratio: 900 / 780; }
}
.bp-frame.iw-frame,
.iw-frame.pac-shell {
  border: 1px solid var(--rule-strong, #B8C1D1);
  border-top-width: 1px;
  border-bottom-width: 1px;
  box-shadow: none;
}
.iw-content { grid-area: ct; gap: 10px; padding: 14px 18px; background: var(--hrb-gray-00); overflow: hidden; position: relative; min-height: 0; }
.iw-sb, .pac-side.iw-sb { overflow-y: auto; min-height: 0; }
.iw-entity-orb {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--ink) 0%, #0B2450 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 8px 18px -8px rgba(0, 23, 56, 0.55);
  overflow: hidden !important;
  padding: 0;
  position: relative;
}
.iw-entity-orb img {
  display: block;
  width: 34px; height: 34px;
  max-width: 60%; max-height: 60%;
  object-fit: contain;
  margin: 0;
}
.iw-user-av { background: #2FA98E !important; color: #fff !important; }
.iw-user-id { color: var(--accent) !important; }

/* ── run header (steps 2–6) ──────────────────────────────── */
.iw-run { display: flex; flex-direction: column; gap: 10px; }
.iw-run-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.iw-run-bc { font: 400 18px/1.1 var(--font-display); color: var(--ink-2); }
.iw-run-bc b { color: var(--ink); font-weight: 700; }
.iw-run-sep { color: var(--ink-3); margin: 0 3px; }
.iw-run-ref { font: 400 11px var(--font-mono); color: var(--ink-3); margin-top: 4px; }
.iw-run-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.iw-meta-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 11.5px var(--font-body); color: var(--ink-2);
  background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 5px 10px;
}
.iw-meta-pill.blue { color: #1763B6; }
.iw-meta-pill.blue b { background: #1763B6; color: #fff; border-radius: 5px; padding: 0 5px; margin-left: 1px; font-size: 10.5px; }
.iw-meta-status {
  font: 600 11px var(--font-body); color: #1763B6;
  background: #EAF4FF; border: 1px solid #BBD9F5; border-radius: 8px; padding: 5px 11px;
}
.iw-meta-status.locked { color: var(--hrb-green-60); background: #ECF8EF; border-color: #BCE6C7; }
.iw-meta-lock { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #ECF8EF; color: var(--hrb-green-60); border: 1px solid #BCE6C7; }
.iw-meta-lock.locked { background: var(--hrb-green-60); color: #fff; border-color: var(--hrb-green-60); }
.iw-meta-x { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--ink); color: #fff; }

/* navy tab bar */
.iw-navtabs { display: flex; gap: 2px; background: var(--ink); border-radius: 10px; padding: 5px; }
.iw-navtab {
  font: 600 13px var(--font-body); color: rgba(255,255,255,0.7);
  background: transparent; border: 0; border-radius: 7px; padding: 8px 22px; cursor: pointer;
  transition: background var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard);
}
.iw-navtab.on { background: var(--accent); color: #fff; }

/* ── stage ───────────────────────────────────────────────── */
.iw-stage { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; animation: iwStageIn 0.42s var(--ease-emphasized); }
@keyframes iwStageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.iw-screen { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 11px; overflow: hidden; position: relative; }

.iw-h3 { font: 620 15px/1.2 var(--font-display); margin: 0; color: var(--ink); }
.iw-page-h { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.iw-page-title { font: 700 18px/1.1 var(--font-display); margin: 0; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.iw-ver-note { display: inline-flex; align-items: center; gap: 6px; font: 500 10.5px var(--font-body); color: var(--ink-3); }

/* segmented control */
.iw-seg { display: inline-flex; background: var(--hrb-orange-00); border: 1px solid var(--hrb-orange-20); border-radius: 9px; padding: 2px; }
.iw-seg button { font: 600 11.5px var(--font-body); color: var(--ink-3); background: transparent; border: 0; border-radius: 7px; padding: 6px 14px; cursor: pointer; }
.iw-seg button.on { background: #fff; color: var(--accent); box-shadow: var(--shadow-compact); }
.iw-seg.sm button { padding: 5px 11px; font-size: 11px; }

/* generic card / round buttons */
.iw-card { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow-compact); }
.iw-round-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--rule); background: #fff; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.iw-round-btn.navy { background: var(--ink); border-color: var(--ink); color: #fff; }
.iw-link-orange { display: inline-flex; align-items: center; gap: 5px; font: 600 12.5px var(--font-body); color: var(--accent); background: none; border: 0; cursor: pointer; }
.iw-link-orange.sm { font-size: 11.5px; }
.iw-link-plain { font: 600 13px var(--font-body); color: var(--ink-2); background: none; border: 0; cursor: pointer; }

/* orange / disabled buttons */
.iw-btn-orange {
  position: relative; font: 700 13px var(--font-body); color: #fff;
  background: var(--accent); border: 0; border-radius: 8px; padding: 9px 22px; cursor: pointer;
  box-shadow: 0 6px 12px -5px rgba(255,95,31,0.5);
}
.iw-btn-orange.lg { padding: 11px 30px; }
.iw-btn-orange.xl { padding: 15px 30px; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.iw-btn-orange.is-done { background: var(--hrb-green-60); box-shadow: none; display: inline-flex; align-items: center; gap: 6px; }
.iw-btn-disabled { font: 600 12.5px var(--font-body); color: var(--ink-3); background: #EEF0F3; border: 0; border-radius: 8px; padding: 9px 22px; cursor: not-allowed; }

/* pills */
.iw-pill-green-solid { font: 600 11px var(--font-body); color: #fff; background: var(--hrb-green-60); border-radius: 7px; padding: 4px 11px; }
.iw-pill-green-soft { font: 600 10.5px var(--font-body); color: var(--hrb-green-60); background: #ECF8EF; border: 1px solid #BCE6C7; border-radius: 7px; padding: 3px 9px; }
.iw-pill-blue { font: 600 10.5px var(--font-body); color: #1763B6; background: #EAF4FF; border: 1px solid #BBD9F5; border-radius: 7px; padding: 3px 10px; }
.iw-tag-cont { font: 600 10px var(--font-body); color: var(--ink-2); background: var(--hrb-darkblue-00); border-radius: 5px; padding: 2px 7px; margin-left: 4px; }
.iw-tag-pac { font: 600 10px var(--font-mono); color: #B57100; background: #FFF7EC; border: 1px solid #F2C99C; border-radius: 5px; padding: 2px 8px; }
.iw-badge-yellow { font: 700 10.5px var(--font-mono); color: #B57100; background: #FFF3D6; border-radius: 5px; padding: 1px 7px; }

/* ── STEP 1 · payrolls list ──────────────────────────────── */
.iw-open { gap: 13px; }
.iw-open-head { display: flex; align-items: center; gap: 22px; }
.iw-open-title { font: 700 19px/1 var(--font-display); margin: 0; color: var(--ink); }
.iw-open-status { display: inline-flex; align-items: center; gap: 9px; }
.iw-open-status-k { font: 600 9.5px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.iw-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.iw-card-title { font: 700 15px var(--font-display); margin: 0; color: var(--ink); }
.iw-card-tools { display: flex; align-items: center; gap: 9px; }
.iw-grp { font: 700 12.5px var(--font-body); color: var(--ink); margin: 14px 0 6px; }
.iw-paytable { display: flex; flex-direction: column; }
.iw-pt-head, .iw-pt-row { display: grid; grid-template-columns: 1.1fr 1.1fr 2fr 0.8fr 0.9fr 0.8fr; align-items: center; gap: 12px; padding: 11px 12px; }
.iw-pt-head { font: 600 10px var(--font-body); color: var(--ink-3); border-bottom: 1px solid var(--rule); }
.iw-pt-row { border-radius: 10px; font: 400 12.5px var(--font-body); color: var(--ink); }
.iw-pt-row.is-focus { background: var(--hrb-orange-00); box-shadow: inset 0 0 0 1px var(--hrb-orange-20); }
.iw-pt-id { font: 600 12.5px var(--font-body); color: var(--accent); }
.iw-pt-name { display: flex; flex-direction: column; gap: 2px; }
.iw-pt-name > span:first-child { font-weight: 600; }
.iw-pt-sub { font: 400 11px var(--font-body); color: var(--ink-3); }
.iw-pt-pay { font-variant-numeric: tabular-nums; }
.iw-pt-act { display: flex; justify-content: flex-end; }

.iw-close-card { display: flex; align-items: center; gap: 14px; opacity: 0.92; }
.iw-close-icn { width: 40px; height: 40px; border-radius: 10px; background: var(--hrb-gray-00); color: var(--ink-3); display: grid; place-items: center; flex: none; }
.iw-close-body { flex: 1; }
.iw-close-title { font: 600 14px var(--font-display); color: var(--ink-2); }
.iw-close-sub { font: 400 11.5px var(--font-body); color: var(--ink-3); margin-top: 3px; display: inline-flex; align-items: center; gap: 6px; }
.iw-close-lock { color: #D22A2A; display: inline-flex; }

/* ── STEP 2 · insights dashboard ─────────────────────────── */
.iw-insights { display: flex; align-items: stretch; gap: 0; padding: 0; overflow: hidden; min-height: 116px; }
.iw-ins-lead { display: grid; grid-template-columns: 38px 1fr; column-gap: 12px; row-gap: 6px; align-content: center; padding: 18px 22px; border-right: 1px solid var(--rule); flex: 1.2 1 0; min-width: 0; overflow: hidden; }
.iw-ins-spark { width: 38px; height: 38px; border-radius: 11px; background: var(--hrb-orange-00); color: var(--accent); display: grid; place-items: center; flex: none; grid-column: 1; grid-row: 1; }
.iw-ins-lead b { display: flex; align-items: center; font: 700 16px var(--font-display); color: var(--ink); line-height: 1; grid-column: 2; grid-row: 1; min-height: 38px; }
.iw-ins-proc { display: block; font: 400 11.5px var(--font-body); color: var(--ink-3); line-height: 1.35; grid-column: 1 / -1; grid-row: 2; }
.iw-ins-events { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding: 16px 22px; border-right: 1px solid var(--rule); flex: 1.4 1 0; min-width: 0; overflow: hidden; }
.iw-ins-evtop { display: flex; align-items: center; gap: 12px; }
.iw-ins-evk { position: absolute; opacity: 0; }
.iw-ring {
  width: 56px; height: 56px; border-radius: 50%; flex: none; position: relative;
  background: conic-gradient(var(--hrb-green-60) 100%, #E2ECF8 0);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.iw-ring::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff; }
.iw-ring b { position: relative; z-index: 1; font: 700 15px var(--font-display); color: var(--ink); line-height: 1; }
.iw-ring i { position: relative; z-index: 1; font: 600 9px var(--font-body); color: var(--ink-3); font-style: normal; line-height: 1; margin-top: 1px; }
.iw-ins-leg { display: flex; flex-direction: row; flex-wrap: wrap; column-gap: 12px; row-gap: 3px; min-width: 0; }
.iw-ins-leg span { display: inline-flex; align-items: center; gap: 6px; font: 500 10.5px var(--font-body); color: var(--ink-2); white-space: nowrap; }
.iw-ins-leg b { color: var(--ink); margin-left: 2px; }
.iw-ins-leg i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.d-blue { background: #1763B6; } .d-yellow { background: #E0A300; } .d-red { background: #D22A2A; }
.iw-ins-emp { display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--font-body); color: var(--hrb-green-60); white-space: nowrap; flex: none; }
.iw-ins-metric { flex: 1 1 0; min-width: 0; padding: 16px 18px; border-right: 1px solid var(--rule); display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 10px; row-gap: 8px; align-content: center; align-items: start; }
.iw-ins-metric:nth-child(3) { flex: 0.75 1 0; }
.iw-ins-metric:nth-child(4) { flex: 1.25 1 0; }
.iw-ins-metric:nth-child(5) { flex: 0.9 1 0; }
.iw-ins-metric:nth-child(6) { flex: 1.25 1 0; }
.iw-ins-metric:last-child { border-right: 0; }
.iw-ins-mic { width: 30px; height: 30px; border-radius: 8px; background: #F0F3F8; color: var(--ink-2); display: grid; place-items: center; grid-column: 1; grid-row: 1; }
.iw-ins-mk { font: 500 11.5px var(--font-body); color: var(--ink-3); line-height: 1.3; min-height: 30px; display: flex; align-items: center; grid-column: 2; grid-row: 1; }
.iw-content { container-type: inline-size; }
.iw-ins-mv { font: 700 20px var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -0.01em; white-space: normal; overflow-wrap: anywhere; grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
@container (max-width: 680px) {
  /* Frame height is fixed (aspect-ratio + overflow:hidden), so the strip must stay
     short: 2 header cells on row 1, the four metrics side by side on row 2. */
  .iw-insights { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: min-content; height: auto !important; flex: none !important; overflow: visible; }
  .iw-insights .iw-ins-lead { grid-column: 1 / 3; flex: none !important; }
  .iw-insights .iw-ins-events { grid-column: 3 / -1; flex: none !important; border-right: 0 !important; }
  .iw-insights .iw-ins-metric { flex: none !important; border-top: 1px solid var(--rule); border-bottom: 0; padding: 10px 12px; grid-template-columns: 1fr; }
  .iw-insights .iw-ins-mic { display: none; }
  .iw-insights .iw-ins-mk { grid-column: 1; min-height: 0; font-size: 10.5px; }
  .iw-insights .iw-ins-mv { font-size: 15px; }
  .iw-insights .iw-ins-metric:nth-of-type(even) { border-right: 1px solid var(--rule); }
  .iw-insights .iw-ins-metric:last-of-type { border-right: 0; }
  /* Height budget: frame height is fixed, so keep the strip near its original
     116px and guarantee the table below keeps room for head + rows. */
  .iw-insights .iw-ins-proc { display: none; }
  .iw-insights .iw-ins-lead { padding: 10px 14px; row-gap: 0; grid-template-columns: 30px 1fr; column-gap: 10px; }
  .iw-insights .iw-ins-spark { width: 30px; height: 30px; border-radius: 9px; }
  .iw-insights .iw-ins-lead b { min-height: 30px; font-size: 14px; }
  .iw-insights .iw-ins-events { padding: 10px 14px; gap: 5px; }
  .iw-insights .iw-ins-leg { font-size: 10px; }
  .iw-gtn-table { min-height: 92px; }
}
@container (max-width: 520px) {
  .iw-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .iw-insights .iw-ins-lead, .iw-insights .iw-ins-events { grid-column: 1 / -1; border-right: 0 !important; border-bottom: 1px solid var(--rule); }
  /* 2×2 metrics: icon left, label over value on the right */
  .iw-insights .iw-ins-metric { grid-template-columns: 28px 1fr; column-gap: 10px; row-gap: 2px; padding: 12px 14px; align-content: center; }
  .iw-insights .iw-ins-mic { display: grid; width: 28px; height: 28px; border-radius: 8px; grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  .iw-insights .iw-ins-mk { grid-column: 2; grid-row: 1; min-height: 0; font-size: 11px; }
  .iw-insights .iw-ins-mv { grid-column: 2; grid-row: 2; font-size: 16px; }
  .iw-insights .iw-ins-metric:nth-of-type(odd) { border-right: 1px solid var(--rule); }
  .iw-insights .iw-ins-metric:nth-of-type(even) { border-right: 0; }
  .iw-insights .iw-ins-metric:nth-of-type(3), .iw-insights .iw-ins-metric:nth-of-type(4) { border-top: 1px solid var(--rule); }
}
.iw-ins-mv i { font: 500 10.5px var(--font-body); color: var(--ink-3); font-style: normal; }

.iw-gtn-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.iw-gtn-title { font: 700 17px var(--font-display); margin: 0; color: var(--ink); }
.iw-gtn-tools { display: flex; align-items: center; gap: 8px; }
.iw-loading { display: flex; align-items: center; gap: 8px; justify-content: center; flex: 1; min-height: 90px; font: 500 12px var(--font-body); color: var(--ink-3); background: #fff; border: 1px solid var(--rule); border-radius: 12px; }
.iw-loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); animation: iwBlink 1s var(--ease-standard) infinite; }
.iw-loading span:nth-child(2) { animation-delay: 0.15s; }
.iw-loading span:nth-child(3) { animation-delay: 0.3s; }
@keyframes iwBlink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* ── STEP 3 · gross-to-net table ─────────────────────────── */
.iw-gtn { gap: 10px; }
.iw-ai-banner {
  display: flex; align-items: center; gap: 11px;
  background: #fff; border: 1px solid var(--hrb-orange-20); border-radius: 10px; padding: 10px 14px;
}
.iw-ai-spark { width: 26px; height: 26px; border-radius: 7px; background: #F0ECFB; color: #6B43C9; display: grid; place-items: center; flex: none; }
.iw-ai-text { font: 500 12px var(--font-body); color: var(--ink); flex: 1; }
.iw-ai-text b { font-weight: 700; }
.iw-ai-filter { display: inline-flex; align-items: center; gap: 6px; }
.iw-ai-fl { font: 500 11px var(--font-body); color: var(--ink-3); margin-right: 2px; }
.iw-fl-pill { font: 600 10.5px var(--font-body); color: var(--ink-2); background: #fff; border: 1px solid var(--rule); border-radius: 7px; padding: 4px 10px; cursor: pointer; }
.iw-fl-pill.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ── STEP 3 (redesigned) · AI Insights panel ─────────────── */
.iw-aii-screen { gap: 10px; }
.iw-aii-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; }
.iw-aii-lead { display: inline-flex; align-items: center; gap: 8px; }
.iw-aii-lead b { font: 700 16px var(--font-display); color: var(--ink); }
.iw-aii-chev { color: var(--ink-3); font-size: 13px; line-height: 1; }
.iw-aii-toggle { display: inline-flex; background: #EEF1F6; border: 1px solid var(--rule); border-radius: 9px; padding: 3px; gap: 3px; }
.iw-aii-toggle button { font: 600 11px var(--font-body); color: var(--ink-3); background: none; border: 0; border-radius: 6px; padding: 5px 12px; cursor: pointer; white-space: nowrap; }
.iw-aii-toggle button.on { background: #fff; color: var(--hrb-orange-60, #FF5F1F); box-shadow: 0 1px 2px rgba(0,23,56,.08); }
.iw-aii-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 0.8fr 0.8fr 1.3fr; gap: 12px; }
.iw-aii-sum { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 16px 16px 12px; overflow: hidden; }
.iw-aii-sum::after { content: ""; position: absolute; right: -46px; bottom: -46px; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, #F0ECFB, rgba(240,236,251,0) 70%); pointer-events: none; }
.iw-aii-sum-top { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; position: relative; z-index: 1; }
.iw-aii-orb { width: 40px; height: 40px; border-radius: 50%; background: #F0ECFB; color: #6B43C9; display: grid; place-items: center; margin-bottom: 2px; }
.iw-aii-sum-title { margin: 0; font: 700 15px var(--font-display); color: var(--ink); }
.iw-aii-badge { font: 600 10.5px var(--font-body); padding: 2px 9px; border-radius: 6px; }
.iw-aii-badge.ok { background: #E7F6EC; color: #0F8529; }
.iw-aii-badge.bad { background: #FCE9E9; color: #D22A2A; }
.iw-aii-sum-sub { font: 500 11px var(--font-body); color: var(--ink-3); }
.iw-aii-stats { list-style: none; margin: 13px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; flex: 1; position: relative; z-index: 1; }
.iw-aii-stat { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 9px; }
.iw-aii-stat-ic { color: var(--ink-3); display: grid; place-items: center; }
.iw-aii-stat-k { font: 500 12px var(--font-body); color: var(--ink-2); }
.iw-aii-count { min-width: 24px; text-align: center; font: 700 11.5px var(--font-body); padding: 2px 7px; border-radius: 6px; }
.iw-aii-count.neutral { background: #EEF1F6; color: var(--ink-2); }
.iw-aii-count.warn { background: #FDF3E0; color: #B27A00; }
.iw-aii-count.bad { background: #FCE9E9; color: #D22A2A; }
.iw-aii-count.good { background: #E7F6EC; color: #0F8529; }
.iw-aii-sum-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); position: relative; z-index: 1; }
.iw-aii-lastrun { font-size: 10px; color: var(--ink-3); }
.iw-aii-details { position: relative; font: 600 12px var(--font-body); color: var(--ink-2); cursor: pointer; }
.iw-aii-details:hover { color: var(--hrb-orange-60, #FF5F1F); }
.iw-aii-acts { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.iw-aii-act { position: relative; flex: 1; display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 13px 15px; transition: border-color .18s var(--ease-standard), box-shadow .18s var(--ease-standard); }
.iw-aii-act.iw-radar { cursor: pointer; }
.iw-aii-act.iw-radar:hover { border-color: var(--hrb-orange-30, #FFB98F); box-shadow: 0 8px 20px -14px rgba(0,23,56,.4); }
.iw-aii-act-top { display: flex; align-items: center; gap: 9px; }
.iw-aii-act-ic { width: 30px; height: 30px; border-radius: 9px; background: #F0ECFB; color: #6B43C9; display: grid; place-items: center; flex: none; }
.iw-aii-act-title { margin: 0; font: 700 13px var(--font-display); color: var(--ink); }
.iw-aii-act-desc { margin: 0; font: 500 12px/1.45 var(--font-body) !important; color: var(--ink-3); flex: 1; }
.iw-aii-act-cta { position: relative; align-self: flex-start; font: 600 12px var(--font-body); color: var(--hrb-orange-60, #FF5F1F); cursor: pointer; }
@container (max-width: 720px) {
  .iw-aii-screen { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .iw-aii-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: min-content; }
  .iw-aii-acts { grid-column: 1 / -1; flex-direction: row; }
  .iw-aii-act { flex: 1 1 0; }
}
@container (max-width: 480px) {
  .iw-aii-grid { grid-template-columns: 1fr; }
  .iw-aii-acts { flex-direction: column; }
  .iw-aii-head { flex-wrap: wrap; row-gap: 8px; }
}

.iw-gtn-table { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.iw-gt-head, .iw-gt-row {
  display: grid;
  grid-template-columns: 36px 2fr 1.2fr 1.1fr 1.2fr 1.3fr 1.3fr 34px 26px;
  align-items: center; gap: 10px; padding: 9px 14px;
}
.iw-gt-head { font: 600 10px var(--font-body); color: var(--ink-3); border-bottom: 1px solid var(--rule); background: var(--hrb-gray-00); }
.iw-gt-head .num { text-align: right; }
.iw-gt-body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.iw-gt-row { border-bottom: 1px solid var(--hrb-darkblue-00); font: 400 12px var(--font-body); color: var(--ink); transition: background var(--motion-base) var(--ease-standard); }
.iw-gt-row.is-focus { background: var(--hrb-orange-00); box-shadow: inset 0 0 0 1px var(--hrb-orange-20); border-radius: 8px; }
.iw-gt-n { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-3); font-weight: 600; }
.iw-gt-dot { width: 6px; height: 6px; border-radius: 50%; background: #E0A300; flex: none; }
.iw-gt-name { display: flex; align-items: center; gap: 10px; }
.iw-gt-av { width: 30px; height: 30px; border-radius: 50%; color: #fff; font: 700 11px var(--font-body); display: grid; place-items: center; flex: none; }
.iw-gt-av.sm { width: 22px; height: 22px; font-size: 9px; }
.iw-gt-emp { display: flex; flex-direction: column; }
.iw-gt-id { font: 400 10.5px var(--font-mono); color: var(--ink-3); }
.iw-gt-nm { font: 600 12px var(--font-body); color: var(--ink); }
.iw-gt-amt { text-align: right; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.iw-delta { display: inline-flex; align-items: center; gap: 2px; font: 500 10px var(--font-body); }
.iw-delta.neg { color: #D22A2A; } .iw-delta.pos { color: var(--hrb-green-60); }
.iw-ai-pill { font: 600 10px var(--font-body); color: #B42318; background: #FCEEEE; border: 1px solid #F1C4C4; border-radius: 6px; padding: 3px 8px; }
.iw-gt-ok { color: var(--hrb-green-60); display: inline-flex; justify-content: center; }
.iw-gt-kebab { position: relative; color: var(--ink-3); display: inline-flex; justify-content: center; }

/* ── STEP 4 · edit input modal ───────────────────────────── */
.iw-editwrap { gap: 0; position: relative; flex: 1; min-height: 0; }
.iw-edit-behind { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; padding: 6px; opacity: 0.4; filter: blur(1px); pointer-events: none; }
.iw-behind-row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 1px solid var(--rule); border-radius: 8px; font: 400 11px var(--font-body); color: var(--ink-2); }
.iw-edit {
  position: absolute; left: 18px; right: 18px; bottom: 14px; z-index: 5;
  background: #fff; border: 1px solid var(--rule-strong); border-radius: 14px;
  box-shadow: var(--shadow-large); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 14px;
  animation: iwEditUp 0.4s var(--ease-emphasized);
}
@keyframes iwEditUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.iw-edit-head { display: flex; align-items: center; gap: 12px; }
.iw-edit-title { font: 700 17px var(--font-display); margin: 0; color: var(--ink); }
.iw-edit-x { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; border: 0; background: var(--hrb-gray-00); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.iw-edit-grid { display: flex; flex-direction: column; }
.iw-eg-head, .iw-eg-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.3fr 0.9fr 1fr 1.2fr 1.1fr 0.7fr 0.6fr;
  align-items: center; gap: 12px;
}
.iw-eg-head { padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.iw-eg-head span { font: 600 11px var(--font-body); color: var(--ink-2); display: flex; flex-direction: column; }
.iw-eg-head i { font: 400 10px var(--font-body); color: var(--ink-3); font-style: normal; margin-top: 2px; }
.iw-eg-head em { color: var(--accent); font-style: normal; }
.iw-eg-row { padding-top: 16px; font: 400 12.5px var(--font-body); color: var(--ink); }
.iw-eg-range { font-weight: 500; }
.iw-eg-prev { display: flex; align-items: center; justify-content: space-between; background: var(--hrb-gray-00); border: 1px solid var(--rule); border-radius: 8px; padding: 9px 11px; color: var(--ink-2); }
.iw-eg-prev i, .iw-eg-new i { font: 500 10px var(--font-body); color: var(--ink-3); font-style: normal; }
.iw-eg-arrow { color: var(--ink-3); display: inline-flex; justify-content: center; }
.iw-eg-newwrap { position: relative; border-radius: 8px; }
.iw-eg-input {
  appearance: none; -webkit-appearance: none;
  border: 0; background: transparent; outline: none;
  font: inherit; color: inherit;
  width: 4.5ch; min-width: 40px;
  padding: 0; margin: 0;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.iw-eg-input:focus { color: var(--accent); }
.iw-eg-input::-webkit-outer-spin-button, .iw-eg-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.iw-eg-input[type=number] { -moz-appearance: textfield; }
.iw-eg-input:disabled { color: var(--ink); opacity: 1; }
.iw-eg-new { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1.5px solid var(--accent); border-radius: 8px; padding: 9px 11px; font-weight: 700; box-shadow: 0 0 0 3px rgba(255,95,31,0.14); }
.iw-eg-var { color: var(--hrb-green-60); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.iw-eg-date { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff; border: 1px solid var(--rule-strong); border-radius: 8px; padding: 9px 11px; color: var(--ink); }
.iw-eg-date.dim { color: var(--ink-3); }
.iw-eg-date svg { color: var(--ink-3); }
.iw-eg-unit { color: var(--ink-2); }
.iw-edit-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; border-top: 1px solid var(--rule); padding-top: 14px; }
.iw-edit-note { display: flex; align-items: flex-start; gap: 8px; font: 400 11px/1.45 var(--font-body); color: var(--ink-3); max-width: 60ch; }
.iw-note-i { width: 15px; height: 15px; border-radius: 50%; border: 1px solid #BBD9F5; color: #1763B6; font: 700 9px var(--font-mono); display: grid; place-items: center; flex: none; margin-top: 1px; }
.iw-edit-actions { display: inline-flex; align-items: center; gap: 14px; flex: none; }
.iw-edit-saved { display: inline-flex; align-items: center; gap: 7px; font: 600 11.5px var(--font-body); color: var(--hrb-green-60); background: #F4FBF6; border: 1px solid #BCE6C7; border-radius: 8px; padding: 8px 12px; animation: iwStageIn 0.4s var(--ease-emphasized); }

/* ── STEP 5 · approve & lock ─────────────────────────────── */
.iw-approve { justify-content: center; }
.iw-mini-eyebrow { font: 600 13.5px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.iw-mini-lead { font-size: 13.5px; font-weight: 700; color: var(--ink); letter-spacing: 0.08em; }
.iw-mini-lead-now { color: var(--accent); }
.iw-approve-grid { display: grid; grid-template-columns: 1fr auto 1.1fr; gap: 18px; align-items: center; flex: 1; min-height: 0; }
.iw-then, .iw-now { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 16px 18px; height: 100%; display: flex; flex-direction: column; gap: 10px; }
.iw-thenlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.iw-thenlist li { display: flex; align-items: center; gap: 10px; font: 500 12px var(--font-body); color: var(--ink-2); padding: 7px 10px; border-radius: 7px; background: var(--hrb-gray-00); transition: opacity 0.45s, transform 0.45s, filter 0.45s; }
.iw-thenlist li span { width: 18px; height: 18px; border-radius: 50%; background: var(--hrb-darkblue-00); color: var(--ink-3); font: 600 10px var(--font-mono); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.iw-thenlist li.is-collapsed { opacity: 0.4; transform: scale(0.97); filter: grayscale(1); text-decoration: line-through; }
.iw-arrow-mid { color: var(--accent); display: flex; align-items: center; justify-content: center; }
.iw-now { align-items: center; justify-content: center; text-align: center; }
.iw-now.is-locked { border-color: #BCE6C7; background: linear-gradient(160deg, #F4FBF6, #fff); }
.iw-locked-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; animation: bpPop 0.4s var(--ease-emphasized); }
.iw-locked-card b { font: 700 16px var(--font-display); color: var(--hrb-green-60); }
.iw-locked-icn { width: 44px; height: 44px; border-radius: 12px; background: #DEF3E4; color: var(--hrb-green-60); display: grid; place-items: center; margin-bottom: 4px; }
.iw-locklist { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.iw-locklist li { display: flex; align-items: center; gap: 9px; font: 500 12px var(--font-body); color: var(--ink-3); transition: color 0.4s; }
.iw-locklist li svg { color: var(--ink-3); transition: color 0.4s; }
.iw-locklist li.on { color: var(--ink); }
.iw-locklist li.on svg { color: var(--hrb-green-60); }

/* ── STEP 6 · reports ────────────────────────────────────── */
.iw-reports { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; flex: 1; min-height: 0; }
.iw-report { background: #fff; border: 1px solid var(--rule); border-radius: 11px; padding: 13px 14px; display: flex; flex-direction: column; gap: 9px; }
.iw-report-h { display: flex; align-items: center; gap: 9px; }
.iw-report-icn { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.iw-report.tone-blue .iw-report-icn { background: #EAF4FF; color: #1763B6; }
.iw-report.tone-orange .iw-report-icn { background: var(--hrb-orange-00); color: var(--accent); }
.iw-report.tone-green .iw-report-icn { background: #ECF8EF; color: var(--hrb-green-60); }
.iw-report.tone-violet .iw-report-icn { background: #F0ECFB; color: #6B43C9; }
.iw-report-g { font: 600 13px var(--font-body); color: var(--ink); flex: 1; }
.iw-report-items { display: flex; flex-wrap: wrap; gap: 6px; }
.iw-chip { font: 500 10.5px var(--font-body); color: var(--ink-2); background: var(--hrb-gray-00); border: 1px solid var(--rule); border-radius: 6px; padding: 3px 8px; }
.iw-report-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.iw-tag-auto { display: inline-flex; align-items: center; gap: 5px; font: 600 9.5px var(--font-body); color: var(--accent); }
.iw-mini-dl { display: inline-flex; align-items: center; gap: 5px; font: 600 11px var(--font-body); color: var(--ink-2); background: #fff; border: 1px solid var(--rule-strong); border-radius: 7px; padding: 5px 10px; cursor: pointer; }
.iw-mini-dl:hover { background: var(--hrb-darkblue-00); }
.iw-retry-note { display: inline-flex; align-items: center; gap: 7px; font: 500 11px var(--font-body); color: var(--ink-3); padding: 8px 12px; background: #fff; border: 1px solid var(--rule); border-radius: 9px; }

/* ── STEP 6 · reports · list/table view ──────────────────── */
.iw-rpt-tablewrap { flex: 1; min-height: 0; overflow: auto; background: #fff; border: 1px solid var(--rule); border-radius: 12px; }
.iw-rpt-table { width: 100%; border-collapse: collapse; }
.iw-rpt-table thead th { position: sticky; top: 0; z-index: 1; background: #fff; text-align: left; font: 600 10.5px var(--font-body); letter-spacing: 0.03em; color: var(--ink-3); padding: 11px 16px; border-bottom: 1px solid var(--rule); }
.iw-rpt-table tbody td { padding: 11px 16px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.iw-rpt-table tbody tr:last-child td { border-bottom: 0; }
.iw-rpt-table tbody tr { transition: background 0.18s var(--ease-standard); }
.iw-rpt-table tbody tr:hover { background: var(--hrb-darkblue-00); }
.iw-rpt-num { width: 34px; text-align: center; font: 600 12px var(--font-body); color: var(--ink-3); }
.iw-rpt-name { font: 600 13px var(--font-body); color: var(--ink); }
.iw-rpt-src { font: 500 11px var(--font-body); color: var(--ink-3); margin-top: 2px; }
.iw-rpt-when { width: 210px; font: 500 12px var(--font-mono, var(--font-body)); color: var(--ink-2); white-space: nowrap; }
.iw-rpt-st { width: 150px; }
.iw-rpt-actions { display: inline-flex; align-items: center; gap: 8px; }
.iw-rpt-badge { font: 600 10.5px var(--font-body); color: var(--ink-2); background: var(--hrb-darkblue-00); border: 1px solid var(--rule); border-radius: 6px; padding: 3px 9px; }
.iw-rpt-refresh { color: var(--ink-3); display: inline-flex; }
.iw-rpt-gen { font: 600 12px var(--font-body); color: var(--accent); background: none; border: 0; cursor: pointer; padding: 0; }
.iw-rpt-gen:hover { color: var(--hrb-orange-70); text-decoration: underline; }
.iw-rpt-dl { display: inline-flex; align-items: center; gap: 5px; font: 600 11px var(--font-body); color: var(--ink-2); background: #fff; border: 1px solid var(--rule-strong); border-radius: 7px; padding: 5px 11px; cursor: pointer; }
.iw-rpt-dl:hover { background: var(--hrb-darkblue-00); border-color: var(--accent); color: var(--accent); }

/* ── STEP 7 · calendar (schedule list) ───────────────────── */
.iw-cal-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.iw-cal-nav { display: flex; align-items: center; gap: 10px; }
.iw-cal-events { font: 700 16px var(--font-display); color: var(--ink); }
.iw-cal-range { font: 700 13px var(--font-display); color: var(--ink); }
.iw-cal-arrow { width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--rule); background: #fff; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.iw-cal-arrow:hover { background: var(--hrb-darkblue-00); }
.iw-cal-tools { display: flex; align-items: center; gap: 8px; }
.iw-cal-toggle { display: inline-flex; background: var(--hrb-darkblue-00); border: 1px solid var(--rule); border-radius: 9px; padding: 2px; }
.iw-cal-toggle button { font: 600 11.5px var(--font-body); color: var(--ink-3); background: none; border: 0; border-radius: 7px; padding: 5px 12px; cursor: pointer; }
.iw-cal-toggle button.on { background: #fff; color: var(--accent); box-shadow: 0 1px 2px rgba(0,23,56,0.08); }
.iw-cal-round { width: 30px; height: 30px; border-radius: 9px; border: 0; background: var(--hrb-darkblue-90); color: #fff; display: grid; place-items: center; cursor: pointer; }
.iw-cal-round:hover { background: var(--ink); }

.iw-cal-scroll { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 16px; padding-right: 2px; }
.iw-cal-month { display: flex; flex-direction: column; gap: 8px; }
.iw-cal-mtitle { display: flex; align-items: center; gap: 10px; font: 700 13.5px var(--font-display); color: var(--hrb-darkblue-70); margin: 0; }
.iw-cal-nowtag { font: 700 8.5px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); background: var(--hrb-orange-00); border: 1px solid var(--hrb-orange-20); border-radius: 5px; padding: 2px 7px; }
.iw-cal-tablewrap { overflow-x: auto; border-top: 1px solid var(--rule); }
.iw-cal-table { width: 100%; min-width: 640px; border-collapse: collapse; table-layout: fixed; }
.iw-cal-table th:nth-child(1), .iw-cal-table td:nth-child(1) { width: 12%; }
.iw-cal-table th:nth-child(2), .iw-cal-table td:nth-child(2) { width: 21%; }
.iw-cal-table th:nth-child(3), .iw-cal-table td:nth-child(3) { width: 11%; }
.iw-cal-table th:nth-child(4), .iw-cal-table td:nth-child(4) { width: 12%; }
.iw-cal-table th:nth-child(5), .iw-cal-table td:nth-child(5) { width: 11%; }
.iw-cal-table th:nth-child(6), .iw-cal-table td:nth-child(6) { width: 10%; }
.iw-cal-table th:nth-child(7), .iw-cal-table td:nth-child(7) { width: 12%; }
.iw-cal-table th:nth-child(8), .iw-cal-table td:nth-child(8) { width: 11%; }
.iw-cal-table thead th { text-align: left; font: 600 10px var(--font-body); letter-spacing: 0.02em; color: var(--ink-3); padding: 9px 12px 9px 0; }
.iw-cal-table tbody td { font: 500 12px var(--font-body); color: var(--ink-2); padding: 11px 12px 11px 0; border-top: 1px solid var(--rule); }
.iw-cal-ev { color: var(--accent) !important; font-weight: 600 !important; }
.iw-cal-dim { color: var(--ink-3) !important; }
.iw-cal-type { font: 600 10px var(--font-body); color: var(--hrb-green-60); background: #ECF8EF; border-radius: 6px; padding: 3px 9px; }
.iw-cal-pub { font: 700 10px var(--font-body); color: #fff; background: var(--hrb-green-60); border-radius: 6px; padding: 3px 9px; }
.iw-cal-month.is-now .iw-cal-table tbody td { background: var(--hrb-orange-00); }
.iw-cal-foot { display: inline-flex; align-items: center; gap: 9px; font: 500 12px var(--font-body); color: #fff; padding: 11px 14px; background: var(--ink); border-radius: 10px; }
.iw-cal-foot svg { color: var(--accent); flex: none; }
.iw-cal-foot b { color: #fff; }

/* ── cursor / click cue ──────────────────────────────────── */
.iw-act { position: relative; }
.iw-act::after {
  content: ""; position: absolute; inset: -4px; border-radius: 10px;
  box-shadow: 0 0 0 2px var(--accent); opacity: 0;
  animation: iwActPulse 1.6s var(--ease-standard) infinite; pointer-events: none;
}
@keyframes iwActPulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.9; } }
.iw-cue { position: absolute; right: -10px; bottom: -14px; z-index: 6; pointer-events: none; }
.iw-cue-ptr { display: block; animation: iwTap 1.6s var(--ease-emphasized) infinite; filter: drop-shadow(0 2px 3px rgba(0,23,56,0.3)); }
@keyframes iwTap { 0%, 100% { transform: translate(0,0); } 45% { transform: translate(-3px,-3px); } 55% { transform: translate(-3px,-3px) scale(0.9); } }
.iw-cue-ring { position: absolute; right: 4px; bottom: 6px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent); animation: iwCueRing 1.6s var(--ease-standard) infinite; }
@keyframes iwCueRing { 0% { transform: scale(0.4); opacity: 0.8; } 70% { transform: scale(2.4); opacity: 0; } 100% { opacity: 0; } }
.iw-cue-tip { position: absolute; right: 26px; bottom: 22px; white-space: nowrap; font: 600 10px var(--font-body); color: #fff; background: var(--ink); border-radius: 6px; padding: 4px 8px; }

/* ── foot (caption + nav) ────────────────────────────────── */
.iw-foot { gap: 14px; align-items: center; padding: 9px 14px; position: relative; overflow: hidden; }
.iw-play svg { color: var(--accent); }
.iw-foot-prog { position: absolute; left: 0; top: 0; height: 2px; background: var(--accent); border-radius: 0 2px 2px 0; animation: iwProg 3.6s linear forwards; }
@keyframes iwProg { from { width: 0; } to { width: 100%; } }
.iw-foot-caption { display: flex; align-items: center; gap: 11px; min-width: 0; }
.iw-foot-n { font: 700 11px var(--font-mono); color: #fff; background: var(--accent); border-radius: 999px; padding: 3px 9px; flex: none; }
.iw-foot-cap { font: 500 13px/1.3 var(--font-body); color: var(--ink); text-wrap: pretty; }
.iw-foot-nav { display: inline-flex; align-items: center; gap: 8px; flex: none; }

/* ── radar ping — indicates a clickable primary action ─── */
.iw-radar { position: relative; }
.iw-radar::before, .iw-radar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 3px rgba(255, 95, 31, 0.55), 0 0 18px 4px rgba(255, 95, 31, 0.35);
  opacity: 0;
  pointer-events: none;
  animation: iwRadarPing 2s var(--ease-emphasized) infinite;
}
.iw-radar::after { animation-delay: 1s; }
@keyframes iwRadarPing {
  0%   { transform: scale(0.94); opacity: 0.8; }
  60%  { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}
.iw-radar-row { position: relative; cursor: pointer; }
.iw-radar-row::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--accent);
  opacity: 0;
  pointer-events: none;
  animation: iwRadarInset 2.2s var(--ease-standard) infinite;
}
@keyframes iwRadarInset {
  0%   { opacity: 0; }
  50%  { opacity: 0.55; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .iw-radar::before, .iw-radar::after, .iw-radar-row::after { animation: none; }
}

/* ── responsive ──────────────────────────────────────────── */
@media (max-width: 1180px) { .iw-frame { font-size: 0.9em; } }
@media (max-width: 960px) {
  .iw-frame { grid-template-columns: 64px 1fr; }
  .iw-ins-proc, .iw-run-ref { display: none; }
}
@media (max-width: 820px) {
  .iw-reports { grid-template-columns: 1fr; }
  .iw-calgrid { grid-template-columns: repeat(3, 1fr); }
  .iw-insights { flex-wrap: wrap; }
  .iw-approve-grid { grid-template-columns: 1fr; }
  .iw-arrow-mid { transform: rotate(90deg); }
  .iw-foot { flex-direction: column; align-items: flex-start; }
  .iw-foot-nav { align-self: stretch; justify-content: flex-end; }
  /* Insights strip: real grid instead of 6 squeezed flex items */
  .iw-insights { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 0; }
  .iw-ins-lead, .iw-ins-events { grid-column: 1 / -1; flex: none !important; border-right: 0 !important; border-bottom: 1px solid var(--rule); }
  .iw-ins-metric { flex: none !important; border-bottom: 1px solid var(--rule); }
  .iw-ins-metric:nth-of-type(even) { border-right: 0; }
  .iw-ins-metric:nth-last-of-type(-n+2) { border-bottom: 0; }
  .iw-ins-mv { font-size: 18px; }
}

/* Tablet-and-down: hide sidebar, aspect ratio taller so content still fits */
@media (max-width: 720px) {
  .iw-section, .iw-section .wrap { overflow-x: clip; overflow-y: visible; }
  .iw-frame,
  .iw-frame.pac-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "ct";
    aspect-ratio: auto;
    min-height: 640px;
    font-size: 0.9em;
    width: 100%;
    max-width: 100%;
  }
  .iw-sb, .pac-side.iw-sb { display: none; }
  .iw-content { padding: 12px 12px; overflow: auto; }
  .iw-run-top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .iw-run-meta { flex-wrap: wrap; gap: 6px; }
  .iw-run-bc { font-size: 16px; }
  .iw-meta-pill, .iw-meta-status { font-size: 11px; padding: 4px 8px; }
  .iw-open-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .iw-page-h { flex-direction: column; align-items: flex-start; gap: 6px; }
  .iw-gtn-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .iw-gtn-tools { flex-wrap: wrap; }
  .iw-calgrid { grid-template-columns: repeat(2, 1fr); }
  .iw-stepper .bp-stepper-li { padding: 6px 10px; font-size: 11.5px; }
  .iw-eg-head, .iw-eg-row { min-width: 660px; }
  .iw-edit { left: 10px; right: 10px; bottom: 10px; padding: 12px 14px; }
  .iw-edit-foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .iw-edit-actions { justify-content: flex-end; }
  .iw-reports { grid-template-columns: 1fr; }
  .iw-approve-grid { grid-template-columns: 1fr; gap: 14px; }
  .iw-arrow-mid { transform: rotate(90deg); }
  .iw-ai-banner { flex-wrap: wrap; }
  .iw-ai-filter { flex-wrap: wrap; row-gap: 6px; }
  /* Keep tables laid out normally but allow horizontal scroll */
  .iw-pt-head, .iw-pt-row { min-width: 720px; }
  .iw-gt-head, .iw-gt-row { min-width: 900px; }
  /* the gross-to-net table sets overflow:hidden at desktop — on mobile it must scroll, not clip */
  .iw-gtn-table { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .iw-gtn-table .iw-gt-body { overflow-x: visible; overflow-y: visible; min-width: 900px; }
  .iw-paytable { scrollbar-width: thin; }
  .iw-foot { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
  .iw-foot-caption { align-items: flex-start; }
  .iw-foot-nav { justify-content: space-between; }
  .bp-btn { flex: 1; justify-content: center; }
  .iw-report { padding: 14px; }
  .iw-report-items { flex-wrap: wrap; }
}

/* Small mobile — 480 and below */
@media (max-width: 480px) {
  .iw-frame,
  .iw-frame.pac-shell {
    min-height: 720px;
    border-radius: 10px;
  }
  .iw-content { padding: 10px; gap: 8px; }
  .iw-run-bc { font-size: 15px; }
  .iw-open-title { font-size: 16px; }
  .iw-calgrid { grid-template-columns: 1fr; }
  .iw-calcell {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 0;
    padding: 10px 14px;
    gap: 12px;
  }
  .iw-cal-flag { position: static; margin-left: auto; }
  .iw-foot-caption { flex-wrap: wrap; }
  .iw-foot-cap { font-size: 12px; }
  .iw-stepper .bp-stepper-li { font-size: 11px; padding: 5px 8px; }
  .iw-then, .iw-now { padding: 12px 14px; }
  .iw-close-card { flex-wrap: wrap; }
  .iw-close-title { font-size: 14px; }
  .iw-ins-lead, .iw-ins-events { padding: 12px 14px; }
}

/* ── "How Instaroll works" editorial copy block ──────────── */
.ir-copy-sec { padding-top: clamp(4px, 1.4vh, 18px); }
.ic4 {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(30px, 6vw, 96px);
  align-items: start;
}
.ic4-aside { position: sticky; top: 96px; }
.ic4-eyebrow { display: inline-block; color: var(--ink-3); letter-spacing: 0.16em; text-transform: uppercase; font-size: 11px; }
.ic4-h {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.06;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin: 14px 0 0;
  text-wrap: balance;
}
.ic4-lede {
  font-family: var(--font-body);
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.55;
  color: var(--ink-2);
  margin: 22px 0 0;
  text-wrap: pretty;
}
.ic4-main { display: flex; flex-direction: column; }
.ic4-item {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: clamp(16px, 1.6vw, 24px);
  align-items: start;
  padding: clamp(18px, 2vw, 26px) 0;
  border-top: 1px solid var(--rule);
}
.ic4-item:first-child { padding-top: 4px; border-top: 0; }
.ic4-item:last-child { padding-bottom: 0; }
.ic4-num {
  font-family: var(--font-display);
  font-size: clamp(34px, 3.4vw, 52px);
  font-weight: 700;
  line-height: 0.9;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.ic4-p {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.25vw, 18px);
  line-height: 1.7;
  color: var(--ink);
  margin: 0;
  text-wrap: pretty;
}
@media (max-width: 900px) {
  .ic4 { grid-template-columns: 1fr; gap: 26px; }
  .ic4-aside { position: static; }
}

/* ── Step 4 edit modal · fit within the console on tablet (was clipping at top) ── */
@media (max-width: 1024px) {
  .iw-edit { top: 12px; left: 12px; right: 12px; bottom: 12px; padding: 14px 16px; gap: 10px; overflow-y: auto; justify-content: flex-start; }
  .iw-edit-grid { overflow-x: auto; }
  .iw-eg-head, .iw-eg-row { min-width: 640px; }
  .iw-edit-title { font-size: 15px; }
  /* Gross-to-net + pay tables: keep columns intact and scroll horizontally instead of squeezing */
  .iw-pt-head, .iw-pt-row { min-width: 720px; }
  .iw-gt-head, .iw-gt-row { min-width: 900px; }
  .iw-gtn-table { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .iw-gtn-table .iw-gt-body { overflow-x: visible; overflow-y: visible; min-width: 900px; }
  .iw-paytable { scrollbar-width: thin; }
  /* Calendar: 3-col layout is 4 rows tall — let it scroll inside the frame instead of clipping */
  .iw-calgrid { overflow-y: auto; overflow-x: hidden; align-content: start; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
}
/* Phones & tablets (≤1024px): edit form scrolls horizontally as one aligned table — header and values stay paired */
@media (max-width: 1024px) {
  .iw-edit-grid { overflow-x: auto !important; -webkit-overflow-scrolling: touch; scrollbar-width: thin; padding-bottom: 4px; }
  .iw-eg-head, .iw-eg-row { min-width: 660px !important; max-width: none !important; grid-template-columns: 1.1fr 0.9fr 0.3fr 0.9fr 1fr 1.2fr 1.1fr 0.7fr 0.6fr !important; }
  .iw-eg-input { min-width: 0 !important; }
}
