/* Muffin Moose: the page styles (moved out of index.html so phones cache them; scripts/stamp.mjs versions the link). */
/* Breakpoints: five widths only, so every tab changes layout at the same places (CSS can't use variables in @media):
     380px  small phones (iPhone SE / mini)          @media (max-width: 380px)
     430px  phones (every current iPhone)            @media (max-width: 430px)
     640px  large phones and small tablets           @media (max-width: 639.98px)  /  (min-width: 640px)
     900px  tablets, laptops; above it the TV board  @media (max-width: 900px)
    1100px  computers: Sports in two columns, cards two across   @media (min-width: 1100px)
   tests/frontend-escaping.test.mjs fails if a new width sneaks in. */
:root {
  /* Muffinman design language: brand purple #514285, clean cards, small caps labels. Dark palette = Muffinman dark. */
  --bg: #0d0d0f; --bg2: #252529; --card: #1a1a1f; --card2: #232328;
  --line: #34343a; --text: #f5f5f7; --muted: #a8a8b0; --dim: #8e8e93;
  --brand: #6a55a8; --brand2: #7b5ba1; --accent: #b9a3e3; --brandbar: #4f3f8a;
  --live: #ff453a; --ok: #48bb78; --warn: #ecc94b; --bad: #f56565; --kids: #ffb37a;
  --bears: #c83803; --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  --tabbar-h: 0px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
/* Light: Muffinman's light palette (white cards on a soft grey page, purple brand). */
html[data-theme="light"] { color-scheme: light;
  --bg: #f5f5f7; --bg2: #ececf0; --card: #ffffff; --card2: #f6f6f9; --line: #e0e0e6; --text: #141418; --muted: #55555f; --dim: #7c7c86;
  --brand: #514285; --brand2: #514285; --accent: #514285; --brandbar: #514285;
  --live: #e0245e; --ok: #2f9e5b; --warn: #b7791f; --bad: #e53e3e; --kids: #9a4a00;
  --shadow: 0 1px 2px rgba(20,20,40,.06), 0 4px 14px rgba(20,20,40,.06); --shadow-lg: 0 16px 40px rgba(30,20,60,.18); }
html[data-theme="light"] .card.fav { background: linear-gradient(180deg, #f1edfb, var(--card)); border-color: #cfc3ec; }
html[data-theme="light"] .team.mine .nm { color: var(--text); }
html[data-theme="light"] .ch.have, html[data-theme="light"] .tile .acts .mark.on, html[data-theme="light"] .mark.on, html[data-theme="light"] .seenrow button, html[data-theme="light"] .newsfilter button.act, html[data-theme="light"] h2 .h2acts button { color: var(--ok); }
html[data-theme="light"] .badge.person { background: #ece7f8; color: #3d2f8a; } html[data-theme="light"] .badge.coach { color: #a03a08; background: #fde6d8; } html[data-theme="light"] .badge.src { background: #f3f2f7; border-color: #cfcddb; }
html[data-theme="light"] body.tv { background: var(--bg); }
html[data-theme="light"] .stile .sweek i.d { color: var(--muted); }
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); background: var(--bg); color: var(--text); line-height: 1.4;
       -webkit-font-smoothing: antialiased; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); min-height: 100vh; }
/* Text size: the Aa button cycles these. Every font size is in rem, so bumping the root size scales
   the type without changing the layout width (no sideways scrolling on a phone). */
html { background: var(--bg); color-scheme: dark; font-size: 20.5px; }  /* default: body text lands around 17px, like the Claude app */
html[data-size="lg"] { font-size: 23px; }
html[data-size="xl"] { font-size: 26px; }
html.tv { font-size: 18px; }                /* the TV layout has its own big sizes; keep its base closer to design */
html.tv[data-size="lg"] { font-size: 20px; }
html.tv[data-size="xl"] { font-size: 22px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand2); outline-offset: 2px; }

/* ---- header: Muffinman's purple app bar · moose + wordmark (opens More) · tabs (wide screens) · refresh ---- */
header { position: sticky; top: 0; z-index: 10; background: var(--brandbar); color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 2px 10px rgba(30,20,60,.18);
         padding: calc(6px + env(safe-area-inset-top)) 12px 6px; min-height: calc(56px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; background: none; border: 0; padding: 2px 6px 2px 2px; cursor: pointer; border-radius: 12px; color: #fff; min-height: 44px; }
.brand:hover { background: rgba(255,255,255,.08); }
.brand[aria-expanded="true"] { background: rgba(255,255,255,.14); }
.brand .mark { width: 38px; height: 38px; display: block; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.brand .mark img { width: 100%; height: 100%; display: block; }
.brand .wordmark { font-family: "Great Vibes", "Snell Roundhand", "Brush Script MT", cursive; font-size: 1.6rem; line-height: 1; white-space: nowrap; padding-top: 4px; letter-spacing: .01em; }
/* The big stacked wordmark is for the TV layout only. */
.brand .word { display: none; flex-direction: column; align-items: flex-start; line-height: 1; margin-left: 2px; }
.brand .script { font-family: "Great Vibes", "Snell Roundhand", "Brush Script MT", cursive; font-weight: 400; font-size: 3rem; line-height: .95; color: #fff; padding: 0 4px 0 2px; }
.brand .moose { font-size: 0.9375rem; font-weight: 600; letter-spacing: .5em; color: rgba(255,255,255,.75); text-transform: uppercase; padding: 4px 0 0 3px; margin-top: 1px; border-top: 1px solid rgba(255,255,255,.4); align-self: stretch; }
.spacer { flex: 1; }
/* Tabs in the header on wide screens (phones use the tab bar at the bottom). */
.views { display: flex; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.views::-webkit-scrollbar { display: none; }
.views button { position: relative; background: transparent; border: 0; color: rgba(255,255,255,.82); font-size: 0.75rem; font-weight: 600; padding: 9px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap; min-height: 40px; }
.views button:hover { background: rgba(255,255,255,.1); color: #fff; }
.views button.on { background: rgba(255,255,255,.18); color: #fff; }
.pip { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--live); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--brandbar); }
.newsfilter button.act { margin-left: auto; color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
header .btn { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 999px; height: 40px; min-width: 40px; padding: 0 12px;
              font-size: 12px; font-weight: 700; letter-spacing: .04em; display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; }
header .btn:hover { background: rgba(255,255,255,.2); }
header .btn#refresh { padding: 0; width: 40px; } header .btn#refresh svg { width: 18px; height: 18px; }
header .btn.spin svg { animation: spin 1s linear infinite; }
/* The Moose bar button: a search pill on wide screens, a round icon on phones (moose.css styles the bar itself) */
.moosebtn { display: inline-flex; align-items: center; gap: 8px; height: 40px; min-width: 40px; padding: 0 10px 0 12px; margin-right: 8px; border: 0; border-radius: 999px;
  background: rgba(255,255,255,.14); color: rgba(255,255,255,.88); font: inherit; font-size: 14px; cursor: pointer; transition: background .15s; }
.moosebtn:hover { background: rgba(255,255,255,.22); }
.moosebtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.moosebtn svg { width: 18px; height: 18px; flex: none; }
.moosebtn .moosetxt { min-width: 9.5em; text-align: left; }
.moosebtn .moosekbd { font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 4px 6px; border-radius: 6px; background: rgba(255,255,255,.16); color: #fff; }
@media (pointer: coarse) { .moosebtn .moosekbd { display: none; } }
@media (max-width: 639.98px) { .moosebtn { width: 40px; padding: 0; justify-content: center; } .moosebtn .moosetxt, .moosebtn .moosekbd { display: none; } }
html.bar .moosebtn { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- More sheet: the other tabs as tiles, then settings ---- */
.menu { position: fixed; top: calc(var(--header-h, 56px) + 8px); left: 12px; z-index: 40; width: 340px; max-width: calc(100vw - 24px); background: var(--card); color: var(--text);
        border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 4px; }
.menu .mgrab { display: none; }
.menu .mgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 6px; }
.menu .mtile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line);
               background: var(--card2); color: var(--text); font-size: 0.625rem; font-weight: 600; line-height: 1.15; text-align: center; cursor: pointer; }
.menu .mtile .ico { width: 24px; height: 24px; color: var(--brand2); }
.menu .mtile:hover, .menu .mtile:focus-visible { border-color: var(--brand2); }
.menu .mhead { margin: 8px 4px 2px; font-size: 0.625rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.menu .mrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 4px; min-height: 48px; font-size: 0.75rem; color: var(--text); border-top: 1px solid var(--line); }
.menu .btn { min-width: 84px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font-size: 13px; font-weight: 700; cursor: pointer; }
.menu .btn[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.menu .mbtns { display: flex; gap: 6px; }
.menu .onlybar { display: none; } body.bar .menu .onlybar { display: flex; } body.bar .menu { top: 6rem; left: 1.6rem; }

/* ---- phone tab bar: Sports · Tracker · Grocery · Watch · More ---- */
.tabbar { display: none; }
@media (max-width: 900px) {
  :root { --tabbar-h: 62px; }
  header .views { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
            padding: 4px 4px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: none; border: 0; color: var(--dim); font-size: 11px; font-weight: 600; cursor: pointer; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
  .tabbar .ico { width: 25px; height: 25px; }
  .tabbar button.on { color: var(--brand2); }
  html[data-theme="dark"] .tabbar button.on { color: var(--accent); }
  .tabbar .pip { top: 2px; right: calc(50% - 22px); box-shadow: 0 0 0 2px var(--card); }
  /* the sheet rises from the bottom on phones */
  .menu { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-width: none; border-radius: 20px 20px 0 0; border-bottom: 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 85vh; overflow-y: auto; animation: rise .22s ease-out; }
  .menu .mgrab { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 2px auto 10px; }
  body.sheet::after { content: ""; position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.35); }
  body.bar .tabbar { display: none; }
  body.bar { --tabbar-h: 0px; }
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 430px) { header { gap: 6px; padding-left: 8px; padding-right: 8px; } .brand .mark { width: 36px; height: 36px; } .brand .wordmark { font-size: 1.45rem; } }
@media (max-width: 380px) { .brand .wordmark { font-size: 1.3rem; } }
/* Collapsible sections: tap the heading */
#sportsView section > h2 { cursor: pointer; user-select: none; }
#sportsView section > h2::after { content: "⌄"; margin-left: auto; font-size: 1rem; color: var(--dim); transition: transform .15s; }
section.collapsed > h2::after { transform: rotate(-90deg); }
section.collapsed > :not(h2) { display: none !important; }

/* ---- section tabs (sports) ---- */
#nav { display: flex; gap: 6px; padding: 10px 16px 8px; overflow-x: auto; scrollbar-width: none; position: sticky; top: var(--header-h, 56px); z-index: 9; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
#nav::-webkit-scrollbar { display: none; }
#nav a { flex: 0 0 auto; font-size: 0.75rem; font-weight: 600; color: var(--muted); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
#nav a.active { color: #fff; background: var(--brand); border-color: var(--brand); }

main { padding: 8px 16px 40px; max-width: 760px; margin: 0 auto; }
section { margin-top: 26px; scroll-margin-top: calc(var(--header-h, 56px) + 56px); }
h2 { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
h2 .count { background: var(--card2); color: var(--muted); border-radius: 999px; font-size: 0.6875rem; padding: 1px 7px; text-transform: none; letter-spacing: 0; }
/* Buttons that sit in a section heading (Sports stories: Mark older / Mark all read); clicks on them don't fold the section */
h2 .h2acts { display: flex; gap: 6px; text-transform: none; letter-spacing: 0; }
h2 .h2acts button { background: var(--bg2); border: 1px solid rgba(53,196,110,.4); color: #7fe0a4; border-radius: 999px; padding: 4px 10px; font-size: 0.75rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
#news > h2 { flex-wrap: wrap; row-gap: 6px; }
@media (max-width: 639.98px) { #news > h2::after { order: 1; } #news > h2 .h2acts { order: 2; flex-basis: 100%; } }
h3 { font-size: 0.75rem; color: var(--dim); margin: 14px 0 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tabs { display: flex; gap: 6px; margin: 0 0 10px; }
.tabs button { background: var(--bg2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 6px 12px; font-size: 0.8125rem; font-weight: 600; cursor: pointer; }
.tabs button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.legend { font-size: 0.6875rem; color: var(--dim); margin: 6px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
.legend .ch { font-size: 0.625rem; padding: 1px 6px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.card.fav { border-color: #4a3d86; background: linear-gradient(180deg, #221d36, var(--card)); }
.empty { color: var(--dim); font-size: 0.875rem; padding: 14px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.error { color: var(--warn); font-size: 0.75rem; }
.quiet { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 0 8px; }

/* ---- game row ---- */
.game { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; position: relative; }
.game .go { position: absolute; top: 10px; right: 12px; font-size: 0.6875rem; color: var(--dim); }
.teams { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.team { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; font-weight: 600; min-width: 0; }
.team img { width: 22px; height: 22px; object-fit: contain; flex: 0 0 auto; }
.team .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team .rec { color: var(--dim); font-size: 0.75rem; font-weight: 500; }
.ball { flex: 0 0 auto; font-size: 0.8em; margin-left: 2px; }
.pstats { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 3px; font-size: 0.75rem; border-top: 1px solid var(--line); padding-top: 6px; }
.pstats:empty { display: none; }
.pstats div { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.pstats b { font-weight: 600; margin-right: 2px; }
.pstats span { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pstats small { font-family: inherit; color: var(--dim); font-size: 0.85em; margin-left: 3px; }
body.tv .pstats { font-size: 1rem; gap: 5px; }
/* Game leaders (passing / rushing / receiving, top performer...): on the big screens only */
.gleaders { display: none; grid-column: 1 / -1; flex-direction: column; gap: 3px; font-size: 0.8rem; border-top: 1px solid var(--line); padding-top: 6px; } .gleaders:empty { display: none !important; }
body.tv .gleaders, body.bar .gleaders { display: flex; font-size: 0.95rem; gap: 5px; }
.gleaders div { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; } .gleaders i { font-style: normal; color: var(--dim); font-size: 0.85em; text-transform: uppercase; letter-spacing: .06em; min-width: 2.6em; }
.gleaders b { font-weight: 600; } .gleaders em { font-style: normal; color: var(--dim); font-size: 0.85em; } .gleaders span { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.ball.rz { filter: drop-shadow(0 0 4px var(--live)); }
.team.mine .nm { color: #fff; }
.team.loser { opacity: .6; }
.score { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 1.25rem; font-weight: 700; text-align: right; display: flex; flex-direction: column; gap: 6px; padding-top: 14px; }
.score.pre { font-size: 0.875rem; font-family: var(--sans); font-weight: 600; color: var(--text); }
.meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.75rem; color: var(--muted); padding-top: 6px; border-top: 1px solid var(--line); margin-top: 2px; }
.meta .status { font-weight: 600; color: var(--text); }
.meta .status.live { color: var(--live); }
.meta .status.live::before, .stat-label .live-tag::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-right: 5px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.lg { font-size: 0.625rem; font-weight: 700; letter-spacing: .06em; color: var(--dim); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; }
.ch { display: inline-flex; align-items: center; gap: 4px; background: var(--card2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; font-weight: 600; color: var(--text); }
.ch.have { border-color: rgba(53,196,110,.5); color: #7fe0a4; }
.ch.have::before { content: "✓"; font-size: 0.625rem; }
.ch.missing { color: var(--dim); text-decoration: line-through; }
.ch .svc { color: var(--dim); font-weight: 500; }
.spacer { flex: 1; }
/* "Last night" finals: the Mark all read row under the heading; cards reuse the tile action pills below */
.seenrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.75rem; color: var(--dim); margin: -2px 0 10px; }
.seenrow button { white-space: nowrap; flex: 0 0 auto; }
.game .recap { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 8px; font-size: 0.875rem; line-height: 1.45; }
.game .recap b { display: block; margin-bottom: 4px; }
.game .recap p { margin: 0; color: var(--muted); }
.game .recap summary { list-style: none; color: var(--accent); font-size: 0.8125rem; font-weight: 600; cursor: pointer; margin-top: 6px; }
.game .recap summary::-webkit-details-marker { display: none; }
.game .recap .story { white-space: pre-line; color: var(--muted); margin-top: 6px; }
body.tv .game .recap { font-size: 1.0625rem; }
body.tv .game .acts .open, body.tv .game .acts button, body.tv .seenrow button { font-size: 1rem; padding: 8px 16px; }
body.tv .seenrow { font-size: 0.9375rem; }

/* ---- compact slate (Everything tab) ---- */
.slate .row { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; }
.slate .row:last-child { border-bottom: 0; }
.slate .lg { justify-self: start; }
.slate .m { min-width: 0; }
.slate .m b { font-weight: 600; }
.slate .m .sub { display: block; color: var(--muted); font-size: 0.75rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slate .r { text-align: right; font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.slate .r.live { color: var(--live); font-weight: 700; }
.slate .r .sc { font-family: var(--mono); font-weight: 700; color: var(--text); font-size: 0.875rem; }
details.more summary { list-style: none; cursor: pointer; color: var(--accent); font-size: 0.8125rem; font-weight: 600; padding: 10px 0; text-align: center; }
details.more summary::-webkit-details-marker { display: none; }

/* ---- team strip ---- */
.strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.strip .grp { grid-column: 1 / -1; margin: 10px 0 0; display: flex; align-items: center; gap: 8px; }
.strip .grp:first-child { margin-top: 0; }
.strip .grp .off { color: var(--dim); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 0.6875rem; border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.strip .grp .glink { margin-left: auto; text-transform: none; letter-spacing: 0; font-size: 0.75rem; font-weight: 600; color: var(--accent);
                     background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.strip .grp .glink:hover { border-color: var(--brand2); }
.tcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; border-top: 3px solid var(--tc, var(--line)); min-height: 96px; }
.tcard .tn { font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.tcard .tn img { width: 24px; height: 24px; }
.tcard .tn small { color: var(--dim); font-weight: 600; font-size: 0.6875rem; margin-left: auto; }
.tcard.college .tn small { color: var(--text); background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 0.75rem; }
.tcard .last, .tcard .next { font-size: 0.875rem; color: var(--muted); margin-top: 8px; line-height: 1.35; }
.tcard .last b, .tcard .next b { color: var(--text); font-weight: 600; }
.tcard .w, .w { color: var(--ok); font-weight: 700; } .tcard .l, .l { color: var(--live); font-weight: 700; }
.tcard .rec { color: var(--dim); font-size: 0.8125rem; }

/* ---- story / newsletter tiles ---- */
.newsfilter { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 8px; padding: 0 16px; }
.newsfilter::-webkit-scrollbar { display: none; }
.newsfilter button { flex: 0 0 auto; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 5px 11px; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.newsfilter button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.tiles { display: grid; gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: start; }
.tile .top { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; font-size: 0.6875rem; color: var(--dim); flex-wrap: wrap; }
.tile .top .when { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tile .h { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.tile .h a:hover { color: var(--accent); }
.tile .by { font-size: 0.75rem; color: var(--muted); }
.tile .thumb { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--card2); grid-column: 2; grid-row: 2 / span 3; }   /* column 2 always: without it the grid put a thumb in column 1, pushing the headline over and the summary down */
.tile .sum { grid-column: 1 / -1; font-size: 0.8438rem; color: var(--text); line-height: 1.5; white-space: pre-line; margin-top: 2px; }
.tile .tags { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
/* action pills: Read story / Mark read on tiles, Box score / Mark read on Last night cards */
.acts { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.game .acts { border-top: 1px solid var(--line); padding-top: 8px; }
.acts .open, .acts button, .seenrow button { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 0.75rem; font-weight: 700; background: var(--card2); color: var(--text); cursor: pointer; }
.acts .open { color: var(--accent); }
.mark.on, .seenrow button { color: #7fe0a4; border-color: rgba(53,196,110,.5); }
.tile.read { opacity: .55; }
.tile.read .sum, .tile.read .thumb { display: none; }
.badge { background: var(--card2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-weight: 700; font-size: 0.625rem; letter-spacing: .04em; color: var(--muted); }
.badge.person { background: rgba(91,74,168,.22); border-color: rgba(163,147,238,.5); color: #c9bff8; }
.badge.coach { background: rgba(200,56,3,.25); border-color: var(--bears); color: var(--kids); }
.badge.src { background: rgba(255,255,255,.06); border-color: #4a4a5e; color: var(--text); }
.auth { text-align: center; }
.auth form { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.auth input { background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 8px 14px; font-size: 0.875rem; width: 200px; }
.auth button { background: var(--brand2); color: #fff; border: 0; border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer; }

/* ---- players ---- */
.pcard { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: start; }
.pcard img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--card2); }
.pcard .pn { font-weight: 700; font-size: 0.9375rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pcard .pn small { color: var(--dim); font-weight: 600; font-size: 0.6875rem; }
.pcard .inj { color: var(--warn); font-size: 0.6875rem; font-weight: 700; }
.pcard .ok-tag { color: var(--ok); font-size: 0.6875rem; font-weight: 700; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 8px; }
.stat { min-width: 44px; }
.stat .v { font-family: var(--mono); font-weight: 700; font-size: 1rem; }
.stat .k { font-size: 0.625rem; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.stat-label { font-size: 0.6875rem; color: var(--dim); margin-top: 8px; text-transform: uppercase; letter-spacing: .05em; }
.stat-label b { text-transform: none; letter-spacing: 0; }
.stat-label .live-tag { color: var(--live); font-weight: 700; }
.fant { margin-top: 8px; font-size: 0.75rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.fant b { color: var(--text); }
.proj { margin-top: 6px; font-size: 0.75rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .plinks { margin-top: 6px; font-size: 0.75rem; }
.pcard .plinks a { color: var(--accent); font-weight: 600; }

.foot { margin-top: 30px; text-align: center; }
.tagline { font-family: "Great Vibes", "Snell Roundhand", cursive; font-size: 1.375rem; color: var(--accent); margin: 0 0 4px; }
footer { color: var(--dim); font-size: 0.6875rem; text-align: center; }
/* ---- Ask (sports questions, answered by Claude with web search; history kept in D1) ---- */
.ask .thread { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 2px 0 6px; }
.ask .msg { max-width: 92%; padding: 9px 12px; border-radius: 14px; font-size: 0.875rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.ask .msg.user { align-self: flex-end; background: var(--brand2); color: #fff; border-bottom-right-radius: 4px; }
.ask .msg.bot { align-self: flex-start; background: var(--card2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ask .msg.bot a { color: var(--accent); text-decoration: underline; }
.ask .msg .src { display: block; margin-top: 6px; font-size: 0.6875rem; color: var(--dim); white-space: normal; }
.ask .msg .src a { color: var(--dim); }
.ask .msg.wait { color: var(--muted); font-style: italic; }
.ask .when { font-size: 0.625rem; color: var(--dim); align-self: center; }
.ask form { display: flex; gap: 8px; margin-top: 10px; }
.ask form input { flex: 1; min-width: 0; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 10px 14px; font-size: 1rem; }
.ask form button { background: var(--brand2); color: #fff; border: 0; border-radius: 999px; padding: 0 16px; font-weight: 700; cursor: pointer; }
.ask form button:disabled { opacity: .5; cursor: default; }
.ask .hint { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.6875rem; color: var(--dim); margin-top: 6px; }
.ask .hint button { background: none; border: 0; color: var(--dim); text-decoration: underline; cursor: pointer; font-size: inherit; padding: 0; }
.ask .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ask .chips button { background: var(--bg2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 4px 10px; font-size: 0.6875rem; cursor: pointer; }
body.tv #ask { display: none; }
/* ---- Tracker view: To do (routine + lists + numbers) and Analytics ---- */
.trhead { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.trhead .tabs { margin: 0; }
.tb { border: 1px solid var(--line); background: var(--card2); color: var(--text); border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 0.8125rem; padding: 6px 12px; font-family: inherit; }
.tb.edit { margin-left: auto; } .tb.edit.on { background: var(--brand2); border-color: var(--brand2); color: #fff; }
.trlist h2 .tb { padding: 3px 9px; font-size: 0.6875rem; text-transform: none; letter-spacing: 0; }
.tritem.sub { padding-left: 28px; min-height: 44px; font-size: 0.9375rem; border-bottom: 1px dashed var(--line); }
.tb.info { width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border-radius: 50%; color: var(--accent); font-size: 0.9375rem; flex: 0 0 auto; font-weight: 700; }
.beerank button.top { color: var(--text); } .beerank button.on { background: #f7da21; border-color: #f7da21; color: #1a1500; } .beerow.top i { opacity: 1; }
.tb.info.on { background: var(--brand2); border-color: var(--brand2); color: #fff; }
.tb.plus { width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border-radius: 50%; color: var(--dim); font-size: 1rem; flex: 0 0 auto; }
.tb.plus.on { background: var(--brand2); border-color: var(--brand2); color: #fff; }
.trtitle { font-size: 1.125rem; letter-spacing: 0; text-transform: none; color: var(--text); margin: 0; }
.trtoggle { font-size: 0.8125rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.trtoggle input { width: 18px; height: 18px; accent-color: var(--brand2); }
.cal-day.all { aspect-ratio: auto; min-height: clamp(44px, 12vw, 64px); border-radius: 10px; padding: 4px 0 5px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; font-size: clamp(0.8125rem, 3.4vw, 1rem); color: var(--text); }
.cal-day.all .cdots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 85%; min-height: 7px; }
.cal-day.all .cdots i { width: clamp(6px, 1.8vw, 8px); height: clamp(6px, 1.8vw, 8px); border-radius: 50%; background: var(--c); } .cal-day.all .cdots i.hollow { background: transparent; border: 1px solid var(--c); }
.cal-day.all.sel { border-color: var(--accent); background: var(--card2); }
.caldetail b { color: var(--text); }
.tritem.sub .tt { color: var(--muted); } .tritem.sub.done .tt { color: var(--dim); text-decoration: line-through; }
.tb.check.sm { width: 26px; height: 26px; font-size: 0.75rem; }
.tritem.sub .tb.done.sm, .tritem.sub .tb.skip.sm, .tritem.sub .tb.fail.sm { width: 32px; height: 32px; font-size: 0.9375rem; }
.habit.sub { margin-left: 18px; padding: 10px 12px; } .habit.sub .hh b { font-size: 0.9375rem; }
.tradd.sub { margin: 6px 0 8px 28px; } .tradd.sub input { padding: 7px 12px; font-size: 0.875rem; }
.tritem .stat { color: var(--dim); font-size: 0.75rem; white-space: nowrap; }
.tritem.done .stat { color: var(--ok); } .tritem.skip .stat { color: var(--warn); } .tritem.fail .stat { color: var(--bad, #ff3b5c); }
.tritem.done .tt, .tritem.skip .tt, .tritem.fail .tt { color: var(--muted); }
.tb.done, .tb.skip, .tb.fail, .tb.check { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; font-size: 1.125rem; border-radius: 50%; }
.tb.done.on { background: var(--ok); border-color: var(--ok); color: #05130a; }
.tb.skip.on { background: var(--warn); border-color: var(--warn); color: #1a1200; }
.tb.fail.on { background: var(--bad, #ff3b5c); border-color: var(--bad, #ff3b5c); color: #fff; }
.tb.check { width: 30px; height: 30px; border-width: 2px; font-size: 0.875rem; }
.tb.check.on { background: var(--ok); border-color: var(--ok); color: #05130a; }
.tb.x { color: var(--live); border-color: rgba(255,59,92,.4); padding: 4px 10px; font-size: 0.75rem; }
.trnote { color: var(--dim); font-size: 0.8125rem; padding: 8px 0; }
.trdays button.on { background: var(--brand2); border-color: var(--brand2); color: #fff; }
/* Numbers: cards that say how it's going */
.ncard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; } .nrun.warn { color: var(--warn); border-color: var(--warn); }
.ncard .nh { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; } .ncard .nh b { font-size: 1rem; } .ncard .nh .hs { margin-left: auto; color: var(--muted); font-size: 0.75rem; }
.nbig .score { font-size: 2.5rem; line-height: 1; font-family: var(--mono); font-variant-numeric: tabular-nums; } .nbig .score.good { color: var(--ok); } .nbig .score.bad { color: var(--live); } .nfacts span.ok { border-color: var(--ok); } .nfacts span.low { border-color: var(--live); }
.ncard .trnote { margin: 8px 0 0; } .habit .hs.good { color: var(--ok); } .habit .hs.bad { color: var(--live); }
.nrow:first-child, .ncard .nh + .nrow { border-top: 0; } .nrow > button.tb { grid-area: n; justify-self: start; }
.nrow .nn small.goal { margin-top: 1px; } .nrow .nn small.means { margin-top: 2px; color: var(--muted); line-height: 1.35; } .nrow .nn small.goal.good { color: var(--ok); } .nrow .nn small.goal.bad { color: var(--live); }
.nrow .band { font-style: normal; font-weight: 700; font-size: 0.6875rem; padding: 1px 7px; border-radius: 999px; background: var(--bg2); color: var(--muted); border: 1px solid var(--line); }
.nrow .band.good { color: var(--ok); border-color: var(--ok); } .nrow .band.bad { color: var(--live); border-color: var(--live); }
.nrow .mval.clockin .tb.now { min-height: 40px; padding: 6px 14px; font-weight: 700; }
.stampnum.past { border-color: var(--warn); } .stampnum.past .nh .hs { color: var(--warn); } .chist .cweek i.good { color: var(--ok); border-color: var(--ok); } .chist .cweek i.late { color: var(--warn); border-color: var(--warn); } .nrow.good .nd { color: var(--ok); }
.tritem:not(.sub) .tt, .tritem.sub .tt { cursor: text; }
/* bigger thumbs, same look: a 40px hit area around the small round buttons */
.tb, .wb, .ws, .lnk, .stile i[data-delmetric] { position: relative; } .tb::after, .wb::after, .ws::after, .lnk::after, .stile i[data-delmetric]::after { content: ""; position: absolute; inset: -6px; }
.stile .sweek i.on { background: var(--c); border-color: var(--c); } .stile .sweek i.td { box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--dim); }
.stile.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, var(--card)); }
.stile.game { grid-column: 1 / -1; cursor: default; }
.recs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 2px; }
.recs span { display: flex; flex-direction: column; font-size: 0.6875rem; color: var(--dim); line-height: 1.2; }
.recs span b { font-size: 1rem; color: var(--text); font-variant-numeric: tabular-nums; }
.recs.big { margin: 2px 0 8px; } .recs.big span b { font-size: 1.25rem; }
.cycle.game { padding-bottom: 2px; }
.relbox .ct { font-size: 0.875rem; font-weight: 600; margin-bottom: 4px; } .relbox .ct small { color: var(--dim); font-weight: 500; margin-left: 6px; }
.rel { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: baseline; padding: 4px 0; font-size: 0.8125rem; }
.rel > span { color: var(--text); } .rel > b { font-variant-numeric: tabular-nums; font-size: 1rem; } .rel > small { grid-column: 1 / -1; color: var(--dim); font-size: 0.6875rem; margin-top: -2px; }
.rel.up > b { color: var(--ok); } .rel.down > b { color: var(--bad); }
.rel.dow { display: flex; gap: 4px; justify-content: space-between; margin-top: 6px; }
.rel.dow span { display: flex; flex-direction: column; align-items: center; font-size: 0.6875rem; color: var(--dim); flex: 1; padding: 6px 0; background: var(--bg2); border-radius: 8px; }
.rel.dow span b { font-size: 0.875rem; color: var(--text); } .rel.dow span.up b { color: var(--ok); } .rel.dow span.down b { color: var(--bad); } .rel.dow span small { font-size: 0.625rem; }
.stile .seg button.on { background: var(--c); border-color: var(--c); color: var(--ct, #fff); }
.stile .sweek i.w { background: #1f8a4c; border-color: #1f8a4c; } .stile .sweek i.l { background: #b3372f; border-color: #b3372f; }
.stile .sweek i.d { background: var(--card2); border-color: var(--dim); color: var(--muted); } .stile .sweek i.p { background: var(--c); border-color: var(--c); opacity: .5; }
/* Game stamps (Basketball) in the month view: win green, loss red, DNP a faded dashed ring; specific enough to beat .cal-day.on below */
.cal-day.on.w { background: #1f8a4c; border-color: #1f8a4c; color: #fff; } .cal-day.on.l { background: #b3372f; border-color: #b3372f; color: #fff; }
.cal-day.on.d { background: transparent; border: 2px dashed var(--dim); color: var(--dim); font-size: clamp(0.625rem, 2.6vw, 0.75rem); } .cal-day.on.p { background: var(--c); border-color: var(--c); color: #fff; opacity: .55; }
.grec { display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; } .grec b { font-weight: 800; white-space: nowrap; } .grec .w { color: #1f8a4c; } .grec .l { color: #d9534a; } .grec .d { color: var(--dim); }
html[data-theme="dark"] .grec .w { color: #4cc98a; }
body.tv .stiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cal-pick button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.cal-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; } .cal-head > b { font-size: 0.9375rem; white-space: nowrap; } .cal-head .hs { color: var(--dim); font-size: 0.75rem; margin-left: auto; }
.cal-head .tb { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; } .cal-head .tb:disabled { opacity: .35; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; max-width: 640px; }   /* fills the screen on a phone; cells and dots scale with it */
.cal-wd { text-align: center; font-size: clamp(0.625rem, 2.6vw, 0.75rem); color: var(--dim); font-weight: 700; padding-bottom: 2px; }
.cal-day.on { background: var(--c, var(--brand2)); border-color: var(--c, var(--brand2)); color: var(--ct, #fff); } .cal-day.today { box-shadow: 0 0 0 2px var(--accent) inset; }
.lock { text-align: center; padding: 24px 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lock .lockico { font-size: 2.25rem; line-height: 1; }
.lock .locktxt { display: flex; flex-direction: column; gap: 4px; } .lock .locktxt b { font-size: 1.0625rem; } .lock .locktxt span { color: var(--muted); font-size: 0.875rem; }
.lock .lockbtn { width: 100%; max-width: 360px; min-height: 48px; background: var(--brand); color: #fff; border: 0; border-radius: var(--radius-sm); padding: 12px 22px; font-weight: 600; font-size: 0.875rem; cursor: pointer; font-family: inherit; box-shadow: var(--shadow); }
.lock details { width: 100%; max-width: 360px; } .lock summary { list-style: none; cursor: pointer; color: var(--accent); font-size: 0.8125rem; font-weight: 600; padding: 4px; }
.lock summary::-webkit-details-marker { display: none; }
.lock form { display: flex; flex-direction: column; gap: 10px; align-items: stretch; margin-top: 10px; }
.lock input { background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 1rem; width: 100%; min-height: 48px; }
.lock input:focus { outline: none; border-color: var(--brand2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand2) 25%, transparent); }
.lock form button { min-height: 48px; background: var(--brand); color: #fff; border: 0; border-radius: var(--radius-sm); padding: 12px 16px; font-weight: 600; font-size: 0.875rem; cursor: pointer; font-family: inherit; }
.tritem.pk { min-height: 44px; }
.habit, .chart { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; } .habit .hs { margin-left: auto; color: var(--muted); font-size: 0.75rem; white-space: nowrap; }
.dot.done { background: var(--ok); border-color: var(--ok); } .dot.skip { background: var(--warn); border-color: var(--warn); } .dot.fail { background: var(--bad, #ff3b5c); border-color: var(--bad, #ff3b5c); } .dot.pending { border-color: var(--accent); }
.dot.off { background: transparent; border-color: rgba(255,255,255,.08); }
.cycle { font-size: 0.875rem; line-height: 1.4; margin: 0 0 10px; padding: 8px 10px; border-left: 3px solid var(--c, var(--accent)); background: var(--card2); border-radius: 0 8px 8px 0; }
.cycle b { color: var(--text); } .cycle small { display: block; color: var(--dim); font-size: 0.75rem; margin-top: 3px; }
.chart .ct { font-size: 0.875rem; font-weight: 600; margin-bottom: 6px; } .chart .ct small { color: var(--dim); font-weight: 500; margin-left: 6px; } svg.bars .base { stroke: var(--line); stroke-width: .4; }
.icard.good { border-left-color: var(--ok); } .icard.now { border-left-color: var(--accent); }
.icard.bottom { border-left-color: var(--accent); background: var(--card2); } .icard.bottom ul { margin: 0; padding-left: 18px; font-size: 0.875rem; line-height: 1.45; } .icard.bottom li { margin: 3px 0; color: var(--muted); } .icard.bottom li b { color: var(--text); } .icard .ih .hs { margin-left: auto; color: var(--dim); font-size: 0.6875rem; text-align: right; }
.ichip.good { color: var(--ok); border-color: var(--ok); }
.ibar.good > i { background: var(--ok); }
.inow.good { border-color: var(--ok); } .inow.good small { color: var(--ok); }
.insights > small.trnote { display: block; font-size: 0.6875rem; }
svg.trend .band { fill: var(--brand2); opacity: .22; } svg.trend .g { stroke: var(--line); stroke-width: .6; }
.tlegend .lb { width: 12px; height: 8px; background: var(--brand2); opacity: .4; border-radius: 2px; } svg.bars .grid { stroke: var(--line); stroke-width: .3; stroke-dasharray: 1 1.2; }
/* ---- Bar view: the menu board on the 55" TV behind the bar (Fire Stick browser, 720p / 1080p) ---- */
/* The board scales with the screen it's on: type sized from both width and height so four columns fill a 27" monitor
   or a 55" TV without scrolling; each column scrolls inside itself if a long slate ever overflows. */
/* (the [data-size] twin outranks html.tv[data-size], so a saved "large text" choice can't blow the board past the screen) */
html.bar, html.bar[data-size] { font-size: clamp(11px, min(1.25vw, 2.1vh), 34px); }
html.bar, html.bar body { height: 100%; overflow: hidden; }
body.bar { background: radial-gradient(80% 50% at 50% 0%, #1e1b2e 0%, var(--bg) 60%); padding-bottom: 0; }
main#barView { max-width: none; padding: 1.1rem 1.8rem .7rem; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: .5rem; margin: 0; box-sizing: border-box; overflow: hidden; }
.barhead { display: flex; align-items: center; gap: .9rem; flex: 0 0 auto; white-space: nowrap; }
.barhead .barbrand { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 12px; flex: 0 0 auto; }
/* Same cropped moose head as the phone header, scaled with the board */
.barhead .barmark { width: 2.6rem; height: 2.6rem; border-radius: .7rem; overflow: hidden; display: block; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.barhead .barmark img { width: 100%; height: 100%; display: block; }
/* The script face's capitals rise well above the line box: give them headroom instead of clipping them */
.bartitle { display: flex; align-items: baseline; gap: .8rem; min-width: 0; overflow: visible; padding: .45rem .3rem .1rem 0; }
.barhead .script { font-family: "Great Vibes", "Snell Roundhand", cursive; font-size: 2.3rem; color: var(--accent); line-height: 1.3; }
.barhead .tagline { font-family: "Great Vibes", "Snell Roundhand", cursive; font-size: 1.5rem; color: var(--muted); line-height: 1.3; }
.barhead .tagline:not(:empty)::before { content: "·"; margin-right: .8rem; color: var(--dim); }
.barhead .barclock { margin-left: auto; font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.barhead .barexit + .barexit { margin-left: .4rem; } :fullscreen #barFullBtn, :-webkit-full-screen #barFullBtn { display: none; }
.barhead .barexit { background: var(--card2); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: .35rem .8rem; font-size: 0.8rem; font-weight: 700; cursor: pointer; margin-left: .8rem; font-family: inherit; }
/* Three columns: Menu (snacks, then drinks) · Bar · Today (my teams two-up, then everything by league). */
.bargrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 2.35fr); gap: 2.2rem; flex: 1; min-height: 0; align-items: start; }
/* Fire TV's Silk browser lays its address bar over the top of the page; leave room for it until the board is full screen */
html.silk main#barView { padding-top: 13vh; } html.silk:fullscreen main#barView, html.silk:-webkit-full-screen main#barView { padding-top: 1.1rem; }
/* .fit wrappers are zoomed by fitBar() in app.js so each column's content lands exactly above the fold */
.bargrid .fit { transform-origin: top left; }
.baropts { display: flex; gap: .4rem; margin-left: auto; } .bargames .barhd { display: flex; align-items: center; gap: .8rem; margin: 0 0 .6rem; } .bargames .barhd h2 { margin: 0; }
.baropt { background: var(--bg2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: .3rem .8rem; font-size: 0.75rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.baropt.on { background: var(--brand2); border-color: var(--brand2); color: #fff; } .baropt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.bar[data-barscope="mine"] .bargames .allonly { display: none; }
.bargrid > section { max-height: 100%; overflow-y: auto; scrollbar-width: none; } .bargrid > section::-webkit-scrollbar { display: none; }
body.bar section > h2 { cursor: default; } body.bar section > h2::after { content: none; } /* the board's columns don't collapse */
.bargames > h3 { font-size: 0.8rem; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; margin: .2rem 0 .5rem; }
.bargames > h3:not(:first-of-type) { margin-top: 1rem; }
.barall .row { grid-template-columns: 52px 1fr auto; padding: .38rem 0; font-size: 0.95rem; }
.barall h3 { font-size: 0.75rem; color: var(--dim); letter-spacing: .12em; text-transform: uppercase; margin: .7rem 0 .2rem; }
.barall h3:first-child { margin-top: 0; }
.barall .m .sub { font-size: 0.72rem; } .barall .r { font-size: 0.72rem; } .barall .r .sc { font-size: 0.85rem; }
.barmenu h2, .bargames h2 { font-size: 1.05rem; color: var(--accent); letter-spacing: .14em; margin: 0 0 .6rem; text-transform: uppercase; }
.barmenu .msec { margin-bottom: .9rem; }
.barmenu h3 { font-size: 0.95rem; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .3rem; display: flex; align-items: center; gap: .5rem; }
.barmenu h3 .age { font-size: 0.65rem; border: 1px solid var(--line); border-radius: 999px; padding: 1px .45rem; color: var(--dim); letter-spacing: .05em; }
/* Read from the bar stools: the item big, what's in it on its own line underneath */
.barmenu .mi { display: flex; flex-direction: column; gap: .05rem; padding: .3rem 0; border-bottom: 1px dashed var(--line); font-size: 1.65rem; font-weight: 600; line-height: 1.15; }
.barmenu .mi small { color: var(--muted); font-weight: 500; font-size: 0.95rem; line-height: 1.25; }
.bargames .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.bargames .cards .card { margin: 0; }
.bargames .empty { font-size: 1.1rem; padding: 1.3rem; }
.barfoot { display: flex; justify-content: space-between; align-items: center; color: var(--dim); font-size: 0.65rem; padding-top: .3rem; border-top: 1px solid var(--line); margin-top: auto; }
.barfoot a { color: var(--accent); font-weight: 600; }
/* opened on a phone by accident: stack the board so it stays readable, and keep the moose and Exit pinned clear of the notch so there's always a way out */
@media (max-width: 900px) { html.bar, html.bar[data-size] { font-size: 14px; } html.bar { height: auto; overflow: auto; } html.bar body { height: auto; overflow: visible; } main#barView { height: auto; overflow: visible; padding: 0 16px calc(.7rem + env(safe-area-inset-bottom)); } .barhead { position: sticky; top: 0; z-index: 20; background: var(--bg); margin: 0 -16px; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; border-bottom: 1px solid var(--line); } .barhead .barexit { min-height: 44px; padding: 0 14px; font-size: 0.9375rem; } body.bar .menu { top: calc(env(safe-area-inset-top) + 66px); left: 10px; } .bargrid { grid-template-columns: 1fr; gap: 1rem; } .bargrid > section { max-height: none; } .bargames { grid-column: auto; } .barhead .tagline { display: none; } .barhead .barclock { font-size: 1.1rem; } }
@media (max-width: 639.98px) { .barhead .barclock, .barhead #barFullBtn { display: none; } .barhead #barExit { margin-left: auto; } }
body.bar .legend { display: none; }
#groceryView .trhead .grcount { margin-left: 2px; font-size: 0.8125rem; color: var(--muted); }
.gradd .more { display: none; width: 100%; grid-template-columns: 1fr 1fr; gap: 6px; } .gradd.open .more { display: grid; }
.grrow { display: flex; flex-wrap: wrap; row-gap: 6px; align-items: center; gap: 14px; margin: 8px 0 2px; font-size: 0.8125rem; color: var(--muted); white-space: nowrap; overflow-x: auto; scrollbar-width: none; } .grrow::-webkit-scrollbar { display: none; } .grrow .trtoggle { display: inline-flex; align-items: center; gap: 6px; }
.grrow .right { margin-left: auto; } .lnk.on { text-decoration: underline; } .calchip.off { color: var(--dim); } .calchip.off i { background: transparent; border: 2px solid var(--c); }
.calchip.kid { border-style: dashed; color: var(--muted); border-color: var(--c, var(--line)); } .calchip.kid.on { background: var(--c, var(--brand2)); border-color: var(--c, var(--brand2)); color: #fff; border-style: solid; }
.calwho.kid { text-transform: none; letter-spacing: 0; color: var(--c, var(--accent)); border-color: var(--c, var(--brand2)); } .calwho.school { color: var(--warn); border-color: var(--warn); } .calwho.sports { color: var(--bears); border-color: var(--bears); } .calwho.lunch { color: var(--c); border-color: var(--c); }
.calev.work .caltitle { font-weight: 500; color: var(--muted); }
.calday { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 4px 0; margin-top: 10px; overflow: hidden; }
.calday h3 { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 10px 14px 4px; font-size: 0.9375rem; } .calday h3 small { color: var(--dim); font-weight: 500; font-size: 0.75rem; }
.calday.today { border-color: var(--brand2); } .calday.today h3 { color: var(--accent); }
.caldetail { grid-area: detail; margin-top: 6px; font-size: 0.8125rem; color: var(--muted); } .caldetail p { margin: 4px 0 0; white-space: pre-line; }
.calcell.today { box-shadow: 0 0 0 2px var(--accent) inset; } .calcell.sel { border-color: var(--accent); background: var(--card); }
.calcell .cdots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 85%; min-height: 7px; } .calcell .cdots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.gtool.on { background: var(--card2); color: var(--text); border-color: var(--brand2); } .gtool.toggle { margin-left: auto; } .gcard h3 .tb { margin-left: auto; }
.gcard.done h3 .gico { color: var(--ok); } .gcard.notes { padding: 4px 14px 12px; }
/* Swipe left (or long press) a row to remove it: the row slides off a red backing that fades in as you pull. */
.gswipe { position: relative; overflow: hidden; }
.gswipe.sw .grow { transition: none; }
.gswact { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 18px; background: linear-gradient(90deg, transparent, #b3261e 40%); color: #fff; font-weight: 700; font-size: 0.875rem; opacity: 0; pointer-events: none; }
.gswipe.armed .gswact { background: #b3261e; } .gtext .gsub.note { color: var(--dim); } .gtext .gsub.alt { color: var(--accent); } .gthumb .gemoji { font-size: 1.5rem; } .gtag.chris { color: var(--accent); border-color: var(--brand2); } .gtag.kids { color: var(--kids); border-color: color-mix(in srgb, var(--kids) 60%, transparent); } .gtag.megan { color: #e06fb0; border-color: #e06fb0; } .grow.gedit .gedhead .tb { padding: 6px 12px; }
.tb.primary { background: var(--brand2); border-color: var(--brand2); color: #fff; } .gpast .gthumb .gemoji { font-size: 1.25rem; }
.gpast.on { border-color: var(--brand2); background: color-mix(in srgb, var(--brand2) 18%, var(--bg2)); } .gpast.on .gplus { background: var(--brand2); border-color: var(--brand2); color: #fff; } .gaskopt .gthumb .gemoji { font-size: 1.25rem; }
.gaskopt.new { border-style: dashed; } .gaskopt.new b { color: var(--accent); } .gscanhead .hs { color: var(--muted); font-size: 0.75rem; flex: 1; } .gscanhead .tb { padding: 4px 10px; }
.gscanrow.new .gsub { color: var(--accent); } .luhead .grcount { flex: 1; font-size: 0.8125rem; color: var(--muted); } .luhead .tb.edit { margin-left: 0; }
.lurow.away .lunm { opacity: .45; text-decoration: line-through; }
.luprefs button.on { background: var(--brand2); border-color: var(--brand2); color: #fff; } .luprefs button.star.on { background: transparent; border-color: var(--warn); color: var(--warn); }
.lusetup .row2, .luteambtns { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 6px; } .tb.big { padding: 10px 18px; font-size: 0.9375rem; } .tb.on { background: var(--brand2); border-color: var(--brand2); color: #fff; } .lugames .tabs { margin: 0; flex: 1; min-width: 0; }
.lugrid th.pos { width: 44px; text-align: left; font-family: var(--mono); font-size: 0.75rem; padding-left: 6px; }
.lugrid tr.line th, .lugrid tr.line td { border-top: 2px solid var(--muted); }
.qlock.on { border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 18%, var(--card)); color: var(--warn); }
.lugrid.haslocks td.locked, .lugrid.haslocks th.locked { background: color-mix(in srgb, var(--warn) 10%, var(--card)); }
.lugrid.haslocks th.locked { box-shadow: inset 0 3px 0 var(--warn); }
.lugrid.haslocks td.locked .chip { color: var(--muted); } .lugrid.haslocks td.locked .chip.off { color: color-mix(in srgb, var(--warn) 70%, var(--muted)); }
.chip { display: block; padding: 9px 2px; border-radius: 8px; font-weight: 700; font-size: 0.9375rem; line-height: 1.1; cursor: pointer; border: 2px solid transparent; user-select: none; overflow-wrap: anywhere; }
.chip.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); } .chip.off { color: var(--warn); } .chip.empty { color: var(--dim); font-weight: 500; }
.lugrid tr.sit td { background: var(--bg2); padding: 4px 2px; } .lugrid tr.sit .chip { display: inline-block; padding: 5px 6px; font-size: 0.8125rem; margin: 1px; max-width: 100%; } .chip.b2b { color: var(--live); }
.chip.add { border: 1px dashed var(--line); color: var(--dim); font-weight: 500; padding: 4px 8px; }
.hpgrid th.pos { width: 40px; padding: 0; }
.hplock.on { color: var(--warn); }
.hpchip.closer b { color: var(--warn); } .hpchip.empty b { color: var(--dim); }
.hpgrid tr.final th, .hpgrid tr.final td { border-bottom: 2px solid var(--muted); }
.hpnum.sel, .hpchip.sel, .hpsitk.sel, .hpover { border-color: var(--accent) !important; background: color-mix(in srgb, var(--accent) 22%, transparent); }
@media (max-width: 430px) { .hpgrid th.pos { width: 32px; } .hpchip b { font-size: 1.0625rem; } .hpchip small { font-size: 10px; } .hpsitk small { display: none; } .hpgrid .hpsith { width: 20%; } }
@media (max-width: 430px) { .qlock { padding: 3px 5px; } .qlock small { display: none; } .lugrid th.pos { width: 30px; padding-left: 3px; font-size: 11px; } .lugrid th, .lugrid td { padding: 1px; } .chip { font-size: 12px; padding: 8px 0; letter-spacing: -0.01em; white-space: nowrap; } .chip.long { font-size: 10.5px; letter-spacing: -0.03em; } .lugrid tr.sit .chip { font-size: 0.75rem; padding: 4px 4px; } }
@media print {
  @page { margin: 10mm; }
  html, body { background: #fff !important; color: #000 !important; }
  body[data-view="lineup"] > :not(#lineupView), #lineupView .noprint, header, nav, #menu { display: none !important; }
  body[data-view="hoops"] > :not(#hoopsView), #hoopsView .noprint { display: none !important; } #hoopsView { display: block !important; max-width: none; padding: 0; }
  .hpchip b, .hpchip small, .hpnum, .hpsitk, .hpnums, .hpnums b { color: #000 !important; } .hpnum b { background: none !important; color: #000 !important; border: 1px solid #000; }
  #lineupView { display: block !important; max-width: none; padding: 0; }
  .luprint b, .luprint span, .lusits, .lusits b { color: #000 !important; } .luprint b { font-size: 20pt; } .luprint span { font-size: 12pt; }
  .lugrid th, .lugrid td { border-color: #000 !important; color: #000 !important; background: #fff !important; }
  .lugrid th { font-size: 11pt; } .chip { font-size: 15pt; padding: 12px 2px; color: #000 !important; border-color: transparent !important; background: none !important; }
  .lugrid tr.sit .chip { font-size: 12pt; padding: 4px 6px; } .chip.add { display: none; } .qmove, .qlock, .lulockbar { display: none; } .lugrid.haslocks td.locked .chip { color: #000 !important; } .lugrid td.na { background: repeating-linear-gradient(45deg, #fff 0 6px, #999 6px 7px) !important; }
  table.printonly { display: table; margin-top: 14px; } .luscore th.pos { width: 34%; font-family: inherit; font-size: 11pt; text-transform: none; letter-spacing: 0; } .luscore td { height: 26px; }
  .lunotes.printonly { display: block; margin-top: 16px; font-size: 12pt; font-weight: 700; min-height: 80px; border-bottom: 1px solid #000; } .chip.off::after { content: " *"; } .lusits { font-size: 11pt; margin-top: 10px; }
} .lgadd .row { display: flex; gap: 6px; }
.lgadd .row input[name="person"] { flex: 0 0 38%; } .lgperson small b.up { color: var(--ok); } .lgperson small b.down { color: var(--bad); }
.lgcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.lgcard.won { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); } .lgcard.lost { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); } .lgcard.push, .lgcard.done { opacity: .8; }
.lgtop { display: flex; align-items: center; gap: 8px; } .lgwhen { margin-left: auto; font-size: 0.6875rem; color: var(--dim); font-weight: 700; }
.lgstmt { font-size: 1rem; line-height: 1.35; } .lgnotes { font-size: 0.8125rem; color: var(--muted); white-space: pre-line; line-height: 1.35; }
.lgnotes { cursor: text; border-radius: 8px; margin: 0 -6px; padding: 2px 6px; } .lgnotes:hover { background: var(--bg2); } .lgnoteedit .wbtns { display: flex; gap: 6px; justify-content: flex-end; }
.lgstate em { font-style: normal; color: var(--accent); text-transform: none; letter-spacing: 0; font-weight: 600; }
.lgstate { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-right: auto; } .lgstate.won { color: var(--ok); } .lgstate.lost { color: var(--bad); }
/* Settle buttons are outlined until tapped, so nothing reads as already chosen */
.wb.win { background: transparent; border-color: color-mix(in srgb, var(--ok) 60%, var(--line)); color: var(--ok); } .wb.lose { background: transparent; border-color: color-mix(in srgb, var(--bad) 60%, var(--line)); color: var(--bad); }
/* What to Watch: tall full-width cards, poster on the left */
.wtabs { overflow-x: auto; scrollbar-width: none; margin: 2px 0 8px; } .wtabs::-webkit-scrollbar { display: none; } .wtabs button { flex: 0 0 auto; }
.wtabs button b { margin-left: 6px; font-size: 0.6875rem; background: var(--brand2); color: #fff; border-radius: 999px; padding: 1px 6px; } .wkinds button.on { background: var(--card2); opacity: 1; }
.wgroup { font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; display: flex; align-items: baseline; gap: 10px; }
.wgroup small { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--dim); } .wcard.rec { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); } .rt.none { color: var(--dim); font-weight: 500; } .wb:disabled { opacity: .45; cursor: default; }
.wb.sm { padding: 5px 10px; font-size: 0.75rem; min-height: 32px; }
.wacts { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: auto; padding-top: 4px; }
.wb { background: var(--card2); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 7px 11px; font-size: 0.8125rem; font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap; }
.wb.on { background: var(--ok); border-color: var(--ok); color: #05130a; } .wb.thumb { padding: 5px 8px; font-size: 1rem; line-height: 1; } .wb.thumb.on { background: var(--brand2); border-color: var(--brand2); }
.wb.add { background: var(--brand2); border-color: var(--brand2); color: #fff; } .wb.ghost { background: transparent; color: var(--muted); } .wb.ghost.danger { color: var(--bad); } .wb.more { margin-left: auto; padding: 5px 9px; }
.wmore { display: flex; gap: 8px; }
.wedit { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: -4px 0 12px; }
.wedit input, .wedit select, .wedit textarea { width: 100%; min-width: 0; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px 11px; font-size: 0.9375rem; font-family: inherit; }
.wedit .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: center; } .wedit .wbtns { display: flex; gap: 6px; justify-content: flex-end; }
.wempty { padding: 14px 0; } .wrow.rec { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); } .wmorerow .wb { padding: 10px 18px; font-size: 0.9375rem; } .wmorerow .wb:disabled { opacity: .6; }
.wkindf { display: inline-flex; gap: 2px; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 2px; flex: 0 0 auto; }
.wkindf button { background: transparent; border: 0; color: var(--muted); font-size: 0.75rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; cursor: pointer; font-family: inherit; } .wkindf button.on { background: var(--card2); color: var(--text); }
.ws.on { background: var(--brand2); border-color: var(--brand2); color: #fff; } .ws.plus { padding: 3px 7px; }
.wstate.new { color: #0d1; background: color-mix(in srgb, var(--ok) 18%, transparent); border-radius: 999px; padding: 3px 8px; }
#watchView .grrow { overflow: visible; white-space: normal; flex-wrap: wrap; row-gap: 6px; } #watchView .grrow .grcount { flex: 1; min-width: 7em;   /* below this it wraps to its own line instead of shrinking to "t…" */ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } #watchView .grrow .trtoggle { flex: 0 0 auto; white-space: nowrap; }
body.tv #wList { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } body.tv .wgroup { grid-column: 1 / -1; }
body.tv main#groceryView { max-width: 1100px; padding: 0 32px 32px; }
#todayBody.stale { opacity: .6; transition: opacity .2s; }   /* last open's cards (app.js mm-today) until fresh scores land */
.skeleton { height: 64px; border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%); background-size: 200% 100%; animation: sh 1.2s infinite; margin-bottom: 8px; }
@keyframes sh { to { background-position: -200% 0; } }
@media (min-width: 640px) { .tile .thumb { width: 120px; height: 76px; } }

/* =====================================================================
   TV mode — for the screen behind the bar. Toggle with the TV button,
   the "t" key, or open ?tv=1. Bigger type, two columns, no tabs.
   ===================================================================== */
body.tv { background: radial-gradient(90% 60% at 50% 0%, #1b1a26 0%, var(--bg) 60%); }
body.tv header { position: static; padding: 18px 32px 14px; gap: 18px; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--brandbar); }
body.tv .brand .mark { width: 64px; height: 64px; border-radius: 16px; }
body.tv .brand .word { display: flex; }
body.tv .views button { font-size: 1rem; padding: 8px 16px; }
body.tv header .btn { height: 44px; min-width: 44px; font-size: 0.9375rem; padding: 0 16px; }
body.tv nav { display: none; }
body.tv main#sportsView { max-width: none; padding: 0 32px 32px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); column-gap: 28px; align-items: start;
               grid-template-areas: "last teams" "today teams" "today news" "foot foot"; }
body.tv #lastnight { grid-area: last; } body.tv #today { grid-area: today; } body.tv #teams { grid-area: teams; } body.tv #news { grid-area: news; } body.tv .foot { grid-area: foot; }
body.tv #players { display: none; }
body.tv main#trackerView { max-width: 1100px; padding: 0 32px 32px; }
body.tv .tiles { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
body.tv section { margin-top: 18px; }
body.tv h2 { font-size: 1.0625rem; margin-bottom: 12px; }
body.tv h2 .count { font-size: 0.8125rem; }
body.tv h3 { font-size: 0.875rem; margin: 18px 0 6px; }
body.tv .tabs button { font-size: 1rem; padding: 8px 16px; }
body.tv .card { padding: 16px 20px; margin-bottom: 12px; border-radius: 18px; }
body.tv .empty { font-size: 1.125rem; padding: 24px; }
body.tv .teams { gap: 10px; }
body.tv .team { font-size: 1.5rem; gap: 12px; }
body.tv .team img { width: 34px; height: 34px; }
body.tv .team .rec { font-size: 0.9375rem; }
body.tv .score { font-size: 2.375rem; gap: 10px; }
body.tv .score.pre { font-size: 1.375rem; }
body.tv .meta { font-size: 1.0625rem; gap: 10px; padding-top: 10px; margin-top: 6px; }
body.tv .meta .status.live::before, body.tv .stat-label .live-tag::before { width: 10px; height: 10px; }
body.tv .lg { font-size: 0.75rem; padding: 2px 7px; }
body.tv .ch { font-size: 1rem; padding: 4px 11px; border-radius: 8px; }
body.tv .ch.have::before { font-size: 0.8125rem; }
body.tv .slate .row { grid-template-columns: 56px 1fr auto; font-size: 1.125rem; padding: 11px 0; gap: 12px; }
body.tv .slate .m .sub { font-size: 0.875rem; }
body.tv .slate .r { font-size: 0.9375rem; }
body.tv .slate .r .sc { font-size: 1.1875rem; }
body.tv details.more summary { display: none; }
body.tv .strip { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
body.tv .strip .grp { font-size: 0.9375rem; margin-top: 14px; }
body.tv .strip .grp .off { font-size: 0.8125rem; }
body.tv .strip .grp .glink { font-size: 0.9375rem; padding: 6px 14px; }
body.tv .tcard { padding: 14px 16px; }
body.tv .tcard .tn { font-size: 1.125rem; }
body.tv .tcard .tn img { width: 24px; height: 24px; }
body.tv .tcard .tn small { font-size: 0.75rem; }
body.tv .tcard .last, body.tv .tcard .next { font-size: 0.9375rem; }
body.tv .tcard .rec { font-size: 0.8125rem; }
body.tv .newsfilter, body.tv h2 .h2acts { display: none; }
body.tv .tile .h { font-size: 1.25rem; }
body.tv .tile .sum { font-size: 1rem; }
body.tv .tile .by, body.tv .tile .top { font-size: 0.875rem; }
body.tv .tile .thumb { width: 132px; height: 84px; border-radius: 10px; }
body.tv .tile .acts { display: none; }
body.tv .badge { font-size: 0.75rem; }
body.tv .foot { margin-top: 20px; }
body.tv .tagline { font-size: 2.125rem; }
body.tv footer { font-size: 0.9375rem; }

/* ---- phones and accessibility ---- */
/* iOS zooms the page when a focused field's text is under 16px: keep every typed field at 16px on touch screens. */
@media (pointer: coarse) { input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: max(16px, 1rem) !important; } }
/* Today card (glance.js): one row on wide screens; on phones the calendar across the top and three small tiles under it */
.glance { margin: 4px 0 18px; }
.gtiles { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
.gtile { display: flex; align-items: flex-start; gap: 10px; min-height: 64px; padding: 12px 14px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.gtile:hover { border-color: var(--brand); } .gtile:active { transform: scale(.98); }
.gtile:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.gico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand2, var(--brand)); }
.gico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.gtxt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.glab { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.glab em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--accent); }
.gtxt b { font-size: 16px; }
.gsub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 639.98px) { .gtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .gtile.wide { grid-column: 1 / -1; }
  .gtile:not(.wide) { flex-direction: column; gap: 6px; padding: 10px 12px; } .gtile:not(.wide) .gsub { display: none; } .gtile:not(.wide) .gtxt b { font-size: 15px; } }
html.tv .glance, html.bar .glance { display: none; }
/* Room held before the scripts fill things in, so nothing below jumps (layout shift): the Today card's placeholder tiles
   (index.html, replaced by glance.js), the Grocery store and Watch list tabs, and the AI box slots on Grocery and Watch. */
.gtile.gskel { cursor: default; box-shadow: none; } .gtile.gskel .gtxt b, .gtile.gskel .gsub { opacity: 0; }
.grstores, .wtabs { min-height: 42px; box-sizing: border-box; }
.aislot { display: flow-root; min-height: 88px; }
#grMain:not(.drawn) > .gcard.notes { display: none; }
.calchips { min-height: 42px; box-sizing: border-box; }   /* the Calendar filter chips fill in after the feed loads */

/* Tab switches (app.js swap): a quick cross-fade; the bars stay put */
header { view-transition-name: mm-header; } .tabbar { view-transition-name: mm-tabbar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
::view-transition-group(mm-header), ::view-transition-group(mm-tabbar) { animation: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
/* a tab whose script failed to load or threw (app.js openModule) */
.viewfail { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); font-size: 0.9375rem; }
.viewfail .chip { min-height: 44px; padding: 0 16px; }
.paused > :not(.viewpaused) { display: none !important; }   /* a tab the heal agent paused keeps its markup for later */
.updatebar { white-space: nowrap; max-width: calc(100vw - 32px); position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; display: flex; gap: 10px; align-items: center; padding: 10px 14px; margin-bottom: var(--tabbar-h); border-radius: 999px; background: var(--card2); color: var(--text); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.35); font-size: 0.9375rem; }
.updatebar button { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--accent, #6b5bd2); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }

/* ---- Fixes tab (fixes.js): what the heal agent found ---- */
#fixesView .trhead > .wb { margin-left: auto; }
.fxrisk { font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; border-radius: 999px; padding: 3px 9px; border: 1px solid var(--line); }
.fxrisk.low { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); } .fxrisk.medium { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); } .fxrisk.high { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.fxrow { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 9px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; font-size: 0.875rem; }
.fxrow .wb { margin-left: auto; }
.fxdot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; } .fxdot.ok { background: var(--ok); } .fxdot.bad { background: var(--bad); } .fxdot.warn { background: var(--warn); }
.fxmeta { font-size: 0.75rem; color: var(--dim); } .fxcount { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 2.5em; }
.fxmsg { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); overflow-wrap: anywhere; min-width: 0; flex: 1 1 60%; }
.wgroup.fxhead { align-items: center; } .wgroup.fxhead .wb { margin-left: auto; text-transform: none; letter-spacing: 0; }
.fxlede { margin: 0 0 10px; font-size: 0.9375rem; line-height: 1.45; color: var(--text); }
.fxidea { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card, 14px); padding: 12px 14px; margin-bottom: 8px; }
.fxidea b { display: block; font-size: 0.9375rem; margin: 6px 0 4px; } .fxidea p { margin: 0 0 4px; font-size: 0.875rem; line-height: 1.45; color: var(--muted); }
.fxidea .fxev { font-size: 0.8125rem; color: var(--dim); }
.fxideatop { display: flex; gap: 6px; flex-wrap: wrap; }
.fxtag { font-size: 0.6875rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: var(--bg2); color: var(--muted); text-transform: capitalize; }
.fxtag.high { background: color-mix(in srgb, var(--brand) 18%, var(--bg2)); color: var(--text); }
.fxbars { display: flex; align-items: flex-end; gap: 3px; height: 56px; padding: 6px 0 2px; }
.fxbars span { flex: 1; height: 100%; display: flex; align-items: flex-end; } .fxbars i { display: block; width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--brand); }
html[data-theme="dark"] .fxbars i { background: var(--accent); }
.fxdev { margin: 2px 0 10px; text-transform: capitalize; }
.fxmore { margin: 8px 0; } .fxmore > summary { cursor: pointer; font-size: 0.875rem; font-weight: 700; color: var(--muted); padding: 6px 0; } .fxmore small { font-weight: 500; color: var(--dim); }
.fxdone > summary { cursor: pointer; list-style: none; } .fxdone > summary::-webkit-details-marker { display: none; }

/* ==== Platform layer: one look for every tab ====
   Every tab is built from the same few parts: a page header (title, a quiet count, actions on the right), pill rows that
   scroll sideways instead of wrapping into stacks, 44 px inputs and buttons with the same corners, and the tab bar's line
   icons instead of emoji. Each tab's own stylesheet loads later, so these rules start at `main` to win. */
main .trhead { flex-wrap: wrap; gap: 6px 10px; margin: 14px 0 12px; min-height: 40px; }
main .trhead .trtitle { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.15; }
main .trhead .grcount { font-size: 0.8125rem; font-weight: 600; color: var(--muted); min-width: 0; }
main .trhead > .tb.edit, main .trhead > .calmodes, #fixesView .trhead > .wb, #trackerView .trhead > .tabs { margin-left: auto; }
#trackerView .trhead > .tabs + .tb.edit { margin-left: 0; }
main .trhead .tb { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; }
/* Pill rows: one line that scrolls sideways, edge to edge on a phone. */
main .tabs, main .calchips, main .gtools { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin-inline: -16px; padding: 2px 16px 4px; scroll-padding-inline: 16px; }
main .tabs::-webkit-scrollbar, main .calchips::-webkit-scrollbar, main .gtools::-webkit-scrollbar { display: none; }
main .tabs > *, main .calchips > *, main .gtools > * { flex: none; white-space: nowrap; }
main .trhead .tabs { margin-inline: 0; padding: 0; overflow: visible; }
main .tabs button, main .calchip, main .gtool { min-height: 36px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 650; border-radius: 999px; }
main .tabs button.on { box-shadow: 0 1px 6px color-mix(in srgb, var(--brand) 35%, transparent); }
main .calchips { gap: 6px; margin: 4px 0 12px; }
/* Line icons in buttons (index.html, ai-box.js, fixes.js) */
.ico { flex: none; }
main .gtool .ico, main .tb .ico, .wkinds .ico, .aipintog .ico, .aipinic .ico { width: 17px; height: 17px; }
.wkinds button { display: inline-grid; place-items: center; min-width: 40px; color: var(--muted); }
.wkinds button.on { color: var(--text); }
.aipintog { display: inline-grid; place-items: center; color: var(--muted); } .aipintog.on { color: var(--accent); }
.aipinic { display: inline-grid; place-items: center; color: var(--accent); }
.lock .lockico { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--accent); }
.lock .lockico .ico { width: 30px; height: 30px; }
html[data-theme="light"] .lock .lockico { color: var(--brand); }
/* Inputs and their buttons: 44 px, 12 px corners, card colour, the same focus ring. */
main .gradd input, main .wadd input, main .lgadd input, main .aiin, main .aipinin { min-height: 44px; border-radius: 12px; background: var(--card); font-size: 1rem; }
main .gradd button[type="submit"], main .wadd button[type="submit"], main .lgadd button[type="submit"], main .aisend, main .aibtn, main .aipintog { min-height: 44px; border-radius: 12px; }
main .gradd input:focus, main .wadd input:focus, main .lgadd input:focus, main .aiin:focus, main .aipinin:focus { outline: 2px solid var(--brand2); outline-offset: 0; border-color: transparent; }
/* Notes under a form wrap instead of being cut off. */
main .grrow .trnote { white-space: normal; flex: 1 1 60%; min-width: 0; }
/* Cards across tabs: the same corners and shadow. */
main .card, main .lgcard, main .wcard, main .gcard, main .calday, main .trlist, main .fxidea { border-radius: 14px; }
@media (max-width: 639.98px) { main .trhead .trtitle { font-size: 1.25rem; } }
main .tabs, main .calchips, main .gtools { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
main .trhead .tabs { -webkit-mask-image: none; mask-image: none; }
.wkinds .ico, .aipintog .ico { width: 20px; height: 20px; }
main .calev .caltime { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; white-space: nowrap; }
.fxbuild { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.fxbuild textarea { width: 100%; min-height: 84px; resize: vertical; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: 1rem; line-height: 1.4; }
.fxbuild textarea:focus { outline: 2px solid var(--brand2); outline-offset: 0; border-color: transparent; }
.fxbuildrow { display: flex; gap: 8px; } .fxbuildrow select { flex: 1; min-width: 0; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; padding: 0 10px; }
.fxbuildrow .wb { min-height: 44px; padding: 0 18px; }
.fxidea .wacts { margin-top: 8px; }
.fxconfirm { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 16px; margin: 4px 0 14px; border-color: var(--brand2); }
.fxconfirm > span { color: var(--muted); font-size: 0.875rem; margin-top: -6px; }
.fxconfirm .lockbtn { min-height: 48px; background: var(--brand); color: #fff; border: 0; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; }
.fxconfirm form { display: flex; gap: 8px; } .fxconfirm input { flex: 1; min-width: 0; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; padding: 0 12px; }
.fxconfirm form button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--brand2); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.fxconfirm > .wb { align-self: center; }
.fxbusy::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand2); animation: spin .8s linear infinite; }
.fxchoices { display: flex; gap: 8px; flex-wrap: wrap; } .fxchoices .wb { min-height: 38px; padding: 0 16px; }
.fxwhen { margin-left: auto; font-size: 0.75rem; color: var(--dim); }
.fxpick { display: inline-grid; place-items: center; width: 28px; height: 28px; margin: -4px 2px -4px -4px; cursor: pointer; }
.fxpick input { width: 20px; height: 20px; accent-color: var(--brand2); cursor: pointer; }
.fxidea.picked, .fxcard.picked { border-color: var(--brand2); box-shadow: 0 0 0 1px var(--brand2) inset; }
.fxselall { display: flex; justify-content: flex-end; margin: -2px 0 6px; } .fxselall .lnk { font-size: 0.8125rem; font-weight: 700; color: var(--accent); background: none; border: 0; cursor: pointer; padding: 4px 2px; }
.fxbatch { position: sticky; bottom: calc(var(--tabbar-h, 0px) + 10px + env(safe-area-inset-bottom)); z-index: 5; margin: 14px 0 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--brand2); border-radius: 16px; box-shadow: var(--shadow-lg); }
.fxbatchtop { display: flex; align-items: center; gap: 10px; } .fxbatchtop .lnk { margin-left: auto; font-weight: 700; color: var(--accent); background: none; border: 0; cursor: pointer; }
.fxbatchacts { display: flex; gap: 8px; flex-wrap: wrap; } .fxbatchacts .wb { min-height: 42px; padding: 0 16px; }
html[data-theme="light"] .fxselall .lnk, html[data-theme="light"] .fxbatchtop .lnk { color: var(--brand); }
.fxtag.again { background: color-mix(in srgb, var(--warn) 22%, var(--bg2)); color: var(--text); text-transform: none; }

/* =====================================================================
   Computer screens (1100px and up, not TV mode): use the width instead of a phone column in the middle.
   Sports in two columns, card lists (Experiences, Watch) two across, the list tabs a little wider. Phones and the
   TV layout are untouched.
   ===================================================================== */
@media (min-width: 1100px) {
  body:not(.tv) main:not(#barView) { max-width: 1240px; padding: 8px 32px 48px; }
  body:not(.tv) main#sportsView { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: start;
    grid-template-areas: "glance glance" "last news" "today news" "teams teams" "players ask" "foot foot"; }
  body:not(.tv) #glance { grid-area: glance; } body:not(.tv) #lastnight { grid-area: last; } body:not(.tv) #today { grid-area: today; }
  body:not(.tv) #teams { grid-area: teams; } body:not(.tv) #news { grid-area: news; } body:not(.tv) #players { grid-area: players; }
  body:not(.tv) #ask { grid-area: ask; } body:not(.tv) main#sportsView > .foot { grid-area: foot; }
  body:not(.tv) main#todosView, body:not(.tv) main#trackerView, body:not(.tv) main#groceryView, body:not(.tv) main#ledgerView, body:not(.tv) main#fixesView { max-width: 1000px; }
  body:not(.tv) #wList { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; align-items: start; } body:not(.tv) #wList > .wgroup { grid-column: 1 / -1; }
  body:not(.tv) #expView .xpevs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; align-items: start; } body:not(.tv) #expView .xpevs > .xpmonth { grid-column: 1 / -1; }
  body:not(.tv) .calgrid, body:not(.tv) .cal { max-width: none; }
}
