/* Shared look for every Get It Made tool: colours, type, panel, buttons, viewer stage.
   Change it here and every tool picks it up on the next build. */
/* Layout: fixed-width inspection panel on the left, 3D view fills the rest; stacks on phones. */
:root {
  --bg: #e8edf1;
  --panel: #ffffff;
  --ink: #0b0f1a;
  --muted: #4a5266;
  --line: #cfd6dd;
  --accent: #000443;
  --brand: #d81f41;
  --on-brand: #fffffe;
  --original: #d9480f;
  --revised: #087f5b;
  --original-soft: #fff0e6;
  --revised-soft: #e3f6ef;
  --stage: #eef1f5;
  --added: #0a8f6c;
  --removed: #d9480f;
  --modified: #a66a00;
  --added-soft: #e3f6ef;
  --removed-soft: #fff0e6;
  --modified-soft: #fdf3d7;
  --part: #d5d9e0;
  --edge: #1b222c;
  --cut: #8d96a4;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #03052b; --panel: #000443; --ink: #f2f4f7; --muted: #aab2d6; --line: #262c74;
    --accent: #a9b8ff; --original: #ff8f5a; --revised: #4fd1a5;
    --original-soft: #3a2418; --revised-soft: #15332a; --stage: #050838;
    --added: #4fd1a5; --removed: #ff8f5a; --modified: #f2c14e; --added-soft: #15332a; --removed-soft: #3a2418; --modified-soft: #3a3012;
    --part: #5d6775; --edge: #e6ebf2; --cut: #39424e;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #03052b; --panel: #000443; --ink: #f2f4f7; --muted: #aab2d6; --line: #262c74;
  --accent: #a9b8ff; --original: #ff8f5a; --revised: #4fd1a5;
  --original-soft: #3a2418; --revised-soft: #15332a; --stage: #050838;
    --added: #4fd1a5; --removed: #ff8f5a; --modified: #f2c14e; --added-soft: #15332a; --removed-soft: #3a2418; --modified-soft: #3a3012;
    --part: #5d6775; --edge: #e6ebf2; --cut: #39424e;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font-body); display: grid; grid-template-columns: minmax(340px, 400px) 1fr; }
[hidden] { display: none !important; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.panel { border-top: 4px solid var(--brand); background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 20px 18px 28px; display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.brand { display: inline-block; color: var(--ink); margin-bottom: 12px; border-radius: 0; }
.logo { display: block; height: 34px; width: auto; }
h1 { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.lede { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
h2 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 8px; }

.slots { display: grid; gap: 8px; position: relative; }
.slot { display: grid; grid-template-columns: 10px 1fr; gap: 12px; align-items: center; border: 1px dashed var(--line); border-radius: 0; padding: 10px 12px; cursor: pointer; position: relative; }
.slot.filled { border-style: solid; }
.slot.over { border-color: var(--accent); background: var(--bg); }
.slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.slot .swatch { width: 10px; height: 34px; border-radius: 0; }
#slotA .swatch, #slotB .swatch { background: var(--muted); }
.ver { font-size: 11px; font-weight: 600; border: 1px solid var(--line); border-radius: 0; padding: 1px 8px; vertical-align: 2px; color: var(--muted); }
.slot .role { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.slot .fname { font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere; }
.slot:not(.filled) .fname { font-family: var(--font-body); color: var(--muted); }
.tag { font-size: 10px; border: 1px solid var(--line); border-radius: 0; padding: 0 7px; letter-spacing: 0.04em; }
.rowline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.btn { background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 5px 11px; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.45; cursor: default; }
.field { display: flex; gap: 8px; align-items: center; }
select { background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 5px 8px; }
.check { display: flex; gap: 7px; align-items: center; cursor: pointer; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }

.error { border: 1px solid var(--original); background: var(--original-soft); border-radius: 0; padding: 10px 12px; }
.progress { height: 3px; background: var(--line); border-radius: 0; overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; background: var(--brand); width: 0; transition: width 0.15s linear; }
#status { color: var(--muted); font-size: 13px; min-height: 1.45em; }

.verdict { border-radius: 0; padding: 12px 14px; border-left: 5px solid; }
.verdict.diff { background: var(--original-soft); border-color: var(--original); }
.verdict.match { background: var(--revised-soft); border-color: var(--revised); }
.verdict strong { font-size: 16px; font-weight: 600; display: block; }
.verdict span { font-size: 13px; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
thead th { font-size: 11px; font-weight: 600; color: var(--muted); text-align: right; padding: 0 0 5px 8px; }
thead th:first-child { text-align: left; padding-left: 0; }
tbody th { font-weight: 400; text-align: left; padding: 5px 0; white-space: nowrap; }
tbody td { font-family: var(--font-mono); font-size: 12.5px; text-align: right; padding: 5px 0 5px 8px; }
tbody tr { border-top: 1px solid var(--line); }
tbody td:last-child { color: var(--muted); }
tbody tr.changed td:last-child { color: var(--original); font-weight: 500; }
tbody tr.changed th::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--original); margin-right: 6px; vertical-align: middle; }

#regions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.region { width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 8px 10px; cursor: pointer; display: grid; gap: 2px; }
.region:hover, .region.on { border-color: var(--accent); }
.region.on { background: var(--bg); }
.rt { display: flex; gap: 8px; align-items: center; }
.num, .pin { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 600; color: var(--panel); background: var(--muted); font-variant-numeric: tabular-nums; }
.badge { font-size: 12px; font-weight: 500; border-radius: 0; padding: 1px 8px; }
.region.added .num, .pin.added { background: var(--added); }
.region.removed .num, .pin.removed { background: var(--removed); }
.region.modified .num, .pin.modified { background: var(--modified); }
.region.added .badge { background: var(--added-soft); color: var(--added); }
.region.removed .badge { background: var(--removed-soft); color: var(--removed); }
.region.modified .badge { background: var(--modified-soft); color: var(--modified); }
.rm, .rd { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: pre-wrap; }
#batchList { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; max-height: 340px; overflow-y: auto; }
.brow { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 0; }
.bopen { width: 100%; text-align: left; background: none; border: 0; padding: 6px 10px; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; border-radius: 0; }
.bopen:disabled { cursor: default; }
.brow:has(.bopen:hover:not(:disabled)), .brow.on { border-color: var(--accent); }
.bextra { padding: 0 10px 8px; font-size: 12px; color: var(--muted); }
.bextra select { max-width: 100%; font-size: 12px; padding: 3px 6px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: 12px; }
.bn { font-family: var(--font-mono); font-size: 12.5px; overflow-wrap: anywhere; }
.bs { font-size: 12px; font-weight: 500; color: var(--muted); }
.bd { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.brow.changed { border-left-color: var(--removed); } .brow.changed .bs { color: var(--removed); }
.brow.same { border-left-color: var(--added); } .brow.same .bs { color: var(--added); }
.brow.new, .brow.removed, .brow.error { border-left-color: var(--modified); } .brow.new .bs, .brow.removed .bs, .brow.error .bs { color: var(--modified); }
#copyOut { width: 100%; min-height: 120px; margin-top: 8px; font-family: var(--font-mono); font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 0; padding: 8px; }
.foot { color: var(--muted); font-size: 12px; margin: 0; }
.madeby { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.madeby p { margin: 0; font-size: 13px; color: var(--muted); }
.madeby p strong { color: var(--ink); font-weight: 600; }
.madeby .links { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cta { background: var(--brand); color: var(--on-brand); text-decoration: none; font-weight: 500; border-radius: 0; padding: 6px 14px; }
.cta:hover { filter: brightness(1.08); }
.site { color: var(--ink); font-size: 13px; }

.stage { position: relative; background: var(--stage); min-width: 0; min-height: 0; }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.viewbar { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; pointer-events: none; }
.viewbar > * { pointer-events: auto; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 0; overflow: hidden; }
.seg button { background: none; border: 0; padding: 6px 12px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 5px 10px; }
.legend { position: absolute; left: 14px; bottom: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 8px 12px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; }
.pins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pin { position: absolute; left: -11px; top: -30px; border: 2px solid var(--panel); width: 24px; height: 24px; cursor: pointer; pointer-events: auto; padding: 0; }
.pin::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 8px; margin-left: -1px; background: inherit; }
.pin.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.pin.behind, .pin.behind.added, .pin.behind.removed, .pin.behind.modified { background: var(--muted); opacity: 0.45; }
.pin.behind:hover, .pin.behind.on { opacity: 0.8; }
.legend .ghost { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); opacity: 0.45; margin-right: 6px; vertical-align: -1px; }
.divider { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--line); pointer-events: none; }
.handle { position: absolute; top: 0; bottom: 0; width: 22px; margin-left: -11px; cursor: ew-resize; background: none; border: 0; padding: 0; touch-action: none; }
.handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 10px; width: 2px; background: var(--accent); }
.handle::after { content: "\2194"; position: absolute; top: 50%; left: -3px; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; background: var(--accent); color: var(--panel); display: grid; place-items: center; font-size: 15px; }
.plabel { position: absolute; top: 112px; left: 14px; font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 2px 9px; pointer-events: none; max-width: 44%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 2px 4px; margin-left: auto; }
.stepper button { background: none; border: 0; cursor: pointer; padding: 3px 9px; border-radius: 0; font-size: 15px; line-height: 1.2; }
.stepper button:hover { color: var(--accent); background: var(--bg); }
.stepper span { font-size: 13px; min-width: 96px; text-align: center; font-variant-numeric: tabular-nums; }
.cutbar { position: absolute; top: 146px; right: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 6px 8px; max-width: calc(100% - 28px); }
.cutbar input[type=range] { width: 180px; accent-color: var(--brand); }
.mono { font-family: var(--font-mono); font-size: 12.5px; min-width: 104px; }
.measureOut { position: absolute; right: 14px; bottom: 14px; max-width: min(430px, calc(100% - 28px)); background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 0; padding: 10px 12px; display: grid; gap: 4px; }
.measureOut strong { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.measureOut pre { margin: 0; font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: pre-wrap; }
.measureOut .btn { justify-self: start; margin-top: 4px; padding: 2px 10px; }
.stage.measuring canvas { cursor: crosshair; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 0; margin-right: 6px; vertical-align: -1px; }
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 24px; background: var(--stage); }
.emptyTitle { font-size: 22px; font-weight: 600; text-transform: none; letter-spacing: -0.01em; color: var(--ink); margin: 0; }
.bigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; width: min(680px, 100%); }
.big { background: var(--panel); border: 2px dashed var(--muted); border-radius: 0; padding: 34px 18px; cursor: pointer; display: grid; gap: 8px; min-height: 170px; align-content: center; }
.big:hover, .big.over { border-color: var(--brand); }
.big.filled { border-style: solid; border-color: var(--added); }
.bigRole { font-size: 17px; font-weight: 600; }
.bigName { color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.emptyNote { color: var(--muted); font-size: 13px; margin: 0; max-width: 52ch; }
.empty .link { font-size: 14px; }
.exampleBar { width: max-content; position: absolute; left: 50%; transform: translateX(-50%); top: 62px; z-index: 3; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: 0; padding: 9px 12px; max-width: calc(100% - 28px); font-size: 13.5px; }
.exampleBar .cta { border: 0; cursor: pointer; font-size: 13.5px; }
.help { position: absolute; right: 14px; bottom: 14px; color: var(--muted); font-size: 12px; }

@media (max-width: 760px) {
  html, body { height: auto; }
  body { grid-template-columns: 1fr; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; order: 2; }
  .stage { height: 62vh; min-height: 320px; order: 1; }
  .help { display: none; }
}
@media (prefers-reduced-motion: reduce) { .progress i { transition: none; } }

.brandbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.logo { display: inline-flex; line-height: 0; }
.logo img { height: 30px; width: auto; }
.logo .ld { display: none; }
:root[data-theme="dark"] .logo .ll { display: none; }
:root[data-theme="dark"] .logo .ld { display: inline; }
.themebtn { font-size: 12px; padding: 4px 10px; }

.other { border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 10px 12px; font-size: 13px; color: var(--muted); }
.other strong { color: var(--ink); font-weight: 600; display: block; }
.other a { color: var(--accent); }
.bigs.one { grid-template-columns: minmax(230px, 420px); justify-content: center; }
.details th { font-weight: 400; text-align: left; padding: 5px 0; white-space: nowrap; }
.details td { text-align: right; }
