:root {
  --bg: #050D1C; --bg2: #071630; --text: #FFFFFF; --muted: #8FA6C4; --line: rgba(255,255,255,.10);
  --card: rgba(255,255,255,.06); --card2: rgba(255,255,255,.10);
  --cyan: #3FD0E0; --gold: #E2C48E; --blue: #2B6CB0; --green: #34D399; --amber: #FBBF24; --red: #F87171; --violet: #A78BFA;
  --hero: linear-gradient(135deg, #1B5299 0%, #0E3A6E 55%, #0A7C8C 100%);
  --cta: linear-gradient(135deg, #F0D9A8, #C9A66B); --cta-text: #1A1408;
  --shadow: 0 20px 50px rgba(0,0,0,.35); --blur: blur(18px);
  --r: 22px; --nav-h: 76px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #C3D1E1; --bg2: #D6E1ED; --text: #0A1626; --muted: #3E4F66; --line: rgba(10,22,38,.18);
  --card: #F4F7FB; --card2: #E3EAF3; --cyan: #0A7A8A; --gold: #8A6A35; --green: #0F8A5F; --amber: #B7791F; --red: #C53030; --violet: #6B46C1;
  --shadow: 0 6px 18px rgba(10,30,60,.18);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text);
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 60%); background-attachment: fixed;
  -webkit-font-smoothing: antialiased; overflow-wrap: anywhere;
}
[data-theme="light"] body { background: linear-gradient(180deg, #D6E1ED 0%, #BCCADB 100%); background-attachment: fixed; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cyan); }
.sea { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35; }
.g1 { width: 420px; height: 420px; background: #0A7C8C; top: -140px; right: -120px; }
.g2 { width: 360px; height: 360px; background: #1B5299; bottom: -160px; left: -120px; }
[data-theme="light"] .glow { opacity: .12; }
#root { position: relative; z-index: 1; min-height: 100vh; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; transform: scale(.94); } }

/* building blocks */
.glass { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow); }
[data-theme="light"] .glass { backdrop-filter: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--text); }
.btn:hover { border-color: var(--cyan); }
.btn.primary { background: var(--cta); color: var(--cta-text); border: 0; box-shadow: 0 8px 24px rgba(226,196,142,.25); }
.btn.cyan { background: linear-gradient(135deg, #3FD0E0, #2B6CB0); color: #04121F; border: 0; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.sm { min-height: 38px; padding: 0 14px; border-radius: 11px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 13px; color: var(--muted); font-weight: 500; }
.input { width: 100%; min-height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.05); outline: none; }
[data-theme="light"] .input { background: #FFFFFF; border-color: rgba(10,22,38,.28); }
.input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(63,208,224,.18); }
.muted { color: var(--muted); }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); font-weight: 700; }
.error { color: var(--red); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--card2); border: 1px solid var(--line); white-space: nowrap; }
.chip.active { color: var(--green); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.10); }
.chip.planned { color: var(--amber); border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.10); }
.chip.closed { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .box { width: 100%; max-width: 420px; padding: 34px 28px; }
.login-tools { position: fixed; top: 14px; right: 16px; display: flex; align-items: center; gap: 8px; z-index: 5; }
.login .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.login .logo img { width: 44px; height: 44px; }
.login .logo b { font-size: 18px; letter-spacing: .02em; }
.login h1 { font-size: 30px; line-height: 1.15; margin: 8px 0 6px; font-weight: 800; }
.login p { margin: 0 0 24px; }

/* picker / overview */
.page-pad { padding: 24px 20px calc(var(--nav-h) + 40px); max-width: 1100px; margin: 0 auto; }
.picker h1, .page h1 { font-size: 28px; font-weight: 800; margin: 6px 0 4px; }
.company { margin-top: 26px; }
.company h2 { font-size: 15px; color: var(--muted); font-weight: 600; margin: 0 0 12px; display: flex; gap: 10px; align-items: center; }
.vgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.vcard { text-align: left; padding: 18px; cursor: pointer; display: grid; gap: 10px; border: 1px solid var(--line); }
.vcard:hover { border-color: var(--cyan); transform: translateY(-1px); }
.vcard .top { display: flex; align-items: center; gap: 12px; }
.vcard .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--hero); font-size: 22px; flex: none; }
.vcard b { font-size: 17px; display: block; }

/* shell */
.shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 18px 10px; background: linear-gradient(180deg, var(--bg) 40%, transparent); }
[data-theme="light"] .topbar { background: linear-gradient(180deg, #D6E1ED 40%, transparent); }
.topbar .vessel { flex: 1; min-width: 0; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.topbar .vessel small { display: block; color: var(--muted); font-size: 12px; }
.topbar .vessel b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--cta); color: var(--cta-text); border: 0; cursor: pointer; flex: none; text-decoration: none; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); cursor: pointer; flex: none; font-size: 18px; text-decoration: none; color: var(--text); }
main.page { padding: 8px 18px calc(var(--nav-h) + 48px + env(safe-area-inset-bottom)); max-width: 1100px; margin: 0 auto; }

.bnav { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); height: var(--nav-h); display: flex; align-items: center; justify-content: space-around; padding: 0 6px; border-radius: 26px; background: rgba(7,22,48,.82); border: 1px solid var(--line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: 0 16px 40px rgba(0,0,0,.45); }
[data-theme="light"] .bnav { background: rgba(244,247,251,.96); border-color: rgba(10,22,38,.18); box-shadow: 0 10px 30px rgba(10,30,60,.25); }
.bnav a { flex: 1; min-width: 0; display: grid; justify-items: center; gap: 4px; padding: 8px 2px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; border-radius: 18px; }
.bnav a .i { font-size: 21px; line-height: 1; }
.bnav a span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bnav a.on { color: var(--cyan); }
.bnav a.on .i { filter: drop-shadow(0 0 8px var(--cyan)); }
.bnav a.fab { flex: none; width: 58px; height: 58px; margin-top: -30px; border-radius: 50%; padding: 0; align-content: center; background: var(--cta); color: var(--cta-text); box-shadow: 0 10px 26px rgba(226,196,142,.4); }
.bnav a.fab .i { font-size: 28px; }
.bnav a.fab span:last-child { display: none; }
.side { display: none; }

/* home */
.hero { position: relative; overflow: hidden; padding: 24px; border-radius: 26px; background: var(--hero); color: #fff; box-shadow: 0 24px 60px rgba(14,58,110,.45); }
.hero::after { content: ""; position: absolute; left: -10%; right: -10%; bottom: -60px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.07); }
.hero .eyebrow { color: #BFF6FC; }
.hero h1 { margin: 6px 0 6px; font-size: 26px; }
.hero p { margin: 0; color: rgba(255,255,255,.8); }
.hero .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; position: relative; z-index: 1; }
.hero .chip { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.2); color: #fff; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-top: 14px; }
.stat { padding: 16px; }
.stat small { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat b { display: block; font-size: 28px; font-weight: 800; margin-top: 4px; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 26px 0 12px; }
.section-title h2 { font-size: 18px; margin: 0; }
.actions { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.action { padding: 16px; display: grid; gap: 10px; text-decoration: none; color: var(--text); }
.action:hover { border-color: var(--cyan); }
.action .i { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; background: rgba(63,208,224,.12); }
.action b { font-size: 15px; }
.action small { color: var(--muted); font-size: 12px; }

/* lists */
.list { display: grid; gap: 10px; }
.item { padding: 16px; display: grid; gap: 10px; }
.item .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.item b { font-size: 16px; }
.item .meta { color: var(--muted); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; }
.item .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.person .avatar { width: 38px; height: 38px; font-size: 14px; background: var(--card2); color: var(--text); border: 1px solid var(--line); cursor: default; }
.person div { min-width: 0; }
.person small { display: block; color: var(--muted); font-size: 12px; }
.empty { text-align: center; padding: 34px 20px; }
.empty .i { font-size: 38px; }
.empty h3 { margin: 10px 0 6px; }
.empty p { margin: 0; color: var(--muted); }

/* sheet */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(2,6,14,.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: var(--bg2); border: 1px solid var(--line); }
.sheet h2 { margin: 0 0 16px; font-size: 22px; }
.check { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 8px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--cyan); }
.check small { color: var(--muted); display: block; font-size: 12px; }
.row2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }

/* profile & admin */
.admin-card { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 22px; text-decoration: none; color: #F4E4C1; background: linear-gradient(135deg, #2A2112, #0E0B06); border: 1px solid rgba(226,196,142,.35); box-shadow: 0 14px 34px rgba(0,0,0,.35); }
.admin-card .i { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--cta); color: var(--cta-text); font-size: 22px; flex: none; }
.admin-card b { display: block; color: #F0D9A8; font-size: 16px; }
.admin-card small { color: rgba(244,228,193,.7); }
.admin-card .go { margin-left: auto; font-size: 20px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--cyan); color: #04121F; }
.soon .i { font-size: 44px; }
.chip.home-dept { color: var(--cyan); border-color: rgba(63,208,224,.4); }
.side-group { margin: 14px 14px 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.side-sub { margin: 8px 14px 2px 22px; font-size: 12px; color: var(--muted); font-weight: 600; }
.side-sec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 0; border-radius: 8px; user-select: none; }
.side-sec > summary::-webkit-details-marker { display: none; }
.side-sec > summary::after { content: "›"; margin-left: auto; margin-right: 4px; font-size: 16px; transition: transform .15s; }
.side-sec[open] > summary::after { transform: rotate(90deg); }
.side-sec > summary:hover { color: var(--text, inherit); }
.side-sec.sub { margin-left: 8px; }
.side a.sub { padding-left: 30px; }
.sub-title { margin: 10px 2px 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--nav-h) + 30px); transform: translateX(-50%); padding: 12px 18px; border-radius: 14px; background: #0B1F3D; color: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 600; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 250px 1fr; }
  .bnav { display: none; }
  .bnav-only { display: none; }
  .side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; padding: 22px 14px; border-right: 1px solid var(--line); background: rgba(5,13,28,.5); backdrop-filter: var(--blur); }
  [data-theme="light"] .side { background: #AFC0D4; }
  .side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 800; }
  .side .brand img { width: 34px; height: 34px; }
  .side a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; color: var(--muted); text-decoration: none; font-weight: 600; }
  .side a:hover { background: var(--card); color: var(--text); }
  .side a.on { background: rgba(63,208,224,.12); color: var(--cyan); }
  .side .i { font-size: 18px; width: 22px; text-align: center; }
  .side .spacer { flex: 1; }
  main.page { padding: 8px 32px 48px; width: 100%; }
  .topbar { padding: 18px 32px 10px; }
  .grid2 { grid-template-columns: repeat(4, 1fr); }
  .sheet-bg { align-items: center; }
  .sheet { border-radius: 26px; }
  .toast { bottom: 30px; }
}

/* Hauls */
.haul-start { min-height: 72px; font-size: 20px; border-radius: 18px; margin-bottom: 16px; }
.haul-live { border: 1px solid var(--cyan); }
.kg { color: var(--gold, #E2C48E); font-weight: 700; white-space: nowrap; }
.est-row { display: grid; grid-template-columns: 1fr 110px 44px; gap: 8px; margin-bottom: 8px; align-items: center; }
.pos-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.pos-src-slot:empty { display: none; }
.chip.pos-src { font-size: 10px; padding: 1px 6px; font-weight: 700; letter-spacing: .04em; vertical-align: middle; }
.chip.pos-src.ais { color: #34D399; border-color: #34D399; }
.chip.pos-src.gps { color: var(--gold, #E2C48E); border-color: var(--gold, #E2C48E); }
.ais-now { margin: 4px 0 10px; font-size: 13px; }
.haul-code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--cyan); margin-left: 6px; }

/* Catch registration: big touch targets for the factory screen */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { min-height: 64px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; text-align: left; display: flex; flex-direction: column; justify-content: center; gap: 3px; font: inherit; touch-action: manipulation; }
.tile b { font-size: 16px; }
.tile small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.on { border-color: var(--cyan); background: rgba(63,208,224,.16); box-shadow: 0 0 0 1px var(--cyan) inset; }
.tile.on small { color: var(--cyan); }
.haul-tiles .tile small { font-family: ui-monospace, Consolas, monospace; }
.reg-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.reg-row > select { flex: 1 1 180px; min-height: 56px; }
.seg.big button { padding: 12px 18px; font-size: 15px; min-height: 44px; }
.reg-qty { padding: 16px; margin-bottom: 8px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .btn { min-height: 64px; min-width: 64px; font-size: 26px; padding: 0 10px; }
.stepper .input { flex: 1; min-width: 90px; }
.stepper .btn[data-step="10"] { font-size: 18px; }
.stepper .input, .big-num { min-height: 64px; font-size: 28px; font-weight: 700; text-align: center; }
.calc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.calc div { background: var(--card2); border-radius: 12px; padding: 10px; }
.calc small { display: block; color: var(--muted); font-size: 12px; }
.calc b { font-size: 18px; white-space: nowrap; }
.calc div:last-child b { color: var(--gold); }
.reg-add { min-height: 56px; flex: 1 1 180px; font-size: 17px; }
.species-sum { padding: 6px 14px; }
.species-sum div { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1.1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: center; }
.species-sum div:last-child { border-bottom: 0; }
.species-sum span { text-align: right; white-space: nowrap; }
.species-sum .ss-head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 0; }
.species-sum .ss-head b { font-weight: 600; }
.log-hsum { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; justify-content: flex-end; }
.log-hsum small { color: var(--muted); font-size: 12px; }
.gold { color: var(--gold); }
.prod.off { opacity: .55; }
@media (max-width: 520px) {
  .species-sum div { grid-template-columns: 1.3fr 1fr 1fr; }
  .species-sum div span:nth-child(2), .species-sum div span:nth-child(5) { display: none; }
  .calc b { font-size: 15px; }
}.tile.more { border-style: dashed; color: var(--cyan); }

/* ---------- freezers ---------- */
.frz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.frz { --c: var(--muted); padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-align: left; font: inherit; cursor: pointer; touch-action: manipulation; display: flex; flex-direction: column; gap: 6px; min-height: 124px; }
.frz.filling { --c: var(--amber); } .frz.freezing { --c: var(--cyan); } .frz.ready { --c: var(--green); }
.frz.on { border-color: var(--c); box-shadow: 0 0 0 2px var(--c) inset; }
.frz-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.frz-st { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c); }
.frz-big { font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--c); }
.frz-big small { font-size: 15px; color: var(--muted); font-weight: 600; }
.frz .bar { height: 6px; border-radius: 99px; background: var(--card2); overflow: hidden; }
.frz .bar i { display: block; height: 100%; background: var(--c); border-radius: 99px; }
.frz-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frz.ready .frz-big { animation: frzPulse 1.6s ease-in-out infinite; }
@keyframes frzPulse { 50% { opacity: .45; } }
.frz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 2px; font-size: 13px; color: var(--muted); }
.frz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.frz-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--muted); }
.frz-legend .filling i { background: var(--amber); } .frz-legend .freezing i { background: var(--cyan); } .frz-legend .ready i { background: var(--green); }
.frz-note { font-size: 12px; margin: -6px 0 14px; }
.frz-st { white-space: nowrap; flex: none; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--c) 16%, transparent); }
.fp { position: relative; display: flex; align-items: stretch; padding: 5px 0 5px 5px; border-radius: 10px; background: linear-gradient(90deg, #3a4552, #2a323c); border: 2px solid #56616e; }
.fp-in { flex: 1; display: flex; gap: 1px; min-width: 0; }
.fp.from-right .fp-in { flex-direction: row-reverse; }
.fp-col { flex: 1; display: grid; grid-template-rows: 1fr 1fr; gap: 2px; padding: 0 1px; border-right: 1px solid #6b7785; min-width: 0; }
.fp.from-right .fp-col { border-right: 0; border-left: 1px solid #6b7785; }
.fp-col i.fp-full { grid-row: 1 / 3; height: auto; }
.fp-col i { height: 22px; border-radius: 3px; background: rgba(255,255,255,.06); border: 1px dashed rgba(255,255,255,.12); }
.fp-col i.fp-b { background: var(--b); border: 1px solid rgba(0,0,0,.25); }
.fp-col i.fp-x { visibility: hidden; }
.fp.freezing { background: linear-gradient(90deg, #2c5068, #1f3a4d); border-color: #6fb6d8; }
.fp.freezing .fp-b { filter: saturate(.55) brightness(1.08); box-shadow: inset 0 0 0 2px rgba(220,245,255,.55); }
.fp-snow { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #dff4ff; font-size: 26px; text-shadow: 0 0 6px #6fb6d8; }
.fp-hyd { flex: none; width: 12px; margin: -5px 0 -5px 5px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 8px 0; background: #56616e; border-radius: 0 8px 8px 0; }
.fp-hyd i { width: 10px; height: 10px; border-radius: 50%; background: #8996a4; }
.frz-foot { display: flex; align-items: flex-end; gap: 10px; }
.frz-foot .frz-big { flex: none; }
.frz-meter { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.frz-meter small { color: var(--muted); font-size: 11px; }.frz-detail { padding: 16px; margin-bottom: 16px; }
.frz-back { margin: 0 0 10px; }
.frz-step { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.frz-step .pick-by { margin-left: auto; }
.gdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.frz-step .btn { color: var(--cyan); font-weight: 700; }
.sp-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.15); }
.sp-colors { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sp-colors button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.sp-colors button.on { border-color: #fff; box-shadow: 0 0 0 2px var(--cyan); }
.frz-chip.filling { color: var(--amber); } .frz-chip.freezing { color: var(--cyan); } .frz-chip.ready { color: var(--green); }
.frz-line { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); flex-wrap: wrap; }
.frz-line .grow { flex: 1; min-width: 140px; }
.frz-line .seq { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--card2); font-weight: 700; font-size: 13px; flex: none; }
.frz-line.annulled, .frz-line.cancelled { opacity: .5; } .frz-line.annulled b, .frz-line.cancelled b { text-decoration: line-through; }
.frz-line.printed .seq { color: var(--green); }
.frz-line .btns { display: flex; gap: 6px; flex-wrap: wrap; }
.frz-actions { margin-top: 14px; align-items: flex-end; }
.frz-settings { margin-top: 14px; } .frz-settings summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 6px 0; }.frz-line .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- label printing ---------- */
.prn-next { padding: 16px; margin-bottom: 16px; }
.prn-preview { background: repeating-conic-gradient(rgba(255,255,255,.04) 0 25%, transparent 0 50%) 0 0 / 16px 16px; border-radius: 14px; padding: 14px; overflow: auto; display: flex; justify-content: center; }
.prn-preview .lbl { box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.prn-confirm { margin-top: 14px; padding: 14px; border-radius: 14px; border: 1px solid var(--amber); background: rgba(251,191,36,.08); display: grid; gap: 10px; }
.prn-auto { display: flex; gap: 8px; align-items: center; margin-top: 12px; color: var(--muted); font-size: 13px; }
.frz-line[data-sel] { cursor: pointer; } .frz-line.on { border-color: var(--cyan); }
.lbl { box-sizing: border-box; background: #fff; color: #000; font-family: Arial, Helvetica, sans-serif; line-height: 1.15; padding: 3mm; display: flex; flex-direction: column; gap: 1.2mm; overflow: hidden; flex: none; }
.lbl small { display: block; font-size: .62em; text-transform: uppercase; letter-spacing: .02em; color: #000; }
.lbl .l-top { display: flex; justify-content: space-between; align-items: center; gap: 2mm; border-bottom: .4mm solid #000; padding-bottom: 1mm; }
.lbl .l-ap { border: .4mm solid #000; border-radius: 50%; padding: .5mm 2mm; font-weight: 700; font-size: .85em; white-space: nowrap; }
.lbl .l-sp { font-size: 1.15em; } .lbl .l-sp b { font-size: 1.5em; } .lbl .l-sp div { font-size: .8em; }
.lbl .l-big { display: grid; grid-template-columns: 1fr 1fr; gap: 2mm; } .lbl .l-big b { font-size: 1.9em; display: block; }
.lbl .l-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1mm 2mm; border-top: .3mm solid #000; padding-top: 1mm; } .lbl .l-grid b { font-size: 1.05em; }
.lbl .l-txt { font-size: .72em; flex: 1; min-height: 0; overflow: hidden; }
.lbl .l-bcw { text-align: center; } .lbl .l-bc { display: block; width: 100%; height: 12mm; } .lbl .l-hr { font-size: .7em; font-family: "Courier New", monospace; margin-top: .5mm; }
.lbl .l-foot { display: flex; justify-content: space-between; font-size: .7em; border-top: .3mm solid #000; padding-top: .8mm; }
#printArea { display: none; }
@media print {
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing #printArea { display: block; }
  #printArea .lbl { page-break-after: always; break-after: page; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}@media print { body.printing::before, body.printing::after { display: none !important; } }

.lbl .l-a, .lbl .l-b { display: contents; }
.lbl.land { flex-direction: row; gap: 3mm; }
.lbl.land .l-a, .lbl.land .l-b { display: flex; flex-direction: column; gap: 1.2mm; flex: 1; min-width: 0; }
.lbl.land .l-b { border-left: .3mm solid #000; padding-left: 3mm; }
.lbl-page { position: relative; overflow: hidden; page-break-after: always; break-after: page; }
.lbl-page .lbl { position: absolute; top: 0; left: 0; transform-origin: 0 0; transform: rotate(90deg) translateY(-100%); page-break-after: auto; break-after: auto; }
.prn-preview { justify-content: flex-start !important; } .prn-preview > * { margin: 0 auto; flex: none; }
.chip.q-b { color: var(--amber); border-color: rgba(251,191,36,.45); background: rgba(251,191,36,.12); padding: 1px 7px; margin-left: 4px; font-size: 11px; }

/* IPC / station screens: menu as big tabs in the top bar, larger touch targets */
.topnav { display: none; }
.ipc { display: block !important; }
.ipc .side, .ipc .bnav { display: none !important; }
.ipc .topbar { flex-wrap: wrap; padding: 12px 24px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
[data-theme="light"] .ipc .topbar { background: #D6E1ED; }
.ipc .topbar .vessel b { font-size: 20px; }
.ipc .icon-btn, .ipc .avatar { width: 56px; height: 56px; font-size: 24px; }
.ipc .topnav { order: 10; flex-basis: 100%; display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-top: 4px; }
.ipc .topnav::-webkit-scrollbar { display: none; }
.ipc .topnav a { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; padding: 0 22px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 19px; font-weight: 700; white-space: nowrap; touch-action: manipulation; }
.ipc .topnav a .i { font-size: 24px; }
.ipc .topnav a.on { background: var(--cyan); border-color: var(--cyan); color: #04121F; }
.ipc main.page { max-width: none; padding: 16px 24px 40px; }
.ipc .section-title h2 { font-size: 22px; }
.ipc .btn { min-height: 60px; padding: 0 24px; font-size: 18px; border-radius: 16px; }
.ipc .btn.sm { min-height: 50px; padding: 0 18px; font-size: 16px; }
.ipc .input { min-height: 60px; font-size: 18px; }
.ipc .seg button { padding: 14px 20px; font-size: 17px; }
.ipc .chip { font-size: 15px; padding: 6px 12px; }
.ipc .tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.ipc .tile { min-height: 100px; padding: 14px 18px; font-size: 18px; border-radius: 18px; }
.ipc .tile b { font-size: 21px; }
.ipc .item { padding: 22px; }
.ipc .item b { font-size: 19px; }
.ipc .item .meta { font-size: 15px; }
.ipc .frz-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ipc .fp-col i { height: 30px; }
.ipc .frz-line { padding: 16px 18px; font-size: 17px; }
.ipc .frz-line b { font-size: 18px; }
.ipc .frz-line .seq { width: 40px; height: 40px; font-size: 16px; }
.ipc .stepper .btn { min-height: 76px; min-width: 76px; }
.ipc .stepper .input, .ipc .big-num { min-height: 76px; font-size: 32px; }
.ipc .sheet { max-width: 760px; }
/* On-screen numpad (IPC) */
.numpad-bg { position: fixed; inset: 0; z-index: 1000; background: rgba(2, 10, 20, .55); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.numpad { width: 100%; max-width: 460px; padding: 18px; border-radius: 24px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.numpad-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.numpad-head .muted { font-size: 16px; }
.numpad-val { display: block; text-align: right; font-size: 44px; font-weight: 800; padding: 10px 18px; border-radius: 16px; background: var(--card); border: 2px solid var(--cyan); min-height: 74px; font-variant-numeric: tabular-nums; }
.numpad-val.fresh { color: var(--muted, #8aa); }
.numpad-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.numpad-keys button, .numpad-foot .btn { min-height: 76px; border-radius: 16px; font-size: 30px; font-weight: 700; touch-action: manipulation; user-select: none; }
.numpad-keys button { background: var(--card); border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.numpad-keys button:active { background: var(--cyan); color: #04121F; }
.numpad-foot { display: flex; gap: 10px; margin-top: 12px; }
.numpad-foot .btn { flex: 1; font-size: 22px; }
.numpad-foot .btn.primary { flex: 2; }
.ipc input.input[type="number"] { caret-color: transparent; cursor: pointer; }
/* IPC: drop the vessel name + page title header to save screen space (menu already shows where you are) */
.ipc main.page .section-title > div > .eyebrow, .ipc main.page .section-title > div > h1 { display: none; }
.ipc main.page .section-title:has(> div > h1) { margin: 0 0 8px !important; justify-content: flex-end; }
.ipc main.page .section-title:has(> div > h1):not(:has(.btns > *, > a, > button, > .chip)) { display: none; }
/* IPC compact: one-row top bar (menu inline), tighter spacing so the cards fit without scrolling */
.ipc .topbar { flex-wrap: nowrap; gap: 10px; padding: 8px 14px; position: sticky; top: 0; z-index: 20; }
.ipc .topbar .vessel { flex: 0 0 auto; }
.ipc .topbar .vessel small { display: none; }
.ipc .topbar .vessel b { font-size: 18px; }
.ipc .topnav { order: 0; flex: 1 1 auto; flex-basis: auto; padding-top: 0; gap: 8px; min-width: 0; }
.ipc .topnav a { min-height: 56px; padding: 0 16px; font-size: 17px; }
.ipc .icon-btn, .ipc .avatar { width: 50px; height: 50px; font-size: 22px; flex: 0 0 auto; }
.ipc .topbar > .icon-btn, .ipc .topbar > .avatar { order: 1; }
.ipc main.page { padding: 10px 14px 20px; }
.ipc main.page .section-title { margin: 8px 0 6px; }
.ipc main.page .section-title h2 { font-size: 19px; margin: 0; }
.ipc main.page p.muted { margin: 2px 0 6px; font-size: 14px; }
.ipc main.page .glass, .ipc main.page section { margin-top: 0; }
.ipc .tiles { gap: 10px; }
.ipc .tile { min-height: 84px; padding: 10px 14px; }
.ipc .frz-grid { gap: 10px; }
.ipc .item { padding: 14px 18px; }
.ipc .field { margin-bottom: 8px; }
.ipc .topbar .vessel .ipc-logo { display: block; height: 46px; width: auto; }
.ipc .topbar .vessel { padding: 2px 6px; background: none; border: 0; }
/* IPC: big species/size cards that fill the width */
.ipc .tiles { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.ipc .tile { min-height: 128px; padding: 14px 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.ipc .tile b { font-size: 30px; line-height: 1.1; }
.ipc .tile small { font-size: 17px; }
.ipc .frz-step .btn { min-height: 64px; font-size: 20px; }
.ipc .field > span { font-size: 17px; }
.ipc .seg.big button { min-height: 70px; padding: 0 34px; font-size: 22px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 52px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; opacity: .6; }
.pw-eye.on { opacity: 1; color: var(--cyan); }
input[type=password]::-ms-reveal { display: none; }

.cat-new { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.pg-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.chip.pg { cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }
.chip.pg.off { opacity: .5; }
.chip.pg .gdot { margin-right: 4px; }

/* Product number badge on picker tiles */
.tile .pno{display:inline-block;align-self:flex-start;margin-bottom:4px;padding:2px 9px;border-radius:8px;background:var(--accent,#3dd2e0);color:#04202a;font-weight:800;font-size:17px;letter-spacing:.3px;line-height:1.3}
.tile.on .pno{background:#fff;color:#04202a}

/* Freezer: chosen quality and resulting product number */
.frz-qual{align-items:flex-end;gap:16px;flex-wrap:wrap}
.frz-pno{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.frz-pno .pno{margin:0;font-size:22px;padding:4px 12px}

.haul-mode { padding: 14px 16px; margin-bottom: 14px; }
.haul-prod { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line, rgba(255,255,255,.08)); }
.prod-rows { display: grid; gap: 10px; margin: 12px 0; }
.prod-row { padding: 10px 12px; }
.prod-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prod-head small { color: var(--muted); }
.prod-head .kg { margin-left: auto; }
.prod-edit { display: grid; grid-template-columns: 1fr 110px 130px auto; gap: 8px; margin-top: 8px; align-items: center; }
.prod-qty { display: flex; align-items: center; gap: 6px; }
.prod-qty small { color: var(--muted); }
@media (max-width: 640px) { .prod-edit { grid-template-columns: 1fr 1fr; } .prod-edit select[name=product] { grid-column: 1 / -1; } }

.utc-clock { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.05; padding: 4px 10px; border-radius: 10px; background: rgba(34,211,238,.08); border: 1px solid rgba(34,211,238,.25); font-variant-numeric: tabular-nums; }
.utc-clock small { font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.utc-clock b { font-size: 16px; color: var(--cyan, #22d3ee); }
.haul-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.haul-mode-grid p { margin: 8px 0 0; }
@media (max-width: 700px) { .haul-mode-grid { grid-template-columns: 1fr; } }
.chip.closed { background: rgba(52,211,153,.15); color: #34D399; }
.chip.prod { background: rgba(251,191,36,.15); color: #FBBF24; }
.prn-card { width: 100%; display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin: 4px 0 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--bg2); color: inherit; font: inherit; text-align: left; cursor: pointer; flex-wrap: wrap; }
.prn-card:hover { border-color: var(--accent, #2dd4e6); }
.prn-card .grow { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; }
.prn-card .grow b { font-size: 20px; }
.prn-card .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 14px; }
.prn-card-no { min-width: 96px; padding: 10px 14px; border-radius: 14px; background: #000; color: #fff; font-size: 34px; font-weight: 800; text-align: center; letter-spacing: .02em; }
.prn-card-n { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.prn-card-n b { font-size: 28px; }
.prn-card-n small { color: var(--muted); }
.prn-card-eye { font-size: 13px; color: var(--muted); }
.prn-sheet { max-width: 900px; }
.pal-add { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--accent, #2dd4e6); background: var(--bg2); }
.pal-add .grow { flex: 1; min-width: 160px; font-size: 18px; }

/* ---------- reports ---------- */
.rep-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin: 4px 0 10px; }
.rep-bar .btns { display: flex; gap: 6px; }
.rep-dl { position: relative; }
.rep-dl > summary { list-style: none; cursor: pointer; }
.rep-dl > summary::-webkit-details-marker { display: none; }
.rep-dl-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 130px; display: flex; flex-direction: column; padding: 6px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.rep-dl-menu button { text-align: left; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.rep-dl-menu button:hover, .rep-dl-menu button:focus-visible { background: var(--card2); }
.rep-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 10px; }
.rep-stats > div { padding: 10px 12px; }
.rep-stats small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.rep-stats b { font-size: 20px; font-weight: 800; white-space: nowrap; }
.rep-cols { display: grid; gap: 12px; }
@media (min-width: 900px) { .rep-cols { grid-template-columns: 1fr 1.3fr; align-items: start; } }
.rep-h { font-size: 15px; margin: 6px 0; }
.rep-wrap { padding: 4px 10px; overflow-x: auto; }
table.rep { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rep th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.rep td { padding: 7px 6px; border-bottom: 1px solid var(--line); }
table.rep .n { text-align: right; white-space: nowrap; }
table.rep tfoot td { font-weight: 800; border-bottom: 0; }
table.rep a { color: var(--cyan); text-decoration: none; }
.rep-days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.rep-days .chip { cursor: pointer; white-space: nowrap; border: 1px solid var(--line); font: inherit; font-size: 13px; }
.rep-days .chip.on { background: var(--cyan); color: #04121F; }
.rep-est details { border-bottom: 1px solid var(--line); }
.rep-est details:last-child { border-bottom: 0; }
.rep-est summary { display: grid; grid-template-columns: var(--estc, 64px 1fr 1fr 1fr 1.4fr); gap: 8px; align-items: center; padding: 10px 2px; cursor: pointer; font-size: 14px; list-style: none; }
.rep-est summary > span { text-align: right; white-space: nowrap; }
.rep-est-h { display: grid; grid-template-columns: var(--estc, 64px 1fr 1fr 1fr 1.4fr); gap: 8px; padding: 8px 2px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; }
.rep-est-h span:nth-child(n+3) { text-align: right; }
.rep-est details .rep-wrap { background: none; box-shadow: none; border: 0; padding: 0 0 8px; }
.ok { color: var(--green); } .neg { color: #F87171; } .pos { color: var(--gold); }
@media (max-width: 600px) {
  .hide-s { display: none; }
  table.rep { font-size: 13px; }
  .rep-est summary, .rep-est-h { grid-template-columns: var(--estcs, 56px 1fr 1fr 1.3fr); font-size: 13px; }
  .rep-stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .rep-stats > div { padding: 8px 10px; border-radius: 14px; }
  .rep-stats b { font-size: 15px; }
  .rep-stats small { font-size: 11px; }
  .rep-bar .seg button { padding: 7px 9px; }
}
#printArea .rep-print { color: #000; font: 11pt/1.35 system-ui, sans-serif; }
#printArea .rep-print h1 { font-size: 16pt; margin: 0 0 2mm; } #printArea .rep-print > p { margin: 0 0 4mm; font-size: 9pt; }
#printArea .rep-print .glass { background: none !important; border: 0 !important; box-shadow: none !important; color: #000; }
#printArea .rep-print * { color: #000 !important; }
#printArea .rep-print .rep-stats { grid-template-columns: repeat(5, 1fr); }
#printArea .rep-print table.rep th, #printArea .rep-print table.rep td { border-bottom: .2mm solid #999; padding: 1.2mm 1.5mm; }
#printArea .rep-print .hide-s { display: table-cell; }
#printArea .rep-print .rep-cols { grid-template-columns: 1fr; }

/* Packaging */
.pk-top { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pk-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; }
.pk-card.low { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.pk-name { font-weight: 700; line-height: 1.2; }
.pk-qty { font-size: 26px; line-height: 1.1; } .pk-qty small { font-size: 13px; font-weight: 500; opacity: .7; }
.pk-card .input { margin-top: 4px; font-size: 18px; }
.pk-low { background: rgba(248,113,113,.18); color: var(--red); }
.pk-warn { padding: 10px 14px; border-radius: 12px; margin-bottom: 10px; color: var(--red); font-weight: 600; }
.pk-moves { margin-top: 12px; padding: 10px 14px; border-radius: 14px; } .pk-moves summary { cursor: pointer; font-weight: 700; }
.pk-mlist { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 320px; overflow: auto; }
.pk-mlist > div { display: grid; grid-template-columns: 70px 1fr; column-gap: 8px; align-items: baseline; }
.pk-mlist > div > span { font-weight: 700; text-align: right; grid-row: span 2; }
.pk-type, .pk-link { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 10px 12px; border-radius: 14px; }
.pk-type .field, .pk-link .field { margin: 0; flex: 1 1 150px; } .pk-type .field.sm, .pk-link .field.sm { flex: 0 1 90px; }
.pk-chk input { width: 22px; height: 22px; margin: 8px 0; }
.pk-link .grow { flex: 1 1 160px; align-self: center; }
.pk-link { padding: 8px 12px; } .pk-link .field > span { font-size: 12px; } .pk-link .input, .pk-type .input { padding-top: 8px; padding-bottom: 8px; }
@media (max-width: 520px) { .pk-grid { grid-template-columns: 1fr 1fr; } .pk-qty { font-size: 22px; } }
/* Grading (tanks after the grader) */
.gr-trip { margin: 0 0 10px; }
.gr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.gr-tank { --c: var(--cyan); display: flex; flex-direction: column; gap: 4px; align-items: stretch; text-align: left; padding: 10px 12px; border-radius: 14px; color: inherit; font: inherit; cursor: pointer; min-height: 92px; }
.gr-tank.free { opacity: .55; cursor: default; }
.gr-tank.used { border-color: var(--c); }
.gr-tank.full { border-color: var(--c); box-shadow: inset 0 0 0 2px var(--c); }
.gr-tank.hit { outline: 3px solid var(--green); outline-offset: 1px; }
.gr-no { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.gr-gr { font-size: 15px; line-height: 1.2; min-height: 18px; }
.gr-bar { display: block; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.gr-bar i { display: block; height: 100%; background: var(--c); border-radius: 99px; }
.chip.gr-full { padding: 1px 7px; font-size: 11px; color: var(--red); border-color: rgba(248,113,113,.45); background: rgba(248,113,113,.14); }
.gr-reg { padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; }
.gr-last { color: var(--green); margin-bottom: 8px; font-size: 14px; }
.gr-grades { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.gr-grades .chip { --c: var(--cyan); cursor: pointer; font-size: 14px; padding: 8px 14px; }
.gr-grades .chip.on { background: var(--c); border-color: var(--c); color: #04121F; }
.gr-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.gr-row .field { margin: 0; flex: 1 1 110px; }
.gr-row .input { font-size: 20px; }
.gr-row .btn { flex: 1 1 120px; min-height: 48px; }
.gr-avg { display: block; font-size: 20px; padding: 10px 0; }
.gr-set { padding: 12px 14px; border-radius: 14px; }
.gr-set > .gr-row { margin-bottom: 10px; }
.gr-caps { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.gr-caps .field { margin: 0; } .gr-caps .field > span { font-size: 12px; } .gr-caps .input { padding-top: 8px; padding-bottom: 8px; }
.gr-route { padding: 10px 12px; border-radius: 14px; }
.gr-route-h { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.gr-route-h select { flex: 1; }
.gr-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.gr-pick button { position: relative; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.gr-pick button.on { background: var(--cyan); border-color: var(--cyan); color: #04121F; }
.gr-pick sup { position: absolute; top: 2px; right: 4px; font-size: 10px; }
.gr-stats { grid-template-columns: repeat(3, 1fr); }
.gr-entries { max-height: 40vh; }
.gr-entries > div > b { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
@media (max-width: 520px) { .gr-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; } .gr-tank { padding: 8px; min-height: 84px; } .gr-gr { font-size: 13px; } .gr-tank small { font-size: 11px; } }
@media (max-width: 360px) { .gr-grid { grid-template-columns: 1fr 1fr; } }
.gr-ctx { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.gr-ctx .field { margin: 0; flex: 1 1 150px; min-width: 0; }
.gr-ctx .field > span { font-size: 12px; }
.gr-ctx .input { padding-top: 8px; padding-bottom: 8px; }
.gr-warn { font-size: 13px; color: var(--gold); margin: 0 0 8px; }
.gr-grades .chip.gr-ug { border-style: dashed; }
.gr-ugsp { flex: 1 1 160px; max-width: 240px; padding-top: 6px; padding-bottom: 6px; }
.gr-recent { margin-top: 10px; font-size: 13px; }
.gr-recent summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.gr-recent .pk-mlist { margin-top: 6px; }
.gr-progs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.gr-prog { padding: 10px 12px; border-radius: 14px; display: flex; flex-direction: column; gap: 6px; }
.gr-prog.on { box-shadow: inset 0 0 0 2px var(--green); }
.gr-prog-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gr-prog-h b { flex: 1; min-width: 0; }
.gr-bt { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.gr-bkg { display: inline-flex; align-items: center; gap: 6px; }
.gr-bkg .input { width: 110px; padding-top: 6px; padding-bottom: 6px; }
.gr-ugline { border: 1px dashed var(--gold); }
.gr-scope { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 14px; margin-bottom: 10px; }
.gr-scope-c { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1 1 220px; min-width: 0; }
.gr-scope-c .input { padding-top: 6px; padding-bottom: 6px; width: auto; }
.gr-scope-l { font-size: 13px; color: var(--muted); }
.gr-hpick { display: flex; flex-wrap: wrap; gap: 4px; }
.gr-hpick .chip { cursor: pointer; }
.gr-hpick .chip.on { background: var(--cyan); border-color: var(--cyan); color: #04121F; }
.gr-dt { display: inline-flex; align-items: center; gap: 4px; }
.gr-hd summary { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.gr-hd summary h2 { margin: 0; }
.gr-hd summary span { font-size: 13px; color: var(--muted); }
.gr-hd[open] summary { margin-bottom: 8px; }
.gr-haul { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line, rgba(255,255,255,.08)); font-size: 13px; }
@media (max-width: 520px) { .gr-scope .seg button { padding: 6px 8px; font-size: 12px; } .gr-ugsp { max-width: none; } .gr-progs { grid-template-columns: 1fr; } }
/* Catering: provisions, orders and the slop chest */
[data-ctname][hidden], [data-ctgroup][hidden] { display: none !important; }
.ct-cat { margin: 14px 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ct-kind { margin: 18px 0 8px; font-size: 17px; }
.ct-search { margin-bottom: 10px; max-width: 360px; }
.ct-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin: 12px 0 4px; }
.ct-tools .ct-search { flex: 1 1 200px; margin: 0; }
.ct-sub { margin-bottom: 12px; }
.ct-order { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.ct-order-h { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.ct-order-h > b { flex: 1 1 auto; min-width: min(100%, 140px); }
.cto-sec { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 12px 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line, rgba(255,255,255,.12)); }
.ct-order .btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip.ct-s-draft { color: var(--muted); }
.chip.ct-s-sent { color: var(--amber); border-color: rgba(251,191,36,.45); background: rgba(251,191,36,.12); }
.chip.ct-s-received { color: var(--green); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.10); }
.chip.ct-s-cancelled { color: var(--red); border-color: rgba(248,113,113,.35); }
.ct-ol.on { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
.ct-ohead textarea { resize: vertical; }
.ct-tap { cursor: pointer; transition: border-color .15s; }
.ct-tap:hover, .ct-tap:focus-visible { border-color: var(--cyan); outline: none; }
.ct-sheet .field { margin: 0 0 10px; }
.ct-sheet h2 small { font-size: 13px; font-weight: 500; }
.ct-sgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 10px; }
.ct-sgrid .ct-qob { grid-column: 1 / -1; }
.ct-sgrid .ct-qob .input { font-size: 20px; font-weight: 700; }
.ct-schk { display: flex; flex-wrap: wrap; gap: 0 10px; }
.ct-schk .check { flex: 1 1 140px; }
.ct-sbtns { display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; margin-top: 6px; }
@media (min-width: 560px) { .ct-sheet { border-radius: 26px; margin-bottom: 4vh; } .sheet-bg:has(.ct-sheet) { align-items: center; } .ct-sgrid { grid-template-columns: repeat(4, 1fr); } .ct-sgrid .ct-qob { grid-column: 1 / 3; } }
.ct-ostore { font-size: 11px; color: var(--amber); }
.ct-sticky { position: sticky; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); backdrop-filter: blur(12px); }
.ct-sticky .grow { flex: 1 1 80px; }
.ctc-chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 6px; scrollbar-width: none; }
.ctc-chips::-webkit-scrollbar { display: none; }
@media (min-width: 760px) { .ctc-chips { flex-wrap: wrap; overflow: visible; } }
.ctc-chips .chip { cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; flex: 0 0 auto; }
.ctc-chips.sub .chip { font-weight: 500; }
.ctc-chips .chip small { opacity: .65; }
.ctc-chips .chip.on { background: var(--cyan); border-color: var(--cyan); color: #04121F; }
.ctc-chips.dim { opacity: .45; }
.ctc-list { margin: 8px 0 12px; gap: 6px; }
.ctc-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.ctc-row input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--cyan); }
.ctc-row .ctc-n { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ctc-row .ctc-n b { font-weight: 600; font-size: 14px; }
.ctc-row .ctc-p { white-space: nowrap; font-weight: 600; text-align: right; }
.ctc-row.on { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
.ctc-row.have { opacity: .6; cursor: default; }
.sl-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: space-between; margin-bottom: 10px; }
.sl-bar .field { margin: 0; flex: 0 1 320px; }
.sl-sell { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(260px, 1.6fr) minmax(250px, 1fr); gap: 14px; align-items: start; }
.sl-col > .ct-kind:first-child { margin-top: 0; }
.sl-crewgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.sl-crew { min-height: 56px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.sl-crew b { font-size: 15px; }
.sl-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.sl-item { position: relative; min-height: 72px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.sl-item b { font-size: 15px; line-height: 1.2; }
.sl-badge { position: absolute; top: -6px; right: -6px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: var(--cyan); color: #04121F; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.sl-side { position: sticky; top: 12px; }
.sl-cart { padding: 12px 14px; border-radius: 16px; display: flex; flex-direction: column; gap: 10px; }
.sl-cart-h { display: flex; justify-content: space-between; gap: 8px; font-size: 17px; }
.sl-lines { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow: auto; }
.sl-lines > div { display: grid; grid-template-columns: 1fr auto 74px; gap: 8px; align-items: center; }
.sl-lines .n { text-align: right; font-weight: 600; }
.sl-qty { display: inline-flex; align-items: center; gap: 6px; }
.sl-qty b { min-width: 22px; text-align: center; }
.sl-qty .btn { min-width: 36px; min-height: 36px; padding: 0; }
.sl-go { width: 100%; min-height: 52px; font-size: 16px; }
.sl-mine summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.sl-detail { margin-top: 4px; }
@media (max-width: 1100px) {
  .sl-sell { grid-template-columns: minmax(0, 1fr) minmax(250px, 320px); }
  .sl-sell > .sl-col:first-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .sl-sell { grid-template-columns: 1fr; }
  .sl-side { top: auto; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); z-index: 5; }
  .sl-cart { background: var(--card2); backdrop-filter: blur(12px); }
  .sl-lines { max-height: 26vh; }
  .sl-crewgrid, .sl-items { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}
/* Grading live dashboard (IPC touch screen, tablet, phone, desktop) */
.gr-head .btns .btn { min-height: 44px; }
.chip.warn { color: var(--amber); border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.12); }
.chip.danger { color: var(--red); border-color: rgba(248,113,113,.45); background: rgba(248,113,113,.14); }
.gr-st .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 5px; }
.gr-st-offline, .gr-st-not_connected, .gr-st-disabled, .gr-st-none { color: var(--muted); }
.gr-status { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 8px 12px; border-radius: 14px; margin-bottom: 8px; }
.gr-st-i { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gr-st-i small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.gr-st-i b { font-size: 15px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.gr-st-i .chip { padding: 2px 8px; font-size: 12px; }
.gr-wait { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 14px; margin-bottom: 8px; border-style: dashed; }
.gr-wait .i { font-size: 28px; } .gr-wait p { margin: 2px 0 0; font-size: 13px; }
.gr-live { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 10px; align-items: start; }
.gr-live-b { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.gr-live-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gr-live-grid .gr-tank { min-height: 112px; }
.gr-fig { display: flex; gap: 4px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.gr-fig b { font-size: 17px; } .gr-fig span { margin-left: auto; color: var(--muted); font-size: 12px; }
.gr-fig em { font-style: normal; font-size: 11px; color: var(--amber); border: 1px dashed var(--amber); border-radius: 6px; padding: 0 4px; }
.gr-bar.est i { background: repeating-linear-gradient(45deg, var(--c), var(--c) 6px, transparent 6px, transparent 10px); }
.gr-nogates { padding: 16px; }
.gr-cur, .gr-tick { padding: 10px 12px; border-radius: 14px; }
.gr-cur-h { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; font-size: 14px; }
.gr-cur-h .btn { min-height: 36px; }
.gr-cur-t { margin-top: 6px; font-size: 13px; width: 100%; }
.gr-cur-t td, .gr-cur-t th { padding: 4px 6px; }
.gr-tick-l { display: flex; flex-direction: column; margin-top: 6px; font-size: 13px; }
.gr-tick-l > div { display: grid; grid-template-columns: 64px 74px minmax(0, 1fr) auto 32px; gap: 6px; align-items: center; padding: 3px 0; border-bottom: 1px solid var(--line); }
.gr-tick-l > div:first-child { color: var(--green); }
.gr-tick-l > div > span:first-child { font-variant-numeric: tabular-nums; color: var(--muted); }
.gr-tick-l b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.gr-tick-l .n { text-align: right; font-variant-numeric: tabular-nums; }
.gr-tick-l .btn { min-height: 28px; padding: 0 8px; }
/* Grader device cards */
.gr-devs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 6px; }
.gr-dev { padding: 10px 12px; border-radius: 14px; display: flex; flex-direction: column; gap: 4px; }
.gr-dev-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gr-dev .btns { margin: 4px 0 0; }
.gr-probe-out { white-space: pre-wrap; font-size: 12px; margin: 0; }
.gr-probe-out:empty { display: none; }
.gr-prn { margin-top: 10px; }
/* Program editor: one row per gate, like the grader's program screen */
.gr-pe-top { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; padding: 10px 12px; border-radius: 14px; margin-bottom: 8px; }
.gr-pe-top .field { margin: 0; flex: 0 1 260px; }
.gr-pe-top .input { min-height: 44px; }
.gr-pe-hint { flex: 1 1 260px; margin: 0; font-size: 12px; }
.gr-pe { padding: 4px 6px; }
.gr-pe-t { font-size: 13px; }
.gr-pe-t td, .gr-pe-t th { padding: 4px; vertical-align: middle; }
.gr-pe-t .input { min-height: 40px; padding: 0 8px; border-radius: 10px; }
.gr-pe-t .gr-gate { width: 56px; }
.gr-pe-t .gr-prod { min-width: 200px; }
.gr-prod-sp { display: block; font-size: 11px; margin-top: 2px; }
.gr-pe-t .gr-w { width: 78px; text-align: right; }
.gr-pe-t .gr-tsel { width: 96px; padding-right: 4px; }
.gr-pe-t .gr-bt { margin: 0; flex-wrap: nowrap; gap: 4px; }
.gr-pe-t .gr-bt .chip { cursor: pointer; white-space: nowrap; }
.gr-pe-t .gr-bt .chip.on { background: var(--cyan); border-color: var(--cyan); color: #04121F; }
.gr-pe-t .gr-bkg-i { width: 84px; }
.gr-pe-t .gr-lu { flex-wrap: nowrap; } .gr-pe-t .gr-lu button { min-height: 40px; padding: 0 10px; }
.gr-pe-t tr.gr-ugline td { border-top: 1px dashed var(--gold); }
.gr-warn { padding: 6px 10px; border: 1px dashed var(--gold); border-radius: 10px; }
.gr-send { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; }
.gr-sync { padding: 1px 7px; font-size: 11px; }
@media (max-width: 900px) { .gr-live { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .gr-status { gap: 4px 12px; } .gr-st-i b { font-size: 13px; }
  .gr-live-grid { grid-template-columns: repeat(2, 1fr); } .gr-live-grid .gr-tank { min-height: 96px; }
  .gr-tick-l > div { grid-template-columns: 58px minmax(0, 1fr) auto 28px; } .gr-tick-l > div > span:nth-child(2) { display: none; }
  .gr-pe-t thead { display: none; }
  .gr-pe-t tr { display: grid; grid-template-columns: 1fr 1fr 1fr 40px; gap: 4px; padding: 6px 0; border-bottom: 1px solid var(--line); }
  .gr-pe-t td { padding: 0; } .gr-pe-t td:nth-child(2) { grid-column: 2 / 5; } .gr-pe-t .gr-prod { min-width: 0; }
  .gr-pe-t td:nth-child(3) { order: 3; } .gr-pe-t td:nth-child(4) { order: 4; } .gr-pe-t td:nth-child(7) { order: 5; grid-column: 3 / 5; }
  .gr-pe-t td:nth-child(5) { order: 6; } .gr-pe-t td:nth-child(6) { order: 7; grid-column: 2 / 4; } .gr-pe-t td:nth-child(8) { order: 8; }
  .gr-pe-t td:nth-child(1), .gr-pe-t td:nth-child(2) { order: 1; } .gr-pe-t tr.gr-ugline td:empty { display: none; }
  .gr-pe-t .gr-w { width: 100%; } .gr-pe-t .gr-tsel { width: 100%; }
}
/* IPC touch screen: bigger targets */
.ipc .gr-live-grid .gr-tank { min-height: 128px; } .ipc .gr-gr { font-size: 17px; } .ipc .gr-tick-l .btn, .ipc .gr-cur-h .btn { min-height: 44px; }

/* orders: list with amounts, add-from buttons, send sheet */
.ct-ohead { padding: 12px 14px; margin-bottom: 10px; }
.ct-ohead > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; list-style: none; }
.ct-ohead > summary::before { content: "▸"; color: var(--muted); }
.ct-ohead[open] > summary::before { content: "▾"; }
.ct-ohead[open] > summary { margin-bottom: 10px; }
.cto-add { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.cto-add .btn { flex: 1 1 auto; min-height: 44px; padding: 0 12px; }
.cto-panel { padding: 12px 14px; margin-bottom: 10px; display: grid; gap: 8px; }
.cto-panel .btns { justify-content: flex-end; }
.cto-pinfo { justify-content: flex-end; min-height: 50px; display: flex; align-items: center; }
.cto-prev { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 300px; overflow: auto; }
.cto-prev .tile { text-align: left; display: grid; gap: 2px; padding: 10px 12px; }
.cto-list { padding: 6px 12px; margin-bottom: 12px; }
.cto-h { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cto-empty { padding: 14px 0; margin: 0; }
.cto-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cto-row:last-child { border-bottom: 0; }
.cto-row.zero { opacity: .55; }
.cto-n { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cto-n b { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.cto-q { width: 72px; min-height: 38px; padding: 0 6px; text-align: center; font-size: 16px; }
.cto-sum { min-width: 70px; text-align: right; font-weight: 600; white-space: nowrap; }
.cto-x { min-width: 36px; min-height: 36px; padding: 0; }
@media (max-width: 560px) {
  .cto-row { grid-template-columns: 1fr auto auto; }
  .cto-n { grid-column: 1 / -1; }
  .cto-row .sl-qty { grid-column: 1; }
}
@media (max-width: 420px) { .hide-xs { display: none; } }
.cto-send { display: grid; gap: 12px; padding: 14px; max-width: 760px; }
.cto-send .field { margin: 0; }
.cto-send textarea { min-height: 150px; padding: 12px 16px; resize: vertical; line-height: 1.45; }
.cto-sendinfo { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.cto-attach { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cto-attach .chip { cursor: pointer; padding: 6px 12px; font-size: 13px; }
.cto-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.cto-dl { align-items: center; }
.cto-add .cto-i { flex: none; }
.cto-add .cto-l { margin-left: 6px; }
@media (max-width: 560px) {
  .cto-add { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .cto-add .btn { flex-direction: column; gap: 2px; min-height: 58px; padding: 4px 2px; font-size: 11px; line-height: 1.15; text-align: center; }
  .cto-add .cto-i { font-size: 18px; }
  .cto-add .cto-l { margin: 0; }
  .cto-foot { flex-wrap: nowrap; gap: 6px; padding: 8px; }
  .cto-foot .btn { padding: 0 12px; min-height: 44px; white-space: nowrap; }
  .cto-foot .grow { font-size: 12px; line-height: 1.2; min-width: 0; }
}

/* slop chest: tobacco quota + crew requests */
.sl-cnt{display:inline-block;min-width:18px;padding:0 5px;border-radius:9px;background:var(--gold,#d4a73a);color:#111;font-size:11px;font-weight:700;line-height:18px;text-align:center}
.sl-tob{color:var(--muted)}
.sl-tob.over,.sl-tobline.over{color:#ff6b6b;font-weight:600}
.sl-tobline{margin:6px 0;font-size:13px}
.sl-reqgrp{padding:8px 12px;margin-bottom:10px}
.sl-reqh{display:flex;justify-content:space-between;align-items:center;padding:4px 0 6px;border-bottom:1px solid var(--line,rgba(255,255,255,.1))}
.sl-reqh label{display:flex;gap:8px;align-items:center;cursor:pointer}
.sl-req{display:flex;gap:10px;align-items:center;padding:8px 0;border-bottom:1px solid var(--line,rgba(255,255,255,.06))}
.sl-req:last-child{border-bottom:0}
.sl-req input[type=checkbox],.sl-reqh input[type=checkbox]{width:20px;height:20px;flex:none}
.sl-req-m{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.sl-req-m small{overflow-wrap:anywhere}@media (max-width: 640px) {
  .section-title:has(> .pk-top > .seg) { flex-wrap: wrap; gap: 10px; }
  .section-title > .pk-top:has(> .seg) { width: 100%; }
  .pk-top > .seg { display: flex; width: 100%; }
  .pk-top > .seg > button { flex: 1; white-space: nowrap; padding-left: 6px; padding-right: 6px; }
}
/* slop chest self-service shop */
.sl-tobinfo{padding:10px 12px;margin-bottom:10px;font-size:13px}
.sl-tobinfo.over{color:#ff6b6b}
.sh-cart{margin-top:12px}
.sh-mine .sh-x{opacity:.45;text-decoration:line-through}
.sh-groups{display:flex;gap:6px;overflow-x:auto;padding:2px 0 10px;scrollbar-width:none}
.sh-groups .chip{cursor:pointer;font:inherit;font-size:13px;color:inherit}
.sh-groups .chip.on{background:var(--cyan);color:#04121F}
.sh-prod.on .sl-req-m b{color:var(--cyan)}
#shRes{max-height:none}
/* slop pre-orders: destination (trip/steward) and draft-order picker */
.sl-dest{color:var(--cyan);font-size:12px}
.sh-dest{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;margin-top:10px}
.sl-opick{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px;margin:12px 0}
.sl-opick .tile{display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:left;padding:12px;border-radius:12px;border:1px solid var(--line,rgba(255,255,255,.12));background:var(--glass,rgba(255,255,255,.04));color:inherit;font:inherit;cursor:pointer}
.sl-opick .tile:hover{border-color:var(--cyan)}
@media (max-width:640px){.sl-opick,.sh-dest{grid-template-columns:1fr}}
/* barcode scanner sheet */
.ct-tools:has(> .scan-btn:only-child) { justify-content: flex-end; }
.scan-btn { flex: 0 0 auto; white-space: nowrap; }
.scan-sheet { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; }
.scan-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.scan-h h2 { margin: 0; font-size: 19px; }
.scan-h .scan-camsw { margin: 0 0 0 auto; font-size: 14px; white-space: nowrap; }
.scan-cam[hidden] { display: none; }
.scan-mode { margin: 0; }
.scan-cam { position: relative; border-radius: 16px; overflow: hidden; background: #000; height: min(38vh, 260px); }
.scan-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-cam.off { height: auto; background: transparent; border: 1px dashed var(--line); }
.scan-cam.off video, .scan-cam.off .scan-aim { display: none; }
.scan-aim { position: absolute; left: 12%; right: 12%; top: 32%; bottom: 32%; border: 2px solid var(--cyan); border-radius: 10px; box-shadow: 0 0 0 999px rgba(0,0,0,.28); pointer-events: none; }
.scan-msg { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 6px 10px; font-size: 13px; text-align: center; color: #fff; background: rgba(0,0,0,.45); }
.scan-cam.off .scan-msg { position: static; background: none; color: var(--muted); padding: 12px; }
.scan-panel { border: 1px solid var(--cyan); border-radius: 14px; padding: 10px; }
.scan-qty { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scan-qty b { flex: 1 1 100%; }
.scan-qty .input { flex: 1 1 90px; font-size: 20px; }
.scan-unk { display: flex; flex-direction: column; gap: 8px; }
.scan-unk .check { margin: 0; }
.scan-list { max-height: 30vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.scan-item { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.scan-item:hover, .scan-item:focus { border-color: var(--cyan); }
.scan-manual { display: flex; gap: 8px; }
.scan-manual .input { flex: 1; }
.scan-log { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.scan-log .ok { color: var(--cyan); }
.scan-log .bad { color: var(--muted); }
.scan-log > :first-child { font-weight: 600; }
.scan-done { width: 100%; }
.pk-card.scanned { border-color: var(--cyan); }.scan-found { display: block; min-height: 1em; }
.scan-item.best { border-color: var(--cyan); }
.scan-item.best:first-child { background: rgba(34,211,238,.12); font-weight: 600; }
/* transit (duty-free) goods */
.chip.ct-tr { background: rgba(167,139,250,.2); color: #c4b5fd; font-size: .72em; padding: 1px 7px; margin-left: 4px; vertical-align: middle; }
html[data-theme="light"] .chip.ct-tr { color: #6d28d9; }
.ct-trseg { margin: 0; flex: 0 0 auto; }
.ct-trseg button { padding: 6px 10px; }
.cto-type { margin: 0 0 10px; }
.ct-customs-row { margin: 12px 0 0; align-items: center; }
.ct-customs { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }/* List view modes (lvSeg): cards side by side (default), compact list, detailed list */
.lv-seg button { min-width: 36px; font-size: 16px; padding: 6px 10px; }
.ct-tools .lv-seg { margin-left: auto; }
.lv-list, .lv-detail { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important; gap: 6px; }
.lv-detail { grid-template-columns: 1fr !important; }
.lv-list > *, .lv-detail > * { flex-direction: row !important; flex-wrap: wrap; align-items: center; justify-content: flex-start !important; gap: 4px 12px; min-height: 48px; padding: 6px 12px; border-radius: 10px; text-align: left; }
.lv-list > * > :is(.pk-name, b:first-of-type), .lv-detail > * > :is(.pk-name, b:first-of-type) { flex: 1 1 140px; font-size: 15px; }
.lv-list .pk-qty, .lv-detail .pk-qty { font-size: 18px; order: 3; margin-left: auto; }
.lv-list > * > .input, .lv-detail > * > .input { width: 96px; margin: 0 0 0 auto; order: 4; font-size: 16px; padding-top: 6px; padding-bottom: 6px; }
.lv-list .pk-card > small { display: none; }
.lv-list .sl-item > small { margin-left: auto; white-space: nowrap; }
.lv-detail > * > small { flex: 0 1 260px; order: 2; }
.lv-list .sl-badge, .lv-detail .sl-badge { position: static; order: -1; }
@media (max-width: 520px) { .lv-list, .lv-detail { grid-template-columns: 1fr !important; } .lv-detail > * > small { flex-basis: 100%; order: 5; } }
.cto-crew{display:block;font-size:.78rem;color:var(--accent,#22d3ee);overflow-wrap:anywhere}
.cto-panel .sl-reqgrp{margin-top:8px}

/* Supplier chips and its catalogue inline in the order editor */
.cto-sups{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:10px 0 4px}
.cto-cat{padding:10px;margin:6px 0 10px}
.cto-cat .ctc-list{max-height:min(52vh,520px);overflow:auto}
.cto-cat .ctc-foot{position:static;margin-top:8px;display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}


/* ---- Manual samples (factory IPC station) ---- */
.ms-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.ms-start { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; }
.ms-start .field { margin: 0; flex: 1 1 160px; min-width: 0; }
.ms-start .btn { flex: 1 1 160px; min-height: 48px; }
.ms-h3 { margin: 4px 0 8px; font-size: 15px; }
.ms-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.ms-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; text-align: left; color: inherit; font: inherit; cursor: pointer; border: 1px solid var(--line); }
.ms-row.closed { opacity: .8; }
.ms-row-a { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ms-row-a small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-row-b { display: flex; flex-direction: column; align-items: flex-end; }
.ms-row-b b { font-size: 20px; line-height: 1; }
.ms-info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border-radius: 14px; margin-bottom: 10px; }
.ms-info > div { flex: 1 1 200px; display: flex; flex-direction: column; min-width: 0; }
.ms-info-b { display: flex; gap: 6px; }
.ms-grid { display: grid; gap: 10px; }
.ms-a, .ms-b { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
@media (min-width: 900px) { .ms-grid { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.ms-weigh { padding: 12px 14px; border-radius: 14px; display: flex; flex-direction: column; gap: 10px; }
.ms-cnt { display: flex; gap: 10px; }
.ms-cnt > span { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; padding: 6px 10px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); }
.ms-cnt small { color: var(--muted); font-size: 13px; }
.ms-cnt b { font-size: 32px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ms-cnt > span:last-child b { color: var(--accent, #4f8cff); }
.ms-live { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; border-radius: 12px; background: var(--card2); border: 2px solid var(--line); text-align: center; min-height: 96px; justify-content: center; }
.ms-live b { font-size: clamp(40px, 9vw, 72px); line-height: 1.05; font-variant-numeric: tabular-nums; }
.ms-live.stable { border-color: var(--green); }
.ms-live.nobridge, .ms-live.error { border-color: var(--gold); }
.ms-live .btn.sm { min-height: 48px; margin-top: 6px; }
.ms-scan { display: flex; flex-direction: column; gap: 6px; align-items: stretch; width: 100%; }
.ms-scan small { display: block; }
.ms-rec { display: flex; gap: 8px; }
.ms-big { flex: 1; min-height: 64px; font-size: 22px; }
.ms-auto { min-width: 84px; justify-content: center; cursor: pointer; font-size: 15px; }
.ms-auto.on { background: var(--cyan); border-color: var(--cyan); color: #04121F; }
.ms-man { display: flex; gap: 8px; }
.ms-man .input { flex: 1; min-width: 0; font-size: 20px; }
.ms-man .btn { min-height: 48px; }
.ms-cam { display: flex; gap: 8px; }
.ms-cam .btn { flex: 1; }
.ms-start .ms-sph, .ms-start .ms-what { flex: 1 1 100%; }
.ms-start .ms-sph .ms-cam { align-items: center; }
.ms-start .ms-sph .btn { min-height: 48px; }
.ms-start > small { flex: 1 1 100%; }
.ms-tiles { margin-top: 6px; }
.ms-pi small { display: block; font-size: 11px; opacity: .75; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-finish { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; border: 2px solid var(--accent, #2f81f7); }
.ms-finish .ms-endph { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.ms-finish .ms-endph .ms-cam .btn, .ms-finish .btns .btn { min-height: 48px; }
.ms-finish .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.ms-finish .btns .btn { flex: 1 1 160px; }
.ms-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 10px 12px; border-radius: 14px; }
.ms-stats > div { display: flex; flex-direction: column; min-width: 0; }
.ms-stats small { font-size: 12px; opacity: .75; }
.ms-stats b { font-size: 18px; white-space: nowrap; }
.ms-dist, .ms-wl, .ms-ph { padding: 10px 12px; border-radius: 14px; }
.ms-fields, .ms-note { padding: 10px 12px; border-radius: 14px; display: flex; flex-direction: column; gap: 6px; }
.ms-note p { margin: 0; white-space: pre-wrap; }
.ms-note .btn { align-self: flex-end; }
.ms-finish .ms-note { padding: 0; }
.ms-f { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line, rgba(127,127,127,.2)); }
.ms-f > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.ms-f > span:first-child small { font-size: 11px; }
.ms-f.miss > span:first-child { color: var(--warn, #d97706); }
.ms-f.dev b { color: var(--danger, #dc2626); }
.ms-scale { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.ms-scale button { min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line, rgba(127,127,127,.35)); background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.ms-scale button.on { background: var(--accent, #0ea5e9); border-color: var(--accent, #0ea5e9); color: #fff; }
.ms-scale button.ok.on { background: #16a34a; border-color: #16a34a; }
.ms-scale button.dev.on { background: #dc2626; border-color: #dc2626; }
.ms-scale button.swatch { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 56px; min-height: 64px; padding: 6px 8px; }
.ms-scale button.swatch i { display: block; width: 36px; height: 26px; border-radius: 6px; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.ms-scale button.swatch.on { background: transparent; color: inherit; border: 3px solid var(--accent, #0ea5e9); }
.ms-swdot { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
/* Haul size: an even segmented row, same height as the other start fields. */
.ms-start .ms-hs { justify-content: stretch; flex-wrap: nowrap; gap: 6px; }
.ms-start .ms-hs button { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-num { display: flex; align-items: center; gap: 6px; }
.ms-num .input { width: 110px; text-align: right; }
.ms-dist > b, .ms-wl > b, .ms-ph > b { display: block; margin-bottom: 6px; }
.ms-bin { display: grid; grid-template-columns: minmax(90px, 1.3fr) 2fr auto; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.ms-bin.other { opacity: .7; }
.ms-bar { height: 10px; border-radius: 99px; background: var(--card2); overflow: hidden; }
.ms-bar i { display: block; height: 100%; background: var(--cyan); border-radius: 99px; }
.ms-bin .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ms-ws { display: flex; flex-wrap: wrap; gap: 6px; max-height: 42vh; overflow: auto; }
.ms-station { display: flex; flex-direction: column; }
.ms-station > .ms-wl { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-style: dashed; }
.ms-station > .ms-weigh { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }
.ms-station .ms-ws { max-height: 24vh; }
.ms-w { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); font-variant-numeric: tabular-nums; }
.ms-w small { opacity: .6; font-size: 11px; }
.ms-w.manual { border-style: dashed; }
.ms-w button, .ms-pi button { border: 0; background: transparent; color: inherit; opacity: .55; cursor: pointer; padding: 2px 6px; font: inherit; }
.ms-w button:hover, .ms-pi button:hover { opacity: 1; color: var(--red); }
.ms-phs { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-pi { position: relative; }
.ms-pi img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; display: block; }
.ms-pi button { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.55); color: #fff; border-radius: 6px; opacity: .85; }
.ms-camwrap { display: flex; align-items: center; justify-content: center; padding: 12px; }
.ms-camsheet { width: min(760px, 100%); padding: 12px; border-radius: 16px; display: flex; flex-direction: column; gap: 10px; }
.ms-camsheet video { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; }
.ms-camsheet .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-camsheet .btns .btn { flex: 1 1 120px; min-height: 48px; }
@media (max-width: 520px) { .ms-stats { grid-template-columns: repeat(3, 1fr); } .ms-stats > div:nth-child(n+4) { display: none; } .ms-list { grid-template-columns: 1fr; } .ms-big { min-height: 56px; } }
/* Room plan (cargo hold) */
.rp-rooms { display: flex; gap: 8px; margin: 0 0 8px; overflow-x: auto; }
.rp-rooms button { flex: 1; min-height: 48px; padding: 6px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font-weight: 800; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.rp-rooms button small { font-weight: 600; font-size: 12px; color: var(--muted); }
.rp-rooms button.on { background: rgba(63,208,224,.16); border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; }
.rp-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rp-qempty { font-size: 13px; margin: 0 0 8px; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-side-lbl { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--cyan); padding: 0 4px; }
.rp-ay.full { color: var(--green, #34d399); font-weight: 800; }
.rp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.rp-stat { padding: 6px 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rp-stat small { color: var(--muted); font-size: 12px; }
.rp-stat b { font-size: 18px; white-space: nowrap; }
.rp-stat.warn b { color: var(--amber); }
.rp-tag { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 6px; border-radius: 7px; background: var(--c); color: #0A1626; font-weight: 800; font-size: 12px; flex: none; }
.rp-queue { padding: 8px 12px; margin-bottom: 8px; }
.rp-qhead { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.rp-qlist { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0 2px; scroll-snap-type: x proximity; }
.rp-qp { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 12px 6px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); color: var(--text); text-align: left; cursor: pointer; flex: none; scroll-snap-align: start; }
.rp-qp span { display: grid; line-height: 1.25; white-space: nowrap; }
.rp-qp.on { border-color: var(--cyan); box-shadow: 0 0 0 2px var(--cyan) inset; }
.rp-qp:disabled { cursor: default; }
.rp-pickbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 10px; border-radius: 12px; background: var(--cyan); color: #04121F; }
.rp-pickbar .btn { min-height: 36px; background: rgba(255,255,255,.85); color: #04121F; }
/* Map and species key sit side by side, centered; narrower rooms keep the same square size as the widest room. */
.rp-main { display: flex; justify-content: center; gap: 10px; align-items: flex-start; --sidew: clamp(190px, 22vw, 260px); --sideg: calc(var(--sidew) + 10px); }
.rp-main.nokey { --sideg: 0px; }
.rp-main > .rp-side:not(.rp-float) { flex: 0 0 var(--sidew); width: var(--sidew); box-sizing: border-box; }
.rp-gridwrap { padding: 8px; overflow: hidden; }
/* A room narrower than the widest room keeps the same square size instead of stretching. */
.rp-grid { display: grid; gap: 3px; min-width: 0; width: 100%; }
.rp-gridwrap { --ax: 34px; flex: 0 1 auto; box-sizing: border-box; max-width: 100%; width: calc(var(--ax) + 16px + (100% - var(--sideg) - var(--ax) - 16px) * var(--cols, 1) / var(--maxcols, 1)); }
.rp-corner { font-size: 10px; align-self: end; text-align: left; }
.rp-ax { font-size: 11px; color: var(--muted); text-align: center; align-self: end; white-space: nowrap; padding: 0 2px 2px; }
.rp-ay { align-self: center; padding-right: 4px; }
/* A pallet is square, so each place is drawn square in every view. */
.rp-cell { min-width: 0; min-height: 26px; height: auto; aspect-ratio: 1 / 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 2px; border-radius: 8px; border: 1px dashed var(--line); background: transparent; color: var(--text); cursor: pointer; }
.rp-cell i { display: flex; justify-content: space-between; align-items: center; gap: 2px; font-style: normal; font-size: 10px; font-weight: 800; padding: 1px 4px; border-radius: 4px; background: var(--c); color: #0A1626; }
.rp-cell i small { font-weight: 600; font-size: 9px; opacity: .75; }
.rp-cell i { overflow: hidden; white-space: nowrap; }
.rp-grid.tight .rp-cell i { justify-content: center; font-size: 9px; padding: 1px 2px; }
.rp-grid.tight .rp-cell i small { display: none; }
.rp-cell.has { border-style: solid; border-color: var(--fill); background: color-mix(in srgb, var(--fill) 28%, transparent); }
.rp-cell.full { border-style: solid; background: color-mix(in srgb, var(--fill, transparent) 55%, transparent); }
.rp-cell.sel { border: 2px solid var(--cyan); }
.rp-cell.target { border: 2px dashed var(--cyan); background: rgba(63,208,224,.10); }
.rp-cell.dim { opacity: .45; }
.rp-cell.blocked { display: grid; place-items: center; font-size: 10px; color: var(--muted); cursor: default; border-style: solid; background: repeating-linear-gradient(45deg, transparent 0 6px, var(--card2) 6px 12px); text-align: center; overflow: hidden; font-size: 9px; white-space: nowrap; text-overflow: ellipsis; display: block; line-height: 1; padding-top: 30%; }
.rp-side { padding: 12px; display: grid; gap: 8px; position: sticky; top: 8px; }
.rp-side-h { display: flex; justify-content: space-between; align-items: baseline; }
.rp-pal { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; padding: 8px; border-radius: 10px; background: var(--card2); }
.rp-pal .grow { display: grid; min-width: 140px; }
.rp-pal-a { display: flex; gap: 6px; width: 100%; }
.rp-pal-a .btn { min-height: 38px; flex: 1; padding: 0 10px; }
.rp-h3 { margin: 8px 0 0; font-size: 14px; }
.rp-sp { display: flex; gap: 8px; align-items: center; }
.rp-sw { width: 16px; height: 16px; border-radius: 4px; background: var(--c); flex: none; }
.rp-key { display: grid; gap: 6px; }
.rp-key .grow { flex: 1; min-width: 0; }
.rp-detail { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.rp-detail:empty { display: none; }
.rp-cell i { justify-content: center; min-height: 6px; flex: 1; max-height: 34%; font-size: 9px; padding: 0; }
.rp-fold { display: flex; align-items: center; gap: 12px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--green, #34d399); background: rgba(52,211,153,.12); color: var(--text); cursor: pointer; text-align: left; }
.rp-fold span { color: var(--muted); font-size: 12px; flex: 1; }
.rp-fold u { font-size: 12px; color: var(--cyan); }
.rp-qempty { display: flex; align-items: center; gap: 10px; }
.rp-qempty > span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
/* Fullscreen room plan: covers the whole screen (also the app top bar and menu); the open rows share all remaining height. */
.rp-fs { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--bg, #06101d); overflow: hidden; }
.rp-fsbar { display: flex; align-items: center; gap: 8px; flex: none; }
.rp-fsbar .rp-rooms { margin: 0; flex: 0 1 auto; }
.rp-fsbar .rp-rooms button { min-height: 40px; flex: none; }
.rp-fsbar .rp-stats { margin: 0; flex: 1; }
.rp-fsbar .rp-stat { padding: 4px 10px; }
.rp-fsbar .rp-fsbtn { flex: none; min-height: 40px; }
.rp-fs .rp-queue, .rp-fs .rp-qempty, .rp-fs .rp-pickbar { flex: none; margin: 0; }
.rp-fs .rp-main { flex: 1; min-height: 0; display: flex; position: relative; }
.rp-fs .rp-gridwrap { display: flex; align-items: flex-start; min-height: 0; flex: 0 1 auto; overflow-y: auto; }
.rp-fs .rp-fskey { align-self: flex-start; max-height: 100%; }
.rp-fs .rp-float { position: absolute; top: 8px; right: 8px; bottom: 8px; width: min(320px, 90vw); overflow-y: auto; z-index: 3; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: var(--bg2); align-content: start; }
.rp-floatx { position: absolute; top: 8px; right: 8px; min-height: 32px; }
.rp-float > .rp-side-h { padding-right: 44px; }
/* Fullscreen: a pallet is square, so each place is drawn square; more rows than fit scroll down. */
.rp-fs .rp-gridwrap { --ax: 48px; }
.rp-fs .rp-grid { flex: 1; min-height: 0; gap: 4px; align-content: start; }
.rp-fs .rp-cell { height: auto; min-height: 40px; aspect-ratio: 1 / 1; border-radius: 10px; padding: 3px; }
.rp-fs .rp-cell i { font-size: 12px; max-height: 32%; }
.rp-fs .rp-ax { font-size: 13px; }
.rp-fs .rp-ay { font-size: 15px; font-weight: 800; }
.rp-fs .rp-side { position: static; overflow-y: auto; min-height: 0; }
.rp-fs .rp-cell.blocked { font-size: 11px; }
@media (max-width: 760px) { .rp-fsbar { flex-wrap: wrap; } }
.rp-qhead .rp-addbtn { margin-left: auto; }
.rp-addbtn { min-height: 34px; white-space: nowrap; }
.rp-add { display: grid; gap: 12px; }
.rp-add label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
.rp-add .input { width: 100%; min-width: 0; min-height: 48px; font-size: 16px; box-sizing: border-box; }
.rp-add .btns { display: flex; gap: 8px; }
.rp-add .btns .btn { flex: 1; min-height: 52px; }
/* Manual pallet: a centered popup over the room plan. */
.rp-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(2, 8, 16, .65); }
.rp-modal .rp-add { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px; border-radius: 16px; background: var(--bg2, #0b1a2c); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.rp-modal .rp-side-h b { font-size: 18px; }
.rp-modal #rpAddX { min-height: 44px; min-width: 44px; }
.rp-add label.rp-mix { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.rp-add2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rp-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rp-add .rp-side-h { align-items: center; gap: 8px; }
.rp-add #rpAddBack { min-height: 44px; min-width: 44px; }
.rp-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rp-kind { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); color: var(--text); text-align: left; cursor: pointer; font-size: 15px; }
.rp-kind span { font-size: 22px; width: 28px; text-align: center; }
.rp-kind:hover { border-color: var(--cyan); }
.rp-cell { position: relative; }
.rp-one { position: absolute; top: 2px; left: 2px; right: 2px; font-style: normal; font-size: 9px; font-weight: 800; text-align: center; padding: 1px 2px; border-radius: 4px; background: rgba(255,255,255,.88); color: #0A1626; white-space: nowrap; overflow: hidden; }
.rp-fs .rp-one { font-size: 11px; }
.rp-loose { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 0; }
.rp-lax { align-self: center; }
.rp-lchip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 2px 10px; border-radius: 999px; border: 1px dashed var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--text); font-size: 12px; cursor: pointer; white-space: nowrap; }
.rp-lchip b { font-weight: 800; }
.rp-lchip.on { border: 2px solid var(--cyan); }
.rp-lchip:disabled { opacity: .45; cursor: default; }
.rp-fs .rp-lchip { min-height: 40px; font-size: 14px; }
.rp-lpm .btn { min-height: 48px; font-size: 16px; font-weight: 700; }
.rp-cell[data-rpdrag] { touch-action: none; cursor: grab; }
.rp-cell.dragging { opacity: .4; }
.rp-cell.drop { border: 2px solid var(--green, #34d399); background: rgba(52,211,153,.22); }
.rp-cell.nodrop { border: 2px solid var(--red, #f87171); background: rgba(248,113,113,.18); }
.rp-ghost { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; padding: 8px 12px; border-radius: 10px; background: var(--c); color: #0A1626; font-weight: 800; font-size: 14px; white-space: nowrap; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.rp-mvline { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px; border-radius: 10px; background: var(--card2); font-size: 18px; font-weight: 700; }
.rp-mvline b { color: var(--cyan); font-size: 22px; }
@media (max-width: 760px) {
  .rp-main { flex-wrap: wrap; --sideg: 0px; }
  .rp-main > .rp-side:not(.rp-float) { flex: 1 1 100%; width: auto; }
  .rp-side { position: static; }
  .rp-gridwrap { max-height: none; }
}
@media (max-width: 560px) {
  .rp-stat { display: grid; gap: 0; padding: 5px 10px; }
  .rp-stat small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rp-stat b { font-size: 16px; }
  .rp-rooms button { min-height: 42px; font-size: 15px; }
  .rp-cell { min-height: 22px; }
  .rp-head h1 { font-size: 24px; }
  .rp-gridwrap { padding: 4px; }
  .rp-ax { font-size: 10px; }
}

/* Manual weight unit (g / kg) and phone photos */
.ms-man .ms-unit { flex-wrap: nowrap; }
.ms-man .ms-unit button { min-width: 48px; min-height: 48px; }
.ms-finish .ms-phone { min-height: 48px; align-self: flex-start; }
.ms-qrsheet { width: min(420px, 100%); padding: 18px; border-radius: 16px; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.ms-qr { align-self: center; background: #fff; padding: 12px; border-radius: 12px; line-height: 0; color: #000; }
.ms-qr svg { width: 260px; height: 260px; display: block; }
.ms-qrn { font-size: 15px; }
.ms-qrsheet .btn { min-height: 48px; }
.snap { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.snap-top { display: flex; align-items: center; gap: 12px; }
.snap-top h1 { font-size: 24px; margin: 2px 0 0; }
.snap-info { padding: 12px 14px; border-radius: 14px; display: flex; flex-direction: column; gap: 2px; }
.snap-f { padding: 14px; border-radius: 14px; display: flex; flex-direction: column; gap: 10px; }
.snap-f.miss { border: 2px solid var(--accent, #2f81f7); }
.snap-f .ms-cam .btn { min-height: 56px; font-size: 17px; }
.snap .snap-done { min-height: 52px; }
.rp-fixed { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line, #d0d7de); border-radius: 10px; margin: 4px 0 10px; font-size: 1.05rem; }
.rp-add [hidden] { display: none !important; }

.rp-add .rp-unit{align-self:flex-start}
.rp-mixbox{display:flex;flex-direction:column;gap:8px}
.rp-mixlist{display:flex;flex-direction:column;gap:6px}
.rp-mixline{display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:10px;background:rgba(127,127,127,.12)}
.rp-mixline .pno{margin-right:6px}

/* room plan: export buttons, history, delivery chooser, print */
.rp-headbtns, .rp-out { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rp-hist { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 8px; }
.rp-hist small, .dlv-room small { display: block; opacity: .75; }
.rp-hist > span { display: flex; gap: 6px; flex-shrink: 0; }
.dlv-room { padding: 10px 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }
.dlv-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.dlv-opt { flex: 1; min-width: 90px; }
.dlv-opt input { position: absolute; opacity: 0; pointer-events: none; }
.dlv-opt span { display: block; text-align: center; padding: 10px 8px; border-radius: 10px; border: 1px solid rgba(148,163,184,.4); cursor: pointer; font-weight: 600; }
.dlv-opt input:checked + span { background: var(--accent, #0ea5e9); border-color: transparent; color: #04202a; }
#printArea .rpp { color: #000; font: 9pt/1.3 system-ui, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#printArea .rpp h1 { font-size: 15pt; margin: 0 0 3mm; }
#printArea .rpp h2 { font-size: 12pt; margin: 4mm 0 2mm; } #printArea .rpp h2 small { font-weight: 400; font-size: 9pt; }
#printArea .rpp table { border-collapse: collapse; width: 100%; }
#printArea .rpp th, #printArea .rpp td { border: .2mm solid #888; padding: 1mm 1.5mm; vertical-align: top; text-align: left; }
#printArea .rpp-sum { width: auto !important; min-width: 50%; margin-bottom: 3mm; }
#printArea .rpp-room { break-before: page; page-break-before: always; break-inside: avoid; }
#printArea .rpp-p { border-left: 1.2mm solid #999; padding-left: 1mm; margin-bottom: .6mm; font-size: 7.5pt; }
#printArea .rpp-p small { margin-left: 1mm; color: #444; }
#printArea .rpp-loose td { font-size: 7.5pt; background: #f3f3f3; }

/* quotas */
.q-year { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.q-year select { min-height: 48px; }
.q-tabs { margin-bottom: 14px; }
.q-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.q-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.q-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-h .chip { margin-left: auto; }
.q-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.q-big { font-size: 28px; font-weight: 800; line-height: 1.1; }
.q-big small { font-size: 14px; font-weight: 500; opacity: .7; }
.q-bar { position: relative; display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: rgba(127,127,127,.18); }
.q-bar i { display: block; height: 100%; background: var(--c, var(--accent)); }
.q-bar i.est { background: repeating-linear-gradient(135deg, var(--c, var(--accent)) 0 4px, transparent 4px 8px); opacity: .75; }
.q-kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 13px; }
.q-kv > div { display: flex; flex-direction: column; gap: 2px; }
.q-kv span { opacity: .7; }
.q-kv b { font-size: 15px; font-variant-numeric: tabular-nums; }
.q-split { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; opacity: .85; }
.q-split span { display: inline-flex; align-items: center; gap: 6px; }
.q-sq { width: 12px; height: 12px; border-radius: 3px; background: var(--c, var(--accent)); display: inline-block; }
.q-sq.est { background: repeating-linear-gradient(135deg, var(--c, var(--accent)) 0 3px, transparent 3px 6px); }
.q-foot { font-size: 13px; opacity: .7; margin-top: 12px; line-height: 1.45; }
.q-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.q-tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.q-tbl table { width: 100%; border-collapse: collapse; font-size: 14px; }
.q-tbl th, .q-tbl td { padding: 10px 8px; border-bottom: 1px solid rgba(127,127,127,.2); text-align: left; white-space: nowrap; vertical-align: top; }
.q-tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; opacity: .7; }
.q-tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.q-sum td { font-weight: 700; border-top: 2px solid rgba(127,127,127,.35); }
.q-neg { color: var(--red); }
.q-pos { color: var(--green, #2fbf71); }
.q-click { cursor: pointer; }
.q-click:hover td { background: rgba(127,127,127,.08); }
.q-lines { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.q-line { display: grid; grid-template-columns: 1fr 140px; gap: 8px; align-items: center; }
.q-line > span { display: flex; flex-direction: column; }
.q-line input { min-height: 48px; }
@media (max-width: 700px) {
  .q-stats { grid-template-columns: 1fr 1fr; }
  .q-grid { grid-template-columns: 1fr; }
  .q-line { grid-template-columns: 1fr 110px; }
}

/* ---------- ISM (safety) – big, simple, for everyone on board ---------- */
.ism { display: flex; flex-direction: column; gap: 14px; max-width: 560px; margin: 6px auto 0; }
.ism.ism-wide { max-width: 1100px; }
.ism-who { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.ism-h1 { font-size: 30px; margin: 0; line-height: 1.15; }
.ism-h3 { font-size: 19px; margin: 8px 0 0; }
.ism-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; }
.ism-link { background: none; border: 0; color: var(--muted); font-size: 17px; font-weight: 600; cursor: pointer; padding: 10px 0; text-decoration: none; }
.ism-big { display: flex; gap: 16px; align-items: center; padding: 22px 20px; border-radius: 22px; background: var(--cta); color: var(--cta-text); text-decoration: none; box-shadow: 0 10px 30px rgba(226,196,142,.25); }
.ism-big .ic { font-size: 40px; line-height: 1; }
.ism-big b { font-size: 24px; display: block; }
.ism-big span { font-size: 15px; }
.ism-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ism-tile { position: relative; min-height: 128px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; color: var(--text); text-decoration: none; }
.ism-tile .ic { position: absolute; top: 14px; left: 16px; font-size: 28px; }
.ism-tile b { font-size: 18px; line-height: 1.15; }
.ism-tile small { color: var(--amber); font-size: 13px; }
.ism-tile.soon { opacity: .5; }
.ism-tile.soon small { color: var(--muted); }
.ism-badge { position: absolute; top: 14px; right: 14px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 15px; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 800; }
.ism-pending { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-color: rgba(251,191,36,.5); color: var(--amber); font-weight: 600; }
.ism-dots { display: flex; gap: 8px; align-items: center; }
.ism-dots i { width: 40px; height: 8px; border-radius: 4px; background: var(--card2); }
.ism-dots i.on { background: var(--cyan); }
.ism-dots span { margin-left: 8px; color: var(--muted); font-size: 15px; }
.ism-text { min-height: 130px; padding: 14px; font-size: 18px; line-height: 1.4; resize: vertical; }
.ism-text.sm { min-height: 80px; font-size: 16px; }
.ism-bigbtn { height: 64px; border-radius: 16px; background: var(--card2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 18px; font-weight: 700; cursor: pointer; color: var(--text); }
.ism-bigbtn .ic { font-size: 24px; }
.ism-bigbtn.on { background: rgba(63,208,224,.18); border: 2px solid var(--cyan); }
.ism-photos { display: flex; gap: 10px; flex-wrap: wrap; }
.ism-pic { position: relative; width: 84px; height: 84px; border-radius: 12px; background: var(--card2) center/cover no-repeat; display: block; }
.ism-pic.big { width: 180px; height: 130px; }
.ism-pic button { position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--red); color: #fff; font-weight: 800; cursor: pointer; }
.ism-next { width: 100%; min-height: 60px; font-size: 19px; margin-top: 6px; }
.ism-next:disabled { opacity: .45; cursor: default; }
.ism-sev { padding: 16px 18px; border-radius: 18px; border: 2px solid; background: none; display: flex; flex-direction: column; align-items: flex-start; text-align: left; cursor: pointer; color: var(--text); }
.ism-sev b { font-size: 21px; }
.ism-sev span { font-size: 15px; color: var(--muted); }
.ism-sev.g { border-color: rgba(52,211,153,.45); } .ism-sev.a { border-color: rgba(251,191,36,.45); } .ism-sev.r { border-color: rgba(248,113,113,.45); }
.ism-sev.g.on { background: rgba(52,211,153,.2); border-color: var(--green); box-shadow: 0 0 0 3px rgba(52,211,153,.25); }
.ism-sev.a.on { background: rgba(251,191,36,.2); border-color: var(--amber); box-shadow: 0 0 0 3px rgba(251,191,36,.25); }
.ism-sev.r.on { background: rgba(248,113,113,.22); border-color: var(--red); box-shadow: 0 0 0 3px rgba(248,113,113,.25); }
.ism-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ism-pick button { min-height: 64px; border-radius: 16px; background: var(--card2); border: 1px solid var(--line); font-size: 19px; font-weight: 700; cursor: pointer; color: var(--text); }
.ism-pick button.co { border-style: dashed; }
.ism-pick button.on { background: rgba(63,208,224,.2); border: 2px solid var(--cyan); }
.ism-note { margin: 0; font-size: 15px; }
.ism-note.c { text-align: center; font-size: 13px; }
.ism-sum { padding: 10px 14px; display: grid; gap: 8px; }
.ism-kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; }
.ism-kv span { color: var(--muted); font-weight: 600; }
.ism-done { align-items: center; text-align: center; padding-top: 30px; }
.ism-ok { width: 96px; height: 96px; border-radius: 50%; background: rgba(52,211,153,.2); color: var(--green); font-size: 54px; display: grid; place-items: center; font-weight: 800; }
.ism-seg { align-self: flex-start; }
.ism-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.ism-chips button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card2); font-weight: 600; font-size: 15px; cursor: pointer; color: var(--text); }
.ism-chips button b { margin-left: 4px; color: var(--muted); }
.ism-chips button.on { background: var(--cyan); color: #04121F; border-color: var(--cyan); }
.ism-chips button.on b { color: #04121F; }
.ism-list { display: grid; gap: 10px; }
.ism-li { padding: 14px 16px; border-radius: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; box-shadow: inset 4px 0 0 var(--muted); }
.ism-li.sev-high { box-shadow: inset 4px 0 0 var(--red); } .ism-li.sev-medium { box-shadow: inset 4px 0 0 var(--amber); } .ism-li.sev-low { box-shadow: inset 4px 0 0 var(--green); }
.ism-li-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ism-li-top b { font-size: 17px; }
.ism-li .muted { font-size: 14px; }
.ism-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--card2); color: var(--muted); }
.ism-tag.sev-high, .ism-tag.st-overdue { background: rgba(248,113,113,.16); color: var(--red); }
.ism-tag.sev-medium, .ism-tag.st-in_progress { background: rgba(251,191,36,.16); color: var(--amber); }
.ism-tag.sev-low, .ism-tag.st-solved { background: rgba(52,211,153,.16); color: var(--green); }
.ism-tag.st-received { background: rgba(63,208,224,.15); color: var(--cyan); }
.ism-flow { display: flex; gap: 6px; }
.ism-flow div { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--card); color: var(--muted); font-weight: 600; font-size: 14px; min-width: 0; }
.ism-flow i { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; background: var(--card2); }
.ism-flow .done { color: var(--text); }
.ism-flow .done i { background: var(--green); color: #071630; }
.ism-flow .now { color: var(--text); box-shadow: inset 0 0 0 2px var(--amber); }
.ism-flow .now i { background: var(--amber); color: #071630; }
.ism-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.ism-acts .btn { min-height: 56px; font-size: 17px; padding: 0 22px; }
.ism-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.ism-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ism-card { padding: 16px 18px; }
.ism-card h3 { margin: 0 0 10px; font-size: 17px; }
.ism-p { margin: 0 0 12px; line-height: 1.5; white-space: pre-wrap; }
.ism-kv2 { display: grid; grid-template-columns: 140px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ism-kv2:last-child { border-bottom: 0; }
.ism-kv2 span { color: var(--muted); }
.ism-kv2 b { font-weight: 600; white-space: pre-wrap; }
.ism-lg { font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.ism-lg small { flex: none; }
.ism-cm { display: flex; gap: 8px; margin-top: 10px; }
@media (max-width: 760px) {
  .ism-grid { grid-template-columns: 1fr; }
  .ism-flow span { display: none; }
  .ism-flow .now span { display: inline; }
  .ism-flow .now { flex: 3.2; }
  .ism-flow span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ism-kv2 { grid-template-columns: 120px 1fr; }
}/* Product list / species list: cards side by side, compact list, detailed list (lvSeg "cat-prod" / "cat-sp") */
.ct-tools > .seg:not(.lv-seg) { margin: 0 !important; }
.pl-lv { display: grid; gap: 10px; margin-bottom: 6px; }
.pl-lv.lv-cards { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.pl-lv.lv-cards > .item { padding: 12px; gap: 4px; }
.pl-lv.lv-cards .meta { gap: 2px 10px; }
.pl-lv:not(.lv-detail) .pl-d { display: none; }
.pl-lv.lv-list > .item { gap: 4px 12px; }
.pl-lv .pl-main { flex: 1 1 140px; }
.pl-lv.lv-list .meta, .pl-lv.lv-detail .meta { margin-left: auto; }
.pl-lv.lv-detail > .item { padding: 10px 14px; }

/* Count sample (shrimp): one step at a time, then the result */
.mc-step{display:flex;flex-direction:column;gap:12px}
.mc-h{display:flex;align-items:flex-start;gap:10px}
.mc-h>span{display:flex;flex-direction:column;gap:2px}
.mc-h>span>b{font-size:1.15rem}
.mc-n .input{font-size:1.6rem;text-align:center}
.mc-by{display:flex;flex-direction:column;gap:8px}
.mc-by .ms-num{display:flex;align-items:center;gap:6px}
.mc-res{display:flex;flex-direction:column;gap:8px}
.mc-res .ms-f{display:flex;align-items:center;gap:8px}
.mc-res .ms-f>span{flex:1}
.mc-big{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.mc-big>div{display:flex;flex-direction:column;align-items:center;padding:12px;border-radius:12px;background:rgba(127,127,127,.12)}
.mc-big b{font-size:2rem;line-height:1.1}
.mc-fit{padding:8px 12px;border-radius:10px;font-weight:600}
.mc-fit.in{background:rgba(34,160,90,.18);color:#1f9d55}
.mc-fit.small,.mc-fit.big{background:rgba(220,60,60,.16);color:#d64545}
.mc-net{border-top:1px solid rgba(127,127,127,.25);padding-top:8px}
.mc-step,.mc-res{padding:16px}
.mc-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.mc-c{display:flex;flex-direction:column;gap:4px;min-width:0}
.mc-c .input{width:100%;min-width:0;text-align:center}

/* ISM phase 2 */
.ism-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ism-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ism-tag.tk-new { background: rgba(63,208,224,.15); color: var(--cyan); }
.ism-tag.tk-in_progress, .ism-tag.rs-awaiting_sign, .ism-tag.cl-due { background: rgba(251,191,36,.16); color: var(--amber); }
.ism-tag.tk-done, .ism-tag.tk-verified, .ism-tag.rs-done, .ism-tag.cl-ok { background: rgba(52,211,153,.16); color: var(--green); }
.ism-sec { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 10px 0 0; display: flex; align-items: center; gap: 8px; }
.ism-sec b { background: var(--red); color: #fff; border-radius: 999px; padding: 1px 9px; font-size: 12px; letter-spacing: 0; }
.ism-li.off { opacity: .55; }
.ism-list.lv-cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ism-donebtn { background: var(--green); color: #04121F; border: 0; width: 100%; text-align: left; min-height: 72px; border-radius: 18px; padding: 12px 20px; font-size: 22px; font-weight: 800; cursor: pointer; }
.ism-src { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--text); }
.ism-src b { color: var(--cyan); }
.ism-lgpic { margin-top: 6px; }
.ism-prog { height: 8px; border-radius: 999px; background: var(--card2); overflow: hidden; }
.ism-prog i { display: block; height: 100%; background: var(--cyan); transition: width .2s; }
.ism-q { font-size: 26px; line-height: 1.25; font-weight: 700; margin: 6px 0; }
.ism-ans { display: grid; gap: 10px; }
.ism-ans button { min-height: 80px; border-radius: 18px; border: 2px solid var(--line); background: var(--card2); color: var(--text); font-size: 22px; font-weight: 800; cursor: pointer; }
.ism-ans button.ok.on { background: rgba(52,211,153,.22); border-color: var(--green); color: var(--green); }
.ism-ans button.nok.on { background: rgba(248,113,113,.2); border-color: var(--red); color: var(--red); }
.ism-ans button.na.on { background: rgba(148,163,184,.2); border-color: var(--muted); }
.ism-num { font-size: 34px; text-align: center; min-height: 72px; font-weight: 800; }
.ism-pick.one { grid-template-columns: 1fr; }
.ism-pick button small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.ism-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); text-decoration: none; width: 100%; text-align: left; font: inherit; cursor: pointer; }
.ism-row:last-child { border-bottom: 0; }
div.ism-row { cursor: default; }
.ism-row > span { display: flex; flex-direction: column; gap: 2px; }
.ism-row > b { white-space: nowrap; }
.ism-a-ok { color: var(--green); } .ism-a-nok { color: var(--red); } .ism-a-na { color: var(--muted); }
.ism-f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ism-f3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.ism-fs { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ism-form { display: flex; flex-direction: column; gap: 10px; }
.ism-tabs { margin-bottom: 4px; }
.ism-admlink { display: block; padding: 14px 18px; border-radius: 18px; text-decoration: none; font-weight: 700; color: var(--cyan); }
.ism-mxw { overflow: auto; }
.ism-mx { border-collapse: collapse; width: 100%; font-size: 14px; }
.ism-mx th, .ism-mx td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.ism-mx th:first-child, .ism-mx td:first-child { text-align: left; white-space: normal; }
.ism-mx tbody th { text-align: left; font-weight: 600; white-space: normal; min-width: 160px; }
.ism-mx small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.ism-mx td.mx-due { color: var(--red); font-weight: 700; }
.ism-mx td.mx-ok { color: var(--green); }
.ism-mx td.mx-na, .ism-mx td.mx-none { opacity: .4; }
.ism-items { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.ism-item { display: grid; grid-template-columns: 26px 1fr 130px 150px auto; gap: 8px; align-items: center; }
.ism-item-n { color: var(--muted); font-weight: 700; text-align: right; }
.ism-item-b { display: flex; gap: 4px; }
.ism-item-b button { width: 38px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); color: var(--text); cursor: pointer; }
.ism-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
@media (max-width: 600px) {
  .ism-f2, .ism-f3 { grid-template-columns: 1fr; }
  .ism-item { grid-template-columns: 22px 1fr 1fr; gap: 6px; }
  .ism-item > :nth-child(2), .ism-item > .ism-item-b { grid-column: 2 / -1; }
  .ism-item > :nth-child(3) { grid-column: 2; }
  .ism-item > :nth-child(4) { grid-column: 3; }
  .ism-item select { font-size: 14px; min-width: 0; }
  .ism-item-b { justify-content: flex-end; }
  .ism-item-n { align-self: start; padding-top: 10px; }
}

/* ISM drills */
.ism-pick.multi button:not(.on) { opacity: .5; text-decoration: line-through; }
.ism-people { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.ism-people span { padding: 6px 10px; border-radius: 999px; background: rgba(63,208,224,.14); font-size: 14px; }
.ism-people.out span { background: var(--card2); color: var(--muted); }
.ism-vr { padding: 10px 0; border-top: 1px solid var(--line); }
.ism-vr-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.ism-vr .ism-chips { flex-wrap: wrap; }

/* ISM work permits + SJA */
.ism-ptypes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ism-ptype { position: relative; min-height: 110px; border-radius: 18px; background: var(--card2); border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; text-align: left; gap: 2px; cursor: pointer; color: var(--text); }
.ism-ptype .ic { position: absolute; top: 12px; left: 14px; font-size: 26px; }
.ism-ptype b { font-size: 18px; line-height: 1.15; }
.ism-ptype small { color: var(--muted); font-size: 13px; }
.ism-ptype.on { background: rgba(63,208,224,.2); border: 2px solid var(--cyan); }
.ism-people button { min-height: 52px; font-size: 16px; }
.ism-hzs { display: flex; flex-direction: column; gap: 10px; }
.ism-hz { padding: 12px; border-radius: 16px; display: flex; flex-direction: column; gap: 8px; }
.ism-hz.sev-high { box-shadow: inset 4px 0 0 var(--red); } .ism-hz.sev-medium { box-shadow: inset 4px 0 0 var(--amber); } .ism-hz.sev-low { box-shadow: inset 4px 0 0 var(--green); }
.ism-hz-top { display: flex; align-items: center; gap: 10px; }
.ism-hz-top > b { font-size: 18px; min-width: 20px; }
.ism-hz-top .seg { flex: 1; }
.ism-hz textarea { min-height: 0; resize: vertical; }
.ism-addhz { width: 100%; margin-top: 10px; border-style: dashed; }
.ism-checks { display: flex; flex-direction: column; gap: 8px; }
.ism-chk { display: grid; grid-template-columns: 1fr 56px 56px; gap: 8px; align-items: center; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); font-size: 16px; }
.ism-chk.set { border-color: rgba(52,211,153,.45); }
.ism-chk button { height: 48px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: 18px; font-weight: 800; cursor: pointer; }
.ism-chk button.on { background: rgba(63,208,224,.2); border: 2px solid var(--cyan); }
.ism-chk button.on.ok { background: var(--green); border-color: var(--green); color: #04121F; }
.ism-gas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ism-gas .input { font-size: 22px; font-weight: 700; }
.ism-gas .input.bad { border-color: var(--red); color: var(--red); }
.ism-pact { gap: 10px; }
.ism-nobtn { background: none; border: 2px solid var(--red); color: var(--red); width: 100%; text-align: left; min-height: 72px; border-radius: 18px; padding: 12px 20px; font-size: 22px; font-weight: 800; cursor: pointer; }
.ism-tag.pm-applied { background: rgba(251,191,36,.16); color: var(--amber); }
.ism-tag.pm-approved, .ism-tag.pm-active { background: rgba(52,211,153,.16); color: var(--green); }
.ism-tag.pm-rejected { background: rgba(248,113,113,.16); color: var(--red); }
.ism-li.pmt-applied { box-shadow: inset 4px 0 0 var(--amber); } .ism-li.pmt-approved { box-shadow: inset 4px 0 0 var(--green); }
.ism-sja { width: 100%; border-collapse: collapse; font-size: 15px; }
.ism-sja th { text-align: left; color: var(--muted); font-weight: 600; font-size: 13px; padding: 4px 6px; }
.ism-sja td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.ism-chkv { display: flex; gap: 10px; padding: 4px 0; font-size: 15px; }
.ism-chkv > span:first-child { min-width: 28px; font-weight: 800; }
@media (max-width: 560px) { .ism-pact { grid-template-columns: 1fr; } .ism-sja thead { display: none; } .ism-sja tr { display: grid; grid-template-columns: 1fr auto; } .ism-sja td:nth-child(2) { grid-column: 1; grid-row: 2; border-top: 0; color: var(--muted); padding-top: 0; } }
