/* Shared visual rhythm. Keep rich canvas, media and code surfaces intact. */
:root, body.theme-light { --border: var(--line); --card: var(--panel); --wu-focus: color-mix(in srgb, var(--accent) 32%, transparent); }
:root { --radius: 12px; }
body { text-rendering: optimizeLegibility; }
body.theme-light { --bg: #f2f5fa; --panel: #fff; --panel-2: #f7f9fc; --line: #dce3ee; --text: #18243a; --muted: #5d6b80; }
.topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "heading actions" "navigation navigation"; align-items: center; gap: 10px 18px; padding: 14px 24px 12px; background: var(--panel); }
.topbar-left { grid-area: heading; }
.topbar-head h2 { font-size: 19px; line-height: 1.35; letter-spacing: -.3px; margin: 0; }
.topbar-head p { font-size: 12px; margin: 4px 0 0; }
.topbar-actions { grid-area: actions; display: flex; flex-wrap: nowrap; gap: 8px; width: auto; }
#viewSwitch { grid-area: navigation; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; width: 100%; border: 0; border-radius: 0; overflow: visible; }
#viewSwitch button { border: 1px solid transparent; border-radius: 8px; min-height: 34px; padding: 6px 9px; font-size: 12.5px; line-height: 1.35; white-space: normal; background: var(--panel-2); color: var(--muted); }
#viewSwitch button:hover { border-color: var(--line); color: var(--text); }
#viewSwitch button.active, body.theme-light #viewSwitch button.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 5px var(--wu-focus); }
.topbar-actions > .pill-btn { min-width: 34px; padding: 6px 10px; margin: 0; }
.topbar-actions > .status { align-self: center; }
.workspace { padding-top: 18px; gap: 18px; }
.workspace > [class$="-card"] { min-width: 0; }
.svc-head { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.svc-head h3 { font-size: 19px; line-height: 1.4; letter-spacing: -.25px; }
.svc-head p { max-width: 100ch; line-height: 1.65; }
.docs-item, .upd-section, .ins-card, .gh-card, .cost-kpi, .svc-result { border-color: var(--line); }
.docs-item { padding: 16px; gap: 10px; box-shadow: 0 2px 8px rgb(12 28 50 / 3%); }
.docs-item .docs-desc, .hc-line { line-height: 1.75; }
.docs-body { grid-template-columns: repeat(auto-fill, minmax(min(100%, 390px), 1fr)); gap: 16px; }
.chip-row { gap: 6px; }
.chip-row button, .svc-tabs button { min-height: 34px; }
button, input, select, textarea { transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; box-shadow: 0 0 0 4px var(--wu-focus); }
input, select, textarea { border-radius: 8px; }
:where(button, input, select, textarea):disabled { cursor: not-allowed; }
[hidden].wu-table-tools, [hidden].wu-table-search, [hidden].wu-table-empty, [hidden].wu-result-count { display: none !important; }
.wu-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.wu-library-search, .wu-table-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.wu-library-search { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.wu-library-search input[type="search"] { flex: 1 1 220px; min-width: 120px; max-width: none; width: auto; margin: 0; min-height: 36px; }
.wu-library-search .wu-reset, .wu-table-tools .wu-reset { color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; min-height: 32px; padding: 5px 11px; font-size: 12px; white-space: nowrap; }
.wu-library-search .wu-reset:hover, .wu-table-tools .wu-reset:hover { border-color: var(--accent); }
.wu-library-search .wu-reset:disabled { opacity: .5; }
.wu-result-count { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wu-table-tools { padding: 7px 0; }
.wu-table-search { flex: 1 1 160px; max-width: 320px; margin: 0; min-width: 110px; }
.wu-table-search input { width: 100%; min-height: 32px; padding: 5px 10px; margin: 0; font-size: 12px; }
.wu-scroll-region { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.wu-table-scroll { width: 100%; }
.wu-table { border-collapse: separate !important; border-spacing: 0; min-width: 100%; font-variant-numeric: tabular-nums; }
.wu-table th { position: relative; text-align: left; padding-right: 22px !important; background: var(--panel-2); line-height: 1.4; overflow-wrap: anywhere; }
.price-table .wu-table th, .ins-table-wrap .wu-table th { position: sticky; top: 0; z-index: 1; }
.wu-table td { overflow-wrap: anywhere; }
.wu-table th, .wu-table td { padding-top: 9px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.wu-table tbody tr:hover > td { background-color: color-mix(in srgb, var(--accent) 5%, var(--panel)); }
.wu-table .wu-sortable { cursor: pointer; user-select: none; }
.wu-table .wu-sortable::after { content: "↕"; color: var(--muted); font-size: 11px; display: inline-block; margin-left: 6px; }
.wu-table th[aria-sort="ascending"]::after { content: "↑"; color: var(--accent); }
.wu-table th[aria-sort="descending"]::after { content: "↓"; color: var(--accent); }
.wu-resize { position: absolute; inset: 0 -4px 0 auto; width: 10px; cursor: col-resize; touch-action: none; z-index: 3; }
.wu-resize::before { content: ""; position: absolute; top: 22%; bottom: 22%; left: 4px; width: 2px; border-radius: 2px; background: var(--line); }
.wu-resize:hover::before, .wu-resize:focus-visible::before { background: var(--accent); }
.wu-resizing, .wu-resizing * { cursor: col-resize !important; user-select: none !important; }
.wu-filtered { display: none !important; }
.wu-table-empty { margin: 10px 0; padding: 18px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; text-align: center; background: var(--panel-2); }
@media (max-width: 1120px) {
  .topbar { padding: 12px 18px; }
  .topbar-actions { gap: 6px; }
  #viewSwitch { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .topbar { gap: 8px 12px; padding: 10px 12px; }
  .topbar-actions { display: grid; grid-template-columns: repeat(3, auto); gap: 4px 6px; justify-content: end; }
  .topbar-actions > .pill-btn { min-width: 32px; min-height: 32px; padding: 4px 8px; }
  .topbar-actions > .status { grid-column: 1 / -1; justify-self: end; min-width: 0; max-width: 116px; padding: 2px 8px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-head h2 { font-size: 17px; }
  #viewSwitch { display: flex; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; scrollbar-width: thin; }
  #viewSwitch button { flex: 0 0 auto; white-space: nowrap; min-height: 36px; }
  .workspace { padding: 12px; gap: 12px; }
  .svc-head h3 { font-size: 17px; }
  .wu-library-search, .wu-table-tools { gap: 7px; }
  .wu-library-search input[type="search"] { flex-basis: 100%; }
  .wu-table-search { max-width: none; }
  .wu-table th, .wu-table td { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  button, input, select, textarea, .edge-toggle, .app-shell { transition: none !important; }
}
/* Honor semantic visibility even when a component sets display:flex or grid. */
[hidden] { display: none !important; }
.app-shell, .main, .topbar, .topbar-actions, #viewSwitch, .workspace { min-width: 0; max-width: 100%; }
.main { overflow: clip; }
.upd-body { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.gh-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.cost-panels { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.upd-key-row label { min-width: 0; }
.upd-key-row input { width: 100%; max-width: 100%; }
.wu-table.upd-table { min-width: 640px; }
.wu-sidebar-backdrop { display: none; }
@media (max-width: 1120px) {
  .app-shell, body.sidebar-collapsed .app-shell { display: block; width: 100%; min-height: 100dvh; }
  .main { width: 100%; overflow: clip; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 90; width: min(330px, calc(100vw - 48px)); height: 100dvh; max-height: none; border-right: 1px solid var(--line); box-shadow: 8px 0 32px rgb(0 0 0 / 20%); overflow: auto; }
  body.sidebar-collapsed .sidebar { display: none; }
  .edge-toggle { z-index: 95; top: 18px; left: min(330px, calc(100vw - 48px)); height: 44px; }
  body.sidebar-collapsed .edge-toggle { left: 0; }
  body:not(.sidebar-collapsed) .wu-sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 85; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; border-radius: 0; background: rgb(7 17 33 / 45%); cursor: default; }
  .topbar-left { padding-left: 14px; }
  .workspace > [class$="-card"] { width: 100%; }
}
.cop-report-note { padding: 13px 16px; margin: 14px 0; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--panel-2); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.cop-report-note p { margin: 4px 0 0; color: var(--muted); }
body:not(.theme-light) #viewSwitch button.active { color: #09243b; }
@media (max-width: 1120px) {
  .edge-toggle { transition: color .15s ease, background .15s ease; }
}
