/* Dueness Calendar — shared by /dueness (master) and the batter-profile
 * "Dueness" tab. Tokens only, no new hexes; survives [data-theme="light"].
 * Every class is prefixed due-. */

.due-page { max-width: 1280px; margin: 0 auto; padding: 26px 24px 56px; font-variant-numeric: tabular-nums; }

/* ── header ── */
.due-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin: 4px 0 18px; }
.due-head-left { min-width: 250px; }
.due-kicker { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.due-title { margin: 6px 0 8px; font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -0.5px; color: var(--text); }
.due-sub { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); max-width: 600px; text-wrap: pretty; }
.due-sub strong { color: var(--text); font-weight: 600; }
.due-pager { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.due-iconbtn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; }
.due-iconbtn:hover { border-color: var(--muted); color: var(--text); }
.due-iconbtn--off { opacity: 0.35; cursor: default; pointer-events: none; }
.due-month { min-width: 104px; text-align: center; font-size: 15px; font-weight: 700; color: var(--text); }
.due-todaybtn { padding: 7px 13px; border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 12.5px; font-weight: 600; border-radius: 8px; cursor: pointer; text-decoration: none; }
.due-todaybtn:hover { border-color: var(--muted); color: var(--text); }

.due-schedwarn { margin: 0 0 12px; padding: 9px 13px; border: 1px solid color-mix(in srgb, var(--warm) 45%, transparent); background: color-mix(in srgb, var(--warm) 8%, transparent); border-radius: var(--radius, 10px); font-size: 12px; color: var(--text); }

/* ── filters ── */
.due-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius, 10px); background: var(--card); margin-bottom: 12px; }
.due-search { display: flex; align-items: center; gap: 7px; padding: 0 10px; height: 32px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); flex: 0 1 230px; min-width: 170px; color: var(--muted); box-sizing: border-box; }
.due-search input { border: none; outline: none; background: transparent; color: var(--text); font-size: 12.5px; width: 100%; font-family: inherit; padding: 0; }
.due-chip { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; border: 1px solid var(--border); background: transparent; color: var(--text); }
.due-chip--on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.due-chip--hot { border-color: var(--hot); background: color-mix(in srgb, var(--hot) 12%, transparent); color: var(--hot); }
.due-vr { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }
.due-vr--sm { height: 14px; }
.due-fsel { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.due-fsel select { height: 32px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 12px; font-family: inherit; }
.due-count { margin-left: auto; font-size: 11.5px; color: var(--muted); }

/* ── legend ── */
.due-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; justify-content: flex-end; margin: 0 2px 10px; font-size: 11px; color: var(--muted); }
.due-lg { display: flex; align-items: center; gap: 5px; }
.due-lg--hot { font-weight: 700; color: var(--hot); }
.due-lg--warm { font-weight: 700; color: var(--warm); }
.due-lg--t { font-weight: 700; color: var(--text); }
.due-lg--m { font-weight: 600; color: var(--muted); }
.due-hatch-sw { width: 12px; height: 9px; border: 1px solid var(--border); background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--border) 60%, transparent) 0px, color-mix(in srgb, var(--border) 60%, transparent) 1px, transparent 1px, transparent 4px); }
.due-heat-sw { width: 34px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--cold), var(--text), var(--hot)); }

/* ── layout ── */
.due-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.due-main--narrow { display: block; }
.due-main--narrow .due-rail { position: static; margin-top: 16px; }
.due-cal-col { min-width: 0; }

/* ── calendar ── */
.due-cal { border: 1px solid var(--border); border-radius: var(--radius, 10px); background: var(--card); overflow: hidden; }
.due-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; border-bottom: 1px solid var(--border); }
.due-dow span { padding: 8px 10px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.due-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border); }
.due-cell { position: relative; min-width: 0; min-height: 118px; padding: 8px 9px 7px; box-sizing: border-box; display: flex; flex-direction: column; gap: 2px; background: var(--card); }
.due-cell--bv { min-height: 96px; }
.due-cell--click { cursor: pointer; }
.due-cell--out { background: var(--card); opacity: 0.4; pointer-events: none; }
.due-cell--off { background: var(--bg); background-image: repeating-linear-gradient(45deg, color-mix(in srgb, var(--border) 45%, transparent) 0px, color-mix(in srgb, var(--border) 45%, transparent) 1px, transparent 1px, transparent 7px); }
.due-cell--future { background: var(--bg); }
.due-cell--sat, .due-cell--pre { background: var(--bg); }
.due-cell--today { background: color-mix(in srgb, var(--accent) 7%, var(--card)); box-shadow: inset 0 0 0 1.5px var(--accent); }
.due-cell-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; min-height: 17px; }
.due-date { font-size: 11.5px; font-weight: 700; color: var(--text); line-height: 15px; }
.due-cell--out .due-date, .due-cell--off .due-date { color: var(--muted); }
.due-date--today { background: var(--accent); color: var(--invert-text, var(--bg)); padding: 1px 7px; border-radius: 999px; }
.due-tag { font-size: 8.5px; font-weight: 700; letter-spacing: 0.1em; color: var(--accent); }
.due-qmark { margin-left: auto; color: var(--muted); display: flex; opacity: 0.8; }
.due-off-lbl { margin: auto; font-size: 9.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); opacity: 0.7; }
.due-noscript { padding: 20px; font-size: 13px; color: var(--muted); }

/* rows in cells */
.due-hr-row { display: flex; align-items: center; gap: 5px; font-size: 11.5px; line-height: 1.45; min-width: 0; }
.due-hr-row--cand .due-row-name { color: var(--muted); }
.due-dot { flex: none; width: 5px; height: 5px; border-radius: 50%; box-sizing: border-box; }
.due-dot--hr { background: var(--accent); }
.due-dot--cand { border: 1px solid var(--muted); background: transparent; }
.due-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; }
a.due-row-name:hover { color: var(--thr-blue); }
.due-row-right { margin-left: auto; flex: none; font-size: 10.5px; color: var(--muted); }
.due-more { margin-top: 1px; font-size: 10.5px; color: var(--muted); text-decoration: underline dotted; cursor: pointer; width: max-content; }

/* avatars */
.due-ava { flex: none; border-radius: 50%; overflow: hidden; background: var(--card-alt, var(--bg)); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; }
.due-ava img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.due-ava--txt { font-size: 7.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }

/* batter-view cell content */
.due-bv-hr { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--text); }
.due-bv-hr .due-row-right { font-weight: 400; }
.due-bv-hrlbl { font-weight: 700; }
.due-bv-was { font-size: 10px; color: var(--muted); }
.due-bv-g { margin-top: auto; align-self: flex-end; font-size: 9.5px; color: var(--muted); opacity: 0.85; }
.due-bv-cand { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.due-bv-board { font-size: 10.5px; font-weight: 600; color: var(--thr-blue); }

/* ── rail ── */
.due-rail { position: sticky; top: 14px; min-width: 0; }
.due-railcard { border: 1px solid var(--border); border-radius: var(--radius, 10px); background: var(--card); padding: 13px 14px 11px; }
.due-railcard-head { margin-bottom: 6px; }
.due-railcard-title { font-size: 15px; font-weight: 700; color: var(--text); }
.due-railcard-sub { font-size: 11px; color: var(--muted); }
.due-railcard-body { display: flex; flex-direction: column; }
.due-rail-row { display: flex; align-items: center; gap: 9px; padding: 8px 2px; border-top: 1px solid var(--border); }
.due-rail-row:first-child { border-top-color: transparent; }
.due-rail-mid { flex: 1; min-width: 0; }
.due-rail-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.due-rail-pin { display: flex; flex: none; color: var(--accent); border: none; background: transparent; padding: 0; cursor: pointer; }
.due-rail-name { font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due-rail-name:hover { color: var(--thr-blue); }
.due-flags { display: flex; align-items: center; gap: 4px; flex: none; }
.due-flags span { display: flex; }
.due-boardchip { flex: none; font-size: 10px; font-weight: 700; color: var(--thr-blue); border: 1px solid color-mix(in srgb, var(--thr-blue) 45%, transparent); border-radius: 999px; padding: 1px 7px; text-decoration: none; }
.due-rail-meta { margin-top: 1px; font-size: 11px; color: var(--muted); }
.due-rail-x { flex: none; font-size: 15px; font-weight: 800; }
.due-rail-empty { padding: 14px 2px; font-size: 12px; color: var(--muted); }
.due-railcard-foot { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--border); font-size: 10.5px; color: var(--muted); }

/* mobile rail strip */
.due-rail-strip { margin: 0 0 14px; }
.due-rail-strip-title { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.due-rail-strip-title span { color: var(--muted); font-weight: 400; }
.due-rail-strip-track { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.due-rail-mini { flex: none; width: 130px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); padding: 9px 11px; text-decoration: none; }
.due-rail-mini-x { font-size: 16px; font-weight: 800; }
.due-rail-mini-name { margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due-rail-mini-meta { margin-top: 1px; font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── footnote ── */
.due-footnote { margin: 10px 2px 0; font-size: 11px; line-height: 1.55; color: var(--muted); display: flex; gap: 7px; align-items: flex-start; max-width: 780px; text-wrap: pretty; }
.due-footnote svg { flex: none; margin-top: 2px; }
.due-footnote strong { font-weight: 600; color: var(--text); }
.due-footnote a { color: var(--thr-blue); }

/* ── hover card ── */
.due-hover { position: fixed; z-index: 60; width: 264px; box-sizing: border-box; background: var(--tooltip-bg); color: var(--tooltip-fg); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,0.4)); padding: 12px 13px; animation: dueFade 0.14s ease; }
.due-hv-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.due-hv-names { min-width: 0; }
.due-hv-name { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due-hv-team { font-size: 11px; opacity: 0.65; }
.due-hv-x { margin-left: auto; flex: none; text-align: right; }
.due-hv-x > div:first-child { font-size: 16px; font-weight: 800; line-height: 1.1; }
.due-hv-xcap { font-size: 8px; font-weight: 700; letter-spacing: 0.1em; opacity: 0.55; }
.due-hv-meta { margin-top: 4px; font-size: 11.5px; opacity: 0.8; }
.due-hv-flags { margin-top: 5px; font-size: 10.5px; line-height: 1.5; opacity: 0.7; }
.due-hv-at { margin-top: 6px; padding-top: 6px; border-top: 1px solid color-mix(in srgb, var(--tooltip-fg) 18%, transparent); font-size: 10.5px; line-height: 1.5; opacity: 0.85; }
.due-hv-null { margin-top: 8px; font-size: 11px; opacity: 0.8; font-style: italic; }
.due-hv-link { display: inline-block; margin-top: 9px; font-size: 11.5px; color: var(--thr-blue); text-decoration: none; font-weight: 600; }
.due-hv-list { max-height: 196px; overflow: auto; display: flex; flex-direction: column; gap: 4px; margin-top: 7px; }

/* ── gap-dot strip ── */
.due-strip { position: relative; }
.due-strip--sm { margin-top: 10px; margin-bottom: 4px; }
.due-strip-plot { position: relative; border-bottom: 1px solid color-mix(in srgb, currentColor 30%, transparent); margin-bottom: 14px; }
.due-strip-dot { position: absolute; margin-left: -2px; border-radius: 50%; background: var(--thr-blue); }
.due-strip-cap { position: absolute; transform: translateX(-50%); white-space: nowrap; font-size: 8.5px; opacity: 0.75; }
.due-strip-med { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, currentColor 55%, transparent); }
.due-strip-medlbl { position: absolute; top: -14px; transform: translateX(-50%); white-space: nowrap; font-size: 9px; font-weight: 600; color: var(--muted); }
.due-strip-now { position: absolute; top: -2px; bottom: 0; width: 2px; margin-left: -1px; }
.due-strip-nowlbl { position: absolute; top: -14px; white-space: nowrap; font-size: 9px; font-weight: 700; }
.due-strip-ax { position: absolute; bottom: -13px; transform: translateX(-50%); white-space: nowrap; font-size: 8.5px; opacity: 0.55; }
.due-strip-note { font-size: 10px; line-height: 1.45; opacity: 0.6; }

/* ── modal / bottom sheet ── */
.due-scrim { position: fixed; inset: 0; z-index: 70; background: color-mix(in srgb, var(--bg-alt) 72%, transparent); display: flex; align-items: center; justify-content: center; padding: 20px; }
.due-modal { width: 440px; max-width: 440px; max-height: 76vh; overflow: auto; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,0.4)); padding: 15px 18px 17px; animation: dueFade 0.16s ease; box-sizing: border-box; }
.due-sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 10px; }
.due-modal-head { display: flex; align-items: flex-start; gap: 10px; }
.due-modal-title { font-size: 15px; font-weight: 800; color: var(--text); }
.due-modal-sub { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.due-modal-x { margin-left: auto; flex: none; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; padding: 0; }
.due-modal-body { margin-top: 11px; border-top: 1px solid var(--border); padding-top: 7px; display: flex; flex-direction: column; }
.due-modal-row { padding: 4px 0; font-size: 12.5px; }
.due-modal-p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--text); }
.due-modal-exp { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); font-size: 11px; line-height: 1.5; color: var(--muted); }
.due-modal-exp a { color: var(--thr-blue); }
.due-was-pill { margin-left: auto; flex: none; font-size: 10.5px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; line-height: 16px; }
.due-was-pill + .due-row-right, .due-was-pill ~ .due-flags { margin-left: 6px; }
.due-lock-btn { flex: none; display: flex; align-items: center; justify-content: center; width: 26px; height: 24px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; padding: 0; margin-left: 6px; }
.due-lock-btn--on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.due-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 80; background: var(--tooltip-bg); color: var(--tooltip-fg); font-size: 12px; padding: 8px 15px; border-radius: 999px; box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,0.4)); animation: dueFade 0.15s ease; white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; }

/* ── mobile week list ── */
.due-week-list { display: flex; flex-direction: column; }
.due-wk-head { padding: 11px 12px 6px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); background: var(--bg); }
.due-dayrow { display: flex; gap: 12px; padding: 9px 12px 10px; border-top: 1px solid var(--border); cursor: pointer; }
.due-dayrow--today { background: color-mix(in srgb, var(--accent) 7%, var(--card)); box-shadow: inset 2px 0 0 var(--accent); }
.due-dayrow-l { flex: none; width: 42px; }
.due-dayrow-dow { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.due-dayrow-num { margin-top: 1px; font-size: 16px; font-weight: 800; color: var(--text); }
.due-dayrow--today .due-dayrow-num { color: var(--accent); }
.due-dayrow-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; justify-content: center; }
.due-off-pill { align-self: flex-start; font-size: 9.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; }

/* ── batter tab (Tonight bar + stat cards + tightness) ── */
.due-tonight { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 9px 13px; border: 1px solid var(--border); border-radius: var(--radius, 10px); background: var(--card); margin-bottom: 14px; font-size: 12px; color: var(--muted); }
.due-tonight-tag { font-size: 9px; font-weight: 700; letter-spacing: 0.12em; color: var(--accent); }
.due-tonight-flag { display: flex; align-items: center; gap: 5px; }
.due-tonight-flag--sus { color: var(--warm); }
.due-tonight-flag--hvp { color: var(--thr-blue); }
.due-tonight-next { margin-left: auto; font-size: 11px; }
.due-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.due-statcard { border: 1px solid var(--border); border-radius: var(--radius, 10px); background: var(--card); padding: 12px 14px; }
.due-statcard-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.due-statcard-val { margin-top: 4px; font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.1; }
.due-statcard-sub { margin-top: 3px; font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.due-tightcard { border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: var(--radius, 10px); background: var(--card); padding: 13px 14px 11px; margin-bottom: 14px; }
.due-tightcard-title { font-size: 15px; font-weight: 700; color: var(--text); }
.due-tightcard-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.due-tightcard-plot { margin: 22px 10px 22px; color: var(--text); }
.due-tightcard-msg { padding: 10px 4px 2px; font-size: 12.5px; color: var(--muted); font-style: italic; }
.due-tightcard-foot { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--border); font-size: 10.5px; color: var(--muted); }

@keyframes dueFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* classes above set explicit display values, which beat the UA's [hidden]
 * rule — restore hidden's meaning for everything we toggle from JS */
.due-scrim[hidden], .due-hover[hidden], .due-grid[hidden], .due-dow[hidden],
.due-lg[hidden], .due-rail-strip[hidden] { display: none !important; }

/* ── responsive ── */
@media (max-width: 1139px) {
  .due-main { display: block; }
  .due-rail { position: static; margin-top: 16px; }
}
@media (max-width: 640px) {
  .due-page { padding: 18px 14px 44px; }
  .due-scrim { align-items: flex-end; padding: 0; }
  .due-modal { width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; }
  .due-rail { display: none; }
  .due-search { flex-basis: 100%; }
}
