/* Zhong De Tang — prototype styles. Palette sampled from the brief (nav tan, paper, logo gold). */
:root {
  --paper: #F6E4CE;
  --paper-2: #FBF3E7;
  --paper-3: #EFD9BD;
  --nav: #C5A179;
  --nav-ink: #2B1D12;
  --ink: #36240F;
  --muted: #6E5540;
  --faint: #8F765F;
  --rule: #D8BD99;
  --rule-strong: #2B1D12;
  --gold: #E5B84C;
  --gold-deep: #A87A22;
  --maroon: #7B2B1C;
  --maroon-2: #5E1F14;
  --ok: #2F6B4A;
  --ok-bg: #E3EFE3;
  --warn-bg: #FBEBC8;
  --danger: #A12A1C;
  --danger-bg: #F8E0DA;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(43, 29, 18, .06), 0 6px 22px rgba(43, 29, 18, .07);
  --serif-en: 'Cormorant Garamond', 'Noto Serif SC', Georgia, 'Times New Roman', serif;
  --serif-zh: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --brush: 'Ma Shan Zheng', 'Noto Serif SC', 'KaiTi', 'STKaiti', serif;
  --sans: 'Noto Sans SC', system-ui, -apple-system, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink);
  font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--maroon); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--maroon); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Decorations from the brief's paper background */
.deco { position: fixed; pointer-events: none; z-index: 0; user-select: none; }
.deco-tl { top: 70px; left: -30px; width: 190px; }
.deco-cloud { top: 110px; right: -20px; width: 260px; opacity: .85; }
.deco-br { bottom: -40px; right: -10px; width: 230px; }
@media (max-width: 700px) { .deco-tl { width: 110px; } .deco-cloud { width: 150px; } .deco-br { width: 130px; } }

/* Prototype ribbon */
.ribbon {
  position: relative; z-index: 30; background: var(--nav-ink); color: #F3E3CC;
  font-size: 13px; padding: 6px 16px; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: center;
}
.ribbon b { color: var(--gold); font-weight: 600; letter-spacing: .02em; }
.ribbon label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.ribbon a { color: #F3E3CC; }

/* Nav (matches the brief: tan bar, plain black links, Eng | 中文 right) */
.nav {
  position: sticky; top: 0; z-index: 25; background: var(--nav); color: var(--nav-ink);
  display: flex; align-items: center; gap: 8px; padding: 0 16px; min-height: 56px;
  box-shadow: 0 1px 0 rgba(43, 29, 18, .15);
}
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav a.nav-link {
  color: var(--nav-ink); text-decoration: none; font-size: 17px; padding: 8px 12px; border-radius: 999px;
  border: 1.5px solid transparent; white-space: nowrap;
}
.nav a.nav-link:hover { background: rgba(255, 255, 255, .18); }
.nav a.nav-link[aria-current="page"] { border-color: var(--nav-ink); }
.lang { display: flex; align-items: center; gap: 2px; font-size: 17px; white-space: nowrap; }
.lang button { background: none; border: 0; padding: 6px 6px; cursor: pointer; color: var(--nav-ink); opacity: .65; }
.lang button[aria-pressed="true"] { opacity: 1; font-weight: 700; }
.menu-btn { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--nav-ink); }
@media (max-width: 820px) {
  .menu-btn { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--nav); padding: 6px 12px 14px; box-shadow: 0 10px 20px rgba(43, 29, 18, .15);
  }
  .nav-links.open { display: flex; }
  .nav a.nav-link { border-radius: 10px; padding: 12px; }
  .nav { justify-content: space-between; }
}

main { position: relative; z-index: 1; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.page { padding-block: 36px 80px; }
.eyebrow { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-deep); font-weight: 600; margin: 0 0 6px; }
:lang(zh) .eyebrow { letter-spacing: .3em; }
h1, h2, h3 { font-variant-numeric: lining-nums; }
/* Cormorant only has old-style figures: amounts use the sans face so 0 never reads as o. */
h1, h2, h3 { font-family: var(--serif-en); color: var(--ink); line-height: 1.2; margin: 0 0 12px; font-weight: 600; }
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3 { font-family: var(--serif-zh); font-weight: 700; }
h1 { font-size: clamp(30px, 4.4vw, 46px); }
h2 { font-size: clamp(24px, 3vw, 32px); }
h3 { font-size: 21px; }
p { margin: 0 0 12px; }
.lead { font-size: 18px; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px;
  border-radius: 999px; border: 1.5px solid var(--maroon); background: var(--maroon); color: #FBF1E3;
  font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--maroon-2); border-color: var(--maroon-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--maroon); }
.btn-ghost:hover { background: rgba(123, 43, 28, .07); color: var(--maroon-2); }
.btn-gold { background: var(--gold); border-color: var(--gold-deep); color: var(--nav-ink); }
.btn-gold:hover { background: #D9A93A; border-color: var(--gold-deep); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.linkish { background: none; border: 0; padding: 0; color: var(--maroon); text-decoration: underline; cursor: pointer; }

/* Cards */
.card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.outline-card { border: 1.5px solid var(--rule-strong); border-radius: var(--radius); background: rgba(251, 243, 231, .55); }

/* Home hero video */
.hero { position: relative; height: calc(100vh - 56px - 32px); min-height: 440px; max-height: 820px; overflow: hidden; background: #000; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
@media (max-width: 620px) { .hero { height: 62vh; min-height: 360px; } }

.section { padding-block: 56px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* Event banners */
.banner {
  position: relative; overflow: hidden; border-radius: calc(var(--radius) - 4px); color: #FBF1E3; min-height: 150px; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 46px 96px 16px 18px; isolation: isolate;
}
.ev-tile.featured .banner { padding-right: 130px; }
.banner::before { content: ''; position: absolute; inset: 0; z-index: -2; background: var(--bg); }
.banner::after {
  content: ''; position: absolute; right: -24px; bottom: -30px; width: 58%; aspect-ratio: 301 / 680; z-index: -1;
  background: url(assets/lotus-br.png) no-repeat center / contain; filter: invert(1) brightness(1.6); opacity: .22;
}
.banner .glyph {
  position: absolute; top: 10px; right: 14px; font-family: var(--brush); font-size: 64px; line-height: 1; color: var(--gold);
  writing-mode: vertical-rl; letter-spacing: .05em; text-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.banner .b-date { font-size: 13px; font-weight: 600; letter-spacing: .04em; opacity: .92; }
.banner .b-title {
  font-family: var(--serif-en); font-size: 21px; line-height: 1.2; font-weight: 600; margin-top: 2px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
:lang(zh) .banner .b-title { font-family: var(--serif-zh); font-weight: 700; }
.banner .b-tag { position: absolute; top: 12px; left: 14px; background: var(--gold); color: var(--nav-ink); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.t-jade { --bg: linear-gradient(150deg, #3C7F69, #1E4A3E); }
.t-lapis { --bg: linear-gradient(150deg, #33609A, #1B3358); }
.t-gold { --bg: linear-gradient(150deg, #B8862E, #7A5217); }
.t-crimson { --bg: linear-gradient(150deg, #9E3322, #5E1A10); }
.t-indigo { --bg: linear-gradient(150deg, #4A4288, #26214C); }

/* Events grid (p.9): featured "Upcoming Event" card spans 2 cols x 2 rows; the rest
   (up to 20 total) auto-flow into the remaining cells in reading order — a sparse grid
   naturally leaves unused trailing cells blank with no box, so capacity just falls out
   of how many <a class="ev-tile"> are rendered, nothing extra needed for "empty". */
.ev-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(170px, auto); gap: 16px; }
.ev-tile { display: block; text-decoration: none; border: 1.5px solid var(--rule-strong); border-radius: var(--radius); padding: 5px; background: rgba(251, 243, 231, .6); transition: transform .15s, box-shadow .15s; }
.ev-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ev-tile.featured { grid-column: span 2; grid-row: span 2; }
.ev-tile.featured .banner { min-height: 350px; }
.ev-tile.featured .glyph { font-size: 96px; }
.ev-tile.featured .b-title { font-size: 28px; -webkit-line-clamp: 3; }
.ev-tile.past { opacity: .55; }
@media (max-width: 900px) { .ev-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .ev-grid { grid-template-columns: 1fr; }
  .ev-tile.featured { grid-column: span 1; grid-row: auto; }
  .ev-tile.featured .banner { min-height: 260px; }
  /* A long English title (e.g. "Guan Yin Bodhisattva Renunciation Day Puja") needs 4 lines
     at this width/font-size; the 3-line clamp was cutting the word that names the event. */
  .ev-tile.featured .b-title { -webkit-line-clamp: 4; }
}

/* Donation tiles (the brief's three stacked, centred boxes) */
.don-stack { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 18px; }
.don-tile {
  width: min(520px, 100%); text-decoration: none; color: var(--ink); border: 1.5px solid var(--rule-strong); border-radius: var(--radius);
  background: rgba(251, 243, 231, .7); padding: 20px 24px; display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center;
  text-align: left; transition: transform .15s, box-shadow .15s, background .15s;
}
.don-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); background: var(--paper-2); }
.don-tile .seal { width: 64px; height: 64px; object-fit: contain; }
.don-tile h3 { margin: 0 0 2px; font-size: 22px; }
.don-tile p { margin: 0; color: var(--muted); font-size: 15px; }
.don-tile .arrow { font-size: 22px; color: var(--maroon); }

/* Detail pages */
.detail { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 900px) { .detail { grid-template-columns: minmax(0, 1fr); } }
.sticky { position: sticky; top: 76px; }
@media (max-width: 900px) { .sticky { position: static; } }
.back { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; color: var(--muted); margin-bottom: 14px; font-size: 15px; }
.back:hover { color: var(--maroon); }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 16px 0 20px; font-size: 15px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule); }
.timeline li { position: relative; padding: 0 0 14px 18px; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid var(--paper); }
.timeline .tt { font-weight: 700; margin-right: 8px; font-variant-numeric: tabular-nums; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span, .label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.req { color: var(--danger); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--rule); background: #FFFBF4; color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--maroon); box-shadow: 0 0 0 3px rgba(123, 43, 28, .15); }
input[aria-invalid=true] { border-color: var(--danger); }
.err { color: var(--danger); font-size: 14px; margin: -6px 0 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin-bottom: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--maroon); flex: none; }

.opt { border-top: 1px solid var(--rule); padding: 14px 0; }
.opt:first-of-type { border-top: 0; padding-top: 4px; }
.opt-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.opt-name { font-weight: 700; }
.opt-price { color: var(--muted); font-size: 14px; }
.opt-note { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--rule); border-radius: 999px; background: #FFFBF4; flex: none; }
.stepper button { width: 38px; height: 38px; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--maroon); border-radius: 50%; }
.stepper button:disabled { color: var(--rule); cursor: not-allowed; }
.stepper output { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.names { display: grid; gap: 8px; margin-top: 10px; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; border-top: 1.5px solid var(--rule-strong); margin-top: 8px; padding-top: 14px; font-size: 18px; }
.total-row strong { font-size: 24px; font-family: var(--sans); font-weight: 700; font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--rule); background: #FFFBF4; border-radius: 999px; padding: 8px 16px; cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; }
.chip[aria-pressed=true] { background: var(--maroon); border-color: var(--maroon); color: #FBF1E3; }
.seg { display: inline-flex; border: 1.5px solid var(--rule); border-radius: 999px; padding: 3px; background: #FFFBF4; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; }
.seg button[aria-pressed=true] { background: var(--nav-ink); color: #FBF1E3; }

/* Checkout */
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 22px; flex-wrap: wrap; }
.steps li { display: flex; gap: 8px; align-items: center; color: var(--faint); font-weight: 600; font-size: 15px; }
.steps li .n { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: 13px; }
.steps li.on { color: var(--maroon); }
.steps li.done { color: var(--ok); }
.steps li + li::before { content: ''; width: 26px; height: 1.5px; background: var(--rule); }
.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--rule); font-size: 15px; }
.summary-line .l { min-width: 0; }
.summary-line .r { font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary-names { font-size: 13px; color: var(--muted); }
.paynow { display: grid; grid-template-columns: 190px 1fr; gap: 20px; align-items: center; }
@media (max-width: 560px) { .paynow { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.qr { width: 190px; height: 190px; border-radius: 12px; background: #fff; padding: 10px; border: 2px solid #7B1F6B; position: relative; }
.qr .demo { position: absolute; inset: 0; display: grid; place-items: center; }
.qr .demo span { background: #7B1F6B; color: #fff; font-weight: 800; font-size: 13px; padding: 3px 8px; border-radius: 6px; letter-spacing: .1em; }
.paynow-brand { display: inline-block; background: #7B1F6B; color: #fff; font-weight: 800; padding: 2px 10px; border-radius: 6px; font-size: 14px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.testcards { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.notice { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }
.notice.warn { background: var(--warn-bg); border: 1px solid #E9CF8E; }
.notice.bad { background: var(--danger-bg); border: 1px solid #E7B3A8; color: #6E1D12; }
.notice.good { background: var(--ok-bg); border: 1px solid #B9D6BD; color: #1F4A33; }

/* Receipt */
.receipt { max-width: 720px; margin: 0 auto; }
.receipt-head { text-align: center; margin-bottom: 18px; }
.receipt-head .lotus-ok { width: 74px; height: 74px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--maroon); color: var(--gold); font-family: var(--brush); font-size: 30px; }
.ref { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .06em; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* Statue wall */
.wall-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; margin: 10px 0 14px; }
.wall-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 16px; height: 16px; border-radius: 4px; display: inline-block; border: 1px solid var(--rule-strong); }
.wall-scroll { overflow-x: auto; padding-bottom: 6px; }
.wall { display: grid; grid-template-columns: 30px repeat(12, 38px); gap: 5px; background: linear-gradient(#5B2A1A, #3E1B10); padding: 12px; border-radius: 12px; width: max-content; }
.wall .rowlab { color: var(--gold); font-weight: 700; display: grid; place-items: center; font-size: 13px; }
.niche { width: 38px; height: 50px; border-radius: 18px 18px 4px 4px; border: 1px solid rgba(229, 184, 76, .5); background: #F4E2C3; cursor: pointer; display: grid; place-items: end center; padding-bottom: 4px; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.niche.tier-upper { background: #F8E7B9; }
.niche.taken { background: #8B6B45; color: #F3E3CC; cursor: not-allowed; }
.niche.taken::before { content: '地'; font-family: var(--brush); color: var(--gold); font-size: 18px; margin-bottom: 2px; }
.niche[aria-pressed=true] { background: var(--gold); outline: 3px solid #fff; outline-offset: -1px; color: var(--nav-ink); font-weight: 700; }
.niche:not(.taken):hover { background: #FFF3D6; }
.tier-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
@media (max-width: 560px) { .tier-cards { grid-template-columns: 1fr; } }
.tier-cards .t { border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 10px 12px; background: #FFFBF4; font-size: 14px; }
.tier-cards .t strong { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }

/* About / contact */
.photo-frame { border-radius: var(--radius); overflow: hidden; border: 6px solid var(--paper-2); box-shadow: var(--shadow); }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.map { aspect-ratio: 16 / 10; border-radius: var(--radius); border: 1.5px dashed var(--rule-strong); display: grid; place-items: center; text-align: center; color: var(--muted); background: repeating-linear-gradient(45deg, rgba(197, 161, 121, .12) 0 12px, transparent 12px 24px); padding: 20px; }
.info-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.info-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; overflow-wrap: anywhere; }
.info-list .ic { color: var(--maroon); font-size: 18px; line-height: 1.5; }
a.map { overflow-wrap: anywhere; text-decoration: none; color: var(--muted); transition: color .15s, border-color .15s; }
a.map:hover { color: var(--maroon); border-color: var(--maroon); }
a.map strong { display: inline-block; margin: 6px 0 4px; color: var(--ink); font-size: 17px; }

/* Modal + toast */
.modal-back { position: fixed; inset: 0; background: rgba(43, 29, 18, .5); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--paper-2); border-radius: var(--radius); max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.modal header h3 { margin: 0; font-size: 20px; }
.modal .body { padding: 18px 20px; }
.modal .foot { padding: 14px 20px; border-top: 1px solid var(--rule); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.x { background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--muted); width: 40px; height: 40px; border-radius: 50%; }
.email-preview { background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 18px; font-size: 14px; color: #222; }
.email-preview .eh { font-size: 12px; color: #666; border-bottom: 1px solid #eee; padding-bottom: 8px; margin-bottom: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--nav-ink); color: #FBF1E3; padding: 12px 20px; border-radius: 999px; z-index: 70; box-shadow: var(--shadow); font-size: 15px; max-width: calc(100% - 32px); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Admin */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1.5px solid var(--rule); margin-bottom: 20px; }
.tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.tabs button[aria-selected=true] { color: var(--maroon); border-bottom-color: var(--maroon); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .v { font-family: var(--sans); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-2); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { background: var(--paper-3); font-weight: 700; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--paper-3); color: var(--ink); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: #1F4A33; }
.badge.warn { background: var(--warn-bg); color: #6B4A08; }
.badge.bad { background: var(--danger-bg); color: #6E1D12; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }

footer.site { position: relative; z-index: 1; background: var(--nav-ink); color: #E9D6BC; padding: 36px 0 28px; font-size: 14px; }
footer.site a { color: #F3E3CC; }
footer.site .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { footer.site .cols { grid-template-columns: 1fr; } }
footer.site img { width: 260px; margin-bottom: 10px; }

@media print {
  .ribbon, .nav, footer.site, .deco, .actions, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
