/* Albert One. Calm, legible, phone first. One accent, no decoration without a job. */
:root {
  color-scheme: dark light;
  --bg: #0b0d0f;
  --surface: #121519;
  --surface-2: #181c21;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eceef0;
  --muted: #8d959e;
  --faint: #5b626b;
  --accent: #5fe0b7;
  --accent-ink: #062a20;
  --accent-soft: rgba(95, 224, 183, 0.13);
  --good: #5fe0b7;
  --warn: #f2b85b;
  --bad: #ff7a7a;
  --c1: #5fe0b7;
  --c2: #6eb3ff;
  --c3: #b79cff;
  --c4: #f2b85b;
  --c5: #ff8fb0;
  --c6: #7fd6e8;
  --c7: #c9d36a;
  --c8: #9aa3ad;
  --radius: 18px;
  --radius-s: 11px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f5f2;
    --surface: #ffffff;
    --surface-2: #f0efeb;
    --line: rgba(20, 24, 28, 0.09);
    --line-strong: rgba(20, 24, 28, 0.18);
    --text: #14181c;
    --muted: #5f6770;
    --faint: #98a0a8;
    --accent: #0f9d76;
    --accent-ink: #ffffff;
    --accent-soft: rgba(15, 157, 118, 0.1);
    --good: #0f9d76;
    --warn: #b7791f;
    --bad: #d64545;
    --c1: #0f9d76;
    --c2: #2f7fd6;
    --c3: #7b5fd6;
    --c4: #c98a1c;
    --c5: #d6557f;
    --c6: #2a9db3;
    --c7: #8a9a1f;
    --c8: #7a838c;
    --shadow: 0 18px 50px rgba(20, 24, 28, 0.14);
  }
}
:root[data-theme="light"] {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f0efeb;
  --line: rgba(20, 24, 28, 0.09);
  --line-strong: rgba(20, 24, 28, 0.18);
  --text: #14181c;
  --muted: #5f6770;
  --faint: #98a0a8;
  --accent: #0f9d76;
  --accent-ink: #ffffff;
  --accent-soft: rgba(15, 157, 118, 0.1);
  --good: #0f9d76;
  --warn: #b7791f;
  --bad: #d64545;
  --c1: #0f9d76;
  --c2: #2f7fd6;
  --c3: #7b5fd6;
  --c4: #c98a1c;
  --c5: #d6557f;
  --c6: #2a9db3;
  --c7: #8a9a1f;
  --c8: #7a838c;
  --shadow: 0 18px 50px rgba(20, 24, 28, 0.14);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
body {
  overflow: hidden;
}
[hidden] {
  display: none !important;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
input,
textarea {
  font: inherit;
  color: inherit;
}
.muted {
  color: var(--muted);
}
.error {
  color: var(--bad);
  min-height: 1.3em;
  margin: 0;
  font-size: 14px;
}
svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── sign-in ─────────────────────────────────────────────────────────── */
.gate {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate-card {
  width: min(360px, 100%);
  display: grid;
  gap: 14px;
  text-align: center;
}
.gate-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 6px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  box-shadow: inset 0 0 0 9px var(--accent-soft);
}
.gate-card h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.gate-card p {
  margin: 0;
}
.gate-card input[type="password"] {
  height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  text-align: center;
  font-size: 17px;
  outline: none;
}
.gate-card input:focus {
  border-color: var(--accent);
}

.btn {
  height: 46px;
  padding: 0 18px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-weight: 550;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.08s, background 0.15s;
}
.btn:active {
  transform: scale(0.98);
}
.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}
.btn.danger {
  color: var(--bad);
}
.btn.small {
  height: 36px;
  padding: 0 13px;
  font-size: 14px;
  border-radius: 10px;
}
.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

/* ── frame ───────────────────────────────────────────────────────────── */
#main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "stage" "talk";
}
.top {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + var(--safe-t)) 14px 6px 18px;
}
.who {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  transition: background 0.3s;
}
.dot[data-on="1"] {
  background: var(--accent);
}
.dot[data-on="0"] {
  background: var(--bad);
}
.top-actions {
  display: flex;
  gap: 2px;
}
.icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.icon svg {
  width: 21px;
  height: 21px;
}
.icon:hover {
  color: var(--text);
}
.icon:active {
  background: var(--surface-2);
}
.icon.accent {
  color: var(--accent);
}
.icon[aria-pressed="true"] {
  color: var(--bad);
}
.icon .slash {
  display: none;
}
.icon[aria-pressed="true"] .slash {
  display: block;
}
.icon circle {
  fill: currentColor;
  stroke: none;
}

/* ── the display ─────────────────────────────────────────────────────── */
.stage {
  grid-area: stage;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 4px 12px 0;
}
.canvas {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  gap: 12px;
  overscroll-behavior-x: contain;
}
.canvas::-webkit-scrollbar {
  display: none;
}
.view {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  animation: rise 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}
.view-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 12px 10px 18px;
}
.view-titles {
  flex: 1;
  min-width: 0;
}
.view-title {
  margin: 0;
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.view-sub {
  margin: 2px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}
.view-close {
  width: 34px;
  height: 34px;
  margin-top: -4px;
  color: var(--faint);
}
.view-close svg {
  width: 17px;
  height: 17px;
}
.view-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 18px 18px;
  overscroll-behavior: contain;
}
.view-actions {
  display: flex;
  gap: 8px;
  padding: 10px 18px 16px;
  border-top: 1px solid var(--line);
}
.view-actions .btn {
  flex: 1;
}
.view-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.pager {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 9px 0 2px;
}
.pager i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: all 0.2s;
}
.pager i[data-on="1"] {
  background: var(--accent);
  width: 16px;
  border-radius: 3px;
}

/* empty display */
.home {
  flex: 0 0 100%;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 6px;
  padding: 24px;
  color: var(--muted);
  scroll-snap-align: center;
}
.home b {
  display: block;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* stats */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.stat {
  background: var(--surface-2);
  border-radius: var(--radius-s);
  padding: 13px 14px 12px;
  min-width: 0;
}
/* An odd tile at the end takes the full row instead of leaving a hole. */
.stats > .stat:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
.stat-label {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-value {
  margin-top: 3px;
  font-size: 27px;
  font-weight: 640;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.stat-value.text {
  font-size: 17px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.stat-value small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 3px;
  letter-spacing: 0;
}
.stat-detail {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}
.delta {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.delta.up {
  color: var(--good);
}
.delta.down {
  color: var(--bad);
}
.stat[data-tone="accent"] .stat-value {
  color: var(--accent);
}
.stat[data-tone="warn"] .stat-value {
  color: var(--warn);
}
.stat[data-tone="bad"] .stat-value {
  color: var(--bad);
}
.stat[data-tone="good"] .stat-value {
  color: var(--good);
}
.spark {
  display: block;
  width: 100%;
  height: 26px;
  margin-top: 6px;
  color: var(--accent);
}

/* chart */
.chart-wrap {
  margin-top: 14px;
}
.chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  touch-action: pan-y;
}
.chart text {
  fill: var(--muted);
  stroke: none;
  font: 11px var(--font);
  font-variant-numeric: tabular-nums;
}
.chart .grid {
  stroke: var(--line);
  stroke-width: 1;
}
.chart .cursor {
  stroke: var(--line-strong);
  stroke-width: 1;
}
.chart-tip {
  min-height: 20px;
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chart-tip b {
  color: var(--text);
  font-weight: 600;
}
.legend {
  display: grid;
  gap: 2px;
  margin-top: 10px;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
}
.legend-row i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex: none;
}
.legend-row span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.legend-row b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.legend-row em {
  font-style: normal;
  color: var(--muted);
  font-size: 12.5px;
  width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* list */
.group-title {
  margin: 16px 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.group-title:first-child {
  margin-top: 4px;
}
.row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  width: 100%;
  text-align: left;
}
.group-title + .row,
.rows > .row:first-child {
  border-top: 0;
}
.check {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.check svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
  opacity: 0;
  color: var(--accent-ink);
}
.row[data-done="1"] .check {
  background: var(--accent);
  border-color: var(--accent);
}
.row[data-done="1"] .check svg {
  opacity: 1;
}
.row[data-done="1"] .row-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--faint);
}
.row-main {
  flex: 1;
  min-width: 0;
}
.row-title {
  font-size: 15.5px;
  overflow-wrap: anywhere;
}
.row-meta {
  margin-top: 1px;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.row-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.row[data-tone="bad"] .row-side .due {
  color: var(--bad);
}
.row[data-tone="warn"] .row-side .due {
  color: var(--warn);
}
.bullet {
  flex: none;
  width: 8px;
  height: 8px;
  margin: 7px 7px 0;
  border-radius: 50%;
  background: var(--line-strong);
}
.row[data-tone="accent"] .bullet {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.row[data-done="1"] .bullet {
  background: var(--accent);
}
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.tag[data-tone="good"] {
  color: var(--good);
  background: var(--accent-soft);
}
.tag[data-tone="accent"] {
  color: var(--accent);
  background: var(--accent-soft);
}
.tag[data-tone="warn"] {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, transparent);
}
.tag[data-tone="bad"] {
  color: var(--bad);
  background: color-mix(in srgb, var(--bad) 14%, transparent);
}
.empty {
  padding: 28px 0;
  text-align: center;
  color: var(--muted);
}

/* table */
.table-scroll {
  overflow-x: auto;
  margin: 0 -18px;
  padding: 0 18px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 12px 8px 0;
  white-space: nowrap;
}
td {
  padding: 10px 12px 10px 0;
  border-top: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
  min-width: 70px;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-right: 0;
  padding-left: 12px;
}

/* cards */
.cards {
  display: grid;
  gap: 10px;
}
.card {
  background: var(--surface-2);
  border-radius: var(--radius-s);
  padding: 13px 14px;
  display: grid;
  gap: 5px;
}
.card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.card-title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 15.5px;
  overflow-wrap: anywhere;
}
.card-sub {
  font-size: 13.5px;
  color: var(--muted);
}
.card-body {
  font-size: 14px;
  color: var(--muted);
}
.card-stats {
  display: flex;
  gap: 16px;
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}
.card-stats b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.card img {
  width: 100%;
  border-radius: 8px;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* board */
.board {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 -18px;
  padding: 0 18px 4px;
  scroll-snap-type: x proximity;
}
.board-col {
  flex: 0 0 78%;
  max-width: 300px;
  scroll-snap-align: start;
  background: var(--surface-2);
  border-radius: var(--radius-s);
  padding: 11px;
}
.board-col h4 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
}
.board-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  margin-top: 7px;
  font-size: 14px;
}

/* progress */
.task {
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.task:first-child {
  border-top: 0;
  padding-top: 4px;
}
.task-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.task-title {
  flex: 1;
  min-width: 0;
  font-weight: 580;
  font-size: 15.5px;
  overflow-wrap: anywhere;
}
.task-meta {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}
.task-step {
  margin-top: 7px;
  font-size: 13.5px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: baseline;
  overflow-wrap: anywhere;
}
.task-step::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-1px);
}
.task[data-status="running"] .task-step::before {
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
.task-result {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bar {
  height: 3px;
  margin-top: 9px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 35%;
  background: var(--accent);
  border-radius: 2px;
  animation: slide 1.6s ease-in-out infinite;
}
@keyframes slide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(290%);
  }
}

/* doc */
.doc {
  font-size: 15.5px;
  line-height: 1.55;
}
.doc h1,
.doc h2,
.doc h3 {
  margin: 1.1em 0 0.35em;
  font-size: 16.5px;
  letter-spacing: -0.01em;
}
.doc h1 {
  font-size: 19px;
}
.doc p {
  margin: 0.55em 0;
}
.doc ul,
.doc ol {
  padding-left: 1.25em;
  margin: 0.5em 0;
}
.doc li {
  margin: 0.2em 0;
}
.doc code {
  font: 13.5px var(--mono);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 5px;
}
.doc pre {
  background: var(--surface-2);
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
}
.doc pre code {
  background: none;
  padding: 0;
}
.doc a {
  color: var(--accent);
}
.doc blockquote {
  margin: 0.6em 0;
  padding-left: 12px;
  border-left: 2px solid var(--line-strong);
  color: var(--muted);
}
.draft-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--warn);
}

/* timeline */
.tl-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.tl-item:first-child {
  border-top: 0;
}
.tl-time {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

/* media */
.media {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.media figure {
  margin: 0;
}
.media img,
.media video {
  width: 100%;
  border-radius: 10px;
  display: block;
  background: var(--surface-2);
}
.media figcaption {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

/* choice */
.choices {
  display: grid;
  gap: 8px;
}
.choice {
  text-align: left;
  padding: 13px 14px;
  border-radius: var(--radius-s);
  background: var(--surface-2);
  border: 1px solid transparent;
  transition: all 0.12s;
}
.choice b {
  display: block;
  font-weight: 580;
}
.choice span {
  font-size: 13.5px;
  color: var(--muted);
}
.choice[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* connect */
.connect {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  justify-items: center;
  text-align: center;
  padding-top: 6px;
}
.connect > * {
  max-width: 100%;
}
.connect-msg {
  margin: 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 15px;
}
.connect-code {
  font: 600 28px/1 var(--mono);
  letter-spacing: 0.12em;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  user-select: all;
}
.connect-qr {
  width: min(250px, 70%);
  aspect-ratio: 1;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}
.connect-qr img {
  width: 100%;
  height: 100%;
  display: block;
}
.connect .btn {
  min-width: 200px;
}
.connect form {
  width: 100%;
  display: grid;
  gap: 10px;
  text-align: left;
}
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  outline: none;
}
.field input:focus {
  border-color: var(--accent);
}
.steps {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}
.steps div {
  display: flex;
  gap: 9px;
  align-items: baseline;
}
.steps i {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  font: 600 10.5px/15px var(--font);
  text-align: center;
  font-style: normal;
  transform: translateY(2px);
}
.steps [data-done="1"] i {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2.5px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.done-mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.done-mark svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.2;
}
.remote {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #fff;
  position: relative;
  touch-action: none;
}
.remote canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}
.remote-bar {
  display: flex;
  gap: 8px;
  width: 100%;
}
.remote-bar input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  outline: none;
}
.html-frame {
  width: 100%;
  min-height: 320px;
  height: 100%;
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
}

/* ── conversation ────────────────────────────────────────────────────── */
.talk {
  grid-area: talk;
  display: flex;
  flex-direction: column;
  padding: 6px 16px calc(10px + var(--safe-b));
}
.transcript {
  display: none;
}
.caption {
  min-height: 62px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  padding: 6px 4px 8px;
  text-align: center;
}
.caption p {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cap-user {
  -webkit-line-clamp: 2;
  font-size: 14px;
  color: var(--muted);
}
.cap-albert {
  -webkit-line-clamp: 3;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.cap-albert .next {
  color: var(--faint);
}
.dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 2px 0 2px;
}
.hint {
  margin: 4px 0 0;
  min-height: 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--faint);
}
.composer {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.composer input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 15px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  outline: none;
  font-size: 16px;
}
.composer input:focus {
  border-color: var(--accent);
}

/* the orb: state at a glance. off · idle · listening · thinking · speaking · muted */
.orb {
  --level: 0;
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  outline-offset: 4px;
}
.orb-core {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(calc(0.86 + var(--level) * 0.34));
  transition: transform 0.09s linear, background 0.25s, opacity 0.25s;
}
.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  transition: border-color 0.25s, transform 0.12s linear;
}
.orb-arc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}
.orb[data-state="off"] .orb-core,
.orb[data-state="muted"] .orb-core {
  background: var(--faint);
  transform: scale(0.72);
}
.orb[data-state="idle"] .orb-core {
  opacity: 0.9;
}
.orb[data-state="listening"] .orb-ring {
  border-color: var(--accent);
  transform: scale(calc(1 + var(--level) * 0.16));
}
.orb[data-state="thinking"] .orb-core {
  transform: scale(0.7);
  opacity: 0.75;
}
.orb[data-state="thinking"] .orb-arc {
  opacity: 1;
  animation: spin 0.9s linear infinite;
}
.orb[data-state="speaking"] .orb-ring {
  border-color: var(--accent);
  opacity: 0.55;
  transform: scale(calc(1 + var(--level) * 0.22));
}

/* ── sheet ───────────────────────────────────────────────────────────── */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-back {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  animation: fade 0.2s;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.sheet-card {
  position: relative;
  width: min(520px, 100%);
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(22px + var(--safe-b));
  box-shadow: var(--shadow);
  animation: up 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes up {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
}
.sheet-card h3 {
  margin: 14px 0 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 2px;
  border-top: 1px solid var(--line);
  text-align: left;
  font-size: 15.5px;
}
.menu-row:first-of-type {
  border-top: 0;
}
.menu-row span {
  flex: 1;
}
.menu-row em {
  font-style: normal;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}
.switch {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--line-strong);
  position: relative;
  transition: background 0.2s;
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.switch[aria-checked="true"] {
  background: var(--accent);
}
.switch[aria-checked="true"]::after {
  transform: translateX(18px);
}
.kv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  font-size: 14px;
  color: var(--muted);
}
.kv b {
  color: var(--text);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ── wide screens: conversation left, display right ──────────────────── */
@media (min-width: 900px) {
  #main {
    grid-template-columns: minmax(340px, 400px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "top top" "talk stage";
  }
  .top {
    padding: 14px 20px 8px 26px;
    border-bottom: 1px solid var(--line);
  }
  .talk {
    padding: 0 22px 22px 26px;
    border-right: 1px solid var(--line);
    min-height: 0;
  }
  .transcript {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 0 10px;
    scrollbar-width: thin;
  }
  .turn {
    font-size: 15px;
    line-height: 1.5;
  }
  .turn[data-role="user"] {
    color: var(--muted);
  }
  .turn[data-role="user"]::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--faint);
    margin-right: 8px;
    transform: translateY(-2px);
  }
  .caption {
    text-align: left;
    min-height: 70px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
  }
  .stage {
    padding: 18px 22px 12px;
  }
  .view-body {
    padding: 2px 24px 24px;
  }
  .view-head {
    padding: 20px 16px 12px 24px;
  }
  .view-title {
    font-size: 20px;
  }
  .stats {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }
  .cards {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
  .media {
    grid-template-columns: repeat(3, 1fr);
  }
  .sheet {
    align-items: center;
  }
  .sheet-card {
    border-radius: 22px;
  }
  .connect {
    max-width: 440px;
    margin: 0 auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
