:root {
  color-scheme: light;
  --ink: #20211d;
  --muted: #73756b;
  --paper: #f4f2e9;
  --panel: #fffef8;
  --line: #deded2;
  --lime: #c8f36a;
  --purple: #b7a7ed;
  --danger: #a93e3e;
  font-family: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, .button { border: 0; border-radius: 999px; padding: 12px 18px; background: var(--ink); color: white; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .18s ease, opacity .18s ease; }
button:hover, .button:hover { transform: translateY(-2px); }
button:disabled { cursor: wait; opacity: .55; transform: none; }
.button-soft { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.button-lime { background: var(--lime); color: var(--ink); }
.button-danger { background: #f7e1dc; color: var(--danger); }
.portal-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: min(1180px, calc(100% - 40px)); margin: auto; padding: 24px 0; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 700 14px "Space Grotesk", sans-serif; letter-spacing: .08em; text-decoration: none; }
.wordmark b { font-weight: 400; }
.wordmark-mark { display: flex; gap: 3px; transform: skew(-18deg); }
.wordmark-mark i { display: block; width: 5px; height: 20px; background: var(--ink); }
.portal-nav { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 13px; }
.portal-nav a { text-decoration: none; }
.portal-nav a:hover { color: var(--ink); }
.portal-main { width: min(1180px, calc(100% - 40px)); margin: auto; padding: 26px 0 100px; }
.portal-hero { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: end; gap: 30px; padding: 46px; border-radius: 24px; background: var(--ink); color: var(--paper); overflow: hidden; position: relative; }
.portal-hero::after { content: ""; position: absolute; width: 340px; height: 340px; right: 65px; top: -190px; border: 1px solid rgba(200,243,106,.42); border-radius: 50%; box-shadow: 0 0 0 35px rgba(200,243,106,.04), 0 0 0 70px rgba(200,243,106,.035); }
.eyebrow { margin: 0 0 14px; color: #a5bb75; font-size: 10px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.portal-hero h1 { max-width: 690px; margin: 0; font: 600 clamp(40px, 6vw, 76px)/.98 "Space Grotesk", sans-serif; letter-spacing: -.065em; }
.portal-hero h1 span { color: var(--lime); }
.portal-hero p:last-child { max-width: 590px; margin: 22px 0 0; color: #c3c2b7; line-height: 1.65; }
.hero-stamp { z-index: 1; justify-self: end; align-self: center; width: 190px; height: 190px; display: grid; place-items: center; border: 1px solid rgba(200,243,106,.7); border-radius: 50%; color: var(--lime); text-align: center; transform: rotate(9deg); }
.hero-stamp span { font: 700 15px/1.2 "Space Grotesk", sans-serif; letter-spacing: .1em; }
.portal-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: 24px; margin-top: 24px; align-items: start; }
.panel { padding: 26px; border: 1px solid var(--line); border-radius: 19px; background: var(--panel); }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 20px; }
.panel-heading h2, .panel h2 { margin: 0; font: 600 25px "Space Grotesk", sans-serif; letter-spacing: -.04em; }
.panel-heading p, .subtle { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.event-list { display: grid; gap: 12px; }
.event-card { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.event-date { display: grid; place-items: center; width: 60px; height: 67px; border-radius: 12px; background: #e9e2fa; text-align: center; }
.event-date strong { display: block; font: 700 23px/1 "Space Grotesk", sans-serif; }
.event-date span { color: #5f5581; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.event-copy h3 { margin: 0; font: 700 16px "Space Grotesk", sans-serif; }
.event-copy p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.event-meta { display: flex; gap: 10px; margin-top: 8px; color: var(--muted); font-size: 10px; }
.event-action { text-align: right; }
.event-action small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }
.empty-state { padding: 34px 16px; border: 1px dashed var(--line); border-radius: 15px; color: var(--muted); text-align: center; font-size: 13px; }
.account-panel { position: sticky; top: 18px; }
.account-panel h2 { margin-bottom: 8px; }
.account-panel > p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.account-state { margin: 16px 0; padding: 13px; border-radius: 12px; background: #eff2e6; font-size: 12px; }
.account-actions { display: grid; gap: 10px; margin-top: 16px; }
.stack-form { display: grid; gap: 12px; margin-top: 16px; }
.stack-form label { display: grid; gap: 6px; color: #55574f; font-size: 12px; font-weight: 700; }
.stack-form input, .stack-form select, .stack-form textarea { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); outline: none; }
.stack-form input:focus, .stack-form select:focus, .stack-form textarea:focus { border-color: #91a95a; box-shadow: 0 0 0 3px rgba(145,169,90,.14); }
.stack-form textarea { min-height: 90px; resize: vertical; }
.form-switch { color: var(--muted); font-size: 12px; line-height: 1.6; }
.form-switch button { padding: 0; background: none; color: #596d33; text-decoration: underline; }
.notice { display: none; margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: #edf2df; color: #445426; font-size: 12px; line-height: 1.5; }
.notice.is-error { background: #f7e1dc; color: #8b3030; }
.notice.is-visible { display: block; }
.divider { height: 1px; margin: 20px 0; background: var(--line); }
.key-form { display: flex; gap: 8px; margin-top: 16px; }
.key-form input { min-width: 0; flex: 1; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; text-transform: uppercase; }
.reservation-tag { display: inline-block; margin-top: 7px; padding: 4px 8px; border-radius: 999px; background: #e5f3c9; color: #48621b; font-size: 10px; font-weight: 800; }
.cancel-reservation { display: block; margin: 8px 0 0 auto; padding: 7px 11px; font-size: 11px; }
.private-tag { background: #eee8fa; color: #5e4c88; }
.portal-footer { display: flex; justify-content: space-between; gap: 20px; width: min(1180px, calc(100% - 40px)); margin: auto; padding: 22px 0 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.admin-grid .panel { align-self: start; }
.admin-events { margin-top: 24px; }
.admin-event-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.admin-event-row:last-child { border-bottom: 0; }
.admin-event-row strong { display: block; font-family: "Space Grotesk", sans-serif; }
.admin-event-row small { display: block; margin-top: 5px; color: var(--muted); }
.key-output { display: none; margin-top: 16px; padding: 16px; border: 1px solid #bdcf98; border-radius: 12px; background: #f4f8e9; }
.key-output.is-visible { display: block; }
.key-output p { margin: 0 0 10px; color: #566b31; font-size: 12px; }
.key-output pre { max-height: 240px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 600 12px/1.8 monospace; }
.key-output-actions { display: flex; gap: 8px; }
.panel-spaced { margin-top: 18px; }
.form-notice { margin: 0; }
.admin-only { display: none; }
.admin-only.is-visible { display: block; }
/* Account + dynamic auth flow */
.account-cta { display: inline-flex; align-items: center; gap: 8px; }
.account-cta.is-signed-in { padding: 7px 14px 7px 7px; }
.avatar-dot { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--lime); color: var(--ink); font: 700 12px "Space Grotesk", sans-serif; flex: none; }
.avatar-large { width: 44px; height: 44px; font-size: 18px; }
.account-card { display: flex; align-items: center; gap: 12px; margin: 4px 0 8px; }
.account-card strong { display: block; font: 700 18px "Space Grotesk", sans-serif; }
.account-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.auth-steps { display: flex; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.auth-steps li { display: flex; flex: 1; align-items: center; gap: 6px; padding-top: 8px; border-top: 3px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; transition: border-color .25s ease, color .25s ease; }
.auth-steps li.is-active { border-color: var(--ink); color: var(--ink); }
.auth-steps li.is-done { border-color: #91a95a; color: #48621b; }
.step-dot { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #eceee4; font-size: 10px; }
.is-active .step-dot { background: var(--ink); color: var(--paper); }
.is-done .step-dot { background: var(--lime); color: var(--ink); }
.discord-chip { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 5px 12px 5px 5px; border-radius: 999px; background: #eff2e6; font-size: 12px; font-weight: 700; }
.discord-chip .avatar-dot { width: 22px; height: 22px; font-size: 11px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 14px; padding: 4px; border-radius: 999px; background: #eceee4; }
.auth-tab { padding: 9px 12px; background: transparent; color: var(--muted); font-size: 12px; }
.auth-tab:hover { transform: none; color: var(--ink); }
.auth-tab[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(32,33,29,.12); }
.auth-panel { animation: auth-in .22s ease; }
@keyframes auth-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.field-group { display: grid; gap: 6px; }
.field-hint { min-height: 15px; color: var(--muted); font-size: 11px; font-weight: 500; }
.field-hint[data-state="ok"] { color: #48621b; }
.field-hint[data-state="error"] { color: var(--danger); }
.field-hint[data-state="pending"] { color: #6b6a5f; }
.input-with-action { position: relative; display: block; }
.input-with-action input { padding-right: 76px; }
.reveal-toggle { position: absolute; top: 50%; right: 6px; padding: 6px 10px; transform: translateY(-50%); background: transparent; color: #596d33; font-size: 11px; }
.reveal-toggle:hover { transform: translateY(-50%); }
.strength-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength-meter i { height: 4px; border-radius: 4px; background: var(--line); transition: background .2s ease; }
.strength-meter[data-score="1"] i:nth-child(-n+1) { background: var(--danger); }
.strength-meter[data-score="2"] i:nth-child(-n+2) { background: #d59b3a; }
.strength-meter[data-score="3"] i:nth-child(-n+3) { background: #91a95a; }
.strength-meter[data-score="4"] i { background: #48621b; }
.auth-success { padding: 18px 0 8px; text-align: center; animation: auth-in .25s ease; }
.success-mark { display: inline-grid; place-items: center; width: 52px; height: 52px; margin-bottom: 10px; border-radius: 50%; background: var(--lime); font-size: 24px; font-weight: 700; }
.cookie-note { margin: 16px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.link-button { padding: 0; background: none; color: #596d33; font-size: 11px; font-weight: 700; text-decoration: underline; }
.link-button:hover { transform: none; }
.small-button { padding: 7px 12px; font-size: 11px; }
.account-hero { grid-template-columns: 1fr; }
.account-hero h1 { font-size: clamp(38px, 5vw, 62px); }
.account-guest { max-width: 520px; margin: 24px auto 0; }
.account-guest .account-panel { position: static; }
.account-loading { margin-top: 24px; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 24px; align-items: start; }
.account-grid-full { grid-column: 1 / -1; }
.account-grid > .notice { margin: 0; }
.profile-list { display: grid; gap: 0; margin: 0; }
.profile-list > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.profile-list > div:last-child { border-bottom: 0; }
.profile-list dt { color: var(--muted); font-weight: 700; }
.profile-list dd { margin: 0; overflow-wrap: anywhere; }
.uuid-row { display: flex; align-items: center; gap: 8px; }
.uuid-row code { min-width: 0; overflow-wrap: anywhere; font-size: 11px; }
.compact-card { grid-template-columns: minmax(0, 1fr) auto; }
.consent-check { display: flex !important; grid-template-columns: none; align-items: flex-start; gap: 9px !important; font-weight: 500 !important; line-height: 1.5; }
.consent-check input { width: auto !important; margin-top: 2px; }
.consent-check a { color: #596d33; }
.reauth-box { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; }
.reauth-box .subtle { flex: 1 1 260px; margin: 0; }
.password-form { max-width: 460px; }
.session-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { .auth-panel, .auth-success { animation: none; } }
@media (max-width: 820px) {
  .account-grid { grid-template-columns: 1fr; }
  .portal-hero { grid-template-columns: 1fr; padding: 31px; }
  .hero-stamp { display: none; }
  .portal-layout { grid-template-columns: 1fr; }
  .account-panel { position: static; }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .portal-header, .portal-main, .portal-footer { width: min(100% - 24px, 1180px); }
  .portal-header { padding: 17px 0; }
  .portal-nav { gap: 11px; font-size: 11px; }
  .portal-header > .button { padding: 10px 12px; font-size: 11px; }
  .portal-hero { padding: 25px 21px; border-radius: 18px; }
  .portal-hero h1 { font-size: 43px; }
  .panel { padding: 19px; }
  .event-card { grid-template-columns: 54px minmax(0, 1fr); gap: 12px; }
  .event-date { width: 52px; height: 60px; }
  .event-action { grid-column: 2; display: flex; align-items: center; justify-content: space-between; text-align: left; }
  .event-action small { margin: 0 0 0 8px; }
  .portal-footer { flex-direction: column; }
  .profile-list > div { grid-template-columns: 1fr; gap: 4px; }
  .compact-card { grid-template-columns: 1fr; }
  .compact-card .event-action { grid-column: 1; }
  .portal-nav a[href="/"] { display: none; }
}
