/* Lian web UI. Design tokens first; light and dark share every rule. */
:root {
  --bg: #f7f7f5; --surface: #ffffff; --surface-2: #f1f1ee; --line: #e6e5e0;
  --fg: #1c1c1a; --fg-2: #5b5b56; --fg-3: #8c8c86;
  --accent: #3b5bdb; --accent-2: #4c6ef5; --accent-soft: #eef2ff;
  --ok: #2f9e44; --ok-soft: #ebfbee; --warn: #e67700; --warn-soft: #fff4e6;
  --bad: #e03131; --bad-soft: #fff5f5;
  --shadow: 0 1px 2px rgba(20,20,15,.04), 0 8px 24px rgba(20,20,15,.06);
  --r: 16px; --r-sm: 10px;
  --col: 760px;
  --ff: "Inter", "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111112; --surface: #19191b; --surface-2: #222225; --line: #2c2c30;
  --fg: #ededee; --fg-2: #a7a7ad; --fg-3: #75757c;
  --accent: #7c95ff; --accent-2: #93a7ff; --accent-soft: #1c2240;
  --ok: #51cf66; --ok-soft: #13261a; --warn: #ffa94d; --warn-soft: #2b2012;
  --bad: #ff6b6b; --bad-soft: #2d1616;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--ff); font-size: 15px;
  line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.muted { color: var(--fg-2); }

/* shell */
.shell { height: var(--app-h, 100dvh); display: flex; flex-direction: column; max-width: var(--col);
  margin: 0 auto; padding: 0 16px; }
.top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: start;
  padding: 14px 0 8px; flex: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: var(--fg-2); position: relative; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.who-btn { display: flex; flex-direction: column; align-items: center; gap: 2px;
  justify-self: center; max-width: 100%; padding: 2px 10px; border-radius: 14px; }
.who-btn:hover .who-name { color: var(--accent); }
.orb { width: 44px; height: 44px; border-radius: 30%; margin-bottom: 4px; overflow: hidden;
  background: url(/assets/icons/icon-192.png) center / cover no-repeat;
  box-shadow: 0 6px 18px rgba(90,112,255,.35); }
.orb.busy { animation: breathe 2.4s ease-in-out infinite; }
.orb.big { width: 64px; height: 64px; margin: 0 auto 14px; }
@keyframes breathe { 50% { box-shadow: 0 6px 26px rgba(91,108,255,.65); transform: scale(1.04); } }
.who-name { font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.who-status { font-size: 12px; color: var(--fg-3); max-width: 420px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }

/* chat */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.thread { flex: 1; overflow-y: auto; padding: 12px 2px 8px; overflow-anchor: none; }
.thread-in { display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; flex-direction: column; gap: 8px; max-width: 100%; }
.msg.me { align-items: flex-end; }
.msg.me .bubble { background: var(--surface-2); padding: 10px 14px; border-radius: 18px 18px 6px 18px;
  max-width: 85%; white-space: pre-wrap; word-break: break-word; }
.msg.ai .bubble { max-width: 100%; word-break: break-word; }
.bubble p { margin: 0 0 10px; } .bubble p:last-child { margin: 0; }
.bubble ul, .bubble ol, .prose ul, .prose ol { margin: 4px 0 10px 20px; }
.bubble li { margin: 2px 0; }
.bubble code, .prose code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px;
  font-family: ui-monospace, monospace; font-size: .88em; }
.bubble pre, .prose pre { background: var(--surface-2); padding: 12px 14px; border-radius: 12px;
  overflow-x: auto; margin: 6px 0 10px; }
.bubble pre code { background: none; padding: 0; }
.working { display: flex; align-items: center; gap: 8px; color: var(--fg-3); font-size: 13.5px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3);
  animation: blink 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

.hello { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 20px 8px 40px; }
.hello h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 8px; }
.hello p { color: var(--fg-2); max-width: 470px; margin-bottom: 24px; }
.starters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 560px; }
.starter { text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--fg-2); font-size: 13.5px;
  transition: border-color .15s, color .15s, transform .1s; }
.starter:hover { border-color: var(--accent); color: var(--fg); }
.starter:active { transform: scale(.99); }
.starter { display: flex; flex-direction: column; gap: 6px; }
.starter-kind { font-size: 11px; color: var(--fg-3); letter-spacing: .02em; }
.starter-more { margin-top: 4px; color: var(--fg-2); gap: 6px; }

.composer { flex: none; padding: 8px 0 14px; }
.composer-in { display: flex; align-items: flex-end; gap: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 22px; padding: 8px 8px 8px 16px;
  box-shadow: var(--shadow); transition: border-color .15s; }
.composer-in:focus-within { border-color: var(--accent); }
.composer textarea { flex: 1; border: 0; outline: none; resize: none; background: none;
  line-height: 1.55; padding: 7px 0; max-height: 220px; }
.composer textarea::placeholder { color: var(--fg-3); }
.send { width: 38px; height: 38px; border-radius: 50%; background: var(--fg); color: var(--bg);
  display: grid; place-items: center; flex: none; transition: opacity .15s; }
.send:hover { opacity: .85; }
.send.stop { background: var(--surface-2); color: var(--fg); }
.composer-hint { text-align: center; font-size: 11.5px; color: var(--fg-3); margin-top: 6px; }

/* cards inside chat */
.cards { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 520px; }
.card { display: block; width: 100%; text-align: left; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; color: var(--fg);
  transition: border-color .15s, box-shadow .15s; }
button.card:hover, a.card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  text-decoration: none; }
.card-top { display: flex; align-items: center; gap: 6px; color: var(--fg-3); margin-bottom: 4px; }
.card-kind { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; flex: 1; }
.card-title { font-weight: 600; font-size: 14.5px; }
.card-sub { color: var(--fg-2); font-size: 13px; margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.card.shot { padding: 6px; }
.card.shot img { display: block; width: 100%; max-height: 420px; object-fit: contain; aspect-ratio: 16 / 10;
  border-radius: 10px; background: var(--surface-2); }
.card.approval { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background:
  linear-gradient(var(--surface), var(--surface)) padding-box; }
.card.approval.danger { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
.card .row { margin-top: 10px; }
.bar { height: 4px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }

/* pills & buttons */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--fg-2);
  white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.run { background: var(--accent-soft); color: var(--accent); }
.pill.wait { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  animation: blink 1.3s ease-in-out infinite; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  transition: opacity .15s, background .15s; white-space: nowrap; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--fg); color: var(--bg); }
.btn.primary:hover:not(:disabled) { opacity: .88; }
.btn.ghost { background: var(--surface-2); }
.btn.ghost:hover { background: var(--line); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { padding: 12px 16px; font-size: 15px; }
.btn.block { width: 100%; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.input { width: 100%; flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid transparent;
  border-radius: 12px; padding: 10px 12px; outline: none; transition: border-color .15s, background .15s; }
.input:focus { border-color: var(--accent); background: var(--surface); }

/* drawer, sheets, scrim */
.scrim { position: fixed; inset: 0; background: rgba(10,10,12,.35); backdrop-filter: blur(2px);
  z-index: 40; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); z-index: 41;
  background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px;
  display: flex; flex-direction: column; gap: 10px; animation: slideL .2s cubic-bezier(.2,.8,.3,1); }
@keyframes slideL { from { transform: translateX(-16px); opacity: .5; } }
.navs { display: flex; flex-direction: column; gap: 1px; }
.nav { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--fg-2); font-size: 14px; text-align: left; }
.nav:hover { background: var(--surface-2); color: var(--fg); }
.nav.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav span:first-of-type { flex: 1; }
.badge { font-size: 11px; font-weight: 700; background: var(--accent); color: #fff;
  border-radius: 999px; padding: 0 7px; min-width: 20px; text-align: center; }
.label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--fg-3); padding: 12px 12px 4px; }
.convs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
/* rows keep their height and the list scrolls; flex must not squash them */
.convs > * { flex-shrink: 0; }
.convs .sub { font-size: 11.5px; color: var(--fg-3); padding: 8px 12px 2px; }
.conv { text-align: left; padding: 8px 12px; border-radius: 10px; font-size: 13.5px; color: var(--fg-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv:hover { background: var(--surface-2); color: var(--fg); }
.conv.on { background: var(--surface-2); color: var(--fg); font-weight: 600; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--fg-2); flex: none; }
.me-text { min-width: 0; } .me-name { font-weight: 600; font-size: 13.5px; }
.me-mail { font-size: 12px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; }

.sheet { position: fixed; z-index: 41; background: var(--surface); display: flex; flex-direction: column;
  left: 50%; bottom: 0; transform: translateX(-50%); width: min(640px, 100vw); max-height: 88dvh;
  border-radius: 20px 20px 0 0; box-shadow: var(--shadow); animation: up .22s cubic-bezier(.2,.8,.3,1); }
.sheet.right { left: auto; right: 0; top: 0; bottom: 0; transform: none; width: min(400px, 92vw);
  max-height: none; border-radius: 0; animation: slideR .2s cubic-bezier(.2,.8,.3,1); }
@keyframes up { from { transform: translate(-50%, 24px); opacity: .5; } }
@keyframes slideR { from { transform: translateX(16px); opacity: .5; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px 20px;
  border-bottom: 1px solid var(--line); }
.sheet-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sheet-title { font-weight: 650; font-size: 16px; min-width: 0; overflow-wrap: anywhere; }
.sheet-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--fg-2); min-width: 0; }
.sheet-status > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-sum { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.goal-sum .ring { width: 20px; height: 20px; flex: none; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 44px; z-index: 5; min-width: 190px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; }
.menu-item { text-align: left; padding: 10px 12px; border-radius: 8px; font-size: 14px; color: var(--fg); }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); }
.sheet-section { display: flex; flex-direction: column; gap: 8px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; font-size: 14px; }
.steps li i { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); flex: none;
  display: grid; place-items: center; }
.steps li.done { color: var(--fg-3); }
.steps li.done i { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.now { background: var(--accent-soft); color: var(--fg); font-weight: 600; }
.steps li.now i { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface); background: var(--accent); }
.now-tag { margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--accent); }
.prose.result { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.file-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--fg); }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-chip:hover { border-color: var(--accent); }
.details { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.details > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--fg-2); list-style: none; }
.details > summary::-webkit-details-marker { display: none; }
.details > summary::before { content: "▸"; display: inline-block; margin-right: 6px; transition: transform .15s; }
.details[open] > summary::before { transform: rotate(90deg); }
.msg.ask { border-left: 3px solid var(--warn); padding-left: 12px; gap: 6px; }
.ask-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  color: var(--warn); letter-spacing: .02em; }
.goal-desc { margin: 0; }
@media (prefers-reduced-motion: reduce) { .details > summary::before { transition: none; } }
.sheet-body { overflow-y: auto; padding: 16px 20px 28px; display: flex; flex-direction: column; gap: 12px; }
.sheet.talks { height: 88dvh; }
.sheet.talks.right { height: auto; }
.sheet.talks .sheet-body { flex: 1; min-height: 0; overscroll-behavior: contain; }
.sheet-foot { flex: none; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
  background: var(--surface); }
.sheet-foot .composer-in { box-shadow: none; padding: 6px 6px 6px 14px; }
.sheet-foot textarea { flex: 1; border: 0; outline: none; resize: none; background: none; color: var(--fg);
  font: inherit; line-height: 1.5; padding: 7px 0; max-height: 160px; }
.sheet-foot textarea::placeholder { color: var(--fg-3); }
.sheet-foot .send { width: 36px; height: 36px; }
.talk-group { padding-top: 6px; border-top: 1px solid var(--line); }
.talk { gap: 14px; }
.talk .cards { max-width: 100%; }
.talk-empty { color: var(--fg-3); font-size: 13.5px; padding: 4px 2px; }

/* secondary pages */
.page { flex: 1; overflow-y: auto; padding: 4px 2px 40px; display: flex; flex-direction: column; gap: 10px; }
.page h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--fg-2); font-size: 13.5px;
  align-self: flex-start; padding: 4px 8px 4px 4px; border-radius: 8px; }
.back:hover { background: var(--surface-2); }
.group { display: flex; flex-direction: column; gap: 8px; }
.group > .label { padding-left: 2px; }
.row-card { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  color: var(--fg); }
.row-card.col { flex-direction: column; align-items: stretch; gap: 8px; }
.row-card.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
button.row-card:hover, a.row-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  text-decoration: none; }
.row-main { flex: 1; min-width: 0; }
.row-main.link { text-align: left; color: inherit; background: none; padding: 0; }
.row-title .tag { margin-left: 8px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); vertical-align: 1px; }
.row-title .tag.muted { background: var(--surface-2); color: var(--fg-3); }
.group > .hint { color: var(--fg-3); font-size: 12.5px; padding: 0 2px 2px; }
.row-sub.fact-why { color: var(--fg); }
.row-sub.fact-src { font-size: 12px; color: var(--fg-3); }
.row-title { font-weight: 600; font-size: 14.5px; }
.row-sub { color: var(--fg-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.seg { display: flex; gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 3px; flex-wrap: wrap; }
.seg button { flex: 1; padding: 7px 10px; border-radius: 9px; font-size: 13px; color: var(--fg-2); }
.seg button.on { background: var(--surface); color: var(--fg); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg.small { margin-top: 16px; justify-content: center; }
.callout { border-radius: 12px; padding: 12px 14px; font-size: 13.5px; }
.callout.wait { background: var(--warn-soft); } .callout.bad { background: var(--bad-soft); color: var(--bad); }
.callout .row { margin-top: 10px; }
.empty { text-align: center; padding: 48px 20px; color: var(--fg-3); }
.empty-ic { width: 54px; height: 54px; border-radius: 16px; background: var(--surface-2);
  display: grid; place-items: center; margin: 0 auto 14px; color: var(--fg-2); }
.empty-t { font-weight: 600; color: var(--fg); margin-bottom: 4px; }
.empty-s { font-size: 13.5px; max-width: 360px; margin: 0 auto; }
.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 14px;
  display: flex; flex-direction: column; gap: 12px; }
.tl { position: relative; }
.tl::before { content: ""; position: absolute; left: -20px; top: 7px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--line); border: 2px solid var(--surface); }
.tl.result::before { background: var(--ok); } .tl.error::before { background: var(--bad); }
.tl.approval::before { background: var(--warn); }
.tl-t { font-size: 13.5px; font-weight: 600; }
.tl-d { font-size: 12.5px; color: var(--fg-2); white-space: pre-wrap; word-break: break-word; }
.tl-at { font-size: 11.5px; color: var(--fg-3); }
.surf { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 4px 0; }
.surf .st { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.surf-n { display: flex; flex-direction: column; min-width: 0; }
.surf-d { font-size: 12px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.st.off { background: var(--fg-3); opacity: .5; }
.st.no { border: 1.5px dashed var(--fg-3); }
.surf-r { margin-left: auto; font-size: 12.5px; color: var(--fg-3); text-align: right; max-width: 60%; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.file-card { display: flex; flex-direction: column; gap: 4px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 8px; color: var(--fg); }
.file-card:hover { border-color: var(--accent); text-decoration: none; }
.file-card img { width: 100%; height: 110px; object-fit: cover; border-radius: 9px; background: var(--surface-2); }
.file-ic { height: 110px; display: grid; place-items: center; background: var(--surface-2);
  border-radius: 9px; color: var(--fg-3); }
.file-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 11.5px; color: var(--fg-3); }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.82);
  display: grid; place-items: center; padding: 24px; cursor: zoom-out; animation: fade .15s; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* auth: brand story on the left, the form on the right; one column on phones */
.auth { min-height: var(--app-h, 100dvh); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  position: relative; background: var(--bg); }
.auth-lang { position: absolute; top: 18px; right: 20px; z-index: 2; width: auto; }
.auth-brand { position: relative; overflow: hidden; color: #eef0ff; padding: 56px clamp(28px, 5vw, 72px);
  display: flex; flex-direction: column; justify-content: center; gap: 22px;
  background:
    radial-gradient(620px 420px at 12% 8%, rgba(47,180,200,.42), transparent 62%),
    radial-gradient(700px 520px at 92% 96%, rgba(124,92,255,.55), transparent 60%),
    linear-gradient(160deg, #0d1030 0%, #1d1a4d 52%, #14133a 100%); }
.auth-brand::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%); }
.auth-brand > * { position: relative; z-index: 1; max-width: 520px; }
.auth-logo { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.auth-logo .orb { width: 40px; height: 40px; margin: 0; box-shadow: 0 8px 24px rgba(47,180,200,.35); }
.auth-hero { font-size: clamp(34px, 4.2vw, 52px); line-height: 1.12; font-weight: 750; letter-spacing: -.035em;
  white-space: pre-line; text-wrap: balance;
  background: linear-gradient(92deg, #ffffff 30%, #b9c4ff 70%, #8fe3ee); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.auth-lede { font-size: 16.5px; line-height: 1.65; color: rgba(232,235,255,.78); max-width: 46ch; }
.auth-feats { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; margin-top: 4px; }
.auth-feats li { display: flex; gap: 12px; align-items: flex-start; }
.auth-feats .feat-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #a9e8f1; }
.auth-feats b { display: block; font-size: 14.5px; font-weight: 650; color: #fff; }
.auth-feats li span:not(.feat-ic) { display: block; font-size: 13px; line-height: 1.5; color: rgba(225,229,255,.66); }
.auth-preview { margin-top: 8px; padding: 16px; border-radius: 18px; display: flex; flex-direction: column; gap: 10px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(6px); box-shadow: 0 24px 60px rgba(4,6,30,.45); }
.pv-msg { font-size: 13.5px; line-height: 1.5; padding: 9px 13px; border-radius: 14px; max-width: 86%; }
.pv-msg.me { align-self: flex-end; background: rgba(255,255,255,.14); border-radius: 14px 14px 4px 14px; }
.pv-msg.ai { align-self: flex-start; color: rgba(236,239,255,.9); padding-left: 2px; }
.pv-card { background: #fff; color: #1c1c1a; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; }
.pv-card-top { display: flex; justify-content: space-between; align-items: center; }
.pv-time { font-size: 12px; color: #8c8c86; }
.pv-title { font-weight: 650; font-size: 14px; }
.pv-bar { height: 6px; border-radius: 3px; background: #eceef6; overflow: hidden; }
.pv-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #2fb4c8, #7c5cff); }
.pv-steps { font-size: 12.5px; color: #5b5b56; }
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  padding: 72px clamp(20px, 5vw, 64px) 32px; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.auth-card-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.auth-card h2 { font-size: 28px; font-weight: 720; letter-spacing: -.025em; }
.auth-card .callout { display: flex; gap: 8px; align-items: flex-start; }
.field { display: flex; flex-direction: column; gap: 7px; text-align: left; font-size: 13px;
  color: var(--fg-2); font-weight: 550; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > svg { position: absolute; left: 14px; color: var(--fg-3); pointer-events: none; }
.input-wrap .input { padding-left: 42px; height: 48px; border-radius: 12px; font-size: 15px;
  background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s; }
.input-wrap .input:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.input-wrap:focus-within > svg { color: var(--accent); }
.input-eye { position: absolute; right: 6px; width: 36px; height: 36px; border-radius: 10px; display: grid;
  place-items: center; color: var(--fg-3); }
.input-eye:hover { background: var(--surface-2); color: var(--fg); }
.input-wrap .input[name="password"] { padding-right: 46px; }
.auth-card .btn.lg { height: 50px; border-radius: 12px; font-size: 15.5px; font-weight: 650; margin-top: 4px;
  background: linear-gradient(135deg, #3b5bdb, #6a4cf5); color: #fff; box-shadow: 0 10px 24px rgba(74,84,230,.28); }
.auth-card .btn.lg:hover:not(:disabled) { filter: brightness(1.06); }
.auth-switch { font-size: 14px; color: var(--fg-2); text-align: center; }
.auth-switch a { font-weight: 600; }
.auth-trust { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.5; color: var(--fg-3);
  border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.auth-trust svg { flex: none; margin-top: 2px; color: var(--ok); }
.auth-foot { font-size: 11.5px; letter-spacing: .04em; color: var(--fg-3); text-align: center; }
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 64px 24px 30px; gap: 14px; }
  .auth-feats, .auth-preview { display: none; }
  .auth-hero { font-size: 32px; }
  .auth-lede { font-size: 15px; }
  .auth-panel { justify-content: flex-start; padding: 28px 20px 28px; }
  .auth-lang .on { background: rgba(255,255,255,.9); color: #1c1c1a; }
  .auth-lang { background: rgba(255,255,255,.14); }
  .auth-lang button:not(.on) { color: rgba(255,255,255,.85); }
}

.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 70;
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 13.5px;
  box-shadow: var(--shadow); animation: up .2s; }
.toast.bad { background: var(--bad); color: #fff; }

@media (max-width: 600px) {
  .shell { padding: 0 12px; }
  .starters { grid-template-columns: 1fr; }
  .composer-hint { display: none; }
  .who-status { max-width: 62vw; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* switches and the mobile tools list */
.switch { flex: none; width: 42px; height: 24px; border-radius: 12px; background: var(--surface-3, var(--line));
  position: relative; transition: background .15s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch.on { background: var(--accent); }
.switch.on i { transform: translateX(18px); }
.tool-groups { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 8px; }
.tool-group { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.row-title.sm { font-size: 14px; }
.tool-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); }
.tool-item.dim { opacity: .6; }
.tool-ex { font-size: 12.5px; color: var(--fg-3); margin-top: 3px; }

/* brand tagline under the name: L·I·A·N initials stand out */
.tagline { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; margin: -4px 0 6px;
  font-size: 12.5px; letter-spacing: .02em; color: var(--fg-3); }
.tagline b { color: var(--accent); font-weight: 700; }

/* goals look different from delegated work: violet tint, stripe, progress ring */
:root { --goal: #7C5CFF; }
.card.goal { position: relative; overflow: hidden; border-color: color-mix(in srgb, var(--goal) 35%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--goal) 10%, var(--surface)), var(--surface) 70%); padding-left: 18px; }
.card.goal::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--goal); }
.card.goal .card-kind { color: var(--goal); }
.goal-head { display: flex; align-items: center; gap: 12px; }
.goal-main { flex: 1; min-width: 0; }
.ring { width: 38px; height: 38px; flex: none; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: color-mix(in srgb, var(--goal) 18%, transparent); stroke-width: 4; }
.ring-fg { fill: none; stroke: var(--goal); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .4s; }
.card.task { border-left: 1px solid var(--line); }
.goal-chip { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 3px 8px; border-radius: 999px;
  font-size: 12px; color: var(--goal); background: color-mix(in srgb, var(--goal) 10%, transparent); cursor: pointer; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-group { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px;
  color: var(--goal); background: color-mix(in srgb, var(--goal) 8%, transparent); }
.goal-group-t { font-weight: 650; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-group-s { font-size: 12px; color: var(--fg-3); }

/* service connections */
.conn-badge { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px; letter-spacing: -.02em; }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.conn-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); }
.conn-card .btn { align-self: flex-start; }
.conn-tools { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.conn-tool { display: flex; align-items: flex-start; gap: 10px; }
.btn.danger { color: var(--bad); }
.input::placeholder, textarea::placeholder { color: var(--fg-3); font-weight: 400; opacity: 1; }
.pv-card .pill { background: #ebfbee; color: #2f9e44; }

/* wide screens: persistent sidebar + centred content column */
.frame { height: var(--app-h, 100dvh); display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px 14px;
  display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 8px; font-weight: 700; font-size: 17px;
  letter-spacing: -.01em; }
.side-brand .orb { width: 30px; height: 30px; margin: 0; border-radius: 9px; box-shadow: 0 4px 12px rgba(90,112,255,.3); }
.frame-main { min-width: 0; min-height: 0; display: flex; }
.frame-main .shell { flex: 1; max-width: 880px; width: 100%; }
.frame .top { grid-template-columns: 44px 1fr 44px; }

/* one primary colour across sign-in and the app: the brand indigo→violet */
:root { --brand: linear-gradient(135deg, #3b5bdb, #6a4cf5); }
.btn.primary, .send:not(.stop) { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(74,84,230,.22); }
.btn.primary:hover:not(:disabled), .send:not(.stop):hover { opacity: 1; filter: brightness(1.07); }
.btn.primary:disabled { box-shadow: none; }

/* VM live view */
.vm-frame { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  background: #0e0f14; aspect-ratio: 16 / 10; max-width: 100%; box-shadow: var(--shadow); }
.vm-frame img { display: block; width: 100%; height: 100%; object-fit: contain; cursor: crosshair; user-select: none; }
.vm-live { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: #fff; background: rgba(0,0,0,.55); padding: 4px 9px; border-radius: 999px; }
.vm-live i { width: 7px; height: 7px; border-radius: 50%; background: #ff4d5e; animation: blink 1.4s ease-in-out infinite; }
.vm-live.off i { background: #8c8c86; animation: none; }
.vm-tap { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  border: 2px solid #7c95ff; background: rgba(124,149,255,.25); pointer-events: none; animation: vmtap .6s ease-out forwards; }
@keyframes vmtap { to { transform: scale(1.8); opacity: 0; } }
.vm-type { display: flex; gap: 8px; }
.vm-type .input { flex: 1; min-width: 0; }
.vm-keys { display: flex; flex-wrap: wrap; gap: 6px; }
.vm-cta { margin-top: 8px; align-self: flex-start; }
.small { font-size: 12.5px; }
.vm-fs { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 10px;
  background: rgba(0,0,0,.55); color: #fff; font-size: 17px; display: grid; place-items: center; }
.vm-stage { display: flex; flex-direction: column; gap: 10px; }
.vm-stage.full { position: fixed; inset: 0; z-index: 80; background: #0b0c10; padding: calc(8px + env(safe-area-inset-top, 0px)) 8px calc(10px + env(safe-area-inset-bottom, 0px)); }
.vm-stage.full .vm-frame { flex: 1; min-height: 0; aspect-ratio: auto; border: 0; border-radius: 10px; }
.vm-stage.full .vm-keys .btn { background: rgba(255,255,255,.1); color: #fff; }
.vm-stage.full .input { background: #16171d; border-color: #2a2b33; color: #eee; }

/* settings: account first, sign out in reach */
.row-card.account { display: flex; align-items: center; gap: 14px; }
.avatar.lg { width: 44px; height: 44px; font-size: 18px; flex: none; }
.link-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.link-row .row-title { flex: 1; }
.link-row svg:last-child { transform: rotate(180deg); color: var(--fg-3); }
.me-card { cursor: pointer; border-radius: 12px; padding: 10px 8px 4px; }
.me-card:hover { background: var(--surface-2); }
.me-card .me-text { flex: 1; min-width: 0; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }

/* instructions queued on a running task */
.instruct .msgs { display: flex; flex-direction: column; gap: 6px; }
.imsg { display: flex; justify-content: space-between; gap: 10px; background: var(--accent-soft);
  border-radius: 10px; padding: 8px 12px; font-size: 13.5px; }
.imsg.read { background: var(--surface-2); color: var(--fg-2); }
.imsg-st { font-size: 12px; color: var(--fg-3); white-space: nowrap; }
.instruct textarea { flex: 1; min-width: 0; resize: vertical; }
.danger-text { color: var(--bad); }
.card.approval.done { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px;
  color: var(--fg-2); background: var(--surface-2); border-color: transparent; }
/* the Work page: what needs the person, goals with their running work, the rest */
.group.needs .row-card.need { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); text-align: left; }
.row-card.need .btn { flex: none; pointer-events: none; }
.goal-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.goal-card.paused { opacity: .7; }
.goal-card-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px;
  text-align: left; color: var(--fg); }
.goal-card-head:hover { background: var(--surface-2); }
.goal-card-head .ring { width: 30px; height: 30px; }
.goal-card-head > svg:last-child { transform: rotate(180deg); color: var(--fg-3); flex: none; }
.goal-card-work { display: flex; flex-direction: column; gap: 6px; padding: 0 10px 10px 54px; }
.goal-card-work .row-card { padding: 9px 12px; border-radius: 10px; background: var(--surface-2); border-color: transparent; }
/* Work page: in progress | finished */
.work-tabs { margin-bottom: 14px; flex-wrap: nowrap; }
.work-tabs .count { margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--line);
  font-size: 11px; font-variant-numeric: tabular-nums; }
.work-tabs button.on .count { background: var(--accent-soft); color: var(--accent); }
.done-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.keep-line { display: flex; align-items: center; gap: 8px; color: var(--fg-3); font-size: 13px; }
.keep-line .link { color: var(--accent); background: none; padding: 0; font-size: 13px; }
.done-head > .btn { margin-left: auto; }
.done-row { display: flex; align-items: center; gap: 10px; }
.done-row .row-main { flex: 1; min-width: 0; }
.done-row .icon-btn { flex: none; color: var(--fg-3); }
@media (max-width: 480px) { .goal-card-work { padding-left: 10px; } }

/* a finished task's or goal's panel: where the composer was, one quiet line */
.talk-closed { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line);
  color: var(--fg-3); font-size: 13px; text-align: center; }
