/* SoftballU AI — combined version: compact layout, the full app's palette and type. */
:root {
  --bg: #f4f6fa;
  --surface: #fff;
  --ink: #0e1a33;
  --ink-2: #1f2a40;
  --muted: #5b6781;
  --line: #e2e6ee;
  --line-2: #edf0f5;
  --navy: #0e1a33;
  --lime: #d4ee4b;
  --lime-soft: #f1fbd0;
  --lime-line: #c9d98a;
  --indigo: #4f46e5;
  --link: #3730a3;
  --ai: linear-gradient(90deg, #4f46e5, #0e7fb8);
  --good: #0b7a55;
  --good-bg: #e3f6ec;
  --warn: #9a5b00;
  --warn-bg: #fff2d9;
  --bad: #b42318;
  --bad-bg: #fef1ef;
  --orange: #c2410c;
  --radius: 12px;
  --display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); font-variant-numeric: tabular-nums; }
a { color: var(--link); font-weight: 600; text-decoration: none; }
a:hover { color: var(--orange); text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.2px; color: var(--ink); }
h1 { font-size: 26px; line-height: 1.15; margin: 0 0 6px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h2 { font-size: 17px; margin: 0 0 10px; }
h2 .sub { font-family: var(--body); font-size: 13px; font-weight: 500; color: var(--muted); }
p { margin: 6px 0; }
small, .muted { color: var(--muted); }
ul.plain { list-style: none; margin: 4px 0; padding: 0; }
button.link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--link); cursor: pointer; }
button.link:hover { color: var(--orange); text-decoration: underline; }
button.link[disabled] { color: var(--muted); cursor: default; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.35); border-radius: 4px; }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-in { max-width: 1080px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--ink) !important; font: 700 19px var(--display); text-decoration: none !important; }
.logo .ai { background: var(--ai); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search input { width: 100%; border-radius: 999px; padding: 7px 14px; }
.q-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(14, 26, 51, 0.14); }
.q-results li { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; flex-wrap: wrap; }
.q-results li.hl { background: var(--lime-soft); }
.q-results li a { flex: 1; }
.q-results small { flex-basis: 100%; order: 3; margin-top: -4px; }
#nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
#nav a { color: var(--ink-2); padding: 6px 10px; border-radius: 999px; font-weight: 600; font-size: 14px; }
#nav a:hover { background: var(--line-2); text-decoration: none; color: var(--ink); }
#nav a.on { background: var(--lime); color: var(--ink); }
#nav .who { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-size: 14px; color: var(--muted); }
#nav .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font: 700 12px var(--display); }
#nav #logout { font-size: 14px; margin-left: 6px; }
#flash { max-width: 1080px; margin: 10px auto 0; padding: 8px 14px; background: var(--navy); color: #fff; border-radius: 10px; width: calc(100% - 40px); }
main { max-width: 1080px; margin: 0 auto; padding: 18px 20px 30px; outline: none; display: flex; flex-direction: column; gap: 14px; }
main > * { margin-top: 0; margin-bottom: 0; }
.foot { max-width: 1080px; margin: 0 auto; padding: 8px 20px 28px; font-size: 13px; color: var(--muted); }
.crumb { font-size: 13px; color: var(--muted); }
.crumb + h1 { margin-top: -8px; }

/* cards: sectionize() wraps each top-level h2 + its content */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; box-shadow: 0 1px 2px rgba(14, 26, 51, 0.04); }
.card > :last-child { margin-bottom: 0; }

/* forms */
input[type='text'], input[type='email'], input[type='password'], input[type='search'], select, textarea {
  font: inherit; padding: 6px 10px; border: 1px solid #cdd3de; border-radius: 8px; background: #fff; color: var(--ink); max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18); }
textarea { width: 100%; }
button.btn { font: 600 14px var(--body); padding: 7px 16px; border: 0; border-radius: 9px; background: var(--navy); color: #fff; cursor: pointer; }
button.btn:hover { background: #1a2744; }
button.btn[disabled] { opacity: 0.6; cursor: default; }
.field { margin: 10px 0; }
.field > label, .field > .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); }
.err { color: var(--bad); font-size: 13px; margin-top: 3px; }
.form-alert .alert { color: var(--bad); background: #fef1ef; border-radius: 8px; padding: 8px 12px; margin: 6px 0; }
.alert.info { color: var(--ink); background: var(--lime-soft); padding: 8px 12px; border: 1px solid var(--lime-line); border-radius: 8px; }
.inline { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.inline label { font-weight: 500; white-space: nowrap; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
fieldset { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 14px; padding: 8px 18px 12px; }
legend { font: 700 16px var(--display); padding: 0 6px; }
.checks { padding: 0; margin: 4px 0 0; }
.checks li { list-style: none; color: var(--muted); font-size: 12px; display: inline; margin-right: 12px; }
.checks li.ok { color: var(--good); }
.checks li.ok::before { content: '✓ '; }
details { margin: 0; }
details > summary { cursor: pointer; font-weight: 600; color: var(--link); padding: 2px 0; }
details[open] > summary { margin-bottom: 6px; }
main > details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 18px; }
.box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 6px 0; background: #fafbfd; }
main > p.box, main > div.box.fit { background: var(--lime-soft); border-color: var(--lime-line); }

/* follow pill */
button.follow { font: 600 13px var(--body); padding: 4px 12px; border-radius: 999px; border: 1.5px solid var(--navy); background: #fff; color: var(--navy); cursor: pointer; white-space: nowrap; }
button.follow:hover { background: var(--line-2); }
button.follow.on { background: var(--lime); border-color: var(--lime-line); }
button.follow[disabled] { opacity: 0.6; }

/* tables */
.wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; white-space: nowrap; }
tr.mine td { background: var(--lime-soft); }

/* level pills + score */
.lv { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.3px; }
.lv.HIGH { color: var(--good); background: var(--good-bg); }
.lv.MED { color: var(--warn); background: var(--warn-bg); }
.lv.LOW { color: var(--bad); background: var(--bad-bg); }
.score { display: inline-flex; width: 38px; height: 38px; border-radius: 50%; align-items: center; justify-content: center; font: 700 15px var(--display); border: 3px solid var(--line); }
.score.HIGH { border-color: var(--lime); background: var(--navy); color: #fff; }
.score.MED { border-color: #f5c36b; }
.est { color: var(--warn); background: var(--warn-bg); font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.leaves { color: var(--orange); }

/* signed-out */
.auth { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.auth h1 { font-size: 32px; }
.auth h2 { margin-top: 14px; }
.auth .formcol { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 4px 16px rgba(14, 26, 51, 0.06); }
.auth .formcol input:not([type='radio']):not([type='checkbox']) { width: 100%; }
.auth .formcol button.btn { width: 100%; padding: 9px; margin-top: 4px; }
.auth .side { display: flex; flex-direction: column; gap: 16px; }
.demo-embed { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: 0 4px 16px rgba(14, 26, 51, 0.06); }
.demo-embed video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; background: var(--navy); }
.demo-embed figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.demo-embed figcaption b { color: var(--ink); }
button.demo-link { display: inline-flex; align-items: center; gap: 6px; font-family: var(--body); font-size: 14px; }
.watch { display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px 7px 7px; border: 0; border-radius: 999px; background: var(--lime); color: var(--ink); font: 600 15px var(--body); cursor: pointer; box-shadow: 0 4px 14px rgba(14, 26, 51, 0.12); }
.watch:hover { background: #c8e33a; }
.watch:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }
.watch small { font-weight: 500; color: #4d5f05; }
.watch-play { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: var(--lime); padding-left: 2px; }
.ig { background: linear-gradient(150deg, #0e1a33, #1b2463 68%, #0b3a5c); color: #e4e9f5; border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.ig-head { font-size: 14px; }
.ig-hero { font: 700 40px/1 var(--display); color: var(--lime); margin-right: 6px; vertical-align: -4px; }
.ig-bar { display: flex; gap: 3px; height: 10px; border-radius: 999px; overflow: hidden; }
.ig-bar span { flex-basis: 0; min-width: 6px; }
.ig-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.ig-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.seg-D1 { background: #818cf8; }
.seg-D2 { background: #38bdf8; }
.seg-D3 { background: var(--lime); }
.seg-NAIA { background: #fb923c; }
.ig-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ig-tile { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 10px; padding: 10px; }
.ig-tile b { display: block; font: 700 22px var(--display); color: #fff; }
.ig-tile span { font-size: 12px; line-height: 1.3; display: block; }

.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 14px 0 6px; }
.feat { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--tone); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 4px 16px rgba(14, 26, 51, 0.05); }
.feat-a { --tone: #818cf8; --tone-bg: #eef0ff; --tone-ink: #3730a3; }
.feat-b { --tone: #38bdf8; --tone-bg: #e6f6fd; --tone-ink: #075985; }
.feat-c { --tone: #a3c614; --tone-bg: var(--lime-soft); --tone-ink: #4d5f05; }
.feat-top { display: flex; align-items: center; justify-content: space-between; }
.feat-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--tone-bg); color: var(--tone-ink); }
.feat-ico svg, .aud-ico svg { width: 22px; height: 22px; }
.feat-n { font: 700 28px/1 var(--display); color: var(--line); }
.feat h3 { font-size: 16px; margin: 10px 0 6px; }
.feat ul { list-style: none; margin: 0; padding: 0; }
.feat li { position: relative; padding: 3px 0 3px 18px; font-size: 14px; line-height: 1.35; }
.feat li::before { content: ''; position: absolute; left: 2px; top: 10px; width: 7px; height: 7px; border-radius: 2px; background: var(--tone); }
.soon { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-size: 11px; font-weight: 600; line-height: 18px; white-space: nowrap; vertical-align: 1px; }
.aud-grid { display: grid; gap: 10px; }
.aud { display: flex; gap: 14px; align-items: flex-start; background: var(--navy); color: #e4e9f5; border-radius: var(--radius); padding: 14px 16px; }
.aud-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--lime); color: var(--navy); }
.aud b { font: 700 16px var(--display); color: #fff; }
.aud p { margin: 2px 0 0; font-size: 14px; color: #c4cbe0; }

/* lists */
.list li { padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.kv dt { font-weight: 600; color: var(--muted); font-size: 14px; }
dl.kv dd { margin: 0; }
.stackbar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--line-2); max-width: 320px; margin: 4px 0 4px; }
.cols { columns: 4 160px; column-gap: 18px; }
.cols label { display: block; break-inside: avoid; font-weight: 500; }
.news-day { font: 600 12px var(--body); text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin: 12px 0 2px; }
.card .news-day:first-of-type { margin-top: 2px; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth .side { order: -1; }
  .ig-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row2 { grid-template-columns: 1fr; }
  #nav { margin-left: 0; }
  .search { max-width: none; order: 3; flex-basis: 100%; }
  .top-in, main { padding-left: 16px; padding-right: 16px; }
  #flash { width: calc(100% - 32px); }
  #nav a { padding: 4px 8px; font-size: 13px; }
  #nav .who { margin-left: 2px; font-size: 0; }
  #nav .avatar { font-size: 12px; }
  .top-in { gap: 8px 14px; padding-top: 8px; padding-bottom: 8px; }
  h1 { font-size: 22px; }
}

/* social accounts */
.socials { display: flex; flex-wrap: wrap; gap: 6px; }
.socials .soc { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; }
.socials .soc:hover { border-color: var(--indigo); text-decoration: none; }
.soc-p { font-weight: 700; color: var(--ink); }


/* primary position emphasis (Home + Profile) */
.matches-for { font-size: 16px; margin: 4px 0 8px; }
.matches-for b { font-family: var(--display); font-size: 18px; }
.pos-note { margin: 6px 0 0; padding: 6px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--ink, #1b2333); font-size: 13px; }

/* Small window (Change password on the Profile page) */
main dialog.modal, dialog.modal { margin: auto; width: min(360px, calc(100vw - 32px)); padding: 16px 20px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 20px 50px rgba(14, 26, 51, 0.25); }
dialog.modal::backdrop { background: rgba(14, 26, 51, 0.45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-x { background: none; border: 0; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal-x:hover { color: var(--ink); }

/* "Watch how it works" video window (signed-out home) */
dialog.modal-video { width: min(960px, calc(100vw - 32px)); padding: 14px 16px 4px; }
.modal-video video { display: block; width: 100%; aspect-ratio: 16 / 9; margin-top: 10px; border-radius: 10px; background: var(--navy); }
.modal-video .demo-err { margin: 8px 0 0; font-size: 14px; }
.demo-cta { text-align: center; margin: 12px 0 10px; }
.demo-cta .btn { display: inline-block; font: 600 14px var(--body); padding: 8px 18px; border-radius: 9px; background: var(--navy); color: #fff; text-decoration: none; }
.demo-cta .btn:hover { background: #1a2744; text-decoration: none; }

/* opening color key */
.lv-key { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.lv-key .lv { font-size: 10px; padding: 1px 7px; margin-left: 4px; }
h2 .lv-key { display: inline-block; margin: 0 0 0 10px; font-family: var(--body); font-weight: 500; vertical-align: middle; }

/* site analytics (#/admin, admin.js) */
.an-filters { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; }
.an-filters label { font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.an-filters .an-check { font-weight: 500; }
.an-filters input[type='date'] { font: inherit; padding: 5px 8px; border: 1px solid #cdd3de; border-radius: 8px; }
.an-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.an-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.an-tile b { display: block; font: 700 24px/1.1 var(--display); }
.an-tile span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 2px; }
.an-tile small { display: block; font-size: 12px; }
.an-tabs, .an-metrics { display: flex; flex-wrap: wrap; gap: 4px; }
.an-tabs button, .an-metrics button { font: 600 14px var(--body); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.an-metrics button { font-size: 13px; padding: 3px 10px; }
.an-tabs button.on, .an-metrics button.on { background: var(--lime); border-color: var(--lime-line); color: var(--ink); }
.an-chart-wrap { position: relative; margin-top: 8px; }
.an-chart { width: 100%; height: auto; display: block; }
.an-chart .bar { fill: var(--indigo); }
.an-chart .hit { fill: transparent; }
.an-chart .hit.on { fill: rgba(79, 70, 229, 0.08); }
.an-chart .grid { stroke: var(--line-2); stroke-width: 1; }
.an-chart .base { stroke: var(--line); stroke-width: 1; }
.an-chart .ax { font-size: 11px; fill: var(--muted); }
.an-tip { position: absolute; pointer-events: none; background: var(--navy); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.an-table td.an-first { max-width: 360px; overflow-wrap: anywhere; }
.an-table td { overflow-wrap: anywhere; }
.an-bar { display: inline-block; width: 60px; height: 6px; background: var(--line-2); border-radius: 999px; margin-right: 8px; vertical-align: middle; overflow: hidden; }
.an-bar i { display: block; height: 100%; background: var(--indigo); border-radius: 999px; }
.an-tools { font-size: 13px; margin-top: 4px; }
th button.an-sort { font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 24px; }
.an-grid h3 { font-size: 14px; margin: 10px 0 2px; }
.an-foot { font-size: 12px; }
@media (max-width: 860px) {
  .an-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
