:root {
  --green: #0a8f3c;
  --green-dark: #07692c;
  --green-soft: #e8f6ed;
  --ink: #14201a;
  --muted: #5d6b63;
  --line: #dbe5de;
  --bg: #f4f8f5;
  --card: #fff;
  --red: #c62828;
  --amber: #b26a00;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1000px; }
header.hero {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
  padding: 28px 16px 40px;
  text-align: center;
}
header.hero h1 { margin: 0 0 4px; font-size: 1.6rem; }
header.hero p { margin: 0; opacity: .9; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.pull { margin-top: -26px; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
.notice { background: #fff7e0; border: 1px solid #f0d78a; color: #6b4f00; border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: .92rem; }
.pkgs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .pkgs { grid-template-columns: 1fr; } }
.pkg { position: relative; }
.pkg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.pkg .box {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  height: 100%;
  transition: border-color .12s, background .12s;
}
.pkg input:checked + .box { border-color: var(--green); background: var(--green-soft); }
.pkg input:focus-visible + .box { outline: 3px solid #9bd8b2; }
.pkg .nm { font-weight: 700; }
.pkg .pr { color: var(--green-dark); font-weight: 800; font-size: 1.15rem; }
.pkg .dt { color: var(--muted); font-size: .82rem; margin-top: 2px; }
label.f { display: block; font-weight: 600; margin: 12px 0 6px; font-size: .92rem; }
input[type=text], input[type=tel], input[type=password], input[type=number], select, textarea {
  width: 100%;
  font: inherit;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 3px solid #9bd8b2; border-color: var(--green); }
button, .btn {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  background: var(--green);
  color: #fff;
  width: 100%;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
button:hover { background: var(--green-dark); }
button:disabled { background: #a9c9b5; cursor: not-allowed; }
button.ghost { background: #fff; color: var(--green-dark); border: 1.5px solid var(--green); }
button.danger { background: var(--red); }
button.small { width: auto; padding: 6px 10px; font-size: .85rem; border-radius: 8px; }
.err { color: var(--red); font-size: .9rem; min-height: 1.2em; margin-top: 8px; }
.status { text-align: center; padding: 10px 4px; }
.status .big { font-size: 2.6rem; }
.status h3 { margin: 6px 0; }
.status p { color: var(--muted); margin: 4px 0; }
.spin { width: 38px; height: 38px; border: 4px solid var(--green-soft); border-top-color: var(--green); border-radius: 50%; margin: 6px auto; animation: sp 0.9s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 14px; }
.hidden { display: none !important; }

/* admin */
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { width: auto; background: #fff; color: var(--ink); border: 1.5px solid var(--line); padding: 8px 14px; }
.tabs button.on { background: var(--green); color: #fff; border-color: var(--green); }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; background: #fff; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th { background: var(--green-soft); }
td.wrap-ok { white-space: normal; min-width: 160px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: #eee; }
.pill.completed { background: #d8f3e1; color: #07692c; }
.pill.paid, .pill.dispatched { background: #dbeafe; color: #1d4ed8; }
.pill.pending { background: #fff3cd; color: #8a6100; }
.pill.failed, .pill.needs_attention { background: #fde2e2; color: var(--red); }
.pill.ignored { background: #eceff1; color: #546e7a; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }
dialog { border: 0; border-radius: var(--radius); padding: 16px; width: min(94vw, 460px); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
code { background: #eef3ef; padding: 2px 6px; border-radius: 6px; word-break: break-all; font-size: .85rem; }
.kv { margin: 8px 0; font-size: .92rem; }
.kv b { display: block; color: var(--muted); font-weight: 600; font-size: .8rem; }
