/* ငါးဘောင်ချာ — calm, finger-friendly, and the same app on a phone, a tablet and a computer.
   How the layout works:
   · every size is in rem; <html data-size> picks the scale (သေး / ပုံမှန် / ကြီး in ⚙️ ဆက်တင်)
   · the page itself never scrolls: #app is a grid (top bar · screen · tabs) and each screen scrolls inside #main
   · narrow screens: tabs along the bottom. From 720px wide (or a phone turned on its side): the tabs become a rail
     on the left and the top bar goes away. From 1200px: the rail opens into a sidebar with the shop's name.
   Font: Noto Sans Myanmar → Pyidaungsu → Myanmar Text → Padauk (whatever the device has). */
:root {
  --font: "Noto Sans Myanmar", "Pyidaungsu", "Myanmar Text", "Padauk", system-ui, sans-serif;
  --ctl: 3rem; --ctl-lg: 3.4rem; --ctl-sm: 2.5rem;         /* heights of inputs and buttons */
  --r: 1rem; --r-sm: .75rem; --pad: 1rem; --gap: .75rem;
  --top-h: 3.25rem; --nav-h: 3.9rem; --rail-w: 5.5rem;
  color-scheme: light;
  /* ☀️ light (the default) */
  --pri: #0b7285; --pri-d: #095c6b; --pri-l: #d9f0f4; --pri-ll: #f0f9fb; --on-pri: #fff;
  --pri-fill: linear-gradient(180deg, #0e8aa0, #0b7285); --pri-fill-line: #095c6b;
  --bg: #eef3f6; --card: #fff; --field: #fff; --ink: #16262e; --muted: #596c76; --line: #d6e1e7;
  --red: #c62828; --red-l: #fdeaea; --red-fill: #c62828; --red-line: #f0bcbc;
  --green: #2e7d32; --green-l: #e6f4e7; --green-fill: #2e7d32; --green-ink: #1b5e20;
  --amber: #b45309; --amber-l: #fff3dc; --amber-fill: #b45309; --amber-line: #f3d29c; --amber-l2: #fff0d6; --amber-line2: #f0c987;
  --blue: #1d4ed8; --blue-l: #e6edff; --blue-line: #c9d7fb;
  --tint-line: #c9e3ea; --tile-line: #c5e1e8; --tile-a: #f6fcfd; --tile-b: #e9f6f9; --ctrl-line: #b4c6ce;
  --done-bg: #fafdfa; --paper-bg: #e1eaee; --scrim: rgba(15, 30, 40, .5);
  --top-bg: linear-gradient(135deg, #0b7285, #0a5a6c); --top-ink: #fff; --top-chip: rgba(255, 255, 255, .16);
  --osum-bg: linear-gradient(135deg, #0e8aa0, #0a5a6c);
  --toast-bg: #16262e; --toast-ink: #fff;
  --shadow: 0 1px 2px rgba(10, 50, 60, .05), 0 3px 10px rgba(10, 50, 60, .05);
  --pop-shadow: 0 12px 30px rgba(0, 0, 0, .16); --drag-shadow: 0 8px 24px rgba(10, 50, 60, .28);
}
/* 🌙 dark: ink-blue-grey ground, soft cards, one teal accent */
:root[data-theme="dark"] {
  color-scheme: dark;
  --pri: #2bb3a3; --pri-d: #5fd8c9; --pri-l: #17403d; --pri-ll: #14272a; --on-pri: #04201c;
  --pri-fill: #2bb3a3; --pri-fill-line: #2bb3a3;
  --bg: #0e1418; --card: #161e23; --field: #1c262c; --ink: #e8eef1; --muted: #93a3ad; --line: #2a373f;
  --red: #ff8a80; --red-l: #3a1f22; --red-fill: #cf3f3f; --red-line: #6b3338;
  --green: #62d98f; --green-l: #13301f; --green-fill: #25804a; --green-ink: #8fe5ae;
  --amber: #f0b44c; --amber-l: #362e12; --amber-fill: #a85f00; --amber-line: #6b5a22; --amber-l2: #3f3414; --amber-line2: #7a6528;
  --blue: #8db2ff; --blue-l: #1c2a4a; --blue-line: #34487a;
  --tint-line: #25454a; --tile-line: #2a4147; --tile-a: #1c292e; --tile-b: #162126; --ctrl-line: #4a5c66;
  --done-bg: #131d1a; --paper-bg: #0a0f12; --scrim: rgba(0, 0, 0, .66);
  --top-bg: linear-gradient(135deg, #182329, #121a1f); --top-ink: #e8eef1; --top-chip: rgba(255, 255, 255, .08);
  --osum-bg: linear-gradient(135deg, #1f8576, #17625a);
  --toast-bg: #2d3b44; --toast-ink: #fff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 3px 10px rgba(0, 0, 0, .25);
  --pop-shadow: 0 12px 30px rgba(0, 0, 0, .55); --drag-shadow: 0 8px 24px rgba(0, 0, 0, .6);
}
html { font-size: 17px; }
html[data-size="sm"] { font-size: 15px; }
html[data-size="lg"] { font-size: 19px; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.6; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
body { font-size: 1rem; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input[type=checkbox], input[type=radio] { accent-color: var(--pri); }
h1, h2, h3 { line-height: 1.45; }
h2 { font-size: 1.3rem; margin: 0; }
p { margin: .35rem 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }
.ico { width: 1.5rem; height: 1.5rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- the frame: top bar · screen · tabs ---------- */
#app { display: grid; height: 100vh; height: 100dvh; grid-template: "top" auto "main" minmax(0, 1fr) "nav" auto / minmax(0, 1fr); }
#topbar { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: var(--top-h); padding: env(safe-area-inset-top) max(.8rem, env(safe-area-inset-right)) 0 max(.8rem, env(safe-area-inset-left)); background: var(--top-bg); color: var(--top-ink); }
#main { grid-area: main; min-width: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: var(--pad) max(var(--pad), env(safe-area-inset-right)) 2rem max(var(--pad), env(safe-area-inset-left)); }
#main[data-screen="new"] { padding: 0; overflow: hidden; }
#nav { grid-area: nav; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.brand { display: flex; align-items: center; gap: .6rem; min-width: 0; font-weight: 800; font-size: 1.08rem; }
.brand .logo { flex: none; width: 2.1rem; height: 2.1rem; border-radius: .65rem; display: flex; align-items: center; justify-content: center; background: var(--top-chip); }
.brand .bn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-brand, .nav-foot { display: none; }
.nav-tabs { flex: 1; display: flex; min-width: 0; }
.navbtn { flex: 1 1 0; min-width: 0; min-height: var(--nav-h); border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; color: var(--muted); font-size: .74rem; font-weight: 700; line-height: 1.35; padding: .25rem .1rem; position: relative; }
.navbtn .lb { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.navbtn .lb.short { display: none; }
@media (max-width: 479px) { .navbtn .lb.full { display: none; } .navbtn .lb.short { display: block; } }
.navbtn .icw { display: flex; align-items: center; justify-content: center; width: 3.4rem; height: 1.9rem; border-radius: 1rem; position: relative; }
.navbtn.on { color: var(--pri-d); }
.navbtn.on .icw { background: var(--pri-l); }
.navbtn .dot { position: absolute; top: -.15rem; right: .35rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 1rem; background: var(--amber-fill); color: #fff; font-size: .68rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* sync status: a small pill (top bar on phones, foot of the rail on wider screens) */
.syncchip { flex: none; display: inline-flex; align-items: center; gap: .4rem; min-height: 2.3rem; max-width: 60%; padding: 0 .7rem; border: 0; border-radius: 2rem; background: var(--top-chip); color: inherit; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.syncchip .ico { width: 1.3rem; height: 1.3rem; }
.syncchip .st { overflow: hidden; text-overflow: ellipsis; }
#topbar .syncchip.ok .st { display: none; }
.syncchip.wait { background: var(--amber-l); color: var(--amber); }
.syncchip.bad { background: var(--red-l); color: var(--red); }
.syncchip.busy .ico { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* from tablet width, or a phone on its side: the tabs stand on the left, no top bar */
@media (min-width: 720px), (orientation: landscape) and (max-height: 520px) and (min-width: 560px) {
  #app { grid-template: "nav main" minmax(0, 1fr) / var(--rail-w) minmax(0, 1fr); }
  #topbar { display: none; }
  #nav { flex-direction: column; align-items: stretch; gap: .35rem; border-top: 0; border-right: 1px solid var(--line); padding: calc(.7rem + env(safe-area-inset-top)) 0 calc(.6rem + env(safe-area-inset-bottom)) env(safe-area-inset-left); }
  .nav-brand { display: flex; align-items: center; justify-content: center; gap: .65rem; padding: 0 .5rem .5rem; min-width: 0; font-weight: 800; }
  .nav-brand .logo { flex: none; width: 2.6rem; height: 2.6rem; border-radius: .8rem; display: flex; align-items: center; justify-content: center; background: var(--pri-fill); color: var(--on-pri); }
  .nav-brand .bn { display: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-tabs { flex-direction: column; gap: .2rem; overflow-y: auto; }
  .navbtn { flex: none; min-height: 4rem; font-size: .78rem; }
  .nav-foot { display: flex; justify-content: center; padding: 0 .4rem; }
  .nav-foot .syncchip { max-width: 100%; background: var(--bg); color: var(--muted); }
  .nav-foot .syncchip.ok { color: var(--green); }
  .nav-foot .syncchip.wait { background: var(--amber-l); color: var(--amber); }
  .nav-foot .syncchip.bad { background: var(--red-l); color: var(--red); }
  .nav-foot .syncchip .st { display: none; }
  #main { padding-top: 1.2rem; padding-left: 1.2rem; padding-right: max(1.2rem, env(safe-area-inset-right)); }
}
@media (orientation: landscape) and (max-height: 520px) and (min-width: 560px) {
  :root { --rail-w: 4.2rem; }
  .nav-brand { display: none; }
  .navbtn { min-height: 2.9rem; }
  .navbtn .lb { display: none; }
  #main { padding-top: .7rem; }
}
@media (min-width: 1200px) {
  :root { --rail-w: 14.5rem; }
  .nav-brand { justify-content: flex-start; padding: 0 1rem .9rem; }
  .nav-brand .bn { display: block; font-size: 1.05rem; }
  .nav-tabs { padding: 0 .6rem; }
  .navbtn { flex-direction: row; justify-content: flex-start; gap: .6rem; min-height: 3rem; padding: 0 .5rem; border-radius: .8rem; font-size: .98rem; }
  .navbtn .icw { width: 2.4rem; background: none !important; }
  .navbtn.on { background: var(--pri-l); }
  .nav-foot { justify-content: flex-start; padding: 0 .8rem; }
  .nav-foot .syncchip { width: 100%; justify-content: flex-start; }
  .nav-foot .syncchip .st { display: block; }
  #main { padding: 1.6rem 2rem 2.5rem; }
}

/* a screen's own width and its title row */
.page { max-width: 54rem; margin: 0 auto; }
.page.wide { max-width: 84rem; }
.phead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem .75rem; margin-bottom: .9rem; min-height: var(--ctl); }

/* ---------- basics ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; margin-bottom: .85rem; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card h3 { margin: 0 0 .6rem; font-size: .9rem; color: var(--muted); font-weight: 800; }
.card h3.gap { margin-top: .9rem; }
.row.twobtn > .btn { flex: 1 1 0; min-width: 0; padding: 0 .5rem; }
input[type=text], input[type=tel], input[type=search], input[type=date], input[type=password], textarea {
  width: 100%; min-width: 0; height: var(--ctl); border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 0 .85rem; background: var(--field); font-size: 1.05rem; outline: none; }
textarea { height: auto; min-height: 12rem; padding: .7rem .85rem; line-height: 1.75; }
input:focus, textarea:focus { border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-l); }
input.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }
input.big { height: var(--ctl-lg); font-size: 1.2rem; }
input.warn { border-color: var(--amber); background: var(--amber-l); }
input.bad { border-color: var(--red); background: var(--red-l); }
input[type=search] { margin-bottom: .6rem; }
input.bigsearch { height: var(--ctl-lg); font-size: 1.1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: var(--ctl); padding: 0 1.1rem; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--field); font-weight: 800; font-size: 1rem; white-space: nowrap; text-decoration: none; }
.btn:active, .chip:active, .fbtn:active, .cattab:active, .set-item:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.pri { background: var(--pri-fill); border-color: var(--pri-fill-line); color: var(--on-pri); }
.btn.danger { color: var(--red); border-color: var(--red-line); }
.btn.dangerfill { background: var(--red-fill); border-color: var(--red-fill); color: #fff; }
.btn.big { min-height: var(--ctl-lg); font-size: 1.1rem; padding: 0 1.3rem; }
.btn.sm { min-height: var(--ctl-sm); padding: 0 .8rem; font-size: .92rem; }
.btn.block { width: 100%; }
.btn.on { background: var(--pri-l); border-color: var(--pri); color: var(--pri-d); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn-x { flex: none; border: 0; background: none; font-size: 1.2rem; width: 2.75rem; height: 2.75rem; border-radius: 50%; color: var(--muted); }
.btn-x:active { background: var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: .55rem; }
.chip { border: 1.5px solid var(--line); background: var(--field); border-radius: 2rem; padding: .15rem 1rem; min-height: 2.75rem; font-weight: 800; font-size: .98rem; }
.chip.big { min-height: 3.2rem; padding: .3rem 1.4rem; font-size: 1.1rem; }
.chip.on { background: var(--pri); border-color: var(--pri); color: var(--on-pri); }
.chip.add { border-style: dashed; color: var(--pri-d); }
.chips.small .chip, .chip.small { min-height: 2.5rem; font-size: .92rem; padding: .1rem .9rem; }
.row { display: flex; gap: .6rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; flex-wrap: wrap; margin-top: .85rem; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.mt { margin-top: .7rem; }
.pad { padding: .5rem .25rem; }
.center { text-align: center; }
.muted { color: var(--muted); }
.red { color: var(--red); } .green { color: var(--green); } .blue { color: var(--blue); }
.empty { padding: 1.6rem .75rem; text-align: center; color: var(--muted); }
.empty.wide { grid-column: 1 / -1; }
.hint { font-size: .88rem; color: var(--muted); line-height: 1.6; }
.err { color: var(--red); font-weight: 800; min-height: 1.4em; margin-top: .25rem; }
.note { padding: .6rem .85rem; border-radius: var(--r-sm); font-size: .92rem; margin: .5rem 0; }
.note.ok { background: var(--green-l); color: var(--green-ink); }
.note.edit { background: var(--amber-l); color: var(--amber); font-weight: 800; margin: 0 0 .6rem; }
.field { margin-bottom: .85rem; }
.field > label { display: block; font-size: .9rem; color: var(--muted); font-weight: 800; margin-bottom: .3rem; }
.cb { display: flex; align-items: center; gap: .6rem; }
.cb input { width: 1.5rem; height: 1.5rem; }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .8rem; border: 0; border-radius: 2rem; font-size: .9rem; font-weight: 800; background: var(--bg); color: var(--muted); }
.badge.red { background: var(--red-l); color: var(--red); }
.badge.green { background: var(--green-l); color: var(--green); }
.badge.blue { background: var(--blue-l); color: var(--blue); }
button.badge { min-height: 2.3rem; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .5rem .5rem .5rem .85rem; border-radius: var(--r-sm); margin-bottom: .7rem; background: var(--amber-l); border: 1px solid var(--amber-line); font-size: .92rem; font-weight: 700; }
.banner.info { background: var(--blue-l); border-color: var(--blue-line); }
.banner.edit { background: var(--amber-l2); border-color: var(--amber-line2); font-weight: 800; }
.tag { font-size: .74rem; padding: 0 .6rem; border-radius: 2rem; background: var(--line); font-weight: 800; white-space: nowrap; }
.tag.red { background: var(--red-l); color: var(--red); }
.tag.green { background: var(--green-l); color: var(--green); }
.tag.blue { background: var(--blue-l); color: var(--blue); }
details summary { cursor: pointer; font-weight: 800; color: var(--pri-d); padding: .45rem 0; min-height: 2.5rem; }

/* a date shown our way (16/11/2026); the browser's own picker opens on tap */
.datebtn { position: relative; display: inline-flex; align-items: center; gap: .45rem; min-height: var(--ctl); min-width: 0; padding: 0 .85rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--field); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; }
.datebtn .ico { width: 1.25rem; height: 1.25rem; color: var(--muted); }
.datebtn input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.datebtn.warn { border-color: var(--amber); background: var(--amber-l); color: var(--amber); }
.datebtn.block { display: flex; width: 100%; }

/* two or three choices side by side */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .25rem; padding: .25rem; margin: 0 0 .85rem; border-radius: var(--r-sm); background: var(--line); }
.seg .btn { min-height: 2.6rem; padding: 0 .5rem; border: 0; background: none; color: var(--muted); white-space: normal; line-height: 1.35; font-size: .95rem; }
.seg .btn.on { background: var(--card); color: var(--pri-d); box-shadow: var(--shadow); }

/* ---------- new voucher: fish on the left (wide screens), the bill on the right ---------- */
.sale { height: 100%; display: flex; }
.sale-pick { display: none; }
.sale-bill { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sale-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--pad) max(var(--pad), env(safe-area-inset-right)) 1rem max(var(--pad), env(safe-area-inset-left)); }
.sale-bar { flex: none; display: flex; align-items: center; gap: .55rem; padding: .55rem max(var(--pad), env(safe-area-inset-right)) .55rem max(var(--pad), env(safe-area-inset-left)); background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(0, 0, 0, .06); }
.sale-bar .btn { min-height: 3.4rem; padding: 0 .9rem; }
.sale-bar .btn.pri { flex: 1; min-width: 0; font-size: 1.12rem; }
.sale-bar .add-fish-btn { flex: none; border-color: var(--pri); color: var(--pri-d); background: var(--pri-ll); }
.only-wide { display: none; }
.bar-sum { flex: 0 1 auto; min-width: 3.5rem; margin-right: auto; line-height: 1.3; }
.bar-k { font-size: .76rem; color: var(--muted); font-weight: 700; }
.bar-v { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (min-width: 760px), (orientation: landscape) and (max-height: 520px) and (min-width: 640px) {
  .sale-pick { display: flex; flex-direction: column; flex: 1.3; min-width: 0; padding: var(--pad) 1rem .8rem 1.2rem; }
  .sale-pick h3 { margin: 0 0 .6rem; font-size: .9rem; color: var(--muted); font-weight: 800; }
  .sale-pick .picker { flex: 1; min-height: 0; }
  .sale-bill { flex: 0 0 clamp(20rem, 40%, 29rem); border-left: 1px solid var(--line); background: var(--card); }
  .sale-bill .card { box-shadow: none; }
  .sale-scroll { padding-left: 1rem; padding-right: max(1rem, env(safe-area-inset-right)); }
  .sale-bar { padding-left: 1rem; }
  .add-fish-btn, .only-narrow { display: none !important; }
  .only-wide { display: inline; }
  .sale-bar .btn.pri { flex: 1; }
}
.vhead { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.vtitle { font-size: 1.2rem; font-weight: 800; line-height: 1.35; min-width: 0; white-space: nowrap; }
.vtitle small { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.datenote { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .4rem .75rem; }
.cwrap { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + .25rem); z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--pop-shadow); overflow: hidden; max-height: 60vh; overflow-y: auto; }
.suggest:empty { display: none; }
.suggest button { display: flex; justify-content: space-between; align-items: center; gap: .6rem; width: 100%; min-height: 3.3rem; padding: .4rem .9rem; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.suggest button:last-child { border-bottom: 0; }
.suggest button:active { background: var(--pri-ll); }
.custmore { margin-top: .6rem; }
.items { margin-bottom: .6rem; }
.irow { display: grid; grid-template-columns: 1.9rem 1fr auto; grid-template-areas: "no name amt" "no calc amt"; align-items: center; column-gap: .45rem; width: 100%; padding: .6rem .2rem; border: 0; border-bottom: 1px dashed var(--line); background: none; text-align: left; }
.irow:active { background: var(--pri-ll); }
.ino { grid-area: no; color: var(--muted); }
.iname { grid-area: name; font-weight: 800; font-size: 1.05rem; }
.icalc { grid-area: calc; color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.iamt { grid-area: amt; font-weight: 800; font-size: 1.12rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trow { display: flex; justify-content: space-between; align-items: center; gap: .7rem; padding: .3rem 0; }
.trow .v { font-weight: 800; font-size: 1.12rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trow.line { border-top: 2px solid var(--line); margin-top: .35rem; padding-top: .55rem; }
.trow.grand { border-top-color: var(--ink); }
.trow.bal { border-top: 3px solid var(--ink); }
.trow.bal .k { font-weight: 800; }
.trow.bal .v, .trow.bal b { font-size: 1.6rem; }
.trow.bal.red .v, .trow.bal.red .k { color: var(--red); }
.trow.bal.green .v { color: var(--green); }
.trow.bal.blue .v, .trow.bal.blue .k { color: var(--blue); }
.charges { margin: .35rem 0; }
.crow { display: grid; grid-template-columns: minmax(0, 1.2fr) 2.6rem minmax(0, 1fr) 2.4rem; gap: .35rem; align-items: center; margin: .45rem 0; }
.crow input { padding: 0 .6rem; font-size: 1rem; }
.crow .btn-x { width: 2.4rem; height: 2.4rem; }
.sign { height: var(--ctl); border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--green-l); color: var(--green); font-size: 1.25rem; font-weight: 800; }
.sign.neg { background: var(--red-l); color: var(--red); }

/* fish picker: search → tiles → group tabs at the bottom */
.picker { display: flex; flex-direction: column; min-height: 0; }
.picker > input[type=search] { flex: none; }
.fgrid { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(auto-fill, minmax(5.9rem, 1fr)); grid-auto-rows: min-content; gap: .5rem; align-content: start; padding: 2px; }
.fbtn { min-height: 4.2rem; padding: .35rem .25rem; border-radius: var(--r); border: 1.5px solid var(--tile-line); background: linear-gradient(180deg, var(--tile-a), var(--tile-b)); font-weight: 800; font-size: 1rem; line-height: 1.4; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow-wrap: anywhere; }
.catbar { flex: none; display: flex; gap: .45rem; overflow-x: auto; padding: .55rem 2px 2px; margin-top: .55rem; border-top: 1.5px solid var(--line); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.catbar::-webkit-scrollbar { display: none; }
.cattab { flex: none; min-height: var(--ctl); padding: 0 1.1rem; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--field); font-weight: 800; white-space: nowrap; }
.cattab.on { background: var(--pri); border-color: var(--pri); color: var(--on-pri); }
.psheet { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.psheet .picker { flex: 1; min-height: 0; }
.pfoot { flex: none; display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding-top: .6rem; margin-top: .5rem; border-top: 1px solid var(--line); }
.pfoot b { font-size: 1.12rem; }

/* one fish line */
.itemdlg .row input { flex: 1; }
.btn.plus { min-height: var(--ctl-lg); flex: none; }
.echo { min-height: 1.5em; font-size: 1.1rem; font-weight: 800; margin: -.25rem 0 .55rem; }
.echo.ok { color: var(--green); }
.echo.warn { color: var(--amber); font-size: .9rem; background: var(--amber-l); border-radius: .6rem; padding: .35rem .7rem; }
.parts { margin-bottom: .5rem; }
.chip.part { background: var(--pri-l); border-color: var(--pri); color: var(--pri-d); }
.amtbox { display: flex; justify-content: space-between; align-items: center; background: var(--pri-ll); border: 1.5px solid var(--tile-line); padding: .55rem .9rem; border-radius: var(--r-sm); margin-top: .5rem; font-weight: 700; }
.amtbox .amt, .amtbox b { font-size: 1.7rem; font-weight: 800; color: var(--pri-d); font-variant-numeric: tabular-nums; }

/* ---------- dialogs ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 38rem; max-height: 92vh; max-height: 92dvh; overflow: auto; overscroll-behavior: contain; background: var(--card); border-radius: 1.25rem 1.25rem 0 0; padding: .9rem 1rem calc(1rem + env(safe-area-inset-bottom)); animation: up .16s ease-out; }
.sheet:focus { outline: none; }
@keyframes up { from { transform: translateY(1.6rem); opacity: .6; } to { transform: none; opacity: 1; } }
.overlay.full .sheet { max-width: 54rem; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; overflow: hidden; display: flex; flex-direction: column; padding-top: calc(.9rem + env(safe-area-inset-top)); }
.overlay.full .sheet > * { flex: 1; min-height: 0; }
@media (min-width: 720px) {
  .overlay { align-items: center; padding: 1rem; }
  .sheet { border-radius: 1.25rem; }
  .overlay.full .sheet { height: min(94vh, 62rem); height: min(94dvh, 62rem); border-radius: 1.25rem; padding-top: .9rem; }
}
@media (orientation: landscape) and (max-height: 520px) { .overlay { align-items: center; } .sheet { max-height: 100vh; max-height: 100dvh; border-radius: 0; } }
.shead { flex: none !important; display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.shead b { font-size: 1.2rem; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.cbox { padding: .25rem 0; }
.cmsg { white-space: pre-line; font-size: 1.05rem; margin: .35rem 0 .7rem; line-height: 1.7; }
.cbox input { margin-bottom: .5rem; }
.prices { display: grid; gap: .5rem; }
.prow { display: grid; grid-template-columns: 6.5rem 1fr; gap: .6rem; align-items: center; font-weight: 700; }
.sheet .row.end.sticky { position: sticky; bottom: calc(-1rem - env(safe-area-inset-bottom)); background: var(--card); margin: .6rem -1rem calc(-1rem - env(safe-area-inset-bottom)); padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); z-index: 2; border-top: 1px solid var(--line); }

/* voucher / statement picture: the paper, then what you can do with it */
.vview { display: flex; flex-direction: column; min-height: 0; }
.paperwrap { flex: 1; min-height: 0; overflow: auto; background: var(--paper-bg); border-radius: var(--r-sm); padding: .5rem; }
.vpic { display: block; width: 100%; max-width: 600px; height: auto; margin: 0 auto; border-radius: 6px; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); background: #fff; }
.vacts { flex: none !important; display: flex; flex-wrap: wrap; gap: .55rem; padding-top: .7rem; }
.vacts .btn.pri { flex: 1 1 100%; }
.vacts .btn:not(.pri) { flex: 1 1 0; min-width: 0; padding: 0 .3rem; }
.vdel { flex: 1 1 100%; display: flex; gap: .55rem; margin-top: .3rem; padding-top: .7rem; border-top: 1px dashed var(--line); }
.vacts .vdel .btn { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 0; min-height: 3.1rem; padding: .2rem .35rem; line-height: 1.4; }
.vdel .btn small { font-size: .72rem; font-weight: 600; color: var(--muted); }
.vacts.inline .btn { flex: 1 1 0; }
.vacts.inline .btn.pri { flex: 3 1 0; }
@media (min-width: 900px) and (min-height: 521px) { /* room to spare: paper on the left, buttons down the right */
  .overlay.full .vview { display: grid; grid-template-columns: minmax(0, 1fr) 15.5rem; grid-template-rows: auto auto minmax(0, 1fr); column-gap: 1rem; }
  .vview > .shead, .vview > .okbar { grid-column: 1 / -1; }
  .vview > .paperwrap { grid-column: 1; grid-row: 3; }
  .vview > .vacts { grid-column: 2; grid-row: 3; flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; padding-top: 0; }
  .vview > .vacts .btn { flex: none; width: 100%; }
  .vview > .vacts .vdel { flex: none; margin-top: auto; }
  .vview > .vacts .vdel .btn { flex: 1 1 0; width: auto; }
}
.okbar { flex: none !important; background: var(--green-l); color: var(--green-ink); font-weight: 800; padding: .55rem .85rem; border-radius: var(--r-sm); margin-bottom: .6rem; font-size: .94rem; }
.okbar.bad { background: var(--amber-l); color: var(--amber); }
.steps { margin: .5rem 0 .85rem; padding-left: 1.5rem; line-height: 1.8; }

/* ---------- history / customers ---------- */
.datenav { display: grid; grid-template-columns: 2.7rem minmax(0, 1fr) 2.7rem auto; gap: .4rem; align-items: center; margin-bottom: .7rem; }
.datenav .btn { padding: 0 .7rem; }
.datenav .datebtn { justify-content: center; min-width: 0; padding: 0 .4rem; }
@media (max-width: 479px) { .datenav .datebtn .ico { display: none; } }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.stats.three .stat:first-child { grid-column: 1 / -1; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } .stats.three .stat:first-child { grid-column: auto; } }
.stat { background: var(--pri-ll); border-radius: var(--r-sm); padding: .45rem .8rem; min-width: 0; }
.stat .k { font-size: .78rem; color: var(--muted); font-weight: 700; }
.stat .v { font-size: 1.18rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.vlist, .vfiles { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.tablewrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .94rem; }
table.list th, table.list td { padding: .55rem .45rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.list th { color: var(--muted); font-size: .82rem; }
table.list .n { text-align: right; }
.vfile { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 4.4rem; padding: .55rem .8rem; text-align: left; background: var(--card); border: 1px solid var(--line); border-left: .35rem solid var(--pri); border-radius: var(--r); box-shadow: var(--shadow); }
.vfile:active { background: var(--pri-ll); transform: scale(.99); }
.vfile.pay { border-left-color: var(--green); }
.vfile.cancelled { opacity: .55; }
.vfile.cancelled .vf-name { text-decoration: line-through; }
.vf-ic { flex: none; font-size: 1.7rem; line-height: 1; }
.vf-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.5; }
.vf-name { font-weight: 800; font-size: 1.1rem; overflow-wrap: anywhere; }
.vf-meta { font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 .45rem; align-items: center; font-variant-numeric: tabular-nums; }
.vf-nums { font-size: .94rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.vf-nums .red { color: var(--red); }

.clist button { display: flex; justify-content: space-between; align-items: center; gap: .7rem; width: 100%; min-height: 3.8rem; padding: .5rem .9rem; border: 0; border-bottom: 1px solid var(--line); background: var(--card); text-align: left; font-size: 1.05rem; }
.clist button:last-child { border-bottom: 0; }
.clist button:active { background: var(--pri-ll); }
.cn { display: flex; flex-direction: column; min-width: 0; line-height: 1.45; }
.cn b { overflow-wrap: anywhere; }
.cn small { font-size: .82rem; color: var(--muted); }
.cbal { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* "ရက်အလိုက်": one block per day, one line per person who still owes */
.dgroup { margin: .7rem 0; }
.dhead { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem .9rem; background: var(--pri-l); border-bottom: 1px solid var(--tint-line); }
.dhead b { font-size: 1.05rem; }
.dhead small { font-size: .82rem; color: var(--muted); font-weight: 700; }
.dhead .dsum { text-align: right; line-height: 1.35; }
.dhead .dsum small { display: block; }
.dhead .dsum b { color: var(--red); font-size: 1.18rem; font-variant-numeric: tabular-nums; }
.drow { display: flex; justify-content: space-between; align-items: center; gap: .7rem; width: 100%; min-height: 4rem; padding: .55rem .9rem; border: 0; border-bottom: 1px solid var(--line); background: var(--card); text-align: left; font-size: 1.05rem; }
.drow:last-child { border-bottom: 0; }
.drow:active { background: var(--pri-ll); }
.drow .dwho { display: flex; flex-direction: column; min-width: 0; line-height: 1.45; }
.drow .dwho small { font-size: .82rem; color: var(--muted); }
.drow .dwho .dnow.ok { color: var(--green); font-weight: 700; }
.drow .dun { flex: none; text-align: right; font-weight: 800; font-size: 1.18rem; color: var(--red); font-variant-numeric: tabular-nums; line-height: 1.3; white-space: nowrap; }
.drow .dun small { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; }
.lsheet { display: flex; flex-direction: column; min-height: 0; }
.lsheet .ledger-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding-bottom: .35rem; }
.cinfo { display: grid; gap: .1rem; min-width: 0; }
.balbox { margin: .7rem 0; padding: .7rem .9rem; border-radius: var(--r-sm); background: var(--green-l); }
.balbox.red { background: var(--red-l); }
.balbox .k { font-weight: 800; }
.bigbal { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.3; overflow-wrap: anywhere; }
.balbox.red .bigbal, .balbox.red .k { color: var(--red); }
.balbox.green .bigbal, .balbox.green .k { color: var(--green); }
.lrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l1 bal" "l2 bal"; align-items: center; column-gap: .7rem; width: 100%; padding: .65rem .35rem; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
button.lrow:active { background: var(--pri-ll); }
.lrow .l1 { grid-area: l1; font-size: .96rem; }
.lrow .l2 { grid-area: l2; display: flex; flex-wrap: wrap; gap: 0 .9rem; font-size: .88rem; color: var(--muted); }
.lrow .l2 b { color: var(--ink); font-variant-numeric: tabular-nums; }
.lrow .lbal { grid-area: bal; text-align: right; font-weight: 800; font-size: 1.08rem; font-variant-numeric: tabular-nums; line-height: 1.3; white-space: nowrap; }
.lrow .lbal small { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; }
.lrow.pay .l1 b { color: var(--green); }
.lrow.cancelled { opacity: .55; }
.lrow.cancelled .l1 b { text-decoration: line-through; }
.lrow.opening { background: var(--amber-l); border-radius: .6rem; }

/* ---------- 📋 orders: day buttons, order cards, market list ---------- */
.daychips { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0 0 .7rem; }
.daychip { position: relative; min-height: 3.6rem; padding: .3rem .25rem; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.35; }
.daychip input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
label.daychip { cursor: pointer; }
.daychip small { font-size: .78rem; color: var(--muted); font-weight: 700; }
.daychip:active { transform: scale(.97); }
.daychip.on { border-color: var(--pri); background: var(--pri-l); color: var(--pri-d); }
.daychip .cnt { position: absolute; top: -.5rem; right: -.2rem; min-width: 1.6rem; height: 1.6rem; padding: 0 .4rem; border-radius: 1rem; background: var(--amber-fill); color: #fff; font-size: .82rem; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.osum { background: var(--osum-bg); border: 0; color: #fff; }
.osum .osum-day { font-size: 1.45rem; font-weight: 800; line-height: 1.45; }
.osum .osum-day small { display: block; font-size: .88rem; font-weight: 600; opacity: .92; }
.osum .ostats { display: flex; flex-wrap: wrap; gap: .2rem 1rem; margin: .45rem 0 .7rem; font-weight: 700; }
.osum .btn { background: #fff; color: #095c6b; border-color: #fff; }
.ocards { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.ocard { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 4.6rem; padding: .65rem .8rem; text-align: left; background: var(--card); border: 1px solid var(--line); border-left: .4rem solid var(--amber); border-radius: var(--r); box-shadow: var(--shadow); }
.ocard:active { background: var(--pri-ll); transform: scale(.99); }
.ocard.done { border-left-color: var(--green); background: var(--done-bg); }
.ocard .ost { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--amber-l); font-size: 1.2rem; }
.ocard.done .ost { background: var(--green-l); color: var(--green); font-weight: 800; }
.ocard .obody { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.ocard .oname { font-size: 1.15rem; font-weight: 800; overflow-wrap: anywhere; }
.ocard .olines { font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }
.ocard .onote { font-size: .82rem; color: var(--amber); font-weight: 700; }
.otag { flex: none; font-size: .78rem; padding: .1rem .6rem; border-radius: 2rem; font-weight: 800; white-space: nowrap; background: var(--amber-l); color: var(--amber); }
.otag.done { background: var(--green-l); color: var(--green); }
.olist { margin: .5rem 0; }
.oli { display: flex; justify-content: space-between; align-items: center; gap: .7rem; width: 100%; padding: .65rem .25rem; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-size: 1.05rem; line-height: 1.5; }
.oli b { min-width: 0; }
.oli .q { text-align: right; font-weight: 800; color: var(--pri-d); font-variant-numeric: tabular-nums; }
button.oli:active { background: var(--pri-ll); }
.cline { border: 1.5px solid var(--line); border-radius: var(--r); padding: .55rem .7rem .7rem; margin: .6rem 0; background: var(--card); }
.cline.off { opacity: .45; }
.cl-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.cl-head b { font-size: 1.05rem; line-height: 1.45; }
.cl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .35rem; }
.cl-grid .field { margin: 0; }
.cl-grid input { font-size: 1.1rem; }
.cl-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .5rem; }
.cl-amt { font-weight: 800; font-size: 1.18rem; font-variant-numeric: tabular-nums; color: var(--pri-d); }
.mprog { font-weight: 800; color: var(--muted); }
.mprog.all { color: var(--green); }
.mtop { background: var(--pri-l); border: 1px solid var(--tint-line); border-radius: var(--r-sm); padding: .45rem .8rem; line-height: 1.5; }
.mtop b { display: block; font-size: 1.05rem; color: var(--pri-d); }
.mtop small { font-size: .88rem; color: var(--muted); font-weight: 700; }
.mlist { padding: .2rem .8rem; margin-top: .5rem; }
.mhead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 .7rem; }
.mrow { display: grid; grid-template-columns: 2.9rem minmax(0, 1fr); gap: .6rem; align-items: start; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.mrow:last-child { border-bottom: 0; }
.mcheck { width: 2.7rem; height: 2.7rem; border-radius: var(--r-sm); border: 2.5px solid var(--ctrl-line); background: var(--field); color: transparent; font-size: 1.5rem; font-weight: 800; line-height: 1; }
.mrow.done .mcheck { background: var(--green-fill); border-color: var(--green-fill); color: #fff; }
.mname { font-size: 1.1rem; font-weight: 800; line-height: 1.45; }
.mwho { font-size: .84rem; color: var(--muted); line-height: 1.55; }
.mqty { font-size: 1.1rem; font-weight: 800; color: var(--pri-d); line-height: 1.45; }
.mrow.done .mname, .mrow.done .mqty { color: var(--muted); text-decoration: line-through; }
.mpr { display: flex; align-items: center; gap: .5rem; margin-top: .35rem; flex-wrap: wrap; }
.mpr label { font-size: .8rem; color: var(--muted); font-weight: 700; }
.mpr input { width: 8.5rem; height: 2.6rem; font-size: 1rem; }

/* ---------- checkout: one clear summary, then "how will they pay?" ---------- */
.cosum { background: var(--pri-ll); border: 1px solid var(--tint-line); border-radius: var(--r); padding: .55rem .8rem; margin-bottom: .7rem; }
.cosum .trow.tot .k, .cosum .trow.grand .k { font-weight: 800; font-size: 1.05rem; }
.cosum .trow.tot .v { font-size: 1.35rem; }
.cosum .trow.grand .v { font-size: 1.45rem; }
.addcharge { margin: .35rem 0 .25rem; }
.cnote { margin: -.1rem 0 .45rem; font-size: .86rem; line-height: 1.55; color: var(--muted); text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.qhead { font-size: 1.15rem; font-weight: 800; margin: .8rem 0 .45rem; }
.opts { display: grid; gap: .55rem; margin-bottom: .55rem; }
.opt { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 3.9rem; padding: .5rem .8rem; text-align: left; background: var(--field); border: 1.5px solid var(--line); border-radius: var(--r); }
.opt:active { background: var(--pri-ll); }
.opt .dot { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2.5px solid var(--ctrl-line); background: var(--field); }
.opt.on { border-color: var(--pri); background: var(--pri-ll); box-shadow: 0 0 0 3px var(--pri-l); }
.opt.on .dot { border-color: var(--pri); background: radial-gradient(circle, var(--pri) 0 46%, var(--field) 50%); }
.opt .ot { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 800; font-size: 1.02rem; line-height: 1.45; }
.opt .ot small { font-weight: 800; color: var(--pri-d); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.opt .ov { flex: none; text-align: right; font-size: .76rem; font-weight: 700; color: var(--muted); line-height: 1.35; }
.opt .ov b { display: block; font-size: .96rem; color: var(--red); font-variant-numeric: tabular-nums; white-space: nowrap; }
.opt .ov.zero b { color: var(--green); }
.opt .ov.adv b { color: var(--blue); }
.opt.custom { flex-wrap: wrap; align-items: center; cursor: text; }
.opt.custom .cin { flex: 1 1 100%; }
.opt.custom input { margin: 0; }
.checkout .trow .v { font-size: 1.18rem; }
.checkout .trow.line.bal { margin-top: .8rem; }
.rexplain { font-size: .96rem; font-weight: 700; color: var(--muted); margin: .1rem 0 .35rem; }
.rexplain.red { color: var(--red); } .rexplain.green { color: var(--green); } .rexplain.blue { color: var(--blue); }

/* ---------- ⚙️ settings: a list on the left, the chosen part on the right (one at a time on a phone) ---------- */
.set { display: grid; gap: 1.2rem; align-items: start; max-width: 70rem; margin: 0 auto; }
.set-menu { display: grid; gap: .5rem; }
.set-item { display: flex; align-items: center; gap: .8rem; width: 100%; min-height: 4rem; padding: .6rem .8rem; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.set-item .si { flex: none; width: 2.6rem; height: 2.6rem; border-radius: .8rem; display: flex; align-items: center; justify-content: center; background: var(--pri-l); color: var(--pri-d); }
.set-item .cn { flex: 1; }
.set-item .cn b { font-size: 1.05rem; }
.set-item > .ico:last-child { color: var(--muted); width: 1.2rem; height: 1.2rem; }
.set-back { display: inline-flex; align-items: center; gap: .2rem; min-height: var(--ctl-sm); margin: -.3rem 0 .5rem -.4rem; padding: 0 .7rem 0 .3rem; border: 0; background: none; color: var(--pri-d); font-weight: 800; }
.set[data-open="0"] .set-detail, .set[data-open="1"] .set-menu, .set[data-open="1"] > .phead { display: none; }
.set > .phead { margin-bottom: 0; }
@media (min-width: 900px) {
  .set { grid-template-columns: 17rem minmax(0, 1fr); }
  .set > .phead { grid-column: 1 / -1; display: flex !important; }
  .set[data-open] .set-menu, .set[data-open] .set-detail { display: block; }
  .set-menu { display: grid !important; position: sticky; top: 0; }
  .set-item { min-height: 3.4rem; box-shadow: none; border-color: transparent; background: none; }
  .set-item.on { background: var(--pri-l); border-color: var(--tint-line); }
  .set-item .si { width: 2.2rem; height: 2.2rem; background: var(--card); }
  .set-item .cn small, .set-item > .ico:last-child, .set-back { display: none; }
}
.themeopts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin-bottom: .5rem; }
.tcard { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .7rem .35rem .55rem; min-width: 0; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--field); font-weight: 800; line-height: 1.4; }
.tcard small { font-weight: 600; font-size: .74rem; color: var(--muted); line-height: 1.4; }
.tcard:active { transform: scale(.97); }
.tcard.on { border-color: var(--pri); background: var(--pri-ll); box-shadow: 0 0 0 3px var(--pri-l); }
.tprev { position: relative; overflow: hidden; width: 100%; max-width: 5.5rem; height: 3.5rem; margin-bottom: .2rem; border-radius: .6rem; border: 1px solid #7d8f99; }
.tprev i { position: absolute; left: 0; right: 0; top: 0; height: 24%; }
.tprev b { position: absolute; left: 9%; right: 9%; top: 38%; height: 42%; border-radius: .35rem; }
.tprev b::after { content: ''; position: absolute; right: 8%; top: 28%; width: 28%; height: 44%; border-radius: .25rem; }
.tprev.light { background: #edf3f6; } .tprev.light i { background: #0b7285; } .tprev.light b { background: #fff; border: 1px solid #d3e0e6; } .tprev.light b::after { background: #0b7285; }
.tprev.dark { background: #0e1418; } .tprev.dark i { background: #1c262c; } .tprev.dark b { background: #161e23; border: 1px solid #2a373f; } .tprev.dark b::after { background: #2bb3a3; }
.tprev.auto { background: linear-gradient(110deg, #edf3f6 50%, #0e1418 50%); }
.tprev.auto i { background: linear-gradient(110deg, #0b7285 50%, #1c262c 50%); }
.tprev.auto b { background: linear-gradient(110deg, #fff 50%, #161e23 50%); border: 1px solid #7d8f99; }
.tprev.auto b::after { background: linear-gradient(110deg, #0b7285 50%, #2bb3a3 50%); }
.devrow { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.devrow:last-child { border-bottom: 0; }
.devrow > .ico { color: var(--muted); }
.devrow .cn { flex: 1; }
.syncline { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: var(--r-sm); background: var(--green-l); color: var(--green-ink); font-weight: 700; }
.syncline.wait { background: var(--amber-l); color: var(--amber); }
.syncline.bad { background: var(--red-l); color: var(--red); }

/* fish list (inside settings) */
.frow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .5rem; align-items: center; min-height: 3.4rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.frow:last-child { border-bottom: 0; }
.frow .drag, .frow .totop { width: 2.6rem; height: 2.6rem; border-radius: .6rem; border: 1px solid var(--line); background: var(--field); color: var(--muted); }
.frow .drag { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; font-size: 1.15rem; color: var(--pri-d); background: var(--pri-ll); border-color: var(--tint-line); }
.frow .totop:disabled { opacity: .3; }
.flist.dragmode { user-select: none; -webkit-user-select: none; }
.flist.dragmode .frow { transition: transform .14s ease; }
.flist.dragmode .frow.dragging { transition: none; position: relative; z-index: 5; background: var(--card); border-radius: var(--r-sm); box-shadow: var(--drag-shadow); }
.finfo { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; min-height: 2.8rem; border: 0; background: none; text-align: left; padding: .1rem 0; min-width: 0; }
.finfo b { font-size: 1.05rem; overflow-wrap: anywhere; }
.finfo:active { background: var(--pri-ll); }

/* ---------- 🔑 the sign-in page ---------- */
#gate { position: fixed; inset: 0; z-index: 90; overflow-y: auto; display: flex; padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom)); background: var(--bg); }
.gate-card { width: 100%; max-width: 26rem; margin: auto; background: var(--card); border: 1px solid var(--line); border-radius: 1.4rem; padding: 1.4rem 1.2rem 1.2rem; box-shadow: var(--pop-shadow); }
.gate-brand { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.1rem; line-height: 1.4; }
.gate-brand b { display: block; font-size: 1.3rem; }
.gate-brand small { color: var(--muted); font-size: .82rem; }
.gate-logo { flex: none; width: 3.2rem; height: 3.2rem; border-radius: 1rem; display: flex; align-items: center; justify-content: center; background: var(--pri-fill); color: var(--on-pri); }
.gate-logo .ico { width: 2rem; height: 2rem; }
.gate-form h1 { font-size: 1.2rem; margin: 0 0 .7rem; }
.gate-form label { display: block; font-size: .9rem; font-weight: 800; color: var(--muted); margin-bottom: .75rem; }
.gate-form label input { margin-top: .3rem; height: var(--ctl-lg); font-size: 1.1rem; color: var(--ink); font-weight: 400; }
.passwrap { position: relative; }
.passwrap input { padding-right: 3.2rem; }
.passwrap .eye { position: absolute; right: .2rem; bottom: .2rem; width: 2.9rem; height: calc(var(--ctl-lg) - .4rem); border: 0; background: none; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.field .passwrap .eye { height: calc(var(--ctl) - .4rem); }
.gate-wait { display: flex; align-items: center; justify-content: center; gap: .7rem; padding: 2rem .5rem; color: var(--muted); font-weight: 700; margin: auto; }
.spin { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--pri); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.gate-msg { padding: .7rem .9rem; border-radius: var(--r-sm); margin-bottom: .8rem; font-weight: 700; background: var(--blue-l); color: var(--blue); }
.gate-msg.bad { background: var(--amber-l); color: var(--amber); }
.gate-local { margin-top: 1rem; padding-top: .6rem; border-top: 1px dashed var(--line); }
.gate-local summary { font-size: .9rem; }
.gate-dev { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 3.6rem; margin-bottom: .5rem; padding: .5rem .8rem; text-align: left; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--field); }
.gate-dev .cn { flex: 1; }

/* ---------- toast / update ---------- */
/* messages drop in at the top, where they never cover the buttons along the bottom */
#toast { position: fixed; left: 50%; top: calc(.7rem + env(safe-area-inset-top)); z-index: 300; width: max-content; max-width: min(92vw, 30rem); padding: .6rem 1.1rem; border-radius: 1.2rem; background: var(--toast-bg); color: var(--toast-ink); text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, -1rem); transition: .2s; font-size: .94rem; font-weight: 700; box-shadow: var(--pop-shadow); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--red-fill); color: #fff; }
.updbar { position: fixed; top: 0; left: 0; right: 0; z-index: 400; width: 100%; padding: calc(.8rem + env(safe-area-inset-top)) .8rem .8rem; border: 0; background: var(--amber-fill); color: #fff; font-weight: 800; }

/* ---------- print: the picture itself ---------- */
#printArea { display: none; }
@media print {
  @page { margin: 8mm; }
  html, body { background: #fff; height: auto; overflow: visible; }
  #app, #gate, #toast, .overlay, .updbar { display: none !important; }
  #printArea { display: block; }
  #printArea img { display: block; width: 100%; max-width: 180mm; margin: 0 auto; }
}

/* very small phones (320–350px wide): everything one step smaller so nothing is cut off */
@media (max-width: 350px) {
  html { font-size: 15px; }
  html[data-size="sm"] { font-size: 14px; }
  html[data-size="lg"] { font-size: 16.5px; }
  .sale-bar { gap: .4rem; }
  .sale-bar .btn { padding: 0 .6rem; }
}
