/* ============================================================
   Bridgewire — sandbox preview
   Single, considered visual system.
   Dark default; light variant via [data-theme="light"].
   ============================================================ */

:root {
  --bg: #0b0e1a;
  --bg-2: #11152a;
  --bg-3: #181d36;
  --surface: rgba(255,255,255,0.04);
  --surface-2: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);

  --fg: #eef1f6;
  --fg-2: #c2c9d6;
  --fg-3: #8c93a4;
  --fg-muted: #6b7287;

  --accent: #78e0c0;        /* mint - phone/android tint */
  --accent-2: #a48bff;      /* violet - mac/ai tint */
  --accent-3: #ff7a8a;      /* coral - alerts */
  --warn: #f1c25b;
  --good: #4cd99a;
  --bad: #ff6166;

  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px rgba(0,0,0,0.35);
  --shadow-2: 0 1px 0 rgba(255,255,255,0.04) inset, 0 18px 48px rgba(0,0,0,0.5);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 34px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --easing: cubic-bezier(.2, .8, .2, 1);
}

[data-theme="light"] {
  --bg: #f6f5f1;
  --bg-2: #ffffff;
  --bg-3: #ecebe5;
  --surface: rgba(0,0,0,0.03);
  --surface-2: rgba(0,0,0,0.06);
  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.14);

  --fg: #1a1d28;
  --fg-2: #353948;
  --fg-3: #5c6172;
  --fg-muted: #7c8294;

  --accent: #169e7c;
  --accent-2: #6b4ee8;
  --accent-3: #d94a5f;
  --warn: #b87c00;
  --good: #1b8a5a;
  --bad: #c5343a;

  --shadow-1: 0 1px 0 rgba(0,0,0,0.02) inset, 0 6px 18px rgba(20,20,30,0.08);
  --shadow-2: 0 1px 0 rgba(0,0,0,0.02) inset, 0 16px 40px rgba(20,20,30,0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 800px at 20% -10%, var(--bg-2), transparent 60%),
              radial-gradient(900px 700px at 110% 10%, var(--bg-3), transparent 55%),
              var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-2); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 8px 12px;
  background: var(--bg-2);
  color: var(--fg);
  border-radius: 8px;
  transform: translateY(-200%);
  transition: transform .2s var(--easing);
  z-index: 1000;
  border: 1px solid var(--border-strong);
}
.skip:focus { transform: translateY(0); }

.muted { color: var(--fg-3); }

/* ============================================================
   Brand
   ============================================================ */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 18px;
}
.brand--small { font-size: 15px; }
.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.brand--small .brand__mark { width: 26px; height: 26px; border-radius: 8px; }
.brand__phone { fill: var(--accent); opacity: 0.9; }
.brand__mac { fill: var(--accent-2); opacity: 0.9; }
.brand__wire { stroke: var(--fg); stroke-width: 2; stroke-linecap: round; fill: none; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 500 14px/1 var(--font);
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s var(--easing), background .15s var(--easing), border-color .15s var(--easing);
  background: transparent;
  color: var(--fg);
}
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: linear-gradient(180deg, var(--accent-2), color-mix(in srgb, var(--accent-2) 75%, black));
  color: white;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent-2) 35%, transparent);
}
.btn--primary:hover { filter: brightness(1.07); }

.btn--ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--fg);
}
.btn--ghost:hover { background: var(--surface-2); }

.btn--text {
  color: var(--fg-2);
  padding: 8px 10px;
}
.btn--text:hover { color: var(--fg); }

.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg-2);
  cursor: pointer;
  transition: background .15s var(--easing), color .15s var(--easing);
}
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }

/* ============================================================
   Badges & tags
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-2);
}
.badge__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 25%, transparent);
}
.badge--sandbox {
  background: color-mix(in srgb, var(--warn) 20%, transparent);
  border-color: color-mix(in srgb, var(--warn) 50%, transparent);
  color: var(--warn);
  padding: 3px 9px;
  font-size: 11px;
  margin-left: 4px;
}

.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  vertical-align: middle;
}
.tag--star {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #0b0e1a;
}

/* ============================================================
   Views
   ============================================================ */
.view { flex: 1; }
[hidden] { display: none !important; }

/* ============================================================
   WELCOME
   ============================================================ */
.welcome__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
}
.welcome__hero {
  max-width: 920px;
  margin: 32px auto 0;
  padding: 0 32px;
  text-align: left;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--fg-3);
  margin: 0 0 14px;
}
.welcome__hero h1 {
  font-size: clamp(32px, 5.2vw, 56px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 18px;
}
.welcome__hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--fg-2);
  max-width: 720px;
  margin: 0 0 28px;
}
.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.welcome__points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0 0 64px;
  max-width: 880px;
}
.welcome__points li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--fg-2);
  font-size: 14px;
}
.welcome__points strong { color: var(--fg); }

/* "what" section */
.what {
  max-width: 1080px;
  margin: 0 auto 80px;
  padding: 0 32px;
}
.what h2 {
  font-size: clamp(22px, 2.4vw, 28px);
  letter-spacing: -0.01em;
  margin: 0 0 22px;
}
.what__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.what__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}
.what__card h3 {
  margin: 0 0 12px;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.what__card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--fg-2);
}
.what__card li + li { margin-top: 8px; }

/* ============================================================
   CONSENT FLOW
   ============================================================ */
.consent__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  border-bottom: 1px solid var(--border);
}
.stepper {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  list-style: none;
  padding: 18px 32px;
  margin: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.stepper li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--fg-3);
  background: transparent;
  border: 1px solid transparent;
}
.stepper li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-2);
}
.stepper li[aria-current="step"] {
  background: var(--bg-2);
  border-color: var(--border-strong);
  color: var(--fg);
}
.stepper li[aria-current="step"] span {
  background: var(--accent-2);
  color: white;
}
.stepper li[data-done="true"] span {
  background: var(--good);
  color: white;
}

.consent__main {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}
.consent__title {
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.02em;
  margin: 0 0 28px;
}
.step { display: none; }
.step[data-active="true"] { display: block; }

.step h3 {
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.step__lede {
  color: var(--fg-2);
  margin: 0 0 22px;
  font-size: 15.5px;
}
.step__actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}

.capability-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.capability-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.capability-list h4 {
  margin: 0 0 4px;
  font-size: 15px;
}
.capability-list p {
  margin: 0;
  color: var(--fg-2);
  font-size: 14px;
}

.perms {
  display: grid;
  gap: 8px;
}
.perm {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: background .15s var(--easing), border-color .15s var(--easing);
}
.perm:hover { background: var(--surface-2); }
.perm--ai { border-color: color-mix(in srgb, var(--accent-2) 50%, transparent); }
.perm input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}
.perm input[type="checkbox"]:checked {
  background: var(--accent-2);
  border-color: var(--accent-2);
}
.perm input[type="checkbox"]:checked::after {
  content: "";
  width: 6px; height: 11px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
.perm__body { display: flex; flex-direction: column; gap: 3px; }
.perm__name { font-weight: 600; font-size: 14.5px; }
.perm__detail { color: var(--fg-3); font-size: 13.5px; line-height: 1.5; }

.perms--inline { gap: 6px; }
.perms--inline .perm { padding: 11px 14px; border-radius: 12px; }

.promises {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.promises li {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.promises__x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bad) 28%, transparent);
  color: var(--bad);
  font-weight: 800;
  flex-shrink: 0;
}

.pair {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.pair__qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: white;
  border-radius: var(--radius);
}
.pair__hint { font-size: 12px; color: #444; margin: 0; }
.pair__code { display: flex; flex-direction: column; gap: 6px; }
.pair__label { margin: 0; color: var(--fg-2); }
.pair__digits {
  display: flex;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 28px;
  letter-spacing: 0.04em;
  margin: 6px 0 4px;
}
.pair__digits span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 6px 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
}
.pair__expiry { margin: 6px 0 0; color: var(--fg-3); font-size: 13px; }

@media (max-width: 600px) {
  .pair { grid-template-columns: 1fr; }
}

/* ============================================================
   MAIN BRIDGE — topbar
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-2) 70%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.conn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--fg-2);
}
.conn__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 25%, transparent);
  animation: pulse 2.4s var(--easing) infinite;
}
.conn__sep { color: var(--fg-muted); }
.conn__label { font-weight: 600; color: var(--fg); }
.top-actions { display: flex; gap: 8px; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 25%, transparent); }
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--good) 0%, transparent); }
}

/* ============================================================
   Scenario controls strip
   ============================================================ */
.scenario {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-2) 7%, transparent), transparent);
}
.scenario__intro { font-size: 14px; color: var(--fg-2); max-width: 720px; }
.scenario__controls { display: inline-flex; align-items: center; gap: 6px; }
.scenario__progress {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
  padding: 0 8px;
}
[data-action="scenario-play"][aria-pressed="true"] .play-on { display: none; }
[data-action="scenario-play"][aria-pressed="false"] .play-off { display: none; }

/* ============================================================
   Stage layout
   ============================================================ */
.stage {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(320px, 1fr) minmax(280px, 360px);
  gap: 18px;
  padding: 22px 24px 8px;
  align-items: start;
}
@media (max-width: 1100px) {
  .stage { grid-template-columns: 1fr; }
}

.pane {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-1);
}
.pane__head { margin-bottom: 14px; }
.pane__head h2 {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 4px;
}
.pane__sub { font-size: 13px; color: var(--fg-3); }
.pane__head--ai h2 { color: var(--fg); text-transform: none; letter-spacing: -0.01em; font-size: 16px; }

/* ============================================================
   PHONE
   ============================================================ */
.pane--phone { display: flex; flex-direction: column; align-items: center; }
.phone {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 9 / 19.5;
  border-radius: 36px;
  background: linear-gradient(180deg, #1a1f3a, #0b0e1a);
  padding: 8px;
  position: relative;
  box-shadow: var(--shadow-2), inset 0 0 0 1.5px rgba(255,255,255,0.08);
  margin: 6px 0 0;
}
.phone__notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #050810;
  z-index: 3;
}
.phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: #060914;
  color: white;
  display: flex;
  flex-direction: column;
}
.phone__statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px 6px;
  font-size: 11px;
  font-weight: 600;
  z-index: 2;
}
.phone__icons { display: inline-flex; gap: 6px; align-items: center; }

.phone__view {
  position: absolute;
  inset: 0;
  padding-top: 32px;
  display: none;
  flex-direction: column;
  background: transparent;
}
.phone__view[data-active="true"] { display: flex; }

.phone__wallpaper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(400px 250px at 30% 20%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%),
    radial-gradient(400px 280px at 80% 90%, color-mix(in srgb, var(--accent-2) 35%, transparent), transparent 60%),
    linear-gradient(180deg, #0a1024, #050810);
  z-index: 0;
}

.phone__widget {
  position: relative;
  z-index: 1;
  margin: 16px 18px 8px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
}
.phone__widget-time { margin: 0 0 4px; font-weight: 600; font-size: 13px; }
.phone__widget-weather { margin: 0; font-size: 11.5px; color: rgba(255,255,255,0.72); }

.phone__apps {
  list-style: none;
  margin: 0;
  padding: 18px 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 8px;
  z-index: 1;
  position: relative;
}
.app {
  all: unset;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  position: relative;
  transition: transform .15s var(--easing);
}
.app:hover { transform: translateY(-2px); }
.app__icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}
.app__icon--messages { background: linear-gradient(135deg, #4cd99a, #1f9d68); position: relative; }
.app__icon--messages::after { content: ""; position: absolute; inset: 9px; border-radius: 8px 8px 8px 2px; border: 2px solid white; }
.app__icon--phone { background: linear-gradient(135deg, #34c759, #1c8a3c); position: relative; }
.app__icon--phone::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid white; border-radius: 4px; transform: rotate(-30deg); top: 11px; left: 11px; }
.app__icon--maps { background: linear-gradient(135deg, #5ec6ff, #2a72b9); position: relative; }
.app__icon--maps::after { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; border: 2px solid white; box-shadow: 0 4px 0 -2px white; top: 12px; left: 14px; }
.app__icon--calendar { background: white; color: #d94a5f; font-weight: 700; font-size: 14px; }
.app__icon--calendar::before { content: "14"; }
.app__icon--camera { background: linear-gradient(135deg, #555, #1a1a1a); position: relative; }
.app__icon--camera::after { content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%; border: 2.4px solid white; top: 13px; left: 13px; }
.app__icon--music { background: linear-gradient(135deg, #ff7a8a, #c83a55); position: relative; }
.app__icon--music::after { content: "♪"; position: absolute; color: white; font-size: 22px; left: 10px; top: 4px; font-weight: 700; }
.app__icon--wallet { background: linear-gradient(135deg, #f1c25b, #b8860b); position: relative; }
.app__icon--wallet::after { content: ""; position: absolute; inset: 10px 6px 12px 6px; border-radius: 4px; background: white; opacity: 0.85; }
.app__icon--auth { background: linear-gradient(135deg, #a48bff, #6b4ee8); position: relative; }
.app__icon--auth::after { content: ""; position: absolute; width: 12px; height: 16px; border: 2px solid white; border-radius: 4px 4px 6px 6px; top: 11px; left: 13px; }
.app__label { font-size: 10px; color: rgba(255,255,255,0.85); }
.app__badge {
  position: absolute;
  top: -4px; right: -2px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: var(--accent-3);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #060914;
}

.phone__appbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  position: relative;
  z-index: 1;
}
.phone__appbar h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  text-align: center;
}
.phone__back {
  all: unset;
  cursor: pointer;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--accent);
}

.threads { list-style: none; padding: 0; margin: 0; overflow-y: auto; }
.thread {
  all: unset;
  cursor: pointer;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  width: 100%;
}
.thread:hover { background: rgba(255,255,255,0.04); }
.thread__avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
}
.thread__avatar[data-color="violet"] { background: #a48bff; }
.thread__avatar[data-color="green"] { background: #4cd99a; color: #0b0e1a; }
.thread__avatar[data-color="amber"] { background: #f1c25b; color: #2a1f00; }
.thread__body { display: flex; flex-direction: column; min-width: 0; }
.thread__name { font-weight: 600; font-size: 13.5px; }
.thread__last {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thread__time { font-size: 11px; color: rgba(255,255,255,0.45); }

.bubbles { list-style: none; padding: 14px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; }
.bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 12.5px;
  line-height: 1.4;
}
.bubble--in { background: rgba(255,255,255,0.1); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble--out { background: var(--accent-2); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.composer {
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.composer__hint { font-size: 11px; color: rgba(255,255,255,0.55); text-align: center; }

.call {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 12px;
}
.call__hint { color: rgba(255,255,255,0.55); font-size: 12px; text-align: center; margin: 0; }
.call--ringing {
  background: radial-gradient(60% 50% at 50% 20%, color-mix(in srgb, var(--good) 30%, transparent), transparent);
}
.call__avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a48bff, #6b4ee8);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 600; color: white;
}
.call--ringing .call__avatar { animation: ring 1.4s var(--easing) infinite; }
@keyframes ring {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 50%, transparent); }
  50% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--good) 0%, transparent); }
}
.call__name { font-weight: 600; font-size: 15px; }
.call__status { font-size: 12px; color: rgba(255,255,255,0.7); }

.maps { flex: 1; display: flex; flex-direction: column; padding: 8px 10px 14px; }
.maps__canvas { flex: 1; border-radius: 8px; overflow: hidden; }
.maps__card {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  font-size: 12px;
}
.maps__card strong { display: block; margin-bottom: 2px; }

.cal { padding: 12px 14px; }
.cal__day { font-weight: 600; margin-bottom: 8px; font-size: 13px; }
.cal__events { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.cal__event {
  background: rgba(255,255,255,0.07);
  border-left: 3px solid var(--accent);
  padding: 8px 10px;
  border-radius: 6px;
  display: flex; flex-direction: column; gap: 2px;
  font-size: 12px;
}
.cal__event strong { font-size: 13px; }
.cal__event span { color: rgba(255,255,255,0.7); font-size: 11px; }
.cal__event--new {
  border-left-color: var(--accent-3);
  background: color-mix(in srgb, var(--accent-3) 18%, transparent);
}
.cal__source { font-style: italic; color: rgba(255,255,255,0.5) !important; }

.photo { flex: 1; padding: 12px; display: flex; align-items: center; justify-content: center; }
.photo__img { width: 100%; max-width: 200px; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }

.music { display: flex; flex-direction: column; align-items: center; padding: 24px 16px; gap: 8px; }
.music__art { border-radius: 14px; overflow: hidden; }
.music__title { font-weight: 600; font-size: 14px; margin: 14px 0 2px; }
.music__artist { font-size: 12px; color: rgba(255,255,255,0.7); margin: 0; }
.music__bar { width: 80%; height: 4px; background: rgba(255,255,255,0.15); border-radius: 999px; margin-top: 16px; overflow: hidden; }
.music__bar span { display: block; height: 100%; width: 37%; background: var(--accent); animation: progress 8s linear infinite; }
@keyframes progress { from { width: 37%; } to { width: 92%; } }

.wallet { padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.wallet__card {
  width: 200px; height: 124px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f1c25b, #b8860b);
  color: #2a1f00;
  padding: 14px;
  display: flex; flex-direction: column; justify-content: space-between;
  font-family: var(--font-mono);
  box-shadow: 0 12px 28px rgba(241,194,91,0.25);
}
.wallet__bank { font-size: 12px; }
.wallet__num { font-size: 16px; font-weight: 600; letter-spacing: 0.08em; }
.wallet__hint { font-size: 11px; color: rgba(255,255,255,0.55); text-align: center; margin: 0; }

.auth { padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.auth__label { font-size: 13px; color: rgba(255,255,255,0.75); margin: 0; }
.auth__code { font-family: var(--font-mono); font-size: 30px; letter-spacing: 0.12em; margin: 4px 0; color: var(--accent); }
.auth__expiry { font-size: 11px; color: rgba(255,255,255,0.55); margin: 0; }

.phone__nav {
  position: absolute;
  bottom: 8px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 36px;
  padding: 6px 0;
}
.phone__navbtn {
  all: unset;
  cursor: pointer;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7);
}
.phone__navbtn:hover { color: white; }

.phone__notif {
  position: absolute;
  top: 32px;
  left: 8px; right: 8px;
  background: rgba(20, 25, 50, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 10px 12px;
  z-index: 5;
  animation: notif-in .35s var(--easing);
  font-size: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.55);
}
.phone__notif strong { font-size: 13px; }
.phone__notif p { margin: 2px 0 0; color: rgba(255,255,255,0.75); }
@keyframes notif-in {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   AI CO-PILOT
   ============================================================ */
.pane--ai {
  background: linear-gradient(180deg, var(--bg-2), color-mix(in srgb, var(--bg-2) 90%, var(--accent-2)));
  border-color: color-mix(in srgb, var(--accent-2) 30%, var(--border));
}
.ai-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--fg-2);
  margin-bottom: 12px;
}
.ai-status__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
  animation: pulse-mint 2s infinite;
}
@keyframes pulse-mint {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 0%, transparent); }
}
.ai-status--thinking .ai-status__dot {
  background: var(--accent-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 25%, transparent);
  animation: pulse-violet 1s infinite;
}
@keyframes pulse-violet {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 25%, transparent); }
  50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--accent-2) 0%, transparent); }
}

.suggestions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
}
.suggestion {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  position: relative;
  animation: card-in .4s var(--easing);
}
@keyframes card-in {
  from { transform: translateY(-6px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.suggestion--empty {
  background: var(--surface);
  border-style: dashed;
  color: var(--fg-2);
}
.suggestion--empty p { margin: 0; font-size: 14px; }
.suggestion--empty p + p { margin-top: 6px; }

.sug__head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--fg-3);
}
.sug__icon {
  width: 24px; height: 24px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.sug__src { font-weight: 500; }
.sug__time { margin-left: auto; font-family: var(--font-mono); }

.sug__title { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.sug__because {
  font-size: 12.5px;
  color: var(--fg-3);
  background: var(--surface);
  padding: 8px 10px;
  border-radius: 8px;
  border-left: 2px solid var(--accent-2);
}
.sug__because strong { color: var(--fg-2); }

.sug__draft {
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--font);
}

.sug__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sug-btn {
  all: unset;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  transition: background .15s var(--easing);
}
.sug-btn--primary {
  background: var(--accent-2);
  color: white;
}
.sug-btn--primary:hover { filter: brightness(1.07); }
.sug-btn--ghost {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--fg-2);
}
.sug-btn--ghost:hover { background: var(--surface-2); color: var(--fg); }
.sug-btn--danger { color: var(--bad); }

.suggestion--accepted {
  opacity: 0.55;
  border-color: var(--good);
}
.suggestion--accepted .sug__actions { display: none; }
.suggestion--accepted::after {
  content: "Accepted";
  position: absolute;
  top: 12px; right: 12px;
  font-size: 11px;
  color: var(--good);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.suggestion--dismissed {
  opacity: 0.4;
  border-style: dashed;
}
.suggestion--dismissed .sug__actions { display: none; }
.suggestion--dismissed::after {
  content: "Dismissed";
  position: absolute;
  top: 12px; right: 12px;
  font-size: 11px;
  color: var(--fg-3);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-explain {
  margin-top: 16px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}
.ai-explain summary {
  cursor: pointer;
  color: var(--fg-2);
  font-weight: 500;
  list-style: none;
}
.ai-explain summary::-webkit-details-marker { display: none; }
.ai-explain summary::before { content: "›"; display: inline-block; margin-right: 8px; transition: transform .2s var(--easing); }
.ai-explain[open] summary::before { transform: rotate(90deg); }
.ai-explain p { color: var(--fg-3); margin: 10px 0 0; }
.ai-explain code { font-family: var(--font-mono); font-size: 11.5px; background: var(--bg); padding: 1px 5px; border-radius: 4px; }

/* ============================================================
   MAC SIDE
   ============================================================ */
.widgets {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.widget {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.widget__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.widget__head h3 { margin: 0; font-size: 13px; letter-spacing: -0.01em; }
.widget__sub { font-size: 11px; color: var(--fg-3); }
.widget__body { padding: 12px 14px; min-height: 56px; }
.widget__empty { margin: 0; font-size: 13px; color: var(--fg-3); }
.widget__body--drop { border: 1px dashed transparent; transition: border-color .2s; }

.widget-msg {
  background: var(--surface);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.widget-msg__from { font-weight: 600; font-size: 13px; }
.widget-msg__body { color: var(--fg-2); font-size: 13px; }
.widget-msg__draft {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent-2);
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--fg);
  font-size: 12.5px;
}
.widget-msg__draft em { color: var(--fg-3); font-style: normal; font-size: 11px; }

.widget-call {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px;
}
.widget-call__avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a48bff, #6b4ee8);
  color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600;
}
.widget-call__meta { flex: 1; }
.widget-call__from { font-weight: 600; font-size: 13px; }
.widget-call__status { font-size: 11px; color: var(--fg-3); }
.widget-call__waveform {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 22px;
}
.widget-call__waveform span {
  width: 3px;
  background: var(--good);
  border-radius: 2px;
  animation: wave 1s ease-in-out infinite;
}
.widget-call__waveform span:nth-child(1) { animation-delay: 0s; height: 10px; }
.widget-call__waveform span:nth-child(2) { animation-delay: .1s; height: 16px; }
.widget-call__waveform span:nth-child(3) { animation-delay: .2s; height: 22px; }
.widget-call__waveform span:nth-child(4) { animation-delay: .3s; height: 14px; }
.widget-call__waveform span:nth-child(5) { animation-delay: .4s; height: 8px; }
@keyframes wave {
  0%, 100% { transform: scaleY(0.6); }
  50% { transform: scaleY(1.4); }
}

.widget-clip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
  word-break: break-all;
}
.widget-clip__meta { font-family: var(--font); color: var(--fg-3); font-size: 11px; margin-top: 4px; }

.widget-file {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 10px;
}
.widget-file__icon {
  width: 32px; height: 40px;
  background: linear-gradient(180deg, var(--accent-2), color-mix(in srgb, var(--accent-2) 60%, black));
  border-radius: 4px;
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.widget-file__meta { flex: 1; }
.widget-file__name { font-weight: 600; font-size: 13px; }
.widget-file__size { font-size: 11px; color: var(--fg-3); }

/* ============================================================
   Activity / event log
   ============================================================ */
.eventlog {
  margin: 0 24px 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.eventlog__head { margin-bottom: 10px; }
.eventlog__head h2 {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 4px;
}
.eventlog__list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  max-height: 200px;
  overflow-y: auto;
}
.eventlog__list li {
  display: grid;
  grid-template-columns: 70px 90px 1fr;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
  color: var(--fg-2);
}
.eventlog__list li:last-child { border-bottom: none; }
.eventlog__list .ts { color: var(--fg-3); }
.eventlog__list .src { color: var(--accent); }
.eventlog__list .src[data-source="mac"] { color: var(--accent-2); }
.eventlog__list .src[data-source="ai"] { color: var(--accent-3); }

/* ============================================================
   Drawer
   ============================================================ */
.drawer { position: fixed; inset: 0; z-index: 100; }
.drawer__scrim {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  animation: fade-in .2s var(--easing);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.drawer__panel {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: min(440px, 92vw);
  background: var(--bg-2);
  border-left: 1px solid var(--border-strong);
  padding: 20px;
  overflow-y: auto;
  animation: slide-in .3s var(--easing);
  box-shadow: -16px 0 40px rgba(0,0,0,0.4);
}
@keyframes slide-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.drawer__head h2 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.drawer__section {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.drawer__section:last-of-type { border-bottom: none; }
.drawer__section h3 {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 10px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  cursor: pointer;
}
.row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 38px; height: 22px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background .2s var(--easing);
}
.row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--fg-2);
  top: 2px; left: 2px;
  transition: transform .2s var(--easing), background .2s;
}
.row input[type="checkbox"]:checked {
  background: color-mix(in srgb, var(--accent-2) 50%, transparent);
  border-color: var(--accent-2);
}
.row input[type="checkbox"]:checked::after {
  transform: translateX(16px);
  background: white;
}
.gates { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.gates li {
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 10px;
  font-size: 13px;
  color: var(--fg-2);
}
.gates__tag {
  display: inline-block;
  background: color-mix(in srgb, var(--warn) 30%, transparent);
  color: var(--warn);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
  letter-spacing: 0.04em;
}

/* ============================================================
   Footer + sr hint
   ============================================================ */
.footer {
  margin-top: auto;
  padding: 22px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--fg-3);
  border-top: 1px solid var(--border);
}
.srhint {
  position: absolute;
  width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
