@font-face { font-family: "Unbounded"; font-weight: 500; font-display: swap; src: url(fonts/unbounded-500.woff2) format("woff2"); }
@font-face { font-family: "Unbounded"; font-weight: 600; font-display: swap; src: url(fonts/unbounded-600.woff2) format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 400; font-display: swap; src: url(fonts/hanken-400.woff2) format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 500; font-display: swap; src: url(fonts/hanken-500.woff2) format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 600; font-display: swap; src: url(fonts/hanken-600.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(fonts/plexmono-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(fonts/plexmono-500.woff2) format("woff2"); }

:root {
  color-scheme: dark;
  --ink: #0A0A0A;
  --ink-1: #111111;
  --ink-2: #171717;
  --ink-3: #1F1F1F;
  --ink-4: #2A2A2A;
  --line: rgba(255,255,255,0.09);
  --line-2: rgba(255,255,255,0.16);
  --line-3: rgba(255,255,255,0.28);
  --paper: #FFFFFF;
  --text: #F2F2F0;
  --mute: #A3A3A0;
  --dim: #7C7C79;
  --signal: #FF4A2A;
  --ok: #3DDC97;
  --f-display: "Unbounded", "Hanken Grotesk", sans-serif;
  --f-body: "Hanken Grotesk", -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --side: 272px;
  --col: 760px;
  --lift: inset 0 1px 0 rgba(255,255,255,0.06), 0 12px 32px -18px rgba(0,0,0,0.9);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--ink); color: var(--text);
  font: 400 15px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
p a, .prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-3); }
img, video { max-width: 100%; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
::selection { background: var(--paper); color: var(--ink); }
:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--ink-4) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 10px; border: 3px solid var(--ink); }
input, textarea { caret-color: var(--paper); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* ---------- buttons (brandbook: soft square, sentence case, arrow chip) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px; border-radius: var(--r);
  font-weight: 600; font-size: 14px; letter-spacing: -0.005em; white-space: nowrap;
  border: 1px solid var(--line-2); background: var(--ink-2); color: var(--text);
  transition: background .15s, border-color .15s, transform .15s var(--ease), filter .15s;
}
.btn:hover { border-color: var(--line-3); background: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary {
  background: linear-gradient(180deg, #FFFFFF, #E6E6E3); color: var(--ink); border-color: transparent;
  padding: 0 5px 0 16px; box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(0,0,0,.4), 0 12px 24px -12px rgba(0,0,0,.9);
}
.btn.primary:hover { filter: brightness(1.04); }
.btn.primary .chip { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: var(--paper); display: grid; place-items: center; }
.btn.primary .chip svg { width: 15px; height: 15px; }
.btn.wide { width: 100%; justify-content: space-between; height: 46px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.danger:hover { border-color: var(--signal); color: #FF8C78; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--mute); }
.icon-btn:hover { background: var(--ink-3); color: var(--text); }
.text-btn { color: var(--mute); font-size: 13px; }
.text-btn:hover { color: var(--text); }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--mute); }
.input, .field input, .field textarea, .field select {
  width: 100%; background: var(--ink-1); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 11px 13px; outline: none; transition: border-color .15s;
}
.input:focus, .field input:focus, .field textarea:focus { border-color: var(--line-3); background: var(--ink); }
.field textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
::placeholder { color: var(--dim); }
.error { color: #FF8C78; font-size: 14px; min-height: 1.4em; margin: 0; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(120% 80% at 50% 0%, #161616, var(--ink) 60%); }
.login-card { width: min(380px, 100%); display: grid; gap: 16px; }
.login-logo { width: 150px; height: auto; margin-bottom: -8px; }
.login h1 { font: 600 44px/1 var(--f-display); text-transform: uppercase; margin: 0; letter-spacing: -0.01em; }
.login-sub { margin: -4px 0 8px; color: var(--mute); }

/* ---------- shell ---------- */
.app { height: 100%; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
.side { display: flex; flex-direction: column; min-height: 0; background: var(--ink); border-right: 1px solid var(--line); padding: 14px 10px 10px; gap: 6px; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 10px; }
.wordmark { display: flex; align-items: center; gap: 10px; }
.wordmark img { height: 22px; width: auto; }
.wordmark span { font: 500 11px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--mute); padding: 4px 6px; border: 1px solid var(--line-2); border-radius: 5px; }
.new-chat {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 10px;
  background: var(--ink-2); border: 1px solid var(--line); font-weight: 600; font-size: 14px; margin-bottom: 6px;
  transition: background .15s, border-color .15s;
}
.new-chat:hover { background: var(--ink-3); border-color: var(--line-2); }
.nav { display: grid; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: 9px; color: var(--mute); font-size: 14px; }
.nav a svg { width: 17px; height: 17px; }
.nav a:hover { background: var(--ink-2); color: var(--text); }
.nav a.on { background: var(--ink-3); color: var(--text); }
.chats { flex: 1; overflow: auto; margin: 10px -4px 0; padding: 0 4px; display: grid; gap: 1px; align-content: start; }
.chats h3 { font: 500 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin: 14px 12px 8px; }
.chat-link { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 6px 12px; border-radius: 9px; color: var(--mute); font-size: 14px; }
.chat-link .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-link:hover { background: var(--ink-2); color: var(--text); }
.chat-link.on { background: var(--ink-3); color: var(--text); }
.chat-link .bdot { width: 18px; height: 18px; border-radius: 5px; flex: none; display: grid; place-items: center; font: 600 9px/1 var(--f-display); background: var(--ink-4); color: var(--mute); overflow: hidden; }
.chat-link .bdot img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); flex: none; box-shadow: 0 0 0 0 rgba(255,74,42,.5); animation: live 1.6s var(--ease) infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(255,74,42,0); } 100% { box-shadow: 0 0 0 0 rgba(255,74,42,0); } }
.me { border-top: 1px solid var(--line); padding: 12px 8px 4px; display: grid; gap: 8px; }
.me-row { display: flex; align-items: center; gap: 10px; }
.avatar { width: 28px; height: 28px; border-radius: 8px; background: var(--paper); color: var(--ink); display: grid; place-items: center; font: 600 12px/1 var(--f-display); flex: none; }
.me-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { height: 3px; background: var(--ink-3); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--paper); border-radius: 3px; transform-origin: left; transform: scaleX(0); transition: transform .6s var(--ease); }
.meter.hot i { background: var(--signal); }
.me-spend { font: 400 12px/1.3 var(--f-mono); color: var(--dim); font-variant-numeric: tabular-nums; }

.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scrim { display: none; }
.only-mobile { display: none; }

/* ---------- chat ---------- */
.thread { flex: 1; overflow: auto; padding: 40px 24px 24px; scroll-behavior: smooth; }
.thread-inner { max-width: var(--col); margin: 0 auto; display: grid; gap: 22px; }
.chat-head { max-width: var(--col); margin: 0 auto 4px; width: 100%; display: flex; align-items: center; gap: 10px; color: var(--mute); font-size: 13px; }
.brand-pill { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px 0 4px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--ink-1); color: var(--text); font-size: 13px; font-weight: 500; }
.brand-pill .logo { width: 20px; height: 20px; border-radius: 5px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.brand-pill .logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-pill .logo.none { background: var(--ink-4); color: var(--mute); font: 600 9px/1 var(--f-display); }
button.brand-pill:hover { border-color: var(--line-3); }
.brand-pill svg { width: 14px; height: 14px; color: var(--mute); }

.msg-user { justify-self: end; max-width: 82%; display: grid; gap: 8px; justify-items: end; }
.msg-user .bubble { background: var(--ink-3); border: 1px solid var(--line); border-radius: 16px 16px 4px 16px; padding: 10px 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.attach-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.attach { display: flex; align-items: center; gap: 8px; height: 44px; padding: 4px 10px 4px 4px; border-radius: 10px; background: var(--ink-2); border: 1px solid var(--line); font-size: 13px; max-width: 220px; }
.attach .thumb { width: 36px; height: 36px; border-radius: 7px; background: var(--ink-4); overflow: hidden; display: grid; place-items: center; flex: none; color: var(--mute); font: 500 9px/1 var(--f-mono); text-transform: uppercase; }
.attach .thumb img { width: 100%; height: 100%; object-fit: cover; }
.attach .n { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach .x { color: var(--dim); display: grid; place-items: center; }
.attach .x:hover { color: var(--text); }
.attach.up { opacity: .55; }

.prose { overflow-wrap: anywhere; font-size: 15.5px; line-height: 1.65; }
.prose p { margin: 0 0 12px; max-width: 70ch; }
.prose p:last-child, .prose ul:last-child, .prose ol:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; }
.prose li { margin: 3px 0; }
.prose li::marker { color: var(--dim); }
.prose b { font-weight: 600; color: var(--paper); }
.prose h4 { font: 600 15px/1.4 var(--f-body); margin: 16px 0 6px; }
.prose code { font: 13px var(--f-mono); background: var(--ink-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.prose pre { background: var(--ink-1); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; overflow: auto; }
.prose pre code { background: none; border: 0; padding: 0; }

/* the working group: one row per step, the newest live */
.work { border: 1px solid var(--line); border-radius: var(--r); background: var(--ink-1); overflow: hidden; }
.work-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--mute); font-size: 13.5px; text-align: left; }
.work-head:hover { color: var(--text); }
.work-head .sum { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-head .sum b { color: var(--text); font-weight: 500; }
.work-head .count { font: 12px var(--f-mono); color: var(--dim); font-variant-numeric: tabular-nums; }
.work-head svg { transition: transform .25s var(--ease); width: 16px; height: 16px; }
.work.open .work-head svg { transform: rotate(180deg); }
.work-list { display: none; border-top: 1px solid var(--line); padding: 6px 0; max-height: 340px; overflow: auto; }
.work.open .work-list { display: block; }
.step { display: flex; align-items: baseline; gap: 10px; padding: 5px 14px; font-size: 13.5px; color: var(--mute); }
.step i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); flex: none; transform: translateY(-1px); }
.step.gen { color: var(--text); }
.step.gen i { background: var(--paper); }
.work .spin { width: 14px; height: 14px; border-radius: 50%; border: 1.6px solid var(--line-2); border-top-color: var(--paper); animation: spin .8s linear infinite; flex: none; }
.work .done-ic { width: 16px; height: 16px; color: var(--dim); }
@keyframes spin { to { transform: rotate(360deg); } }

.msg-err { display: flex; gap: 10px; align-items: flex-start; color: #FFB4A6; font-size: 14px; background: rgba(255,74,42,.07); border: 1px solid rgba(255,74,42,.25); border-radius: var(--r); padding: 10px 14px; }

.file-card { background: var(--ink-1); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--lift); }
.file-card .media { background: #000; display: grid; place-items: center; }
.file-card video, .file-card .media img { display: block; width: 100%; max-height: 480px; object-fit: contain; }
.file-card audio { display: block; width: calc(100% - 24px); margin: 14px 12px; }
.file-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; font-size: 14px; border-top: 1px solid var(--line); }
.file-meta .t { min-width: 0; display: grid; }
.file-meta .t b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta .t span { font: 12px var(--f-mono); color: var(--dim); }

/* ---------- composer ---------- */
.composer { padding: 8px 24px 20px; }
.composer-box {
  max-width: var(--col); margin: 0 auto; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 24px 48px -28px rgba(0,0,0,1); transition: border-color .15s;
}
.composer-box:focus-within { border-color: var(--line-3); }
.composer-box .attach-row { justify-content: flex-start; padding: 10px 10px 0; }
.composer textarea { display: block; width: 100%; border: 0; background: none; resize: none; outline: none; padding: 14px 16px 6px; max-height: 260px; font-size: 15.5px; line-height: 1.5; }
.composer-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px 8px; }
.composer-bar .grow { flex: 1; }
.send { width: 36px; height: 36px; border-radius: 10px; background: var(--paper); color: var(--ink); display: grid; place-items: center; transition: opacity .15s, transform .15s var(--ease); }
.send:hover { transform: translateY(-1px); }
.send[disabled] { opacity: .3; pointer-events: none; }
.send.stop { background: var(--ink-4); color: var(--text); }
.send svg { width: 17px; height: 17px; stroke-width: 2; }
.composer-hint { max-width: var(--col); margin: 8px auto 0; color: var(--dim); font-size: 12px; text-align: center; }

.brand-menu { position: relative; }
.menu {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 20; width: 260px; max-height: 320px; overflow: auto;
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,1); transform-origin: bottom left; animation: pop .18s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } }
.menu button, .menu a { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; text-align: left; font-size: 14px; color: var(--text); }
.menu button:hover, .menu a:hover { background: var(--ink-3); }
.menu .logo { width: 22px; height: 22px; border-radius: 6px; background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.menu .logo img { width: 100%; height: 100%; object-fit: contain; }
.menu .logo.none { background: var(--ink-4); color: var(--mute); font: 600 9px/1 var(--f-display); }
.menu .logo svg { width: 13px; height: 13px; }
.brand-pill .logo svg { width: 13px; height: 13px; }
.menu .sep { height: 1px; background: var(--line); margin: 6px 0; }
.menu .on svg { margin-left: auto; color: var(--text); }
.menu .muted { color: var(--mute); }

/* ---------- empty state ---------- */
.hello { max-width: var(--col); margin: 0 auto; width: 100%; padding-top: 12vh; display: grid; gap: 28px; }
.hello h1 { font: 600 clamp(28px, 4.4vw, 46px)/1.08 var(--f-display); text-transform: uppercase; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
.hello h1 em { font-style: normal; color: var(--mute); }
.ideas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.idea { text-align: left; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--ink-1); display: grid; gap: 4px; transition: border-color .15s, background .15s, transform .2s var(--ease); }
.idea:hover { border-color: var(--line-2); background: var(--ink-2); transform: translateY(-1px); }
.idea b { font-weight: 600; font-size: 14px; }
.idea span { color: var(--mute); font-size: 13.5px; line-height: 1.45; }
.nudge { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r); border: 1px dashed var(--line-2); color: var(--mute); font-size: 14px; }
.nudge .btn { margin-left: auto; }

/* ---------- pages ---------- */
.page { flex: 1; overflow: auto; padding: 40px 28px 64px; }
.page-inner { max-width: 1120px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font: 600 clamp(26px, 3.6vw, 40px)/1.05 var(--f-display); text-transform: uppercase; letter-spacing: -0.01em; margin: 0; }
.page-head p { margin: 8px 0 0; color: var(--mute); max-width: 56ch; }
.section-title { font: 600 15px/1.3 var(--f-body); margin: 36px 0 12px; display: flex; align-items: baseline; gap: 10px; }
.section-title span { font: 12px var(--f-mono); color: var(--dim); }
.blank { padding: 40px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--mute); display: grid; gap: 14px; justify-items: center; }

/* brands grid */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.brand-card { border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--ink-1); overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s, transform .25s var(--ease), box-shadow .25s; }
.brand-card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: 0 24px 40px -24px rgba(0,0,0,1); }
.brand-card .face { aspect-ratio: 16 / 10; display: grid; place-items: center; background: #F4F4F2; padding: 28px; }
.brand-card .face img { max-width: 70%; max-height: 70%; object-fit: contain; }
.brand-card .face.none { background: var(--ink-3); font: 600 40px/1 var(--f-display); color: var(--mute); text-transform: uppercase; }
.brand-card .meta { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); }
.brand-card .meta b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { font: 500 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; padding: 5px 7px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--mute); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.status.ready { color: var(--ok); border-color: rgba(61,220,151,.35); }
.status.building { color: #FFB4A6; border-color: rgba(255,74,42,.35); }
.add-card { border-radius: var(--r-lg); border: 1px dashed var(--line-2); display: grid; place-items: center; min-height: 200px; color: var(--mute); gap: 10px; align-content: center; transition: border-color .2s, color .2s, background .2s; }
.add-card:hover { border-color: var(--line-3); color: var(--text); background: var(--ink-1); }
.add-card svg { width: 26px; height: 26px; }

/* brand room */
.room-head { display: flex; gap: 20px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.room-logo { width: 84px; height: 84px; border-radius: 18px; background: #F4F4F2; display: grid; place-items: center; padding: 12px; flex: none; }
.room-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.room-logo.none { background: var(--ink-3); font: 600 30px/1 var(--f-display); color: var(--mute); }
.room-title { flex: 1; min-width: 220px; display: grid; gap: 6px; }
.room-title input { font: 600 clamp(24px, 3.4vw, 36px)/1.1 var(--f-display); text-transform: uppercase; background: none; border: 0; border-bottom: 1px solid transparent; outline: none; padding: 2px 0; width: 100%; letter-spacing: -0.01em; }
.room-title input:hover, .room-title input:focus { border-bottom-color: var(--line-2); }
.room-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs button { padding: 10px 14px; color: var(--mute); font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--paper); }

.kit { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.dropzone {
  position: relative; border-radius: var(--r-lg); border: 1.5px dashed var(--line-2); background: var(--ink-1);
  padding: 34px 24px; display: grid; justify-items: center; gap: 10px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s, transform .25s var(--ease);
}
.dropzone:hover { border-color: var(--line-3); }
.dropzone.over { border-color: var(--paper); background: var(--ink-2); transform: scale(1.01); }
.dropzone b { font: 600 18px/1.2 var(--f-display); text-transform: uppercase; }
.dropzone span { color: var(--mute); font-size: 14px; max-width: 46ch; }
.dropzone .stack { display: flex; margin-bottom: 6px; }
.dropzone .stack i { width: 46px; height: 58px; border-radius: 8px; background: var(--ink-3); border: 1px solid var(--line-2); margin: 0 -8px; transition: transform .35s var(--ease); }
.dropzone .stack i:nth-child(1) { transform: rotate(-10deg) translateY(4px); }
.dropzone .stack i:nth-child(2) { background: var(--paper); transform: translateY(-4px); z-index: 1; }
.dropzone .stack i:nth-child(3) { transform: rotate(10deg) translateY(4px); }
.dropzone:hover .stack i:nth-child(1), .dropzone.over .stack i:nth-child(1) { transform: rotate(-18deg) translate(-8px, 2px); }
.dropzone:hover .stack i:nth-child(3), .dropzone.over .stack i:nth-child(3) { transform: rotate(18deg) translate(8px, 2px); }
.dropzone:hover .stack i:nth-child(2), .dropzone.over .stack i:nth-child(2) { transform: translateY(-10px); }

.shelves { display: grid; gap: 8px; margin-top: 18px; }
.shelf { border-radius: var(--r); border: 1px solid var(--line); background: var(--ink-1); padding: 12px 14px; display: grid; gap: 10px; }
.shelf-head { display: flex; align-items: baseline; gap: 10px; }
.shelf-head b { font-size: 14px; font-weight: 600; }
.shelf-head span { font: 12px var(--f-mono); color: var(--dim); }
.shelf-head em { margin-left: auto; font-style: normal; font-size: 12.5px; color: var(--dim); }
.tiles { display: flex; gap: 8px; flex-wrap: wrap; }
.tile { position: relative; width: 92px; display: grid; gap: 4px; animation: land .45s var(--ease) both; }
@keyframes land { from { opacity: 0; transform: translateY(-14px) scale(.9); } }
.tile .pic { width: 92px; height: 92px; border-radius: 10px; background: #F4F4F2; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line); }
.tile .pic img, .tile .pic video { width: 100%; height: 100%; object-fit: contain; }
.tile .pic.photo img, .tile .pic.photo video { object-fit: cover; }
.tile .pic.doc { background: var(--ink-3); color: var(--mute); font: 500 11px/1 var(--f-mono); text-transform: uppercase; }
.tile .n { font-size: 11.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .tools { position: absolute; top: 4px; right: 4px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.tile:hover .tools, .tile:focus-within .tools { opacity: 1; }
.tile .tools select, .tile .tools button { height: 24px; border-radius: 6px; background: rgba(10,10,10,.82); border: 1px solid var(--line-2); font-size: 11px; color: var(--text); }
.tile .tools button { width: 24px; display: grid; place-items: center; }
.tile .tools svg { width: 13px; height: 13px; }
.tile.up .pic { opacity: .5; }

.side-card { border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--ink-1); padding: 18px; display: grid; gap: 14px; position: sticky; top: 0; }
.side-card h3 { font: 600 14px/1.3 var(--f-body); margin: 0; }
.side-card p { margin: 0; color: var(--mute); font-size: 13.5px; }
.build { border-radius: var(--r-lg); padding: 18px; display: grid; gap: 12px; background: linear-gradient(180deg, #1B1B1B, #111); border: 1px solid var(--line-2); box-shadow: var(--lift); }
.build h3 { font: 600 16px/1.25 var(--f-display); text-transform: uppercase; margin: 0; }
.build p { margin: 0; color: var(--mute); font-size: 13.5px; }
.chapters { display: flex; flex-wrap: wrap; gap: 4px; }
.chapters span { font: 11px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px 6px; border-radius: 5px; background: var(--ink-3); color: var(--dim); }
.build.busy .chapters span { animation: shimmer 2.4s ease-in-out infinite; }
.build.busy .chapters span:nth-child(2n) { animation-delay: .3s; }
.build.busy .chapters span:nth-child(3n) { animation-delay: .6s; }
@keyframes shimmer { 50% { color: var(--text); background: var(--ink-4); } }

.book-frame { width: 100%; height: calc(100vh - 260px); min-height: 520px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }

/* library */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.filter { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--mute); font-size: 13px; }
.filter:hover { color: var(--text); }
.filter.on { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.grid .file-card video, .grid .file-card .media img { height: 210px; }

/* team */
.add-user { display: grid; grid-template-columns: 1fr 1.3fr 130px auto; gap: 10px; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
th { text-align: left; font: 500 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); padding: 12px 14px; background: var(--ink-1); border-bottom: 1px solid var(--line); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .input { width: 96px; padding: 7px 10px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.notice { background: var(--ink-1); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 14px; margin-bottom: 16px; font-size: 14px; }
.notice code { font: 13px var(--f-mono); background: var(--ink-3); padding: 2px 6px; border-radius: 5px; user-select: all; }
.tag { font: 11px var(--f-mono); color: var(--dim); margin-left: 6px; }

.on-dark { background: var(--ink-4) !important; }

/* overlays */
.drop-veil { position: fixed; inset: 0; z-index: 50; background: rgba(10,10,10,.78); backdrop-filter: blur(6px); display: grid; place-items: center; pointer-events: none; animation: pop .2s var(--ease); }
.drop-veil div { border: 1.5px dashed var(--paper); border-radius: 24px; padding: 40px 56px; display: grid; gap: 8px; justify-items: center; text-align: center; }
.drop-veil svg { width: 30px; height: 30px; }
.drop-veil b { font: 600 22px/1.2 var(--f-display); text-transform: uppercase; }
.drop-veil span { color: var(--mute); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: 10px; font-weight: 500; font-size: 14px; box-shadow: 0 20px 40px -12px rgba(0,0,0,.8); animation: pop .2s var(--ease); max-width: calc(100% - 32px); }

@media (max-width: 980px) {
  .kit { grid-template-columns: 1fr; }
  .side-card { position: static; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); z-index: 30; transform: translateX(-102%); transition: transform .3s var(--ease); }
  .side.open { transform: none; box-shadow: 30px 0 60px rgba(0,0,0,.6); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .side.open + .scrim { opacity: 1; pointer-events: auto; }
  .only-mobile { display: grid; }
  .topbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
  .topbar-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .thread { padding: 20px 16px 12px; }
  .composer { padding: 6px 12px 12px; }
  .page { padding: 24px 16px 48px; }
  .hello { padding-top: 6vh; }
  .ideas { grid-template-columns: 1fr; }
  .add-user { grid-template-columns: 1fr; }
  .msg-user { max-width: 92%; }
  .book-frame { height: 70vh; }
  .room-title input { font-size: 22px; text-overflow: ellipsis; }
  .room-logo { width: 64px; height: 64px; border-radius: 14px; }
  .composer-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
