/* EconomicGoat — design system */
:root {
  --ink: #18181b; --text: #27272a; --text-2: #6b6b73; --text-3: #a1a1aa;
  --bg: #ffffff; --soft: #fafaf9; --side: #f8f8f7; --line: #ececea; --line-2: #e2e2df;
  --hover: rgba(24, 24, 27, .045); --press: rgba(24, 24, 27, .08);
  --blue: #2563eb; --blue-bg: #eff5ff; --green: #0f7a55; --green-bg: #ecf8f2; --red: #c93a33; --red-bg: #fdf0ef;
  --amber: #a86400; --amber-bg: #fdf6e7; --purple: #6d3fc0; --purple-bg: #f4f0fd;
  --r: 12px; --r-s: 8px;
  --sh-1: 0 1px 2px rgba(16, 16, 20, .04);
  --sh-2: 0 1px 2px rgba(16, 16, 20, .04), 0 6px 20px rgba(16, 16, 20, .05);
  --sh-3: 0 12px 48px rgba(16, 16, 20, .14), 0 2px 6px rgba(16, 16, 20, .06);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Inter, ui-sans-serif, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif; color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
::selection { background: rgba(37, 99, 235, .16); }
.i { width: 16px; height: 16px; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
input:focus-visible, textarea:focus-visible, [contenteditable]:focus-visible { outline: none; }

/* ---------- shell ---------- */
#app { display: flex; height: 100vh; height: 100dvh; }
#sidebar { width: 252px; flex-shrink: 0; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px 12px; overflow-y: auto; }
#mainwrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
main { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
#topbar { display: none; }

.goat { display: block; width: 100%; height: 100%; }
.goat-eye { fill: var(--ink); }
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 14px; text-decoration: none; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: #fff; padding: 4px; flex-shrink: 0; box-shadow: 0 2px 6px rgba(0, 0, 0, .16); }
.bname { font-weight: 700; font-size: 15px; letter-spacing: -.3px; color: var(--ink); }
.bsub { font-size: 12px; color: var(--text-2); }
.search-btn { display: flex; align-items: center; gap: 8px; width: 100%; border: 1px solid var(--line-2); background: #fff; border-radius: 9px; padding: 7px 10px; font-size: 13.5px; color: var(--text-2); cursor: pointer; margin-bottom: 10px; box-shadow: var(--sh-1); transition: border-color .15s; }
.search-btn:hover { border-color: #cfcfcb; }
.search-btn span { flex: 1; text-align: left; }
.nav-group { font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 14px 10px 5px; letter-spacing: .2px; }
nav { display: flex; flex-direction: column; gap: 1px; }
nav a, .side-foot > a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--text-2); font-weight: 500; font-size: 14px; transition: background .12s, color .12s; }
nav a .i, .side-foot > a .i { width: 17px; height: 17px; }
nav a:hover, .side-foot > a:hover { background: var(--hover); color: var(--ink); }
nav a.on, .side-foot > a.on { background: #fff; color: var(--ink); box-shadow: var(--sh-1), 0 0 0 1px var(--line); }
nav a em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 650; background: var(--ink); color: #fff; border-radius: 10px; padding: 1px 7px; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.status-line { font-size: 12px; color: var(--text-2); padding: 8px 10px 0; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.status-line a { text-decoration: none; display: flex; align-items: center; gap: 7px; font-weight: 550; color: var(--amber); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.ok { background: #22a06b; box-shadow: 0 0 0 3px rgba(34, 160, 107, .15); }
.dot.warn { background: #e2a03f; box-shadow: 0 0 0 3px rgba(226, 160, 63, .18); }
.sync-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 550; padding: 2px 8px; border-radius: 20px; background: var(--hover); color: var(--text-2); margin-left: auto; }
.sync-pill .i { width: 13px; height: 13px; }
.sync-pill.ok { color: var(--green); background: var(--green-bg); }
.sync-pill.error { color: var(--red); background: var(--red-bg); }
#syncdot { margin-left: auto; }

/* ---------- Ask Goat ---------- */
#fab { position: fixed; right: 22px; bottom: 22px; z-index: 30; display: flex; align-items: center; gap: 8px; padding: 11px 18px 11px 15px; border-radius: 30px; border: 0; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: 0 8px 28px rgba(0, 0, 0, .22); transition: transform .2s var(--ease), box-shadow .2s; }
#fab svg { width: 18px; height: 18px; }
#fab:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(0, 0, 0, .28); }
body[data-page="chat"] #fab, body.drawer-open #fab { opacity: 0; pointer-events: none; transform: scale(.9); }
#drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100vw; background: #fff; border-left: 1px solid var(--line); box-shadow: -20px 0 60px rgba(0, 0, 0, .1); z-index: 35; display: flex; flex-direction: column; transform: translateX(105%); transition: transform .3s var(--ease); }
body.drawer-open #drawer { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.drawer-title { display: flex; align-items: center; gap: 9px; font-size: 15px; }
.drawer-btns { display: flex; gap: 2px; }
.drawer-btns button { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--text-2); display: grid; place-items: center; }
.drawer-btns button:hover { background: var(--hover); color: var(--ink); }
.drawer-btns svg { width: 17px; height: 17px; }
#drawer-body { flex: 1; min-height: 0; }

/* ---------- page scaffolding ---------- */
.page { max-width: 920px; margin: 0 auto; padding: 56px 48px 140px; animation: rise .35s var(--ease); }
.page.wide { max-width: 1140px; }
.page.narrow { max-width: 720px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.ph-main { display: flex; gap: 16px; align-items: flex-start; }
.ph-icon { width: 44px; height: 44px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-1); display: grid; place-items: center; flex-shrink: 0; margin-top: 2px; }
.ph-icon .i { width: 21px; height: 21px; color: var(--ink); }
.ph h1 { font-size: 32px; font-weight: 700; letter-spacing: -.9px; line-height: 1.15; margin: 0 0 6px; color: var(--ink); }
.ph p { margin: 0; color: var(--text-2); font-size: 15.5px; max-width: 600px; }
.ph-actions { display: flex; gap: 8px; }
.h2 { font-size: 19px; font-weight: 650; letter-spacing: -.35px; margin: 48px 0 6px; color: var(--ink); }
.sub { color: var(--text-2); margin: 0 0 18px; }
.muted { color: var(--text-2); }
.sm { font-size: 13px; }
.mt { margin-top: 14px; } .mt-s { margin-top: 8px; }
.row { display: flex; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; align-items: flex-end; }
.row.center { align-items: center; }
.row.between { justify-content: space-between; }
.gap { gap: 10px; }
.grow { flex: 1; }
.hidden { display: none !important; }
.w-sm { width: 150px; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text-2); font-size: 14px; font-weight: 500; margin-bottom: 18px; padding: 4px 8px 4px 4px; border-radius: 7px; }
.back:hover { color: var(--ink); background: var(--hover); }
.center-col { text-align: center; display: flex; flex-direction: column; align-items: center; padding-top: 12vh; }
.big-title { font-size: 34px; letter-spacing: -1px; margin: 18px 0 8px; color: var(--ink); }
.err { color: var(--red); } .ok-txt { color: var(--green); display: inline-flex; align-items: center; gap: 6px; font-weight: 550; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; font-weight: 550; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; color: var(--ink); transition: background .12s, border-color .12s, transform .06s, box-shadow .12s; box-shadow: var(--sh-1); }
.btn:hover { background: var(--soft); border-color: #d4d4d0; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .08); }
.btn.primary:hover { background: #2f2f35; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 11px 20px; font-size: 15px; border-radius: 10px; }
.btn.full { width: 100%; }
.btn.icon-only { padding: 6px 8px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink); }
input, textarea { border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 12px; background: #fff; outline: none; width: 100%; transition: border-color .12s, box-shadow .12s; box-shadow: var(--sh-1); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, textarea:focus { border-color: #8fb3f5; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--ink); box-shadow: none; }
textarea { resize: vertical; line-height: 1.6; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; }
details summary { cursor: pointer; font-size: 13.5px; font-weight: 550; color: var(--text-2); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: ''; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
details[open] summary::before { transform: rotate(45deg); }
details summary:hover { color: var(--ink); }
.mini-details { margin: 2px 0 14px; }
.mini-details[open] summary { margin-bottom: 10px; }
.help { margin: -4px 0 16px; font-size: 14px; }
.help ol { margin: 10px 0 0; padding-left: 20px; color: var(--text); }
.help li { margin: 6px 0; }
.help a { color: var(--blue); font-weight: 550; }

/* custom select */
.cs { position: relative; min-width: 0; }
.cs > select { display: none; }
.cs-btn { width: 100%; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 9px; padding: 8.5px 11px; background: #fff; cursor: pointer; text-align: left; box-shadow: var(--sh-1); transition: border-color .12s, box-shadow .12s; min-height: 40px; }
.cs-btn:hover { border-color: #d0d0cc; }
.cs.open .cs-btn { border-color: #8fb3f5; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.cs-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-code { font-size: 11.5px; font-weight: 650; color: var(--text-2); background: var(--hover); border-radius: 5px; padding: 1px 6px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.cs-chev { color: var(--text-3); transition: transform .15s; }
.cs.open .cs-chev { transform: rotate(180deg); }
.cs-pop { position: fixed; z-index: 200; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-3); padding: 5px; animation: pop .14s var(--ease); max-height: min(380px, 60vh); display: flex; flex-direction: column; outline: none; }
.cs-pop.up { transform-origin: bottom; }
.cs-search { display: flex; align-items: center; gap: 8px; padding: 6px 9px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; color: var(--text-3); }
.cs-search input { border: 0; box-shadow: none !important; padding: 2px 0; }
.cs-list { overflow-y: auto; }
.cs-group { font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 9px 10px 4px; }
.cs-opt { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.cs-opt.active { background: var(--hover); }
.cs-opt.sel { font-weight: 600; }
.cs-check { color: var(--ink); margin-left: auto; }
.cs-two { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cs-desc { font-size: 12.5px; color: var(--text-2); font-weight: 400; }
.cs-empty { padding: 14px; text-align: center; color: var(--text-3); font-size: 13.5px; }

/* surfaces */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--sh-2); }
.card h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15px; font-weight: 650; color: var(--ink); }
.card ul { margin: 0; padding-left: 20px; }
.card li { margin: 7px 0; }
ul.ticks, ul.arrows { list-style: none; padding: 0; }
ul.ticks li, ul.arrows li { position: relative; padding-left: 24px; }
ul.ticks li::before { content: '✓'; position: absolute; left: 2px; color: var(--green); font-weight: 700; }
ul.arrows li::before { content: '→'; position: absolute; left: 2px; color: var(--blue); font-weight: 700; }
.seg { display: inline-flex; background: var(--press); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; background: transparent; padding: 7px 13px; border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 550; color: var(--text-2); transition: background .12s, color .12s; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.seg.full { display: flex; } .seg.full button { flex: 1; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--press); color: var(--text-2); white-space: nowrap; }
.badge.big { padding: 9px 16px; font-size: 14px; }
.badge.accent { background: var(--blue-bg); color: var(--blue); }
.badge.good, .badge.great { background: var(--green-bg); color: var(--green); }
.badge.ok { background: var(--amber-bg); color: var(--amber); }
.badge.low { background: var(--red-bg); color: var(--red); }
.empty { color: var(--text-2); padding: 20px; text-align: center; font-size: 14px; }
.empty a { color: var(--blue); font-weight: 550; }
.spin { width: 14px; height: 14px; border: 2px solid rgba(0, 0, 0, .14); border-top-color: currentColor; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; flex-shrink: 0; }
.btn.primary .spin { border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
kbd { font-family: inherit; font-size: 11px; font-weight: 500; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: #fff; color: var(--text-2); line-height: 1.5; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 26px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; padding: 10px 12px; color: var(--text-2); font-weight: 550; font-size: 14.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .12s; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-color: var(--ink); }
.checklist { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.checklist label { display: flex; gap: 11px; align-items: center; padding: 9px 10px; border-radius: 7px; cursor: pointer; }
.checklist label span:first-of-type { flex: 1; }
.checklist label:hover { background: var(--hover); }

/* callouts */
.co, .prose blockquote { border-radius: 10px; padding: 13px 16px; margin: 16px 0; background: var(--soft); border: 1px solid var(--line); color: var(--text); }
.co > :first-child, .prose blockquote > :first-child { margin-top: 0; }
.co > :last-child, .prose blockquote > :last-child { margin-bottom: 0; }
.co b { display: inline-flex; align-items: center; gap: 6px; }
.co p { margin: 6px 0 0; }
.co-def { background: var(--blue-bg); border-color: #d9e6fd; }
.co-tip { background: var(--amber-bg); border-color: #f3e3bd; }
.co-warn { background: var(--red-bg); border-color: #f6d8d5; }
.co-eval { background: var(--purple-bg); border-color: #e5dcf8; }
.co-chain { background: #f3f7fb; border-color: #dfe8f2; }
.co-good, .co-world { background: var(--green-bg); border-color: #d2ecdf; }
.co-data { background: #fbf4f0; border-color: #f1dfd4; }
.tips ul { margin: 8px 0 0; padding-left: 18px; }

/* ---------- home ---------- */
.hello { display: flex; align-items: center; gap: 18px; margin-bottom: 30px; }
.hello-goat { width: 56px; height: 56px; border-radius: 16px; background: var(--ink); color: #fff; padding: 7px; flex-shrink: 0; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.hello-goat.big { width: 76px; height: 76px; border-radius: 22px; padding: 10px; }
.hello h1 { font-size: 34px; font-weight: 700; letter-spacing: -1px; margin: 0; color: var(--ink); line-height: 1.15; }
.hello p { margin: 4px 0 0; color: var(--text-2); }
.setup { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-radius: 14px; background: linear-gradient(180deg, #fffaf0, #fdf6e7); border: 1px solid #f1e2bf; margin-bottom: 26px; flex-wrap: wrap; }
.setup-l { display: flex; gap: 14px; align-items: center; flex: 1; min-width: 260px; }
.setup-i { width: 40px; height: 40px; border-radius: 11px; background: #fff; display: grid; place-items: center; border: 1px solid #f1e2bf; color: var(--amber); flex-shrink: 0; }
.setup-i .i { width: 19px; height: 19px; }
.setup p { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { position: relative; text-decoration: none; border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #fff; box-shadow: var(--sh-1); transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s; display: flex; flex-direction: column; min-height: 152px; }
.tile:hover { box-shadow: var(--sh-2), 0 10px 30px rgba(0, 0, 0, .06); transform: translateY(-2px); border-color: var(--line-2); }
.tile-i { width: 36px; height: 36px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); display: grid; place-items: center; margin-bottom: auto; color: var(--ink); }
.tile-i .i { width: 18px; height: 18px; }
.tile:nth-child(1) .tile-i { background: var(--blue-bg); color: var(--blue); border-color: #dbe7fd; }
.tile:nth-child(2) .tile-i { background: var(--green-bg); color: var(--green); border-color: #d2ecdf; }
.tile:nth-child(3) .tile-i { background: var(--purple-bg); color: var(--purple); border-color: #e5dcf8; }
.tile:nth-child(4) .tile-i { background: var(--amber-bg); color: var(--amber); border-color: #f3e3bd; }
.tile-t { font-weight: 650; font-size: 15px; color: var(--ink); margin-top: 18px; letter-spacing: -.2px; }
.tile-d { font-size: 13px; color: var(--text-2); line-height: 1.45; margin-top: 3px; }
.tile-go { position: absolute; top: 18px; right: 16px; color: var(--text-3); opacity: 0; transform: translateX(-4px); transition: all .2s var(--ease); }
.tile:hover .tile-go { opacity: 1; transform: none; }
.recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 12px; }
.rec { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-decoration: none; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; transition: background .12s, border-color .12s; }
.rec:hover { background: var(--soft); border-color: var(--line-2); }
.rec-i { grid-row: span 2; width: 34px; height: 34px; border-radius: 9px; background: var(--soft); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-2); }
.rec-t { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.rec-m { font-size: 12.5px; color: var(--text-2); }
.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.spec-col { border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: #fff; box-shadow: var(--sh-1); }
.spec-head { font-size: 12px; font-weight: 650; color: var(--text-2); padding: 8px 10px 8px; }
.spec-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background .1s; }
.spec-row:hover { background: var(--hover); }
.spec-row .code { font-size: 12px; font-weight: 650; color: var(--text-3); font-variant-numeric: tabular-nums; width: 34px; flex-shrink: 0; }
.spec-row .nm { flex: 1; font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.4; }
.spec-row .acts { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.spec-row:hover .acts, .spec-row:focus-within .acts { opacity: 1; }
.spec-row .acts button { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line-2); background: #fff; border-radius: 7px; cursor: pointer; color: var(--text-2); }
.spec-row .acts button:hover { color: var(--ink); border-color: #cfcfcb; }
.spec-row .acts .i { width: 14px; height: 14px; }

/* ---------- chat ---------- */
.chat-page { display: flex; flex-direction: column; height: 100%; }
.chat-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.chat-title { display: flex; align-items: center; gap: 9px; font-size: 15px; color: var(--ink); }
.chat-host { flex: 1; min-height: 0; }
.chat { display: flex; flex-direction: column; height: 100%; }
.chat-msgs { flex: 1; overflow-y: auto; }
.chat-inner { max-width: 780px; margin: 0 auto; padding: 18px 28px 12px; }
.chat.compact .chat-inner { padding: 14px 18px 8px; }
.msg { margin: 20px 0; animation: rise .25s var(--ease); }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bubble { background: #f3f3f1; padding: 10px 15px; border-radius: 18px 18px 5px 18px; max-width: 80%; color: var(--ink); }
.msg.bot { display: flex; gap: 13px; }
.av { width: 28px; height: 28px; flex-shrink: 0; border-radius: 9px; background: var(--ink); color: #fff; padding: 3.5px; margin-top: 1px; }
.msg-body { flex: 1; min-width: 0; }
.msg-acts { display: flex; gap: 2px; margin-top: 6px; opacity: 0; transition: opacity .15s; }
.msg.bot:hover .msg-acts { opacity: 1; }
.msg-acts button { border: 0; background: transparent; padding: 5px; border-radius: 6px; cursor: pointer; color: var(--text-3); display: grid; place-items: center; }
.msg-acts button:hover { background: var(--hover); color: var(--ink); }
.typing { display: flex; gap: 4px; padding: 10px 0; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: bounce 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: none; opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }
.followups { display: flex; flex-wrap: wrap; gap: 7px; margin: -4px 0 8px 41px; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 20px; padding: 6px 13px; font-size: 13px; cursor: pointer; transition: background .12s, border-color .12s; color: var(--ink); }
.chip:hover { background: var(--soft); border-color: #cfcfcb; }
.composer-wrap { padding: 10px 28px 16px; }
.chat.compact .composer-wrap { padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.composer { max-width: 780px; margin: 0 auto; border: 1px solid var(--line-2); border-radius: 18px; padding: 10px 10px 8px 16px; background: #fff; box-shadow: 0 4px 24px rgba(0, 0, 0, .06); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: #b8cdf6; box-shadow: 0 4px 24px rgba(0, 0, 0, .06), 0 0 0 3px rgba(37, 99, 235, .1); }
.composer textarea { border: 0; box-shadow: none !important; padding: 4px 0 8px; resize: none; max-height: 200px; display: block; }
.composer-bar { display: flex; align-items: center; gap: 6px; }
.composer-bar .cs { width: 150px; }
.composer-bar .cs-btn { border: 0; box-shadow: none; background: var(--hover); min-height: 32px; padding: 5px 10px; border-radius: 9px; font-size: 13px; font-weight: 550; }
.composer-bar .cs-btn:hover { background: var(--press); }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 550; padding: 6px 10px; border-radius: 9px; cursor: pointer; }
.chip-btn:hover { background: var(--hover); color: var(--ink); }
.chip-btn.on { color: var(--blue); background: var(--blue-bg); }
.send { width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--ink); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .12s, transform .08s; flex-shrink: 0; }
.send:hover { background: #33333a; } .send:active { transform: scale(.95); }
.send .i { width: 17px; height: 17px; }
.send.stop .i { width: 14px; height: 14px; fill: currentColor; }
.fine { font-size: 11.5px; color: var(--text-3); text-align: center; margin-top: 8px; }
.empty-chat { text-align: center; padding: 9vh 0 10px; display: flex; flex-direction: column; align-items: center; }
.chat.compact .empty-chat { padding: 6vh 0 10px; }
.empty-goat { width: 54px; height: 54px; border-radius: 16px; background: var(--ink); color: #fff; padding: 7px; box-shadow: 0 8px 22px rgba(0, 0, 0, .18); margin-bottom: 18px; }
.empty-chat h2 { font-size: 26px; letter-spacing: -.7px; margin: 0 0 6px; color: var(--ink); }
.chat.compact .empty-chat h2 { font-size: 21px; }
.starters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 22px 0 18px; width: 100%; max-width: 640px; }
.chat.compact .starters { grid-template-columns: 1fr; }
.starter { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; font-size: 13.5px; cursor: pointer; color: var(--ink); box-shadow: var(--sh-1); transition: border-color .12s, background .12s, transform .12s; }
.starter .i { color: var(--text-3); }
.starter:hover { border-color: var(--line-2); background: var(--soft); transform: translateY(-1px); }
.topic-pick { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 420px; align-items: stretch; }

/* ---------- prose ---------- */
.prose { line-height: 1.72; overflow-wrap: break-word; color: var(--text); }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { line-height: 1.3; letter-spacing: -.3px; margin: 1.6em 0 .5em; font-weight: 650; color: var(--ink); }
.prose h1 { font-size: 1.6em; } .prose h2 { font-size: 1.34em; } .prose h3 { font-size: 1.12em; } .prose h4 { font-size: 1em; }
.prose p { margin: .7em 0; }
.prose ul, .prose ol { padding-left: 1.35em; margin: .6em 0; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--text-3); }
.prose ol li::marker { color: var(--text-2); font-weight: 600; }
.prose li > p { margin: .2em 0; }
.prose strong { font-weight: 650; color: var(--ink); }
.prose em { color: var(--text-2); }
.prose a { color: var(--blue); }
.prose code { background: var(--press); padding: 2px 5px; border-radius: 5px; font-size: .88em; font-family: ui-monospace, Menlo, monospace; }
.prose pre { background: var(--soft); border: 1px solid var(--line); padding: 14px; border-radius: 10px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { border-left: 3px solid var(--line-2); }
.prose blockquote.co { border-left-width: 1px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.8em 0; }
.prose table { border-collapse: separate; border-spacing: 0; width: 100%; margin: 1.1em 0; font-size: .93em; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 9px 13px; text-align: left; vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose th { background: var(--soft); font-weight: 600; color: var(--ink); }

/* ---------- graphs ---------- */
.graph-wrap { margin: 18px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; max-width: 640px; box-shadow: var(--sh-1); }
.graph-svg svg { display: block; width: 100%; height: auto; }
.graph-tools { display: flex; gap: 2px; justify-content: flex-end; padding: 6px 8px; border-top: 1px solid var(--line); background: var(--soft); }
.graph-tools button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; font-size: 12.5px; font-weight: 550; color: var(--text-2); padding: 5px 9px; border-radius: 7px; cursor: pointer; }
.graph-tools button .i { width: 14px; height: 14px; }
.graph-tools button:hover { background: var(--hover); color: var(--ink); }
.graph-loading { height: 260px; max-width: 640px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-2); font-size: 14px; background: linear-gradient(90deg, #f6f6f4 25%, #fbfbfa 50%, #f6f6f4 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; margin: 18px 0; }
.graph-loading span { width: 14px; height: 14px; border: 2px solid rgba(0, 0, 0, .15); border-top-color: #555; border-radius: 50%; animation: spin .7s linear infinite; }
.graph-err { padding: 13px 15px; background: var(--red-bg); color: var(--red); border-radius: 10px; font-size: 13.5px; margin: 12px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

.studio { display: grid; grid-template-columns: 310px 1fr; gap: 24px; align-items: start; }
.studio > * { min-width: 0; }
.studio-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 4px; }
.studio-side .card { padding: 18px; }
.ideas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.idea { border: 1px solid var(--line); background: var(--soft); border-radius: 8px; padding: 5px 9px; font-size: 12.5px; cursor: pointer; text-align: left; color: var(--text); transition: background .12s, border-color .12s; }
.idea:hover { background: #fff; border-color: var(--line-2); color: var(--ink); }
.side-h { font-size: 12px; font-weight: 650; color: var(--text-3); margin: 18px 6px 4px; }
.tpl { display: flex; flex-direction: column; gap: 1px; }
.tpl button { display: flex; align-items: center; gap: 9px; text-align: left; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text); }
.tpl button .i { color: var(--text-3); }
.tpl button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl button:hover { background: var(--hover); color: var(--ink); }
.canvas { padding: 10px; }
.graph-svg.big { border-radius: 8px; overflow: hidden; }
.canvas-tools { display: flex; align-items: center; gap: 8px; padding: 10px 4px 2px; }
.expl { margin-top: 24px; padding: 0 4px; }
#jsonbox { margin-top: 14px; }

/* ---------- practice ---------- */
.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; box-shadow: var(--sh-2); }
.step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 13.5px; flex-shrink: 0; }
.step-b { flex: 1; min-width: 0; }
.step h3 { margin: 2px 0 2px; font-size: 16.5px; letter-spacing: -.25px; color: var(--ink); }
.step-b > p { margin: 0 0 16px; }
.extract { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; margin-bottom: 12px; font-size: 14.5px; max-height: 420px; overflow: auto; }
.result { margin-top: 26px; display: flex; flex-direction: column; gap: 14px; animation: rise .35s var(--ease); }
.score { display: flex; align-items: center; gap: 24px; }
.score-txt p { margin: 10px 0 0; font-size: 15.5px; color: var(--ink); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.ring { --c: var(--blue); width: 108px; height: 108px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #efefed 0); }
.ring > div { width: 88px; height: 88px; border-radius: 50%; background: #fff; display: flex; align-items: baseline; justify-content: center; padding-top: 27px; }
.ring b { font-size: 31px; font-weight: 700; letter-spacing: -1px; color: var(--ink); }
.ring span { font-size: 14px; color: var(--text-2); font-weight: 600; }
.ring.great, .ring.good { --c: #22a06b; } .ring.ok { --c: #e2a03f; } .ring.low { --c: var(--red); }
.ao-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ao { padding: 16px; }
.ao.na { opacity: .5; }
.ao-h { display: flex; flex-direction: column; }
.ao-h b { color: var(--ink); }
.ao-h span { font-size: 12.5px; color: var(--text-2); }
.bar { height: 6px; background: #efefed; border-radius: 6px; overflow: hidden; margin: 10px 0 8px; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 6px; transition: width .7s var(--ease); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.model { border-left: 3px solid #22a06b; }
.loading-card { margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px; text-align: center; }
.gen-anim { display: flex; gap: 6px; margin-bottom: 8px; }
.gen-anim span { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); animation: bounce 1.2s infinite; }
.gen-anim span:nth-child(2) { animation-delay: .15s; } .gen-anim span:nth-child(3) { animation-delay: .3s; }
.quiz-setup .row .field { margin-bottom: 0; }
.quiz-setup .co { margin-top: 0; }
.quiz { max-width: 740px; margin-top: 16px; }
.quiz-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); font-weight: 550; }
.progress { height: 5px; background: #efefed; border-radius: 5px; overflow: hidden; margin: 10px 0 22px; }
.progress i { display: block; height: 100%; background: var(--ink); border-radius: 5px; transition: width .4s var(--ease); }
.qtext { font-size: 17px; font-weight: 500; margin-bottom: 18px; color: var(--ink); }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line-2); background: #fff; border-radius: 11px; padding: 12px 14px; cursor: pointer; transition: background .12s, border-color .12s, transform .1s; }
.opt:hover:not(:disabled) { background: var(--soft); border-color: #cbcbc7; transform: translateX(2px); }
.opt .ok { width: 27px; height: 27px; border-radius: 8px; background: var(--press); display: grid; place-items: center; font-weight: 650; font-size: 13px; flex-shrink: 0; }
.opt.right { border-color: #22a06b; background: var(--green-bg); }
.opt.right .ok { background: #22a06b; color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-bg); }
.opt.wrong .ok { background: var(--red); color: #fff; }
.opt:disabled { cursor: default; color: var(--text); }
.quiz-end { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px; max-width: 520px; margin-top: 16px; }

/* ---------- notes ---------- */
.drop { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 42px 20px; border: 1.5px dashed #d6d6d2; border-radius: 16px; cursor: pointer; background: var(--soft); transition: background .15s, border-color .15s; text-align: left; }
.drop.slim { padding: 20px; }
.drop:hover, .drop.over { background: var(--blue-bg); border-color: #8fb3f5; }
.drop b { display: block; color: var(--ink); }
.drop span { font-size: 13.5px; color: var(--text-2); }
.drop-i { width: 46px; height: 46px; border-radius: 13px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; box-shadow: var(--sh-1); color: var(--ink); flex-shrink: 0; }
.drop-i .i { width: 20px; height: 20px; }
.progress-note { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 16px; border-radius: 10px; background: var(--soft); font-size: 14px; }
.docgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 20px; }
.doccard { text-decoration: none; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: #fff; box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 4px; transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s; }
.doccard:hover { box-shadow: var(--sh-2), 0 10px 30px rgba(0, 0, 0, .06); transform: translateY(-2px); border-color: var(--line-2); }
.dc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dc-i { width: 30px; height: 30px; border-radius: 8px; background: var(--soft); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-2); }
.dc-kind { font-size: 11.5px; font-weight: 650; color: var(--text-3); flex: 1; }
.dc-t { font-weight: 650; font-size: 15px; color: var(--ink); letter-spacing: -.2px; line-height: 1.35; }
.dc-m { font-size: 12.5px; color: var(--text-2); }
.dc-chips { display: flex; gap: 6px; margin-top: 10px; }
.dc-chips span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 550; padding: 2px 8px 2px 6px; border-radius: 6px; background: var(--hover); color: var(--text-3); }
.dc-chips span .i { width: 13px; height: 13px; }
.dc-chips span.on { background: var(--green-bg); color: var(--green); }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.doc-head h1 { font-size: 32px; font-weight: 700; letter-spacing: -.9px; line-height: 1.2; margin: 0; color: var(--ink); outline: none; border-radius: 6px; flex: 1; min-width: 260px; }
.doc-head h1[contenteditable=true]:hover { background: var(--hover); }
.doc-actions { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 4px; }
.reader { max-width: 760px; font-size: 15.5px; }
.reader.original { white-space: normal; color: var(--text); }
.reader-foot { max-width: 760px; margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }
.gen { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 70px 20px; border: 1px dashed var(--line-2); border-radius: 16px; background: var(--soft); }
.gen > .i { width: 26px; height: 26px; color: var(--text-2); margin-bottom: 6px; }
.gen b { color: var(--ink); font-size: 16px; }

/* mind map */
.map-host { height: min(72vh, 760px); min-height: 420px; }
.mm { position: relative; height: 100%; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff radial-gradient(circle, #e4e4e1 1px, transparent 1.2px) 0 0 / 22px 22px; box-shadow: var(--sh-2); }
.mm-stage { position: absolute; inset: 0; cursor: grab; touch-action: none; }
.mm-stage:active { cursor: grabbing; }
.mm-canvas { transform-origin: 0 0; position: absolute; left: 0; top: 0; }
.mm-canvas svg { display: block; overflow: visible; }
.mm-canvas svg > rect { fill: transparent; }
.mm-node.can { cursor: pointer; }
.mm-node.can:hover rect { filter: brightness(.97); }
.mm-tools { position: absolute; right: 12px; top: 12px; display: flex; align-items: center; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 3px; box-shadow: var(--sh-2); }
.mm-tools button { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--text-2); display: grid; place-items: center; }
.mm-tools button:hover { background: var(--hover); color: var(--ink); }
.mm-sep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }
.mm-hint { position: absolute; left: 14px; bottom: 12px; font-size: 12px; color: var(--text-3); background: rgba(255, 255, 255, .85); padding: 3px 8px; border-radius: 6px; }

/* ---------- flashcards ---------- */
.decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.deck { text-decoration: none; border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #fff; display: flex; flex-direction: column; gap: 6px; text-align: left; box-shadow: var(--sh-1), 5px 5px 0 -1px #fff, 5px 5px 0 0 var(--line); transition: transform .2s var(--ease), box-shadow .2s; }
.deck:hover { transform: translateY(-2px); box-shadow: var(--sh-2), 5px 5px 0 -1px #fff, 5px 5px 0 0 var(--line-2); }
.deck.new { border-style: dashed; background: var(--soft); box-shadow: none; align-items: center; justify-content: center; text-align: center; cursor: pointer; min-height: 150px; font: inherit; color: var(--ink); }
.deck.new:hover { background: #fff; box-shadow: var(--sh-2); }
.deck.new > span:first-child { width: 36px; height: 36px; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; }
.deck-t { font-weight: 650; font-size: 16px; letter-spacing: -.25px; color: var(--ink); }
.deck-f { display: flex; justify-content: space-between; align-items: center; }
.deck .bar i { background: #22a06b; }
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 30px; }
.mini { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; font-size: 14px; box-shadow: var(--sh-1); }
.mini-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.mini-top .x { margin-left: auto; }
.mini-f { font-weight: 600; margin-bottom: 8px; color: var(--ink); }
.mini-f p { margin: 0; }
.mini-b { color: var(--text-2); font-size: 13.5px; max-height: 130px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
.mini-g { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.x { border: 0; background: transparent; color: var(--text-3); cursor: pointer; border-radius: 6px; padding: 4px; display: grid; place-items: center; }
.x .i { width: 14px; height: 14px; }
.x:hover { background: var(--red-bg); color: var(--red); }
.tag { display: inline-block; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .5px; padding: 2px 8px; border-radius: 5px; background: var(--press); color: var(--text-2); }
.t-definition { background: var(--blue-bg); color: #1e55c4; } .t-analysis { background: var(--purple-bg); color: var(--purple); } .t-diagram { background: var(--green-bg); color: var(--green); }
.t-evaluation { background: var(--amber-bg); color: var(--amber); } .t-data { background: var(--red-bg); color: #b13b35; } .t-application { background: #fdf0e6; color: #b4571b; }

.study { max-width: 760px; margin: 0 auto; padding: 32px 28px 100px; animation: rise .25s var(--ease); }
.study-top { display: flex; justify-content: space-between; align-items: center; }
.study-top .back { margin: 0; }
.flip { display: grid; perspective: 1800px; cursor: pointer; margin-top: 6px; }
.face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 36px 42px; min-height: 380px; box-shadow: 0 16px 50px rgba(0, 0, 0, .07), 0 1px 3px rgba(0, 0, 0, .04); transition: transform .6s var(--ease); }
.face.front { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 20px; }
.face.f-back { transform: rotateY(180deg); }
.flip.flipped .front { transform: rotateY(-180deg); }
.flip.flipped .f-back { transform: rotateY(0); }
.face.f-back .tag { margin-bottom: 14px; }
.ftext { font-size: 24px; font-weight: 600; letter-spacing: -.4px; line-height: 1.4; max-width: 560px; color: var(--ink); }
.ftext p { margin: 0; }
.hint { font-size: 13px; color: var(--text-3); }
.face .graph-wrap { margin: 18px auto 0; }
.rate-q { text-align: center; font-size: 13px; color: var(--text-2); font-weight: 550; margin-top: 22px; opacity: 0; transition: opacity .25s; }
.rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; opacity: 0; pointer-events: none; transform: translateY(6px); transition: opacity .25s, transform .25s var(--ease); }
.study.revealed .rate, .study.revealed .rate-q { opacity: 1; pointer-events: auto; transform: none; }
.r { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid var(--line-2); background: #fff; border-radius: 13px; padding: 12px 8px; cursor: pointer; transition: transform .1s, background .12s, border-color .12s; box-shadow: var(--sh-1); }
.r:hover { transform: translateY(-2px); }
.r span { font-size: 12px; color: var(--text-2); }
.r kbd { margin-top: 5px; }
.r0:hover { border-color: var(--red); background: var(--red-bg); } .r1:hover { border-color: #e2a03f; background: var(--amber-bg); }
.r2:hover { border-color: #22a06b; background: var(--green-bg); } .r3:hover { border-color: var(--blue); background: var(--blue-bg); }
.r0 b { color: var(--red); } .r1 b { color: var(--amber); } .r2 b { color: var(--green); } .r3 b { color: var(--blue); }

/* ---------- settings ---------- */
.set { margin-bottom: 36px; }
.set-h h2 { display: flex; align-items: center; gap: 9px; font-size: 17px; letter-spacing: -.3px; margin: 0 0 4px; color: var(--ink); }
.set-h p { margin: 0 0 14px; color: var(--text-2); font-size: 14.5px; }
.set .card .row .field { flex: 1; min-width: 200px; }
.code-big { display: inline-block; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 16px; font-weight: 600; letter-spacing: .3px; color: var(--ink); background: var(--soft); border: 1px solid var(--line); padding: 7px 12px; border-radius: 9px; margin-top: 4px; user-select: all; }
.sync-on { display: flex; flex-direction: column; gap: 12px; }
.sync-on p { margin: 0; }
.sync-on .sync-pill { margin-left: 0; font-size: 12.5px; padding: 4px 10px; }

/* ---------- modal, palette, onboarding, toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 20, 24, .32); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fadein .15s ease; }
.modal { background: #fff; border-radius: 16px; padding: 26px; width: 100%; max-width: 520px; box-shadow: var(--sh-3); max-height: 90vh; overflow: auto; animation: pop .2s var(--ease); }
.modal.wide { max-width: 820px; }
.modal h3 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.4px; color: var(--ink); }
.modal > .muted { margin: 0 0 16px; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 22px; }
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
.pal-modal { padding: 0; max-width: 600px; overflow: hidden; align-self: start; margin-top: 12vh; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.pal-in .i { width: 19px; height: 19px; }
.pal-in input { border: 0; box-shadow: none !important; padding: 2px 0; font-size: 16px; }
.pal-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; cursor: pointer; color: var(--text); }
.pal-item .i { color: var(--text-3); }
.pal-item.on { background: var(--hover); color: var(--ink); }
.pal-t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pal-s { font-size: 12px; color: var(--text-3); }
.pal-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); background: var(--soft); }
.pal-foot kbd { margin-right: 3px; }
.ob-modal { max-width: 560px; padding: 34px; }
.onboard { text-align: center; }
.onboard .field, .onboard .help { text-align: left; }
.ob-goat { width: 72px; height: 72px; border-radius: 20px; background: var(--ink); color: #fff; padding: 9px; margin: 0 auto 18px; box-shadow: 0 10px 28px rgba(0, 0, 0, .2); }
.ob-goat.sm { width: 52px; height: 52px; border-radius: 15px; padding: 0; display: grid; place-items: center; }
.ob-goat.sm .i { width: 24px; height: 24px; }
.onboard h2 { font-size: 26px; letter-spacing: -.8px; margin: 0 0 6px; color: var(--ink); }
.ob-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0 24px; text-align: left; }
.ob-feats div { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 3px; background: var(--soft); }
.ob-feats .i { width: 19px; height: 19px; margin-bottom: 6px; color: var(--ink); }
.ob-feats b { font-size: 14px; color: var(--ink); }
.ob-feats span { font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.onboard .modal-foot { justify-content: space-between; }
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 300; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 11px; font-size: 14px; box-shadow: 0 10px 34px rgba(0, 0, 0, .25); animation: pop .22s var(--ease); max-width: 90vw; transition: opacity .3s, transform .3s; }
.toast .i { width: 16px; height: 16px; }
.toast.error .i { color: #ff8a80; } .toast.success .i { color: #6ee7a8; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .studio { grid-template-columns: 1fr; }
  .studio-side { position: static; }
  .ao-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  #sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: 0 0 40px rgba(0, 0, 0, .15); }
  body.nav-open #sidebar { transform: none; }
  body.nav-open #scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .28); z-index: 50; }
  #topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fff; }
  #topbar button { border: 0; background: transparent; cursor: pointer; padding: 4px; margin-left: -4px; display: grid; place-items: center; color: var(--ink); }
  #topbar img { border-radius: 7px; }
  .page { padding: 28px 16px 120px; }
  .ph h1, .hello h1, .doc-head h1 { font-size: 26px; }
  .ph-icon { display: none; }
  .tiles, .spec, .grid2, .ob-feats, .starters { grid-template-columns: 1fr; }
  .tile { min-height: 0; }
  .tile-t { margin-top: 12px; }
  .spec-row .acts { opacity: 1; }
  .chat-inner { padding: 14px 16px 8px; }
  .composer-wrap { padding: 8px 12px 12px; }
  .followups { margin-left: 0; }
  .score { flex-direction: column; text-align: center; }
  .score .badges { justify-content: center; }
  .step { padding: 18px 16px; gap: 12px; }
  .face { padding: 26px 20px; min-height: 300px; }
  .ftext { font-size: 20px; }
  .rate { grid-template-columns: repeat(2, 1fr); }
  .study { padding: 20px 16px 100px; }
  #fab { right: 16px; bottom: 16px; padding: 13px; }
  #fab span { display: none; }
  #drawer { width: 100vw; }
  .ob-modal { padding: 24px 20px; }
  .map-host { height: 64vh; }
  .w-sm { width: 100%; }
}
