:root {
  --ui-bg: #f5f7f6;
  --ui-surface: #fff;
  --ui-ink: #24352e;
  --ui-muted: #56685f;
  --ui-line: #d4dfd8;
  --ui-accent: #245c50;
  --ui-accent-soft: #e4efe9;
  --ui-wine: #763c4c;
  --ui-gold: #b69854;
  --ui-error: #8c2834;
  --ui-radius: 6px;
  --ui-width: 1120px;
}

* { box-sizing: border-box; letter-spacing: 0; }
body, body.birthday-admin, body.guest-shell-body {
  margin: 0; background: var(--ui-bg); color: var(--ui-ink);
  font: 16px/1.5 Arial, sans-serif;
}
body a { color: var(--ui-accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ui-accent); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
h1, h2, h3, p, dd, li { overflow-wrap: anywhere; }
h1 { font-size: 28px; line-height: 1.25; margin: 0 0 24px; }
h2 { font-size: 20px; line-height: 1.35; margin: 0 0 16px; }
h3 { font-size: 17px; margin: 24px 0 12px; }
p { margin: 0 0 16px; }
img { max-width: 100%; }
.ui-skip { position: absolute; left: 16px; top: -100px; z-index: 20; padding: 12px; background: #fff; }
.ui-skip:focus { top: 12px; }
.ui-header { background: var(--ui-surface); border-bottom: 1px solid var(--ui-line); }
.ui-header-inner { max-width: var(--ui-width); margin: auto; padding: 16px 24px; display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; }
.ui-brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--ui-muted); flex-shrink: 0; }
.ui-brand img { width: 146px; height: 44px; object-fit: contain; }
.ui-brand span { font-size: 13px; padding-left: 16px; border-left: 1px solid var(--ui-line); }
.ui-staff-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; flex: 1; }
.ui-staff-nav > a, .ui-tools-nav > summary { padding: 12px 10px; min-height: 44px; font-size: 14px; text-decoration: none; }
.ui-staff-nav a[aria-current], .ui-tools-nav[open] > summary, .ui-tools-nav summary[data-current-section] { background: var(--ui-accent-soft); color: var(--ui-accent); font-weight: 700; border-bottom: 2px solid var(--ui-accent); }
.ui-tools-nav { position: relative; }
.ui-tools-nav > summary { cursor: pointer; }
.ui-tools-nav > div { position: absolute; right: 0; top: 100%; width: 290px; max-width: calc(100vw - 40px); z-index: 10; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); background: #fff; box-shadow: 0 8px 24px #24352e1a; padding: 8px; }
.ui-tools-nav > div a { display: block; padding: 10px 12px; font-size: 14px; text-decoration: none; }
.ui-tools-nav a:hover { background: var(--ui-bg); }
.ui-logout { margin: 0; }
.ui-public-header { justify-content: space-between; max-width: 900px; }
.ui-public-header > a:last-child { font-size: 13px; padding: 12px 0; }
.admin-page, .birthday-workspace { max-width: var(--ui-width); width: 100%; margin: 0 auto; padding: 32px 24px 64px; min-width: 0; }
.admin-page > section { margin: 28px 0; border-top: 1px solid var(--ui-line); padding-top: 24px; }
.admin-page > h2 { margin-top: 28px; }
.admin-page > p:first-child { font-size: 14px; }
.ui-narrow { max-width: 560px; }
.page { display: block; min-height: 0; padding: 32px 24px 64px; }
.panel { width: 100%; max-width: 520px; padding: 0; margin: auto; border: 0; background: transparent; border-radius: 0; box-shadow: none; }
.policy-content { max-width: 760px; }
.policy-content h2 { margin-top: 32px; }
.policy-details { grid-template-columns: minmax(120px, 1fr) minmax(0, 3fr); }
.policy-details dd { overflow-wrap: anywhere; min-width: 0; }
.form, .ui-form { display: grid; gap: 18px; }
.ui-form { max-width: 520px; margin: 24px 0; }
label { font-size: 15px; line-height: 1.45; }
.form > label { gap: 6px; }
.form input, .ui-form input, .birthday-search input, .form textarea {
  width: 100%; min-width: 0; min-height: 46px; padding: 11px 12px; border: 1px solid #a5b7ad;
  border-radius: var(--ui-radius); background: var(--ui-surface); color: var(--ui-ink); font: inherit;
}
input::placeholder, textarea::placeholder { color: #68786f; opacity: 1; }
input[type=checkbox], input[type=radio], .form input[type=radio] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--ui-accent); flex-shrink: 0; }
.consent-field { align-items: start; gap: 12px; padding: 0; background: transparent; border: 0; }
.consent-field input { margin-top: 3px; }
.consent-field label { font-size: 14px; font-weight: 400; }
.required-note { color: var(--ui-wine); }
.ui-optional { font-weight: 400; color: var(--ui-muted); font-size: 13px; }
.ui-help { font-size: 14px; color: var(--ui-muted); margin: 0; font-weight: 400; }
body button, body .button, body .ui-primary, body .birthday-primary-link {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px;
  border: 1px solid transparent; border-radius: var(--ui-radius); padding: 11px 16px; font: 700 15px/1.4 Arial, sans-serif;
  background: var(--ui-accent); color: #fff; text-decoration: none; cursor: pointer; overflow-wrap: anywhere; text-align: center;
}
body button:hover, body .button:hover, body .birthday-primary-link:hover { background: #1b483e; }
body .ui-secondary, body button[formaction], body .birthday-admin button[data-status-button] { background: transparent; color: var(--ui-accent); border: 1px solid #a5b7ad; }
body .ui-secondary:hover, body button[formaction]:hover { background: var(--ui-accent-soft); }
body button:disabled { color: #56685f; background: #e1e7e3; border-color: var(--ui-line); cursor: not-allowed; }
form[aria-busy=true] { cursor: progress; }
.ui-alert, .birthday-error, .birthday-success, .birthday-notice { padding: 16px 18px; border: 0; border-left: 4px solid var(--ui-accent); background: var(--ui-accent-soft); color: #193f32; border-radius: 0; margin: 0 0 24px; }
.ui-alert-error, .birthday-error { background: #fceff1; color: var(--ui-error); border-left-color: var(--ui-error); }
.ui-alert-neutral, .birthday-notice { background: #eef1f4; color: #364c5a; border-left-color: #637b8a; }
.ui-alert p:last-child, .birthday-success p:last-child, .birthday-error p:last-child { margin-bottom: 0; }
.ui-alert h2 { color: inherit; font-size: 18px; margin-bottom: 8px; }
.ui-table-scroll { width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; margin: 16px 0 24px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); background: #fff; }
.ui-table-scroll table { min-width: 100%; margin: 0; border: 0; background: transparent; box-shadow: none; border-collapse: collapse; font-size: 14px; }
.ui-table-scroll th, .ui-table-scroll td { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--ui-line); text-align: left; vertical-align: top; min-width: 150px; max-width: 340px; overflow-wrap: break-word; }
.ui-table-scroll th { color: var(--ui-muted); font-weight: 700; background: #eef3f0; }
.ui-table-scroll tbody tr:last-child td, .ui-table-scroll tbody tr:last-child th { border-bottom: 0; }
.ui-table-scroll tbody tr:hover td { background: #f7faf8; }
.ui-table-scroll td a { display: inline-block; padding: 5px 0; }
.details { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 3fr); gap: 12px 24px; padding: 20px 0; margin: 20px 0; background: transparent; border: 0; border-top: 1px solid var(--ui-line); border-bottom: 1px solid var(--ui-line); border-radius: 0; }
.details dt, .operator-card dt { font-weight: 400; color: var(--ui-muted); }
.details dd { margin: 0; min-width: 0; }
.operator-header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 24px; }
.operator-header h1 { flex-basis: 100%; margin: 4px 0 0; }
.operator-reference { margin-left: auto; color: var(--ui-muted); font: 14px/1.4 monospace; overflow-wrap: anywhere; }
.operator-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.operator-card { min-width: 0; background: transparent; border: 0; border-radius: 0; padding: 0; box-shadow: none; }
.operator-card dl { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 1fr); gap: 12px; margin: 0; }
.operator-card dd { margin: 0; min-width: 0; }
.operator-actions { padding-left: 20px; }
.operator-actions li { padding: 4px 0; }
.operator-badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 13px; font-weight: 700; background: #e9eeeb; color: #42584b; }
.operator-badge-ok { background: #e2efe7; color: #245c3e; }
.operator-badge-error { background: #fbe9ec; color: #8c2834; }
.operator-badge-warning { background: #fbefd5; color: #6e521a; }
.ui-table-scroll .operator-badge { min-width: 180px; }
.lookup-link { display: inline-block; padding: 10px 0; margin-right: 20px; }
.birthday-title { margin: 0 0 24px; }
.birthday-title p { color: var(--ui-wine); font-size: 14px; }
.birthday-title h1 { font-size: 28px; }
.birthday-columns { gap: 40px; }
.birthday-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 28px; }
.birthday-steps li { font-size: 15px; padding: 0 0 12px; }
.birthday-steps small { display: block; font-weight: 400; font-size: 13px; margin-top: 3px; }
.birthday-steps [aria-disabled=true] { color: #627268; border-bottom: 2px dashed var(--ui-line); }
.birthday-summary { border-left-color: var(--ui-wine); }
.birthday-guest-list label:has(input:checked) { background: var(--ui-accent-soft); box-shadow: inset 3px 0 var(--ui-accent); }
.birthday-guest-list label { padding: 12px; }
.birthday-error, .birthday-notice, .birthday-success { scroll-margin-top: 24px; }
.birthday-admin .birthday-issued-codes { grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); }

/* Guest pages share the brand without inheriting the staff workspace density. */
.guest-shell { width: min(100%, 520px); padding: 16px 20px 100px; }
.guest-topbar { min-height: 60px; margin-bottom: 12px; border-bottom: 1px solid var(--ui-line); padding-bottom: 12px; }
.guest-brand-logo { width: 146px; height: 44px; object-fit: contain; padding: 0; border: 0; background: transparent; border-radius: 0; filter: none; }
.guest-back-link { color: var(--ui-accent); background: transparent; border: 0; border-radius: 0; padding: 10px 0; min-height: 44px; }
.guest-back-link-muted { color: var(--ui-muted); font-weight: 400; }
.guest-shell .guest-identity-card, .guest-shell .guest-ivory-card, .guest-shell .hero-profile-card { background: transparent; color: var(--ui-ink); border: 0; border-bottom: 1px solid var(--ui-line); box-shadow: none; border-radius: 0; }
.guest-shell .guest-primary-card { background: var(--ui-accent); border: 0; color: #fff; box-shadow: none; border-radius: 0; }
.guest-shell .guest-home-hero { min-height: 0; padding: 16px 0 24px; overflow: visible; }
.guest-shell .guest-home-identity h1, .guest-shell .stamp-card-hero h1, .guest-shell .hero-profile-header h1 { font-size: 28px; line-height: 1.25; color: var(--ui-ink); }
.guest-shell .guest-home-title, .guest-shell .hero-title { font-size: 18px; color: var(--ui-accent); line-height: 1.4; }
.guest-shell .guest-home-real-note { color: var(--ui-muted); font-size: 14px; }
.guest-home-eyebrow, .hero-eyebrow, .stamp-eyebrow { color: var(--ui-muted); font-size: 13px; letter-spacing: 0; }
.guest-shell .guest-home-balance, .guest-shell .guest-home-row { padding: 24px 0; margin: 0; gap: 12px; }
.guest-shell .guest-home-balance h2 { font-size: 32px; line-height: 1.2; }
.guest-shell .guest-home-balance span, .guest-shell .guest-home-row span { color: var(--ui-muted); font-weight: 400; }
.guest-shell .guest-home-row h2 { color: var(--ui-ink); font-size: 20px; line-height: 1.35; }
.guest-shell .guest-home-row > div { min-width: 0; }
.guest-shell .guest-home-mission { margin: 16px 0 0; padding: 24px 20px; }
.guest-shell .guest-home-mission h2 { font-size: 22px; line-height: 1.3; }
.guest-shell .guest-primary-card p, .guest-shell .guest-primary-card .guest-home-eyebrow { color: #e0ece6; }
.guest-shell .guest-home-mission strong { color: #fff; background: transparent; padding: 0; border: 0; border-radius: 0; font-size: 16px; }
.guest-home-friends-count { background: var(--ui-accent-soft); color: var(--ui-accent); border-radius: 6px; }
.guest-home-mini-stamp { border-color: #879d90; }
.guest-home-mini-stamp.is-filled, .stamp-dot-filled { background: var(--ui-gold); }
.guest-home-progress, .hero-progress { background: #e0e7e2; border: 0; border-radius: 4px; }
.guest-home-progress span, .hero-progress-bar { background: var(--ui-accent); }
.guest-birthday { background: #eef4f0; padding: 22px 20px; margin: 0; border-top-color: var(--ui-wine); border-bottom-color: var(--ui-line); }
.guest-birthday .birthday-total { font-size: 32px; }
.guest-birthday .birthday-note { font-size: 14px; }
.guest-birthday progress { appearance: none; border: 0; border-radius: 4px; overflow: hidden; accent-color: var(--ui-accent); background: #d4dfd8; }
.guest-birthday progress::-webkit-progress-bar { background: #d4dfd8; }
.guest-birthday progress::-webkit-progress-value { background: var(--ui-accent); }
.guest-birthday progress::-moz-progress-bar { background: var(--ui-accent); }
.guest-home-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 520px); padding: 8px 12px max(8px, env(safe-area-inset-bottom)); border: 1px solid var(--ui-line); border-bottom: 0; background: #fff; border-radius: 0; box-shadow: 0 -4px 18px #24352e0d; z-index: 5; }
.guest-bottom-nav a { min-height: 44px; color: var(--ui-muted); background: transparent; border: 0; border-radius: 4px; font-size: 14px; }
.guest-bottom-nav a.is-active, .guest-bottom-nav a[aria-current] { color: var(--ui-accent); background: var(--ui-accent-soft); box-shadow: inset 0 -2px var(--ui-accent); }
.guest-shell section[id] { scroll-margin-top: 20px; }
.ui-preview-label { font-size: 13px; color: var(--ui-wine); margin: 12px 0; }
.stamp-card, .stamp-card-hero, .hero-profile-card { padding: 24px 0; }
.stamp-card-note, .hero-goal-card { padding: 20px; }
.stamp-card-list { gap: 0; }
.stamp-count, .stamp-status { color: var(--ui-accent); background: var(--ui-accent-soft); border: 0; border-radius: 4px; font-size: 15px; }
.stamp-label { color: var(--ui-muted); }
.stamp-dots { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stamp-dots-eight { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.stamp-dot { width: 100%; height: auto; aspect-ratio: 1; max-width: 44px; border-color: #a5b7ad; box-shadow: none; }
.hero-level-badge { background: var(--ui-accent-soft); color: var(--ui-accent); border-color: var(--ui-line); box-shadow: none; }
.hero-card-grid { gap: 20px; }
.hero-timeline-step { min-width: 0; }
@media (max-width: 720px) {
  .ui-header-inner { padding: 12px 20px; gap: 10px 16px; }
  .ui-staff-nav { order: 3; flex-basis: 100%; }
  .ui-logout { margin-left: auto; }
  .ui-brand span { display: none; }
  .ui-staff-nav > a, .ui-tools-nav > summary { font-size: 13px; padding: 11px 8px; }
  .ui-tools-nav > div { position: fixed; left: 20px; right: 20px; top: auto; width: auto; max-width: none; max-height: calc(100vh - 200px); overflow-y: auto; }
  .admin-page, .birthday-workspace { padding: 24px 20px 48px; }
  .page { padding: 28px 20px 48px; }
  h1, .birthday-title h1 { font-size: 25px; }
  .operator-grid, .birthday-columns { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .birthday-summary { border-left: 0; border-top: 2px solid var(--ui-wine); padding: 20px 0 0; }
  .details, .policy-details { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .details dd, .policy-details dd { margin: 0 0 14px; }
  .birthday-steps { gap: 16px; }
  .birthday-steps li { font-size: 14px; }
  .ui-public-header { gap: 6px 16px; }
}
@media (max-width: 420px) {
  .ui-brand img { width: 132px; }
  .ui-public-header > a:last-child { font-size: 12px; }
  .operator-card dl, .birthday-facts > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .operator-card dd { margin-bottom: 12px; }
}
[data-guest-screen][hidden], [data-guest-sections][hidden] { display: none !important; }
[data-guest-screen] { min-height: 65vh; }
.guest-screen-title { margin: 24px 0 12px; font-size: 26px; }
.guest-screen-heading { padding: 20px 0; }
.guest-screen-heading .guest-screen-title { margin: 0 0 12px; }
.guest-screen-heading p:last-child { margin-bottom: 0; color: var(--ui-muted); }
.guest-path-current { padding: 20px 0 20px 20px; border-left: 3px solid var(--ui-gold); margin: 0 0 24px; }
.guest-path-current h2 { font-size: 24px; margin-bottom: 8px; }
.guest-path-current p:last-child { margin: 0; color: var(--ui-muted); }
.guest-path-mission { padding: 24px; background: var(--ui-accent); color: #fff; }
.guest-path-mission .guest-home-eyebrow { color: #e0ece6; }
.guest-path-mission h2 { margin-bottom: 0; }
.guest-path-future { padding: 24px 0; }
.guest-path-future > p, .guest-stamps-note { font-size: 14px; color: var(--ui-muted); }
.guest-section-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.guest-section-heading h2 { min-width: 0; font-size: 18px; }
.guest-coming-soon { font-size: 12px; line-height: 1.5; color: var(--ui-wine); border-bottom: 1px solid var(--ui-wine); flex-shrink: 0; }
.guest-stamp-cards { display: grid; gap: 16px; }
.guest-stamp-card { padding: 20px; border: 1px solid var(--ui-line); border-radius: 6px; background: #fff; }
.guest-stamp-card p { font-size: 14px; color: var(--ui-muted); margin: 16px 0 0; }
.guest-stamp-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.guest-stamp-slots span { width: 100%; max-width: 44px; aspect-ratio: 1; border: 1px dashed #a5b7ad; border-radius: 50%; background: var(--ui-bg); }
.guest-stamps-note { margin: 20px 0; }
