/* Grizly — warm, phone-first, one-hand friendly. */

:root {
  --bg: #fbf3e8;
  --bg-2: #f6ead9;
  --surface: #fffdfa;
  --surface-2: #fff8ef;
  --ink: #241c16;
  --ink-soft: #4d4139;
  --muted: #74675d;
  --line: #eadccb;
  --line-strong: #ddc9b2;
  --accent: #d9532c;
  --accent-dark: #b6401f;
  --accent-soft: #fbe3d7;
  --green: #2f7d5b;
  --green-soft: #e3f1e9;
  --amber: #94650f;
  --amber-soft: #fbefd3;
  --red: #ab2a21;
  --red-soft: #fbe3df;
  --blue: #356a8a;
  --blue-soft: #e5eff5;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(36, 28, 22, 0.04), 0 14px 34px rgba(36, 28, 22, 0.07);
  --shadow-soft: 0 1px 2px rgba(36, 28, 22, 0.05);
  --focus: 0 0 0 4px rgba(217, 83, 44, 0.18);
  --wrap: 1120px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(1100px 520px at 50% -8%, #fffaf3 0%, rgba(251, 243, 232, 0) 65%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }

a { color: var(--accent-dark); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }

a:hover { color: var(--accent); }

h1, h2, h3, h4, p { margin-top: 0; }

h1 {
  font-size: clamp(2.1rem, 5vw, 3.5rem);
  line-height: 1.03;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 750;
  margin-bottom: 0.5rem;
}

h3 { font-size: 1.08rem; line-height: 1.3; letter-spacing: -0.01em; }

.h3 { font-size: 1.15rem; }

.h4 { font-size: 1rem; margin-bottom: 0.25rem; }

.muted { color: var(--muted); }

.small { font-size: 0.84rem; }

.grow { flex: 1 1 auto; }

.inline-form { display: inline-flex; gap: 8px; align-items: center; margin: 0; }

.stack { display: flex; flex-direction: column; gap: 16px; }

.stack-lg { display: flex; flex-direction: column; gap: 20px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }

.page { flex: 1 0 auto; padding-top: 34px; padding-bottom: 56px; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 2000;
}

.skip-link:focus { left: 16px; }

[hidden] { display: none !important; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 243, 232, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(234, 220, 203, 0.8);
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  flex: 0 0 auto;
}

.brand:hover { color: var(--accent-dark); }

.brand-mark { width: 30px; height: 30px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.main-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  padding: 9px 13px;
  border-radius: 999px;
}

.main-nav a:hover { background: rgba(234, 220, 203, 0.55); color: var(--ink); }

.main-nav a.is-active { background: var(--ink); color: var(--bg); }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-link { text-decoration: none; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
  border: 1px solid rgba(217, 83, 44, 0.14);
}

.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }

.avatar-lg { width: 54px; height: 54px; font-size: 1rem; }

.avatar-link .avatar { transition: transform 120ms ease; }

.avatar-link:hover .avatar { transform: translateY(-1px); }

/* mobile tab bar */

.tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: rgba(255, 253, 250, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(5, 1fr);
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  padding: 4px 2px;
  border-radius: 12px;
}

.tabbar svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabbar a.is-active { color: var(--accent-dark); }

.tabbar a.is-active svg { fill: rgba(217, 83, 44, 0.1); }

/* ---------- typography helpers ---------- */

.eyebrow {
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.lede {
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  color: var(--ink-soft);
  max-width: 56ch;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.page-head h1 { margin-bottom: 0.25rem; }

.page-head p { margin-bottom: 0; }

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.back-link { margin-bottom: 14px; font-size: 0.9rem; }

.back-link a { text-decoration: none; color: var(--muted); }

.back-link a:hover { color: var(--ink); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 680;
  font-size: 0.94rem;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background 130ms ease, border-color 130ms ease, transform 90ms ease,
    box-shadow 130ms ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn:focus-visible { outline: none; box-shadow: var(--focus); }

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(217, 83, 44, 0.2); }

.btn-primary:hover { background: var(--accent-dark); color: #fff; }

.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }

.btn-secondary:hover { background: var(--surface-2); color: var(--ink); border-color: #cdb69c; }

.btn-ghost { background: transparent; color: var(--muted); }

.btn-ghost:hover { background: rgba(234, 220, 203, 0.55); color: var(--ink); }

.btn-dark { background: var(--ink); color: var(--bg); }

.btn-dark:hover { background: #3a2e25; color: #fff; }

.btn-danger { background: var(--red); color: #fff; }

.btn-danger:hover { background: #8d211a; color: #fff; }

.btn-sm { min-height: 34px; padding: 0 13px; font-size: 0.84rem; }

.btn-lg { min-height: 50px; padding: 0 24px; font-size: 1rem; }

.btn-block { width: 100%; }

.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.btn-ghost:disabled:hover { background: transparent; color: var(--muted); }

/* ---------- flashes & notices ---------- */

.flashes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  font-size: 0.93rem;
  animation: flash-in 180ms ease both;
}

.flash span { flex: 1; }

.flash-success { background: var(--green-soft); border-color: #bcdccb; color: #1f5a41; }

.flash-error { background: var(--red-soft); border-color: #efc3bd; color: #7e201a; }

.flash-info { background: var(--blue-soft); border-color: #c4dbe7; color: #26536c; }

.flash.is-gone { opacity: 0; transform: translateY(-4px); transition: opacity 220ms ease, transform 220ms ease; }

.flash-close {
  border: 0;
  background: transparent;
  font-size: 1.2rem;
  line-height: 1;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  padding: 0 2px;
}

.flash-close:hover { opacity: 1; }

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.notice {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 0.93rem;
  margin-bottom: 20px;
}

.notice-info { background: var(--blue-soft); border-color: #c9dde8; color: #234f67; }

.notice-warn { background: var(--amber-soft); border-color: #eed8a8; color: #6f4b08; }

.notice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.inline-warning {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--amber-soft);
  color: #6f4b08;
  font-size: 0.86rem;
}

/* ---------- panels & grids ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.panel-soft { background: var(--surface-2); box-shadow: none; border-color: #efe0cf; }

.panel-highlight { background: #f2f9f4; border-color: #c9e3d3; }

.panel-accent { background: var(--accent-soft); border-color: #efc4af; }

.panel-danger { background: #fff6f4; border-color: #f0cbc5; }

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h2 { margin-bottom: 0; }

.grid-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.grid-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.link-arrow {
  font-weight: 650;
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--accent-dark);
  white-space: nowrap;
}

.link-arrow::after { content: " →"; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.empty-state { text-align: left; }

.empty-state h2 { margin-bottom: 6px; }

.empty-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.empty-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
}

.empty-hero h2 { margin-bottom: 6px; }

.empty-hero p { max-width: 62ch; margin-bottom: 0; }

/* ---------- badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 750;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.badge-ok { background: var(--green-soft); color: #1e5b41; }

.badge-bad { background: var(--red-soft); color: #88201a; }

.badge-warn { background: var(--amber-soft); color: #6f4b08; }

.badge-neutral { background: var(--bg-2); color: var(--muted); }

.badge-lg { padding: 6px 12px; font-size: 0.8rem; }

/* ---------- forms ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 620;
}

.field > span:first-child { color: var(--ink); }

.field small { font-weight: 500; color: var(--muted); font-size: 0.79rem; line-height: 1.4; }

input[type="text"],
input[type="password"],
input[type="search"],
select,
textarea {
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  min-height: 46px;
  padding: 10px 13px;
  width: 100%;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea { min-height: 88px; resize: vertical; line-height: 1.45; }

select { padding-right: 34px; }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus);
}

input:disabled { background: var(--bg-2); color: var(--muted); }

.input-wrap { position: relative; display: block; }

.input-wrap input { padding-right: 64px; }

.input-reveal {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: var(--bg-2);
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
}

.input-reveal:hover { background: var(--accent-soft); color: var(--accent-dark); }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--ink-soft);
  cursor: pointer;
}

.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: 0 0 auto; }

.check-inline { align-items: center; font-weight: 650; }

.select-sm { min-height: 34px; padding: 4px 28px 4px 10px; font-size: 0.82rem; border-radius: 9px; }

.mode-choice { border: 0; padding: 0; margin: 0; display: grid; gap: 9px; }

.mode-choice legend { font-size: 0.9rem; font-weight: 620; margin-bottom: 7px; padding: 0; }

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.radio-card input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); flex: 0 0 auto; }

.radio-card span { display: flex; flex-direction: column; gap: 2px; }

.radio-card small { font-size: 0.79rem; font-weight: 500; color: var(--muted); line-height: 1.4; }

.radio-card:hover { border-color: var(--line-strong); }

.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.radio-card:has(input:checked) small { color: #7d3a22; }

.radio-card.is-disabled { opacity: 0.55; cursor: not-allowed; }

.radio-card > .badge { margin-left: auto; }

.radio-list { border: 0; padding: 0; margin: 0; display: grid; gap: 9px; }

.radio-list legend { font-size: 0.9rem; font-weight: 620; margin-bottom: 8px; padding: 0; }

.share-form { display: flex; flex-direction: column; gap: 16px; }

.details { margin-top: 14px; }

.details summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 0.88rem;
  color: var(--accent-dark);
  padding: 8px 0;
  list-style: none;
}

.details summary::-webkit-details-marker { display: none; }

.details summary::before { content: "+ "; font-weight: 800; }

.details[open] summary::before { content: "− "; }

.details > form, .details > p { margin-top: 10px; }

.kv { margin: 0 0 8px; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; font-size: 0.86rem; }

.kv dt { color: var(--muted); }

.kv dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }

.search-panel { margin-bottom: 20px; }

.search-form { display: flex; gap: 12px; align-items: flex-end; }

.search-form .field { margin: 0; }

/* ---------- landing ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 40px;
  align-items: center;
  padding: 54px 0 46px;
}

.hero-copy h1 { margin-bottom: 18px; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 22px; }

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 550;
}

.trust-list li::before { content: "✓ "; color: var(--green); font-weight: 800; }

.hero-art {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 30px 0;
}

.hero-art::before {
  content: "";
  position: absolute;
  inset: 6% 4% 4%;
  background: radial-gradient(circle at 60% 40%, rgba(217, 83, 44, 0.24), rgba(217, 83, 44, 0) 66%),
    radial-gradient(circle at 20% 80%, rgba(47, 125, 91, 0.18), rgba(47, 125, 91, 0) 60%);
  border-radius: 50%;
  filter: blur(4px);
}

.phone {
  position: relative;
  width: min(330px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 16px;
  box-shadow: 0 30px 70px rgba(36, 28, 22, 0.16), 0 2px 6px rgba(36, 28, 22, 0.06);
  transform: rotate(-2deg);
}

.phone-top { display: flex; align-items: center; gap: 8px; padding: 2px 4px 12px; font-size: 0.72rem; color: var(--muted); }

.phone-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.phone-title { font-weight: 700; color: var(--ink-soft); }

.phone-time { margin-left: auto; font-variant-numeric: tabular-nums; }

.ticket {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
}

.ticket-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.ticket-head > div { display: flex; flex-direction: column; line-height: 1.25; }

.ticket-head strong { font-size: 0.95rem; }

.ticket-head span:not(.avatar):not(.badge) { font-size: 0.74rem; color: var(--muted); }

.ticket-head .badge { margin-left: auto; }

.fake-qr {
  width: 172px;
  height: 172px;
  margin: 0 auto;
  color: var(--ink);
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.fake-qr svg { width: 100%; height: 100%; shape-rendering: crispEdges; }

.ticket-valid { text-align: center; font-size: 0.78rem; color: var(--muted); margin: 12px 0 2px; }

.float-pill {
  position: absolute;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(36, 28, 22, 0.14);
  white-space: nowrap;
}

.pill-approve { top: 56px; right: -26px; background: var(--green); color: #fff; transform: rotate(4deg); }

.pill-code { bottom: 44px; left: -30px; background: var(--accent); color: #fff; transform: rotate(-5deg); }

.section { padding: 46px 0; }

.section-head { max-width: 620px; margin-bottom: 26px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.step p { color: var(--muted); margin-bottom: 0; font-size: 0.94rem; }

.split-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.split-section .panel { padding: 30px; }

.split-section h2 { margin-bottom: 12px; }

.check-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; font-size: 0.92rem; }

.check-list li { position: relative; padding-left: 22px; color: var(--ink-soft); }

.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 800; }

.panel-accent .check-list li::before { color: var(--accent-dark); }

.cta-band {
  margin: 22px 0 10px;
  padding: 34px 38px;
  border-radius: 26px;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 18px 46px rgba(36, 28, 22, 0.18);
}

.cta-band h2 { color: #fff; margin-bottom: 4px; }

.cta-band p { color: rgba(251, 243, 232, 0.72); margin-bottom: 0; }

.cta-band .btn-primary { flex: 0 0 auto; }

/* ---------- auth ---------- */

.auth-page .page { display: flex; align-items: flex-start; justify-content: center; }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 360px);
  gap: 28px;
  justify-content: center;
  width: 100%;
  padding: 34px 0 20px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 34px;
  box-shadow: var(--shadow);
}

.auth-card h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 6px; }

.auth-card form { margin-top: 24px; }

.auth-alt { margin: 22px 0 0; font-size: 0.9rem; color: var(--muted); text-align: center; }

.auth-aside { padding: 24px 6px; }

.auth-aside h2 { font-size: 1.1rem; }

.error-card { max-width: 520px; margin: 40px auto; text-align: center; }

.error-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* ---------- dashboard ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 22px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.stat { display: flex; flex-direction: column; gap: 2px; }

.stat-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }

.stat-label { font-size: 0.78rem; color: var(--muted); font-weight: 550; }

.stat-urgent .stat-value { color: var(--accent); }

.row-list { list-style: none; margin: 0; padding: 0; }

.row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
}

.row-item + .row-item { border-top: 1px solid var(--line); }

.row-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.row-link:hover strong { color: var(--accent-dark); }

.row-item:has(> .row-link:hover) { background: var(--surface-2); border-radius: 10px; }

.row-main { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1; }

.row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.row-meta { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; flex: 0 0 auto; }

.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 0.8rem;
  flex: 0 0 auto;
  border: 1px solid rgba(217, 83, 44, 0.12);
}

.account-avatar-alt { background: var(--green-soft); color: #1f5a41; border-color: rgba(47, 125, 91, 0.14); }

.account-avatar-lg { width: 52px; height: 52px; border-radius: 15px; font-size: 0.95rem; }

.account-avatar-xl { width: 66px; height: 66px; border-radius: 19px; font-size: 1.15rem; }

.activity-list { list-style: none; margin: 0; padding: 0; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
}

.activity-item + .activity-item { border-top: 1px solid var(--line); }

.activity-dot {
  width: 9px;
  height: 9px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex: 0 0 auto;
}

.activity-main p { margin: 0; font-size: 0.92rem; }

.activity-main p + p { margin-top: 2px; }

.activity-list-lg .activity-item { gap: 20px; padding: 15px 0; }

.activity-date {
  flex: 0 0 150px;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

/* ---------- accounts ---------- */

.account-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}

.account-card-top { display: flex; align-items: flex-start; gap: 14px; }

.account-card-title { flex: 1; min-width: 0; }

.account-card-title h2 { font-size: 1.2rem; margin-bottom: 2px; }

.account-card-status { flex: 0 0 auto; }

.account-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 16px 0 18px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}

.account-card-meta strong { color: var(--ink); }

.account-card-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.account-head { align-items: center; }

.account-head-main { display: flex; align-items: center; gap: 16px; }

.account-head-main h1 { margin-bottom: 2px; }

.account-head-main p { margin-bottom: 0; }

.people-list { list-style: none; margin: 0; padding: 0; }

.person-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.person-row + .person-row { border-top: 1px solid var(--line); }

.person-row.is-muted { opacity: 0.55; }

.person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }

.person-main strong { overflow-wrap: anywhere; }

.person-head { display: flex; align-items: center; gap: 13px; }

.person-row-request { flex-wrap: wrap; }

.request-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }

.prose-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }

.prose-grid .panel { padding: 28px; }

.prose-grid h2 { font-size: 1.3rem; margin-bottom: 12px; }

.prose-grid p { color: var(--ink-soft); }

.numbered { margin: 0; padding-left: 1.2em; display: grid; gap: 12px; color: var(--ink-soft); }

.numbered li { padding-left: 4px; }

.numbered strong { color: var(--ink); }

/* ---------- counter ---------- */

.counter-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.counter-toolbar #show-selected { margin-left: auto; }

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.pick-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 90ms ease;
  user-select: none;
}

.pick-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }

.pick-card:has(.pick-input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.pick-card:focus-within { box-shadow: var(--focus); }

.pick-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.pick-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  flex: 0 0 auto;
  position: relative;
}

.pick-card:has(.pick-input:checked) .pick-check { background: var(--accent); border-color: var(--accent); }

.pick-card:has(.pick-input:checked) .pick-check::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.pick-main { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }

.pick-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pick-status { margin-left: auto; flex: 0 0 auto; }

.qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #fdf9f2;
  overflow-y: auto;
  padding: 0 20px calc(24px + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}

.overlay-open { overflow: hidden; }

.qr-overlay-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 940px;
  margin: 0 auto;
  padding: 16px 0;
  background: rgba(253, 249, 242, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.qr-overlay-bar h2 { margin-bottom: 0; }

.qr-overlay-actions { display: flex; gap: 8px; }

.qr-list {
  max-width: 940px;
  margin: 22px auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
  align-items: start;
}

.qr-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  text-align: center;
  box-shadow: var(--shadow);
  break-inside: avoid;
}

.qr-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  margin-bottom: 14px;
}

.qr-card-head h3 { margin: 0; font-size: 1.15rem; }

.qr-owner { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.11em; color: var(--muted); font-weight: 750; }

.qr-image {
  width: min(100%, 330px);
  margin: 4px auto 12px;
  border-radius: 14px;
  background: #fff;
  image-rendering: pixelated;
}

.qr-validity { margin: 0; font-size: 0.86rem; color: var(--muted); }

.qr-countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #1f5a41;
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.qr-countdown.is-expired { background: var(--red-soft); color: #88201a; }

.qr-card-actions { display: flex; justify-content: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

.qr-card-error { border-color: #efc3bd; background: var(--red-soft); }

.qr-card-error h3 { margin-bottom: 6px; }

.qr-card-error p { color: #7e201a; font-size: 0.9rem; }

.qr-card-error a { color: #7e201a; font-weight: 700; }

.qr-footnote { max-width: 700px; margin: 4px auto 20px; text-align: center; font-size: 0.78rem; color: var(--muted); }

/* ---------- footer ---------- */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 24px 0 30px;
  background: rgba(246, 234, 217, 0.5);
}

.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }

.footer-inner p { margin: 0; font-size: 0.78rem; color: var(--muted); max-width: 72ch; }

.footer-links { display: flex; gap: 16px; white-space: nowrap; }

.footer-links a { color: var(--muted); font-weight: 600; text-decoration: none; }

.footer-links a:hover { color: var(--ink); }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 18px; padding-top: 34px; }
  .hero-art { order: -1; padding: 8px 0 0; }
  .phone { width: min(310px, 88%); }
  .pill-approve { right: -12px; }
  .pill-code { left: -12px; }
  .grid-main, .grid-sidebar, .split-section, .prose-grid { grid-template-columns: 1fr; }
  .grid-sidebar > aside { order: 2; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .steps { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: minmax(0, 460px); }
  .auth-aside { padding: 4px 6px 20px; }
  .account-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media (max-width: 860px) {
  .main-nav { display: none; }
  .tabbar { display: grid; }
  body.has-tabbar { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .site-footer { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  body:not(.has-tabbar) .site-footer { padding-bottom: 28px; }
  .page { padding-top: 24px; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .header-inner { min-height: 60px; gap: 10px; }
  .brand { font-size: 1.05rem; }
  .brand-mark { width: 27px; height: 27px; }
  .header-actions .btn-ghost { display: none; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
  .page-head-actions { width: 100%; flex-wrap: wrap; }
  .page-head-actions .btn { flex: 1; }
  h1 { font-size: clamp(1.9rem, 9vw, 2.6rem); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px 18px; }
  .stat-value { font-size: 1.45rem; }
  .panel { padding: 20px; border-radius: 18px; }
  .cta-band { flex-direction: column; align-items: flex-start; padding: 26px; }
  .cta-band .btn { width: 100%; }
  .empty-hero { flex-direction: column; align-items: flex-start; }
  .empty-hero .btn { width: 100%; }
  .account-head { flex-direction: column; align-items: flex-start; }
  .account-head .page-head-actions { width: 100%; }
  .account-head-main .account-avatar-xl { width: 54px; height: 54px; }
  .account-card-top { flex-wrap: wrap; }
  .account-card-status { margin-left: 66px; }
  .account-card-actions .btn { flex: 1; }
  .search-form { flex-direction: column; align-items: stretch; }
  .counter-toolbar { flex-wrap: wrap; gap: 10px; }
  .counter-toolbar #show-selected { margin-left: 0; width: 100%; }
  .qr-overlay { padding: 0 12px calc(16px + env(safe-area-inset-bottom)); }
  .qr-overlay-bar { padding: 12px 0; }
  .qr-overlay-actions .btn { min-height: 38px; padding: 0 12px; font-size: 0.85rem; }
  .qr-list { grid-template-columns: 1fr; margin-top: 14px; }
  .qr-card { padding: 18px; border-radius: 20px; }
  .qr-image { width: min(100%, 300px); }
  .activity-date { flex-basis: 100%; padding-top: 0; }
  .activity-list-lg .activity-item { flex-direction: column; gap: 4px; }
  .footer-inner { flex-direction: column; gap: 10px; }
  .person-row-request .request-actions { width: 100%; margin-left: 52px; }
  .request-actions .inline-form { flex: 1; }
  .request-actions select { flex: 1; }
  .auth-card { padding: 24px; border-radius: 22px; }
  .hero-art { padding-top: 0; }
  .trust-list { gap: 6px 14px; }
  .share-form .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- print: codes only ---------- */

@media print {
  @page { margin: 10mm; }
  body { background: #fff; }
  .site-header, .site-footer, .tabbar, .flashes, .qr-overlay-bar,
  .qr-footnote, .qr-card-actions, .qr-countdown { display: none !important; }
  .page > *:not(#qr-overlay) { display: none !important; }
  .qr-overlay {
    position: static !important;
    overflow: visible !important;
    background: #fff !important;
    padding: 0 !important;
  }
  .qr-list {
    display: block !important;
    max-width: none;
    margin: 0;
  }
  .qr-card {
    box-shadow: none;
    border: 1px solid #ddd;
    margin: 0 auto 12mm;
    max-width: 150mm;
    page-break-inside: avoid;
  }
  .qr-image { width: 110mm; }
  .qr-validity { font-size: 11pt; }
}

/* ---------- toasts ---------- */

.toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.toast { pointer-events: auto; box-shadow: 0 12px 30px rgba(36, 28, 22, 0.16); }

@media (min-width: 861px) {
  .toast-host { bottom: 24px; }
}
