:root {
  /* 3DEXPERIENCE palette, measured 2026-11-28 from 3DS's public UIKit CSS (exact) and 3DX video frames;
     see docs\ui-style-3dx.md "Measured colours". Where a 3DX colour is too light to read, the same hue is
     darkened just enough for WCAG: text >= 4.5:1, icons and borders >= 3:1, also on --row-sel. */
  --bg: #f1f1f1;           /* UIKit grey canvas */
  --panel: #ffffff;
  --panel-2: #f4f5f6;      /* UIKit hover / thumbnail grey */
  --line: #e2e4e3;         /* UIKit hairline */
  --text: #3d3d3d;         /* UIKit body text, 10.9:1 on white */
  --muted: #636567;        /* UIKit #77797c darkened: 4.65:1 on --row-sel */
  --accent: #1c6aa1;       /* UIKit blue #368ec4 darkened: white text 5.8:1, 4.6:1 on --row-sel */
  --accent-hover: #005686; /* UIKit dark blue (link hover, pressed button) */
  --accent-bright: #368ec4;/* UIKit blue as-is: tab underlines, selection bars (non-text only) */
  --accent-soft: #d5e8f2;  /* UIKit active-button tint */
  --gold: #e87b00;         /* UIKit warning orange: borders and icons only; text uses --warn */
  --warn: #8f4c00;         /* UIKit dark warning: 6.6:1 on white */
  --danger: #c23b25;       /* UIKit error #ea4f37 darkened: white text 5.3:1 */
  --danger-text: #c23b25;
  --on-accent: #ffffff;
  --field-border: #8a8c8f; /* 3.4:1 on --panel, so inputs are visible (UIKit's #e2e4e3 is not) */
  --focus: #2a78ae;        /* 3.8:1 on --row-sel */
  --row-hover: #f4f5f6;    /* UIKit table hover */
  --row-sel: #d9e7f4;      /* 3DX task pane selected row */
  /* Top bar: 3DX blue bar (UIKit dark blue), white text 7.9:1 */
  --topbar: #005686; --topbar-text: #ffffff; --topbar-muted: #cfe3f0; --topbar-line: rgba(255,255,255,.32);
  /* Maturity: 3DX colours the current state blue (lifecycle chart); the other hues are UIKit's
     success/warning/neutral pairs (dark text on the light alert tint), all >= 4.5:1 */
  --work: #005686;  --work-bg: #d5e8f2;
  --frozen: #8f4c00; --frozen-bg: #fff3e9;
  --released: #477738; --released-bg: #edf6eb;
  --obsolete: #636567; --obsolete-bg: #f1f1f1;
  /* Reservation icons like 3DX: grey free, green mine, red others; darkened to >= 3:1 on selected rows */
  --lock-free: #7a7c80; --lock-mine: #2e8526; --lock-other: #c23b25;
  --shadow: 0 4px 16px rgba(0,40,70,.14);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12171d; --panel: #1a2029; --panel-2: #202733; --line: #313a46; --text: #e3e8ee; --muted: #9ba6b3;
    --accent: #78befa; --accent-hover: #a5d4fb; --accent-bright: #78befa; --accent-soft: #1b3049; --row-hover: #222b36; --row-sel: #1e3650;
    --topbar: #0a3352; --topbar-text: #ffffff; --topbar-muted: #c5d1dd; --topbar-line: rgba(255,255,255,.22);
    --work: #78befa; --work-bg: #1c2d42; --frozen: #f2a65a; --frozen-bg: #3a2a14;
    --released: #8ed07f; --released-bg: #193222; --obsolete: #aab1ba; --obsolete-bg: #2a2e33;
    --lock-free: #8e99a6; --lock-mine: #6ccb5c; --lock-other: #ff7a66;
    --warn: #f2a65a; --danger-text: #ff8f86; --on-accent: #06192b; --field-border: #6b7684; --focus: #78befa;
    --shadow: 0 6px 24px rgba(0,0,0,.5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12171d; --panel: #1a2029; --panel-2: #202733; --line: #313a46; --text: #e3e8ee; --muted: #9ba6b3;
  --accent: #78befa; --accent-hover: #a5d4fb; --accent-bright: #78befa; --accent-soft: #1b3049; --row-hover: #222b36; --row-sel: #1e3650;
  --topbar: #0a3352; --topbar-text: #ffffff; --topbar-muted: #c5d1dd; --topbar-line: rgba(255,255,255,.22);
  --work: #78befa; --work-bg: #1c2d42; --frozen: #f2a65a; --frozen-bg: #3a2a14;
  --released: #8ed07f; --released-bg: #193222; --obsolete: #aab1ba; --obsolete-bg: #2a2e33;
  --lock-free: #8e99a6; --lock-mine: #6ccb5c; --lock-other: #ff7a66;
  --warn: #f2a65a; --danger-text: #ff8f86; --on-accent: #06192b; --field-border: #6b7684; --focus: #78befa;
  --shadow: 0 6px 24px rgba(0,0,0,.5); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.4 "Segoe UI", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

.btn { border: 1px solid var(--line); background: var(--panel); padding: 4px 12px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.danger { color: var(--danger-text); }
.btn:disabled { cursor: not-allowed; }
.btn.small { padding: 2px 8px; font-size: 12px; }
.btn.icon { padding: 4px 8px; font-size: 16px; line-height: 1.2; text-decoration: none; color: var(--text); }
input[type=text], input[type=password], input[type=search], select, textarea {
  border: 1px solid var(--field-border); background: var(--panel); border-radius: 4px; padding: 8px 8px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: var(--focus); }
/* One keyboard focus ring for everything (buttons, links, rows, tree nodes, menu items). */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.grid tbody tr:focus-visible, .tree .node:focus-visible, .menu .mi:focus-visible { outline-offset: -2px; }
.grid tbody tr:focus { outline-offset: -2px; }
.grid tbody tr:focus:not(:focus-visible) { outline: none; }

/* layout */
.shell { display: grid; grid-template-rows: 48px 1fr; height: 100vh; }
.top { display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; display: flex; align-items: center; text-decoration: none; color: var(--text); }
.top .search { flex: 1; max-width: 460px; }
.top .spacer { flex: 1; }
.top .who { color: var(--muted); }
.body { display: grid; grid-template-columns: 260px 1fr; min-height: 0; }
.tree { background: var(--panel); border-right: 1px solid var(--line); overflow: auto; padding: 8px 0; }
.main { overflow: auto; padding: 16px 20px; min-width: 0; }

.tree .node { display: flex; align-items: center; gap: 4px; padding: 4px 8px; cursor: pointer; border-radius: 4px; margin: 0 8px; user-select: none; }
.tree .node:hover { background: var(--row-hover); }
.tree .node.sel { background: var(--row-sel); font-weight: 600; }
.tree .twist { width: 16px; text-align: center; color: var(--muted); font-size: 10px; }
.tree .node.nav-only { color: var(--muted); }

.crumbs { color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
h1 { font-size: 20px; margin: 0 0 12px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; }

/* table */
.tablewrap { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: auto; }
table.grid { border-collapse: collapse; width: 100%; }
.grid th, .grid td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid th { position: sticky; top: 0; background: var(--panel-2); font-weight: 600; color: var(--muted); font-size: 12px; }
.grid th button.sort .ic { margin-left: 2px; vertical-align: -2px; }
.tree .twist .ic { vertical-align: -1px; }
.menu .mi .hint .ic { vertical-align: -1px; }
.grid th button.sort { background: none; border: 0; padding: 2px 0; margin: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.grid th button.sort:hover { color: var(--text); }
.grid tbody tr { cursor: default; }
.grid tbody tr:hover { background: var(--row-hover); }
.grid tbody tr.sel { background: var(--row-sel); }
.grid tbody tr.old td { color: var(--muted); }
.grid td.name { font-weight: 600; }
/* File-type marks (ICONS in app.js): line icons in the type colours the old PRT/ASM/DRW badges used */
:root { --t-part: #c4572d; --t-asm: #2f6fb3; --t-drw: #6b5bb5; --t-solid: #3d8b8b; --t-pdf: #b3261e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --t-part: #f0875c; --t-asm: #6aa8ea; --t-drw: #a497ec; --t-solid: #6cc4c4; --t-pdf: #f07a72; } }
:root[data-theme="dark"] { --t-part: #f0875c; --t-asm: #6aa8ea; --t-drw: #a497ec; --t-solid: #6cc4c4; --t-pdf: #f07a72; }
.ico { display: inline-flex; vertical-align: -3px; line-height: 0; margin-right: 8px; color: var(--muted); }
.ico svg { display: block; }
.ico.Part { color: var(--t-part); } .ico.Assembly { color: var(--t-asm); }
.ico.Drawing, .ico.DXF, .ico.DWG, .ico.eDrawing { color: var(--t-drw); }
.ico.STEP, .ico.IGES, .ico.Parasolid, .ico.STL { color: var(--t-solid); } .ico.PDF { color: var(--t-pdf); }
.latest { color: var(--released); font-weight: 700; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.drop { outline: 2px dashed var(--accent); outline-offset: -6px; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.pill.In-Work { color: var(--work); background: var(--work-bg); }
.pill.Frozen { color: var(--frozen); background: var(--frozen-bg); }
.pill.Released { color: var(--released); background: var(--released-bg); }
.pill.Obsolete { color: var(--obsolete); background: var(--obsolete-bg); }

/* context menu */
.menu { position: fixed; z-index: 50; min-width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); padding: 4px; }
.menu .mi { padding: 8px 12px; border-radius: 4px; cursor: pointer; display: flex; justify-content: space-between; gap: 16px;
  width: 100%; border: 0; background: none; text-align: left; font: inherit; color: inherit; }
.menu .mi:hover, .menu .mi:focus { background: var(--row-hover); }
.menu .mi.off { color: var(--muted); cursor: default; }
.menu .mi.off:hover { background: none; }
.menu .mi .hint { color: var(--muted); font-size: 12px; }
.menu .sep { height: 1px; background: var(--line); margin: 4px 8px; }
.menu .sub { position: relative; }
.menu .sub > .menu { display: none; position: absolute; left: 100%; top: -4px; }
.menu .sub:hover > .menu, .menu .sub.open > .menu { display: block; }

/* modal */
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 0; background: var(--panel); color: var(--text); box-shadow: var(--shadow); width: min(520px, 94vw); }
dialog::backdrop { background: var(--backdrop); }
dialog .hd { padding: 16px 20px; font-weight: 700; border-bottom: 1px solid var(--line); }
dialog .bd { padding: 16px 20px; display: grid; gap: 12px; max-height: 70vh; overflow: auto; }
dialog .ft { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
label.f { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
label.f > span { font-weight: 600; }

/* item page */
.cols { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 16px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.card > .hd { padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.card > .bd { padding: 12px 16px; }
dl.props { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; word-break: break-word; }
.revblock { border-bottom: 1px solid var(--line); padding: 12px 16px; }
.revblock:last-child { border-bottom: 0; }
.revhead { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.revhead .r { font-size: 16px; font-weight: 700; }
.ver { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 2px 8px; padding: 4px 0; color: var(--muted); font-size: 13px; align-items: baseline; }
.ver .vlinks { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: flex-end; }
.ver .vwhy { grid-column: 2 / -1; font-size: 12px; color: var(--text); background: var(--panel-2); padding: 4px 8px; }
.ver b { color: var(--text); }
.hist { font-size: 13px; }
.hist div { padding: 4px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.hist b { color: var(--text); font-weight: 600; }

/* previews, BOM, tree check-in */
img.thumb { width: 34px; height: 26px; object-fit: contain; vertical-align: middle; margin-right: 8px; border-radius: 2px; background: var(--img-bg); border: 1px solid var(--line); }
img.preview { display: block; width: 100%; max-height: 300px; object-fit: contain; background: var(--img-bg); border-radius: 4px; }
.viewer { min-height: 300px; overflow: hidden; }
.viewer canvas { display: block; width: 100% !important; height: auto !important; touch-action: none; }
.vtools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vtools .btn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.vtools .vhint { margin-left: auto; color: var(--muted); font-size: 12px; }
.vreadout { min-height: 1.4em; font-size: 13px; color: var(--muted); white-space: pre-wrap; }
.vreadout b { color: var(--text); }
.tag { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 4px; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); }
.tag.warn { color: var(--warn); border-color: var(--gold); background: transparent; }
.grid.bom td.name a { color: inherit; }
.treeprog { position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 55; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--dialog-shadow); max-height: 45vh; display: grid; grid-template-rows: auto auto 1fr; }
.treeprog .hd { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; font-weight: 700; }
.treeprog .bar { height: 4px; background: var(--line); margin: 0 12px; border-radius: 2px; overflow: hidden; }
.treeprog .fill { height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.treeprog .lines { overflow: auto; padding: 8px 12px; font-size: 13px; display: grid; gap: 4px; }
.treeprog .lines .err { color: var(--danger-text); }

/* explorer */
.grid.explorer tbody tr { user-select: none; }
.grid.explorer tr.cut { opacity: .45; }
.grid.explorer td.name .nm { display: inline-flex; flex-direction: column; vertical-align: middle; line-height: 1.2; }
.grid.explorer td.name .fname { font-size: 11px; font-weight: 400; color: var(--muted); }
.grid.explorer .fico { margin-right: 8px; }
.droptarget, .tree .node.droptarget { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft) !important; }
input.rename { width: auto; min-width: 220px; padding: 2px 8px; font-weight: 600; }
.dragghost { position: fixed; top: -100px; left: -100px; padding: 4px 12px; border-radius: 2px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.bell { position: relative; }
.bell .count { position: absolute; top: -4px; right: -4px; min-width: 16px; padding: 0 4px; border-radius: 8px; font-size: 10px; line-height: 16px; background: var(--danger); color: var(--on-strong); display: none; }
.bell.has .count { display: block; }
.swbar .stale { font-size: 12px; color: var(--warn); }
.swbar .stale.local { color: var(--muted); }

.linkmark { color: var(--accent); font-weight: 400; }
/* Icons from ICONS in app.js: inline SVG, coloured by currentColor */
.ic { display: inline-flex; vertical-align: -3px; line-height: 0; flex: none; }
.ic svg { display: block; }
.ic-folder { color: var(--muted); }
.tree .node .ic-folder { margin-right: 8px; }
.bell .ic, .top .btn .ic { vertical-align: middle; }
.stale .ic { vertical-align: -3px; }
.menu .note { display: inline-flex; align-items: center; gap: 8px; }
.menu .note .ic { color: var(--accent); }
.ver .graph .ic { vertical-align: -2px; }
.treeprog .lines .ic { vertical-align: -1px; }
.grid.treeplan td.tstat { text-align: center; width: 28px; }
.grid.treeplan td.tstat.new { color: var(--work); }
.grid.treeplan td.tstat.changed { color: var(--warn); }
.grid.treeplan td.tstat.same { color: var(--released); }
.grid.treeplan td.tstat.locked { color: var(--danger-text); }
.grid.treeplan td.tstat.lib { color: var(--muted); }
.grid.treeplan select.small, .toolbar select.small { padding: 2px 4px; font-size: 12px; width: auto; }
.vtools select.vmode { width: auto; padding: 2px 8px; font-size: 12px; }

/* admin */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 8px 16px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--text); border-color: var(--accent-bright); font-weight: 600; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix input[type=text] { width: 140px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; }
.login .card { width: min(380px, 92vw); }
.login .bd { display: grid; gap: 12px; }
.login .err { color: var(--danger-text); min-height: 1.2em; }

/* toasts */
#toasts { position: fixed; bottom: 16px; right: 16px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 4px; box-shadow: var(--shadow); max-width: 420px; }
.toast.err { background: var(--danger); color: var(--on-strong); display: flex; gap: 12px; align-items: flex-start; }
.toast.err .msg { flex: 1; }
.toast .x { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0 2px; line-height: 1.2; }
.toast .x:focus-visible { outline-color: var(--on-strong); }
/* Shown by route() when a page takes longer than 300 ms */
.loading { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); z-index: 40; padding: 4px 16px; border-radius: 2px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--muted); font-size: 13px; }

/* SolidWorks sidebar */
.embed .body { grid-template-columns: 1fr; }
.embed .tree { display: none; }
.embed .main { padding: 12px; }
.embed .top { padding: 0 12px; gap: 8px; }
.embed .top .who, .embed .top .brand { display: none; }
.embed .grid th.wide, .embed .grid td.wide { display: none; }
.embed .grid th, .embed .grid td { padding: 8px 4px; }
.embed .grid td.name .ico { display: none; }
.embed h1 { font-size: 16px; }
.swbar { background: var(--accent-soft); border: 1px solid var(--line); padding: 8px 12px; margin-bottom: 12px; display: grid; gap: 8px; }
.swbar .t { font-size: 12px; color: var(--muted); }
.swbar .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.folderpick { margin-bottom: 8px; }

@media (max-width: 760px) {
  .body { grid-template-columns: 1fr; }
  .tree { display: none; }
  .cols { grid-template-columns: 1fr; }
  .main { padding: 12px 16px; }
}

/* Version rows: how exactly a check-in recorded its parts (API v2 graph_status) */
.ver .graph { font: inherit; font-size: 11px; padding: 1px 8px; border-radius: 2px; border: 1px solid var(--line); background: none;
  white-space: nowrap; cursor: pointer; }
.ver .graph.complete { color: var(--released); border-color: var(--released); }
.ver .graph.incomplete { color: var(--warn); border-color: var(--gold); }
.ver .graph.legacy { color: var(--muted); border-color: var(--field-border); }
/* Narrow screens and the SolidWorks pane: badge and links wrap under the details */
@media (max-width: 760px) {
  .ver { grid-template-columns: 52px minmax(0, 1fr); }
  .ver .vlinks { grid-column: 2; justify-content: flex-start; }
}
.embed .ver { grid-template-columns: 44px minmax(0, 1fr); }
.embed .ver .vlinks { grid-column: 2; justify-content: flex-start; }

/* Top bar version chip */
.ver-chip { font-size: 11px; color: var(--muted); white-space: nowrap; margin-right: 4px; }
.shell.embed .ver-chip { font-size: 10px; }
/* SolidWorks pane (UI review 2026-11-21, items 1, 2, 5, 6, 7, 12, 17) */
.shell.embed { grid-template-rows: 48px auto 1fr; }
.shell.embed > .swbar { margin: 8px 12px 0; }
.embed .top { padding: 0 8px; gap: 8px; }
/* No room for these in the pane: the name, Refresh and the version (the last two are in the menu). */
/* The pane keeps its Home button: it is the only way back to the top folder there. */
.embed .top .spacer, .embed .top .ver-chip, .embed .top button.btn.icon[aria-label="Refresh"] { display: none; }
.embed .top .search { flex: 1 1 100px; min-width: 100px; max-width: none; }
.embed #changes-btn .ico-only { display: none; }
@media (max-width: 340px) {
  .embed #changes-btn { padding: 4px 8px; font-size: 16px; line-height: 1.2; }
  .embed #changes-btn .lbl { display: none; }
  .embed #changes-btn .ico-only { display: inline; }
}
.embed .grid .pane-hide { display: none; }
.embed .grid td.name { white-space: normal; max-width: 0; width: 100%; }
.embed .grid.explorer td.name .nm { display: inline-flex; max-width: calc(100% - 42px); min-width: 0; }
.embed .grid.explorer td.name .title { overflow-wrap: anywhere; }
.embed .grid.explorer td.name .fname { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed .grid .lock { font-size: 15px; }
.embed .btn.small { padding: 4px 12px; font-size: 13px; min-height: 28px; }
.embed h1 { overflow-wrap: anywhere; }
.istatus { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: -8px 0 12px; font-size: 13px; }
.tcards { overflow: auto; display: grid; gap: 8px; }
.tcard { border: 1px solid var(--line); padding: 8px 12px; display: grid; gap: 8px; background: var(--panel-2); }
.tcard-hd { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; overflow-wrap: anywhere; }
.tcard .tstat { line-height: 0; }
.tcard .tstat.new { color: var(--work); }
.tcard .tstat.changed { color: var(--warn); }
.tcard .tstat.same { color: var(--released); }
.tcard .tstat.locked { color: var(--danger-text); }
.tcard .tstat.lib { color: var(--muted); }
.tcard .tvault { color: var(--muted); font-size: 12px; }
.tcard .twhy { color: var(--muted); font-size: 12px; }
.tcard .tfields { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.tcard .tfields label { display: grid; gap: 2px; font-size: 11px; color: var(--muted); font-weight: 600; }
.tcard .tfields select { padding: 4px 8px; font-size: 13px; }
.tcard-hd > b { flex: 1 1 120px; min-width: 0; }

/* ------------------------------------------------------------------
   3DEXPERIENCE-style skin (2026-11-22, docs/ui-style-3dx.md): dark top bar, dense grid,
   state tags with a dot, reservation padlocks, information panel, tile view. */
body { font-size: 13px; }
.btn { border-radius: 4px; border-color: var(--field-border); min-height: 28px; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.small { min-height: 24px; }
input[type=text], input[type=password], input[type=search], select, textarea { border-radius: 4px; }

.shell { grid-template-rows: 44px 1fr; }
.top { background: var(--topbar); color: var(--topbar-text); border-bottom: 0; box-shadow: 0 1px 0 var(--line); position: relative; z-index: 2; }
.top .brand { color: var(--topbar-text); font-weight: 600; font-size: 15px; }
.top .btn { background: transparent; border-color: var(--topbar-line); color: var(--topbar-text); }
.top .btn:hover { background: var(--topbar-hover); border-color: var(--topbar-btn-line); }
.top .btn.icon { color: var(--topbar-text); border-color: transparent; }
.top .btn.icon:hover { border-color: var(--topbar-line); }
.top .ver-chip { color: var(--topbar-muted); }
.top #changes-btn { color: var(--topbar-text); }
.top input[type=search] { border-radius: 2px; border: 1px solid transparent; background: var(--search-bg); color: var(--search-text); padding: 4px 16px; }
.top input[type=search]::placeholder { color: var(--search-ph); }
.top :focus-visible { outline-color: var(--top-focus); }
.top input:focus { outline: 2px solid var(--top-focus); outline-offset: 1px; border-color: transparent; }
.shell.embed { grid-template-rows: 44px auto 1fr; }

.tree { padding: 8px 0; }
.tree .node { border-radius: 0; margin: 0; padding: 4px 12px; }
.tree .node.sel { background: var(--row-sel); box-shadow: inset 3px 0 0 var(--accent-bright); }
.main { padding: 16px 20px; }
h1 { font-size: 18px; font-weight: 600; }
.toolbar { gap: 8px; }

.tablewrap { border-radius: 4px; }
.grid th, .grid td { padding: 8px 12px; }
.grid th { font-weight: 600; font-size: 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.grid tbody tr.sel { background: var(--row-sel); box-shadow: inset 3px 0 0 var(--accent-bright); }
.grid.explorer td.name .pn { font-size: 11px; font-weight: 400; color: var(--muted); }
.embed .grid.explorer td.name .pn { display: block; overflow-wrap: anywhere; }
.card { border-radius: 4px; }
.card > .hd { padding: 8px 12px; font-weight: 600; background: var(--panel-2); border-radius: 4px 4px 0 0; }
.card > .bd { padding: 12px 12px; }
dialog { border-radius: 6px; }
.menu { border-radius: 4px; }
.menu .mi { border-radius: 2px; }
.tabs a.on { border-color: var(--accent-bright); }

/* Maturity tags: text colour on a light tint, with a dot of the same colour */
.pill { border-radius: 2px; padding: 1px 8px 1px 8px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 4px; vertical-align: 1px; }

/* Reservation padlocks: gray free, green yours, red someone else's (holder in title and aria-label) */
.lock { display: inline-grid; place-items: center; min-width: 24px; min-height: 24px; vertical-align: middle; }
.lock svg { display: block; }
.lock.free { color: var(--lock-free); }
.lock.mine { color: var(--lock-mine); }
.lock.other { color: var(--lock-other); }
.lockname { display: inline-flex; align-items: center; gap: 2px; }
.embed .grid .lock { font-size: inherit; }
.lockhd { display: inline-block; vertical-align: -2px; }
.tag.lib { color: var(--work); background: var(--work-bg); border-color: transparent; }

/* Item page: information panel on the right (wide screens), first when stacked */
.cols.info { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); grid-template-areas: "main panel"; gap: 16px; }
.cols.info > .infopanel { grid-area: panel; display: grid; gap: 12px; align-content: start; min-width: 0; }
.cols.info > .infomain { grid-area: main; display: grid; gap: 12px; align-content: start; min-width: 0; }
.infopanel dl.props { grid-template-columns: 110px minmax(0, 1fr); font-size: 13px; }
.pgroup { border-top: 1px solid var(--line); padding: 4px 0; }
.pgroup:first-child { border-top: 0; }
.pgroup > summary { cursor: pointer; font-weight: 600; padding: 4px 0; min-height: 24px; }
.pgroup .pcount { color: var(--muted); font-weight: 400; }
.pgroup dl.props { margin: 4px 0 8px 16px; }
@media (max-width: 900px) {
  .cols.info { grid-template-columns: 1fr; grid-template-areas: "panel" "main"; }
}
.embed .cols.info { grid-template-columns: 1fr; grid-template-areas: "panel" "main"; }
.embed .infopanel dl.props { grid-template-columns: 96px minmax(0, 1fr); }

/* Folder view switch and tiles */
.viewswitch { display: inline-flex; }
.viewswitch .btn { border-radius: 0; padding: 4px 8px; display: inline-grid; place-items: center; min-width: 30px; }
.viewswitch .btn:first-child { border-radius: 4px 0 0 4px; }
.viewswitch .btn:last-child { border-radius: 0 4px 4px 0; margin-left: -1px; }
.viewswitch .btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { display: grid; gap: 2px; padding: 8px; height: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  color: var(--text); text-decoration: none; min-width: 0; }
.tile:hover { border-color: var(--accent); background: var(--row-hover); }
.tile .tthumb { display: grid; place-items: center; height: 96px; background: var(--panel-2); border-radius: 2px; border: 1px solid var(--line); overflow: hidden; margin-bottom: 4px; }
.tile .tthumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tile .tthumb .ico { margin: 0; }
.tile .tthumb .ic-folder { color: var(--muted); }
.tile .tthumb:has(img) { background: var(--img-bg); }
.tile .tname { font-weight: 600; overflow-wrap: anywhere; }
.tile .fname { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .tmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; font-size: 12px; color: var(--muted); }
.embed .tiles { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.embed .tile .tthumb { height: 72px; }

/* ------------------------------------------------------------------
   3DEXPERIENCE UIKit layer (2026-11-30). Values copied from 3DS's public UIKit stylesheet (3DSwym / 3DPassport
   UIKIT.css): Arial 14px, 38px buttons and fields with 4px corners, grey default buttons, light-blue primary,
   3px tab underline, dialogs with a grey footer, dropdown items with hairlines and a 5px left bar.
   Sam asked for an exact match, so the UIKit colours are used as they are (some are below WCAG text contrast;
   see docs/ui-style-3dx.md). Keyboard focus rings stay (UIKit has none). Tokens below so dark mode follows. */
:root {
  --accent: #368ec4; --accent-hover: #005686; --accent-bright: #368ec4; --muted: #77797c; --focus: #368ec4;
  --link: #368ec4; --link-hover: #005686;
  --btn-bg: #f1f1f1; --btn-border: #b4b6ba; --btn-text: #3d3d3d;
  --btn-hover-bg: #e2e4e3; --btn-hover-border: #77797c; --btn-press-bg: #d1d4d4; --btn-press-border: #3d3d3d;
  --btn-on-bg: #d5e8f2; --btn-on-text: #005686; --btn-on-border: #368ec4;
  --btn-off-text: #b1b1b1; --btn-off-border: #e1e2e3;
  --pri-bg: #42a2da; --pri-border: #368ec4; --pri-hover-bg: #368ec4; --pri-hover-border: #005686;
  --pri-press-bg: #005686; --pri-press-border: #003c5a; --pri-off-bg: #abd1e8; --pri-off-border: #a6c9df;
  --err: #ea4f37; --err-dark: #844138; --err-tint: #fff0ee; --ok: #57b847; --ok-tint: #edf6eb; --info: #00b8de;
  --input-border: #b4b6ba; --input-off-bg: #f1f1f1; --footer-bg: #f1f1f1; --footer-inset: #f9f9f9;
  --menu-line: #e2e4e3; --menu-hover: #f4f5f6; --menu-bar: #77797c; --card-border: rgba(0,0,0,.15);
  --card-shadow: 0 1px 2px rgba(0,0,0,.175); --dialog-border: #d1d4d4; --dialog-shadow: 0 5px 15px rgba(0,0,0,.25);
  --toast-shadow: 0 1px 1px rgba(0,0,0,.3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #78befa; --accent-hover: #a5d4fb; --accent-bright: #78befa; --muted: #9ba6b3; --focus: #78befa;
    --link: #78befa; --link-hover: #a5d4fb;
    --btn-bg: #262e3a; --btn-border: #4a5563; --btn-text: #e3e8ee; --btn-hover-bg: #2f3947; --btn-hover-border: #8e99a6;
    --btn-press-bg: #39434f; --btn-press-border: #c5d1dd; --btn-on-bg: #1b3049; --btn-on-text: #a5d4fb; --btn-on-border: #78befa;
    --btn-off-text: #5f6a77; --btn-off-border: #313a46;
    --pri-bg: #2f8ac9; --pri-border: #78befa; --pri-hover-bg: #368ec4; --pri-hover-border: #a5d4fb;
    --pri-press-bg: #005686; --pri-press-border: #78befa; --pri-off-bg: #24465f; --pri-off-border: #2d5675;
    --err: #ff7a66; --err-dark: #ffb3a7; --err-tint: #3a1f1b; --ok: #6ccb5c; --ok-tint: #193222; --info: #4fd3ef;
    --input-border: #4a5563; --input-off-bg: #202733; --footer-bg: #202733; --footer-inset: #262e3a;
    --menu-line: #313a46; --menu-hover: #222b36; --menu-bar: #8e99a6; --card-border: #313a46;
    --card-shadow: 0 1px 2px rgba(0,0,0,.5); --dialog-border: #313a46; --dialog-shadow: 0 5px 15px rgba(0,0,0,.6);
    --toast-shadow: 0 1px 3px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  --accent: #78befa; --accent-hover: #a5d4fb; --accent-bright: #78befa; --muted: #9ba6b3; --focus: #78befa;
  --link: #78befa; --link-hover: #a5d4fb;
  --btn-bg: #262e3a; --btn-border: #4a5563; --btn-text: #e3e8ee; --btn-hover-bg: #2f3947; --btn-hover-border: #8e99a6;
  --btn-press-bg: #39434f; --btn-press-border: #c5d1dd; --btn-on-bg: #1b3049; --btn-on-text: #a5d4fb; --btn-on-border: #78befa;
  --btn-off-text: #5f6a77; --btn-off-border: #313a46;
  --pri-bg: #2f8ac9; --pri-border: #78befa; --pri-hover-bg: #368ec4; --pri-hover-border: #a5d4fb;
  --pri-press-bg: #005686; --pri-press-border: #78befa; --pri-off-bg: #24465f; --pri-off-border: #2d5675;
  --err: #ff7a66; --err-dark: #ffb3a7; --err-tint: #3a1f1b; --ok: #6ccb5c; --ok-tint: #193222; --info: #4fd3ef;
  --input-border: #4a5563; --input-off-bg: #202733; --footer-bg: #202733; --footer-inset: #262e3a;
  --menu-line: #313a46; --menu-hover: #222b36; --menu-bar: #8e99a6; --card-border: #313a46;
  --card-shadow: 0 1px 2px rgba(0,0,0,.5); --dialog-border: #313a46; --dialog-shadow: 0 5px 15px rgba(0,0,0,.6);
  --toast-shadow: 0 1px 3px rgba(0,0,0,.6);
}

body { font: 14px/1.42857 Arial, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

/* Buttons: UIKit .btn + .btn-default / .btn-primary / .btn-sm / .btn-error */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; min-height: 0; min-width: 72px;
  padding: 8px 16px 8px; font-size: 14px; font-weight: 400; line-height: 1.42857; border: 1px solid var(--btn-border);
  border-radius: 4px; background: var(--btn-bg); color: var(--btn-text); }
.btn:hover, .btn:focus-visible { background: var(--btn-hover-bg); border-color: var(--btn-hover-border); color: var(--btn-text); }
.btn:active { background: var(--btn-press-bg); border-color: var(--btn-press-border); }
.btn.on, .btn[aria-pressed="true"] { background: var(--btn-on-bg); border-color: var(--btn-on-border); color: var(--btn-on-text); }
.btn:disabled { color: var(--btn-off-text); border-color: var(--btn-off-border); background: var(--btn-bg); cursor: not-allowed; }
.btn.primary { background: var(--pri-bg); border-color: var(--pri-border); color: var(--on-strong); }
.btn.primary:hover, .btn.primary:focus-visible { background: var(--pri-hover-bg); border-color: var(--pri-hover-border); color: var(--on-strong); }
.btn.primary:active { background: var(--pri-press-bg); border-color: var(--pri-press-border); }
.btn.primary:disabled { background: var(--pri-off-bg); border-color: var(--pri-off-border); color: var(--on-strong); }
.btn.danger { background: transparent; border-color: var(--err); color: var(--err); }
.btn.danger:hover, .btn.danger:focus-visible { background: transparent; border-color: var(--err-dark); color: var(--err-dark); }
.btn.small { height: 24px; min-height: 0; min-width: 65px; padding: 1px 8px; font-size: 12px; line-height: 1.5; border-radius: 2px; }
.btn.icon { min-width: 38px; padding: 0 8px; font-size: 16px; }
.viewswitch .btn { height: 38px; min-width: 38px; padding: 0 8px; }
.viewswitch .btn[aria-pressed="true"] { background: var(--btn-on-bg); border-color: var(--btn-on-border); color: var(--btn-on-text); position: relative; z-index: 1; }
.vtools .btn.on { background: var(--btn-on-bg); border-color: var(--btn-on-border); color: var(--btn-on-text); }

/* Fields: UIKit .form-control (38px) and .input-sm (24px text, 30px select) */
input[type=text], input[type=password], input[type=search], input[type=number], select, textarea {
  height: 38px; padding: 8px 12px; border: 1px solid var(--input-border); border-radius: 4px; background: var(--panel);
  color: var(--text); font-size: 14px; line-height: 1.42857; }
textarea { height: auto; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--focus); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
input:disabled, select:disabled, textarea:disabled, input[readonly] { background: var(--input-off-bg); border-color: var(--menu-line); }
select.small, .grid.treeplan select.small, .toolbar select.small, .vtools select.vmode { height: 30px; padding: 4px 12px; font-size: 12px; border-radius: 2px; }
input.rename { height: 24px; padding: 4px 12px; border-radius: 2px; }
.tcard .tfields select { height: 30px; padding: 4px 12px; font-size: 12px; }
::placeholder { color: var(--muted); opacity: 1; }

/* Checkboxes: UIKit .toggle-primary square (grey box, blue when ticked, white tick) */
input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; flex: none; border: 1px solid var(--input-border);
  border-radius: 2px; background: var(--btn-bg); display: inline-grid; place-items: center; cursor: pointer; vertical-align: middle; }
input[type=checkbox]:hover:not(:disabled) { background: var(--btn-hover-bg); border-color: var(--btn-hover-border); }
input[type=checkbox]:checked { background: var(--pri-bg); border-color: var(--pri-border); }
input[type=checkbox]:checked:hover:not(:disabled) { background: var(--pri-hover-bg); border-color: var(--pri-hover-border); }
input[type=checkbox]:checked::after { content: ""; width: 5px; height: 10px; border: solid var(--on-strong); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
input[type=checkbox]:disabled { background: var(--input-off-bg); border-color: var(--btn-off-border); cursor: default; }
input[type=checkbox]:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.check { color: var(--text); gap: 8px; }

/* Tables: UIKit .table (8px cells, hairline rows, 2px rule under the header, #f4f5f6 hover) */
.tablewrap { border: 1px solid var(--card-border); border-radius: 0; box-shadow: var(--card-shadow); }
.grid th, .grid td { padding: 8px; border-bottom: 0; border-top: 1px solid var(--menu-line); line-height: 1.42857; }
.grid th { font-size: 14px; font-weight: 700; color: var(--text); background: var(--panel); border-top: 0; border-bottom: 2px solid var(--menu-line); vertical-align: bottom; }
.grid tbody tr:hover { background: var(--menu-hover); }
.grid tbody tr.sel, .grid tbody tr.sel:hover { background: var(--row-sel); }
.grid td.name { font-weight: 400; }
.grid.explorer td.name .title { font-weight: 700; }
.embed .grid th, .embed .grid td { padding: 8px 4px; }

/* Tabs: UIKit .tab / .tab-item */
.tabs { gap: 4px; padding: 0 4px; border-bottom: 1px solid var(--menu-line); }
.tabs a { padding: 12px 16px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 400; }
.tabs a:hover { color: var(--text); border-bottom-color: var(--muted); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent-bright); font-weight: 400; }

/* Dialogs: UIKit .modal-content / -header / -body / -footer */
dialog { border: 1px solid var(--dialog-border); border-radius: 6px; box-shadow: var(--dialog-shadow); }
dialog::backdrop { background: var(--backdrop); }
dialog .hd { padding: 0 16px 0 12px; line-height: 42px; font-size: 16px; font-weight: 700; color: var(--text); border-bottom: 1px solid var(--menu-line); }
dialog .bd { padding: 12px 16px; min-height: 60px; }
dialog .ft { padding: 12px; gap: 12px; border-top: 1px solid var(--menu-line); background: var(--footer-bg);
  box-shadow: inset 0 1px var(--footer-inset); border-radius: 0 0 6px 6px; }
dialog .ft .btn { height: 38px; }
label.f { font-size: 14px; color: var(--text); gap: 4px; }
label.f > span { font-weight: 700; }

/* Menus: UIKit .dropdown-menu-root and .item (hairlines, #f4f5f6 hover with a 5px grey bar) */
.menu { border: 1px solid var(--card-border); border-radius: 0; box-shadow: var(--card-shadow); padding: 0; font-size: 13px; min-width: 200px; }
.menu .mi { position: relative; min-height: 36px; align-items: center; padding: 4px 16px; border-radius: 0; border-bottom: 1px solid var(--menu-line); }
.menu .mi:last-child { border-bottom: 0; }
.menu .mi:hover, .menu .mi:focus { background: var(--menu-hover); }
.menu .mi:hover::before, .menu .mi:focus::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--menu-bar); }
.menu .mi.off { color: var(--btn-off-text); }
.menu .mi.off:hover::before { display: none; }
.menu .sep { height: 0; margin: 0; border-top: 1px solid var(--menu-line); }
.menu .sub > .menu { top: -1px; }

/* Cards / panels: UIKit .card */
.card { border: 1px solid var(--card-border); border-radius: 0; box-shadow: var(--card-shadow); }
.card > .hd { background: var(--panel); border-radius: 0; font-size: 14px; font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--menu-line); }
.card > .bd { padding: 12px 16px; }
.tile { border-radius: 0; border-color: var(--card-border); box-shadow: var(--card-shadow); }
.tile:hover { border-color: var(--accent-bright); background: var(--panel); }

/* Notifications: UIKit .alert-message (text block, 3px coloured left edge, soft shadow) */
.toast { background: var(--panel); color: var(--text); border: 1px solid var(--card-border); border-radius: 0; box-shadow: var(--toast-shadow);
  padding: 16px; font-size: 13px; }
.toast.err { background: var(--err-tint); color: var(--text); border-color: var(--err); }
.toast .x { color: var(--muted); font-weight: 700; }
.toast .x:hover { color: var(--text); }
.toast.err .x:focus-visible { outline-color: var(--focus); }

/* Tags: UIKit .badge shape (2px corners) */
.pill, .tag { border-radius: 2px; }

/* Top bar: 3DX blue bar, white icon buttons without frames, square-cornered search field */
.top .btn, .top .btn.icon { background: transparent; border-color: transparent; color: var(--topbar-text); height: 32px; min-width: 32px; padding: 0 12px; }
.top .btn:hover, .top .btn:focus-visible { background: var(--topbar-hover); border-color: transparent; color: var(--topbar-text); }
.top .btn:active { background: var(--topbar-press); }
.top input[type=search] { height: 30px; border-radius: 2px; border: 1px solid transparent; padding: 4px 12px; color: var(--search-text); }
.top input[type=search]::placeholder { color: var(--search-ph); }
.top input[type=search]:focus { outline: 0; box-shadow: 0 0 0 2px var(--search-ring); }
.embed .btn.small { height: 28px; padding: 1px 12px; font-size: 13px; }
.embed .top .btn { padding: 0 8px; min-width: 30px; }

/* Sign in with Microsoft (Microsoft's button guidance: white with #8c8c8c border and #5e5e5e text, or dark #2f2f2f
   with white text; Segoe UI Semibold 15px, 41px tall, 12px padding and gap, four-square logo). */
.ms-slot { display: grid; gap: 12px; }
.ms-slot[hidden] { display: none; }
.ms-btn { display: flex; align-items: center; justify-content: center; gap: 12px; height: 41px; padding: 0 12px;
  background: var(--ms-bg); color: var(--ms-text); border: 1px solid var(--ms-border); border-radius: 0; text-decoration: none;
  font: 600 15px "Segoe UI", system-ui, sans-serif; }
.ms-btn:hover { background: var(--ms-hover); color: var(--ms-text); text-decoration: none; }
.ms-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ms-logo { display: inline-flex; }
.ms-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.ms-or::before, .ms-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* Sign-in, first-sign-in name page, link result (3DEXPERIENCE card style). Provider buttons follow each brand's
   guidance: Discord blurple #5865F2 with the white logo and "Sign in with Discord"; Microsoft (dormant) white or
   #2f2f2f. Every button is full width, at least 44 px tall (touch target in the SolidWorks pane). */
.login { min-height: 100vh; padding: 16px; box-sizing: border-box; }
.login .card.auth { width: min(400px, 100%); }
.login .card.auth > .bd { display: grid; gap: 16px; padding: 20px 20px 20px; }
.login h1 { font-size: 20px; font-weight: 400; margin: 0; color: var(--text); }
.login .lead { margin: 0; color: var(--text); }
.login .fine { margin: 0; color: var(--muted); font-size: 12px; }
.login .hint { margin: -8px 0 0; color: var(--muted); font-size: 12px; }
.login .f { display: grid; gap: 4px; }
.login input[type=text], .login input[type=password] { height: 44px; font-size: 15px; box-sizing: border-box; }
.login .btn.primary { height: 44px; width: 100%; font-size: 15px; }
.login .pw-form { display: grid; gap: 12px; }
.auth-providers { display: grid; gap: 12px; }
.auth-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px;
  padding: 0 16px; box-sizing: border-box; width: 100%; border-radius: 4px; text-decoration: none; cursor: pointer;
  font: 600 15px "Segoe UI", "gg sans", system-ui, sans-serif; }
.auth-btn .logo { display: inline-flex; flex: none; }
.auth-btn:hover { text-decoration: none; }
.auth-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.auth-btn.busy { cursor: progress; opacity: .85; }
.auth-btn .spin { display: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: bv-spin .8s linear infinite; }
.auth-btn.busy .spin { display: inline-block; }
.auth-btn.busy .logo { display: none; }
@keyframes bv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .auth-btn .spin { animation-duration: 2.4s; } }
.dc-btn { background: var(--dc-bg); color: var(--on-strong); border: 1px solid var(--dc-bg); }
.dc-btn:hover { background: var(--dc-hover); border-color: var(--dc-hover); color: var(--on-strong); }
.dc-btn:focus-visible { color: var(--on-strong); }
.dc-btn:active { background: var(--dc-press); }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin-top: 4px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth-msg { border: 1px solid var(--err); background: var(--err-tint); color: var(--text); padding: 12px 12px; margin: 0; }
.auth-msg[hidden] { display: none; }
.auth-msg strong { display: block; }
.auth-msg p { margin: 4px 0 0; }
.auth-msg .code { color: var(--muted); font-size: 11px; font-family: var(--mono); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; cursor: pointer; font: inherit;
  min-height: 24px; }
.embed.login .linkbtn { min-height: 44px; }
input[aria-invalid="true"] { border-color: var(--err); }
@media (max-width: 360px) {
  .login { padding: 8px; place-items: start center; }
  .login .card.auth > .bd { padding: 16px; }
}

/* Admin > Discord */
.dc-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; border: 1px solid var(--line); }
.dc-grants { display: flex; flex-wrap: wrap; gap: 4px; }
.dc-grants .tag { margin-left: 0; }
.tag.ok { color: var(--released); background: var(--released-bg); border-color: transparent; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.dc-admin { display: grid; gap: 12px; }
.dc-admin .card { max-width: 760px; }
.dc-rows { display: grid; gap: 8px; }
.dc-row { display: grid; grid-template-columns: 1fr 180px auto; gap: 8px; align-items: center; }
@media (max-width: 520px) { .dc-row { grid-template-columns: 1fr; } }
dialog .auth-msg { margin: 0; }

/* Emergency password sign-in: notice on the login page, banner for admins, switch on Admin > Discord. */
.auth-note { border: 1px solid var(--gold); background: var(--frozen-bg); color: var(--text); padding: 12px 12px; margin: 0; }
.em-banner { background: var(--frozen-bg); color: var(--text); border-bottom: 2px solid var(--gold); padding: 8px 16px; }
.em-banner[hidden] { display: none; }
.em-banner a { margin-left: 4px; }
.em-card.on { border-color: var(--gold); }
.em-form { display: grid; gap: 12px; }
.em-form .f, .em-card .f { display: grid; gap: 4px; }
.em-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.em-card .toolbar { flex-wrap: wrap; align-items: end; }
.em-card .f.inline select { min-width: 160px; }
.embed .em-banner { padding: 8px; font-size: 13px; }
.shell:has(> .em-banner:not([hidden])) { grid-template-rows: 44px auto 1fr; }
.shell.embed:has(> .em-banner:not([hidden])) { grid-template-rows: 44px auto auto 1fr; }
dialog .hint { margin: -8px 0 0; color: var(--muted); font-size: 12px; }

/* File history: filter bar + table (2026-12-02) */
.histcard > .hd .hcount { font-weight: 400; font-size: 12px; color: var(--muted); }
.hfilters { display: flex; flex-wrap: wrap; gap: 8px 8px; align-items: center; margin-bottom: 8px; }
.hfilters select, .hfilters input[type=search] { width: auto; min-width: 140px; height: 30px; padding: 4px 12px; font-size: 13px; }
.hfilters input[type=search] { flex: 1 1 160px; }
.hdate { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.hdate input[type=date] { height: 30px; padding: 4px 8px; font-size: 13px; width: auto; border: 1px solid var(--input-border);
  border-radius: 2px; background: var(--panel); color: var(--text); }
.hquick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.hquick .grow { flex: 1; }
.histtable td { vertical-align: top; }
.histtable td.hwhen { white-space: nowrap; color: var(--muted); font-size: 13px; }
.histtable td.hwho { white-space: nowrap; }
.histtable td.hdet { white-space: normal; font-size: 13px; color: var(--text); min-width: 200px; overflow-wrap: anywhere; }
.histtable td.hempty { color: var(--muted); text-align: center; padding: 16px; }
.htag { display: inline-block; white-space: nowrap;
  color: var(--text); }
.hdet-pane { display: none; }
.embed .hdet-pane { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
.embed .histtable td.hwhen { font-size: 12px; white-space: normal; }
.embed .hfilters select, .embed .hfilters input[type=search] { min-width: 0; flex: 1 1 120px; }
.hmore { display: flex; justify-content: center; margin-top: 8px; }
.hmore .btn[hidden] { display: none; }

/* ------------------------------------------------------------------
   Layout and hierarchy pass (2026-12-02). Refines the UIKit layer above without replacing it:
   - one spacing scale in 4 px steps (--s1..--s6), two radii (2 px tags, 4 px controls; dialogs keep UIKit's 6 px);
   - fewer boxes: hairline panels with no shadow; shadows stay on menus, dialogs and toasts;
   - type levels: page title 22/400, section 15/700, body 14, meta 12-13 muted; revisions in tabular monospace;
   - maturity tags without dots, In Work (the default state) as plain text so the other states stand out;
   - the file page: a header with its state said once, tabs for the detail views, one information panel.
   Every colour is a token here (light and dark), so dark mode follows. */
:root {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --mono: Consolas, "Cascadia Mono", "Courier New", monospace;
  --on-strong: #ffffff; --img-bg: #ffffff; --backdrop: rgba(0,0,0,.5);
  --topbar-hover: rgba(255,255,255,.15); --topbar-press: rgba(255,255,255,.25); --topbar-btn-line: rgba(255,255,255,.6);
  --top-focus: #ffffff; --search-bg: #ffffff; --search-text: #3d3d3d; --search-ph: #77797c; --search-ring: #78befa;
  --ms-bg: #ffffff; --ms-text: #5e5e5e; --ms-border: #8c8c8c; --ms-hover: #f3f3f3;
  --dc-bg: #5865f2; --dc-hover: #4752c4; --dc-press: #3c45a5;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ms-bg: #2f2f2f; --ms-text: #ffffff; --ms-border: #2f2f2f; --ms-hover: #3b3b3b; --backdrop: rgba(0,0,0,.6); }
}
:root[data-theme="dark"] { --ms-bg: #2f2f2f; --ms-text: #ffffff; --ms-border: #2f2f2f; --ms-hover: #3b3b3b; --backdrop: rgba(0,0,0,.6); }

html, body { overflow-x: clip; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 14px; }
.num, .grid th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Type levels */
h1 { font-size: 22px; font-weight: 400; line-height: 1.25; margin: 0 0 var(--s3); text-wrap: balance; }
.embed h1 { font-size: 17px; }
.crumbs { font-size: 12px; margin-bottom: var(--s1); }
.main { padding: var(--s4) var(--s5) var(--s6); }
.embed .main { padding: var(--s3) var(--s2) var(--s5); }

/* Panels: a hairline, no shadow, a plain heading instead of a header bar */
.tablewrap, .card, .tile { box-shadow: none; }
.card > .hd { padding: var(--s3) var(--s4) var(--s1); border-bottom: 0; font-size: 15px; min-height: 0; gap: var(--s2); }
.card > .bd { padding: var(--s2) var(--s4) var(--s4); }
.card > .hd + table.grid, .card > .hd + .bd > table.grid:first-child { margin-top: var(--s1); }

/* Maturity tags: the tint says the state; In Work, the everyday state, is plain text */
.pill::before { content: none; }
.pill { padding: 0 var(--s2); line-height: 20px; font-size: 12px; font-weight: 700; border-radius: 2px; }
.pill.In-Work { background: transparent; color: var(--text); font-weight: 400; font-size: inherit; padding: 0; }
.tag { padding: 0 var(--s2); }

/* Toolbars: one primary, the rest in groups */
.toolbar { gap: var(--s2); margin-bottom: var(--s4); }
.toolbar .tsep { width: 1px; height: 24px; background: var(--line); margin: 0 var(--s1); }

/* Folder page header */
.phead { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); margin-bottom: var(--s3); }
.phead h1 { margin: 0; }
.pcount { color: var(--muted); font-size: 13px; }
.pdesc { margin: calc(-1 * var(--s2)) 0 var(--s4); color: var(--muted); max-width: 75ch; }

/* Tiles: the thumbnail is the object; no card around each one */
.tiles { gap: var(--s4) var(--s3); grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); }
.tile { border: 1px solid transparent; background: transparent; padding: var(--s1); gap: 2px; border-radius: 4px; }
.tile:hover { border-color: var(--line); background: var(--panel); }
.tile .tthumb { height: 112px; background: var(--panel); border: 1px solid var(--card-border); border-radius: 2px; margin-bottom: var(--s1); }
.tile.folder .tthumb { background: var(--panel-2); }
.tile .tmeta { gap: var(--s2); }
.embed .tiles { gap: var(--s3) var(--s2); }

/* File page: header with identity on the left and state on the right */
.ihead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s3) var(--s6); margin-bottom: var(--s4); }
.ihead-id { display: flex; gap: var(--s3); align-items: flex-start; min-width: 0; flex: 1 1 280px; }
.ihead-id > .ico { margin: var(--s1) 0 0; }
.ihead-t { min-width: 0; }
.ihead h1 { margin: 0; overflow-wrap: anywhere; }
.ifile { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.ifacts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin: 0; }
.ifacts > div { display: grid; gap: 2px; align-content: start; }
.ifacts dt { font-size: 12px; color: var(--muted); }
.ifacts dd { margin: 0; min-height: 24px; display: flex; align-items: center; }
.ifacts dd.mono { font-size: 16px; font-weight: 700; }
.ifacts .lock { min-width: 20px; }
.embed .ihead { gap: var(--s2) var(--s4); margin-bottom: var(--s3); }
.embed .ihead-id { flex-basis: 100%; }
.embed .ifacts { gap: var(--s2) var(--s4); }

.cols.info { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: var(--s5); }
.cols.info > .infomain { gap: 0; }
/* Stacked (narrow window, SolidWorks pane): the header already gives the state, so the tabs come first */
@media (max-width: 900px) { .cols.info { grid-template-columns: 1fr; grid-template-areas: "main" "panel"; gap: var(--s4); } }
.embed .cols.info { grid-template-columns: 1fr; grid-template-areas: "main" "panel"; gap: var(--s4); }

/* Information panel: one surface, sections divided by hairlines */
.cols.info > .infopanel { gap: 0; background: var(--panel); border: 1px solid var(--card-border); }
.infopanel > .card { border: 0; border-top: 1px solid var(--menu-line); background: none; }
.infopanel > .card:first-child { border-top: 0; }
.infopanel > .card[hidden] + .card, .infopanel > .card:first-child[hidden] + .card { border-top: 0; }
.infopanel > .card > .hd { font-size: 14px; }
.infopanel > .card > .bd { padding: var(--s1) var(--s4) var(--s4); }
.infopanel dl.props { grid-template-columns: 96px minmax(0, 1fr); gap: var(--s1) var(--s3); font-size: 13px; }
.ipreview > .bd { padding: var(--s1) var(--s4) var(--s4); }
.ipreview img.preview { max-height: 220px; border: 1px solid var(--menu-line); border-radius: 2px; }
.inote { margin: 0; color: var(--muted); font-size: 13px; }
.pgroup dl.props { margin: var(--s1) 0 var(--s2) var(--s4); }

/* Tabs (same look as UIKit .tab: 3 px underline on the current one) */
.tabstrip { display: flex; gap: var(--s1); border-bottom: 1px solid var(--menu-line); overflow-x: auto; scrollbar-width: thin; margin-bottom: var(--s4); }
.tabbtn { flex: none; background: none; border: 0; border-bottom: 3px solid transparent; padding: var(--s3) var(--s3) var(--s2); margin-bottom: -1px;
  color: var(--muted); cursor: pointer; font: inherit; white-space: nowrap; }
.tabbtn:hover { color: var(--text); border-bottom-color: var(--muted); }
.tabbtn[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent-bright); }
.tabbtn[hidden] { display: none; }
.tabbtn .tcount { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tabbtn:focus-visible { outline-offset: -2px; }
.embed .tabstrip { flex-wrap: wrap; overflow: visible; column-gap: 0; }
.embed .tabbtn { padding: var(--s2) var(--s2) var(--s1); }
.tabpanel:focus-visible { outline-offset: 4px; }
.tabpanel > .card { border: 0; background: none; }
.tabpanel > .card > .hd { padding: 0 0 var(--s3); background: none; justify-content: flex-end; font-size: 14px; font-weight: 400; }
.tabpanel > .card > .hd:not(:has(> :not(.ttl))) { display: none; }
.tabpanel > .card > .hd > .ttl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tabpanel > .card > .bd { padding: 0; }
.tabpanel > .card > .hd + table.grid { margin-top: 0; }
.tabpanel .xvers { display: none; }  /* versions are listed in the Versions tab */
.tablewrap.flat { box-shadow: none; }

/* Versions table: a row group per revision */
.vtable th, .vtable td { vertical-align: top; }
.vtable .revrow th { position: static; background: var(--panel-2); color: var(--muted); font-size: 13px; font-weight: 400;
  padding: var(--s2); border-top: 1px solid var(--menu-line); border-bottom: 0; white-space: normal; }
.vtable .revrow .rv { font-weight: 700; color: var(--text); font-size: 14px; margin-right: var(--s2); }
.vtable .revrow .rv .mono { font-size: 14px; }
.vtable .revrow .pill { margin-right: var(--s2); }
.vtable td.vnum { font-weight: 700; }
.vtable td.vcomment { white-space: normal; min-width: 160px; }
.vtable td.vdate { color: var(--muted); }
.vtable td.vlinks { white-space: normal; text-align: right; min-width: 72px; }
.vtable td.vlinks a { display: inline-block; }
.vtable td.vlinks a + a { margin-left: var(--s3); }
.vtable .vwhyrow td { border-top: 0; padding-top: 0; }
.vtable .vwhy { font-size: 12px; color: var(--text); background: var(--panel-2); padding: var(--s1) var(--s2); }
.vmeta-pane { display: none; }
.embed .vmeta-pane { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.embed .vlinks-pane { color: inherit; }
.embed .vlinks-pane a + a { margin-left: var(--s3); }
.embed .vtable td.vcomment { min-width: 0; }

/* History: action as plain text */
.htag { font-weight: 400; }
.histcard .hfilters, .histcard .hquick { gap: var(--s2); }

/* Sign-in: under the same blue bar as the app, not a box floating in grey */
.login { display: block; place-items: normal; padding: 0; min-height: 100vh; }
.login > .top { height: 44px; padding: 0 var(--s4); }
.login .card.auth { width: min(400px, calc(100% - var(--s6))); margin: 12vh auto var(--s6); }
.login .card.auth > .bd { gap: var(--s4); padding: var(--s5); }
.embed.login .card.auth { margin-top: var(--s4); }
@media (max-width: 360px) { .login { padding: 0; } .login .card.auth { width: calc(100% - var(--s4)); margin-top: var(--s2); } .login .card.auth > .bd { padding: var(--s4); } }

/* ------------------------------------------------------------------
   Round 2 (2026-12-02): title block, change request page, SolidWorks pane toolbars. */
/* Title block: the state of a file or change request in ruled cells, read like a drawing's title block.
   The revision letter (or change number) is the strongest mark on the page. */
.ifacts.tblock { display: grid; grid-auto-flow: column; gap: 1px; background: var(--field-border); border: 1px solid var(--field-border); }
.tblock > div { background: var(--panel); padding: var(--s1) var(--s3) var(--s2); min-width: 80px; gap: 0; }
.ifacts > div[hidden] { display: none; }
.tblock dt { font-size: 11px; }
.tblock dd { min-height: 28px; }
.tblock .tb-rev dd { align-items: baseline; }
.tblock .tb-letter { font-size: 26px; font-weight: 700; line-height: 1.1; }
.tblock .tb-letter.tb-num { font-size: 20px; }
.tblock .tb-ver { font-size: 15px; font-weight: 700; color: var(--muted); }
.tblock .tb-pn dd { font-weight: 700; }
.embed .ifacts.tblock { grid-auto-flow: row; grid-template-columns: 1fr 1fr; width: 100%; }
.embed .tblock > .tb-pn, .embed .tblock > .tb-lock { grid-column: 1 / -1; }
.embed .tblock .tb-letter { font-size: 22px; }

/* SolidWorks pane: toolbars stay on one row (the rest of the actions are in More / Folder) */
.embed .toolbar.paneacts { flex-wrap: nowrap; gap: var(--s2); }
.embed .toolbar.paneacts .btn { height: 32px; padding: 0 var(--s3); min-width: 0; flex: none; }
.embed .toolbar.paneacts .btn.primary { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.embed .toolbar.paneacts .viewswitch .btn { width: 32px; padding: 0; }

/* Change request page: sections divided by hairlines, the route and files as tables */
.cr-by { font-size: 13px; color: var(--muted); margin-top: 2px; }
.crpage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 0 var(--s6); align-items: start; }
.crpage > div { display: grid; min-width: 0; align-content: start; }
.crpage .card { border: 0; border-top: 1px solid var(--line); background: none; }
.crpage .card > .hd { padding: var(--s3) 0 var(--s2); background: none; }
.crpage .card > .bd { padding: 0 0 var(--s4); }
.crpage .card > .tablewrap { margin-bottom: var(--s4); border: 0; }
.crpage .cr-desc { margin: 0; padding: 0 0 var(--s4); border-top: 0; max-width: 75ch; }
.crpage .cr-note { border-top: 0; padding: 0 0 var(--s4); }
.crpage .grid th:first-child, .crpage .grid td:first-child { padding-left: 0; }
.crpage .cr-problem td, .crpage .cr-required td { padding-left: var(--s2); }
.cr-route td { white-space: normal; vertical-align: top; }
.cr-route tbody.active td { background: var(--row-hover); }
.cr-route .cr-appr { display: inline-flex; gap: var(--s2); align-items: center; padding: 0; grid-template-columns: none; }
.cr-route .cr-now { padding: 0 var(--s2); }
.grid .num { text-align: right; }
@media (max-width: 900px) { .crpage { grid-template-columns: 1fr; } }
.embed .crpage { grid-template-columns: 1fr; }
.crpage .grid, .crpage .tablewrap, .crpage .grid th { background: transparent; }
.embed .crpage .grid td.name { max-width: none; width: auto; min-width: 96px; white-space: normal; overflow-wrap: anywhere; }
.embed .crpage .cr-action { min-width: 0; padding: 0 var(--s1); }
.embed .crpage .grid td:last-child .btn { min-width: 0; }

/* /open/<id>: hand-off page for "Copy SolidWorks link" */
.openpage .top { height: 44px; display: flex; align-items: center; padding: 0 16px; }
.openpage .top .brand { color: var(--topbar-text); font-weight: 700; font-size: 15px; }
.openbox { max-width: 520px; margin: 48px auto; padding: 0 16px; }
.openbox h1 { font-size: 22px; font-weight: 400; margin: 0 0 12px; }
.openbox p { margin: 0 0 12px; }
.openbox .btn { margin-right: 8px; text-decoration: none; }
.openbox .openhelp { color: var(--muted); font-size: 13px; }
.openbox #status { color: var(--muted); }

/* Folder view: "up one level" row/tile; drop files or folders on it (or on a breadcrumb) to move them out */
.grid.explorer tr.uprow td { cursor: default; }
.grid.explorer tr.uprow .title { font-weight: 400; }
.grid.explorer tr.uprow:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.tile.uptile { color: var(--muted); }
.tile.uptile .tname { font-weight: 400; }
.crumbs a.droptarget { outline: 2px solid var(--accent-bright); outline-offset: 2px; background: var(--accent-soft); }

/* .btn sets display, which beat the hidden attribute (Clear / Show more showed with nothing to do) */
.histcard [hidden] { display: none !important; }

/* 3D viewer background: SolidWorks' default radial gradient (measured 249 centre, 213 corners) */
.viewer { background: radial-gradient(ellipse at 50% 45%, #f9f9f9 0%, #e6e6e6 55%, #d5d5d5 100%); }

/* Messages stay inside the window (the SolidWorks pane is narrow): long paths wrap, the close button stays visible */
#toasts { left: 16px; justify-items: end; pointer-events: none; }
.toast { pointer-events: auto; max-width: min(420px, 100%); overflow-wrap: anywhere; }
.toast.err .x { flex: none; }
.embed #toasts { left: 8px; right: 8px; bottom: 8px; }
/* the change-request count now sits on the menu button */
#acct-btn { position: relative; }
