/* tiksi - design console.
   Dark instrument UI: deep layered surfaces, hairline borders, one amber accent.
   Tokens first, then chrome (topbar, rail), editor layout, components, print. */

:root {
  /* surfaces: deep, slightly warm greys that step up in lightness per layer */
  --bg: #090c0f;
  --panel: #0f1418;
  --panel-2: #151b21;
  --panel-3: #1b232b;
  /* hairlines are low-alpha white so they read the same on every surface */
  --line: rgba(255, 255, 255, 0.065);
  --line-2: rgba(255, 255, 255, 0.12);
  --ink: #e9eef3;
  --dim: #8f9ca8;
  --faint: #5d6a76;
  --accent: #e8973a;
  --accent-soft: rgba(232, 151, 58, 0.14);
  --accent-ink: #0c1013;
  --cyan: #5fb3c9;
  --green: #57b981;
  --red: #e05252;
  --sel: #4f8fd0;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --rail-w: 152px;
  --top-h: 48px;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.45), 0 3px 10px rgba(0, 0, 0, 0.28);
  --shadow-2: 0 12px 32px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.35);
  --glass-bg: rgba(13, 18, 23, 0.78);
  --glass-line: rgba(255, 255, 255, 0.1);
  --focus: 0 0 0 3px rgba(232, 151, 58, 0.28);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 150ms;
  /* a 1px top highlight that makes raised surfaces read as lit from above */
  --lift: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
/* keyboard focus ring: an outline, so no component box-shadow can override it and no
   overflow clip can hide it; text fields override it below with their own border + glow */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(232, 151, 58, 0.35); color: var(--ink); }
svg.ic { flex: none; vertical-align: -3px; }

#app {
  display: grid;
  grid-template: var(--top-h) 1fr / var(--rail-w) 1fr;
  grid-template-areas: "top top" "rail view";
  height: 100vh;
  background: var(--bg);
}

/* ---------- topbar ---------- */
#topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-bottom: 1px solid var(--line);
  box-shadow: var(--lift), 0 1px 0 rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 9px; margin-right: 8px; user-select: none; }
.brand-logo {
  color: var(--accent); width: 26px; height: 26px; padding: 4px; border-radius: 7px;
  background: linear-gradient(180deg, var(--panel-3), var(--panel));
  border: 1px solid rgba(232, 151, 58, 0.35);
  box-shadow: var(--lift), 0 0 12px rgba(232, 151, 58, 0.18), 0 1px 2px rgba(0, 0, 0, 0.5);
  filter: drop-shadow(0 0 3px rgba(232, 151, 58, 0.4));
}
.brand-mark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.24em;
  color: var(--ink);
  line-height: 1;
}
.brand-sub {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--faint);
  text-transform: uppercase;
  padding-left: 9px;
  border-left: 1px solid var(--line-2);
  line-height: 1;
  white-space: nowrap;
}
/* the tag is the first thing the topbar squeezes; below this width it goes rather than wraps */
@media (max-width: 1140px) { .brand-sub { display: none; } }
.topbar-group { display: flex; align-items: center; gap: 8px; }
.topbar-spacer { flex: 1; }
.tb-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--faint);
}
.tb-select, select {
  background: var(--panel-3);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 5px 26px 5px 8px;
  max-width: 240px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f9ca8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 12px;
  box-shadow: var(--lift);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
select[multiple] { background-image: none; padding-right: 8px; }
.tb-select:hover, select:hover { border-color: rgba(255, 255, 255, 0.2); }
.tb-select:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
select option { background: var(--panel-2); color: var(--ink); }

.tb-btn, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(180deg, var(--panel-3), var(--panel-2));
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 6px 11px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--lift), 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease),
              background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.tb-btn .ic, .btn .ic { opacity: 0.85; }
.tb-btn:hover, .btn:hover { border-color: rgba(232, 151, 58, 0.6); color: var(--accent); }
.tb-btn:hover .ic, .btn:hover .ic { opacity: 1; }
.tb-btn:active, .btn:active { transform: translateY(1px); box-shadow: none; }
.tb-btn:disabled, .btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.primary {
  background: linear-gradient(180deg, #f2a64b, #de8c2f);
  border-color: rgba(255, 190, 110, 0.55);
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 14px rgba(232, 151, 58, 0.18);
}
.btn.primary:hover { filter: brightness(1.07); color: var(--accent-ink); }
.btn.primary .ic { opacity: 1; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--dim); }
.btn.ghost:hover { color: var(--ink); border-color: var(--line-2); background: rgba(255, 255, 255, 0.03); }
.btn.danger:hover { border-color: rgba(224, 82, 82, 0.7); color: var(--red); }
.btn.on { border-color: rgba(232, 151, 58, 0.7); color: var(--accent); background: var(--accent-soft); }
.btn.small { padding: 3px 8px; font-size: 10px; gap: 5px; }
.btn.large { padding: 9px 16px; font-size: 12px; }
.icon-btn, .tb-btn.icon-btn, .btn.icon-btn { padding: 5px 7px; min-width: 30px; gap: 0; }
.icon-btn .ic { opacity: 0.9; }

.seg {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--panel-2);
  box-shadow: var(--lift);
}
.seg.fill { display: flex; }
.seg.fill .seg-btn { flex: 1; }
.seg-btn {
  background: transparent; color: var(--dim); border: 0; cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; padding: 5px 10px; letter-spacing: 0.08em;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
/* the end buttons carry the group's rounding themselves (no overflow clip, so focus rings show) */
.seg-btn:first-child { border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px); }
.seg-btn:last-child { border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn:hover { color: var(--ink); }
.seg-btn.active {
  background: linear-gradient(180deg, #f2a64b, #de8c2f);
  color: var(--accent-ink); font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.save-status {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--faint);
  min-width: 96px; justify-content: flex-end; white-space: nowrap;
}
.save-status::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 6px rgba(87, 185, 129, 0.6);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.save-status.busy { color: var(--accent); }
.save-status.busy::before {
  background: var(--accent); box-shadow: 0 0 8px rgba(232, 151, 58, 0.7);
  animation: pulse 900ms ease-in-out infinite;
}

/* ---------- rail ---------- */
#rail {
  grid-area: rail;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  gap: 2px;
}
#rail a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--dim);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  position: relative;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
#rail a .ic { opacity: 0.7; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
#rail a::before {
  content: ''; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
  opacity: 0; transform: scaleY(0.4); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
#rail a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.035); }
#rail a:hover .ic { opacity: 1; }
#rail a.active {
  color: var(--accent);
  background: linear-gradient(90deg, rgba(232, 151, 58, 0.16), rgba(232, 151, 58, 0.04));
  box-shadow: inset 0 0 0 1px rgba(232, 151, 58, 0.12), 0 0 18px rgba(232, 151, 58, 0.08);
}
#rail a.active .ic { opacity: 1; filter: drop-shadow(0 0 4px rgba(232, 151, 58, 0.5)); }
#rail a.active::before { opacity: 1; transform: scaleY(1); }
.rail-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.rail-foot a { font-size: 9.5px; color: var(--faint); }

/* ---------- view chrome ---------- */
#view { grid-area: view; overflow: hidden; position: relative; background: var(--bg); }
#view > * { animation: view-in 220ms var(--ease) both; }
.view-scroll { overflow: auto; height: 100%; padding: 20px 24px 64px; }
.view-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.view-title { font-family: var(--mono); font-size: 13px; letter-spacing: 0.18em; color: var(--ink); font-weight: 700; }
.view-sub { font-family: var(--mono); font-size: 10.5px; color: var(--faint); letter-spacing: 0.04em; }
.view-sub.busy { color: var(--accent); }
.kicker {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.kicker::after { content: ''; flex: 1; height: 1px; background: var(--line); max-width: 220px; }
h3.kicker { font-weight: 700; }

/* ---------- editor layouts (plan + model) ---------- */
.editor-layout { display: grid; grid-template-columns: 156px 1fr 272px; height: 100%; }
.tool-col {
  background: var(--panel); border-right: 1px solid var(--line);
  padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden;
}
.tool-col .tool-sep { border-top: 1px solid var(--line); margin: 8px 2px; }
.tool-col .tool-head {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; color: var(--faint);
  padding: 6px 8px 4px; text-transform: uppercase;
}
.tool-btn {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: transparent; color: var(--dim); border: 1px solid transparent; border-radius: var(--radius);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em;
  padding: 6px 8px; cursor: pointer; text-align: left; width: 100%; white-space: nowrap;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tool-btn .ic { opacity: 0.7; transition: opacity var(--dur) var(--ease); }
.tool-btn .tb-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.tool-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); border-color: var(--line); }
.tool-btn:hover .ic { opacity: 1; }
.tool-btn:active { background: rgba(255, 255, 255, 0.07); }
.tool-btn.active {
  background: linear-gradient(180deg, #f2a64b, #de8c2f);
  color: var(--accent-ink); font-weight: 700; border-color: rgba(255, 190, 110, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 10px rgba(232, 151, 58, 0.25);
}
.tool-btn.active .ic { opacity: 1; }
.tool-btn .key {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.02em; color: var(--faint);
  border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 4px; min-width: 18px; text-align: center;
  background: rgba(255, 255, 255, 0.03); line-height: 1.3; font-weight: 500;
}
.tool-btn.active .key { color: var(--accent-ink); border-color: rgba(0, 0, 0, 0.28); background: rgba(0, 0, 0, 0.12); opacity: 0.85; }
.tool-check {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--radius);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--dim); cursor: pointer; user-select: none;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.tool-check:hover { color: var(--ink); background: rgba(255, 255, 255, 0.03); }
.tool-check .ic { opacity: 0.7; }
.tool-check span { flex: 1; }
.tool-check input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 26px; height: 14px; border-radius: 999px; flex: none;
  background: var(--panel-3); border: 1px solid var(--line-2); position: relative; cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tool-check input[type="checkbox"]::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--dim); transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.tool-check input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.tool-check input[type="checkbox"]:checked::after { transform: translateX(12px); background: var(--accent-ink); }
.tool-check input[type="checkbox"]:focus-visible { outline-offset: 1px; }

.canvas-wrap { position: relative; overflow: hidden; background: var(--bg); }
.canvas-wrap canvas { display: block; cursor: crosshair; }
.canvas-hint {
  position: absolute; left: 12px; bottom: 10px; pointer-events: none;
  font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: 0.04em; line-height: 1.5;
  background: var(--glass-bg); border: 1px solid var(--glass-line); backdrop-filter: blur(8px);
  padding: 5px 9px; border-radius: var(--radius); max-width: 70%; box-shadow: var(--shadow-1);
}
.canvas-hint:empty { display: none; }
.canvas-badge {
  position: absolute; right: 12px; top: 10px; pointer-events: none;
  font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: 0.04em;
  background: var(--glass-bg); border: 1px solid var(--glass-line); backdrop-filter: blur(8px);
  padding: 4px 9px; border-radius: var(--radius); box-shadow: var(--shadow-1); white-space: nowrap;
}
.canvas-badge:empty { display: none; }
.canvas-badge b { color: var(--ink); font-weight: 600; }
.canvas-badge .ac { color: var(--accent); }
/* the plan editor draws rulers along the top and left edges; move the overlays clear of them */
.plan-canvas .canvas-badge { top: 30px; }
.plan-canvas .canvas-hint { left: 30px; }

.inspector {
  background: var(--panel); border-left: 1px solid var(--line);
  padding: 14px 14px 24px; overflow-y: auto; font-size: 12.5px;
}
.inspector h3 {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: var(--accent);
  margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; text-transform: uppercase;
}
.inspector h3 .ic { opacity: 0.9; }
.inspector h3:not(:first-child) { margin-top: 18px; }
.inspector .empty { color: var(--faint); font-family: var(--mono); font-size: 10.5px; line-height: 1.7; }
.inspector .tool-sep { border-top: 1px solid var(--line); margin: 10px 0; }
.field { margin-bottom: 10px; }
.field label {
  display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em;
  color: var(--faint); margin-bottom: 4px; text-transform: uppercase;
}
.field input[type="text"], .field input[type="number"], .field input[type="date"], .field input[type="url"],
.field input[type="search"], .field textarea, .field select {
  width: 100%;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  font-family: var(--mono); font-size: 12px; padding: 6px 8px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
  color-scheme: dark;
}
.field input:hover, .field textarea:hover, .field select:hover { border-color: rgba(255, 255, 255, 0.2); }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); background: var(--panel-3);
  box-shadow: var(--focus), inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.field input::placeholder, .field textarea::placeholder, .search-input::placeholder { color: var(--faint); }
.field textarea { resize: vertical; min-height: 58px; font-family: var(--sans); line-height: 1.45; }
.field-row { display: flex; gap: 8px; }
.field-row .field { flex: 1; min-width: 0; }
.stat-line {
  display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 11px;
  color: var(--dim); padding: 4px 0; border-bottom: 1px dashed var(--line);
}
.stat-line:last-of-type { border-bottom: 0; }
.stat-line b { color: var(--ink); font-weight: 600; text-align: right; }
.inspector .btn { width: 100%; margin-top: 8px; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.swatch {
  width: 24px; height: 24px; border-radius: var(--radius); border: 1px solid var(--line-2); cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.swatch:hover { transform: translateY(-1px); }
.swatch.active { outline: 2px solid var(--accent); outline-offset: 1px; }

/* range inputs: thin track, amber thumb */
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px; border-radius: 2px; background: var(--line-2);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; margin-top: -5.5px;
  background: var(--accent); border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px rgba(232, 151, 58, 0.6), 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: transform var(--dur) var(--ease);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: var(--line-2); }
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px rgba(232, 151, 58, 0.6);
}
input[type="range"]:focus-visible { outline: none; }   /* the thumb glow is the ring */
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus); }

/* ---------- tables ---------- */
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
table.grid th {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--faint); text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line-2);
  white-space: nowrap; position: sticky; top: 0; background: var(--bg); z-index: 1;
}
table.grid td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.012); }
table.grid tbody tr:hover td { background: rgba(255, 255, 255, 0.035); }
table.grid td.num, table.grid th.num { text-align: right; font-family: var(--mono); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.grid input[type="text"], table.grid input[type="number"], table.grid select {
  background: transparent; border: 1px solid transparent; color: var(--ink);
  font-size: 12.5px; padding: 3px 5px; border-radius: 4px; width: 100%; box-shadow: none; background-image: none;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
table.grid input.num { font-family: var(--mono); text-align: right; font-size: 11.5px; font-variant-numeric: tabular-nums; }
table.grid input[data-money] { width: 82px; min-width: 82px; }
table.grid input:hover, table.grid select:hover { border-color: var(--line-2); }
table.grid input:focus, table.grid select:focus { outline: none; border-color: var(--accent); background: var(--panel-2); box-shadow: var(--focus); }
table.grid select { padding-right: 5px; }
/* number spinners steal half of a narrow cell; the value matters more than the arrows */
table.grid input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
table.grid input[type="number"]::-webkit-outer-spin-button, table.grid input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
table.grid select[multiple] option { padding: 2px 4px; border-radius: 3px; }
table.grid select[multiple] option:checked { background: var(--accent-soft); color: var(--accent); }
.card table.grid th { background: var(--panel-2); }
/* dependency picker: the collapsed state is a one-line summary of the chosen predecessors
   (a clipped listbox would show whatever option Chromium scrolled to); the listbox itself
   takes its place only while open, then the summary returns */
.dep-wrap { border: 1px solid transparent; border-radius: 4px; transition: border-color var(--dur) var(--ease); }
.dep-wrap:hover { border-color: var(--line-2); }
.dep-summary {
  display: block; width: 100%; text-align: left; background: transparent; border: 0; color: var(--ink);
  font-family: var(--mono); font-size: 11px; padding: 3px 5px; line-height: 1.45; border-radius: 3px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dep-summary.none { color: var(--faint); }
.dep-summary:disabled { cursor: default; }
.dep-wrap select, table.grid .dep-wrap select[multiple] {
  border: 0; box-shadow: none; background: transparent; width: 100%;
  padding: 2px 5px; line-height: 1.45; font-family: var(--mono); font-size: 11px;
}
.dep-wrap select { display: none; }
.dep-wrap.open { border-color: var(--accent); background: var(--panel-2); box-shadow: var(--focus); }
.dep-wrap.open .dep-summary { display: none; }
.dep-wrap.open select { display: block; }
table.grid .row-del {
  opacity: 0; cursor: pointer; color: var(--faint); font-family: var(--mono); font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 4px;
  transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease);
}
table.grid tr:hover .row-del { opacity: 1; }
table.grid .row-del:hover { color: var(--red); background: rgba(224, 82, 82, 0.12); }
tr.total-row td { border-top: 1px solid var(--line-2); border-bottom: none; font-weight: 600; font-family: var(--mono); }
table.grid tbody tr.total-row:hover td, table.grid tbody tr.total-row td { background: transparent; }
table.grid .bar { height: 7px; border-radius: 4px; background: var(--line-2); min-width: 2px; }
table.grid .bar.on { background: linear-gradient(90deg, #de8c2f, #f2a64b); box-shadow: 0 0 8px rgba(232, 151, 58, 0.25); }

/* ---------- cards / chips ---------- */
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 13px 15px; box-shadow: var(--lift), var(--shadow-1);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card.clickable { cursor: pointer; }
.card.clickable:hover { border-color: var(--line-2); transform: translateY(-1px); box-shadow: var(--lift), var(--shadow-2); }
.card.active { border-color: rgba(232, 151, 58, 0.7); box-shadow: var(--lift), 0 0 0 1px rgba(232, 151, 58, 0.25), 0 0 20px rgba(232, 151, 58, 0.1), var(--shadow-1); }
.chip {
  display: inline-block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 999px; line-height: 1.5;
  border: 1px solid var(--line-2); color: var(--dim); white-space: nowrap; background: rgba(255, 255, 255, 0.025);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.chip .ic { width: 11px; height: 11px; vertical-align: -2px; margin-right: 4px; }
.chip.accent { border-color: rgba(232, 151, 58, 0.6); color: var(--accent); background: rgba(232, 151, 58, 0.08); }
.chip.green { border-color: rgba(87, 185, 129, 0.6); color: var(--green); background: rgba(87, 185, 129, 0.08); }
.chip.red { border-color: rgba(224, 82, 82, 0.6); color: var(--red); background: rgba(224, 82, 82, 0.08); }
.chip.cyan { border-color: rgba(95, 179, 201, 0.6); color: var(--cyan); background: rgba(95, 179, 201, 0.08); }

.status-idea { border-color: var(--faint); color: var(--faint); }
.status-scoped { border-color: rgba(95, 179, 201, 0.7); color: var(--cyan); background: rgba(95, 179, 201, 0.08); }
.status-committed { border-color: rgba(232, 151, 58, 0.7); color: var(--accent); background: rgba(232, 151, 58, 0.08); }
.status-in-progress { border-color: rgba(87, 185, 129, 0.7); color: var(--green); background: rgba(87, 185, 129, 0.08); }
.status-done { border-color: var(--green); color: var(--green); background: rgba(87, 185, 129, 0.18); }
/* project list cards: a status-coloured bar on the left edge */
.proj-card { position: relative; padding-left: 20px; }
.proj-card .sbar { position: absolute; left: 7px; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; border: 0; background: currentColor; opacity: 0.9; }
.proj-card .p-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.proj-card .p-chips { display: flex; gap: 6px; margin: 7px 0 5px; flex-wrap: wrap; }
.proj-card .p-sub { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }

/* ---------- money / kpi ---------- */
.kpi-band { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.kpi {
  background: linear-gradient(160deg, var(--panel-3) 0%, var(--panel) 70%);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 12px 18px 11px; min-width: 168px; position: relative; overflow: hidden;
  box-shadow: var(--lift), var(--shadow-1);
}
.kpi::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120px 60px at 100% 0%, rgba(255, 255, 255, 0.05), transparent 70%);
}
.kpi .k-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--faint); text-transform: uppercase; }
.kpi .k-value { font-family: var(--mono); font-size: 22px; font-weight: 700; margin-top: 4px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi .k-sub { font-family: var(--mono); font-size: 10px; color: var(--dim); margin-top: 3px; }
.kpi.over { border-color: rgba(224, 82, 82, 0.4); background: linear-gradient(160deg, rgba(224, 82, 82, 0.16), var(--panel) 70%); }
.kpi.over .k-value { color: var(--red); }
.kpi.ok { border-color: rgba(87, 185, 129, 0.35); background: linear-gradient(160deg, rgba(87, 185, 129, 0.14), var(--panel) 70%); }
.kpi.ok .k-value { color: var(--green); }
.kpi.accent { border-color: rgba(232, 151, 58, 0.4); background: linear-gradient(160deg, rgba(232, 151, 58, 0.18), var(--panel) 70%); }
.kpi.accent .k-value { color: var(--accent); text-shadow: 0 0 18px rgba(232, 151, 58, 0.35); }
.kpi input { color-scheme: dark; }

.capbar {
  height: 12px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px;
  position: relative; overflow: visible; margin: 8px 0 4px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}
.capbar .fill {
  position: absolute; inset: 0 auto 0 0; border-radius: 6px;
  background: linear-gradient(90deg, #b8702a, #e8973a 60%, #f6b45e);
  box-shadow: 0 0 12px rgba(232, 151, 58, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: width 320ms var(--ease);
}
.capbar .fill.over { background: linear-gradient(90deg, #8f2f2f, #e05252 60%, #ff7a7a); box-shadow: 0 0 12px rgba(224, 82, 82, 0.4); }
.capbar .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); }
.capbar .mark .mark-label {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; color: var(--ink);
}
.capbar-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--faint); margin-bottom: 20px; }

/* ---------- gantt ---------- */
.gantt-wrap {
  overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--lift), var(--shadow-1);
}
.gantt-svg { display: block; }
.gantt-svg text { font-family: var(--mono); }
.gantt-svg .g-row { fill: transparent; transition: fill var(--dur) var(--ease); }
.gantt-svg .g-row:hover { fill: rgba(255, 255, 255, 0.035); }
.gantt-svg .g-row:hover ~ .g-label { fill: var(--ink); }
.gantt-svg .g-bar { transition: filter var(--dur) var(--ease); }
.gantt-svg .g-bar:hover { filter: brightness(1.15); }

/* ---------- product cards ---------- */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 14px; }
.prod-card .p-img {
  aspect-ratio: 4 / 3; border-radius: var(--radius); background: linear-gradient(180deg, var(--panel-3), var(--panel-2));
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  margin: -1px -1px 10px; border: 1px solid var(--line); position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.prod-card .p-img::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 50% at 50% 30%, rgba(255, 255, 255, 0.05), transparent 70%);
}
.prod-card .p-img img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform 300ms var(--ease); }
.prod-card:hover .p-img img { transform: scale(1.03); }
.prod-card .p-img .ph {
  font-family: var(--mono); font-size: 9.5px; color: var(--faint); letter-spacing: 0.14em;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.prod-card .p-img .ph .ic { width: 22px; height: 22px; opacity: 0.6; }
.prod-card .p-name { font-weight: 600; margin-bottom: 2px; line-height: 1.3; }
.prod-card .p-meta { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.prod-card .p-chips { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.prod-card .p-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; }
.prod-card .p-price { font-family: var(--mono); font-size: 14px; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.prod-card .p-link { font-family: var(--mono); font-size: 10px; color: var(--cyan); text-decoration: none; letter-spacing: 0.08em; display: inline-flex; align-items: center; gap: 4px; }
.prod-card .p-link:hover { text-decoration: underline; }

/* ---------- sheets ---------- */
.sheet-layout { display: grid; grid-template-columns: 280px 1fr; height: 100%; }
.sheet-list { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 14px 12px; }
.sheet-list .sl-group { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--faint); text-transform: uppercase; margin: 14px 0 4px; padding: 0 8px; }
.sheet-list .sl-item {
  display: block; width: 100%; text-align: left; background: transparent; border: 1px solid transparent;
  color: var(--dim); padding: 6px 9px; border-radius: var(--radius); cursor: pointer; font-size: 12px;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.sheet-list .sl-item:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.sheet-list .sl-item.active { color: var(--accent); background: var(--accent-soft); border-color: rgba(232, 151, 58, 0.25); }
.sheet-view { overflow-y: auto; padding: 28px 24px 60px; background: radial-gradient(900px 500px at 50% 0%, rgba(255, 255, 255, 0.025), transparent 70%), var(--bg); }

.sheet {
  color: #1c1c1c; max-width: 820px; margin: 0 auto;
  padding: 44px 50px; border-radius: 3px; font-family: var(--sans);
  /* paper: warm off-white with a faint fibre grain from layered gradients, no image asset */
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.012) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.008) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #f7f4ed 0%, #f3efe6 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 18px 50px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4);
  position: relative;
}
.sheet + .sheet { margin-top: 24px; }
.sheet .s-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 3px solid #1c1c1c; padding-bottom: 10px; }
.sheet .s-brand { font-family: var(--mono); font-weight: 700; letter-spacing: 0.22em; font-size: 13px; }
.sheet .s-doc { font-family: var(--mono); font-size: 10px; color: #666; letter-spacing: 0.12em; text-transform: uppercase; }
.sheet h1 { font-size: 24px; margin: 18px 0 2px; letter-spacing: -0.01em; }
.sheet .s-sub { font-family: var(--mono); font-size: 11px; color: #666; margin-bottom: 18px; }
.sheet h2 { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; margin: 24px 0 8px; color: #8a5a1e; }
.sheet table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.sheet th { text-align: left; font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: #666; padding: 5px 8px; border-bottom: 1.5px solid #1c1c1c; }
.sheet td { padding: 6px 8px; border-bottom: 1px solid #d8d2c4; vertical-align: top; }
.sheet td.num, .sheet th.num { text-align: right; font-family: var(--mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sheet .s-foot { margin-top: 30px; padding-top: 10px; border-top: 1px solid #d8d2c4; font-family: var(--mono); font-size: 9.5px; color: #888; display: flex; justify-content: space-between; }
.sheet .p-block { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid #d8d2c4; }
.sheet .p-block img { width: 110px; height: 110px; object-fit: contain; background: #fff; border: 1px solid #d8d2c4; }
.sheet .p-block .pb-name { font-weight: 700; font-size: 14px; }
.sheet .p-block .pb-meta { font-family: var(--mono); font-size: 11px; color: #666; margin: 2px 0 6px; }
.sheet .p-block .pb-specs { font-size: 12px; line-height: 1.55; }
.sheet .p-block .pb-price { font-family: var(--mono); font-weight: 700; margin-top: 6px; }
.sheet a { color: #8a5a1e; }

/* ---------- misc ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .sp { flex: 1; }
.muted { color: var(--dim); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }
.right { text-align: right; }
input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
input[type="file"].hidden-file, .hidden-file { display: none; }
.two-col { display: grid; grid-template-columns: 340px 1fr; gap: 18px; height: 100%; overflow: hidden; }
.col-scroll { overflow-y: auto; padding-right: 4px; }
.list-stack { display: flex; flex-direction: column; gap: 8px; }
.banner {
  background: var(--accent-soft); border: 1px solid rgba(232, 151, 58, 0.5); color: var(--ink);
  border-radius: var(--radius); padding: 9px 12px; font-size: 12px; margin-bottom: 14px;
  font-family: var(--mono); display: flex; align-items: center; gap: 8px;
}
.search-input {
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--radius); font-family: var(--mono); font-size: 12px; padding: 6px 10px 6px 30px; width: 240px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6a76' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 9px center; background-size: 14px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus), inset 0 1px 2px rgba(0, 0, 0, 0.3); }
.legend { display: flex; gap: 16px; font-family: var(--mono); font-size: 10px; color: var(--dim); align-items: center; flex-wrap: wrap; }
.legend .sw { display: inline-block; width: 14px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* empty states: plain text (inspector) or a centred block with an icon slot */
.empty { color: var(--faint); font-family: var(--mono); font-size: 11px; line-height: 1.7; }
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px;
  padding: 40px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius-lg); color: var(--dim);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; line-height: 1.6;
  background: radial-gradient(400px 160px at 50% 0%, rgba(255, 255, 255, 0.03), transparent 70%);
}
.empty-state .empty-ic {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--faint); box-shadow: var(--lift);
}
.empty-state .empty-ic .ic { width: 20px; height: 20px; }
.empty-state b { color: var(--ink); font-weight: 600; font-family: var(--sans); font-size: 13px; letter-spacing: 0; }
.empty-state .btn { margin-top: 6px; }

/* glassy floating panels for HUDs and overlays */
.glass, .hud {
  background: var(--glass-bg); border: 1px solid var(--glass-line); border-radius: var(--radius);
  backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: var(--lift), var(--shadow-1);
}
.hud { position: absolute; padding: 6px 9px; font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: 0.04em; z-index: 3; }
.hud b { color: var(--ink); font-weight: 600; }
.hud .btn, .glass .btn { box-shadow: none; }

/* toast: fixed, bottom centre, one line, auto-dismissed by whoever creates it */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--glass-bg); border: 1px solid var(--glass-line); border-left: 3px solid var(--accent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--ink); font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  padding: 9px 14px; border-radius: var(--radius); box-shadow: var(--shadow-2); z-index: 1000;
  display: flex; align-items: center; gap: 9px; max-width: min(560px, 90vw);
  animation: toast-in 220ms var(--ease) both;
}
.toast.ok { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.leaving { animation: toast-out 180ms var(--ease) both; }

/* tooltip: JS-positioned element, or CSS-only via data-tip */
.tooltip {
  position: absolute; z-index: 1001; pointer-events: none;
  background: #05080a; color: var(--ink); border: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; padding: 4px 8px; border-radius: 4px;
  box-shadow: var(--shadow-1); white-space: nowrap;
}
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 7px); transform: translateX(-50%) translateY(2px);
  background: #05080a; color: var(--ink); border: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; padding: 4px 8px; border-radius: 4px;
  white-space: nowrap; pointer-events: none; opacity: 0; z-index: 1001; box-shadow: var(--shadow-1);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); transition-delay: 0ms;
}
[data-tip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); transition-delay: 350ms; }
[data-tip-below]::after { bottom: auto; top: calc(100% + 7px); }

.kbd-hint { white-space: nowrap; margin-right: 8px; }
kbd {
  font-family: var(--mono); font-size: 9.5px; color: var(--dim); border: 1px solid var(--line-2); border-radius: 4px;
  padding: 0 5px; background: rgba(255, 255, 255, 0.03); line-height: 1.6;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.12) transparent; }

/* ---------- motion ---------- */
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-out { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- print ---------- */
#print-root { display: none; }
@media print {
  @page { margin: 12mm; }
  html, body { height: auto; }
  body { overflow: visible; background: #fff; color: #111; }
  #app { display: none; }
  #print-root { display: block; }
  #print-root .sheet { box-shadow: none; max-width: none; border-radius: 0; padding: 4mm 2mm; background: #fff; }
  #print-root .sheet-page { page-break-after: always; break-after: page; }
  #print-root .sheet-page:last-child { page-break-after: auto; break-after: auto; }
  #print-root .sheet table { page-break-inside: auto; }
  #print-root .sheet tr { page-break-inside: avoid; break-inside: avoid; }
  #print-root .sheet h2 { page-break-after: avoid; break-after: avoid; }
  #print-root .sheet a { color: #1c1c1c; text-decoration: none; }
  #print-root .sheet a[href^="http"]::after { content: ' (' attr(href) ')'; font-size: 9px; color: #666; }
}
