/* Aureven Farm – dark theme from aureven.com (#0d1112, neon green #00F297, petrol #004e5a). No framework. */

:root {
    --bg: #0d1112;
    --surface: #141a1c;
    --surface-2: #1b2325;
    --surface-3: #222c2e;
    --border: #253033;
    --border-strong: #334346;
    --text: #ecf1ee;
    --muted: #9db0ac;
    --faint: #6f817e;
    --accent: #00f297;
    --accent-strong: #00c47a;
    --accent-ink: #00261b;
    --accent-soft: rgba(0, 242, 151, .10);
    --petrol: #004e5a;
    --side-bg: #0a0e0f;
    --side-text: #b8c6c3;
    --ok: #00f297;   --ok-soft: rgba(0, 242, 151, .12);
    --warn: #f2c230; --warn-soft: rgba(242, 194, 48, .12);
    --bad: #ff6b6b;  --bad-soft: rgba(255, 107, 107, .12);
    --info: #5cc8ff; --info-soft: rgba(92, 200, 255, .12);
    --radius: 10px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .25);
    --font: "Archivo", "Segoe UI", system-ui, sans-serif;
    --display: "Big Shoulders Display", "Archivo", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 650; }
h1 { font-family: var(--display); font-size: 2.1rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
h2 { font-size: 1.02rem; font-weight: 650; }
h3 { font-size: .95rem; }
h1:focus { outline: none; }
p { margin: 0 0 .75rem; }
code, .mono { font-family: var(--mono); font-size: .86em; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- shell ---------- */

.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }

.side {
    background: var(--side-bg);
    color: var(--side-text);
    border-right: 1px solid var(--border);
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
    padding: 18px 12px;
    overflow-y: auto; overflow-x: hidden;
}
.brand { display: flex; align-items: center; gap: 8px; padding: 2px 8px 22px; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; color: var(--accent); flex: none; }
.brand-mark svg { width: 28px; height: 28px; }
.brand-word { font-family: var(--display); font-size: 21px; font-weight: 800; letter-spacing: .03em; color: var(--text); white-space: nowrap; }
.brand-word span { color: var(--accent); font-weight: 600; margin-left: 3px; }
.nav-group { margin: 18px 10px 6px; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }
.nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 10px; border-radius: 8px; margin-bottom: 2px;
    color: var(--side-text); font-size: 14px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; padding: 14px 6px 0; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--petrol); color: var(--accent); font-weight: 700; font-size: 12px; flex: none; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 28px;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.topbar .spacer { flex: 1; }

.content { padding: 26px 28px 44px; max-width: 1280px; width: 100%; }

.footer { margin-top: auto; padding: 16px 28px; border-top: 1px solid var(--border); color: var(--faint); font-size: 12px; }

.btn.menu-toggle { display: none; }

@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
    .shell.open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); }
    .btn.menu-toggle { display: inline-flex; }
    .topbar, .content, .footer { padding-left: 16px; padding-right: 16px; }
    h1 { font-size: 1.7rem; }
}

/* ---------- page header ---------- */

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head > div:first-child { flex: 1; min-width: 240px; }
.page-head .lead { color: var(--accent); opacity: .85; margin: 6px 0 0; max-width: 75ch; font-size: 14px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- cards & grid ---------- */

.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 20px;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { flex: 1; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: -8px; margin-bottom: 12px; }

.grid { display: grid; gap: 16px; }
.grid > .card + .card { margin-top: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
@media (max-width: 1100px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 16px; }

.tile { padding: 16px 18px; position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--border-strong); }
.tile.ok::before { background: var(--ok); }
.tile.warn::before { background: var(--warn); }
.tile.bad::before { background: var(--bad); }
.tile .label { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tile .value { font-family: var(--display); font-size: 1.9rem; font-weight: 700; margin-top: 4px; letter-spacing: .02em; text-transform: uppercase; }
.tile.ok .value { color: var(--ok); }
.tile.warn .value { color: var(--warn); }
.tile.bad .value { color: var(--bad); }
.tile .hint { font-size: 12.5px; color: var(--faint); margin-top: 2px; }

/* KPI strip and page toolbar (tabs, search, filters in one row). */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--border-strong); }
.kpi.ok::before { background: var(--ok); }
.kpi.warn::before { background: var(--warn); }
.kpi.bad::before { background: var(--bad); }
.kpi-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.kpi-value { font-family: var(--display); font-size: 1.75rem; font-weight: 700; letter-spacing: .02em; line-height: 1.1; }
.kpi-value small { font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi.bad .kpi-value { color: var(--bad); }
.kpi-hint { font-size: 12.5px; color: var(--faint); }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.toolbar .tabs { border-bottom: 0; margin-bottom: -1px; }
.toolbar-search { flex: 1 1 220px; max-width: 360px; min-height: 34px !important; padding: 5px 11px !important; }
.toolbar .chips-filter { margin-left: auto; padding: 6px 0; }

/* ---------- badges ---------- */

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: var(--surface-3); color: var(--muted); white-space: nowrap;
    border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.badge.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.badge.accent { background: var(--accent); color: var(--accent-ink); }
.printing-now { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.spinner { width: 11px; height: 11px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ---------- alerts ---------- */

.alert {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 16px; font-size: 14px;
    background: var(--surface);
}
.alert p:last-child { margin: 0; }
.alert strong { display: block; margin-bottom: 2px; }
.alert .icon { font-weight: 700; flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; }
.alert.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); }
.alert.warn .icon { background: var(--warn); color: #241a00; }
.alert.bad { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-soft); }
.alert.bad .icon { background: var(--bad); color: #2a0000; }
.alert.info { border-color: color-mix(in srgb, var(--info) 35%, transparent); background: var(--info-soft); }
.alert.info .icon { background: var(--info); color: #00202e; }
.alert.ok { border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-soft); }
.alert.ok .icon { background: var(--ok); color: var(--accent-ink); }

/* ---------- buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; padding: 0 14px; border-radius: 8px;
    border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
    font: inherit; font-size: 14px; font-weight: 550; cursor: pointer; white-space: nowrap;
    transition: background .12s, border-color .12s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-3); border-color: var(--faint); text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary:disabled { background: var(--surface-3); border-color: var(--border-strong); color: var(--faint); opacity: 1; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger-outline { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); background: transparent; }
.btn.danger-outline:hover { background: var(--bad-soft); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 42px; padding: 0 20px; font-size: 15px; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #2a0000; font-weight: 650; }

/* ---------- forms ---------- */

.field { display: block; margin-bottom: 14px; }
.field > .lbl { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field .help { display: block; color: var(--muted); font-size: 12.5px; margin-top: 5px; }
input[type=text], input[type=number], input[type=email], input[type=search], select, textarea {
    width: 100%; font: inherit; font-size: 14px; color: var(--text);
    background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px;
    padding: 7px 11px; min-height: 38px;
}
input[type=number] { font-family: var(--mono); }
select option { background: var(--surface); }
textarea { min-height: 120px; resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(18px); background: var(--accent-ink); }
.switch input:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
    text-align: left; font-family: var(--mono); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
    color: var(--faint); padding: 9px 10px; border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
table.data td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--surface-2); }
table.data tr.clickable:hover td:first-child strong { color: var(--accent); }
table.data .num { text-align: right; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
table.kv td:first-child { color: var(--muted); width: 40%; }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }

.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 12.5px; }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow0 { flex: 1; min-width: 0; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.bad-text { color: var(--bad); }
.info-text { color: var(--info); }
.mt { margin-top: 16px; }
.mb0 { margin-bottom: 0; }

/* ---------- tooltip help ---------- */

.tip {
    display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
    background: var(--surface-3); color: var(--muted); font-size: 10.5px; font-weight: 700; cursor: help; position: relative;
    border: 1px solid var(--border-strong); text-transform: none; letter-spacing: 0; font-family: var(--font);
}
.tip:hover::after, .tip:focus::after {
    content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
    width: max-content; max-width: 280px; background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong);
    padding: 8px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 400; line-height: 1.4; z-index: 50; white-space: normal;
    box-shadow: var(--shadow);
}

/* ---------- tabs ---------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button {
    background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 14px; margin-bottom: -1px;
    font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; padding: 0 0 18px 42px; }
.steps li::before {
    counter-increment: s; content: counter(s);
    position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent); font-family: var(--mono); font-weight: 600; font-size: 12px;
    display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 13.5px; top: 32px; bottom: 4px; width: 1px; background: var(--border-strong); }

details.faq { border-bottom: 1px solid var(--border); padding: 11px 0; }
details.faq summary { cursor: pointer; font-weight: 600; }
details.faq summary::marker { color: var(--accent); }
details.faq p { margin: 8px 0 0; color: var(--muted); }

.attention { list-style: none; padding: 0; margin: 0; }
.attention li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--border); }
.attention li:last-child { border-bottom: 0; }

.toast {
    position: fixed; right: 20px; bottom: 20px; z-index: 60; max-width: 420px;
    background: var(--surface-3); color: var(--text); border: 1px solid var(--accent);
    padding: 12px 16px; border-radius: 8px; font-size: 14px; box-shadow: var(--shadow);
}
.toast.bad { border-color: var(--bad); }

/* ---------- outside Shopify admin ---------- */

.outside { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.outside[hidden] { display: none; }
.outside-card { max-width: 460px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 36px 28px; }
.outside-card .brand-mark { margin: 0 auto 14px; font-family: var(--display); font-size: 34px; font-weight: 800; width: auto; height: auto; }
.outside-card h1 { font-size: 1.7rem; margin-bottom: 10px; }
.outside-card p { color: var(--muted); }

/* ---------- framework bits ---------- */

.blazor-error-boundary { background: var(--bad-soft); color: var(--bad); padding: 1rem; border-radius: 8px; }
.blazor-error-boundary::after { content: "Na tejto časti stránky nastala chyba. Obnov stránku."; }

#blazor-error-ui {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    background: var(--warn); color: #241a00; padding: .7rem 1.25rem; font-size: 14px;
}
#blazor-error-ui a { color: #241a00; font-weight: 700; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* ---------- filter chips & bulk bar ---------- */

.chips-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.chip-btn:hover { color: var(--text); }
.chip-btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip-btn .n { font-family: var(--mono); font-size: 11.5px; margin-left: 4px; opacity: .8; }

.bulk-bar {
    position: sticky; top: 58px; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 10px 14px; margin: 0 0 14px; border-radius: 10px; border: 1px solid var(--accent);
    background: color-mix(in srgb, var(--surface) 92%, var(--accent));
}
.bulk-bar strong { margin-right: 6px; }
input[type=checkbox].row-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; margin: 2px 0 0; }
tr.dim td { opacity: .7; }
tr.selected td { background: var(--accent-soft); }

/* ---------- farm: rack ---------- */

.mb { margin-bottom: 16px; }
.grow { flex: 1; min-width: 200px; }
.spacer { flex: 1; }
select.auto { width: auto; min-width: 220px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-family: var(--display); font-size: 1.35rem; letter-spacing: .03em; text-transform: uppercase; }

/* The rack and the "now" panel side by side; the rack is sized so the whole of it fits the screen at 100 % zoom. */
.wall-top { display: grid; grid-template-columns: minmax(0, min(520px, 56vh)) minmax(300px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .wall-top { grid-template-columns: 1fr; } }

.rack {
    position: relative; padding: 10px 14px 0; border-radius: 14px;
    background: linear-gradient(180deg, #11181a, #0b1011);
    border: 1px solid var(--border);
    box-shadow: inset 5px 0 0 #2a3437, inset -5px 0 0 #2a3437;
}
.rack-shelf { position: relative; padding-top: 18px; }
.rack-shelf-name { position: absolute; top: 2px; left: 4px; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }
.rack-bay { display: flex; align-items: flex-end; justify-content: space-evenly; gap: 1%; padding: 4px 1% 0; }
.rack-board { height: 7px; border-radius: 2px; background: linear-gradient(180deg, #3a4649, #263033); box-shadow: 0 6px 10px rgba(0, 0, 0, .35); margin-bottom: 4px; }
.rack-shelf.empty .rack-bay { min-height: 34px; }
.rack-empty { align-self: center; color: var(--faint); font-size: 12px; font-style: italic; }
.rack-item { position: relative; display: flex; flex-direction: column; align-items: center; color: var(--text); transition: transform .15s; }
.rack-item:hover { transform: translateY(-3px); text-decoration: none; }
.rack-item .figure { width: 100%; height: auto; display: block; }
.rack-unit { opacity: .95; }
.rack-label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 2px; font-size: 12px; line-height: 1.2; }
.rack-label .badge { font-size: 10.5px; padding: 1px 6px; }
.rack-pct { font-family: var(--display); font-size: 1.25rem; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.figure { overflow: visible; }
.figure-offline { filter: grayscale(.8) brightness(.6); }
.figure-printing .figure-door, .figure-preparing .figure-door { stroke: var(--accent); }
.figure-paused .figure-door, .figure-finished .figure-door { stroke: var(--warn); }
.figure-failed .figure-door { stroke: var(--bad); }
.figure-printing .figure-print { filter: drop-shadow(0 0 2px rgba(255, 255, 255, .25)); }
.growth-edge { stroke: var(--accent); stroke-linecap: round; filter: drop-shadow(0 0 2px var(--accent)); }
.fig-spool { cursor: help; transition: filter .15s; }
.fig-spool:hover { filter: brightness(1.3) drop-shadow(0 0 3px rgba(0, 242, 151, .6)); }
.unit-pill { cursor: help; }
.unit-heat { animation: unit-heat 2.4s ease-in-out infinite; }
@keyframes unit-heat { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .unit-heat { animation: none; } }
.pc-figure { height: 100%; padding: 6px 0; display: flex; justify-content: center; }
.pc-figure .figure { height: 100%; width: auto; }
.detail-figure { height: 100%; width: 100%; padding: 16px; display: flex; align-items: flex-end; justify-content: center; gap: 4%; }
.detail-figure .figure { height: 100%; width: auto; max-width: 70%; }
.detail-ace { height: 34%; display: flex; }
.detail-ace .figure { height: 100%; width: auto; max-width: none; }

/* ---------- farm: "now" panel next to the rack ---------- */

.now { display: flex; flex-direction: column; gap: 12px; }
.card.now + .card { margin-top: 0; }
.now-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.now-stats > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; }
.now-stats b { font-family: var(--display); font-size: 1.8rem; line-height: 1; font-weight: 700; }
.now-stats span { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 4px; }
.now-title { font-family: var(--mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: 4px; }
.todo, .soon { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.todo li + li { margin-top: 6px; }
.todo li.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); }
.todo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--info); flex: none; }
.todo li.warn .todo-dot { background: var(--warn); }
.todo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.todo-main .faint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soon li { display: grid; grid-template-columns: minmax(80px, auto) 1fr auto; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.soon li:last-child { border-bottom: 0; }
.soon a { color: var(--text); }
.soon-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.soon-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.soon-when { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; font-variant-numeric: tabular-nums; }
.soon-when b { font-family: var(--mono); font-size: 13.5px; }
.now-hint { margin: 0; font-size: 13px; color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 8px 10px; }
.now-problem { font-size: 13px; }
.now-plan { margin-top: auto; border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.now-plan strong { font-size: 1.05rem; }
.now-plan .btn { align-self: flex-start; margin-top: 4px; padding-left: 0; color: var(--accent); }

/* ---------- farm: printer cards ---------- */

.printer-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.printer-grid > .card + .card { margin-top: 0; }
@media (max-width: 420px) { .printer-grid { grid-template-columns: 1fr; } }
.pcard { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-top: 3px solid var(--border-strong); }
.pcard.state-printing, .pcard.state-preparing { border-top-color: var(--ok); }
.pcard.state-failed { border-top-color: var(--bad); }
.pcard.state-paused, .pcard.state-finished { border-top-color: var(--warn); }
.pcard.state-idle { border-top-color: var(--info); }
.pc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pc-name { display: flex; flex-direction: column; color: var(--text); line-height: 1.25; }
.pc-name strong { font-size: 1.05rem; }
.pc-name:hover strong { color: var(--accent); }
.pc-name:hover { text-decoration: none; }
.pc-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: center; }
.pc-view { position: relative; aspect-ratio: 4 / 3; background: var(--bg); border-radius: 8px; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--border); }
.pc-camera-time {
    position: absolute; right: 6px; bottom: 6px; display: inline-flex; gap: 4px; align-items: center;
    font-family: var(--mono); font-size: 11px; color: var(--text); background: rgba(0, 0, 0, .6); padding: 2px 6px; border-radius: 4px;
}
.pc-camera-time svg { width: 12px; height: 12px; }
.pc-status { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 100%; justify-content: center; }
.pc-pct { display: flex; align-items: baseline; gap: 2px; font-family: var(--display); font-weight: 700; color: var(--accent); line-height: .9; }
.pc-pct span { font-size: 4rem; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.pc-pct small { font-size: 1.6rem; }
.pc-eta { display: flex; flex-direction: column; line-height: 1.25; }
.pc-eta b { font-family: var(--mono); font-size: 1.05rem; font-weight: 600; }
.pc-eta span { color: var(--muted); font-size: 13px; }
.pc-big { font-family: var(--display); font-size: 2rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); line-height: 1; }
.pc-big.warn { color: var(--warn); }
.pc-big.info { color: var(--info); }
.pc-big.bad { color: var(--bad); }
.pc-status .muted { font-size: 13px; }
.pc-part { width: 86%; height: 86%; }
.pc-job-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.pc-job-name.big { font-size: 16px; white-space: normal; margin-bottom: 8px; }
.pc-job-meta { display: flex; gap: 12px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.pc-error { color: var(--muted); font-size: 13px; margin: 0; }
.pc-foot { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; }
.pc-temps { display: flex; flex-wrap: wrap; gap: 6px; }
.temp { font-family: var(--mono); font-size: 12px; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.temp.on { color: #ffb36b; background: rgba(255, 140, 50, .12); }
.temp-name { font-family: var(--font); color: var(--faint); margin-right: 2px; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress.big { height: 10px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s; }
@media (max-width: 520px) { .pc-body { grid-template-columns: 1fr; } .pc-pct span { font-size: 3.2rem; } }

/* ---------- farm: printer controls ---------- */

.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn.icon { width: 36px; padding: 0; }
.btn.icon.lit { color: #ffd66b; border-color: color-mix(in srgb, #ffd66b 50%, transparent); background: rgba(255, 214, 107, .1); }
.confirm-stop { display: inline-flex; gap: 6px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; height: 36px; }
.seg button { background: transparent; border: 0; border-left: 1px solid var(--border); color: var(--muted); font: inherit; font-size: 12.5px; padding: 0 10px; cursor: pointer; font-family: var(--mono); }
.seg button:first-child { border-left: 0; }
.seg button:hover { color: var(--text); background: var(--surface-3); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg button:disabled { opacity: .5; cursor: not-allowed; }
.controls.compact .seg { height: 32px; }
.controls.compact .seg button { padding: 0 7px; font-size: 11.5px; }
.ctl-msg { font-size: 12.5px; color: var(--accent); }
.ctl-msg.bad { color: var(--bad); }

.spools { display: flex; flex-wrap: wrap; gap: 12px; }
.spool-unit { display: flex; flex-direction: column; gap: 4px; }
.spool-unit-name { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.spool-row { display: flex; gap: 6px; }
.spool { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.spool-color {
    width: 22px; height: 22px; border-radius: 50%; background: var(--c); flex: none;
    border: 2px solid rgba(255, 255, 255, .38); box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .25);
}
/* An empty slot is a dashed outline with nothing in it, so it never looks like a black spool. */
.spool.unloaded .spool-color { background: none; border: 2px dashed var(--faint); box-shadow: none; }
.spool.unloaded .spool-label { color: var(--faint); font-weight: 400; }
.spool.active .spool-color { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), inset 0 0 0 4px rgba(0, 0, 0, .25); }
.spool-label { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.spool-label.low { color: var(--warn); }
.spool-unit-climate { margin-left: 8px; text-transform: none; letter-spacing: 0; color: var(--muted); }
.spool-unit-climate.drying { color: var(--warn); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); border: 1px solid rgba(255, 255, 255, .25); margin-right: 5px; vertical-align: -1px; }

/* Big filament spools on the printer cards. */
.pc-fil { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.spools.lg { gap: 10px 22px; }
.spools.lg .spool-row { gap: 10px; }
.spools.lg .spool { position: relative; min-width: 68px; }
/* Seen from the side: the wound filament in its color around a dark hub with the slot number (readable on any color). */
.spools.lg .spool-color {
    width: 64px; height: 64px; border-width: 3px;
    background: radial-gradient(circle, var(--surface-2) 0 13px, rgba(0, 0, 0, .45) 13px 15px, var(--c) 15px);
    box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .22);
}
.spools.lg .spool.active .spool-color { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 14px rgba(0, 242, 151, .4), inset 0 0 0 4px rgba(0, 0, 0, .22); }
.spools.lg .spool.unloaded .spool-color { background: none; border: 3px dashed var(--faint); box-shadow: none; }
.spools.lg .spool-slot { position: absolute; top: 0; left: 0; right: 0; height: 64px; line-height: 64px; text-align: center; font-family: var(--mono); font-size: 13px; font-weight: 700; color: #fff; pointer-events: none; }
.spools.lg .spool.unloaded .spool-slot { color: var(--faint); }
.spools.lg .spool-label { font-size: 12.5px; color: var(--text); font-weight: 600; }
.spools.lg .spool.unloaded .spool-label { color: var(--faint); font-weight: 400; }
.spools.lg .spool-label.low { color: var(--warn); }
.spools.lg .spool-unit-name { font-size: 11px; }

/* ---------- farm: printer detail ---------- */

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.detail-grid .stack > .card + .card { margin-top: 0; }
@media (max-width: 1000px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-camera { position: relative; padding: 0; overflow: hidden; aspect-ratio: 16 / 9; display: grid; place-items: center; background: var(--bg); }
.detail-camera > img { width: 100%; height: 100%; object-fit: contain; }
.detail-camera > img.stale { opacity: .45; filter: grayscale(1); }
.camera-notice {
    position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 8px; align-items: center;
    font-size: 13.5px; color: var(--text); background: rgba(0, 0, 0, .7); padding: 8px 12px; border-radius: 6px;
}
.camera-notice.bad { border-left: 3px solid var(--bad); }
.camera-notice.top { bottom: auto; top: 44px; }
.camera-view { position: relative; width: 100%; height: 100%; display: grid; place-items: center; background: var(--bg); outline: none; }
.camera-view > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.camera-view > img.stale { opacity: .45; filter: grayscale(1); }
.print-camera .camera-view { aspect-ratio: 16 / 9; border-radius: 8px; border: 1px solid var(--border); overflow: hidden; }
.camera-top, .camera-bottom { position: absolute; left: 8px; right: 8px; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.camera-top { top: 8px; justify-content: space-between; }
.camera-bottom { bottom: 8px; align-items: flex-end; }
.camera-top > span, .camera-labels > span {
    display: inline-flex; gap: 5px; align-items: center; font-size: 12px; color: var(--text);
    background: rgba(0, 0, 0, .65); padding: 3px 8px; border-radius: 4px;
}
.camera-top > span:only-child { margin-left: auto; }
.camera-top svg { width: 12px; height: 12px; }
.camera-time { font-family: var(--mono); font-size: 11px !important; }
.camera-labels { flex: 1; display: flex; justify-content: space-between; gap: 8px; }
.camera-labels > span { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.camera-max {
    pointer-events: auto; flex: none; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer;
    color: var(--text); background: rgba(0, 0, 0, .65); border: 1px solid rgba(255, 255, 255, .18); border-radius: 6px;
}
.camera-max:hover, .camera-max:focus-visible { border-color: var(--accent); color: var(--accent); }
.camera-max svg { width: 18px; height: 18px; }
.camera-view.max { position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100vh; aspect-ratio: auto; border: 0; border-radius: 0; background: #000; }
.camera-view.max .camera-top > span, .camera-view.max .camera-labels > span { font-size: 15px; padding: 5px 12px; }
.camera-view.max .camera-max { width: 42px; height: 42px; }
.camera-notice svg { width: 14px; height: 14px; flex: none; }
.heater { display: grid; grid-template-columns: 110px 1fr 110px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13.5px; }
.heater .mono { text-align: right; }
.heater-power { display: block; font-size: 11px; }
.heater-bar { position: relative; height: 8px; border-radius: 999px; background: var(--surface-3); }
.heater-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #5cc8ff, #ffb36b, #ff6b6b); }
.heater-bar i { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--text); }
details.raw summary { cursor: pointer; }
.raw-table td { padding: 4px 10px; font-size: 12px; word-break: break-all; }
.detail-job { display: flex; align-items: center; gap: 18px; }
.detail-growth { width: 120px; height: 120px; flex: none; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }

/* ---------- farm: mapping, parts, stats ---------- */

.map-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .map-layout { grid-template-columns: 1fr; } }
.map-list { position: sticky; top: 70px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; }
.product-list { list-style: none; padding: 0; margin: 12px -8px 0; overflow-y: auto; }
.product-list li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.product-list li:hover { background: var(--surface-2); }
.product-list li.on { background: var(--accent-soft); color: var(--accent); }
.product-list img, .product-list .noimg { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--faint); }
.product-list .noimg svg { width: 18px; height: 18px; }
.pl-title { flex: 1; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.card.dim, tr.dim td { opacity: .6; }
.util { display: grid; grid-template-columns: minmax(160px, 1.2fr) 2fr 54px minmax(130px, auto); gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.util:last-of-type { border-bottom: 0; }
.util-bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.util-bar span { display: block; height: 100%; background: var(--accent); }
.util .mono { text-align: right; }
@media (max-width: 720px) { .util { grid-template-columns: 1fr 60px; } .util-bar { grid-column: 1 / -1; } }
.target-input { width: 96px; text-align: right; }
.swatches { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.swatch { width: 16px; height: 16px; border-radius: 50%; background: var(--c); border: 1px solid var(--border-strong); }
.swatch.missing { outline: 2px solid var(--bad); outline-offset: 1px; }

/* ---------- farm: print dialog ---------- */

.overlay {
    position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .62);
    display: grid; place-items: start center; padding: 6vh 16px 16px; overflow-y: auto;
}
.sheet { width: min(760px, 100%); margin: 0; box-shadow: var(--shadow); }
.print-pick { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 14px; }
.print-option {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; text-align: left;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font: inherit; cursor: pointer;
}
.print-option:hover { border-color: var(--border-strong); }
.print-option.on { border-color: var(--accent); background: var(--accent-soft); }
.print-option:disabled { cursor: not-allowed; opacity: .6; }
.print-body { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) 220px; align-items: start; }
@media (max-width: 720px) { .print-body { grid-template-columns: 1fr; } }
.print-camera { margin: 0; }
.print-camera img { width: 100%; border-radius: 8px; border: 1px solid var(--border); display: block; }
.checklist { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; font-size: 15px; }
.check-row.bad { color: var(--bad); background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); }
.check-mark { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; }
.check-row.bad .check-mark { background: var(--bad-soft); }
.check-tap {
    display: flex; gap: 12px; align-items: center; width: 100%; min-height: 56px; padding: 12px 14px; text-align: left;
    border-radius: 10px; border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: var(--surface-2);
    color: var(--text); font: inherit; font-size: 15px; cursor: pointer; transition: background .15s, border-color .15s;
}
.check-tap:hover { border-color: var(--warn); }
.check-tap:disabled { cursor: not-allowed; opacity: .6; }
.check-tap.on { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-soft); color: var(--muted); }
.check-box {
    flex: none; width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--warn); display: grid; place-items: center;
    font-size: 18px; font-weight: 700; color: var(--accent-ink); transition: background .15s, border-color .15s;
}
.check-tap.on .check-box { background: var(--ok); border-color: var(--ok); }
.check-ok { border-radius: 10px; border: 1px solid var(--border); padding: 0 14px; color: var(--muted); font-size: 14px; }
.check-ok summary { display: flex; gap: 12px; align-items: center; min-height: 48px; cursor: pointer; list-style: none; }
.check-ok summary::-webkit-details-marker { display: none; }
.check-ok summary::after { content: "▾"; margin-left: auto; color: var(--faint); }
.check-ok[open] summary::after { content: "▴"; }
.check-ok .check-mark { width: 24px; height: 24px; background: var(--ok-soft); color: var(--ok); font-size: 13px; }
.check-ok ul { margin: 0 0 12px; padding-left: 36px; }
.check-ok li { padding: 2px 0; }
.ready-bar { flex-basis: 100%; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.ready-fill { display: block; height: 100%; border-radius: inherit; background: var(--warn); transition: width .3s ease, background .3s; }
.ready-bar.ok .ready-fill { background: var(--ok); }
.ready-bar.bad .ready-fill { background: var(--bad); }
.ready-text { font-size: 13px; color: var(--warn); }
.ready-text.ok { color: var(--ok); }
.ready-text.bad { color: var(--bad); }
@media (prefers-reduced-motion: reduce) { .ready-fill, .check-tap, .check-box { transition: none; } }
.version-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.version-pick { width: auto; min-height: 32px; padding: 3px 8px; font-family: var(--mono); font-size: 13px; }

/* ---------- výroba: objednávky s fotkami produktov a diely na tlač ---------- */

.unmapped-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }

.order { padding: 0; overflow: hidden; }
.prod-list > .card + .card, .card.order + .card.order { margin-top: 12px; }
.order.done { opacity: .72; }
.order-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.o-num { font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--accent); }
.o-who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.o-who strong { font-weight: 600; }
.o-age { font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--surface-3); border-radius: 6px; padding: 1px 7px; }
.o-age.late { color: var(--bad); background: var(--bad-soft); }
.o-progress { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.o-bar { width: 90px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.o-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.country { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.country b { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; color: var(--text); background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 5px; }

.o-line { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(0, 3fr); gap: 16px; padding: 12px 16px; align-items: start; }
.o-line + .o-line { border-top: 1px solid var(--border); }
.o-prod { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.o-img { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; flex: none; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--faint); }
.o-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.o-img svg { width: 24px; height: 24px; }
.o-prod-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.o-prod-text strong { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.o-prod-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.o-qty { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text); background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 1px 7px; }
.o-parts { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.o-part { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); }
.o-part.done { opacity: .6; }
.o-part.missing { display: flex; flex-wrap: wrap; border-style: dashed; border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.o-thumb { width: 40px; height: 40px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: var(--faint); }
.o-thumb img { width: 100%; height: 100%; object-fit: contain; }
.o-thumb svg { width: 18px; height: 18px; }
.o-part-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.o-part-text strong { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.o-count { font-family: var(--mono); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.o-count span { color: var(--faint); font-weight: 500; font-size: 12.5px; }
.o-act { display: flex; gap: 6px; align-items: center; justify-content: flex-end; min-width: 150px; }
.o-done svg { width: 18px; height: 18px; }
.btn.sm.icon { width: 30px; }
@media (max-width: 900px) {
    .o-line { grid-template-columns: 1fr; }
    .o-part { grid-template-columns: 40px minmax(0, 1fr) auto; }
    .o-act { grid-column: 1 / -1; justify-content: flex-start; }
}

.queue { padding: 0; overflow: hidden; }
.q-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 56px 92px 92px auto; gap: 14px; align-items: center; padding: 12px 16px; }
.q-row + .q-row { border-top: 1px solid var(--border); }
.q-row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.q-thumb { width: 64px; height: 64px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; color: var(--faint); }
.q-thumb img { width: 100%; height: 100%; object-fit: contain; }
.q-thumb svg { width: 24px; height: 24px; }
.q-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.q-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-main .faint { overflow-wrap: anywhere; }
.q-orders { display: flex; flex-wrap: wrap; gap: 4px; }
.q-num { text-align: right; line-height: 1.25; }
.q-num b { display: block; font-family: var(--mono); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-num span { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); white-space: nowrap; }
.q-act { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
@media (max-width: 900px) {
    .q-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
    .q-num { grid-row: 2; text-align: left; }
    .q-act { grid-column: 1 / -1; flex-direction: row; }
}

/* ---------- sklad: varianty v rozbaľovacej skupine produktu ---------- */

table.data tbody.group tr.group-row td { background: var(--surface-2); }
table.data tbody.group + tbody td, table.data tbody + tbody.group td { border-top: 1px solid var(--border-strong); }
table.data tr.variant-row td:first-child { padding-left: 40px; }
table.data tr.variant-row td:first-child strong { font-weight: 550; }
.group-toggle {
    display: inline-flex; align-items: flex-start; gap: 8px; padding: 0; border: 0; background: none;
    color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.group-toggle > span { display: flex; flex-direction: column; }
.group-toggle svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--muted); transform: rotate(-90deg); transition: transform .15s; }
.group-toggle.on svg { transform: none; color: var(--accent); }
.group-toggle:hover strong { color: var(--accent); }

.plates { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }

/* ---------- farm: print dialog and print picker ---------- */

.sheet-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.sheet-head h2 { font-size: 1.15rem; overflow-wrap: anywhere; }
.sheet-thumb { width: 64px; height: 64px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--faint); }
.sheet-thumb img { width: 100%; height: 100%; object-fit: contain; }
.sheet-thumb svg { width: 26px; height: 26px; }
.sheet-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.step-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 16px 0 8px; }
.step-label .faint { text-transform: none; letter-spacing: 0; font-family: var(--font); }
.po-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.print-option .spools { gap: 6px; margin-top: 4px; }
.print-option .spool-color { width: 14px; height: 14px; border-width: 1px; box-shadow: none; }
.slot-map { display: flex; flex-direction: column; gap: 8px; }
.slot-row { display: grid; grid-template-columns: minmax(150px, auto) 20px 1fr; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.slot-row.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.slot-row.bad { border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.slot-need { display: flex; align-items: center; gap: 10px; }
.slot-arrow { color: var(--faint); text-align: center; }
.slot-choices { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.slot-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px 0 6px; border-radius: 999px;
    border: 1px solid var(--border-strong); background: var(--bg); color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer;
}
.slot-btn .spool-color { width: 20px; height: 20px; }
.slot-btn:hover { color: var(--text); border-color: var(--faint); }
.slot-btn.on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }
.slot-name { font-family: var(--mono); font-weight: 600; }
.slot-mat { font-size: 11.5px; }
.slot-note { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--bad); }
@media (max-width: 640px) { .slot-row { grid-template-columns: 1fr; } .slot-arrow { display: none; } }

.tabs .n, .chip-btn .n { font-family: var(--mono); font-size: 11.5px; margin-left: 4px; opacity: .75; }
.pick-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.pick-list li + li { margin-top: 6px; }
.pick-item {
    width: 100%; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left;
    padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer;
}
.pick-item:hover { border-color: var(--accent); }
.pick-item:disabled { opacity: .5; cursor: not-allowed; }
.pick-thumb { width: 56px; height: 56px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; overflow: hidden; color: var(--faint); }
.pick-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pick-thumb svg { width: 22px; height: 22px; }
.pick-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; align-items: flex-start; }
.pick-main .faint { overflow-wrap: anywhere; }
.pick-orders { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pick-num { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.pick-num b { font-family: var(--mono); font-size: 14px; }
.pick-num span { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.order-chip { font-family: var(--mono); font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); white-space: nowrap; }

/* ---------- mapovanie: varianty, sada dielov, hľadanie dielu ---------- */

.chip { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.chip-sep { width: 1px; align-self: stretch; background: var(--border-strong); margin: 0 4px; }
.mb-s { margin-bottom: 10px; }
.cov { flex: none; font-family: var(--mono); font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.cov.full { color: var(--ok); background: var(--ok-soft); }
.cov.part { color: var(--warn); background: var(--warn-soft); }
.cov.none { color: var(--faint); background: var(--surface-3); }
.product-list li.on .pl-title { color: var(--accent); }

.mp-head { display: flex; align-items: center; gap: 14px; }
.mp-head h2 { font-size: 1.2rem; }
.mp-img { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; flex: none; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--faint); }
.mp-img img { width: 100%; height: 100%; object-fit: cover; }

.variants { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; max-height: 420px; overflow-y: auto; }
.v-row { display: grid; grid-template-columns: 24px minmax(160px, 1fr) minmax(0, 2fr) auto; gap: 10px; align-items: center; padding: 7px 10px; cursor: pointer; font-size: 13.5px; }
.v-row + .v-row { border-top: 1px solid var(--border); }
.v-row:hover { background: var(--surface-2); }
.v-row.on { background: var(--accent-soft); }
.v-row.common { background: var(--surface-2); }
.v-row.common.on { background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface-2)); }
.v-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.v-name strong { font-weight: 600; }
.v-map { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; }
.map-chip { font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--petrol); color: #bff7e3; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.map-chip.dim { background: var(--surface-3); color: var(--muted); }
@media (max-width: 720px) { .v-row { grid-template-columns: 24px 1fr auto; } .v-map { grid-column: 2 / -1; grid-row: 2; } }

.map-empty { padding: 18px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 10px; margin-bottom: 12px; }
.map-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: var(--bg); }
.mr-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mr-fields { display: grid; grid-template-columns: minmax(150px, 1.4fr) minmax(130px, 1fr) minmax(140px, 1.2fr) 86px 86px; gap: 10px; }
.mr-fields .field { margin: 0; }
.mr-fields .lbl { font-size: 12px !important; color: var(--muted) !important; }
.mr-info { gap: 6px 10px; }
.mr-remove { align-self: start; }
@media (max-width: 1100px) { .mr-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.map-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--border); }

.part-search { position: relative; display: flex; gap: 8px; align-items: center; }
.part-search input { flex: 1; }
.part-chosen {
    display: flex; align-items: center; gap: 6px; width: 100%; min-height: 38px; padding: 6px 11px; border-radius: 8px; text-align: left;
    border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; cursor: pointer;
}
.part-chosen:hover { border-color: var(--accent); }
.part-chosen svg { width: 16px; height: 16px; margin-left: auto; color: var(--muted); flex: none; }
.part-path { color: var(--faint); font-size: 12.5px; }
.part-hits {
    position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; list-style: none; margin: 0; padding: 4px;
    background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); max-height: 360px; overflow-y: auto;
}
.part-hits li.faint { padding: 8px 10px; }
.part-hits button {
    display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent;
    color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; flex-wrap: wrap;
}
.part-hits button:hover, .part-hits button.on { background: var(--accent-soft); }

/* ---------- diely: kompaktný zoznam, rovnaký diel pre viac tlačiarní v jednom riadku ---------- */

.toolbar-count { margin-left: auto; padding: 6px 0; }
.folder-head { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.folder-head svg { width: 15px; height: 15px; }
.parts-list { padding: 0; overflow: hidden; }
.card.parts-list + .folder-head { margin-top: 22px; }
.pf + .pf { border-top: 1px solid var(--border); }
.pf-row {
    display: grid; grid-template-columns: 52px minmax(0, 1fr) 96px 104px 110px 18px; gap: 14px; align-items: center; width: 100%;
    padding: 8px 14px; background: none; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.pf-row:hover { background: var(--surface-2); }
.pf-row > svg { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.pf.open .pf-row > svg { transform: rotate(180deg); color: var(--accent); }
.pf.open .pf-row { background: var(--surface-2); }
.pf-thumb { width: 52px; height: 52px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; color: var(--faint); }
.pf-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pf-thumb svg { width: 20px; height: 20px; }
.pf-name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pf-name strong { font-weight: 600; overflow-wrap: anywhere; }
.pf-vars { display: flex; flex-wrap: wrap; gap: 4px; }
.pf-var { font-family: var(--mono); font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--info-soft); color: var(--info); }
.pf-var b { color: var(--text); font-weight: 600; }
.pf-num { text-align: right; line-height: 1.25; }
.pf-num b { display: block; font-family: var(--mono); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pf-num span { font-size: 11px; color: var(--faint); white-space: nowrap; }
.pf-use { text-align: right; font-size: 12.5px; }
.pf-detail { padding: 6px 14px 14px 80px; background: var(--surface-2); }
.pf-part + .pf-part { margin-top: 12px; }
.pf-part-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
table.data.compact td { padding: 6px 8px; font-size: 13px; vertical-align: middle; }
@media (max-width: 860px) {
    .pf-row { grid-template-columns: 44px minmax(0, 1fr) auto 18px; }
    .pf-row .pf-num:nth-of-type(2), .pf-use { display: none; }
    .pf-thumb { width: 44px; height: 44px; }
    .pf-detail { padding-left: 14px; overflow-x: auto; }
}

/* ---------- plán výroby: časová os ---------- */

.inline-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.inline-field select { width: auto; min-height: 34px; padding: 4px 8px; }
.plan-top { display: grid; grid-template-columns: minmax(300px, 1.1fr) minmax(0, 1.4fr); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.plan-top .card + .card { margin-top: 0; }
@media (max-width: 960px) { .plan-top { grid-template-columns: 1fr; } }
.plan-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.visit-now { display: flex; flex-direction: column; gap: 10px; border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.visit-when { font-family: var(--display); font-size: 2.6rem; font-weight: 700; color: var(--accent); line-height: 1; letter-spacing: .02em; }
.visit-when small { font-family: var(--font); font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.visit-then { border-top: 1px solid var(--border); padding-top: 8px; font-size: 13.5px; }
.visit-todo { display: flex; flex-direction: column; gap: 6px; }
.vt-line { display: grid; grid-template-columns: 52px 1fr; gap: 8px; font-size: 13.5px; line-height: 1.35; }
.visit-todo.compact .vt-line { font-size: 13px; }
.vt-verb { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.lg-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.visits { list-style: none; margin: 0; padding: 0; }
.visits li { display: grid; grid-template-columns: 90px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.visits li:last-child { border-bottom: 0; }
.v-time { font-family: var(--mono); font-weight: 600; }

.tl-scroll { overflow-x: auto; margin: 0 -20px; padding: 0 20px 6px; }
.tl { display: block; font-family: var(--font); }
.tl-night { fill: rgba(0, 0, 0, .55); }
.tl-hour { stroke: var(--border); stroke-width: 1; }
.tl-day { stroke: var(--border-strong); stroke-width: 1.5; }
.tl-row { stroke: var(--border); }
.tl-tick { fill: var(--faint); font-family: var(--mono); font-size: 10.5px; }
.tl-date { fill: var(--muted); font-size: 11.5px; font-weight: 600; }
.tl-name { fill: var(--text); font-size: 12.5px; font-weight: 600; }
.tl .bar { transition: opacity .12s; cursor: default; }
.tl .bar rect { stroke: var(--surface); stroke-width: 2; }
.tl .bar text { fill: #fff; font-size: 11px; font-weight: 600; pointer-events: none; }
.tl .bar.running rect { fill: url(#none); fill: var(--surface-3); stroke: var(--accent); stroke-dasharray: 4 3; }
.tl .bar.running text { fill: var(--muted); }
.tl .bar:hover rect { filter: brightness(1.2); }
.tl-visit { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 4; opacity: .55; }
.tl-visit-dot { fill: var(--accent); }
.tl-now { stroke: var(--warn); stroke-width: 2; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 13px; }
.lg-item { display: inline-flex; align-items: center; gap: 4px; transition: opacity .12s; cursor: default; }

/* ---------- vyťaženie: história, dni, týždeň, pauzy ---------- */

.hist { position: relative; }
.hist-axis { position: relative; height: 18px; margin: 0 56px 0 110px; }
.hist-axis span { position: absolute; transform: translateX(-50%); font-family: var(--mono); font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.hist-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) 46px; gap: 10px; align-items: center; padding: 5px 0; }
.hist-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-track { position: relative; height: 22px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.hist-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
.hist-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; background: var(--accent); box-shadow: 0 0 0 1px var(--surface-2); }
.hist-bar.failed { background: var(--bad); }
.hist-bar.running { background: repeating-linear-gradient(45deg, var(--accent) 0 5px, var(--accent-strong) 5px 10px); }
.hist-share { text-align: right; font-size: 12.5px; }
.hist-legend { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; margin-top: 8px; margin-left: 110px; }
.sw { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-right: -8px; }
.sw.ok { background: var(--accent); }
.sw.failed { background: var(--bad); }
.sw.running { background: repeating-linear-gradient(45deg, var(--accent) 0 3px, var(--accent-strong) 3px 6px); }
@media (max-width: 720px) { .hist-row { grid-template-columns: 70px minmax(0, 1fr) 40px; } .hist-axis, .hist-legend { margin-left: 80px; } }

.daychart { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; height: 220px; }
.dc-y { display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-family: var(--mono); font-size: 10.5px; color: var(--faint); line-height: 1; }
.dc-y span:first-child { transform: translateY(-50%); }
.dc-y span:last-child { transform: translateY(50%); }
.daychart { margin-bottom: 26px; }
.dc-plot { display: flex; gap: 3px; align-items: stretch; border-bottom: 1px solid var(--border-strong); background: linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 100% 50%; }
.dc-col { flex: 1; display: flex; flex-direction: column; min-width: 0; border-radius: 4px 4px 0 0; }
.dc-col.weekend { background: rgba(92, 200, 255, .06); }
.dc-stack { flex: 1; display: flex; flex-direction: column-reverse; gap: 2px; padding: 0 12%; }
.dc-stack span { display: block; border-radius: 2px; min-height: 2px; }
.dc-stack span:last-child { border-radius: 4px 4px 2px 2px; }
.dc-x { height: 20px; margin-bottom: -21px; text-align: center; font-family: var(--mono); font-size: 10px; color: var(--faint); white-space: nowrap; overflow: hidden; }
.dc-col.weekend .dc-x { color: var(--info); }
.daychart + .tl-legend { margin-top: 8px; }

.heat { display: grid; grid-template-columns: 24px repeat(24, minmax(0, 1fr)); gap: 2px; }
.heat-h { font-family: var(--mono); font-size: 9.5px; color: var(--faint); text-align: left; }
.heat-d { font-size: 11px; color: var(--muted); align-self: center; }
.heat-c { aspect-ratio: 1; border-radius: 3px; background: color-mix(in srgb, var(--accent) calc(var(--v) * 100%), var(--surface-2)); }
.heat-c.na { background: transparent; border: 1px dashed var(--border); }
.heat-scale { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11.5px; }
.heat-scale i { width: 120px; height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--surface-2), var(--accent)); }

.gapchart { display: flex; gap: 8px; height: 200px; align-items: stretch; padding-bottom: 34px; border-bottom: 1px solid var(--border-strong); }
.gc-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; position: relative; }
.gc-bar { width: 70%; border-radius: 4px 4px 0 0; background: var(--info); min-height: 0; }
.gc-bar.long { background: var(--warn); }
.gc-n { font-family: var(--mono); font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.gc-x { position: absolute; bottom: -30px; font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.2; }

/* ---------- labels (Bluetooth label printer in the workshop) ---------- */

.label-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--faint); }
.label-state svg { width: 14px; height: 14px; flex: none; }
.label-state.ok svg { color: var(--ok); }
.label-state.warn { color: var(--warn); }
.label-pick { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.label-preview { margin: 0; flex: 0 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.label-preview svg { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 0 0 1px var(--border-strong); }
.label-preview figcaption { overflow-wrap: anywhere; }
.label-pick-act { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; flex: 1 1 220px; min-width: 0; }
.label-pick-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.label-pick-row input { width: 80px; }
table.data tr.on td { background: var(--accent-soft); }
.label-prod { display: flex; align-items: center; gap: 10px; }
.label-prod .o-img { width: 36px; height: 36px; border-radius: 8px; }
.label-prod .o-img svg { width: 18px; height: 18px; }
.label-variant { min-width: 160px; max-width: 280px; }
.o-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; padding-top: 2px; }
.label-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--bg); font-family: var(--mono); font-size: 11px; font-weight: 700; }
.o-labels { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); }
.o-labels svg { width: 14px; height: 14px; }
.o-labels input { width: 64px; min-height: 26px; height: 26px; padding: 0 6px; font-size: 13px; }
.label-bar strong { display: inline-flex; align-items: center; gap: 6px; }
.label-bar strong svg { width: 16px; height: 16px; color: var(--accent); }
.label-order { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.label-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.label-chip-name { font-family: var(--font); font-weight: 500; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.chip-x { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; line-height: 1; cursor: pointer; padding: 0 2px; }
.chip-x:hover { color: var(--bad); }

/* ---------- farm: slot editor (material and color of an AMS slot) ---------- */
.slot-sheet { width: min(520px, 100%); }
.slot-sheet .slot-preview { width: 52px; height: 52px; border-width: 3px; background: radial-gradient(circle, var(--surface) 0 10px, rgba(0, 0, 0, .45) 10px 12px, var(--c) 12px); }
.slot-sheet .slot-preview.none { background: none; border-style: dashed; border-color: var(--faint); }
.slot-sheet .swatches { gap: 8px; align-items: center; }
.slot-sheet .swatch { width: 34px; height: 34px; border: 2px solid rgba(255, 255, 255, .38); cursor: pointer; padding: 0; }
.slot-sheet .swatch.on { outline: 3px solid var(--accent); outline-offset: 2px; }
.swatch-custom { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.swatch-custom input[type=color] { width: 34px; height: 34px; padding: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: none; cursor: pointer; }
/* A spool that can be edited is a button; it looks the same, with a hint on hover. */
button.spool { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
button.spool:hover .spool-color, button.spool:focus-visible .spool-color { outline: 2px solid var(--accent); outline-offset: 2px; }
