@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ============================================================
   Emerald Fairway — design tokens
   Palette per DESIGN.md "Brand & Style" (the practical golf palette).
   The file's YAML front-matter carries a cooler blue-tinted surface set
   that contradicts the prose; the prose palette wins.
   ============================================================ */
:root{
  --primary:#0b4d3c;          /* Augusta deep emerald */
  --primary-dark:#083a2d;
  --primary-deep:#003528;
  --on-primary:#ffffff;
  --primary-fixed:#b2efd8;
  --primary-fixed-dim:#97d3bc;

  --secondary:#10b981;        /* fairway volt lime */
  --secondary-deep:#064e3b;
  --secondary-soft:#d1fae5;

  --tertiary:#f59e0b;         /* sunset gold */
  --tertiary-soft:#fef3c7;
  --on-tertiary-soft:#92400e;

  --slate:#0f172a;            /* rich slate — body copy */
  --slate-mut:#475569;
  --outline:#64748b;

  --canvas:#fbfbf9;           /* sand dune cream */
  --surface:#ffffff;          /* flagstick white */
  --well:#f1f3f0;             /* mown grass mist */
  --line:#e2e8f0;
  --line-strong:#cbd5e1;

  --error-soft:#ffdad6;
  --on-error-soft:#93000a;

  --r-sm:.25rem;
  --r:.5rem;
  --r-md:.75rem;
  --r-lg:1rem;
  --r-xl:1.5rem;
  --r-full:9999px;

  --e1:0 2px 8px -2px rgba(15,23,42,.05), 0 1px 4px -1px rgba(11,77,60,.04);
  --e2:0 10px 24px -6px rgba(11,77,60,.12), 0 4px 10px -3px rgba(15,23,42,.04);
  --e3:0 20px 35px -8px rgba(15,23,42,.16);

  --max:1360px;
  --header-h:72px;
}

*{box-sizing:border-box}
/* Author display rules outrank the UA's [hidden]{display:none}, so make it stick. */
[hidden]{display:none!important}
html{scroll-behavior:smooth;scroll-padding-top:calc(var(--header-h) + 16px)}
body{
  margin:0;background:var(--canvas);color:var(--slate);
  font-family:'Hanken Grotesk',system-ui,sans-serif;font-size:14px;line-height:20px;
  -webkit-font-smoothing:antialiased;
}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer;background:none;border:0}
a{color:inherit;text-decoration:none}
button,a,input,select{-webkit-tap-highlight-color:transparent}
button,a{touch-action:manipulation}
img{max-width:100%}
/* tabular numerals wherever numbers are compared */
.slot-time,.booking-total strong,.rating strong,.sheet-date b{
  font-family:'JetBrains Mono',ui-monospace,monospace;font-variant-numeric:tabular-nums;
}
:focus-visible{outline:2px solid var(--secondary);outline-offset:2px;border-radius:var(--r-sm)}

.wrap{width:min(var(--max),calc(100% - 4rem));margin-inline:auto}

/* ---------- type scale ---------- */
h1{font-size:48px;line-height:56px;font-weight:700;letter-spacing:-.03em;margin:0}
h2{font-size:32px;line-height:40px;font-weight:700;letter-spacing:-.02em;margin:0}
h3{font-size:18px;line-height:24px;font-weight:600;letter-spacing:-.005em;margin:0}

/* badge micro-type — metadata only */
.badge,.chip-badge,.wave-count,.pill-flag,.slot-meta,.course-location,.eyebrow,
.field > label,.dialog-field > span,.sheet-date small{
  font-size:11px;line-height:14px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
}

/* ---------- skip link ---------- */
.skip-link{
  position:absolute;left:16px;top:-60px;z-index:60;background:var(--primary);color:var(--on-primary);
  padding:12px 18px;border-radius:0 0 var(--r) var(--r);font-weight:600;transition:top .15s;
}
.skip-link:focus{top:0}

/* ---------- top strip ---------- */
.announcement{
  background:var(--primary-deep);color:var(--primary-fixed-dim);
  text-align:center;padding:10px 16px;font-size:12px;line-height:16px;
}
.announcement a{color:var(--secondary-soft);margin-left:16px;font-weight:600}
.announcement a:hover{color:#fff}

/* ---------- header ---------- */
.header{
  position:sticky;top:0;z-index:40;background:rgba(255,255,255,.95);
  backdrop-filter:blur(10px);box-shadow:0 1px 8px rgba(0,0,0,.05);
}
.header-inner{height:var(--header-h);display:flex;align-items:center;gap:1rem}
.logo{display:flex;align-items:center;font-size:22px;font-weight:700;letter-spacing:-.02em;color:var(--primary)}
.logo-mark{
  display:inline-grid;place-items:center;width:34px;height:34px;border-radius:var(--r);
  background:var(--primary);color:var(--primary-fixed);font-size:18px;margin-right:10px;flex:none;
}
.logo-dot{color:var(--secondary)}
.header nav{display:flex;gap:4px;align-items:center;margin-left:2rem;margin-right:auto}
.header nav a{padding:6px 12px;border-radius:var(--r);color:var(--slate-mut);font-weight:500}
.header nav a:hover{background:var(--well);color:var(--slate)}
.header nav a.active{background:var(--primary);color:var(--on-primary);font-weight:600}
.header-actions{display:flex;align-items:center;gap:.5rem;margin-left:auto}
.ghost-button{
  border:1px solid var(--line);background:var(--surface);padding:0 14px;height:44px;
  border-radius:var(--r);font-weight:500;display:inline-flex;align-items:center;gap:8px;color:var(--slate);
}
.ghost-button:hover{background:var(--well)}
.ghost-button b{
  background:var(--secondary);color:var(--secondary-deep);padding:1px 7px;
  border-radius:var(--r-full);font-size:11px;font-weight:700;
}
.ghost-button[aria-pressed=true]{background:var(--primary);border-color:var(--primary);color:var(--on-primary)}
.ghost-button[aria-pressed=true] b{background:var(--primary-fixed);color:var(--primary)}
.heart{font-size:16px;line-height:1}
.account-button{
  background:var(--primary);color:var(--on-primary);height:44px;padding:0 20px;
  border-radius:var(--r);font-weight:600;box-shadow:0 2px 8px -2px rgba(15,23,42,.12);
}
.account-button:hover{background:var(--primary-dark)}

/* ---------- hero ---------- */
.hero{
  position:relative;color:var(--on-primary);overflow:hidden;
  background:var(--primary-deep) url('https://images.unsplash.com/photo-1655709307894-1fdbdbe2b373?auto=format&fit=crop&w=2200&q=85') center 78%/cover;
}
.hero-shade{
  position:absolute;inset:0;
  background:linear-gradient(90deg,rgba(0,53,40,.94) 0%,rgba(0,53,40,.74) 44%,rgba(3,42,32,.36) 100%);
}
/* fairway contour motif, as in the reference hero */
.hero-contour{position:absolute;inset:0;opacity:.10;pointer-events:none;color:#fff}
.hero-contour svg{width:100%;height:100%;display:block}
.hero-content{position:relative;padding:2.5rem 0 5rem;display:flex;flex-direction:column;align-items:flex-start;gap:.75rem}
.hero-content > *{max-width:46rem}
.pill-flag{
  display:inline-flex;align-items:center;gap:6px;width:fit-content;
  padding:5px 12px;border-radius:var(--r-full);
  background:var(--secondary-soft);color:var(--secondary-deep);
}
.hero p{font-size:16px;line-height:24px;color:var(--primary-fixed-dim);margin:0}

/* ---------- booking bar ---------- */
.search-wrap{position:relative;margin-top:-3.25rem;z-index:5}
.search-panel{
  background:var(--surface);border-radius:var(--r-xl);box-shadow:var(--e3);
  padding:1rem;display:flex;flex-direction:column;gap:1rem;
}
.day-strip{display:flex;gap:.5rem;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
.day-strip::-webkit-scrollbar{display:none}
.day-pill{
  flex:none;padding:8px 16px;border-radius:var(--r-full);background:var(--well);
  color:var(--slate-mut);font-weight:600;font-size:13px;white-space:nowrap;transition:background .15s;
}
.day-pill:hover{background:var(--line)}
.day-pill[aria-pressed=true]{background:var(--primary);color:var(--on-primary)}
.search-fields{display:grid;grid-template-columns:2.2fr 1fr auto;gap:.75rem;align-items:end}
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.field > label{color:var(--outline)}
.field-hint{font-weight:400;letter-spacing:0;text-transform:none}
.field input{
  height:48px;background:var(--surface);border:1px solid var(--line-strong);
  border-radius:var(--r);padding:0 14px;width:100%;min-width:0;font-size:15px;color:var(--slate);
}
.field input::placeholder{color:var(--outline)}
.field input:focus{outline:2px solid var(--secondary);outline-offset:2px;border-color:transparent}
.primary{
  border:0;background:var(--primary);color:var(--on-primary);height:48px;padding:0 24px;
  border-radius:var(--r);font-weight:600;font-size:15px;
  display:inline-flex;align-items:center;justify-content:center;gap:10px;transition:background .15s;
}
.primary:hover:not(:disabled){background:var(--primary-dark)}
.primary:disabled{opacity:.45;cursor:not-allowed}
.benefits{
  display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem 2rem;
  padding-top:1rem;font-size:12px;line-height:16px;color:var(--slate-mut);
}

/* ---------- location combobox ----------
   A native <datalist> renders in the browser's own theme and cannot be styled,
   so suggestions use the ARIA combobox pattern. */
.location-field{position:relative}
.combo-list{
  position:absolute;left:0;right:0;top:calc(100% + 8px);z-index:30;
  margin:0;padding:6px;list-style:none;background:var(--surface);
  border:1px solid var(--line);border-radius:var(--r-md);box-shadow:var(--e3);
  max-height:362px;overflow-y:auto;overscroll-behavior:contain;
}
.combo-list[hidden]{display:none}
.combo-option{
  display:flex;align-items:center;gap:12px;padding:9px 11px;
  border-radius:var(--r);cursor:pointer;min-height:46px;
}
.combo-option:hover,.combo-option[aria-selected=true]{background:var(--well)}
.combo-option[aria-selected=true]{box-shadow:inset 0 0 0 1px rgba(16,185,129,.45)}
.combo-icon{
  flex:none;width:32px;height:32px;border-radius:var(--r-full);background:var(--secondary-soft);
  display:grid;place-items:center;font-size:15px;color:var(--primary);
}
.combo-text{min-width:0;display:flex;flex-direction:column;gap:2px}
.combo-name{font-size:14px;font-weight:600;color:var(--slate);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.combo-name mark{background:var(--secondary-soft);color:inherit;border-radius:3px;padding:0 1px}
.combo-meta{font-size:12px;line-height:16px;color:var(--outline)}
.combo-empty{padding:16px 12px;color:var(--outline);font-size:13px;text-align:center}

/* ---------- courses ---------- */
.courses-section{padding:2.5rem 0 3.5rem}
.section-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:1.5rem}
.eyebrow{color:var(--secondary-deep);display:flex;align-items:center;gap:8px;margin-bottom:6px}
.eyebrow span{width:6px;height:6px;border-radius:50%;background:var(--secondary);flex:none}
.section-heading p{color:var(--slate-mut);margin:8px 0 0;font-size:14px}
.text-link{font-weight:600;color:var(--primary);display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.text-link:hover{color:var(--secondary-deep);text-decoration:underline}

.signin-banner{
  display:flex;align-items:center;gap:1rem;flex-wrap:wrap;
  background:var(--primary);color:var(--primary-fixed-dim);
  border-radius:var(--r-lg);padding:1rem 1.25rem;margin-top:1.5rem;
}
.signin-banner p{margin:0}
.signin-banner strong{color:var(--on-primary)}
.signin-banner button{
  margin-left:auto;background:var(--secondary);color:var(--secondary-deep);
  height:44px;padding:0 20px;border-radius:var(--r);font-weight:700;
}
.signin-banner button:hover{background:#0ea371}

.city-chips{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:1.5rem}
.city-chips button,.tabs button{
  border:1px solid var(--line);background:var(--surface);border-radius:var(--r-full);
  padding:8px 16px;font-size:13px;font-weight:600;color:var(--slate);
}
.city-chips button:hover,.tabs button:hover{background:var(--well)}
.city-chips button[aria-pressed=true],.tabs button[aria-pressed=true]{
  background:var(--primary);border-color:var(--primary);color:var(--on-primary);
}
.filter-row{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin:1.5rem 0 1.25rem;flex-wrap:wrap}
.tabs{display:flex;gap:.5rem}
.result-count{font-size:13px;color:var(--slate-mut);margin:0}
.result-count button{color:var(--primary);font-weight:600;margin-left:10px;text-decoration:underline}

.course-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1.5rem}
.course-card{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);
  overflow:hidden;display:flex;flex-direction:column;box-shadow:var(--e1);
  transition:box-shadow .2s,border-color .2s,transform .2s;
}
.course-card:hover{box-shadow:var(--e2);border-color:rgba(16,185,129,.3);transform:translateY(-2px)}
.course-photo{position:relative;aspect-ratio:16/9;background:var(--well)}
.course-photo img{width:100%;height:100%;object-fit:cover;display:block}
.course-photo.is-logo{background:var(--surface)}
.course-photo.is-logo img{object-fit:contain;padding:1.75rem}
.course-photo:after{
  content:'';position:absolute;inset:auto 0 0;height:52%;pointer-events:none;
  background:linear-gradient(transparent,rgba(15,23,42,.74));
}
.photo-fallback{
  width:100%;height:100%;display:grid;place-items:center;
  background:linear-gradient(140deg,#dcefe4,#b9d8c6);
}
.photo-fallback span{
  width:68px;height:68px;border-radius:var(--r-full);background:rgba(255,255,255,.75);
  display:grid;place-items:center;font-size:24px;font-weight:700;color:var(--primary);
}
.badge{
  position:absolute;left:12px;top:12px;z-index:2;
  background:rgba(255,255,255,.92);backdrop-filter:blur(8px);
  padding:4px 10px;border-radius:var(--r-full);color:var(--primary);
}
.save-button{
  position:absolute;right:12px;top:12px;z-index:2;
  width:40px;height:40px;border-radius:var(--r-full);display:grid;place-items:center;
  background:rgba(255,255,255,.75);backdrop-filter:blur(8px);font-size:18px;color:var(--slate);
  transition:transform .15s,background .15s;
}
.save-button:hover{transform:scale(1.08);background:#fff}
.save-button[aria-pressed=true]{color:#e11d48}
.course-title-over{position:absolute;left:14px;right:14px;bottom:12px;z-index:2;color:#fff}
.course-location{opacity:.92}
.course-title-over h3{font-size:18px;line-height:24px;font-weight:700;margin-top:3px;text-shadow:0 1px 6px rgba(0,0,0,.45)}
.course-body{padding:1rem;display:flex;flex-direction:column;gap:.75rem;flex:1}
.meta-row{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.chip-badge{background:var(--well);color:var(--slate-mut);padding:3px 9px;border-radius:var(--r-full)}
.rating{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--slate-mut);margin:0}
.rating .star{color:var(--tertiary);font-size:13px}
.rating strong{color:var(--slate);font-size:13px;font-weight:700}
.course-bottom{
  border-top:1px solid var(--line);padding-top:.75rem;margin-top:auto;
  display:flex;align-items:center;justify-content:space-between;gap:.75rem;
}
.fee-note{font-size:12px;line-height:16px;color:var(--outline)}
.view-times{
  background:var(--primary);color:var(--on-primary);height:44px;padding:0 18px;
  border-radius:var(--r);font-weight:600;font-size:13px;white-space:nowrap;
  display:inline-flex;align-items:center;gap:8px;
}
.view-times:hover{background:var(--primary-dark)}
.view-times.is-locked{background:var(--well);color:var(--slate)}
.view-times.is-locked:hover{background:var(--line)}

/* skeletons */
.skeleton-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);overflow:hidden}
.skeleton-card .photo{aspect-ratio:16/9;background:var(--well)}
.skeleton-card .bar{height:12px;border-radius:var(--r-sm);background:var(--well);margin:12px 1rem}
.skeleton-card .bar.short{width:40%}
.skeleton-card .bar.wide{width:72%;height:18px}
@media(prefers-reduced-motion:no-preference){
  .skeleton-card .bar,.skeleton-card .photo{animation:pulse 1.4s ease-in-out infinite}
}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.55}}

/* states */
.state-panel{
  grid-column:1/-1;text-align:center;padding:3rem 1.5rem;background:var(--surface);
  border:1px solid var(--line);border-radius:var(--r-lg);
}
.state-panel h3{font-size:20px;margin-bottom:6px}
.state-panel p{margin:0 auto;color:var(--slate-mut);max-width:44ch}
.state-panel .primary,.state-panel .view-times{margin-top:1.25rem}
.state-panel.error{background:var(--error-soft);border-color:#f3c4bd}
.state-panel.error h3{color:var(--on-error-soft)}
.demo-note{font-size:12px;color:var(--outline);margin-top:1.25rem}

/* ---------- closing / footer ---------- */
.closing{text-align:center;padding:2rem 0 3rem}
.closing .logo-mark{margin:0 auto 1rem}
.closing p{color:var(--slate-mut);margin:.5rem 0 1rem}
footer{background:var(--primary-deep);color:var(--primary-fixed-dim)}
.footer-content{display:flex;align-items:center;gap:.75rem 1.5rem;flex-wrap:wrap;padding:1.75rem 0}
.footer-content .logo{color:var(--on-primary);font-size:20px}
.footer-content .logo-mark{background:var(--primary);color:var(--primary-fixed)}
.footer-content p{margin:0;font-size:13px}
.footer-content > span{margin-left:auto;font-size:12px}

/* ---------- dialog / tee sheet ---------- */
dialog{
  border:0;border-radius:var(--r-xl);padding:0;width:min(620px,calc(100% - 1.5rem));
  max-height:min(90vh,820px);color:var(--slate);box-shadow:var(--e3);background:var(--canvas);
}
dialog::backdrop{background:rgba(3,25,19,.62)}
.dialog-body{padding:1.5rem;overflow-y:auto;max-height:inherit}
/* The body scrolls beneath this button, so it needs to stay opaque and on top. */
.dialog-close{
  position:absolute;right:12px;top:12px;z-index:5;width:40px;height:40px;border-radius:var(--r-full);
  display:grid;place-items:center;font-size:20px;color:var(--slate-mut);
  background:var(--surface);box-shadow:0 0 0 5px var(--canvas);
}
.dialog-close:hover{background:var(--well);color:var(--slate)}
.dialog-head{padding-right:3rem}
.dialog-head h2{font-size:24px;line-height:30px;margin-top:4px}
#booking-details{color:var(--slate-mut);font-size:13px;margin:6px 0 0}

.sheet-dates{display:flex;gap:.5rem;overflow-x:auto;scrollbar-width:none;margin:1.25rem 0 .25rem;padding-bottom:4px}
.sheet-dates::-webkit-scrollbar{display:none}
.sheet-date{
  flex:none;min-width:76px;padding:8px 12px;border-radius:var(--r);border:1px solid var(--line);
  background:var(--surface);display:flex;flex-direction:column;align-items:center;gap:2px;
}
.sheet-date small{color:var(--outline)}
.sheet-date b{font-size:14px;font-weight:600}
.sheet-date:hover{background:var(--well)}
.sheet-date[aria-pressed=true]{background:var(--primary);border-color:var(--primary);color:var(--on-primary)}
.sheet-date[aria-pressed=true] small{color:var(--primary-fixed-dim)}
.dialog-field{display:flex;flex-direction:column;gap:6px;margin-top:.75rem}
.dialog-field > span{color:var(--outline)}
.dialog-field input{
  height:48px;border:1px solid var(--line-strong);border-radius:var(--r);
  padding:0 14px;background:var(--surface);font-size:15px;
}

.slots-label{font-size:13px;color:var(--slate-mut);margin:1.25rem 0 .5rem}
.wave{margin-top:1.25rem}
.wave-head{display:flex;align-items:center;gap:8px;margin-bottom:.5rem}
.wave-head h4{margin:0;font-size:14px;font-weight:700;color:var(--slate)}
.wave-count{background:var(--secondary-soft);color:var(--secondary-deep);padding:2px 8px;border-radius:var(--r-full)}
.time-options{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:.5rem;margin:0}
.time-options button{
  min-height:54px;padding:8px 6px;border:1px solid var(--line);border-radius:var(--r);
  background:var(--surface);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  transition:border-color .15s,background .15s,box-shadow .15s;
}
.slot-time{font-size:15px;font-weight:600;letter-spacing:-.01em}
.slot-meta{color:var(--outline)}
.time-options button:hover:not(:disabled){border-color:var(--secondary);box-shadow:var(--e2)}
.time-options button[aria-pressed=true]{background:var(--primary);border-color:var(--primary);color:var(--on-primary)}
.time-options button[aria-pressed=true] .slot-meta{color:var(--primary-fixed-dim)}
.time-options button:disabled{background:var(--well);color:#94a3b8;border-color:transparent;cursor:not-allowed}
.time-options button:disabled .slot-time{text-decoration:line-through}

.booking-total{
  display:flex;justify-content:space-between;align-items:center;gap:1rem;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-md);
  padding:1rem;margin-top:1.5rem;
}
.booking-total > span{font-size:13px;color:var(--slate-mut)}
.booking-total strong{font-size:22px;font-weight:700;letter-spacing:-.02em;text-align:right}
.booking-total strong.placeholder{
  font-family:'Hanken Grotesk',sans-serif;font-size:13px;font-weight:400;color:var(--outline);letter-spacing:0;
}
.booking-notice{font-size:12px;line-height:18px;color:var(--outline);margin:.75rem 0 1rem}
dialog .primary{width:100%}
.feedback{font-size:13px;line-height:18px;margin:.75rem 0 0;border-radius:var(--r)}
.feedback:empty{display:none}
.feedback.error{color:var(--on-error-soft);background:var(--error-soft);padding:12px 14px}
.feedback.success{color:var(--secondary-deep);background:var(--secondary-soft);padding:12px 14px}

.success-panel{text-align:center;padding:.5rem 0}
.success-mark{
  width:60px;height:60px;border-radius:var(--r-full);background:var(--secondary-soft);
  color:var(--secondary-deep);display:grid;place-items:center;font-size:30px;margin:.5rem auto 1rem;
}
.success-panel h3{font-size:22px;margin-bottom:6px}
.success-panel > p{color:var(--slate-mut);margin:0}
.success-panel dl{
  display:grid;grid-template-columns:auto 1fr;gap:8px 1.25rem;text-align:left;font-size:13px;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-md);padding:1rem;margin:1.25rem 0 0;
}
.success-panel dt{color:var(--outline)}
.success-panel dd{margin:0;font-weight:600}
.dialog-actions{display:flex;gap:.5rem;margin-top:1.25rem}
.dialog-actions .view-times{flex:1;justify-content:center;background:var(--well);color:var(--slate)}
.dialog-actions .view-times:hover{background:var(--line)}

/* ---------- member profile ---------- */
.avatar{
  display:inline-grid;place-items:center;flex:none;
  width:30px;height:30px;border-radius:var(--r-full);
  background:var(--primary);color:var(--primary-fixed);
  font-size:12px;font-weight:700;letter-spacing:.02em;
  background-size:cover;background-position:center;
}
.avatar-lg{width:72px;height:72px;font-size:26px;box-shadow:var(--e1)}
.profile-button{
  display:inline-flex;align-items:center;gap:9px;height:44px;padding:0 14px 0 7px;
  border:1px solid var(--line);border-radius:var(--r-full);background:var(--surface);
  font-weight:600;color:var(--slate);max-width:230px;
}
.profile-button:hover{background:var(--well)}
.profile-button .label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

#profile-dialog{width:min(720px,calc(100% - 1.5rem))}
.profile-head{display:flex;align-items:center;gap:1rem;padding-right:3rem}
.profile-id{min-width:0}
.profile-id h2{font-size:26px;line-height:32px;margin-top:2px}
#profile-sub{color:var(--slate-mut);font-size:13px;margin:4px 0 0}

.profile-stats{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:1.25rem}
.stat-tile{
  flex:1 1 130px;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--r-md);padding:.75rem 1rem;
}
.stat-tile small{
  display:block;font-size:11px;font-weight:700;letter-spacing:.04em;
  text-transform:uppercase;color:var(--outline);margin-bottom:3px;
}
.stat-tile b{
  font-family:'JetBrains Mono',monospace;font-variant-numeric:tabular-nums;
  font-size:19px;font-weight:700;letter-spacing:-.02em;
}
.stat-tile b.text{font-family:'Hanken Grotesk',sans-serif;font-size:15px;letter-spacing:0}

.profile-section{margin-top:1.75rem;border-top:1px solid var(--line);padding-top:1.25rem}
.profile-section-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding-right:2.75rem}
.profile-section-head h3{font-size:16px}
.section-note{color:var(--outline);font-size:12px;margin:4px 0 0}
.ghost-button.sm{height:36px;padding:0 12px;font-size:13px;font-weight:600;border-radius:var(--r)}

.profile-details{
  display:grid;grid-template-columns:auto 1fr;gap:8px 1.25rem;margin:1rem 0 0;font-size:13px;
}
.profile-details dt{color:var(--outline)}
.profile-details dd{margin:0;font-weight:600;overflow-wrap:anywhere}
.profile-details dd.empty{font-weight:400;color:var(--outline)}

.profile-form{margin-top:1rem;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-md);padding:1rem}
.profile-form h4{margin:0 0 .75rem;font-size:15px;font-weight:700}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:.75rem}
.form-grid .span-2{grid-column:1/-1}
.form-grid label{display:grid;gap:5px;font-size:12px;font-weight:600;color:var(--slate-mut)}
.form-grid input,.form-grid select{
  height:44px;border:1px solid var(--line-strong);border-radius:var(--r);
  padding:0 12px;background:var(--surface);font-size:14px;font-weight:400;color:var(--slate);
}
.form-grid input:focus,.form-grid select:focus{outline:2px solid var(--secondary);outline-offset:2px;border-color:transparent}
.switch-set{border:0;margin:1rem 0 0;padding:0;display:grid;gap:.5rem}
.switch-set legend{
  font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
  color:var(--outline);padding:0;margin-bottom:.25rem;
}
.switch,.form-grid label.switch{
  display:flex;align-items:center;gap:10px;font-size:13px;font-weight:500;color:var(--slate);
}
.switch input{width:18px;height:18px;accent-color:var(--primary);flex:none}

.visually-hidden{
  position:absolute;width:1px;height:1px;margin:-1px;padding:0;
  overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;
}
.avatar-md{width:56px;height:56px;font-size:19px}
.photo-field{display:flex;align-items:center;gap:1rem;margin-bottom:1rem}
.photo-field-text{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}
.photo-field-text .section-note{width:100%;margin:0}
.visually-hidden:focus-visible + label{outline:2px solid var(--secondary);outline-offset:2px}

.membership-row{
  display:flex;align-items:center;gap:1rem;flex-wrap:wrap;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-md);
  padding:.875rem 1rem;margin-top:.75rem;
}
.membership-main{min-width:0;flex:1 1 220px}
.membership-main h4{margin:0;font-size:15px;font-weight:700}
.membership-meta{display:flex;flex-wrap:wrap;gap:.25rem .875rem;margin-top:5px;font-size:12px;color:var(--slate-mut)}
.membership-meta code{
  font-family:'JetBrains Mono',monospace;font-size:12px;
  background:var(--well);padding:1px 6px;border-radius:var(--r-sm);color:var(--slate);
}
.membership-actions{display:flex;gap:.5rem;margin-left:auto}
.tag-member,.tag-guest{
  font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
  padding:3px 9px;border-radius:var(--r-full);
}
.tag-member{background:var(--secondary-soft);color:var(--secondary-deep)}
.tag-guest{background:var(--tertiary-soft);color:var(--on-tertiary-soft)}
.link-danger{color:#b3261e;font-weight:600;font-size:13px;padding:0 6px}
.link-danger:hover{text-decoration:underline}

.rounds-section{padding:0 0 3.5rem}
.rounds-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:.75rem;margin-top:1.5rem}
.rounds-grid .score-row{margin-top:0}
#rounds-nav b{background:var(--well);color:var(--slate-mut)}
@media(max-width:1024px){.rounds-grid{grid-template-columns:1fr}}

/* ---- rounds (read-only) ---- */
.score-row{
  display:flex;align-items:center;gap:1rem;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-md);
  padding:.75rem 1rem;margin-top:.5rem;
}
.score-date{
  flex:none;width:52px;text-align:center;background:var(--well);
  border-radius:var(--r);padding:6px 4px;
}
.score-date small{
  display:block;font-size:10px;font-weight:700;letter-spacing:.06em;
  text-transform:uppercase;color:var(--outline);
}
.score-date b{
  font-family:'JetBrains Mono',monospace;font-variant-numeric:tabular-nums;
  font-size:17px;font-weight:700;line-height:20px;
}
.score-main{min-width:0;flex:1 1 auto}
.score-main h4{margin:0;font-size:14px;font-weight:700;overflow-wrap:anywhere}
.score-meta{display:flex;flex-wrap:wrap;gap:.125rem .75rem;margin-top:3px;font-size:12px;color:var(--slate-mut)}
.score-figures{display:flex;gap:1rem;flex:none;text-align:right}
.score-figures div{min-width:42px}
.score-figures small{
  display:block;font-size:10px;font-weight:700;letter-spacing:.04em;
  text-transform:uppercase;color:var(--outline);
}
.score-figures b{
  font-family:'JetBrains Mono',monospace;font-variant-numeric:tabular-nums;
  font-size:17px;font-weight:700;letter-spacing:-.02em;
}
.score-flags{display:flex;gap:4px;flex-wrap:wrap;margin-top:5px}
#scores-more{margin-top:.75rem}
@media(max-width:768px){
  .score-row{flex-wrap:wrap}
  .score-figures{margin-left:auto;text-align:left}
}

.profile-footer{margin-top:1.75rem;border-top:1px solid var(--line);padding-top:1.25rem}
.profile-empty{
  background:var(--well);border-radius:var(--r-md);padding:1.25rem;
  text-align:center;color:var(--slate-mut);font-size:13px;margin-top:.75rem;
}

@media(max-width:768px){
  .form-grid{grid-template-columns:1fr}
  .form-grid .span-2{grid-column:auto}
  .profile-head{gap:.75rem}
  .avatar-lg{width:58px;height:58px;font-size:21px}
  .profile-id h2{font-size:22px;line-height:28px}
  .membership-actions{margin-left:0;width:100%}
}

#login-form{display:grid;gap:1rem;margin-top:1.25rem}
#login-form label{display:grid;gap:6px;font-size:13px;font-weight:600}
#login-form input{
  height:48px;padding:0 14px;border:1px solid var(--line-strong);border-radius:var(--r);
  background:var(--surface);font-weight:400;
}
#login-intro{color:var(--slate-mut);font-size:14px;margin:6px 0 0}
body:has(dialog[open]){overflow:hidden}

/* ---------- responsive ---------- */
@media(max-width:1024px){
  .wrap{width:calc(100% - 3rem)}
  .course-grid{grid-template-columns:repeat(2,1fr);gap:1.25rem}
  .header nav{margin-left:1rem}
  h1{font-size:38px;line-height:46px}
  .field-hint{display:none}
}
@media(max-width:768px){
  :root{--header-h:64px}
  .wrap{width:calc(100% - 2rem)}
  h1{font-size:34px;line-height:42px;letter-spacing:-.02em}
  h2{font-size:26px;line-height:34px}
  .announcement a{display:none}
  .header nav{display:none}
  .hero-content{padding:1.75rem 0 4.5rem}
  .hero p{font-size:14px;line-height:20px}
  .search-fields{grid-template-columns:1fr}
  .search-panel .primary{width:100%}
  .course-grid{grid-template-columns:1fr}
  .section-heading{flex-direction:column;align-items:flex-start;gap:.5rem}
  .signin-banner button{margin-left:0;width:100%}
  .dialog-body{padding:1.25rem}
  .time-options{grid-template-columns:repeat(auto-fill,minmax(88px,1fr))}
  .footer-content > span{margin-left:0;width:100%}
  /* three action buttons + logo will not fit with text labels */
  .ghost-button .label,.profile-button .label{display:none}
  .profile-button{max-width:none;padding:0 6px}
}
@media(max-width:420px){
  .profile-button{padding-left:5px}
}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *{transition:none!important;animation:none!important}
}

.profile-empty.span-grid{grid-column:1/-1}

.tab-icon{font-size:15px;line-height:1;color:var(--slate-mut)}
#rounds-nav[aria-current=true] .tab-icon{color:inherit}
