/* Kunnossapito: the NBP apps' look (SafetyObservationBot / FactoryTraining): the green bar, green buttons, phone first */
:root {
  --bg: #ffffff; --text: #1f2328; --muted: #59636e; --line: #d1d9e0; --card: #f6f8fa; --field: #ffffff; --test-bg: #fdecec;
  --btn: #5f9e32; --error: #b42318; --warn: #9a6700; --stop: #b42318; --ok: #1a7f37;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1b1d21; --text: #e6e8eb; --muted: #9aa4af; --line: #3a3f46; --card: #23262b; --field: #24272c; --test-bg: #3a2224;
    --btn: #4a8a1f; --error: #ff8a80; --warn: #e3b341; --stop: #ff8a80; --ok: #7ee787; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif; }
body.test { background: var(--test-bg); }
main { max-width: 960px; margin: 0 auto; padding: 16px; }
h2 { font-size: 1.25rem; margin: 8px 0 12px; }
h3 { font-size: 1.05rem; margin: 22px 0 8px; }
a { color: inherit; text-decoration: none; }
.note { color: var(--muted); margin: 4px 0; }
.error { color: var(--error); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }
.foot { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 24px 8px; }

.banner { background: #8cc45a; color: #0f1a0f; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 20px; min-height: 64px; }
.banner .logo { display: inline-flex; align-items: center; background: #fff; border-radius: 10px; padding: 6px 12px; flex: none; }
.banner .logo img { height: 30px; width: auto; display: block; }
.banner h1 { margin: 0; font-size: 1.2rem; }
.banner .sp { flex: 1; }
.banner .who { font-weight: 600; }
.nav { display: flex; flex-wrap: wrap; gap: 6px; }
.nav a, .banner .help { min-height: 40px; padding: 8px 14px; border-radius: 10px; background: rgba(15, 26, 15, 0.12); color: #0f1a0f; text-decoration: none; display: inline-flex; align-items: center; }
.nav a.on { background: #fff; font-weight: 600; }
/* 0.18 (plan-0.18 §1): one Rekisteri menu; its pages each with an address */
.menu { position: relative; }
.menu-btn { min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 0; background: rgba(15, 26, 15, 0.12); color: #0f1a0f; font: inherit; cursor: pointer; }
.menu-btn.on { background: #fff; font-weight: 600; }
.menu-list { position: absolute; z-index: 30; top: calc(100% + 4px); right: 0; min-width: 220px; padding: 6px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.3); display: flex; flex-direction: column; }
.menu-list[hidden] { display: none; }
/* the menu sits in .nav: undo the bar's tinted tabs (a grey block per item in the light scheme) */
.menu-list a { min-height: 0; display: block; padding: 10px 12px; border-radius: 8px; background: none; color: var(--text); text-decoration: none; }
.menu-list a:hover, .menu-list a.on { background: var(--line); }
.menu-list a.on { font-weight: 600; }
.menu-edit:not(:empty) { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
/* narrow: the list spans the bar's width, right under the bar (the banner holds it; else it opened below the first screen) */
@media (max-width: 640px) { .banner { position: relative; } .menu { position: static; } .menu-list { left: 8px; right: 8px; } }
.edit-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 16px; background: #5c4a12; color: #fff6d8; font-size: 0.95em; }
.edit-bar[hidden] { display: none; }
.edit-bar.bad { background: #6b1f1f; color: #ffe3e3; }
.edit-bar .button { min-height: 32px; }
/* the field's machine picker (0.18 §2) */
.machine-field .chosen { margin: 4px 0; }
.machines-chosen { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.banner .help { width: 40px; justify-content: center; border-radius: 50%; padding: 0; font-weight: 700; }
@media (max-width: 640px) { .banner { padding: 8px 12px; } .banner .logo img { height: 24px; } .nav a { padding: 6px 10px; } main { padding: 12px; } }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--btn); border-radius: 6px;
  background: var(--btn); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.button.small { min-height: 36px; padding: 4px 12px; font-size: 0.95rem; }
.button.stop { background: var(--stop); border-color: var(--stop); }
.button:disabled { opacity: 0.55; cursor: default; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--btn); width: 20px; height: 20px; }

label.field { display: block; margin: 10px 0; }
label.field > span { display: block; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=search], input[type=number], input[type=date], input[type=url], input[type=tel], input[type=email], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--text); font: inherit; }
textarea { min-height: 90px; resize: vertical; }
label.check { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-weight: 600; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; text-decoration: none; display: block; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.2; }
.stat.alert b { color: var(--stop); }
.list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.list li { border-bottom: 1px solid var(--line); }
.list a.item, .list div.item { display: flex; gap: 10px; align-items: baseline; padding: 10px 4px; text-decoration: none; flex-wrap: wrap; }
.list .main { flex: 1 1 260px; min-width: 0; }
.list .meta { color: var(--muted); font-size: 0.9rem; }
.code { font-family: ui-monospace, Consolas, monospace; font-weight: 600; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 0.8rem; font-weight: 600; background: var(--card); border: 1px solid var(--line); white-space: nowrap; }
.badge.p1, .badge.stop { background: var(--stop); color: #fff; border-color: var(--stop); }
.badge.late { color: var(--warn); border-color: var(--warn); }
.badge.done { color: var(--ok); border-color: var(--ok); }
.badge.ready { color: #fff; background: var(--ok); border-color: var(--ok); }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { dl { grid-template-columns: 1fr; } dt { margin-top: 6px; } }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 10px 0; }
.crumbs { color: var(--muted); font-size: 0.9rem; margin-bottom: 4px; }
.tree { list-style: none; padding-left: 18px; margin: 0; }
.tree.top { padding-left: 0; }
.tree li { margin: 2px 0; }
.tree .toggle { width: 26px; height: 26px; border: 0; background: none; color: var(--text); cursor: pointer; font-size: 0.9rem; }
.tree .leaf { display: inline-block; width: 26px; }
.events { list-style: none; padding: 0; margin: 0; }
.events li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.files figure { margin: 0; border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: var(--card); }
.files img { width: 100%; height: 110px; object-fit: cover; border-radius: 4px; display: block; }
.files figcaption { font-size: 0.85rem; overflow-wrap: anywhere; }
.pdf { display: flex; align-items: center; justify-content: center; height: 110px; font-size: 2rem; }
.hits { list-style: none; padding: 0; margin: 4px 0; border: 1px solid var(--line); border-radius: 6px; max-height: 280px; overflow: auto; }
.hits li button { width: 100%; text-align: left; padding: 10px; border: 0; border-bottom: 1px solid var(--line); background: var(--field); color: var(--text); font: inherit; cursor: pointer; }
.chosen { padding: 10px; border: 2px solid var(--btn); border-radius: 6px; margin: 4px 0; }
.check-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.check-line .t { flex: 1 1 240px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.guide h3 { margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #1f2328; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 10; }

/* ---------- list and detail: Laitteet, Varaosat, Toimittajat (0.2.0, Hannu 25.11.2026) ---------- */
main:has(.md) { max-width: 1280px; }
.md { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.md-list { position: sticky; top: 8px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--bg); }
.md-list .rows { overflow: auto; flex: 1; margin: 0 -4px; }
.md-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* 0.18.2: a page's heading on the left, its buttons on the same line at the right (they wrap under it only when narrow) */
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.list-head h2 { margin: 0; }
.md-head-row .list-head { margin-bottom: 12px; }
.list-head .buttons { margin: 0; justify-content: flex-end; }
.md-head h2 { margin: 0; }
.md-detail { min-width: 0; }
.md-back { display: none; text-decoration: none; color: var(--muted); margin-bottom: 6px; }
.md-empty { border: 1px dashed var(--line); border-radius: 10px; padding: 40px 20px; text-align: center; }
@media (max-width: 800px) {
  .md { grid-template-columns: 1fr; }
  .md-list { position: static; max-height: none; }
  .md.has-detail .md-list { display: none; }
  .md:not(.has-detail) .md-detail { display: none; }
  .md-back { display: inline-block; }
}
.rows { display: flex; flex-direction: column; }
.r { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; text-decoration: none; color: inherit; min-height: 38px; }
a.r:hover, .r:has(.rl):hover { background: var(--card); }
.r.sel { background: var(--btn); color: #fff; }
.r.sel .code, .r.sel .meta { color: #fff; }
.r.static { border-bottom: 1px solid var(--line); border-radius: 0; }
.r .rl { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.r .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.r .meta, .meta { color: var(--muted); font-size: 0.88rem; }
.tog { width: 24px; height: 24px; border: 0; background: none; color: inherit; cursor: pointer; padding: 0; flex: none; font-size: 0.85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg);
  color: var(--text); font: inherit; font-size: 0.88rem; cursor: pointer; }
span.chip { cursor: default; background: var(--card); }
.chip.on { background: var(--btn); border-color: var(--btn); color: #fff; }
.chip.warn { border-color: var(--warn); color: var(--warn); }
.chip .n, .tabs .n { font-size: 0.78rem; opacity: 0.8; }
.head-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 4px 0 12px; background: var(--card); }
.head-card .title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.big { font-size: 1.3rem; font-weight: 600; }
.code.big { font-size: 1.1rem; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; color: var(--muted); font: inherit; padding: 10px 12px; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button.on { color: var(--text); border-bottom-color: var(--btn); font-weight: 600; }
.tabpanel { padding-top: 10px; }
h4 { font-size: 0.95rem; margin: 16px 0 6px; color: var(--muted); }
.kv { grid-template-columns: max-content 1fr; }
table.grid th { font-size: 0.88rem; }
table.grid a, .crumbs a { text-decoration: none; color: inherit; font-weight: 600; }
tr.click { cursor: pointer; }
tr.click:hover { background: var(--card); }
.list a.item { color: inherit; }
.events li { display: flex; gap: 10px; flex-wrap: wrap; padding: 5px 0; }
.events .when { color: var(--muted); font-size: 0.88rem; min-width: 150px; }
.chips.one-line { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chips.one-line .chip { flex: none; }
.prev-back { display: inline-block; text-decoration: none; color: var(--text); font-weight: 600; margin: 0 0 8px; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.linkbtn { border: 0; display: inline-flex; align-items: center; padding: 3px 11px; margin: 4px 0; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer;
  color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.linkbtn:hover { background: color-mix(in srgb, var(--ok) 26%, transparent); }
.browse { margin: 4px 0; }
.browse-head { margin: 4px 0; }
/* attachments (0.2.3): links as rows, choose-then-name, rename and delete in place */
.r .link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.r .link .nm { display: block; font-weight: 600; }
.r .link .meta { display: block; }
.r .link .ic { font-size: 1.2rem; }
.files figcaption .nm { margin: 4px 0; font-weight: 600; }
.files figcaption .button { margin: 2px 4px 0 0; }
.files figcaption input { width: 100%; margin: 2px 0; }
.confirm, .rename { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.confirm .q { font-weight: 600; }
.pending .pend { display: flex; align-items: flex-end; gap: 10px; margin: 6px 0; }
.pending .pend img, .pending .pend .pdf { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 2rem; border: 1px solid var(--line); }
.pending .pend .field { flex: 1; margin: 0; }
.adder { margin-top: 8px; }
/* fields as wide as their content (0.2.3) */
.row.fit { display: flex; flex-wrap: wrap; gap: 0 16px; }
.row.fit > .field { flex: none; }
select.w-s { width: 11em; }
input.w-date { width: 10.5em; }
select.w-name { width: 16em; max-width: 100%; }
.notok { display: inline-flex; }
.notok-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; width: 100%; margin-top: 4px; }
.notok-form input { flex: 1; min-width: 180px; }
.notok:has(.notok-form) { flex-basis: 100%; }
/* status steps and actions, waiting lines (0.2.3) */
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0 10px; }
.steps .step { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.steps .step.past { color: var(--text); }
.steps .step.on { background: var(--btn); border-color: var(--btn); color: #fff; font-weight: 600; }
.steps .step.cancel { background: var(--muted); border-color: var(--muted); }
.steps .sep { color: var(--muted); }
.status-actions { align-items: center; }
.status-actions .grow { flex: 1; }
.wait-form { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin: 8px 0; background: var(--card); }
.wait-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.wait-line .part-pick { width: 30em; max-width: 100%; }
.part-pick .hits { position: relative; }
.part-pick .chosen .button { margin-left: 8px; }
.wait-line input[type=text] { flex: 1; min-width: 180px; }
.wait-line input.w-qty { width: 6em; }
.r.arrived { opacity: 0.6; }
.wait-row { flex-wrap: wrap; }
.row-err:empty { display: none; }
.row-err { flex-basis: 100%; margin: 4px 0 0; }
.need-hint { flex-basis: 100%; }
.wait-row .queue { font-size: 0.85rem; margin-top: 2px; }
.need-hint:empty { display: none; }
.wait-row:has(.arrive-form) .arrive-form { flex-basis: 100%; }
.box.nudge { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Tilanne (0.2.3): the tiles filter, the links go elsewhere */
button.stat { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
button.stat.on { border: 2px solid var(--btn); padding: 9px 11px; box-shadow: inset 0 -3px 0 var(--btn); }
button.stat:disabled { opacity: 0.45; cursor: default; }
.go-links { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: -6px 0 10px; }
/* One look for "you can go there" inside text (Hannu 26.11.2026, 0.2.8): a chip, never an underline */
a.go, .go-links a { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 10px; font-weight: 600; text-decoration: none; white-space: nowrap;
  color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
a.go:hover, .go-links a:hover { background: color-mix(in srgb, var(--ok) 26%, transparent); }
.go-links a { padding: 3px 11px; }
.go-links a.alert { color: var(--stop); background: color-mix(in srgb, var(--stop) 12%, transparent); }
.go-links a.alert:hover { background: color-mix(in srgb, var(--stop) 22%, transparent); }
.list-title { margin: 14px 0 4px; }
/* Historia (0.2.3) */
.hist-filters .chips { margin: 4px 0; }
.hist-row { align-items: flex-start; border-bottom: 1px solid var(--line); border-radius: 0; }
.hist-row .when { flex: none; width: 7.5em; color: var(--muted); font-size: 0.88rem; padding-top: 2px; }
.hist-row .nm { white-space: normal; }
.hist-row .outcome { font-size: 0.9rem; margin-top: 2px; }
@media (max-width: 640px) { .hist-row { flex-wrap: wrap; } .hist-row .when { width: 100%; } }
/* roll-up views (0.3.0) */
.area-sum { margin: 6px 0; font-size: 0.9rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Rekisteri (0.4.1): the workbook's version against the register */
.warn-box { border: 1px solid var(--warn); color: var(--warn); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.stale-box { border: 2px solid var(--stop); background: color-mix(in srgb, var(--stop) 10%, transparent); border-radius: 8px; padding: 8px 14px; margin: 8px 0; }
.stale-box strong { color: var(--stop); }
.stale-box ul { margin: 4px 0 8px 18px; padding: 0; }
table.versions td { vertical-align: top; }
/* the workbook check's size table (0.4.2) */
table.size tr.same td { color: var(--muted); }
table.size tr.total td { font-weight: 600; border-top: 2px solid var(--muted); }
table.size td:nth-child(n+2), table.size th:nth-child(n+2) { text-align: right; }
table.size tr.total td[colspan] { text-align: center; }

/* the symptom under the order's title (0.5) */
.symptom { margin: -6px 0 8px; color: var(--muted); }
/* part rows (code, name, stock pill; finding 1 of 0.5): never squeezed by the list; on a phone the code and the pill on
   the first line, the whole name under them, wrapping normally */
.rows > .r { flex-shrink: 0; }
@media (max-width: 640px) {
  .r:has(> .code + .nm) { flex-wrap: wrap; align-items: baseline; row-gap: 0; }
  .r:has(> .code + .nm) > .code { order: 0; }
  .r:has(> .code + .nm) > .badge, .r:has(> .code + .nm) > .meta { order: 1; margin-left: auto; }
  .r:has(> .code + .nm) > .nm { order: 2; flex: 1 0 100%; overflow: visible; white-space: normal; overflow-wrap: anywhere; }
}
/* 0.5: the kiosk's picked name in the banner (plan-0.5, 8 L), the machine's downtime box, the hint under a toggle */
.banner .kiosk { display: inline-flex; align-items: center; gap: 6px; background: #fff; border-radius: 10px; padding: 4px 10px; }
.banner .kiosk select { min-height: 36px; }
.box.down { border-color: var(--stop); }
.box.down .buttons { margin-top: 8px; }
.note.hint { margin: -4px 0 10px; font-size: 0.9rem; }
/* the interface's deep link to one routine task (0.5): that task stands out */
.box.picked { border: 2px solid var(--btn); }

/* 0.6: the Suunnitelmat page (grouped by machine), headers inside a hit list, a plan's checklist */
.group-head { margin: 14px 0 4px; font-weight: 600; color: var(--muted); font-size: 0.9rem; }
.hits .hits-head { padding: 6px 10px; font-size: 0.85rem; font-weight: 600; color: var(--muted); background: var(--bg, transparent); border-bottom: 1px solid var(--line); }
.hits li button .meta { display: block; }
.plan-checklist { margin: 4px 0 8px; padding-left: 1.6em; }
.plan-checklist li { margin: 3px 0; }
/* 0.6.1: a spare part hit: the code and stock first, the name smaller below */
.part-lines .part-name { font-size: 0.88rem; margin-top: 2px; }
.hits li button .part-lines .meta { display: inline; }
.chosen .part-lines { display: inline-block; }

/* 0.7.0: a spare part's row everywhere: the code and the stock pill on top, the name smaller below (full width) */
.r.part-row { flex-direction: column; align-items: stretch; gap: 2px; }
.part-row .pr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.part-row .pr-right { flex: none; }
.part-row .pr-name { font-size: 0.88rem; color: var(--muted); }
.r.sel .pr-name { color: #fff; }

/* 0.8 (plan-0.8): QR stickers. The machine page from a sticker: the actions big on top */
.qr-actions .button { font-size: 1.05rem; padding: 12px 18px; }
.buttons.tight { margin: 0; gap: 6px; }
.qr-row { cursor: pointer; }
.qr-row input { margin: 0 4px 0 0; }
.qr-list { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
body.qr-go main { text-align: center; padding-top: 40px; }
/* one A4 sheet: 3 x 8 stickers of 70 x 37 mm (the first layout; changed when the factory has chosen its stickers) */
.qr-preview { overflow: auto; margin: 12px 0; }
.qr-preview .qr-page { outline: 1px solid var(--line); margin-bottom: 12px; }
.qr-page { width: 210mm; height: 296mm; display: grid; grid-template-columns: repeat(3, 70mm); grid-template-rows: repeat(8, 37mm); background: #fff; color: #000; }
.ql { display: flex; gap: 2.5mm; align-items: center; padding: 3mm; box-sizing: border-box; overflow: hidden; }
.ql-qr { flex: none; width: 28mm; height: 28mm; }
.ql-qr svg { width: 28mm; height: 28mm; display: block; }
.ql-txt { min-width: 0; display: flex; flex-direction: column; gap: 0.6mm; font-family: Arial, sans-serif; }
.ql-code { font-weight: 700; font-size: 11pt; overflow-wrap: anywhere; }
.ql-name { font-size: 8pt; line-height: 1.15; max-height: 3.6em; overflow: hidden; }
.ql-hint { font-size: 6.5pt; }
.ql-foot { font-size: 6pt; color: #555; }
#qr-print { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body.printing > *:not(#qr-print) { display: none !important; }
  body.printing #qr-print { display: block; }
  body.printing { background: #fff; }
  #qr-print .qr-page { break-after: page; }
}

/* 0.9: a round on several machines: one row per machine, ticked to sign some */
.round-parts { margin: 6px 0; }
.part-pick-row { cursor: pointer; }
.part-pick-row input { margin: 0 4px 0 0; }
.go-list { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; }

/* 0.10: a routine's work steps: safety first and marked, then tools, then the steps */
.steps { margin: 6px 0; font-size: 0.92rem; }
.steps ul, .steps ol { margin: 2px 0 6px; padding-left: 1.4em; }
.steps-safety { border-left: 3px solid var(--stop); padding-left: 8px; }

/* 0.11: editing steps on a plan */
.step-rows { margin: 6px 0; }
.step-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.step-row select { width: auto; flex: none; }
.step-row input[type=text] { width: auto; flex: 1 1 260px; min-width: 0; }
.step-row button { flex: none; }
@media (max-width: 640px) { .step-row input[type=text] { flex-basis: 100%; order: 5; } }
/* 0.12: a dropdown of tick boxes (Vuorot) */
.multi-pick { position: relative; }
/* 0.12.1: the chips and the place select on one line where they fit */
.place-row select.place-pick { display: block; width: 100%; margin: 6px 0 8px; min-height: 40px; }
.place-row .chip { white-space: nowrap; }
/* 0.12: edit boxes; the supplier's types as tick boxes */
.edit-box { margin: 10px 0; }
.ticks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.ticks label { display: flex; align-items: center; gap: 6px; min-height: 36px; cursor: pointer; }
.multi-pick > button.mp-head { width: 100%; min-height: 44px; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--text); font: inherit; cursor: pointer; }
.multi-pick .mp-list { position: absolute; z-index: 20; left: 0; right: 0; margin-top: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); box-shadow: 0 4px 14px rgba(0,0,0,.25); max-height: 340px; overflow: auto; }
.multi-pick .mp-list label { display: flex; align-items: center; gap: 8px; padding: 6px 4px; cursor: pointer; }
.multi-pick .mp-hint { margin-top: 2px; }

/* 0.32: production issues (plan-0.32): compact rows, a tap opens the details in place */
.list .issue-head { cursor: pointer; }
.list .issue-head:hover, .list .issue-head.on { background: rgba(127, 127, 127, 0.12); }
.issue-detail { padding: 4px 8px 12px 16px; border-left: 3px solid var(--line); margin: 0 0 8px 4px; }
.issue-text { margin: 6px 0; }
.issue-text p { margin: 2px 0 0; white-space: pre-wrap; }
.issue-notes { margin: 2px 0 0; padding-left: 18px; }
.issue-notes li { white-space: pre-wrap; }
.list-title.alert { color: var(--stop); }
/* 0.35: the plan form's result cards (Vuorossa / Työtilaus) */
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin: 4px 0 8px; }
.choice-card { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; cursor: pointer; }
.choice-card span { color: var(--muted); font-size: 0.88rem; }
.choice-card.on { border-color: var(--btn); box-shadow: inset 0 0 0 1px var(--btn); }
.line-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.line-row .nm { flex: 1 1 220px; }
/* 0.35.1: a plan in a list: the name on one line, the short timing under it */
.plan-row .nm b, .plan-row .nm .meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
