/* Princeton Club Portal — v0.1.0
   Tokens: club blue (from the logo), pool teal, brass for members-only, cool paper. */
:root {
  --brand: #24477F;
  --accent: #14968F;
  --ink: #17233A;
  --ink-2: #4A576C;
  --ink-3: #7B8798;
  --paper: #F3F6F8;
  --surface: #FFFFFF;
  --surface-2: #F8FAFB;
  --line: #DDE4EA;
  --brass: #A97A2C;
  --ok: #1E7F4F;
  --warn: #A86512;
  --bad: #B3362B;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --shadow: 0 1px 2px rgba(23, 35, 58, .06), 0 8px 24px -12px rgba(23, 35, 58, .18);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E6ECF3; --ink-2: #B3BECC; --ink-3: #8592A3;
    --paper: #0F1724; --surface: #172235; --surface-2: #1C2940; --line: #2A3953;
    --brass: #D3A75A; --ok: #4CC08A; --warn: #E3A04A; --bad: #EF7B70;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--paper); }
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
@media (prefers-color-scheme: dark) { a { color: #8FB3EA; } }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 1em; max-width: 72ch; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 42px; padding: 0 1.1em;
  border-radius: var(--r-sm); border: 1px solid transparent; background: var(--brand); color: #fff; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: transform .12s ease, filter .12s ease; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.accent { background: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--bad); }
.btn.sm { min-height: 34px; padding: 0 .8em; font-size: .9rem; }
.btn.block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.field { margin-bottom: 1rem; }
.hint { font-size: .82rem; color: var(--ink-3); margin-top: .25rem; font-weight: 400; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date],
input[type=datetime-local], input[type=search], input[type=file], select, textarea {
  width: 100%; min-height: 42px; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font: inherit; }
input[type=color] { width: 56px; height: 42px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .92rem; }
.check input { margin-top: .25rem; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.grid-2 { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.otp-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- flash ---------- */
.flash { border-radius: var(--r-sm); padding: .7rem .9rem; margin-bottom: .6rem; border-left: 4px solid; background: var(--surface); font-size: .93rem; }
.flash.success { border-color: var(--ok); }
.flash.error { border-color: var(--bad); }
.flash.info { border-color: var(--brand); }
.flash.test { border-color: var(--brass); background: color-mix(in srgb, var(--brass) 12%, var(--surface)); font-weight: 600; }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.2rem; }
.panel + .panel { margin-top: 1rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.stack > * + * { margin-top: 1rem; }
.cols { display: grid; gap: 1rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.2rem; margin: 0; }
.dl dt { color: var(--ink-3); font-size: .88rem; }
.dl dd { margin: 0; font-weight: 500; }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.badge.open, .badge.new { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.badge.in_progress, .badge.contacted { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.badge.club_updated, .badge.confirmed, .badge.published, .badge.active { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.badge.rejected, .badge.cancelled, .badge.suspended { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.badge.won, .badge.delivered, .badge.read, .badge.done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.badge.lost, .badge.exception, .badge.failed, .badge.overdue { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.badge.follow_up, .badge.site_visit, .badge.negotiation, .badge.queued, .badge.paused { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.badge.members_only { color: var(--brass); border-color: color-mix(in srgb, var(--brass) 45%, var(--line)); }
.badge.open_all, .badge.prebooking { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-3); font-size: .82rem; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td a.row-link { font-weight: 600; text-decoration: none; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--ink-3); }
.pager { display: flex; gap: .4rem; justify-content: flex-end; align-items: center; margin-top: .8rem; font-size: .9rem; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 160px; flex: 1 1 160px; max-width: 280px; }

/* ---------- event ticket (the signature element) ---------- */
.ticket { display: grid; grid-template-columns: 88px 1fr; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden; text-decoration: none; color: inherit; position: relative; }
.ticket-stub { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; padding: .8rem .4rem; border-right: 2px dashed color-mix(in srgb, #fff 45%, var(--brand)); }
.ticket-stub::before, .ticket-stub::after { content: ""; position: absolute; right: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); }
.ticket-stub::before { top: -8px; } .ticket-stub::after { bottom: -8px; }
.ticket-day { font-size: 2.1rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ticket-mon { font-size: .85rem; font-weight: 600; opacity: .85; }
.ticket-time { font-size: .75rem; opacity: .75; margin-top: .3rem; }
.ticket-body { padding: .9rem 1rem; min-width: 0; }
.ticket-body h3 { margin: .3rem 0 .25rem; font-size: 1.05rem; }
.ticket-body p { margin: 0; color: var(--ink-2); font-size: .9rem; }
.ticket.members_only .ticket-stub { background: var(--brass); }
.ticket.open_all .ticket-stub, .ticket.prebooking .ticket-stub { background: var(--accent); }
a.ticket:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.ticket-list { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* hero carousel */
.hero { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--brand); color: #fff; }
.hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hero-track::-webkit-scrollbar { display: none; }
.hero-slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; min-height: clamp(220px, 34vw, 380px); display: flex; align-items: flex-end; text-decoration: none; color: #fff; }
.hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,20,40,0) 30%, rgba(10,20,40,.82)); }
.hero-copy { position: relative; z-index: 1; padding: clamp(1rem, 3vw, 2rem); display: flex; gap: 1.2rem; align-items: flex-end; }
.hero-date { flex: none; text-align: center; border: 2px dashed rgba(255,255,255,.55); border-radius: var(--r-md); padding: .5rem .8rem; }
.hero-date b { display: block; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1; font-weight: 800; }
.hero-copy h2 { font-size: clamp(1.3rem, 1rem + 1.8vw, 2.2rem); margin: 0 0 .3rem; }
.hero-copy p { margin: 0; opacity: .9; }
.hero-dots { position: absolute; z-index: 2; right: 1rem; top: 1rem; display: flex; gap: .35rem; }
.hero-dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.45); cursor: pointer; }
.hero-dots button[aria-current="true"] { background: #fff; width: 22px; border-radius: 5px; }
.hero-empty { padding: 2.2rem; }

.event-banner { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 7; background: var(--surface-2); }
.event-banner img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- public / auth layouts ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem clamp(1rem, 3vw, 2rem); background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-weight: 700; }
.brand img { height: 38px; width: auto; }
.brand-mark { width: 38px; height: 38px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.wrap { max-width: 1120px; margin: 0 auto; padding: clamp(1rem, 3vw, 2rem); }
.site-foot { border-top: 1px solid var(--line); padding: 1.2rem clamp(1rem, 3vw, 2rem); color: var(--ink-3); font-size: .82rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-foot a { color: inherit; }

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); }
.auth-side { background: var(--brand); color: #fff; padding: clamp(1.5rem, 4vw, 3.5rem); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side h1 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 3rem); max-width: 14ch; }
.auth-side .waves { position: absolute; right: -60px; bottom: -40px; width: 380px; opacity: .16; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: clamp(1.5rem, 4vw, 3rem); background: var(--surface); }
.auth-main form { width: 100%; max-width: 400px; }
.auth-main .site-foot { border: 0; padding: 1.5rem 0 0; }
.auth-switch { margin-top: 1.2rem; font-size: .92rem; display: grid; gap: .4rem; }
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 1.2rem 1.2rem 1.4rem; }
  .auth-side h1 { font-size: 1.5rem; margin: .8rem 0 0; }
  .auth-side .side-extra { display: none; }
}

.choice { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.choice a { display: block; padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: inherit; background: var(--surface); }
.choice a:hover { border-color: var(--accent); }
.choice strong { display: block; font-size: 1.05rem; margin-bottom: .3rem; }

/* ---------- portal layout ---------- */
.portal-nav { display: flex; gap: .2rem; }
.portal-nav a { padding: .5rem .8rem; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .93rem; }
.portal-nav a[aria-current="page"] { color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, transparent); }
.tabbar { display: none; }
@media (max-width: 760px) {
  .portal-nav { display: none; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .45rem; font-size: .72rem; text-decoration: none; color: var(--ink-3); font-weight: 600; }
  .tabbar a[aria-current="page"] { color: var(--brand); }
  .tabbar svg { width: 22px; height: 22px; }
  body.has-tabbar { padding-bottom: 70px; }
}
.welcome { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.welcome h1 { margin: 0; }
.facts { display: flex; gap: 1.6rem; flex-wrap: wrap; margin-top: 1rem; }
.facts div { min-width: 120px; }
.facts b { display: block; font-size: 1.05rem; }
.facts span { color: var(--ink-3); font-size: .85rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; border-left: 2px solid var(--line); margin-left: .4rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.timeline li.internal::before { border-color: var(--brass); }
.timeline .when { font-size: .8rem; color: var(--ink-3); }

/* ---------- admin layout ---------- */
.admin { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: #142440; color: #C9D4E3; padding: 1rem .7rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { color: #fff; padding: .3rem .5rem 1rem; }
.side .brand-mark { background: var(--accent); }
.side nav p { margin: 1rem .6rem .3rem; font-size: .76rem; color: #8193AD; font-weight: 600; }
.side nav a { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: var(--r-sm); color: #C9D4E3; text-decoration: none; font-size: .92rem; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a[aria-current="page"] { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.side nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.main { min-width: 0; display: flex; flex-direction: column; }
.main-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem clamp(1rem, 2.5vw, 1.8rem); border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.main-body { padding: clamp(1rem, 2.5vw, 1.8rem); flex: 1; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head h1 { margin: 0; }
.menu-btn { display: none; }
.test-ribbon { background: var(--brass); color: #fff; font-size: .78rem; text-align: center; padding: .25rem; font-weight: 600; }
@media (max-width: 980px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 50; width: 270px; transform: translateX(-100%); transition: transform .2s ease; }
  body.menu-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .menu-btn { display: inline-flex; }
}

/* ---------- dashboard ---------- */
.kpis { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem 1.1rem; text-decoration: none; color: inherit; }
.kpi b { display: block; font-size: 2rem; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--ink-3); font-size: .86rem; }
.kpi small { display: block; margin-top: .3rem; color: var(--ink-2); font-size: .8rem; }
.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0); }
.ring > div { width: 92px; height: 92px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 750; font-size: 1.3rem; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: .5rem; }
.bars div { flex: 1; background: color-mix(in srgb, var(--brand) 75%, transparent); border-radius: 4px 4px 0 0; min-height: 3px; position: relative;
  transform-origin: bottom; animation: grow .7s cubic-bezier(.2,.7,.2,1) both; }
.bars div:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -4px); background: var(--ink); color: var(--surface); font-size: .75rem; padding: .15rem .4rem; border-radius: 4px; white-space: nowrap; }
.bar-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--ink-3); margin-top: .3rem; }
.hbar { display: grid; grid-template-columns: 150px 1fr 40px; gap: .6rem; align-items: center; margin-bottom: .55rem; font-size: .9rem; }
.hbar i { display: block; height: 10px; border-radius: 5px; background: var(--accent); transform-origin: left; animation: growx .8s cubic-bezier(.2,.7,.2,1) both; }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes growx { from { transform: scaleX(0); } }

.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix input { width: 18px; height: 18px; accent-color: var(--accent); }
pre.log { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .8rem; font-size: .82rem; max-height: 320px; overflow: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- v0.9.0 additions ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.tabs a { padding: .4rem .8rem; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font-size: .88rem; font-weight: 600; background: var(--surface); }
.tabs a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabs a span { opacity: .75; font-weight: 500; margin-left: .25rem; }
.funnel { display: grid; gap: .5rem; }
.funnel div { display: grid; grid-template-columns: 110px 1fr 48px; align-items: center; gap: .6rem; font-size: .9rem; }
.funnel i { display: block; height: 22px; border-radius: 4px; background: linear-gradient(90deg, var(--brand), var(--accent)); transform-origin: left; animation: growx .9s cubic-bezier(.2,.7,.2,1) both; }
.qr-card { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; align-items: start; padding: 1rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.qr-card img { width: 120px; height: 120px; background: #fff; border-radius: 6px; }
.tag-list { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag-list code { font-size: .78rem; padding: .15rem .4rem; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; }
.preview-frame { border: 1px solid var(--line); border-radius: var(--r-md); overflow: auto; max-height: 560px; background: #eef2f6; }
.progress { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transform-origin: left; animation: growx 1s cubic-bezier(.2,.7,.2,1) both; }
.overdue-text { color: var(--bad); font-weight: 600; }
.code-input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }

/* v0.9.1 — logo sizes */
.brand img.brand-logo { height: 40px; width: auto; }
.auth-side .brand img.brand-logo { height: clamp(56px, 7vw, 84px); }
.side .brand img.brand-logo { height: 46px; }

/* ---------- v0.9.2 ---------- */
.viewas-ribbon { background: #7A2E8E; color: #fff; text-align: center; padding: .4rem 1rem; font-size: .9rem; }
.viewas-ribbon a { color: #fff; font-weight: 700; margin-left: .5rem; }
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); }
.bell svg { width: 20px; height: 20px; }
.bell span { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
.note-item { display: block; text-decoration: none; color: inherit; }
.note-item.unread { border-left: 4px solid var(--accent); }
.renewal { display: flex; gap: .8rem 1rem; align-items: center; flex-wrap: wrap; padding: .9rem 1.1rem; border-radius: var(--r-md); margin-bottom: 1rem; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.renewal span { flex: 1 1 260px; }
.renewal.urgent { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.renewal.expired { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }

/* social-style profile */
.profile-hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 1rem; }
.profile-hero .cover { position: relative; height: clamp(140px, 22vw, 240px); background: linear-gradient(120deg, var(--brand), var(--accent)) center / cover no-repeat; }
.cover-edit { position: absolute; right: .8rem; bottom: .8rem; }
.cover-edit .btn { background: rgba(255,255,255,.9); color: #17233A; border-color: transparent; }
.profile-head { display: flex; align-items: flex-end; gap: 1rem; padding: 0 1.2rem 1.1rem; flex-wrap: wrap; }
.profile-head .profile-id { flex: 1 1 240px; padding-top: .6rem; }
.profile-head h1 { margin: 0; }
.profile-head p { margin: .2rem 0 0; }
.avatar-wrap { position: relative; margin-top: -56px; }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; object-fit: cover; flex: none; }
.avatar.lg { width: 112px; height: 112px; font-size: 2.6rem; border: 4px solid var(--surface); box-shadow: var(--shadow); }
.avatar.sm { width: 40px; height: 40px; font-size: 1rem; background: color-mix(in srgb, var(--brand) 80%, #fff); }
.avatar-edit { position: absolute; right: 2px; bottom: 6px; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; font-weight: 700; color: var(--ink); }
.profile-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.profile-grid .profile-sec.wide { grid-column: 1 / -1; }
.profile-grid.compact { grid-template-columns: 1fr; }
.profile-grid .panel + .panel { margin-top: 0; }
@media (max-width: 760px) { .profile-grid { grid-template-columns: 1fr; } }
.fix-link { font-size: .78rem; margin-left: .4rem; font-weight: 500; }
.family-cards { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: .6rem; }
.family-card { display: flex; gap: .7rem; align-items: center; padding: .7rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }

/* home page */
main.wide { display: block; }
.home-hero { position: relative; overflow: hidden; background: var(--brand); color: #fff; }
.home-hero .hero-slide.big { min-height: clamp(320px, 42vw, 620px); }
.home-hero .hero-copy { max-width: 1120px; margin: 0 auto; width: 100%; padding: clamp(1.2rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem); }
.home-hero .hero-copy h2 { font-size: clamp(1.7rem, 1.1rem + 3vw, 3.4rem); margin: .4rem 0; }
.home-hero .hero-dots { right: auto; left: 50%; transform: translateX(-50%); top: auto; bottom: 1rem; }
.empty-hero { padding: clamp(3rem, 8vw, 6rem) 0; }
.event-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.event-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.event-card-img { position: relative; aspect-ratio: 12 / 5; background: linear-gradient(120deg, var(--brand), var(--accent)); }
.event-card-img img { width: 100%; height: 100%; object-fit: cover; }
.date-chip { position: absolute; left: .8rem; top: .8rem; background: #fff; color: #17233A; border-radius: 10px; padding: .3rem .6rem; text-align: center; font-size: .8rem; font-weight: 600; line-height: 1.1; box-shadow: var(--shadow); }
.date-chip b { display: block; font-size: 1.4rem; }
.event-card-body { padding: 1rem 1.1rem 1.2rem; }
.event-card-body h3 { font-size: 1.2rem; margin: .5rem 0 .3rem; }
.event-card-body p { margin: 0; }
.signin-strip { display: grid; grid-template-columns: 1fr auto; gap: .8rem 1rem; align-items: center; margin: 2.5rem 0 1rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
@media (max-width: 640px) { .signin-strip { grid-template-columns: 1fr; } }
