:root {
  --bg: #f7f6f2; --panel: #ffffff; --soft: #f1efe8; --line: #e6e2d8; --line-2: #d6d1c4;
  --ink: #1c1f1e; --ink-2: #474d4a; --muted: #7e8580;
  --accent: #0f766e; --accent-hover: #0c625b; --accent-soft: #e2f3f0; --accent-ink: #ffffff;
  --sun: #f59e0b; --sun-soft: #fff4dd; --good: #2f855a; --good-soft: #e6f6ec; --bad: #c0392b; --bad-soft: #fdecea;
  --shadow: 0 1px 2px rgba(30,25,10,.05), 0 8px 28px rgba(30,25,10,.07);
  --shadow-lg: 0 20px 60px rgba(20,20,10,.18);
  --r: 16px; --font: "Plus Jakarta Sans", system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111413; --panel: #191d1c; --soft: #202524; --line: #2a302e; --line-2: #3a413e;
    --ink: #eef1ef; --ink-2: #c0c7c3; --muted: #879089;
    --accent: #2dd4bf; --accent-hover: #5eead4; --accent-soft: #15302d; --accent-ink: #062320;
    --sun: #fbbf24; --sun-soft: #2e2512; --good: #6fcf97; --good-soft: #16291e; --bad: #f28b82; --bad-soft: #301b19;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.3); --shadow-lg: 0 20px 60px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); cursor: pointer; text-decoration: none; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 18px; margin: 0; font-weight: 700; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.grow { flex: 1; }
.link { font-weight: 600; }
.link:hover { text-decoration: underline; }

/* buttons */
.btn { border: 1.5px solid var(--line-2); background: var(--panel); border-radius: 12px; padding: 9px 16px; cursor: pointer; font-weight: 600; white-space: nowrap; transition: transform .08s, background .15s, border-color .15s; }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.primary:disabled { opacity: .5; cursor: default; }
.btn.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--soft); }
.btn.big { padding: 13px 20px; font-size: 16px; border-radius: 14px; }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: transparent; cursor: pointer; font-size: 20px; width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--soft); }
.icon-btn.on { background: var(--bad-soft); animation: pulse 1.2s infinite; }
.chip-btn { border: 1.5px solid var(--line); background: var(--soft); border-radius: 99px; padding: 5px 12px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn.set { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
input, select, textarea { background: var(--panel); border: 1.5px solid var(--line-2); border-radius: 12px; padding: 10px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search { width: 100%; font-size: 16px; padding: 12px 16px; border-radius: 14px; }

/* logo mark */
.mark { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, #14b8a6, #0f766e); position: relative; flex: none; display: inline-block; box-shadow: 0 4px 12px rgba(15,118,110,.3); }
.mark::after { content: ""; position: absolute; left: 7px; right: 7px; top: 12px; height: 10px; border-top: 3px solid #fff; border-radius: 50%; }
.mark.big { width: 56px; height: 56px; border-radius: 17px; }
.mark.big::after { left: 12px; right: 12px; top: 20px; height: 16px; border-top-width: 4px; }
.mark.small { width: 28px; height: 28px; border-radius: 9px; }
.mark.small::after { left: 6px; right: 6px; top: 10px; height: 8px; border-top-width: 2.5px; }

/* avatars */
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; flex: none; letter-spacing: -.02em; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.all { background: linear-gradient(135deg, #14b8a6, #0f766e); }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border-radius: 24px; padding: 32px; box-shadow: var(--shadow-lg); display: grid; gap: 14px; text-align: center; }
.login-card label { display: grid; gap: 6px; font-weight: 600; text-align: left; color: var(--ink-2); }
.logo-big { display: grid; place-items: center; }
.err { color: var(--bad); margin: 0; min-height: 1em; font-weight: 600; }

/* shell */
.app { display: grid; grid-template-columns: 84px 1fr; height: 100vh; height: 100dvh; }
.rail { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 14px 8px; gap: 4px; }
.rail a { display: grid; justify-items: center; gap: 2px; width: 68px; padding: 8px 0; border-radius: 14px; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.rail a .ri { font-size: 22px; line-height: 1; }
.rail a:hover { background: var(--soft); }
.rail a.on { background: var(--accent-soft); color: var(--accent); }
.rail .rail-logo { margin-bottom: 10px; padding: 0; width: auto; }
.rail .rail-logo:hover { background: none; }
.rail-grow { flex: 1; }
.rail-me { border: 0; background: none; cursor: pointer; padding: 0; }
main { min-width: 0; min-height: 0; overflow: hidden; }
.view { height: 100%; overflow: auto; }
.page { max-width: 1100px; margin: 0 auto; padding: 32px 28px 60px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 0; }

/* home */
.home { max-width: 980px; margin: 0 auto; padding: 36px 24px 60px; }
.hello { text-align: center; margin-bottom: 22px; }
.hello .mark { margin-bottom: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 34px 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile { background: var(--panel); border: 1.5px solid var(--line); border-radius: 20px; padding: 18px; cursor: pointer; display: grid; gap: 6px; align-content: start; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; text-align: left; }
.tile:hover { transform: translateY(-3px); border-color: var(--accent); }
.tile:active { transform: scale(.98); }
.tile .ti { font-size: 34px; line-height: 1; margin-bottom: 4px; }
.tile b { font-size: 16px; line-height: 1.25; }
.tile small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.tile .money { font-size: 11.5px; color: var(--sun); font-weight: 700; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.cat { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; cursor: pointer; text-align: left; }
.cat:hover { border-color: var(--accent); }
.cat .ci { font-size: 26px; }
.cat b { display: block; font-size: 14.5px; }
.cat small { color: var(--muted); font-size: 12.5px; line-height: 1.3; display: block; }
.recent { display: grid; gap: 8px; }
.recent-item { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 14px; cursor: pointer; }
.recent-item:hover { border-color: var(--accent); }
.recent-item b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item small { color: var(--muted); }
.recent-item > div { min-width: 0; flex: 1; }

/* composer */
.composer { background: var(--panel); border: 2px solid var(--line-2); border-radius: 22px; padding: 12px 12px 10px; box-shadow: var(--shadow); max-width: 820px; margin: 0 auto; transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft), var(--shadow); }
.composer-top { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 0 4px; }
.composer textarea { width: 100%; border: 0; box-shadow: none !important; resize: none; font-size: 17px; padding: 10px 6px; min-height: 56px; max-height: 260px; background: transparent; }
.composer-row { display: flex; gap: 4px; align-items: center; }
.hint { flex: 1; font-size: 12.5px; color: var(--muted); padding-left: 6px; }
.send { margin-left: auto; padding: 10px 20px; border-radius: 14px; font-size: 15.5px; }
.attachments { display: flex; gap: 6px; flex-wrap: wrap; }
.att { background: var(--soft); border-radius: 99px; padding: 4px 6px 4px 12px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; max-width: 260px; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 14px; }

/* picker */
.picker { position: fixed; z-index: 50; background: var(--panel); border: 1.5px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(420px, calc(100vw - 32px)); max-height: 340px; overflow: auto; padding: 6px; }
.pick { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.pick.on, .pick:hover { background: var(--accent-soft); }
.pick .pi { font-size: 20px; width: 28px; text-align: center; }
.pick b { display: block; font-size: 14px; }
.pick small { color: var(--muted); font-size: 12px; display: block; line-height: 1.3; }
.picker .ph { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 10px 4px; font-weight: 700; }

/* chat */
#view-chat { display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.chat-title { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.thread { flex: 1; overflow: auto; padding: 26px 20px 10px; display: flex; flex-direction: column; gap: 22px; }
.chat-foot { padding: 10px 20px 18px; }
.msg { max-width: 820px; width: 100%; margin: 0 auto; }
.msg.user .bubble { background: var(--accent); color: var(--accent-ink); border-radius: 20px 20px 6px 20px; padding: 12px 16px; margin-left: auto; width: fit-content; max-width: 85%; white-space: pre-wrap; font-weight: 500; }
.msg.sea { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.msg.sea .body { min-width: 0; }
.msg.sea .who { font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.md { overflow-wrap: anywhere; font-size: 15.5px; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol { margin: 0 0 10px; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 2px 0; }
.md h1, .md h2, .md h3 { font-size: 16px; margin: 16px 0 8px; }
.md code { font-family: var(--mono); font-size: 13px; background: var(--soft); padding: 1px 6px; border-radius: 6px; }
.md pre { background: var(--soft); border-radius: 12px; padding: 12px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; margin: 0 0 12px; display: block; overflow-x: auto; font-size: 14px; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--soft); }
.md blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--line-2); color: var(--ink-2); }
.md img { max-width: 100%; border-radius: 10px; }
.md a[data-file] { background: var(--accent-soft); padding: 0 6px; border-radius: 6px; font-weight: 600; }
.now { display: flex; gap: 10px; align-items: center; color: var(--ink-2); font-size: 14.5px; background: var(--soft); border-radius: 12px; padding: 9px 12px; margin: 6px 0; }
.spinner { width: 16px; height: 16px; border: 2.5px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .55; } }
.did { margin: 4px 0 10px; font-size: 13px; }
.did summary { cursor: pointer; color: var(--muted); font-weight: 600; list-style: none; display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 99px; background: var(--soft); }
.did summary::-webkit-details-marker { display: none; }
.did ol { margin: 8px 0 0; padding-left: 26px; color: var(--ink-2); }
.did li { padding: 1px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results { margin-top: 12px; display: grid; gap: 8px; }
.results h4 { margin: 0; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.result { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; cursor: pointer; color: var(--ink); text-decoration: none; }
.result:hover { border-color: var(--accent); text-decoration: none; }
.result .rico { font-size: 24px; }
.result b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result small { color: var(--muted); display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result > div { min-width: 0; flex: 1; }
.result .go { font-weight: 700; color: var(--accent); white-space: nowrap; }
.replies { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.reply { border: 1.5px solid var(--line-2); background: var(--panel); border-radius: 99px; padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 14px; }
.reply:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.reply.main { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.error-box { background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 10px 14px; font-weight: 600; }
.meta-line { font-size: 12px; color: var(--muted); margin-top: 8px; }
.readonly-note { text-align: center; color: var(--muted); background: var(--soft); border-radius: 12px; padding: 8px; }

/* sheet (tool flow) */
.scrim { position: fixed; inset: 0; background: rgba(10,14,12,.4); z-index: 30; backdrop-filter: blur(2px); }
.sheet { position: fixed; z-index: 31; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); background: var(--panel); border-radius: 24px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.sheet-head { display: flex; gap: 14px; align-items: center; padding: 22px 22px 10px; }
.sheet-head .si { font-size: 40px; line-height: 1; }
.sheet-head h2 { font-size: 21px; }
.sheet-head p { margin: 2px 0 0; color: var(--muted); }
.sheet-body { padding: 8px 22px 6px; overflow: auto; }
.sheet-foot { display: flex; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--line); align-items: center; }
.step-label { font-weight: 800; font-size: 15px; margin: 10px 0 10px; display: flex; gap: 8px; align-items: center; }
.step-label .n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; font-size: 13px; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 320px; overflow: auto; padding: 2px; }
.client-pick { display: flex; gap: 10px; align-items: center; border: 1.5px solid var(--line); background: var(--panel); border-radius: 14px; padding: 8px 10px; cursor: pointer; text-align: left; min-width: 0; }
.client-pick:hover { border-color: var(--accent); }
.client-pick.on { border-color: var(--accent); background: var(--accent-soft); }
.client-pick b { display: block; font-size: 13.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-pick small { color: var(--muted); font-size: 11.5px; font-family: var(--mono); }
.client-pick > div { min-width: 0; }
.client-pick .avatar { width: 32px; height: 32px; font-size: 11.5px; }
.note { border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }
.note.money { background: var(--sun-soft); color: var(--ink); }
.note.info { background: var(--soft); color: var(--ink-2); }
.sheet textarea { width: 100%; min-height: 90px; font-size: 16px; }

/* cards + lists */
.grid { display: grid; gap: 14px; }
.cols-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 18px; }
.chips .chip-btn { padding: 7px 14px; font-size: 14px; }
.tool-card { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; text-align: left; }
.tool-card:hover { border-color: var(--accent); }
.tool-card .ti { font-size: 30px; line-height: 1; }
.tool-card b { display: block; font-size: 15.5px; }
.tool-card small { color: var(--muted); font-size: 13.5px; display: block; line-height: 1.35; margin-top: 2px; }
.tool-card .tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); }
.tag.money { background: var(--sun-soft); color: var(--sun); }
.tag.helper { background: #ede7fb; color: #5b3fb5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.helper { background: #261f3b; color: #b9a6f3; } }
.client-card { display: grid; gap: 12px; cursor: pointer; }
.client-card:hover { border-color: var(--accent); }
.client-card .top { display: flex; gap: 12px; align-items: center; }
.client-card .top b { display: block; font-size: 16px; }
.client-card .top small { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.status { display: grid; gap: 4px; font-size: 13.5px; color: var(--ink-2); }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--soft); color: var(--ink-2); white-space: nowrap; font-weight: 600; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--sun-soft); color: var(--sun); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.work-item { display: flex; gap: 14px; align-items: center; }
.work-item .wi { font-size: 26px; }
.work-item > div { flex: 1; min-width: 0; }
.work-item b { display: block; }
.work-item small { color: var(--muted); display: block; font-size: 13px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.list { display: grid; gap: 10px; }
.tabs { display: flex; gap: 6px; border-bottom: 1.5px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.decision { padding: 12px 0; border-bottom: 1px solid var(--line); }
.decision summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; }
.decision .when { color: var(--muted); font-size: 12.5px; font-family: var(--mono); white-space: nowrap; }
.decision .body { margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.form-row label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
table.data { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--r); overflow: hidden; border: 1.5px solid var(--line); }
table.data th { text-align: left; font-size: 12.5px; color: var(--muted); padding: 10px 12px; background: var(--soft); }
table.data td { padding: 10px 12px; border-top: 1px solid var(--line); }
.help-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.help-step { text-align: center; padding: 20px; }
.help-step .hi { font-size: 44px; }
.help-step b { display: block; font-size: 16px; margin: 6px 0 4px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.empty .ei { font-size: 44px; display: block; margin-bottom: 8px; }

/* drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); background: var(--panel); z-index: 32; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.drawer header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer header b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.drawer-body { overflow: auto; padding: 22px; flex: 1; }
.drawer-body iframe { width: 100%; height: 100%; min-height: 72vh; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.drawer-body pre.plain { white-space: pre-wrap; font-family: var(--mono); font-size: 13px; }
.big-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 6px 0 22px; }
.big-action { display: flex; gap: 10px; align-items: center; border: 1.5px solid var(--line); background: var(--panel); border-radius: 14px; padding: 12px; cursor: pointer; text-align: left; font-weight: 700; font-size: 14px; }
.big-action:hover { border-color: var(--accent); background: var(--accent-soft); }
.big-action span { font-size: 22px; }
.dsec { margin-bottom: 22px; }
.dsec h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); align-items: center; }
.file-list a { display: flex; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--line); color: var(--ink); }
.file-list a:hover { color: var(--accent); }

.toast { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; z-index: 60; font-weight: 600; }
.dropzone { position: fixed; inset: 0; z-index: 70; background: rgba(15,118,110,.18); display: grid; place-items: center; pointer-events: none; }
.dropzone div { background: var(--panel); border: 3px dashed var(--accent); padding: 34px 44px; border-radius: 24px; font-size: 20px; font-weight: 800; color: var(--accent); }

/* tablet */
@media (max-width: 980px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
/* phone: rail becomes a bottom bar */
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rail { grid-row: 2; flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); gap: 0; }
  .rail .rail-logo, .rail-grow, .rail-me { display: none; }
  .rail a { width: auto; flex: 1; padding: 6px 0; font-size: 11px; }
  .rail a .ri { font-size: 20px; }
  main { grid-row: 1; }
  .home { padding: 22px 16px 40px; }
  .page { padding: 22px 16px 40px; }
  h1 { font-size: 23px; }
  .tiles { gap: 10px; }
  .tile { padding: 14px; }
  .tile .ti { font-size: 28px; }
  .hint { display: none; }
  .thread { padding: 18px 14px 8px; }
  .chat-foot { padding: 8px 10px 10px; }
  .chat-head { padding: 8px 10px; }
  .composer textarea { font-size: 16px; min-height: 48px; }
  .sheet { top: auto; bottom: 0; left: 0; transform: none; width: 100%; border-radius: 24px 24px 0 0; max-height: 92dvh; }
  .work-item { flex-wrap: wrap; }
  .row-actions { width: 100%; justify-content: flex-start; }
}

.chip-btn:disabled { cursor: default; border-color: transparent; }
.chip-btn:disabled:hover { color: inherit; }
.chat-foot .composer textarea { min-height: 44px; font-size: 16px; }
.chat-foot .composer { padding: 8px 10px 8px; }
