/* Iso Sketch - application chrome. The sheet itself is styled by the renderer.

   LAYOUT SYSTEM. Everything here sits on a 4 px grid (--s1..--s6) and one
   type scale, so a control added later looks like it was always there. The
   screen chrome is deliberately quiet - neutral panels, one accent - because
   the drawing is the thing on screen that is allowed to be loud. */

.isk-root {
  /* THE DEFAULT ACCENT, AND ONLY THE DEFAULT. Each product overrides it in
     css/host.css, which loads after this file - embedded, the editor sits
     inside the host's own shell, and an accent that ignores the host reads as
     a control panel bolted on from somewhere else. Do not edit the value here
     to re-brand a copy: that is exactly how three copies of this stylesheet
     came to differ.

     The weld and material colours below are NOT brand and do not follow it:
     red is a weld call and blue is a heat number on every isometric that has
     ever been issued, and recolouring those to match an app is how a print
     stops meaning what a fitter reads it to mean. */
  --accent: #f5a623;
  --accent-ink: #14181d;
  --weld: #d0021b;
  --mat: #1163d6;
  --flange: #1f9a56;
  --ok: #00c2a8;
  --warn: #e0a800;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --radius: 6px; --radius-lg: 10px;
  --rail: 76px;
  --side: 352px;
  --fs: 13px; --fs-sm: 12px; --fs-xs: 11px; --fs-cap: 10.5px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .25);
  --focus: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent);
}

/* Screen background, dark through light. --hover is the one-step lift used by
   every control on hover; --sel is the selection tint. Each theme states both
   so the light ones do not inherit a lift that reads as a shadow. */
.isk-root[data-theme="black"] { --bg:#000000; --panel:#0b0d10; --panel2:#141821; --hover:#1c2230; --line:#242a33; --text:#e9eef5; --dim:#97a3b2; --field:#171c24; --sel: rgba(245,166,35,.16); }
.isk-root[data-theme="dark"]  { --bg:#10141a; --panel:#181e27; --panel2:#202833; --hover:#28323f; --line:#2c3542; --text:#e9eef5; --dim:#9aa8b9; --field:#232c38; --sel: rgba(245,166,35,.16); }
.isk-root[data-theme="slate"] { --bg:#2b333f; --panel:#333c4a; --panel2:#3d4756; --hover:#475262; --line:#4a5566; --text:#eef2f7; --dim:#b7c2cf; --field:#46515f; --sel: rgba(245,166,35,.18); }
.isk-root[data-theme="gray"]  { --bg:#9aa3ae; --panel:#e7ebf0; --panel2:#f2f5f8; --hover:#dde3ea; --line:#c3cbd5; --text:#1b2129; --dim:#4f5a67; --field:#ffffff; --sel: rgba(214,130,0,.14); --shadow: 0 10px 30px rgba(0,0,0,.18); --shadow-sm: 0 2px 8px rgba(0,0,0,.12); }
.isk-root[data-theme="light"] { --bg:#e8ecf1; --panel:#ffffff; --panel2:#f4f7fa; --hover:#e9eef4; --line:#d6dde6; --text:#161b22; --dim:#5a6572; --field:#ffffff; --sel: rgba(214,130,0,.14); --shadow: 0 10px 30px rgba(0,0,0,.14); --shadow-sm: 0 2px 8px rgba(0,0,0,.10); }
/* The accent on a white panel is too pale to carry text. The light themes get
   a deeper amber for anything that is text-on-panel; the fill stays bright. */
.isk-root[data-theme="gray"], .isk-root[data-theme="light"] { --accent-text: #b86e00; }
.isk-root { --accent-text: var(--accent); }

.isk-root, .isk-root * { box-sizing: border-box; }
.isk-root [hidden] { display: none !important; }

.isk-root {
  height: 100%; margin: 0;
  font: var(--fs)/1.45 "Segoe UI", "Inter", system-ui, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text); background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.isk-root { display: grid; grid-template-rows: auto 1fr auto; position: relative; }

/* Every focusable control gets the same ring, and only from the keyboard. */
.isk-root :focus { outline: none; }
.isk-root :focus-visible { box-shadow: var(--focus); outline: none; }

/* ---------- top bar: two tiers ---------- */
.isk-root #topbar {
  display: flex; flex-direction: column;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.isk-root .bar1, .isk-root .bar2 {
  display: flex; align-items: center; gap: var(--s3);
  padding: 6px var(--s3); min-height: 44px;
}
.isk-root .bar2 {
  min-height: 36px; padding-top: 4px; padding-bottom: 6px;
  border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  background: color-mix(in srgb, var(--panel2) 55%, var(--panel));
}
.isk-root .bar2 .cap {
  font-size: var(--fs-cap); letter-spacing: 1px; text-transform: uppercase; color: var(--dim);
  font-weight: 700; margin-right: var(--s1);
}
.isk-root .bar2 .sep { width: 1px; height: 20px; background: var(--line); margin: 0 var(--s1); }

.isk-root .brand { display: flex; align-items: center; gap: var(--s2); user-select: none; margin-right: var(--s1); }
/* The box only. WHAT GOES IN IT IS THE HOST'S - css/host.css paints it, either
   with a background image or by styling an inline <svg> the host's index.html
   puts here. It is loaded from the STYLESHEET rather than an <img> because this
   markup is injected into the host page when embedded, where `src="img/..."`
   resolves against the host root and 404s. A url() inside a stylesheet resolves
   against that stylesheet, which is in iso-sketch/css/ either way round. */
.isk-root .brand .mark { width: 26px; height: 26px; flex: none; }
.isk-root .brand .mark svg { width: 100%; height: 100%; display: block; }
.isk-root .brand .name { font-weight: 800; letter-spacing: 2px; font-size: 14px; }
.isk-root .brand .sub { color: var(--dim); font-size: var(--fs-xs); letter-spacing: .4px; }

.isk-root .group { display: flex; align-items: center; gap: var(--s1); }
.isk-root .group.grow { margin-left: auto; }
.isk-root .group + .group { padding-left: var(--s3); border-left: 1px solid var(--line); }
.isk-root .group.grow + .group { border-left: none; }

/* ---------- buttons ---------- */
.isk-root .btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: var(--fs-sm); font-weight: 500;
  color: var(--text); background: var(--panel2);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 5px 11px; min-height: 30px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .06s;
}
.isk-root .btn svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.isk-root .btn:hover { background: var(--hover); border-color: color-mix(in srgb, var(--line) 40%, var(--dim)); }
.isk-root .btn:active { transform: translateY(1px); }
.isk-root .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.isk-root .btn.primary:hover { filter: brightness(1.07); }
.isk-root .btn.quiet { background: transparent; border-color: transparent; color: var(--dim); }
.isk-root .btn.quiet:hover { background: var(--hover); color: var(--text); }
.isk-root .btn.icon { padding: 5px 7px; }
.isk-root .btn.sm { padding: 3px 8px; min-height: 26px; font-size: var(--fs-xs); }
.isk-root .btn.danger:hover { border-color: var(--weld); color: var(--weld); }
.isk-root .btn[disabled] { opacity: .45; cursor: default; }
.isk-root .btn kbd { font: 10px/1 ui-monospace, Consolas, monospace; color: var(--dim); background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 1px 4px; }

.isk-root .fld { display: flex; align-items: center; gap: 5px; font-size: var(--fs-xs); color: var(--dim); }
.isk-root .fld > span { text-transform: uppercase; letter-spacing: .6px; font-size: var(--fs-cap); font-weight: 600; }
.isk-root select, .isk-root input[type="text"], .isk-root input[type="date"], .isk-root input[type="number"], .isk-root input:not([type]), .isk-root textarea {
  font: inherit; font-size: var(--fs-sm); color: var(--text); background: var(--field);
  border: 1px solid var(--line); border-radius: 5px; padding: 5px 7px; min-height: 30px;
  transition: border-color .12s;
}
.isk-root select:hover, .isk-root input:hover, .isk-root textarea:hover { border-color: color-mix(in srgb, var(--line) 40%, var(--dim)); }
.isk-root select:focus, .isk-root input:focus, .isk-root textarea:focus { border-color: var(--accent); box-shadow: var(--focus); }
.isk-root input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

/* ---------- main ---------- */
.isk-root #main { display: flex; min-height: 0; }

/* ---------- tool rail ---------- */
.isk-root #toolrail {
  width: var(--rail); flex: 0 0 var(--rail);
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px; padding: var(--s2) 6px; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
}
.isk-root .railcap {
  font-size: 9.5px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--dim);
  font-weight: 700; padding: var(--s2) var(--s1) 3px; user-select: none; opacity: .85;
}
.isk-root .railcap:first-child { padding-top: 2px; }
.isk-root .tool {
  position: relative;
  display: grid; gap: 3px; justify-items: center; align-content: center;
  padding: 6px 2px 5px; min-height: 50px;
  border: 1px solid transparent; border-radius: var(--radius);
  background: none; color: var(--dim); font: inherit; cursor: pointer;
  transition: background .12s, color .12s;
}
.isk-root .tool svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.isk-root .tool b { font-size: 15px; line-height: 1; font-weight: 800; }
.isk-root .tool span { font-size: 10px; letter-spacing: .1px; line-height: 1.1; }
.isk-root .tool kbd {
  position: absolute; top: 3px; right: 4px;
  font: 700 9px/1 ui-monospace, Consolas, monospace; color: var(--dim);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 3px; padding: 1px 3px;
  opacity: .85;
}
.isk-root .tool:hover { background: var(--hover); color: var(--text); }
.isk-root .tool.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.isk-root .tool.active kbd { background: rgba(0,0,0,.18); border-color: transparent; color: var(--accent-ink); }
.isk-root .tool.weld svg, .isk-root .tool.weld b { color: var(--weld); }
.isk-root .tool.mat svg, .isk-root .tool.mat b { color: var(--mat); }
.isk-root .tool.flg svg, .isk-root .tool.flg b { color: var(--flange); }
.isk-root .tool.active svg, .isk-root .tool.active b { color: inherit; }
.isk-root .tool.ghost { color: var(--dim); min-height: 44px; }
.isk-root .railgap { flex: 1; min-height: var(--s2); }
.isk-root .railsep { height: 1px; background: var(--line); margin: var(--s1) var(--s1); }
/* Shorter windows: the rail gives up its captions, then its labels, rather
   than scrolling - a tool you have to scroll to is a tool you forget. */
@media (max-height: 1040px) {
  .isk-root .railcap { display: none; }
  .isk-root .tool { min-height: 44px; padding: 4px 2px 3px; }
  .isk-root .tool.ghost { min-height: 40px; }
}
@media (max-height: 900px) {
  .isk-root { --rail: 58px; }
  .isk-root .tool span { display: none; }
  .isk-root .tool { min-height: 38px; }
  .isk-root .tool.ghost { min-height: 36px; }
  .isk-root .tool kbd { top: 2px; right: 3px; }
}

/* ---------- stage ---------- */
.isk-root #stage { position: relative; flex: 1; min-width: 0; background: var(--bg); overflow: hidden; }
.isk-root #canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.isk-root #canvas:focus { outline: none; }
.isk-root.tool-select #canvas { cursor: default; }
.isk-root.tool-pan #canvas { cursor: grab; }
.isk-root #sheetHost { filter: drop-shadow(0 8px 26px rgba(0,0,0,.42)); }
.isk-root .ax-hit { cursor: pointer; }
.isk-root .ax-hit-lbl { cursor: move; }

/* sheet tabs along the bottom of the canvas */
.isk-root #sheetTabs {
  position: absolute; left: var(--s3); bottom: var(--s3); display: flex; gap: 3px; align-items: center;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 4px; max-width: calc(100% - 24px);
  overflow-x: auto; scrollbar-width: thin; box-shadow: var(--shadow-sm);
}
.isk-root .sheetTab {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: var(--fs-sm); padding: 5px 10px; border-radius: 6px;
  border: 1px solid transparent; background: transparent; color: var(--dim); cursor: pointer; white-space: nowrap;
  transition: background .12s, color .12s;
}
.isk-root .sheetTab:hover { background: var(--hover); color: var(--text); }
.isk-root .sheetTab.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.isk-root .sheetTab .no { font-size: var(--fs-xs); opacity: .7; font-variant-numeric: tabular-nums; }
.isk-root .sheetTab .badge {
  font-size: 9.5px; font-weight: 800; line-height: 1; padding: 3px 5px; border-radius: 4px; color: #fff; letter-spacing: .3px;
}
.isk-root .sheetTab .badge.weld { background: var(--weld); }
.isk-root .sheetTab .badge.heat { background: var(--mat); }
.isk-root .sheetTab .badge.flange { background: var(--flange); }
.isk-root .sheetTab .badge.spool { background: #7b3fc4; }
.isk-root .sheetTab svg.lock { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; opacity: .7; }
.isk-root .sheetTab.add { padding: 5px 8px; font-weight: 700; }

/* right-click menu (sheet tabs, and anything else that wants one) */
.isk-root .ctxmenu {
  position: absolute; z-index: 60; min-width: 170px; padding: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
}
.isk-root .ctxmenu button {
  display: flex; width: 100%; align-items: center; gap: 8px; text-align: left;
  font: inherit; font-size: var(--fs-sm); padding: 6px 10px; border: none; border-radius: 5px;
  background: none; color: var(--text); cursor: pointer;
}
.isk-root .ctxmenu button:hover { background: var(--hover); }
.isk-root .ctxmenu button.danger:hover { color: var(--weld); }
.isk-root .ctxmenu button[disabled] { opacity: .4; cursor: default; }
.isk-root .ctxmenu .hr { height: 1px; background: var(--line); margin: 4px 2px; }
.isk-root .ctxmenu svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }

.isk-root #inlineEdit {
  position: absolute; z-index: 20; background: var(--panel);
  border: 1px solid var(--accent); border-radius: 6px; padding: 6px;
  box-shadow: var(--shadow);
}
.isk-root #inlineEdit input { width: 190px; }
.isk-root #inlineEdit .hint { font-size: 10px; color: var(--dim); margin-top: 4px; }

/* toasts: short confirmations that do not need the status bar read */
.isk-root #toasts {
  position: absolute; top: var(--s3); right: var(--s3); z-index: 40;
  display: flex; flex-direction: column; gap: 6px; pointer-events: none; max-width: min(420px, 80%);
}
.isk-root .toast {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 12px; border-radius: 8px; font-size: var(--fs-sm); line-height: 1.4;
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); box-shadow: var(--shadow); pointer-events: auto;
  animation: isk-toast-in .18s ease-out;
}
.isk-root .toast.ok { border-left-color: var(--ok); }
.isk-root .toast.warn { border-left-color: var(--warn); }
.isk-root .toast.err { border-left-color: var(--weld); }
.isk-root .toast svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.isk-root .toast.ok svg { color: var(--ok); }
.isk-root .toast.warn svg { color: var(--warn); }
.isk-root .toast.err svg { color: var(--weld); }
.isk-root .toast.out { animation: isk-toast-out .22s ease-in forwards; }
@keyframes isk-toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes isk-toast-out { to { opacity: 0; transform: translateX(12px); } }

/* ---------- side panel ---------- */
.isk-root #side {
  width: var(--side); flex: 0 0 var(--side); background: var(--panel);
  border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0;
}
.isk-root .tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 var(--s1); }
.isk-root .tab {
  flex: 1; font: inherit; font-size: var(--fs-xs); font-weight: 600; padding: 10px 2px 8px; cursor: pointer;
  background: none; border: none; border-bottom: 2px solid transparent; color: var(--dim);
  transition: color .12s;
}
.isk-root .tab:hover { color: var(--text); }
.isk-root .tab.active { color: var(--text); border-bottom-color: var(--accent); }
.isk-root .panes { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.isk-root .pane { display: none; padding: var(--s3); }
.isk-root .pane.active { display: block; }

.isk-root h4 {
  margin: var(--s4) 0 var(--s2); font-size: var(--fs-cap); letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--dim); font-weight: 700;
}
.isk-root h4:first-child { margin-top: 0; }

/* the card at the top of Properties: what is selected, in one line */
.isk-root .card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: var(--s3);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.isk-root .card.weld { border-left-color: var(--weld); }
.isk-root .card.material { border-left-color: var(--mat); }
.isk-root .card.flange { border-left-color: var(--flange); }
.isk-root .card .ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); }
.isk-root .card .ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.isk-root .card .t { flex: 1; min-width: 0; }
.isk-root .card .t b { display: block; font-size: var(--fs); line-height: 1.2; }
.isk-root .card .t small { display: block; color: var(--dim); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.isk-root .card .acts { display: flex; gap: 4px; }

/* sheet summary when nothing is selected */
.isk-root .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: var(--s3); }
.isk-root .stat { padding: 8px 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; }
.isk-root .stat b { display: block; font-size: 18px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.isk-root .stat span { font-size: var(--fs-cap); color: var(--dim); text-transform: uppercase; letter-spacing: .6px; }
.isk-root .stat.weld b { color: var(--weld); }
.isk-root .stat.material b { color: var(--mat); }
.isk-root .stat.flange b { color: var(--flange); }

.isk-root .row { display: grid; grid-template-columns: 96px 1fr; gap: 6px; align-items: center; margin-bottom: 6px; }
.isk-root .row > label { font-size: var(--fs-xs); color: var(--dim); }
.isk-root .row > select, .isk-root .row > input, .isk-root .row > textarea { width: 100%; }
.isk-root .row.wide { grid-template-columns: 1fr; }
.isk-root .rowflex { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--s2); }
.isk-root .logoPreview { max-height: 36px; max-width: 110px; background: #fff; padding: 2px; border-radius: 3px; }

/* feet / inches / fraction */
.isk-root .lenpick { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 5px; }
.isk-root .lenpick > div { display: flex; align-items: center; gap: 4px; min-width: 0; }
.isk-root .lenpick input, .isk-root .lenpick select { width: 100%; min-width: 0; }
.isk-root .lenpick .lenunit { font-size: 10px; color: var(--dim); letter-spacing: .4px; }
.isk-root .check { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; font-size: var(--fs-sm); }
.isk-root .muted { color: var(--dim); font-size: var(--fs-xs); }
.isk-root .note { color: var(--dim); font-size: var(--fs-xs); margin: var(--s2) 0 0; line-height: 1.5; }
.isk-root .note b { color: var(--text); font-weight: 600; }
/* A note that is a QUESTION, not a hint. Used where the drawing says something
   the records do not corroborate - a stencil no welder on file carries.

   The RULE is red; the text is full-strength --text. Setting the text red as
   well fails contrast on the dark themes at 11px, and the panel background
   ranges from #000 to #fff across the five screen settings, so there is no one
   red that reads on all of them. The bar carries the signal, the text carries
   the words. */
.isk-root .note.warn { color: var(--text); border-left: 2px solid var(--weld);
  padding-left: 8px; }
.isk-root .empty { color: var(--dim); font-size: var(--fs-sm); padding: 22px 6px; text-align: center; }
.isk-root kbd.k {
  display: inline-block; font: 600 10.5px/1 ui-monospace, Consolas, monospace; color: var(--text);
  background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; margin: 0 1px;
}

/* component palette */
.isk-root .parts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.isk-root .part {
  font: inherit; font-size: var(--fs-xs); text-align: left; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel2);
  color: var(--text); cursor: pointer; transition: border-color .12s, background .12s;
}
.isk-root .part:hover { border-color: var(--accent); background: var(--hover); }
.isk-root .part.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }

/* direction grid */
.isk-root .dirs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.isk-root .dirbtn {
  font: inherit; font-size: var(--fs-xs); padding: 5px 2px; border-radius: 5px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer;
}
.isk-root .dirbtn:hover { border-color: var(--accent); }
.isk-root .dirbtn.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }

/* bom table */
.isk-root table.bom { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); }
.isk-root table.bom th {
  text-align: left; color: var(--dim); font-size: 9.5px; letter-spacing: .6px;
  text-transform: uppercase; border-bottom: 1px solid var(--line); padding: 5px 4px;
}
.isk-root table.bom td { padding: 5px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.isk-root table.bom td.num { text-align: right; white-space: nowrap; }
.isk-root .totals { margin-top: 10px; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: var(--fs-xs); }
.isk-root .totals span:nth-child(odd) { color: var(--dim); }

/* sheets list */
.isk-root .sheetRow {
  display: flex; align-items: center; gap: 6px; padding: 7px 8px; margin-bottom: 5px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel2);
}
.isk-root .sheetRow.active { border-color: var(--accent); }
.isk-root .sheetRow .nm { flex: 1; font-size: var(--fs-sm); }
.isk-root .sheetRow .no { color: var(--dim); font-size: var(--fs-xs); min-width: 20px; }

.isk-root .speclist { display: grid; gap: 6px; }
.isk-root .specRow { border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: var(--panel2); }
.isk-root .specRow .hd { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 6px; }
.isk-root .specRow .hd b { font-size: var(--fs-sm); }
/* A register card is coloured like the bubble it belongs to. */
.isk-root .specRow.reg-weld { border-left: 3px solid var(--weld); }
.isk-root .specRow.reg-material { border-left: 3px solid var(--mat); }
.isk-root .specRow.reg-flange { border-left: 3px solid var(--flange); }

/* ---------- status ---------- */
.isk-root #status {
  display: flex; align-items: center; gap: var(--s2); padding: 5px var(--s3); min-height: 34px;
  background: var(--panel); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--dim);
}
.isk-root #status .spacer, .isk-root .group .spacer { flex: 1; }
.isk-root .chip {
  padding: 3px 9px; border-radius: 20px; background: var(--panel2);
  border: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.isk-root .fld.inline { color: var(--dim); }
.isk-root .fld > span { white-space: nowrap; }
.isk-root .fld.inline input { min-height: 26px; padding: 3px 7px; }
/* A locked length is in force whether or not you are looking at the bar. */
.isk-root .fld.inline.locked > span { color: var(--accent-text); font-weight: 700; }
.isk-root .fld.inline.locked input { border-color: var(--accent); }
.isk-root #statusText { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- overlays: wizard, start screen, shortcuts, palette, tour ---------- */
.isk-root .wizwrap, .isk-root .modalwrap {
  position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 14, 0.58); backdrop-filter: blur(2px);
}
.isk-root .wizcard, .isk-root .modal {
  width: min(680px, 92vw); max-height: 92vh; overflow-y: auto; padding: var(--s5) var(--s5) var(--s4);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  animation: isk-pop .16s ease-out;
}
@keyframes isk-pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.isk-root .wizcard h3, .isk-root .modal h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.1px; }
.isk-root .wizgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin-top: var(--s3); }
.isk-root .wizgrid .row { grid-column: auto; }
.isk-root .wizbtns { margin-top: var(--s3); justify-content: flex-end; }
.isk-root .wizbtns .btn.primary { padding: 7px 16px; }
@media (max-width: 720px) { .isk-root .wizgrid { grid-template-columns: 1fr; } }

/* start screen */
.isk-root .start { width: min(860px, 94vw); }
.isk-root .start .hero { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.isk-root .start .hero .mark { width: 40px; height: 40px; }
.isk-root .start .hero .mark svg { width: 100%; height: 100%; }
.isk-root .start .hero h3 { font-size: 20px; margin: 0; letter-spacing: 1.5px; }
.isk-root .start .hero p { margin: 2px 0 0; color: var(--dim); font-size: var(--fs-sm); }
.isk-root .start .cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--s5); }
.isk-root .start .actions { display: grid; gap: var(--s2); }
.isk-root .action {
  display: flex; align-items: center; gap: 12px; text-align: left;
  font: inherit; padding: 12px 14px; border-radius: 10px; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  transition: border-color .12s, background .12s, transform .06s;
}
.isk-root .action:hover { border-color: var(--accent); background: var(--hover); }
.isk-root .action:active { transform: translateY(1px); }
.isk-root .action.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.isk-root .action.primary:hover { filter: brightness(1.06); }
.isk-root .action .ico { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 8px; background: rgba(0,0,0,.12); }
.isk-root .action.primary .ico { background: rgba(0,0,0,.14); }
.isk-root .action .ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.isk-root .action b { display: block; font-size: var(--fs); }
.isk-root .action small { display: block; font-size: var(--fs-xs); opacity: .8; }
.isk-root .action kbd { margin-left: auto; font: 10px/1 ui-monospace, Consolas, monospace; opacity: .7; }
.isk-root .recent { display: grid; gap: 4px; align-content: start; }
.isk-root .recent .rf {
  display: flex; align-items: center; gap: 10px; text-align: left; font: inherit;
  padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--text); cursor: pointer;
}
.isk-root .recent .rf:hover { background: var(--hover); border-color: var(--line); }
.isk-root .recent .rf svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--dim); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.isk-root .recent .rf b { display: block; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.isk-root .recent .rf small { display: block; font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.isk-root .start .foot { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s4); color: var(--dim); font-size: var(--fs-xs); }
@media (max-width: 760px) { .isk-root .start .cols { grid-template-columns: 1fr; } }

/* shortcuts cheat sheet */
.isk-root .keys { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; margin-top: var(--s3); }
.isk-root .keys .kr { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); font-size: var(--fs-sm); }
.isk-root .keys .kr span:first-child { color: var(--text); }
.isk-root .keys h4 { grid-column: 1 / -1; margin: var(--s3) 0 2px; }
.isk-root .keys h4:first-child { margin-top: 0; }
@media (max-width: 640px) { .isk-root .keys { grid-template-columns: 1fr; } }

/* command palette */
.isk-root .modalwrap.top { align-items: flex-start; padding-top: 12vh; }
.isk-root .palette { width: min(560px, 92vw); padding: var(--s2); }
.isk-root .palette input { width: 100%; font-size: 15px; padding: 10px 12px; min-height: 42px; border-radius: 8px; }
.isk-root .palette .list { margin-top: var(--s2); max-height: 50vh; overflow-y: auto; }
.isk-root .palette .cmd {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  font: inherit; font-size: var(--fs); padding: 8px 10px; border-radius: 6px; border: none;
  background: none; color: var(--text); cursor: pointer;
}
.isk-root .palette .cmd .grp { font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--dim); min-width: 62px; }
.isk-root .palette .cmd .k { margin-left: auto; }
.isk-root .palette .cmd.sel, .isk-root .palette .cmd:hover { background: var(--sel); }
.isk-root .palette .none { padding: 14px 10px; color: var(--dim); font-size: var(--fs-sm); }

/* first-run tour: a spotlight ring on the target and a card beside it */
.isk-root .tourdim { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.isk-root .tourring {
  position: fixed; z-index: 71; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(8, 10, 14, .55), 0 0 0 3px var(--accent);
  transition: all .22s ease;
}
.isk-root .tourcard {
  position: fixed; z-index: 72; width: 320px; padding: var(--s4);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  animation: isk-pop .16s ease-out;
}
.isk-root .tourcard .step { font-size: var(--fs-cap); color: var(--dim); letter-spacing: 1px; text-transform: uppercase; font-weight: 700; }
.isk-root .tourcard h3 { margin: 4px 0 6px; font-size: 15px; }
.isk-root .tourcard p { margin: 0 0 var(--s3); font-size: var(--fs-sm); color: var(--text); line-height: 1.5; }
.isk-root .tourcard .rowflex { margin: 0; justify-content: flex-end; }

/* right-click menu: headings, fly-outs, swatches, key hints */
.isk-root .ctxmenu { max-width: 340px; }
.isk-root .ctxmenu .mtitle {
  padding: 6px 10px 6px; margin-bottom: 2px; font-size: var(--fs-cap); font-weight: 700; letter-spacing: .4px;
  color: var(--dim); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.isk-root .ctxmenu .ml { flex: 1; white-space: nowrap; }
.isk-root .ctxmenu .mi-sp { width: 15px; flex: none; }
.isk-root .ctxmenu .mk { font: 10px/1 ui-monospace, Consolas, monospace; color: var(--dim); margin-left: 14px; }
.isk-root .ctxmenu .chev { margin-left: 10px; color: var(--dim); font-size: 15px; line-height: 1; }
.isk-root .ctxmenu .sw { width: 14px; height: 14px; flex: none; border-radius: 3px; border: 1px solid rgba(0,0,0,.25); }
.isk-root .ctxmenu button.on { background: var(--sel); font-weight: 600; }
.isk-root .ctxmenu button.has-sub:hover, .isk-root .ctxmenu button.has-sub:focus { background: var(--hover); }
.isk-root .ax-grip:hover { fill: #ff9500; }
.isk-root .ax-cell:hover { fill: rgba(255, 149, 0, .14); }

/* ---------- weld log ---------- */
.isk-root .modal.wlog { width: min(1180px, 96vw); max-height: 92vh; display: flex; flex-direction: column; }
.isk-root .wltabs { display: flex; gap: 4px; margin: var(--s2) 0 var(--s3); border-bottom: 1px solid var(--line); }
.isk-root .wltab {
  font: inherit; font-size: var(--fs-sm); padding: 7px 14px; border: none; background: none; color: var(--dim);
  border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px;
}
.isk-root .wltab:hover { color: var(--text); }
.isk-root .wltab.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.isk-root .wlbody { min-height: 0; overflow-y: auto; }
.isk-root .wlbody h4 { margin: var(--s4) 0 var(--s2); }
.isk-root .wlsum { display: flex; gap: var(--s4); align-items: center; margin-bottom: var(--s2); font-size: var(--fs-sm); }
.isk-root .wlsum .bad b, .isk-root table.wl td.bad { color: var(--weld); }
.isk-root .wlsum .good b, .isk-root table.wl td.good { color: var(--ok); }
.isk-root .wlsum .warn b { color: var(--warn); }
.isk-root .wlscroll { overflow-x: auto; }
.isk-root table.wl { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.isk-root table.wl th {
  text-align: left; color: var(--dim); font-size: 9.5px; letter-spacing: .6px; text-transform: uppercase;
  border-bottom: 1px solid var(--line); padding: 6px 5px; white-space: nowrap; position: sticky; top: 0; background: var(--panel);
}
.isk-root table.wl td { padding: 4px 5px; border-bottom: 1px solid var(--line); vertical-align: top; }
.isk-root table.wl td.num, .isk-root table.wl td.nw { text-align: right; white-space: nowrap; }
.isk-root table.wl td.nw { text-align: left; }
.isk-root table.wl td input, .isk-root table.wl td select { min-height: 26px; padding: 2px 6px; font-size: var(--fs-xs); max-width: 100%; }
.isk-root table.wl tr.rowerr td:first-child { box-shadow: inset 3px 0 0 var(--weld); }
.isk-root table.wl td.iss { min-width: 220px; }
.isk-root table.wl td.iss .err { color: var(--weld); }
.isk-root table.wl td.iss .warn { color: var(--warn); }
.isk-root table.wl td.iss .ok { color: var(--ok); font-weight: 700; }
.isk-root table.wl a { color: var(--accent-text); font-weight: 600; text-decoration: none; }
.isk-root .modal.offset { width: min(520px, 92vw); }
.isk-root .modal.ask { width: min(460px, 92vw); }

/* ---------- revision compare bar ---------- */
.isk-root .cmpbar {
  position: absolute; left: 12px; top: 12px; z-index: 20;
  display: flex; align-items: center; gap: 10px; max-width: min(620px, calc(100% - 380px)); flex-wrap: wrap;
  padding: 8px 10px 8px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--accent);
  box-shadow: var(--shadow-sm); font-size: var(--fs-sm);
}
.isk-root .cmpbar .lg { display: inline-flex; align-items: center; gap: 5px; color: var(--dim); font-size: var(--fs-xs); }
.isk-root .cmpbar .lg i { display: inline-block; width: 16px; height: 0; margin-left: 6px; border-top: 3px solid; }
.isk-root .cmpbar .lg i.rm { border-top: 2px dashed #d0021b; }
.isk-root .cmpbar .lg i.ch { border-color: #e8a000; }
.isk-root .cmpbar .lg i.ad { border-color: #1f9a56; }

/* mark-up photos */
.isk-root .photos { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.isk-root .photos img { width: 72px; height: 54px; object-fit: cover; border-radius: 4px; cursor: zoom-in; border: 1px solid var(--line, #333); }
.isk-root table.wl tr.bad td:first-child { color: #ff6b6b; font-weight: 700; }
.isk-root #canvas { touch-action: none; }

/* side panel auto-hide */
.isk-root #main { position: relative; }
.isk-root .tab.pin { flex: 0 0 30px; display: flex; align-items: center; justify-content: center; padding: 6px 0 4px; }
.isk-root .tab.pin svg, .isk-root #sideHandle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.isk-root.side-auto #side {
  position: absolute; right: 0; top: 0; bottom: 0; z-index: 40;
  transform: translateX(102%); transition: transform .18s ease;
  box-shadow: -10px 0 28px rgba(0, 0, 0, .38);
}
.isk-root.side-auto #side.show { transform: none; }
.isk-root #sideHandle { display: none; }
.isk-root.side-auto #sideHandle {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 39;
  width: 22px; padding: 10px 0; background: var(--panel); color: var(--dim);
  border: 1px solid var(--line); border-right: none; border-radius: 8px 0 0 8px; cursor: pointer;
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px; transition: opacity .15s;
}
.isk-root.side-auto #sideHandle:hover { color: var(--text); background: var(--panel2, var(--panel)); }
.isk-root.side-auto #sideHandle span { writing-mode: vertical-rl; }
.isk-root.side-auto #sideHandle svg { width: 14px; height: 14px; }
.isk-root.side-auto #sideHandle.gone { opacity: 0; pointer-events: none; }
