@font-face { font-family: "Inter"; src: url("/_nano/ui/fonts/inter-variable.woff2?v=2d1994b9e9") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("/_nano/ui/fonts/inter-display-semibold.woff2?v=2d1994b9e9") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("/_nano/ui/fonts/inter-display-bold.woff2?v=2d1994b9e9") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bone: #f4f1e8; --paper: #fbf9f3; --sand: #e4dac5; --sand-soft: #ece6d8; --stone: #c9beac; --taupe: #a4967f; --clay: #8b6f5c;
  --espresso: #2b211c; --warm: #5c5049; --ink-3: #6e6058;
  --fjord: #33465a; --spruce: #1f3a2e; --spruce-2: #305a47; --falu: #632722;
  --fjord-90: #e9e7df; --spruce-90: #e9e7de;
  --ok: #497d12; --ok-t: #c9ddbc; --ok-ink: #2f5309; --risk: #a37c11; --risk-ink: #6b5209; --risk-t: #e5d4b1; --bad: #ab423a; --bad-ink: #7d2b24; --bad-t: #f5cac4;
  --ink: var(--espresso); --ink-2: var(--warm);
  --line: rgba(43, 33, 28, .11); --line-2: rgba(43, 33, 28, .19); --field-line: #948878; --field-line-hover: #6f6458; --rule: #dcd3c2;
  --hover: rgba(43, 33, 28, .045); --sel: #ece8dd; --row-hover: #f5f2e9;
  --s1: #632722; --s2: #305a47; --s3: #4d6d8f; --s4: #ab6500; --s5: #7b4f6e; --s6: #6b6a2c; --s0: #5c5049;
  /* Avatar fill for series 4: ochre darkened so bone initials hold 4.5:1 (#ab6500 gives 4.05). Series 5 and 6 pass as they are. */
  --a4: #8a5300;
  /* Label: uppercase tracked, for table headers and section kickers only. --ink-3 holds 5.7:1 on paper, 5.4:1 on bone. */
  --label: 600 11.5px/1.3 var(--font); --label-ls: .06em;
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --display: "Inter Display", "Inter", -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --shadow-1: 0 1px 2px rgba(43, 33, 28, .05);
  --shadow: 0 1px 2px rgba(43, 33, 28, .06), 0 12px 32px -12px rgba(43, 33, 28, .18);
  --shadow-pop: 0 1px 2px rgba(43, 33, 28, .06), 0 8px 24px -6px rgba(43, 33, 28, .18), 0 24px 64px -12px rgba(43, 33, 28, .22);
  --gutter: 28px; --top-h: 50px;
  color-scheme: light;
  accent-color: var(--spruce);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bone); color: var(--ink); font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: geometricPrecision; font-feature-settings: "cv11", "ss01";
  overflow-wrap: break-word;
}
::selection { background: #d9c9a8; color: var(--espresso); }
button, input, select, textarea { font: inherit; color: inherit; text-rendering: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: var(--fjord); text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--fjord); outline-offset: 2px; border-radius: 6px; }
input, textarea, select { caret-color: var(--spruce); }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; }
img, svg { max-width: 100%; }
.num, time { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); font-weight: 400; }
.kicker { display: block; margin-bottom: 6px; font: var(--label); letter-spacing: var(--label-ls); text-transform: uppercase; color: var(--ink-3); }
.mono, code { font: 13px/1.5 var(--mono); }
code { background: var(--bone); padding: 1px 6px; border-radius: 4px; overflow-wrap: anywhere; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
* { scrollbar-width: thin; scrollbar-color: var(--stone) transparent; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 14px; height: 14px; }
svg.i.lg { width: 18px; height: 18px; }
.na-mark { width: 30px; height: 30px; flex: none; display: block; }
.nas-lockup-svg { display: block; width: 100%; height: auto; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.55; max-width: 66ch; }

kbd {
  font: 500 11px/1 var(--font); display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 4px; background: var(--paper); border: 1px solid var(--line-2); border-bottom-width: 1.5px; color: var(--ink-2);
}
.keys { display: inline-flex; gap: 3px; }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: var(--r-md);
  background: var(--paper); border: 1px solid var(--line-2); font-weight: 550; color: var(--ink); text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Top bar: a plain bar. Inside the canvas in appFrame; full width on pages without a sidebar. ---------- */
.ui-top {
  position: sticky; top: 0; z-index: 40; flex: none; display: flex; align-items: center; gap: 12px; height: var(--top-h); padding: 0 16px 0 22px;
  background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line);
}
.ui-lockup { flex: none; display: flex; align-items: center; min-height: 44px; width: 150px; color: var(--espresso); border-radius: 4px; }
.ui-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; color: var(--ink-2); }
.ui-top-right a:not(.btn) { color: var(--ink-2); text-decoration: none; }
.ui-top-right a:not(.btn):hover { color: var(--ink); text-decoration: underline; }
.ui-top .icon-btn { color: var(--ink-2); }
.ui-top .icon-btn:hover { background: var(--hover); color: var(--ink); }
.ui-top .btn.on-dark { --hair: var(--field-line); background: var(--paper); color: var(--ink); }
.ui-top .btn.on-dark:not(:disabled):not([aria-disabled="true"]):hover { --hair: var(--field-line); }
.ui-top .btn.on-dark:not(:disabled):not([aria-disabled="true"]):active { background: var(--spruce-90); }
.crumbs { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.ui-lockup + .crumbs, .ui-product + .crumbs { margin-left: 2px; padding-left: 14px; border-left: 1px solid var(--line-2); }
.crumbs a { color: var(--ink-2); text-decoration: none; border-radius: 4px; padding: 2px 5px; }
.crumbs a:hover { color: var(--ink); background: var(--hover); }
.crumbs .cur { color: var(--ink); font-weight: 550; overflow: hidden; text-overflow: ellipsis; padding: 2px 5px; }
.crumbs .i { color: var(--stone); width: 14px; height: 14px; }

/* ---------- Page ---------- */
.ui-page { width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px var(--gutter) 88px; }
.ui-page.wide { max-width: 1400px; }
.ui-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.ui-head h1 { font: 700 26px/1.15 var(--display); letter-spacing: -.015em; }
.ui-head .lede { margin-top: 6px; max-width: 72ch; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.ui-head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.ui-section { margin-top: 36px; }
.ui-section-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ui-section-h h2 { font-size: 15px; font-weight: 650; }
.ui-section-h .acts { margin-left: auto; display: flex; gap: 8px; }
.strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; padding: 10px 14px; border-radius: var(--r-md); background: var(--risk-t); color: var(--risk-ink); font-size: 13.5px; }
.rule { width: 64px; height: 3px; background: var(--falu); }

/* ---------- Auth ---------- */
.ui-auth { min-height: 100vh; min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 20px; padding: 32px 16px; }
.ui-auth-lock { display: flex; align-items: center; min-height: 44px; width: 188px; margin-bottom: 4px; color: var(--espresso); border-radius: 4px; }
.ui-auth-card {
  width: min(420px, 100%); padding: 32px 32px 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  display: grid; gap: 14px;
}
.ui-auth-card h1 { font: 700 28px/1.12 var(--display); letter-spacing: -.02em; }
.ui-auth-card .lede { color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.ui-auth-card form { display: grid; gap: 14px; }
.ui-auth-foot { width: min(560px, 100%); text-align: center; font-size: 12.5px; color: var(--ink-3); }

/* ---------- Surfaces ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); font-weight: 650; font-size: 14.5px; }
.card-h .acts { margin-left: auto; display: flex; gap: 8px; }
.card-b { padding: 20px; }
.card-f { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }

.ui-table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow-x: auto; }
.ui-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ui-table th { padding: 10px 16px; text-align: left; font: var(--label); letter-spacing: var(--label-ls); text-transform: uppercase; color: var(--ink-3); white-space: nowrap; border-bottom: 1px solid var(--line); background: var(--paper); }
.ui-table td { padding: 14px 16px; vertical-align: middle; border-top: 1px solid var(--line); }
.ui-table td.num, .ui-table td.r, .ui-table th.num, .ui-table th.r { font-variant-numeric: tabular-nums; }
.ui-table thead + tbody tr:first-child td, .ui-table tbody:first-child tr:first-child td { border-top: 0; }
.ui-table tbody tr:hover { background: var(--row-hover); }
.ui-table th:first-child, .ui-table td:first-child { padding-left: 20px; }
.ui-table th:last-child, .ui-table td:last-child { padding-right: 20px; }
.ui-table th.num, .ui-table th.r, .ui-table td.num, .ui-table td.r { text-align: right; }
.ui-table td.acts, .ui-table th.acts { text-align: right; white-space: nowrap; }
.ui-table .acts .btn + .btn, .ui-table .acts form + form, .ui-table .acts .btn + form { margin-left: 6px; }
.ui-table .acts form { display: inline; }
.cell-main { min-width: 0; }
.cell-main b, .cell-main a.title { display: block; font-weight: 650; font-size: 14.5px; letter-spacing: -.003em; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.cell-main a.title:hover { text-decoration: underline; text-decoration-color: var(--stone); }
.cell-main small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }

.kv { display: grid; grid-template-columns: 180px minmax(0, 1fr); margin: 0; }
.kv dt, .kv dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv dt { color: var(--ink-2); }
.kv dd { font-weight: 550; overflow-wrap: anywhere; }

.ui-empty { display: grid; justify-items: center; gap: 8px; padding: 56px 24px; text-align: center; background: var(--paper); border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.ui-empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border-radius: 50%; background: var(--sand-soft); color: var(--clay); }
.ui-empty-icon .i { width: 20px; height: 20px; }
.ui-empty h2 { font: 600 18px/1.25 var(--display); letter-spacing: -.01em; word-spacing: .06em; }
.ui-empty p { max-width: 44ch; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.ui-empty .acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.card.flush > .ui-empty { border: 0; border-radius: 0; background: transparent; }

/* ---------- Alerts and toasts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.5; background: var(--fjord-90); color: var(--fjord); border-color: rgba(51, 70, 90, .2); }
.alert .sh { margin-top: 5px; }
.alert.ok { background: var(--ok-t); color: var(--ok-ink); border-color: rgba(73, 125, 18, .3); }
.alert.risk { background: var(--risk-t); color: var(--risk-ink); border-color: rgba(163, 124, 17, .35); }
.alert.risk .sh-risk { border-bottom-color: var(--risk-ink); }
.alert.bad { background: var(--bad-t); color: var(--bad-ink); border-color: rgba(171, 66, 58, .4); }
.alert:empty, .alert[data-empty] { display: none; }
.field-err { color: var(--bad-ink); font-size: 13px; font-weight: 450; }
.field-err:empty { display: none; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 90; max-width: min(560px, calc(100vw - 32px)); transform: translate(-50%, 20px);
  display: flex; gap: 10px; align-items: center; padding: 11px 16px; border-radius: 10px; background: var(--espresso); color: var(--bone);
  font-size: 13.5px; line-height: 1.45; box-shadow: var(--shadow-pop); opacity: 0; pointer-events: none; transition: opacity .25s var(--ease), transform .3s var(--ease);
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.error { background: var(--bad-ink); }

/* ---------- Buttons (Nytt) ---------- */
.btn, .btn-ms {
  --hair: var(--field-line);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 36px; padding: 0 16px; border: 0; border-radius: 5px;
  background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair);
  font-weight: 600; font-size: 14px; line-height: 1; letter-spacing: .02em; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color .12s ease-out, color .12s ease-out, box-shadow .12s ease-out, transform .24s cubic-bezier(.34, 1.56, .64, 1);
}
.btn:focus-visible, .btn-ms:focus-visible { border-radius: 5px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 44px; padding: 0 22px; font-size: 15px; }
.btn.block { display: flex; width: 100%; }
.btn .i { color: var(--ink-2); }
.btn kbd { margin-left: 2px; background: transparent; border-color: rgba(43, 33, 28, .16); }
.btn:not(:disabled):not([aria-disabled="true"]):hover { box-shadow: inset 0 0 0 2px var(--hair); }
.btn:not(:disabled):not([aria-disabled="true"]):active, .btn-ms:not(:disabled):not([aria-disabled="true"]):active { transform: scale(.97); background: var(--spruce-90); transition: transform 90ms ease-out, background-color .12s ease-out; }
.btn.primary { background: var(--spruce); color: var(--bone); box-shadow: none; }
.btn.primary .i { color: var(--bone); }
.btn.primary kbd { color: #d1d0c7; border-color: rgba(244, 241, 232, .28); }
.btn.primary:not(:disabled):not([aria-disabled="true"]):hover { background: var(--spruce-2); box-shadow: none; }
.btn.primary:not(:disabled):not([aria-disabled="true"]):active { background: var(--spruce); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:not(:disabled):not([aria-disabled="true"]):hover { background: var(--hover); box-shadow: none; }
.btn.danger { --hair: var(--bad); color: var(--bad-ink); }
.btn.danger:not(:disabled):not([aria-disabled="true"]):active { background: var(--bad-t); }
.btn.on-dark { --hair: rgba(244, 241, 232, .42); background: transparent; color: var(--bone); }
.btn.on-dark:not(:disabled):not([aria-disabled="true"]):hover { --hair: rgba(244, 241, 232, .75); }
.btn.on-dark:not(:disabled):not([aria-disabled="true"]):active { background: rgba(244, 241, 232, .14); }
.btn.primary.is-done { background: #162b22; }
.btn.is-done:not(.primary) { background: var(--spruce-90); color: var(--spruce); --hair: var(--spruce); }

/* Disabled: tinted, not faded; no motion */
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; transform: none; background: transparent; color: var(--ink-3); box-shadow: inset 0 0 0 1px rgba(43, 33, 28, .22); }
.btn.primary:disabled, .btn.primary[aria-disabled="true"] { background: rgba(31, 58, 46, .18); color: #33453b; box-shadow: none; }
.btn.ghost:disabled, .btn.ghost[aria-disabled="true"] { box-shadow: none; }
.btn.on-dark:disabled, .btn.on-dark[aria-disabled="true"] { color: rgba(244, 241, 232, .6); box-shadow: inset 0 0 0 1px rgba(244, 241, 232, .22); }

/* Busy: 3px track just under the button (Nytt), absolutely placed so nothing shifts. Set --p for a determinate fill. */
.btn[aria-busy="true"], .btn-ms[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::before, .btn[aria-busy="true"]::after, .btn-ms[aria-busy="true"]::before, .btn-ms[aria-busy="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; top: calc(100% + 4px); height: 3px; pointer-events: none;
}
.btn[aria-busy="true"]::before, .btn-ms[aria-busy="true"]::before { background: #d9e3dc; }
.btn[aria-busy="true"]::after, .btn-ms[aria-busy="true"]::after { background: var(--spruce); transform-origin: left; transform: scaleX(var(--p, .35)); animation: btn-busy 1.3s ease-in-out infinite; }
@keyframes btn-busy { 0% { transform: scaleX(0); transform-origin: left; } 50% { transform: scaleX(1); transform-origin: left; } 50.01% { transform: scaleX(1); transform-origin: right; } 100% { transform: scaleX(0); transform-origin: right; } }

/* Sign in with Microsoft: light theme per Microsoft's sign-in button guidance */
.btn-ms { --hair: #8c8c8c; gap: 12px; height: auto; min-height: 44px; padding: 0 16px; background: #fff; color: #5e5e5e; font-size: 15px; }
.btn-ms svg { width: 21px; height: 21px; flex: none; }
.btn-ms.block, .ui-auth-card .btn-ms { display: flex; width: 100%; }
.btn-ms:not(:disabled):not([aria-disabled="true"]):hover { box-shadow: inset 0 0 0 2px var(--hair); }
.btn-ms:not(:disabled):not([aria-disabled="true"]):active { background: #f2f2f2; }
.btn-ms[aria-disabled="true"] { cursor: not-allowed; transform: none; background: #f5f5f5; color: #6b6b6b; box-shadow: inset 0 0 0 1px #c8c8c8; }

.icon-btn { display: inline-grid; place-items: center; border-radius: 7px; color: var(--ink-2); width: 30px; height: 30px; flex: none; }
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.icon-btn:disabled { opacity: .45; }
.link-btn { color: var(--fjord); font-weight: 550; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: rgba(51, 70, 90, .6); transition: text-decoration-thickness .12s ease-out; }
.link-btn:hover { text-decoration-thickness: 2px; text-decoration-color: var(--fjord); }
.text-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--fjord); font-weight: 550; font-size: 13.5px; padding: 4px 0; }
.text-btn:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }

/* ---------- Fields ---------- */
.field { display: grid; align-content: start; gap: 6px; font-size: 13px; font-weight: 550; color: var(--ink); }
.field > small { color: var(--ink-2); font-weight: 400; font-size: 12.5px; }
.input, .select, .textarea,
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea {
  width: 100%; min-height: 38px; padding: 7px 12px; border: 1px solid var(--field-line); border-radius: var(--r-md); background: var(--paper);
  font-size: 14px; font-weight: 400; color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
.textarea, .field textarea { min-height: 96px; line-height: 1.55; resize: vertical; }
.input:hover, .select:hover, .textarea:hover, .field input:hover, .field select:hover, .field textarea:hover { border-color: var(--field-line-hover); }
.input:focus, .select:focus, .textarea:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--fjord); outline-offset: 2px; border-color: var(--fjord);
}
.field.invalid input, .field.invalid select, .field.invalid textarea, .input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--bad); }
.field.invalid input:focus, .field.invalid select:focus, .field.invalid textarea:focus, .input[aria-invalid="true"]:focus { outline-color: var(--fjord); border-color: var(--bad); }
.input:disabled, .select:disabled, .textarea:disabled, .field input:disabled { background: var(--sand-soft); color: var(--ink-3); cursor: not-allowed; }
::placeholder { color: #6e625a; opacity: 1; }
.select, .field select {
  appearance: none; padding-right: 32px; background-repeat: no-repeat; background-position: right 11px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235C5049' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; }
.find { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 10px; border-radius: 7px; border: 1px solid var(--field-line); background: var(--paper); color: var(--ink-2); }
.find input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink); padding: 0; min-height: 0; }
.find:focus-within { border-color: var(--fjord); outline: 2px solid var(--fjord); outline-offset: 2px; }
.toggle { position: relative; flex: none; width: 36px; height: 22px; border-radius: 11px; background: var(--ink-3); transition: background .15s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 2px rgba(43, 33, 28, .25); transition: transform .2s var(--ease); }
.toggle[aria-checked="true"] { background: var(--spruce); }
.toggle[aria-checked="true"]::after { transform: translateX(14px); }
.toggle:disabled { opacity: .5; }
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: rgba(43, 33, 28, .06); }
.seg button { height: 28px; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(43, 33, 28, .1), 0 0 0 1px var(--line); }

/* ---------- Avatars (series colours) ---------- */
.av { --c: var(--s0); position: relative; flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: var(--c); color: var(--bone); font-weight: 650; letter-spacing: .02em; line-height: 1; }
.av.s1 { --c: var(--s1); } .av.s2 { --c: var(--s2); } .av.s3 { --c: var(--s3); } .av.s4 { --c: var(--a4); } .av.s5 { --c: var(--s5); } .av.s6 { --c: var(--s6); }
.av-xs { width: 20px; height: 20px; font-size: 9px; }
.av-sm { width: 24px; height: 24px; font-size: 10px; }
.av-md { width: 32px; height: 32px; font-size: 12px; }
.av-lg { width: 40px; height: 40px; font-size: 14px; }
.av-xl { width: 56px; height: 56px; font-size: 19px; }
.av.dashed { background: var(--paper); color: var(--c); box-shadow: inset 0 0 0 1.5px var(--c); }
.av.dashed::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1.5px dashed var(--paper); }
.av.unk { background: var(--paper); color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.stack { display: flex; align-items: center; }
.stack .av { box-shadow: 0 0 0 2px var(--paper); }
.stack .av + .av { margin-left: -4px; }

/* ---------- Status: shape plus word ---------- */
.st { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 550; white-space: nowrap; color: var(--ink); }
.st-sub { color: var(--ink-2); font-weight: 400; }
.st-sub::before { content: "· "; }
.sh { width: 10px; height: 10px; flex: none; display: inline-block; }
.sh-ok { border-radius: 50%; background: var(--ok); }
.sh-risk { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid var(--risk); }
.sh-run { border-radius: 50%; border: 2px solid var(--fjord); background: linear-gradient(90deg, var(--fjord) 50%, transparent 50%); }
.sh-queue { border-radius: 50%; border: 2px solid var(--taupe); }
.sh-idle { border-radius: 50%; border: 2px dashed var(--taupe); }
.sh-bad { background: var(--bad); border-radius: 2px; width: 9px; height: 9px; }
.sh-info { border-radius: 50%; border: 2px solid var(--fjord); }
.pbar { width: 44px; height: 4px; border-radius: 2px; background: var(--fjord-90); box-shadow: inset 0 0 0 1px rgba(51, 70, 90, .18); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--fjord); border-radius: 2px; width: 100%; transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .4s var(--ease); }
.pbar .p-0 { --p: 0; }
.pbar .p-10 { --p: 0.1; }
.pbar .p-20 { --p: 0.2; }
.pbar .p-30 { --p: 0.3; }
.pbar .p-40 { --p: 0.4; }
.pbar .p-50 { --p: 0.5; }
.pbar .p-60 { --p: 0.6; }
.pbar .p-70 { --p: 0.7; }
.pbar .p-80 { --p: 0.8; }
.pbar .p-90 { --p: 0.9; }
.pbar .p-100 { --p: 1; }

/* ---------- Chips and badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12.5px; font-weight: 550; background: var(--bone); border: 1px solid var(--line); color: var(--ink); white-space: nowrap; }
.chip .i { width: 13px; height: 13px; color: var(--ink-2); }
.chip-vm { background: var(--spruce-90); border-color: rgba(31, 58, 46, .22); color: var(--spruce); }
.chip-vm::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--spruce); }
.chip-sug { background: transparent; border: 1px dashed rgba(51, 70, 90, .55); color: var(--fjord); }
.chip-sug::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px dashed var(--fjord); }
.chip-named { background: var(--fjord-90); border-color: rgba(51, 70, 90, .2); color: var(--fjord); }
.chip-named::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--fjord); }
.count { white-space: nowrap; font-size: 12px; color: var(--ink-2); background: rgba(43, 33, 28, .06); padding: 0 6px; border-radius: 8px; line-height: 18px; font-weight: 550; font-variant-numeric: tabular-nums; }
.badge { --b: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12.5px; font-weight: 550; white-space: nowrap; background: var(--bone); border: 1px solid var(--line-2); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--b); }
.badge.spruce { --b: var(--spruce); background: var(--spruce-90); border-color: rgba(31, 58, 46, .22); color: var(--spruce); }
.badge.fjord { --b: var(--fjord); background: var(--fjord-90); border-color: rgba(51, 70, 90, .22); color: var(--fjord); }
.badge.ok { --b: var(--ok); background: var(--ok-t); border-color: rgba(73, 125, 18, .3); color: var(--ok-ink); }
.badge.risk { --b: var(--risk); background: var(--risk-t); border-color: rgba(163, 124, 17, .35); color: var(--risk-ink); }
.badge.ok::before { border-radius: 50%; }
.badge.risk::before { width: 0; height: 0; border-radius: 0; background: none; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 7px solid var(--risk); }
.badge.bad::before { width: 6px; height: 6px; border-radius: 1px; }
.badge.bad { --b: var(--bad); background: var(--bad-t); border-color: rgba(171, 66, 58, .4); color: var(--bad-ink); }

/* ---------- App frame: bone sidebar with the lockup, inset paper canvas with its own top bar ---------- */
.ui-product { flex: none; font-size: 13.5px; font-weight: 600; letter-spacing: .01em; color: var(--ink); white-space: nowrap; }
.ui-menu { display: inline-grid; }
.app { --side-w: 244px; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
.app .ui-top { position: relative; }
.app .ui-top .ui-lockup, .app .ui-top .ui-product { display: none; }
.app .ui-top .crumbs { margin: 0; padding: 0; border: 0; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-lock { display: flex; align-items: center; min-height: 44px; width: 192px; padding: 0 8px; color: var(--espresso); border-radius: 6px; }
.side-top [data-app-close] { display: none; }
.side { display: flex; flex-direction: column; gap: 2px; min-height: 0; padding: 14px 12px 12px; overflow-y: auto; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side > *, .side nav > *, .side .folders > * { flex: none; }
.nav-i { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 0 8px; border-radius: 7px; color: var(--ink); font-weight: 550; font-size: 14px; text-decoration: none; text-align: left; }
.nav-i > span:first-of-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-i .i { color: var(--ink-2); }
.nav-i:hover { background: var(--hover); }
.nav-i[aria-current="page"] { background: var(--paper); box-shadow: 0 0 0 1px var(--line), var(--shadow-1); }
.nav-i[aria-current="page"] .i { color: var(--spruce); }
.nav-i .ct { margin-left: auto; font-size: 12px; color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.side-h { margin: 18px 8px 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.side nav > .side-h:first-child { margin-top: 4px; }
.side-foot { position: sticky; bottom: -12px; z-index: 1; margin: auto -12px -12px; padding: 12px 12px 12px; background: var(--bone); box-shadow: 0 -1px 0 var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.side-h-tog { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; margin: 0 -4px; padding: 0 4px; border: 0; border-radius: 5px; background: none; color: inherit; font: inherit; cursor: pointer; }
.side-h-tog:hover { background: var(--hover); }
.side-h-tog .i { width: 14px; height: 14px; color: var(--ink-3); transition: transform .16s var(--ease); }
.side-h-tog[aria-expanded="false"] .i { transform: rotate(-90deg); }
.side .apps-all { color: var(--ink-2); font-weight: 500; font-size: 13px; min-height: 28px; }
.folders[data-limit]:not(.is-expanded) > .fold-row:nth-child(n+7):not(:has([aria-current="page"])) { display: none; }
.canvas { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; margin: 8px 8px 8px 0; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.main { flex: 1; min-height: 0; overflow: auto; position: relative; }
.scrim { position: fixed; inset: 0; z-index: 49; background: rgba(43, 33, 28, .34); animation: ui-fade .16s ease-out; }
@keyframes ui-fade { from { opacity: 0; } }

/* Workspace switcher, menus */
.ws-wrap { position: relative; margin: 10px 0 8px; }
.ws { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: var(--r-md); text-align: left; min-height: 44px; }
.ws:hover, .ws[aria-expanded="true"] { background: var(--hover); }
.ws-txt { min-width: 0; flex: 1; }
.ws b { display: block; font-weight: 650; font-size: 14px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws small { display: block; font-size: 12.5px; color: var(--ink-2); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws > .i { margin-left: auto; color: var(--ink-2); }
.menu { position: fixed; z-index: 60; min-width: 220px; max-width: min(380px, calc(100vw - 16px)); padding: 6px; background: var(--paper); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-pop); animation: ui-rise .18s var(--ease); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; }
.ws-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); min-width: 0; }
.menu-h { padding: 8px 10px 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 6px 10px; border-radius: 7px; text-align: left; font-size: 13.5px; color: var(--ink); text-decoration: none; }
.menu-item:hover:not(:disabled), .menu-item:focus-visible { background: var(--sel); }
.menu-item:focus-visible { outline: 2px solid var(--fjord); outline-offset: 1px; }
.menu-item .i { color: var(--ink-2); }
.menu-item .menu-meta { margin-left: auto; color: var(--ink-2); font-size: 12px; }
.menu-item.danger, .menu-item.danger .i { color: var(--bad-ink); }
@keyframes ui-rise { from { opacity: 0; transform: translateY(6px) scale(.985); } }

/* Sidebar sections, folders, trash, user row */
.side-h { display: flex; align-items: center; justify-content: space-between; min-height: 22px; }
.side-h .icon-btn { width: 22px; height: 22px; border-radius: 5px; }
.side-sep { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.folders { display: flex; flex-direction: column; gap: 2px; }
.fold .i { color: var(--clay); }
.fold-row { position: relative; display: flex; align-items: center; }
.fold-row .nav-i { padding-right: 8px; }
.fold-row .fold-more { position: absolute; right: 2px; opacity: 0; width: 26px; height: 26px; }
.fold-row:hover .fold-more, .fold-row:focus-within .fold-more, .fold-more[aria-expanded="true"] { opacity: 1; }
.fold-row:hover .nav-i .ct, .fold-row:focus-within .nav-i .ct { visibility: hidden; }
.fold-row.is-dragging { opacity: .5; }
.fold-form { display: flex; gap: 4px; align-items: center; padding: 2px 0 2px 4px; }
.fold-form input { flex: 1; min-width: 0; height: 30px; padding: 0 8px; border: 1px solid var(--fjord); border-radius: 7px; background: var(--paper); font-size: 13.5px; outline: 2px solid var(--fjord); outline-offset: 1px; }
.fold-form .icon-btn { width: 28px; height: 28px; }
.fold-drop { outline: 2px dashed var(--fjord); outline-offset: -2px; background: var(--fjord-90); border-radius: 7px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-md); min-width: 0; }
.me .av { flex: none; }
.me .me-txt { min-width: 0; flex: 1; }
.me b, .me small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me b { font-weight: 650; font-size: 13.5px; line-height: 1.25; color: var(--ink); }
.me small { font-size: 12.5px; color: var(--ink-2); line-height: 1.3; }
.me .icon-btn { flex: none; }

/* Top bar search (opens the page's palette; see APP_FRAME_JS) */
.ui-cmdk { display: flex; align-items: center; gap: 9px; width: 340px; max-width: 100%; height: 32px; padding: 0 6px 0 11px; border-radius: 8px; background: var(--bone); border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; text-align: left; }
.ui-cmdk:hover { border-color: var(--line-2); color: var(--ink); }
.ui-cmdk > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Item bar: second sticky bar under the top bar for item pages */
.item-bar { flex: none; display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 16px 0 22px; background: rgba(251, 249, 243, .94); -webkit-backdrop-filter: saturate(1.2) blur(8px); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--line); position: relative; z-index: 6; }
.ib-left { display: flex; align-items: stretch; gap: 2px; height: 100%; min-width: 0; font-weight: 600; font-size: 14px; }
.ib-left > b, .ib-title { align-self: center; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-tab { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; font-weight: 600; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.ib-tab .i { color: var(--ink-3); }
.ib-tab:hover { color: var(--ink); }
.ib-tab[aria-current="page"], .ib-tab[aria-selected="true"] { color: var(--ink); }
.ib-tab[aria-current="page"] .i, .ib-tab[aria-selected="true"] .i { color: var(--spruce); }
.ib-tab[aria-current="page"]::after, .ib-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--espresso); }
.ib-crumb { display: none; }
.ib-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.main.bare { overflow: hidden; display: flex; flex-direction: column; }

/* ---------- Touch and small screens ---------- */
@media (min-width: 861px) {
  .app { transition: grid-template-columns .2s var(--ease); }
  .canvas { transition: margin .2s var(--ease); }
  .app.side-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
  .app.side-collapsed .side { min-width: 0; overflow: hidden; visibility: hidden; }
  .app.side-collapsed .canvas { margin: 8px; }
}
@media (max-width: 860px) {
  :root { --gutter: 16px; --top-h: 52px; }
  body { font-size: 15px; }
  .ui-top { gap: 6px; padding: 0 6px 0 6px; background: var(--bone); }
  .app { display: block; }
  .app .ui-top .ui-lockup { display: flex; }
  .side-top [data-app-close] { display: inline-grid; }
  .side { overflow-y: auto; position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(300px, 86vw); background: var(--bone); box-shadow: var(--shadow-pop); transform: translateX(-104%); transition: transform .28s var(--ease); visibility: hidden; padding-top: 18px; }
  .app.drawer-open .side { transform: none; visibility: visible; }
  .nav-i { min-height: 44px; }
  .canvas { margin: 0; border: 0; border-radius: 0; height: 100vh; height: 100dvh; box-shadow: none; }
  .ui-product { display: none; }
  .ui-top-right { padding-right: 2px; }
  .ui-top-right .ui-cmdk { width: 44px; height: 44px; padding: 0; justify-content: center; border: 0; background: transparent; }
  .ui-top-right .ui-cmdk > span, .ui-top-right .ui-cmdk .keys { display: none; }
  .ui-top-right .ui-cmdk .i { width: 18px; height: 18px; }
  .item-bar { padding: 0 8px 0 12px; height: 48px; }
  .ib-right .btn .lbl { display: none; }
  .fold-row .fold-more { opacity: 1; width: 44px; height: 44px; right: 0; }
  .side-h { margin-top: 12px; }
  .side-h .icon-btn, .fold-form .icon-btn { width: 44px; height: 44px; margin: -11px -10px -11px 0; }
  .fold-form input { height: 44px; font-size: 16px; }
  .fold-row .nav-i .ct { margin-right: 36px; }
  .fold-row:hover .nav-i .ct, .fold-row:focus-within .nav-i .ct { visibility: visible; }
  .ui-lockup { width: 132px; }
  .crumbs { display: none; }
  .ui-page { padding: 20px var(--gutter) 64px; }
  .ui-head { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 20px; }
  .ui-head h1 { font-size: 23px; }
  .ui-head .acts { margin-left: 0; }
  .ui-head .acts .btn { flex: 1; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { padding-bottom: 0; border: 0; }
  .ui-auth-card { padding: 26px 22px 22px; }
  .input, .select, .textarea, .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea { font-size: 16px; }
}
@media (max-width: 520px) {
  .ui-top-right .hide-sm { display: none; }
  .ui-table-wrap { overflow: visible; background: transparent; border: 0; box-shadow: none; }
  .ui-table, .ui-table tbody, .ui-table tr, .ui-table td { display: block; width: 100%; }
  .ui-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ui-table tr { margin-bottom: 10px; padding: 6px 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
  .ui-table td, .ui-table td:first-child, .ui-table td:last-child { padding: 8px 16px; border: 0; }
  .ui-table td[data-label] { display: flex; justify-content: space-between; align-items: center; gap: 16px; text-align: right; }
  .ui-table td[data-label]::before { content: attr(data-label); flex: none; font-size: 12px; font-weight: 500; color: var(--ink-3); text-align: left; }
  .ui-table td.acts { text-align: left; white-space: normal; display: flex; flex-wrap: wrap; gap: 8px; }
  .ui-table tbody tr:hover { background: var(--paper); }
  .ui-empty { padding: 40px 20px; }
  .toast { bottom: 16px; }
}
@media (pointer: coarse), (max-width: 520px) {
  .btn, .btn.sm, .btn.lg, .btn-ms { min-height: 44px; }
  .btn, .btn.sm { padding: 0 16px; }
  .icon-btn { width: 44px; height: 44px; }
  .input, .select, .textarea, .field input:not([type="checkbox"]):not([type="radio"]), .field select { min-height: 44px; }
  .seg button { min-height: 40px; }
  .check { min-height: 44px; }
  .check input { width: 20px; height: 20px; }
  .toggle { width: 44px; height: 26px; border-radius: 13px; }
  .toggle::after { width: 20px; height: 20px; }
  .toggle[aria-checked="true"]::after { transform: translateX(18px); }
  .text-btn, .link-btn { min-height: 44px; display: inline-flex; align-items: center; }
  .find { height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .btn:active, .btn-ms:active { transform: none !important; } *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* directory.ts */

/* ---------- Sidebar ---------- */
.dir-publish { margin: 0 0 12px; }
.dir-publish .keys { margin-left: 2px; }

/* ---------- Page ---------- */
.dir-signin { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; margin-bottom: 20px; padding: 16px 20px; background: var(--spruce-90); border-color: rgba(31, 58, 46, .18); }
.dir-signin b { display: block; font-size: 14.5px; font-weight: 650; }
.dir-signin p { margin-top: 2px; max-width: 60ch; }
.dir-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin-bottom: 16px; }
.dir-tools .find { width: 300px; max-width: 100%; }
.dir-quiet { margin-left: 10px; color: var(--ink-2); font-weight: 450; }
.dir-quiet .link-btn { font-weight: 550; }
.dir-count { margin-left: auto; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.dir-count b { color: var(--ink); font-weight: 600; }

/* ---------- Table ---------- */
.dir-tbl .dir-c-access { width: 110px; }
.dir-tbl .dir-c-status { width: 120px; }
.dir-tbl .dir-c-created { width: 120px; white-space: nowrap; color: var(--ink-2); }
.dir-tbl .dir-c-more { width: 52px; }
.dir-app { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dir-app .cell-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 12.5px; }
.dir-app .cell-main a.title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-row { cursor: pointer; }
.dir-row.is-dragging { opacity: .45; }
.dir-ico { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: var(--r-md); background: var(--sand-soft); color: var(--clay); }
.dir-ico .i { width: 17px; height: 17px; }
.dir-group-h > .i { vertical-align: -3px; margin-right: 8px; color: var(--clay); }
.dir-more-btn { opacity: 0; }
.dir-row:hover .dir-more-btn, .dir-more-btn[aria-expanded="true"], .dir-more-btn:focus-visible { opacity: 1; }
.ui-table .dir-group-h { text-transform: none; letter-spacing: normal; padding: 12px 20px 10px; background: rgba(43, 33, 28, .028); color: var(--ink); font-size: 13px; font-weight: 650; border-bottom: 1px solid var(--line); }
.ui-table tbody + tbody .dir-group-h { border-top: 1px solid var(--line); }
.dir-group-h .count { margin-left: 6px; font-weight: 550; }
.ui-table tr.dir-group:hover, .ui-table tr.empty-row:hover { background: transparent; }
.dir-empty-cell { padding: 0; }
.dir-empty-cell .ui-empty { border: 0; border-radius: 0; background: transparent; padding: 32px 24px; }
.ui-table td.dir-empty-cell:first-child { padding: 0; }



/* ---------- Row menu (popover, built by the page script) ---------- */
.dir-menu.row-menu { position: fixed; z-index: 90; min-width: 200px; max-width: calc(100vw - 16px); display: grid; padding: 6px; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); animation: ui-fade .12s ease-out; }
.row-menu > a, .row-menu > button { display: flex; align-items: center; width: 100%; min-height: 36px; padding: 0 12px; border-radius: var(--r-md); color: var(--ink); font-size: 14px; font-weight: 550; text-align: left; text-decoration: none; cursor: pointer; }
.row-menu > a:hover, .row-menu > button:hover, .row-menu > a:focus-visible, .row-menu > button:focus-visible { background: var(--sel); outline: none; }
.row-menu > a:focus-visible, .row-menu > button:focus-visible { box-shadow: inset 0 0 0 2px var(--fjord); }
.row-menu > button.is-done { color: var(--ok-ink); }
@media (max-width: 860px), (hover: none) { .row-menu > a, .row-menu > button { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .dir-menu.row-menu { animation: none; } }

/* ---------- Status, waiting versions, copies ---------- */
.dir-stat { display: grid; gap: 3px; justify-items: start; }
.dir-new { display: inline-flex; align-items: center; gap: 7px; color: var(--a4); font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.dir-new-sh { width: 8px; height: 8px; flex: none; border-radius: 1px; background: var(--a4); transform: rotate(45deg); }
.dir-sh-pause { background: linear-gradient(90deg, var(--ink-2) 0 3px, transparent 3px 7px, var(--ink-2) 7px 10px); }
.dir-st-paused { color: var(--ink-2); }
.ui-table tr.is-paused .dir-ico { background: var(--hover); color: var(--ink-3); }
.ui-table tr.is-paused a.title { color: var(--ink-2); }
.ui-table tr.has-waiting .dir-ico { position: relative; overflow: visible; }
.ui-table tr.has-waiting .dir-ico::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 1px; background: var(--a4); box-shadow: 0 0 0 2px var(--paper); transform: rotate(45deg); }
.ui-table tr.has-waiting > td:first-child { box-shadow: inset 3px 0 0 var(--a4); }
.dir-copies { display: inline-flex; align-items: center; min-height: 24px; margin-top: 2px; padding: 0; color: var(--a4); font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.dir-copies::after { content: ""; width: 6px; height: 6px; margin-left: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s var(--ease); }
.dir-copies[aria-expanded="true"]::after { transform: rotate(-135deg); }
.dir-copies:focus-visible { outline: 2px solid var(--fjord); outline-offset: 2px; border-radius: 2px; }
@media (max-width: 860px) { .dir-copies { min-height: 44px; } }
.ui-table tr.dir-sub[hidden] { display: none; }
.ui-table tr.dir-sub { background: var(--hover); }
.ui-table tr.dir-sub:hover { background: var(--hover); }
.ui-table tr.dir-sub > td { padding: 10px 20px 10px 64px; }
.dir-subin { display: grid; gap: 8px; }
.dir-sub-main, .dir-sub-confirm { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; color: var(--ink-2); font-size: 13.5px; }
.dir-sub-main[hidden], .dir-sub-confirm[hidden] { display: none; }
.dir-sub-l b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.dir-sub-l small { display: block; color: var(--ink-3); font-size: 12.5px; }
.dir-sub-q { color: var(--ink); }
.dir-sub-acts { display: inline-flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 520px) {
  .ui-table tr.dir-sub { margin: -6px 0 10px 12px; width: calc(100% - 12px); }
  .ui-table tr.dir-sub > td { padding: 10px 14px; }
  .dir-sub-acts .btn { min-height: 44px; }
}

/* ---------- Upload dialog ---------- */
.dir-drop { position: relative; display: block; border: 1.5px dashed var(--field-line); border-radius: var(--r-lg); background: var(--bone); transition: background .15s var(--ease), border-color .15s var(--ease); }
.dir-drop:hover, .dir-drop.is-over { background: var(--sel); border-color: var(--fjord); }
.dir-drop.has-file { border-style: solid; border-color: var(--spruce); background: var(--spruce-90); }
.dir-drop:focus-within { outline: 2px solid var(--fjord); outline-offset: 2px; }
.dir-file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dir-drop-l { display: grid; justify-items: center; gap: 4px; padding: 26px 16px; text-align: center; pointer-events: none; }
.dir-drop-l .i { width: 22px; height: 22px; color: var(--clay); }
.dir-drop-l b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.dir-drop-l small { color: var(--ink-2); font-size: 12.5px; }
.dir-cli { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.dir-cli > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; color: var(--ink-2); font-size: 13.5px; font-weight: 550; min-height: 28px; }
.dir-cli > summary:focus-visible { outline: 2px solid var(--fjord); outline-offset: 2px; border-radius: 2px; }
.dir-cli > summary::-webkit-details-marker { display: none; }
.dir-cli > summary::before { content: ""; flex: none; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s var(--ease); }
.dir-cli[open] > summary::before { transform: rotate(45deg); }
.dir-cli[open] > summary { margin-bottom: 4px; }
@media (max-width: 860px) { .dir-cli > summary { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .dir-drop, .dir-copies::after, .dir-cli > summary::before { transition: none; } }

/* ---------- Command palette ---------- */
dialog.dir-palette { width: min(640px, calc(100vw - 24px)); margin: 10vh auto 0; padding: 0; border: 1px solid var(--line-2); border-radius: 14px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-pop); overflow: hidden; }
dialog.dir-palette::backdrop { background: rgba(43, 33, 28, .4); }
.dir-q { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.dir-q .i { color: var(--ink-2); }
.dir-q input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--ink); }
.dir-q input::-webkit-search-cancel-button, .dir-tools input::-webkit-search-cancel-button { appearance: none; display: none; }
.dir-pcats { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.dir-cat { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 14px; border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 550; color: var(--ink-2); white-space: nowrap; }
.dir-cat:hover { color: var(--ink); background: var(--hover); }
.dir-cat[aria-pressed="true"] { background: var(--espresso); border-color: var(--espresso); color: var(--bone); }
.dir-cat-n { font-size: 11.5px; font-variant-numeric: tabular-nums; opacity: .75; }
.dir-pl { max-height: min(460px, 56vh); overflow: auto; padding: 6px 8px 8px; }
.dir-ph { margin: 10px 8px 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.dir-pi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px; border-radius: 8px; font-size: 14px; text-align: left; color: var(--ink); }
.dir-pi:hover, .dir-pi[aria-selected="true"] { background: var(--sel); }
.dir-pi[aria-selected="true"] { box-shadow: inset 2px 0 0 var(--spruce); }
.dir-pi-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-pi small { flex: 0 1 auto; max-width: 45%; margin-left: auto; padding-left: 12px; color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dir-pfoot { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.dir-pfoot span { display: inline-flex; align-items: center; gap: 4px; }
.dir-pempty { padding: 20px 10px; color: var(--ink-2); }

/* ---------- Modals (.backdrop.open is toggled by the page script) ---------- */
.dir-backdrop { display: none; position: fixed; inset: 0; z-index: 80; align-items: center; justify-content: center; padding: 16px; background: rgba(43, 33, 28, .4); }
.dir-backdrop.open { display: flex; animation: ui-fade .16s ease-out; }
.dir-modal { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow-pop); }
.dir-modal > * { min-width: 0; }
.dir-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dir-modal-head h2 { font: 600 19px/1.25 var(--display); letter-spacing: -.01em; }
.dir-modal-head p { margin-top: 4px; font-size: 13.5px; line-height: 1.5; }
.dir-code { margin: 0; padding: 14px 16px; background: var(--espresso); color: var(--bone); border-radius: var(--r-md); font: 12.5px/1.75 var(--mono); overflow-x: auto; white-space: pre; }
.dir-code .dim { color: var(--stone); }
.dir-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dir-fine { font-size: 12.5px; }
.dir-form { display: grid; gap: 12px; }
.dir-inline-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; }
.dir-inline-form .field { flex: 1; min-width: 200px; }
.dir-token { padding: 12px 14px; background: var(--risk-t); border: 1px solid rgba(163, 124, 17, .35); border-radius: var(--r-md); color: var(--risk-ink); font: 12px/1.6 var(--mono); word-break: break-all; }
.dir-keys { display: grid; gap: 8px; }
.dir-key { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); font-size: 13.5px; }
.dir-key-prefix { margin-left: 4px; color: var(--ink-3); font: 12px var(--mono); }
.dir-note { padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-md); color: var(--ink-2); font-size: 13.5px; }
.dir-note b { display: block; color: var(--ink); font-weight: 650; }

/* ---------- Share and delete dialogs ---------- */
.dir-choice { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.dir-choice legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 550; }
.dir-choice .check { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-md); }
.dir-choice .check:has(input:checked) { border-color: var(--spruce); background: var(--spruce-90); }
.dir-choice .check b { display: block; font-weight: 600; }
.dir-choice .check small { display: block; color: var(--ink-2); font-size: 12.5px; }
.dir-results-h { margin-bottom: 8px; font-weight: 600; }
.dir-results { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dir-results li { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 2px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-md); font-size: 13.5px; align-items: center; }
.dir-results li small { grid-column: 2; color: var(--ink-2); font-size: 12.5px; }
.dir-res-t { overflow-wrap: anywhere; font-weight: 550; }

/* Keep a category row's count visible after a mouse rename leaves focus on it; keyboard focus still swaps count for the menu button. */
@media (min-width: 861px) {
  .fold-row:focus-within:not(:hover) .nav-i .ct { visibility: visible; }
  .fold-row:focus-within:not(:hover):not(:has(.fold-more:focus-visible)) .fold-more:not([aria-expanded="true"]) { opacity: 0; }
  .fold-row:focus-within:has(.fold-more:focus-visible) .nav-i .ct { visibility: hidden; }
}

/* ---------- Move to category ---------- */
.dir-movelist { display: grid; gap: 6px; }
.dir-moveopt { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-md); text-align: left; font-weight: 550; }
.dir-moveopt:hover { background: var(--hover); }
.dir-moveopt[aria-pressed="true"] { border-color: var(--spruce); background: var(--spruce-90); }
.dir-moveopt small { color: var(--ink-2); font-weight: 400; }

/* ---------- Wide and narrow ---------- */
@media (min-width: 521px) {
  .ui-table td.dir-c-created { text-align: left; }
}
@media (min-width: 521px) and (max-width: 1040px) {
  .dir-tbl .dir-c-created { display: none; }
}
@media (max-width: 860px), (hover: none) {
  .dir-kbd { display: none; }
  .dir-more-btn { opacity: 1; }
}
@media (min-width: 861px) {
  .ui-head .dir-mobile-only { display: none; }
}
@media (max-width: 860px) {
  .dir-tools .find { height: 44px; padding: 0 10px; }
  .dir-tools .find input { height: 44px; min-height: 44px; margin: -1px 0; }
  .dir-row { position: relative; }
  .dir-row a.title::after { content: ""; position: absolute; inset: 0; z-index: 0; }
  .ui-table td.dir-more { position: relative; z-index: 1; }
  .dir-signin-top { display: none; }
  .ui-top .ui-menu { flex: none; width: 44px; height: 44px; }
  .seg button { min-height: 44px; min-width: 44px; }
  .dir-more-btn { width: 44px; height: 44px; }
  .dir-publish { min-height: 44px; }
  .dir-tools .find { width: 100%; }
  .dir-count { margin-left: 0; }
    .dir-pi { min-height: 44px; }
  .dir-signin { flex-direction: column; align-items: stretch; }
  .dir-signin .btn { width: 100%; height: 44px; }
  .ui-head .dir-mobile-only { margin-left: 0; }
  .dir-mobile-only .btn { width: 100%; height: 44px; }
  dialog.dir-palette { margin-top: 8vh; }
  .dir-backdrop { align-items: flex-end; padding: 0; }
  .dir-modal { width: 100%; border-radius: 14px 14px 0 0; padding: 20px 16px; }
  .dir-modal .btn { min-height: 44px; }
  .dir-modal-head .btn { height: 44px; }
}
@media (max-width: 400px) {
  .ui-top .ui-lockup { width: 108px; }
}
@media (max-width: 520px) {
  .dir-row a.title::after { content: ""; position: absolute; inset: 0; z-index: 0; }
  .ui-table tr.app-row td.dir-more { z-index: 1; }
  .ui-table tr.app-row { position: relative; }
  .ui-table tr.app-row td.dir-title { padding: 10px 52px 6px 16px; }
  .ui-table tr.app-row td.dir-more { position: absolute; top: 4px; right: 4px; width: auto; padding: 0; }
  .ui-table tr.app-row td.dir-more .icon-btn { width: 44px; height: 44px; }
  .ui-table tr.dir-group { margin: 14px 0 8px; padding: 0; background: transparent; border: 0; box-shadow: none; }
  .ui-table tr.dir-group th { display: block; padding: 0 2px; background: transparent; border: 0; }
  .ui-table tbody + tbody .dir-group-h { border-top: 0; }
  .ui-table tr.empty-row { padding: 0; }
  .dir-empty-cell .ui-empty { padding: 28px 16px; background: var(--paper); border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
  .dir-tbl .dir-c-access, .dir-tbl .dir-c-status, .dir-tbl .dir-c-created { width: 100%; }
}

/* ---------- Sidebar account row (button that opens the account menu) ---------- */
button.me-btn { width: 100%; text-align: left; cursor: pointer; }
button.me-btn:hover, button.me-btn[aria-expanded="true"] { background: var(--sel); }
button.me-btn:focus-visible { outline: 2px solid var(--fjord); outline-offset: -2px; }
button.me-btn > .i { flex: none; width: 16px; height: 16px; color: var(--ink-2); transform: rotate(180deg); }
button.me-btn[aria-expanded="true"] > .i { transform: none; }
.menu.user-menu { z-index: 95; }
@media (max-width: 860px) { button.me-btn { min-height: 44px; } .menu.user-menu .menu-item { min-height: 44px; } }

/* ---------- Toast with an action (Undo) ---------- */
.toast .toast-msg { min-width: 0; overflow-wrap: anywhere; }
.toast .toast-act { flex: none; min-height: 32px; margin: -4px -6px -4px 4px; padding: 0 12px; border: 1px solid rgba(244, 241, 232, .45); border-radius: 6px; color: var(--bone); font-size: 13px; font-weight: 650; cursor: pointer; }
.toast .toast-act:hover { background: rgba(244, 241, 232, .14); }
.toast .toast-act:focus-visible { outline: 2px solid var(--bone); outline-offset: 2px; }
@media (pointer: coarse), (max-width: 520px) { .toast .toast-act { min-height: 44px; min-width: 44px; margin: -10px -12px -10px 4px; } }

/* ---------- Filter chips, Needs review, sort ---------- */
.dir-tools2 { display: flex; align-items: center; gap: 10px 16px; margin: -4px 0 16px; }
.dir-chips { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: thin; }
.dir-chip { display: inline-flex; align-items: center; flex: none; gap: 7px; height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 15px; background: var(--paper); font-size: 13px; font-weight: 550; color: var(--ink-2); white-space: nowrap; cursor: pointer; }
.dir-chip:hover { color: var(--ink); background: var(--hover); }
.dir-chip[aria-pressed="true"] { background: var(--espresso); border-color: var(--espresso); color: var(--bone); }
.dir-chip:focus-visible, .dir-chip-clear:focus-visible, .dir-sort select:focus-visible { outline: 2px solid var(--fjord); outline-offset: 2px; }
.dir-chip-review:not([aria-pressed="true"]) { color: var(--a4); border-color: rgba(163, 124, 17, .45); }
.dir-chip-n { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .8; }
.dir-chip-sep { flex: none; width: 1px; height: 18px; margin: 0 2px; background: var(--line-2); }
.dir-chip-clear { flex: none; height: 30px; padding: 0 8px; color: var(--ink-2); font-size: 13px; font-weight: 550; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.dir-chip-clear:hover { color: var(--ink); }
.dir-sort { display: inline-flex; align-items: center; flex: none; gap: 8px; font-size: 13px; color: var(--ink-2); font-weight: 550; }
.dir-sort select { width: auto; min-height: 32px; padding: 3px 28px 3px 10px; font-size: 13px; }
@media (max-width: 860px) {
  .dir-tools2 { flex-direction: column; align-items: stretch; margin-top: 0; }
  .dir-chips { flex: none; width: 100%; margin: 0 -16px; padding: 2px 16px 6px; width: calc(100% + 32px); }
  .dir-chip { height: 44px; padding: 0 16px; border-radius: 22px; font-size: 14px; }
  .dir-chip-clear { height: 44px; padding: 0 12px; }
  .dir-sort { justify-content: space-between; }
  .dir-sort select { flex: 1; max-width: 220px; min-height: 44px; font-size: 14px; }
}

/* ---------- Select many ---------- */
.dir-sel { position: relative; z-index: 1; display: grid; place-items: center; flex: none; width: 28px; height: 32px; margin-left: -6px; cursor: pointer; }
.dir-sel input { width: 17px; height: 17px; margin: 0; accent-color: var(--spruce); cursor: pointer; }
.dir-sel-off { visibility: hidden; cursor: default; }
@media (min-width: 861px) {
  .dir-sel:not(.dir-sel-off) input:not(:checked) { opacity: 0; }
  .dir-row:hover .dir-sel input, .dir-sel input:focus-visible, .has-bulk .dir-sel input { opacity: 1; }
}
.dir-sel input:focus-visible { outline: 2px solid var(--fjord); outline-offset: 2px; }
.ui-table tr.dir-row.is-selected { background: var(--sel); }
.ui-table tr.dir-row.is-selected:hover { background: var(--sel); }
@media (max-width: 860px) {
  .dir-sel { width: 44px; height: 44px; margin: -6px 0 -6px -10px; }
  .dir-sel input { width: 22px; height: 22px; }
}

/* ---------- Bulk bar ---------- */
.dir-bulk { position: fixed; z-index: 85; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; width: min(680px, calc(100vw - 32px)); padding: 10px 12px 10px 18px; background: var(--paper); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-pop); animation: ui-fade .14s ease-out; }
.dir-bulk-n { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.dir-bulk-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.has-bulk .ui-page { padding-bottom: 96px; }
.has-bulk .toast { bottom: 96px; }
@media (max-width: 860px) {
  .dir-bulk { width: calc(100vw - 16px); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); padding: 10px 10px 12px; flex-direction: column; align-items: stretch; gap: 8px; }
  .dir-bulk-n { padding-left: 4px; }
  .dir-bulk-acts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .dir-bulk-acts .btn.ghost { grid-column: 1 / -1; }
  .dir-bulk-acts .btn { min-height: 44px; padding: 0 10px; justify-content: center; }
  .has-bulk .ui-page { padding-bottom: 190px; }
  .has-bulk .toast { bottom: 190px; }
}
@media (prefers-reduced-motion: reduce) { .dir-bulk { animation: none; } }

/* ---------- Trash view ---------- */
.row-menu > button.is-danger { color: var(--bad-ink); }
.dir-trashlist { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dir-trashrow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
.dir-trash-main { flex: 1; min-width: 0; }
.dir-trash-t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 600; }
.dir-trash-main small { display: block; margin-top: 2px; color: var(--ink-2); font-size: 12.5px; }
.dir-trashrow .btn { flex: none; }
.dir-trashrow .btn .i { width: 15px; height: 15px; }
@media (max-width: 520px) {
  .dir-trashrow { flex-wrap: wrap; padding: 12px; }
  .dir-trash-main { flex-basis: calc(100% - 52px); }
  .dir-trashrow .btn { width: 100%; min-height: 44px; }
}

/* shell.ts: frame around the sandboxed app */
.sh-body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.sh-body .ui-top { flex: none; }
.sh-itemback .i { transform: rotate(180deg); width: 18px; height: 18px; }
.sh-itemback { display: none; flex: none; align-items: center; gap: 4px; min-height: 44px; margin-right: 4px; padding: 0 8px 0 4px; border-radius: var(--r-md); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; align-self: center; }
.sh-body .item-bar { z-index: 3; }
/* Report toolbar: every role sees the title; the bar wraps onto more rows instead of hiding controls. */
.item-bar { flex-wrap: wrap; height: auto; min-height: 52px; column-gap: 12px; }
.item-bar > .ib-title { flex: 0 1 auto; min-width: 0; max-width: min(100%, 40ch); font-size: 15px; }
.item-bar .ib-left { height: 52px; }
.item-bar .ib-right { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; padding: 6px 0; }
.sh-stagebox:focus { outline: none; }
.sh-stagebox:focus-visible { outline: 2px solid var(--fjord); outline-offset: -2px; }
@media (max-width: 1023px), (hover: none) { .btn.cm-mode kbd { display: none; } }
/* Wide: with tabs, the breadcrumb right above already names the report, so tabs and actions keep one row. */
@media (min-width: 861px) { .item-bar:has(.ib-tab) > .ib-title { display: none; } }
/* Narrow: title and icon-only actions (each has an aria-label) share a row, tabs get the row below, 44px targets. */
@media (max-width: 860px) {
  .item-bar { min-height: 48px; padding: 2px 8px 2px 12px; }
  .item-bar > .ib-title { flex: 1 1 0; min-width: min(100%, 12em); max-width: none; }
  .item-bar .ib-left { order: 1; flex: 1 0 100%; height: 44px; overflow-x: auto; scrollbar-width: none; }
  .item-bar .ib-left::-webkit-scrollbar { display: none; }
  .item-bar .ib-tab { flex: none; padding: 0 9px; }
  .item-bar .ib-tab .i { display: none; }
  .item-bar .ib-right { padding: 2px 0; }
  .item-bar .ib-right .btn { min-width: 44px; min-height: 44px; padding: 0 12px; }
  .item-bar .sh-dl-wrap { position: static; }
  .item-bar .sh-dl-menu { right: 8px; max-width: calc(100vw - 16px); }
  .sh-itemback { display: inline-flex; }
  /* Portal: the back link comes before the title, on the same row. */
  .sh-body .item-bar .ib-left { order: -1; flex: none; }
}
@media (max-width: 520px) { .sh-itemback { min-width: 44px; justify-content: center; } .sh-itemback span { display: none; } }
.sh-sharebar { flex: none; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 var(--gutter); background: var(--spruce); color: var(--bone); }
.sh-share-mark { flex: none; display: grid; }
.sh-sharebar .na-mark { width: 22px; height: 22px; color: var(--bone); }
.sh-share-prod { flex: none; padding-right: 12px; border-right: 1px solid rgba(244, 241, 232, .28); font-size: 13.5px; font-weight: 650; letter-spacing: .01em; }
.sh-share-prod:last-child { padding-right: 0; border-right: 0; }
.sh-share-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 550; }
.sh-sharebar .badge { flex: none; background: rgba(244, 241, 232, .14); color: var(--bone); box-shadow: none; border-color: transparent; }
@media (max-width: 860px) { .sh-sharebar { height: 44px; } }
@media (max-width: 520px) { .sh-sharebar .hide-sm { display: none; } }
.sh-who { max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-stage { position: relative; flex: 1; min-height: 0; background: var(--bone); }
.sh-stagebox { position: absolute; inset: 0; }
.sh-stagebox iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: var(--bone); opacity: 0; transition: opacity .18s ease; }
.sh-stagebox.ready iframe { opacity: 1; }
.sh-loader { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--ink-2); font-size: 13.5px; pointer-events: none; transition: opacity .18s ease; }
.sh-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--espresso); animation: sh-spin .8s linear infinite; }
.sh-stagebox.ready .sh-loader { opacity: 0; }
@keyframes sh-spin { to { transform: rotate(360deg); } }
.sh-revoked { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 24px var(--gutter); background: var(--bone); overflow: auto; }
.sh-revoked[hidden] { display: none; }
.sh-revoked .ui-empty { max-width: 520px; }

.sh-backdrop { display: none; position: fixed; inset: 0; z-index: 50; align-items: center; justify-content: center; padding: 16px; background: rgba(43, 33, 28, .45); }
.sh-backdrop.open { display: flex; }
.sh-modal { width: min(600px, 100%); max-height: calc(100dvh - 32px); overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop); }
.sh-modal > * { min-width: 0; }
.sh-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sh-modal-head h2 { font: 600 20px/1.2 var(--display); letter-spacing: -.01em; }
.sh-sub { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; overflow-wrap: break-word; }
.sh-sec { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.sh-sec[hidden] { display: none; }
.sh-sec h3 { font-size: 14px; font-weight: 650; }
.sh-sec .sh-sub { margin: -4px 0 0; }
.sh-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sh-form > .sh-grow { flex: 1 1 200px; min-width: 0; width: auto; }
.sh-form > .sh-role { flex: 0 0 auto; width: auto; }
.sh-list { display: grid; gap: 8px; }
.sh-list:empty { display: none; }
.sh-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bone); font-size: 13px; overflow-wrap: anywhere; }
.sh-row > .btn { flex: none; }
/* Colleague picker and member rows */
.sh-pickform { display: grid; gap: 10px; }
.sh-pickform .sh-sub { margin: 0; }
.sh-pick { display: grid; gap: 6px; max-height: 248px; overflow-y: auto; overscroll-behavior: contain; min-width: 0; margin: 0; padding: 2px; border: 0; }
.sh-pick[hidden], .sh-pick-empty[hidden], .sh-pick-row[hidden] { display: none; }
.sh-pick-row { display: grid; grid-template-columns: 18px 1fr; column-gap: 10px; align-items: center; min-height: 52px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bone); cursor: pointer; }
.sh-pick-row input { grid-row: 1 / span 2; width: 16px; height: 16px; margin: 0; accent-color: var(--fjord); }
.sh-pick-row b { grid-column: 2; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.sh-pick-row small { grid-column: 2; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.sh-pick-row:hover { border-color: var(--line-2); background: var(--sand-soft); }
.sh-pick-row:has(:checked) { border-color: var(--fjord); background: var(--sand-soft); }
.sh-pick:disabled .sh-pick-row { opacity: .55; cursor: not-allowed; }
.sh-pick-empty { margin: 0; padding: 12px; border: 1px dashed var(--line-2); border-radius: var(--r-md); font-size: 13.5px; color: var(--ink-2); }
.sh-member { flex-wrap: wrap; }
.sh-who2 { flex: 1 1 180px; min-width: 0; display: grid; gap: 1px; }
.sh-who2 b { font-size: 14px; font-weight: 650; }
.sh-who2 small { font-size: 12.5px; color: var(--ink-2); }
.sh-role-tag { flex: none; font-size: 12.5px; color: var(--ink-2); }
@media (max-width: 860px) { .sh-member .btn, #trashRow .btn, #pauseBtn { min-height: 44px; } }
.sh-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sh-code { padding: 8px 12px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--sand-soft); font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.sh-code[hidden] { display: none; }
.sh-status { margin: 0; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.5; }
.sh-status[hidden] { display: none; }
.sh-status.err { background: var(--bad-t); color: var(--bad-ink); border-color: rgba(171, 66, 58, .4); }
.sh-status.ok { background: var(--ok-t); color: var(--ok-ink); border-color: rgba(73, 125, 18, .3); }
.sh-status.warn { display: grid; gap: 6px; justify-items: start; background: var(--risk-t); color: var(--risk-ink); border-color: rgba(163, 124, 17, .35); }
.sh-status.warn[hidden] { display: none; }
.sh-status.warn p, .sh-status.warn ul { margin: 0; }
.sh-status.warn ul { padding-left: 18px; }
.sh-notice-h { font-weight: 650; }
.sh-notice-hint { font-size: 13px; }
.sh-fcode { font: 11.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-2); }
.sh-locked { margin: 0; font-size: 13px; color: var(--ink-2); }
.sh-status[aria-busy="true"] .btn { pointer-events: none; }
@media (max-width: 520px) {
  .sh-body .ui-product, .sh-body .ui-top-right .av { display: none; }
  .sh-modal { padding: 18px; }
  .sh-form > .btn, .sh-form > .sh-role { flex: 1 1 100%; }
  .sh-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .sh-stagebox iframe, .sh-loader { transition: none; } .sh-spin { animation: none; } }


/* shell.ts: owner Download menu (reuses .menu / .menu-item from ui.ts). */
.sh-dl-wrap { position: relative; }
.sh-dl-menu { position: absolute; right: 0; top: calc(100% + 4px); min-width: 260px; }
.sh-dl-menu .menu-item { min-height: 44px; }
.sh-dl-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sh-dl-txt b { font-weight: 600; }
.sh-dl-txt small { font-size: 12px; color: var(--ink-2); }
html.focus-mode .sh-dl-menu { display: none !important; }
/* shell.ts: full screen. html.focus-mode hides every piece of chrome; the report fills the viewport. */
.sh-focus-exit { display: none; }
.sh-sharebar .btn { background: rgba(244, 241, 232, .14); color: var(--bone); box-shadow: none; flex: none; }
.sh-sharebar .btn:hover { background: rgba(244, 241, 232, .24); }
html.focus-mode .side, html.focus-mode .ui-top, html.focus-mode .item-bar, html.focus-mode .sh-sharebar, html.focus-mode .scrim { display: none !important; }
html.focus-mode .app { display: block; height: 100vh; height: 100dvh; }
html.focus-mode .app .canvas, html.focus-mode .app.side-collapsed .canvas { margin: 0 !important; height: 100vh; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; transition: none; }
html.focus-mode .sh-focus-exit { position: fixed; right: 12px; bottom: 12px; z-index: 70; display: inline-flex; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 22px; opacity: .55; box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-pop); transition: opacity .16s var(--ease); }
html.focus-mode .sh-focus-exit .i { color: var(--ink); }
html.focus-mode .sh-focus-exit:hover, html.focus-mode .sh-focus-exit:focus-visible { opacity: 1; border-radius: 22px; }
html.focus-mode body.cm-open .sh-focus-exit { right: 372px; }
@media (max-width: 767px) { html.focus-mode body.cm-open .sh-focus-exit { right: auto; left: 12px; } }
@media (max-width: 520px) { .sh-focus-exit .lbl { display: none; } html.focus-mode .sh-focus-exit { padding: 0; width: 44px; } }
@media (max-width: 860px) { .sh-sharebar .btn .lbl { display: none; } }

/* portal.ts: Insight customer pages */
.ins-hint { margin-top: -6px; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.ins-first { display: grid; gap: 10px; margin-top: 4px; padding-top: 20px; border-top: 1px solid var(--line); }
.ins-first h2 { font: 600 16px/1.3 var(--display); }
.ins-first p { color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.ins-s0 { --c: var(--s0); } .ins-s1 { --c: var(--s1); } .ins-s2 { --c: var(--s2); } .ins-s3 { --c: var(--s3); } .ins-s4 { --c: var(--s4); --t: var(--a4); } .ins-s5 { --c: var(--s5); } .ins-s6 { --c: var(--s6); }
.ins-tile { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--t, var(--c)); color: var(--bone); }
.ins-tile .i { width: 19px; height: 19px; }
.ins-tile-lg { width: 56px; height: 56px; border-radius: 14px; }
.ins-tile-lg .i { width: 26px; height: 26px; }
.ins-tile-sm { width: 26px; height: 26px; border-radius: 7px; }
.ins-tile-sm .i { width: 14px; height: 14px; }
.ins-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.ins-stat { display: grid; gap: 2px; min-width: 0; padding: 14px 16px 14px; background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.ins-stat-v { font: 650 24px/1.15 var(--display); letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.ins-stat-l { font: var(--label); letter-spacing: var(--label-ls); text-transform: uppercase; color: var(--ink-3); }
.ins-stat-h { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-stats.ins-stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ins-feature { display: flex; align-items: center; gap: 18px; margin-bottom: 32px; padding: 20px 22px; background: color-mix(in srgb, var(--c) 7%, var(--paper)); border: 1px solid color-mix(in srgb, var(--c) 28%, var(--line)); border-radius: var(--r-lg); }
.ins-feature-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.ins-feature-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ins-latest { font: var(--label); letter-spacing: var(--label-ls); text-transform: uppercase; color: var(--ink-3); }
.ins-feature h2 { font: 650 22px/1.2 var(--display); letter-spacing: -.012em; overflow-wrap: anywhere; }
.ins-feature-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; }
.ins-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.ins-meta .av { width: 18px; height: 18px; font-size: 8px; }
.ins-group { margin-bottom: 28px; }
.ins-group-h { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 650 16px/1.3 var(--display); }
.ins-group-h .count { font-size: 12.5px; }
.ins-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.ins-card { height: 100%; display: grid; align-content: start; gap: 6px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); color: inherit; text-decoration: none; transition: border-color .12s, box-shadow .12s; }
.ins-card:hover { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); box-shadow: var(--shadow); }
.ins-card:focus-visible { border-radius: var(--r-lg); }
.ins-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; min-width: 0; }
.ins-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); min-height: 28px; }
.ins-card-foot .ins-open { margin-left: auto; }
.ins-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ins-t { font-weight: 650; font-size: 15px; line-height: 1.3; letter-spacing: -.003em; color: var(--ink); overflow-wrap: anywhere; }
.ins-open { display: inline-flex; align-items: center; gap: 2px; font-size: 13.5px; font-weight: 550; color: var(--fjord); }
.ins-open .i { width: 16px; height: 16px; transition: transform .15s var(--ease); }
.ins-card:hover .ins-open .i { transform: translateX(2px); }
.ins-who { max-width: 20ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-foot { margin: 0; font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 860px) { .ins-stats, .ins-stats.ins-stats-2 { grid-template-columns: 1fr; } .ins-stat { grid-template-columns: auto 1fr; align-items: baseline; column-gap: 12px; } .ins-stat-h { grid-column: 1 / -1; } }
@media (max-width: 520px) { .ins-stat:nth-child(3) { display: none; } .ins-feature { flex-direction: column; align-items: flex-start; } .ins-feature .btn { width: 100%; } .ins-open span { display: none; } }
@media (prefers-reduced-motion: reduce) { .ins-open .i { transition: none; } .ins-card:hover .ins-open .i { transform: none; } }

/* ---------- Versions dialog, compare view ---------- */
.sh-vpill { display: inline-flex; align-items: center; gap: 3px; height: 18px; margin-left: 6px; padding: 0 7px; border-radius: 9px; background: var(--a4); color: var(--paper); font-size: 11.5px; font-weight: 650; line-height: 1; white-space: nowrap; }
.sh-vpill[hidden] { display: none; }
@media (max-width: 860px) { .sh-vpill-w { display: none; } .sh-vpill { margin-left: 4px; } }
.sh-vmodal { width: min(680px, 100%); }
.sh-status.note { background: rgba(171, 101, 0, .10); color: var(--ink); border-color: rgba(138, 83, 0, .4); }
.sh-wait { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 10px 14px; border: 1px solid rgba(138, 83, 0, .4); border-left: 4px solid var(--a4); border-radius: var(--r-md); background: rgba(171, 101, 0, .10); }
.sh-wait[hidden] { display: none; }
.sh-wait-t { display: grid; gap: 2px; min-width: 0; }
.sh-wait-t b::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--a4); }
.sh-wait-t b { font-size: 14.5px; font-weight: 650; overflow-wrap: anywhere; }
.sh-wait-k { display: inline-flex; align-items: center; gap: 7px; color: var(--a4); font-size: 12.5px; font-weight: 650; }
.sh-wait-k::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--a4); }
.sh-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sh-acts[hidden] { display: none; }
.sh-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; flex: 1 1 100%; justify-content: flex-end; }
.sh-confirm-q { flex: 1 1 220px; font-size: 13.5px; font-weight: 550; }
.sh-vlist { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sh-vlist:empty { display: none; }
.sh-v { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bone); }
.sh-v.is-live { background: var(--paper); border-color: rgba(31, 58, 46, .35); }
.sh-v.is-waiting { border-color: rgba(138, 83, 0, .4); }
.sh-v.is-draft { border-style: dashed; border-color: var(--field-line); }
.sh-v-main { min-width: 0; display: grid; gap: 2px; }
.sh-v-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sh-v-head b { font-size: 14.5px; font-weight: 650; }
.sh-v-meta { margin: 0; color: var(--ink-2); font-size: 12.5px; overflow-wrap: anywhere; }
.sh-v-meta code { color: var(--ink-3); font: 12px var(--mono); }
.sh-pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--bone); color: var(--ink-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.sh-shape { width: 8px; height: 8px; flex: none; display: inline-block; border: 1.5px solid currentColor; border-radius: 50%; }
.sh-pill.live { background: var(--spruce-90); border-color: rgba(31, 58, 46, .3); color: var(--spruce); }
.sh-pill.live .sh-shape, .sh-pill.added .sh-shape { background: currentColor; }
.sh-pill.waiting, .sh-pill.changed { background: rgba(171, 101, 0, .12); border-color: rgba(138, 83, 0, .4); color: var(--a4); }
.sh-pill.waiting .sh-shape, .sh-pill.changed .sh-shape { width: 0; height: 0; border: 0; border-radius: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid currentColor; }
.sh-pill.added { background: rgba(48, 90, 71, .12); border-color: rgba(48, 90, 71, .35); color: var(--spruce); }
.sh-pill.removed { background: rgba(99, 39, 34, .10); border-color: rgba(99, 39, 34, .35); color: var(--falu); }
.sh-pill.removed .sh-shape { width: 8px; height: 8px; border-radius: 1px; background: currentColor; }
.sh-pill.draft .sh-shape { border-style: dashed; }
.sh-pill.draft { border-style: dashed; }
.sh-quiet { padding-top: 12px; }
.sh-quiet .sh-row { background: transparent; border-style: dashed; color: var(--ink-2); }
.sh-drop { position: relative; border: 1.5px dashed var(--field-line); border-radius: var(--r-lg); background: var(--bone); transition: background .15s var(--ease), border-color .15s var(--ease); }
.sh-drop:hover, .sh-drop.is-over { background: var(--sel); border-color: var(--fjord); }
.sh-drop.has-file { border-style: solid; border-color: var(--spruce); background: var(--spruce-90); }
.sh-drop:focus-within { outline: 2px solid var(--fjord); outline-offset: 2px; }
.sh-file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.sh-drop-l { display: grid; justify-items: center; gap: 4px; padding: 20px 16px; text-align: center; pointer-events: none; }
.sh-drop-l .i { width: 20px; height: 20px; color: var(--clay); }
.sh-drop-l b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.sh-drop-err { position: relative; margin: 0; padding: 8px 14px 12px; color: var(--bad-ink); font-size: 13px; font-weight: 600; text-align: center; pointer-events: none; }
.sh-drop-err[hidden] { display: none; }
.sh-check { display: flex; min-height: 44px; padding: 0 4px; }
.sh-check input { width: 20px; height: 20px; }
.sh-drop-l small { color: var(--ink-2); font-size: 12.5px; }

/* Compare: a full-screen dialog over the report */
.sh-cmp-bd { z-index: 60; padding: 0; background: rgba(43, 33, 28, .5); }
.sh-cmp { display: flex; flex-direction: column; width: 100%; height: 100%; background: var(--paper); }
.sh-cmp-top { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 12px var(--gutter, 20px); border-bottom: 1px solid var(--line); }
.sh-cmp-top h2 { flex: 1 1 280px; min-width: 0; font: 600 17px/1.3 var(--display); letter-spacing: -.01em; overflow-wrap: anywhere; }
@media (max-width: 720px) { .sh-cmp-top h2 { flex: 1 1 0; order: 1; font-size: 15.5px; } #closeCompareBtn { order: 2; width: 44px; padding: 0; justify-content: center; } #closeCompareBtn .lbl { display: none; } .sh-cmp-top .sh-seg { order: 3; flex: 1 1 100%; } .sh-cmp-top .sh-seg button { flex: 1 1 0; } }
.sh-seg { display: inline-flex; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--bone); }
.sh-seg[hidden] { display: none; }
.sh-seg button { min-height: 32px; padding: 0 12px; border-radius: 6px; color: var(--ink-2); font-size: 13.5px; font-weight: 550; cursor: pointer; }
.sh-seg button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line-2); }
.sh-seg button:focus-visible, .sh-pane-b:focus-visible { outline: 2px solid var(--fjord); outline-offset: 2px; }
#cmpStatus { flex: none; margin: 10px var(--gutter, 20px) 0; }
.sh-cmp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sh-cmp-view { flex: 1; min-height: 0; overflow: auto; padding: 16px var(--gutter, 20px); display: flex; flex-direction: column; gap: 12px; }
.sh-cmp-view[hidden] { display: none; }
#cmpSide { overflow: hidden; }
.sh-cmp-tools { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sh-pane-toggle { display: none; }
.sh-frames { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.sh-frames.single { grid-template-columns: minmax(0, 1fr); }
.sh-frame { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line-2); border-radius: var(--r-md); overflow: hidden; background: var(--bone); }
.sh-frame h3 { flex: none; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--paper); font-size: 13.5px; font-weight: 650; }
.sh-frame iframe { flex: 1; min-height: 0; width: 100%; border: 0; background: #fff; }
.sh-cmp-foot { flex: none; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px var(--gutter, 20px); border-top: 1px solid var(--line); background: var(--paper); }
.sh-cmp-foot .sh-acts { justify-content: flex-end; }
.sh-cmp-foot .btn[hidden] { display: none; }
@media (max-width: 720px) {
  .sh-pane-toggle { display: inline-flex; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--bone); }
  .sh-pane-b { min-height: 44px; padding: 0 12px; border-radius: 6px; color: var(--ink-2); font-size: 13.5px; font-weight: 550; }
  .sh-pane-b[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2); }
  .sh-cmp-tools { flex-wrap: wrap; }
  .sh-frames { grid-template-columns: minmax(0, 1fr); }
  .sh-frames[data-pane="a"] .sh-frame[data-side="b"], .sh-frames[data-pane="b"] .sh-frame[data-side="a"] { display: none; }
  .sh-seg { width: 100%; }
  .sh-seg button { flex: 1; min-height: 44px; padding: 0 6px; }
  .sh-sync { display: none; }
  .sh-cmp-foot .btn, .sh-v .btn, .sh-wait .btn, .sh-confirm .btn { min-height: 44px; }
  .sh-cmp-top .btn { min-height: 44px; }
  .sh-acts, .sh-cmp-foot .sh-acts { width: 100%; }
  .sh-v .sh-acts .btn, .sh-wait .sh-acts .btn { flex: 1 1 auto; justify-content: center; }
  .sh-v .sh-acts .btn.ghost { border: 1px solid var(--line-2); }
}
@media (max-width: 860px) {
  .sh-v .btn, .sh-wait .btn, .sh-confirm .btn, .sh-vmodal .sh-sec .btn { min-height: 40px; }
  .sh-v .sh-acts { width: 100%; }
}
.sh-cmp-h { margin: 6px 0 0; color: var(--ink-3); font: var(--label); letter-spacing: var(--label-ls); text-transform: uppercase; }
.sh-chg { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bone); }
.sh-chg-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sh-chg-top h4 { min-width: 0; font-size: 14.5px; font-weight: 650; overflow-wrap: anywhere; }
.sh-chg-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.sh-chg-col { min-width: 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line); }
.sh-chg-col p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.sh-chg-k { color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.sh-struct { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sh-struct li { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bone); font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.sh-struct-compat { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.sh-struct-compat small { flex: 1 1 100%; color: var(--ink-2); font-size: 12.5px; }
.sh-text-sum { font-size: 14px; font-weight: 600; }
.sh-hunk { border: 1px solid var(--line-2); border-radius: var(--r-md); overflow: hidden; background: var(--paper); font-size: 12.5px; line-height: 1.6; }
.sh-ln { display: flex; gap: 8px; padding: 1px 12px; }
.sh-ln.add { background: rgba(48, 90, 71, .14); }
.sh-ln.del { background: rgba(99, 39, 34, .10); }
.sh-ln.ctx { color: var(--ink-3); }
.sh-sign { flex: none; width: 1ch; font-weight: 700; }
.sh-ln.add .sh-sign { color: var(--spruce); }
.sh-ln.del .sh-sign { color: var(--falu); }
.sh-lt, .sh-sign { font-family: var(--mono); }
.sh-lt { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .sh-drop { transition: none; } }

/* comments-shell.ts: workspace, item bar controls, docked panel, popover composer */
.cm-ws { position: absolute; inset: 0; display: flex; min-width: 0; min-height: 0; }
.cm-stage { position: relative; flex: 1; min-width: 0; min-height: 0; }
.cm-float { position: absolute; inset: 0; z-index: 4; overflow: hidden; pointer-events: none; }
.cm-float > * { pointer-events: auto; }
.cm-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--sand-soft); font-size: 12px; font-weight: 650; display: inline-grid; place-items: center; }
.btn.cm-toggle[aria-pressed="true"], .btn.cm-mode[aria-pressed="true"], .btn.cm-mode-sm[aria-pressed="true"] { background: var(--espresso); color: var(--bone); box-shadow: none; }
.btn[aria-pressed="true"] .cm-count { background: rgba(244, 241, 232, .18); }
.btn.cm-mode[aria-pressed="true"] kbd { color: #d1d0c7; border-color: rgba(244, 241, 232, .28); }
.cm-mode-sm { display: none; }
.cm-spark { flex: none; width: 12px; height: 12px; fill: currentColor; }
.cm-modebar { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 20px; background: var(--fjord); color: var(--bone); font-size: 13px; font-weight: 550; box-shadow: var(--shadow-pop); white-space: nowrap; }
.cm-modebar .btn { height: 28px; border-radius: 14px; background: rgba(244, 241, 232, .14); color: var(--bone); box-shadow: none; }
.cm-modebar kbd { color: #d1d0c7; background: transparent; border-color: rgba(244, 241, 232, .3); }

.cm-panel { flex: none; width: 360px; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--paper); }
.cm-panel[hidden] { display: none; }
.cm-panel-h { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--line); }
.cm-panel-h h2 { font: 600 17px/1.2 var(--display); }
.cm-panel-h h2:focus { outline: none; }
.cm-panel-actions { display: flex; align-items: center; gap: 8px; }
.cm-panel-actions:empty { display: none; }
.btn.cm-send { gap: 6px; background: var(--spruce); color: var(--bone); box-shadow: none; }
.btn.cm-send:hover { background: color-mix(in srgb, var(--spruce) 86%, black); }
.btn.cm-send .cm-count { background: rgba(244, 241, 232, .18); }
.btn.cm-send[aria-disabled="true"] { background: var(--sand-soft); color: var(--ink-3); cursor: default; }
.btn.cm-send[aria-disabled="true"] .cm-count { background: var(--paper); }
.cm-round { flex: none; display: grid; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--spruce) 8%, var(--paper)); font-size: 13.5px; line-height: 1.5; }
.cm-round[hidden] { display: none; }
.cm-round[data-state="accepted"], .cm-round[data-state="rejected"], .cm-round[data-state="hint"] { padding: 8px 10px 8px 14px; background: var(--paper); }
.cm-round p { margin: 0; }
.cm-round-h { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--spruce); }
.cm-round-h .cm-spark { width: 12px; height: 12px; }
.cm-round-sum { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9em; overflow: auto; }
.cm-prompt { display: flex; gap: 8px; align-items: center; }
.cm-prompt-t { flex: 1; min-width: 0; min-height: 32px; height: 32px; padding: 0 8px; resize: none; font: 12px/1 var(--mono); color: var(--ink-2); text-overflow: ellipsis; }
.cm-round-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cm-confirm { flex-basis: 100%; font-weight: 600; }
.cm-round-res { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-2); }
.cm-round-res > span:not(.cm-sp) { min-width: 0; }
.cm-round-res .cm-spark { color: var(--spruce); }
.cm-hint { color: var(--ink-2); }
.cm-round-tag { font-size: 12px; color: var(--ink-2); }
.cm-panel-b { flex: 1; overflow: auto; padding: 12px; display: grid; align-content: start; gap: 10px; overscroll-behavior: contain; }
.cm-sp { flex: 1; }
.cm-ib { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r-md); color: var(--ink-2); }
.cm-ib:hover { background: var(--hover); color: var(--ink); }
.cm-ib .i { width: 16px; height: 16px; }
.cm-error { padding: 8px 10px; border-radius: var(--r-md); background: var(--bad-t); color: var(--bad-ink); font-size: 13px; }
.cm-empty { padding: 28px 12px; text-align: center; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.cm-empty b { display: block; margin-bottom: 4px; color: var(--ink); font-size: 14.5px; }

.cm-card { padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow-1); display: grid; gap: 10px; font-size: 13.5px; line-height: 1.5; transition: border-color .12s, box-shadow .12s; }
.cm-card[data-thread] { cursor: pointer; }
.cm-card.on { cursor: default; border-color: var(--fjord); box-shadow: 0 0 0 1px var(--fjord), var(--shadow); }
.cm-card:hover { border-color: var(--line-2); }
.cm-card.on:hover { border-color: var(--fjord); }
.cm-card.draft { border-color: var(--fjord); box-shadow: 0 0 0 3px rgba(51, 70, 90, .14); }
.cm-card.resolved { opacity: .78; }
.cm-th-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cm-n { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px 12px 12px 3px; background: var(--espresso); color: var(--bone); font-size: 11.5px; font-weight: 700; }
.cm-n.agent { background: var(--spruce); }
.cm-n .cm-spark { width: 10px; height: 10px; }
.cm-n.outdated { background: var(--paper); color: var(--risk-ink); box-shadow: inset 0 0 0 2px var(--risk); }
.cm-n.moved { background: var(--paper); color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--stone); }
.cm-anchor { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12px/1.4 var(--mono); color: var(--ink-2); }
.cm-th-head .badge { flex: none; height: 20px; font-size: 12px; }
.cm-intent { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.cm-tag-agent { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 11px; background: var(--spruce-90); color: var(--spruce); border: 1px solid rgba(31, 58, 46, .22); font-size: 12px; font-weight: 600; }
.cm-tag-agent .cm-spark { width: 9px; height: 9px; }
.cm-link { color: var(--fjord); font-weight: 600; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; }
.cm-link:hover { color: var(--ink); }
.cm-note { font-size: 12.5px; padding: 6px 10px; border-radius: var(--r-md); background: var(--risk-t); color: var(--risk-ink); overflow-wrap: anywhere; }
.cm-note.moved { background: var(--bone); color: var(--ink-2); border: 1px dashed var(--stone); }
.cm-msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cm-msg { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 2px 8px; }
.cm-msg > .av { grid-row: span 3; }
.cm-who { display: flex; gap: 6px; align-items: baseline; min-width: 0; font-size: 12.5px; font-weight: 650; }
.cm-who > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-who time, .cm-who .cm-ag, .cm-edited { flex: none; }
.cm-who time, .cm-edited { font-weight: 450; color: var(--ink-3); }
.cm-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-msgs.peek .cm-body { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cm-msg.agent { padding: 10px; margin: 0 -4px; border-radius: var(--r-md); background: color-mix(in srgb, var(--spruce) 10%, var(--paper)); box-shadow: inset 3px 0 0 var(--spruce); }
.cm-msg.agent > .av { background: var(--spruce); }
.cm-msg.agent > .av .cm-spark { width: 11px; height: 11px; color: var(--bone); }
.cm-msg.agent .cm-who { color: var(--spruce); }
.cm-ag { font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--spruce); opacity: .8; }
.cm-acts { display: flex; gap: 12px; }
.cm-acts button { font-size: 12px; color: var(--ink-3); font-weight: 550; }
.cm-acts button:hover { color: var(--ink); text-decoration: underline; }
.cm-more { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.cm-reply, .cm-compose, .cm-edit { display: grid; gap: 8px; }
.cm-ta { width: 100%; min-height: 40px; max-height: 200px; resize: vertical; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--paper); color: var(--ink); font: 400 13.5px/1.45 var(--font); }
.cm-ta:focus { outline: none; border-color: var(--fjord); box-shadow: 0 0 0 3px rgba(51, 70, 90, .14); }
.cm-compose .cm-ta { min-height: 76px; }
.cm-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cm-seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--sand-soft); }
.cm-seg button { height: 28px; padding: 0 9px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.cm-seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1); }
.cm-seg button[data-intent="agent"][aria-pressed="true"] { color: var(--spruce); }
.cm-ctx { display: flex; gap: 6px; align-items: center; min-width: 0; margin: -4px -4px 0 0; font-size: 12.5px; color: var(--ink-2); }
.cm-ctx code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.cm-pop { position: absolute; left: 0; top: 0; width: 360px; max-width: calc(100% - 16px); max-height: calc(100% - 16px); overflow: auto; padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.cm-sec { display: grid; gap: 10px; }
.cm-sec-h { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 2px 2px; font: var(--label); letter-spacing: var(--label-ls); text-transform: uppercase; color: var(--ink-3); }
.cm-sec-h .i { width: 14px; height: 14px; transition: transform .15s; }
.cm-sec-h[aria-expanded="false"] .i { transform: rotate(-90deg); }
@media (max-width: 767px) {
  .cm-ws { flex-direction: column; }
  .cm-stage { min-height: 30%; }
  .cm-panel { width: auto; height: 55%; border-left: 0; border-top: 1px solid var(--line); }
  .btn.cm-mode { display: none; }
  .btn.cm-mode-sm { display: inline-flex; }
  .cm-send-l { display: none; }
  .cm-prompt-t { font-size: 16px; }
  .cm-modebar { font-size: 12.5px; }
  .cm-modebar kbd { display: none; }
  .cm-ta { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .cm-card, .cm-sec-h .i { transition: none; } }

/* auth.ts (sign-in page) */
.acc-or { display: flex; align-items: center; gap: 12px; margin: 4px 0 0; font-size: 12.5px; font-weight: 550; color: var(--ink-3); }
.acc-or::before, .acc-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.acc-dev { display: grid; gap: 14px; }
.acc-dev .alert { padding: 8px 12px; font-size: 12.5px; }
.acc-quiet { justify-self: center; display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-size: 13px; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--stone); text-underline-offset: 3px; border-radius: 3px; }
.acc-quiet:hover { color: var(--ink); text-decoration-color: currentColor; }
#err.alert { margin: 0; }

/* admin.ts (/access admin) */
.acc-note { margin: 6px 8px; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.acc-detail { display: grid; gap: 4px; min-width: 0; }
#status { margin-bottom: 16px; }
#status .acc-msg { overflow-wrap: anywhere; }
.acc-report { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.acc-report h2 { font: 650 20px/1.25 var(--display); letter-spacing: -.01em; overflow-wrap: anywhere; min-width: 0; }
.acc-detail > .alert { margin-top: 14px; }
.acc-sec { display: grid; gap: 12px; margin-top: 32px; min-width: 0; }
.acc-sec .ui-section-h { margin-bottom: 0; }
.acc-sec .ui-section-h h2 { font-size: 16px; }
.acc-hint { margin: -6px 0 0; max-width: 62ch; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.acc-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 16px 20px; }
.acc-form .field { flex: 1 1 240px; min-width: 0; }
.acc-form .field.acc-days { flex: 0 0 140px; }
.acc-form .btn { flex: none; }
.acc-block { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--risk-t); font-size: 13.5px; line-height: 1.5; color: var(--risk-ink); }
.acc-block[hidden] { display: none; }
.acc-block > span:nth-child(2) { flex: 1 1 240px; min-width: 0; }
.acc-block .btn { color: var(--ink); }
@media (max-width: 860px) { .acc-block .btn { min-height: 44px; } }
.acc-none { margin: 0; padding: 18px 20px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); background: var(--paper); font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
#customers .ui-table, #invites .ui-table { table-layout: fixed; }
#customers th:nth-child(1), #invites th:nth-child(1) { width: 40%; }
#customers th:nth-child(2), #invites th:nth-child(2) { width: 22%; }
#customers th:nth-child(3), #invites th:nth-child(3) { width: 16%; }
.acc-confirm { display: grid; gap: 8px; justify-items: end; text-align: right; white-space: normal; }
.acc-confirm .acc-q { max-width: 34ch; font-size: 13px; line-height: 1.4; color: var(--ink); }
.acc-confirm-btns { display: flex; gap: 6px; }
.ui-table td.acts .btn { margin-left: 0; }
.ui-table td.acts { vertical-align: middle; }
.acc-qr { display: grid; gap: 14px; padding: 16px 20px; }
.acc-qr-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.acc-qr-h .acc-sub { margin: 0; }
.acc-qr-h .badge { font-variant-numeric: tabular-nums; }
.acc-qr-body { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
/* The SVG carries a 2-module border; the white padding widens the quiet zone so it scans on any background. */
.acc-qr-code { flex: none; width: min(320px, 100%); padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.acc-qr-code svg { display: block; width: 100%; height: auto; }
.acc-qr-code.is-closed svg { opacity: .12; }
.acc-qr-side { flex: 1 1 280px; min-width: 0; display: grid; gap: 12px; align-content: start; }
.acc-qr-side .acc-hint { margin: 0; }
.acc-qr-url { margin: 0; overflow-wrap: anywhere; }
.acc-qr-url code { user-select: all; }
.acc-qr-acts { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .acc-form { padding: 14px 16px; }
  .acc-form .field, .acc-form .field.acc-days { flex: 1 1 100%; }
  .acc-form .btn { width: 100%; }
}
@media (max-width: 520px) {
  #customers .ui-table, #invites .ui-table { table-layout: auto; }
  .ui-table td.acts .acc-confirm { justify-items: start; text-align: left; width: 100%; }
  .acc-confirm .acc-q { max-width: none; }
}

/* Insights */
.acc-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.acc-tile { display: grid; gap: 4px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.acc-tile-l { color: var(--ink-2); }
.acc-tile-v { font: 650 22px/1.2 var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.acc-tile:last-child .acc-tile-v { font-size: 16px; line-height: 1.5; }
.acc-chart-card { margin-top: 12px; padding: 16px 20px; display: grid; gap: 10px; }
.acc-chart-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; }
.acc-chart-h .muted { font-size: 12.5px; }
.acc-chart svg { display: block; width: 100%; height: 64px; }
.acc-bar { fill: var(--spruce); stroke: var(--paper); stroke-width: 1; vector-effect: non-scaling-stroke; }
.acc-bar-team { fill: var(--s3); }
.acc-bar-insight { fill: var(--s2); }
.acc-bar-share { fill: var(--a4); }
.acc-bar:hover { opacity: .85; }
.acc-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; padding: 0; list-style: none; font-size: 12.5px; color: var(--ink-2); }
.acc-legend li { display: inline-flex; align-items: center; gap: 6px; }
.acc-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--s0); flex: none; }
.acc-sw-team { background: var(--s3); }
.acc-sw-insight { background: var(--s2); }
.acc-sw-share { background: var(--a4); }
.acc-chan-h { display: inline-flex; align-items: center; gap: 8px; }
.acc-grid { stroke: var(--ink); stroke-opacity: .15; stroke-width: 1; vector-effect: non-scaling-stroke; }
.acc-ymax { display: block; margin-bottom: 4px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.acc-take { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.acc-base { stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.acc-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.acc-chans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.acc-chan { display: grid; justify-items: start; gap: 6px; padding: 12px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
.acc-chan-n { font: 650 18px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.acc-chan-s { font-size: 12.5px; color: var(--ink-2); }
.acc-sub { margin: 20px 0 10px; font-size: 14.5px; font-weight: 650; }
#insightsBody .ui-empty { padding: 36px 20px; }
.acc-skel { display: block; height: 66px; border-radius: var(--r-lg); background: var(--sand-soft); animation: acc-pulse 1.4s ease-in-out infinite; }
.acc-skel-chart { height: 120px; margin-top: 12px; }
@keyframes acc-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .acc-skel { animation: none; } }
@media (max-width: 860px) { .acc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .acc-chans { grid-template-columns: 1fr; } }
.acc-grp { margin: 10px 8px 2px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.acc-grp:first-child { margin-top: 2px; }

/* claude-access.ts (/settings/claude-access) */
.acc-levels-form { display: grid; gap: 12px; max-width: 820px; min-width: 0; }
.acc-levels { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.acc-level { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-lg); cursor: pointer; }
.acc-level input { width: 16px; height: 16px; margin: 3px 0 0; }
.acc-level:has(input:checked) { border-color: var(--spruce); background: var(--spruce-90); }
.acc-level:has(input:focus-visible) { outline: 2px solid var(--fjord); outline-offset: 2px; }
.acc-level:has(input:disabled) { cursor: default; opacity: .7; }
.acc-level-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14.5px; }
.acc-level-t b { font-weight: 650; }
.acc-level-d { grid-column: 2; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); max-width: 72ch; }
.acc-levels-form .acc-hint { margin: 0; }
.acc-human { color: var(--ink); }
.acc-save { display: flex; gap: 12px; align-items: center; }
.acc-steps { display: grid; gap: 12px; max-width: 820px; margin: 0; padding: 0; list-style: none; }
.acc-step { display: grid; gap: 8px; padding: 16px 20px; min-width: 0; }
.acc-step h3 { margin: 0; font-size: 15px; font-weight: 650; }
.acc-step p { margin: 0; max-width: 72ch; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.acc-step ol { display: grid; gap: 8px; margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.acc-step ol > li { min-width: 0; overflow-wrap: anywhere; }
.acc-cmd { display: flex; align-items: center; gap: 8px; margin-top: 6px; min-width: 0; }
.acc-cmd code { flex: 1 1 auto; min-width: 0; padding: 7px 10px; overflow-x: auto; white-space: nowrap; overflow-wrap: normal; }
.acc-cmd .btn { flex: none; }
@media (max-width: 520px) {
  .acc-step { padding: 14px 16px; }
  .acc-cmd { flex-wrap: wrap; }
  .acc-cmd code { flex-basis: 100%; }
}

/* portal.ts and report-pass.ts (portal and report-pass pages) */

/* ---------- Share (report-pass.ts, view host) ---------- */
.ext-share { gap: 18px; }
.ext-brand { display: flex; align-items: center; gap: 14px; }
.ext-brand .ui-auth-lock { width: 168px; }
.ext-product { padding-left: 14px; border-left: 1px solid var(--line-2); font-size: 13.5px; font-weight: 650; letter-spacing: .01em; color: var(--ink-2); line-height: 24px; }
.ext-share .ui-auth-card { gap: 16px; }
.ext-share .ui-auth-card h1 { font-size: 26px; overflow-wrap: anywhere; }
.ext-eyebrow { margin: 0; font: var(--label); letter-spacing: var(--label-ls); text-transform: uppercase; color: var(--ink-3); }
.ext-share .lede { margin: 0; }
.ext-share .lede b { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.ext-step { display: grid; gap: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.ext-stepper { margin: 0 0 -6px; font: var(--label); letter-spacing: var(--label-ls); text-transform: uppercase; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ext-step-h { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 700; font-family: var(--display); letter-spacing: -.01em; }
.ext-step-h:focus { outline: none; }
.ext-slot { display: grid; }
.ext-slot:empty { display: none; }
.ext-wrong { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); text-align: center; }
.ext-check { min-height: 65px; display: flex; justify-content: center; max-width: 100%; overflow: hidden; }
.ext-check:empty { display: none; }
.field .input.ext-code {
  min-height: 60px; padding: 8px 12px 8px calc(12px + .35em); text-align: center;
  font: 600 30px/1 var(--mono); letter-spacing: .35em; font-variant-numeric: tabular-nums; text-indent: 0;
}
.field .input.ext-code::placeholder { color: var(--warm); font-weight: 500; }
.ext-share .msg { margin: 0; }
.ext-share .btn { min-height: 44px; }
.ext-state-icon { width: 48px; height: 48px; }
.ext-state-icon .i { width: 22px; height: 22px; }
@media (max-width: 860px) {
  .ext-share .ui-auth-card h1 { font-size: 23px; }
  .field .input.ext-code { font-size: 28px; min-height: 56px; }
}
@media (max-width: 360px) {
  .field .input.ext-code { font-size: 24px; letter-spacing: .25em; }
}

/* ---------- Expired link page (report-pass.ts inactivePage) ---------- */
body.exp-body {
  --exp-card: #e4dac5; --exp-btn: #d8ccb2; --exp-btn-line: #c9beac; --exp-btn-h: #cfc2a6; --exp-btn-a: #c6b999;
  --exp-ease: ease-out; --stamp-delay: 1.75s; --stamp-dur: .5s; --land: calc(var(--stamp-delay) + var(--stamp-dur) * .55);
  margin: 0; min-height: 100vh; min-height: 100svh; background: var(--bone); color: var(--ink);
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.55; overflow-x: hidden; position: relative;
}
.exp-page {
  position: relative; z-index: 1; min-height: 100vh; min-height: 100svh; display: grid; align-content: center; gap: clamp(1.5rem, 5vh, 3rem);
  padding: max(1.5rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
  max-width: 78rem; margin: 0 auto;
}
.exp-brand { display: grid; gap: clamp(.9rem, 2.4vh, 1.5rem); justify-items: start; align-content: center; }
.exp-mark { width: clamp(5.5rem, 34vw, 13rem); height: auto; color: var(--espresso); overflow: visible; display: block; }
.exp-mark path, .exp-mark circle { fill: none; stroke: currentColor; stroke-width: 45.8; stroke-linecap: round; stroke-linejoin: round; }
.exp-mark path[stroke-linejoin="miter"] { stroke-linejoin: miter; stroke-miterlimit: 4; }
.exp-wordmark { width: clamp(9.5rem, 52vw, 19rem); height: auto; display: block; color: var(--espresso); opacity: 0; transform: translateY(8px); animation: exp-rise .5s var(--exp-ease) 1s forwards; }
.na-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: na-draw .4s ease-out forwards; }
.na-branch { stroke-dasharray: 1; stroke-dashoffset: 1; animation: na-draw .2s ease-out .4s forwards; }
.na-node { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.4); animation: na-node-in .2s ease-out forwards, na-node-pulse 7s ease-in-out infinite; }
.na-node:nth-of-type(1) { animation-delay: .6s, .8s; }
.na-node:nth-of-type(2) { animation-delay: .69s, .89s; }
.na-node:nth-of-type(3) { animation-delay: .78s, .98s; }
@keyframes na-draw { to { stroke-dashoffset: 0; } }
@keyframes na-node-in { to { opacity: 1; transform: scale(1); } }
@keyframes na-node-pulse { 0%, 82.8%, 100% { transform: scale(1); opacity: 1; } 8.6% { transform: scale(1.18); opacity: .86; } 17.1% { transform: scale(1); opacity: 1; } }
@keyframes exp-rise { to { opacity: 1; transform: none; } }

.exp-copy { max-width: 36rem; }
.exp-rv { opacity: 0; transform: translateY(16px); animation: exp-rise .5s var(--exp-ease) forwards; }
.exp-rv.a { animation-delay: 1.0s; } .exp-rv.b { animation-delay: 1.12s; } .exp-rv.c { animation-delay: 1.24s; } .exp-rv.d { animation-delay: 1.36s; }
.exp-copy h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(2.2rem, min(8vw, 10.5vh), 4.4rem); line-height: 1.02; letter-spacing: -.035em; text-wrap: balance; }
.exp-lede { margin: 1.1rem 0 0; color: var(--ink-2); max-width: 32rem; text-wrap: pretty; }
.exp-ref { margin-top: clamp(1.4rem, 4vh, 2.2rem); }
.exp-ref-label { margin: 0 0 .6rem; font-size: .8125rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.exp-ref-card { display: flex; align-items: stretch; background: var(--exp-card); color: var(--espresso); border-radius: 14px; width: max-content; max-width: 100%; overflow: hidden; }
.exp-ref-code {
  display: flex; align-items: center; gap: .08em; position: relative; padding: 1.55rem 1.8rem 1.35rem 1.75rem;
  font-weight: 650; font-size: clamp(1.3rem, 5.4vw, 2.2rem); line-height: 1; font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero", "ss01"; letter-spacing: 0; user-select: all; -webkit-user-select: all;
}
.exp-ref-code .ch { display: inline-block; width: .78em; text-align: center; }
.exp-ref-code .gap { display: inline-flex; align-items: center; justify-content: center; width: .42em; height: 2.5px; background: var(--falu); color: transparent; margin: 0 .16em; border-radius: 2px; align-self: center; overflow: hidden; }
.exp-copy-btn {
  appearance: none; border: 0; border-left: 1px solid var(--exp-btn-line); background: var(--exp-btn); color: var(--espresso);
  font: inherit; font-size: .9375rem; font-weight: 600; padding: 0 1rem; min-width: 0; min-height: 3.25rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; cursor: pointer; transition: background .2s ease-out;
}
.exp-copy-btn:hover { background: var(--exp-btn-h); }
.exp-copy-btn:active { background: var(--exp-btn-a); }
.exp-copy-btn:focus-visible { outline: 3px solid var(--espresso); outline-offset: -6px; border-radius: 0; }
.exp-copy-btn[disabled] { display: none; }
.exp-copy-btn svg { width: 1.15rem; height: 1.15rem; display: block; overflow: visible; }
.exp-icons { flex: none; }
.exp-copy-btn .ic-copy, .exp-copy-btn .ic-check { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.exp-copy-btn .ic-check { color: var(--espresso); opacity: 0; }
.exp-copy-btn .ic-check path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.exp-lbls { display: grid; }
.exp-lbls > span { grid-area: 1 / 1; text-align: left; }
.exp-lbl-done, .exp-lbl-sel { opacity: 0; color: var(--espresso); }
.exp-copy-btn.done .ic-copy, .exp-copy-btn.done .exp-lbl-copy, .exp-copy-btn.sel .exp-lbl-copy { opacity: 0; }
.exp-copy-btn.done .ic-check, .exp-copy-btn.done .exp-lbl-done, .exp-copy-btn.sel .exp-lbl-sel { opacity: 1; }
.exp-copy-btn.done .ic-check path { animation: exp-tick .35s ease-out both; }
@keyframes exp-tick { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.exp-hint { margin: .85rem 0 0; font-size: .9375rem; color: var(--ink-2); max-width: 30rem; text-wrap: pretty; }
.exp-ref-code::before {
  content: ""; position: absolute; inset: .55rem .5rem .5rem .55rem; border: 2px solid var(--falu); border-radius: 7px 9px 6px 8px;
  transform: rotate(-1.6deg); pointer-events: none; animation: exp-stamp var(--stamp-dur) cubic-bezier(.2, .9, .3, 1) var(--stamp-delay) both;
}
.exp-ref-code::after {
  content: "USE BY"; position: absolute; top: .2rem; left: 1.45rem; padding: 0 .4rem; background: var(--exp-card); color: var(--falu);
  font-size: .625rem; font-weight: 700; letter-spacing: .18em; line-height: 1; transform: rotate(-1.6deg);
  pointer-events: none; animation: exp-stamp var(--stamp-dur) cubic-bezier(.2, .9, .3, 1) var(--stamp-delay) both;
}
@keyframes exp-stamp { 0% { opacity: 0; transform: rotate(-7deg) scale(1.4); } 55% { opacity: 1; transform: rotate(-1.6deg) scale(.96); } 100% { opacity: 1; transform: rotate(-1.6deg) scale(1); } }
.exp-oops { display: inline-block; transform-origin: 0 100%; animation: exp-blush .25s ease-out var(--land) both; }
@keyframes exp-blush { 0% { color: var(--ink); transform: none; } 40% { transform: scale(1.04) rotate(-.6deg); } 100% { color: var(--falu); transform: none; } }

@media (min-aspect-ratio: 11/10) and (min-width: 640px) {
  .exp-page { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; column-gap: clamp(2rem, 6vw, 6rem); align-content: center; }
  .exp-mark { width: clamp(7rem, min(26vw, 62vh), 20rem); }
  .exp-wordmark { width: clamp(11rem, min(20vw, 48vh), 21rem); }
  .exp-brand { justify-items: start; }
}
@media (max-height: 460px) and (min-aspect-ratio: 11/10) {
  .exp-page { padding-top: max(.9rem, env(safe-area-inset-top)); padding-bottom: max(.9rem, env(safe-area-inset-bottom)); }
  body.exp-body { font-size: 1rem; line-height: 1.45; }
  .exp-copy h1 { font-size: clamp(1.9rem, 9vh, 3rem); }
  .exp-lede { margin-top: .6rem; }
  .exp-ref { margin-top: .9rem; }
  .exp-ref-label { margin-bottom: .4rem; }
  .exp-ref-code { font-size: 1.5rem; padding: 1.2rem 1rem 1rem 1.2rem; }
  .exp-copy-btn { min-height: 2.75rem; }
  .exp-hint { margin-top: .5rem; font-size: .875rem; }
}
@media (prefers-reduced-motion: reduce) {
  body.exp-body *, body.exp-body *::before, body.exp-body *::after {
    animation-delay: 0s !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important;
  }
  .exp-oops { animation: none; color: var(--falu); }
}

/* ---------- Link icon: copy a person's link ---------- */
.sh-result { margin: 0; padding: 0; list-style: none; }
.lc { position: relative; display: inline-flex; vertical-align: middle; align-items: center; gap: 6px; flex: none; max-width: 100%; }
.btn.lc-btn { width: 32px; padding: 0; }
.ui-table .acts .btn + .lc, .ui-table .acts form + .lc { margin-left: 6px; }
.lc-btn svg { width: 16px; height: 16px; }
/* The confirmation floats under the icon so the row never moves; the failure text stays in flow so it can be selected. */
.lc-msg { position: absolute; top: calc(100% + 2px); right: 0; z-index: 2; padding: 2px 8px; border-radius: 4px; background: var(--ok-t); white-space: nowrap; font-size: 12.5px; color: var(--ok-ink); }
.lc-msg.lc-fail { position: static; padding: 0; background: none; white-space: normal; color: var(--ink); }
.lc-msg:empty { display: none; }
.lc-url { display: block; width: 100%; max-width: 100%; min-height: 36px; margin-top: 4px; color: var(--ink); background: var(--bone); border: 1px solid var(--line-2); padding: 1px 8px; border-radius: 4px; font: 12.5px/1.4 var(--mono); }
/* Category share results: status, report, link icon on the first line; the reason sits under the report. */
.dir-results li:has(.lc) { grid-template-columns: 90px minmax(0, 1fr) auto; }
@media (pointer: coarse), (max-width: 520px) {
  .btn.lc-btn, .btn.sm.lc-btn { width: 44px; padding: 0; }
}

/* ---------- Share dialog ---------- */
.sh-modal.sd-modal { width: min(640px, 100%); }
.sd-form { display: grid; gap: 16px; }
.sd-fields { display: grid; gap: 16px; min-width: 0; margin: 0; padding: 0; border: 0; }
.sd-fields:disabled { opacity: .6; }
#p-col, #p-cus, #p-one { display: grid; gap: 16px; }
#p-col[hidden], #p-cus[hidden], #p-one[hidden] { display: none; }
.sd-field { display: grid; align-content: start; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.sd-field > label, .sd-field > legend { padding: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.sd-field > .input, .sd-field > .select, .sd-form .select { min-height: 44px; }
.sd-hint { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.sd-seg { display: grid; grid-template-columns: 1fr; border: 1px solid var(--field-line); border-radius: var(--r-md); overflow: hidden; background: var(--paper); }
.sd-seg label { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 14px; cursor: pointer; font-weight: 600; border-top: 1px solid var(--line-2); }
.sd-seg label:first-child { border-top: 0; }
.sd-seg label:has(input:checked) { background: var(--spruce); color: var(--bone); }
.sd-seg label:has(input:focus-visible) { outline: 2px solid var(--fjord); outline-offset: -3px; }
.sd-seg small { display: block; font-weight: 400; opacity: .85; font-size: 12.5px; }
.sd-seg input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--bone); }
@media (min-width: 620px) {
  .sd-seg { grid-template-columns: repeat(3, 1fr); }
  .sd-seg label { border-top: 0; border-left: 1px solid var(--line-2); }
  .sd-seg label:first-child { border-left: 0; }
}
.sd-caps { display: grid; grid-template-columns: 1fr; border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 2px 10px; background: var(--paper); }
.sd-opt { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 10px 4px; cursor: pointer; font-size: 14px; font-weight: 500; }
.sd-opt input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--spruce); }
.sd-opt.sd-dis { cursor: not-allowed; color: var(--ink-2); }
.sd-why { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-2); }
.sd-why:empty { display: none; }
@media (min-width: 560px) { .sd-caps { grid-template-columns: 1fr 1fr; column-gap: 16px; } }
.sd-two { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 560px) { .sd-two { grid-template-columns: 1fr 1fr; } }
.sd-mail[hidden] { display: none; }
.sd-sender { margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--sand-soft); font-size: 13px; color: var(--ink-2); }
.sd-err { margin: 0; color: var(--bad-ink); font-size: 13px; font-weight: 500; }
.sd-err:empty { display: none; }
.sd-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.sd-after { display: grid; gap: 12px; }
.sd-after[hidden], #shareBody[hidden] { display: none; }
.sd-after-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sd-copied { font-size: 12.5px; font-weight: 650; color: var(--ok-ink); }
.sd-copied:empty { display: none; }
.sd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.sd-modal .sh-pick-row { min-height: 52px; }
.sd-modal .sh-who2 { flex: 1 1 200px; }
@media (pointer: coarse), (max-width: 520px) {
  .sd-modal .btn, .sd-modal .btn.sm { min-height: 44px; }
  .sd-foot .btn { flex: 1 1 120px; }
}

/* ---------- People and access ---------- */
.pp-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); overflow-x: auto; margin-bottom: 14px; }
.pp-tabs button { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-bottom: 3px solid transparent; font: 600 14px/1 var(--font); color: var(--ink-2); white-space: nowrap; }
.pp-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--spruce); }
.pp-tabs button:hover { background: var(--hover); }
.pp-tabs .n { padding: 1px 8px; border-radius: 999px; background: var(--sand); color: var(--ink-2); font-size: 12px; }
.pp-panel:focus { outline: none; }
.pp-filters { display: grid; grid-template-columns: 1fr; gap: 8px 16px; align-items: end; margin-bottom: 10px; }
.pp-opt { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; font-size: 14px; }
.pp-opt input { width: 18px; height: 18px; }
.pp-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 10px; }
.pp-bulk .count { margin-right: 4px; font-weight: 600; }
.pp-table { min-width: 880px; }
.pp-table { font-size: 13.5px; }
.pp-table th, .pp-table td { padding-left: 8px; padding-right: 8px; }
.pp-table th:last-child, .pp-table td:last-child { padding-right: 12px; }
.pp-table td[data-label="Can open"], .pp-table td[data-label="Status"], .pp-table td[data-label="Shared with"] { white-space: nowrap; }
.pp-table td.cb, .pp-table th.cb { width: 44px; padding-left: 14px; padding-right: 6px; text-align: center; }
.pp-table .nm { font-weight: 600; }
.pp-table .sub { color: var(--ink-3); font-size: 12.5px; overflow-wrap: anywhere; }
.pp-table tr.sel { background: var(--sel); }
.pp-table .rowact { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.pp-table .empty { padding: 28px 16px; text-align: center; color: var(--ink-2); }
.pp-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pp-note { margin-top: 8px; color: var(--ink-2); font-size: 13px; }
.pp-foot { margin: 40px 0 0; color: var(--ink-3); font-size: 12.5px; }
.pp-result { display: grid; gap: 6px; margin: 0 0 12px; }
.pp-result ul { margin: 4px 0 0; padding-left: 18px; }

dialog.pp-dlg { width: min(460px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--line-2); border-radius: 14px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-pop); }
dialog.pp-dlg::backdrop { background: rgba(43, 33, 28, .4); }
dialog.pp-dlg form { margin: 0; }
dialog.pp-dlg .card-b { display: grid; gap: 12px; }
dialog.pp-dlg h3 { font-size: 16px; }
.pp-actlist { display: grid; gap: 8px; }
.pp-actlist .btn { width: 100%; justify-content: flex-start; }
.pp-sub { margin-top: 2px; color: var(--ink-2); font-size: 13px; font-weight: 400; word-break: break-word; }

/* Person screen */
.pp-back { display: inline-flex; margin-bottom: 14px; font-size: 13.5px; }
.pp-who { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 8px; }
.pp-who h1 { font: 700 22px/1.2 var(--display); }
.pp-meta { margin-bottom: 14px; color: var(--ink-2); font-size: 13.5px; }
.pp-cols { display: grid; grid-template-columns: 1fr; gap: 22px; }
.pp-cols h2 { margin-bottom: 8px; font-size: 15px; }
.pp-grid { display: grid; gap: 12px; }
.pp-rep { display: grid; gap: 10px; margin: 0; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--paper); min-width: 0; }
.pp-rep legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pp-rep-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 10px; }
.pp-caps { display: flex; flex-wrap: wrap; gap: 0 20px; }
.pp-opt span { white-space: nowrap; }
.pp-exp { display: grid; grid-template-columns: 1fr; gap: 8px; }
.pp-rep-acts { display: flex; justify-content: flex-end; }
.pp-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 16px; }
.pp-timeline { margin: 0 0 0 6px; padding: 0; list-style: none; border-left: 2px solid var(--line-2); }
.pp-timeline li { position: relative; padding: 4px 0 10px 16px; font-size: 14px; }
.pp-timeline li::before { content: ""; position: absolute; left: -6px; top: 10px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink-3); background: var(--paper); }
.pp-timeline time { display: block; color: var(--ink-3); font-size: 12.5px; }
@media (min-width: 560px) {
  .pp-exp { grid-template-columns: 220px; }
}
@media (min-width: 760px) {
  .pp-filters { grid-template-columns: minmax(200px, 1.4fr) minmax(140px, .8fr) auto auto; }
}
@media (min-width: 960px) {
  .pp-cols { grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 520px) {
  .pp-table { min-width: 0; }
  .pp-table td.cb { padding: 4px 16px 0; text-align: left; }
  .pp-table td.main { display: block; text-align: left; }
  .pp-table td.main::before { display: none; }
  .pp-table td.acts { justify-content: flex-end; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
  .pp-table .pp-chips { justify-content: flex-end; }
  .pp-table .empty { display: block; text-align: center; }
  .pp-table td.cb input { width: 20px; height: 20px; }
}
@media (prefers-reduced-motion: reduce) { .pp-tabs button { transition: none; } }
