:root {
  --stone: #DCE3E1;
  --surface: #F3F6F4;
  --ink: #17232A;
  --ink-soft: #4F5E64;
  --line: #C3CDCA;
  --lagoon: #1D6B73;
  --lagoon-ink: #F3F6F4;
  --amber: #B97A12;
  --amber-wash: #F4E6C8;
  --danger: #A23B2C;
  --s1: #C2CDC9; --s2: #ACBCB6; --s3: #CDD7D3; --s4: #9DAFA9; --s5: #B7C5C0;
  --pebble-shadow: inset 0 2px 6px rgba(23, 35, 42, .10), 0 1px 0 rgba(255, 255, 255, .7);
  --stone-shadow: inset 0 -3px 0 rgba(23, 35, 42, .08), inset 0 2px 0 rgba(255, 255, 255, .45);
  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --stone: #1B2528; --surface: #243135; --ink: #E3EAE8; --ink-soft: #9DADB0; --line: #34444A;
    --lagoon: #5FB3B9; --lagoon-ink: #10191C; --amber: #E0A84A; --amber-wash: #3A2F1A; --danger: #E07A68;
    --s1: #2E3D41; --s2: #36474C; --s3: #29373A; --s4: #3E5056; --s5: #324246;
    --pebble-shadow: inset 0 2px 8px rgba(0, 0, 0, .35), 0 1px 0 rgba(255, 255, 255, .04);
    --stone-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25), inset 0 2px 0 rgba(255, 255, 255, .06);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--stone); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lagoon); outline-offset: 2px; }
a { color: var(--lagoon); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons, fields */
.btn { border: 0; border-radius: 999px; padding: 10px 20px; cursor: pointer; font-weight: 600; background: var(--lagoon); color: var(--lagoon-ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.quiet { background: none; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.round { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; flex: none; }
.btn.round svg { width: 18px; height: 18px; }
.field { width: 100%; border: 0; border-radius: 16px; background: var(--surface); padding: 12px 16px; box-shadow: var(--pebble-shadow); outline: none; }
.field:focus { outline: 2px solid var(--lagoon); outline-offset: 2px; }
.error { color: var(--danger); font-size: 14px; min-height: 1.3em; margin: 2px 0 0; }
.lang { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); box-shadow: var(--pebble-shadow); }
.lang button { border: 0; background: none; padding: 3px 10px; border-radius: 999px; font-size: 13px; cursor: pointer; color: var(--ink-soft); font-weight: 600; }
.lang button[aria-pressed="true"] { background: var(--lagoon); color: var(--lagoon-ink); }

/* ---------- the cairn illustration */
.cairn-art { width: 100%; max-width: 340px; height: auto; overflow: visible; }
.cairn-art .st { transform-box: fill-box; transform-origin: center; }
.cairn-art .hl { fill: #fff; opacity: .28; }
.cairn-art .river { fill: none; stroke: var(--lagoon); stroke-width: 2; stroke-linecap: round; opacity: .55; }
@media (prefers-color-scheme: dark) { .cairn-art .hl { opacity: .07; } }
@media (prefers-reduced-motion: no-preference) {
  .cairn-art.settle .st { animation: settle .7s cubic-bezier(.2, .9, .3, 1.15) both; }
  .cairn-art.settle .st:nth-of-type(1) { animation-delay: 0s; }
  .cairn-art.settle .st:nth-of-type(2) { animation-delay: .12s; }
  .cairn-art.settle .st:nth-of-type(3) { animation-delay: .24s; }
  .cairn-art.settle .st:nth-of-type(4) { animation-delay: .36s; }
  .cairn-art.settle .st:nth-of-type(5) { animation-delay: .48s; }
}
@keyframes settle { from { opacity: 0; transform: translateY(-36px) rotate(-4deg); } to { opacity: 1; transform: none; } }

/* ---------- auth */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { display: grid; place-items: center; padding: 48px; background: var(--surface); border-radius: 0 48px 48px 0; }
.auth-art figure { margin: 0; display: grid; justify-items: center; gap: 22px; }
.auth-art figcaption { font-family: var(--serif); font-size: 19px; color: var(--ink-soft); max-width: 30ch; text-align: center; line-height: 1.45; }
.auth-form-wrap { display: grid; place-items: center; padding: 40px 24px; position: relative; }
.auth-form-wrap .lang { position: absolute; top: 20px; right: 20px; }
.auth-card { width: min(380px, 100%); }
.auth-card h1 { font-size: 52px; letter-spacing: -.035em; margin: 0 0 4px; font-weight: 700; line-height: 1; }
.auth-card .lede { color: var(--ink-soft); margin: 0 0 30px; font-family: var(--serif); font-size: 20px; line-height: 1.4; }
.auth-card form { display: grid; gap: 10px; }
.auth-card .btn { padding: 13px; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px; border: 0; border-radius: 999px;
  background: var(--surface); box-shadow: var(--stone-shadow), 0 0 0 1px var(--line); font-weight: 600; cursor: pointer; color: var(--ink); text-decoration: none;
}
.google-btn svg { width: 18px; height: 18px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 13px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-card .switch { margin-top: 18px; font-size: 14px; color: var(--ink-soft); }
.auth-card .switch button { background: none; border: 0; color: var(--lagoon); cursor: pointer; padding: 0; text-decoration: underline; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 216px 1fr; height: 100dvh; }
.rail { display: flex; flex-direction: column; gap: 4px; padding: 22px 14px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 21px; letter-spacing: -.02em; padding: 0 10px 20px; }
.brand svg { width: 26px; height: 26px; }
.nav-btn { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 0; border-radius: 16px 20px 18px 14px; background: none; text-align: left; cursor: pointer; color: var(--ink-soft); font-weight: 500; }
.nav-btn:hover { color: var(--ink); }
.nav-btn[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--stone-shadow); }
.nav-btn svg { width: 19px; height: 19px; flex: none; }
.rail-foot { margin-top: auto; padding: 10px; font-size: 13px; color: var(--ink-soft); display: grid; gap: 10px; justify-items: start; }
.who { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; }
.who img, .who .mono { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.who .mono { display: grid; place-items: center; background: var(--s4); font-weight: 700; color: var(--ink); }
.who small { display: block; color: var(--ink-soft); font-size: 12px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--ink-soft); text-decoration: underline; cursor: pointer; font-size: 13px; justify-self: start; }
.main { overflow: hidden; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border-radius: 36px 0 0 36px; }
@media (prefers-color-scheme: dark) { .main { background: #1F2A2D; } }

/* ---------- home */
.page { overflow-y: auto; padding: 48px clamp(18px, 5vw, 72px) 56px; }
.home { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px 64px; max-width: 1100px; }
.hero h1 { font-size: clamp(34px, 4.6vw, 54px); line-height: 1.04; letter-spacing: -.035em; margin: 0 0 8px; font-weight: 650; }
.hero .date { color: var(--ink-soft); margin: 0 0 28px; font-family: var(--serif); font-size: 20px; }
.ideas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.idea { border: 0; padding: 8px 15px; cursor: pointer; background: var(--stone); color: var(--ink); font-size: 14px; box-shadow: var(--stone-shadow); }
.idea:nth-child(3n+1) { border-radius: 18px 22px 16px 20px; }
.idea:nth-child(3n+2) { border-radius: 22px 16px 20px 18px; }
.idea:nth-child(3n) { border-radius: 16px 20px 22px 18px; }
.idea:hover { background: var(--s3); }
.section-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.empty { color: var(--ink-soft); margin: 0; font-size: 15px; }
.lower { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 44px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--line); }
.list button, .list .row { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 11px 2px; background: none; border: 0; text-align: left; cursor: pointer; }
.list .row { cursor: default; }
.list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
.list button:hover .t { color: var(--lagoon); }

/* memories as a cairn of stones, newest on top */
.home > *, .lower > *, .side > * { min-width: 0; }
.side { display: grid; gap: 36px; align-content: start; }
.cairn { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 10px 0; overflow: hidden; }
.stone {
  position: relative; max-width: 100%; padding: 10px 34px 11px 18px; font-size: 14px; line-height: 1.35; text-align: center;
  background: var(--s1); box-shadow: var(--stone-shadow); color: var(--ink);
}
.stone:nth-child(5n+1) { background: var(--s1); border-radius: 26px 32px 24px 30px / 22px 26px 20px 24px; transform: translateX(-6px); }
.stone:nth-child(5n+2) { background: var(--s2); border-radius: 30px 22px 32px 26px / 24px 20px 26px 22px; transform: translateX(8px); }
.stone:nth-child(5n+3) { background: var(--s3); border-radius: 22px 30px 26px 34px / 20px 24px 22px 26px; transform: translateX(-3px); }
.stone:nth-child(5n+4) { background: var(--s4); border-radius: 34px 26px 30px 22px / 26px 22px 24px 20px; transform: translateX(5px); }
.stone:nth-child(5n) { background: var(--s5); border-radius: 28px 34px 22px 28px / 24px 26px 20px 22px; transform: translateX(-8px); }
.stone .x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; border: 0; background: none; color: var(--ink-soft); cursor: pointer; opacity: 0; }
.stone:hover .x, .stone .x:focus-visible { opacity: 1; }
@media (hover: none) { .stone .x { opacity: .7; } }
.cairn-base { width: 78%; height: 6px; border-radius: 50%; background: var(--line); opacity: .7; margin-top: 2px; }

.meter { margin-bottom: 16px; }
.meter-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.meter-head span:last-child { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.tank { height: 12px; border-radius: 999px; background: var(--stone); box-shadow: var(--pebble-shadow); overflow: hidden; }
.water { height: 100%; background: var(--lagoon); border-radius: 999px; transition: width .6s ease; }
.water.high { background: var(--amber); }

/* ---------- pebble composer (home + chat) */
.composer {
  display: flex; align-items: flex-end; gap: 8px; background: var(--stone);
  border-radius: 30px 34px 32px 28px / 28px 32px 34px 30px; box-shadow: var(--pebble-shadow); padding: 9px 9px 9px 22px;
}
.composer.big { padding: 14px 14px 14px 26px; border-radius: 40px 46px 42px 38px / 38px 42px 46px 40px; }
.composer.big textarea { font-size: 19px; min-height: 52px; }
.composer textarea { flex: 1; border: 0; background: none; resize: none; outline: none; padding: 10px 0; max-height: 220px; line-height: 1.45; }
.composer:focus-within { outline: 2px solid var(--lagoon); outline-offset: 3px; }

/* ---------- projects */
.page-head h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -.03em; margin: 0 0 6px; font-weight: 650; }
.page-head p { color: var(--ink-soft); margin: 0 0 28px; font-family: var(--serif); font-size: 19px; max-width: 52ch; }
.inline-form { display: flex; gap: 8px; margin: 0 0 24px; max-width: 560px; }
.inline-form .field { border-radius: 999px; }
.proj-list { max-width: 680px; }

/* ---------- chat */
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-head { padding: 20px clamp(16px, 5vw, 48px) 0; display: flex; gap: 12px; align-items: center; }
.chat-head h1 { font-size: 18px; margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head .btn { margin-left: auto; padding: 8px 16px; }
.log { flex: 1; overflow-y: auto; padding: 28px clamp(16px, 5vw, 48px) 12px; }
.log-inner { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.welcome { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 6vh 0 2vh; }
.welcome .cairn-art { max-width: 120px; }
.welcome p { font-family: var(--serif); font-size: 20px; color: var(--ink-soft); margin: 0; max-width: 34ch; }
.welcome .ideas { justify-content: center; }
.msg-user { align-self: flex-end; max-width: 80%; background: var(--stone); padding: 10px 17px; border-radius: 22px 24px 6px 22px; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: var(--stone-shadow); }
.msg-ai { font-family: var(--serif); font-size: 18.5px; line-height: 1.62; overflow-wrap: anywhere; }
.msg-ai p { margin: 0 0 .7em; }
.msg-ai p:last-child { margin-bottom: 0; }
.msg-ai pre { font: 14px/1.5 ui-monospace, monospace; background: var(--stone); padding: 12px 14px; border-radius: 14px; overflow-x: auto; }
.msg-ai code { font: .84em ui-monospace, monospace; background: var(--stone); padding: 1px 5px; border-radius: 6px; }
.msg-ai pre code { background: none; padding: 0; }
.msg-ai ul, .msg-ai ol { padding-left: 1.3em; margin: 0 0 .7em; }
.note { font-size: 14px; color: var(--ink-soft); margin: 0; }
.typing:empty::after { content: ""; display: inline-block; width: 22px; height: 10px; border-radius: 50%; background: var(--s4); animation: breathe 1.1s ease-in-out infinite; }
.typing:not(:empty)::after { content: "▍"; color: var(--lagoon); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes breathe { 50% { transform: scale(1.25, .8); opacity: .6; } }

.approval { border-radius: 24px 28px 22px 26px; background: var(--amber-wash); padding: 16px 20px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 45%, transparent); }
.approval strong { display: block; margin-bottom: 4px; }
.approval .url { font-size: 14px; overflow-wrap: anywhere; color: var(--ink-soft); }
.approval .actions { display: flex; gap: 8px; margin-top: 12px; }
.approval.resolved { opacity: .72; }
.handoff { margin: 0; border-radius: 20px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); background: var(--stone); }
.handoff img { display: block; width: 100%; height: auto; }
.handoff figcaption { padding: 9px 14px; font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; }
.composer-wrap { padding: 8px clamp(16px, 5vw, 48px) max(18px, env(safe-area-inset-bottom)); }
.composer-wrap .composer { max-width: 720px; margin: 0 auto; }

/* ---------- responsive */
@media (max-width: 980px) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .lower { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { border-radius: 0 0 40px 40px; padding: 28px 24px 22px; }
  .auth-art .cairn-art { max-width: 150px; }
  .auth-art figcaption { font-size: 17px; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .main { border-radius: 0 0 28px 28px; }
  .rail { grid-row: 2; flex-direction: row; justify-content: space-around; padding: 6px 8px max(6px, env(safe-area-inset-bottom)); }
  .brand, .rail-foot { display: none; }
  .nav-btn { flex-direction: column; gap: 2px; font-size: 12px; padding: 6px 16px; }
  .page { padding-top: 30px; }
  .mobile-only { display: flex; }
}
@media (min-width: 721px) { .mobile-only { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .water { transition: none; }
  .typing:empty::after, .typing:not(:empty)::after { animation: none; }
}

/* ================= v2 accessories ================= */
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn.danger { color: var(--danger); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: none; color: var(--ink-soft); cursor: pointer; }
.icon-btn:hover { background: var(--stone); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.on { color: var(--lagoon); background: var(--stone); }
.icon-btn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.composer .mic.on { color: #fff; background: var(--danger); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--danger) 18%, transparent); } }
.btn.round.stopping { background: var(--ink); color: var(--surface); }
.hint { color: var(--ink-soft); font-size: 13.5px; margin: -14px 0 22px; }
.lede-sm { color: var(--ink-soft); font-family: var(--serif); font-size: 18px; margin: 0 0 20px; max-width: 60ch; }
.meta { color: var(--ink-soft); font-size: 13px; }

/* hopping pebbles loader */
.hop { display: inline-flex; gap: 4px; align-items: flex-end; height: 14px; vertical-align: middle; margin-right: 8px; }
.hop i { width: 9px; height: 6px; border-radius: 50%; background: var(--lagoon); animation: hop 1s ease-in-out infinite; }
.hop i:nth-child(2) { animation-delay: .15s; background: var(--s4); }
.hop i:nth-child(3) { animation-delay: .3s; background: var(--s2); }
@keyframes hop { 0%, 100% { transform: translateY(0) scaleX(1.1); } 45% { transform: translateY(-7px) scaleX(.9); } }

/* skeleton */
.skeleton { border-radius: 18px; background: linear-gradient(90deg, var(--stone) 25%, var(--s3) 50%, var(--stone) 75%); background-size: 300% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 50;
  background: var(--ink); color: var(--surface); padding: 10px 20px; border-radius: 999px 999px 999px 999px / 28px 32px 30px 26px; font-size: 14px; transition: .25s ease; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 720px) { .toast { bottom: 84px; } }

/* plan chip */
.plan-chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: capitalize; background: var(--s3); color: var(--ink); }
.plan-chip.plan-pro { background: var(--lagoon); color: var(--lagoon-ink); }
.plan-chip.plan-scale { background: var(--amber); color: #fff; }

/* hero ripples */
.hero { position: relative; }
.hero > *:not(.ripples) { position: relative; }
.ripples { position: absolute; left: -40px; right: -40px; top: 150px; width: calc(100% + 80px); height: 170px; pointer-events: none; }
.ripples ellipse { fill: none; stroke: var(--lagoon); stroke-width: 1; opacity: .12; transform-origin: 50% 50%; transform-box: fill-box; }
@media (prefers-reduced-motion: no-preference) {
  .ripples ellipse { animation: ripple 9s ease-out infinite; }
  .ripples ellipse:nth-child(2) { animation-delay: 3s; }
  .ripples ellipse:nth-child(3) { animation-delay: 6s; }
}
@keyframes ripple { 0% { transform: scale(.6); opacity: 0; } 30% { opacity: .16; } 100% { transform: scale(1.25); opacity: 0; } }
.idea { display: inline-flex; align-items: center; gap: 6px; }
.idea svg { width: 14px; height: 14px; color: var(--lagoon); flex: none; }

/* home blocks */
.col-main { display: grid; gap: 40px; min-width: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.block-head .section-title { margin: 0; }
.lower { margin-top: 0; }
.list .t svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 7px; color: var(--ink-soft); }
.empty-art { display: grid; justify-items: center; gap: 10px; text-align: center; }
.empty-art .cairn-art { max-width: 84px; }

/* action cards */
.cards { display: grid; gap: 10px; margin-top: 8px; }
.card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 14px 14px 16px; background: var(--stone); box-shadow: var(--stone-shadow);
  border-radius: 24px 28px 22px 26px / 22px 26px 24px 28px; transition: opacity .2s, transform .2s; }
.card:nth-child(2n) { border-radius: 28px 22px 26px 24px / 26px 22px 28px 24px; }
.card.leaving { opacity: 0; transform: translateX(16px); }
.card-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 46% 54% 50% 50% / 54% 46% 54% 46%; background: var(--lagoon); color: var(--lagoon-ink); }
.card-icon svg { width: 18px; height: 18px; }
.card.kind-task .card-icon { background: var(--amber); color: #fff; }
.card.kind-billing .card-icon { background: var(--s4); color: var(--ink); }
.card h3 { margin: 0; font-size: 15.5px; font-weight: 600; }
.card p { margin: 2px 0 0; font-size: 14px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-actions { display: flex; align-items: center; gap: 2px; }

/* panels */
.panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.panel-grid.big { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.panel-tile { background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--stone-shadow); border-radius: 26px 30px 24px 28px / 24px 28px 26px 30px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.panel-tile header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 6px 16px; background: var(--stone); }
.panel-tile h3 { margin: 0; font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-tile iframe { width: 100%; height: 280px; border: 0; background: var(--surface); display: block; }
.panel-tile.big iframe { height: 440px; }
.panel-wait { height: 280px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--ink-soft); font-size: 14px; padding: 16px; text-align: center; }
.panel-tile.big .panel-wait { height: 440px; }
.inline-form.wide { max-width: 760px; }
dialog.sheet { width: min(860px, calc(100vw - 24px)); height: min(760px, calc(100dvh - 24px)); border: 0; padding: 0; border-radius: 30px; background: var(--surface); color: var(--ink); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0, 0, 0, .25); }
dialog.sheet:not([open]) { display: none; }
dialog.sheet::backdrop { background: rgba(23, 35, 42, .45); }
dialog.sheet header { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px 24px; }
dialog.sheet h2 { margin: 0; font-size: 18px; }
dialog.sheet iframe { flex: 1; width: 100%; border: 0; background: var(--surface); }
.redesign { display: flex; gap: 8px; padding: 12px 14px 16px; border-top: 1px solid var(--line); }
.redesign .field { border-radius: 999px; flex: 1; }

/* settings */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 26px; padding: 4px; background: var(--stone); border-radius: 999px; width: fit-content; max-width: 100%; box-shadow: var(--pebble-shadow); }
.tabs button { border: 0; background: none; padding: 7px 15px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-soft); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--stone-shadow); }
.tab-body { max-width: 860px; }
.current-plan { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.current-plan .plan-chip { font-size: 14px; padding: 4px 14px; }
.usage-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 640px; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0 22px; }
.plan-card { background: var(--stone); box-shadow: var(--stone-shadow); padding: 18px; border-radius: 26px 30px 24px 28px / 24px 28px 26px 30px; display: grid; gap: 6px; align-content: start; }
.plan-card.current { box-shadow: inset 0 0 0 2px var(--lagoon), var(--stone-shadow); }
.plan-card h3 { margin: 0; font-size: 16px; }
.plan-card .price { margin: 4px 0 0; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.plan-card .price small { font-size: 14px; font-weight: 500; color: var(--ink-soft); margin-left: 4px; }
.plan-card .btn { justify-self: start; margin-top: 8px; }
.checkout, .invoice { background: var(--stone); box-shadow: var(--stone-shadow); border-radius: 28px; padding: 20px 22px; display: grid; gap: 12px; max-width: 560px; }
.checkout h3 { margin: 0; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); box-shadow: var(--pebble-shadow); width: fit-content; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.seg input:checked + span { background: var(--lagoon); color: var(--lagoon-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--lagoon); outline-offset: 2px; }
.invoice p { margin: 0; }
.invoice .amount { display: flex; align-items: center; gap: 6px; font-size: 18px; }
.invoice .amount strong { font-size: 30px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.invoice .addr { display: flex; align-items: center; gap: 6px; background: var(--surface); border-radius: 14px; padding: 8px 6px 8px 12px; }
.invoice code { font-size: 13px; overflow-wrap: anywhere; flex: 1; }
.invoice .status { display: flex; align-items: center; font-weight: 600; }
.conn { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--stone); box-shadow: var(--stone-shadow); border-radius: 24px 28px 22px 26px; max-width: 560px; }
.conn-logo { width: 42px; height: 42px; display: grid; place-items: center; background: var(--surface); border-radius: 50%; }
.conn-logo svg { width: 22px; height: 22px; }
.conn-body { flex: 1; min-width: 0; }
.conn-body h3 { margin: 0; font-size: 16px; }
.conn-body p { margin: 2px 0 0; }
a.btn { text-decoration: none; display: inline-block; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 24px; max-width: 760px; align-items: end; }
.grid-form .area, .grid-form .seg, .grid-form .row-fields { grid-column: 1 / -1; }
.grid-form .btn { justify-self: start; }
.field.area { border-radius: 18px; resize: vertical; min-height: 64px; }
.row-fields { display: flex; flex-wrap: wrap; gap: 10px; }
.mini { display: grid; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.mini[hidden] { display: none; }
.mini .field { color: var(--ink); }
select.field { appearance: none; padding-right: 30px; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.specs { display: grid; gap: 12px; }
.spec { background: var(--stone); box-shadow: var(--stone-shadow); border-radius: 22px 26px 20px 24px; padding: 14px 18px; }
.spec.paused { opacity: .65; }
.spec header { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.spec h3 { margin: 0; font-size: 15.5px; display: flex; align-items: center; gap: 6px; }
.spec h3 svg { width: 16px; height: 16px; color: var(--amber); }
.spec p { margin: 6px 0; font-size: 14.5px; }
.spec pre { white-space: pre-wrap; font: 14px/1.5 var(--sans); margin: 8px 0 0; color: var(--ink-soft); }
.spec .actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.spec details { font-size: 14px; margin-top: 6px; }
.spec summary { cursor: pointer; color: var(--lagoon); font-weight: 600; }
.msg-ai.small { font-size: 15.5px; margin-top: 6px; }

/* chat extras */
.chat-head .icon-btn { margin-left: auto; }
.chat-head .btn { margin-left: 4px; }
.status-line { min-height: 22px; padding: 0 clamp(16px, 5vw, 48px); max-width: 816px; margin: 0 auto; width: 100%; font-size: 13.5px; color: var(--ink-soft); display: flex; align-items: center; }
.chip-note { align-self: flex-start; background: var(--stone); padding: 4px 12px; border-radius: 999px; }
.live { margin: 0; border-radius: 22px; overflow: hidden; background: #0d1416; box-shadow: 0 0 0 1px var(--line); }
.live img { display: block; width: 100%; min-height: 120px; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: #0d1416; }
.live-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 12.5px; color: #cfe3e2; background: #142023; }
.live-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: #E0604A; animation: pulse-dot 1.4s ease-in-out infinite; }
.live-bar .live-url { margin-left: auto; opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live.ended .dot { background: var(--s4); animation: none; }
.live figcaption { padding: 8px 14px; font-size: 13px; color: #b7cac9; background: #142023; overflow-wrap: anywhere; }
@keyframes pulse-dot { 50% { opacity: .35; } }
.composer .icon-btn { width: 40px; height: 40px; }

@media (max-width: 980px) { .plans { grid-template-columns: 1fr; } .usage-row { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .grid-form { grid-template-columns: 1fr; }
  .nav-btn { padding: 6px 8px; font-size: 11px; }
  .nav-btn span { max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
  .tabs { border-radius: 22px; }
  .card { grid-template-columns: auto 1fr; }
  .card-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .ripples { display: none; }
  .hop i, .skeleton, .live-bar .dot, .composer .mic.on, .icon-btn.spin svg { animation: none; }
  .toast, .card { transition: none; }
}

/* layout guards: never let intrinsic widths push the page sideways */
.composer textarea { min-width: 0; }
.page { overflow-x: hidden; }
@media (max-width: 720px) { .composer.big textarea { font-size: 17px; min-height: 44px; } .composer.big { padding: 10px 10px 10px 20px; } }

/* ================= workspace, wallet, hand-over ================= */
.tab-body.wide { max-width: 980px; }
.files-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-weight: 600; }
.crumbs button { border: 0; background: none; padding: 2px 4px; cursor: pointer; color: var(--lagoon); border-radius: 8px; }
.crumbs span { color: var(--ink-soft); }
.files-head .meta { margin-left: auto; }
.upload-btn { cursor: pointer; }
.tank.slim { height: 6px; margin-bottom: 14px; }
.list.files .row { display: grid; grid-template-columns: 1fr auto auto auto auto; align-items: center; gap: 4px; padding: 6px 2px; }
.file-name { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 0; text-align: left; min-width: 0; font: inherit; color: inherit; }
button.file-name { cursor: pointer; font-weight: 600; }
.file-name svg { width: 17px; height: 17px; flex: none; color: var(--ink-soft); }
a.icon-btn { text-decoration: none; }

.term { background: #111b1e; color: #d7e4e2; border-radius: 26px 30px 24px 28px / 24px 28px 26px 30px; overflow: hidden; box-shadow: 0 0 0 1px #24333a; }
.term-out { margin: 0; padding: 18px 20px; height: min(56vh, 460px); overflow: auto; font: 13.5px/1.55 ui-monospace, "SFMono-Regular", Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.term .dim, .term-card .dim { color: #7f9497; }
.term .err { color: #f0a08f; }
.term .prompt, .term-card .prompt { color: #8fd3d8; }
.term-in { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 18px; background: #16242a; font-family: ui-monospace, monospace; color: #8fd3d8; }
.term-in input { flex: 1; min-width: 0; border: 0; background: none; color: #e7f1ef; font: 14px ui-monospace, monospace; outline: none; }
.term-in:focus-within { box-shadow: inset 0 0 0 2px var(--lagoon); }
.term .hop i { background: #8fd3d8; }

.term-card { margin: 0; border-radius: 20px; overflow: hidden; background: #111b1e; box-shadow: 0 0 0 1px var(--line); }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 7px 14px; font-size: 12.5px; color: #b7cac9; background: #16242a; }
.term-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.term-card.ended .term-bar .dot { background: #5fb3b9; }
.term-card pre { margin: 0; padding: 12px 16px; max-height: 280px; overflow: auto; color: #d7e4e2; font: 13px/1.5 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

.wallet-card { background: var(--stone); box-shadow: var(--stone-shadow); border-radius: 28px 32px 26px 30px / 26px 30px 28px 32px; padding: 18px 20px; margin-bottom: 18px; }
.wallet-top { display: flex; align-items: center; gap: 14px; }
.wallet-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 46% 54% 50% 50% / 54% 46% 54% 46%; background: var(--lagoon); color: var(--lagoon-ink); flex: none; }
.wallet-icon svg { width: 22px; height: 22px; }
.wallet-top > div:nth-child(2) { flex: 1; min-width: 0; }
.addr-big { font-size: 14.5px; overflow-wrap: anywhere; font-weight: 600; }
.wallet-top p { margin: 2px 0 0; }
.nets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.net { background: var(--surface); border-radius: 18px; padding: 10px 12px; }
.net h4 { margin: 0 0 6px; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.asset { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.asset.has { color: var(--ink); font-weight: 600; }
.send-form { max-width: 640px; }
.grid-form.tight { margin: 0; max-width: none; }
.wide-field { grid-column: 1 / -1; }
.review { background: var(--surface); border-radius: 16px; padding: 12px 14px; font-size: 14.5px; overflow-wrap: anywhere; }
.review code { font-size: 13px; }
.review .big { font-size: 20px; }
.warn { color: var(--danger); font-size: 13.5px; margin: 6px 0 0; }
.export { margin-top: 28px; }
.export summary { cursor: pointer; color: var(--danger); font-weight: 600; }
.export .addr { display: flex; gap: 6px; align-items: center; background: var(--stone); border-radius: 14px; padding: 8px 6px 8px 12px; }
.export code { flex: 1; font-size: 12.5px; overflow-wrap: anywhere; }

.approval.money { box-shadow: inset 0 0 0 2px var(--amber); }
.approval.handover { background: var(--stone); box-shadow: inset 0 0 0 2px var(--lagoon); }
.ho-type { display: flex; gap: 6px; margin-top: 10px; }
.ho-type .field { border-radius: 999px; }
.live.control { box-shadow: 0 0 0 3px var(--lagoon); }
.live.control img { cursor: crosshair; }
@media (max-width: 720px) {
  .list.files .row { grid-template-columns: 1fr auto auto auto; }
  .list.files .row .meta { display: none; }
}
