/* Hallmark · macrostructure: Index-First · tone: utilitarian · anchor hue: 84 warm paper, coral accent 32
 * nav: N3 side-rail, widened to an app sidebar · footer: none (app surface) · theme: custom (Kora tokens, unchanged)
 * pre-emit critique: P4 H4 E4 S4 R5 V4
 *
 * Kora workspace portal. Every colour, face and size comes from /tokens.css, so the
 * light and dark schemes there apply here with no second palette. Two surfaces:
 * the sidebar sits on paper, the working column on the lighter raised paper.
 *
 * Signed-out screen: Split Studio diptych (sign-in card left, proof panel right),
 * pre-emit critique P4 H4 E4 S5 R4 V4. The proof panel is a peach tint with a
 * static grain, never the accent, so the accent stays a highlighter.
 */

:root {
  /* Google's own mark colours, lifted to tokens so the sign-in button never inlines a value. */
  --color-google-blue: oklch(63.04% 0.18 259.96);
  --color-google-green: oklch(64.75% 0.1603 148.5);
  --color-google-yellow: oklch(83.04% 0.1698 83.99);
  --color-google-red: oklch(62.57% 0.2058 29.08);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

:root {
  --side-width: 16.5rem;
  --thread-max: 46rem;
  --page-max: 60rem;
  --top-height: 3.75rem;
}

* { box-sizing: border-box; }

html { overflow-x: clip; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--color-paper-light);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: fixed; inset-block-start: var(--space-sm); inset-inline-start: var(--space-sm);
  z-index: var(--z-tooltip); padding: var(--space-xs) var(--space-md); border-radius: var(--radius-sm);
  background: var(--color-ink); color: var(--color-paper-light);
  transform: translateY(-200%);
}
.skip:focus-visible { transform: translateY(0); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.wordmark {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.04em;
  font-size: var(--text-lg); line-height: 1; color: var(--color-ink); text-decoration: none;
}

.boot { padding: var(--space-xl) var(--page-gutter); color: var(--color-muted); }

/* ---- controls ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: var(--tap-target); padding-inline: var(--space-md);
  border: var(--rule-hair) solid var(--color-ink); border-radius: var(--radius-pill);
  background: var(--color-accent); color: var(--color-accent-ink);
  font: inherit; font-size: var(--text-xs); font-weight: 600; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--color-ink); border-color: var(--color-rule-strong); }
.btn-quiet { background: transparent; color: var(--color-ink-soft); border-color: transparent; padding-inline: var(--space-sm); text-decoration: underline; text-underline-offset: 0.2em; }
@media (hover: hover) {
  .btn:hover:not(:disabled) { background: var(--color-accent-hover); }
  .btn-ghost:hover:not(:disabled) { background: var(--color-paper-deep); border-color: var(--color-ink); }
  .btn-quiet:hover:not(:disabled) { background: transparent; color: var(--color-ink); }
}

.icon-btn {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: var(--tap-target); height: var(--tap-target);
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-ink-soft); cursor: pointer;
}
.icon-btn svg { width: 1.25rem; height: 1.25rem; }
@media (hover: hover) { .icon-btn:hover { background: var(--color-paper-deep); color: var(--color-ink); } }
.icon-btn:active, .nav-item:active, .recent-item:active { transform: translateY(1px); }

.field-label { display: block; font-size: var(--text-xs); font-weight: 600; margin-block-end: var(--space-2xs); }
.input {
  display: block; width: 100%; min-height: var(--tap-target); padding: var(--space-xs) var(--space-sm);
  border: var(--rule-hair) solid var(--color-rule-strong); border-radius: var(--radius-sm);
  outline: 2px solid transparent; outline-offset: 1px;
  background: var(--color-paper-light); color: var(--color-ink);
  font: inherit; font-size: max(1rem, var(--text-sm));
}
textarea.input { min-height: 6rem; resize: vertical; }
.input[aria-invalid="true"] { border-color: var(--color-accent-deep); }
.input:disabled { opacity: 0.55; cursor: not-allowed; }
@media (hover: hover) { .input:hover:not(:disabled) { background: var(--color-paper); } }

.note { color: var(--color-muted); font-size: var(--text-xs); }
.error { color: var(--color-accent-deep); font-size: var(--text-xs); }
/* A field's error keeps its line so the form doesn't jump; elsewhere an empty error takes no room. */
.error:empty { display: none; }
.input + .error:empty { display: block; min-height: 1lh; }
.status-line { color: var(--color-ink-soft); font-size: var(--text-xs); min-height: 1lh; }

/* ---- shell ---- */

.app { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100dvh; }

.side {
  position: fixed; inset-block: 0; inset-inline-start: 0; z-index: var(--z-modal);
  display: flex; flex-direction: column; gap: var(--space-md);
  width: min(var(--side-width), 86%);
  padding: var(--space-sm) var(--space-xs);
  padding-inline-start: max(var(--space-sm), env(safe-area-inset-left, 0px));
  padding-block-end: max(var(--space-md), env(safe-area-inset-bottom, 0px));
  background: var(--color-paper); border-inline-end: var(--rule-hair) solid var(--color-rule);
  overflow-y: auto;
  transform: translateX(-100%); visibility: hidden;
  transition: transform var(--dur-short) var(--ease-in), visibility 0s linear var(--dur-short);
}
.app.side-open .side {
  transform: none; visibility: visible;
  transition: transform var(--dur-short) var(--ease-out), visibility 0s;
}
.scrim { position: fixed; inset: 0; z-index: var(--z-sticky); background: var(--color-overlay); border: 0; padding: 0; width: 100%; }

.side-top { display: flex; align-items: center; justify-content: space-between; padding-inline: var(--space-sm); min-height: var(--tap-target); }
.side .wordmark { font-size: var(--text-md); }

.nav { display: flex; flex-direction: column; gap: var(--space-3xs); }
.nav-item {
  display: flex; align-items: center; gap: var(--space-sm); min-height: var(--tap-target); padding-inline: var(--space-sm);
  border-radius: var(--radius-sm); color: var(--color-ink-soft); font-size: var(--text-xs); text-decoration: none; white-space: nowrap;
}
.nav-icon { width: 1.125rem; height: 1.125rem; flex: 0 0 auto; }
.side-new { color: var(--color-ink); font-weight: 600; margin-block-end: var(--space-xs); }
.nav-item[aria-current="page"] { background: var(--color-paper-deep); color: var(--color-ink); font-weight: 600; }
@media (pointer: fine) { .nav-item { min-height: 2.25rem; } }
@media (hover: hover) { .nav-item:hover { background: var(--color-paper-deep); color: var(--color-ink); } }

.side-label { padding-inline: var(--space-sm); margin-block-end: var(--space-2xs); color: var(--color-muted); font-size: var(--text-2xs); font-weight: 500; }
/* The list takes what room is left and scrolls inside it, so it can never run into the account block below. */
.recent { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.recent ul { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.side-top, .side-new, .nav, .side-foot { flex: 0 0 auto; }
.recent-item {
  display: block; width: 100%; min-height: 2.25rem; padding: var(--space-2xs) var(--space-sm);
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-ink-soft);
  font: inherit; font-size: var(--text-xs); text-align: start; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (hover: hover) { .recent-item:hover { background: var(--color-paper-deep); color: var(--color-ink); } }

.side-foot {
  margin-block-start: auto; padding: var(--space-sm) var(--space-sm) 0;
  border-block-start: var(--rule-hair) solid var(--color-rule);
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-sm); align-items: center;
  font-size: var(--text-2xs); color: var(--color-muted);
}
.avatar {
  grid-row: span 2; display: grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: var(--radius-pill); background: var(--color-peach); color: var(--color-ink);
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-xs);
}
.whoami-name { color: var(--color-ink); font-size: var(--text-xs); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whoami-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; min-height: var(--tap-target); color: var(--color-ink-soft); white-space: nowrap; }
@media (hover: hover) { .logout:hover { color: var(--color-ink); } }

.main-col { display: flex; flex-direction: column; min-width: 0; height: 100dvh; }
.top {
  flex: 0 0 auto; display: flex; align-items: center; gap: var(--space-xs);
  min-height: var(--top-height); padding-inline: var(--space-xs) var(--page-gutter);
  padding-inline-start: max(var(--space-xs), env(safe-area-inset-left, 0px));
}
.top-text { min-width: 0; }
.view-title { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; font-size: var(--text-base); line-height: 1.15; overflow-wrap: anywhere; min-width: 0; }
.view-sub { color: var(--color-muted); font-size: var(--text-2xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.main:focus { outline: none; }
.view { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.page { width: min(100%, var(--page-max)); margin-inline: auto; padding: var(--space-lg) var(--page-gutter) var(--space-2xl); }

@media (min-width: 60rem) {
  .app { grid-template-columns: var(--side-width) minmax(0, 1fr); }
  .app.side-collapsed { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; inset-block-start: 0; height: 100dvh; width: auto; z-index: var(--z-base); transform: none; visibility: visible; transition: none; }
  .app.side-collapsed .side { display: none; }
  .scrim { display: none; }
}

/* ---- messages ---- */

.view-chat { display: flex; flex-direction: column; overflow: hidden; }
.thread-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.thread { width: min(100%, var(--thread-max)); margin-inline: auto; padding: var(--space-lg) var(--page-gutter) var(--space-md); display: flex; flex-direction: column; gap: var(--space-md); }
.thread-more { align-self: center; }

.msg { display: flex; flex-direction: column; gap: var(--space-3xs); max-width: 88%; align-self: flex-start; }
.msg-user { align-self: flex-end; align-items: flex-end; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-user .msg-text { padding: var(--space-xs) var(--space-md); border-radius: var(--radius-phone-bubble); border-end-end-radius: var(--radius-phone-tail); background: var(--color-paper-deep); }
.link-chip {
  display: inline-flex; align-items: baseline; gap: var(--space-xs); max-width: 100%;
  padding: var(--space-3xs) var(--space-sm); margin-block: var(--space-3xs);
  border: var(--rule-hair) solid var(--color-rule-strong); border-radius: var(--radius-sm);
  background: var(--color-paper); color: var(--color-ink); font-weight: 500; text-decoration: none;
  overflow-wrap: anywhere; vertical-align: baseline;
}
.link-source { flex: 0 0 auto; color: var(--color-muted); font-size: var(--text-2xs); font-weight: 400; }
@media (hover: hover) { .link-chip:hover { border-color: var(--color-ink); background: var(--color-paper-deep); } }
.link-chip:active { transform: translateY(1px); }
.msg-meta { color: var(--color-muted); font-size: var(--text-2xs); }
.msg-failed .msg-text { outline: var(--rule-hair) dashed var(--color-accent-deep); }
.day { align-self: center; color: var(--color-muted); font-size: var(--text-2xs); }

.typing { display: flex; align-items: center; gap: var(--space-xs); color: var(--color-muted); font-size: var(--text-xs); }
.typing-dots { display: inline-flex; gap: var(--space-2xs); }
.typing-dots i { width: 0.35rem; height: 0.35rem; border-radius: var(--radius-pill); background: var(--color-muted); animation: typing 1.2s var(--ease-in-out) infinite; }
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.composer-wrap { flex: 0 0 auto; padding: var(--space-xs) var(--page-gutter) max(var(--space-md), env(safe-area-inset-bottom, 0px)); }
.composer {
  width: min(100%, var(--thread-max)); margin-inline: auto;
  display: flex; align-items: flex-end; gap: var(--space-xs);
  padding: var(--space-xs); padding-inline-start: var(--space-lg);
  border: var(--rule-hair) solid var(--color-rule-strong); border-radius: calc(var(--tap-target) / 2 + var(--space-xs));
  background: var(--color-paper-light); box-shadow: var(--shadow-soft);
}
.composer-send {
  display: grid; place-items: center; flex: 0 0 auto; width: var(--tap-target); height: var(--tap-target);
  border: 0; border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-accent-ink); cursor: pointer;
  transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.composer-send svg { width: 1.25rem; height: 1.25rem; }
.composer-send:active { transform: translateY(1px); }
.composer-send:disabled { background: var(--color-disabled); cursor: not-allowed; }
@media (hover: hover) { .composer-send:hover:not(:disabled) { background: var(--color-accent-hover); } }
.composer:focus-within { border-color: var(--color-ink); outline: 2px solid var(--color-focus); outline-offset: 2px; }
.composer-input {
  flex: 1 1 auto; min-width: 0; min-height: var(--tap-target); max-height: 12rem; padding: var(--space-xs) 0;
  border: 0; outline: 0; resize: none; background: transparent; color: var(--color-ink);
  font: inherit; font-size: max(1rem, var(--text-sm)); line-height: 1.5;
}
.composer-input::placeholder { color: var(--color-muted); }
.composer-note { width: min(100%, var(--thread-max)); margin: var(--space-2xs) auto 0; }

/* An empty thread puts the greeting and the composer together in the middle, the way a new chat opens. */
.view-chat.is-empty { justify-content: center; padding-block-end: var(--space-3xl); }
.view-chat.is-empty .thread-scroll { flex: 0 0 auto; }
.view-chat.is-empty .composer-wrap { padding-block-end: 0; }
.empty-start { align-items: center; text-align: center; padding-block: 0 var(--space-md); }
.empty-start-title {
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); line-height: 1.1;
  letter-spacing: -0.03em; overflow-wrap: anywhere; min-width: 0;
}
.empty-start p { max-width: 46ch; }

/* ---- setup checklist ---- */

.setup { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-md); padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-xs); }
.setup-title { font-size: var(--text-sm); font-weight: 600; }
.setup-step { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs) var(--space-sm); padding-block: var(--space-2xs); border-block-start: var(--rule-hair) solid var(--color-rule); }
.setup-step-name { flex: 1 1 12rem; min-width: 0; }
.setup-step.is-done .setup-step-name { color: var(--color-muted); }

/* ---- job cards and rows ---- */

.job {
  align-self: stretch; display: flex; flex-direction: column; gap: var(--space-xs);
  padding: var(--space-md); border: var(--rule-hair) solid var(--color-rule-strong); border-radius: var(--radius-md);
}
.job-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2xs) var(--space-sm); font-size: var(--text-xs); color: var(--color-ink-soft); }
.job-title { font-weight: 600; overflow-wrap: anywhere; }
.job-summary { color: var(--color-ink-soft); font-size: var(--text-xs); overflow-wrap: anywhere; }
.job-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.job-ask { font-size: var(--text-xs); font-weight: 600; flex: 1 1 100%; }

.state { display: inline-flex; align-items: center; gap: var(--space-2xs); font-weight: 600; color: var(--color-ink); white-space: nowrap; }
.state::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: var(--radius-pill); border: var(--rule-strong) solid currentColor; }
.state[data-tone="live"]::before { background: currentColor; }
.state[data-tone="alert"] { color: var(--color-accent-deep); }
.state[data-tone="alert"]::before { background: currentColor; border-radius: var(--radius-xs); }
.state[data-tone="off"] { color: var(--color-muted); }

.filters { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-block-end: var(--space-md); }
.filter { flex: 1 1 9rem; min-width: 0; }

.rows { border-block-start: var(--rule-hair) solid var(--color-rule); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-md); padding-block: var(--space-md); border-block-end: var(--rule-hair) solid var(--color-rule); }
.row-main { flex: 1 1 14rem; min-width: 0; }
.row-name { font-size: inherit; font-weight: 600; overflow-wrap: anywhere; }
.row-desc { color: var(--color-muted); font-size: var(--text-xs); overflow-wrap: anywhere; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
button.row-open { all: unset; cursor: pointer; font-weight: 600; text-decoration: underline; text-decoration-color: var(--color-rule-strong); text-underline-offset: 0.2em; overflow-wrap: anywhere; }
button.row-open:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

.empty { padding-block: var(--space-xl); display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-xs); }
.empty-title { font-weight: 600; }
.empty p { color: var(--color-muted); max-width: 52ch; }

.skeleton { height: 1rem; border-radius: var(--radius-xs); background: var(--color-paper-deep); margin-block: var(--space-md); }
.skeleton:nth-child(2) { width: 72%; }
.skeleton:nth-child(3) { width: 48%; }

.section { margin-block-end: var(--space-xl); }
.section + .section { padding-block-start: var(--space-lg); border-block-start: var(--rule-hair) solid var(--color-rule); }
.section-title { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; font-size: var(--text-md); line-height: 1.2; margin-block-end: var(--space-2xs); overflow-wrap: anywhere; min-width: 0; }
.section-sub { color: var(--color-muted); font-size: var(--text-xs); margin-block-end: var(--space-md); max-width: 60ch; }
.sub-title { font-size: var(--text-sm); font-weight: 600; margin-block: var(--space-md) var(--space-2xs); }

.timeline { display: flex; flex-direction: column; border-inline-start: var(--rule-hair) solid var(--color-rule-strong); margin-inline-start: var(--space-2xs); }
.timeline li { position: relative; padding: 0 0 var(--space-md) var(--space-md); }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -0.3rem; inset-block-start: 0.45em; width: 0.55rem; height: 0.55rem; border-radius: var(--radius-pill); background: var(--color-paper-light); border: var(--rule-hair) solid var(--color-ink-soft); }
.timeline-what { overflow-wrap: anywhere; }
.timeline-when { color: var(--color-muted); font-size: var(--text-2xs); }

.detail-links { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); margin-block: var(--space-sm) var(--space-lg); font-size: var(--text-xs); }

/* ---- connectors ---- */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: var(--space-md); }
.card { display: flex; flex-direction: column; gap: var(--space-xs); min-width: 0; padding: var(--space-md); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-md); }
.card-agent { border-color: var(--color-rule-strong); }
.card-name { font-weight: 600; font-size: var(--text-sm); }
.card-detail { color: var(--color-muted); font-size: var(--text-xs); overflow-wrap: anywhere; flex: 1 1 auto; }
.card-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-block-start: var(--space-xs); }
.card .state { font-size: var(--text-xs); }

.drawer {
  position: fixed; inset-block: 0; inset-inline: auto 0; margin: 0;
  width: min(30rem, 100%); max-width: none; height: 100dvh; max-height: none;
  padding: 0; border: 0; border-inline-start: var(--rule-hair) solid var(--color-rule);
  background: var(--color-paper-light); color: var(--color-ink);
}
.drawer::backdrop { background: var(--color-overlay); }
.drawer[open] { display: flex; flex-direction: column; animation: drawer-in var(--dur-short) var(--ease-out); }
@keyframes drawer-in {
  from { opacity: 0; transform: translateX(1.5rem); }
  to { opacity: 1; transform: none; }
}
.drawer-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-lg); border-block-end: var(--rule-hair) solid var(--color-rule); }
.drawer-title { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; font-size: var(--text-md); }
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: var(--space-lg); padding-block-end: max(var(--space-xl), env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: var(--space-lg); }

.steps { display: flex; flex-direction: column; gap: var(--space-lg); counter-reset: step; }
.step { counter-increment: step; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-xs); }
.step-title { font-weight: 600; }
.step-title::before { content: counter(step) ". "; font-variant-numeric: tabular-nums; }
.step p { color: var(--color-ink-soft); font-size: var(--text-xs); max-width: 60ch; }
.drawer-status { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2xs); padding-block-end: var(--space-md); border-block-end: var(--rule-hair) solid var(--color-rule); }
.drawer-status p { color: var(--color-ink-soft); font-size: var(--text-xs); max-width: 60ch; }
.chip { display: inline-block; padding: var(--space-3xs) var(--space-xs); border: var(--rule-hair) solid var(--color-rule-strong); border-radius: var(--radius-xs); background: var(--color-paper); color: var(--color-ink); font-weight: 500; overflow-wrap: anywhere; }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); font-size: var(--text-xs); }
.copy-label { flex: 0 0 3.5rem; color: var(--color-muted); }
.btn-small { min-height: var(--tap-target); padding-inline: var(--space-sm); }
.example { padding: var(--space-xs) var(--space-md); border-inline-start: var(--rule-strong) solid var(--color-rule-strong); margin-block: var(--space-xs); overflow-wrap: anywhere; }
.more summary { display: flex; align-items: center; min-height: var(--tap-target); cursor: pointer; font-size: var(--text-xs); font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; }
.more[open] summary { margin-block-end: var(--space-md); }
.link-list { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2xs); font-size: var(--text-xs); }
.perm-list { font-size: var(--text-xs); color: var(--color-ink-soft); columns: 2; column-gap: var(--space-lg); }

/* ---- settings ---- */

.pairs { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2xs) var(--space-lg); }
.pairs dt { color: var(--color-muted); font-size: var(--text-xs); }
.pairs dd { margin: 0 0 var(--space-sm); overflow-wrap: anywhere; }
@media (min-width: 40rem) {
  .pairs { grid-template-columns: 12rem minmax(0, 1fr); }
  .pairs dd { margin-block-end: var(--space-xs); }
}
.choice { display: flex; align-items: center; gap: var(--space-sm); min-height: var(--tap-target); cursor: pointer; }
.choice input { width: 1.15rem; height: 1.15rem; accent-color: var(--color-accent-deep); flex: 0 0 auto; }
.choices { border: 0; padding: 0; margin: 0; min-width: 0; }
.choices legend { padding: 0; font-size: var(--text-xs); font-weight: 600; margin-block-end: var(--space-2xs); }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.confirm-ask { flex: 1 1 100%; font-size: var(--text-xs); font-weight: 600; }

/* ---- what Kora knows ---- */

.profile-list li { padding-block: var(--space-2xs); overflow-wrap: anywhere; }
.profile-basis { color: var(--color-muted); font-size: var(--text-xs); }
.note-text { overflow-wrap: anywhere; }
.note-doubt { color: var(--color-accent-deep); font-size: var(--text-xs); }
.note-form { flex: 1 1 100%; min-width: 0; }
.note-form .row-actions { margin-block-start: var(--space-sm); }

/* ---- signed out ---- */

.signin {
  min-height: 100dvh; display: grid; gap: var(--space-sm);
  padding: var(--space-sm); background: var(--color-paper);
}

.signin-card {
  display: flex; flex-direction: column; gap: var(--space-2xl);
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-md);
  background: var(--color-paper-light);
}
.signin-body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-sm); max-width: 30rem; }
.signin-card h1 {
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl);
  line-height: 1.05; letter-spacing: -0.035em; overflow-wrap: anywhere; min-width: 0;
}
.signin-lead { font-size: var(--text-base); color: var(--color-ink-soft); max-width: 46ch; }

.signin-google {
  display: inline-flex; align-items: center; gap: var(--space-sm);
  min-height: var(--control-height); padding-inline: var(--space-lg);
  margin-block: var(--space-lg) var(--space-2xs);
  border: var(--rule-hair) solid var(--color-rule-strong); border-radius: var(--radius-sm);
  background: var(--color-paper-light); color: var(--color-ink);
  font-size: var(--text-base); font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
.signin-google:active { transform: translateY(1px); }
@media (hover: hover) {
  .signin-google:hover { background: var(--color-paper-deep); border-color: var(--color-ink); }
}
.g-mark { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; }
.g-blue { fill: var(--color-google-blue); }
.g-green { fill: var(--color-google-green); }
.g-yellow { fill: var(--color-google-yellow); }
.g-red { fill: var(--color-google-red); }

.signin-body .note { font-size: var(--text-xs); color: var(--color-ink-soft); max-width: 46ch; }
.signin-legal { margin-block-start: auto; font-size: var(--text-xs); color: var(--color-muted); max-width: 46ch; }
.signin-legal a { color: var(--color-ink-soft); text-underline-offset: 0.2em; white-space: nowrap; }
@media (hover: hover) {
  .signin-legal a:hover { color: var(--color-ink); }
}

/* Proof half: what signing in gets you, shown as the thread itself. */
.signin-proof {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-2xl);
  padding: var(--space-xl) var(--space-lg);
  border-radius: var(--radius-md); background: var(--color-peach); color: var(--color-ink);
}
.signin-proof::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--grain); opacity: 0.22;
}
.signin-proof h2 {
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl);
  line-height: 1.08; letter-spacing: -0.03em; max-width: 17ch; overflow-wrap: anywhere; min-width: 0;
}

.proof-thread { display: flex; flex-direction: column; gap: var(--space-xs); width: 100%; max-width: 27rem; align-self: flex-end; }
.proof-msg { display: flex; flex-direction: column; gap: var(--space-2xs); max-width: 85%; opacity: 0; transform: translateY(6px); animation: proof-in var(--dur-long) var(--ease-out) forwards; }
.proof-msg p { padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-md); font-size: var(--text-base); line-height: 1.35; overflow-wrap: anywhere; }
.proof-you { align-self: flex-end; align-items: flex-end; }
.proof-you p { background: var(--color-ink); color: var(--color-paper-light); }
.proof-kora { align-self: flex-start; }
.proof-kora p { background: var(--color-paper-light); border: var(--rule-hair) solid var(--color-rule); }
.proof-kora + .proof-you { margin-block-start: var(--space-sm); }
.proof-via { font-size: var(--text-xs); color: var(--color-ink-soft); }
.proof-msg:nth-child(2) { animation-delay: 110ms; }
.proof-msg:nth-child(3) { animation-delay: 220ms; }
.proof-msg:nth-child(4) { animation-delay: 330ms; }
@keyframes proof-in {
  to { opacity: 1; transform: none; }
}
@keyframes proof-fade {
  to { opacity: 1; }
}

@media (min-width: 60rem) {
  .signin { grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr); }
  .signin-card { padding: var(--space-4xl) var(--space-3xl) var(--space-xl); }
  .signin-proof { padding: var(--space-3xl) var(--space-2xl) var(--space-2xl); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 150ms !important; animation-iteration-count: 1 !important; transition-duration: 150ms !important; }
  .typing-dots i { animation: none; opacity: 0.7; }
  .drawer[open] { animation-name: none; }
  .proof-msg { transform: none; animation-name: proof-fade; }
}
