/* ════════════════════════════════════════════════════════════════════
   Ideawall — front-end styles. Chrome only; the board itself is canvas.
   ════════════════════════════════════════════════════════════════════ */
:root {
  --iw-primary:   #373f92;   /* BrightSail navy — the working primary (buttons, links, active, focus, headings) */
  --iw-primary-2: #2c3376;   /* navy hover/active shade */
  --iw-accent:    #1eabab;   /* BrightSail teal — identity accent (Sighting/Pilot presence, fills, non-text marks) */
  --iw-wash:      rgba(55, 63, 146, .06);   /* hover / selected-row wash */
  /* Full brand ramp, for components that need a named hue: */
  --iw-b-navy: #373f92; --iw-b-teal: #1eabab; --iw-b-coral: #e9794a;
  --iw-b-orange: #f4a120; --iw-b-green: #56bd77; --iw-b-blue: #188ab5;
  --iw-b-yellow: #f3e519;
  --iw-ink: #1c2430;
  --iw-muted: #6b7686;
  --iw-line: #e7eae8;
  --iw-panel: #ffffff;
  --iw-rail: #ffffff;
  --iw-bg: #f3f5f4;
  --iw-shadow: 0 10px 30px rgba(20, 30, 40, .12);
  --iw-shadow-sm: 0 2px 10px rgba(20, 30, 40, .08);
  --iw-radius: 14px;
  --iw-topbar-h: 56px;
}

/* Smoothness — shared transitions across the chrome */
.iw-tool, .iw-btn, .iw-icon-btn, .iw-ctx-btn, .iw-zoom-controls,
.iw-sighting-card, .iw-board-card, .iw-tpl-chip, .iw-guide-chip {
  transition: background .16s ease, box-shadow .16s ease, transform .12s ease, border-color .16s ease, color .16s ease;
}

/* Onboarding empty-state */
.iw-onboard { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 5; }
.iw-onboard-card { text-align: center; background: rgba(255,255,255,.72); backdrop-filter: blur(3px); border: 1px solid var(--iw-line); border-radius: 18px; padding: 24px 34px; box-shadow: var(--iw-shadow-sm); animation: iw-rise .35s ease both; }
.iw-onboard-emoji { font-size: 30px; }
.iw-onboard-mark { width: 40px; height: 40px; object-fit: contain; display: block; margin: 0 auto 6px; }
.iw-onboard-card h2 { margin: 6px 0; color: var(--iw-ink); font-size: 20px; font-weight: 700; }
.iw-onboard-card p { margin: 3px 0; font-size: 14px; color: var(--iw-muted); }
.iw-onboard-card b { color: var(--iw-ink); }
.iw-onboard-sub { font-size: 12.5px; }
.iw-onboard-card kbd { background: #eef1f0; border: 1px solid var(--iw-line); border-radius: 5px; padding: 1px 6px; font-size: 11px; }
@keyframes iw-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.iw-app, .iw-app * { box-sizing: border-box; }
/* The `hidden` attribute must win over our display:flex/grid panels (otherwise a
   hidden properties/guide panel shows as an empty white strip). */
.iw-app [hidden] { display: none !important; }
.iw-app {
  position: relative; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--iw-ink); background: var(--iw-bg); overflow: hidden; user-select: none; -webkit-user-select: none;
}
.iw-fullscreen { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 9000; }
.iw-embed { width: 100%; height: 640px; border: 1px solid var(--iw-line); border-radius: var(--iw-radius); }

/* ── Top bar ─────────────────────────────────────────────────────── */
.iw-topbar {
  position: absolute; top: 0; left: 0; right: 0; height: var(--iw-topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 12px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--iw-line); z-index: 30;
}
.iw-topbar-left, .iw-topbar-right, .iw-topbar-center, .iw-facilitation { display: flex; align-items: center; gap: 8px; }
.iw-facilitation:empty { display: none; }   /* no gap when idle/no widgets */
.iw-title-wrap { display: flex; flex-direction: column; line-height: 1.1; }
.iw-board-title {
  border: none; background: transparent; font-size: 15px; font-weight: 600; color: var(--iw-ink);
  padding: 3px 6px; border-radius: 6px; width: 220px; max-width: 38vw;
}
.iw-board-title:hover { background: #f1f1f6; }
.iw-board-title:focus { outline: 2px solid var(--iw-primary); background: #fff; }
/* Mouse clicks shouldn't draw a focus box around the title, a button, or the canvas —
   only keyboard navigation does. Keeps clicking around the board visually quiet so the
   only thing that changes the layout is the ✦ Pilot control. */
.iw-app :focus:not(:focus-visible) { outline: none; }
.iw-save-state { font-size: 11px; color: var(--iw-muted); }
.iw-save-saving { color: #b9770b; } .iw-save-offline { color: #c0392b; } .iw-save-saved { color: #2e7d32; }

/* Site brand (→ back to site) + board meta in the top bar */
.iw-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--iw-ink); padding: 3px 6px; border-radius: 9px; }
.iw-brand:hover { background: #eef2f1; }
.iw-brand-logo, .iw-brand .custom-logo { height: 26px; width: auto; max-width: 130px; display: block; border-radius: 5px; }
.iw-brand-name { font-weight: 800; font-size: 14px; white-space: nowrap; max-width: 170px; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; color: var(--iw-primary); }
.iw-brand-mark { color: var(--iw-primary); font-size: 17px; }
.iw-brand-sep { width: 1px; height: 22px; background: var(--iw-line); margin: 0 2px; flex: none; }
.iw-board-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--iw-muted); padding-left: 6px; }
.iw-updated { white-space: nowrap; }

.iw-btn {
  border: 1px solid var(--iw-line); background: #fff; color: var(--iw-ink); font-size: 13px; font-weight: 600;
  padding: 7px 12px; border-radius: 9px; cursor: pointer; transition: .12s; white-space: nowrap;
}
.iw-btn:hover { border-color: #c9c9da; box-shadow: var(--iw-shadow-sm); }
.iw-btn-primary { background: var(--iw-primary); border-color: var(--iw-primary); color: #fff; }
.iw-btn-primary:hover { background: var(--iw-primary-2); }
.iw-icon-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: transparent; border-radius: 8px; cursor: pointer; font-size: 16px; color: var(--iw-ink);
}
.iw-icon-btn:hover { background: #f1f1f6; }
.iw-zoom-controls { display: flex; align-items: center; gap: 2px; border: 1px solid var(--iw-line); border-radius: 9px; padding: 2px; }
.iw-zoom-label { font-size: 12px; min-width: 42px; text-align: center; color: var(--iw-muted); }

/* ── Tool rail ───────────────────────────────────────────────────── */
.iw-toolrail {
  position: absolute; left: 12px; top: calc(var(--iw-topbar-h) + 16px); z-index: 25;
  display: flex; flex-direction: column; gap: 4px; padding: 6px;
  background: var(--iw-rail); border: 1px solid var(--iw-line); border-radius: 14px; box-shadow: var(--iw-shadow);
  transition: opacity .26s ease, transform .26s ease;
}
/* Slid away by the ✦ Pilot control's clean-board toggle (kept in DOM, just hidden). */
.iw-toolrail.iw-out { opacity: 0; transform: translateX(-118%); pointer-events: none; }
.iw-tool {
  position: relative; width: 42px; height: 42px; border: none; background: transparent; border-radius: 10px;
  cursor: pointer; font-size: 19px; display: flex; align-items: center; justify-content: center; color: #3a3a48;
}
.iw-tool:hover { background: #eef2f1; }
.iw-tool.iw-active { background: var(--iw-primary); color: #fff; box-shadow: 0 3px 10px rgba(55, 63, 146, .35); }
/* Pinned (kept-on) tool: a small corner dot says it stays armed for repeat placement. */
.iw-tool.iw-pinned::after {
  content: ""; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%;
  background: #ffd166; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85);
}
.iw-tool:active { transform: scale(.92); }
.iw-tool .iw-tool-tip {
  position: absolute; left: 52px; top: 50%; transform: translateY(-50%); background: #20232e; color: #fff;
  font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: .12s;
}
.iw-tool:hover .iw-tool-tip { opacity: 1; }
.iw-tool-sep { height: 1px; background: var(--iw-line); margin: 4px 6px; }
.iw-tool-flyout {
  position: absolute; left: 52px; top: 0; background: #fff; border: 1px solid var(--iw-line); border-radius: 12px;
  box-shadow: var(--iw-shadow); padding: 8px; display: none; z-index: 40;
}
.iw-tool-flyout.iw-open { display: flex; flex-wrap: wrap; gap: 6px; width: 168px; }
.iw-swatch { width: 26px; height: 26px; border-radius: 7px; cursor: pointer; border: 2px solid transparent; }
.iw-swatch.iw-active { border-color: var(--iw-ink); }

/* ── Stage ───────────────────────────────────────────────────────── */
.iw-stage-host {
  position: absolute; inset: 0; top: var(--iw-topbar-h); outline: none;
  /* Confine the Konva <canvas> to its own low, isolated stacking context so its child layers
     (z-index:1 below) can't compete with the chrome (rail z:25, dock z:27). This is stacking
     hygiene — NOT the fix for the "bars vanish on board click" bug; that was caused by the board
     grabbing keyboard focus (a tabindex that's since been removed — see render.php / iw-core). */
  z-index: 1; isolation: isolate;
  /* Own every touch gesture on the board (pinch / pan / momentum are handled in JS); scoped
     strictly to the canvas so the toolbar, Pilot panel and page chrome still scroll normally. */
  touch-action: none; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.iw-embed .iw-stage-host { top: var(--iw-topbar-h); }
/* Ocean: a subtle "deep water" wash behind the board — surface light up top, gently deepening
   below. Static (doesn't move with pan) so it reads as depth, not texture. Kept very low-alpha.
   The Konva canvas (any direct child that isn't the water) sits above it. */
.iw-water {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(150% 115% at 50% -25%, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 46%),
    linear-gradient(180deg, rgba(74, 132, 150, .04) 0%, rgba(28, 66, 88, .07) 100%);
}
.iw-stage-host > div:not(.iw-water) { position: relative; z-index: 1; }

/* ── Context toolbar ─────────────────────────────────────────────── */
.iw-context-toolbar {
  position: absolute; z-index: 28; display: flex; gap: 2px; padding: 4px;
  background: #fff; border: 1px solid var(--iw-line); border-radius: 10px; box-shadow: var(--iw-shadow);
  opacity: 0; transform: translateY(6px) scale(.98); pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.iw-context-toolbar.iw-show { opacity: 1; transform: none; pointer-events: auto; }
.iw-ctx-btn {
  min-width: 30px; height: 30px; border: none; background: transparent; border-radius: 7px; cursor: pointer;
  font-size: 14px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; color: #2a2a36;
}
.iw-ctx-btn:hover { background: #f1f1f6; }
.iw-ctx-btn.iw-active { background: var(--iw-primary); color: #fff; }
.iw-ctx-sep { width: 1px; background: var(--iw-line); margin: 2px 3px; }
.iw-ctx-swatch { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(0, 0, 0, .15); }

/* ── In-place text editor ────────────────────────────────────────── */
.iw-text-edit {
  position: absolute; z-index: 50; border: none; outline: 2px solid var(--iw-primary); border-radius: 6px;
  /* No padding: the editor is positioned at the text node's exact origin, so any padding would
     shift the glyphs off the displayed text. The outline gives the visual affordance. */
  background: rgba(255, 255, 255, .96); resize: none; padding: 0; font-family: inherit; overflow: hidden;
}

/* ── Right panel ─────────────────────────────────────────────────── */
.iw-panel {
  position: absolute; right: 0; top: var(--iw-topbar-h); bottom: 0; width: 320px; z-index: 26;
  background: var(--iw-panel); border-left: 1px solid var(--iw-line); box-shadow: -4px 0 18px rgba(0, 0, 0, .05);
  display: flex; flex-direction: column; overflow: hidden;
}
.iw-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--iw-line); font-weight: 700; }
.iw-panel-body { flex: 1; overflow-y: auto; padding: 12px 14px; }
.iw-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 13px; }
.iw-field > span { color: var(--iw-muted); font-weight: 600; }
.iw-field input, .iw-field select, .iw-field textarea { padding: 8px; border: 1px solid var(--iw-line); border-radius: 8px; font: inherit; }

/* ── Presence ────────────────────────────────────────────────────── */
.iw-presence-stack { display: flex; align-items: center; }
.iw-avatar {
  width: 30px; height: 30px; border-radius: 50%; margin-left: -8px; border: 2px solid #fff; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--iw-primary);
}
.iw-cursor-flag { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 0 8px 8px 8px; color: #fff; white-space: nowrap; }

/* ── Minimap ─────────────────────────────────────────────────────── */
.iw-minimap {
  position: absolute; right: 14px; bottom: 14px; width: 200px; height: 140px; z-index: 24;
  background: rgba(255, 255, 255, .9); border: 1px solid var(--iw-line); border-radius: 10px; box-shadow: var(--iw-shadow-sm);
  overflow: hidden; cursor: pointer;
}
.iw-minimap.iw-hidden { display: none; }

/* ── Facilitation chips (timer/vote) ─────────────────────────────── */
.iw-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--iw-line); box-shadow: var(--iw-shadow-sm); font-weight: 700; font-size: 13px;
}
.iw-chip.iw-danger { background: #fdecea; border-color: #f5c6c0; color: #c0392b; }
.iw-chip.iw-timer-urgent { background: #FAE2D7; border-color: #e9794a; color: #1c2430; }   /* < 1 min — BrightSail coral, ink text */
.iw-chip .iw-chip-btn { border: none; background: transparent; cursor: pointer; font-weight: 700; }
/* The timer host lays its controls + countdown in a row (so the chip doesn't wrap below). */
.iw-timer { display: inline-flex; align-items: center; gap: 8px; }
.iw-timer-time { font-variant-numeric: tabular-nums; }

/* ── Modals ──────────────────────────────────────────────────────── */
.iw-modal-backdrop { position: fixed; inset: 0; background: rgba(15, 18, 30, .45); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.iw-modal { width: 460px; max-width: 92vw; max-height: 86vh; background: #fff; border-radius: 16px; box-shadow: var(--iw-shadow); display: flex; flex-direction: column; overflow: hidden; }
.iw-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--iw-line); }
.iw-modal-head h3 { margin: 0; font-size: 17px; }
.iw-modal-x { border: none; background: transparent; font-size: 22px; cursor: pointer; color: var(--iw-muted); line-height: 1; }
.iw-modal-body { padding: 18px; overflow-y: auto; }
.iw-modal-foot { padding: 12px 18px; border-top: 1px solid var(--iw-line); display: flex; justify-content: flex-end; gap: 8px; }

/* ── Toasts ──────────────────────────────────────────────────────── */
.iw-toasts { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 9998; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.iw-toast { background: #20232e; color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 13px; opacity: 0; transform: translateY(8px); transition: .25s; box-shadow: var(--iw-shadow); }
.iw-toast.iw-show { opacity: 1; transform: translateY(0); }
.iw-toast-error { background: #c0392b; } .iw-toast-success { background: #2e7d32; }

/* ── Loading veil ────────────────────────────────────────────────── */
.iw-loading { position: absolute; inset: 0; top: var(--iw-topbar-h); background: var(--iw-bg); z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--iw-muted); }
.iw-spinner { width: 34px; height: 34px; border: 3px solid #d9d9e6; border-top-color: var(--iw-primary); border-radius: 50%; animation: iw-spin .8s linear infinite; }
@keyframes iw-spin { to { transform: rotate(360deg); } }
.iw-error { color: #c0392b; font-weight: 600; }

/* ── Shortcuts ───────────────────────────────────────────────────── */
.iw-shortcuts { display: flex; flex-direction: column; gap: 8px; }
.iw-sc-row { display: flex; justify-content: space-between; align-items: center; }
.iw-sc-row kbd { background: #f1f1f6; border: 1px solid var(--iw-line); border-radius: 6px; padding: 2px 8px; font-size: 12px; }

/* ── Gate (no access) ────────────────────────────────────────────── */
.iw-gate { display: flex; align-items: center; justify-content: center; min-height: 70vh; }
.iw-gate-card { text-align: center; background: #fff; padding: 36px 40px; border-radius: 16px; box-shadow: var(--iw-shadow); }

/* ── Launcher / gallery ──────────────────────────────────────────── */
.iw-launcher { max-width: 1080px; margin: 0 auto; padding: 40px 24px 90px; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--iw-ink); }
/* Hero as a contained banner so it reads as one designed unit, not a loose row. */
.iw-launcher-head { display: flex; align-items: center; gap: 22px; margin-bottom: 40px; padding: 24px 28px; background: #fff; border: 1px solid var(--iw-line); border-radius: 18px; box-shadow: 0 1px 3px rgba(16, 24, 64, .05); }
.iw-launcher-logo { width: 120px; max-width: 34vw; height: auto; display: block; flex: 0 0 auto; }
.iw-launcher-title { flex: 1; min-width: 0; }
.iw-launcher-head h1 { margin: 0; font-size: 30px; line-height: 1.05; color: var(--iw-primary); font-weight: 800; letter-spacing: -.01em; }
.iw-launcher-title p { margin: 6px 0 0; font-size: 14px; color: var(--iw-muted); }
.iw-launcher-head .iw-btn { flex: 0 0 auto; align-self: center; }
/* Uppercase section labels give the page a clear, structured rhythm. */
.iw-launcher .iw-sec-h { font: 700 12.5px/1.2 inherit; letter-spacing: .06em; text-transform: uppercase; color: var(--iw-muted); margin: 0 0 16px; }
@media (max-width: 560px) { .iw-launcher-head { flex-wrap: wrap; text-align: center; justify-content: center; } .iw-launcher-title { flex-basis: 100%; text-align: center; } }
.iw-empty-mark { width: 48px; height: 48px; object-fit: contain; display: block; margin: 0 auto 10px; opacity: .92; }
.iw-embed-credit { position: absolute; right: 10px; bottom: 8px; z-index: 20; display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255, 255, 255, .88); border: 1px solid var(--iw-line); border-radius: 999px; padding: 3px 9px 3px 5px; font-size: 11px; color: var(--iw-muted); }
.iw-embed-credit img { width: 14px; height: 14px; object-fit: contain; }
.iw-muted { color: var(--iw-muted); }
.iw-board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin: 0 0 44px; }
.iw-board-card { display: block; text-decoration: none; color: inherit; border: 1px solid var(--iw-line); border-radius: 14px; overflow: hidden; background: #fff; transition: .15s; }
.iw-board-card:hover { box-shadow: var(--iw-shadow); transform: translateY(-2px); }
.iw-board-thumb { height: 130px; background: linear-gradient(135deg, #eef0ff, #f7f0ff); display: flex; align-items: center; justify-content: center; color: var(--iw-muted); font-weight: 600; }
.iw-board-thumb img { width: 100%; height: 100%; object-fit: cover; }
.iw-board-name { font-weight: 700; padding: 10px 12px 2px; }
.iw-board-sub { padding: 0 12px 12px; color: var(--iw-muted); font-size: 12px; }
/* Board manage menu (picker tiles) + Active/Archived tabs (v1.46) */
.iw-board-tabs { display: flex; gap: 6px; margin: 0 0 16px; }
.iw-board-tabs button { border: 1px solid var(--iw-line); background: #fff; color: var(--iw-muted); border-radius: 999px; padding: 5px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.iw-board-tabs button.iw-active { background: var(--iw-primary); color: #fff; border-color: var(--iw-primary); }
.iw-board-tile { position: relative; }
.iw-board-tile.iw-board-archived .iw-board-card { opacity: .72; }
.iw-board-menu-wrap { position: absolute; top: 8px; right: 8px; z-index: 6; }
.iw-board-menu-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--iw-line); background: rgba(255,255,255,.92); color: #1f2330; font-size: 18px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--iw-shadow-sm); }
.iw-board-menu-btn:hover { background: #fff; }
.iw-board-menu { position: absolute; top: 34px; right: 0; min-width: 148px; background: #fff; border: 1px solid var(--iw-line); border-radius: 10px; box-shadow: var(--iw-shadow); padding: 4px; }
.iw-board-menu[hidden] { display: none; }
.iw-board-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px; font: inherit; font-size: 13px; color: inherit; cursor: pointer; }
.iw-board-menu button:hover { background: var(--iw-wash); }
.iw-board-menu button.iw-danger { color: #b32d2e; }
.iw-board-menu button.iw-danger:hover { background: #fbeaea; }
.iw-skeleton { height: 174px; border-radius: 14px; background: linear-gradient(90deg, #eee, #f6f6f9, #eee); background-size: 200% 100%; animation: iw-shine 1.3s infinite; }
@keyframes iw-shine { to { background-position: -200% 0; } }
.iw-empty { grid-column: 1 / -1; text-align: center; color: var(--iw-muted); padding: 40px; }
.iw-template-strip h3 { margin: 0 0 12px; }
.iw-template-row { display: flex; gap: 10px; flex-wrap: wrap; }
.iw-tpl-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; border: 1px solid var(--iw-line); background: #fff; border-radius: 10px; cursor: pointer; }
.iw-tpl-chip:hover { border-color: var(--iw-primary); }
.iw-tpl-chip strong { font-size: 13px; } .iw-tpl-chip span { font-size: 11px; color: var(--iw-muted); }

/* ── Template picker grid ────────────────────────────────────────── */
/* Template picker — an image-forward gallery: thumbnails of the actual cards, many at a glance,
   with the full description on hover instead of a dense text block. */
.iw-modal.iw-tpl-modal { width: 940px; }
.iw-tpl-scroll { max-height: 72vh; }
.iw-tpl-section { margin: 16px 2px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--iw-muted); font-weight: 700; }
.iw-tpl-section:first-child { margin-top: 0; }
.iw-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.iw-tpl-card { display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 1px solid var(--iw-line); border-radius: 12px; background: #fff; cursor: pointer; text-align: left; font: inherit; transition: box-shadow .12s, border-color .12s, transform .12s; }
.iw-tpl-card:hover:not(:disabled) { border-color: var(--iw-primary); box-shadow: 0 6px 18px rgba(0, 0, 0, .09); transform: translateY(-2px); }
.iw-tpl-card:disabled { opacity: .55; cursor: default; }
.iw-tpl-thumb { display: block; aspect-ratio: 3 / 2; border-radius: 7px; overflow: hidden; background: #faf7f0; border: 1px solid var(--iw-line); }
.iw-tpl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.iw-tpl-thumb-none { display: flex; align-items: center; justify-content: center; color: var(--iw-primary); font-weight: 800; font-size: 26px; text-transform: uppercase; }
.iw-tpl-name { font-size: 13px; font-weight: 600; color: var(--iw-ink); line-height: 1.3; }
.iw-tpl-count { display: inline-block; margin-left: 5px; font-size: 11px; color: var(--iw-muted); font-weight: 500; }
.iw-tpl-tip { position: fixed; z-index: 10001; max-width: 260px; background: #23262e; color: #fff; padding: 9px 11px; border-radius: 9px; font-size: 12px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0, 0, 0, .24); pointer-events: none; }
.iw-tpl-tip strong { display: block; font-size: 12.5px; margin-bottom: 3px; color: #fff; }
.iw-tpl-tip span { color: #cdd2da; }

/* ── Comments ────────────────────────────────────────────────────── */
.iw-comment { border-bottom: 1px solid var(--iw-line); padding: 10px 0; }
.iw-comment-author { font-weight: 700; font-size: 13px; }
.iw-comment-time { color: var(--iw-muted); font-size: 11px; margin-left: 6px; }
.iw-comment-body { font-size: 13px; margin: 4px 0; white-space: pre-wrap; }
.iw-comment-actions { display: flex; gap: 10px; font-size: 12px; }
.iw-comment-actions button { border: none; background: transparent; color: var(--iw-primary); cursor: pointer; padding: 0; }
.iw-comment-pin { position: absolute; z-index: 22; transform: translate(-50%, -100%); }

/* ── Sextant: the Pilot dock ─────────────────────────────────────── */
.iw-guide {
  position: absolute; right: 0; top: var(--iw-topbar-h); bottom: 0; width: 372px; max-width: 92vw;
  z-index: 27; display: flex; flex-direction: column;
  background: #fff; border-left: 1px solid var(--iw-line); box-shadow: -10px 0 34px rgba(20, 30, 40, .08); overflow: hidden;
  animation: iw-slidein .28s ease both;
  transition: transform .26s ease, opacity .26s ease;
}
.iw-guide.iw-out { transform: translateX(105%); opacity: 0; } /* contract to the side on collapse */
@keyframes iw-slidein { from { transform: translateX(18px); opacity: .3; } to { transform: none; opacity: 1; } }
.iw-guide-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--iw-line);
  background: linear-gradient(180deg, rgba(55,63,146,.07), rgba(55,63,146,0)); }
.iw-guide-head strong { font-size: 15px; }
.iw-guide-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--iw-accent); box-shadow: 0 0 0 3px rgba(55, 63, 146, .15); }
.iw-guide-stage { margin-left: auto; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--iw-muted); }

/* Readiness instrument — stage dots + a horizon bar under the current dot (guided Sightings only). */
.iw-stage-strip { display: inline-flex; align-items: center; gap: 7px; text-transform: none; letter-spacing: 0; }
.iw-stage-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; box-sizing: border-box; border: 1.5px solid var(--iw-muted); background: transparent; }
.iw-stage-done { background: var(--iw-muted); border-color: var(--iw-muted); opacity: .75; }
.iw-stage-cur { border-color: var(--iw-accent); }
.iw-stage-ready { box-shadow: 0 0 0 3px rgba(55, 63, 146, .18); }
.iw-stage-bar { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 16px; height: 2px; border-radius: 2px; background: var(--iw-line); overflow: hidden; }
.iw-stage-bar-fill { display: block; height: 100%; width: 42%; background: var(--iw-muted); transition: width .35s ease, background .35s ease; }
.iw-stage-bar-full .iw-stage-bar-fill { width: 100%; background: var(--iw-accent); }
.iw-stage-bar-still .iw-stage-bar-fill { transition: none; }   /* reduced-motion: no fill animation */

/* The Lookout lamp in the dock head — amber, idle→dim, spoken→ringed, pulses once when it speaks. */
.iw-guide-lamp { border: none; background: transparent; cursor: pointer; margin-left: 2px; padding: 0;
  width: 14px; height: 14px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; line-height: 1; color: #d9a441; opacity: .5; transition: opacity .2s ease, box-shadow .2s ease; }
.iw-guide-lamp[hidden] { display: none; }
.iw-guide-lamp:hover:not(:disabled) { opacity: .9; }
.iw-guide-lamp:disabled { cursor: default; }
.iw-lamp-spoken { opacity: 1; box-shadow: 0 0 0 2px rgba(216, 164, 65, .5); }
.iw-lamp-pulse { animation: iw-lamp-pulse .9s ease; }
@keyframes iw-lamp-pulse { 0% { transform: scale(1); } 30% { transform: scale(1.5); } 100% { transform: scale(1); } }
.iw-guide-min { border: none; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; color: var(--iw-muted); padding: 0 4px; }
.iw-guide-body { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.iw-guide-msg { font-size: 13.5px; line-height: 1.4; padding: 9px 12px; border-radius: 12px; max-width: 90%; white-space: normal; }
.iw-guide-pilot { background: #eef5f4; color: #1f2a29; align-self: flex-start; border-bottom-left-radius: 4px; }
.iw-guide-user { background: var(--iw-primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
/* The Lookout — a rare amber second voice that guards the human core. */
.iw-guide-lookout { background: #fbeee2; color: #5a4326; align-self: flex-start; border-bottom-left-radius: 4px; border-left: 3px solid #c6792f; }
.iw-guide-lookout b { color: #a85a16; }
/* Idle presence — a quiet, transient nudge (no API). Reads as a soft aside, not a message. */
.iw-guide-idle { background: transparent; color: var(--iw-muted); font-style: italic; font-size: 12.5px; padding: 2px 6px; align-self: flex-start; }
/* A quiet aside (e.g. "the deck is spent") — muted, not a full Pilot bubble. */
.iw-guide-aside { background: transparent; color: var(--iw-muted); font-style: italic; font-size: 12px; padding: 2px 6px; align-self: flex-start; }
.iw-guide-typing { display: inline-flex; gap: 4px; }
.iw-guide-typing span { width: 6px; height: 6px; border-radius: 50%; background: #9bb6b3; animation: iw-blink 1.2s infinite; }
.iw-guide-typing span:nth-child(2) { animation-delay: .2s; } .iw-guide-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes iw-blink { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.iw-guide-status { padding: 0 14px; font-size: 12px; color: var(--iw-muted); }
.iw-guide-status.iw-ok { color: #2e7d32; }
/* Batched-reaction affordance: one hidden, low-effort turn ("How's this looking?"). */
.iw-guide-actions { padding: 4px 12px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.iw-guide-peek { border: 1px solid var(--iw-line); background: #fff; color: var(--iw-primary); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.iw-guide-peek:hover { background: var(--iw-wash); }

/* ── Raise to the Pilot ────────────────────────────────────────────────── */
.iw-raise-input { width: 100%; box-sizing: border-box; resize: vertical; border: 1px solid var(--iw-line);
  border-radius: 10px; padding: 10px; font: inherit; font-size: 14px; }
.iw-raise-tray { border-top: 1px solid var(--iw-line); background: #fbfdfc; }
.iw-raise-head { width: 100%; text-align: left; border: none; background: transparent; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 700; color: var(--iw-primary); padding: 8px 14px; }
.iw-raise-rows { max-height: 132px; overflow-y: auto; padding: 0 10px 8px; }
.iw-raise-row { display: flex; align-items: flex-start; gap: 8px; padding: 7px 4px; border-top: 1px dashed var(--iw-line); }
.iw-raise-text { flex: 1; font-size: 12.5px; line-height: 1.35; color: var(--iw-ink); }
.iw-raise-acts { display: flex; gap: 4px; flex-shrink: 0; }
.iw-raise-a { border: 1px solid var(--iw-line); background: #fff; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--iw-ink); padding: 3px 8px; }
.iw-raise-a:hover { background: var(--iw-wash); }
.iw-raise-send { color: #fff; background: var(--iw-primary); border-color: var(--iw-primary); }
.iw-raise-send:hover { background: var(--iw-primary); filter: brightness(1.06); }

/* Push-to-talk mic (optional voice input), beside Send. */
.iw-guide-mic { border: 1px solid var(--iw-line); background: #fff; border-radius: 10px; cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0 10px; flex: 0 0 auto; }
.iw-guide-mic[hidden] { display: none; }
.iw-guide-mic:hover { background: var(--iw-wash); }
.iw-guide-mic.iw-mic-on { background: #fdecec; border-color: #e0736b; color: #c0392b; animation: iw-mic-pulse 1s ease infinite; }
@keyframes iw-mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(224, 115, 107, .45); } 50% { box-shadow: 0 0 0 5px rgba(224, 115, 107, 0); } }

/* ── On the Bridge — realtime voice Pilot ──────────────────────────────────
   Toggle sits in the guide action row (driver only); the pill mirrors the live
   flag to the whole room; voice turns wear a small mic glyph in the thread. */
.iw-bridge-toggle { border: 1px solid var(--iw-line); background: #fff; color: var(--iw-primary);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.iw-bridge-toggle:hover { background: var(--iw-wash); }
.iw-bridge-toggle:disabled { opacity: .6; cursor: default; }
.iw-bridge-toggle.is-live { background: var(--iw-primary); border-color: var(--iw-primary); color: #fff; animation: iw-mic-pulse 1.6s ease infinite; }
.iw-bridge-toggle.is-speaking { background: var(--iw-primary-2); }

.iw-bridge-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--iw-line);
  background: #eef5f4; color: var(--iw-primary); border-radius: 999px; padding: 4px 10px;
  font-size: 12px; font-weight: 700; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.iw-bridge-pill[hidden] { display: none; }
.iw-bridge-pill-float { position: fixed; top: 64px; right: 12px; z-index: 60; box-shadow: var(--iw-shadow-sm); }
.iw-bridge-pip { width: 8px; height: 8px; border-radius: 50%; background: #1eabab; flex: 0 0 auto; animation: iw-bridge-pulse 1.4s ease infinite; }
@keyframes iw-bridge-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(30, 171, 171, .5); } 50% { box-shadow: 0 0 0 5px rgba(30, 171, 171, 0); } }

/* A spoken turn folded into the dock thread — a small mic glyph so it reads as dictation. */
.iw-guide-voice .iw-guide-vglyph { opacity: .7; font-size: 12px; }
.iw-guide-user.iw-guide-voice .iw-guide-vglyph { opacity: .85; }

/* Tap-to-start chips under the greeting on a fresh plain board. */
.iw-guide-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 2px; }
.iw-guide-chip-btn { border: 1px solid var(--iw-primary); background: #fff; color: var(--iw-primary);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.iw-guide-chip-btn:hover { background: var(--iw-wash); }

/* "Start the next Sighting" — on a pack-bound board card in the launcher. */
.iw-next-sighting { display: block; width: 100%; margin-top: 8px; border: 1px solid var(--iw-line); background: #fff;
  color: var(--iw-primary); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; text-align: center; }
.iw-next-sighting:hover { background: var(--iw-wash); }

/* ── Sextant: the Readout — end-of-session deliverable ─────────────────── */
/* Reuses the peek pill shape but reads as the primary end-of-session CTA. */
button.iw-guide-readout { color: #fff; background: var(--iw-primary); border-color: var(--iw-primary); }
button.iw-guide-readout:hover { background: var(--iw-primary); filter: brightness(1.06); }
button.iw-guide-readout:disabled { opacity: .6; cursor: default; }

/* Drafting overlay — over the dock while Opus writes; the board stays fully usable. */
.iw-readout-drafting { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px;
  background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); color: var(--iw-ink); }
.iw-readout-drafting small { color: var(--iw-muted); max-width: 230px; line-height: 1.4; }
.iw-readout-spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--iw-line);
  border-top-color: var(--iw-primary); animation: iw-readout-spin .8s linear infinite; }
@keyframes iw-readout-spin { to { transform: rotate(360deg); } }

/* The readout modal + document typography. */
.iw-readout-modal { width: 640px; }
.iw-readout-when { margin: 0 0 12px; font-size: 12px; color: var(--iw-muted); }
.iw-readout-doc { font-size: 14px; line-height: 1.5; color: var(--iw-ink); }
.iw-readout-doc h1 { font-size: 20px; margin: 4px 0 8px; }
.iw-readout-doc h2 { font-size: 16px; margin: 18px 0 6px; }
.iw-readout-doc h3, .iw-readout-doc h4 { font-size: 14px; margin: 14px 0 4px; }
.iw-readout-doc p { margin: 0 0 10px; }
.iw-readout-doc ul, .iw-readout-doc ol { margin: 0 0 10px; padding-left: 22px; }
.iw-readout-doc li { margin: 3px 0; }
.iw-readout-doc hr { border: none; border-top: 1px solid var(--iw-line); margin: 14px 0; }
.iw-readout-plain { white-space: pre-wrap; word-wrap: break-word; font: inherit; margin: 0; }
/* Fillable "Owner: ____" blanks — a subtle inline field. */
.iw-fill { display: inline-block; min-width: 90px; border-bottom: 1.5px solid var(--iw-primary);
  padding: 0 4px; margin: 0 2px; line-height: 1.3; color: var(--iw-primary); font-weight: 600; outline: none; }
.iw-fill:focus { background: var(--iw-wash); }
.iw-fill[contenteditable="false"] { border-bottom-style: dotted; color: var(--iw-muted); font-weight: 400; min-width: 60px; }
/* BrightSail: navy headings + the mark in the readout modal header. */
.iw-readout-doc h1, .iw-readout-doc h2, .iw-readout-doc h3, .iw-readout-doc h4 { color: var(--iw-primary); }
.iw-readout-when strong { color: var(--iw-ink); }
.iw-readout-modal .iw-modal-head { display: flex; align-items: center; gap: 8px; }
.iw-readout-mark { width: 24px; height: 24px; object-fit: contain; flex: 0 0 auto; }

/* The Report ▾ menu (v1.50) — dock dropdown + archive list. */
.iw-reports-wrap { position: relative; display: inline-block; }
.iw-reports-menu { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 40; min-width: 232px; max-width: 300px;
  background: #fff; border: 1px solid var(--iw-line); border-radius: 12px; box-shadow: 0 12px 34px rgba(15,20,40,.18); padding: 6px; }
.iw-reports-item { display: block; width: 100%; text-align: left; border: none; background: none; color: var(--iw-ink);
  font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.iw-reports-item:hover { background: var(--iw-wash); }
.iw-reports-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--iw-muted);
  padding: 8px 10px 4px; margin-top: 4px; border-top: 1px solid var(--iw-line); }
.iw-reports-list { max-height: 240px; overflow-y: auto; }
.iw-reports-empty { font-size: 12.5px; color: var(--iw-muted); padding: 6px 10px; }
.iw-reports-row { display: flex; align-items: stretch; gap: 4px; }
.iw-reports-open { flex: 1 1 auto; min-width: 0; text-align: left; border: none; background: none; color: var(--iw-ink);
  font: inherit; font-size: 12.5px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.iw-reports-open:hover { background: var(--iw-wash); }
.iw-reports-kind { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--iw-primary); font-weight: 700; }
.iw-reports-date { display: block; font-size: 11px; color: var(--iw-muted); margin-top: 1px; }
.iw-reports-dl { flex: 0 0 auto; align-self: center; border: 1px solid var(--iw-line); background: #fff; color: var(--iw-primary);
  font: inherit; font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 999px; cursor: pointer; }
.iw-reports-dl:hover { background: var(--iw-wash); }
/* The read-only report modal reuses the readout document typography. */
.iw-report-modal { width: 680px; }
.iw-report-doc { font-size: 14px; line-height: 1.55; color: var(--iw-ink); max-height: 62vh; overflow-y: auto; }
.iw-report-doc h1 { font-size: 20px; margin: 4px 0 10px; color: var(--iw-primary); }
.iw-report-doc h2 { font-size: 16px; margin: 18px 0 6px; color: var(--iw-primary); }
.iw-report-doc p { margin: 0 0 10px; }
.iw-report-doc ul { margin: 0 0 10px; padding-left: 22px; }
.iw-report-doc li { margin: 3px 0; }
.iw-report-table { border-collapse: collapse; margin: 4px 0 12px; width: 100%; font-size: 13px; }
.iw-report-table th, .iw-report-table td { border: 1px solid var(--iw-line); padding: 5px 8px; text-align: left; vertical-align: top; }
.iw-report-table th { background: var(--iw-wash); font-weight: 700; }
.iw-guide-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--iw-line); align-items: flex-end; }
.iw-guide-input textarea { flex: 1; resize: none; border: 1px solid var(--iw-line); border-radius: 10px; padding: 8px; font: inherit; font-size: 13px; }
.iw-guide-chip {
  position: absolute; right: 0; top: calc(var(--iw-topbar-h) + 18px); z-index: 26; display: none; align-items: center; gap: 7px;
  padding: 11px 15px; border-radius: 12px 0 0 12px; border: 1px solid var(--iw-line); border-right: none;
  background: #fff; box-shadow: -6px 4px 18px rgba(20, 30, 40, .12);
  font-weight: 700; font-size: 13px; color: var(--iw-primary); cursor: pointer;
}
.iw-guide-chip:hover { padding-right: 19px; }

/* Persistent Pilot on/off toggle in the top bar (active = panel open). */
.iw-guide-toggle.iw-active { background: var(--iw-primary); border-color: var(--iw-primary); color: #fff; }
.iw-guide-toggle.iw-active:hover { background: var(--iw-primary); box-shadow: var(--iw-shadow-sm); }

/* ── Sightings gallery (launcher) ────────────────────────────────── */
.iw-sightings { margin: 0 0 44px; }
.iw-sightings h3 { margin: 0 0 16px; }
.iw-sighting-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.iw-sighting-card { text-align: left; border: 1px solid var(--iw-line); border-radius: 14px; padding: 18px; cursor: pointer; background: #fff; transition: .15s; border-top: 4px solid var(--iw-primary); }
.iw-sighting-card:hover { box-shadow: var(--iw-shadow); transform: translateY(-2px); }
.iw-sighting-card h4 { margin: 0 0 4px; font-size: 15px; }
.iw-sighting-card p { margin: 0 0 8px; font-size: 12.5px; color: var(--iw-muted); }
.iw-sighting-card .iw-sighting-go { font-size: 12px; font-weight: 700; color: var(--iw-primary); }

/* ── Pilot on narrow screens: bottom sheet, not a side panel ─────── */
@media (max-width: 820px) {
  .iw-guide { right: 0; left: 0; top: auto; bottom: 0; width: 100%; max-width: 100%; height: 55vh;
    border-left: none; border-top: 1px solid var(--iw-line); box-shadow: 0 -10px 30px rgba(20, 30, 40, .1); }
  .iw-guide-chip { right: 16px; top: auto; bottom: 16px; border-radius: 999px; border: 1px solid var(--iw-line); }
}

/* ── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .iw-topbar-center { display: none; }
  .iw-board-title { width: 120px; }
  .iw-btn { padding: 7px 9px; }
  .iw-panel { width: 100%; }
  .iw-minimap { display: none; }
}

/* ── Reduced motion ──────────────────────────────────────────────────
   The JS animators (spring camera, pop-in, momentum, snap-settle, ghost fade) each check
   IW.motionOK and snap instantly when motion is off. Here we calm the looping CSS effects
   and shorten transitions so the chrome matches. The loader keeps a slow spin so progress
   is still legible. */
@media (prefers-reduced-motion: reduce) {
  .iw-tool, .iw-btn, .iw-icon-btn, .iw-ctx-btn, .iw-zoom-controls,
  .iw-sighting-card, .iw-board-card, .iw-tpl-chip, .iw-guide-chip,
  .iw-context-toolbar, .iw-guide, .iw-toast { transition-duration: .001ms !important; }
  .iw-guide { animation: none !important; }
  .iw-guide-typing span { animation: none !important; opacity: .55; }
  .iw-onboard-card { animation: none !important; }
  .iw-spinner { animation-duration: 1.4s; }
  .iw-bd-dot { animation: none !important; }
}

/* ── The Boarding Pass — driver console + QR takeover (Plan v1.25 M1) ── */
.iw-boarding-btn { position: relative; }
.iw-boarding-btn.iw-boarding-live::after {
  content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px;
  border-radius: 50%; background: #1eabab; box-shadow: 0 0 0 2px #fff;
}
.iw-boarding-modal .iw-modal-body { padding-top: 6px; }
.iw-boarding-panel { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.iw-bd-lead { margin: 4px 0 2px; opacity: .75; max-width: 30em; }
.iw-bd-wide { width: 100%; }
.iw-bd-qr { width: 190px; height: 190px; background: #fff; border: 1px solid #e6e8ee; border-radius: 12px; padding: 8px; }
.iw-bd-url { font: 600 14px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--iw-primary, #373f92); word-break: break-all; }
.iw-bd-aboard { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; opacity: .85; }
.iw-bd-dot { width: 8px; height: 8px; border-radius: 50%; background: #1eabab; animation: iw-bd-pulse 2s ease-in-out infinite; }
@keyframes iw-bd-pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.iw-bd-modes-label { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; opacity: .5; margin-top: 4px; }
.iw-bd-modes { display: flex; gap: 8px; width: 100%; }
.iw-bd-mode { flex: 1; padding: 12px 6px; border: 2px solid #e6e8ee; border-radius: 12px; background: #fff;
  font: 600 15px/1.2 inherit; color: var(--iw-ink, #1c2430); cursor: pointer; position: relative; }
.iw-bd-mode.on { border-color: var(--iw-primary, #373f92); background: #f6f8ff; color: var(--iw-primary, #373f92); }
.iw-bd-mode.disabled { opacity: .5; cursor: default; }
.iw-bd-soon { display: block; font: 600 10px/1 inherit; opacity: .6; margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }
.iw-bd-footer { display: flex; gap: 8px; width: 100%; margin-top: 6px; }
.iw-bd-footer .iw-btn { flex: 1; }
.iw-bd-revoke { color: #b23b3b; }

.iw-bd-takeover {
  position: fixed; inset: 0; z-index: 9999; background: #0b1020;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  cursor: zoom-out; padding: 4vmin;
}
.iw-bd-tk-mark { width: 40px; height: 40px; position: absolute; top: 20px; left: 22px; opacity: .9; }
.iw-bd-tk-qr { width: min(70vh, 70vw); height: min(70vh, 70vw); background: #fff; border-radius: 18px; padding: 3.5%; }
.iw-bd-tk-url { color: #fff; font: 700 clamp(24px, 5vw, 44px)/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .01em; }
.iw-bd-tk-hint { color: rgba(255,255,255,.5); font-size: 14px; }

/* Capture tray (M2) */
.iw-bd-tray-label { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; opacity: .5; align-self: flex-start; margin-top: 4px; }
.iw-bd-tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; width: 100%; }
.iw-bd-shot { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid #e6e8ee; background: #f4f5f7; }
.iw-bd-shot img { display: block; width: 100%; height: 92px; object-fit: cover; }
.iw-bd-shot-acts { position: absolute; inset: auto 0 0 0; display: flex; gap: 4px; align-items: center; justify-content: space-between; padding: 4px; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.iw-bd-read { padding: 3px 8px; font-size: 12px; }
.iw-bd-x { border: 0; background: rgba(0,0,0,.5); color: #fff; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; }
.iw-raise-mic { font-size: 12px; opacity: .85; }

/* Add-image modal — modernized (drop zone + preview + clean URL field) */
.iw-image-modal { display: flex; flex-direction: column; gap: 14px; min-width: 320px; max-width: 440px; text-align: left; }
.iw-img-drop { position: relative; border: 2px dashed #cdd2e0; border-radius: 14px; background: #f8f9fc; padding: 26px 18px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.iw-img-drop:hover, .iw-img-drop.over { border-color: var(--iw-primary, #373f92); background: #f1f4ff; }
.iw-img-file { display: none; }
.iw-img-dz-ic { color: var(--iw-primary, #373f92); opacity: .85; line-height: 0; margin-bottom: 8px; }
.iw-img-dz-ic svg { width: 40px; height: 40px; }
.iw-img-dz-main { font-weight: 600; font-size: 15px; }
.iw-img-dz-sub { font-size: 13px; opacity: .55; margin-top: 3px; }
.iw-img-prev img { max-width: 100%; max-height: 220px; border-radius: 10px; display: block; margin: 0 auto; }
.iw-img-or { display: flex; align-items: center; gap: 10px; color: #9aa1b3; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.iw-img-or::before, .iw-img-or::after { content: ""; flex: 1; height: 1px; background: #e6e8ee; }
.iw-image-modal .iw-input { width: 100%; padding: 10px 12px; border: 1px solid #cdd2e0; border-radius: 10px; font: inherit; box-sizing: border-box; }
.iw-image-modal .iw-input:focus { outline: none; border-color: var(--iw-primary, #373f92); box-shadow: 0 0 0 3px rgba(55,63,146,.14); }
.iw-image-status { font-size: 13px; color: #667085; min-height: 18px; }
@media (prefers-reduced-motion: reduce) { .iw-bd-dot { animation: none; } }
