/* Ptashka Service: dark field cabinet, by the brand guide. e-Ukraine: Ministry of Digital Transformation, CC BY 4.0.
   Alumni Sans and JetBrains Mono: SIL OFL. */
@font-face { font-family: PuBody; src: url("brand/e-ukraine-regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: PuBody; src: url("brand/e-ukraine-medium.otf") format("opentype"); font-weight: 500 700; font-display: swap; }
@font-face { font-family: PuHead; src: url("brand/alumni-sans-bold-italic.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: PuMono; src: url("brand/jetbrains-mono.ttf") format("truetype"); font-display: swap; }
:root {
  --bg: #07120d; --card: #111d16; --strong: #00301e; --ink: #fff; --muted: #c3d2c8; --line: #42574b; --soft: #22382a;
  --accent: #00a75d; --accent-ink: #000; --sand: #fdd491; --ok: #7cc495; --warn: #fdd491; --warn-bg: #322817; --bad: #ffb8ad; --bad-bg: #3a2522;
  --radius: 11px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); font: 15px/1.5 PuBody, system-ui, -apple-system, "Segoe UI", sans-serif; overflow-wrap: anywhere; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(#0003, #0003), url("brand/camo.jpg") center / cover no-repeat var(--bg); }
main { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 13px 32px; }
body.has-nav main { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
main > * { margin-top: 0; }
h1 { font: italic 700 clamp(33px, 9vw, 45px)/1 PuHead, system-ui, sans-serif; text-transform: uppercase; letter-spacing: .015em; margin: 0 0 8px; }
h2 { font: 500 16px/1.35 PuBody, system-ui, sans-serif; margin: 18px 0 8px; }
.card h2 { margin: 0 0 4px; }
p { margin: 0 0 11px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mono { font: 400 12px/1.4 PuMono, monospace; }
.kicker { display: block; font: 400 12px/1.4 PuMono, monospace; color: var(--sand); letter-spacing: .06em; text-transform: uppercase; }
.intro { padding: 4px 2px 12px; }
.intro h1 { margin: 2px 0 4px; }
.intro p { margin: 0; color: var(--muted); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -13px 14px; padding: calc(8px + env(safe-area-inset-top)) 13px 8px; min-height: 62px; background: #000; border-bottom: 1px solid var(--line); }
.top img { display: block; width: 128px; height: auto; }
.link { background: none; border: 0; padding: 10px 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; min-height: 44px; }
.link:hover { color: var(--ink); }
.back { display: block; margin: -4px 0 6px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 9px; border: 1px solid #607668; background: #15251c; color: #fff; cursor: pointer; }
svg.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.amount { font: 400 48px/1 PuMono, monospace; color: var(--sand); letter-spacing: -.07em; }
.unit { margin-left: 8px; }
.line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px; margin: 2px 0 6px; }

.btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 48px; padding: 9px 12px; margin: 0 0 10px; border-radius: 9px; border: 1px solid #607668; background: #15251c; color: #fff; font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.btn:hover { background: #20392b; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: #12b76d; }
.btn.danger { color: var(--bad); border-color: #96685f; background: #34221f; }
.btn.quiet { justify-content: flex-start; border-color: transparent; background: transparent; min-height: 44px; padding: 6px 2px; margin: 0; }
.btn.center { justify-content: center; text-align: center; }
.btn:disabled { opacity: .5; cursor: default; }
.btn .side { font-weight: 400; opacity: .85; white-space: nowrap; }
.card .btn:last-child { margin-bottom: 0; }
.row-btns { display: flex; gap: 8px; }
.row-btns .btn { margin: 0; justify-content: center; text-align: center; }
.badge { background: var(--sand); color: #000; border-radius: 99px; font-size: 12px; padding: 0 7px; line-height: 18px; font-weight: 500; }
a.btn { text-decoration: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 0 0 11px; }
.card.balance { background: var(--strong); }
.card.alert { background: var(--warn-bg); border-color: #92794c; }
.card.alert .muted { color: #f6e0bd; }
.card .head, .row { display: flex; justify-content: space-between; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 6px; }
.card .kind { font: 400 12px/1.4 PuMono, monospace; color: var(--sand); letter-spacing: .06em; text-transform: uppercase; }
.card .title { font-weight: 500; }
.card dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 12px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; }
.status { display: inline-block; border-radius: 5px; padding: 3px 7px; font-size: 12px; color: #e6f4eb; background: #223c2d; }
.status::first-letter { text-transform: uppercase; }
.status.attention { color: var(--sand); background: #392e1e; }

.list { border-top: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 0 12px; }
.item { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .right { text-align: right; white-space: nowrap; }
.item .title { font-weight: 500; }

.flag { padding: 9px 11px; border-radius: 9px; margin: 0 0 11px; background: var(--soft); border: 1px solid var(--line); }
.flag.ok { color: var(--ok); }
.flag.warn { color: #f6e0bd; background: var(--warn-bg); border-color: #92794c; }
.flag.bad { color: #ffd0c9; background: var(--bad-bg); border-color: #96685f; }
.flag b { color: var(--sand); font-weight: 500; }
.flag .rules { margin: 6px 0; padding-left: 20px; color: inherit; }
.flag .rules li { margin: 5px 0; }

label { display: block; margin: 12px 0 5px; font-size: 14px; text-shadow: 0 1px 3px #000; }
.card label { text-shadow: none; }
input, select, textarea { display: block; width: 100%; min-height: 46px; padding: 8px 10px; border-radius: 8px; border: 1px solid #718477; background: var(--card); color: var(--ink); font: inherit; font-size: 16px; }
textarea { min-height: 84px; resize: vertical; }
input[type="file"] { padding: 10px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, .link:focus-visible, .tabbar button:focus-visible, .icon-btn:focus-visible, summary:focus-visible { outline: 2px solid var(--sand); outline-offset: 1px; }
.check { display: flex; gap: 9px; align-items: center; margin: 14px 0; min-height: 44px; }
.check input { width: 20px; height: 20px; min-height: 0; flex: none; accent-color: var(--accent); }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.seg .btn { justify-content: center; text-align: center; margin: 0; padding: 8px; }
.seg .btn.on { background: #214a33; border-color: #79a88d; }
.seg .btn.small { font-size: 14px; font-weight: 400; min-height: 44px; }
details { margin: 8px 0 11px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; }
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
details ol, details ul { padding-left: 20px; margin: 4px 0 10px; }
details li { margin: 4px 0; }
.error { color: #ffd0c9; margin: 10px 0; }
.error:empty { display: none; }
.error:not(:empty) { background: var(--bad-bg); border-radius: 7px; padding: 8px 10px; }
.note { color: #d6f5e3; margin: 10px 0; }
.note:empty { display: none; }
.note:not(:empty) { background: #123e2a; border: 1px solid #427b5b; border-radius: 8px; padding: 8px 10px; }
.progress { height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
video { display: block; width: 100%; max-height: 420px; border-radius: 9px; background: #000; margin: 6px 0; }

.msgs { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.msg { max-width: 88%; padding: 9px 10px; border-radius: 9px; background: var(--soft); white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: #194430; }
.msg time { display: block; font: 400 11px/1.4 PuMono, monospace; color: var(--muted); margin-top: 3px; }

.tabbar { position: fixed; z-index: 5; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 560px); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 5px 5px calc(5px + env(safe-area-inset-bottom)); background: #101a15; border-top: 1px solid var(--line); }
.tabbar button { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 51px; padding: 4px 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.tabbar button[aria-current="page"] { color: #fff; background: #194430; }
.tabbar .badge { position: absolute; top: 3px; left: 54%; }

.sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 12px 0; }
.sheet .qr { border: 1px dashed var(--line); border-radius: 10px; padding: 10px; text-align: center; font: 600 13px/1.3 PuMono, monospace; background: #fff; color: #000; }
.sheet .qr img { width: 100%; height: auto; display: block; }
.mt { margin-top: 16px; } .mt8 { margin-top: 8px; } .mt4 { margin-top: 4px; }
.nowrap { white-space: nowrap; } .warn { color: var(--warn); }
@media (max-width: 360px) {
  main { padding-inline: 9px; } .top { margin-inline: -9px; padding-inline: 9px; } .card { padding-inline: 10px; }
  .tabbar button { letter-spacing: -.02em; font-size: 11px; }
}
@media print {
  body { background: #fff; } body::before, .tabbar { display: none; }
  main > *:not(.print) { display: none !important; }
  .print > *:not(.sheet) { display: none !important; }
  .sheet { grid-template-columns: repeat(4, 1fr); }
  .sheet .qr { break-inside: avoid; }
}
