:root {
  --navy: #10243a;
  --navy-2: #1b3554;
  --paper: #f4efe6;
  --card: #fffdf8;
  --ink: #1c2430;
  --muted: #667084;
  --line: #e4d9c8;
  --teal: #0e7c6b;
  --teal-dark: #0a5c50;
  --in: #0d7a45;
  --out: #a33b24;
  --warn: #f8e6df;
  --ok: #e7f6ee;
  --shadow: 0 16px 40px rgba(16, 36, 58, 0.08);
  color: var(--ink);
  background:
    radial-gradient(1200px 420px at 10% -10%, rgba(14, 124, 107, 0.12), transparent 55%),
    var(--paper);
  font-family: "Avenir Next", "Segoe UI", "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--teal-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

.shell { max-width: 820px; margin: 0 auto; padding: 0 16px 112px; }
.brandbar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #f7f3ea;
  margin: 0 -16px 22px;
  padding: 16px 18px 18px;
  border-radius: 0 0 28px 28px;
  box-shadow: 0 12px 30px rgba(16, 36, 58, 0.18);
}
.brandrow { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.logo {
  height: 40px;
  width: auto;
  max-width: 210px;
  object-fit: contain;
  display: block;
  background: #fff;
  border-radius: 12px;
  padding: 4px 10px;
}
.pagehead { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-top: 16px; }
.eyebrow { margin: 0 0 4px; color: #c9d5c8; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.72rem; }
h1 { margin: 0; font-size: 1.85rem; letter-spacing: -0.03em; font-weight: 650; }
h2 { margin: 22px 0 10px; font-size: 1.02rem; letter-spacing: -0.01em; }
select.shop, select, input, textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
select.shop { width: auto; max-width: 13rem; background: #fff; color: var(--ink); }
.brandbar select.shop { background: rgba(255, 253, 248, 0.96); }
textarea { min-height: 88px; }
label { display: block; margin: 12px 0; }
label span, .label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.9rem; }
.check { display: flex; gap: 10px; align-items: center; }
.check input { width: auto; }
.card, .row, .balance {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.card, .balance { padding: 18px; margin: 0 0 14px; }
.balance p { margin: 0; }
.big {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 2.7rem;
  letter-spacing: -0.04em;
  margin: 6px 0 10px;
}
.split { display: flex; flex-wrap: wrap; gap: 14px 18px; }
.muted { color: var(--muted); display: block; }
.in { color: var(--in); }
.out { color: var(--out); }
.actions, .links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.action, .btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: var(--teal);
  color: white;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  min-height: 48px;
  cursor: pointer;
  font-weight: 600;
}
.ghost, a.ghost, button.ghost {
  background: transparent;
  color: var(--teal-dark);
  border: 1px solid var(--line);
}
.banner, .error { background: var(--warn); color: var(--out); padding: 12px 14px; border-radius: 14px; margin: 0 0 12px; }
.notice, .success { background: var(--ok); color: var(--in); padding: 12px 14px; border-radius: 14px; margin: 0 0 12px; }
.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  margin: 0 0 10px;
  text-decoration: none;
  color: inherit;
}
.row strong { display: block; }
.identity { display: flex; gap: 14px; align-items: center; }
.thumb { width: 52px; height: 52px; border-radius: 12px; background: white; border: 1px solid var(--line); object-fit: contain; }
.code { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.empty { color: var(--muted); }
.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 253, 248, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
.tabs a {
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 8px 0;
  border-radius: 12px;
}
.tabs a.on { color: var(--teal-dark); background: #e7f4f1; font-weight: 700; }
.line { display: grid; grid-template-columns: 1.4fr 0.6fr 0.8fr auto; gap: 8px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chips a {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--card);
  color: var(--ink);
}
.chips a.on { background: var(--navy); color: white; border-color: var(--navy); }
.daynav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.qrbox { display: flex; gap: 16px; align-items: center; }
.qrbox img { width: 148px; height: 148px; background: white; border-radius: 16px; border: 1px solid var(--line); }
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.authcard { width: min(440px, 100%); }
.auth .logo { height: 44px; margin-bottom: 8px; }
@media (max-width: 640px) {
  .line { grid-template-columns: 1fr; }
  .actions, .links { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
}
@media print {
  body { background: white; }
  .brandbar, .tabs, form, .no-print { display: none !important; }
  .shell { padding: 0; }
  .print-label { border: 1px solid #ccc; padding: 16px; width: 280px; }
}
