/* Jus'Print — Graphite + Ember (modern, light + dark) */
:root {
  /* neutral system */
  --bg: #f7f7f8;
  --sheet: #ffffff;
  --text: #18181b;
  --secondary: #71717a;
  --line: #e4e4e7;
  --shadow: 0 1px 2px rgba(24,24,27,.04), 0 6px 20px rgba(24,24,27,.06);

  /* semantic accents */
  --accent: #f2570e;          /* ember — primary actions, active */
  --accent-soft: rgba(242,87,14,.12);
  --ok: #2563eb;              /* positive / online / printed / healthy */
  --ok-soft: rgba(37,99,235,.12);
  --alert: #ef4444;
  --alert-soft: rgba(239,68,68,.13);
  --brand-green: #5c8a34;     /* logo wordmark only */

  /* aliases so existing markup maps to the new system */
  --marigold: var(--accent);
  --leaf: var(--ok);
  --green: var(--accent);

  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0e;
    --sheet: #18181b;
    --text: #fafafa;
    --secondary: #a1a1aa;
    --line: #27272a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.4);
    --accent-soft: rgba(242,87,14,.18);
    --ok-soft: rgba(59,130,246,.2);
    --ok: #3b82f6;
    --alert: #f87171;
    --alert-soft: rgba(248,113,113,.18);
    --brand-green: #8bbf5a;
  }
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
.serif { font-family: "Iowan Old Style", Georgia, "Times New Roman", serif; }
.wrap { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: 92px; }
.wide { max-width: 1100px; }

.logo { font-size: 30px; font-weight: 800; display: inline-flex; align-items: baseline; letter-spacing: -0.02em; }
.logo .jus { font-family: "Iowan Old Style", Georgia, serif; font-style: italic; color: var(--brand-green); }
.logo .print { color: var(--accent); font-weight: 900; letter-spacing: 0; }
.tagline { font-size: 10px; letter-spacing: 3px; color: var(--secondary); font-weight: 600; }

.card {
  background: var(--sheet); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: 20px; margin: 14px 0;
}
.card.tight { padding: 16px; }
h1.display { font-family: "Iowan Old Style", Georgia, serif; color: var(--text); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
h2.display { font-family: "Iowan Old Style", Georgia, serif; color: var(--text); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.muted { color: var(--secondary); font-size: 13px; }
.label { font-size: 10px; letter-spacing: 1.5px; color: var(--secondary); font-weight: 700; text-transform: uppercase; }
.big-amount { font-family: "Iowan Old Style", Georgia, serif; color: var(--text); font-size: 40px; font-weight: 700; letter-spacing: -0.03em; }
.dashed { border: none; border-top: 1px dashed var(--line); margin: 14px 0; }

button, .btn {
  font: inherit; cursor: pointer; border: none; border-radius: 12px;
  padding: 14px 20px; font-weight: 700;
  background: var(--accent); color: #fff; width: 100%;
  transition: transform .1s, opacity .1s, filter .1s;
}
button:hover { filter: brightness(1.05); }
button:active { transform: scale(.985); }
button:disabled { opacity: .45; cursor: default; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-outline:hover { border-color: var(--secondary); filter: none; }
.btn-pill { width: auto; padding: 10px 16px; font-size: 14px; border-radius: 999px; }
.btn-ghost { background: transparent; color: var(--accent); box-shadow: none; width: auto; padding: 8px; font-weight: 600; }

input, select {
  font: inherit; width: 100%; padding: 13px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  transition: border-color .1s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
label.field { display: block; margin: 10px 0; }

.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; }
.chip { font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
        padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.chip.printed { background: var(--ok-soft); color: var(--ok); }
.chip.printing { background: var(--accent-soft); color: var(--accent); }
.chip.pending { background: rgba(113,113,122,.14); color: var(--secondary); }
.chip.refunded, .chip.expired, .chip.cancelled { background: var(--alert-soft); color: var(--alert); }
.chip.online { background: var(--ok-soft); color: var(--ok); }
.chip.offline { background: rgba(113,113,122,.14); color: var(--secondary); }
.chip.alert { background: var(--alert-soft); color: var(--alert); }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--sheet);
  border-top: 1px solid var(--line); display: flex; justify-content: space-around;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  backdrop-filter: saturate(1.2);
}
.tab { flex: 1; text-align: center; background: none; color: var(--secondary);
       box-shadow: none; font-weight: 600; font-size: 11px;
       padding: 4px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tab .ic { font-size: 20px; }
.tab.active { color: var(--accent); }

.badges { display: flex; justify-content: space-around; text-align: center; }
.badges .b { font-size: 10px; color: var(--secondary); font-weight: 700; letter-spacing: 1px; }
.badges .b .ic { display: block; font-size: 18px; margin-bottom: 4px; }

.linkrow { display: flex; justify-content: space-between; align-items: center; padding: 11px 0;
           color: var(--text); text-decoration: none; font-weight: 600; }
.linkrow:hover { color: var(--accent); }
.linkrow .arw { color: var(--secondary); }

details.section > summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
details.section > summary::-webkit-details-marker { display: none; }
.chev { transition: transform .15s; color: var(--secondary); }
details.section[open] > summary .chev { transform: rotate(180deg); }

/* compact wallet chip (home top-right) */
.wallet-chip { display: inline-flex; align-items: center; gap: 8px; width: auto;
  background: var(--accent-soft); color: var(--accent); font-weight: 700;
  padding: 7px 7px 7px 14px; border-radius: 999px; font-size: 15px; box-shadow: none; }
.wallet-chip:hover { filter: none; }
.wallet-chip .wc-plus { display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--accent); color: #fff; font-size: 17px; line-height: 1; }

/* home print-option cards (colour-coded soft tiles) */
.opt { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  background: var(--sheet); color: var(--text); border: 1px solid var(--line);
  border-radius: 20px; padding: 16px; box-shadow: var(--shadow); font-weight: 400; }
.opt:hover { filter: none; }
.opt:active { transform: scale(.99); }
.opt-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  font-size: 28px; background: var(--tile); flex: none; }
.opt-tx { flex: 1; }
.opt-title { font-family: "Iowan Old Style", Georgia, serif; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.opt-sub { color: var(--secondary); font-size: 13px; margin-top: 3px; }
.opt-arw { color: var(--secondary); font-size: 20px; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex;
            align-items: center; justify-content: center; padding: 20px; z-index: 50;
            backdrop-filter: blur(3px); }
.sheet { background: var(--sheet); border-radius: 22px; padding: 26px; max-width: 420px; width: 100%;
         max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); border: 1px solid var(--line); }
.qr-box { background: #fff; border-radius: 14px; padding: 14px; display: inline-block; }
.center { text-align: center; }
.stack > * + * { margin-top: 10px; }
.grid { display: grid; gap: 12px; }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
.grid.g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .grid.g2 { grid-template-columns: 1fr; } }
.spin { width: 44px; height: 44px; border: 4px solid var(--line); border-top-color: var(--accent);
        border-radius: 50%; animation: sp 1s linear infinite; margin: 0 auto; }
@keyframes sp { to { transform: rotate(360deg); } }
.toast { position: fixed; bottom: 104px; left: 50%; transform: translateX(-50%);
         background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 999px;
         font-size: 14px; font-weight: 600; z-index: 100; box-shadow: var(--shadow); }
.meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 4px; }
