/* Direction C «Офис» (Fluent 2 / Windows 11), dark by the mood of B «Студия»; one blue accent in both themes.
   Every color is light-dark(light, dark): the page follows the system, data-theme fixes one. */
:root {
  color-scheme: light dark;
  --chrome: light-dark(#eef1f6, #0e0e11);
  --page: light-dark(#f9f9fb, #141417);
  --card: light-dark(#ffffff, #1b1b1f);
  --stroke: light-dark(rgba(0, 0, 0, .07), rgba(255, 255, 255, .07));
  --stroke-2: light-dark(rgba(0, 0, 0, .12), rgba(255, 255, 255, .12));
  --text: light-dark(#1b1b1f, #ededef);
  --text-2: light-dark(#5c5f66, #a0a0a8);
  --text-3: light-dark(#6e7178, #85858e);
  --accent: light-dark(#0067c0, #2b74c8);
  --accent-text: light-dark(#0067c0, #78b4f5);
  --on-accent: #fff;
  --accent-soft: light-dark(#e5f0fb, rgba(75, 150, 240, .16));
  --hover: light-dark(rgba(0, 0, 0, .035), rgba(255, 255, 255, .045));
  --selected: light-dark(rgba(0, 0, 0, .055), rgba(255, 255, 255, .075));
  --danger: light-dark(#c42b1c, #ff99a4);
  --example-bg: light-dark(#f8e9e3, rgba(214, 120, 90, .16));
  --example-line: light-dark(#e2b5a5, rgba(214, 120, 90, .4));
  --example-text: light-dark(#8a3d24, #f0b39c);
  --shadow: light-dark(0 2px 6px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .35));
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { background: var(--chrome); color: var(--text); font: 14px/1.4 var(--font); font-variant-numeric: tabular-nums; overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; border-radius: 4px; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill-accent { fill: var(--accent); stroke: none; }
svg .on-accent { stroke: var(--on-accent); stroke-width: 1.3; }

.nav, .page, .props { scrollbar-width: thin; scrollbar-color: var(--stroke-2) transparent; }

.app { display: grid; grid-template-rows: 44px minmax(0, 1fr) 28px; height: 100vh; }

/* Title bar: drag region; the system caption buttons sit on the right (titleBarOverlay), the text never runs under them. */
.title { display: flex; align-items: center; gap: 12px; padding-left: 16px; -webkit-app-region: drag; user-select: none;
  padding-right: calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw)); }
.title .name { font-size: 12.5px; color: var(--text-2); }
.title .name b { color: var(--text); font-weight: 600; }

.main { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 0; }

.nav { padding: 4px 8px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.nav .it { position: relative; display: flex; align-items: center; gap: 14px; height: 38px; padding: 0 12px; border-radius: 6px; width: 100%; }
.nav .it:hover { background: var(--hover); }
.nav .it[aria-current="page"] { background: var(--selected); font-weight: 600; }
.nav .it[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3px; border-radius: 2px; background: var(--accent); }
.nav hr { border: 0; border-top: 1px solid var(--stroke); margin: 8px 12px; }
.nav .end { margin-top: auto; padding-bottom: 8px; }

.surface { display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 0; background: var(--page); border: 1px solid var(--stroke); border-right: 0; border-bottom: 0; border-top-left-radius: 8px; overflow: hidden; }
.page { overflow: auto; scrollbar-gutter: stable; padding: 22px 28px 20px; display: flex; flex-direction: column; min-width: 0; }
.page:focus { outline: none; caret-color: transparent; }
.props { border-left: 1px solid var(--stroke); overflow: auto; padding: 18px 16px; }
.props h2 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.props .hint { color: var(--text-2); font-size: 13px; }
.props .big { font: 600 20px/1.25 var(--font-display); margin-bottom: 4px; }
.props .sub { color: var(--text-2); font-size: 13px; margin-bottom: 14px; }

.head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin-bottom: 14px; }
.head h1 { font: 600 28px/1.2 var(--font-display); letter-spacing: -.01em; }
.head > div:first-child { min-width: 0; flex: 1 1 300px; }
.head h1 { white-space: nowrap; }
/* a long order name stays two lines; what changed comes first in the line, so it is never the part cut off */
.head .sub { color: var(--text-2); margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
/* at the 1100 px minimum the five buttons do not fit in a line: they wrap to the right, the page never scrolls sideways */
.head .acts { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 0; }

.btn { height: 32px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 6px; background: var(--card); border: 1px solid var(--stroke); border-bottom-color: var(--stroke-2); font-size: 13.5px; white-space: nowrap; }
.btn svg.i { width: 16px; height: 16px; }
.btn.pri { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn:disabled { color: var(--text-3); }
.btn.pri:disabled { background: var(--hover); color: var(--text-3); border-color: var(--stroke); }
/* locked but still focusable, so its reason reaches the status bar: looks off as a disabled one does */
.btn[aria-disabled="true"] { color: var(--text-3); cursor: default; }
.btn.pri[aria-disabled="true"] { background: var(--hover); color: var(--text-3); border-color: var(--stroke); }

.pivot { display: flex; gap: 24px; border-bottom: 1px solid var(--stroke); margin-bottom: 18px; }
.pivot button { padding: 8px 0 10px; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
.pivot button[aria-selected="true"] { color: var(--text); font-weight: 600; box-shadow: inset 0 -3px var(--accent); }
.pivot button[aria-disabled="true"] { color: var(--text-3); cursor: default; }
.pivot .num { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--selected); font-size: 11.5px; font-weight: 600; }
.pivot [aria-selected="true"] .num { background: var(--accent); color: var(--on-accent); }
.pivot svg.i { width: 14px; height: 14px; }

.card { background: var(--card); border: 1px solid var(--stroke); border-radius: 8px; box-shadow: var(--shadow); }

.empty { flex: 1; display: grid; place-content: center; justify-items: center; text-align: center; gap: 10px; padding: 48px 24px; }
.empty .ring { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.empty .ring svg.i { width: 26px; height: 26px; }
.empty h2 { font: 600 20px/1.25 var(--font-display); }
.empty p { color: var(--text-2); max-width: 460px; }

/* GOST base list */
.table { overflow: hidden; flex: none; }
.table .row { display: grid; grid-template-columns: 172px minmax(0, 1fr) 110px 140px; gap: 16px; align-items: center; padding: 10px 16px; width: 100%; border-top: 1px solid var(--stroke); }
.table .row.th { border-top: 0; font-size: 12.5px; color: var(--text-2); padding-top: 12px; padding-bottom: 8px; }
.table button.row:hover { background: var(--hover); }
.table button.row[aria-pressed="true"] { background: var(--accent-soft); }
.table button.row[aria-pressed="true"] .chip.on { background: var(--card); }
.table .num { font-weight: 600; white-space: nowrap; }
.table .ttl { min-width: 0; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; border: 1px solid var(--stroke-2); color: var(--text-2); white-space: nowrap; }
.chip.on { border-color: transparent; background: var(--accent-soft); color: var(--accent-text); }
.note { color: var(--text-2); }

/* Settings */
.set { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px; }
.set + .set { border-top: 1px solid var(--stroke); }
.set .k { font-weight: 600; }
.set .h { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.logo-row { display: flex; align-items: center; gap: 10px; }
/* The licence screen: the machine code to copy, the key box, the answer to the key. */
.set.keyset { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.mcode { font: 600 15px/1 Consolas, "Cascadia Mono", monospace; letter-spacing: .06em; padding: 7px 10px; border-radius: 6px; background: var(--hover); user-select: all; }
.keybox { width: 100%; min-height: 72px; resize: vertical; padding: 8px 10px; border-radius: 6px; font: 12.5px/1.45 Consolas, "Cascadia Mono", monospace; color: var(--text); background: var(--card); border: 1px solid var(--stroke-2); border-bottom-color: var(--text-3); word-break: break-all; }
.reportbox { min-height: 220px; word-break: break-word; white-space: pre-wrap; overflow: auto; color: var(--text-2); }
.keybox:focus { outline: none; border-bottom: 2px solid var(--accent-text); }
.eula summary { cursor: pointer; width: max-content; color: var(--accent-text); }
.eula .reportbox { margin-top: 8px; min-height: 320px; white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.5; }
.ok { color: var(--accent-text); font-size: 12.5px; font-weight: 600; }
.vtier { border-style: solid; background: var(--accent-soft); color: var(--text); }
.vtier > svg.i { color: var(--accent-text); }
.logo-prev { max-height: 48px; max-width: 160px; object-fit: contain; background: #fff; border: 1px solid var(--stroke); border-radius: 4px; padding: 4px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; background: var(--hover); border-radius: 6px; }
.seg button { padding: 5px 14px; border-radius: 4px; font-size: 13px; color: var(--text-2); }
.seg button[aria-checked="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.seg button:disabled { opacity: .55; }
.stack { display: grid; gap: 12px; align-content: start; }

/* Property rows */
.kv { display: grid; gap: 2px; }
.kv .r { display: grid; grid-template-columns: minmax(84px, auto) minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid var(--stroke); }
.kv .r:first-child { border-top: 0; }
.kv .k { color: var(--text-2); }
.kv .v { font-weight: 600; text-align: right; }

.status { display: flex; align-items: center; gap: 18px; padding: 0 16px; font-size: 12px; color: var(--text-2); border-top: 1px solid var(--stroke); white-space: nowrap; overflow: hidden; }
.status span { display: inline-flex; align-items: center; gap: 6px; }
.status svg.i { width: 14px; height: 14px; }
.status .sb-note { color: var(--text); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.status .sb-open { font: inherit; font-weight: 600; color: var(--accent-text); background: none; border: 0; padding: 2px 4px; border-radius: 4px; cursor: pointer; text-decoration: underline; }
.status .sb-open:focus-visible { outline: 2px solid var(--accent); }
.status .ref { flex: 1; justify-content: flex-end; color: var(--text); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Forms: stock and cargo. Labels above inputs, two columns, the error under its field. */
.lead { color: var(--text-2); margin: -4px 0 14px; max-width: 760px; }
.card.form { padding: 16px 18px 18px; }
.card.form h2 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.fld { display: grid; gap: 5px; align-content: start; min-width: 0; }
.fld.wide { grid-column: 1 / -1; }
.lbl { font-weight: 600; font-size: 13.5px; }
.lbl .unit, .lbl .opt { font-weight: 400; color: var(--text-2); }
.lbl .opt::before { content: "· "; }
.fld .h { color: var(--text-2); font-size: 12.5px; }
.in, .refpick { height: 32px; width: 100%; padding: 0 10px; border-radius: 6px; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--stroke-2); border-bottom-color: var(--text-3); }
.in:focus, .refpick:focus { outline: none; border-bottom: 2px solid var(--accent-text); }
.in[aria-invalid="true"], .seg[aria-invalid="true"] { border-color: var(--danger); box-shadow: inset 0 -1px var(--danger); }
.seg[aria-invalid="true"] { border: 1px solid var(--danger); }
.fld .seg { justify-self: start; flex-wrap: wrap; }
.err { color: var(--danger); font-size: 12.5px; min-height: 0; }
.err:empty { display: none; }
.flag label { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.flag input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.flag .h { padding-left: 28px; }
.refslot { display: grid; gap: 5px; justify-items: start; }
.refpick { width: auto; max-width: 100%; color: var(--text-2); }
.kv.gap { margin-top: 12px; }
/* the licence rows in a card of their own: the fields of the "Разработчик" card next to it, not text at the border */
.card > .kv { padding: 6px 18px; }
.kv .v { overflow-wrap: break-word; min-width: 0; }
/* "what is left": the label wraps, "не заполнено" stays on one line (web-qa N2) */
.kv.todo .r { grid-template-columns: minmax(0, 1fr) auto; }
.kv.todo .v { white-space: nowrap; }
/* one column width on every page: stock, journal and calculation line up at 1920 */
.page > * { max-width: 1240px; width: 100%; }
.badge { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 6px; background: var(--accent-soft); font-size: 12.5px; }
.badge svg.i { width: 16px; height: 16px; color: var(--accent-text); margin-top: 1px; }
.grid-rows { display: grid; gap: 6px; }
.grid-rows .rw { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 32px; gap: 10px; align-items: start; }
.grid-rows .rw.th { font-size: 12.5px; }
.grid-rows .rw.th .lbl, .grid-rows .rw.th span { font-weight: 600; }
.fld .btn { justify-self: start; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; color: var(--text-2); }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.notice { display: flex; gap: 12px; align-items: center; padding: 12px 14px; margin-bottom: 12px; border-radius: 8px; background: var(--accent-soft); }
.notice > svg.i { color: var(--accent-text); }
.notice > div { flex: 1; min-width: 0; }
.notice .h { color: var(--text-2); font-size: 13px; }
.foot { display: flex; justify-content: flex-end; padding-top: 14px; }
.btn.pri svg.i { order: 2; }

/* Design step: variant cards by standard, the picked card with its mini-form, tabs, tiles, scheme and tables. */
.page > .design { display: grid; gap: 14px; }
.vgroup h2 { font-size: 15px; font-weight: 600; margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; }
.gost { font-weight: 400; font-size: 12.5px; color: var(--text-2); }
.vcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 10px; }
.vcard { display: grid; gap: 6px; align-content: start; padding: 12px 14px; border-radius: 8px; background: var(--card); border: 1px solid var(--stroke); box-shadow: var(--shadow); min-width: 0; }
.vcard:hover { border-color: var(--stroke-2); }
.vcard[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.vc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.vc-top b { font: 600 17px/1.2 var(--font-display); }
.vc-desc { color: var(--text-2); font-size: 12.5px; }
.vc-nums { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }
.vc-nums b { flex-basis: 100%; font: 600 16px/1.3 var(--font-display); }
.vc-why { font-size: 12.5px; color: var(--text-2); }
.vc-foot { font-size: 12px; color: var(--text-3); }
.chip.st-ok { border-color: transparent; background: var(--accent-soft); color: var(--accent-text); }
.chip.st-need { border-style: dashed; border-color: var(--accent-text); color: var(--accent-text); }
.chip.st-no { color: var(--text-3); }
.vnone { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--text-2); padding: 10px 14px; border: 1px dashed var(--stroke-2); border-radius: 8px; }
.vnone svg.i { width: 16px; height: 16px; }
.vrefused { margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.vrefused summary { cursor: pointer; width: max-content; }
.vrefused ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.link { color: var(--accent-text); text-decoration: underline; }
.vpicked { padding: 16px 18px 18px; display: grid; gap: 12px; }
.vhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.vhead h2 { font: 600 20px/1.25 var(--font-display); display: flex; gap: 8px; align-items: baseline; }
.refine .card.form { box-shadow: none; background: var(--page); }
.refine > .h { color: var(--text-2); font-size: 12.5px; margin-top: 6px; }
.pivot.sm { margin-bottom: 0; gap: 20px; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; gap: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 12px; }
.tile { display: grid; align-content: start; align-self: stretch; gap: 2px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--stroke); background: var(--page); min-width: 0; }
.tile .k { font-size: 12px; color: var(--text-2); }
.tile .v { font: 600 19px/1.25 var(--font-display); overflow-wrap: anywhere; }
.tile .v small { font: 400 12.5px var(--font); color: var(--text-2); white-space: nowrap; }
.tile .refchip { margin-top: 4px; font-size: 11.5px; text-align: start; }
.tile.on, .dt-row.on { background: var(--accent-soft); border-color: transparent; }
.dgrid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.schemebox { display: grid; gap: 8px; margin: 0; padding: 10px; border: 1px solid var(--stroke); border-radius: 8px; background: var(--page); }
.schemebox figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; font-size: 12px; color: var(--text-2); }
svg.scheme { width: 100%; max-height: 260px; }
svg.scheme .slab { cursor: pointer; }
svg.scheme polygon { stroke: var(--text-3); stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
svg.scheme .f-top { fill: light-dark(#e6dccd, #4a3d2c); }
svg.scheme .f-x { fill: light-dark(#d4c5ae, #3a2f22); }
svg.scheme .f-y { fill: light-dark(#c2b195, #2e251a); }
svg.scheme .slab:hover polygon { stroke: var(--text); }
/* the ring of a focused group is its own outline, not the browser's box: a box of a wall behind would cross the lid */
svg.scheme .slab:focus { outline: none; }
svg.scheme .slab:focus-visible polygon { stroke: var(--accent); stroke-width: 2.4; }
svg.scheme .slab.on .f-top { fill: light-dark(#b9d6f5, #2b5a8e); }
svg.scheme .slab.on .f-x { fill: light-dark(#9cc3ee, #234d7a); }
svg.scheme .slab.on .f-y { fill: light-dark(#85b3e6, #1d4068); }
svg.scheme:has(.slab.on) .slab:not(.on) { opacity: 0.45; }
.dtable { display: grid; border: 1px solid var(--stroke); border-radius: 8px; overflow: hidden; }
.dt-row { display: grid; gap: 10px; align-items: center; padding: 7px 12px; width: 100%; border-top: 1px solid var(--stroke); font-size: 13px; }
.dt-row:first-child { border-top: 0; }
.dt-row.th { font-size: 12px; color: var(--text-2); font-weight: 600; }
button.dt-row:hover { background: var(--hover); }
.dt-row.cols-5 { grid-template-columns: minmax(110px, 1.5fr) 86px 62px 34px 52px minmax(0, 1fr); }
.dt-row.cols-4 { grid-template-columns: minmax(110px, 1.5fr) 72px 72px 80px minmax(0, 1fr); }
.dt-row.cols-3 { grid-template-columns: minmax(130px, 1.5fr) 92px 92px minmax(0, 1fr); }
.dt-row .n { text-align: right; }
.dt-row .r { color: var(--text-2); font-size: 12px; overflow-wrap: anywhere; }
.vbody h3 { font-size: 13.5px; font-weight: 600; margin: 14px 0 6px; }
.vbody > .h { color: var(--text-2); font-size: 12.5px; margin-bottom: 8px; }
.notes { list-style: none; padding: 0; display: grid; gap: 6px; }
.nt { display: grid; gap: 4px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--stroke); background: var(--page); font-size: 13px; }
.nt-warn, .nt-nc, .nt-need { background: var(--accent-soft); border-color: transparent; }
.nt-no { border-color: var(--danger); }
.nt-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.refchip { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text-2); }
.refchip svg.i { width: 13px; height: 13px; }
.cut-mode { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.cut-mode .chip { white-space: normal; height: auto; min-height: 22px; padding: 2px 10px; }
.tile .mark { font-size: 11.5px; color: var(--accent-text); }
.cutlist { display: grid; gap: 10px; }
.cutsec { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--stroke); border-radius: 8px; background: var(--page); }
.cutsec.on { border-color: var(--accent-text); }
.cut-h { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; text-align: left; font-size: 13px; color: var(--text-2); }
.cut-h b { font: 600 15px/1.3 var(--font-display); color: var(--text); }
.cut-h .r { margin-left: auto; }
.barrow { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 2px 10px; align-items: center; }
.bar-n { font-size: 12.5px; font-weight: 600; text-align: right; }
.bar-t { grid-column: 1 / -1; font-size: 12px; color: var(--text-2); }
.ws-t { color: var(--text-3); }
svg.bar { width: 100%; height: 22px; display: block; }
svg.bar rect { vector-effect: non-scaling-stroke; }
svg.bar .st { fill: none; stroke: var(--stroke-2); stroke-width: 1; }
svg.bar .pc { fill: light-dark(#d4c5ae, #8a7556); stroke: var(--page); stroke-width: 2; }
svg.bar .ws { fill: var(--selected); stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.dt-row.est { grid-template-columns: minmax(200px, 1fr) 96px 56px 104px 116px; }
.dt-row.est span:first-child { white-space: normal; }
.dt-row.total { font-weight: 600; font-size: 14px; background: var(--accent-soft); }

/* order journal: search, list, the picked order in the side panel */
/* on a wide screen "Новый расчёт" stays over the list, not at the far edge */
.jbar { margin-bottom: 12px; }
.jbar .in { max-width: 420px; }
.table.orders .row { grid-template-columns: 52px 128px minmax(0, 1fr) 132px 116px; text-align: left; }
.table.orders .when { color: var(--text-2); font-variant-numeric: tabular-nums; }
.table.orders .ttl { display: grid; gap: 2px; color: var(--text); }
/* three lines before the ellipsis: a cargo name "Груз 1 200 кг, 1 200 × 800 × 900 мм" was cut at 1366 (web-qa 65 #13), at 1100 two
   were not enough (web-qa 67 M2) */
.table.orders .ttl .nm { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.table.orders .ttl .h { color: var(--text-2); font-size: 12.5px; }
.table.orders .n { text-align: right; font-variant-numeric: tabular-nums; }
.hint.pad { padding: 12px 16px; border-top: 1px solid var(--stroke); }
.props .fld { margin-bottom: 8px; }
.props .fld .k { color: var(--text-2); font-size: 12.5px; }
.props h2.gap { margin-top: 16px; }
.props .kv + .hint { margin-top: 8px; }
.jacts { display: grid; gap: 8px; margin-top: 16px; }
.jacts .btn { justify-content: center; }
@media (max-width: 1500px) {
  .dgrid { grid-template-columns: minmax(0, 1fr); }
  .schemebox { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); align-items: end; }
}

@media (max-width: 1280px) {
  .main { grid-template-columns: 216px minmax(0, 1fr); }
  .surface { grid-template-columns: minmax(0, 1fr) 256px; }
  .fields { gap: 12px 16px; }
  .table .row { grid-template-columns: 156px minmax(0, 1fr) 92px 120px; gap: 12px; }
  .table.orders .row { grid-template-columns: 48px 112px minmax(0, 1fr) 112px 104px; }
  /* the five document buttons stay in one row down to 1100: words only, narrower */
  .head .acts .btn { padding: 0 11px; }
  .head .acts .btn svg.i { display: none; }
}
/* "Fill" by mouse: the field it leads to flashes once (no focus ring after a click) */
.pulse { animation: pulse 1.4s ease-out 1; }
@keyframes pulse { 0%, 30% { box-shadow: 0 0 0 4px var(--accent-soft), 0 0 0 1px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation-duration: 2.5s; animation-timing-function: steps(1, end); } }
/* The start picture of Taramer (design/splash, chosen 27.10): always dark, whatever the theme, as Adobe's. The splash window
   (app/ui/splash.html, 640×400, no frame) and the web's loading screen (index.html #boot, until the first answer) draw the
   same: the crate of crate-art.js over dots, the name, the standards, a running line, the version and the maker. */
.sp {
  --sp-card: #1b1b1f; --sp-text: #ededef; --sp-text-2: #a0a0a8; --sp-text-3: #85858e; --sp-stroke: rgba(255,255,255,.12);
  --accent: #2b74c8; --sp-line: #78b4f5; --sp-wall: rgba(120,180,245,.04); --sp-side: rgba(120,180,245,.085);
  --sp-lid: rgba(120,180,245,.06); --sp-dot: rgba(255,255,255,.07);
  position: relative; overflow: hidden; background: var(--sp-card); color: var(--sp-text); color-scheme: dark; user-select: none; cursor: default;
}
body.splash { height: 100vh; border: 1px solid var(--sp-stroke); }
.sp .art { position: absolute; inset: 0; width: 100%; height: 100%; }
.sp .art .dot { fill: var(--sp-dot); }
.sp .art line, .sp .art polygon { stroke: var(--sp-line); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sp .art .wall { fill: var(--sp-wall); stroke-width: 1.3; }
.sp .art .wall.side { fill: var(--sp-side); }
.sp .art .lid { fill: var(--sp-lid); stroke-width: 1.3; }
.sp .art .batten { fill: var(--sp-side); stroke-width: 1; }
.sp .art .seam { stroke-width: .8; opacity: .55; }
.sp .art .edge { stroke-width: 1.3; }
.sp .art .hid { stroke-width: .8; stroke-dasharray: 3 4; opacity: .35; }
.sp .art .guide { stroke-width: .8; stroke-dasharray: 2 4; opacity: .6; }
.sp .art .ext { stroke-width: .7; opacity: .45; }
.sp .art .dim { stroke-width: .8; opacity: .8; }
.sp .art .tick { fill: var(--sp-line); }
.sp .art .num { fill: var(--sp-text-3); font: 600 11px var(--font); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.sp .art polygon, .sp .art line:not(.hid):not(.guide) { stroke-dasharray: 600; stroke-dashoffset: 600; animation: sp-draw 1.6s ease-out forwards; }
@keyframes sp-draw { to { stroke-dashoffset: 0; } }
.sp-txt { position: absolute; left: 36px; top: 34px; width: 44%; }
.sp-brand { display: flex; align-items: center; gap: 8px; color: var(--sp-text-2); font-size: 11px; font-weight: 600; letter-spacing: .16em; }
.sp-brand svg.i { width: 22px; height: 22px; display: block; }
.sp h1 { margin-top: 64px; font: 600 52px/1 var(--font-display); letter-spacing: -.025em; color: var(--sp-text); }
.sp-tag { margin-top: 12px; color: var(--sp-text-2); font-size: 15px; }
.sp-gosts { margin-top: 6px; color: var(--sp-text-3); font-size: 11.5px; letter-spacing: .02em; }
.sp-foot { position: absolute; left: 36px; right: 36px; bottom: 20px; }
.sp-status { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--sp-text-2); }
.sp-status > span:first-child { white-space: nowrap; }
.sp-bar { flex: 1; height: 2px; background: var(--sp-stroke); border-radius: 2px; overflow: hidden; }
.sp-bar i { display: block; height: 100%; width: 62%; background: var(--accent); animation: sp-load 2.4s ease-in-out infinite; }
@keyframes sp-load { from { width: 8%; } to { width: 96%; } }
.sp-legal { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; font-size: 11px; color: var(--sp-text-3); }
/* the web: the whole window until the program has its first answer, the picture larger, as the mockup's 960×540 */
.boot { position: fixed; inset: 0; z-index: 100; }
.boot .sp-txt { left: 64px; top: 56px; width: 40%; }
.boot h1 { margin-top: 96px; font-size: 64px; }
.boot .sp-foot { left: 64px; right: 64px; bottom: 32px; }
@media (max-width: 640px) {
  .boot .art { opacity: .45; }
  .boot .sp-txt { left: 16px; right: 16px; top: 32px; width: auto; }
  .boot h1 { margin-top: 48px; font-size: 44px; }
  .boot .sp-foot { left: 16px; right: 16px; bottom: 20px; }
  .boot .sp-legal { flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { .sp .art polygon, .sp .art line, .sp-bar i { animation: none; stroke-dashoffset: 0; } }
/* First steps (prod-8a, onboard.js): the welcome dialog, the ways to start, the tour card and its ring, "how to use", the
   example's band. The example is marked in a muted terracotta, not yellow (canon 3.3: no yellow, no gold). */
dialog#welcome { margin: auto; width: min(720px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--stroke-2); border-radius: 12px; background: var(--card); color: var(--text); box-shadow: 0 16px 48px rgba(0, 0, 0, .28); }
dialog#welcome::backdrop { background: rgba(0, 0, 0, .4); }
.welcome { padding: 28px 32px 22px; }
.welcome .wtop { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.welcome h2 { font: 600 26px/1.25 var(--font-display); letter-spacing: -.01em; }
.welcome .wtop .icon-btn { margin: -4px -10px 0 0; }
.welcome .lead { color: var(--text-2); font-size: 15px; margin: 6px 0 22px; }
.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ways.two { grid-template-columns: repeat(2, minmax(0, 320px)); }
.way { display: grid; align-content: start; gap: 4px; padding: 16px; border: 1px solid var(--stroke-2); border-radius: 10px; background: var(--page); }
.way:hover { background: var(--hover); border-color: var(--text-3); }
.way.pri { border-color: var(--accent); background: var(--accent-soft); }
.way b { font-size: 15px; font-weight: 600; margin-top: 8px; }
.way .h { color: var(--text-2); font-size: 13px; line-height: 1.45; }
.wn { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; background: var(--selected); color: var(--accent-text); }
.way.pri .wn { background: var(--accent); color: var(--on-accent); }
.wfoot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-top: 20px; }
.wfoot .h { color: var(--text-2); font-size: 13px; }
label.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); cursor: pointer; }
label.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

#tour-ring { position: fixed; z-index: 50; border-radius: 10px; pointer-events: none; box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px var(--accent-soft); }
#tour { position: fixed; z-index: 51; width: 360px; padding: 18px 20px 14px; border: 1px solid var(--stroke-2); border-radius: 10px; background: var(--card); box-shadow: 0 12px 36px rgba(0, 0, 0, .22); }
#tour[hidden], #tour-ring[hidden] { display: none; }
#tour .tstep { color: var(--accent-text); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
#tour h2 { font: 600 17px/1.3 var(--font-display); margin: 6px 0; }
#tour p { color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
#tour .tfoot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
#tour .tfoot .link { margin-left: auto; margin-right: 4px; font-size: 12.5px; color: var(--text-2); }
.dots { display: flex; gap: 5px; }
.dots .dot { width: 6px; height: 6px; border-radius: 3px; background: var(--stroke-2); }
.dots .dot.on { width: 16px; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) { #tour, #tour-ring { transition: top .18s ease-out, left .18s ease-out, width .18s ease-out, height .18s ease-out; } }

.kv.keys .r { grid-template-columns: 64px minmax(0, 1fr); }
.kv.keys .v { font-weight: 400; text-align: left; }
.nav .it { white-space: nowrap; }
.nav .it kbd { margin-left: auto; }
@media (max-width: 1280px) { .nav .it kbd { display: none; } }
.kv.keys kbd, .nav .it kbd { font: 11px var(--font); color: var(--text-3); border: 1px solid var(--stroke-2); border-radius: 4px; padding: 0 5px; }
.notice.example { background: var(--example-bg); border: 1px solid var(--example-line); }
.notice.example b { color: var(--example-text); font-weight: 600; }
.status .sb-example { color: var(--example-text); background: var(--example-bg); text-decoration: none; }
.steps-list { display: grid; gap: 8px; padding-left: 22px; }
.steps-list li { padding-left: 4px; }
#developer, .steps-card { padding: 16px 18px 18px; }
#developer > h2, .steps-card > h2 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
#developer .logo-row { margin-top: 14px; }
details.news { margin-top: 14px; border-top: 1px solid var(--stroke); padding-top: 10px; }
details.news summary { cursor: pointer; font-weight: 600; }
details.news .h { color: var(--text-2); font-size: 13px; margin-top: 6px; }

/* The sign-in page of the web build (login.html): one card in the middle, the program's own fields and buttons. */
body.login { overflow: auto; background: var(--page); }
.signin { min-height: 100%; display: grid; place-content: center; gap: 18px; padding: 24px 16px; }
.signin .brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.signin .brand svg.i { width: 24px; height: 24px; }
.signin .brand .name { color: var(--text-2); }
.signin .brand .name b { color: var(--text); font-weight: 600; }
.signin-card { width: min(380px, calc(100vw - 32px)); padding: 24px; display: grid; gap: 14px; }
.signin-card h1 { font: 600 20px/1.3 var(--font-display); }
.signin-card > .h { color: var(--text-2); font-size: 13px; }
.signin .show { display: flex; align-items: center; gap: 8px; width: fit-content; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.signin .show input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.signin-card .btn.pri { justify-content: center; height: 36px; margin-top: 4px; }

/* Narrow screens: the web build on a tablet or a phone (the program's window is never under 1100 px, main.cjs minWidth).
   The menu becomes a strip under the title that scrolls sideways, "Свойства" go under the page and the two scroll as one. */
@media (max-width: 1099px) {
  .app { height: 100dvh; grid-template-rows: 44px minmax(0, 1fr) 28px; }
  .title .name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 16px; }
  .main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .nav { flex-direction: row; gap: 2px; padding: 0 8px 6px; overflow: auto hidden; scrollbar-width: none; }
  .nav .it { width: auto; flex: none; gap: 8px; height: 36px; padding: 0 12px; }
  .nav .it[aria-current="page"]::before { left: 12px; right: 12px; top: auto; bottom: 0; width: auto; height: 3px; }
  .nav .end { display: flex; gap: 2px; margin: 0; padding: 0; }
  .nav hr { margin: 8px 4px; border-top: 0; border-left: 1px solid var(--stroke); }
  .nav .it kbd { display: none; }
  .surface { display: block; overflow: auto; border-left: 0; border-top-left-radius: 0; scrollbar-width: thin; scrollbar-color: var(--stroke-2) transparent; }
  .page { overflow: visible; padding: 20px 20px 16px; }
  .props { border-left: 0; border-top: 1px solid var(--stroke); overflow: visible; padding: 16px 20px 24px; }
  .status .ref { display: none; }
}
/* a tablet: "Как пользоваться", "О программе", "Настройки" as icons (the name stays for screen readers and in the hint),
   so the whole menu fits 768 without a sideways scroll; the open one keeps its name (web-qa 67 M3) */
@media (min-width: 641px) and (max-width: 1099px) {
  .nav .it { padding: 0 10px; }
  .nav .it[aria-current="page"]::before { left: 10px; right: 10px; }
  .nav .end .it:not([aria-current]) .lb { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (max-width: 640px) {
  .page { padding: 16px 16px 12px; }
  .props { padding: 14px 16px 20px; }
  .head h1 { white-space: normal; font-size: 24px; }
  .head > div:first-child { flex-basis: 100%; }
  .head .acts { margin-left: 0; justify-content: flex-start; }
  .head .acts .btn svg.i { display: none; }
  /* gap 12: the four steps fit 390 without a sideways scroll once unlocked (web-qa 67 M4) */
  .pivot { gap: 12px; overflow: auto hidden; scrollbar-width: none; }
  .pivot button { flex: none; white-space: nowrap; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .card.form { padding: 14px 14px 16px; }
  .grid-rows .rw { gap: 6px; }
  .set { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .vhead { flex-wrap: wrap; }
  .schemebox { grid-template-columns: minmax(0, 1fr); }
  /* the tables of parts and the estimate keep their columns and scroll sideways in their own box, never the page */
  .dtable { overflow-x: auto; }
  .dt-row { min-width: 560px; }
  .dt-row.est { min-width: 620px; }
  /* the base and the journal: each row a small card, the header row is not needed */
  .table .row.th { display: none; }
  .table .row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 8px; padding: 12px 14px; }
  .table .row .ttl { grid-column: 1 / -1; grid-row: 2; }
  .table.orders .row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .table.orders .row > :nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  .table.orders .row > :nth-child(4) { grid-column: 1 / -1; grid-row: 3; color: var(--text-2); font-size: 12.5px; }
  .table.orders .row > :nth-child(5) { grid-column: 3; grid-row: 1; }
  .welcome { padding: 20px 18px 16px; }
  .welcome h2 { font-size: 22px; }
  .welcome .lead { font-size: 14px; margin-bottom: 16px; }
  .ways, .ways.two { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .way { padding: 12px 14px; }
  #tour { width: calc(100vw - 32px); }
  /* the bar takes two lines on a phone rather than cut the example mark, the time and "order saved" (web-qa 65 #5) */
  .app { grid-template-rows: 44px minmax(0, 1fr) auto; }
  .status { flex-wrap: wrap; white-space: normal; gap: 2px 12px; padding: 4px 12px; min-height: 28px; }
  /* 16 px in the fields: a phone does not zoom the page on focus */
  .in, .refpick, .keybox { font-size: 16px; }
}
/* a small phone (360): the four steps still fit; a strip that cannot scroll far enough can only cut its first item (web-qa 67 M4) */
@media (max-width: 380px) {
  .pivot { gap: 6px; }
  .pivot button { gap: 5px; }
}
@media (max-width: 640px) {
  /* the totals of a variant two to a row: a phone sees the price, the wood and the tare at once */
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile .v { font-size: 17px; }
}
