/* Farmářská tečka — administrace. Barvy navazují na brand.css původního správce. */
:root {
  --red: #ec1f25;
  --red-dark: #b8151a;
  --red-soft: #fce9e8;
  --ink: #140300;
  --muted: #6c625e;
  --line: #e9e2de;
  --bg: #faf8f6;
  --card: #ffffff;
  --ok: #2f6b3a;
  --ok-bg: #e6f2e4;
  --warn: #7a5212;
  --warn-bg: #fff1d6;
  --bad: #8f1d1d;
  --bad-bg: #fde8e7;
  --info: #24507a;
  --info-bg: #e5eef8;
  --test: #4a3a8f;
  --test-bg: #eeeaff;
  --radius: 10px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: var(--red-dark); text-underline-offset: 3px; }
h1 { font-size: 28px; letter-spacing: -0.6px; margin: 0 0 4px; }
h2 { font-size: 19px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 18px 0 8px; }
code, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.muted, small { color: var(--muted); }
button, .button {
  font: inherit; font-weight: 700; min-height: 40px; padding: 8px 16px; border-radius: 7px; border: 0;
  background: var(--red); color: #fff; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
button:hover, .button:hover { background: #c81117; }
button.secondary, .button.secondary { background: #fff; color: var(--ink); border: 1px solid #d7cbc6; }
button.secondary:hover { background: #f4edeb; }
button.danger { background: #fff; color: var(--bad); border: 1px solid #e4b4b2; }
button.danger:hover { background: var(--bad-bg); }
button.link { background: none; color: var(--red-dark); padding: 0; min-height: 0; font-weight: 400; text-decoration: underline; }
button:disabled { opacity: .55; cursor: not-allowed; }
button.working:disabled { opacity: 1; cursor: progress; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #e0d6d2; border-top-color: var(--red, #e2231a); animation: ft-spin .8s linear infinite; flex: none; }
@keyframes ft-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
input, select, textarea { font: inherit; border: 1px solid #d7cbc6; border-radius: 7px; padding: 8px 10px; background: #fff; min-height: 40px; max-width: 100%; }
textarea { min-height: 160px; width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; }
label.check { flex-direction: row; align-items: center; font-weight: 400; font-size: 14px; gap: 8px; }
label.check input { min-height: 0; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #ec1f2570; outline-offset: 2px; }

.env-banner { background: repeating-linear-gradient(135deg, #4a3a8f, #4a3a8f 12px, #5b4aa3 12px, #5b4aa3 24px); color: #fff; text-align: center; font-weight: 700; font-size: 13px; padding: 6px 12px; letter-spacing: .5px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: #fff; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.brand img { width: 150px; height: auto; display: block; }
.brand-sub { font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: .3px; border-left: 1px solid var(--line); padding-left: 14px; }
.account { display: flex; gap: 14px; align-items: center; font-size: 14px; flex-wrap: wrap; justify-content: flex-end; }

.shell { flex: 1; display: grid; grid-template-columns: 230px minmax(0, 1fr); width: 100%; max-width: 1480px; margin: 0 auto; }
.side { display: flex; flex-direction: column; gap: 2px; padding: 20px 12px; border-right: 1px solid var(--line); }
.side a { padding: 9px 12px; border-radius: 7px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14px; }
.side a:hover { background: #f4edeb; }
.side a[aria-current="page"] { background: var(--red-soft); color: var(--red-dark); }
.side .nav-label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 16px 12px 4px; font-weight: 700; }
main { padding: 24px 28px 40px; min-width: 0; }
main:focus { outline: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumbs { font-size: 13px; margin-bottom: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat span { display: block; font-size: 13px; color: var(--muted); font-weight: 700; }
.stat strong { display: block; font-size: 30px; letter-spacing: -1px; margin: 4px 0 2px; }
.stat small { font-size: 12px; }
.split-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.split-head h2 { margin: 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eee6e1; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); background: #fbf9f8; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fdf8f6; }
td .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; background: #f1ece9; color: var(--muted); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.b-online, .b-verified, .b-success, .b-active, .b-finished { background: var(--ok-bg); color: var(--ok); }
.b-late, .b-pending_user, .b-blocked, .b-scheduled, .b-waiting, .b-draft, .b-delivering, .b-queued, .b-running, .b-in_progress, .b-succeeded_unverified, .b-rejected { background: var(--warn-bg); color: var(--warn); }
.b-offline, .b-failed, .b-unknown, .b-revoked, .b-denied, .b-retired { background: var(--bad-bg); color: var(--bad); }
.b-info, .b-planned, .b-legacy { background: var(--info-bg); color: var(--info); }
.b-test { background: var(--test-bg); color: var(--test); border: 1px dashed #8d80d6; }
.b-test::before { display: none; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.toolbar label { font-size: 12px; }
form.stack { display: grid; gap: 12px; max-width: 640px; }
form.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0; }
legend { font-weight: 700; font-size: 13px; padding: 0 6px; }
.pick-list { max-height: 260px; overflow: auto; display: grid; gap: 4px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.note { background: #fbf6e9; border: 1px solid #efe1bd; color: #5c4513; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin: 10px 0; }
.note.danger { background: var(--bad-bg); border-color: #efc2c0; color: var(--bad); }
.secret { background: #fff7f6; border: 1px dashed var(--red); padding: 12px; border-radius: 8px; margin: 12px 0; }
.secret input { width: 100%; font-family: ui-monospace, Menlo, monospace; }
.code-big { font-size: 30px; letter-spacing: 4px; font-weight: 700; color: var(--red-dark); font-family: ui-monospace, Menlo, monospace; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; font-size: 14px; }
.tabs a[aria-current="page"] { color: var(--red-dark); border-color: var(--red); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid #f0e9e5; font-size: 14px; display: grid; grid-template-columns: 150px 1fr; gap: 10px; }
.timeline li:last-child { border-bottom: 0; }
pre.json { background: #fbf9f8; border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; max-height: 420px; font-size: 12px; }
.temp-value { font-size: 22px; font-weight: 700; }
.temp-missing { font-size: 22px; font-weight: 700; color: var(--bad); }

.toast { position: sticky; top: 8px; z-index: 5; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.toast.error { background: var(--bad); }

.login { max-width: 420px; margin: 40px auto; }
.login .card { padding: 26px; }

dialog { border: 0; border-radius: 12px; padding: 0; max-width: min(640px, calc(100vw - 32px)); width: 100%; box-shadow: 0 20px 60px rgba(20, 3, 0, .25); }
dialog::backdrop { background: rgba(20, 3, 0, .35); }
dialog form { padding: 22px; display: grid; gap: 12px; }
#dialog-body { display: grid; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.foot { border-top: 1px solid var(--line); padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; gap: 20px; font-size: 13px; color: var(--muted); background: #fff; }
.foot strong { display: block; color: var(--ink); }
.foot .maker { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-decoration: none; color: var(--ink); }
.foot .maker img { width: 120px; height: auto; }
.foot .maker span { font-size: 11px; color: var(--muted); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .side .nav-label { display: none; }
  main { padding: 18px 16px 32px; }
  .top { padding: 12px 16px; flex-wrap: wrap; }
  .brand-sub { display: none; }
  .foot { flex-direction: column; align-items: flex-start; }
  .foot .maker { align-items: flex-start; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
}

.nav-count { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; text-align: center; margin-left: 4px; }
.matrix td.outdated { background: var(--warn-bg); }
.matrix td.cell { white-space: nowrap; font-size: 13px; }
.matrix th.pkg { white-space: normal; min-width: 140px; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--ink); }
.fault-active { color: var(--bad); font-weight: 700; }
.coord { border-left: 4px solid var(--red); }
.timeline .sub { display: block; font-size: 12px; color: var(--muted); }

/* Přihlašovací obrazovka: jen logo a formulář. */
body.is-login { background: #fff url("/admin/login-bg.svg") center / cover no-repeat fixed; }
body.is-login .top, body.is-login .foot, body.is-login .side { display: none; }
body.is-login .shell { display: block; max-width: none; }
body.is-login main { padding: 0; }
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; box-sizing: border-box; }
.login-box { width: 100%; max-width: 400px; text-align: center; }
.login-logo { display: block; width: 240px; max-width: 70%; height: auto; margin: 0 auto 28px; }
.login-box h1 { font-size: 20px; line-height: 1.4; font-weight: 700; margin: 0 0 24px; }
.login-box .note, .login-box .muted { text-align: left; margin: 0 0 12px; }
.login-form { display: grid; gap: 12px; }
.login-form input { width: 100%; box-sizing: border-box; min-height: 50px; padding: 12px 18px; border: 1px solid transparent; border-radius: 7px; background: #f4f1ee; font-size: 16px; }
.login-form input:focus { background: #fff; border-color: var(--red); outline: none; }
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
button.password-toggle, button.password-toggle:hover { position: absolute; top: 0; right: 0; width: 48px; height: 50px; min-height: 0; padding: 0; display: flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--muted); }
.login-form button[type="submit"] { justify-self: center; justify-content: center; text-align: center; min-width: 140px; min-height: 46px; margin-top: 12px; }

/* Nabídka účtu v hlavičce */
.account { position: relative; }
.account-button { display: flex; align-items: center; gap: 10px; background: none; color: var(--ink); border: 0; border-radius: 10px; padding: 5px 8px 5px 5px; min-height: 0; font-weight: 400; }
.account-button:hover, .account-button[aria-expanded="true"] { background: #f6f1ee; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; letter-spacing: .3px; }
.account-text { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.account-text strong { font-size: 14px; font-weight: 600; }
.account-text small { font-size: 12px; color: var(--muted); }
.account-menu { position: absolute; right: 0; top: calc(100% + 6px); width: 250px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(20, 3, 0, .14); padding: 6px; z-index: 50; display: grid; gap: 1px; }
.account-menu-head { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 5px; display: grid; gap: 2px; font-size: 14px; }
.account-menu-head span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.account-menu a, .account-menu button { display: block; width: 100%; box-sizing: border-box; text-align: left; padding: 9px 12px; border-radius: 8px; background: none; color: var(--ink); font-size: 14px; font-weight: 400; text-decoration: none; min-height: 0; border: 0; }
.account-menu a:hover, .account-menu button:hover { background: #f6f1ee; }
.data-switch { display: inline-flex; background: #f4f0ed; border-radius: 8px; padding: 3px; gap: 2px; }
.data-switch button, .data-switch button:hover { background: none; color: var(--muted); border: 0; border-radius: 6px; padding: 5px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.data-switch button:hover { color: var(--ink); }
.data-switch button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20, 3, 0, .12); }
.test-data .data-switch button[aria-pressed="true"] { background: #eda100; color: #241400; }
.data-banner { background: repeating-linear-gradient(135deg, #8f5f00, #8f5f00 12px, #a06c00 12px, #a06c00 24px); }
.account-menu .sign-out { color: var(--red-dark); }

/* Tabulky se stránkováním */
.dt-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.dt-bar input { flex: 1 1 260px; max-width: 420px; }
.dt-count { color: var(--muted); font-size: 13px; }
button.dt-sort, button.dt-sort:hover { background: none; color: inherit; padding: 0; min-height: 0; font: inherit; text-transform: inherit; letter-spacing: inherit; }
button.dt-sort:hover { color: var(--red-dark); }
.dt-filters th { background: #fff; padding: 6px 8px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.dt-filters input, .dt-filters select { width: 100%; min-width: 90px; min-height: 32px; padding: 4px 8px; font-size: 13px; box-sizing: border-box; }
.dt-dates { display: grid; gap: 4px; min-width: 130px; }
.dt-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; font-size: 13px; }
.dt-foot label { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.dt-foot select { min-height: 32px; padding: 2px 6px; }
.dt-pages { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.dt-pages button { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.dt-pages button[aria-current="page"] { background: var(--red); color: #fff; border-color: var(--red); }
.dt-gap { padding: 0 4px; color: var(--muted); }

/* Modální okna */
dialog.wide { max-width: min(860px, calc(100vw - 32px)); }
dialog form { max-height: calc(100vh - 64px); overflow-y: auto; box-sizing: border-box; }
.dialog-stack { display: grid; gap: 12px; }
dialog ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* Grafy */
.charts-head { margin: 20px 0 10px; }
.charts h3 { margin: 0 0 12px; font-size: 15px; }
.chart { width: 100%; overflow: hidden; }
.chart svg { display: block; }
.chart .axis { font-size: 11px; fill: var(--muted); }
.chart .grid-line { stroke: #efe9e5; stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-tip { position: fixed; z-index: 100; background: #1c1412; color: #fff; font-size: 12px; line-height: 1.45; padding: 6px 9px; border-radius: 6px; white-space: pre-line; pointer-events: none; max-width: 280px; }
.chart-table { margin-top: 8px; font-size: 13px; }
.bar-list { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { width: 100%; height: 10px; display: block; }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 600; }
.segmented { display: inline-flex; background: #f4f0ed; border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; margin-bottom: 8px; }
.segmented a { padding: 5px 12px; border-radius: 6px; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.segmented a[aria-current="page"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20, 3, 0, .12); }
.older { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 4px 0; font-size: 13px; }
.login-download { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; font-size: 14px; color: var(--muted); text-decoration: none; }
.login-download:hover { color: var(--red-dark); }
@media (max-width: 520px) { .account-text { display: none; } }
.dt td code { white-space: nowrap; }

/* Test pozic: nákres dvířek */
.door-zone { margin: 6px 0 16px; }
.door-zone h3 { margin: 0 0 8px; font-size: 15px; }
.door-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
button.door { flex: 0 1 76px; min-width: 60px; min-height: 54px; padding: 6px 4px; flex-direction: column; justify-content: center; gap: 1px;
  background: #fff; color: var(--ink); border: 1px solid #d7cbc6; border-radius: 8px; font-weight: 400; }
button.door strong { font-size: 15px; line-height: 1.1; }
button.door span { font-size: 11px; color: var(--muted); }
button.door:hover:not(:disabled) { background: #f4edeb; }
button.door:disabled { opacity: 1; cursor: default; }
.door-pending { background: var(--info-bg) !important; border-color: #b9cde6 !important; }
.door-board, .door-unknown { background: var(--warn-bg) !important; border-color: #ead29e !important; }
.door-opened { background: var(--ok-bg) !important; border-color: #b7d6b2 !important; }
.door-closed { background: var(--bad-bg) !important; border-color: #efc2c0 !important; }
.door-failed { background: #f4f0ed !important; }
.door-fault { background: var(--bad-bg) !important; border-color: #d98f8b !important; border-style: dashed !important; }
.door-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.door-key { font-size: 12px; padding: 3px 8px; border-radius: 6px; border: 1px solid #d7cbc6; background: #fff; }
.lift-zone .door-row { align-items: stretch; }
.row-label { flex: 0 0 64px; display: flex; align-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.jog-panel { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; margin: 6px 0 4px; }
.jog-pad { display: grid; grid-template-columns: repeat(3, 84px); grid-template-rows: repeat(3, 72px); gap: 6px; }
.jog-pad .jog-up { grid-column: 2; grid-row: 1; }
.jog-pad .jog-left { grid-column: 1; grid-row: 2; }
.jog-pad .jog-right { grid-column: 3; grid-row: 2; }
.jog-pad .jog-down { grid-column: 2; grid-row: 3; }
.jog-pad > span:not(.jog-center) { display: none; }
.jog-center { grid-column: 2; grid-row: 2; display: flex; align-items: center; justify-content: center; }
.jog-center label { font-size: 11px; color: var(--muted); text-align: center; display: grid; gap: 2px; }
.jog-center select { font-size: 13px; padding: 4px; }
button.jog { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; font-size: 26px; line-height: 1; padding: 4px;
  background: #fff; color: var(--ink); border: 1px solid #d7cbc6; border-radius: 8px; font-weight: 400; }
button.jog:hover:not(:disabled) { background: #f4edeb; }
button.jog span { font-size: 11px; color: var(--muted); font-weight: 600; }
button.jog:disabled { opacity: .45; }
.jog-side { flex: 1 1 240px; max-width: 420px; }
@media (max-width: 520px) { .row-label { flex-basis: 100%; } .jog-pad { grid-template-columns: repeat(3, 72px); grid-template-rows: repeat(3, 64px); } }
.split-tools { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.service-code { font-size: 44px; font-weight: 800; letter-spacing: 8px; text-align: center; margin: 8px 0 12px; font-variant-numeric: tabular-nums; }

/* Skutečné rozmístění dvířek (LOCKER_LAYOUTS v app.js). Šířka: M = 1,5 S, L = 2 M, XL = M. Výška v řádcích
   po polovině M (DOOR_ROWS): S = 3, M a L = 2, XL = 6, takže dvě S i jedno XL jsou vysoké jako tři M. */
.door-grid { display: grid; gap: 6px; grid-auto-rows: 22px; }
.door-grid button.door { min-width: 0; width: 100%; min-height: 0; height: 100%; }
.door-grid-g12 { grid-template-columns: repeat(12, minmax(0, 1fr)); max-width: 560px; }
.door-grid-g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 540px; }
.door-rows-2 { grid-row: span 2; }
.door-rows-3 { grid-row: span 3; }
.door-rows-6 { grid-row: span 6; }
.door-span-1 { grid-column: span 1; }
.door-span-2 { grid-column: span 2; }
.door-span-3 { grid-column: span 3; }
.door-span-4 { grid-column: span 4; }

button.door { position: relative; }
.door-size { position: absolute; top: 3px; right: 5px; font-size: 10px; font-style: normal; font-weight: 700; color: var(--muted); }
.door-grid button.door span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) {
  .door-grid { gap: 4px; }
  .door-grid button.door { padding: 6px 2px; }
  .door-grid button.door span { font-size: 9px; }
  .door-size { font-size: 8px; top: 2px; right: 3px; }
}

/* Pozice s otevřenou poruchou (záložka Poruchy) nebo pozice, kterou výrobce vede jako vadnou: svítí, ale z nákresu nemizí. */
button.door.door-faulty { background: #fde8e6 !important; border: 2px solid #d9342b !important; }
button.door .fault-tag { color: #b01b14; font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
button.door.door-faulty:disabled { cursor: not-allowed; }

/* SN výtah: přihrádka na láhev vína (LIFT_ART v app.js). Výška a šířka přihrádky odpovídá láhvi. */
.art-wine .door-row { gap: 8px; }
.art-wine button.door { flex: 0 0 72px; min-height: 150px; justify-content: flex-end; padding: 8px 4px 6px; }
.bottle { width: 26px; height: 78px; margin-bottom: 6px; flex: none; }
.bottle-glass { fill: #2f4a35; }
.bottle-cap { fill: #7a1f2b; }
.bottle-label { fill: #f3eee6; }
.bottle-dot { fill: #e2231a; }
.door-faulty .bottle-glass { fill: #8e8580; }
@media (max-width: 520px) { .art-wine button.door { flex-basis: 40px; min-height: 118px; } .bottle { width: 18px; height: 56px; } }

/* XY výtah: farmářské skleničky (např. polévky) stojí v patře vedle sebe na polici, řada se nezalamuje. */
.shelf { display: flex; flex: 1 1 0; min-width: 0; max-width: 720px; gap: 6px; padding-bottom: 4px; border-bottom: 4px solid #c9b8a6; border-radius: 0 0 2px 2px; }
.art-jar button.door { flex: 0 1 76px; min-width: 0; min-height: 112px; justify-content: flex-end; padding: 8px 3px 6px; }
.art-jar button.door span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jar { width: 40px; height: 48px; margin-bottom: 6px; flex: none; }
.jar-lid { fill: #b3261e; }
.jar-rim { fill: #7a1f2b; }
.jar-glass { fill: #e6ece9; stroke: #9fb3ad; stroke-width: 1.2; }
.jar-soup { fill: #d9822b; }
.jar-label { fill: #f3eee6; }
.jar-dot { fill: #e2231a; }
.door-faulty .jar-soup { fill: #b3aaa4; }
@media (max-width: 520px) {
  .shelf { flex-basis: 100%; gap: 3px; }
  .art-jar button.door { min-height: 92px; padding: 6px 1px 4px; }
  .art-jar button.door strong { font-size: 13px; }
  .art-jar button.door span { font-size: 8px; }
  .art-jar button.door .fault-tag { font-size: 8px; text-transform: none; letter-spacing: 0; overflow: visible; }
  .jar { width: 26px; height: 32px; margin-bottom: 4px; }
}

/* Odemčení nastavení tabletu (QR kód z FT Správce / FT Monitoru) */
.unlock-card { max-width: 560px; }
.unlock-card button { width: 100%; min-height: 48px; font-size: 17px; margin-top: 8px; }
.unlock-card code.challenge { font-size: 20px; letter-spacing: 2px; padding: 2px 8px; }
.unlock-code { font: 700 44px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 6px; text-align: center;
  padding: 14px 8px; margin: 10px 0; border-radius: var(--radius); background: var(--red-soft); color: var(--ink); }
@media (max-width: 520px) { .unlock-code { font-size: 36px; letter-spacing: 4px; } }
