/* KidFAX — clean, bright, friendly. Crayon colours from the logo; big round buttons. */
:root {
  --red: #EC3B33;     --red-dark: #C42820;    --red-soft: #FDE4E2;
  --blue: #1E8FE1;    --blue-dark: #1371B6;   --blue-soft: #DDEFFC;
  --green: #36B34A;   --green-dark: #23903A;  --green-soft: #DFF4E2;
  --orange: #F7941D;  --orange-dark: #D27508; --orange-soft: #FEEBD3;
  --purple: #8E44AD;  --purple-dark: #6F2F8B; --purple-soft: #F1E4F7;
  --yellow: #FFC72C;  --yellow-dark: #E0A800; --yellow-soft: #FFF4D1;
  --teal: #22AFAC;    --teal-soft: #D8F3F2;
  --epson: #1A3E96;
  --ink: #1D2033;
  --muted: #6B6F85;
  --line: #ECE7F1;
  --bg: #F8F7FC;
  --card: #FFFFFF;
  --ok: #23903A;
  --bad: #D93025;
  --radius: 26px;
  --shadow: 0 2px 0 rgba(29, 32, 51, .04), 0 10px 28px rgba(29, 32, 51, .07);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Arial Rounded MT Bold", "Varela Round", system-ui, sans-serif;
  --accent: var(--blue); --accent-dark: var(--blue-dark); --accent-soft: var(--blue-soft);
  --tabbar-h: 84px;
}
.theme-blue   { --accent: var(--blue);   --accent-dark: var(--blue-dark);   --accent-soft: var(--blue-soft); }
.theme-yellow { --accent: var(--yellow); --accent-dark: var(--yellow-dark); --accent-soft: var(--yellow-soft); }
.theme-green  { --accent: var(--green);  --accent-dark: var(--green-dark);  --accent-soft: var(--green-soft); }
.theme-purple { --accent: var(--purple); --accent-dark: var(--purple-dark); --accent-soft: var(--purple-soft); }
.theme-red    { --accent: var(--red);    --accent-dark: var(--red-dark);    --accent-soft: var(--red-soft); }
.theme-ink    { --accent: var(--ink);    --accent-dark: #000;               --accent-soft: #E9E9F2; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 18px; line-height: 1.4; color: var(--ink); background: var(--bg);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px);
}
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: 32px; font-weight: 900; }
h2 { font-size: 22px; font-weight: 800; margin-bottom: 14px; }
h2.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
h3 { font-size: 18px; font-weight: 800; }
p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.icon { flex: none; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.block { display: block; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.center form, form.center { display: flex; justify-content: center; }
.stack { display: grid; gap: 12px; }
.hide { display: none !important; }
code { font-size: 14px; background: var(--bg); padding: 2px 7px; border-radius: 8px; }

/* ---------- Top bar + tabs ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--bg);
}
.brand img { height: 56px; width: auto; mix-blend-mode: multiply; }
.my-number {
  display: grid; justify-items: end; text-decoration: none; line-height: 1.15;
  padding: 8px 14px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow);
}
.my-number small { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.my-number b { font-size: 20px; font-weight: 900; letter-spacing: .03em; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 8px 8px env(safe-area-inset-bottom);
  background: var(--card); border-radius: 26px 26px 0 0; box-shadow: 0 -6px 30px rgba(29, 32, 51, .08);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; font-weight: 800; font-size: 13px; color: var(--muted); border-radius: 20px;
}
.tab-icon { display: grid; place-items: center; width: 54px; height: 36px; border-radius: 18px; transition: background .15s; }
.tab.is-active { color: var(--ink); }
.tab-blue.is-active .tab-icon   { background: var(--blue);   color: #fff; }
.tab-yellow.is-active .tab-icon { background: var(--yellow); color: var(--ink); }
.tab-green.is-active .tab-icon  { background: var(--green);  color: #fff; }
.tab-purple.is-active .tab-icon { background: var(--purple); color: #fff; }
.badge {
  position: absolute; top: 2px; left: calc(50% + 12px);
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--red); color: #fff; font-size: 13px; line-height: 22px; text-align: center; border: 2px solid #fff;
}
@media (min-width: 860px) {
  body { padding-bottom: 60px; }
  .topbar { padding: 14px 32px; display: grid; grid-template-columns: auto 1fr auto; }
  .brand img { height: 68px; }
  .tabs {
    position: static; display: flex; gap: 6px; height: auto; padding: 6px; justify-self: center;
    border-radius: 999px; box-shadow: var(--shadow);
  }
  .tab { flex-direction: row; gap: 8px; padding: 6px 18px 6px 6px; font-size: 17px; border-radius: 999px; }
  .tab-icon { width: 44px; height: 44px; border-radius: 50%; }
  .badge { position: static; }
}
@media (max-width: 420px) {
  .brand img { height: 46px; }
  .my-number b { font-size: 17px; }
}

/* ---------- Page ---------- */
.page { max-width: 820px; margin: 0 auto; padding: 6px 16px 0; display: grid; gap: 18px; }
.hero {
  display: flex; align-items: center; gap: 16px; padding: 22px 22px;
  border-radius: var(--radius); background: var(--accent); color: #fff; position: relative; overflow: hidden;
}
.theme-yellow .hero { color: var(--ink); }
.hero::after {
  content: ""; position: absolute; right: -40px; top: -60px; width: 180px; height: 180px;
  border-radius: 50%; background: rgba(255, 255, 255, .16);
}
.hero p { font-size: 17px; font-weight: 600; opacity: .92; margin-top: 4px; }
.hero-icon { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 22px; background: rgba(255, 255, 255, .25); }
.hero .grow { position: relative; z-index: 1; }
.hero-action { position: relative; z-index: 1; margin-left: auto; }

.card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card-big { padding: 32px 22px; display: grid; gap: 14px; justify-items: center; text-align: center; }
.card-big h2 { font-size: 25px; margin: 0; }
.card-big p { max-width: 460px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-attention { border: 3px solid var(--orange); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-between h2 { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 24px; border: 0; border-radius: 999px;
  font: inherit; font-weight: 800; font-size: 18px; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-dark); }
.theme-yellow .btn-primary { color: var(--ink); }
.btn-primary:active { box-shadow: 0 2px 0 var(--accent-dark); }
.btn-blue { background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-dark); }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-dark); }
.btn-secondary { background: var(--card); color: var(--ink); border: 3px solid var(--line); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-danger { background: var(--bad); color: #fff; box-shadow: 0 4px 0 #A8231A; }
.btn-ghost { background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }
.btn-xl { min-height: 66px; padding: 0 34px; font-size: 21px; }
.btn-small { min-height: 42px; padding: 0 16px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-add { min-height: 46px; padding: 0 18px 0 12px; font-size: 17px; }
.btn-add .icon { background: rgba(255,255,255,.25); border-radius: 50%; padding: 3px; }
.icon-btn {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--bg); color: var(--muted); font: inherit;
}
.icon-btn:hover:not(:disabled) { color: var(--ink); background: var(--line); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.is-on { color: var(--yellow-dark); }
.link-btn { background: none; border: 0; padding: 4px; font: inherit; font-weight: 800; color: var(--accent-dark); cursor: pointer; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px;
  font-size: 14px; font-weight: 800; background: #EFEDF5; color: var(--muted); white-space: nowrap;
}
.pill .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--green-soft); color: var(--ok); }
.pill-ok .dot { animation: pulse 1.8s infinite; }
.pill-bad { background: var(--red-soft); color: var(--bad); }
.pill-wait { background: var(--yellow-soft); color: #8A6400; }
.pill-info { background: var(--blue-soft); color: var(--blue-dark); }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Contact list ---------- */
.contacts { list-style: none; margin: 0; padding: 0; }
.contact {
  display: flex; align-items: center; gap: 14px; padding: 12px 6px; text-decoration: none;
  border-bottom: 2px solid var(--line);
}
.contacts li:last-child .contact { border-bottom: 0; }
a.contact:hover { background: var(--bg); border-radius: 18px; }
.contact b { display: block; font-size: 19px; }
.contact .sub { display: block; font-size: 14px; color: var(--muted); }
.letter { font-size: 14px; font-weight: 900; color: var(--muted); padding: 14px 6px 2px; letter-spacing: .06em; }
.avatar {
  flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 24px; font-weight: 900;
}
.avatar-lg { width: 96px; height: 96px; font-size: 44px; }
.av-red { background: var(--red); } .av-blue { background: var(--blue); } .av-green { background: var(--green); }
.av-orange { background: var(--orange); } .av-purple { background: var(--purple); } .av-teal { background: var(--teal); }
.av-yellow { background: var(--yellow); color: var(--ink); }
.fav-star { color: var(--yellow-dark); }
.chev { color: var(--muted); }
.rank {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--yellow); color: var(--ink); font-weight: 900; font-size: 18px;
}
.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 18px 8px; }
.empty-art { font-size: 54px; line-height: 1; }

.request { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border-radius: 20px; background: var(--yellow-soft); }
.request + .request { margin-top: 10px; }
.request .grow b { display: block; }

.profile { display: grid; justify-items: center; gap: 8px; text-align: center; padding-top: 10px; }
.profile .sub { color: var(--muted); font-weight: 700; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field-label { font-weight: 800; }
.hint { font-size: 15px; color: var(--muted); }
.input {
  font: inherit; font-weight: 700; color: var(--ink); width: 100%;
  padding: 12px 16px; border-radius: 16px; border: 3px solid var(--line); background: #fff;
}
.input:focus { outline: none; border-color: var(--accent); }
select.input { appearance: auto; }
.input-big { font-size: 26px; font-weight: 900; letter-spacing: .04em; text-align: center; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.field-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; }
.field-row + .field-row { border-top: 2px dashed var(--line); }
.time-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.time-row label { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.time-row .input { width: auto; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form .input { flex: 1; min-width: 160px; }

.switch { position: relative; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { display: block; width: 66px; height: 40px; border-radius: 999px; background: #DCD8E4; transition: background .15s; }
.switch span::after {
  content: ""; position: absolute; top: 5px; left: 5px; width: 30px; height: 30px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); transition: left .15s;
}
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { left: 31px; }
.switch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; background: #EFEDF5; }
.stepper button {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff;
  font: inherit; font-size: 26px; font-weight: 900; color: var(--ink); cursor: pointer; box-shadow: var(--shadow);
}
.stepper input {
  width: 56px; border: 0; background: none; text-align: center; font: inherit; font-size: 22px; font-weight: 900; -moz-appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ---------- Big on/off ---------- */
.big-toggle {
  width: 100%; display: flex; align-items: center; gap: 18px; padding: 18px 20px; border-radius: 24px; cursor: pointer;
  border: 0; font: inherit; text-align: left; color: #fff; background: var(--green); box-shadow: 0 5px 0 var(--green-dark);
  transition: transform .08s;
}
.big-toggle:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--green-dark); }
.big-toggle.is-off { background: #8C8FA3; box-shadow: 0 5px 0 #6B6E82; }
.big-toggle .knob {
  flex: none; display: grid; place-items: center; width: 70px; height: 70px; border-radius: 50%;
  background: rgba(255,255,255,.25); border: 4px solid rgba(255,255,255,.8);
}
.big-toggle b { display: block; font-size: 26px; font-weight: 900; }
.big-toggle small { display: block; font-size: 15px; font-weight: 700; opacity: .92; }
.big-toggle .state { margin-left: auto; font-size: 30px; font-weight: 900; padding: 6px 18px; border-radius: 999px; background: rgba(255,255,255,.25); }
.big-toggle-xl { padding: 28px; }
.big-toggle-xl .knob { width: 110px; height: 110px; }
.big-toggle-xl b { font-size: 34px; }

/* ---------- Usage meters & counters ---------- */
.usage { margin-bottom: 14px; }
.usage-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 16px; }
.meter { height: 14px; border-radius: 999px; background: #EFEDF5; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 999px; background: var(--green); }
.meter.is-full span { background: var(--orange); }
.counters { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.counter { display: grid; justify-items: center; gap: 2px; padding: 18px 10px; border-radius: 22px; text-align: center; }
.counter-sent { background: var(--blue-soft); color: var(--blue-dark); }
.counter-recv { background: var(--orange-soft); color: var(--orange-dark); }
.counter b { font-size: 44px; font-weight: 900; line-height: 1; color: var(--ink); }
.counter span { font-weight: 800; font-size: 15px; display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Printer & fax lists ---------- */
.who { display: flex; align-items: center; gap: 14px; }
.who h2 { margin: 0; }
.printer-icon { flex: none; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 20px; background: var(--green); color: #fff; }
.howto { margin: 14px 0 0; padding: 14px 16px; border-radius: 18px; background: var(--bg); display: grid; gap: 8px; }
.howto ol { margin: 0; padding-left: 22px; display: grid; gap: 4px; font-weight: 700; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 20px; background: var(--bg); }
.list-item .muted { display: block; font-size: 14px; }
.list-item .when { display: block; font-size: 13px; color: var(--muted); }
.fax-thumb { flex: none; width: 54px; height: 70px; object-fit: cover; border-radius: 10px; background: #fff; border: 2px solid var(--line); }
.fax-thumb-empty { display: grid; place-items: center; color: var(--muted); }
.fax-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.direction { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 13px; }
.direction-in { color: var(--orange-dark); }
.direction-out { color: var(--blue-dark); }
.mini-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.mini-steps li { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--accent-soft); font-weight: 700; font-size: 16px; }
.mini-steps span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 900; }

/* ---------- Billing ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.plan { position: relative; cursor: pointer; }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan-body { display: grid; gap: 6px; height: 100%; padding: 18px; border-radius: 22px; border: 3px solid var(--line); }
.plan-body .price { font-size: 32px; font-weight: 900; }
.plan-body .price small { font-size: 15px; color: var(--muted); }
.plan-body ul { margin: 4px 0 0; padding-left: 18px; font-size: 14px; color: var(--muted); display: grid; gap: 2px; }
.plan input:checked + .plan-body { border-color: var(--purple); background: var(--purple-soft); }
.plan input:focus-visible + .plan-body { outline: 3px solid var(--purple); outline-offset: 2px; }
.plan .current { position: absolute; top: 12px; right: 12px; }
.paycard {
  display: grid; gap: 14px; padding: 20px; border-radius: 22px; color: #fff; max-width: 360px;
  background: linear-gradient(135deg, var(--purple), var(--blue)); box-shadow: 0 10px 24px rgba(142, 68, 173, .3);
}
.paycard .num { font-size: 22px; font-weight: 900; letter-spacing: .12em; }
.paycard .meta { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; opacity: .9; }
.bill-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
.bill-fact { padding: 14px 16px; border-radius: 18px; background: var(--bg); }
.bill-fact small { display: block; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bill-fact b { font-size: 20px; }
.demo-note { padding: 10px 14px; border-radius: 14px; background: var(--yellow-soft); font-size: 15px; font-weight: 700; color: #7A5A00; }

.danger-zone { border: 3px dashed #F3B3AE; background: #FFF8F7; }
.btn-delete { width: 100%; min-height: 74px; font-size: 22px; }

/* ---------- Banners, toasts, dialogs ---------- */
.banner {
  padding: 14px 18px; border-radius: 20px; font-weight: 800;
  background: var(--orange-soft); color: #8A4B00; border: 3px solid var(--orange);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.banner-welcome { background: var(--blue-soft); color: var(--blue-dark); border-color: var(--blue); }
.toasts { position: fixed; top: 86px; left: 50%; translate: -50% 0; z-index: 30; display: grid; gap: 8px; width: min(560px, calc(100% - 24px)); }
.toast {
  padding: 15px 20px; border-radius: 20px; font-weight: 800; background: var(--ink); color: #fff;
  box-shadow: 0 12px 30px rgba(29, 32, 51, .25); animation: toast-in .25s ease-out; transition: opacity .3s, translate .3s;
}
.toast-ok { background: var(--green-dark); }
.toast-error { background: var(--bad); }
.toast-info { background: var(--blue-dark); }
.toast.is-gone { opacity: 0; translate: 0 -10px; }
@keyframes toast-in { from { opacity: 0; translate: 0 -10px; } }
.modal {
  border: 0; border-radius: var(--radius); padding: 26px; width: min(460px, calc(100% - 28px));
  box-shadow: 0 24px 60px rgba(29, 32, 51, .3); color: var(--ink);
}
.modal::backdrop { background: rgba(29, 32, 51, .45); }
.modal h2 { margin-bottom: 8px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.modal-actions .btn { min-height: 50px; }
.footer { max-width: 820px; margin: 26px auto 0; padding: 0 16px; display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.footer img { height: 18px; mix-blend-mode: multiply; }
.footer a { color: inherit; font-weight: 800; }

/* ---------- Sign in / sign up ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px 40px; }
body.auth-body { padding-bottom: 0; background: radial-gradient(circle at 10% 10%, var(--yellow-soft), transparent 40%), radial-gradient(circle at 90% 90%, var(--blue-soft), transparent 45%), var(--bg); }
.auth-card { width: min(460px, 100%); display: grid; gap: 16px; }
.auth-logo { width: min(300px, 80%); margin: 0 auto; mix-blend-mode: multiply; }
.auth-card .card { padding: 26px; }
.auth-card h1 { font-size: 26px; text-align: center; margin-bottom: 18px; }
.auth-switch { text-align: center; font-weight: 700; }
.auth-switch a { color: var(--blue-dark); font-weight: 900; }
.powered { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.powered img { height: 22px; mix-blend-mode: multiply; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 76px; }
.pw-wrap button { position: absolute; right: 8px; top: 50%; translate: 0 -50%; }

/* ---------- Admin ---------- */
.admin-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.admin-top .brand img { height: 50px; }
.admin-top h1 { font-size: 22px; }
.admin-top form { margin-left: auto; }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); }
.admin-nav a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; text-decoration: none; font-weight: 900; color: var(--muted); }
.admin-nav a.is-active { background: var(--ink); color: #fff; }
.admin-page { max-width: 1100px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { background: var(--card); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); display: grid; gap: 2px; }
.stat-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat-value { font-size: 34px; font-weight: 900; line-height: 1.1; }
.stat-sub { font-size: 14px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td small { display: block; color: var(--muted); font-size: 13px; }
.table .nowrap { white-space: nowrap; }
.user-tools summary { cursor: pointer; font-weight: 800; color: var(--blue-dark); white-space: nowrap; }
.user-tools[open] summary { margin-bottom: 8px; }
.user-tools form { margin-bottom: 8px; }
.user-tools select { font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 10px; border: 2px solid var(--line); }
.temp-pw { display: inline-block; margin-top: 6px; padding: 6px 10px; border-radius: 10px; background: var(--yellow-soft); font-weight: 900; }
.log { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.log td { padding: 6px 8px; }
.log .lvl { font-weight: 900; text-transform: uppercase; font-size: 11px; }
.lvl-error { color: var(--bad); } .lvl-warn { color: var(--orange-dark); } .lvl-info { color: var(--muted); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 15px; }
.facts dt { font-weight: 800; color: var(--muted); }
.facts dd { margin: 0; word-break: break-all; }
.ok-text { color: var(--ok); font-weight: 800; }
.bad-text { color: var(--bad); font-weight: 800; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-row a { padding: 6px 14px; border-radius: 999px; background: var(--bg); text-decoration: none; font-weight: 800; font-size: 14px; }
.filter-row a.is-active { background: var(--ink); color: #fff; }

@media (max-width: 520px) {
  h1 { font-size: 26px; }
  .hero { padding: 18px; }
  .hero-icon { width: 54px; height: 54px; }
  .card { padding: 18px; }
  .big-toggle b { font-size: 21px; }
  .big-toggle .knob { width: 56px; height: 56px; }
  .big-toggle .state { font-size: 22px; padding: 4px 12px; }
  .counter b { font-size: 36px; }
}

/* ---------- 1.0.1: Main tab, log out ---------- */
.tabs { grid-template-columns: repeat(5, 1fr); }
.tab-red.is-active .tab-icon { background: var(--red); color: #fff; }
.top-right { display: grid; justify-items: end; gap: 6px; }
.my-username { font-size: 12px; font-weight: 800; color: var(--muted); }
.logout-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--line); background: var(--card); font: inherit; font-size: 13px; font-weight: 800; color: var(--muted);
}
.logout-btn:hover { color: var(--bad); border-color: #F3B3AE; }
.big-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.big-steps li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 20px; background: var(--bg); font-size: 19px; font-weight: 600; }
.step-n { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: #fff; font-size: 22px; font-weight: 900; }
.step-red { background: var(--red); } .step-blue { background: var(--blue); } .step-green { background: var(--green); } .step-orange { background: var(--orange); }
@media (max-width: 520px) {
  .tab { font-size: 12px; }
  .tab-icon { width: 46px; }
  .big-steps li { font-size: 17px; }
}
.nowrap { white-space: nowrap; }
/* 1.0.2 */
.fax-status { display: grid; justify-items: end; gap: 6px; }
.santa-row { background: var(--red-soft); border-radius: 18px; border-bottom: 0; padding: 10px 12px; margin-bottom: 6px; }
.santa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.santa-letter { display: grid; gap: 6px; padding: 10px; border-radius: 18px; background: var(--bg); font-size: 14px; }
.santa-letter img { width: 100%; aspect-ratio: 8.5 / 11; object-fit: cover; border-radius: 10px; border: 2px solid var(--line); background: #fff; }
.santa-letter .btn-row { gap: 6px; }
/* 1.0.3: Santa replies */
.reply-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.reply-item { position: relative; display: grid; gap: 4px; padding: 8px; border-radius: 16px; background: var(--bg); font-size: 14px; text-align: center; justify-items: center; }
.reply-item img { width: 100%; aspect-ratio: 8.5 / 11; object-fit: cover; border-radius: 8px; border: 2px solid var(--line); background: #fff; }
.reply-pick { max-height: 46vh; overflow: auto; padding: 2px; }
.reply-pick .reply-item { cursor: pointer; border: 3px solid transparent; }
.reply-pick input { position: absolute; opacity: 0; }
.reply-pick .reply-item:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.upload-box { display: grid; gap: 8px; margin-top: 16px; padding: 14px; border-radius: 16px; border: 3px dashed var(--line); }
.santa-letter { position: relative; }
.santa-letter a img { cursor: zoom-in; }
.santa-letter .pick { position: absolute; top: 16px; left: 16px; z-index: 1; background: #fff; border-radius: 8px; padding: 4px 6px; box-shadow: var(--shadow); }
.santa-letter .pick input, .select-all input { width: 18px; height: 18px; }
.select-all { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; }
.modal-wide { width: min(680px, calc(100% - 28px)); max-height: calc(100vh - 40px); }
