/* ============================================================
   The Clubhouse — "Modern Country Club" design system
   Deep pine surfaces, warm stone neutrals, brass-gold accents,
   athletic condensed numerals (Barlow Condensed / Barlow).

   Token architecture: primitives → semantic roles.
   Components reference semantic tokens only.
   ============================================================ */

:root {
    /* ----- primitive palette ----- */
    --pine-950: #081711;
    --pine-900: #0c231a;
    --pine-800: #123324;
    --pine-700: #1a4530;
    --pine-600: #23593e;
    --pine-500: #2e7050;
    --pine-100: #e2ede5;
    --pine-50: #eef5ef;

    --stone-50: #fbfaf7;
    --stone-100: #f4f2ec;
    --stone-200: #e9e6dc;
    --stone-300: #d8d4c6;

    --brass-700: #7c5203;
    --brass-600: #a16207;
    --brass-500: #c07e14;
    --brass-400: #d9a62e;
    --brass-300: #e9c568;
    --brass-100: #f7eed6;

    --red-700: #9c2b21;
    --red-600: #c2362b;
    --red-100: #fbe9e7;
    --sky-700: #245d79;

    /* ----- semantic tokens ----- */
    --bg: var(--stone-100);
    --surface: #ffffff;
    --fg: #131a15;
    --muted: #57615a;
    --faint: #7d877f;
    --border: #e4e1d5;
    --border-strong: #ccc8b8;

    --primary: var(--pine-800);
    --primary-hover: var(--pine-700);
    --on-primary: #f7f5ee;
    --brand-dark: var(--pine-900);
    --accent-text: var(--brass-600);   /* gold safe on light bg */
    --accent-on-dark: var(--brass-300);
    --danger: var(--red-600);
    --focus: var(--pine-500);

    /* legacy aliases still referenced by scoped styles */
    --green-deep: var(--pine-800);
    --green: var(--pine-600);
    --green-bright: var(--pine-500);
    --gold: var(--brass-500);
    --ink: var(--fg);
    --ink-soft: var(--muted);
    --ink-faint: var(--faint);
    --line: var(--border);
    --line-strong: var(--border-strong);
    --card: var(--surface);
    --flag-red: var(--red-600);

    /* ----- surfaces & depth ----- */
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-xs: 0 1px 2px rgba(12, 35, 26, 0.05);
    --shadow: 0 1px 2px rgba(12, 35, 26, 0.05), 0 3px 12px rgba(12, 35, 26, 0.05);
    --shadow-lift: 0 2px 4px rgba(12, 35, 26, 0.06), 0 12px 32px rgba(12, 35, 26, 0.12);
    --shadow-dark: 0 8px 28px rgba(8, 23, 17, 0.35);
    --ring: 0 0 0 3px rgba(46, 112, 80, 0.25);

    /* ----- layout ----- */
    --header-h: 64px;
    --bottomnav-h: 66px;
    --shell-max: 1040px;

    /* ----- type ----- */
    --font: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-display: "Barlow Condensed", "Barlow", "Segoe UI", system-ui, sans-serif;

    /* fluid type scale */
    --step-0: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);       /* body 16→17 */
    --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
    --step-2: clamp(1.45rem, 1.3rem + 0.7vw, 1.8rem);
    --step-3: clamp(1.9rem, 1.55rem + 1.7vw, 2.7rem);

    /* ----- motion ----- */
    --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --t-fast: 0.16s;
    --t-med: 0.24s;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--fg);
    background: var(--bg);
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* faint clubhouse atmosphere behind every page */
body {
    background:
        radial-gradient(1100px 340px at 50% -80px, rgba(35, 89, 62, 0.07), transparent 70%),
        radial-gradient(700px 260px at 100% 0%, rgba(217, 166, 46, 0.05), transparent 65%),
        var(--bg);
    background-attachment: fixed;
}

h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--fg);
    margin: 0 0 0.3rem;
    font-weight: 700;
    line-height: 1.08;
    text-transform: uppercase;
    letter-spacing: 0.015em;
}
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 0.85em; }
a { color: var(--pine-600); }

h1:focus { outline: none; }
:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-radius: 4px;
}

::selection { background: rgba(46, 112, 80, 0.22); }

/* slim, pine-tinted scrollbars to match the clubhouse theme */
* { scrollbar-width: thin; scrollbar-color: rgba(35, 89, 62, 0.45) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
    background: rgba(35, 89, 62, 0.4);
    border-radius: 99px;
    border: 3px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(35, 89, 62, 0.65); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }

/* shared inline icon sizing */
.app-icon { width: 22px; height: 22px; flex-shrink: 0; }
.btn .app-icon { width: 18px; height: 18px; }
.badge .app-icon { width: 13px; height: 13px; }

/* ---------- App shell ----------
   The shell owns the viewport; only .app-scroll scrolls, so the
   scrollbar runs between the header and the bottom nav instead of
   over them. */

.app-shell { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

.app-scroll {
    flex: 1; min-height: 0;
    overflow-y: auto; overflow-x: clip;
    -webkit-overflow-scrolling: touch;
}

.app-header {
    position: relative; z-index: 40; flex-shrink: 0;
    height: var(--header-h);
    display: flex; align-items: center; gap: 1.5rem;
    padding: 0 clamp(1rem, 3vw, 2rem);
    background:
        radial-gradient(560px 120px at 12% 0%, rgba(233, 197, 104, 0.07), transparent 70%),
        linear-gradient(180deg, var(--pine-900), var(--pine-950));
    color: var(--on-primary);
    border-bottom: 1px solid rgba(233, 197, 104, 0.18);
    box-shadow: 0 4px 18px rgba(8, 23, 17, 0.18);
}
.app-header :focus-visible { outline-color: var(--brass-300); }

.app-logo {
    display: flex; align-items: center; gap: 0.6rem;
    color: #fff; text-decoration: none;
    font-family: var(--font-display);
    font-weight: 700; font-size: 1.3rem;
    text-transform: uppercase; letter-spacing: 0.06em;
}
.logo-flag {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px;
    color: var(--accent-on-dark);
    background: rgba(233, 197, 104, 0.10);
    border: 1px solid rgba(233, 197, 104, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.logo-flag .app-icon { width: 20px; height: 20px; }

.app-nav { display: flex; gap: 0.25rem; margin-left: auto; }
.app-nav a {
    position: relative;
    color: rgba(247, 245, 238, 0.72); text-decoration: none;
    padding: 0.55rem 0.95rem;
    font-family: var(--font-display);
    font-weight: 600; font-size: 1.02rem;
    text-transform: uppercase; letter-spacing: 0.08em;
    border-radius: var(--radius-sm);
    transition: color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.app-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.app-nav a::after {
    content: ""; position: absolute; left: 0.95rem; right: 0.95rem; bottom: 4px;
    height: 2px; border-radius: 2px;
    background: var(--brass-400);
    transform: scaleX(0); transform-origin: left;
    transition: transform var(--t-med) var(--ease-out);
}
.app-nav a.active { color: var(--accent-on-dark); }
.app-nav a.active::after { transform: scaleX(1); }

.header-user { margin-left: 0.25rem; color: #fff; text-decoration: none; font-weight: 600; }
.header-user .avatar {
    box-shadow: 0 0 0 2px rgba(233, 197, 104, 0.45);
    transition: box-shadow var(--t-fast), transform var(--t-fast) var(--ease-spring);
}
.header-user:hover .avatar { box-shadow: 0 0 0 3px var(--brass-400); transform: scale(1.05); }

.app-main {
    width: 100%;
    max-width: var(--shell-max);
    margin: 0 auto;
    padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1rem, 3vw, 1.5rem) 2.25rem;
    animation: page-enter 0.4s var(--ease-out) both;
}
@keyframes page-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Bottom nav (mobile) ---------- */

.bottom-nav {
    position: relative; z-index: 40; flex-shrink: 0;
    height: var(--bottomnav-h);
    display: flex; justify-content: space-around; align-items: stretch;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    backdrop-filter: blur(16px) saturate(1.3);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 24px rgba(12, 35, 26, 0.10);
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
    position: relative;
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--faint); text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
    transition: color var(--t-fast) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav svg { width: 23px; height: 23px; fill: currentColor; transition: transform var(--t-med) var(--ease-spring); }
.bottom-nav a.active { color: var(--pine-700); }
.bottom-nav a.active svg { transform: translateY(-1px) scale(1.06); }
.bottom-nav a.active::before {
    content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 32px; height: 3px; border-radius: 0 0 4px 4px;
    background: var(--brass-500);
}
.bottom-nav a.nav-play.active::before { display: none; }
.nav-play-btn {
    display: flex; align-items: center; justify-content: center;
    width: 50px; height: 50px; border-radius: 50%;
    background: linear-gradient(150deg, var(--pine-600), var(--pine-800));
    box-shadow: 0 6px 18px rgba(18, 51, 36, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    margin-top: -22px;
    border: 3px solid rgba(255, 255, 255, 0.95);
    transition: transform var(--t-med) var(--ease-spring), box-shadow var(--t-med);
}
.bottom-nav a.nav-play:active .nav-play-btn { transform: scale(0.92); }
.nav-play-btn svg { fill: #fff; }
.bottom-nav a.nav-play.active .nav-play-btn {
    background: linear-gradient(150deg, var(--brass-400), var(--brass-600));
    box-shadow: 0 6px 18px rgba(192, 126, 20, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.bottom-nav a.nav-play.active .nav-play-btn svg { fill: var(--pine-950); }

@media (min-width: 768px) {
    .bottom-nav { display: none; }
    .app-main { padding-bottom: 3rem; }
}
@media (max-width: 767px) {
    .app-nav { display: none; }
    /* desktop nav (which carries margin-left:auto) is hidden here,
       so the user chip takes over pushing itself to the right edge */
    .app-header { gap: 0.75rem; }
    .header-user { margin-left: auto; }
}

/* ---------- Common bits ---------- */

.page-head { margin-bottom: clamp(1.1rem, 2.5vw, 1.75rem); }
.page-eyebrow {
    display: flex; align-items: center; gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 0.8rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.22em;
    color: var(--accent-text);
    margin-bottom: 0.35rem;
}
.page-eyebrow::before {
    content: ""; width: 22px; height: 2px; border-radius: 2px;
    background: var(--brass-500);
}
.page-sub, .account-sub { color: var(--muted); margin: 0.15rem 0 0; font-size: 0.97rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    padding: 1.25rem;
}

.section-title {
    display: flex; align-items: center; gap: 0.6rem;
    margin: 1.9rem 0 0.85rem;
    font-family: var(--font-display);
    font-size: 1.02rem; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.14em;
}
.section-title::before {
    content: ""; width: 18px; height: 3px; border-radius: 2px;
    background: var(--brass-500);
}
.section-title::after {
    content: ""; flex: 1; height: 1px;
    background: var(--border-strong);
    opacity: 0.7;
}

.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 50%;
    background: linear-gradient(150deg, var(--pine-600), var(--pine-900));
    color: #fff; font-weight: 700; font-size: 1rem; flex-shrink: 0;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.85rem; }

.badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.18rem 0.6rem; border-radius: 6px;
    font-family: var(--font-display);
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
    border: 1px solid transparent;
}
.badge-green { background: var(--pine-50); color: var(--pine-700); border-color: #cfe2d2; }
.badge-gold { background: var(--brass-100); color: var(--brass-700); border-color: #ecdcae; }
.badge-gray { background: var(--stone-200); color: var(--muted); border-color: var(--border-strong); }
.badge-red { background: var(--red-100); color: var(--red-700); border-color: #f2cfca; }

.icon-chip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    background: var(--stone-200); color: var(--pine-700);
}
.icon-chip .app-icon { width: 20px; height: 20px; }
.icon-chip-gold { background: rgba(217, 166, 46, 0.18); color: var(--brass-700); }

.empty-state {
    text-align: center; color: var(--muted);
    padding: 2.75rem 1.25rem;
    background: var(--stone-50);
    border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
}
.empty-state .empty-icon {
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.8rem;
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--stone-200); color: var(--pine-700);
}
.empty-state .empty-icon .app-icon { width: 26px; height: 26px; }
.empty-state .empty-title {
    display: block;
    font-family: var(--font-display);
    font-size: 1.15rem; font-weight: 700; color: var(--fg);
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}

/* live "round in progress" banner */
.resume-banner {
    display: flex; align-items: center; gap: 0.85rem;
    background:
        radial-gradient(320px 120px at 100% 0%, rgba(217, 166, 46, 0.16), transparent 70%),
        linear-gradient(0deg, var(--brass-100), var(--brass-100));
    border: 1px solid #ecdcae; border-left: 4px solid var(--brass-500);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    padding: 0.85rem 1.05rem; margin-bottom: 1.1rem;
    text-decoration: none; color: var(--fg);
    transition: box-shadow var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out);
}
.resume-banner:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.resume-banner .row-main { flex: 1; min-width: 0; }
.resume-banner .row-title { font-weight: 600; }
.resume-banner .row-sub { font-size: 0.84rem; color: var(--muted); margin-top: 0.1rem; }
.live-dot {
    position: relative;
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    background: var(--brass-500); flex-shrink: 0;
}
.live-dot::after {
    content: ""; position: absolute; inset: -4px; border-radius: 50%;
    border: 2px solid var(--brass-400);
    animation: live-pulse 1.8s var(--ease-out) infinite;
}
@keyframes live-pulse {
    0% { transform: scale(0.6); opacity: 0.9; }
    70%, 100% { transform: scale(1.5); opacity: 0; }
}

/* ---------- Skeleton loading ---------- */

.skeleton {
    position: relative; overflow: hidden;
    background: var(--stone-200);
    border-radius: var(--radius-sm);
}
.skeleton::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: translateX(-100%);
    animation: shimmer 1.4s var(--ease-out) infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.skeleton-stat { height: 86px; border-radius: var(--radius); }
.skeleton-row { height: 68px; border-radius: var(--radius); margin-bottom: 0.6rem; }
.skeleton-block { height: 140px; border-radius: var(--radius); margin-bottom: 0.85rem; }

/* ---------- Buttons ---------- */

.btn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    border: 1.5px solid transparent; border-radius: 10px; cursor: pointer;
    font-family: inherit; font-weight: 600; font-size: 0.95rem;
    padding: 0.6rem 1.3rem; min-height: 44px;
    text-decoration: none;
    touch-action: manipulation;
    transition: transform var(--t-fast) var(--ease-spring),
                box-shadow var(--t-fast) var(--ease-out),
                background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: 0 2px 10px rgba(18, 51, 36, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 5px 18px rgba(18, 51, 36, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-secondary { background: var(--pine-50); color: var(--pine-800); border-color: #cfe2d2; }
.btn-secondary:hover:not(:disabled) { background: var(--pine-100); border-color: #b9d4be; }

.btn-gold {
    background: linear-gradient(150deg, var(--brass-400), var(--brass-600));
    color: var(--pine-950);
    box-shadow: 0 2px 10px rgba(192, 126, 20, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-gold:hover:not(:disabled) { box-shadow: 0 5px 18px rgba(192, 126, 20, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4); filter: brightness(1.04); }

.btn-ghost { background: transparent; color: var(--pine-800); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { border-color: var(--pine-600); background: var(--surface); }
.btn-danger { background: var(--red-100); color: var(--red-700); border-color: #f2cfca; }
.btn-danger:hover:not(:disabled) { background: #f8dcd8; }
.btn-block { width: 100%; }
.btn-sm { padding: 0.35rem 0.9rem; font-size: 0.87rem; min-height: 38px; }
.btn-sm .app-icon { width: 15px; height: 15px; }

/* ---------- Forms ---------- */

.field { display: block; margin-bottom: 1rem; }
.field > span {
    display: block; font-size: 0.82rem; font-weight: 600; color: var(--fg);
    margin-bottom: 0.35rem;
}
.field > span em { font-weight: 400; color: var(--muted); font-style: normal; }
.field input, .field select, .field textarea,
input.form-input, select.form-input {
    width: 100%;
    padding: 0.62rem 0.85rem; min-height: 44px;
    border: 1.5px solid var(--border-strong); border-radius: 10px;
    font-family: inherit; font-size: 1rem; color: var(--fg);
    background: var(--surface);
    transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.field textarea { min-height: 88px; }
.field input:hover:not(:focus), .field select:hover:not(:focus), input.form-input:hover:not(:focus) { border-color: #b3af9f; }
.field input:focus, .field select:focus, .field textarea:focus, input.form-input:focus {
    outline: none; border-color: var(--pine-500);
    box-shadow: var(--ring);
}
.check-field { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 1rem; font-size: 0.94rem; }
.check-field input[type=checkbox] { accent-color: var(--pine-600); width: 18px; height: 18px; }

.validation-message { color: var(--danger); font-size: 0.82rem; margin-top: 0.3rem; display: block; }
.invalid:not([type=checkbox]) { border-color: var(--danger) !important; }

.alert {
    padding: 0.8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: 0.94rem;
    border: 1px solid transparent; border-left-width: 4px;
    animation: page-enter 0.3s var(--ease-out) both;
}
.alert-error { background: var(--red-100); color: var(--red-700); border-color: #f2cfca; border-left-color: var(--red-600); }
.alert-success { background: var(--pine-50); color: var(--pine-800); border-color: #cfe2d2; border-left-color: var(--pine-500); }
.alert-warn { background: var(--brass-100); color: var(--brass-700); border-color: #ecdcae; border-left-color: var(--brass-500); }

/* ---------- Account (login/register) ---------- */

.account-shell {
    min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem 1rem;
    background:
        radial-gradient(900px 480px at 85% -10%, rgba(233, 197, 104, 0.10), transparent 60%),
        radial-gradient(700px 420px at 0% 100%, rgba(46, 112, 80, 0.22), transparent 60%),
        linear-gradient(160deg, var(--pine-950), var(--pine-900) 55%, var(--pine-800));
}
.account-card {
    position: relative; overflow: hidden;
    width: 100%; max-width: 430px;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    padding: 2.25rem 2rem;
    animation: account-in 0.5s var(--ease-out) both;
}
.account-card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--brass-600), var(--brass-300), var(--brass-600));
}
@keyframes account-in {
    from { opacity: 0; transform: translateY(16px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.account-brand { text-align: center; margin-bottom: 1.6rem; }
.brand-flag {
    display: inline-flex; align-items: center; justify-content: center;
    width: 58px; height: 58px; border-radius: 16px; margin-bottom: 0.6rem;
    background: var(--pine-900); color: var(--accent-on-dark);
    border: 1px solid rgba(233, 197, 104, 0.35);
    box-shadow: 0 8px 22px rgba(12, 35, 26, 0.35);
}
.brand-flag .app-icon { width: 28px; height: 28px; }
.brand-name {
    font-family: var(--font-display);
    font-size: 1.7rem; font-weight: 700; display: block;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--pine-900);
}
.brand-tag { color: var(--muted); font-size: 0.87rem; }
.account-card h1 { font-size: 1.35rem; }
.account-switch { text-align: center; font-size: 0.92rem; color: var(--muted); margin-top: 1.3rem; }

/* ---------- Dashboard ---------- */

.stat-grid {
    display: grid; gap: 0.8rem;
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 0.6rem;
}
@media (min-width: 700px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .stat-grid { grid-template-columns: repeat(6, 1fr); } }

.stat-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-xs); padding: 1rem 1.1rem;
    display: flex; flex-direction: column; gap: 0.15rem;
    transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.stat-card .stat-value {
    font-family: var(--font-display);
    font-size: 2rem; font-weight: 700; color: var(--pine-900); line-height: 1.05;
    font-variant-numeric: tabular-nums;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.stat-card .stat-value .app-icon { width: 22px; height: 22px; color: var(--brass-500); }
.stat-card .stat-value small { font-size: 0.8rem; font-family: var(--font); font-weight: 500; color: var(--muted); }
.stat-card .stat-label {
    font-family: var(--font-display);
    font-size: 0.76rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.12em; color: var(--faint);
}
.stat-card.stat-hero {
    position: relative; overflow: hidden;
    background:
        radial-gradient(360px 180px at 100% 0%, rgba(233, 197, 104, 0.16), transparent 65%),
        linear-gradient(150deg, var(--pine-900), var(--pine-700));
    border: 1px solid rgba(233, 197, 104, 0.25);
    box-shadow: var(--shadow-dark);
}
.stat-card.stat-hero .stat-value { color: #fff; }
.stat-card.stat-hero .stat-label { color: var(--accent-on-dark); }

.list-row {
    display: flex; align-items: center; gap: 0.85rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    padding: 0.85rem 1.05rem; margin-bottom: 0.6rem;
}
.list-row .row-main { flex: 1; min-width: 0; }
.list-row .row-title { font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .row-sub { font-size: 0.84rem; color: var(--muted); margin-top: 0.1rem; }
.list-row .row-end { text-align: right; flex-shrink: 0; }
.row-chevron { color: var(--faint); flex-shrink: 0; }
.row-chevron .app-icon { width: 18px; height: 18px; }
.row-score {
    font-family: var(--font-display);
    font-size: 1.5rem; font-weight: 700; color: var(--pine-900); line-height: 1;
    font-variant-numeric: tabular-nums;
}
.row-score-sub { font-size: 0.76rem; color: var(--faint); }
a.list-row, button.list-row {
    text-decoration: none; cursor: pointer;
    width: 100%; text-align: left; font-family: inherit; font-size: 1rem;
    transition: box-shadow var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out), border-color var(--t-med);
}
a.list-row:hover, button.list-row:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); border-color: var(--border-strong); }

/* ---------- Play: course / tee / mode selection ---------- */

.search-bar { display: flex; gap: 0.5rem; margin-bottom: 1.1rem; }
.search-bar input { flex: 1; }

.course-grid { display: grid; gap: 0.85rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .course-grid { grid-template-columns: repeat(2, 1fr); } }

.course-card {
    position: relative; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    padding: 1.05rem 1.05rem 0.95rem 1.4rem; cursor: pointer;
    text-align: left; font-family: inherit; width: 100%;
    transition: box-shadow var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out), border-color var(--t-med);
}
.course-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); border-color: var(--border-strong); }
.course-card::before {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 5px;
    background: var(--accent, var(--pine-600));
    transition: width var(--t-med) var(--ease-out);
}
.course-card:hover::before { width: 8px; }
.course-card .course-name { font-family: var(--font-display); font-weight: 700; color: var(--pine-900); font-size: 1.2rem; text-transform: uppercase; letter-spacing: 0.02em; }
.course-card .course-loc { color: var(--muted); font-size: 0.86rem; margin: 0.1rem 0 0.6rem; }
.course-card .course-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.tee-row {
    display: flex; align-items: center; gap: 0.9rem;
    width: 100%; text-align: left; font-family: inherit; font-size: 1rem; cursor: pointer;
    background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
    padding: 0.9rem 1.05rem; margin-bottom: 0.65rem; min-height: 44px;
    transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.tee-row:hover { border-color: var(--pine-500); box-shadow: var(--shadow); transform: translateY(-1px); }
.tee-swatch {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    border: 2px solid rgba(0, 0, 0, 0.12);
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.12);
}
.tee-name { font-weight: 600; }
.tee-meta { font-size: 0.84rem; color: var(--muted); }

.mode-grid { display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .mode-grid { grid-template-columns: repeat(2, 1fr); } }
.mode-card {
    text-align: left; font-family: inherit; font-size: 1rem; cursor: pointer;
    background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
    padding: 1rem 1.05rem;
    transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), background var(--t-fast), transform var(--t-fast) var(--ease-out);
}
.mode-card:hover { border-color: var(--pine-500); box-shadow: var(--shadow); transform: translateY(-1px); }
.mode-card.selected {
    border-color: var(--pine-600);
    background: var(--pine-50);
    box-shadow: var(--ring);
}
.mode-card .mode-name { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--pine-900); text-transform: uppercase; letter-spacing: 0.03em; }
.mode-card .mode-desc { font-size: 0.86rem; color: var(--muted); margin-top: 0.2rem; }

/* numbered wizard progress */
.wizard-steps {
    display: flex; align-items: center;
    margin-bottom: 1.4rem;
}
.wizard-steps .step {
    display: flex; align-items: center; gap: 0.45rem;
    font-family: var(--font-display);
    font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--faint);
    transition: color var(--t-fast);
}
.wizard-steps .step-dot {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    font-size: 0.8rem; font-variant-numeric: tabular-nums;
    background: var(--stone-200); color: var(--muted);
    border: 1.5px solid var(--border-strong);
    transition: background var(--t-med), color var(--t-med), border-color var(--t-med), box-shadow var(--t-med);
}
.wizard-steps .step-dot .app-icon { width: 14px; height: 14px; }
.wizard-steps .step.done .step-dot {
    background: var(--pine-600); border-color: var(--pine-600); color: #fff;
}
.wizard-steps .step.done { color: var(--pine-700); }
.wizard-steps .step.current .step-dot {
    background: var(--pine-900); border-color: var(--pine-900); color: #fff;
    box-shadow: 0 0 0 3px rgba(46, 112, 80, 0.22);
}
.wizard-steps .step.current { color: var(--pine-900); }
.wizard-steps .step-line {
    flex: 1; height: 2px; margin: 0 0.55rem;
    min-width: 12px;
    background: var(--border-strong); border-radius: 2px;
}
.wizard-steps .step-line.done { background: var(--pine-600); }
@media (max-width: 520px) {
    .wizard-steps .step span.step-label { display: none; }
    .wizard-steps .step.current span.step-label { display: inline; }
}

.player-chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.95rem; }
.player-chip {
    display: inline-flex; align-items: center; gap: 0.45rem;
    background: var(--pine-50); border: 1px solid #cfe2d2;
    border-radius: 999px; padding: 0.32rem 0.75rem 0.32rem 0.38rem;
    font-size: 0.9rem; font-weight: 600; color: var(--pine-800);
    animation: chip-in 0.25s var(--ease-spring) both;
}
@keyframes chip-in {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}
.player-chip button {
    display: inline-flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer; color: var(--pine-800);
    padding: 0; border-radius: 50%;
    min-width: 24px; min-height: 24px;
    transition: color var(--t-fast), transform var(--t-fast);
}
.player-chip button .app-icon { width: 14px; height: 14px; }
.player-chip button:hover { color: var(--danger); transform: scale(1.15); }

/* ---------- Scorecard ---------- */

.sc-top {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.sc-course { font-family: var(--font-display); font-weight: 700; color: var(--pine-900); font-size: 1.25rem; line-height: 1.15; text-transform: uppercase; letter-spacing: 0.02em; }
.sc-mode { font-size: 0.8rem; color: var(--muted); }

.hole-progress {
    height: 5px; border-radius: 99px; overflow: hidden;
    background: var(--stone-200);
    margin-bottom: 1rem;
}
.hole-progress > i {
    display: block; height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, var(--pine-600), var(--brass-500));
    transition: width 0.45s var(--ease-out);
}

.hole-card {
    position: relative;
    background:
        radial-gradient(420px 200px at 100% 0%, rgba(233, 197, 104, 0.14), transparent 65%),
        linear-gradient(150deg, var(--pine-950), var(--pine-800));
    color: #fff; border-radius: var(--radius-lg);
    border: 1px solid rgba(233, 197, 104, 0.22);
    box-shadow: var(--shadow-dark);
    padding: 1.25rem 1.4rem;
    display: flex; align-items: center; gap: 1.5rem;
    margin-bottom: 1.1rem; overflow: hidden;
}
.hole-number { text-align: center; }
.hole-number .hn-label {
    font-family: var(--font-display);
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.22em;
    color: var(--accent-on-dark);
}
.hole-number .hn-value {
    font-family: var(--font-display);
    font-size: 3.4rem; font-weight: 700; line-height: 0.95;
    font-variant-numeric: tabular-nums;
}
.hole-facts { display: flex; gap: 0; }
.hole-fact { padding: 0 1.1rem; border-left: 1px solid rgba(255, 255, 255, 0.14); }
.hole-fact:first-child { border-left: none; padding-left: 0; }
.hole-fact .hf-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hole-fact .hf-label {
    font-family: var(--font-display);
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.16em;
    color: rgba(247, 245, 238, 0.6);
}

.score-row {
    display: flex; align-items: center; gap: 0.8rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-xs); padding: 0.75rem 0.95rem; margin-bottom: 0.6rem;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.score-row .sr-main { flex: 1; min-width: 0; }
.score-row .sr-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-row .sr-sub { font-size: 0.78rem; color: var(--muted); }
.score-row.me {
    border-color: rgba(46, 112, 80, 0.55);
    border-left: 4px solid var(--pine-600);
    background: linear-gradient(0deg, rgba(46, 112, 80, 0.05), rgba(46, 112, 80, 0.05)), var(--surface);
}

.stepper { display: flex; align-items: center; gap: 0.55rem; }
.stepper button {
    width: 44px; height: 44px; border-radius: 12px;
    border: 1.5px solid #cfe2d2; cursor: pointer; font-size: 1.35rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    background: var(--pine-50); color: var(--pine-800);
    touch-action: manipulation;
    transition: background var(--t-fast), transform var(--t-fast) var(--ease-spring), border-color var(--t-fast);
}
.stepper button:hover:not(:disabled) { background: var(--pine-100); border-color: #b9d4be; }
.stepper button:active:not(:disabled) { transform: scale(0.9); }
.stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
.stepper .stepper-value {
    min-width: 2.4rem; text-align: center;
    font-family: var(--font-display);
    font-size: 1.9rem; font-weight: 700; color: var(--pine-900);
    font-variant-numeric: tabular-nums;
}
.stepper .stepper-value.empty { color: var(--border-strong); }

.score-note { font-family: var(--font-display); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.score-note.birdie { color: var(--sky-700); }
.score-note.eagle { color: var(--brass-600); }
.score-note.bogey { color: #9a6414; }
.score-note.double { color: var(--danger); }
.score-note.par-note { color: var(--muted); }

.bbb-buttons { display: flex; gap: 0.4rem; }
.bbb-buttons button {
    border: 1.5px solid var(--border-strong); background: var(--surface); cursor: pointer;
    border-radius: 8px; padding: 0.45rem 0.7rem; min-height: 38px;
    font-family: var(--font-display); font-size: 0.82rem; font-weight: 600;
    letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
    touch-action: manipulation;
    transition: all var(--t-fast) var(--ease-out);
}
.bbb-buttons button:hover { border-color: var(--brass-500); color: var(--pine-900); }
.bbb-buttons button.on {
    background: linear-gradient(150deg, var(--brass-400), var(--brass-600));
    border-color: var(--brass-600); color: var(--pine-950);
    box-shadow: 0 2px 8px rgba(192, 126, 20, 0.35);
}

.sc-nav {
    position: sticky; bottom: 0.5rem;
    display: flex; gap: 0.6rem; margin-top: 1.1rem;
    z-index: 10;
}
@media (min-width: 768px) { .sc-nav { bottom: 1rem; } }
.sc-nav .btn { flex: 1; padding: 0.9rem 1rem; font-size: 1.02rem; }

.save-banner {
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--brass-100); border: 1px solid #ecdcae; border-left: 4px solid var(--brass-500);
    color: var(--brass-700);
    border-radius: var(--radius-sm); padding: 0.65rem 0.95rem; margin-bottom: 0.85rem; font-size: 0.9rem;
    animation: page-enter 0.3s var(--ease-out) both;
}
.save-banner .app-icon { width: 18px; height: 18px; flex-shrink: 0; }
.save-banner .btn { margin-left: auto; }

.mini-standings { margin-top: 1.2rem; }
.mini-standings .ms-row {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0.25rem; border-bottom: 1px solid var(--border); font-size: 0.92rem;
}
.mini-standings .ms-row:last-child { border-bottom: none; }
.mini-standings .ms-rank {
    width: 1.7rem; font-family: var(--font-display); font-weight: 700;
    color: var(--faint); font-variant-numeric: tabular-nums;
}
.mini-standings .ms-name { flex: 1; font-weight: 600; }
.mini-standings .ms-score { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--pine-900); font-variant-numeric: tabular-nums; }
.mini-standings .ms-detail { font-size: 0.77rem; color: var(--muted); }

/* ---------- Round summary / winner animation ---------- */

.winner-stage {
    position: relative; overflow: hidden;
    background:
        radial-gradient(560px 280px at 50% -10%, rgba(233, 197, 104, 0.20), transparent 65%),
        linear-gradient(155deg, var(--pine-950), var(--pine-800));
    border: 1px solid rgba(233, 197, 104, 0.25);
    border-radius: var(--radius-lg); color: #fff; text-align: center;
    padding: 2.5rem 1rem 2.1rem; margin-bottom: 1.3rem;
    box-shadow: var(--shadow-dark);
}
.winner-trophy {
    display: inline-flex; align-items: center; justify-content: center;
    width: 76px; height: 76px; border-radius: 50%;
    background: rgba(233, 197, 104, 0.12);
    border: 1px solid rgba(233, 197, 104, 0.4);
    color: var(--brass-300);
    filter: drop-shadow(0 6px 18px rgba(217, 166, 46, 0.4));
    animation: trophy-pop 0.9s var(--ease-spring) both;
}
.winner-trophy .app-icon { width: 38px; height: 38px; }
.winner-name {
    font-family: var(--font-display);
    font-size: 2.1rem; font-weight: 700; margin-top: 0.55rem;
    text-transform: uppercase; letter-spacing: 0.04em;
    animation: rise-in 0.7s 0.35s var(--ease-out) both;
}
.winner-label {
    font-family: var(--font-display);
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.3em; color: var(--brass-300);
    animation: rise-in 0.7s 0.55s var(--ease-out) both;
}
.winner-result { opacity: 0.85; font-size: 0.97rem; animation: rise-in 0.7s 0.7s var(--ease-out) both; }

@keyframes trophy-pop {
    0% { transform: scale(0) rotate(-25deg); opacity: 0; }
    70% { transform: scale(1.12) rotate(5deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes rise-in {
    from { transform: translateY(14px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.confetti { position: absolute; top: -16px; width: 9px; height: 15px; opacity: 0.9; border-radius: 2px; animation: confetti-fall linear infinite; }
@keyframes confetti-fall {
    0% { transform: translateY(-20px) rotate(0deg); }
    100% { transform: translateY(360px) rotate(660deg); }
}

.podium-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem 0.95rem; }
.podium-rank {
    font-family: var(--font-display); font-size: 1.15rem; font-weight: 700;
    width: 2.2rem; height: 2.2rem; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; font-variant-numeric: tabular-nums;
    background: var(--stone-200); color: var(--muted);
}
.podium-rank.medal-1 { background: linear-gradient(150deg, var(--brass-300), var(--brass-500)); color: var(--pine-950); box-shadow: 0 2px 8px rgba(192, 126, 20, 0.4); }
.podium-rank.medal-2 { background: linear-gradient(150deg, #e8e8e8, #b9bdc1); color: #3d4348; }
.podium-rank.medal-3 { background: linear-gradient(150deg, #dda87a, #b3763f); color: #3d2814; }

.summary-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.summary-table th, .summary-table td { padding: 0.45rem 0.35rem; text-align: center; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.summary-table th {
    font-family: var(--font-display);
    color: var(--faint); font-size: 0.74rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.1em;
}
.summary-table tr:hover td { background: var(--stone-50); }
.summary-table td:first-child, .summary-table th:first-child { text-align: left; }
.summary-scroll { overflow-x: auto; border-radius: var(--radius-sm); }

/* classic golf notation: circles under par, squares over par */
.score-mark {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; height: 24px; padding: 0 2px;
    font-variant-numeric: tabular-nums;
}
.score-mark.mark-birdie {
    border-radius: 50%;
    box-shadow: 0 0 0 1.5px var(--sky-700);
    color: var(--sky-700); font-weight: 700;
}
.score-mark.mark-eagle {
    border-radius: 50%;
    box-shadow: 0 0 0 1.5px var(--brass-600);
    outline: 1.5px solid var(--brass-600); outline-offset: 2.5px;
    color: var(--brass-600); font-weight: 700;
}
.score-mark.mark-bogey {
    border-radius: 4px;
    box-shadow: 0 0 0 1.5px #b3915c;
    color: #9a6414;
}
.score-mark.mark-double {
    border-radius: 4px;
    box-shadow: 0 0 0 1.5px var(--red-600);
    outline: 1.5px solid var(--red-600); outline-offset: 2.5px;
    color: var(--red-600); font-weight: 600;
}

.score-legend {
    display: flex; flex-wrap: wrap; gap: 0.9rem;
    margin-top: 0.8rem; padding-top: 0.7rem;
    border-top: 1px solid var(--border);
    font-size: 0.78rem; color: var(--muted);
}
.score-legend .legend-item { display: inline-flex; align-items: center; gap: 0.45rem; }
.score-legend .score-mark { min-width: 18px; height: 18px; font-size: 0.7rem; }

/* ---------- Profile ---------- */

.verify-box { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.hcp-display {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    width: 96px; height: 96px; border-radius: 50%;
    background:
        radial-gradient(80px 50px at 70% 10%, rgba(233, 197, 104, 0.2), transparent 70%),
        linear-gradient(150deg, var(--pine-800), var(--pine-950));
    border: 1px solid rgba(233, 197, 104, 0.3);
    color: #fff; flex-shrink: 0;
    box-shadow: var(--shadow-dark);
}
.hcp-display .hcp-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.hcp-display .hcp-label {
    font-family: var(--font-display);
    font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.16em;
    color: var(--accent-on-dark);
}

/* ---------- Misc ---------- */

.tab-row {
    display: inline-flex; gap: 0.25rem; margin-bottom: 1.1rem; flex-wrap: wrap;
    background: var(--stone-200); border-radius: 12px; padding: 0.3rem;
}
.tab-row button {
    display: inline-flex; align-items: center; gap: 0.4rem;
    border: none; background: transparent; color: var(--muted); cursor: pointer;
    padding: 0.5rem 1.05rem; min-height: 40px; border-radius: 9px;
    font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
    letter-spacing: 0.05em; text-transform: uppercase;
    touch-action: manipulation;
    transition: background var(--t-fast) var(--ease-out), color var(--t-fast), box-shadow var(--t-fast);
}
.tab-row button:hover:not(.active) { color: var(--fg); }
.tab-row button.active {
    background: var(--surface);
    color: var(--pine-900);
    box-shadow: 0 1px 3px rgba(12, 35, 26, 0.14);
}
.tab-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px;
    background: var(--pine-600); color: #fff;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}
.tab-row button:not(.active) .tab-count { background: var(--faint); }

.inline-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.loading-note { color: var(--muted); padding: 1.6rem 0; text-align: center; }
.spinner {
    display: inline-block; width: 22px; height: 22px; border-radius: 50%;
    border: 3px solid var(--pine-100); border-top-color: var(--pine-600);
    animation: spin 0.7s linear infinite; vertical-align: middle; margin-right: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}

/* ---------- Blazor framework UI ---------- */

.valid.modified:not([type=checkbox]) { outline: none; }

#blazor-error-ui {
    color-scheme: light only;
    background: var(--brass-100);
    border-top: 1px solid #ecdcae;
    color: var(--brass-700);
    bottom: 0;
    box-shadow: 0 -4px 18px rgba(12, 35, 26, 0.12);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.blazor-error-boundary {
    background: var(--red-700);
    padding: 1rem;
    color: white;
    border-radius: var(--radius-sm);
}
.blazor-error-boundary::after { content: "An error has occurred."; }
