/* =====================================================================
   Каталог ХМК СССР — стили (по утверждённому макету «Список и карточка»)
   1. tokens (light / dark)   2. base + kit   3. boot, login, invite, header
   4. workspace: years | list | card   5. pages: review, upload, users, help
   6. popovers, dialog, viewer, toast   7. responsive
   The theme is chosen by [data-theme] on <html> (light | dark); without it the system setting decides.
   ===================================================================== */

/* ---------- 1. tokens ---------- */
:root {
  --f: "Segoe UI Variable Text", "Segoe UI", "Noto Sans", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --fd: "Segoe UI Variable Display", "Segoe UI", "Noto Sans", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --fm: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
  --r: 8px; --rs: 4px;
  --nav-w: 248px; --list-w: 340px; --rail-w: 48px;

  --bg: #f3f4f6;
  --mica: linear-gradient(180deg, #eef2f7 0%, #f3f4f6 180px);
  --accent: #005fb8; --accent-hover: #1a6fc0; --on-accent: #ffffff;
  --layer: rgba(255,255,255,.62);
  --card: #ffffff; --cardpane: #fdfdfd; --btn: #ffffff; --btn-hover: #f6f6f6;
  --stroke: rgba(0,0,0,.075); --stroke-strong: rgba(0,0,0,.14);
  --text: #1a1a1a; --text2: #5d5d5d; --text3: #6e6e6e;
  --subtle: rgba(0,0,0,.04); --subtle2: rgba(0,0,0,.065);
  --input: rgba(255,255,255,.9); --input-line: rgba(0,0,0,.45);
  --sel: rgba(0,95,184,.10); --sel-ring: rgba(0,95,184,.18);
  --stage: linear-gradient(180deg, #eef1f5 0%, #e6eaef 100%);
  --envshadow: 0 1px 2px rgba(0,0,0,.10), 0 6px 18px rgba(0,0,0,.10);
  --info: #005fb8; --info-bg: #eef5fc; --info-line: #c6dcf2;
  --ok: #0f6b3a; --ok-bg: #dff3e6; --ok-line: #a9d9b9;
  --warn: #8a5300; --warn-bg: #fff4de; --warn-line: #efd29c;
  --del: #a4262c; --del-bg: #fde7e9; --del-line: #f1b7bc;
  --ins: #0e5a2f; --ins-bg: #d9f2df;
  --muted-bg: #f1f2f4; --muted-line: #dcdfe3;
  --group: #f8f9fa; --th: #f7f8fa; --chead: rgba(253,253,253,.92);
  --stripe-a: #fafafa; --stripe-b: #efefef;
  --overlay: rgba(10,14,20,.36);
  --pop-shadow: 0 10px 30px rgba(0,0,0,.16), 0 1px 3px rgba(0,0,0,.08);
  --focus: #1a1a1a;
  --av-owner: #005fb8; --av-editor: #9a5b00; --av-reader: #5f6b76;
  --toast-bg: #1f2933; --toast-fg: #ffffff; --toast-line: transparent;
  --mark: #fde68a;
  --track: rgba(0,0,0,.08);
  --switch-off: #8a8f96;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1d20;
    --mica: linear-gradient(180deg, #1f2733 0%, #1b1d20 200px);
    --accent: #60cdff; --accent-hover: #7dd6ff; --on-accent: #001a26;
    --layer: rgba(255,255,255,.035);
    --card: #2a2b2e; --cardpane: #222326; --btn: #2f3034; --btn-hover: #37383d;
    --stroke: rgba(255,255,255,.08); --stroke-strong: rgba(255,255,255,.16);
    --text: #f3f4f6; --text2: #c3c7cc; --text3: #a3a8ae;
    --subtle: rgba(255,255,255,.05); --subtle2: rgba(255,255,255,.09);
    --input: rgba(255,255,255,.06); --input-line: rgba(255,255,255,.5);
    --sel: rgba(96,205,255,.14); --sel-ring: rgba(96,205,255,.25);
    --stage: linear-gradient(180deg, #2b2f35 0%, #24272c 100%);
    --envshadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px rgba(0,0,0,.45);
    --info: #8fd3ff; --info-bg: #1a2a38; --info-line: #2c4a64;
    --ok: #8fe0ad; --ok-bg: rgba(60,170,100,.18); --ok-line: rgba(60,170,100,.4);
    --warn: #f5c56b; --warn-bg: rgba(245,180,60,.12); --warn-line: rgba(245,180,60,.32);
    --del: #ff9aa0; --del-bg: rgba(255,90,100,.14); --del-line: rgba(255,90,100,.35);
    --ins: #97e6b4; --ins-bg: rgba(60,170,100,.2);
    --muted-bg: #2a2c30; --muted-line: #3a3d42;
    --group: #26272a; --th: #2f3034; --chead: rgba(34,35,38,.92);
    --stripe-a: #2a2b2e; --stripe-b: #323337;
    --overlay: rgba(0,0,0,.55);
    --pop-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.06);
    --focus: #ffffff;
    --av-owner: #2b8fd6; --av-editor: #b07418; --av-reader: #6c7782;
    --toast-bg: #33353a; --toast-fg: #f3f4f6; --toast-line: rgba(255,255,255,.22);
    --mark: rgba(245,197,107,.38);
    --track: rgba(255,255,255,.12);
    --switch-off: #7d838b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1d20;
  --mica: linear-gradient(180deg, #1f2733 0%, #1b1d20 200px);
  --accent: #60cdff; --accent-hover: #7dd6ff; --on-accent: #001a26;
  --layer: rgba(255,255,255,.035);
  --card: #2a2b2e; --cardpane: #222326; --btn: #2f3034; --btn-hover: #37383d;
  --stroke: rgba(255,255,255,.08); --stroke-strong: rgba(255,255,255,.16);
  --text: #f3f4f6; --text2: #c3c7cc; --text3: #a3a8ae;
  --subtle: rgba(255,255,255,.05); --subtle2: rgba(255,255,255,.09);
  --input: rgba(255,255,255,.06); --input-line: rgba(255,255,255,.5);
  --sel: rgba(96,205,255,.14); --sel-ring: rgba(96,205,255,.25);
  --stage: linear-gradient(180deg, #2b2f35 0%, #24272c 100%);
  --envshadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px rgba(0,0,0,.45);
  --info: #8fd3ff; --info-bg: #1a2a38; --info-line: #2c4a64;
  --ok: #8fe0ad; --ok-bg: rgba(60,170,100,.18); --ok-line: rgba(60,170,100,.4);
  --warn: #f5c56b; --warn-bg: rgba(245,180,60,.12); --warn-line: rgba(245,180,60,.32);
  --del: #ff9aa0; --del-bg: rgba(255,90,100,.14); --del-line: rgba(255,90,100,.35);
  --ins: #97e6b4; --ins-bg: rgba(60,170,100,.2);
  --muted-bg: #2a2c30; --muted-line: #3a3d42;
  --group: #26272a; --th: #2f3034; --chead: rgba(34,35,38,.92);
  --stripe-a: #2a2b2e; --stripe-b: #323337;
  --overlay: rgba(0,0,0,.55);
  --pop-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.06);
  --focus: #ffffff;
  --av-owner: #2b8fd6; --av-editor: #b07418; --av-reader: #6c7782;
  --toast-bg: #33353a; --toast-fg: #f3f4f6; --toast-line: rgba(255,255,255,.22);
  --mark: rgba(245,197,107,.38);
  --track: rgba(255,255,255,.12);
  --switch-off: #7d838b;
  color-scheme: dark;
}

/* ---------- 2. base + kit ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg) var(--mica) no-repeat; color: var(--text);
  font: 400 14px/1.43 var(--f); font-variant-numeric: tabular-nums;
}
/* desktop and tablet: the site fills the window and each pane scrolls on its own */
@media (min-width: 901px) { body.in-app { height: 100vh; height: 100dvh; } }
h1, h2, h3, p, figure, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; }
.muted { color: var(--text3); }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
code, .mono { font-family: var(--fm); }
.noscript { padding: 24px; font-size: 16px; }

.btn {
  font: 400 14px/20px var(--f); color: var(--text); background: var(--btn); border: 1px solid var(--stroke);
  border-bottom-color: var(--stroke-strong); border-radius: var(--rs); padding: 5px 11px; min-height: 32px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--btn-hover); }
.btn:active { color: var(--text2); }
.btn.accent { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 600; }
.btn.accent:hover { background: var(--accent-hover); }
.btn.accent:active { color: var(--on-accent); opacity: .9; }
.btn.subtle { background: transparent; border-color: transparent; }
.btn.subtle:hover { background: var(--subtle2); }
.btn.icon { padding: 5px 8px; }
.btn.danger { color: var(--del); }
.btn.danger-fill { background: var(--del); color: #fff; border-color: transparent; font-weight: 600; }
:root[data-theme="dark"] .btn.danger-fill { color: #2a0a0c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger-fill { color: #2a0a0c; } }
.btn.big { min-height: 40px; padding: 8px 16px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: default; pointer-events: none; }
.btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn[aria-disabled="true"]:hover { background: var(--btn); }
.btn.flash { box-shadow: 0 0 0 3px var(--sel-ring); }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--text2) transparent var(--text2) transparent; }
.btn.accent.is-busy::after { border-color: var(--on-accent) transparent var(--on-accent) transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.btn:focus-visible, .input:focus-visible, .textarea:focus-visible, .select:focus-visible,
.li:focus-visible, .tile:focus-visible, .stageimg:focus-visible, .link:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.input, .textarea, .select {
  font: 400 14px/20px var(--f); color: var(--text); background: var(--input); width: 100%; min-width: 0;
  border: 1px solid var(--stroke); border-bottom: 1px solid var(--input-line); border-radius: var(--rs);
  padding: 5px 10px; min-height: 32px;
}
.input::placeholder, .textarea::placeholder { color: var(--text3); opacity: 1; }
.input:focus, .textarea:focus, .select:focus { border-bottom: 2px solid var(--accent); padding-bottom: 4px; outline: none; background: var(--card); }
.input[readonly] { background: var(--subtle); }
.input.is-bad { border-color: var(--del-line); border-bottom-color: var(--del); }
.textarea { resize: vertical; min-height: 64px; }
.select { padding-right: 6px; }
.select option { background: var(--card); color: var(--text); }
.box { background: var(--card); border: 1px solid var(--stroke); border-radius: var(--r); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; padding: 1px 8px; border-radius: 999px; background: var(--subtle2); color: var(--text2); white-space: nowrap; font-weight: 400; }
.badge.accent { background: var(--accent); color: var(--on-accent); }
.badge.warn { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.del { background: var(--del-bg); color: var(--del); }
.badge.info { background: var(--info-bg); color: var(--info); box-shadow: inset 0 0 0 1px var(--info-line); }
.badge.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--stroke-strong); color: var(--text); }
.li { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--rs); cursor: pointer; }
.li:hover { background: var(--subtle); }
.li.selected { background: var(--sel); }
.li.selected::before { content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 16px; margin-top: -8px; border-radius: 2px; background: var(--accent); }
.table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--text2); padding: 7px 8px; border-bottom: 1px solid var(--stroke-strong); white-space: nowrap; background: var(--th); }
.table td { padding: 7px 8px; border-bottom: 1px solid var(--stroke); vertical-align: top; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); font: inherit; border-radius: 2px; }
.link:hover { text-decoration-color: currentColor; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 600; font-size: 13px; color: #fff; background: var(--av-owner); flex: none; }
.avatar.editor { background: var(--av-editor); }
.avatar.viewer, .avatar.reader { background: var(--av-reader); }
.avatar.guest { background: var(--subtle2); color: var(--text2); }
.avatar.av-sm { width: 22px; height: 22px; font-size: 11px; }
.avatar.av-lg { width: 38px; height: 38px; font-size: 15px; }
.noimg { display: grid; place-items: center; text-align: center; gap: 6px; border: 1.5px dashed var(--stroke-strong); border-radius: 6px;
  color: var(--text2); background: repeating-linear-gradient(135deg, transparent 0 10px, var(--subtle) 10px 11px); padding: 12px; font-size: 13px; }
.noimg b { color: var(--text); font-weight: 600; }
.seg { display: inline-flex; flex: none; border: 1px solid var(--stroke); border-bottom-color: var(--stroke-strong); border-radius: var(--rs); background: var(--card); padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--text2); width: 30px; height: 26px; border-radius: 3px; display: grid; place-items: center; cursor: pointer; padding: 0; }
.seg button:hover { background: var(--subtle2); }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--sel); color: var(--accent); }
.seg button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.seg-theme button { width: auto; padding: 0 10px; display: inline-flex; gap: 6px; align-items: center; font-size: 13px; height: 30px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--stroke-strong); border-top-color: var(--accent); display: inline-block; flex: none; }
.form-err { color: var(--del); background: var(--del-bg); border: 1px solid var(--del-line); border-radius: 6px; padding: 8px 10px; font-size: 13px; line-height: 1.45; }
.form-info { color: var(--text); background: var(--info-bg); border: 1px solid var(--info-line); border-radius: 6px; padding: 8px 10px; font-size: 13px; line-height: 1.45; }
.fld { display: grid; gap: 4px; }
.fld-l { font-size: 13px; color: var(--text2); }
.fld-h { font-size: 12px; color: var(--text2); line-height: 1.4; }
.pw { position: relative; display: block; }
.pw .input { padding-right: 44px; }
.pw .input:focus { padding-right: 44px; }
.pw-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); min-height: 30px; padding: 4px 8px; color: var(--text2); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .sw { width: 40px; height: 20px; border-radius: 10px; border: 1px solid var(--switch-off); background: transparent; position: relative; flex: none; }
.switch .sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--switch-off); }
.switch input:checked + .sw { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .sw::after { left: 23px; background: var(--on-accent); }
.switch input:focus-visible + .sw { outline: 2px solid var(--focus); outline-offset: 2px; }
.pbar { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.pbar > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; }

/* ---------- 3a. boot ---------- */
.boot { flex: 1; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--text2); font-size: 15px; min-height: 60vh; }

/* ---------- 3b. login ---------- */
.lg { flex: 1 0 auto; display: grid; place-items: center; padding: 40px max(16px, env(safe-area-inset-left)) 56px; }
.lg-wrap { width: min(1080px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.lg-col { display: grid; gap: 0; min-width: 0; }
.lg-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text2); font-weight: 600; letter-spacing: .02em; }
.lg h1 { font: 650 clamp(30px, 4vw, 46px)/1.08 var(--fd); letter-spacing: -.015em; margin: 14px 0 12px; text-wrap: balance; }
.lg-lead { color: var(--text2); font-size: 16px; line-height: 1.5; max-width: 46ch; }
.lg-form { margin-top: 24px; max-width: 440px; padding: 18px 20px 20px; display: grid; gap: 14px; }
.lg-form h2 { font: 600 18px/1.3 var(--fd); }
.lg-form .input { min-height: 38px; font-size: 15px; }
.lg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
.lg-actions .btn { flex: 1 1 160px; }
.lg-note { margin-top: 18px; font-size: 13px; color: var(--text2); display: flex; gap: 8px; align-items: flex-start; max-width: 440px; line-height: 1.45; }
.lg-note .ic { margin-top: 2px; }
.theme-row { margin-top: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text2); }
.lg-art { position: relative; aspect-ratio: 1.25; min-height: 0; }
.lg-env { position: absolute; width: 68%; aspect-ratio: 1150 / 817; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 18px 40px rgba(0,0,0,.18); border-radius: 2px; overflow: hidden; }
.lg-env img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lg-env.e1 { left: 0; top: 6%; transform: rotate(-7deg); }
.lg-env.e2 { right: 0; top: 0; transform: rotate(5deg); }
.lg-env.e3 { left: 16%; bottom: 0; transform: rotate(-1.5deg); }
.lg-cap { position: absolute; right: 0; bottom: -28px; font-size: 12px; color: var(--text3); }

/* invite / reset page */
.iv-wrap { width: min(520px, 100%); display: grid; gap: 0; }
.iv-wrap h1 { font-size: clamp(26px, 3.4vw, 36px); }
.iv-wrap .lg-form { max-width: none; }
.iv-role { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-top: 18px; }
.iv-role b { display: block; font-weight: 600; }
.iv-role span { font-size: 13px; color: var(--text2); }

/* ---------- 3c. app + header ---------- */
.app { flex: 1 1 auto; min-height: 520px; display: flex; flex-direction: column; }
.hd { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px 18px; padding: 8px 14px 8px 10px; }
.hd-brand { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 5px 8px; border-radius: 6px; cursor: pointer; color: var(--text); text-decoration: none; }
.hd-brand:hover { background: var(--subtle2); }
.hd-brand:focus-visible { outline: 2px solid var(--focus); }
.hd-brand span { font: 600 16px/1.2 var(--fd); white-space: nowrap; }
.logo { width: 26px; height: 26px; flex: none; }
.hd-search { position: relative; width: 100%; max-width: 620px; justify-self: center; margin: 0; }
.hd-search .ic { position: absolute; left: 12px; top: 50%; margin-top: -8px; color: var(--text2); pointer-events: none; }
.hd-search .input { padding-left: 38px; min-height: 36px; border-radius: 6px; }
.hd-search .input:focus { padding-left: 38px; }
.hd-actions { display: flex; align-items: center; gap: 8px; }
.hd-actions .btn { min-height: 36px; }
.hd-actions .btn[aria-current="page"] { background: var(--sel); border-color: var(--sel-ring); }
.hd-count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--subtle2); color: var(--text2); font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; }
.hd-count.on { background: var(--accent); color: var(--on-accent); }
.hd-short { display: none; }
.hd-user { display: inline-flex; align-items: center; gap: 9px; padding: 3px 8px 3px 3px; border-radius: 22px; background: transparent; border: 1px solid transparent; cursor: pointer; text-align: left; color: var(--text); }
.hd-user:hover { background: var(--subtle2); }
.hd-user:focus-visible { outline: 2px solid var(--focus); }
.hd-uname { display: grid; line-height: 1.2; }
.hd-uname b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.hd-uname small { font-size: 12px; color: var(--text2); white-space: nowrap; }

/* ---------- 4. workspace ---------- */
.ws { flex: 1; min-height: 0; display: grid; grid-template-columns: auto auto minmax(0, 1fr); position: relative; }
.mbar { display: none; }

/* years */
.nav { width: var(--nav-w); min-height: 0; position: relative; }
.ws.nav-collapsed .nav { width: var(--rail-w); }
.nav-panel { position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0; padding: 0 4px 8px; }
.nav-top { display: flex; align-items: center; gap: 6px; height: 44px; flex: none; }
.nav-ham { width: 40px; height: 36px; padding: 0; }
.nav-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.years { flex: 1; min-height: 0; overflow: auto; padding: 0 2px 4px; scrollbar-width: thin; }
.years li + li { margin-top: 2px; }
.yr { width: 100%; border: 0; background: transparent; color: var(--text); text-align: left; min-height: 36px; padding: 6px 12px; }
.yr .ic { color: var(--text2); }
.yr-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yr-cnt { font-size: 12px; color: var(--text2); white-space: nowrap; }
.yr.is-all { font-weight: 600; }
.yr.is-all .yr-cnt { font-weight: 400; }
.yr.selected .yr-name { font-weight: 600; }
.nav-sep { height: 1px; background: var(--stroke-strong); margin: 6px 8px !important; }
.nav-foot { flex: none; font-size: 13px; line-height: 1.45; color: var(--text2); padding: 8px 12px 0; border-top: 1px solid var(--stroke); margin: 4px 4px 0; }
.nav-foot:empty { display: none; }
.nav-foot b { color: var(--text); font-weight: 600; }
.nav-rail { display: none; flex-direction: column; align-items: center; gap: 4px; padding-top: 2px; }
.rail-year { width: 40px; min-height: 52px; padding: 0; flex-direction: column; gap: 2px; font-size: 12px; line-height: 15px; }
.ws.nav-collapsed .hide-c { display: none; }
.ws.nav-collapsed .nav-rail { display: flex; }

/* list rail (list collapsed) */
.lrail { display: none; width: var(--rail-w); flex-direction: column; align-items: center; gap: 6px; padding-top: 6px;
  background: var(--layer); border-top: 1px solid var(--stroke); border-left: 1px solid var(--stroke); border-top-left-radius: 8px; }
.lrail-label { writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; gap: 8px; padding: 12px 4px; min-height: 0; width: 36px; }
.lrail-label b { font-weight: 600; }
.lrail-label span { color: var(--text2); font-size: 12px; }
.ws.list-collapsed .lp { display: none; }
.ws.list-collapsed .lrail { display: flex; }

/* list pane */
.lp { width: var(--list-w); display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--layer);
  border-top: 1px solid var(--stroke); border-left: 1px solid var(--stroke); border-top-left-radius: 8px; }
.lp-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.lp-acc { display: none; }
.lp-head { flex: none; padding: 12px 12px 10px 14px; display: grid; gap: 10px; border-bottom: 1px solid var(--stroke); }
.lp-titlerow { display: flex; align-items: center; gap: 8px; }
.lp-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; flex: 1; }
.lp-title h2 { font: 600 20px/28px var(--fd); }
.lp-sub { font-size: 13px; color: var(--text2); }
.lp-tools { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.filter { position: relative; flex: 1; min-width: 0; }
.filter .ic { position: absolute; left: 10px; top: 50%; margin-top: -8px; color: var(--text2); pointer-events: none; }
.filter .input, .filter .input:focus { padding-left: 34px; }
.lp-scroll { position: relative; flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; }
.list { padding: 6px; display: grid; gap: 2px; }
.list > li[data-row] { content-visibility: auto; contain-intrinsic-size: auto 78px; }
.list.is-grid > li[data-row] { contain-intrinsic-size: auto 170px; }
.group { position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; gap: 8px; padding: 10px 10px 4px 16px; font-weight: 600; font-size: 13px; background: var(--group); border-bottom: 1px solid var(--stroke); margin: 0 -6px; }
.group span { font-weight: 400; font-size: 12px; color: var(--text2); }
.item { width: 100%; border: 0; background: transparent; color: var(--text); text-align: left; align-items: flex-start; gap: 12px; padding: 9px 10px 9px 12px; text-decoration: none; }
.thumb { flex: none; width: 76px; height: 54px; border-radius: 3px; background: #fff; box-shadow: 0 0 0 1px var(--stroke-strong), 0 1px 2px rgba(0,0,0,.08); overflow: hidden; display: grid; place-items: center; color: var(--text3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.is-empty { background: repeating-linear-gradient(135deg, var(--stripe-a) 0 6px, var(--stripe-b) 6px 7px); box-shadow: inset 0 0 0 1px var(--stroke-strong); }
.itxt { display: grid; gap: 2px; min-width: 0; flex: 1; }
.iline { display: flex; align-items: baseline; gap: 8px; }
.inum { font-weight: 600; font-size: 14px; }
.idate { margin-left: auto; font-size: 13px; color: var(--text2); white-space: nowrap; }
.ititle { font-size: 13px; line-height: 18px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ibadges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.qchip { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 2px 2px 10px; border-radius: 6px; background: var(--sel); color: var(--text); min-width: 0; }
.qchip > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qchip .btn { min-height: 26px; padding: 2px 6px; }
.b-paper { background: transparent; box-shadow: inset 0 0 0 1px var(--stroke-strong); color: var(--text); }
.b-have { background: var(--ok-bg); color: var(--ok); max-width: 100%; }
.b-have span { overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.empty { padding: 28px 16px; text-align: center; color: var(--text2); display: grid; gap: 10px; justify-items: center; }
.list-tail { padding: 4px 12px 14px; display: grid; justify-items: center; gap: 8px; font-size: 13px; color: var(--text2); text-align: center; }
.list-tail:empty { display: none; }
.list-tail .loading { display: inline-flex; gap: 8px; align-items: center; }
.list.is-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.list.is-grid .group, .list.is-grid .empty { grid-column: 1 / -1; }
.list.is-grid .item { flex-direction: column; align-items: stretch; gap: 8px; padding: 8px; height: 100%; }
.list.is-grid .item.selected::before { left: 50%; top: auto; bottom: 2px; width: 16px; height: 3px; margin: 0 0 0 -8px; }
.list.is-grid .thumb { width: 100%; height: auto; aspect-ratio: 1150 / 817; }
.list.is-grid .idate, .list.is-grid .b-paper, .list.is-grid .b-have { display: none; }
.list.is-grid .ititle { font-size: 12px; line-height: 16px; }

/* card pane */
.cp { position: relative; min-height: 0; min-width: 0; overflow: auto; scrollbar-width: thin; background: var(--cardpane); border-top: 1px solid var(--stroke); border-left: 1px solid var(--stroke); container-type: inline-size; container-name: card; }
.card { max-width: 1100px; margin: 0 auto; padding: 0 24px 40px; }
.card.is-loading { opacity: .55; pointer-events: none; }
.card-msg { max-width: 640px; margin: 48px auto; padding: 0 24px; display: grid; gap: 12px; justify-items: start; }
.chead { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0 10px; background: var(--chead); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.numbox { display: grid; border: 1px solid var(--stroke-strong); border-radius: 6px; padding: 3px 12px 4px; background: var(--card); line-height: 1.2; }
.numbox small { font-size: 12px; color: var(--text2); }
.numbox b { font: 600 20px/26px var(--fd); letter-spacing: .01em; }
.chead-mid { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 0; }
.chead-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.chead-edit { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chead .sep { width: 1px; height: 24px; background: var(--stroke-strong); margin: 0 4px; }
.pos { font-size: 13px; color: var(--text2); white-space: nowrap; padding: 0 2px; }
.ro-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text2); padding: 5px 10px; border-radius: 16px; background: var(--subtle); }
.tolist { display: none; }

/* banners */
.banners:empty { display: none; }
.banners { display: grid; gap: 10px; margin-bottom: 12px; }
.bn { display: flex; gap: 10px; align-items: flex-start; border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.45; border: 1px solid var(--info-line); background: var(--info-bg); color: var(--text); }
.bn > .ic { color: var(--info); margin-top: 2px; }
.bn.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.bn.warn > .ic { color: var(--warn); }
.bn.neutral { background: var(--muted-bg); border-color: var(--muted-line); }
.bn.neutral > .ic { color: var(--text2); }
.bn.err { background: var(--del-bg); border-color: var(--del-line); }
.bn.err > .ic { color: var(--del); }
.bn .link.arrowlink { text-decoration-color: currentColor; font-size: 13px; align-self: center; }
.bn-body { display: grid; gap: 8px; min-width: 0; flex: 1; }
.bn-meta { color: var(--text2); }
.bn-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bn-actions .btn { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.bn-panel { background: var(--card); border: 1px solid var(--stroke); border-radius: 8px; padding: 4px 12px; }
.bn-panel .pr { border: 0; padding: 8px 0; box-shadow: none; background: transparent; grid-template-columns: minmax(0,1fr); border-radius: 0; }
.bn-panel .pr + .pr { border-top: 1px solid var(--stroke); }

.editinfo:empty { display: none; }
.editinfo { margin-top: 16px; scroll-margin-top: 80px; }
.editinfo + .fields { margin-top: 10px; }

/* media */
.media { display: grid; gap: 8px; }
.stage { position: relative; width: 100%; aspect-ratio: 1150 / 817; max-height: min(52vh, 520px); background: var(--stage); border-radius: 8px; border: 1px solid var(--stroke); overflow: hidden; }
.stageimg { all: unset; position: absolute; inset: 14px; display: flex; align-items: center; justify-content: center; cursor: zoom-in; }
.stageimg img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; box-shadow: var(--envshadow); background: #fff; }
.stage .noimg { position: absolute; inset: 14px; background-color: color-mix(in srgb, var(--card) 55%, transparent); }
.stage.is-new { box-shadow: 0 0 0 2px var(--ins), 0 0 0 4px var(--ins-bg); }
.cap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--text2); min-height: 32px; }
.cap b { color: var(--text); font-weight: 600; }
.cap-acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px; }
.cap-acts .btn { min-height: 28px; padding: 3px 8px; }
.zoombtn { color: var(--accent); }
.ws.nav-collapsed .card, .ws.list-collapsed .card { max-width: 1200px; }
.ws.nav-collapsed .stage, .ws.list-collapsed .stage { max-height: min(60vh, 640px); }
.ws.nav-collapsed.list-collapsed .card { max-width: 1320px; }
.ws.nav-collapsed.list-collapsed .stage { max-height: min(68vh, 760px); }
.card.editing .stage, .ws.nav-collapsed.list-collapsed .card.editing .stage { max-height: 300px; }

/* strip */
.strip { margin-top: 14px; }
.sechead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-bottom: 8px; }
.sechead h3 { font: 600 14px/20px var(--f); white-space: nowrap; }
.sechead span { font-size: 12px; color: var(--text2); }
.tiles { display: flex; gap: 10px; overflow-x: auto; padding: 3px 3px 8px; scrollbar-width: thin; }
.tiles > li { position: relative; flex: none; }
.tile { all: unset; box-sizing: border-box; width: 104px; display: grid; gap: 5px; cursor: pointer; border-radius: 6px; padding: 4px; }
.tile:hover { background: var(--subtle); }
.tthumb { width: 96px; height: 68px; border-radius: 4px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--stroke-strong); display: grid; place-items: center; color: var(--text3); }
.tthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tthumb.is-empty { background: repeating-linear-gradient(135deg, var(--stripe-a) 0 6px, var(--stripe-b) 6px 7px); font-size: 12px; text-align: center; line-height: 1.2; gap: 2px; align-content: center; color: var(--text2); }
.tile[aria-pressed="true"] .tthumb { box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px var(--sel-ring); }
.tkind { display: grid; font-size: 12px; line-height: 15px; color: var(--text2); min-width: 0; }
.tkind > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tkind b { color: var(--text); font-weight: 600; }
.tile.is-new .tthumb { box-shadow: 0 0 0 2px var(--ins), 0 0 0 4px var(--ins-bg); }
.tile.is-removed .tthumb { opacity: .35; }
.tile.is-removed .tkind { text-decoration: line-through; }
.tile.is-changed .tkind b::after { content: " •"; color: var(--warn); }
.tadd { display: flex; width: 104px; min-height: 26px; padding: 1px 6px; font-size: 12px; margin-top: 2px; }
.tdel { position: absolute; top: -4px; right: -2px; width: 24px; height: 24px; border-radius: 50%; padding: 0; min-height: 0; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.addtile .tthumb { background: transparent; box-shadow: none; border: 1.5px dashed var(--stroke-strong); color: var(--accent); gap: 4px; align-content: center; font-size: 12px; text-align: center; line-height: 1.25; }
.addtile:hover .tthumb { border-color: var(--accent); background: var(--sel); }

/* item form (edit mode) */
.iform { margin-top: 10px; padding: 12px 14px; display: grid; gap: 10px; }
.iform-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.iform-head h3 { font: 600 14px/20px var(--f); }
.iform-head .btn { margin-left: auto; }
.iform-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.iform-grid .wide { grid-column: 1 / -1; }
.iform .fld.is-changed .input, .iform .fld.is-changed .textarea, .iform .fld.is-changed .select { background: var(--warn-bg); border-color: var(--warn-line); }
.iform-removed { font-size: 13px; color: var(--del); }

/* fields */
.fields { margin-top: 16px; padding: 2px 16px; }
.frow { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr); gap: 4px 16px; padding: 9px 0; border-bottom: 1px solid var(--stroke); align-items: baseline; }
.frow:last-child { border-bottom: 0; }
.frow dt { font-size: 13px; color: var(--text2); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.frow dd { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.frow.is-title dd { font-weight: 600; font-size: 15px; line-height: 1.4; }
.editing .frow { align-items: center; padding: 6px 0; }
.editing .frow dd { white-space: normal; }
.editing .frow.is-title { align-items: start; }
.editing .frow.is-title dt { padding-top: 6px; }
.frow.is-changed .input, .frow.is-changed .textarea, .note.is-changed .textarea, .ptable td.is-changed .input { background: var(--warn-bg); border-color: var(--warn-line); }
.chg { display: none; font-size: 12px; line-height: 16px; padding: 0 6px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); white-space: nowrap; }
.is-changed > dt .chg, .note.is-changed .chg, .fld.is-changed .chg { display: inline-block; }
.fmark { font-size: 12px; line-height: 16px; padding: 0 6px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); white-space: nowrap; }
.fprop { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-top: 5px; font-size: 13px; line-height: 1.4; color: var(--text); padding: 4px 8px; border-radius: 4px; background: var(--warn-bg); box-shadow: inset 3px 0 0 var(--warn); white-space: normal; font-weight: 400; }
.fprop > span { min-width: 0; overflow-wrap: anywhere; }
.fprop .link { font-size: 13px; }
.fprops { display: grid; gap: 6px; margin-top: 8px; }
.fprops .fprop { margin-top: 0; }
.fields .input.short { max-width: 180px; }
.fields .textarea { min-height: 56px; }

/* paper table */
.papers { margin-top: 22px; }
.tblwrap { border: 1px solid var(--stroke); border-radius: 8px; background: var(--card); overflow-x: auto; }
.ptable th:first-child { border-top-left-radius: 8px; }
.ptable th:last-child { border-top-right-radius: 8px; }
.ptable tbody tr:last-child td { border-bottom: 0; }
.ptable td:first-child { font-weight: 600; white-space: nowrap; }
.ptable tr.has-prop td { background: var(--warn-bg); }
.ptable tr.has-prop td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.ptable .input { min-width: 70px; min-height: 28px; padding-top: 3px; padding-bottom: 3px; }
.ptable td.delcell { width: 40px; text-align: center; }
.editing .tblwrap { border: 0; background: transparent; overflow: visible; }
.editing .ptable, .editing .ptable tbody { display: block; }
.editing .ptable thead { display: none; }
.editing .ptable tr { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.35fr) minmax(0, 2fr) minmax(0, .6fr) 36px; gap: 8px; align-items: end; background: var(--card); border: 1px solid var(--stroke); border-radius: 8px; padding: 8px 10px 10px; margin-bottom: 8px; }
.editing .ptable td { display: grid; gap: 2px; padding: 0; border: 0; min-width: 0; font-weight: 400; background: transparent; }
.editing .ptable td::before { content: attr(data-l); font-size: 12px; font-weight: 400; color: var(--text2); }
.editing .ptable td.c-other { grid-column: 1 / 5; grid-row: 2; }
.editing .ptable td.delcell { grid-column: 5; grid-row: 1; width: auto; }
.editing .ptable td.delcell::before, .editing .ptable td.c-empty::before { content: none; }
.editing .ptable td.c-empty { grid-column: 1 / -1; }
.editing .ptable .input { min-width: 0; }
.editing .ptable tr.has-prop { background: var(--warn-bg); border-color: var(--warn-line); box-shadow: inset 3px 0 0 var(--warn); }
.editing .ptable tr.has-prop td { background: transparent; box-shadow: none; }
.deltext { display: none; }
.ptools { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.ptools .hint { font-size: 12px; color: var(--text2); }
.flapnote { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--text2); margin-top: 8px; }
.flapnote .ic { margin-top: 1px; }

/* notes */
.notes { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.note { padding: 12px 14px 14px; display: grid; gap: 6px; align-content: start; }
.note .sechead { margin: 0; }
.notetext { white-space: pre-wrap; overflow-wrap: anywhere; }
.editfoot { display: flex; gap: 8px; justify-content: flex-end; align-items: flex-end; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--stroke); }
.editfoot:empty { display: none; }
.editfoot .fld { flex: 1 1 320px; }
.editfoot .textarea { min-height: 40px; }

/* more from the table */
.more-wrap:empty { display: none; }
.more-wrap { margin-top: 14px; }
.more summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 8px; border-radius: var(--r); }
.more summary::-webkit-details-marker { display: none; }
.more summary .ic { color: var(--text2); }
.more[open] summary .ic { transform: rotate(180deg); }
.more summary span { font-weight: 400; font-size: 12px; color: var(--text2); }
.more summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.more dl { padding: 0 16px 6px; }
.more .raw { white-space: pre-wrap; font-size: 13px; overflow-wrap: anywhere; }
.topics { display: flex; flex-wrap: wrap; gap: 4px; white-space: normal; }

/* history */
.hist { margin-top: 26px; }
.hist-list { display: grid; position: relative; padding: 4px 14px; }
.hrow { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--stroke); align-items: start; }
.hrow:first-child { border-top: 0; }
.hdot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--subtle2); color: var(--text2); margin-top: 1px; }
.hrow.k-edit .hdot, .hrow.k-accepted .hdot { background: var(--sel); color: var(--accent); }
.hrow.k-pending .hdot { background: var(--warn-bg); color: var(--warn); }
.hrow.k-rejected .hdot { background: var(--del-bg); color: var(--del); }
.htitle { font-weight: 600; font-size: 13px; }
.hrow.k-import .htitle { font-weight: 400; }
.hwhen { font-size: 13px; color: var(--text2); white-space: nowrap; padding-top: 1px; }
.hlines { grid-column: 2 / 4; display: grid; gap: 3px; font-size: 13px; min-width: 0; }
.hlines > div { overflow-wrap: anywhere; }
.hrow.k-rejected .hlines { opacity: .85; }
.hl-f { color: var(--text2); }
.hcomment { color: var(--text2); }
.hcomment q { color: var(--text); }
.hist-more { margin-top: 8px; }

/* diff (proposals, history lines) */
.df { display: grid; }
.df-row { display: grid; grid-template-columns: minmax(130px, 210px) minmax(0, 1fr); gap: 2px 14px; padding: 8px 0; border-top: 1px solid var(--stroke); align-items: baseline; }
.df-row:first-child { border-top: 0; }
.df-label { font-size: 13px; color: var(--text2); overflow-wrap: anywhere; }
.df-label b { color: var(--text); font-weight: 600; }
.df-vals { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; overflow-wrap: anywhere; }
del.o, ins.n { padding: 1px 6px; border-radius: 4px; overflow-wrap: anywhere; white-space: pre-wrap; }
del.o { background: var(--del-bg); color: var(--del); text-decoration: line-through; text-decoration-thickness: 1px; }
ins.n { background: var(--ins-bg); color: var(--ins); text-decoration: none; font-weight: 600; }
del.o i, ins.n i { font-weight: 400; opacity: .8; }
.arr { color: var(--text3); }
.df-now { font-size: 13px; color: var(--text); width: 100%; }
.df-now b { font-weight: 600; }
.df-img { width: 64px; height: 45px; border-radius: 3px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--stroke-strong); flex: none; display: grid; place-items: center; color: var(--text3); }
.df-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
button.df-img { padding: 0; border: 0; cursor: zoom-in; }
.df-file { font-size: 12px; color: var(--text2); }
.df-row.is-stale .df-label { color: var(--warn); }

/* status bar */
.sbar { flex: none; display: flex; align-items: center; gap: 6px 16px; padding: 4px 14px; font-size: 13px; color: var(--text2); border-top: 1px solid var(--stroke); min-height: 28px; flex-wrap: wrap; background: var(--cardpane); }
.sbar .sp { flex: 1; }
.sbar kbd { font: inherit; border: 1px solid var(--stroke-strong); border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; background: var(--card); }

/* ---------- 5. pages ---------- */
.pg { position: relative; flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; background: var(--cardpane); border-top: 1px solid var(--stroke); }
.pg-in { max-width: 1040px; margin: 0 auto; padding: 18px 28px 56px; }
.pg-back { margin-left: -8px; color: var(--accent); }
.pg-head { display: grid; gap: 6px; margin: 8px 0 18px; }
.pg-head h1 { font: 650 28px/1.2 var(--fd); letter-spacing: -.01em; }
.pg-head h1:focus { outline: none; }
.pg-head p { color: var(--text2); font-size: 15px; max-width: 72ch; }
.pg h2 { font: 600 18px/1.3 var(--fd); }
.pg-loading { display: flex; gap: 10px; align-items: center; color: var(--text2); padding: 24px 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--stroke-strong); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tab { background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--text2); border-bottom: 3px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; border-radius: 4px 4px 0 0; white-space: nowrap; }
.tab:hover { color: var(--text); background: var(--subtle); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* proposals */
.pr-list { display: grid; gap: 14px; }
.pr { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 16px; padding: 16px; border: 1px solid var(--stroke); border-radius: 10px; background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.pr.is-flash { box-shadow: 0 0 0 3px var(--sel-ring); }
.pr.is-done { opacity: .6; }
.pr-thumb { all: unset; cursor: pointer; width: 128px; aspect-ratio: 1150 / 817; border-radius: 4px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--stroke-strong), 0 1px 3px rgba(0,0,0,.1); display: grid; place-items: center; color: var(--text3); align-self: start; }
.pr-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pr-thumb.is-empty { background: repeating-linear-gradient(135deg, var(--stripe-a) 0 6px, var(--stripe-b) 6px 7px); }
.pr-thumb:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pr-main { display: grid; gap: 8px; min-width: 0; }
.pr-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.pr-num { font: 600 17px/1.3 var(--fd); }
.pr-title { color: var(--text); min-width: 0; }
.pr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; color: var(--text2); }
.pr-meta b { color: var(--text); font-weight: 600; }
.pr-comment { font-size: 13px; padding: 6px 10px; border-radius: 6px; background: var(--muted-bg); border: 1px solid var(--muted-line); overflow-wrap: anywhere; white-space: pre-wrap; }
.pr-comment b { font-weight: 600; }
.pr-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.pr-note { font-size: 13px; color: var(--text2); }
.pr-warn { font-size: 13px; color: var(--text); display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 6px; background: var(--warn-bg); border: 1px solid var(--warn-line); }
.pr-warn .ic { color: var(--warn); margin-top: 2px; }
.pr-status { margin-left: auto; }
.pg-empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 48px 16px; color: var(--text2); border: 1px dashed var(--stroke-strong); border-radius: 12px; }
.pg-empty .ic { color: var(--ok); }
.pg-empty b { color: var(--text); font-size: 16px; }

/* upload */
.up-rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.up-rule { padding: 12px 14px; display: grid; gap: 4px; align-content: start; }
.up-rule code { font: 600 14px/1.3 var(--fm); color: var(--text); overflow-wrap: anywhere; }
.up-rule span { font-size: 13px; color: var(--text2); }
.up-info { margin-bottom: 14px; }
.up-drop { border: 2px dashed var(--stroke-strong); border-radius: 12px; padding: 30px 20px; text-align: center; background: var(--card); display: grid; justify-items: center; gap: 10px; }
.up-drop.over { border-color: var(--accent); background: var(--sel); }
.up-drop > .ic { color: var(--accent); }
.up-drop b { font-size: 16px; }
.up-drop p { color: var(--text2); font-size: 13px; }
.up-drop-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.up-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 22px 0 10px; }
.up-sum h2 { margin-right: 4px; }
.up-tbl { border: 1px solid var(--stroke); border-radius: 10px; overflow: hidden; background: var(--card); }
.up-tbl .table td { vertical-align: middle; }
.up-tbl tr.is-miss td { background: color-mix(in srgb, var(--del-bg) 45%, transparent); }
.up-tbl tr.is-skip td { opacity: .7; }
.up-file { display: flex; align-items: center; gap: 10px; min-width: 0; }
.up-th { width: 56px; height: 40px; border-radius: 3px; overflow: hidden; flex: none; background: #fff; box-shadow: 0 0 0 1px var(--stroke-strong); display: grid; place-items: center; color: var(--text3); }
.up-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-th.is-empty { background: repeating-linear-gradient(135deg, var(--stripe-a) 0 6px, var(--stripe-b) 6px 7px); }
.up-name { display: grid; min-width: 0; }
.up-name b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-tbl td:first-child { width: 36%; }
.up-tbl td.up-env { width: 30%; }
.up-name small, .up-env small, .up-st small { font-size: 12px; color: var(--text2); display: block; overflow-wrap: anywhere; }
.up-env b { font-weight: 600; }
.up-st { display: grid; gap: 3px; justify-items: start; min-width: 140px; }
.up-st .pbar { width: 120px; height: 6px; }
.up-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.up-prog { margin-top: 18px; padding: 14px 16px; display: grid; gap: 8px; }
.up-prog-top { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.up-prog-top b { font-weight: 600; }
.up-prog-top .btn { margin-left: auto; }
.up-prog .pbar { height: 10px; border-radius: 5px; }
.up-done { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; padding: 14px 16px; border-radius: 10px; background: var(--ok-bg); color: var(--text); border: 1px solid var(--ok-line); }
.up-done > .ic { color: var(--ok); margin-top: 2px; }
.up-done.sent { background: var(--warn-bg); border-color: var(--warn-line); }
.up-done.sent > .ic { color: var(--warn); }
.up-done.bad { background: var(--del-bg); border-color: var(--del-line); }
.up-done.stopped { background: var(--muted-bg); border-color: var(--muted-line); }
.up-done.stopped > .ic { color: var(--text2); }
.up-done.bad > .ic { color: var(--del); }
.up-done ul { display: grid; gap: 2px; margin-top: 6px; font-size: 13px; }
.up-done-links { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; }
.up-more { margin-top: 10px; display: flex; justify-content: center; }

/* users */
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.role-card { padding: 12px 14px; display: grid; gap: 4px; align-content: start; }
.role-card b { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.role-card span { font-size: 13px; color: var(--text2); }
.us-sec { margin-top: 26px; display: grid; gap: 10px; }
.us-sec > h2 { display: flex; align-items: center; gap: 10px; }
.us-tbl { border: 1px solid var(--stroke); border-radius: 10px; overflow: hidden; background: var(--card); }
.us-tbl .table td { vertical-align: middle; padding: 10px; }
.us-tbl tr.is-off td { background: var(--muted-bg); }
.us-name { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.us-name small { white-space: nowrap; }
.us-state { min-width: 150px; }
.us-name b { font-weight: 600; }
.us-name small { display: block; font-size: 12px; color: var(--text2); }
.us-tbl .select { width: auto; min-width: 150px; }
.us-can { color: var(--text2); font-size: 13px; }
.us-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.us-acts .btn { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.pub { padding: 14px 16px; display: grid; gap: 6px; }
.pub p { font-size: 13px; color: var(--text2); max-width: 75ch; }
.invite { padding: 16px; display: grid; gap: 10px; }
.invite-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.invite-row label { display: grid; gap: 3px; font-size: 12px; color: var(--text2); }
.invite-row .f-name { flex: 1 1 260px; min-width: 0; }
.invite-row .f-role .select { min-width: 150px; }
.linkbox { display: grid; gap: 8px; padding: 14px 16px; border-radius: 10px; background: var(--ok-bg); border: 1px solid var(--ok-line); }
.linkbox b { font-weight: 600; }
.linkbox p { font-size: 13px; }
.linkbox-row { display: flex; gap: 8px; flex-wrap: wrap; }
.linkbox-row .input { flex: 1 1 320px; font-family: var(--fm); font-size: 13px; background: var(--card); }
.inv-list { display: grid; gap: 8px; }
.inv { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; border: 1px solid var(--stroke); border-radius: 8px; background: var(--card); }
.inv b { font-weight: 600; overflow-wrap: anywhere; }
.inv .sp { flex: 1; }
.inv small { font-size: 12px; color: var(--text2); }
.inv.is-old { background: transparent; }
.inv-old summary { cursor: pointer; font-size: 13px; color: var(--text2); padding: 4px 0; }
.inv-old[open] summary { margin-bottom: 8px; }

/* help */
.help { display: grid; gap: 14px; max-width: 760px; }
.hw { padding: 14px 16px; display: grid; gap: 8px; }
.hw h2 { display: flex; align-items: center; gap: 10px; font: 600 16px/1.3 var(--f); }
.hw h2 .num { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--sel); color: var(--accent); font-size: 13px; flex: none; }
.hw p, .hw li { font-size: 14px; line-height: 1.5; color: var(--text); }
.hw ul { display: grid; gap: 5px; padding-left: 0; }
.hw li { padding-left: 16px; position: relative; }
.hw li::before { content: ""; position: absolute; left: 3px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--text3); }
.hw code { white-space: nowrap; font: 600 13px/1.3 var(--fm); background: var(--subtle2); padding: 0 4px; border-radius: 3px; }

/* ---------- 6. popovers, dialog, viewer, toast ---------- */
.pop { position: fixed; z-index: 950; min-width: 250px; max-width: calc(100vw - 16px); background: var(--card); color: var(--text); border: 1px solid var(--stroke-strong); border-radius: 10px; box-shadow: var(--pop-shadow); padding: 6px; max-height: calc(100vh - 80px); overflow: auto; }
.pop-head { padding: 8px 10px 6px; font-size: 12px; color: var(--text2); }
.pop-item { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 10px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; text-align: left; color: var(--text); text-decoration: none; font-size: 14px; }
.pop-item:hover { background: var(--subtle2); }
.pop-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.pop-item[aria-checked="true"] { background: var(--sel); }
.pop-item small { display: block; font-size: 12px; color: var(--text2); }
.pop-item .chk { margin-left: auto; color: var(--accent); visibility: hidden; }
.pop-item[aria-checked="true"] .chk { visibility: visible; }
.pop-sep { height: 1px; background: var(--stroke); margin: 4px 0; }
.pop-confirm { width: 340px; padding: 14px; }
.pc-t { font-size: 14px; line-height: 1.45; }
.pc-t b { font-weight: 600; }
#pc-extra:empty { display: none; }
#pc-extra { margin-top: 10px; display: grid; gap: 4px; }
.pop-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.pop-user { display: flex; gap: 10px; align-items: center; padding: 8px 10px 10px; }
.pop-user b { display: block; }
.pop-user small { color: var(--text2); font-size: 12px; }
.pop-theme { display: flex; gap: 4px; padding: 2px 6px 6px; }
.pop-theme button { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border: 1px solid var(--stroke); border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; font-size: 12px; }
.pop-theme button:hover { background: var(--subtle2); }
.pop-theme button[aria-checked="true"] { background: var(--sel); border-color: var(--sel-ring); color: var(--text); }
.pop-theme button[aria-checked="true"] .ic { color: var(--accent); }

.dlg { border: 1px solid var(--stroke-strong); border-radius: 12px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--card); color: var(--text); box-shadow: var(--pop-shadow); }
.dlg::backdrop { background: var(--overlay); }
.dlg-in { display: flex; flex-direction: column; max-height: calc(100vh - 34px); margin: 0; }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 10px 20px; border-bottom: 1px solid var(--stroke); }
.dlg-head h2 { font: 650 18px/1.3 var(--fd); flex: 1; }
.dlg-body { padding: 16px 20px; display: grid; gap: 12px; overflow: auto; }
.dlg-body p { font-size: 14px; line-height: 1.5; }
.dlg-in > .form-err { margin: 0 20px 4px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; flex-wrap: wrap; border-top: 1px solid var(--stroke); }
.dlg-foot:empty { display: none; }
.dlg-prev { display: flex; gap: 12px; align-items: center; }
.dlg-prev .up-th { width: 96px; height: 68px; }
.dlg-prev small { display: block; font-size: 12px; color: var(--text2); }
.dlg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.dlg .pbar { margin-top: 2px; }

.vw { position: fixed; inset: 0; z-index: 1000; background: rgba(12,14,17,.95); color: #fff; display: grid; grid-template-rows: auto 1fr auto; font: 400 14px/1.4 var(--f); }
.vw-top, .vw-bot { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; }
.vw-bot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); justify-content: center; flex-wrap: wrap; }
.vw-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-title b { font-weight: 600; }
.vw-of { opacity: .65; }
.vw button, .vw .vw-file { color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 6px; min-width: 36px; height: 36px; padding: 0 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; font: inherit; }
.vw button:hover, .vw .vw-file:hover { background: rgba(255,255,255,.18); }
.vw button:disabled { opacity: .35; cursor: default; }
.vw button:focus-visible, .vw .vw-file:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.vw-stage { position: relative; overflow: hidden; cursor: grab; touch-action: none; }
.vw-stage.drag { cursor: grabbing; }
.vw-stage img { position: absolute; left: 50%; top: 50%; max-width: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #fff; }
.vw-stage .noimg { position: absolute; inset: 12% 15%; color: #ddd; border-color: rgba(255,255,255,.35); }
.vw-stage .noimg b { color: #fff; }
.vw-zoom { min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
.vw-src { font-size: 12px; color: rgba(255,255,255,.7); min-width: 0; }

.toast { position: fixed; right: 20px; bottom: calc(40px + env(safe-area-inset-bottom, 0px)); z-index: 1100; background: var(--toast-bg); color: var(--toast-fg);
  border: 1px solid var(--toast-line); padding: 10px 8px 10px 16px; border-radius: 8px; font: 500 14px/1.4 var(--f); box-shadow: var(--pop-shadow);
  width: max-content; max-width: min(460px, calc(100vw - 32px)); display: flex; align-items: flex-start; gap: 8px; }
.toast.is-err { background: var(--del-bg); color: var(--text); border-color: var(--del-line); }
.toast-msg { flex: 1; min-width: 0; padding-top: 1px; }
.toast-x { flex: none; width: 26px; height: 26px; border: 0; border-radius: 4px; background: transparent; color: inherit; opacity: .8; cursor: pointer; display: grid; place-items: center; padding: 0; }
.toast-x:hover { opacity: 1; background: rgba(127,127,127,.22); }
.toast-x:focus-visible { outline: 2px solid currentColor; }

@keyframes hmk-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) {
  .nav { transition: width .16s ease; }
  .toast { transition: opacity .2s; }
  .btn.flash { transition: box-shadow .2s; }
  .spin, .btn.is-busy::after { animation: hmk-spin .8s linear infinite; }
  .pbar > span { transition: width .2s ease; }
  .card.is-loading { transition: opacity .15s .1s; }
}
@media (prefers-reduced-motion: reduce) {
  .spin { border-top-color: var(--accent); border-right-color: var(--accent); }
  *, *::before, *::after { scroll-behavior: auto !important; }
}

/* ---------- 7. responsive ---------- */
/* narrow card: stack labels, table rows become small cards */
@container card (max-width: 620px) {
  .card { padding: 0 16px 28px; }
  .chead .sep { display: none; }
  .frow { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .editing .frow.is-title dt { padding-top: 0; }
  .notes { grid-template-columns: minmax(0, 1fr); }
  .iform-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tblwrap { border: 0; background: transparent; overflow: visible; }
  .ptable, .ptable tbody { display: block; }
  .ptable thead { display: none; }
  .ptable tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; background: var(--card); border: 1px solid var(--stroke); border-radius: 8px; padding: 6px 12px; margin-bottom: 8px; position: relative; }
  .ptable tr.has-prop { box-shadow: inset 3px 0 0 var(--warn); background: var(--warn-bg); }
  .ptable tr.has-prop td { background: transparent; box-shadow: none !important; }
  .ptable td, .editing .ptable td { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: baseline; gap: 8px; border: 0; padding: 4px 0; }
  .ptable td::before { content: attr(data-l); font-size: 12px; font-weight: 400; color: var(--text2); }
  .ptable td.c-empty { grid-template-columns: minmax(0, 1fr); }
  .ptable td.c-empty::before { content: none; }
  .ptable td:first-child { white-space: normal; }
  .ptable td.delcell { display: block; width: auto; text-align: right; padding-top: 6px; }
  .ptable td.delcell::before { content: none; }
  .deltext { display: inline; font-size: 13px; }
  .ptable td.delcell .btn { color: var(--text2); }
  .editing .ptable tr { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 6px 12px; }
  .editing .ptable td { grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 8px; padding: 4px 0; }
  .editing .ptable td.c-other, .editing .ptable td.delcell { grid-column: auto; grid-row: auto; }
  .editing .ptable td.delcell { display: block; text-align: right; padding-top: 6px; }
  .tiles { flex-wrap: wrap; overflow: visible; gap: 8px; }
  .tile { width: 92px; padding: 2px; }
  .tthumb { width: 86px; height: 61px; }
  .tadd { width: 92px; }
  .stageimg, .stage .noimg { inset: 8px; }
  .df-row { grid-template-columns: minmax(0, 1fr); }
  .hrow { grid-template-columns: 22px minmax(0, 1fr); }
  .hwhen { grid-column: 2; padding-top: 0; }
  .hlines { grid-column: 2; }
}

/* header gets tighter */
@media (max-width: 1279px) {
  .hd-uname { display: none; }
  .hd-user { padding-right: 4px; }
}
@media (max-width: 1100px) {
  .hd-long { display: none; }
}

/* tablet: compact years rail, the years open over the list */
@media (max-width: 1179px) {
  :root { --list-w: 300px; }
  .nav, .ws.nav-collapsed .nav { width: var(--rail-w); }
  .ws:not(.nav-collapsed) .nav-panel { right: auto; width: 272px; z-index: 30; background: var(--bg); border-right: 1px solid var(--stroke-strong); border-radius: 0 8px 8px 0; box-shadow: 0 16px 40px rgba(0,0,0,.20); }
  .pr { grid-template-columns: 104px minmax(0, 1fr); }
  .pr-thumb { width: 104px; }
  .up-rules, .roles { grid-template-columns: minmax(0, 1fr); }
}

/* phone and portrait tablet: years as a select, list and card stacked, panes as accordions */
@media (max-width: 900px) {
  .lg { padding-top: 22px; place-items: start center; }
  .lg-wrap { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .lg-art { order: -1; width: min(330px, 86%); justify-self: center; aspect-ratio: 1.5; }
  .lg-env { width: 62%; }
  .lg-cap { display: none; }
  .lg h1 { margin-top: 8px; }
  .lg-form { max-width: none; }

  .app { min-height: 0; }
  .hd { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand actions" "search search"; padding: 8px 12px 10px; gap: 8px; }
  .hd-brand { grid-area: brand; justify-self: start; min-width: 0; padding-left: 2px; }
  .hd-brand span { overflow: hidden; text-overflow: ellipsis; }
  .hd-search { grid-area: search; max-width: none; }
  .hd-actions { grid-area: actions; gap: 4px; }
  .hd-lbl { display: none; }
  .hd-actions .btn { display: inline-grid; grid-auto-flow: column; justify-items: center; align-items: center; column-gap: 4px; row-gap: 1px; padding: 3px 8px; min-height: 44px; font-size: 12px; line-height: 14px; }
  .hd-actions .btn .hd-short { display: block; grid-row: 2; grid-column: 1 / -1; }
  .hd-user > .ic { display: none; }
  .hd-user { padding: 3px; }

  .ws { display: block; }
  .nav, .lrail { display: none !important; }
  .mbar { display: flex; align-items: center; gap: 10px; padding: 2px 12px 10px; }
  .mbar label { font-size: 13px; color: var(--text2); }
  .mbar .select { flex: 1; min-height: 38px; }
  .ws.list-collapsed .lp { display: flex; }
  .lp { width: auto; border-left: 0; border-top-left-radius: 0; }
  .lp-acc { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; background: transparent; border: 0; border-bottom: 1px solid var(--stroke); cursor: pointer; text-align: left; color: var(--text); }
  .lp-acc:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
  .lp-acc-t { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .lp-acc-t b { font: 600 18px/24px var(--fd); }
  .lp-acc-t span { font-size: 12px; color: var(--text2); }
  .ws.list-collapsed .lp-acc .ic { transform: rotate(-90deg); }
  .ws.list-collapsed .lp-body { display: none; }
  .lp-titlerow { display: none; }
  .lp-head { padding: 10px 12px; }
  .lp-scroll { flex: none; overflow: auto; max-height: 62vh; max-height: 62dvh; }
  .group { top: 0; }
  .cp { overflow: visible; border-left: 0; border-top: 1px solid var(--stroke-strong); scroll-margin-top: 8px; }
  .chead { position: static; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; gap: 10px 8px; }
  .chead::after { content: ""; order: 3; flex-basis: 100%; height: 0; }
  .numbox { order: 1; }
  .chead-mid { order: 2; }
  .tolist { display: inline-flex; order: 2; margin-left: auto; }
  .chead-nav { order: 4; margin-left: 0; }
  .chead .sep { display: none; }
  .chead-edit { order: 5; margin-left: auto; }
  .editing .chead-nav { display: none; }
  .editing .chead-edit { margin-left: 0; width: 100%; justify-content: flex-end; }
  .sbar .keys { display: none; }
  .pg { overflow: visible; }
  .pg-in { padding: 12px 16px 40px; }
  .pg-head h1 { font-size: 24px; }
  .tab { padding: 10px 8px; gap: 6px; }
  .pr { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 10px; }
  .pr-thumb { width: 140px; }
  .df-row { grid-template-columns: minmax(0, 1fr); }
  .up-drop { padding: 22px 14px; }
  .up-tbl, .us-tbl { border: 0; background: transparent; overflow: visible; }
  .up-tbl .table, .up-tbl tbody, .us-tbl .table, .us-tbl tbody { display: block; }
  .up-tbl thead, .us-tbl thead { display: none; }
  .up-tbl tr, .us-tbl tr { display: grid; gap: 8px; padding: 12px; margin-bottom: 8px; border: 1px solid var(--stroke); border-radius: 10px; background: var(--card); }
  .up-tbl tr.is-miss { background: color-mix(in srgb, var(--del-bg) 45%, var(--card)); }
  .us-tbl tr.is-off { background: var(--muted-bg); }
  .up-tbl tr.is-miss td.up-env { display: none; }
  .up-tbl td, .us-tbl td { display: block; border: 0; padding: 0 !important; background: transparent !important; }
  .up-name b { white-space: normal; overflow-wrap: anywhere; max-width: none; }
  .up-tbl td:first-child { width: auto; }
  .us-tbl .select { width: 100%; }
  .us-acts { justify-content: flex-start; }
  .dlg-grid { grid-template-columns: minmax(0, 1fr); }
  .toast { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: auto; max-width: none; }
  .vw-bot { gap: 6px; padding-left: 8px; padding-right: 8px; flex-wrap: nowrap; }
  .vw-bot [data-a="one"], .vw-bot .vw-fitlbl, .vw-src { display: none; }
  .vw .vw-file span { display: none; }
}
@media (max-width: 400px) {
  .hd-brand span { font-size: 15px; }
  .seg-theme button { padding: 0 8px; }
}
