/* Matches the palette, type stack and content structure of css-new.css / standings.php. */
:root {
    --text-color: #333;
    --body-bg: #f8f8f8;
    --container-bg: #fff;
    --page-content-bg: #f5f5f5;
    --link-color: #444;
    --link-hover-color: #305785;
    --table-caption-bg: #444;
    --table-caption-color: #fff;
    --table-alt-row-bg: #f9f9f9;
    --table-odd-row-bg: #fff;
    --border-color: #ccc;
    --muted: #606060;
}
* { box-sizing: border-box; }
html { overflow-y: scroll; }
body { margin: 0; font: 18px 'Open Sans', Arial, sans-serif; color: var(--text-color); background: var(--body-bg); }
a { color: var(--link-color); text-decoration: none; }
a:hover { color: var(--link-hover-color); }
#container { width: 80%; max-width: 1200px; margin: 3% auto; background: var(--container-bg); box-shadow: 0 0 8px rgba(0,0,0,.1); }
#page_header { height: 140px; margin: 10px 0; text-align: center; }
#page_header a { display: flex; height: 140px; align-items: center; justify-content: center; }
#page_header img { display: block; max-width: 100%; max-height: 140px; width: auto; height: auto; object-fit: contain; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; border-top: 2px solid #000; padding: 15px 10px; }
.site-nav a { padding: 6px 10px; font-size: 14px; }
.site-nav a:hover { background: rgba(0,0,0,.05); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
#page_content { padding: 25px; background: var(--page-content-bg); font-size: 14px; }
.intro { text-align: center; margin: 0 auto 24px; }
.intro h1 { font-size: 24px; font-weight: 600; line-height: 1.3; margin: 0 0 10px; }
.intro p { margin: 0 auto; max-width: 65ch; color: var(--muted); line-height: 1.6; }
.season-label { text-align: center; font-size: 14px; margin: 0 0 20px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
input, textarea { width: 100%; min-width: 0; border: 1px solid var(--border-color); border-radius: 5px; padding: 10px 12px; font: inherit; line-height: 1.4; color: var(--text-color); background: #fff; }
input { min-height: 44px; }
textarea { resize: vertical; }
button { min-height: 44px; border: 1px solid #444; border-radius: 5px; padding: 10px 16px; background: #444; color: #fff; font: 600 14px 'Open Sans', Arial, sans-serif; cursor: pointer; }
button:hover { background: #333; border-color: #333; }
:where(input, textarea, button, a, summary):focus-visible { outline: 3px solid #305785; outline-offset: 3px; }
button:disabled { opacity: .6; cursor: wait; }
input:read-only, textarea:read-only { background: #f0f0f0; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.6; }
.login { max-width: 380px; margin: 0 auto 20px; padding: 24px; background: #fff; border-radius: 5px; box-shadow: 0 2px 6px rgba(0,0,0,.05); }
.login input { font-size: 22px; letter-spacing: 3px; }
.login button { width: 100%; margin-top: 16px; }
.login .hint { margin: 14px 0 0; }
.message { margin: 0 0 20px; padding: 14px 16px; border-left: 4px solid #305785; background: #eaf0f6; line-height: 1.6; }
.error { border-color: #a53232; background: #fae8e5; color: #7d2424; }
.add-event, .schedule { margin: 0 0 25px; background: #fff; border-radius: 5px; box-shadow: 0 2px 6px rgba(0,0,0,.05); }
.add-event > summary { cursor: pointer; padding: 12px 16px; background: var(--table-caption-bg); color: var(--table-caption-color); font-size: 15px; font-weight: 400; border-radius: 5px; }
.add-event[open] > summary { border-radius: 5px 5px 0 0; }
.create-form { display: grid; grid-template-columns: minmax(0,2fr) minmax(150px,1fr); gap: 18px; padding: 20px; }
.full-width { grid-column: 1 / -1; }
.create-form > .hint { margin: 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; background: var(--table-caption-bg); color: var(--table-caption-color); border-radius: 5px 5px 0 0; }
.section-title h2 { font-size: 15px; font-weight: 400; margin: 0; }
.section-title span { font-size: 12px; white-space: nowrap; }
.event { display: grid; grid-template-columns: 48px minmax(120px,1fr) 165px auto; gap: 16px; align-items: end; padding: 18px 16px; margin: 0; border-bottom: 1px solid #eee; background: var(--table-odd-row-bg); }
.event:nth-of-type(even) { background: var(--table-alt-row-bg); }
.event:last-child { border-bottom: 0; border-radius: 0 0 5px 5px; }
.date-stamp { align-self: center; text-align: center; color: #444; }
.date-stamp span { display: block; font-size: 12px; }
.date-stamp strong { font-size: 26px; font-weight: 600; line-height: 1.2; }
.empty { margin: 0; padding: 24px 16px; color: var(--muted); }
footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 2px solid #000; padding: 15px 0 0; color: var(--muted); font-size: 12px; }
footer p { margin: 0; line-height: 1.6; }
.text-button { background: transparent; border-color: transparent; color: #444; text-decoration: underline; padding: 8px 10px; font-weight: 400; }
.text-button:hover { color: #305785; background: rgba(0,0,0,.05); border-color: transparent; }
#ai-status:empty { display: none; }
[hidden] { display: none !important; }
@media (max-width: 1050px) {
    .event { grid-template-columns: 40px minmax(100px,1fr) 155px; gap: 12px; }
    .event > .event-actions { grid-column: 2 / -1; justify-self: end; }
}
@media (max-width: 640px) {
    body { font-size: 14px; }
    #container { width: 100%; margin: 0; padding: 0 5px; }
    #page_content { padding: 20px 12px; }
    .site-nav { gap: 0; padding: 8px 0; }
    .site-nav a { font-size: 12px; padding: 10px 8px; }
    .intro h1 { font-size: 21px; }
    .create-form { grid-template-columns: minmax(0,1fr); padding: 16px; gap: 16px; }
    .event { grid-template-columns: 38px minmax(0,1fr); padding: 16px 12px; }
    .date-stamp { grid-row: 1 / 3; }
    .event .field { grid-column: 2; }
    .event > .event-actions { grid-column: 2; justify-self: stretch; }
    input, textarea { font-size: 16px; }
    .section-title { gap: 10px; padding: 12px; }
    .section-title h2 { font-size: 14px; }
    footer { align-items: flex-start; flex-direction: column; gap: 4px; }
}
.ai-field { position: relative; }
.ai-field > input, .ai-field > textarea { padding-right: 58px; }
.ai-field > textarea { display: block; min-height: 104px; }
.ai-wand { position: absolute; right: 2px; top: 2px; width: 40px; min-height: 40px; height: 40px; padding: 9px; border: 0; background: transparent; color: #606060; }
.ai-wand:hover { background: #ededed; color: #305785; }
.ai-wand svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ai-wand.is-generating { color: #305785; background: #eaf0f6; }
.ai-meter { width: 100%; max-width: 240px; margin: 0; opacity: .85; }
.meter-heading, .meter-scale { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.meter-heading label { margin: 0; }
.meter-heading output, .meter-scale { font-size: 12px; color: var(--muted); }
.ai-meter input[type="range"] { display: block; padding: 0; margin: 0; width: 100%; height: 26px; min-height: 26px; accent-color: #888; background: transparent; border: 0; cursor: pointer; }
.ai-meter .meter-heading label, .ai-meter .meter-heading output, .ai-meter .meter-scale { font-size: 11px; font-weight: 400; color: var(--muted); }
.seed-label { display: block; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.seed-heading { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.seed-heading .seed-label { margin: 0; }
.seed-refresh { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; min-height: 30px; padding: 5px; border: 0; border-radius: 50%; background: transparent; color: #606060; }
.seed-refresh:hover { background: #e5e5e5; color: #305785; }
.seed-refresh:focus-visible { outline: 2px solid #305785; outline-offset: 2px; }
.seed-refresh svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.seed-refresh-status { font-size: 11px; color: var(--muted); }
.seed-options { display: flex; flex-wrap: wrap; gap: 7px; }
.seed-options .seed-pill { min-height: 32px; padding: 5px 11px; border: 1px solid #d5d5d5; border-radius: 18px; background: #f6f6f6; color: #555; font-size: 12px; font-weight: 400; }
.seed-options .seed-pill:hover { background: #e9eef2; border-color: #9eafbe; }
.seed-options .seed-pill[aria-pressed="true"] { background: #e2edf7; border-color: #597b9c; color: #244b70; box-shadow: inset 0 0 0 1px #597b9c; }
.seed-pill:focus-visible { outline: 2px solid #305785; outline-offset: 2px; }
.ai-meter input:disabled { opacity: .6; cursor: wait; }
.ai-feedback:has(#ai-status:empty):has(#ai-undo[hidden]) { display: none; }
.ai-feedback .hint { margin: 0; }
.ai-feedback .text-button { padding-left: 0; font-size: 12px; }
.event { scroll-margin-top: 20px; }
.event-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.event-actions > button { width: 100%; }
.event.event-saved { animation: saved-row 1.4s ease-out; }
.save-confirmation { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #23713e; animation: saved-check .3s ease-out; }
.save-confirmation svg { width: 22px; height: 22px; }
.save-confirmation circle { fill: #23713e; }
.save-confirmation path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes saved-row { from { background-color: #dcefe2; } }
@keyframes saved-check { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .event.event-saved, .save-confirmation { animation: none; } }
.thinking-dots { display: inline-flex; width: 1.2em; }
.thinking-dots > span { animation: thinking-dot 1.2s steps(1, end) infinite; }
.thinking-dots > span:nth-child(2) { animation-delay: .2s; }
.thinking-dots > span:nth-child(3) { animation-delay: .4s; }
@keyframes thinking-dot { 0%, 100% { opacity: .2; } 40%, 80% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .thinking-dots > span { animation: none; } }
.calendar-hint { margin: 0; padding: 14px 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.month-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 16px; background: #e1e1e1; }
.month-heading h3 { margin: 0; font-size: 14px; font-weight: 600; }
.month-status { font-size: 12px; text-align: right; }
.month-created { color: #205f35; }
.month-review { color: #744700; font-weight: 600; }
.month-missing { color: #555; }
.month-empty { margin: 0; padding: 14px 16px; color: var(--muted); font-size: 13px; }
.past-event { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 16px; padding: 18px 16px; color: var(--muted); font-size: 13px; }
.past-event > strong { font-weight: 400; overflow-wrap: anywhere; }
.past-event .date-stamp { grid-row: auto; }
@media(max-width: 640px) { .month-heading { padding: 11px 12px; } .past-event { grid-template-columns: 38px minmax(0, 1fr); padding: 16px 12px; gap: 10px; } }
.month-event-id { color: #737373; font-size: 12px; font-weight: 400; white-space: nowrap; }
.month-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.month-add { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; border: 1px solid #b5d7bd; border-radius: 50%; background: #e9f5ec; color: #23713e; }
.month-add[hidden] { display: none; }
.month-add:hover { background: #d3ebda; color: #19562d; }
.month-add:focus-visible { outline: 3px solid #23713e; outline-offset: 3px; }
.month-add:disabled { opacity: .5; cursor: wait; }
.month-add svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.add-event { scroll-margin-top: 20px; }
.name-label { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.name-label label { margin: 0; }
.event:not(.event-reading) { align-items: start; }
.event .field > label, .event .name-label, .create-form > div > label[for="new-date"] { display: flex; align-items: center; min-height: 22px; margin-bottom: 6px; }
.event:not(.event-reading) > .date-stamp { align-self: start; margin-top: 28px; }
.event:not(.event-reading) > .event-actions { padding-top: 28px; }
.event .ai-feedback { margin-top: 8px; }
.event .ai-feedback:has([data-ai-status]:empty):has([data-ai-undo][hidden]) { display: none; }
@media (max-width: 1050px) { .event:not(.event-reading) > .event-actions { padding-top: 0; } }
.name-help { position: relative; display: inline-flex; }
.name-help-button { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; min-height: 22px; padding: 0; border: 1px solid #aaa; border-radius: 50%; background: #f4f4f4; color: #555; font-size: 12px; cursor: help; }
.name-help-button:hover { background: #e5e5e5; color: #333; }
.name-help-button:focus-visible { outline: 2px solid #305785; outline-offset: 2px; }
.name-help-tip { position: absolute; z-index: 10; top: calc(100% + 8px); left: -115px; width: 260px; max-width: calc(100vw - 90px); padding: 12px; border-radius: 6px; background: #333; color: #fff; box-shadow: 0 3px 12px #0003; font-size: 12px; font-weight: 400; line-height: 1.5; }
.event.event-reading { grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; }
.event-preview { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.event-preview strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.event-reading > .event-actions { grid-column: 3; justify-self: end; }
.event-reading .date-stamp { grid-row: auto; }
.event-actions > .event-edit { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 8px; background: transparent; color: #606060; }
.event-actions > .event-edit:hover { background: #e5e5e5; color: #305785; }
.event-edit:focus-visible { outline: 2px solid #305785; outline-offset: 2px; }
.event-edit svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 640px) { .event.event-reading { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; } }
