/* Iso Sketch - application chrome. The sheet itself is styled by the renderer. */

.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;
  --weld: #d0021b;
  --mat: #1163d6;
  --ok: #00c2a8;
  --radius: 6px;
  --rail: 78px;
  --side: 348px;
}

/* Screen background, dark through light. */
.isk-root[data-theme="black"] { --bg:#000000; --panel:#0b0d10; --panel2:#141821; --line:#242a33; --text:#e9eef5; --dim:#8b97a6; --field:#171c24; }
.isk-root[data-theme="dark"] { --bg:#10141a; --panel:#181e27; --panel2:#202833; --line:#2c3542; --text:#e9eef5; --dim:#93a1b3; --field:#232c38; }
.isk-root[data-theme="slate"] { --bg:#2b333f; --panel:#333c4a; --panel2:#3d4756; --line:#4a5566; --text:#eef2f7; --dim:#b3bfcd; --field:#46515f; }
.isk-root[data-theme="gray"] { --bg:#9aa3ae; --panel:#e7ebf0; --panel2:#f2f5f8; --line:#c3cbd5; --text:#1b2129; --dim:#5b6673; --field:#ffffff; }
.isk-root[data-theme="light"] { --bg:#e8ecf1; --panel:#ffffff; --panel2:#f4f7fa; --line:#d6dde6; --text:#161b22; --dim:#5d6773; --field:#ffffff; }

.isk-root, .isk-root * { box-sizing: border-box; }
.isk-root [hidden] { display: none !important; }

.isk-root {
  height: 100%; margin: 0;
  font: 13px/1.45 "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text); background: var(--bg);
  overflow: hidden;
}

.isk-root { display: grid; grid-template-rows: auto 1fr auto; }

/* ---------- top bar ---------- */
.isk-root #topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 7px 12px; background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.isk-root .brand { display: flex; align-items: baseline; gap: 7px; user-select: none; }
/* The mark comes from here rather than an <img> in the markup. Embedded, that
   markup is injected into the host page and a relative src resolves against
   the HOST root; a url() in this file resolves against this file, which is in
   iso-sketch/css/ whichever way the editor is running. */
/* 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: 27px; height: 27px; flex: none; transform: translateY(5px); }
.isk-root .brand .mark svg { width: 100%; height: 100%; display: block; }
.isk-root .brand .name { font-weight: 800; letter-spacing: 2px; font-size: 15px; }
.isk-root .brand .sub { color: var(--dim); font-size: 11px; letter-spacing: .4px; }

.isk-root .group { display: flex; align-items: center; gap: 6px; }
.isk-root .group.grow { margin-left: auto; }

.isk-root .btn {
  font: inherit; color: var(--text); background: var(--panel2);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 5px 11px; cursor: pointer; white-space: nowrap;
}
.isk-root .btn:hover { background: var(--field); border-color: var(--accent); }
.isk-root .btn.primary { background: var(--accent); border-color: var(--accent); color: #14181d; font-weight: 700; }
.isk-root .btn.primary:hover { filter: brightness(1.08); }
.isk-root .btn.sm { padding: 3px 8px; font-size: 12px; }
.isk-root .btn.danger:hover { border-color: var(--weld); color: var(--weld); }

.isk-root .fld { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--dim); }
.isk-root .fld > span { text-transform: uppercase; letter-spacing: .6px; }
.isk-root select, .isk-root input[type="text"], .isk-root input:not([type]), .isk-root textarea {
  font: inherit; color: var(--text); background: var(--field);
  border: 1px solid var(--line); border-radius: 5px; padding: 4px 6px;
}
.isk-root select:focus, .isk-root input:focus, .isk-root textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.isk-root input[type="checkbox"] { accent-color: var(--accent); }

/* ---------- main ---------- */
.isk-root #main { display: flex; min-height: 0; }

.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: 3px; padding: 8px 6px; overflow-y: auto;
}
.isk-root .tool {
  display: grid; gap: 2px; justify-items: center;
  padding: 7px 2px; border: 1px solid transparent; border-radius: var(--radius);
  background: none; color: var(--dim); font: inherit; cursor: pointer;
}
.isk-root .tool b { font-size: 15px; line-height: 1; font-weight: 800; }
.isk-root .tool span { font-size: 10px; letter-spacing: .2px; }
.isk-root .tool:hover { background: var(--panel2); color: var(--text); }
.isk-root .tool.active { background: var(--accent); color: #14181d; border-color: var(--accent); }
.isk-root .tool.weld b { color: var(--weld); }
.isk-root .tool.mat b { color: var(--mat); }
.isk-root .tool.active b { color: inherit; }
.isk-root .tool.ghost { color: var(--dim); }
.isk-root .railgap { flex: 1; }

/* ---------- 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 6px 22px rgba(0,0,0,.45)); }
.isk-root .ax-hit { cursor: pointer; }
.isk-root .ax-hit-lbl { cursor: move; }

.isk-root #sheetTabs {
  position: absolute; left: 10px; bottom: 10px; display: flex; gap: 5px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--line); border-radius: 8px; padding: 5px; max-width: calc(100% - 20px);
  overflow-x: auto;
}
.isk-root .sheetTab {
  font: inherit; font-size: 12px; padding: 4px 10px; border-radius: 5px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--dim); cursor: pointer; white-space: nowrap;
}
.isk-root .sheetTab.active { background: var(--accent); color: #14181d; border-color: var(--accent); font-weight: 700; }

.isk-root #inlineEdit {
  position: absolute; z-index: 20; background: var(--panel);
  border: 1px solid var(--accent); border-radius: 6px; padding: 6px;
  box-shadow: 0 8px 26px rgba(0,0,0,.4);
}
.isk-root #inlineEdit input { width: 190px; }
.isk-root #inlineEdit .hint { font-size: 10px; color: var(--dim); margin-top: 4px; }

/* ---------- 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); }
.isk-root .tab {
  flex: 1; font: inherit; font-size: 11.5px; padding: 8px 2px; cursor: pointer;
  background: none; border: none; border-bottom: 2px solid transparent; color: var(--dim);
}
.isk-root .tab:hover { color: var(--text); }
.isk-root .tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 700; }
.isk-root .panes { flex: 1; min-height: 0; overflow-y: auto; }
.isk-root .pane { display: none; padding: 12px; }
.isk-root .pane.active { display: block; }

.isk-root h4 {
  margin: 16px 0 8px; font-size: 10.5px; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--dim); font-weight: 700;
}
.isk-root h4:first-child { margin-top: 0; }

.isk-root .row { display: grid; grid-template-columns: 96px 1fr; gap: 6px; align-items: center; margin-bottom: 6px; }
.isk-root .row > label { font-size: 11.5px; 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: 8px; }

/* 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: 12px; }
.isk-root .muted { color: var(--dim); font-size: 11.5px; }
.isk-root .note { color: var(--dim); font-size: 11px; margin: 8px 0 0; line-height: 1.5; }
/* 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: 12px; padding: 22px 6px; text-align: center; }

/* component palette */
.isk-root .parts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.isk-root .part {
  font: inherit; font-size: 11.5px; text-align: left; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: 5px; background: var(--panel2);
  color: var(--text); cursor: pointer;
}
.isk-root .part:hover { border-color: var(--accent); }
.isk-root .part.active { background: var(--accent); color: #14181d; 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: 11px; 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: #14181d; border-color: var(--accent); font-weight: 700; }

/* bom table */
.isk-root table.bom { width: 100%; border-collapse: collapse; font-size: 11px; }
.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: 11.5px; }
.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: 12px; }
.isk-root .sheetRow .no { color: var(--dim); font-size: 11px; 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: 12px; }

/* ---------- status ---------- */
.isk-root #status {
  display: flex; align-items: center; gap: 10px; padding: 5px 12px;
  background: var(--panel); border-top: 1px solid var(--line); font-size: 11.5px; color: var(--dim);
}
.isk-root #status .spacer, .isk-root .group .spacer { flex: 1; }
.isk-root .chip {
  padding: 2px 8px; 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); }
/* A locked length is in force whether or not you are looking at the bar. */
.isk-root .fld.inline.locked > span { color: var(--accent); font-weight: 700; }
.isk-root .fld.inline.locked input { border-color: var(--accent); }
.isk-root #statusText { color: var(--text); }
