/* -----------------------------------------------------------------------------
   Base styles — deliberately simple. Mobile-first: it looks fine on a phone
   and scales up. We'll build this out as the app grows.
----------------------------------------------------------------------------- */

:root {
    /* ---- LeagueWaves brand palette (from the brand style guide) ---------- */
    --ink: #0E1B2A;          /* primary text */
    --slate: #44566B;        /* secondary text */
    --muted: #7C8C9E;        /* tertiary / hints */
    --cloud: #F4F8FC;        /* app background */
    --line: #E4EBF2;         /* hairlines / borders */
    --white: #FFFFFF;

    --blue: #1E7FE0;         /* Wave Blue — primary */
    --blue-dark: #145CAB;
    --blue-tint: #E9F2FD;

    --green: #1FC08A;        /* Court Green — secondary */
    --green-dark: #0E9E6E;
    --green-tint: #E3F7F0;

    --coral: #FF6B5E;        /* Signal — use sparingly */

    --radius: 14px;
    --shadow: 0 10px 30px rgba(20,60,110,.08);
    --shadow-sm: 0 4px 14px rgba(20,60,110,.07);

    /* ---- Back-compat aliases: existing rules reference these names, so we
       point them at the brand palette rather than rewriting every selector. */
    --navy: #0E1B2A;         /* headings/brand ink (was #1f3a5f) */
    --bg: #F4F8FC;           /* = cloud */
    --ok: #0E9E6E;           /* = green-dark */
    --bad: #D64535;          /* readable error red */
    --border: #E4EBF2;       /* = line */
    --surface: #FFFFFF;
    --surface-2: #F4F8FC;    /* = cloud */
    --accent: var(--blue);
}

* { box-sizing: border-box; }

/* Form controls don't inherit font-family by default across browsers — make
   inputs, selects, textareas, and buttons use the brand font (Inter). Note:
   the *open* list of a native <select> is drawn by the OS and can't be
   restyled; this governs the closed control and everything else. */
input, select, textarea, button { font-family: inherit; }

body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1100px 500px at 85% -10%, rgba(30,127,224,.06), transparent 60%),
        radial-gradient(900px 480px at -5% 8%, rgba(31,192,138,.07), transparent 55%),
        var(--cloud);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%; /* stop mobile browsers from auto-resizing text */
}

/* Pin the background wash only on desktop-class pointers. iOS Safari mishandles
   background-attachment:fixed (repaint jank / sometimes ignored), so we don't
   ask touch devices to do it — they get the same gradient, just scrolling. */
@media (hover: hover) and (pointer: fine) {
    body { background-attachment: fixed; }
}

.wrap {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    /* env() insets are 0 in normal browsers; in a wrapped app (viewport-fit=cover)
       they keep content clear of the rounded corners / notch in landscape. */
    padding: 0 calc(1rem + env(safe-area-inset-right, 0px)) 0 calc(1rem + env(safe-area-inset-left, 0px));
}

/* Header / footer */
.site-header {
    background: var(--white);
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    /* Wrapped-app: content renders under a translucent status bar, so pad the
       header down past the notch/clock. Zero in a normal browser. */
    padding-top: env(safe-area-inset-top, 0px);
}
.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: .8rem;
    padding-bottom: .8rem;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }
.brand-mark { display: block; flex: none; }
.brand-name { color: var(--ink); font-weight: 800; letter-spacing: -.02em; font-size: 1.45rem; }
.brand-name .wv { color: var(--blue); }
.site-header nav a { color: var(--slate); text-decoration: none; margin-left: 1rem; font-weight: 500; }
.site-header nav a:hover { color: var(--blue-dark); }

.site-footer {
    margin-top: 3rem;
    /* Extra bottom padding clears the home-indicator in a wrapped app. */
    padding: 1.5rem 0 calc(1.5rem + env(safe-area-inset-bottom, 0px));
    color: var(--muted);
    border-top: 1px solid var(--line);
}

/* Cards */
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-top: 1.75rem;
    box-shadow: var(--shadow-sm);
}
h1 { color: var(--ink); margin-top: 0; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
h2 { letter-spacing: -.01em; }
.lead { font-size: 1.1rem; color: var(--slate); }

/* Fraunces display face — hero moments only (welcome, dashboard hero). */
.display { font-family: "Fraunces", Georgia, "Times New Roman", serif; font-weight: 700; letter-spacing: -.01em; }

/* Buttons */
.btn {
    display: inline-block;
    background: var(--blue);
    color: #fff;
    text-decoration: none;
    padding: .6rem 1.15rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(30,127,224,.24);
    transition: background .12s ease, box-shadow .12s ease, transform .12s ease;
}
.btn:hover { background: var(--blue-dark); }
.btn:active { transform: translateY(1px); }

.btn-secondary {
    display: inline-block;
    color: var(--blue-dark);
    background: var(--blue-tint);
    text-decoration: none;
    padding: .6rem 1.15rem;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 600;
    transition: background .12s ease;
}
.btn-secondary:hover { background: #dceafb; }
.home-cta { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

/* Health table */
table.health { border-collapse: collapse; width: 100%; margin-top: 1rem; }
table.health th, table.health td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); }
table.health .ok { color: var(--ok); font-weight: 600; }
table.health .bad { color: var(--bad); font-weight: 600; }

/* ---- Forms ---------------------------------------------------------------- */
.auth-card { max-width: 520px; margin-left: auto; margin-right: auto; }

/* Branded heading for auth screens (login / register / forgot / reset). */
.auth-head { text-align: center; margin-bottom: 1.5rem; }
.auth-head h1 { margin: .1rem 0 .35rem; }
.auth-head .lead { margin: 0 auto; max-width: 40ch; }
.auth-mark { margin: 0 auto .85rem; width: 56px; height: 56px; border-radius: 16px;
             background: linear-gradient(150deg, var(--blue), var(--blue-dark));
             display: grid; place-items: center; box-shadow: 0 10px 22px rgba(30,127,224,.26); }

.form-group { margin-bottom: 1rem; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .95rem; }
label .muted { font-weight: 400; color: var(--muted); }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"] {
    width: 100%;
    padding: .6rem .7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
}
input:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }

.hint { color: var(--muted); font-size: .85rem; margin: .3rem 0 0; }
.field-error { color: var(--bad); font-size: .85rem; margin: .3rem 0 0; }

.btn-block { display: block; width: 100%; text-align: center; border: 0; cursor: pointer; font-size: 1rem; }

.auth-alt { margin-top: 1.25rem; color: var(--muted); }

/* ---- Alerts -------------------------------------------------------------- */
.alert { padding: .75rem 1rem; border-radius: 12px; margin-bottom: 1.25rem; font-weight: 500;
    transition: opacity .5s ease, max-height .5s ease, margin .5s ease, padding .5s ease; overflow: hidden; }
.alert-success { background: var(--green-tint); color: var(--green-dark); border: 1px solid #cfeee2; }
.alert-error { background: #fbe9e7; color: var(--bad); border: 1px solid #f2c4bf; }
/* Auto-dismiss: JS adds .is-dismissed after a few seconds; it fades and collapses. */
.alert.is-dismissed { opacity: 0; max-height: 0 !important; margin-bottom: 0; padding-top: 0; padding-bottom: 0; border-color: transparent; }

/* ---- Logout button styled as a nav link --------------------------------- */
.nav-logout { display: inline; margin: 0 0 0 1rem; }
.nav-logout button {
    background: none; border: 0; color: var(--slate); cursor: pointer;
    font: inherit; font-weight: 500; padding: 0;
}
.nav-logout button:hover { color: var(--blue-dark); text-decoration: underline; }

/* Small screens: stack the two-column name row. */
@media (max-width: 520px) {
    .form-row { flex-direction: column; gap: 0; }
}

/* Selects match text inputs */
select {
    width: 100%;
    padding: .55rem .6rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
}
select:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }

/* ---- League bar (secondary nav) ----------------------------------------- */
.league-bar { background: #fff; border-bottom: 1px solid var(--line); }
.league-bar .wrap { display: flex; align-items: center; gap: 1.25rem; padding: .55rem 1rem; flex-wrap: wrap; }
.league-name { font-weight: 700; color: var(--navy); font-size: 1.1rem; }
.league-nav a { color: var(--slate, #44546a); text-decoration: none; margin-right: 1rem; font-size: .95rem; }
.league-nav a:hover { color: var(--blue); }

/* ---- Card header row ----------------------------------------------------- */
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.card-head h1 { margin: 0; }
.section-title { color: var(--navy); font-size: 1.15rem; margin: 1.75rem 0 .6rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.muted { color: var(--muted); }

/* ---- Data tables --------------------------------------------------------- */
table.data { border-collapse: collapse; width: 100%; margin-top: .75rem; }
table.data th, table.data td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.data td.right, table.data th.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---- Badges -------------------------------------------------------------- */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--bg); color: var(--slate, #44546a); border: 1px solid var(--line); }
.badge.role-owner { background: #eaf1fb; color: var(--navy); border-color: #cfe0f0; }
.badge.role-admin { background: #eef6ff; color: var(--blue); border-color: #cfe0f0; }
/* "Next" pill on the setup checklist — the active step to work on. */
.badge-next { background: var(--blue); color: #fff; border-color: var(--blue); text-transform: uppercase; letter-spacing: .04em; font-size: .68rem; }

/* ---- Stat tiles ---------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .8rem; margin: 1rem 0; }
.tile { display: flex; flex-direction: column; align-items: center; padding: 1.1rem .5rem; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; background: #fff; }
.tile:hover { border-color: var(--blue); }
.tile-num { font-size: 1.8rem; font-weight: 700; color: var(--navy); }
.tile-label { color: var(--muted); font-size: .9rem; }

/* ---- Inline "link" buttons + row forms ---------------------------------- */
.link { background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; font: inherit; text-decoration: none; margin-left: .75rem; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--bad); }
form.inline { display: inline; }
.row-form { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.row-form select, .row-form input { width: auto; flex: 1; min-width: 160px; }
.row-form .short { flex: 0 0 110px; min-width: 0; }
.row-form .btn { flex: 0 0 auto; }
.form-group.check label { font-weight: 400; }
.form-group.check input { width: auto; margin-right: .4rem; }

/* Password requirements list under the password field */
ul.req { margin: .4rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .85rem; }
ul.req li { margin: .1rem 0; }

/* -------------------------------------------------------------------------
   Mobile / small screens. Families will mostly use this on a phone, so the
   layout collapses to a single, comfortable column with big tap targets.
   ------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .wrap { padding-left: calc(.85rem + env(safe-area-inset-left, 0px)); padding-right: calc(.85rem + env(safe-area-inset-right, 0px)); }
    .card { padding: 1.15rem; border-radius: 10px; margin-top: 1rem; }
    h1 { font-size: 1.5rem; }

    /* Welcome hero: tighter on a phone so the CTA is above the fold. */
    .welcome { gap: 1.5rem; }
    .welcome-hero { padding: 2.25rem 1.25rem 2rem; border-radius: 20px; }
    .welcome-hero h1 { font-size: 1.65rem; }
    .welcome-sub { font-size: 1.02rem; }
    .btn-lg { width: 100%; text-align: center; }
    .auth-mark, .welcome-mark { width: 52px; height: 52px; }

    /* Card header (title + action button) stacks; button goes full width */
    .card-head { flex-direction: column; align-items: stretch; gap: .6rem; }
    .card-head .btn, .card-head .btn-secondary { width: 100%; text-align: center; }

    /* Top bar and league bar wrap instead of overflowing */
    .site-header .wrap { flex-wrap: wrap; gap: .4rem .75rem; }
    .league-bar .wrap { gap: .4rem .9rem; }
    .league-nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; width: 100%; }
    .league-nav a { margin-right: 0; }

    /* Wide tables scroll sideways rather than breaking the page */
    table.data { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Inline row-forms (invite, add player) stack to full-width controls */
    .row-form { flex-direction: column; align-items: stretch; }
    .row-form select,
    .row-form input,
    .row-form .btn,
    .row-form .short { width: 100%; flex: none; min-width: 0; }

    .tiles { grid-template-columns: repeat(2, 1fr); }

    .home-cta { flex-direction: column; align-items: stretch; }
    .home-cta .btn, .home-cta .btn-secondary { width: 100%; text-align: center; }
}

/* Comfortable tap targets on touch devices */
@media (pointer: coarse) {
    .btn, .btn-secondary, button, select, input[type="text"], input[type="email"],
    input[type="tel"], input[type="password"], input[type="date"] { min-height: 44px; }
    .link { display: inline-block; padding: .35rem 0; }
}

/* Footer row with language switcher */
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.lang-switch { margin: 0; }
.lang-switch select { width: auto; padding: .3rem .5rem; font-size: .85rem; min-height: 0; }

/* -----------------------------------------------------------------------------
   Schedule / fields UI
----------------------------------------------------------------------------- */
.card.wide { max-width: 640px; }

.alert-warn { background: #fff6e6; color: #8a5a00; border: 1px solid #f2dca6; }
.alert-warn ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.alert-warn li { margin: .15rem 0; }

/* Badges */
.badge-ok { background: #e6f4ec; color: var(--ok); border-color: #bfe0cd; }
.badge-warn { background: #fff6e6; color: #8a5a00; border-color: #f2dca6; }
.badge-type { border: 0; color: #fff; }
.badge-type.type-game { background: var(--navy); }
.badge-type.type-practice { background: var(--blue); }
.badge-type.type-event { background: #6b7683; }
.badge-rsvp { border: 0; color: #fff; }
.rsvp-yes { background: var(--ok); }
.rsvp-no { background: var(--bad); }
.rsvp-maybe { background: #b8860b; }

/* Tabs (upcoming / past) */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: .5rem 0 1rem; }
.tab { padding: .5rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tab.active { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }

/* Detail list on the event page */
.detail { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
.detail dt { color: var(--muted); font-weight: 600; }
.detail dd { margin: 0; }
.inline-h1 { display: inline; font-size: 1.5rem; margin: 0 .35rem; }

/* RSVP */
.btn-light { background: var(--bg); color: var(--navy); border: 1px solid var(--line); }
.btn-light:hover { background: #eaf1fb; }
.rsvp-buttons { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.btn.rsvp { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.btn.rsvp.btn-yes.chosen { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.rsvp.btn-no.chosen { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.rsvp.btn-maybe.chosen { background: #b8860b; color: #fff; border-color: #b8860b; }
.rsvp-counts { margin-top: .5rem; }
.rsvp-list { list-style: none; padding: 0; margin: .5rem 0 0; }
.rsvp-list li { padding: .3rem 0; border-top: 1px solid var(--line); }

@media (max-width: 640px) {
    .detail { grid-template-columns: 1fr; gap: .1rem .5rem; }
    .detail dd { margin-bottom: .5rem; }
    .rsvp-buttons .btn { flex: 1; }
}

/* Inline checkbox inside a row-form (e.g. "Primary" guardian) */
.inline-check { display: inline-flex; align-items: center; gap: .35rem; font-weight: 400; white-space: nowrap; }
.inline-check input { width: auto; margin: 0; }

/* Optional sub-form (e.g. "add a parent now" on the create-player screen) */
.subform { border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem 1rem; margin: 1rem 0; }
.subform legend { font-weight: 600; padding: 0 .4rem; color: var(--navy); }

/* Inferred siblings line on the player page */
.siblings-line { margin: .25rem 0 1rem; }
.siblings-line .muted { font-size: .85rem; margin-left: .35rem; }

/* -----------------------------------------------------------------------------
   Messaging
----------------------------------------------------------------------------- */
.nav-badge { display: inline-block; min-width: 1.1rem; padding: 0 .35rem; border-radius: 999px;
    background: var(--bad); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.3rem; }

.msg-list { list-style: none; padding: 0; margin: .5rem 0 0; }
.msg-list li { border-top: 1px solid var(--line); }
.msg-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name time" "preview preview";
    gap: .1rem .5rem; padding: .7rem .2rem; text-decoration: none; color: var(--ink); }
.msg-row:hover { background: var(--bg); }
.msg-name { grid-area: name; font-weight: 600; color: var(--navy); }
.msg-time { grid-area: time; font-size: .8rem; white-space: nowrap; }
.msg-preview { grid-area: preview; color: var(--muted); font-size: .9rem; }
.msg-row.unread .msg-name { font-weight: 700; }
.msg-row.unread .msg-preview { color: var(--ink); }

.thread { display: flex; flex-direction: column; gap: .5rem; margin: .5rem 0 1rem; }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble-row.theirs { justify-content: flex-start; }
.bubble { max-width: 78%; padding: .5rem .75rem; border-radius: 12px; border: 1px solid var(--line); }
.bubble-row.mine .bubble { background: #eaf1fb; border-color: #cfe0f0; }
.bubble-row.theirs .bubble { background: #fff; }
.bubble-who { font-size: .78rem; font-weight: 600; margin-bottom: .15rem; }
.bubble-body { white-space: normal; word-wrap: break-word; overflow-wrap: anywhere; }
.bubble-meta { font-size: .72rem; margin-top: .25rem; }

.reply-form textarea { width: 100%; }
.reply-form .btn { margin-top: .5rem; }
.report-box summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.report-box[open] summary { margin-bottom: .5rem; }
.thread.readonly { pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Small muted text (e.g. head-coach line under a team name) */
.small { font-size: .82rem; }

/* -----------------------------------------------------------------------------
   People picker (type-to-search dropdown enhancement)
----------------------------------------------------------------------------- */
.pp { position: relative; display: inline-block; min-width: 220px; }
.row-form .pp { flex: 1; min-width: 180px; }
.pp-input { width: 100%; }
select.pp-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pp-list { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 2px;
    background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(31,58,95,.12);
    max-height: 260px; overflow-y: auto; }
.pp-item { padding: .5rem .7rem; cursor: pointer; font-size: .92rem; }
.pp-item:hover, .pp-item.active { background: #eaf1fb; }
.pp-input.pp-err { border-color: var(--bad); }
@media (max-width: 640px) { .pp, .row-form .pp { width: 100%; min-width: 0; display: block; } }

/* People-picker: "no match" hint + inline error */
.pp-empty { padding: .5rem .7rem; color: var(--muted); font-size: .88rem; }
.pp-msg { margin: .35rem 0 0; }

/* Staff room: sender name above others' bubbles, and the pinned inbox row. */
.bubble-sender { font-size: .78rem; font-weight: 600; color: #4b5563; margin-bottom: .15rem; }
.msg-row.pinned { background: #f8fafc; border-left: 3px solid #2563eb; }

/* CSV import wizard */
.import-steps { margin: .5rem 0 1rem 1.1rem; line-height: 1.7; }
.table-scroll { overflow-x: auto; }
.import-confirm { margin-top: 1rem; display: flex; align-items: center; gap: 1rem; }
.pill { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.pill-ok   { background: #dcfce7; color: #166534; }
.pill-warn { background: #fef9c3; color: #854d0e; }
.pill-err  { background: #fee2e2; color: #991b1b; }
tr.row-error td   { background: #fef2f2; }
tr.row-duplicate td { background: #fffbeb; }

/* Import "good to know" callout */
.import-note { background: #eff6ff; border-left: 3px solid #2563eb; padding: .55rem .8rem; border-radius: 4px; font-size: .9rem; color: #1e3a5f; margin: .5rem 0 1rem; }

/* Roster-builder division tabs (buttons) + inline checkbox groups */
.tabs button.tab { background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font: inherit; }
.tabs button.tab.active { border-bottom-color: var(--navy); }
.checkbox-row { display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.checkbox-inline { display: inline-flex; align-items: center; gap: .35rem; font-weight: normal; }
.allergy-note { color: #8a5a00; }

/* Global "apply all divisions" bar on the roster builder. */
.apply-all-bar { margin: 0 0 1rem; padding: .75rem 1rem; background: var(--surface-2, #f6f8fa); border: 1px solid var(--border, #e2e6ea); border-radius: 8px; }
.apply-all-bar p { margin: 0 0 .5rem; }

/* Team roster actions: keep the "Move to…" picker compact so Move/Remove sit
   right beside the player instead of being pushed to the far right. */
.move-form { display: inline-flex; align-items: center; gap: .4rem; margin-right: .75rem; }
.move-form select { width: auto; min-width: 120px; max-width: 220px; }
@media (max-width: 640px) {
    /* On narrow screens let the row stack rather than overflow. */
    .move-form { display: flex; margin: 0 0 .4rem; }
    .move-form select { flex: 1; max-width: none; }
}

/* Instant list-search box at the top of long list pages. */
.list-search { margin: 0 0 1rem; display: flex; align-items: center; gap: .6rem; }
.list-search .list-filter { width: 100%; max-width: 22rem; }
.list-search .muted { white-space: nowrap; }
.filter-empty { padding: .75rem .25rem; color: var(--muted, #667); }

/* Field-availability weekly windows shown as compact chips. */
.chip { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .5rem; margin: 0 .3rem .3rem 0; background: var(--surface-2, #eef2f6); border: 1px solid var(--border, #dde3e8); border-radius: 999px; font-size: .85rem; white-space: nowrap; }
.chip .link.danger { padding: 0 .1rem; line-height: 1; font-size: 1rem; }

/* Practice generator: labeled inline inputs, callouts, and slot lines. */
.row-form label.stack { display: flex; flex-direction: column; gap: .2rem; }
.row-form label.stack .lbl { font-size: .8rem; color: var(--muted, #5d7286); font-weight: 600; }
.callout { border-left: 4px solid var(--border, #dde3e8); background: var(--surface-2, #f6f8fa); padding: .55rem .8rem; border-radius: 6px; margin: .6rem 0; }
.callout .h { font-weight: 700; display: block; margin-bottom: .1rem; }
.callout.warn { border-color: #d9a441; background: #fff6e6; }
.callout.bad  { border-color: #cf6b6b; background: #fbe9e9; }
.slotline { display: inline-block; margin: .1rem 0; }
.no { color: var(--bad, #b23b3b); font-weight: 600; }

/* Schedule views: controls, grouping, day headers, print. */
.schedule-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: .5rem 0 1rem; }
.schedule-controls .lbl { font-size: .8rem; color: var(--muted, #5d7286); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--border, #dde3e8); border-radius: 8px; overflow: hidden; }
.seg .segbtn { padding: .4rem .8rem; font-size: .88rem; text-decoration: none; color: var(--ink, #17324a); background: #fff; }
.seg .segbtn.on { background: var(--blue, #2f6fb0); color: #fff; font-weight: 600; }
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chips .chip { border: 1px solid var(--border, #dde3e8); background: #fff; border-radius: 999px; padding: .25rem .6rem; font-size: .82rem; text-decoration: none; color: var(--ink, #17324a); }
.chips .chip.on { background: var(--surface-2, #eaf2fb); border-color: #cfe0f4; color: var(--blue, #2f6fb0); font-weight: 600; }
.sched-group { margin: .5rem 0 1rem; }
.sched-group > summary { cursor: pointer; font-size: 1.05rem; padding: .3rem 0; }
.dayhead { margin-top: 1.1rem; }
.team-subhead { margin: .8rem 0 .2rem; color: var(--blue, #2f6fb0); font-size: 1rem; }
.team-pick { margin: 0 0 1rem; }
@media print {
    .noprint, .league-nav, header, footer, nav { display: none !important; }
    .schedule-page { border: 0; box-shadow: none; padding: 0; }
    .sched-group > summary { list-style: none; }
    a.link { color: inherit; text-decoration: none; }
}

/* ---- Scores & standings ------------------------------------------------- */
.head-actions { display: inline-flex; gap: .5rem; flex-wrap: wrap; }
hr.soft { border: 0; border-top: 1px solid var(--line, #e5e9ee); margin: 1.5rem 0; }
.radio-row { display: block; padding: .3rem 0; }
.mt-2 { margin-top: 1rem; }
.score-line strong { font-size: 1.15rem; }
.score-entry { display: flex; align-items: flex-end; gap: .75rem; margin: 1rem 0; }
.score-entry .form-group { margin: 0; flex: 1; }
.score-entry .short { width: 100%; text-align: center; font-size: 1.25rem; }
.score-dash { padding-bottom: .7rem; font-size: 1.25rem; color: var(--muted); }
.btn-danger-light { background: #fff; color: #b3261e; border: 1px solid #e6b4b0; }
.btn-danger-light:hover { background: #fdf0ef; }
table.data.standings td, table.data.standings th { padding: .5rem .45rem; }
table.data.standings tbody tr:first-child { background: #f4f9f4; }

/* ---- Schedule bulk-select ---------------------------------------------- */
table.data th.chkcol, table.data td.chkcol { width: 1%; white-space: nowrap; text-align: center; }
.chk-inline { display: inline-flex; align-items: center; gap: .4rem; }

/* ---- Notifications ------------------------------------------------------ */
.notif-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.notif { display: flex; gap: .6rem; padding: .8rem .2rem; border-bottom: 1px solid var(--line, #e5e9ee); }
.notif.is-unread { background: #f4f9ff; }
.notif-dot { flex: 0 0 auto; width: .5rem; height: .5rem; margin-top: .5rem; border-radius: 50%; background: var(--blue, #2f6fb0); }
.notif.is-unread .notif-main { margin-left: 0; }
.notif:not(.is-unread) .notif-main { margin-left: 1.1rem; }
.notif-body { white-space: pre-line; margin-top: .15rem; }
.notif-when { margin-top: .25rem; }
.notify-box { border: 1px solid var(--line, #e5e9ee); border-radius: 8px; padding: .8rem; }

/* ---- Legal documents --------------------------------------------------- */
.legal-doc { max-width: 780px; }
.legal-doc h2 { margin-top: 1.4rem; font-size: 1.1rem; }
.legal-doc p { line-height: 1.6; }

/* ---- Guided setup checklist -------------------------------------------- */
.setup-guide { border-left: 4px solid var(--blue, #2f6fb0); }
.progressbar { height: 8px; background: #e8eef4; border-radius: 999px; overflow: hidden; margin: .25rem 0 .75rem; }
.progressbar > span { display: block; height: 100%; background: var(--blue, #2f6fb0); border-radius: 999px; transition: width .3s; }
.setup-steps { list-style: none; margin: .5rem 0 0; padding: 0; }
.setup-step { display: flex; align-items: flex-start; gap: .7rem; padding: .8rem .4rem; border-bottom: 1px solid var(--line, #e5e9ee); }
.setup-step .setup-main { flex: 1; }
.setup-step-title { display: flex; align-items: center; gap: .5rem; }
.setup-mark { flex: 0 0 auto; width: 1.5rem; height: 1.5rem; line-height: 1.5rem; text-align: center; border-radius: 50%; font-weight: 700; }
.setup-mark.m-done { background: #e6f4ea; color: #1e7d3c; }
.setup-mark.m-partial { background: #fff4e0; color: #a9640a; }
.setup-mark.m-todo { background: #eef1f4; color: #8a97a3; }
.setup-step.is-next { background: #f4f9ff; border-radius: 8px; }
.setup-step .btn-secondary { flex: 0 0 auto; align-self: center; }
.setup-launch { margin-top: 1rem; }

/* ---- Field availability speed-ups -------------------------------------- */
.avail-presets { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .25rem 0 .5rem; }
.chip-btn { border: 1px solid var(--border, #dde3e8); background: #fff; border-radius: 999px; padding: .3rem .7rem; font-size: .85rem; cursor: pointer; }
.chip-btn:hover { background: #f4f9ff; border-color: var(--blue, #2f6fb0); }
.weekday-picker { display: flex; flex-wrap: wrap; gap: .4rem; border: 0; padding: 0; margin: 0 0 .5rem; }
.wd-chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--border, #dde3e8); border-radius: 8px; padding: .25rem .55rem; font-size: .9rem; }
.avail-copy { margin-top: .6rem; align-items: center; gap: .5rem; }

/* ---- First-run setup wizard -------------------------------------------- */
.wizard-stepper { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: .5rem 0 1rem; }
.wizard-stepper .wstep a { display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; color: var(--ink, #17324a); border: 1px solid var(--border, #dde3e8); border-radius: 999px; padding: .25rem .6rem; font-size: .85rem; }
.wizard-stepper .wstep.is-current a { border-color: var(--blue, #2f6fb0); background: #f4f9ff; font-weight: 600; }
.wstep-mark { width: 1.2rem; height: 1.2rem; line-height: 1.2rem; text-align: center; border-radius: 50%; font-size: .8rem; }
.wstep-mark.m-done { background: #e6f4ea; color: #1e7d3c; }
.wstep-mark.m-partial { background: #fff4e0; color: #a9640a; }
.wstep-mark.m-todo { background: #eef1f4; color: #8a97a3; }
.wizard-body { max-width: 640px; }
.wizard-body h2 { margin: .2rem 0 .4rem; }
.wizard-cta { margin: 1rem 0; }
.wizard-nav { display: flex; justify-content: space-between; margin-top: .5rem; }
.wizard-golive { margin-top: 1rem; }
.callout.ok { background: #e6f4ea; border-radius: 8px; padding: .5rem .7rem; }

/* ===== Dashboard (redesign) ============================================== */
.dash { display: flex; flex-direction: column; gap: 1rem; }
.dash-head { align-items: flex-start; }
.dash-hero-cta { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.dash-tools { margin-top: .25rem; }
.dash-hero h1 { margin-top: 0; }

/* Health stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .75rem; }
.stat { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.1rem; background: var(--surface);
        border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
        text-decoration: none; color: var(--ink); transition: border-color .12s ease, transform .12s ease; }
.stat:hover { border-color: var(--accent); transform: translateY(-1px); }
.stat-num { font-size: 1.9rem; font-weight: 700; line-height: 1; color: var(--navy); }
.stat-label { font-size: .85rem; color: var(--muted); }

/* Two-column panels (needs attention / coming up) */
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 720px) { .dash-cols { grid-template-columns: 1fr; } }
.panel { margin: 0; }

.attn-list, .coming-list { list-style: none; margin: .35rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.attn-item { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); padding: .45rem .55rem; border-radius: 8px; }
.attn-item:hover { background: #f4f9ff; }
.attn-count { min-width: 1.7rem; height: 1.7rem; display: inline-flex; align-items: center; justify-content: center;
              background: var(--navy); color: #fff; border-radius: 999px; font-size: .85rem; font-weight: 700; padding: 0 .4rem; }
.all-clear { color: var(--ok); margin: .4rem 0; }

.coming-list li { display: flex; gap: .6rem; align-items: baseline; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.coming-list li:last-child { border-bottom: 0; }
.coming-when { min-width: 5.5rem; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.coming-what { font-weight: 600; }

/* ===== First-run welcome (leagues empty state) ========================== */
.welcome { max-width: 800px; margin: 1.5rem auto; display: flex; flex-direction: column; gap: 2.25rem; }
.welcome-hero { text-align: center; background: var(--white); border: 1px solid var(--line); border-radius: 26px;
                box-shadow: var(--shadow); padding: 3.25rem 2rem 2.85rem;
                background-image: linear-gradient(160deg, #ffffff 0%, #f7fbff 100%); }
.welcome-mark { margin: 0 auto .9rem; width: 66px; height: 66px; border-radius: 20px;
                background: linear-gradient(150deg, var(--blue), var(--blue-dark));
                display: grid; place-items: center; box-shadow: 0 12px 26px rgba(30,127,224,.28); }
.welcome-hero h1 { font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: 2.2rem; line-height: 1.12;
                   letter-spacing: -.01em; margin: .15rem 0 .55rem; color: var(--ink); }
.welcome-sub { color: var(--slate); font-size: 1.12rem; max-width: 47ch; margin: 0 auto 1.5rem; }
.btn-lg { font-size: 1.05rem; padding: .85rem 1.7rem; }
.welcome-hint { margin-top: .9rem; }

.welcome-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
@media (max-width: 720px) { .welcome-steps { grid-template-columns: 1fr; } }
.welcome-steps li { display: flex; gap: .85rem; align-items: flex-start; background: var(--white);
                    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.25rem; }
.welcome-steps li div { display: flex; flex-direction: column; gap: .2rem; }
.welcome-steps li strong { font-weight: 700; letter-spacing: -.01em; }
.ws-num { flex: none; width: 2.1rem; height: 2.1rem; border-radius: 10px; background: var(--blue-tint);
          color: var(--blue); font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: 1rem;
          display: grid; place-items: center; }

/* ===== League Profile ==================================================== */
/* Logo / monogram next to the league name in the league bar. */
.league-id { display: inline-flex; align-items: center; gap: .55rem; }
.league-logo { width: 32px; height: 32px; border-radius: 8px; flex: none; }
img.league-logo { object-fit: contain; background: #fff; border: 1px solid var(--line); }
.league-logo-mono { display: inline-grid; place-items: center; background: var(--blue-tint);
    color: var(--blue-dark); font-weight: 800; font-size: .9rem; letter-spacing: .02em; }

/* Profile edit form: logo picker, socials, monogram fallback. */
.logo-row { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.logo-box { width: 96px; height: 96px; border: 1px solid var(--line); border-radius: var(--radius);
    background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; }
.logo-monogram { width: 100%; height: 100%; display: grid; place-items: center; background: var(--blue-tint);
    color: var(--blue-dark); font-weight: 800; font-size: 2rem; }
.logo-controls { flex: 1; min-width: 220px; }
.logo-controls .hint { margin-top: .35rem; }

.social-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.social-label { width: 120px; flex: none; margin: 0; font-weight: 500; }
.np-status { margin: .5rem 0 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* Textareas match the text inputs (incl. brand font). */
textarea { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px;
    font-size: 1rem; font-family: inherit; background: #fff; line-height: 1.5; resize: vertical; }
textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }

@media (max-width: 640px) {
    .social-row { flex-direction: column; align-items: stretch; gap: .2rem; }
    .social-label { width: auto; }
}

/* ===== flatpickr — brand tint =========================================== */
.flatpickr-day.selected, .flatpickr-day.selected:hover,
.flatpickr-day.startRange, .flatpickr-day.endRange { background: var(--blue); border-color: var(--blue); }
.flatpickr-day.today { border-color: var(--blue); }
.flatpickr-day.today:hover { background: var(--blue-tint); color: var(--ink); }
.flatpickr-months .flatpickr-month, .flatpickr-weekdays, span.flatpickr-weekday { color: var(--ink); }
.flatpickr-day:hover { background: var(--blue-tint); }

/* Season-fit summary (schedule generator preview) --------------------------- */
.fit-summary { margin: 0 0 1.25rem; padding: 1rem 1.1rem; background: var(--surface, #fff);
  border: 1px solid var(--border, #dce6f2); border-radius: 14px; box-shadow: 0 2px 10px rgba(14,27,42,.06); }
.fit-title { margin: 0 0 .15rem; font-size: 1.05rem; }
.fit-table { margin-top: .6rem; }
.fit-table th.num, .fit-table td.num { text-align: right; white-space: nowrap; }
.fit-chip { display: inline-block; font-size: .78rem; font-weight: 700; padding: .2rem .55rem;
  border-radius: 999px; white-space: nowrap; }
.fit-chip.fit-ok { background: var(--green-tint, #e4f8f1); color: #0e7a57; }
.fit-chip.fit-warn { background: var(--coral-tint, #ffecea); color: #b23a30; }
.fit-chip.fit-info { background: var(--blue-tint, #e9f2fd); color: var(--blue-dark, #145cab); }
.fit-note { margin-top: .3rem; line-height: 1.35; }

/* Double-header preview panel (schedule generator) -------------------------- */
.dh-panel { margin: 0 0 1.1rem; }
.dh-table { margin-top: .5rem; }
.dh-table th.num, .dh-table td.num { text-align: right; white-space: nowrap; }

/* Per-division override table (schedule generator form) --------------------- */
.div-overrides { width: 100%; margin-top: .25rem; }
.div-overrides summary { cursor: pointer; font-weight: 600; color: var(--blue-dark); }
.override-table { margin-top: .5rem; }
.override-table td, .override-table th { vertical-align: middle; }
.override-table select { padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* Pool rows in the divisions list ------------------------------------------- */
.pool-row td { background: var(--cloud); border-top: none; }
.pool-name { padding-left: 1.25rem; color: var(--slate); }

/* Pooled standings: a "Pool" column + a divider between pools ---------------- */
.standings .pool-sep td { border-top: 2px solid var(--line); }
.pool-tag { display: inline-block; font-size: .74rem; font-weight: 700; padding: .12rem .5rem;
  border-radius: 999px; background: var(--blue-tint); color: var(--blue-dark); white-space: nowrap; }

/* Playoffs bracket ---------------------------------------------------------- */
.head-actions { display: inline-flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.seed-out td { color: var(--muted); }
.check { font-weight: 500; display: inline-flex; align-items: center; gap: .45rem; margin: .5rem 0; }
.bracket { display: flex; gap: 1.25rem; overflow-x: auto; padding: .5rem 0 1rem; align-items: stretch; }
.bracket-col { min-width: 190px; display: flex; flex-direction: column; gap: .9rem; justify-content: space-around; }
.bracket-round { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--slate); margin: 0 0 .2rem; }
.bx-match { border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.bx-team { padding: .5rem .65rem; font-weight: 600; border-bottom: 1px solid var(--line); }
.bx-team:last-of-type { border-bottom: none; }
.bx-win { background: var(--green-tint); color: var(--green-dark); }
.bx-actions { padding: .45rem .65rem; background: var(--cloud); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.bx-actions .link { font-weight: 600; }
.bracket-third { margin-top: 1rem; max-width: 220px; }
.bracket-admin { margin-top: 1rem; display: flex; gap: 1rem; align-items: center; }

/* Bracket match: scheduled game time / score --------------------------------- */
.bx-team { display: flex; justify-content: space-between; align-items: center; }
.bx-score { font-weight: 700; color: var(--ink); margin-left: .5rem; }
.bx-meta { padding: .4rem .65rem; background: var(--cloud); font-size: .82rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.pools-entry { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.pools-entry .section-title { margin: 0 0 .35rem; font-size: 1.05rem; }

/* Crews — roster rows (name · contact · actions) */
.crew-member-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .55rem 0; border-bottom: 1px solid #EEF2F7; list-style: none; }
.crew-member-row .msg-name { flex: 1 1 45%; }
.crew-member-row .row-actions { margin-left: auto; display: flex; gap: .9rem; align-items: center; }
.crew-member-row form.inline { display: inline; }
.crew-member-row .link.small.danger { color: #C0392B; }

/* ---- Contact form ---------------------------------------------------------
   Honeypot: kept in the DOM and the accessibility tree is hidden, but visually
   removed and off the tab order. Not display:none — some bots skip those. */
.hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px;
      overflow: hidden; }
.contact-card .btn-block { width: 100%; margin-top: .4rem; }
.contact-privacy { margin-top: 1rem; text-align: center; }
