/*
  CMS Wiki
  File: /public/assets/app.css
  Version: 0.2
  Modified: 2026-10-05
*/

@font-face { font-family: "Atkinson"; src: url(fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url(fonts/atkinson-hyperlegible-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url(fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url(fonts/atkinson-hyperlegible-latin-700-italic.woff2) format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --side:   #E9EFF2;
  --paper:  #FFFFFF;
  --ink:    #1C2830;
  --muted:  #5E6E78;
  --line:   #D5DEE3;
  --hover:  #DCE5EA;
  --accent: #1D5F7A;
  --accent-ink: #FFFFFF;
  --accent-soft: #E0EDF2;
  --mark:   #FFE7A3;
  --danger: #A63A2B;
  --code-bg: #F1F4F6;

  --info-bg: #E6F1F7;  --info-line: #3C86AA;
  --warn-bg: #FBF0DC;  --warn-line: #C2851E;
  --tip-bg:  #E5F3EA;  --tip-line:  #3D8F5D;

  --nav: #0F1C23; --nav-ink: #F2F6F8;
  --sb: #1D5F7A; --sb-ink: #FFFFFF; --sb-muted: rgba(255,255,255,.72); --sb-hover: rgba(255,255,255,.12); --sb-current: rgba(255,255,255,.22); --sb-line: rgba(255,255,255,.28);
  --font: "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --radius: 6px;
  --side-w: 280px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --side: #11181C; --paper: #172025; --ink: #E2E9EC; --muted: #8E9EA7; --line: #27343B; --hover: #1F2A30;
    --accent: #6DB6D2; --accent-ink: #0E1A1F; --accent-soft: #1B3440; --mark: #6B5A1E; --danger: #E08374; --code-bg: #1D282E;
    --info-bg: #162C37; --info-line: #5AA7CB; --warn-bg: #33291A; --warn-line: #D9A045; --tip-bg: #183024; --tip-line: #5DB27E;
    --nav: #0A1216; --sb: #143A4A; --sb-current: rgba(255,255,255,.18);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --side: #11181C; --paper: #172025; --ink: #E2E9EC; --muted: #8E9EA7; --line: #27343B; --hover: #1F2A30;
  --accent: #6DB6D2; --accent-ink: #0E1A1F; --accent-soft: #1B3440; --mark: #6B5A1E; --danger: #E08374; --code-bg: #1D282E;
  --info-bg: #162C37; --info-line: #5AA7CB; --warn-bg: #33291A; --warn-line: #D9A045; --tip-bg: #183024; --tip-line: #5DB27E;
  --nav: #0A1216; --sb: #143A4A; --sb-current: rgba(255,255,255,.18);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ── Buttons & inputs ─────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .45em .9em; border: 1px solid var(--line);
  background: var(--paper); border-radius: var(--radius); cursor: pointer; font-weight: 700; font-size: .92rem; line-height: 1.3; }
.btn:hover { background: var(--hover); }
a.btn { color: var(--ink); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { background: none; border: 0; padding: .35rem .5rem; border-radius: var(--radius); cursor: pointer; color: var(--muted); font-size: 1.05rem; line-height: 1; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.linklike { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linklike:hover { color: var(--ink); }
input[type=text], input[type=search], input[type=password], input:not([type]), select {
  width: 100%; padding: .5em .65em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* ── Layout ───────────────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100vh; }
.frame { flex: 1; min-height: 0; display: flex; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.view { flex: 1; overflow-y: auto; outline: none; }

/* Top bar */
.topnav { flex: none; display: flex; align-items: center; gap: 1rem; height: 58px; padding: 0 1rem 0 1.1rem; background: var(--nav); color: var(--nav-ink); }
.topnav .icon-btn { color: var(--nav-ink); opacity: .85; }
.topnav .icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; opacity: 1; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; color: var(--nav-ink); text-decoration: none; white-space: nowrap; width: calc(var(--side-w) - 2.1rem); flex: none; }
.brand-mark { width: 26px; height: 24px; flex: none; border-radius: 5px; background: #2F86A8;
  background-image: linear-gradient(#fff, #fff), linear-gradient(#fff, #fff), linear-gradient(#fff, #fff);
  background-size: 14px 2.5px, 9px 2.5px, 12px 2.5px; background-position: 6px 6px, 6px 11px, 6px 16px; background-repeat: no-repeat; }
.search { position: relative; flex: 1; max-width: 560px; margin: 0 auto; }
.search input { height: 38px; border-radius: 999px; padding: 0 1rem 0 2.4rem; border: 1px solid transparent; background: rgba(255,255,255,.1); color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='.7' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 18px; background-position: .8rem center; }
.search input::placeholder { color: rgba(255,255,255,.62); }
.search input:focus { outline: 2px solid #5FB3D3; outline-offset: 0; background-color: rgba(255,255,255,.14); }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--paper); color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 14px 34px rgba(5, 20, 28, .28); max-height: 70vh; overflow-y: auto; }
.search-results a { display: block; padding: .65rem .9rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.search-results a:last-child { border-bottom: 0; }
.search-results a.active, .search-results a:hover { background: var(--accent-soft); }
.search-results strong { display: block; }
.search-results .snip { display: block; color: var(--muted); font-size: .86rem; margin-top: .15rem; }
.search-results mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.search-results .empty { padding: .8rem; color: var(--muted); font-size: .9rem; }
.topnav-actions { display: flex; align-items: center; gap: .5rem; flex: none; }
.nav-btn { background: transparent; color: var(--nav-ink); border-color: rgba(255,255,255,.3); }
.nav-btn:hover { background: rgba(255,255,255,.1); }
.nav-user { display: flex; align-items: center; gap: .5rem; background: none; border: 0; color: var(--nav-ink); cursor: pointer; padding: .25rem .4rem .25rem .25rem; border-radius: 999px; }
.nav-user:hover { background: rgba(255,255,255,.1); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #2F86A8; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; }
.nav-user-name { font-size: .92rem; }

/* Sidebar */
.sidebar { width: var(--side-w); flex: none; background: var(--sb); color: var(--sb-ink); display: flex; flex-direction: column; min-height: 0; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem .25rem; font-weight: 700; }
.side-head .icon-btn { color: var(--sb-ink); }
.side-home { display: block; margin: .8rem .5rem .2rem; padding: .4rem .6rem; border-radius: var(--radius); color: var(--sb-ink); text-decoration: none; font-weight: 700; }
.side-home:hover { background: var(--sb-hover); }
.tree { flex: 1; overflow-y: auto; padding: 0 .5rem 1rem; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { margin-left: .85rem; border-left: 1px solid var(--sb-line); padding-left: .2rem; }
.tree-row { display: flex; align-items: center; border-radius: var(--radius); position: relative; }
.tree-row:hover { background: var(--sb-hover); }
.tree-row.current { background: var(--sb-current); }
.tree-row.current > a { font-weight: 700; }
.tree-row > a { flex: 1; min-width: 0; padding: .36rem .4rem; color: var(--sb-ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .95rem; }
.tree-toggle { width: 1.4rem; flex: none; text-align: center; background: none; border: 0; cursor: pointer; color: var(--sb-muted); font-size: .7rem; padding: .3rem 0; }
.tree-toggle:hover { color: var(--sb-ink); }
.tree-toggle.leaf { visibility: hidden; }
.tree-add { opacity: 0; flex: none; background: none; border: 0; cursor: pointer; color: var(--sb-ink); padding: .15rem .45rem; border-radius: 4px; font-size: 1rem; }
.tree-row:hover .tree-add, .tree-add:focus-visible { opacity: .85; }
.tree-add:hover { background: rgba(255,255,255,.18); opacity: 1; }
.tree-row.drop-before::before, .tree-row.drop-after::after { content: ""; position: absolute; left: 1.4rem; right: 0; height: 2px; background: #fff; }
.tree-row.drop-before::before { top: -1px; }
.tree-row.drop-after::after { bottom: -1px; }
.tree-row.drop-inside { outline: 2px solid #fff; outline-offset: -2px; }
.tree-row.dragging { opacity: .45; }
.tree-empty { color: var(--sb-muted); font-size: .9rem; padding: .5rem .6rem; }
.sidebar :focus-visible { outline-color: #fff; }
.side-foot { display: flex; gap: 1.2rem; padding: .8rem 1.1rem 1rem; border-top: 1px solid var(--sb-line); font-size: .9rem; }
.side-foot a { color: var(--sb-muted); text-decoration: none; }
.side-foot a:hover { color: var(--sb-ink); text-decoration: underline; }

/* Breadcrumb strip */
.crumbbar { flex: none; display: flex; align-items: center; gap: .75rem; min-height: 50px; padding: .45rem 1.5rem; background: var(--side); border-bottom: 1px solid var(--line); }
.crumbs { flex: 1; min-width: 0; display: flex; gap: .5rem; align-items: center; font-size: .92rem; color: var(--muted); white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs .home { display: flex; color: var(--muted); }
.crumbs .sep { opacity: .45; }
.crumbs .here { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: .5rem; }
.save-state { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.save-state.bad { color: var(--danger); font-weight: 700; }

.only-mobile { display: none; }

/* ── Page ─────────────────────────────────────────────────────────── */
.page-wrap { max-width: 860px; margin: 0 auto; padding: 1.5rem 2rem 6rem; }
.page-title { display: block; width: 100%; border: 0; resize: none; overflow: hidden; background: none; padding: 0; margin: .6rem 0 .2rem;
  font: 700 2.35rem/1.15 var(--font); letter-spacing: -.01em; color: var(--ink); outline: none; }
.page-title::placeholder { color: var(--muted); opacity: .6; }
.page-meta { color: var(--muted); font-size: .86rem; margin-bottom: 1.2rem; }

.banner { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding: .7rem 1rem; border-radius: var(--radius);
  background: var(--warn-bg); border-left: 4px solid var(--warn-line); margin: 1rem 0; font-size: .94rem; }
.banner p { margin: 0; flex: 1 1 260px; }

/* Toolbar */
.toolbar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: .35rem .4rem;
  margin: 0 -.4rem .8rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.tb { min-width: 30px; height: 32px; padding: 0 .35rem; border: 0; background: none; border-radius: 5px; cursor: pointer; color: var(--ink); font-size: .92rem; display: inline-flex; align-items: center; justify-content: center; }
.tb:hover { background: var(--hover); }
.tb.on { background: var(--accent-soft); color: var(--accent); }
.tb:disabled { opacity: .35; cursor: default; background: none; }
.tb b, .tb i, .tb u, .tb s { font-size: 1rem; }
.tb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 3px; }
.tb-mono { font-family: var(--mono); font-size: .8rem; }
.tb-select { width: auto; height: 32px; padding: 0 .2rem; border: 0; background: none; font-weight: 700; font-size: .9rem; cursor: pointer; border-radius: 5px; }
.tb-select:hover { background: var(--hover); }
.tb-hl { background: var(--mark); padding: 0 3px; border-radius: 2px; }

/* Popover menus (slash, table, callout, link picker) */
.pop { position: fixed; z-index: 50; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 32px rgba(10, 30, 40, .2);
  min-width: 220px; max-width: 320px; max-height: 340px; overflow-y: auto; padding: .3rem; font-size: .93rem; }
.pop button.item { display: flex; width: 100%; text-align: left; gap: .6rem; align-items: baseline; padding: .4rem .55rem; border: 0; background: none; border-radius: 5px; cursor: pointer; }
.pop button.item:hover, .pop button.item.active { background: var(--accent-soft); }
.pop .item .ico { width: 1.4rem; flex: none; text-align: center; color: var(--muted); }
.pop .item small { display: block; color: var(--muted); font-size: .8rem; }
.pop .pop-head { padding: .35rem .55rem .2rem; color: var(--muted); font-size: .8rem; }
.pop .pop-input { padding: .3rem; }
.pop .empty { padding: .5rem .6rem; color: var(--muted); }
.link-bubble { position: fixed; z-index: 45; display: flex; align-items: center; gap: .2rem; background: var(--paper); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 22px rgba(10, 30, 40, .16); padding: .25rem .35rem; font-size: .88rem; max-width: 420px; }
.link-bubble .url { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); padding: 0 .4rem; }

/* ── Document content ─────────────────────────────────────────────── */
.doc { font-size: 1.04rem; line-height: 1.65; min-height: 40vh; }
.doc .ProseMirror { outline: none; }
.doc .ProseMirror > * + * { margin-top: .75em; }
.doc p { margin: 0; }
.doc h1, .doc h2, .doc h3 { line-height: 1.25; margin: 1.6em 0 .4em; }
.doc h1 { font-size: 1.75rem; }
.doc h2 { font-size: 1.4rem; padding-bottom: .2em; border-bottom: 1px solid var(--line); }
.doc h3 { font-size: 1.15rem; }
.doc .ProseMirror > :first-child { margin-top: 0; }
.doc ul, .doc ol { padding-left: 1.6em; margin-bottom: 0; }
.doc li > p { margin: .15em 0; }
.doc blockquote { margin-left: 0; padding: .1em 0 .1em 1em; border-left: 3px solid var(--line); color: var(--muted); }
.doc code { font-family: var(--mono); font-size: .88em; background: var(--code-bg); padding: .12em .35em; border-radius: 4px; }
.doc pre { font-family: var(--mono); font-size: .88rem; line-height: 1.5; background: var(--code-bg); padding: .9rem 1rem; border-radius: var(--radius); overflow-x: auto; }
.doc pre code { background: none; padding: 0; font-size: inherit; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.doc mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.doc a { text-decoration: underline; text-underline-offset: 2px; }
.doc a[href^="/p/"] { text-decoration-style: dotted; }
.doc img { max-width: 100%; height: auto; border-radius: 4px; display: block; }
.doc img.ProseMirror-selectednode { outline: 3px solid var(--accent); }
.doc img.uploading { opacity: .5; }

.doc ul[data-type="taskList"] { list-style: none; padding-left: .2em; }
.doc ul[data-type="taskList"] li { display: flex; gap: .55em; align-items: flex-start; }
.doc ul[data-type="taskList"] li > label { flex: none; margin-top: .28em; }
.doc ul[data-type="taskList"] li > label input { width: 1.05em; height: 1.05em; accent-color: var(--accent); cursor: pointer; }
.doc ul[data-type="taskList"] li > div { flex: 1; }
.doc ul[data-type="taskList"] li[data-checked="true"] > div { color: var(--muted); text-decoration: line-through; }

.doc table { border-collapse: collapse; width: 100%; table-layout: fixed; margin: 0; overflow: hidden; }
.doc th, .doc td { border: 1px solid var(--line); padding: .45em .6em; vertical-align: top; position: relative; min-width: 3em; }
.doc th { background: var(--code-bg); text-align: left; font-weight: 700; }
.doc td > p, .doc th > p { margin: 0; }
.doc .tableWrapper { overflow-x: auto; }
.doc .selectedCell::after { content: ""; position: absolute; inset: 0; background: var(--accent-soft); opacity: .6; pointer-events: none; }
.doc .column-resize-handle { position: absolute; right: -2px; top: 0; bottom: 0; width: 4px; background: var(--accent); pointer-events: none; }
.doc .resize-cursor { cursor: col-resize; }

.doc div[data-callout] { padding: .8em 1em .8em 2.9em; border-radius: var(--radius); border-left: 4px solid var(--info-line); background: var(--info-bg); position: relative; }
.doc div[data-callout]::before { content: "i"; position: absolute; left: .85em; top: .8em; width: 1.35em; height: 1.35em; border-radius: 50%;
  background: var(--info-line); color: var(--paper); font-weight: 700; font-size: .85em; display: flex; align-items: center; justify-content: center; font-style: normal; }
.doc div[data-callout][data-kind="warning"] { border-left-color: var(--warn-line); background: var(--warn-bg); }
.doc div[data-callout][data-kind="warning"]::before { content: "!"; background: var(--warn-line); }
.doc div[data-callout][data-kind="tip"] { border-left-color: var(--tip-line); background: var(--tip-bg); }
.doc div[data-callout][data-kind="tip"]::before { content: "✓"; background: var(--tip-line); }
.doc div[data-callout] > * + * { margin-top: .5em; }

.doc .is-editor-empty:first-child::before, .doc p.is-empty::before { content: attr(data-placeholder); color: var(--muted); opacity: .7; float: left; height: 0; pointer-events: none; }

/* ── Lists (home, history, trash, people) ─────────────────────────── */
.list-wrap { max-width: 820px; margin: 0 auto; padding: 2rem 2rem 5rem; }
.list-wrap h1 { font-size: 2rem; margin: .3rem 0 1.2rem; }
.list-wrap .lead { color: var(--muted); margin: -.6rem 0 1.5rem; }
.rows { border-top: 1px solid var(--line); }
.rows > * { display: flex; gap: 1rem; align-items: center; padding: .7rem .2rem; border-bottom: 1px solid var(--line); }
.rows a.title { flex: 1; min-width: 0; font-weight: 700; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows a.title:hover { color: var(--accent); text-decoration: underline; }
.rows .meta { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.empty-state { padding: 2.5rem 0; }
.empty-state p { color: var(--muted); max-width: 46ch; }

.history { display: grid; grid-template-columns: 300px 1fr; gap: 0; height: 100%; }
.history-list { border-right: 1px solid var(--line); overflow-y: auto; }
.history-list button { display: block; width: 100%; text-align: left; padding: .7rem 1rem; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.history-list button:hover { background: var(--hover); }
.history-list button.active { background: var(--accent-soft); }
.history-list .when { font-weight: 700; display: block; }
.history-list .who { color: var(--muted); font-size: .86rem; }
.history-list .note { display: block; color: var(--accent); font-size: .82rem; }
.history-view { overflow-y: auto; }
.history-bar { position: sticky; top: 0; z-index: 2; display: flex; gap: .75rem; align-items: center; justify-content: space-between; padding: .7rem 2rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.history-bar span { color: var(--muted); font-size: .9rem; }

.people-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; align-items: end; margin-bottom: 2rem; padding: 1rem; background: var(--side); border-radius: var(--radius); }
.people-form label, .modal label { display: block; font-size: .86rem; color: var(--muted); }
.people-form label input, .people-form label select, .modal label input { margin-top: .25rem; color: var(--ink); }
.tag { font-size: .78rem; padding: .1rem .45rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.tag.off { background: var(--hover); color: var(--muted); }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(8, 20, 26, .45); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 1rem 1rem; }
.modal { background: var(--paper); border-radius: 10px; width: 100%; max-width: 420px; padding: 1.4rem; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.modal h2 { margin: 0 0 1rem; font-size: 1.25rem; }
.modal p { margin: 0 0 1rem; }
.modal label { margin-bottom: .8rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.form-error { color: var(--danger); font-size: .9rem; margin: .3rem 0 0; }

.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 70; background: var(--ink); color: var(--paper);
  padding: .6rem 1rem; border-radius: 8px; font-size: .92rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.toast.bad { background: var(--danger); color: #fff; }

/* ── Login ────────────────────────────────────────────────────────── */
.login-body { background: var(--side); display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.login { width: 100%; max-width: 360px; background: var(--paper); padding: 2rem; border-radius: 10px; border: 1px solid var(--line); }
.login-mark { width: 40px; height: 36px; border-radius: 7px; background: var(--accent);
  background-image: linear-gradient(var(--accent-ink), var(--accent-ink)), linear-gradient(var(--accent-ink), var(--accent-ink)), linear-gradient(var(--accent-ink), var(--accent-ink));
  background-size: 22px 4px, 15px 4px, 19px 4px; background-position: 9px 9px, 9px 16px, 9px 23px; background-repeat: no-repeat; }
.login h1 { margin: 1rem 0 .2rem; font-size: 1.6rem; }
.login-sub { margin: 0 0 1.5rem; color: var(--muted); font-size: .94rem; }
.login-form label { display: block; margin-bottom: 1rem; font-size: .88rem; color: var(--muted); }
.login-form input { margin-top: .3rem; color: var(--ink); }
.login-form .btn { width: 100%; margin-top: .4rem; padding: .65em; }

/* ── Small screens ────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .only-mobile { display: inline-block; }
  .side-head.only-mobile { display: flex; }
  .topnav { gap: .5rem; padding: 0 .6rem; }
  .brand { width: auto; }
  .brand-name, .nav-user-name, .nb-text { display: none; }
  .nav-btn { padding: .35em .7em; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; }
  body.side-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .page-wrap, .list-wrap { padding-left: 1.1rem; padding-right: 1.1rem; }
  .page-title { font-size: 1.85rem; }
  .history { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .history-list { max-height: 34vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .history-bar { padding: .7rem 1.1rem; }
  .save-state { display: none; }
  .crumbbar { padding: .4rem .75rem; }
  .crumbs { display: none; }
  .top-actions { margin-left: auto; }
  .top-actions .hide-mobile { display: none; }
  .toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .toolbar > * { flex: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .sidebar, .topnav, .crumbbar, .toolbar, .banner { display: none !important; }
  #app, .view { display: block; height: auto; overflow: visible; }
}
