/* =====================================================================
   Texas Pride Field Hockey — site styles (coach portal, player pages,
   home page and lesson page all share this file)

   Colors come from the club crest: navy #272264, red #C01D2E, white.
   They live in the variables below ("design tokens"), so changing a
   color is one edit here instead of fifty across the file.
   ===================================================================== */
:root {
  /* Crest colors */
  --navy: #272264;
  --navy-hi: #37318a;      /* hover */
  --navy-deep: #1d1a4c;    /* header bar */
  --red: #c01d2e;
  --red-soft: #fbe8ea;

  /* Every page: dark navy background under a light gray header. */
  --bg: #182849;           /* true navy blue (the crest navy leans violet, so the page uses a bluer navy) */
  --app-bg: var(--bg);
  --header-bg: #bbbfc6;        /* header bar / top band: light gray with a hint of blue */
  --on-bg: #ffffff;                       /* text sitting directly on the navy page */
  --on-bg-muted: rgba(255, 255, 255, .75);
  --box-border: 3px solid var(--red);     /* red outline around each boxed section */
  --panel: #eef0f4;        /* boxes: very light gray (softer than white) */
  --panel-2: #e4e7ee;      /* subtle fills inside boxes */
  --field: #f8f9fb;        /* text boxes, buttons, rating squares: a touch lighter than the box */
  --line: #d7dae3;
  --line-strong: #c3c7d4;
  --text: #16171c;         /* regular text: black */
  --heading: var(--navy);  /* box titles and subtitles: navy */
  --muted: #565b78;
  --faint: #868aa3;
  --error: #b42332;

  /* Status colors (text + soft background) */
  --amber: #8f5b00;  --amber-bg: #fdf1d6;   /* working on, coaches-only */
  --sky: #24539e;    --sky-bg: #e4ecfa;     /* progressing */
  --green: #1c7442;  --green-bg: #def3e6;   /* achieved, complete */

  --radius-lg: 14px;
  --radius: 9px;
  --control-h: 42px;       /* every input, select and button shares this height */
  --shadow: 0 2px 4px rgba(8, 6, 30, .2), 0 10px 24px rgba(8, 6, 30, .25);
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;   /* regular writing */
  --font-head: "Barlow Semi Condensed", system-ui, sans-serif;                 /* headings */
  color-scheme: light;
}

/* ---------- Basics ---------- */
/* Sizes include padding and borders. The ::before/::after part covers decorations
   like the skill-definition bubbles, which otherwise grow by their padding. */
*, *::before, *::after { box-sizing: border-box; }
/* "hidden" must always win, or rules like .stack { display: grid } would show hidden things. */
[hidden] { display: none !important; }
html, body { margin: 0; }
/* Every page: dark navy with a faint lighter wash at the top. */
body {
  color: var(--text); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06) 0, rgba(255, 255, 255, 0) 420px) no-repeat, var(--bg);
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.15; margin: 0; color: var(--heading); }
h1 { font-size: 2rem; letter-spacing: .005em; }
h2 { font-size: 1.4rem; }    /* box titles: sized to sit clearly above the Public Sans body text */
h3 { font-size: 1.15rem; }
p { margin: 0 0 .75rem; }
a { color: var(--navy); }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: .9rem; }
.hint { color: var(--faint); font-size: .85rem; font-weight: 400; }
.error { color: var(--error); font-size: .9rem; min-height: 1.2em; }
.loading { padding: 3rem; text-align: center; color: var(--muted); }
.placeholder { color: var(--faint); font-style: italic; margin-bottom: .75rem; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

/* ---------- Header bar (navy, with the crest) ---------- */
.topbar {
  background: var(--header-bg); color: var(--navy);
  border-bottom: 3px solid var(--red);
  padding: .75rem clamp(1rem, 4vw, 2.75rem);
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: inherit; margin-right: auto; }
.crest { width: 46px; height: 46px; object-fit: contain; flex: none; display: block; }
.crest.big { width: 96px; height: 96px; margin: 0 auto 1rem; }

.brand-name { font: 700 1.2rem/1.1 var(--font-head); display: block; color: var(--navy); letter-spacing: .01em; }
.brand-sub { color: #3f4456; font-size: .85rem; }
.who { color: #2c3040; font-size: .9rem; }
.topbar .btn { background: rgba(255, 255, 255, .45); color: var(--navy); border-color: rgba(39, 34, 100, .35); }
.topbar .btn:hover { border-color: var(--navy); background: rgba(255, 255, 255, .7); }
.topbar .btn.ghost { border-color: transparent; background: transparent; color: var(--navy); }

.page { max-width: 1240px; margin: 0 auto; padding: 1rem clamp(1rem, 4vw, 2.75rem) 4rem; }
.syncline { display: flex; align-items: center; gap: .5rem; color: var(--on-bg-muted); font-size: .85rem; margin-bottom: .75rem; min-height: 1.5rem; }
.syncline .linkbtn { color: var(--on-bg); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.live { background: var(--green); }
.dot.off { background: var(--red); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: var(--control-h); padding: 0 1rem;
  border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--field); color: var(--text);
  font: 500 .95rem var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--navy); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-hi); border-color: var(--navy-hi); }
.btn.danger { color: var(--error); border-color: #e7b9bf; background: transparent; }
.btn.danger:hover { border-color: var(--error); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 0 .5rem; }
.btn.ghost:hover { color: var(--text); }
.btn.small { min-height: 32px; padding: 0 .7rem; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: wait; }
.linkbtn { background: none; border: 0; color: var(--navy); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.danger-link { color: var(--error) !important; }

/* ---------- Form controls ----------
   select is listed with input and textarea (plus appearance:none) so all
   three share one look and height. */
input, select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--field); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: .55rem .8rem;
}
input, select { min-height: var(--control-h); }
textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23565b78' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .85rem center;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(39, 34, 100, .15); }
input[readonly] { background: var(--panel-2); color: var(--muted); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--navy); padding: 0; }
label.field { display: block; }
label.field > span, .field-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; color: var(--heading); }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.stack { display: grid; gap: 1rem; }
.remember { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .92rem; }
.addrow { display: flex; gap: .5rem; margin-top: .6rem; }
.addrow input { flex: 1; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .15rem .6rem; border-radius: 999px;
  font-size: .82rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.badge.ok    { color: var(--green); background: var(--green-bg); }
.badge.warn  { color: var(--amber); background: var(--amber-bg); }
.badge.info  { color: var(--sky);   background: var(--sky-bg); }
.badge.muted { color: var(--muted); background: var(--panel-2); }
.badge.team  { color: var(--text); border-color: var(--line-strong); background: var(--field); }
.badge.team::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--team-color, var(--faint)); box-shadow: inset 0 0 0 1px rgba(27, 25, 64, .25); }
.coach-only { color: var(--amber); background: var(--amber-bg); }

/* ---------- Cards & panels ---------- */
.panel { background: var(--panel); border: var(--box-border); border-radius: var(--radius-lg); padding: 1.2rem 1.35rem; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.panel-head .faint { white-space: nowrap; }
.panel-head h2 .hint { font-family: var(--font); font-size: .85rem; font-weight: 400; margin-left: .35rem; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.page > .panel, .ratings-panel, .fitness-panel, .report-panel, .lessons-panel { margin-bottom: 1rem; }
.empty { text-align: center; padding: 3rem 1rem; background: var(--panel); border: var(--box-border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.empty h2 { margin-bottom: .5rem; }
.qa + .qa { margin-top: .9rem; }
.qa dt { color: var(--heading); font-size: .88rem; font-weight: 700; margin-bottom: .15rem; }
.qa dd { margin: 0; white-space: pre-wrap; }

/* ---------- Roster ---------- */
.roster-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .5rem 0 1.25rem; }
.roster-head h1 { color: var(--on-bg); }
.roster-head h1 span { color: var(--on-bg-muted); font-weight: 600; font-size: 1.2rem; margin-left: .4rem; }
.roster-head .btn.primary, .seasonbar .btn.primary { background: var(--red); border-color: var(--red); }
.roster-head .btn.primary:hover, .seasonbar .btn.primary:hover { background: #a3172a; border-color: #a3172a; }
.filters { display: grid; grid-template-columns: minmax(200px, 1.6fr) auto minmax(150px, 1fr) minmax(170px, 1fr); gap: .75rem; margin-bottom: 1rem; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; height: var(--control-h); background: var(--field); }
.seg button { background: transparent; color: var(--muted); border: 0; padding: 0 .95rem; font: 500 .92rem var(--font); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.roster { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border: var(--box-border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.roster th { text-align: left; font-weight: 700; font-size: .85rem; color: var(--heading); padding: .7rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.roster td { padding: .8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.roster tr:last-child td { border-bottom: 0; }
.roster tbody tr { cursor: pointer; }
.roster tbody tr:hover { background: var(--panel-2); }
.roster a.pname { color: var(--text); text-decoration: none; font-weight: 600; }
.roster .aka { color: var(--faint); font-size: .88rem; margin-left: .35rem; }
.queue { border: var(--box-border); box-shadow: var(--shadow); background: var(--amber-bg); border-radius: var(--radius-lg); padding: .9rem 1.1rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.queue p { margin: 0; margin-right: auto; }

/* ---------- Profile ---------- */
.back { display: inline-block; color: var(--on-bg-muted); text-decoration: none; margin-bottom: .75rem; font-size: .95rem; }
.back:hover { color: var(--on-bg); }
.profile-head { background: var(--panel); border: var(--box-border); border-radius: var(--radius-lg); padding: 1.25rem 1.4rem; display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow); }
.avatar { width: 64px; height: 64px; border-radius: 50%; flex: none; background: var(--navy); color: #fff; display: grid; place-items: center; font: 700 1.35rem var(--font-head); box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--red); }
.profile-head .meta { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .45rem; }
.profile-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.legal { color: var(--faint); font-size: .9rem; }
.signin-line { margin-top: .5rem; font-size: .88rem; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
.access-chip { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--line-strong); border-radius: 999px; padding: .1rem .35rem .1rem .7rem; color: var(--muted); background: var(--field); }
.access-chip em { font-style: normal; color: var(--faint); }
.access-chip .linkbtn { font-size: .8rem; }

.seasonbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 1.25rem 0 1rem; }
.seasonbar .spacer { margin-left: auto; }
.tab { height: 36px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted); font: 500 .92rem var(--font); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--red); border-color: var(--red); color: #fff; }

/* Coach feedback */
.didwell { border-left: 3px solid var(--green); padding: .15rem 0 .15rem .9rem; margin: .25rem 0 1.1rem; white-space: pre-wrap; }
.focus { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .95rem; display: flex; gap: 1rem; align-items: flex-start; }
.focus + .focus { margin-top: .6rem; }
.focus .ft { font-weight: 700; color: var(--heading); }
.focus .fd { color: var(--text); font-size: .93rem; white-space: pre-wrap; }
.focus .status { margin-left: auto; flex: none; cursor: pointer; border: 0; font-family: var(--font); }
.status.working     { color: var(--amber); background: var(--amber-bg); }
.status.progressing { color: var(--sky);   background: var(--sky-bg); }
.status.achieved    { color: var(--green); background: var(--green-bg); }
.coach-visibility { margin: -.4rem 0 .9rem; }
.summary-block { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.summary-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .4rem; }
.summary-head .qa dt { margin: 0; }
.summary-text { white-space: pre-wrap; }
.summary-block .hint { margin: .4rem 0 0; }
.report-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.ai-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

/* ---------- Skill ratings ---------- */
.skill-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 3rem; align-items: start; }
.skill-col { display: grid; gap: 1.5rem; align-content: start; min-width: 0; }
.skill-group { min-width: 0; }
.group-title { font: 700 1.25rem var(--font-head); padding-bottom: .45rem; margin-bottom: .35rem; border-bottom: 2px solid var(--navy); }
/* Offensive / Defensive: a small tinted band with a red bar, a step below the group headings. */
.section-sub { font: 700 .95rem var(--font-head); color: var(--navy); letter-spacing: .01em; margin: 1rem 0 .35rem; padding: .2rem .6rem; border-left: 3px solid var(--red); background: #eeedf6; border-radius: 0 6px 6px 0; }
.group-title + .section-sub { margin-top: .5rem; }
.rating { display: grid; grid-template-columns: minmax(130px, 1fr) auto minmax(92px, auto); gap: .9rem; align-items: center; padding: .28rem 0; }
.rating > span:first-child { min-width: 0; overflow-wrap: break-word; }
.boxes { display: flex; gap: 6px; }
.box { position: relative; width: 32px; height: 22px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--field); cursor: pointer; padding: 0; }
.box.on { background: var(--navy); border-color: var(--navy); }
.box:hover { border-color: var(--navy); }
.box.prev::after { content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--red); }
.level { text-align: right; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.up { color: var(--green); }
.down { color: var(--amber); }
.legend { color: var(--faint); font-size: .83rem; margin-top: .9rem; }
.rating-feedback { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.rating-feedback .group-title { display: flex; align-items: center; gap: .6rem; border-bottom: 0; margin-bottom: .5rem; }
.rating-feedback textarea { margin-top: .5rem; }
.rating-feedback .group-title + .note { border-top: 0; }
/* PC roles boxes under PC Attack / PC Defense Skills */
.roles-box { margin: .1rem 0 .9rem; }
.roles-label { display: block; font-size: .8rem; font-weight: 700; color: var(--heading); margin-bottom: .25rem; }
.roles-box textarea { min-height: 58px; font-size: .92rem; }
.roles-actions { display: flex; justify-content: flex-end; align-items: center; gap: .6rem; margin-top: .35rem; }
.roles-view { margin: -.05rem 0 .7rem; padding: .45rem .7rem; border-left: 2px solid var(--line-strong); font-size: .9rem; }
.roles-view .roles-label { display: inline; margin: 0 .4rem 0 0; }
.roles-text { white-space: pre-wrap; }

/* ---------- Fitness ---------- */
.fitness-grid { display: grid; grid-template-columns: 2.2fr 1fr; gap: 1.5rem 3rem; align-items: start; }
.fitness-grid > div { min-width: 0; }
.fitness-panel .rating { grid-template-columns: auto 1fr; row-gap: .4rem; }
.fitness-panel .rating > span:first-child { grid-column: 1 / -1; }
.fitness-panel .rating .level { text-align: left; }
.fit-table-wrap { overflow-x: auto; margin: .4rem 0 .25rem; }
.fit-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.fit-table th, .fit-table td { text-align: left; padding: .5rem .6rem .5rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.fit-table thead th { color: var(--heading); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.fit-table tbody th { font-weight: 500; white-space: nowrap; color: var(--muted); }
.fit-table td { font-weight: 600; white-space: normal; min-width: 5.5rem; }
.fit-table .chg { display: block; font-size: .76rem; font-weight: 500; margin-top: .1rem; color: var(--faint); white-space: normal; line-height: 1.3; }
.fit-table tr.best th, .fit-table tr.best td { border-bottom: 0; border-top: 2px solid var(--navy); padding-top: .6rem; }
.fit-table tr.best th { color: var(--heading); font-weight: 700; }
.fit-row-actions { text-align: right !important; white-space: nowrap !important; min-width: 0 !important; width: 1%; }
.fit-row-actions .linkbtn { font-size: .85rem; margin-left: .5rem; }
.fit-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line-strong); }
.fit-form-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: .6rem; }
.fit-form-row .field > span { font-size: .82rem; }
.fit-actions { display: flex; align-items: center; gap: .75rem; margin-top: .9rem; flex-wrap: wrap; }
.fit-actions .error { min-height: 0; }
.fit-actions .hint { margin-left: .2rem; }

/* ---------- Goals & notes ---------- */
.goal { display: flex; align-items: center; gap: .65rem; padding: .4rem 0; }
.goal .gt { flex: 1; }
.goal.done .gt { color: var(--faint); text-decoration: line-through; }
.note { border-top: 1px solid var(--line); padding: .7rem 0; }
.panel-head + .note { border-top: 0; padding-top: 0; }
.note .nh { display: flex; justify-content: space-between; color: var(--faint); font-size: .85rem; margin-bottom: .2rem; }
.note .nb { white-space: pre-wrap; }

/* ---------- Private lessons ---------- */
.lesson { display: grid; grid-template-columns: 74px 1fr; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.panel-head + .lesson, .lessons-panel form[hidden] + .lesson { border-top: 0; padding-top: 0; }
.ldate { text-align: center; border: 1px solid var(--line-strong); border-top: 3px solid var(--red); border-radius: var(--radius); padding: .4rem 0; align-self: start; background: var(--field); }
.ldate .m { display: block; color: var(--muted); font-size: .78rem; font-weight: 600; }
.ldate .d { display: block; font: 700 1.5rem/1.1 var(--font-head); color: var(--navy); }
.ldate .y { display: block; color: var(--faint); font-size: .75rem; }
.lmeta { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; margin-bottom: .35rem; }
.lmeta .who { color: var(--heading); font-weight: 700; }
.lwork { white-space: pre-wrap; }
.lnotes { margin-top: .75rem; border-left: 3px solid var(--amber); padding-left: .9rem; }
.lnote { padding: .3rem 0; }
.lnote .nh { color: var(--faint); font-size: .83rem; display: flex; gap: .6rem; }
.lnote .nb { white-space: pre-wrap; }
.lnote-form { margin-top: .5rem; display: grid; gap: .5rem; }
.lactions { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
.qitem { border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; }
.qitem + .qitem { margin-top: .75rem; }
.qrow { display: grid; grid-template-columns: 1fr auto auto; gap: .5rem; margin-top: .6rem; }
.lc-row { display: flex; align-items: center; gap: .75rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.lc-row:first-child { border-top: 0; }
.lc-row .n { flex: 1; }
.lc-row.inactive .n { color: var(--faint); text-decoration: line-through; }

/* ---------- Dialogs ---------- */
dialog { width: min(760px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); color: var(--text); box-shadow: 0 20px 50px rgba(27, 25, 64, .25); }
dialog::backdrop { background: rgba(23, 21, 58, .5); }
.dlg { display: flex; flex-direction: column; max-height: calc(100vh - 2rem); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.dlg-body { padding: 1.2rem 1.4rem; overflow-y: auto; }
.dlg-foot { display: flex; gap: .6rem; align-items: center; padding: 1rem 1.4rem; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.dlg-foot .grow { margin-right: auto; }
.section-title { font: 700 1.15rem var(--font-head); color: var(--navy); margin: 1.4rem 0 .8rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.section-title .hint { font-family: var(--font); font-weight: 400; margin-left: .35rem; }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .4rem .9rem; }
.checkgrid label { display: flex; align-items: center; gap: .45rem; font-size: .92rem; }
.fa-edit { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; display: grid; gap: .5rem; background: var(--panel-2); }
.fa-edit + .fa-edit { margin-top: .6rem; }
.fa-row { display: grid; grid-template-columns: 1fr 160px auto; gap: .5rem; }
.preview { color: var(--muted); font-size: .88rem; margin-top: .35rem; }
.preview strong { color: var(--text); }
.self-readonly { margin: 0; padding: .9rem 1rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.login-row { display: grid; grid-template-columns: 1fr 140px auto; gap: .5rem; }
.login-row + .login-row { margin-top: .5rem; }
.method-choice { display: grid; gap: .5rem; }
.method { display: flex; gap: .7rem; align-items: flex-start; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .7rem .85rem; cursor: pointer; }
.method:has(input:checked) { border-color: var(--navy); background: #eeedf6; }
.method input { margin-top: .2rem; flex: none; }
.method .hint { font-size: .85rem; }
.pw-row { display: flex; gap: .5rem; }
.pw-row input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
.share-box { background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .9rem 1rem; white-space: pre-wrap; font: .95rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0; overflow-x: auto; color: var(--text); }
.success { border: 1px solid #b8e2c8; background: var(--green-bg); color: var(--text); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1.25rem; }

/* ---------- Season report (paper look, matches the PDF) ---------- */
.report { position: relative; background: #f6f7f9; color: var(--text); border: 1px solid var(--line); border-top: 5px solid var(--navy); border-radius: 10px; padding: clamp(1.25rem, 4vw, 2.5rem); line-height: 1.55; }
.report-crest { position: absolute; top: clamp(1rem, 3vw, 2rem); right: clamp(1rem, 3vw, 2rem); width: clamp(48px, 9vw, 72px); height: auto; }
.report-org { font: 700 .72rem var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem; padding-right: 80px; }
.report-name { font: 700 clamp(1.9rem, 5vw, 2.6rem)/1.05 var(--font-head); color: var(--navy); margin: 0 0 .7rem; padding-right: 80px; }
.report-season { margin: 0 0 1.4rem; }
.report-season span { display: inline-block; background: var(--red); color: #fff; font: 700 1rem var(--font-head); letter-spacing: .02em; padding: .3rem .95rem; border-radius: 999px; }
.report-section { border-top: 1px solid var(--line); padding-top: 1.1rem; margin-top: 1.1rem; }
.report-section h3 { font: 700 1.2rem var(--font-head); color: var(--heading); margin: 0 0 .6rem; }
.report-section h4 { font: 700 .92rem var(--font); color: var(--heading); margin: .8rem 0 .15rem; }
.report-section h3 + h4, .report-section h3 + .report-focus h4 { margin-top: 0; }
.report-section p { margin: 0 0 .7rem; white-space: pre-wrap; }
.report-focus + .report-focus { margin-top: .6rem; }
.report-status { font: 600 .72rem var(--font); padding: .1rem .5rem; border-radius: 999px; margin-left: .35rem; vertical-align: 2px; }
.report-status.s-working { background: var(--amber-bg); color: var(--amber); }
.report-status.s-progressing { background: var(--sky-bg); color: var(--sky); }
.report-status.s-achieved { background: var(--green-bg); color: var(--green); }
.report-signoff { font-weight: 700; font-style: italic; color: var(--navy); margin-top: 1rem !important; }
.report-empty { color: var(--faint); font-style: italic; }
.report-date { color: var(--faint); font-size: .8rem; margin: 1.2rem 0 0; }
.report-panel .panel-head { margin-bottom: .9rem; }
.report-dlg-body { background: var(--panel-2); }
.report-editor .report-note { font: 400 .75rem var(--font); color: var(--faint); margin-left: .4rem; }
.report-editor .ai-row { margin-bottom: .6rem; }
.report-signoff-field { display: flex; align-items: center; gap: .6rem; margin-top: .8rem; }
.report-signoff-field span { font-weight: 700; font-size: .9rem; color: var(--muted); white-space: nowrap; }
.report-signoff-field input { flex: 1; font-style: italic; font-weight: 600; }

/* ---------- Sign-in pages, home page, lesson page ---------- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  /* the header's gray across the top, with the red line, then navy: the card overlaps the band */
  background: linear-gradient(180deg, var(--header-bg) 0, var(--header-bg) 217px, var(--red) 217px, var(--red) 220px, transparent 220px); }
.card { background: var(--panel); border: var(--box-border); border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow); }
.card.narrow { width: min(420px, 100%); text-align: center; }
.card.narrow form { text-align: left; }
.card h1 { font-size: 1.6rem; margin-bottom: .35rem; }
.home { min-height: 100vh; }
.home-hero { background: var(--header-bg); border-bottom: 4px solid var(--red); color: var(--navy); text-align: center; padding: 3rem 1.25rem 5.5rem; }
.home-hero h1 { font-size: clamp(2rem, 5vw, 2.8rem); color: var(--navy); margin-bottom: .3rem; }
.home-hero p { color: #3f4456; font-size: 1.05rem; letter-spacing: .02em; margin: 0; }
.home-inner { width: min(860px, calc(100% - 2.5rem)); margin: -3.5rem auto 3rem; }
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.door { background: var(--panel); border: var(--box-border); border-top-width: 6px; border-radius: var(--radius-lg); padding: 1.75rem; display: flex; flex-direction: column; gap: .6rem; box-shadow: var(--shadow); }
.door h2 { font-size: 1.5rem; }
.door p { color: var(--text); flex: 1; }
.door .btn { align-self: flex-start; }
.home-foot { text-align: center; margin-top: 1.5rem; color: var(--on-bg-muted); }
.home-foot a { color: var(--on-bg); }
.athlete-page { max-width: 680px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.athlete-head { margin-bottom: 1.25rem; }
.athlete-head h1 { margin-bottom: .3rem; color: var(--on-bg); }
.athlete-head .muted { color: var(--on-bg-muted); }
.athlete-page > .faint { color: var(--on-bg-muted); }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 20px); background: var(--field); color: var(--text); border: 0; border-left: 4px solid var(--red); font-weight: 500; padding: .65rem 1.1rem; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(27, 25, 64, .3); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

/* ---------- Smaller screens ---------- */
@media (max-width: 1000px) {
  .fitness-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; }
  .skill-groups { grid-template-columns: 1fr; gap: 1.25rem; }
  .skill-col { gap: 1.25rem; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .search { grid-column: 1 / -1; }
  .profile-head .actions { margin-left: 0; width: 100%; }
}
@media (max-width: 680px) {
  .doors { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid2, .fa-row, .qrow { grid-template-columns: 1fr; }
  .topbar { gap: .6rem; }
  .crest { width: 40px; height: 40px; }
  .brand-name { font-size: 1.05rem; }
  .roster thead { display: none; }
  .roster tr { display: grid; grid-template-columns: 1fr auto; padding: .6rem .9rem; border-bottom: 1px solid var(--line); }
  .roster td { border: 0; padding: .15rem 0; }
  .roster td.c-season { display: none; }
  .rating { grid-template-columns: 1fr auto; gap: .6rem; }
  .rating .level { grid-column: 1 / -1; text-align: left; margin-top: -.2rem; }
  .boxes { gap: 5px; }
  .box { width: 26px; height: 20px; }
  .lesson { grid-template-columns: 1fr; gap: .5rem; }
  .ldate { display: inline-flex; gap: .35rem; align-items: baseline; padding: .2rem .6rem; justify-self: start; }
  .ldate .d { font-size: 1rem; }
  .login-row { grid-template-columns: 1fr auto; }
  .login-row select { grid-row: 2; }
  .fitness-panel { padding-left: 1rem; padding-right: 1rem; }
  .fit-form-row { grid-template-columns: 1fr 1fr; }
  .fit-table { font-size: .84rem; }
  .fit-table th, .fit-table td { padding-right: .4rem; min-width: 0; }
  .fit-table thead th, .fit-table tbody th { white-space: normal; }
  .fit-table tbody th { width: 4.2rem; }
  .fit-row-actions .linkbtn { display: block; margin: 0 0 .35rem auto; }
  .report-org, .report-name { padding-right: 56px; }
}

/* ---------- Skill definitions (shown when pointing at / tapping a skill name) ---------- */
.skill-name { position: relative; cursor: help; text-decoration: underline dotted rgba(39, 34, 100, .45); text-decoration-thickness: 1.5px; text-underline-offset: 4px; border-radius: 3px; }
.skill-name:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.skill-name::after {
  content: attr(data-tip);
  position: absolute; left: 0; bottom: calc(100% + 10px); z-index: 30;
  width: max-content; max-width: min(360px, 86vw);   /* room for longer definitions */
  background: var(--navy); color: #fff; font: 500 .84rem/1.45 var(--font); text-decoration: none; white-space: normal;
  padding: .55rem .75rem; border-radius: 8px; box-shadow: 0 8px 20px rgba(8, 6, 30, .3);
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .12s, transform .12s, visibility .12s;
  pointer-events: none;
}
.skill-name::before {   /* the little pointer under the bubble */
  content: ""; position: absolute; left: 14px; bottom: calc(100% + 4px); z-index: 30;
  border: 6px solid transparent; border-top-color: var(--navy); border-bottom: 0;
  opacity: 0; visibility: hidden; transition: opacity .12s, visibility .12s;
}
.skill-name:hover::after, .skill-name:focus::after, .skill-name.tip-open::after,
.skill-name:hover::before, .skill-name:focus::before, .skill-name.tip-open::before { opacity: 1; visibility: visible; transform: none; }
@media (prefers-reduced-motion: reduce) { .skill-name::after, .skill-name::before { transition: none; } }

/* ---------- AI options in the report editor ---------- */
.ai-panel { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .85rem; margin-bottom: .7rem; background: var(--panel); }
.ai-options { display: grid; grid-template-columns: 1fr 140px 1.6fr; gap: .6rem; margin-bottom: .6rem; }
.ai-options .field > span { font-size: .82rem; }
.ai-panel .ai-row { margin-bottom: 0; }
@media (max-width: 700px) { .ai-options { grid-template-columns: 1fr 1fr; } .ai-options .ai-note { grid-column: 1 / -1; } }

/* Position reminder badge on a profile is a button */
button.badge { border: 0; cursor: pointer; font-family: var(--font); }
.gk-note { margin: -.4rem 0 .8rem; }

/* Position dropdown with the optional specific-position box under it */
.position-field { display: grid; gap: .6rem; align-content: start; }

/* ---------- Team history (coaches only) ---------- */
.team-history { margin-top: .55rem; font-size: .88rem; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.team-history .th-label { font-weight: 700; color: var(--heading); }
.team-history ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.team-history strong { color: var(--heading); }
.team-history .th-remove { font-size: .8rem; margin-left: .35rem; }
.team-field { display: grid; gap: .6rem; align-content: start; }
.team-change { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: .7rem .8rem; background: var(--panel-2); }
.team-change .hint { margin: 0 0 .6rem; }
.team-change .grid2 { gap: .6rem; }
.team-change .grid2 { grid-template-columns: 1fr; }

/* "Team this season" next to the season tabs (sits on the navy page) */
.season-team { color: var(--on-bg-muted); font-size: .9rem; margin-left: .35rem; }
.season-team strong { color: var(--on-bg); }

/* ---------- Tournament Notes (coaches only) ---------- */
.tourney-panel { margin-bottom: 1rem; }
.tourney { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .9rem; background: var(--field); }
.tourney + .tourney, .tourney-form + .tourney, .tourney + .tourney-form { margin-top: .6rem; }
.t-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.t-head .spacer { margin-left: auto; }
.t-head .linkbtn { font-size: .85rem; }
.t-name { color: var(--heading); font-size: 1.02rem; }
.t-body { margin-top: .35rem; white-space: pre-wrap; }
.tourney-form { display: grid; gap: .7rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: .85rem .95rem; background: var(--panel-2); }
.tourney-form .error { min-height: 0; margin: 0; }
.tourney-actions { display: flex; gap: .5rem; }

/* A hint placed after a field (rather than in its label) stays small and gray. */
label.field > span.hint { display: block; font-weight: 400; color: var(--faint); font-size: .85rem; margin: .35rem 0 0; }

/* ---------- Focus areas: AI suggestions (season form) ---------- */
.fa-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .35rem; }
.fa-head .field-label { margin-bottom: 0; }
.fa-edit.fa-ai { border: 1.5px dashed var(--navy); }
.ai-tag { font-size: .78rem; font-weight: 600; color: var(--navy); }
.fa-how { display: grid; gap: .25rem; }
.fa-how > span { font-size: .8rem; font-weight: 600; color: var(--muted); }
#ai-fa-status:empty { display: none; }

/* ---------- Lesson linked to a development goal ---------- */
.lgoal { margin-top: .4rem; font-size: .9rem; color: var(--muted); }
.lgoal > span { display: inline-block; margin-right: .35rem; padding: .05rem .45rem; border-radius: 999px;
  border: 1px solid var(--line-strong); font-size: .75rem; font-weight: 700; color: var(--heading); }

/* ---------- Minimizable profile boxes ---------- */
.panel-tools { display: inline-flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.collapse-btn { padding: .2rem .55rem; font-size: .8rem; white-space: nowrap; }
.panel.collapsed { align-self: start; }
.panel.collapsed .panel-head { margin-bottom: .35rem; }
.collapsed-summary { margin: 0; color: var(--muted); font-size: .92rem; }
/* On narrow screens, a box's title and its buttons may wrap onto two lines
   instead of pushing the page wider than the phone. */
.cols > * { min-width: 0; }
@media (max-width: 700px) {
  .panel-head { flex-wrap: wrap; }
  .panel-tools { margin-left: auto; }
}
