/* Nordicco Airflow Designer – application chrome. Design tokens: AGENTS.md "Visual design language". */
:root {
  /* Nordicco design system tokens (claude.ai artifact "Nordicco": tokens.json) */
  --bg: #ededed; --panel: #ffffff; --ink: #3c3c3b; --ink-2: #515151; --muted: #737778; --faint: #9a9d9e;
  --line: #dcdcdc; --line-2: #ededed; --hover: #f4f4f4; --ctl-border: #737778;
  --teal: #53c0ab; --teal-hover: #64c6b2; --teal-d: #1b7262; --teal-l: #dcf2ed; --teal-ring: rgba(83, 192, 171, .35);
  --blue: #00a0dc; --blue-text: #006b93; --blue-l: #d9f0f9; --sage: #87bdb3; --green: #299e87;
  --orange: #ee7219; --orange-d: #9c4608; --danger: #9c4608; --danger-l: #fce6d6; --warn: #ee7219; --warn-l: #fce6d6;
  --r: 0px; --r-sm: 2px;
  --sh-1: none;
  --sh-2: none;
  --sh-3: 0 0 0 1px rgba(60, 60, 59, .12);
  --focus-ring: 0 0 0 2px #ffffff, 0 0 0 4px #3c3c3b;
  --ctl: 32px; --tb: 56px; --lw: 320px; --rw: 340px;
  --f-ui: "Nunito", Avenir, "Avenir Next", system-ui, sans-serif;
  --f-cond: "Bebas Neue", "Arial Narrow", sans-serif;
  color-scheme: light;
}
@media (pointer: coarse) { :root { --ctl: 40px; } }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 400 13px/1.45 var(--f-ui);
  -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }
b { font-weight: 600; }
kbd {
  display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: var(--r-sm); background: #fff; font: 600 11px/18px var(--f-ui); text-align: center; color: var(--ink-2);
}

/* ---------- icons ---------- */
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 14px; height: 14px; }
.ml-auto { margin-left: auto; }

/* ---------- typography ---------- */
.sec {
  margin: 0; font: 400 15.6px/1.2 var(--f-cond); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2);
  display: flex; align-items: center; gap: 6px;
}
.sec-lg { font-size: 17px; letter-spacing: .05em; color: var(--ink); }
.sec-lg { position: relative; padding-bottom: 7px; }
.sec-lg::after { content: ""; position: absolute; left: 0; bottom: 0; width: 64px; height: 3px; background: var(--teal); }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.muted { color: var(--muted); }
.count {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: var(--r-sm); background: var(--line-2); color: var(--muted);
  font: 600 11px/18px var(--f-ui); text-align: center; letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.count:empty { display: none; }
.count-warn { background: var(--warn-l); color: #9c4608; }

/* ============================================================== LAYOUT */
#appRoot { display: flex; flex-direction: column; height: 100%; height: 100dvh; }
.workspace { position: relative; flex: 1; display: flex; min-height: 0; }
.panel { background: var(--panel); display: flex; flex-direction: column; min-height: 0; z-index: 5; }
.panel-left { width: var(--lw); border-right: 1px solid var(--line); }
.panel-right { width: var(--rw); border-left: 1px solid var(--line); }
.panel-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px; scrollbar-width: thin; scrollbar-color: #cfcfcf transparent; -webkit-overflow-scrolling: touch; }
.center { position: relative; flex: 1; min-width: 0; background: linear-gradient(180deg, #e9e9e9 0%, #f7f7f7 100%); overflow: hidden; }
#viewport { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#viewport canvas { display: block; width: 100%; height: 100%; touch-action: none; }

/* ============================================================== TOP BAR */
.topbar {
  height: var(--tb); flex: none; display: flex; align-items: center; gap: 6px; padding: 0 12px 0 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); flex: none; margin-right: 8px; }
.brand-logo { height: 20px; width: auto; display: block; flex: none; }
.brand-symbol { height: 26px; width: auto; display: none; flex: none; }
.brand-div { width: 1px; height: 24px; background: var(--line); margin: 0 4px 0 2px; }
.app-name { font: 400 21.6px/1 var(--f-cond); letter-spacing: .04em; text-transform: uppercase; color: var(--teal-d); white-space: nowrap; }
.proj-name { flex: 0 1 260px; min-width: 110px; margin-left: 10px; }
.proj-name input {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent;
  font-weight: 500; font-size: 14px; text-overflow: ellipsis; transition: border-color .15s, background .15s;
}
.proj-name input:hover { background: var(--hover); }
.proj-name input:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px var(--teal-ring); }
.proj-name input::placeholder { color: var(--faint); }
.tb-spacer { flex: 1; }
.tb-group { display: flex; align-items: center; gap: 2px; }
.tb-sep { width: 1px; height: 24px; background: var(--line); margin: 0 6px; }
.tb-btn {
  height: 36px; min-width: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-2); font-weight: 500; white-space: nowrap;
  transition: background .12s, color .12s;
}
.tb-btn:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.tb-btn:disabled { color: #c2c2c2; }
.tb-btn[aria-pressed="true"] { background: var(--teal-l); color: var(--teal-d); }
.tb-btn.icon-only { padding: 0; }
.drawer-toggle { display: none; }
.present-only { display: none !important; }

/* language picker */
.lang-picker { position: relative; }
.lang-btn { gap: 6px; padding: 0 8px; }
.lang-code { font-weight: 600; font-size: 12px; letter-spacing: .03em; }
.flag { display: inline-flex; width: 20px; height: 14px; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); flex: none; }
.flag svg { width: 100%; height: 100%; display: block; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 170px; margin: 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-2); z-index: 40;
}
.menu button {
  width: 100%; display: flex; align-items: center; gap: 10px; height: var(--ctl); padding: 0 10px; border: 0; background: none;
  border-radius: var(--r-sm); text-align: left;
}
.menu button:hover { background: var(--hover); }
.menu button[aria-selected="true"] { color: var(--teal-d); font-weight: 600; }

/* ============================================================== BUTTONS */
.btn {
  height: var(--ctl); padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--ink); font-weight: 500;
  box-shadow: var(--sh-1); white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s, color .12s;
}
.btn:hover:not(:disabled) { border-color: #737778; background: #fafafa; }
.btn:active:not(:disabled) { box-shadow: none; transform: translateY(.5px); }
.btn[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-l); color: var(--teal-d); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
@media (pointer: coarse) { .btn-sm { height: 40px; } }
.btn-primary { background: var(--teal); border-color: var(--teal); color: var(--ink); font-weight: 700; }
.btn-primary:hover:not(:disabled) { background: var(--teal-hover); border-color: var(--teal-hover); }
.topbar .btn-primary { height: 36px; padding: 0 14px; }
.btn-teal { background: var(--teal); border-color: var(--teal); color: var(--ink); font-weight: 700; }
.btn-teal:hover:not(:disabled) { background: var(--teal-hover); border-color: var(--teal-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-l); border-color: #f5cfb3; }
.btn-ghost { border-color: transparent; box-shadow: none; background: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--hover); }
.icon-btn {
  width: var(--ctl); height: var(--ctl); display: inline-flex; align-items: center; justify-content: center; flex: none;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.grow { flex: 1; }

/* ============================================================== TABS + CARDS */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); flex: none; padding: 0 6px; }
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 2px 9px;
  border: 0; background: none; color: var(--muted); font-size: 11.5px; font-weight: 500; min-height: 56px;
}
.tab .ic { width: 20px; height: 20px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--teal-d); font-weight: 600; }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: -1px; height: 3px; border-radius: 0; background: var(--teal); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.card > .sec:first-child { margin-bottom: 12px; }
.card-list { padding-bottom: 6px; }
.card-details { padding: 0; }
.card-details > summary { list-style: none; display: flex; align-items: center; padding: 14px; cursor: pointer; }
.card-details > summary::-webkit-details-marker { display: none; }
.card-details > summary .chev { margin-left: auto; color: var(--muted); transition: transform .2s; display: inline-flex; }
.card-details[open] > summary .chev { transform: rotate(180deg); }
.card-details[open] { padding-bottom: 14px; }
.card-details > .fld { padding: 0 14px; }

/* fields */
.fld { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; min-height: var(--ctl); }
.card > .sec + .fld, .card > .sec + .seg { margin-top: 0; }
.fld > .lbl { color: var(--ink-2); font-size: 12.5px; flex: 1 1 auto; min-width: 0; }
.fld-col { flex-direction: column; align-items: stretch; gap: 5px; }
.fld-col > .lbl, .lbl-row .lbl { font-size: 12px; color: var(--muted); font-weight: 500; }
.lbl-row { display: flex; align-items: center; justify-content: space-between; }
.row2 { display: flex; gap: 8px; }
.row2 > select { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid2 .fld { margin-top: 10px; }

select, input[type=text], input[type=date], textarea {
  height: var(--ctl); padding: 0 10px; border: 1px solid var(--ctl-border); border-radius: var(--r-sm); background: #fff; min-width: 0;
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.4; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366757b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center / 14px;
}
.card > select { width: 100%; }
select:hover, input[type=text]:hover, textarea:hover { border-color: var(--ink); }
select:focus, input[type=text]:focus, input[type=date]:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

/* number stepper */
.num {
  display: inline-flex; align-items: stretch; height: var(--ctl); width: 148px; flex: none; border: 1px solid var(--ctl-border);
  border-radius: var(--r-sm); background: #fff; overflow: hidden; transition: border-color .12s, box-shadow .12s;
}
.fld-col .num { width: 100%; }
.num:hover { border-color: var(--ink); }
.num:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.num-b {
  width: 28px; flex: none; border: 0; background: #f7f7f7; color: var(--muted); display: flex; align-items: center; justify-content: center;
}
@media (pointer: coarse) { .num-b { width: 40px; } .num { width: 168px; } }
.num-b .ic { width: 14px; height: 14px; }
.num-b:first-child { border-right: 1px solid var(--line-2); }
.num-b:last-child { border-left: 1px solid var(--line-2); }
.num-b:hover:not(:disabled) { background: var(--teal-l); color: var(--teal-d); }
.num-b:disabled { color: #c8c8c8; }
.num-in {
  flex: 1; min-width: 0; width: 100%; border: 0; padding: 0 2px 0 8px; text-align: right; background: transparent;
  font-variant-numeric: tabular-nums; font-weight: 500;
}
.unit { display: flex; align-items: center; padding: 0 8px 0 4px; color: var(--muted); font-size: 11.5px; white-space: nowrap; }

/* segmented */
.seg {
  display: inline-flex; padding: 2px; gap: 2px; background: #ededed; border-radius: var(--r-sm); flex: none; max-width: 100%;
}
.seg > button {
  height: calc(var(--ctl) - 4px); padding: 0 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted);
  font-weight: 500; font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  font-variant-numeric: tabular-nums; transition: background .12s, color .12s, box-shadow .12s;
}
.seg > button .ic { width: 16px; height: 16px; }
.seg > button:hover { color: var(--ink); }
.seg > button[aria-pressed="true"] { background: #fff; color: var(--teal-d); box-shadow: var(--sh-1), 0 0 0 1px rgba(60, 60, 59, .14); font-weight: 600; }
.seg-full { display: flex; width: 100%; }
.seg-full > button { flex: 1; }
.seg-lg > button { height: 38px; padding: 0 14px; font-size: 13px; }
@media (pointer: coarse) { .seg-lg > button { height: 44px; } }
.seg-sm > button { height: 26px; font-size: 12px; padding: 0 8px; }
@media (pointer: coarse) { .seg-sm > button { height: 36px; } }
.fld-col .seg { display: flex; }
.fld-col .seg > button { flex: 1; }

/* direction segmented (two-line) */
.dir-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.dir-seg > button {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; min-height: 52px;
}
.dir-seg > button .ic { grid-row: 1 / span 2; width: 20px; height: 20px; color: var(--muted); }
.dir-seg > button b { font-weight: 600; font-size: 12.5px; }
.dir-seg > button small { color: var(--muted); font-size: 11px; line-height: 1.3; }
.dir-seg > button:hover { border-color: #737778; }
.dir-seg > button[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-l); box-shadow: inset 0 0 0 1px var(--teal); }
.dir-seg > button[aria-pressed="true"] .ic, .dir-seg > button[aria-pressed="true"] b { color: var(--teal-d); }

/* range */
.range-wrap { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.fld:not(.fld-col) > .range-wrap { max-width: 190px; }
.range-wrap output { min-width: 40px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 12.5px; }
input[type=range] {
  --fill: 50%; -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 24px; margin: 0; background: transparent; cursor: pointer;
}
@media (pointer: coarse) { input[type=range] { height: 40px; } }
input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--teal) var(--fill), #dcdcdc var(--fill));
}
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: #dcdcdc; }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--teal); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff;
  border: 2px solid var(--teal); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); transition: transform .1s;
}
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--teal); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.15); }
@media (pointer: coarse) { input[type=range]::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -11px; } }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--teal-ring); }
.range-lg input[type=range] { height: 40px; }
.range-lg input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; }
.range-lg input[type=range]::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -10px; }

/* switch */
.sw {
  position: relative; display: inline-block; width: 30px; height: 18px; border-radius: 9px; background: #cfcfcf; flex: none; transition: background .15s;
}
.sw::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s;
}
.switch-lbl { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); cursor: pointer; min-height: 32px; }
.switch-lbl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-lbl input:checked + .sw, [aria-checked="true"] > .sw { background: var(--teal); }
.switch-lbl input:checked + .sw::after, [aria-checked="true"] > .sw::after { transform: translateX(12px); }
.switch-lbl input:focus-visible + .sw { box-shadow: 0 0 0 3px var(--teal-ring); }

/* summary */
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.summary div { display: flex; flex-direction: column; }
.summary span { color: var(--muted); font-size: 11.5px; }
.summary b { font-size: 14px; font-variant-numeric: tabular-nums; }

/* lists */
.list { list-style: none; margin: 0 -8px; padding: 0; }
.list .li {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; min-height: 44px; border: 0; border-radius: var(--r-sm);
  background: transparent; text-align: left; transition: background .1s;
}
.list .li:hover { background: var(--hover); }
.list .li.is-sel { background: var(--teal-l); box-shadow: inset 2px 0 0 var(--teal); }
.list .li.is-off { opacity: .6; }
.li-ic { width: 30px; height: 30px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; background: #f0f0f0; color: var(--ink-2); flex: none; }
.li-ic.pro { background: #ededed; color: var(--ink); }
.li-ic.aqua { background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.is-sel .li-ic { color: var(--teal-d); }
.li-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.li-main b { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main small { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-meta { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 500; }
.list .empty, .warnings .empty { padding: 8px 8px 10px; color: var(--muted); font-size: 12px; }

/* palette */
.palette { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.pal {
  display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; text-align: left; font-size: 12.5px; line-height: 1.2; transition: border-color .12s, background .12s;
}
.pal .ic { width: 22px; height: 22px; color: var(--ink-2); }
.pal:hover { border-color: var(--teal); background: #fbfdfd; }
.pal[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-l); box-shadow: inset 0 0 0 1px var(--teal); color: var(--teal-d); }
.pal[aria-pressed="true"] .ic { color: var(--teal-d); }

/* ============================================================== VIEWPORT OVERLAYS */
.ov { position: absolute; z-index: 4; }
.ov-tl { top: 12px; left: 12px; display: flex; gap: 6px; align-items: center; }
.ov-tr { top: 12px; right: 12px; }
.ov-bl { left: 12px; bottom: 12px; }
.seg-glass, .glass-btn, .layers, .legend, .place-hint, .busy, .sel-pill {
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(220, 220, 220, .95); box-shadow: var(--sh-2);
}
.seg-glass { border-radius: var(--r); padding: 3px; }
.seg-glass > button { height: 30px; padding: 0 12px; font-weight: 600; }
@media (pointer: coarse) { .seg-glass > button { height: 38px; padding: 0 14px; } }
.seg-glass > button[aria-pressed="true"] { background: var(--teal-d); color: #fff; box-shadow: none; }
.glass-btn {
  width: 38px; height: 38px; border-radius: var(--r); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2);
}
@media (pointer: coarse) { .glass-btn { width: 46px; height: 46px; } }
.glass-btn:hover { color: var(--teal-d); background: #fff; }

.layers { width: 226px; border-radius: var(--r); overflow: hidden; }
.layers-head {
  width: 100%; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 12px; border: 0; background: transparent; color: var(--ink-2);
}
.layers-head .chev { margin-left: auto; display: inline-flex; transition: transform .2s; color: var(--muted); }
.layers.collapsed { width: auto; }
.layers.collapsed .layers-head .chev { transform: rotate(-90deg); }
.layers.collapsed .layers-body { display: none; }
.layers-body { padding: 0 8px 8px; border-top: 1px solid var(--line-2); }
.layers-body > .seg { margin: 8px 0 4px; }
.tgl-list { display: flex; flex-direction: column; }
.tgl {
  display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 4px 0 6px; border: 0; border-radius: var(--r-sm); background: none;
  color: var(--ink-2); font-size: 12.5px; text-align: left;
}
@media (pointer: coarse) { .tgl { height: 42px; } }
.tgl:hover { background: var(--hover); }
.tgl > span { flex: 1; }
.tgl .ic { width: 17px; height: 17px; color: var(--muted); }
.tgl[aria-checked="true"] .ic { color: var(--teal-d); }
.section-ctl { display: flex; align-items: center; gap: 8px; padding: 2px 4px 2px 32px; }

.legend { border-radius: var(--r); padding: 8px 12px 6px; width: 260px; }
.legend-title { display: flex; justify-content: space-between; gap: 8px; font: 400 14.4px/1.2 var(--f-cond); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.legend-at { color: var(--muted); font-family: var(--f-ui); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 11px; }
.legend-bar { height: 10px; border-radius: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.legend-ticks { position: relative; height: 16px; margin: 0 2px; }
.legend-ticks span { position: absolute; top: 2px; transform: translateX(-50%); font-size: 10.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.legend-ticks span:first-child { transform: none; left: 0 !important; }
.legend-ticks span:last-child { transform: translateX(-100%); }

.place-hint {
  position: absolute; z-index: 6; bottom: 84px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 5px 6px 5px 14px; border-radius: var(--r-sm); border-color: var(--teal); white-space: nowrap; max-width: calc(100% - 24px);
  animation: drop .2s ease-out;
}
.place-hint > .ic { color: var(--teal-d); }
.place-hint #placeText { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.place-hint .btn { border-radius: var(--r-sm); }
@keyframes drop { from { opacity: 0; transform: translate(-50%, 6px); } }

.busy {
  position: absolute; z-index: 5; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 10px; border-radius: var(--r-sm); font-size: 12px; font-weight: 500; color: var(--ink-2);
}
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--teal-l); border-top-color: var(--teal); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sel-pill {
  position: absolute; z-index: 5; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 6px 0 14px;
  border-radius: var(--r-sm); font-weight: 500;
}
.sel-pill .ic { color: var(--teal-d); }
.sel-pill b { margin-left: 6px; padding: 0 14px; height: 34px; display: inline-flex; align-items: center; border-radius: var(--r-sm); background: var(--teal-d); color: #fff; font-weight: 600; }

/* ============================================================== RESULTS PANEL */
.results-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--r-sm); background: var(--line-2);
  color: var(--ink-2); font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.chip:empty { display: none; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.kpi { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px 11px; background: #fff; min-width: 0; }
.kpi-wide { grid-column: 1 / -1; }
.kpi-lbl { display: flex; align-items: center; gap: 6px; font: 400 14.4px/1.2 var(--f-cond); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.kpi-val { margin-top: 4px; font: 600 25px/1.1 var(--f-ui); letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.kpi-val small { margin-left: 4px; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi-sub { margin-top: 3px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.4; }
.kpi-accent { background: var(--teal-l); border-color: var(--teal-l); }
.kpi-accent .kpi-val { color: var(--teal-d); }
.kpi.is-empty .kpi-val { color: #c2c2c2; }
.badge { display: inline-flex; align-items: center; height: 17px; padding: 0 6px; border-radius: var(--r-sm); font: 600 10px/1 var(--f-ui); letter-spacing: .02em; text-transform: none; }
.badge-est { background: var(--warn-l); color: #9c4608; border: 1px solid #f5cfb3; cursor: help; }
.kpi-lbl .badge { margin-left: auto; }

.histogram svg { width: 100%; height: auto; display: block; overflow: visible; }
.h-grid { stroke: var(--line-2); stroke-width: 1; }
.h-base { stroke: #b5b8b9; stroke-width: 1; }
.h-ax { font: 500 9.5px var(--f-ui); fill: var(--muted); font-variant-numeric: tabular-nums; }
.h-cap { text-align: center; font-size: 11px; color: var(--muted); margin-top: 0; }
.histogram rect { transition: opacity .1s; }
.histogram rect:hover { opacity: .75; }

.warnings { list-style: none; margin: 0 -6px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wn {
  width: 100%; display: flex; align-items: flex-start; gap: 9px; padding: 8px 8px; border: 0; border-radius: var(--r-sm); text-align: left;
  font-size: 12.5px; line-height: 1.4; background: transparent; color: var(--ink);
}
.wn .ic { margin-top: 1px; }
.wn > span { flex: 1; }
.wn-warn { background: var(--warn-l); }
.wn-warn > .ic:first-child { color: #ee7219; }
.wn-info > .ic:first-child { color: #00a0dc; }
.wn-info { background: #d9f0f9; }
button.wn:hover { filter: brightness(.97); }
.wn .go { color: var(--muted); align-self: center; }
.ok-line { display: flex; align-items: center; gap: 8px; padding: 6px 8px; color: var(--teal-d); font-weight: 500; }
.disclaimer { margin: 4px 4px 12px; font-size: 11px; color: var(--faint); line-height: 1.45; }

/* inspector */
.inspector {
  border: 1px solid var(--teal); border-radius: var(--r); margin-bottom: 14px; background: #fff; box-shadow: 0 0 0 3px var(--teal-l);
  animation: fadeIn .18s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } }
.insp-head { display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 12px; border-bottom: 1px solid var(--line-2); }
.insp-ic { width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--teal-l); color: var(--teal-d); display: flex; align-items: center; justify-content: center; flex: none; }
.insp-ic .ic { width: 20px; height: 20px; }
.insp-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.insp-title small { font-size: 11.5px; color: var(--teal-d); }
.insp-title b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insp-body { padding: 2px 12px 12px; }
.insp-foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line-2); background: #fafafa; border-radius: 0 0 var(--r) var(--r); }
.insp-foot .btn { flex: 1; }
.insp-foot .icon-only-btn { flex: 0 0 auto; width: var(--ctl); padding: 0; }
.inspector .fld:not(.fld-col) .seg { margin-left: auto; }
.clear-row { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; font-size: 11.5px; }
.clear-row > span { display: flex; align-items: center; gap: 5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.clear-row small { color: var(--muted); }
.clear-row .ok .ic { color: var(--teal); }
.clear-row .bad { color: var(--danger); }
.readouts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px; }
.ro { padding: 7px 9px; border-radius: var(--r-sm); background: #f5f5f5; display: flex; flex-direction: column; }
.ro b { font-size: 15px; font-variant-numeric: tabular-nums; }
.ro b small { margin-left: 3px; font-size: 11px; color: var(--muted); font-weight: 500; }
.ro span { font-size: 11px; color: var(--muted); }
.ro-note { grid-column: 1 / -1; margin: 2px 0 0; font-size: 10.5px; color: var(--muted); }

/* ============================================================== PRESENTATION */
.present-bar {
  position: fixed; z-index: 15; left: 50%; bottom: 18px; transform: translate(-50%, 140%); opacity: 0; pointer-events: none;
  display: flex; align-items: stretch; gap: 20px; padding: 14px 18px; max-width: calc(100vw - 24px);
  background: rgba(255, 255, 255, .95); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 0; box-shadow: var(--sh-3); transition: transform .3s ease, opacity .3s;
}
.presenting .present-bar { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.pb-kpis { display: flex; gap: 6px; }
.pk { display: flex; flex-direction: column; justify-content: center; padding: 0 14px; border-right: 1px solid var(--line-2); min-width: 112px; }
.pk:last-child { border-right: 0; }
.pk span { font: 400 15px/1.2 var(--f-cond); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.pk b { font: 600 30px/1.15 var(--f-ui); letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pk b small { margin-left: 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
.pk:nth-child(3) b { color: var(--teal-d); }
.pb-ctl { display: flex; align-items: center; gap: 14px; padding-left: 18px; border-left: 1px solid var(--line); }
.pb-speed { display: flex; flex-direction: column; gap: 0; min-width: 200px; }
.pb-speed output { font-size: 15px; min-width: 48px; }
.presenting .panel { display: none; }
.presenting .edit-chrome { display: none !important; }
.presenting .drawer-toggle { display: none !important; }
.presenting .present-only { display: inline-flex !important; }
.presenting #btnPresent { display: none; }
.presenting .proj-name input { pointer-events: none; font-size: 15px; font-weight: 600; }
.presenting .layers, .presenting .place-hint, .presenting .sel-pill { display: none !important; }
.presenting .legend { bottom: auto; top: 64px; left: 12px; }
.presenting .ov-bl { bottom: auto; top: 62px; }

/* ============================================================== MODALS + TOASTS */
.modal-wrap {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(60, 60, 59, .38); opacity: 0; transition: opacity .18s;
}
.modal-wrap.in { opacity: 1; }
.modal {
  width: 100%; max-width: 560px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: #fff;
  border-radius: 0; box-shadow: var(--sh-3); transform: translateY(8px) scale(.985); transition: transform .2s ease;
}
.modal-wrap.in .modal { transform: none; }
.modal-sm { max-width: 420px; }
.modal-md { max-width: 560px; }
.modal-wide { max-width: 920px; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 14px 14px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head > div { flex: 1; }
.modal-sub { margin: 4px 0 0; color: var(--muted); }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-text { margin: 0; font-size: 14px; color: var(--ink-2); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 16px; }
.modal-foot .btn { min-width: 96px; }

.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.preset {
  display: flex; align-items: center; gap: 12px; padding: 14px; min-height: 76px; border: 1px solid var(--line); border-radius: var(--r);
  background: #fff; text-align: left; transition: border-color .12s, box-shadow .12s, transform .12s;
}
.preset:hover { border-color: var(--teal); background: #fafafa; }
.preset-ic { width: 48px; height: 48px; border-radius: var(--r-sm); background: var(--teal-l); color: var(--teal-d); display: flex; align-items: center; justify-content: center; flex: none; }
.preset-ic .ic { width: 28px; height: 28px; stroke-width: 1.5; }
.preset-txt { display: flex; flex-direction: column; min-width: 0; }
.preset-txt b { font-size: 14px; }
.preset-txt small { color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 2px; }
.preset-empty { border-style: dashed; }
.preset-empty .preset-ic { background: #f1f1f1; color: var(--muted); }

.share-row { display: flex; gap: 8px; }
.share-row input { flex: 1; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; color: var(--ink-2); }
.keys { width: 100%; border-collapse: collapse; }
.keys td { padding: 7px 4px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.keys tr:last-child td { border-bottom: 0; }
.keys td:first-child { white-space: nowrap; width: 46%; color: var(--muted); }

.toasts {
  position: fixed; z-index: 120; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center;
  gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  display: flex; align-items: center; gap: 9px; padding: 10px 16px 10px 12px; border-radius: var(--r); background: #3c3c3b; color: #fff;
  box-shadow: var(--sh-3); font-weight: 500; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; pointer-events: auto;
}
.toast.in { opacity: 1; transform: none; }
.toast-success .ic { color: #53c0ab; }
.toast-warn .ic { color: #ee7219; }
.toast-error { background: var(--danger); }
.toast-info .ic { color: #00a0dc; }
.presenting ~ .toasts, .presenting .toasts { bottom: 130px; }

.scrim { display: none; }

/* ============================================================== TABLET / TOUCH – drawers */
@media (max-width: 1199px), (pointer: coarse) and (max-width: 1400px) {
  .drawer-toggle { display: inline-flex; }
  .panel { position: absolute; top: 0; bottom: 0; z-index: 12; box-shadow: var(--sh-3); transition: transform .26s cubic-bezier(.2, .8, .2, 1), visibility .26s; visibility: hidden; }
  .panel-left { left: 0; width: min(var(--lw), 88vw); transform: translateX(-102%); border-right: 0; }
  .panel-right { right: 0; width: min(var(--rw), 90vw); transform: translateX(102%); border-left: 0; }
  .drawer-left .panel-left, .drawer-right .panel-right { transform: none; visibility: visible; }
  .scrim { display: block; position: absolute; inset: var(--tb) 0 0 0; z-index: 11; background: rgba(60, 60, 59, .18); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .drawer-left .scrim, .drawer-right .scrim { opacity: 1; pointer-events: auto; }
  .tb-btn > span[data-i18n] { display: none; }
  .tb-btn { min-width: 40px; height: 40px; padding: 0 8px; }
  .lang-btn > .lang-code { display: inline; }
  .topbar { padding: 0 8px; gap: 4px; }
  .brand { margin-right: 0; margin-left: 4px; }
  .proj-name { margin-left: 4px; }
  .tb-sep { margin: 0 2px; }
}
@media (max-width: 1100px) {
  .brand .app-name, .brand .brand-div { display: none; }
}
@media (max-width: 900px) {
  .brand .brand-logo { display: none; }
  .brand .brand-symbol { display: block; }
  .hide-narrow { display: none !important; }
  .topbar .btn-primary > span { display: none; }
  .topbar .btn-primary { width: 40px; padding: 0; }
  .legend { width: 220px; }
  .layers { width: 210px; }
  .present-bar { flex-direction: column; gap: 10px; bottom: 12px; }
  .pb-ctl { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 10px; flex-wrap: wrap; justify-content: center; }
  .pk { min-width: 0; padding: 0 10px; }
  .pk b { font-size: 24px; }
  .presenting .toasts { bottom: 220px; }
}
@media (max-width: 640px) {
  .ov-tl .glass-btn.edit-chrome { display: none; }
  .seg-glass > button { padding: 0 9px; }
  .pb-kpis { flex-wrap: wrap; justify-content: center; }
}
.kpi-val-sm { font-size: 20px; }
.btn-row { flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 auto; }
.insp-title small { display: flex; align-items: center; gap: 6px; }
.insp-title small .badge { text-transform: none; letter-spacing: .02em; }
.palette { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pal span { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.tgl > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layers { width: 236px; }
.insp-foot { flex-wrap: wrap; }
.insp-foot .btn { min-width: 0; padding: 0 10px; }
.num { width: 156px; }
@media (pointer: coarse) { .num { width: 180px; } }
.unit { font-size: 11px; padding: 0 7px 0 3px; }
@media (max-width: 1280px) {
  .present-bar { flex-direction: column; gap: 10px; bottom: 12px; padding: 12px 16px; }
  .pb-kpis { justify-content: center; }
  .pb-ctl { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 10px; flex-wrap: wrap; justify-content: center; }
  .presenting .toasts { bottom: 220px; }
}
@media (max-width: 1280px) { .present-bar { width: min(860px, calc(100vw - 24px)); } .pb-ctl { flex-wrap: nowrap; } }
@media (max-width: 820px) { .pb-ctl { flex-wrap: wrap; } .pb-speed { min-width: 0; flex: 1 1 100%; } }
@media (max-width: 900px) { .place-hint #placeText { white-space: normal; } }

/* ============================================================== POLYGON GRAPHICS (Nordicco design system)
   Rule: only white text, and only over the dark navy/blue (left) end of the polygon. */
.brand-logo-w { height: 20px; width: auto; display: none; flex: none; }
.brand-symbol-w { height: 26px; width: auto; display: none; flex: none; }
.modal-brand .modal-head {
  padding: 22px 14px 20px 26px; border-bottom: 0; color: #fff;
  background: #0a3d7a url("assets/graphics/polygon-band.png") left center / cover no-repeat;
}
.modal-brand .modal-head > div { max-width: 62%; }
.modal-brand .modal-head h2 { color: #fff; font-size: 26px; padding-bottom: 0; }
.modal-brand .modal-head h2::after { display: none; }
.modal-brand .modal-sub { color: rgba(255, 255, 255, .88); }
.modal-brand .modal-head .icon-btn { color: #fff; }
.modal-brand .modal-head .icon-btn:hover { background: rgba(255, 255, 255, .16); color: #fff; }

/* presentation mode: the top bar becomes the SlideHeader polygon band with the white logo */
.presenting .topbar {
  border-bottom: 0; color: #fff;
  background: #0a3d7a url("assets/graphics/polygon-band.png") left center / max(200%, 1400px) auto no-repeat; /* dark half only */
}
.presenting .brand .brand-logo, .presenting .brand .brand-symbol { display: none; }
.presenting .brand .brand-logo-w { display: block; }
.presenting .brand-div { background: rgba(255, 255, 255, .5); }
.presenting .app-name { color: #fff; }
.presenting .topbar .proj-name input { color: #fff; background: transparent; border-color: transparent; }
.presenting .topbar .btn, .presenting .topbar .icon-btn, .presenting .topbar .lang-btn { color: #fff; background: transparent; border-color: rgba(255, 255, 255, .45); }
.presenting .topbar .btn:hover, .presenting .topbar .icon-btn:hover { background: rgba(255, 255, 255, .16); }
@media (max-width: 900px) {
  .presenting .brand .brand-logo-w { display: none; }
  .presenting .brand .brand-symbol-w { display: block; }
}
@media (max-width: 600px) {
  .presenting #btnExitPresent > span { display: none; }
  .presenting #btnExitPresent { width: 40px; min-width: 0; padding: 0; justify-content: center; }
}
