/* TheScheduler */
:root {
    --brand: #1f3a68;
    --brand-dark: #152a4d;
    --accent: #f28c28;
    --ink: #1c2230;
    --muted: #5c6577;
    --line: #dbe0ea;
    --bg: #f4f6fa;
    --card: #ffffff;
    --soft: #e8eef8;
    --error: #b42318;
    --error-bg: #fdecea;
    --ok-bg: #e6f4ea;
    --warn-bg: #fff4e0;
    --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
       background: var(--bg); color: var(--ink); line-height: 1.5; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: 28px; line-height: 1.2; margin: 8px 0; }
h2 { font-size: 20px; margin: 0 0 8px; }
h3 { font-size: 16px; margin: 16px 0 6px; }
.lead { font-size: 17px; color: var(--muted); margin: 0 0 20px; max-width: 720px; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 14px; margin: 6px 0 0; }
.crumbs { font-size: 14px; margin: 16px 0 0; color: var(--muted); }

.site-header { background: var(--brand); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; flex-wrap: wrap; }
.wordmark { color: #fff; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -0.3px; }
.wordmark span { color: var(--accent); }
.wordmark small { margin-left: 8px; font-size: 12px; font-weight: 500; letter-spacing: 0; color: rgba(255,255,255,.75); white-space: nowrap; }
@media (max-width: 480px) { .wordmark small { display: block; margin-left: 0; } }
.header-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.header-nav a, .header-nav button { color: #fff; text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.header-nav form { margin: 0; }
.site-footer { color: var(--muted); font-size: 13px; padding: 32px 0; }
main { padding: 8px 0 24px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.flash { padding: 10px 14px; border-radius: 8px; margin: 12px 0; }
.flash.success { background: var(--ok-bg); }
.flash.error { background: var(--error-bg); color: var(--error); }
.notice { background: var(--warn-bg); border-radius: 8px; padding: 10px 14px; margin: 12px 0; }
.notice ul { margin: 4px 0 0; padding-left: 20px; }
.notice.bad { background: var(--error-bg); color: var(--error); }

form.stack label, .field { display: block; margin: 0 0 12px; font-weight: 600; font-size: 14px; }
form.stack label input, form.stack label select, form.stack label textarea, .field input, .field select, .field textarea { display: block; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], select, textarea {
    width: 100%; max-width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
input[type=number] { max-width: 110px; }
textarea { min-height: 80px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
.checks { display: flex; gap: 6px 14px; flex-wrap: wrap; font-weight: 400; }
.checks label { font-weight: 400; display: inline-flex; align-items: center; gap: 6px; margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; }
legend { font-weight: 600; font-size: 14px; padding: 0 4px; }

.btn, button.btn { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 8px;
    padding: 9px 16px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--brand-dark); }
.btn.accent { background: var(--accent); color: #1c2230; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.link-btn { background: none; border: 0; color: var(--error); cursor: pointer; font: inherit; font-size: 13px; padding: 0; }
form.inline { display: inline; margin: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
td.num, th.num { text-align: right; }
.pill { display: inline-block; background: var(--soft); color: var(--brand); border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 600; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; padding: 6px 0 6px 36px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 6px; width: 24px; height: 24px; border-radius: 50%;
    background: var(--soft); color: var(--brand); font-weight: 700; text-align: center; line-height: 24px; font-size: 13px; }
.steps li.done::before { content: "✓"; background: var(--brand); color: #fff; }
.hero { padding: 40px 0 8px; }
.hero h1 { font-size: 38px; max-width: 760px; }
@media (max-width: 600px) { .hero h1 { font-size: 30px; } h1 { font-size: 24px; } .card { padding: 16px; } }
form.stack label.inline-check { display: flex; align-items: center; gap: 8px; }
form.stack label.inline-check input { display: inline; margin: 0; }
table.day-times td { vertical-align: middle; }
table.day-times input[type=time] { max-width: 150px; }
table.day-times tr.off input[type=time] { opacity: .45; }

details.add-more { margin-top: 14px; }
details.add-more > summary { list-style: none; display: inline-block; }
details.add-more > summary::-webkit-details-marker { display: none; }
details.add-more[open] > summary { margin-bottom: 12px; }
td.row-actions { white-space: nowrap; text-align: right; }
td.row-actions a { font-size: 13px; margin-right: 10px; }
table.weeks th, table.weeks td { text-align: center; padding: 6px 4px; min-width: 34px; }
table.weeks th:first-child, table.weeks td:first-child { text-align: left; min-width: 0; }
table.weeks td.zero { color: var(--muted); }
table.weeks td.over { background: #fde8e8; color: var(--error); font-weight: 700; }
.share-link { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.share-link input { flex: 1 1 320px; min-width: 0; }
tr.day-start td { border-top: 2px solid var(--line); }
td.me { font-weight: 700; }

/* Month calendar */
.view-toggle { flex: 0 0 auto !important; width: auto !important; display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.view-toggle a { padding: 7px 14px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--brand); }
.view-toggle a.on { background: var(--brand); color: #fff; }
.month { margin: 0 0 24px; }
.month-title { margin: 0 0 8px; }
table.month-grid { table-layout: fixed; width: 100%; border: 1px solid var(--line); }
table.month-grid th { text-align: center; padding: 6px 2px; border: 1px solid var(--line); }
table.month-grid td { height: 92px; padding: 4px; border: 1px solid var(--line); font-size: 12px; line-height: 1.3; }
table.month-grid td.out { background: var(--soft); opacity: .5; }
table.month-grid .day-num { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.cal-game { padding: 3px 0; border-top: 1px dotted var(--line); overflow-wrap: anywhere; }
.cal-game .t { font-weight: 700; }
.cal-game .div { display: inline-block; background: var(--soft); color: var(--brand); border-radius: 4px; padding: 0 4px; font-size: 11px; font-weight: 600; }
.cal-game .v { display: block; color: var(--muted); font-size: 11px; }
.cal-game .me { font-weight: 700; }
.print-only { display: none; }
@media (max-width: 700px) {
    table.month-grid td { height: auto; font-size: 11px; padding: 2px; }
    .cal-game .v { display: none; }
}
@media print {
    @page { size: landscape; margin: 0.4in; }
    body { background: #fff; }
    .site-header, .site-footer, .no-print, .flash, .crumbs { display: none !important; }
    .print-only { display: block; }
    main.wrap { max-width: none; padding: 0; }
    .card { box-shadow: none; border: 0; padding: 0; }
    .month { page-break-after: always; break-after: page; margin: 0; }
    .month:last-child { page-break-after: auto; break-after: auto; }
    table.month-grid td { height: 1.05in; }
    table.month-grid td.out { opacity: 1; background: #f2f2f2; }
    a { color: inherit; text-decoration: none; }
}

.venue-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 16px; }
.venue-checks label.inline-check { align-items: flex-start; font-weight: 400; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.venue-checks label.inline-check input { margin-top: 3px; }

/* Instructions pop-up */
.header-nav button.nav-link { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; }
dialog.help { border: 0; border-radius: 12px; padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
    box-shadow: 0 20px 60px rgba(0,0,0,.3); color: inherit; }
dialog.help::backdrop { background: rgba(20, 30, 50, .55); }
dialog.help .help-body { padding: 22px 24px 8px; overflow-y: auto; max-height: calc(100vh - 140px); }
dialog.help h2 { margin-top: 0; }
dialog.help ol { padding-left: 20px; margin: 0 0 12px; }
dialog.help li { margin-bottom: 8px; }
dialog.help .help-foot { display: flex; justify-content: flex-end; padding: 12px 24px 20px; border-top: 1px solid var(--line); }

.btn:disabled, button.btn:disabled { opacity: .45; cursor: not-allowed; }
.sport-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 20px 0 4px; }
.sport-list .pill { font-size: 14px; padding: 4px 12px; }
.grid > .card { margin: 0; }
.grid.features { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.game-actions { white-space: nowrap; }
.game-actions a { font-size: 13px; margin-right: 10px; }
a.cal-game { display: block; color: inherit; text-decoration: none; }
a.cal-game:hover { background: var(--soft); }
form.stack p.hint { margin: -4px 0 12px; }
.offers { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); margin-top: 12px; }
.offer { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; }
.offer h3 { margin: 0 0 6px; }
.offer p { flex: 1; margin: 0 0 12px; }
.offer .btn { align-self: flex-start; }
.offer.best { border-color: var(--accent); }

/* Landing: free, no limits */
.free-badge { display: inline-block; margin: 0 0 12px; padding: 4px 12px; border-radius: 999px;
    background: var(--accent); color: #1c2230; font-weight: 700; font-size: 14px; }
.free-card { border-color: var(--accent); margin-top: 24px; }
.free-list { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 8px 24px;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.free-list li { padding-left: 26px; position: relative; }
.free-list li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
