* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: var(--fs-md)/1.45 var(--font); color: var(--text); background: var(--bg); color-scheme: light; -webkit-font-smoothing: antialiased; line-break: strict; }
:root:lang(ja) { --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", var(--cjk), system-ui, Roboto, Helvetica, Arial, sans-serif; }
:lang(ja) { word-break: normal; overflow-wrap: break-word; }
:root:lang(ko) { --hangul: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", "NanumGothic", "Nanum Gothic";
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", var(--hangul), system-ui, Roboto, Helvetica, Arial, var(--cjk), sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, var(--hangul), monospace; }
:lang(ko) { word-break: keep-all; overflow-wrap: break-word; }
:root:lang(zh-Hans) { --han: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans SC";
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", var(--han), system-ui, Roboto, Helvetica, Arial, var(--cjk), sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, var(--han), monospace; }
:root:lang(zh-Hant) { --han: "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", "Noto Sans TC", "Source Han Sans TC";
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", var(--han), system-ui, Roboto, Helvetica, Arial, var(--cjk), sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, var(--han), monospace; }
:lang(zh) { word-break: normal; overflow-wrap: break-word; }
[data-theme=dark] body { color-scheme: dark; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:is(p, .muted, .small, .empty, .toast, .error-box, .hp-purpose, .field > span, blockquote, dd, .prose) a:not(.btn):not(.chip-link):not(.ent-link) { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 600; }
h2 { font-size: var(--fs-xl); } h3 { font-size: var(--fs-lg); }
.muted { color: var(--muted); }
.pad { padding: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.row:has(> .field):not(:has(> :not(.field))), .acct-row:has(> .field):not(:has(> :not(.field))) { align-items: flex-start; }
.grow { flex: 1; }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
::placeholder { color: var(--placeholder); opacity: 1; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px var(--focus-halo); }
.input:focus-visible, .inline-edit:focus-visible { outline-offset: 0; }
[data-press]:focus-visible, [role=grid] [tabindex]:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.modal:focus { outline: none; }
.rail :focus-visible { outline-color: var(--brand-300); box-shadow: 0 0 0 4px rgba(143, 219, 224, .35); }
.modal.modal-nudge { animation: modal-nudge .25s; }
@keyframes modal-nudge { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }


.main { flex: 1; min-height: 0; overflow: auto; position: relative; }
.page { max-width: 1280px; margin: 0 auto; padding: 20px 24px 40px; }
.page.full { max-width: none; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; }
.page-head .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); }
.card-head { padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 14px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.split { display: flex; height: 100%; min-height: 0; }
.split > .sidebar { width: 260px; flex: none; background: var(--panel); border-inline-end: 1px solid var(--line); overflow-y: auto; }
.split > .sidebar.right { border-inline-end: 0; border-inline-start: 1px solid var(--line); width: 320px; }
.split > .content { flex: 1; min-width: 0; overflow: auto; display: flex; flex-direction: column; }
.sidebar h4, .sidebar .side-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 14px 6px; font-weight: 600; }
.side-item { display: flex; align-items: center; gap: 8px; padding: 5px 14px; cursor: pointer; color: var(--text); }
.side-item:hover { background: var(--line-2); text-decoration: none; }
.side-item.active { background: var(--accent-2); color: var(--accent); font-weight: 600; }
.side-item .count { margin-inline-start: auto; color: var(--muted); font-size: 12px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }

.toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; flex: none; }
.toolbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.toolbar .title { font-weight: 600; margin-inline-end: 8px; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); padding: 6px 12px; border-radius: var(--r-ctl); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--line-strong); background: var(--panel-2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--danger); }
.btn.danger.primary, .modal-foot .btn.danger { background: var(--danger); border-color: var(--danger); color: var(--on-status); }
.btn.small { padding: 3px 8px; font-size: var(--fs-xs); }
.btn.active { background: var(--accent-2); border-color: var(--accent); color: var(--accent); }
td .btn { white-space: normal; text-align: start; }
td.nowrap .btn { white-space: nowrap; }
:is(:lang(ja), :lang(zh)) :is(td .btn, .uaf-btn, .th-sort) { word-break: keep-all; }
:is(.fp-table, .schema-table, .rr-table) :is(th, td):first-child { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--surface); }
:is(.fp-table, .schema-table, .rr-table) thead th:first-child { z-index: 2; background: var(--panel-2); }
:is(.fp-table, .schema-table, .rr-table) tr:is(.sel, .selected) td:first-child { background: linear-gradient(var(--sel-bg), var(--sel-bg)), var(--surface); }
.icon-btn { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--muted); padding: 2px 6px; border-radius: var(--r-sm); }
.icon-btn:hover { background: var(--line-2); color: var(--text); }
.input { font: inherit; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); padding: 6px 8px; background: var(--input-bg); color: var(--text); width: 100%; }
.input:focus, .inline-edit:focus { outline: 2px solid var(--focus); border-color: var(--accent); }
select.input { width: auto; max-width: 100%; }
input.input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not(.title-input), select.input:not([multiple]):not([size]) { height: var(--ctl-h); box-sizing: border-box; }
input.input.small:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select.input.small:not([multiple]):not([size]) { height: calc(var(--ctl-h) - 6px); padding-top: 2px; padding-bottom: 2px; }
select.input:not([multiple]):not([size]) { -webkit-appearance: none; appearance: none; padding-inline-end: 24px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 13px) 52%, calc(100% - 8px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.input { resize: vertical; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field[hidden] { display: none; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.form .field:last-child { margin-bottom: 0; }
.ce-err:not(:empty) { margin: -6px 0 12px; }
.field-err:not(:empty) { margin: -6px 0 12px; }
.admin-add + .field-err:not(:empty), .acct-row + .field-err:not(:empty) { margin: 4px 0 8px; }
.checkbox { display: inline-flex; gap: 6px; align-items: center; }

.cls-badge { display: inline-block; color: var(--on-fill); font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 3px; white-space: nowrap; vertical-align: 1px; }
.label-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--chip-bg); border: 1px solid var(--chip-line); color: var(--chip-text); font-size: 11.5px; padding: 0 7px; border-radius: 10px; margin-block: 1px; margin-inline: 0 3px; white-space: nowrap; }
.label-chip .choice-colour { width: 16px; height: 16px; padding: 0; border: 1px solid var(--chip-line); border-radius: 3px; background: none; }
.label-chip button { border: 0; background: none; padding: 0; color: var(--muted); font-size: 13px; }
.ent-link { color: var(--text); }
.ent-link:hover { color: var(--accent); }

.table-wrap { overflow: auto; flex: 1; }
table.grid-table { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--panel); }
.grid-table th { position: sticky; top: 0; background: var(--panel-2); text-align: start; font-weight: 600; font-size: 12px; color: var(--text-2); padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; cursor: pointer; user-select: none; }
.grid-table td { padding: 6px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.grid-table tr:hover td { background: var(--hover); }
.grid-table tr.selected td { background: var(--accent-2); }
.grid-table td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.grid-table td.desc { max-width: 520px; color: var(--text-2); }
.grid-table .chk { width: 30px; }
.inline-edit { border: 1px solid transparent; border-radius: 3px; padding: 1px 4px; margin: -2px -5px; min-height: 1.4em; }
.inline-edit:hover { border-color: var(--line); background: var(--panel); }

.modal-back { position: fixed; inset: 0; background: rgba(15, 26, 51, .45); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding-top: 8vh; }
.modal { background: var(--panel); color: var(--text); border-radius: var(--r-card); box-shadow: var(--shadow-pop); width: 480px; max-width: calc(100vw - 32px); max-height: 84vh; display: flex; flex-direction: column; }
.modal.wide { width: 860px; }
.modal.xwide { width: 1200px; }
.modal-head { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.modal-head .icon-btn { margin-inline-start: auto; }
.modal-body { padding: 16px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.pick-list { margin-top: 10px; max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 4px; }
.pick-row { display: flex; gap: 8px; align-items: center; padding: 6px 10px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.pick-row:hover, .pick-row.active { background: var(--accent-2); }
.pick-row.active { box-shadow: inset 3px 0 0 var(--sel-edge); }
.pick-ctx { margin-inline-start: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dropdown { width: max-content; max-width: min(560px, calc(100vw - 16px)); position: fixed; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-pop); padding: 4px 0; z-index: 145; min-width: 180px; max-height: 70vh; overflow: auto; }
.dd-item { display: block; width: 100%; text-align: start; background: none; border: 0; padding: 7px 14px; color: var(--text); }
.dd-item:hover:not(:disabled) { background: var(--accent-2); }
.dd-item:disabled { color: var(--muted); opacity: .6; }
.dd-div { height: 1px; background: var(--line); margin: 4px 0; }
.dd-head { padding: 6px 14px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.dd-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; box-shadow: none; background: var(--accent-2); }
.dropdown:focus { outline: none; }

.lang-offer { position: fixed; inset-inline-start: 18px; bottom: 18px; z-index: 190; max-width: min(360px, calc(100vw - 32px)); padding: 14px 16px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-pop); }
.lang-offer-title { font-size: 15px; margin: 0 0 4px; }
.lang-offer-btns { gap: 8px; margin-top: 10px; flex-wrap: wrap; }

#toasts { position: fixed; bottom: 18px; inset-inline-end: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; pointer-events: none; }
.toast { background: var(--brand-800); color: var(--on-fill); padding: 9px 14px; border-radius: var(--r-ctl); box-shadow: var(--shadow); transition: opacity .3s; max-inline-size: min(380px, calc(100vw - 32px)); overflow-wrap: anywhere; pointer-events: none; }
.toast :is(button, a, input, select, [tabindex]) { pointer-events: auto; }
.toast.see-through { opacity: .18; }
.toast.see-through:focus-within { opacity: 1; }
.toast.error { background: var(--danger); color: var(--on-status); }
.toast.ok { background: var(--ok); color: var(--on-status); }
.toast.out { opacity: 0; }
.toast.with-x { display: flex; gap: 10px; align-items: flex-start; }
.toast.with-x > :first-child { min-inline-size: 0; }
.toast a:not(.btn) { color: #8fdbe0; font-weight: 600; }
.toast.error a:not(.btn), .toast.ok a:not(.btn) { color: inherit; }
.toast-x { background: none; border: 0; color: inherit; font: inherit; font-size: 16px; line-height: 1; padding: 0 2px; margin-inline-start: auto; border-radius: var(--r-sm); }
.toast-x:focus-visible { outline-color: currentColor; box-shadow: none; }

.progress-card { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 201; min-width: 280px; max-width: min(420px, calc(100vw - 32px));
  background: var(--brand-800); color: var(--on-fill); padding: 10px 14px 12px; border-radius: var(--r-ctl); box-shadow: var(--shadow); font-size: var(--fs-sm); pointer-events: none; }
.progress-head { display: flex; gap: 12px; align-items: baseline; }
.progress-title { font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.progress-count { font-variant-numeric: tabular-nums; opacity: .85; white-space: nowrap; }
.progress-cancel { pointer-events: auto; margin-block: -4px; margin-inline: 0 -6px; color: inherit; background: transparent; border-color: rgba(255, 255, 255, .4); }
.progress-cancel[hidden] { display: none; }
.progress-detail { opacity: .85; font-size: var(--fs-xs); margin-top: 2px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.progress-track { position: relative; height: 4px; margin-top: 8px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .22); overflow: hidden; }
.progress-fill { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: var(--brand-300); transition: width .25s ease-out; }
.progress-card.indeterminate .progress-fill { width: 35%; animation: progress-slide 1.2s ease-in-out infinite; }
@keyframes progress-slide { from { left: -35%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .progress-card.indeterminate .progress-fill { animation-name: none !important; inset-inline-start: 0; width: 100%; opacity: .55; }
  .progress-fill { transition: none !important; }
}

.error-box { margin: 24px; padding: 16px; background: var(--danger-bg); border: 1px solid var(--danger-line); border-radius: 6px; }
.error-box pre { white-space: pre-wrap; font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty h3 { color: var(--text); }

.stat { padding: var(--pad); border-top: 3px solid var(--border-strong); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stat .v { font-size: var(--fs-2xl); line-height: 32px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .k { color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; }

.canvas-wrap { position: relative; flex: 1; overflow: hidden; background: var(--canvas-bg); background-image: radial-gradient(var(--canvas-dot) 1px, transparent 1px); background-size: 20px 20px; }
html.over-canvas, html.over-canvas body, .canvas-wrap { overscroll-behavior: none; }
.canvas-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; }
body.dg-dragging, body.dg-dragging * { user-select: none; -webkit-user-select: none; }
.zoom-box { position: absolute; inset-inline-end: 12px; bottom: 12px; display: flex; gap: 2px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-ctl); box-shadow: 0 2px 8px rgba(0,0,0,.06); padding: 3px; }
.zoom-box button { border: 0; background: none; color: var(--text); width: 30px; height: 28px; border-radius: 4px; }
.zoom-box button:hover { background: var(--line-2); }
.zoom-box span { min-width: 46px; text-align: center; align-self: center; font-size: 12px; color: var(--muted); }

@media (max-width: 760px) {
  .page { padding: 16px; }
}
.drawer-toggle { display: none; }
:root[data-narrow] .split, :root[data-narrow] .is-drawer { position: relative; }
:root[data-narrow] .drawer-toggle { display: flex; align-items: center; justify-content: center; flex: none; width: 28px; padding: 0; border: 0; background: var(--surface-2); color: var(--text-2); cursor: pointer; }
:root[data-narrow] .drawer-toggle.left { border-inline-end: 1px solid var(--line-strong); }
:root[data-narrow] .drawer-toggle.right { border-inline-start: 1px solid var(--line-strong); }
:root[data-narrow] .drawer-toggle:hover, :root[data-narrow] .drawer-toggle[aria-expanded=true] { background: var(--accent-2); color: var(--text); }
:root[data-narrow] .drawer-toggle:focus-visible { outline-offset: -2px; box-shadow: none; }
:root[data-narrow] .is-drawer:not(.drawer-open) { display: none !important; }
:root[data-narrow] .is-drawer.drawer-open { display: block !important; position: absolute !important; top: 0; bottom: 0; z-index: 25; width: min(320px, calc(100% - 40px)) !important; max-width: none; overflow-y: auto; background: var(--panel); box-shadow: var(--shadow-pop); }
:root[data-narrow] .is-drawer.drawer-open.drawer-left { inset-inline-start: 28px; }
:root[data-narrow] .is-drawer.drawer-open.drawer-right { inset-inline-end: 28px; }
:root[data-narrow] .grid.cols-2, :root[data-narrow] .grid.cols-3, :root[data-narrow] .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
:root[data-narrow] .topbar { height: auto; min-height: var(--topbar-h); flex-wrap: wrap; row-gap: 2px; padding-top: 4px; padding-bottom: 4px; }
:root[data-narrow] .topbar > .crumb { flex: 1 1 100%; min-width: 0; flex-wrap: wrap; white-space: normal; row-gap: 0; }
:root[data-narrow] .topbar .vsep { display: none; }
:root[data-narrow] .pg-head { flex-wrap: wrap; row-gap: 6px; }
:root[data-narrow] .pg-text { flex: 1 1 100%; }
:root[data-narrow] .pg-actions { flex: 1 1 auto; justify-content: flex-start; }
.modal-foot { flex-wrap: wrap; }
.modal-head > span[role=heading] { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .modal-back { padding: 8px 0; align-items: flex-start; }
  .modal, .modal.wide, .modal.xwide { max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .modal-head { padding: 10px 12px; }
  .modal-body { padding: 12px; }
  .modal-foot { padding: 10px 12px; gap: 6px; }
}
@media (max-height: 480px) {
  .modal-back { padding: 8px 0; }
  .modal, .modal.wide, .modal.xwide { max-height: calc(100vh - 16px); overflow: auto; }
  .modal > .modal-body { flex: none; overflow: visible; }
}
:root[data-insp-overlay] .insp[data-state=open] { position: absolute; inset-inline-end: 0; top: 0; bottom: 0; z-index: 26; width: min(var(--insp-w, 340px), 100%); box-shadow: var(--shadow-pop); }
@media print {
  .topbar, .rail, .edtabs, .insp, .rail-strip, .skip-link, #focus-pill, .toolbar, .sidebar, .no-print, .pg-actions, .pg-more-wrap { display: none !important; }
  .shell, .work, .shell-body { display: block !important; height: auto !important; overflow: visible !important; }
  .main { overflow: visible; }
  body { background: #fff; }
}

.side-rail { flex: none; width: 22px; border: 0; background: var(--panel); color: var(--muted); font-size: 16px; padding: 0; cursor: pointer; }
.side-rail.left { border-inline-end: 1px solid var(--line); }
.side-rail.right { border-inline-start: 1px solid var(--line); }
.side-rail:hover { background: var(--accent-2); color: var(--accent); }

.dropdown.filterable { display: flex; flex-direction: column; overflow: hidden; padding-top: 0; }
.dropdown.filterable .dd-list { overflow-y: auto; flex: 1; min-height: 0; }
.dd-filter { margin: 6px 6px 4px; width: calc(100% - 12px); padding: 5px 8px; font-size: 13px; flex: none; }
.dd-item.active { background: var(--accent-2); color: var(--accent); }
.dd-empty { padding: 8px 14px; color: var(--muted); font-size: 13px; }


.shell { display: flex; height: 100%; overflow: hidden; position: relative; }
.work { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.shell-body { flex: 1; min-height: 0; display: flex; position: relative; }
.main { flex: 1; min-width: 0; min-height: 0; overflow: auto; position: relative; }
.main:focus { outline: none; box-shadow: none; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
.kbd { font: 500 11px/1 var(--font); padding: 3px 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--r-sm); color: var(--text-2); background: var(--surface); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 8px; top: -48px; z-index: 300; background: var(--surface); color: var(--text); padding: 6px 10px; border-radius: var(--r-ctl); box-shadow: var(--shadow-pop); }
.skip-link:focus { top: 8px; }
.logo-mark { display: inline-flex; flex: none; }

.rail { flex: none; width: var(--rail-w); background: var(--rail-bg); color: var(--rail-text); display: flex; flex-direction: column; padding: 6px 6px 8px; gap: 1px; z-index: 40; min-height: 0; }
[data-theme=dark] .rail { border-inline-end: 1px solid var(--border); }
.rail .brand { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px; margin-bottom: 6px; color: var(--rail-text-strong); font-weight: 650; font-size: var(--fs-lg); border-radius: var(--r-ctl); flex: none; letter-spacing: .01em; }
.rail .brand:hover { text-decoration: none; background: var(--rail-hover); }
.rail-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 1px; }
.rail-tools { display: flex; flex-direction: column; gap: 1px; flex: none; }
.rg { position: relative; }
.rail .ri { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 10px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--rail-text); font: 500 var(--fs-sm)/1 var(--font); text-align: start; cursor: pointer; position: relative; white-space: nowrap; }
.rail .ri:hover { background: var(--rail-hover); color: var(--rail-text-strong); text-decoration: none; }
.rail .ri[aria-current], .rail .ri.in { background: var(--rail-sel); color: var(--rail-text-strong); }
.rail .ri.in::before { content: ""; position: absolute; inset-inline-start: -6px; top: 7px; bottom: 7px; width: 3px; border-start-start-radius: 0; border-start-end-radius: 3px; border-end-end-radius: 3px; border-end-start-radius: 0; background: var(--brand-300); }
.rail .ri .lbl { overflow: hidden; text-overflow: ellipsis; }
.shell:not([data-rail=icons]) .rail .ri { height: auto; min-height: 32px; padding-top: 4px; padding-bottom: 4px; white-space: normal; line-height: 1.2; }
.shell:not([data-rail=icons]) .rail .ri .lbl { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; hyphens: auto; min-width: 0; }
.shell:not([data-rail=icons]) .rail .pages a { height: auto; min-height: 28px; line-height: 1.25; padding-top: 5px; padding-bottom: 5px; white-space: normal; hyphens: auto; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.rail .badge { margin-inline-start: auto; font-size: 11px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: rgba(255, 255, 255, .16); color: var(--rail-text-strong); display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.rail .badge.hot { background: var(--rail-hot); color: var(--brand-900); }
.rail .badge[hidden], .rail .badge-dot { display: none; }
.rail .pages { margin-block: 2px 6px; margin-inline: 20px 0; padding-inline-start: 8px; border-inline-start: 1px solid rgba(255, 255, 255, .16); display: flex; flex-direction: column; gap: 1px; }
.rail .pages a { display: block; height: 28px; line-height: 28px; padding: 0 8px; border-radius: var(--r-ctl); color: var(--rail-text-2); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail .pages a:hover { background: var(--rail-hover); color: var(--rail-text-strong); text-decoration: none; }
.rail .pages a[aria-current=page] { color: var(--rail-text-strong); font-weight: 600; background: rgba(143, 219, 224, .14); }
.rail .sep { height: 1px; background: rgba(255, 255, 255, .12); margin: 6px 4px; flex: none; }
.fly { display: none; position: absolute; inset-inline-start: calc(100% + 4px); top: 0; z-index: 60; flex-direction: column; min-width: 210px; padding: 6px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-pop); }
.fly::before { content: ""; position: absolute; inset-inline-start: -8px; top: 0; bottom: 0; width: 8px; }
.fly .fh { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); padding: 4px 8px 6px; }
.fly a, .fly button { display: flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--text); font: var(--fs-sm)/1 var(--font); text-align: start; white-space: nowrap; cursor: pointer; }
.fly a:hover, .fly button:hover { background: var(--hover-bg); text-decoration: none; }
.fly [aria-current=page] { background: var(--sel-bg); font-weight: 600; }
.fly .ai-ico { color: var(--warn); }
.fly.tip { min-width: 0; padding: 6px 10px; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; top: 2px; pointer-events: none; }
.rail-tools .rg:hover > .tool-fly, .rail-tools .rg:focus-within > .tool-fly, .rail-tools .rg.kb > .tool-fly, .rail-tools .tool-fly.open { display: flex; top: auto; bottom: 0; }
.shell[data-rail=icons] .rail { width: var(--rail-icons-w); }
.shell[data-rail=icons] .rail .lbl, .shell[data-rail=icons] .rail .badge, .shell[data-rail=icons] .rail .wm, .shell[data-rail=icons] .rail .pages { display: none; }
.shell[data-rail=icons] .rail .ri, .shell[data-rail=icons] .rail .brand { justify-content: center; padding: 0; }
.shell[data-rail=icons] .rail .badge-dot:not([hidden]) { display: block; position: absolute; top: 5px; inset-inline-end: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--rail-hot); }
.shell[data-rail=icons] .rail-scroll { overflow: visible; }
.shell[data-rail=icons] .rg:hover > .fly, .shell[data-rail=icons] .rg:focus-within > .fly, .shell[data-rail=icons] .rg.kb > .fly, .rail .rg.kbr > .fly { display: flex; }
.rail-strip { display: none; }
.shell[data-rail=hidden] .rail { position: absolute; left: var(--rail-strip-w); top: 0; bottom: 0; transform: translateX(-102%); visibility: hidden; transition: none; }
.shell[data-rail=hidden].peek .rail { transform: none; visibility: visible; box-shadow: var(--shadow-pop); transition: transform .16s ease; }
.shell[data-rail=hidden] .rail-strip { display: flex; flex: none; position: relative; z-index: 41; width: var(--rail-strip-w); padding: 0; margin: 0; border: 0; border-inline-end: 1px solid var(--border-strong); background: var(--surface-3); color: var(--text-2); cursor: pointer; align-items: center; justify-content: center; transition: background-color .12s ease, color .12s ease; }
.rail-strip .grip { width: 4px; height: 36px; border-inline-start: 1.5px solid currentColor; border-inline-end: 1.5px solid currentColor; opacity: .8; }
.rail-strip .rail-chev { display: none; width: 12px; height: 12px; flex: none; stroke-width: 3; }
.shell[data-rail=hidden] .rail-strip:hover, .shell[data-rail=hidden] .rail-strip:focus-visible, .shell[data-rail=hidden].peek .rail-strip { background: var(--rail-bg); color: var(--rail-text-strong); border-inline-end-color: transparent; }
.rail-strip:hover .grip, .rail-strip:focus-visible .grip, .peek .rail-strip .grip { display: none; }
.rail-strip:hover .rail-chev, .rail-strip:focus-visible .rail-chev, .peek .rail-strip .rail-chev { display: block; }
.shell[data-rail=hidden] .rail-strip:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (pointer: coarse) { :root { --rail-strip-w: 16px; } }
@media (prefers-reduced-motion: reduce) { .rail, .shell[data-rail=hidden] .rail, .shell[data-rail=hidden] .rail-strip { transition: none !important; } }
.rail.fly-off .rg:hover:not(.kb):not(.kbr):not(:focus-within) > .fly:not(.open) { display: none !important; }

.topbar { flex: none; height: var(--topbar-h); display: flex; align-items: center; gap: 4px; padding-block: 0; padding-inline: var(--sp-4) var(--sp-3); border-bottom: 1px solid var(--border); background: var(--surface); min-width: 0; position: relative; z-index: 30; }
.topbar > * { flex: none; }
.crumb { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--text-2); white-space: nowrap; overflow: hidden; }
.crumb svg.sep { width: 12px; height: 12px; color: var(--text-3); }
.crumb a.c { color: var(--text-2); flex: none; }
.crumb a.c:hover { color: var(--text); }
.crumb .c { flex: none; }
.top-project { display: inline-flex; align-items: center; gap: 2px; max-width: 220px; height: 28px; padding-block: 0; padding-inline: 6px 4px; margin-inline-start: -6px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; flex: 0 1 auto; min-width: 0; }
.top-project .pn { overflow: hidden; text-overflow: ellipsis; }
.topbar .top-project { min-width: min(96px, 12vw); }
.top-project:hover { background: var(--hover-bg); color: var(--text); }
.top-status { display: flex; gap: 6px; align-items: center; }
.top-status[hidden] { display: none; }
.topbar .vsep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.top-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: var(--r-ctl); background: none; color: var(--text-2); }
.top-icon:hover:not(:disabled) { background: var(--hover-bg); color: var(--text); }
.top-icon:disabled { opacity: .35; cursor: default; }
.top-icon[aria-pressed=true] { background: var(--sel-bg); color: var(--text); }
.top-icon[hidden], .top-search[hidden], .top-ai[hidden], .top-problems[hidden], .top-save[hidden] { display: none !important; }
.top-search { display: flex; align-items: center; gap: 6px; height: 30px; width: 168px; padding-block: 0; padding-inline: 8px 6px; margin: 0 4px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); cursor: text; }
.top-search:hover { border-color: var(--text-3); }
.update-banner { display: flex; align-items: center; gap: 12px; padding: 5px 16px; background: var(--info-bg, var(--surface-2)); color: var(--info, var(--text)); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); flex: none; }
.update-banner .ub-text { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.update-banner .ub-kept { color: var(--text-2); }
.top-search .kbd { margin-inline-start: auto; }
.topbar .top-ai { height: 30px; padding: 0 10px; border-radius: var(--r-ctl); font-size: var(--fs-sm); gap: 2px; }
.top-problems { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--text-2); font-weight: 600; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.top-problems.none { color: var(--text-3); font-weight: 500; }
.top-problems:hover { background: var(--hover-bg); }
.top-save { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--text-2); font-size: var(--fs-xs); white-space: nowrap; cursor: default; }
.top-save .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.top-save[data-state=saving] .dot { background: var(--info); }
.top-save[data-state=failed] { color: var(--danger); font-weight: 600; cursor: pointer; }
.top-save[data-state=failed] .dot { background: var(--danger); }
@media (max-width: 1000px) {
  .top-search { width: 32px; padding: 0; justify-content: center; }
  .top-search .lbl2, .top-search .kbd { display: none; }
}
@media (max-width: 600px) { .top-save .st { display: none; } }
.topbar.narrow .top-save:not([data-state=failed]) .st { display: none; }
.topbar.narrow .top-viewas:not(.on) { display: none; }

.edtabs { flex: none; display: flex; align-items: stretch; height: var(--tabs-h); background: var(--surface-2); border-bottom: 1px solid var(--border); padding-inline-start: 4px; }
.edtabs[hidden] { display: none; }
.edtabs-strip { display: flex; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.edtabs-strip::-webkit-scrollbar { display: none; }
.edtab { display: flex; align-items: center; flex: 0 1 260px; min-width: 120px; border-inline-end: 1px solid var(--border); position: relative; }
.edtab.on { background: var(--surface); }
.edtab.on::after { content: ""; position: absolute; inset-inline-start: 0; inset-inline-end: 0; top: 0; height: 2px; background: var(--sel-edge); }
.edtab-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 100%; padding-block: 0; padding-inline: 10px 2px; color: var(--text-2); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; }
.edtab-link:focus-visible { outline-offset: -2px; box-shadow: none; }
.edtab.on .edtab-link { color: var(--text); }
.edtab-link:hover { text-decoration: none; color: var(--text); }
.edtab-link .t { flex: 0 1 auto; min-width: 3.5em; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.edtab-link .s { color: var(--text-3); flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.edtab-x { flex: none; width: 22px; height: 22px; margin-inline-end: 4px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-3); opacity: .55; }
.edtab:hover .edtab-x, .edtab.on .edtab-x, .edtab-x:focus-visible { opacity: 1; }
.edtab-x:hover { background: var(--hover-bg); color: var(--text); }
.edtab.drag { opacity: .5; }
.edtab.over { box-shadow: inset 3px 0 0 var(--sel-edge); }
.edtabs-more { flex: none; display: inline-flex; align-items: center; gap: 2px; padding: 0 10px; border: 0; border-inline-start: 1px solid var(--border); background: none; color: var(--text-2); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.edtabs-more:hover { color: var(--text); background: var(--hover-bg); }

.insp { flex: none; position: relative; background: var(--surface); border-inline-start: 1px solid var(--border); display: none; flex-direction: column; min-height: 0; }
.insp[data-state=open] { display: flex; width: var(--insp-w, 340px); }
.insp[data-state=edge] { display: flex; width: 28px; }
.insp-head { display: flex; align-items: center; gap: 2px; padding-block: 6px; padding-inline: 14px 6px; border-bottom: 1px solid var(--border); flex: none; }
.insp-title { font-size: var(--fs-xs); font-weight: 600; margin: 0; color: var(--text-2); text-transform: none; }
.insp-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--text-2); }
.insp-btn:hover { background: var(--hover-bg); color: var(--text); }
.insp-btn[aria-pressed=true] { background: var(--sel-bg); color: var(--text); }
.insp-body { flex: 1; min-height: 0; overflow: auto; }
.insp-empty { color: var(--text-2); font-size: var(--fs-sm); padding: var(--sp-5) var(--sp-4); text-align: center; }
.insp-resize { position: absolute; inset-inline-start: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 5; touch-action: none; }
.insp-resize:hover { background: var(--sel-edge); opacity: .5; }
.insp-resize:focus-visible { background: var(--focus); opacity: 1; outline: none; box-shadow: 0 0 0 2px var(--focus-halo); }
.insp-edge { display: flex; align-items: center; gap: 6px; writing-mode: vertical-rl; width: 100%; height: 100%; padding: 12px 0; border: 0; background: var(--surface-2); color: var(--text-2); font: 600 var(--fs-xs)/1 var(--font); cursor: pointer; white-space: nowrap; overflow: hidden; }
.insp-edge:hover { background: var(--hover-bg); color: var(--text); }
.insp-edge svg { transform: rotate(90deg); }
.insp .db-panel-head { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.insp-head.own { padding: 0; }
.insp-head.own > .ep-head { flex: 1; min-width: 0; position: static; border-bottom: 0; gap: 6px; padding-top: 6px; padding-bottom: 6px; }
.insp-head.own > .ep-head > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-head.own > .ep-head > .insp-btn, .insp-head.own > .ep-head > .icon-btn { flex: none; }
.insp { --insp-pad: var(--sp-4); }
.insp-head { padding-inline-start: var(--insp-pad); }
.insp-empty { padding: var(--sp-5) var(--insp-pad); }
.insp .ep-body { padding-inline-start: var(--insp-pad); padding-inline-end: var(--insp-pad); }
.insp :is(.ep-anchors, .db-panel-head, .ep-head) { padding-inline-start: var(--insp-pad); padding-inline-end: calc(var(--insp-pad) - 4px); }
.insp .ep-body :is(.ep-body, .ep-anchors, .db-panel-head, .ep-head) { padding-inline-start: 0; padding-inline-end: 0; }
.insp .ent-panel > .ep-body { padding: 0 0 var(--insp-pad); }
.insp .ent-panel > .ep-body > * { margin-inline-start: var(--insp-pad); margin-inline-end: var(--insp-pad); }
.insp .ent-panel > .ep-body > :is(.ep-sec, .v2i) { margin: 0; padding-inline-start: var(--insp-pad); padding-inline-end: var(--insp-pad); }
.insp .ent-panel > .ep-body > .ep-sec, .insp :is(.dg-config, .dg-settings > .ep-sec, .sp-chart-panel > .ep-sec) {
  margin: 0; padding-top: var(--sp-3); padding-bottom: var(--sp-3); padding-inline-start: var(--insp-pad); padding-inline-end: var(--insp-pad); border-top: 0; border-bottom: 1px solid var(--line-2); }
.insp .ent-panel > .ep-body > .ep-tabs-wrap { padding-top: 0; border-bottom: 0; }
.insp .ent-panel > .ep-body > .ep-actions { margin-top: var(--sp-3); }
.insp .sp-chart-panel, .insp .dg-checks-panel { padding: 0; }
.insp .v2b-insp { padding: var(--sp-3) var(--insp-pad); }
.insp .dg-checks-panel .ep-head { padding-inline-start: var(--insp-pad); padding-inline-end: calc(var(--insp-pad) - 4px); }
.insp .sim-insp-runs { margin-inline-start: var(--insp-pad); margin-inline-end: var(--insp-pad); }
.insp .ep-sec-head { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2, var(--muted)); margin: 0 0 var(--sp-2); }
.insp .dg-fold.closed > .dg-fold-h { margin-bottom: 0; }

:root[data-focus="1"] .rail, :root[data-focus="1"] .rail-strip, :root[data-focus="1"] .topbar, :root[data-focus="1"] .pg-head, :root[data-focus="1"] .edtabs, :root[data-focus="1"] .insp { display: none !important; }
#focus-pill { position: fixed; top: 8px; inset-inline-end: 8px; z-index: 95; display: none; box-shadow: var(--shadow-pop); }
:root[data-focus="1"] #focus-pill { display: inline-flex; }

.pal-scrim { position: fixed; inset: 0; background: rgba(15, 26, 51, .45); z-index: 150; }
.pal { position: fixed; z-index: 151; top: 12vh; left: 50%; transform: translateX(-50%); width: min(640px, calc(100vw - 32px)); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; max-height: 70vh; }
.pal-in { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); color: var(--text-2); }
.pal-input { flex: 1; border: 0; background: none; font: var(--fs-lg) var(--font); color: var(--text); outline: none; height: 28px; min-width: 0; }
.pal-input:focus-visible { box-shadow: none; outline: none; }
.pal-list { overflow: auto; padding: var(--sp-2); margin: 0; list-style: none; }
.pal-g { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); padding: var(--sp-2) var(--sp-2) 4px; }
.pal-o { display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-2); height: 36px; border-radius: var(--r-ctl); cursor: pointer; font-size: var(--fs-md); color: var(--text); }
.pal-o svg.i { color: var(--text-2); }
.pal-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-sub { margin-inline-start: auto; padding-inline-start: 12px; font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; flex: none; }
.pal-o[aria-selected=true] { background: var(--sel-bg); box-shadow: inset 3px 0 0 var(--sel-edge); }
.pal-cls { width: 10px; height: 10px; border-radius: 2px; flex: none; margin: 0 3px; }
.pal-ai { display: inline-flex; color: var(--brand-800); background: var(--amber); border-radius: var(--r-sm); padding: 1px; flex: none; }
.pal-ai .ai-ico { color: var(--brand-800); }
.pal-empty { color: var(--text-2); font-size: var(--fs-sm); padding: var(--sp-5) var(--sp-4); text-align: center; }
.pal-act { flex: none; margin-inline-start: auto; font-size: var(--fs-xs); font-weight: 600; color: var(--accent); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 1px 6px; }
.pal-sub + .pal-act { margin-inline-start: 8px; }
.pal-o.off { color: var(--text-3); cursor: default; }
.pal-o.off svg.i { color: var(--text-3); }
.pal-foot { display: flex; gap: var(--sp-4); padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-2); }
.pal mark { background: none; color: inherit; font-weight: 700; text-decoration: underline; text-decoration-color: var(--sel-edge); text-underline-offset: 2px; }

.hpage { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--gap); max-width: 1440px; }
:root[data-density=compact] .hpage { padding: var(--sp-4); }
.hpage h1 { font-size: var(--fs-2xl); line-height: 34px; margin: 0; }
.hpage.rvtm h1, .hpage.ifreg h1 { font-size: var(--fs-xl); line-height: 28px; }
.rvtm-freeze :is(th, td).rvtm-fz-id, .rvtm-freeze :is(th, td).rvtm-fz-req { position: sticky; z-index: 1; background: var(--surface); }
.rvtm-freeze :is(th, td).rvtm-fz-id { inset-inline-start: 0; }
.rvtm-freeze :is(th, td).rvtm-fz-req { inset-inline-start: var(--rvtm-id-w, 4.5em); min-width: 12em; max-width: 28em; box-shadow: inset -1px 0 0 var(--border); }
.rvtm-freeze tr.sel :is(td.rvtm-fz-id, td.rvtm-fz-req) { background: linear-gradient(var(--sel-bg), var(--sel-bg)), var(--surface); }
.rvtm-freeze thead :is(th.rvtm-fz-id, th.rvtm-fz-req) { z-index: 2; background: var(--surface-2); }
.hpage h2 { font-size: var(--fs-lg); line-height: 24px; margin: 0; }
.hp-head { display: flex; align-items: flex-end; gap: var(--sp-4); flex-wrap: wrap; }
.hp-titles { flex: 1; min-width: 240px; }
.hp-titles p { margin: 4px 0 0; }
.hp-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.hp-toolbar { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.hp-search { width: 280px; }
.health { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--gap); }
.health > div { display: flex; }
.hc { flex: 1; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; hyphens: auto; text-align: start; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--tone, var(--border-strong)); border-radius: var(--r-card); padding: var(--pad); cursor: pointer; color: var(--text); font: inherit; min-width: 0; }
a.hc:hover, button.hc:hover { border-color: var(--border-strong); border-top-color: var(--tone, var(--border-strong)); background: var(--hover-bg); text-decoration: none; }
div.hc { cursor: default; }
.hc.on { box-shadow: inset 0 0 0 2px var(--sel-edge); }
.hc .v { font-size: var(--fs-2xl); line-height: 32px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hc .v.small-v { font-size: var(--fs-xl); line-height: 32px; }
.hc .t { display: flex; gap: 6px; align-items: center; font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.hc .d { font-size: var(--fs-xs); color: var(--text-2); }
.hc .lv { font-size: var(--fs-lg); font-weight: 600; }
.hc.danger { --tone: var(--danger); } .hc.warn { --tone: var(--warn); } .hc.ok { --tone: var(--ok); } .hc.info { --tone: var(--info); } .hc.plain { --tone: var(--border-strong); }
.metrics .hc .t { font-weight: 500; color: var(--text-2); }
.lc { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--gap); }
.lc .hc { border-top-width: 1px; }
.lc .hc .t { color: var(--text-2); }
.bar { display: block; height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand-700); }
[data-theme=dark] .bar > i { background: var(--brand-300); }
.hpage .cols-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--gap); }
@media (max-width: 1100px) { .hpage .cols-2 { grid-template-columns: minmax(0, 1fr); } }
.hp-card { padding: var(--pad); display: flex; flex-direction: column; gap: var(--sp-2); }
.hlist { list-style: none; margin: 0; padding: 0; }
.hlist li { display: flex; align-items: center; gap: var(--sp-2); padding: 8px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.hlist li:last-child { border-bottom: 0; }
.hlist li svg { color: var(--text-2); }
.hlist .meta { margin-inline-start: auto; font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; padding-inline-start: 8px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-3); }
.dot.danger { background: var(--danger); } .dot.warn { background: var(--warn); } .dot.info { background: var(--info); } .dot.ok { background: var(--ok); }
.stage-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--gap); }
.stage-page { display: flex; flex-direction: column; gap: 4px; padding: var(--pad); color: var(--text); }
.stage-page:hover { text-decoration: none; background: var(--hover-bg); border-color: var(--border-strong); }
.stage-page .muted { font-size: var(--fs-xs); }
.stage-types { display: flex; flex-wrap: wrap; gap: 6px; padding-top: var(--sp-2); border-top: 1px solid var(--border); }
.chip-link { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); }
.chip-link:hover { background: var(--sel-bg); color: var(--text); text-decoration: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 500; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.danger { background: var(--danger-bg); color: var(--danger); } .chip.info { background: var(--info-bg); color: var(--info); }
.tblwrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); overflow: auto; }
.tblwrap[tabindex]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.tbl th { position: sticky; top: 0; z-index: 1; text-align: start; font-weight: 600; font-size: var(--fs-xs); color: var(--text-2); background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 0 var(--sp-3); height: 32px; white-space: nowrap; }
.tbl td { padding: 6px var(--sp-3); height: var(--row-h); border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl td.id { font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-2); white-space: nowrap; }
.tbl td.num { font-variant-numeric: tabular-nums; }
.reg-cell { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 24px; padding: 1px 6px; margin: -1px -6px; border: 1px solid transparent; border-radius: var(--r-sm); background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; white-space: nowrap; }
.reg-cell:hover { border-color: var(--border-strong); background: var(--surface); }
.reg-cell:focus-visible { border-color: var(--accent); }
.reg-edit { min-width: 110px; max-width: 220px; }
.reg-links { display: inline; }
.reg-more { color: var(--text-2); white-space: nowrap; cursor: help; }
.reg-table td.id { white-space: nowrap; }
.reg-wrap { max-height: calc(100vh - 230px); overflow: auto; }
.reg-wrap .reg-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); }
.reg-wrap .reg-table tbody td:first-child, .reg-wrap .reg-table thead th:first-child { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--surface); }
.reg-wrap .reg-table thead th:first-child { z-index: 3; background: var(--surface-2); }
.reg-wrap .reg-table tr.selected td:first-child { background: var(--sel-bg); }
tr.rw-pad > td { padding: 0 !important; border: 0 !important; background: none !important; line-height: 0; font-size: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--hover-bg); }
.tbl tbody tr.sel td { background: var(--sel-bg); }
.tbl tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--sel-edge); }
.tbl tbody tr:focus-visible { outline-offset: -2px; box-shadow: none; }
:root[data-density=compact] .tbl td { padding-top: 3px; padding-bottom: 3px; }

:root[data-density=compact] .toolbar { padding: 5px 10px; }
:root[data-density=compact] .grid-table td { padding-top: 4px; padding-bottom: 4px; }
:root[data-density=compact] .btn { padding: 4px 10px; }
:root[data-density=compact] .btn.small { padding: 2px 7px; }

.topbar > .crumb { min-width: min(160px, 40vw); }
.pg-head { flex: none; display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding-block: 6px; padding-inline: var(--sp-5) var(--sp-4); background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 29; min-width: 0; }
:root[data-density=compact] .pg-head { min-height: 42px; padding-top: 4px; padding-bottom: 4px; padding-inline-start: var(--sp-4); }
.pg-text { flex: 1 1 auto; min-width: 0; }
.pg-title { margin: 0; font-size: 17px; line-height: 24px; font-weight: 650; color: var(--text); letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-title.wrap { white-space: normal; overflow-wrap: anywhere; }
.pg-title[hidden] { display: none; }
.pg-sub { margin: 1px 0 0; font-size: var(--fs-sm); line-height: 18px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pg-sub[hidden] { display: none; }
.pg-head.no-title .pg-text { flex: 1 1 0; }
.pg-actions { flex: 0 0 auto; display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; justify-content: flex-end; min-width: 0; max-width: 100%; }
.pg-actions[hidden] { display: none; }
.pg-actions > div, .pg-pop > div { display: flex; gap: 6px; align-items: center; }
.pg-actions .btn, .pg-more { height: 30px; padding: 0 10px; font-size: var(--fs-sm); white-space: nowrap; }
.pg-actions .split-btn .btn { padding: 0 10px; }
.pg-actions .split-btn .btn.caret { padding: 0 6px; }
.pg-actions select { height: 30px; }
.pg-actions [data-ctl=continue] { max-width: 280px; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 28px; }
.pg-more-wrap { flex: none; position: relative; }
.pg-more { display: inline-flex; align-items: center; gap: 4px; }
.pg-more[hidden] { display: none; }
.pg-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 60; min-width: 220px; max-width: min(360px, 90vw); max-height: 70vh; overflow-y: auto; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 6px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-card, 8px); box-shadow: var(--shadow-pop); }
.pg-pop[hidden] { display: none; }
.pg-pop > .btn, .pg-pop > a.btn, .pg-pop > div > .btn { justify-content: flex-start; text-align: start; border-color: transparent; background: none; height: 30px; padding: 0 10px; font-size: var(--fs-sm); white-space: nowrap; }
.pg-pop > .btn:hover:not(:disabled), .pg-pop > a.btn:hover { background: var(--hover-bg); }
.pg-pop > div { flex-wrap: wrap; padding: 2px 4px; }
.vpage { max-width: none; margin: 0; padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--gap); min-height: 0; }
:root[data-density=compact] .vpage { padding: var(--sp-4); }
.vbar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; flex: none; min-height: var(--ctl-h); }
.vbar .vnote { font-size: var(--fs-sm); color: var(--text-2); }
.vbar .vsearch { width: 220px; }
.vtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); flex: none; }
.vtab { flex: none; display: inline-flex; align-items: center; gap: 6px; height: var(--tabs-h); padding: 0 10px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--text-2); font: 500 var(--fs-sm)/1 var(--font); }
.vtab:hover { color: var(--text); text-decoration: none; }
.vtab[aria-selected=true] { color: var(--text); border-bottom-color: var(--sel-edge); font-weight: 600; }
abbr.acr { text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: 2px; cursor: help; }
abbr.acr:focus { outline: none; }
abbr.acr:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.acr-pop { position: fixed; z-index: 10050; max-width: 300px; padding: 7px 10px; border-radius: var(--r-ctl); background: var(--brand-800); color: var(--on-fill); box-shadow: var(--shadow-pop); font-size: var(--fs-sm); line-height: 1.4; font-weight: 400; text-align: start; white-space: normal; }
.acr-pop[hidden] { display: none; }
.acr-pop strong { display: block; font-weight: 600; margin-bottom: 2px; }
:root[data-theme=dark] .acr-pop { background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); }
.pres { display: flex; align-items: center; gap: 4px; white-space: nowrap; font-size: var(--fs-sm); padding: 0 4px; min-width: 0; }
.pres-sync { background: none; border: 0; padding: 2px 6px; border-radius: var(--r-ctl); font: inherit; color: inherit; cursor: pointer; opacity: .75; }
.pres-sync:hover { opacity: 1; background: var(--surface-2); }
.pres-sync[data-online=false] { opacity: .4; }
.pres-avs { display: inline-flex; align-items: center; padding-inline-start: 5px; }
.pres-av { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; padding: 0; margin-inline-start: -5px; border: 2px solid var(--surface); color: #fff; font: 600 10px/1 var(--font); letter-spacing: .02em; }
button.pres-av { cursor: pointer; position: relative; }
button.pres-av:hover, button.pres-av:focus-visible, button.pres-av[aria-describedby] { z-index: 1; }
button.pres-av:focus-visible { outline-offset: 1px; }
.pres-more { background: var(--surface-3); color: var(--text); font-size: 11px; }
:root[data-theme=dark] .pres-av { box-shadow: 0 0 0 1px var(--border-strong); }
.pres-conflicts { background: var(--danger-fill); color: var(--on-fill); border: 0; border-radius: 10px; padding: 1px 8px; font: inherit; font-size: 11px; cursor: pointer; }
.pres-pop { position: fixed; z-index: 10050; min-width: 200px; max-width: min(320px, calc(100vw - 16px)); max-height: min(420px, calc(100vh - 16px)); overflow: auto; padding: 8px; border-radius: var(--r-ctl); background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-pop); font-size: var(--fs-sm); line-height: 1.4; white-space: normal; display: flex; flex-direction: column; gap: 8px; }
.pres-pop[hidden] { display: none; }
.pres-pop-title { font-weight: 600; color: var(--text-2); }
.pres-card { display: flex; gap: 8px; align-items: flex-start; }
.pres-card .pres-av { margin: 0; width: 32px; height: 32px; font-size: 12px; }
.pres-who { min-width: 0; color: var(--text-2); }
.pres-who strong { display: block; color: var(--text); font-weight: 600; }
.pres-email, .pres-where { overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
}
.dd-item .dd-hint { float: inline-end; margin-inline-start: 18px; color: var(--muted); font-weight: 400; font-size: 12px; }
.dd-item .dd-desc { display: block; max-width: 300px; margin-top: 1px; color: var(--muted); font-weight: 400; font-size: 12px; line-height: 1.35; white-space: normal; }
.dd-item .dd-check { display: inline-block; width: 1.2em; }
.dd-row { display: flex; align-items: stretch; }
.dd-row > .dd-item { flex: 1; min-width: 0; }
.dd-aside { flex: none; background: none; border: 0; padding: 0 12px; color: var(--muted); font-size: 15px; }
.dd-aside:hover, .dd-aside:focus-visible { background: var(--accent-2); color: var(--text); }
.dd-aside:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.dd-aside[aria-checked=true] { color: var(--warn); }
.toast-row { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.toast-acts { display: inline-flex; gap: var(--sp-1); margin-inline-start: auto; }
.toast-act { background: none; border: 1px solid currentColor; color: inherit; font: inherit; font-size: var(--fs-sm); padding: 1px 8px; border-radius: var(--r-sm); cursor: pointer; }
.toast-act:disabled { opacity: .5; cursor: default; }
.toast-act:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; box-shadow: none; }
.trash-page .card-head .input { max-width: 300px; }
.trash-table td.trash-reason { max-width: 360px; }
.trash-preview h4 { margin: var(--sp-4) 0 var(--sp-2); }
.trash-rels, .trash-refs { margin: 0; padding-inline-start: 18px; }

.float-win { position: fixed; z-index: 90; display: flex; flex-direction: column; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-pop); overflow: hidden; }
.float-head { display: flex; align-items: center; gap: 2px; padding-block: 4px; padding-inline: 12px 6px; border-bottom: 1px solid var(--line); background: var(--panel-2); flex: none; }
.float-grab { flex: 1; min-width: 0; padding: 6px 0; cursor: move; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: var(--r-sm); }
.float-grab:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.float-title { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.float-head .icon-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 28px; }
.float-body { flex: 1; min-height: 0; overflow: auto; padding: 12px 16px 20px; overflow-wrap: anywhere; overscroll-behavior: contain; }
.float-body code, .float-body .admin-kv-v { white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; }
.float-resize { position: absolute; inset-inline-end: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none; border-start-start-radius: 0; border-start-end-radius: 0; border-end-end-radius: var(--r-card); border-end-start-radius: 0;
  background: linear-gradient(135deg, transparent 0 55%, var(--line-strong) 55% 62%, transparent 62% 72%, var(--line-strong) 72% 79%, transparent 79%); }
.float-resize:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.float-win .float-pop { display: none; }
.float-pop, .float-in { color: var(--text-2); }
.float-ph { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-ctl); }
.modal-head .float-pop { margin-inline-start: auto; }
.modal-head .float-pop + .icon-btn { margin-inline-start: 2px; }
@media (max-width: 760px) {
  .float-win { inset-inline-start: 0 !important; inset-inline-end: 0; top: auto !important; bottom: 0; width: auto !important; height: min(80vh, calc(100% - 16px)) !important; border-radius: var(--r-card) var(--r-card) 0 0; border-bottom: 0; }
  .float-grab { cursor: default; }
  .float-resize { display: none; }
}
.ovf-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
.ovf-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px); mask-image: linear-gradient(to right, transparent, #000 36px); }
.ovf-l.ovf-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); }

.cr-banner { display: flex; align-items: center; gap: 10px; padding: 6px 16px; background: var(--sel-bg); color: var(--ink, inherit); border-bottom: 2px solid var(--accent); font-size: var(--fs-sm); flex: none; }
.cr-banner strong { font-weight: 650; }
.cr-banner .grow { flex: 1; }
.cr-banner[data-state=preview], .cr-banner[data-state=submitted], .cr-banner[data-state=review], .cr-banner[data-state=approved] { background: var(--info-bg); border-bottom-color: var(--info); }
.cr-marker { display: inline-block; margin-inline-start: 6px; padding: 0 4px; border-radius: 3px; background: var(--accent); color: var(--on-fill); font-size: 10px; font-weight: 700; line-height: 15px; vertical-align: middle; letter-spacing: .02em; }
svg text.cr-marker { fill: var(--accent); font-size: 10px; font-weight: 700; }
.cr-pick-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; max-height: 50vh; overflow: auto; }
.cr-pick-row { text-align: start; justify-content: flex-start; display: block; width: 100%; }

.sio-sum { display: flex; flex-direction: column; gap: var(--sp-2); }
.sio-sum p { margin: 0; }
.sio-counts { font-weight: 600; }
.sio-h { font-size: 13px; margin-block: var(--sp-2) var(--sp-1); }
.sio-list { margin: 0; padding-inline-start: 20px; max-block-size: 30vh; overflow: auto; }
.sio-mism summary { cursor: pointer; }
.sio-table { border-collapse: collapse; inline-size: 100%; margin-block-start: var(--sp-1); font-size: 12px; }
.sio-table th, .sio-table td { text-align: start; padding-block: 2px; padding-inline: 6px; border-block-end: 1px solid var(--border); overflow-wrap: anywhere; }
.sio-table td.mono { font-family: var(--mono); }
.dd-item.danger { color: var(--danger); }
.set-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.set-group + .set-group { border-block-start: 1px solid var(--line); padding-block-start: var(--sp-3); margin-block-start: var(--sp-3); }
.set-h { margin: 0; font-size: var(--fs-sm); font-weight: 650; }
.set-group .field { margin-block-end: 0; }
.pref-checks { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
