:root {
  --ink: #183630;
  --muted: #6b7c76;
  --line: #dce5dd;
  --paper: #f7f8f3;
  --cream: #eef1e7;
  --white: #ffffff;
  --pine: #123c32;
  --pine-dark: #0b2d25;
  --lime: #d9ef5c;
  --lime-deep: #afca20;
  --coral: #d95f4d;
  --shadow: 0 14px 30px rgba(23, 59, 49, 0.08);
  --lifted-shadow: 0 22px 48px rgba(18, 58, 47, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

html[data-theme="dark"] {
  --ink: #e9f1eb;
  --muted: #a7b9af;
  --line: #2b473b;
  --paper: #09120f;
  --cream: #17261f;
  --white: #101c17;
  --pine: #17493a;
  --pine-dark: #0c3026;
  --lime: #cae856;
  --lime-deep: #c8de46;
  --coral: #e87967;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  --lifted-shadow: 0 24px 56px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body { position: relative; isolation: isolate; margin: 0; min-width: 320px; background: radial-gradient(circle at 8% 12%, rgba(203, 229, 136, .22), transparent 22rem), radial-gradient(circle at 92% 74%, rgba(108, 167, 135, .13), transparent 24rem), var(--paper); }
body::before { content: ""; pointer-events: none; position: fixed; z-index: 0; inset: 0; opacity: .32; background-image: radial-gradient(rgba(18, 60, 50, .13) .7px, transparent .7px); background-size: 14px 14px; mask-image: linear-gradient(to bottom, black, transparent 78%); }
body::after { content: ""; pointer-events: none; position: fixed; z-index: 0; top: -390px; right: -335px; width: min(61vw, 700px); aspect-ratio: 1; border: 1px solid rgba(43, 116, 77, .24); border-radius: 50%; box-shadow: 0 0 0 42px rgba(130, 179, 63, .06), 0 0 0 126px rgba(70, 130, 98, .05); }
html[data-theme="dark"] body { background: radial-gradient(circle at 8% 12%, rgba(100, 151, 75, .14), transparent 22rem), radial-gradient(circle at 92% 74%, rgba(23, 91, 70, .19), transparent 24rem), var(--paper); }
html[data-theme="dark"] body::before { opacity: .22; background-image: radial-gradient(rgba(221, 239, 214, .11) .7px, transparent .7px); }
html[data-theme="dark"] body::after { border-color: rgba(202, 232, 86, .27); box-shadow: 0 0 0 42px rgba(202, 232, 86, .05), 0 0 0 126px rgba(48, 127, 92, .11); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { position: relative; z-index: 1; width: min(1180px, calc(100% - 40px)); margin: 0 auto 72px; }
.background-illustrations { position: fixed; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; }
.background-illustrations img { position: absolute; filter: drop-shadow(0 14px 16px rgba(18, 56, 46, .13)); }
.background-paddle { top: 116px; left: max(-42px, calc((100vw - 1320px) / 2)); width: 116px; transform: rotate(-24deg); opacity: .92; }
.background-ball { top: 44%; right: max(12px, calc((100vw - 1360px) / 2)); width: 58px; transform: rotate(12deg); }
.background-pickle { right: max(-22px, calc((100vw - 1320px) / 2)); bottom: -22px; width: 108px; transform: rotate(25deg); opacity: .92; }

.topbar { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: var(--pine); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; font-size: 1.12rem; font-weight: 800; letter-spacing: -0.045em; }
.brand em { font-size: 1rem; font-style: normal; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.text-button { appearance: none; border: 0; padding: 0; color: var(--pine); background: transparent; font-size: .86rem; font-weight: 750; }
.topbar-link { text-decoration: none; }
.text-button:hover { color: #558519; }
.theme-toggle { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; background: rgba(255,255,255,.46); color: var(--ink); font-size: .72rem; font-weight: 800; box-shadow: 0 3px 8px rgba(18, 55, 45, .05); }
.theme-toggle:hover { border-color: var(--lime-deep); transform: translateY(-1px); }
.theme-toggle-icon { display: grid; width: 16px; height: 16px; place-items: center; border-radius: 50%; background: var(--pine); color: var(--lime); font-size: .8rem; line-height: 1; }

.eyebrow { margin: 0 0 9px; color: #84a89b; font-size: .67rem; line-height: 1; font-weight: 800; letter-spacing: .14em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.65rem, 6vw, 4.85rem); letter-spacing: -.075em; line-height: .96; font-weight: 500; }
h2 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1; letter-spacing: -.055em; font-weight: 500; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin: 10px clamp(8px, 3.3vw, 43px) 43px; position: relative; z-index: 1; }
.stat-card { position: relative; overflow: hidden; min-height: 126px; padding: 21px 23px; border: 1px solid var(--line); border-radius: 13px; background: var(--white); box-shadow: 0 8px 18px rgba(22, 56, 48, .06); display: flex; flex-direction: column; }
.stat-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #bcd77e; opacity: .85; }
.stat-card--accent { border-color: var(--lime); background: var(--lime); }
.stat-card--accent::before { background: var(--pine); }
.stat-label { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: .65rem; font-weight: 800; }
.stat-card--accent .stat-label { color: #4d630c; }
.stat-card strong { padding-top: 5px; font-family: Georgia, "Times New Roman", serif; font-size: 2.5rem; font-weight: 500; letter-spacing: -.06em; line-height: 1; }
.stat-detail { margin-top: auto; color: var(--muted); font-size: .75rem; }

.setup-panel, .session-panel { border: 1px solid var(--line); border-radius: 18px; background: var(--white); box-shadow: var(--shadow); }
.setup-panel { padding: clamp(25px, 5vw, 52px); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding-bottom: 31px; }
.section-heading > p { max-width: 320px; margin-bottom: 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.setup-grid { display: grid; grid-template-columns: minmax(220px, .66fr) 1.34fr; gap: 38px; padding: 27px 0 30px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.court-form, .player-adder { min-width: 0; }
label { display: block; margin-bottom: 10px; color: var(--ink); font-size: .85rem; font-weight: 800; }
.stepper { width: 100%; max-width: 255px; height: 51px; display: grid; grid-template-columns: 51px 1fr 51px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
.stepper-button { border: 0; background: var(--cream); color: var(--pine); font-size: 1.45rem; line-height: 1; }
.stepper-button:hover { background: #e2e8d9; }
.stepper input { min-width: 0; border: 0; border-right: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--white); text-align: center; color: var(--pine); font-weight: 800; outline-color: var(--lime-deep); }
input[type=number]::-webkit-inner-spin-button { appearance: none; }
.field-help { margin: 9px 0 0; color: var(--muted); font-size: .75rem; }
.add-form { display: flex; gap: 9px; }
.add-form input, .add-form textarea { width: 100%; min-width: 0; min-height: 51px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); outline-color: var(--lime-deep); color: var(--ink); resize: vertical; box-shadow: inset 0 1px 2px rgba(18, 56, 46, .04); }
.add-form .primary-button { height: 51px; }
.primary-button, .outline-button, .danger-button { border-radius: 8px; font-weight: 800; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.primary-button { min-width: max-content; border: 1px solid var(--pine); background: var(--pine); color: white; padding: 0 18px; font-size: .84rem; box-shadow: 0 4px 0 rgba(7, 38, 30, .2); }
.primary-button:hover:not(:disabled) { background: var(--pine-dark); transform: translateY(-2px); box-shadow: 0 6px 0 rgba(7, 38, 30, .15); }
.primary-button:disabled { cursor: not-allowed; background: #aebdb5; border-color: #aebdb5; }
.quick-actions { margin-top: 10px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .75rem; }
.setup-players { display: flex; flex-wrap: wrap; gap: 8px; min-height: 0; }
.setup-players:not(:empty) { padding-top: 25px; }
.player-tag { display: inline-flex; align-items: center; gap: 7px; padding: 7px 8px 7px 11px; border: 1px solid #d9e4d8; border-radius: 999px; color: var(--pine); background: #f7faf5; font-size: .78rem; font-weight: 700; box-shadow: 0 2px 4px rgba(18, 56, 46, .04); }
.tag-delete { display: grid; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; place-items: center; background: #e3ebe0; color: var(--pine); font-size: 1rem; line-height: 1; }
.tag-delete:hover { background: #cedac9; }
.setup-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 28px; }
.setup-footer p { margin: 0; color: var(--muted); font-size: .83rem; }
.primary-button--large { height: 48px; padding: 0 21px; font-size: .88rem; }
.primary-button--large span { margin-left: 7px; font-size: 1.05rem; }

.session-panel { padding: clamp(25px, 5vw, 52px); }
.session-heading { padding-bottom: 28px; }
.session-actions { display: flex; align-items: center; gap: 10px; }
.outline-button { border: 1px solid #b9ccc3; background: transparent; color: var(--pine); padding: 10px 14px; font-size: .78rem; }
.outline-button:hover { border-color: var(--pine); background: #f3f7f2; }
.add-court-button { border: 1px solid var(--pine); border-radius: 8px; padding: 10px 13px; background: var(--pine); color: white; font-size: .78rem; font-weight: 800; }
.add-court-button span { margin-right: 2px; font-size: 1rem; line-height: 0; }
.add-court-button:hover:not(:disabled) { background: var(--pine-dark); }
.add-court-button:disabled { cursor: not-allowed; border-color: #c0ccc6; background: #c0ccc6; }
.court-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(276px, 1fr)); gap: 18px; }
.court-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcf9; }
.court-card--empty { border-style: dashed; background: #fafbf8; }
.court-topline { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.court-header-actions { display: flex; align-items: center; justify-content: end; gap: 6px; }
.court-number { color: var(--pine); font-size: .78rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.court-status { padding: 5px 7px; border-radius: 99px; background: #e4eee2; color: #517042; font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.close-court-button { border: 1px solid #d8bab3; border-radius: 99px; padding: 5px 7px; background: #fffafa; color: #a95a4e; font-size: .61rem; font-weight: 800; }
.close-court-button:hover:not(:disabled) { border-color: #c77b6f; background: #fcedea; }
.close-court-button:disabled { cursor: not-allowed; border-color: #dde4de; background: #f6f8f5; color: #a4afa8; }
.court-visual { position: relative; isolation: isolate; display: grid; grid-template-rows: 1fr .68fr 1fr; width: min(100%, 252px); aspect-ratio: 1 / 1.9; margin: 15px auto 0; padding: 8px; overflow: visible; background: #0e7dca; box-shadow: 0 7px 16px rgba(15, 80, 120, .19); }
.team { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; padding: 25px 10px 12px; background: linear-gradient(135deg, #28ad62, #42bd6c); }
.team::after { content: ""; position: absolute; z-index: 0; top: 0; bottom: 0; left: 50%; width: 3px; transform: translateX(-50%); background: rgba(255,255,255,.95); }
.team--far { border: 3px solid rgba(255,255,255,.96); border-bottom-width: 2px; }
.team--near { padding: 12px 10px 25px; border: 3px solid rgba(255,255,255,.96); border-top-width: 2px; }
.team-label { position: absolute; z-index: 1; left: 11px; color: rgba(7, 75, 37, .7); font-size: .57rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.team--far .team-label { top: 9px; }
.team--near .team-label { bottom: 9px; }
.team-slots { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.court-player { min-width: 0; display: grid; grid-template-columns: 25px minmax(0, 1fr); align-items: center; gap: 5px; padding: 5px; border: 1px solid rgba(255,255,255,.94); border-radius: 5px; background: rgba(255,255,255,.97); color: #183630; font-size: .66rem; font-weight: 800; box-shadow: 0 2px 4px rgba(15, 63, 51, .15); }
.court-player--open { border-style: dashed; background: rgba(231, 246, 235, .26); color: rgba(255,255,255,.95); box-shadow: none; }
.court-player .initial { display: grid; width: 25px; height: 25px; border-radius: 50%; place-items: center; background: var(--lime); color: var(--pine); font-size: .59rem; font-weight: 850; }
.court-player .initial--open { background: rgba(255,255,255,.24); color: white; font-size: 1rem; }
.court-player-name { min-width: 0; overflow-wrap: anywhere; line-height: 1.15; }
.no-show-button { grid-column: 1 / -1; width: 100%; border: 0; border-radius: 4px; padding: 2px 4px; background: #fde4df; color: #9f4438; font-size: .57rem; font-weight: 850; }
.no-show-button:hover { background: #f8ccc4; }
.court-net { position: relative; z-index: 1; display: grid; place-items: center; margin: 0; border-right: 3px solid rgba(255,255,255,.96); border-left: 3px solid rgba(255,255,255,.96); background: linear-gradient(135deg, #e3aa2a, #f0b93a); color: transparent; font-size: 0; }
.court-net::after { content: ""; position: absolute; z-index: 2; top: 50%; right: -16px; left: -16px; height: 5px; transform: translateY(-50%); border-top: 2px solid rgba(255,255,255,.96); background: #2f4035; box-shadow: 0 3px 3px rgba(22, 38, 30, .35); }
.court-actions { display: flex; gap: 9px; margin-top: 13px; }
.court-actions button { height: 37px; }
.finish-button { flex: 1; border: 0; border-radius: 7px; background: var(--pine); color: white; font-size: .73rem; font-weight: 800; }
.finish-button:hover { background: var(--pine-dark); }
.court-empty-message { margin: 13px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.4; text-align: center; }

.queue-section { margin-top: 47px; padding-top: 32px; border-top: 1px solid var(--line); }
.queue-header { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.queue-total { color: var(--muted); font-size: .78rem; }
.next-callout { margin: 21px 0 13px; min-height: 72px; display: flex; align-items: center; gap: 14px; padding: 13px 17px; border: 1px solid #c9db67; border-radius: 10px; background: #f4f9d8; }
.next-callout .next-label { color: #5c7211; font-size: .65rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.next-callout strong { color: var(--pine); font-size: .95rem; }
.next-callout p { margin: 0; color: #60705c; font-size: .8rem; }
.queue-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: queue; }
.queue-list li { min-height: 57px; display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); font-size: .78rem; font-weight: 700; }
.queue-list li::before { counter-increment: queue; content: counter(queue); display: grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--cream); color: var(--muted); font-size: .63rem; font-weight: 800; }
.queue-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-no-show { flex: 0 0 auto; margin-left: auto; border: 0; padding: 3px 0; background: transparent; color: #b25b4f; font-size: .65rem; font-weight: 800; }
.queue-no-show:hover { color: var(--coral); }
.queue-empty { grid-column: 1 / -1; justify-content: center; color: var(--muted); font-weight: 500 !important; }
.queue-empty::before { display: none !important; }

.roster-section { margin-top: 43px; padding-top: 31px; border-top: 1px solid var(--line); }
.roster-actions { display: flex; align-items: center; gap: 17px; }
.inline-add-form { display: flex; align-items: stretch; min-height: 35px; }
.inline-add-form input, .inline-add-form textarea { width: 144px; min-width: 0; min-height: 47px; padding: 8px 9px; border: 1px solid var(--line); border-right: 0; border-radius: 7px 0 0 7px; background: var(--white); color: var(--ink); outline-color: var(--lime-deep); font-size: .72rem; resize: vertical; }
.inline-add-form .primary-button { border-radius: 0 7px 7px 0; padding: 0 10px; font-size: .7rem; }
.roster-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(192px, 1fr)); gap: 9px; margin-top: 20px; }
.roster-row { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: .78rem; }
.roster-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; }
.roster-status { flex: 0 0 auto; color: var(--muted); font-size: .67rem; }
.roster-row.is-out { border-color: #e5c6bf; background: #fffafa; color: #a05c52; text-decoration: line-through; }
.roster-row.is-out .roster-status { color: #b06358; text-decoration: none; }
.roster-row.is-playing .roster-status { color: #648119; }
.roster-remove { flex: 0 0 auto; border: 0; background: transparent; color: #93a29c; font-size: 1.1rem; }
.roster-remove:hover { color: var(--coral); }
.roster-section.is-collapsed .roster-list { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.is-hidden { display: none !important; }
.toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; max-width: min(360px, calc(100% - 48px)); padding: 12px 15px; border: 1px solid rgba(197, 225, 107, .45); border-radius: 10px; background: #123c32; color: white; box-shadow: 0 14px 32px rgba(8, 35, 27, .22); font-size: .8rem; font-weight: 700; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.confirm-dialog { width: min(410px, calc(100% - 32px)); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--white); color: var(--ink); box-shadow: 0 20px 70px rgba(0,0,0,.27); }
.confirm-dialog::backdrop { background: rgba(10, 36, 29, .5); }
.confirm-dialog form { position: relative; padding: 31px 29px 29px; }
.confirm-dialog form::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 5px; background: linear-gradient(90deg, var(--lime), #8bb941); }
.confirm-dialog h2 { margin-bottom: 12px; }
.confirm-dialog p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); font-size: .87rem; line-height: 1.45; }
.action-confirm-form { padding: 26px 29px 29px !important; }
.action-confirm-form::before { display: none; }
.action-confirm-context { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.action-confirm-context .eyebrow { margin: 0; }
.action-confirm-art { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 16px 16px 16px 5px; background: #e9f0c5; transform: rotate(-5deg); }
.action-confirm-art img { width: 36px; height: 36px; transform: rotate(5deg); }
.action-confirm-initial { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 50%; background: var(--pine); color: var(--lime); font-size: .86rem; font-weight: 900; transform: rotate(5deg); }
#actionConfirmDialog[data-kind="remove"] .action-confirm-art { border-radius: 16px 5px 16px 16px; background: #f5dfda; transform: rotate(5deg); }
#actionConfirmDialog[data-kind="remove"] .action-confirm-context .eyebrow { color: #b15b4d; }
#actionConfirmDialog[data-kind="no-show"] .action-confirm-art { background: #f4ebbd; border-radius: 50% 16px 16px 16px; transform: rotate(-3deg); }
#actionConfirmDialog[data-kind="no-show"] .action-confirm-context .eyebrow { color: #87711c; }
.action-confirm-form h2 { max-width: 330px; font-size: 2rem; line-height: 1.03; }
.action-confirm-form .dialog-actions { margin-top: 27px; }
html[data-theme="dark"] .action-confirm-art { background: #34451b; }
html[data-theme="dark"] #actionConfirmDialog[data-kind="remove"] .action-confirm-art { background: #402522; }
html[data-theme="dark"] #actionConfirmDialog[data-kind="remove"] .action-confirm-context .eyebrow { color: #ed9b90; }
html[data-theme="dark"] #actionConfirmDialog[data-kind="no-show"] .action-confirm-art { background: #4b421d; }
html[data-theme="dark"] #actionConfirmDialog[data-kind="no-show"] .action-confirm-context .eyebrow { color: #ddd078; }
.dialog-actions { display: flex; justify-content: end; gap: 9px; margin-top: 23px; }
.danger-button { border: 1px solid var(--coral); padding: 10px 13px; background: var(--coral); color: white; font-size: .78rem; }
.danger-button:hover { background: #bb4a3b; }

button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(175, 202, 32, .55); outline-offset: 2px; }

html[data-theme="dark"] .theme-toggle { background: #15251e; border-color: #365446; color: var(--ink); box-shadow: none; }
html[data-theme="dark"] .brand, html[data-theme="dark"] .text-button, html[data-theme="dark"] .court-number { color: #e7f1ea; }
html[data-theme="dark"] .brand em, html[data-theme="dark"] .text-button:hover { color: var(--lime); }
html[data-theme="dark"] .stat-card { background: #122019; border-color: #2f493d; box-shadow: 0 8px 20px rgba(0,0,0,.22); }
html[data-theme="dark"] .stat-card--accent { background: var(--lime); color: #17392e; border-color: var(--lime); }
html[data-theme="dark"] .stat-card--accent .stat-detail { color: #4d630c; }
html[data-theme="dark"] .setup-panel, html[data-theme="dark"] .session-panel { background: linear-gradient(145deg, #111f19, #0d1914); }
html[data-theme="dark"] .stepper-button { background: #1c2e26; color: var(--lime); }
html[data-theme="dark"] .stepper-button:hover { background: #284235; }
html[data-theme="dark"] .stepper input, html[data-theme="dark"] .add-form input, html[data-theme="dark"] .add-form textarea, html[data-theme="dark"] .inline-add-form input, html[data-theme="dark"] .inline-add-form textarea { background: #0c1712; border-color: #355244; color: var(--ink); }
html[data-theme="dark"] .player-tag { border-color: #3b5749; background: #17261f; color: #d9f069; }
html[data-theme="dark"] .tag-delete { background: #2b4438; color: var(--ink); }
html[data-theme="dark"] .court-card { background: #122019; border-color: #304b3d; }
html[data-theme="dark"] .court-card--empty { background: #101c17; }
html[data-theme="dark"] .court-status { background: #263d31; color: #c4dfcf; }
html[data-theme="dark"] .outline-button { border-color: #527364; color: var(--ink); }
html[data-theme="dark"] .outline-button:hover { background: #1d3027; border-color: #8ba794; }
html[data-theme="dark"] .next-callout { border-color: #78982a; background: #263b17; }
html[data-theme="dark"] .next-callout strong { color: #e4f3a0; }
html[data-theme="dark"] .next-callout p { color: #c3d1bd; }
html[data-theme="dark"] .queue-list li, html[data-theme="dark"] .roster-row { background: #132019; border-color: #304a3d; }
html[data-theme="dark"] .queue-list li::before { background: #22352b; color: #b7c8be; }
html[data-theme="dark"] .roster-row.is-out { background: #2b1c1a; border-color: #6a3c36; color: #e69b8f; }
html[data-theme="dark"] .roster-row.is-out .roster-status { color: #e69b8f; }
html[data-theme="dark"] .roster-row.is-playing .roster-status { color: #cee974; }
html[data-theme="dark"] .confirm-dialog { background: #122019; }
html[data-theme="dark"] .close-court-button { border-color: #754d48; background: #2a1c1a; color: #efaa9f; }
html[data-theme="dark"] .toast { border-color: #526d30; background: #1d3027; box-shadow: 0 14px 32px rgba(0,0,0,.35); }

.guide-shell { width: min(940px, calc(100% - 40px)); }
.guide-grid { display: grid; max-width: 780px; padding-top: clamp(18px, 4vw, 42px); }
.guide-step { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 21px; align-items: start; min-height: 0; padding: 27px 0; border: 0; border-top: 1px solid var(--line); background: transparent; box-shadow: none; }
.guide-step-art { display: grid; width: 62px; height: 62px; place-items: center; border-radius: 20px 20px 20px 5px; background: var(--cream); transform: rotate(-6deg); }
.guide-step-art img { max-width: 45px; max-height: 48px; transform: rotate(6deg); }
.guide-step-art--roster, .guide-step-art--noshow { background: #e9f0c5; border-radius: 24px 8px 24px 8px; transform: rotate(7deg); }
.guide-step-art--teams, .guide-step-art--current { background: #d7ebd1; transform: rotate(5deg); }
.guide-step-art--rotate { background: #dfeea6; border-radius: 50%; transform: rotate(-9deg); }
.guide-step-art--rotate img { max-width: 40px; }
.guide-step-number { display: block; margin: 0 0 8px; color: var(--lime-deep); font-size: .67rem; font-weight: 900; letter-spacing: .13em; }
.guide-step h2 { margin: 0 0 8px; font-size: 1.42rem; }
.guide-step p { max-width: 560px; margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.52; }
.guide-note { position: relative; overflow: hidden; max-width: 780px; margin-top: 18px; padding: 25px 110px 25px 28px; border: 1px solid #d2e0b1; border-left: 5px solid var(--lime-deep); border-radius: 4px 16px 16px 4px; background: var(--cream); }
.guide-note::after { content: ""; position: absolute; right: 25px; bottom: -11px; width: 78px; height: 78px; background: url("favicon.svg") center / contain no-repeat; transform: rotate(-20deg); opacity: .74; }
.guide-note h2 { margin-bottom: 9px; font-size: 1.35rem; }
.guide-note p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.5; }
html[data-theme="dark"] .guide-step { border-color: #304b3d; }
html[data-theme="dark"] .guide-step-art { background: #21362b; }
html[data-theme="dark"] .guide-step-art--roster, html[data-theme="dark"] .guide-step-art--noshow { background: #3a4323; }
html[data-theme="dark"] .guide-step-art--teams, html[data-theme="dark"] .guide-step-art--current { background: #1e3b30; }
html[data-theme="dark"] .guide-step-art--rotate { background: #34451b; }
html[data-theme="dark"] .guide-note { border-color: #5b733c; background: #17261f; }

@media (max-width: 760px) {
  .app-shell { width: min(100% - 26px, 620px); margin-bottom: 34px; }
  .guide-shell { width: min(100% - 26px, 620px); }
  .topbar { min-height: 70px; }
  .stats { margin: 0 8px 30px; gap: 8px; }
  .stat-card { min-height: 99px; padding: 15px 12px; }
  .stat-card strong { font-size: 2.05rem; }
  .stat-detail { display: none; }
  .stat-label { font-size: .58rem; }
  .setup-panel, .session-panel { padding: 25px 19px; }
  .section-heading { align-items: start; flex-direction: column; gap: 12px; padding-bottom: 23px; }
  .session-heading { flex-direction: row; align-items: center; }
  .setup-grid { grid-template-columns: 1fr; gap: 27px; padding: 23px 0; }
  .stepper { max-width: none; }
  .quick-actions { flex-wrap: wrap; }
  .setup-footer { align-items: stretch; flex-direction: column; }
  .primary-button--large { width: 100%; }
  .court-grid { grid-template-columns: 1fr; }
  .queue-list { grid-template-columns: repeat(2, 1fr); }
  .queue-header { align-items: start; }
  .roster-actions { align-items: end; flex-direction: column; gap: 11px; }
  .inline-add-form input, .inline-add-form textarea { width: 113px; }
}

@media (max-width: 410px) {
  .topbar-actions { gap: 12px; }
  .brand { font-size: 1rem; }
  .theme-toggle { padding: 7px; }
  .theme-toggle #themeToggleLabel { display: none; }
  .session-actions { gap: 6px; }
  .add-court-button, .outline-button { padding-right: 9px; padding-left: 9px; }
  .add-form { flex-direction: column; }
  .add-form .primary-button { height: 45px; }
  .toast { right: 13px; bottom: 13px; max-width: calc(100% - 26px); }
  .background-paddle { top: 230px; left: -52px; width: 92px; opacity: .55; }
  .background-ball { right: 5px; width: 42px; }
  .background-pickle { width: 82px; }
  .guide-step { grid-template-columns: 58px minmax(0, 1fr); gap: 14px; }
  .guide-step-art { width: 52px; height: 52px; border-radius: 16px 16px 16px 4px; }
  .guide-step-art img { max-width: 38px; max-height: 41px; }
  .guide-note { padding-right: 84px; }
  .guide-note::after { right: 11px; font-size: 67px; }
  .queue-list { grid-template-columns: 1fr; }
}
