/* Lineup Logix — App Styles (v1.5)
   - Red-tinted hover lift to list/board cards (parity with marketing)
   - Preserves all existing layout, spacing, and components
*/

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Prevent horizontal bounce on mobile */
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

:root{
  /* ── Light palette ── */
  --ll-bg:        #f8f9fa;
  --ll-bg-2:      #ffffff;
  --ll-bg-3:      #f1f3f5;
  --ll-bg-4:      #e9ecef;
  --ll-border:    #dee2e6;
  --ll-text:      #1a1d23;
  --ll-text-2:    #495057;
  --ll-text-3:    #868e96;
  --ll-red:       #C8561F;
  --ll-red-soft:  rgba(200,86,31,0.09);
  --ll-red-border:rgba(200,86,31,0.3);
  --ll-green:     #16a34a;
  --ll-amber:     #d97706;
  --ll-blue:      #2563eb;
  --ll-radius:    10px;
  --ll-radius-sm: 6px;

  /* ── remap old tokens → light values ── */
  --ink:    var(--ll-text);
  --ink-soft: var(--ll-text-3);
  --bg:     var(--ll-bg-2);
  --surface: var(--ll-bg-2);

  /* Brand core – Lineup Logix red gradient */
  --brand:#C8561F;          /* warm orange-red */
  --brand-500:#C8561F;      /* warm orange-red */
  --brand-rose:#FB7185;     /* soft warm accent for subtle gradients */
  --grad-btn: linear-gradient(135deg, #d96830, #C8561F);
  --grad-hero: radial-gradient(500px 200px at 95% -20%, rgba(200,86,31,0.25), transparent 60%),
               linear-gradient(135deg, #111827 0%, #0F172A 55%, #1E293B 100%);
  --grad-header: linear-gradient(
    180deg,
    rgba(239,68,68,0.08),
    rgba(220,38,38,0.03) 40%,
    rgba(255,255,255,0)
  );
  --grad-footer: linear-gradient(
    180deg,
    rgba(239,68,68,0.06),
    rgba(220,38,38,0.00)
  );

  --accent: var(--brand);
  --accent-ink:#FFFFFF;
  --accent-soft: rgba(220,38,38,.10);

  --maxw:1280px;
  --radius: var(--ll-radius);
  --radius-sm: var(--ll-radius-sm);
  --shadow-card:0 2px 12px rgba(0,0,0,.07);
  --shadow-soft:0 4px 20px rgba(0,0,0,.10);

  /* tighter type scale */
  --type-1: clamp(14px, 1.00vw, 16px);
  --type-2: clamp(15px, 1.15vw, 17px);
  --type-3: clamp(18px, 1.45vw, 21px);

  --line: var(--ll-border);
  --line-strong: var(--ll-border);
  --line-dashed: var(--ll-border);

  --success:#16a34a;
  --danger:#dc2626;

  /* Helper tokens used in later rules */
  --line-soft: var(--ll-border);
  --border-subtle: var(--ll-border);
  --muted: var(--ll-text-3);
  --purple: var(--brand); /* alias for old Life Stories styles */
}

body.theme-warm{
  background: var(--ll-bg);
  color: var(--ll-text);
  font: var(--type-1)/1.55 'Barlow', system-ui, -apple-system, sans-serif;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  /* Step 3 — kill horizontal side scroll on phones.
     max-width:100% (not 100vw) on purpose: 100vw includes the desktop
     scrollbar gutter and would itself create the overflow it's meant to stop. */
  overflow-x: hidden;
  max-width: 100%;
}

/* Step 1 — .no-scroll is toggled by trapScroll() in app.js for every modal.
   It previously had no rule at all, so modal background-scroll was never
   locked. position:fixed is what actually stops iOS rubber-band scrolling;
   app.js stores and restores window.scrollY around it so the page doesn't
   jump to the top when a modal opens or closes. */
body.no-scroll {
  overflow: hidden;
  position: fixed;
  width: 100%;
  left: 0; /* required: app.js sets an inline top:-Npx to pin the scroll offset */
}

/* When onboarding runs, keep the page from scrolling behind it */
body.onboarding-open,
body.wizard-open,
body.mobile-menu-open{
  overflow: hidden;
}

.muted { color: var(--ink-soft); }
[hidden] { display: none !important; }

.soft-press { transform: translateY(0); transition: transform .08s ease; }
.soft-press:active { transform: translateY(1px); }

main.layout { opacity: 0; }
.reveal-in{ opacity:0; transform:translateY(6px); transition:opacity .45s cubic-bezier(.25,1,.5,1), transform .45s cubic-bezier(.25,1,.5,1); }
.reveal-in.is-visible{ opacity:1; transform:none; }

/* ---------- HEADER ---------- */
.site-header{
  position: sticky; top:0; z-index:50;
  background: var(--grad-hero);
  border-bottom: none;
}
.site-header::before{ display: none; }
.site-header::after{ display: none; }
/* Buttons inside the red header need white-on-transparent style */
.site-header .secondary,
.site-header .icon-btn {
  background: rgba(255,255,255,0.15);
  color: #ffffff;
  border-color: rgba(255,255,255,0.35);
}
.site-header .secondary:hover,
.site-header .icon-btn:hover {
  background: rgba(255,255,255,0.25);
}
.header-inner{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:12px 24px; max-width: var(--maxw); margin:0 auto;
}
.brand-wrap{ display:flex; align-items:baseline; gap:10px; }
.brand{ text-decoration:none; color:#ffffff; font-weight:900; letter-spacing:.2px; font-size:1.25rem; }
.brand-word{ font-weight:900; }
.brand-dot{ color:rgba(255,255,255,0.7); font-weight:900; margin-left:1px; }
.tagline{ color:rgba(255,255,255,0.75); font-size:.95rem; }

.menu{
  display:flex;
  align-items:center;
  gap:10px;
  position:relative;
}

/* Mobile hamburger — hidden by default, shown only in mobile media query */
.mobile-menu-toggle{
  display:none;
  border:1px solid rgba(255,255,255,0.35);
  border-radius: var(--radius-sm);
  padding:6px 10px;
  background:rgba(255,255,255,0.15);
  color:#ffffff;
  cursor:pointer;
}

/* Temporarily hide header AI button (AI lives in the wizard for now) */
#btn-ai{
  display:none;
}

.icon-btn{
  background:rgba(255,255,255,0.15); color:#ffffff;
  border:1px solid rgba(255,255,255,0.35); border-radius: var(--radius-sm); padding:6px 10px; cursor:pointer;
}
.menu-popover{
  position:absolute; top:100%; right:0; margin-top:8px;
  background:#fff; border:1px solid var(--line); box-shadow:var(--shadow-card); border-radius:var(--radius-sm);
  padding:8px; min-width:220px; display:none;
}
.menu-popover[aria-hidden="false"]{ display:block; }
.menu-popover a,
.menu-popover .linklike{
  display:block; padding:8px 10px; text-decoration:none; color:var(--ink); border-radius:10px; text-align:left;
}
.menu-popover a:hover,
.menu-popover .linklike:hover{ background: rgba(220,38,38,.06); cursor:pointer; }

/* ---------- MOBILE MENU OVERLAY (NO EXTRA WRAPPER NEEDED) ---------- */
.mobile-menu-panel{
  position: fixed;
  inset: 0;                           /* full-screen backdrop */
  background: rgba(15,23,42,0.55);    /* dim background */
  z-index: 4000;                      /* above header, coachmarks, etc. */
  flex-direction: column;
  align-items: flex-end;              /* anchor to right edge */
  padding: 80px 16px 16px;            /* room for header at top */
  display: none;                      /* closed by default; JS toggles via body.mobile-menu-open */
}
/* When body has the open flag, show the overlay */
body.mobile-menu-open .mobile-menu-panel{
  display: flex !important;
}

/* Style the menu options as a white vertical card stack */
.mobile-menu-sheet{
  width: 100%;
  max-width: 260px;
  background: #fff;
  border-radius: 20px;
  padding: 12px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Buttons inside the sheet */
.mobile-menu-sheet .secondary,
.mobile-menu-sheet a.secondary{
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: #fff;
  margin: 0 0 8px;
  border-radius: 999px;   /* keep the pill look */
  box-shadow: none;       /* sheet already has the shadow */
}

/* ---------- NAV TABS ---------- */
.nav-tabs{
  max-width: var(--maxw); margin:12px auto 4px; padding:0 24px;
  display:flex; gap:8px; flex-wrap:wrap;
}
.nav-tabs .chip{
  padding:8px 12px; border:1px solid var(--line); border-radius:999px;
  background:#fff; cursor:pointer; font-size:var(--type-2); font-weight:700;
  transition: background .15s ease, border-color .15s ease;
}
.nav-tabs .chip[aria-selected="true"]{
  border-color: rgba(220,38,38,.35);
  background: var(--accent-soft);
}

/* ---------- SUBHEAD / SORT ROW ---------- */
.top-row{
  max-width: var(--maxw); margin:2px auto 10px; padding:0 24px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.subhead{ display:flex; align-items:center; gap:10px; font-weight:900; font-size:var(--type-3); letter-spacing:.2px; }

/* Section suggestions trigger */
.section-suggest-btn{
  border:none;
  background:none;
  padding:4px 8px;
  font-size:0.85rem;
  font-weight:500;
  color:var(--brand);
  border-radius:999px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:6px;
  transition:background .15s ease, transform .08s ease, box-shadow .15s ease, color .15s ease;
}
.section-suggest-btn::before{
  content:'✨';
  font-size:0.9rem;
}
.section-suggest-btn:hover{
  background:rgba(220,38,38,0.06);
  box-shadow:0 0 0 1px rgba(220,38,38,0.18);
}
.section-suggest-btn:active{
  transform:translateY(1px);
}

.chip-row{ display:flex; align-items:center; gap:8px; }
/* Widened search bar after removing mode chip */#search-input {
  min-width: 260px;
  flex: 1;
}
.chip{
  padding:8px 12px; border:1px solid var(--line); border-radius:999px; background:#fff;
  font-size:var(--type-2); font-weight:700;
}
#mode-indicator{ opacity:.75; }

/* ---------- MAIN LAYOUT ---------- */
.layout.content{ 
  max-width: var(--maxw); margin:0 auto; padding:16px 24px 96px;
  flex:1;
}

/* ---------- PERSISTENT QUICK ADD ---------- */
.inline-capture{
  position: relative;
  display:grid; grid-template-columns: minmax(420px,1fr) auto; gap:10px;
  width:100%;
  background:#fff; border:1px solid var(--line);
  border-radius: var(--radius); padding:12px 14px; margin-bottom:12px;
  box-shadow: var(--shadow-card);
}
.inline-capture .prompt-chips{
  width:100%;
  display:none; /* Suggestion chips retired in favor of Section Suggestions */
}
.inline-capture input{
  flex:1; min-width: 240px; padding:11px 12px; border:1px solid var(--line); border-radius:12px; font-size:.98rem;
  transition: border-color .15s ease, box-shadow .15s ease; width:100%;
}
.inline-capture input:focus{
  outline:none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--accent-soft);
}
.inline-capture .primary.small{ padding:9px 14px; }

.prompt-chips{
  width:100%;
  display:none; /* Hide legacy suggestion chips everywhere */
}
.prompt-chips .chip{
  cursor:pointer;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
}

.sticky-quick-add{ position: sticky; top: 8px; z-index: 40; box-shadow: var(--shadow-soft); }

/* ---------- EMPTY STATE ---------- */
.empty-state{
  display:flex; justify-content:center; align-items:center;
  min-height:38vh; text-align:center; color:var(--ink-soft);
}
.empty-inner{
  background:#fff; border:1px dashed var(--line-dashed); padding:20px 22px; border-radius:var(--radius);
  max-width:560px; width:100%; box-shadow: var(--shadow-card);
}
.empty-inner h3{ margin:0 0 6px; color:var(--ink); }
.empty-inner p{ margin:0 0 10px; }
.empty-inner .prompt-chips{ justify-content:center; margin-top:8px; }
.empty-inner .large{ padding:11px 18px; margin-top:10px; }

/* ---------- LIST VIEW ---------- */
.items{ list-style:none; padding:0; margin:0; display:grid; gap:10px; }
.note-card{
  background:#fff; border:1px solid var(--line); border-radius: var(--radius);
  padding:12px; box-shadow: var(--shadow-card);
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.note-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(220,38,38,.18);   /* red-tinted lift */
  border-color: rgba(220,38,38,.25);
}
.note-card .card-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.note-card .title{ font-weight:800; letter-spacing:.2px; }
.note-card .notes{ margin-top:8px; color:var(--ink); }

.mini-actions{ display:flex; align-items:center; gap:6px; opacity:0; transition: opacity .12s ease; }
.note-card:hover .mini-actions,
.board-card:hover .mini-actions{ opacity:1; }
.mini-actions button{
  border:1px solid var(--line); background:#fff; border-radius:10px; padding:4px 8px; cursor:pointer;
}

/* ---------- BOARD ---------- */
.board{ display:grid; grid-template-columns: repeat(4, minmax(220px,1fr)); gap:12px; }
.board-col{
  background:#fff; border:1px solid var(--line); border-radius: var(--radius);
  min-height:120px; display:flex; flex-direction:column; box-shadow: var(--shadow-card);
  transition: box-shadow .12s ease, transform .12s ease;
}
.board-head{
  padding:10px 12px; border-bottom:1px solid var(--line); font-weight:900; color:#1F2660; display:flex; align-items:center; gap:6px;
}
.board-drop{
  padding:10px;
  flex:1;
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* Persistent add button/card at top of each column */
.board-add{
  padding:8px 12px;
  border-radius:999px;
  border:1px dashed var(--line-dashed);
  background:rgba(220, 38, 38, 0.03); /* soft red tint */
  color:#991b1b;
  font-size:0.875rem;
  text-align:center;
  cursor:pointer;
  transition:background .12s ease, border-color .12s ease, transform .08s ease;
}

.board-add:hover{
  background:rgba(220, 38, 38, 0.08);
  border-color:rgba(220, 38, 38, 0.55);
  transform:translateY(-1px);
}

.board-add:active{
  transform:translateY(0);
}

.board-drop.drag-over{
  outline:2px solid var(--brand);
  outline-offset:-2px;
}
.board-col.drag-over .board-head{ background: var(--accent-soft); }

.board-card{
  background:#fff; border:1px solid var(--line); border-radius:12px; padding:10px; box-shadow: var(--shadow-card);
  cursor:grab; transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.board-card:active{ cursor:grabbing; }
.board-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(220,38,38,.18);   /* red-tinted lift */
  border-color: rgba(220,38,38,.25);
}
.board-card .title-row{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.board-card .title{ font-weight:800; }
.board-card .notes{ margin-top:6px; color:var(--ink); }

/* ---------- BADGES (plan cues) ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.badge-premium {
  background: rgba(220,38,38,0.12);
  color: #991b1b;
  border: 1px solid rgba(220,38,38,0.25);
  margin-left: 6px;
}

/* ---------- BUTTONS ---------- */
.primary{
  border:none; border-radius:999px;
  background: var(--grad-btn);
  color: var(--accent-ink);
  padding:10px 18px; font-weight:700; font-size:.95rem; cursor:pointer;
  transition: transform .05s ease, filter .15s ease;
}
.primary:hover{ filter: brightness(.98); }
.primary:active{ transform: translateY(1px); }

.secondary{
  background:#fff; color: var(--ink);
  border:1px solid var(--line); border-radius:999px; padding:9px 16px; font-weight:700; font-size:.95rem; cursor:pointer;
}
.secondary:hover{ background: rgba(2,6,23,.03); }

.ghost{
  background:transparent;
  color:var(--ink-soft);
  border:1px solid var(--line-soft);
  border-radius:999px;
  padding:9px 16px;
  font-weight:500;
  font-size:.9rem;
  cursor:pointer;
}
.ghost:hover{
  background:rgba(15,23,42,0.02);
}

.fab{
  position: fixed; right:18px; bottom:18px; z-index: 2000;
  width:56px; height:56px; border-radius:50%;
  border:none; background: var(--grad-btn); color:#fff;
  font-size:26px; line-height:1; display:flex; align-items:center; justify-content:center;
  box-shadow: var(--shadow-soft); cursor: pointer;
}

/* ---------- MODAL / WIZARD / ACK ---------- */
.modal{ position: fixed; inset:0; background: rgba(0,0,0,.18); display:none; z-index:2500; }
.modal.show,
.modal.open{ display:block; }
.modal-box{
  background:#fff;
  border:1px solid var(--line);
  border-radius:20px;
  max-width:720px;
  margin:4vh auto;
  padding:0;
  box-shadow: var(--shadow-soft);
  max-height:92vh;
  overflow:auto;
}
.modal-head{ display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid var(--line); }
.modal-body{ padding:14px; }

/* Life Stories modal: ensure content can scroll and footer is reachable */
#life-modal .modal-box{
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  overflow: hidden;            /* scrolling handled by inner body */
}

#life-modal .modal-body,
#life-modal .onboarding-body{
  flex: 1 1 auto;
  overflow-y: auto;            /* scroll the content area */
}

/* ----- AI modal polish ----- */

.ai-modal-box .modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-intro {
  margin-top: 0;
  margin-bottom: 4px;
}

/* AI Mode buttons */
.ai-mode-container{
  margin-top: 8px;
  margin-bottom: 4px;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.ai-mode-intro{
  font-size:0.85rem;
  color:var(--ink-soft);
}

.ai-modes-row{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.ai-mode-btn{
  border-radius:999px;
  border:1px solid var(--line);
  padding:6px 10px;
  font-size:0.85rem;
  background:#fff;
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease,transform .08s ease;
}

.ai-mode-btn:hover{
  background:rgba(220,38,38,0.04);
  border-color:rgba(220,38,38,0.35);
}

.ai-mode-btn.active{
  background:var(--accent-soft);
  border-color:rgba(220,38,38,0.8);
}

/* AI loader */
.ai-loader{
  margin-top:8px;
  margin-bottom:2px;
  display:none;
  align-items:center;
  gap:6px;
}

.ai-loader.is-active{
  display:inline-flex;
}

.ai-loader .dot{
  width:7px;
  height:7px;
  border-radius:999px;
  background:var(--brand);
  animation:ai-bounce 1s infinite ease-in-out;
}

.ai-loader .dot:nth-child(2){
  animation-delay:0.15s;
}
.ai-loader .dot:nth-child(3){
  animation-delay:0.3s;
}

@keyframes ai-bounce{
  0%,80%,100%{ transform:translateY(0); opacity:0.4;}
  40%{ transform:translateY(-3px); opacity:1;}
}

.ai-context-preview{
  font-size:0.8rem;
  margin:0 0 6px 0;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* ----- Life Stories inline AI helper ----- */

.life-ai{
  margin-top: 6px;
  margin-bottom: 4px;
}

.life-ai-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  font-size:0.85rem;
  color:var(--ink-soft);
}

.life-ai-label{
  font-weight:500;
}

/* Hide the inline AI bar when viewing the Draft Book */
.life-book-mode .life-ai{
  display:none;
}

/* ----- Life Stories layout ----- */

.life-layout{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.life-list{
  border-radius:14px;
  border:1px solid var(--line);
  padding:10px;
  background:#fff;
}

.life-list-head{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-bottom:6px;
}

.life-list-title-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.life-list-title{
  font-weight:700;
  font-size:0.95rem;
}

.life-list-hint{
  font-size:0.8rem;
  color:var(--ink-soft);
  margin:0;
}

.life-list-items{
  display:flex;
  flex-direction:column;
  gap:4px;
  max-height:220px;
  overflow:auto;
}

.life-list-empty{
  font-size:0.82rem;
  margin:2px 0;
}

.life-list-item{
  width:100%;
  text-align:left;
  border-radius:10px;
  border:1px solid transparent;
  padding:6px 8px;
  cursor:pointer;
  background:transparent;
  display:flex;
  flex-direction:column;
  gap:2px;
  font-size:0.85rem;
}

.life-list-row {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}

.life-list-delete {
  flex: 0 0 auto;
  align-self: center;
  padding: 0 0.5rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.life-list-delete:hover {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.4);
  transform: translateY(-1px);
}

.life-list-item:hover{
  background:rgba(220,38,38,0.03);
  border-color:rgba(148,163,184,0.6);
}

.life-list-item.is-active{
  background:var(--accent-soft);
  border-color:rgba(220,38,38,0.7);
}

life-list-item-title{
  font-weight:600;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.life-list-item-meta{
  font-size:0.75rem;
  color:var(--ink-soft);
}

.life-meta{
  font-size:0.8rem;
  color:var(--ink-soft);
  margin:0 0 4px;
}

/* ----- Guided Interview ----- */

.life-guided-toprow{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-top:8px;
  margin-bottom:8px;
}

.life-guided-category select{
  min-width:200px;
}

@media (max-width:600px){
  .life-guided-toprow{
    flex-direction:column;
    align-items:flex-start;
  }
}

.life-guided-counter{
  font-size:0.8rem;
  color:var(--ink-soft);
}

.life-guided-prompt{
  font-size:1rem;
  font-weight:500;
  margin:4px 0 8px;
}

.life-guided-answer textarea{
  width:100%;
}

.life-guided-actions{
  justify-content:flex-end;
  gap:8px;
  margin-top:10px;
}

.life-guided-footer{
  justify-content:flex-end;
  margin-top:4px;
}

.life-guided-link{
  margin-top:4px;
  padding:0;
  border:none;
  background:none;
  font-size:0.8rem;
  color:var(--accent);
  cursor:pointer;
  text-decoration:underline;
  text-align:left;
}
.life-guided-link:hover{
  text-decoration:none;
}

/* Editor area sits beside list on larger screens */
@media (min-width: 768px){
  .life-layout{
    flex-direction:row;
    align-items:flex-start;
  }
  .life-list{
    flex:0 0 260px;
  }
  .life-editor{
    flex:1;
  }
}

.ai-buttons {
  margin-top: 4px;
  gap: 8px;
}

.ai-output-wrap {
  margin-top: 6px;
}

.ai-output-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563; /* muted gray */
  margin-bottom: 4px;
}

.ai-output {
  min-height: 80px;
  max-height: 260px;        /* NEW — prevents clipping */
  overflow-y: auto;         /* NEW — allows scrolling for long text */
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--accent-soft);
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.ai-reminder {
  margin-top: 6px;
  font-size: 0.8rem;
}

.lbl{ display:block; font-weight:800; margin:12px 0 6px; }
input[type="text"], input[type="url"], textarea, select, input[type="date"]{
  width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:#fff;
}
textarea{ resize: vertical; }

.wiz-progress{ list-style:none; display:flex; gap:8px; padding:0; margin:0 0 12px 0; }
.wiz-progress li{
  padding:6px 10px; border:1px solid var(--line); border-radius:999px; font-size:.9rem; color:var(--ink-soft); font-weight:700;
}
.wiz-progress li.active{ border-color: rgba(220,38,38,.35); background: var(--accent-soft); color: var(--ink); }

.wiz-step{ animation: none; }
.wiz-step.fade-in{ animation: fadeIn .18s ease both; }
@keyframes fadeIn{ from{ opacity:0; transform: translateY(6px);} to{opacity:1; transform:none;} }

.helper-line{
  background: rgba(2,6,23,.03); border:1px solid var(--line); color:var(--ink-soft);
  border-radius:12px; padding:8px 10px; margin-bottom:10px; font-size:.92rem;
}

/* Section Suggestions (AI) */
.section-suggestions{
  max-width:var(--maxw);
  margin:0 auto 10px;
  padding:0 24px;
  overflow:hidden;
  max-height:0;
  opacity:0;
  transition:max-height .25s ease, opacity .2s ease;
}
.section-suggestions.open{
  max-height:420px; /* enough for several suggestions */
  opacity:1;
}
.section-suggestions-inner{
  background:#fff;
  border:1px solid var(--line-soft);
  border-radius:14px;
  padding:12px 14px 10px;
  box-shadow:var(--shadow-card-soft);
}
.section-suggestions-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.section-suggestions-title{
  font-size:0.95rem;
  margin:0;
}
.section-suggestions-sub{
  margin:4px 0 6px 0;
  font-size:0.82rem;
}
.section-suggestions-list{
  margin-top:6px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.section-suggestion{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px;
  border-radius:10px;
  background:#F9FAFB;
}
.section-suggestion-text{
  flex:1;
  min-width:0;
}
.section-suggestion-title{
  font-weight:600;
  font-size:0.9rem;
  margin-bottom:2px;
}
.section-suggestion-desc{
  font-size:0.82rem;
  color:var(--ink-soft);
}
.section-suggestion-actions{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.section-suggestion-actions .primary.small,
.section-suggestion-actions .secondary.small,
.section-suggestion-actions .ghost.small{
  font-size:0.8rem;
  padding:5px 10px;
}

/* Make the loader sit nicely in the panel */
#section-suggestions-loader{
  margin-top:4px;
}

/* Inline AI wizard button placement */
.notes-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wiz-ai-inline {
  margin-left: 10px;
  flex-shrink: 0;
  font-size: 0.85rem;
  padding: 6px 10px;
}

.priority-row{ display:flex; align-items:center; gap:8px; }
.due-input{ min-width: 180px; }

.button-row{ display:flex; gap:8px; justify-content:flex-end; margin-top:14px; }

.review-grid{
  display:grid; grid-template-columns: 1fr 1fr; gap:8px;
  background:#fff; border:1px solid var(--line); border-radius:12px; padding:10px;
}
.review-grid .full{ grid-column: 1 / -1; }
.review-grid .k{ display:block; font-size:.8rem; color:var(--ink-soft); }
.review-grid .k + .v{ font-weight:800; }

.radio-pill{
  display:inline-flex; align-items:center; gap:6px;
  border:1px solid var(--line); border-radius:999px; padding:6px 10px; margin-right:6px; cursor:pointer;
}
.radio-pill input{ accent-color: var(--brand); }

/* ---------- TOAST ---------- */
.toast{
  position: fixed; left:50%; bottom:18px; transform:translateX(-50%);
  background:#111827; color:#fff; padding:10px 14px; border-radius:12px; box-shadow:var(--shadow-soft);
  opacity:0; pointer-events:none; transition: opacity .18s ease; z-index: 3000;
}
.toast.show{ opacity:1; }

/* ---------- COACHMARKS ---------- */
.coachmark, .coachmark-multi{
  position: fixed; z-index: 3200; background:#111827; color:#fff; padding:.75rem 1rem; border-radius:12px; box-shadow:var(--shadow-soft);
}
.coachmark{ bottom:5.5rem; right:1rem; max-width:240px; font-size:.9rem; }
.coachmark-multi{ bottom:6rem; right:50%; transform:translateX(50%); text-align:left; }
.coachmark-multi div{ margin-bottom:.25rem; }
#coach-close.small{ padding:6px 10px; }

/* ---------- FOOTER ---------- */
.site-footer{
  max-width: var(--maxw); margin:24px auto 16px; padding:12px 24px;
  color: var(--ink-soft); display:flex; gap:8px; align-items:center;
  background: var(--grad-footer);
  border-radius: 12px;
}

@media (min-width: 900px){
  .inline-capture input{ min-width:420px; }
}

/* Hard hides */
.empty-state[hidden],
.coachmark[hidden],
.coachmark-multi[hidden] { display: none !important; }

/* === LOGIN PAGE OFFSET FALLBACK === */
body.login main.layout.content {
  margin-top: 96px;  /* gets overridden by JS with exact measured height */
}

/* === LOGIN PAGE: keep branded gradient but remove stickiness === */
body.login .site-header {
  position: static; /* header participates in normal flow = no overlap */
}

/* === LOGIN PAGE: ensure main is visible === */
body.login main.layout {
  opacity: 1;
  transform: none;
}
/* v1.7 board header centering */
.board-head{
  display:flex;                /* override any previous layout */
  align-items:center;
  justify-content:center;      /* center title + count */
  text-align:center;
  gap:8px;
}

/* make the count look intentional next to the title */
.board-head [id^="colcount-"]{
  opacity:.7;
  font-weight:600;
  letter-spacing:.2px;
}
/* Link preview line on cards */
.link-row { margin-top:8px; }
.item-link {
  display:inline-block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#b91c1c;                 /* brand-ish red */
  text-decoration:underline;
  text-underline-offset:2px;
}
.item-link:hover { color:#dc2626; }
/* refined rounded drag-over highlight */
.board-col {
  border-radius: 16px;
  overflow: hidden;
}

.board-drop {
  position: relative;
  min-height: 48px;
}

.board-drop.drag-over::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(220,38,38,0.08); /* soft red wash instead of border */
  box-shadow: inset 0 0 0 2px rgba(220,38,38,0.25);
  pointer-events: none;
  z-index: 0;
}

/* keep cards above the highlight */
.board-drop > * {
  position: relative;
  z-index: 1;
}
/* unify card rounding inside board columns */
.board-item,
.card {
  border-radius: 12px;         /* match the drag highlight curve */
  overflow: hidden;            /* clip any inner corners or outlines */
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* optional: refine hover */
.board-item:hover,
.card:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}
/* v1.7 refine: no hard box on drag-over */
.board-drop.drag-over::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  background:rgba(220,38,38,0.06); /* soft glow only */
  box-shadow:none !important;       /* remove inner border */
  pointer-events:none;
  z-index:0;
}

/* keep cards above the wash */
.board-drop > * { position:relative; z-index:1; }

/* remove default focus rings that can look like boxes while dragging */
.board-drop:focus,
.board-card:focus { outline:none; }
/* Kill any hard outline/box on drag-over and keep only a soft wash */
.board-drop.drag-over,
.board-drop.drag-over::before,
.board-drop.drag-over::after {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* If an older ::after border still exists anywhere, cancel it */
.board-drop.drag-over::after { content: none !important; }

/* Soft rounded wash behind cards */
.board-col { border-radius: 16px; overflow: hidden; }
.board-drop { position: relative; min-height: 48px; }
.board-drop.drag-over::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(220,38,38,0.06);
  pointer-events: none;
  z-index: 0;
}
/* keep cards above the wash */
.board-drop > * { position: relative; z-index: 1; }
/* === v1.7 UI polish: gentle hover lift & brand cues === */

/* 1) Header tab buttons (section chips) */
.nav-tabs .chip{
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
  will-change: transform;
}
.nav-tabs .chip:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(220,38,38,.18);
  border-color: #dc2626;
  color:#b91c1c;
}

/* 1b) Suggested quick-add chips */
.prompt-chips .chip{
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
}
.prompt-chips .chip:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(220,38,38,.15);
  border-color:#dc2626;
  color:#b91c1c;
}

/* 2) Floating “+” (wizard FAB) */
#fab-add{
  transition: transform .15s ease, box-shadow .15s ease;
  will-change: transform;
}
#fab-add:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(220,38,38,.35);
}

/* 2b) Add button in quick-add row */
#quick-add-btn{
  transition: transform .15s ease, box-shadow .15s ease;
  will-change: transform;
}
#quick-add-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(220,38,38,.28);
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce){
  .nav-tabs .chip,
  .prompt-chips .chip,
  #fab-add,
  #quick-add-btn{ transition: none; }
}
/* Dark theme base */
body {
  background-color: var(--ll-bg);
}
/* === v1.7 Menu polish: cohesive pills, hover lift, brand cues === */
.menu-popover{
  min-width: 220px;
  padding: 10px;
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(17, 17, 26, .12);
  border: 1px solid #eee;
  background:#fff;
}

.menu-popover .menu-group-label{
  font-size:.85rem;
  color:#6b6b6b;
  margin:6px 4px 6px;
}

.menu-popover a[role="menuitem"],
.menu-popover button[role="menuitem"],
.menu-popover .linklike{
  display:block;
  width:100%;
  text-align:left;
  background:#fff;
  border:1px solid transparent;
  border-radius:12px;
  padding:10px 12px;
  margin:6px 0;
  font: inherit;
  color:#111;
  cursor:pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease, background-color .15s ease;
}

.menu-popover a[role="menuitem"]:hover,
.menu-popover button[role="menuitem"]:hover,
.menu-popover .linklike:hover{
  transform: translateY(-1px);
  background: rgba(220,38,38,.07);
  border-color:#fed7d7;
  box-shadow: 0 10px 22px rgba(220,38,38,.18);
  color:#b91c1c;
  text-decoration: none;
}

/* Focus: subtle brand ring, no jump */
.menu-popover a[role="menuitem"]:focus,
.menu-popover button[role="menuitem"]:focus,
.menu-popover .linklike:focus{
  outline: 2px solid rgba(220,38,38,.35);
  outline-offset: 2px;
  border-color:#fecaca;
}

/* Compact plain links (Privacy / Contact) keep spacing but no pill if preferred */
.menu-popover > a:not(.linklike)[role="menuitem"]{
  border-radius:10px;
  padding:8px 10px;
  margin:4px 0;
}
.menu-popover > a:not(.linklike)[role="menuitem"]:hover{
  background: rgba(220,38,38,.05);
  color:#b91c1c;
}
/* === v1.7 layout polish === */

/* 1) Header alignment fix */
.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header .menu {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* 2) Truncate long card content */
.note-card .title,
.board-card .title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-card .notes,
.board-card .notes {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 6.5em; /* fallback for non-webkit */
}
/* === v1.7 card actions: kebab menu === */
.mini-actions{ position:relative; display:flex; align-items:center; gap:6px; }
.mini-actions .kebab{
  width:28px; height:28px; line-height:28px;
  border:1px solid #e6e6f4; border-radius:8px; background:#fff;
  font-size:18px; padding:0; cursor:pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.mini-actions .kebab:hover{ transform:translateY(-1px); box-shadow:0 8px 20px rgba(220,38,38,.18); border-color:#fecaca; color:#b91c1c; }

.mini-actions .mini-menu{
  position:absolute; right:0; top:36px; min-width:160px; z-index:5;
  background:#fff; border:1px solid #eee; border-radius:12px; padding:6px;
  box-shadow:0 14px 30px rgba(17,17,26,.12); display:none;
}
.mini-actions.open .mini-menu{ display:block; }

.mini-actions .mini-menu button{
  display:block; width:100%; text-align:left;
  background:#fff; border:1px solid transparent; border-radius:10px;
  padding:8px 10px; margin:4px 0; cursor:pointer; font:inherit; color:#111;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease, background-color .15s ease;
}
.mini-actions .mini-menu button:hover{
  transform:translateY(-1px); background:rgba(220,38,38,.07); border-color:#fed7d7; box-shadow:0 10px 22px rgba(220,38,38,.18); color:#b91c1c;
}

/* hide old inline action buttons if they’re still rendered outside mini-menu */
.mini-actions > .pin,
.mini-actions > .edit,
.mini-actions > .del{ display:none !important; }
/* Keep card title rows as the positioning context */
.card-head,
.title-row{
  position: relative;
  padding-right: 40px; /* reserve room for kebab so text doesn't collide */
}

/* Mini-actions pinned to top-right, out of normal flow */
.mini-actions{
  position: absolute;
  top: 6px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

/* Kebab button look/feel */
.mini-actions .kebab{
  width:28px; height:28px; line-height:28px;
  border:1px solid #e6e6f4; border-radius:8px; background:#fff;
  font-size:16px; padding:0; cursor:pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.mini-actions .kebab:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(220,38,38,.18);
  border-color: #fecaca; color:#b91c1c;
}

/* The popover menu */
.mini-actions .mini-menu{
  position:absolute; right:0; top:34px; min-width:160px; z-index:5;
  background:#fff; border:1px solid #eee; border-radius:12px; padding:6px;
  box-shadow:0 14px 30px rgba(17,17,26,.12);
  display:none;
}
.mini-actions.open .mini-menu{ display:block; }

/* Menu items */
.mini-actions .mini-menu button{
  display:block; width:100%; text-align:left;
  background:#fff; border:1px solid transparent; border-radius:10px;
  padding:8px 10px; margin:4px 0; cursor:pointer; font:inherit; color:#111;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease, background-color .15s ease;
}
.mini-actions .mini-menu button:hover{
  transform:translateY(-1px); background:rgba(220,38,38,.07); border-color:#fed7d7; box-shadow:0 10px 22px rgba(220,38,38,.18); color:#b91c1c;
}

/* Keep your old inline action buttons hidden if they still render elsewhere */
.mini-actions > .pin,
.mini-actions > .edit,
.mini-actions > .del{ display:none !important; }

/* Screen-reader only helper */
.sr-only{
  position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
/* --- v1.7 fix: pin kebab to card top-right, reserve space, hide sr-only text --- */

/* Make the entire card the positioning context and reserve room for kebab */
.note-card,
.board-card,
.card,
.board-item {
  position: relative;
  padding-right: 44px;           /* prevents overlap with kebab */
}

/* If your templates also have a title row, keep its padding tight */
.card-head,
.title-row { padding-right: 0 !important; }

/* Pin kebab container to the true top-right of the card */
.mini-actions{
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
}

/* Kebab button styles */
.mini-actions .kebab{
  width: 28px; height: 28px; line-height: 28px;
  border: 1px solid #e6e6f4; border-radius: 8px; background: #fff;
  font-size: 16px; padding: 0; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.mini-actions .kebab:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(220,38,38,.18);
  border-color: #fecaca; color: #b91c1c;
}

/* Kebab popover */
.mini-actions .mini-menu{
  position: absolute; right: 0; top: 34px; min-width: 160px; z-index: 5;
  background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 6px;
  box-shadow: 0 14px 30px rgba(17,17,26,.12);
  display: none;
}
.mini-actions.open .mini-menu{ display: block; }

/* Menu items */
.mini-actions .mini-menu button{
  display: block; width: 100%; text-align: left;
  background: #fff; border: 1px solid transparent; border-radius: 10px;
  padding: 8px 10px; margin: 4px 0; cursor: pointer; font: inherit; color: #111;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease, background-color .15s ease;
}
.mini-actions .mini-menu button:hover{
  transform: translateY(-1px);
  background: rgba(220,38,38,.07);
  border-color: #fed7d7;
  box-shadow: 0 10px 22px rgba(220,38,38,.18);
  color: #b91c1c;
}

/* Visually hidden text */
.sr-only{
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
/* --- v1.7 kebab: anchor to card top-right and keep content clear --- */

/* Make the whole card the positioning context */
.board-card,
.note-card,
.board-item,
.card {
  position: relative;
}

/* Keep titles from colliding with the kebab */
.title-row,
.card-head {
  padding-right: 44px !important;
}

/* Absolute, true top-right for the kebab cluster */
.mini-actions {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
}

/* Kebab look/feel */
.mini-actions .kebab {
  width: 28px; height: 28px; line-height: 28px;
  border: 1px solid #e6e6f4; border-radius: 8px; background: #fff;
  font-size: 16px; padding: 0; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.mini-actions .kebab:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(220,38,38,.18);
  border-color: #fecaca; color: #b91c1c;
}

/* Popover menu */
.mini-actions .mini-menu {
  position: absolute; right: 0; top: 34px; min-width: 160px; z-index: 5;
  background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 6px;
  box-shadow: 0 14px 30px rgba(17,17,26,.12);
  display: none;
}
.mini-actions.open .mini-menu { display: block; }
/* --- v1.7 kebab harden: anchor, reserve space, kill any stray markers --- */

/* 1) Make every card a positioning context */
.board-card,
.note-card,
.board-item,
.card {
  position: relative;
}

/* 2) Reserve space on the header line so text/links never collide with kebab */
.title-row,
.card-head {
  padding-right: 48px !important;
}

/* 3) Pin kebab container to absolute top-right of the CARD (not the row) */
.mini-actions {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  display: flex;
  gap: 6px;
  z-index: 5;
}

/* 4) Kebab button look/feel */
.mini-actions .kebab {
  width: 28px; height: 28px; line-height: 28px;
  border: 1px solid #e6e6f4; border-radius: 8px; background: #fff;
  font-size: 16px; padding: 0; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.mini-actions .kebab:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(220,38,38,.18);
  border-color: #fecaca; color: #b91c1c;
}

/* 5) Popover menu placement */
.mini-actions .mini-menu {
  position: absolute; right: 0; top: 34px; min-width: 160px;
  background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 6px;
  box-shadow: 0 14px 30px rgba(17,17,26,.12);
  display: none;
  z-index: 6;
}
.mini-actions.open .mini-menu { display: block; }

/* 6) Defensive: remove any list/marker-like decorations that can render as "A" */
.title-row,
.card-head,
.notes,
.board-card,
.note-card {
  list-style: none !important;
}
.title-row::marker,
.card-head::marker,
.notes::marker { content: none !important; }
/* Force kebab to anchor to the card, not the title row */
.title-row,
.card-head {
  position: static !important;
  padding-right: 0 !important;
}

/* Last-resort: kill any markers that can render as stray letters */
.board-card *::marker,
.note-card *::marker {
  content: none !important;
}
/* Bring kebab menu above neighboring cards */
.mini-actions.open,
.mini-actions.open .mini-menu { z-index: 10000 !important; }

/* Ensure the card itself floats above siblings while menu is open/hovered */
.board-card, .note-card, .board-item, .card { position: relative; z-index: 1; }
.board-card:hover, .note-card:hover, .board-item:hover, .card:hover { z-index: 2; }
/* if menu is open, elevate the whole card stack context */
.mini-actions.open { position: absolute !important; }
.mini-actions.open ~ * { position: relative; z-index: 2; }

/* Let menus spill outside columns (avoid clipping) */
.board-col { overflow: visible !important; }

/* === Mobile polish: list-only, fast capture (<=640px) === */
@media (max-width: 640px){
  /* Hide board UI entirely */
  #board, .board, .board-wrap, .board-cols, .board-col, .board-drop {
    display:none !important;
  }

  /* Make sure list is visible */
  #list, .list, .list-wrap {
    display:block !important;
  }

  /* Tighten spacing for small screens */
  .nav-tabs{
    display:flex;
    flex-wrap:nowrap;
    overflow-x:auto;
    padding:0 16px 6px;
    margin:12px 0 4px;
    gap:8px;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .nav-tabs::-webkit-scrollbar{
    display:none;
  }
  .nav-tabs .chip{
    flex:0 0 auto;
  }
  .quick-add{
    position:sticky;
    top:0;
    z-index:3;
    background:#fff;
    padding-top:8px;
    border-bottom:1px solid #eee;
  }
  .search-row{
    margin:8px 0;
  }

  /* Bigger touch targets */
  .mk-btn, .secondary, .chip{
    min-height:40px;
  }

  /* Clamp notes more aggressively on mobile */
  .note-card .notes,
  .board-card .notes{
    -webkit-line-clamp: 3;
    max-height: 5em;
  }

  /* Layout & padding tighten for app on phones */
  .layout.content{
    padding:12px 16px 80px;
    max-width:100%;
  }

  .top-row{
    flex-direction:column;
    align-items:flex-start;
    gap:8px;
    margin:4px auto 8px;
    padding:0 4px;
  }

  .chip-row{
    width:100%;
    flex-wrap:wrap;
    justify-content:flex-start;
  }

  /* Let search shrink instead of forcing horizontal scroll */
  #search-input{
    min-width:0;
    flex:1;
  }

  /* Quick add: single column on narrow screens (no overflow) */
  .inline-capture{
    grid-template-columns:1fr;
    padding:10px 10px 12px;
  }

  .inline-capture input{
    min-width:0;
  }

  .inline-capture .primary.small{
    width:100%;
    justify-content:center;
  }

  /* Hard clamp any horizontal expansion */
  html, body{
    max-width:100vw;
    overflow-x:hidden;
  }

  .site-header,
  .header-inner,
  .top-row,
  .layout.content,
  .site-footer,
  .list-wrap{
    max-width:100%;
    overflow-x:hidden;
  }

  /* Mobile header: compact with hamburger */
  .site-header .header-inner{
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    row-gap: 0;
  }

  .brand-wrap{
    display:flex;
    flex-direction:column;
    gap:2px;
    width:auto;
  }

  .tagline{
    font-size:.8rem;
  }

  .menu{
    display:none !important;
  }

  #btn-signout,
  #btn-help,
  #btn-account{
    display:none !important;
  }

  .mobile-menu-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    margin-left:auto;
  }
}

/* === Export modal visibility control (robust) === */
#export-modal {
  position: fixed;
  inset: 0;
  display: none;
  pointer-events: none;
  opacity: 0;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.35);
  z-index: 1000;
}

#export-modal .modal-box {
  width: min(680px, 92vw);
  max-height: 80vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 16px 16px 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}

/* Only when opened do we show and allow interactions */
#export-modal.show[aria-hidden="false"] {
  display: flex;
  pointer-events: auto;
  opacity: 1;
}

/* Ensure header & help menu are always clickable and on top */
.site-header { z-index: 1200; }

.menu-popover {
  z-index: 1300;
  position: absolute;
  top: 100%;
  right: 0;
}

/* Defensive: any hidden modal cannot intercept clicks.
   Exclude .open so the New Team wizard (which uses .open, not .show) can display. */
.modal:not(.show):not(.open) { display: none !important; pointer-events: none !important; }
/* Keep header above content and popover above header */
.site-header { position: sticky; top: 0; z-index: 1200; }

.menu-popover {
  z-index: 1300;
}
/* -------------------------------------
   Keepsake – AI Assist Layout
-------------------------------------- */
.keepsake-ai-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 6px 0 8px;
}

.keepsake-ai-row select {
  min-width: 170px;
}

.keepsake-ai-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Keepsake letter font */
#export-letter {
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  line-height: 1.45;
}
/* Signup plan reminder chip on the login page */
body.login #signup-plan-note {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #991b1b;
  font-weight: 600;
  font-size: 0.8rem;
}
/* === Full-screen onboarding modal === */

.onboarding-modal{
  z-index: 2600;
  background: radial-gradient(circle at top,
    rgba(220,38,38,0.20),
    rgba(15,23,42,0.82));
}

.onboarding-box{
  max-width: 840px;
  width: min(840px, 100vw - 32px);
  margin: 6vh auto;
  border-radius: 24px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(248,247,252,1), #ffffff);
  position: relative;
}

.onboarding-head{
  border-bottom: none;
  padding: 18px 22px 10px;
}

.onboarding-subtitle{
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 2px;
}

.onboarding-body{
  padding: 12px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.onboarding-progress{
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
}

.onboarding-progress li{
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(148,163,184,0.6);
  transition: background 0.18s ease, transform 0.18s ease;
}

.onboarding-progress li.active{
  background: var(--brand);
  transform: scale(1.15);
}

.onboarding-step h2{
  margin: 4px 0 6px;
  font-size: 1.1rem;
}

.onboarding-step p{
  margin: 0 0 10px;
}

.onboarding-section-list{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.onboarding-section-list button{
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: #fff;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.onboarding-section-list button span{
  display: block;
}

.onboarding-section-list button .onb-section-label{
  font-size: 0.95rem;
}

.onboarding-section-list button .onb-section-caption{
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 2px;
}

.onboarding-section-list button:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(220,38,38,0.2);
  border-color: rgba(220,38,38,0.55);
}

.onboarding-section-list button.onb-selected{
  background: var(--accent-soft);
  border-color: rgba(220,38,38,0.9);
}

.onboarding-actions{
  margin-top: 12px;
  display: flex;
  align-items: center;
}

.onboarding-actions #onb-back{
  min-width: 90px;
}

.onboarding-actions #onb-next,
.onboarding-actions #onb-finish{
  min-width: 160px;
}

/* First-save choice overlay inside onboarding */
.onb-choice-backdrop{
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(15,23,42,0.25), rgba(15,23,42,0.65));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2601;
}

.onb-choice-backdrop[hidden]{
  display: none;
}

.onb-choice-sheet{
  max-width: 460px;
  width: 100%;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15,23,42,0.35);
  padding: 18px 20px 16px;
}

.onb-choice-sheet h3{
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.onb-choice-sheet p{
  margin: 0 0 14px;
  font-size: 0.9rem;
}

/* Brand-alt button (sits next to primary, same color family) */
.purple-alt {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.purple-alt:hover {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(220, 38, 38, 0.55);
}

/* Make Save + Dashboard feel like one group */
.onboarding-actions-right{
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.onboarding-actions-right .purple-alt,
.onboarding-actions-right #onb-finish{
  min-width: 150px;
}

/* Mobile stacking */
@media (max-width: 640px){
  .onboarding-actions{
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
  }

  .onboarding-actions-right{
    width: 100%;
    justify-content: stretch;
  }

  .onboarding-actions-right .purple-alt,
  .onboarding-actions-right #onb-finish{
    flex: 1 1 50%;
  }
}

.onb-choice-actions{
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 640px){
  .onb-choice-sheet{
    max-width: 100%;
    padding-inline: 16px;
  }

  .onb-choice-actions{
    flex-direction: column;
    align-items: stretch;
  }

  .onb-choice-actions .secondary,
  .onb-choice-actions .primary{
    width: 100%;
    justify-content: center;
  }
}

/* Mobile: make it truly full-screen and keep buttons big */
@media (max-width: 640px){
  .onboarding-box{
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .onboarding-body{
    padding-inline: 16px;
    padding-bottom: 20px;
  }

  .onboarding-section-list{
    grid-template-columns: 1fr;
  }

  .onboarding-actions{
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .onboarding-actions #onb-back,
  .onboarding-actions #onb-next,
  .onboarding-actions #onb-finish{
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* ----- Life Stories: Draft book view readability ----- */

.life-view-toggle {
  display: flex;
  gap: 8px;
  margin: 8px 0 6px;
}

.life-view-chip {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.life-view-chip-active {
  background: var(--purple);
  color: #fff;
}

#life-book {
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line-soft, #e4e4ef);
  background: #ffffff;
  max-height: 300px;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.6;
}

.life-book-empty {
  color: var(--muted, #6b7280);
}

.life-book-section {
  margin-bottom: 20px;
}

.life-book-section-title {
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 6px;
}

.life-book-entry {
  margin-bottom: 12px;
}

.life-book-entry-title {
  font-weight: 600;
  margin-bottom: 3px;
}

.life-book-entry-meta {
  font-size: 0.78rem;
  color: var(--muted, #6b7280);
  margin-bottom: 4px;
}

.life-book-entry-body {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Chapter intros */

.life-book-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.life-book-section-header .life-book-section-title {
  margin: 0;
}

.life-book-section-header .small {
  font-size: 0.78rem;
  padding: 4px 10px;
}

.life-book-chapter-intro {
  border-radius: 10px;
  background: rgba(248, 247, 252, 0.9);
  padding: 8px 10px;
  margin-bottom: 10px;
}

.life-book-chapter-intro-body {
  margin-top: 4px;
}

.life-book-chapter-intro-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.life-book-chapter-intro-empty {
  margin: 0;
  font-size: 0.82rem;
  color: #6b7280;
}

.life-book-chapter-intro-edit {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.life-book-chapter-intro-textarea {
  width: 100%;
  min-height: 68px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 0.9rem;
  resize: vertical;
}

.life-book-chapter-intro-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.life-book-section-entries {
  margin-top: 4px;
}

/* Toggle visibility when in book view */
.life-book-mode #life-story {
  display: none;
}

.life-book-mode #life-book {
  display: block;
}

.life-book-mode #life-save {
  display: none;
}

/* Life Stories modal spacing tweak */
#life-modal .onboarding-body{
  padding-top: 8px;
}
/* =======================================
   Lineup Logix – App Shell & Layout
   ======================================= */
.app-main {
  max-width: var(--maxw);
  margin: 8px auto 24px;
  padding: 0 16px 80px;
}

.app-layout.app-layout-lineuplogix {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  padding: 14px 16px 18px;
}

/* Toolbar: sport + team selectors */
.ll-toolbar {
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.ll-toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  justify-content: space-between;
}

.ll-toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field-input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 0.9rem;
  background: #fff;
}

/* Team selector row helper */
.ll-team-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Main LL section (tabs + panels) */
.ll-main {
  margin-top: 8px;
}

/* Tabs: Roster / Lineups / Settings */
.ll-nav-tabs {
  margin: 4px 0 10px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-tab {
  border-radius: 999px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease,
              border-color 0.15s ease,
              color 0.15s ease,
              transform 0.12s ease,
              box-shadow 0.12s ease;
}

.nav-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.45);
}

.nav-tab.is-active {
  background: var(--accent-soft);
  border-color: rgba(220, 38, 38, 0.8);
  color: #991b1b;
}

/* Panels: only the active tab shows */
.ll-tab-panels {
  margin-top: 8px;
}

.ll-tab-panel {
  display: none;
}

.ll-tab-panel.is-active {
  display: block;
}

/* Panel headers */
.ll-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-title {
  margin: 0;
  font-size: 1.0rem;
  font-weight: 700;
}

/* Shared empty state for LL sections */
.ll-empty-state {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed var(--line-dashed);
  background: #f9fafb;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* Roster list */
.ll-roster-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ll-roster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.ll-roster-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ll-jersey {
  min-width: 26px;
  text-align: right;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.ll-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.ll-positions {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* Lineups tab – saved lineup cards */
.ll-lineups-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.ll-lineup-card {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: #ffffff;
  padding: 14px 16px 16px;
  box-shadow: 0 4px 14px rgba(15,23,42,0.04);
}

.ll-lineup-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.ll-lineup-title {
  font-size: 0.98rem;
  font-weight: 600;
  margin: 0;
}

.ll-lineup-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.ll-lineup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.ll-lineup-quarter {
  border-radius: 10px;
  border: 1px dashed var(--line-soft);
  padding: 8px 10px;
  background: rgba(248,250,252,0.8);
}

.ll-lineup-quarter-label {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink-soft);
}

.ll-lineup-quarter-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.85rem;
}

/* Mobile tightening */
@media (max-width: 640px) {
  .ll-lineup-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .ll-lineup-meta {
    white-space: normal;
  }
}

/* More button on roster rows */
.ll-roster-more {
  border-radius: 999px;
  padding-inline: 8px;
  font-size: 1.1rem;
}

/* Lineups: attendance + slider area */
.ll-lineup-builder {
  margin-top: 4px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px;
}

.ll-lineup-columns {
  display: contents;
}

/* Attendance column */
.ll-attendance-card {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
}

.ll-attendance-card h3 {
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 700;
}

.ll-attendance-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ll-attendance-row {
  display: grid;
  grid-template-columns: 18px minmax(90px, 1fr) 150px;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.ll-attendance-check{
  width: 16px;
  height: 16px;
  margin: 0;
  transform: translateY(1px);
}

.ll-attendance-name{
  font-weight: 600;
}

.ll-attendance-check {
  width: 16px;
  height: 16px;
}

.ll-attendance-name {
  flex: 1;
}

.ll-attendance-name{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ll-attendance-head {
  display: grid;
  grid-template-columns: 18px minmax(90px, 1fr) 150px;
  gap: 10px;
  padding: 6px 2px 6px;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.ll-attendance-note {
  margin-top: 8px;
}

/* Workspace roster panel: tighter arrival column */
.ll-attendance-card--workspace .ll-attendance-row,
.ll-attendance-card--workspace .ll-attendance-head{
  grid-template-columns: 18px minmax(90px, 1fr) 120px;
}

/* Workspace attendance: slightly smaller so it fits neatly by names */
.ll-attendance-card--workspace .ll-attendance-row{
  font-size: 0.85rem;
}

.ll-attendance-card--workspace .ll-arrival-select{
  padding: 5px 8px;
  font-size: 0.8rem;
  border-radius: 9px;
}

.ll-attendance-card--workspace .ll-attendance-head{
  font-size: 0.72rem;
}

.ll-lineup-actions-centered{
  display:flex;
  flex-direction: column;
  align-items:center;
  gap: 10px;
  margin-top: 12px;
}

.ll-lineup-actions-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  flex-wrap: wrap;
}

.ll-arrival-select {
  width: 100%;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.85rem;
}

.ll-arrival-select:disabled {
  opacity: 0.55;
  background: #f9fafb;
}

/* Slider column */
.ll-philosophy-block {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ll-philosophy-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.helper-text {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

#ll-philosophy-slider {
  width: 100%;
}

.ll-philosophy-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

/* Saved lineups list */
.ll-lineups-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Settings content area stub */
.ll-settings-content {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.9rem;
}

.ll-rules-head {
  margin-bottom: 10px;
}

.ll-rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.ll-rules-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Workspace */
.ll-game-workspace {
  margin-top: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
}

.ll-workspace-body{
  display:grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  align-items:start;
}

.ll-bench{
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(248,250,252,0.85);
  padding: 10px;
}

/* Workspace attendance: tighten so dropdown fits cleanly */
.ll-attendance-card--workspace .ll-attendance-head,
.ll-attendance-card--workspace .ll-attendance-row{
  grid-template-columns: 22px minmax(0, 1fr) 118px;
}

.ll-attendance-card--workspace .ll-attendance-row{
  font-size: 0.82rem;
  gap: 8px;
}

.ll-attendance-card--workspace .ll-arrival-select{
  width: 100%;
  max-width: 118px;
  font-size: 0.82rem;
  padding: 6px 8px;
}

.ll-bench-head{
  margin-bottom: 8px;
}

.ll-bench-title{
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
}

.ll-bench-list{
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
}

.ll-player-chip{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background:#fff;
  padding: 7px 10px;
  font-size: 0.85rem;
  cursor: grab;
  user-select: none;
}

.ll-player-chip:active{ cursor: grabbing; }

.ll-player-chip.is-over{
  outline: 2px solid var(--line);
  outline-offset: 2px;
}

body.ll-dragging .ll-player-chip.is-over{
  position: relative;
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.10);
  outline-color: var(--brand);
}

body.ll-dragging .ll-player-chip.is-over::after{
  content: "Swap";
  position: absolute;
  right: 10px;
  top: -10px;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--brand);
  background: #fff;
  color: var(--brand);
}

.ll-chip-meta{
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.ll-dropzone{
  border-radius: 10px;
  padding: 4px 6px 2px;
  min-height: 52px;
}

.ll-dropzone.is-over{
  background: rgba(220,38,38,0.06);
  box-shadow: inset 0 0 0 2px rgba(220,38,38,0.18);
}

.ll-workspace-head {
  margin-bottom: 10px;
}

.ll-warnings {
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  padding: 8px 10px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.ll-segment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ll-segment {
  border-radius: 12px;
  border: 1px dashed var(--line-soft);
  background: rgba(248,250,252,0.85);
  padding: 8px;
  min-height: 72px;
}

.ll-segment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.ll-segment-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 0;
}

.ll-lock-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}

.ll-lock-btn.is-locked {
  border-color: rgba(220, 38, 38, 0.5);
  color: #991b1b;
  background: rgba(220, 38, 38, 0.06);
}

.ll-segment-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.85rem;
}

/* Simple hidden helper used by JS */
.hidden {
  display: none !important;
}

/* --------- Mobile polish (LL-specific) --------- */
@media (max-width: 640px) {
  .app-main {
    padding: 0 12px 72px;
    margin: 12px auto 24px;
  }

  .app-layout.app-layout-lineuplogix {
    padding: 12px 10px 16px;
    border-radius: 14px;
  }

  .ll-toolbar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .ll-lineup-builder {
    grid-template-columns: 1fr;
  }
    .ll-attendance-row,
  .ll-attendance-head {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .ll-arrival-select {
    grid-column: 1 / -1;
  }

  .ll-rules-grid {
    grid-template-columns: 1fr;
  }

  .ll-workspace-body{
    grid-template-columns: 1fr;
  }

  .ll-segment-grid {
    grid-template-columns: 1fr 1fr;
  }

}

/* === Lineup Logix: Player editor modal === */

.player-modal-box {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  overflow: hidden;
}

.player-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
}

.player-modal-body .field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.player-modal-body .field-group {
  flex: 1 1 0;
}

.field-group-compact {
  max-width: 140px;
}

.player-ratings {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-rating-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.player-rating-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.player-rating-pill {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4ff;
  color: #4b5563;
}

.player-overall {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.player-overall-score span {
  font-size: 1.3rem;
  font-weight: 600;
}

.player-conflicts-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 10px;
}

.player-conflicts-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.modal-footer.button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.modal-footer-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.danger-outline {
  border-color: #fecaca;
  color: #b91c1c;
}

.danger-outline:hover {
  background: #fef2f2;
}
/* =====================================================
   Softball MVP (NEW)
   - Tryouts / Rankings
   - Draft Assistant (3-team snake)
   NOTE: All softball styles are prefixed sb- to avoid any
   chance of impacting basketball or other tabs.
   ===================================================== */

/* Softball sub-tabs row (Tryouts / Draft) */
#sb-tabs,
.sb-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin: 6px 0 12px;
}

#sb-tabs .nav-tab,
.sb-tabs .nav-tab{
  /* reuse existing .nav-tab styles; no overrides needed */
}

/* Panels */
#sb-panel-tryouts,
#sb-panel-draft{
  margin-top: 6px;
}

/* ---------- Tryouts list ---------- */
.sb-tryout-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background:#fff;
  box-shadow: 0 3px 10px rgba(15,23,42,0.04);
}

.sb-tryout-row + .sb-tryout-row{
  margin-top: 8px;
}

.sb-tryout-main{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}

.sb-tryout-title{
  display:flex;
  align-items:baseline;
  gap:8px;
  min-width:0;
}

.sb-tryout-num{
  font-weight:800;
  font-size:0.85rem;
  color: var(--ink-soft);
  flex:0 0 auto;
}

.sb-tryout-name{
  font-weight:800;
  font-size:0.98rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sb-tryout-sub{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  font-size:0.82rem;
  color: var(--ink-soft);
}

.sb-score{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid rgba(220,38,38,0.25);
  background: rgba(220,38,38,0.08);
  color:#991b1b;
  font-weight:800;
  font-size:0.78rem;
}

.sb-tags{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  color: var(--ink);
  font-weight:700;
  font-size:0.76rem;
}

.sb-muted{
  color: var(--ink-soft);
  font-size:0.78rem;
}

/* ---------- Draft status strip ---------- */
.sb-draft-status{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  justify-content:space-between;
  margin: 6px 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 3px 10px rgba(15,23,42,0.04);
}

.sb-status-left,
.sb-status-right{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}

.sb-status-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  font-size:0.82rem;
  font-weight:700;
  color: var(--ink);
}

.sb-status-pill strong{
  font-weight:900;
}

/* ---------- Available Players pool row ---------- */
.sb-pool-wrap{
  margin-top: 10px;
  margin-bottom: 12px;
}

.sb-pool-title-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 8px;
}

.sb-pool-title{
  font-weight:900;
  font-size:0.95rem;
  margin:0;
}

#sb-available-pool,
.sb-available-pool{
  display:flex;
  gap:10px;
  align-items:stretch;
  padding: 10px;
  border-radius: 14px;
  border: 1px dashed var(--line-dashed);
  background: rgba(248,250,252,0.85);
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

#sb-available-pool::-webkit-scrollbar,
.sb-available-pool::-webkit-scrollbar{
  height: 8px;
}
#sb-available-pool::-webkit-scrollbar-thumb,
.sb-available-pool::-webkit-scrollbar-thumb{
  background: rgba(15,23,42,0.14);
  border-radius: 999px;
}

.sb-pool-card{
  flex: 0 0 220px;
  scroll-snap-align: start;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:#fff;
  padding: 10px 10px 9px;
  box-shadow: 0 6px 16px rgba(15,23,42,0.06);
  cursor: grab;
  user-select:none;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.sb-pool-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(220,38,38,.14);
  border-color: rgba(220,38,38,.25);
}

.sb-pool-card:active{
  cursor: grabbing;
  transform: translateY(0);
}

.sb-pool-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.sb-pool-title{
  font-weight:800;
  font-size:0.9rem;
  line-height:1.2;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sb-pool-score{
  flex:0 0 auto;
  font-weight:900;
  font-size:0.95rem;
  color:#991b1b;
  padding:2px 8px;
  border-radius:999px;
  background: rgba(220,38,38,0.08);
  border:1px solid rgba(220,38,38,0.2);
}

.sb-pool-tags{
  margin-top: 6px;
  font-size:0.78rem;
  color: var(--ink-soft);
}

/* ---------- Team buckets (3 columns) ---------- */
#sb-draft-teams-wrap,
.sb-draft-teams-wrap{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items:start;
}

.sb-team-card{
  border-radius: 16px;
  border: 1px solid var(--line);
  background:#fff;
  box-shadow: var(--shadow-card);
  overflow:hidden;
  min-height: 280px;
}

.sb-team-head{
  padding: 10px 12px;
  font-weight: 900;
  border-bottom: 1px solid var(--line);
  background: rgba(220,38,38,0.04);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.sb-team-table{
  padding: 10px;
}

.sb-team-row{
  display:grid;
  grid-template-columns: 52px minmax(0, 1fr) 58px 56px;
  gap: 8px;
  align-items:center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background:#fff;
  cursor: grab;
  user-select:none;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.sb-team-row--head{
  cursor: default;
  user-select: none;
  background: rgba(248,250,252,0.9);
  border-style: dashed;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: none;
}

.sb-team-row + .sb-team-row{
  margin-top: 8px;
}

.sb-team-row:active{
  cursor: grabbing;
}

.sb-team-cell{
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:0.86rem;
}

.sb-team-pick{
  font-weight:900;
  color: var(--ink-soft);
  text-align:right;
}

.sb-team-name{
  font-weight:800;
}

.sb-team-score{
  text-align:right;
  font-weight:900;
  color:#991b1b;
}

.sb-team-tags{
  text-align:right;
  color: var(--ink-soft);
  font-weight:800;
  font-size:0.78rem;
}

/* Dropzone area inside each team card */
.sb-team-dropzone{
  margin-top: 8px;
  padding: 8px;
  border-radius: 14px;
  border: 1px dashed var(--line-dashed);
  background: rgba(248,250,252,0.8);
  min-height: 170px;
}

/* Empty hint */
.sb-team-empty{
  padding: 10px 8px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* Visual feedback while dragging (JS can toggle class on body) */
body.ll-dragging .sb-team-dropzone.is-over,
.sb-team-dropzone.is-over{
  background: rgba(220,38,38,0.06);
  box-shadow: inset 0 0 0 2px rgba(220,38,38,0.18);
  border-color: rgba(220,38,38,0.45);
}

/* Small controls row for draft (names/order/buttons) */
.sb-draft-controls{
  display:flex;
  flex-wrap:wrap;
  gap:10px 12px;
  align-items:flex-end;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:#fff;
}

.sb-draft-controls .field-label{
  margin: 0;
}

.sb-draft-controls .field-group{
  flex: 1 1 180px;
  min-width: 180px;
}

.sb-draft-controls .button-row{
  margin-top: 0;
  justify-content: flex-start;
}

/* Mobile: stack columns cleanly */
@media (max-width: 900px){
  #sb-draft-teams-wrap,
  .sb-draft-teams-wrap{
    grid-template-columns: 1fr;
  }
  .sb-pool-card{
    flex-basis: 200px;
  }
}

/* Phase D: Lineups tab is the workspace; hide saved lineups placeholder area */
#ll-saved-lineups,
#ll-lineups-list,
.ll-saved-lineups,
.ll-lineups-placeholder{
  display: none !important;
}
/* === Lineup Logix: Diamond Game Day wizard === */

.ll-diamond-shell {
  /* Step 4 — was margin-top:10px, which showed as a white band between the
     dark site-header and the Game Day wizard. */
  margin-top: 0;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ll-diamond-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ll-step-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.ll-step-chip.is-active {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(37, 99, 235, 0.06);
}

.ll-diamond-stage {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}

.ll-diamond-counts {
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.ll-diamond-availability-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ll-diamond-availability-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
}

.ll-diamond-player-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ll-diamond-player-name {
  font-weight: 600;
}

.ll-diamond-player-sub {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.ll-diamond-availability-row.is-absent {
  opacity: 0.55;
  background: #f9fafb;
}

.ll-diamond-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ll-diamond-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ll-diamond-inning-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.ll-diamond-inning-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 10px;
}

.ll-diamond-slot {
  font-size: 0.88rem;
}

.ll-diamond-slot strong {
  display: block;
  margin-bottom: 2px;
}

.ll-diamond-bench-note {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

@media (max-width: 720px) {
  .ll-diamond-availability-row {
    grid-template-columns: 1fr;
  }

  .ll-diamond-inning-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ================================================================
   LINEUP LOGIX — PHASE 1 DARK THEME + MOBILE-FIRST SHELL
   All overrides live in this block so cascade is clear and rollback
   is easy. Nothing above this line was structurally changed.
   ================================================================ */

/* ── 1. Header ─────────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, #111827 0%, #0F172A 60%, #1E293B 100%);
  border-bottom: none;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
  height: 48px;
  min-height: 48px;
  margin-bottom: 0; /* Step 4 */
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.site-header::before,
.site-header::after { display: none; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 0 14px;
  height: 48px;
}

.brand {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  color: #ffffff;
}
.brand-dot { color: #C8561F; }
.tagline { display: none; }

/* Always show hamburger; hide the desktop nav cluster */
.menu { display: none !important; }
.mobile-menu-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.35);
  color: #ffffff;
}
#logout-btn { display: none !important; }
#user-email-nav { display: none !important; }

/* Mobile menu overlay */
.mobile-menu-panel { background: rgba(0,0,0,0.7); }
.mobile-menu-sheet {
  background: var(--ll-bg-2);
  box-shadow: 0 20px 50px rgba(0,0,0,0.55);
}
.mobile-menu-sheet .secondary {
  background: var(--ll-bg-3);
  color: var(--ll-text);
  border-color: var(--ll-border);
}

/* Desktop menu popover dark */
.menu-popover {
  background: var(--ll-bg-2);
  border-color: var(--ll-border);
  box-shadow: 0 14px 30px rgba(0,0,0,0.45);
}
.menu-popover a,
.menu-popover .linklike,
.menu-popover a[role="menuitem"],
.menu-popover button[role="menuitem"] {
  background: var(--ll-bg-2);
  color: var(--ll-text);
}
.menu-popover a:hover,
.menu-popover .linklike:hover,
.menu-popover a[role="menuitem"]:hover,
.menu-popover button[role="menuitem"]:hover {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
  color: var(--ll-text);
  box-shadow: none;
  transform: none;
}

/* ── 2. Global buttons ─────────────────────────────────────────── */
.primary {
  background: var(--ll-red);
  color: var(--ll-bg);
  border: none;
}
.primary:hover { filter: brightness(1.08); }
.primary:active { transform: translateY(1px); }
.primary:disabled {
  background: var(--ll-bg-4);
  color: var(--ll-text-3);
  opacity: 0.75;
  cursor: not-allowed;
  filter: none;
}

.secondary {
  background: var(--ll-bg-3);
  color: var(--ll-text-2);
  border-color: var(--ll-border);
}
.secondary:hover { background: var(--ll-bg-4); color: var(--ll-text); }

.ghost {
  background: transparent;
  color: var(--ll-text-3);
  border-color: var(--ll-border);
}
.ghost:hover { background: var(--ll-bg-3); color: var(--ll-text-2); }

.icon-btn {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
  color: var(--ll-text-2);
}

/* Danger */
.danger-outline {
  border-color: rgba(224,82,82,0.45);
  color: var(--ll-red);
}
.danger-outline:hover { background: rgba(224,82,82,0.1); }

/* Badge */
.badge-premium {
  background: rgba(220,38,38,0.12);
  color: var(--ll-red);
  border-color: rgba(220,38,38,0.25);
}

/* ── 3. Form elements ──────────────────────────────────────────── */
input[type="text"],
input[type="url"],
input[type="date"],
textarea,
select,
.field-input {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
  color: var(--ll-text);
}
input[type="text"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--ll-red);
  box-shadow: 0 0 0 2px rgba(220,38,38,0.14);
}
input[type="checkbox"] { accent-color: var(--ll-red); }
input[type="range"]    { accent-color: var(--ll-red); }

.field-label  { color: var(--ll-text-3); }
.helper-text  { color: var(--ll-text-3); }
.helper-line  { background: var(--ll-bg-3); border-color: var(--ll-border); color: var(--ll-text-3); }

/* ── 4. App shell max-width 480 px ─────────────────────────────── */
.app-main {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 80px;
}

.app-layout.app-layout-lineuplogix {
  background: var(--ll-bg-2);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius);
  box-shadow: none;
  padding: 12px 14px 16px;
}

@media (min-width: 481px) {
  /* Step 2 — was 8px top padding, which read as a white band above the
     Game Day header. */
  .app-main { padding: 0 0 80px; }
}

@media (max-width: 480px) {
  .app-main { padding: 0 0 80px; }
  .app-layout.app-layout-lineuplogix {
    border-left: none;
    border-right: none;
    border-radius: 0;
  }
}

/* ── 5. Toolbar — condensed single-line ────────────────────────── */
.ll-toolbar {
  border-bottom: 1px solid var(--ll-border);
  padding: 8px 0 10px;
}
.ll-toolbar-inner {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}
.ll-toolbar-group {
  flex: 1;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ll-toolbar-group label.field-label {
  flex-shrink: 0;
  white-space: nowrap;
}
.ll-toolbar-group .field-input { flex: 1; min-width: 0; }
.ll-team-group { flex: 2; }
.ll-team-select-row { gap: 6px; }
#ll-team-helper { display: none; }
#ll-add-team-btn { flex-shrink: 0; font-size: 0.78rem; padding: 5px 9px; }

/* ── 6. Nav tabs — single scrollable pill row ──────────────────── */
.ll-nav-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  padding: 4px 0 6px;
  margin: 8px 0 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ll-nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  flex: 0 0 auto;
  white-space: nowrap;
  background: var(--ll-bg-3);
  color: var(--ll-text-2);
  border-color: var(--ll-border);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 7px 14px;
}
.nav-tab:hover {
  background: var(--ll-bg-4);
  color: var(--ll-text);
  border-color: var(--ll-border);
  box-shadow: none;
  transform: none;
}
.nav-tab.is-active {
  background: var(--ll-red);
  border-color: var(--ll-red);
  color: var(--ll-bg);
}
.nav-tab.is-active:hover {
  background: var(--ll-red);
  color: var(--ll-bg);
}

/* Softball sub-tabs */
#sb-tabs .nav-tab,
.sb-tabs .nav-tab { /* inherits .nav-tab dark overrides */ }

/* ── 7. Wizard step chips ──────────────────────────────────────── */
.ll-diamond-steps {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ll-diamond-steps::-webkit-scrollbar { display: none; }

.ll-step-chip {
  flex: 0 0 auto;
  white-space: nowrap;
  background: var(--ll-bg-3);
  color: var(--ll-text-3);
  border-color: var(--ll-border);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  padding: 7px 16px;
}
.ll-step-chip:hover {
  background: var(--ll-bg-4);
  color: var(--ll-text-2);
}
.ll-step-chip.is-active {
  background: rgba(220,38,38,0.10);
  border-color: var(--ll-red);
  color: var(--ll-red);
  box-shadow: 0 0 0 1px rgba(220,38,38,0.22);
}
/* Completed step — dimmed with checkmark */
.ll-step-chip.is-done {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
  color: var(--ll-text-3);
  opacity: 0.65;
}

/* ── 8. Diamond stage content ──────────────────────────────────── */
.ll-diamond-stage {
  background: var(--ll-bg);
  border-color: var(--ll-border);
  padding-bottom: 80px; /* clear the sticky nav */
}

.ll-diamond-shell { gap: 8px; }

/* ── 9. Sticky bottom CTA bar ──────────────────────────────────── */
.ll-diamond-nav {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--ll-bg-2);
  border-top: 1px solid var(--ll-border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  /* override the old flex-direction: column-reverse from 720px query */
  flex-direction: row !important;
}
.ll-diamond-nav #ll-diamond-back-btn {
  flex: 0 0 auto;
  width: auto;
  padding: 10px 24px;
}
.ll-diamond-nav #ll-diamond-next-btn {
  flex: 0 0 auto;
  width: auto;
  padding: 10px 24px;
}
/* Override the old 720px width:100% rule */
.ll-diamond-nav button { width: auto !important; }

/* ── Dugout View: right-align both buttons, auto width ───────────────────── */
.ll-diamond-nav--dugout {
  justify-content: flex-end;
  padding: 12px 16px;
}
.ll-diamond-nav--dugout #ll-diamond-next-btn {
  flex: 1 1 0 !important;
  width: auto !important;
}
/* ── Step 4 · Planning: "▶ Start Game" in the bottom nav bar ──────────────── */
.ll-diamond-start-game-nav-btn {
  flex: 1;
  background: linear-gradient(135deg, #111827, #1E293B);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-family: 'Barlow Condensed', Barlow, system-ui,
    sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 11px 8px;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}
.ll-diamond-start-game-nav-btn:active { opacity: 0.85; }
/* Keep Back / Save Lineup / Start Game on one line on phones */
@media (max-width: 480px) {
  .ll-diamond-nav--dugout #ll-diamond-back-btn { padding: 10px 14px; white-space: nowrap; }
  .ll-diamond-nav--dugout #ll-diamond-next-btn.ll-dugout-cta { padding: 10px 12px; white-space: nowrap; }
  .ll-diamond-nav--dugout .ll-diamond-start-game-nav-btn { padding: 11px 10px; }
}
.ll-diamond-nav--dugout #ll-diamond-back-btn {
  flex: 0 0 auto;
  width: auto !important;
  min-width: unset;
}

/* ── Dugout View CTA gold button ─────────────────────────────────────────── */
#ll-diamond-next-btn.ll-dugout-cta {
  background: var(--ll-red);
  border-color: var(--ll-red);
  color: #000;
  font-weight: 700;
  padding: 10px 24px;
  font-size: 14px;
  border-radius: 8px;
}
.ll-diamond-nav--dugout #ll-diamond-back-btn {
  padding: 10px 24px;
  font-size: 14px;
  border-radius: 8px;
}
#ll-diamond-next-btn.ll-dugout-cta:active {
  opacity: 0.88;
}
#ll-diamond-next-btn.ll-dugout-cta:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ── On mobile: dugout nav sits above the fixed bottom nav bar ───────────── */
@media (max-width: 480px) {
  /* Step 5 — the wizard's Back/Save bar sits flush on top of .ll-bottom-nav.
     .ll-bottom-nav is 58px tall; the old 62px left a 4px white sliver.
     Applies to the whole wizard, not just the dugout step, so Back/Next
     never hides behind the bottom nav. */
  .ll-diamond-nav {
    position: fixed;
    bottom: 58px; /* exact height of .ll-bottom-nav */
    left: 0;
    right: 0;
    margin-bottom: 0;
    z-index: 100; /* below .ll-bottom-nav (200) */
    background: #ffffff;
    border-top: 1px solid var(--ll-border);
  }
  .ll-diamond-nav--dugout {
    position: fixed;
    bottom: 58px;
    left: 0;
    right: 0;
    margin-bottom: 0;
    z-index: 150; /* still below .ll-bottom-nav (200) */
  }
  /* Content must clear the fixed Back/Save bar + the bottom nav below it. */
  .ll-diamond-shell,
  .ll-dugout-scroll {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }
}

/* .ll-bottom-nav owns the true bottom edge. Deliberately no safe-area
   padding here: `* { box-sizing: border-box }` + height:58px means padding
   would squeeze the icons rather than grow the bar, and would also throw off
   the .ll-diamond-nav bottom:58px alignment above it. */
.ll-bottom-nav {
  position: fixed;
  bottom: 0;
  z-index: 200;
}

/* Hide legacy top-right Save/Export/Generate row in panel header */
#ll-panel-lineups .ll-panel-header .button-row { display: none; }

/* ── 10. Subheads and text ─────────────────────────────────────── */
.subhead {
  color: var(--ll-text);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
}
.panel-title { color: var(--ll-text); font-family: 'Barlow Condensed', sans-serif; }
h4.subhead { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; }

/* ── 11. Settings / rules cards ────────────────────────────────── */
.ll-settings-content {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
}
.ll-philosophy-block {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
}
.ll-philosophy-scale span { color: var(--ll-text-3); }
.ll-philosophy-label-row .field-label { color: var(--ll-text-3); }

/* ── 12. Empty states ──────────────────────────────────────────── */
.ll-empty-state {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
  color: var(--ll-text-3);
}
.ll-empty-state p { color: var(--ll-text-3); margin: 0; }
.empty-state { color: var(--ll-text-3); }
.empty-inner {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
}
.empty-inner h3 { color: var(--ll-text); }

/* ── 13. ROSTER LIST — card style ──────────────────────────────── */
.ll-roster-list { gap: 8px; }

.ll-roster-row {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
  border-radius: var(--ll-radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ll-roster-row:hover {
  background: var(--ll-bg-4);
  border-color: rgba(220,38,38,0.25);
}

.ll-roster-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

/* Jersey number — gold badge */
.ll-jersey {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(220,38,38,0.10);
  border: 1px solid rgba(220,38,38,0.28);
  color: var(--ll-red);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Player name — Barlow Condensed bold */
.ll-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ll-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stats / positions line — muted small */
.ll-positions {
  font-size: 0.75rem;
  color: var(--ll-text-3);
  line-height: 1.4;
  width: 100%;
}

/* ⋯ edit button */
.ll-roster-more {
  background: var(--ll-bg-4);
  border: 1px solid var(--ll-border);
  color: var(--ll-text-3);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 1rem;
  flex-shrink: 0;
}
.ll-roster-more:hover {
  background: var(--ll-bg-3);
  color: var(--ll-text);
  border-color: var(--ll-red);
}

/* Row layout: main left, edit button right */
.ll-roster-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

/* ── 14. PLAYER AVAILABILITY LIST ──────────────────────────────── */
.ll-diamond-availability-list { gap: 6px; }

.ll-diamond-availability-row {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--ll-radius-sm);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0,1fr) 130px;
  gap: 10px;
  align-items: center;
  transition: background 0.15s ease;
}
.ll-diamond-availability-row.is-absent {
  opacity: 0.45;
  background: var(--ll-bg-3);
}

.ll-diamond-player-name {
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ll-text);
}
.ll-diamond-player-sub {
  font-size: 0.78rem;
  color: var(--ll-text-3);
  margin-top: 2px;
}

/* Availability select — availability status colors via option styling */
.ll-diamond-availability-row select,
.ll-arrival-select {
  background: var(--ll-bg-4);
  border-color: var(--ll-border);
  color: var(--ll-text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
}
.ll-arrival-select:disabled {
  opacity: 0.45;
  background: var(--ll-bg-3);
}

/* Count summary */
.ll-diamond-counts {
  font-size: 0.82rem;
  color: var(--ll-text-3);
  margin-bottom: 8px;
  font-family: 'Barlow', sans-serif;
}

/* ── 15. LINEUP OUTPUT — inning cards ──────────────────────────── */
.ll-diamond-card-list { gap: 14px; }

.ll-diamond-inning-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--ll-radius);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
}

/* Dark gradient "INNING N" header bar */
.ll-diamond-inning-card > strong:first-child {
  background: linear-gradient(135deg, #111827 0%, #1E293B 100%);
  color: #ffffff;
  margin: -12px -12px 10px;
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* 3×3 position grid */
.ll-diamond-inning-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1px;
  background: var(--ll-border);
  margin: 0;
  padding: 0;
}
.ll-diamond-inning-grid .ll-diamond-slot {
  background: #f8fafc;
  border: 1px solid #e8edf2;
  color: var(--ll-text);
  padding: 10px 11px;
}

/* Position label — small caps */
.ll-diamond-slot > strong {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ll-text);
  margin-bottom: 3px;
}

/* Player name */
.ll-diamond-slot > span {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ll-text-3);
  line-height: 1.2;
}

/* Bench section */
.ll-diamond-bench-note {
  background: #fafbfc;
  border-top: 1px solid #f0f4f8;
  padding: 8px 12px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ll-text-3);
  margin-top: 0;
}

/* ── 16. BATTING ORDER ─────────────────────────────────────────── */
#ll-diamond-batting-order h4.subhead {
  color: var(--ll-text-2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

#ll-diamond-batting-order ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: batting;
}
#ll-diamond-batting-order ol li {
  counter-increment: batting;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ll-border);
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ll-text);
}
#ll-diamond-batting-order ol li:last-child { border-bottom: none; }
#ll-diamond-batting-order ol li::before {
  content: counter(batting);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--ll-red);
  min-width: 22px;
  text-align: right;
}

/* Preview tab batting order (same structure) */
#ll-diamond-preview ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: batting;
}
#ll-diamond-preview ol li {
  counter-increment: batting;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--ll-border);
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ll-text);
}
#ll-diamond-preview ol li:last-child { border-bottom: none; }
#ll-diamond-preview ol li::before {
  content: counter(batting);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 1rem;
  color: var(--ll-red);
  min-width: 20px;
  text-align: right;
}

/* ── 17. LINEUP SUMMARY NOTICES ────────────────────────────────── */
/* Amber warning card */
.ll-summary-warn,
div[style*="background: rgba(245,166,35"] {
  background: rgba(245,166,35,0.1) !important;
  border: 1px solid rgba(245,166,35,0.35) !important;
  border-radius: var(--ll-radius-sm);
  color: var(--ll-amber);
  padding: 10px 12px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}
/* Blue info card */
.ll-summary-info,
div[style*="background: rgba(59,130"] {
  background: rgba(74,158,255,0.08) !important;
  border: 1px solid rgba(74,158,255,0.28) !important;
  border-radius: var(--ll-radius-sm);
  color: var(--ll-blue);
  padding: 10px 12px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

/* ── 18. Fielding plan section header ──────────────────────────── */
#ll-diamond-fielding-plan h4.subhead {
  color: var(--ll-text-2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  margin-top: 14px;
}

/* ── 19. Pitching plan slots (Step 3) ──────────────────────────── */
/* Slot rows rendered by renderDiamondPitchingPlan */
.ll-pitcher-slot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--ll-border);
}
.ll-pitcher-slot-row:last-of-type { border-bottom: none; }
.ll-pitcher-slot-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ll-text-3);
  min-width: 24px;
}

/* Inning block strip */
#ll-diamond-inning-strip > span,
#ll-diamond-inning-strip > div {
  flex: 1;
  min-width: 0;
  height: 22px;
  border-radius: 0;
}

/* pitch notice colours already inline — just ensure text is readable */
#ll-diamond-pitch-notice { font-size: 0.82rem; }

/* Add reliever button */
#ll-diamond-add-reliever-btn {
  font-size: 0.82rem;
  padding: 6px 12px;
}

/* ── 20. Warnings strip ─────────────────────────────────────────── */
.ll-warnings {
  border-color: rgba(224,82,82,0.3);
  background: rgba(224,82,82,0.08);
  color: var(--ll-red);
}

/* ── 21. Modals — dark ─────────────────────────────────────────── */
.modal { background: rgba(0,0,0,0.65); }
.modal-box,
.player-modal-box {
  background: #ffffff;
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius);
}
.modal-head {
  border-bottom-color: var(--ll-border);
  color: var(--ll-text);
}
.modal-body { color: var(--ll-text); }

.player-rating-pill {
  background: var(--ll-bg-4);
  color: var(--ll-text-2);
}
.player-overall-score span { color: var(--ll-red); }
.player-rating-label { color: var(--ll-text-2); }

/* Conflicts / position exclusion grid checkboxes */
.player-conflicts-row { color: var(--ll-text-2); }

/* Attendance card in modal */
.ll-attendance-card {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
}
.ll-attendance-card h3 { color: var(--ll-text); }
.ll-attendance-head { color: var(--ll-text-3); }
.ll-attendance-name { color: var(--ll-text); }

/* ── 22. Kebab / mini-actions — dark ───────────────────────────── */
.mini-actions .kebab {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
  color: var(--ll-text-3);
}
.mini-actions .kebab:hover {
  background: var(--ll-bg-4);
  border-color: var(--ll-border);
  color: var(--ll-text);
  box-shadow: none;
}
.mini-actions .mini-menu {
  background: var(--ll-bg-2);
  border-color: var(--ll-border);
  box-shadow: 0 14px 30px rgba(0,0,0,0.45);
}
.mini-actions .mini-menu button {
  background: var(--ll-bg-2);
  color: var(--ll-text);
  border-color: transparent;
}
.mini-actions .mini-menu button:hover {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
  color: var(--ll-text);
  box-shadow: none;
  transform: none;
}

/* ── 23. Note/board cards — dark ───────────────────────────────── */
.note-card,
.board-card {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
}
.note-card .title,
.board-card .title { color: var(--ll-text); }
.note-card .notes,
.board-card .notes { color: var(--ll-text-2); }
.note-card:hover,
.board-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  border-color: var(--ll-border);
  transform: translateY(-2px);
}

.board-col {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
}
.board-head {
  border-bottom-color: var(--ll-border);
  color: var(--ll-text);
}

/* ── 24. Onboarding modal — dark ───────────────────────────────── */
.onboarding-modal { background: rgba(0,0,0,0.75); }
.onboarding-box {
  background: var(--ll-bg-2);
  border: 1px solid var(--ll-border);
}
.onboarding-body { color: var(--ll-text); }
.onboarding-subtitle { color: var(--ll-text-3); }
.onboarding-section-list button {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
  color: var(--ll-text);
}
.onboarding-section-list button .onb-section-caption { color: var(--ll-text-3); }
.onboarding-section-list button:hover {
  background: var(--ll-bg-4);
  border-color: var(--ll-red);
  box-shadow: none;
  transform: none;
}
.onboarding-section-list button.onb-selected {
  background: rgba(220,38,38,0.08);
  border-color: var(--ll-red);
}
.onboarding-progress li { background: var(--ll-border); }
.onboarding-progress li.active { background: var(--ll-red); transform: scale(1.15); }
.onb-choice-sheet {
  background: var(--ll-bg-2);
  box-shadow: 0 18px 45px rgba(0,0,0,0.5);
}
.onb-choice-sheet h3 { color: var(--ll-text); }
.onb-choice-sheet p  { color: var(--ll-text-2); }

/* ── 25. Toast — dark ──────────────────────────────────────────── */
.toast { background: var(--ll-bg-4); color: var(--ll-text); }

/* ── 26. Export modal — dark ───────────────────────────────────── */
#export-modal .modal-box { background: var(--ll-bg-2); }

/* ── 27. Footer — dark ─────────────────────────────────────────── */
.site-footer {
  background: transparent;
  border-top: 1px solid var(--ll-border);
  color: var(--ll-text-3);
}

/* ── 28. Scrollbars — dark ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--ll-bg-2); }
::-webkit-scrollbar-thumb { background: var(--ll-bg-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ll-border); }

/* ── 29. Quick-add / inline-capture — dark ─────────────────────── */
.inline-capture {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
}
.inline-capture input {
  background: var(--ll-bg-4);
  border-color: var(--ll-border);
  color: var(--ll-text);
}

/* ── 30. Login page exception — keep white bg for login form ────── */
body.login .modal-box,
body.login .onboarding-box {
  background: #fff;
  border-color: rgba(2,6,23,0.08);
  color: #0B1220;
}
body.login input[type="text"],
body.login input[type="email"],
body.login input[type="password"] {
  background: #fff;
  border-color: rgba(2,6,23,0.12);
  color: #0B1220;
}

/* ── 31. AI modal — dark ───────────────────────────────────────── */
.ai-output {
  background: var(--ll-bg-4);
  border-color: var(--ll-border);
  color: var(--ll-text);
}
.ai-mode-btn {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
  color: var(--ll-text-2);
}
.ai-mode-btn:hover { background: var(--ll-bg-4); border-color: var(--ll-border); }
.ai-mode-btn.active { background: rgba(220,38,38,0.10); border-color: var(--ll-red); color: var(--ll-red); }
.ai-output-label { color: var(--ll-text-3); }
.ai-loader .dot { background: var(--ll-red); }

/* ── 32. Life Stories modal — dark ────────────────────────────────*/
.life-list {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
}
.life-list-item { color: var(--ll-text-2); }
.life-list-item:hover { background: var(--ll-bg-4); border-color: var(--ll-border); }
.life-list-item.is-active { background: rgba(220,38,38,0.08); border-color: var(--ll-red); }
.life-list-item-meta { color: var(--ll-text-3); }
#life-book {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
  color: var(--ll-text-2);
}
.life-book-section-title { color: var(--ll-text); }
.life-book-chapter-intro { background: var(--ll-bg-4); }

/* ── 33. Softball draft — dark ─────────────────────────────────── */
.sb-draft-status,
.sb-draft-controls {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
}
.sb-status-pill { background: var(--ll-bg-4); border-color: var(--ll-border); color: var(--ll-text-2); }
.sb-pool-card {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
}
.sb-pool-card:hover { border-color: var(--ll-red); box-shadow: none; transform: translateY(-2px); }
.sb-available-pool,
#sb-available-pool { background: var(--ll-bg-4); border-color: var(--ll-border); }
.sb-team-card { background: var(--ll-bg-3); border-color: var(--ll-border); }
.sb-team-head { background: var(--ll-bg-4); border-bottom-color: var(--ll-border); color: var(--ll-text); }
.sb-team-row { background: var(--ll-bg-3); border-color: var(--ll-border); cursor: grab; }
.sb-team-row--head { background: var(--ll-bg-4); color: var(--ll-text-3); }
.sb-team-dropzone { background: var(--ll-bg-4); border-color: var(--ll-border); }
.sb-tryout-row { background: var(--ll-bg-3); border-color: var(--ll-border); }
.sb-score { border-color: rgba(220,38,38,0.22); background: rgba(220,38,38,0.08); color: var(--ll-red); }
.sb-tags { background: var(--ll-bg-4); border-color: var(--ll-border); color: var(--ll-text-2); }

/* ── 34. Section suggestions panel — dark ──────────────────────── */
.section-suggestions-inner {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
}
.section-suggestion { background: var(--ll-bg-4); }
.section-suggestion-title { color: var(--ll-text); }
.section-suggestion-desc { color: var(--ll-text-3); }

/* ── 35. Review grid — dark ────────────────────────────────────── */
.review-grid {
  background: var(--ll-bg-3);
  border-color: var(--ll-border);
}
.review-grid .k { color: var(--ll-text-3); }
.review-grid .k + .v { color: var(--ll-text); }

/* ── 36. Workspace grid — dark ─────────────────────────────────── */
.ll-game-workspace { background: var(--ll-bg-3); border-color: var(--ll-border); }
.ll-bench { background: var(--ll-bg-4); border-color: var(--ll-border); }
.ll-bench-title { color: var(--ll-text); }
.ll-segment { background: var(--ll-bg-4); border-color: var(--ll-border); }
.ll-segment-title { color: var(--ll-text-3); }
.ll-player-chip { background: var(--ll-bg-3); border-color: var(--ll-border); color: var(--ll-text-2); }
.ll-chip-meta { color: var(--ll-text-3); }
.ll-lock-btn { background: var(--ll-bg-4); border-color: var(--ll-border); color: var(--ll-text-3); }
.ll-lock-btn.is-locked { border-color: var(--ll-red); color: var(--ll-red); background: rgba(220,38,38,0.08); }

/* ── END PHASE 1 DARK THEME ─────────────────────────────────────── */
/* ══════════════════════════════════════════════════════════════════
   PASS A — Navigation Shell
   Bottom nav, desktop sidebar, panel visibility, placeholder cards
   ══════════════════════════════════════════════════════════════════ */

/* ── Pass A.1  app-root flex layout ────────────────────────────── */
.app-root {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

/* ── Pass A.2  ll-tab-content (main column) ─────────────────────── */
.ll-tab-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── Pass A.3  Panel visibility ─────────────────────────────────── */
.ll-panel {
  display: none;
}
.ll-panel.active {
  display: block;
}
/* Force ll-tab-panel elements visible inside the active ll-panel
   (overrides app.js .is-active toggling) */
.ll-panel.active .ll-tab-panel {
  display: block !important;
}
/* But keep explicitly hidden softball panels hidden */
.ll-panel.active .ll-tab-panel.hidden {
  display: none !important;
}

/* Step 3 — app containers must not scroll sideways either. */
#app-shell {
  overflow-x: hidden;
  max-width: 100%;
}

/* ── Pass A.4  Legacy tab nav (hidden in DOM, kept for app.js) ───── */
.ll-legacy-tabs {
  display: none !important;
}

/* ── Pass A.5  Bottom navigation bar (mobile) ───────────────────── */
.ll-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: stretch;
  z-index: 200;
  /* keep it centered on devices wider than 480px */
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 -1px 0 #e2e8f0, 0 -4px 16px rgba(0,0,0,0.06);
}
.ll-nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--ll-text-3);
  cursor: pointer;
  padding: 6px 0 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}
.ll-nav-tab.active {
  color: var(--ll-red);
}
.ll-nav-tab:hover {
  color: var(--ll-text-2);
}
.ll-nav-tab.active:hover {
  color: var(--ll-red);
}
.ll-nav-icon {
  font-size: 18px;
  line-height: 1;
}
.ll-nav-label {
  font-family: 'Barlow', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Add bottom padding to app-main so content isn't hidden behind bottom nav */
.app-main {
  padding-bottom: 70px;
}

/* ── Pass A.6  Desktop sidebar (>=600px) ────────────────────────── */
.ll-desktop-sidebar {
  display: none;
}

@media (min-width: 600px) {
  /* Hide mobile bottom nav */
  .ll-bottom-nav {
    display: none;
  }

  /* Remove bottom padding added for mobile nav, and lift the 480px cap
     that Phase 1 sets unconditionally — let .ll-tab-content control width */
  .app-main {
    padding-bottom: 0;
    max-width: 100%;
  }

  /* Show desktop sidebar */
  .ll-desktop-sidebar {
    display: flex;
    flex-direction: column;
    width: 80px;
    min-width: 80px;
    background: var(--ll-bg-2);
    border-right: 1px solid var(--ll-border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    align-items: center;
    gap: 4px;
    z-index: 50;
  }

  /* Expand content column to use available space */
  .ll-tab-content {
    max-width: none;
  }
}

/* Sidebar tab buttons */
.ll-sidebar-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 72px;
  padding: 10px 4px;
  background: none;
  border: none;
  border-radius: var(--ll-radius-sm);
  color: var(--ll-text-3);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  touch-action: manipulation;
}
.ll-sidebar-tab:hover {
  color: var(--ll-text-2);
  background: var(--ll-bg-3);
}
.ll-sidebar-tab.active {
  color: var(--ll-red);
  background: var(--ll-red-soft);
}
/* Sidebar uses same icon/label classes as bottom nav */

/* ── Pass A.7  Placeholder cards (Teams / Season panels) ─────────── */
.ll-placeholder-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  text-align: center;
  background: var(--ll-bg-3);
  border: 1px dashed var(--ll-border);
  border-radius: var(--ll-radius);
  margin: 16px 0;
}
.ll-placeholder-icon {
  font-size: 2rem;
  line-height: 1;
}
.ll-placeholder-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ll-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ll-placeholder-sub {
  font-size: 0.85rem;
  color: var(--ll-text-3);
  max-width: 260px;
}

/* ── END PASS A ──────────────────────────────────────────────────── */

/* ══════════════════════════════════════════════════════════════════
   PASS B — Teams tab grid + responsive width
   ══════════════════════════════════════════════════════════════════ */

/* ── Pass B.1  Responsive content width ────────────────────────── */
.ll-tab-content {
  width: 100%;
  box-sizing: border-box;
  padding: 16px;
}

@media (min-width: 600px) {
  .ll-tab-content {
    max-width: 720px;
    padding: 24px;
  }
}

@media (min-width: 900px) {
  .ll-tab-content {
    max-width: 900px;
    padding: 32px 40px;
  }
}

/* ── Pass B.2  Hide legacy toolbar (kept in DOM for app.js) ─────── */
.ll-legacy-toolbar {
  display: none !important;
}

/* ── Pass B.3  Active team name in header ───────────────────────── */
.ll-active-team-name {
  display: block;
  font-family: 'Barlow', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
/* On mobile, hide the tagline when an active team name is shown */
.ll-active-team-name:not(:empty) ~ .tagline,
.ll-tagline:has(~ .ll-active-team-name:not(:empty)) {
  display: none;
}

/* ── Pass B.4  Primary button (new Teams UI variant) ────────────── */
.ll-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--ll-red);
  color: #ffffff;
  border: none;
  border-radius: var(--ll-radius-sm);
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.ll-btn-primary:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}
.ll-btn-primary:active {
  transform: translateY(0);
}

/* ── Pass B.5  Teams header ─────────────────────────────────────── */
.ll-teams-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.ll-teams-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ll-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Pass B.6  Team card grid ───────────────────────────────────── */
.ll-teams-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
@media (min-width: 600px) {
  .ll-teams-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .ll-teams-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Pass B.7  Team card ────────────────────────────────────────── */
.ll-team-card {
  background: var(--ll-bg-2);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.ll-team-card:hover {
  border-color: var(--ll-red);
  transform: translateY(-1px);
}
.ll-team-card.active {
  border-left: 3px solid var(--ll-red);
}
.ll-team-card-sport {
  font-size: 24px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: var(--ll-bg-3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ll-team-card-info {
  flex: 1;
  min-width: 0;
}
.ll-team-card-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--ll-text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ll-team-card-meta {
  font-size: 12px;
  color: var(--ll-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ll-team-card-actions {
  flex-shrink: 0;
}
.ll-team-card-chevron {
  font-size: 20px;
  color: var(--ll-text-3);
  flex-shrink: 0;
}

/* ── Pass B.8  Kebab menu ───────────────────────────────────────── */
.ll-team-kebab {
  background: none;
  border: none;
  color: var(--ll-text-3);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.12s, background 0.12s;
}
.ll-team-kebab:hover {
  color: var(--ll-text);
  background: var(--ll-bg-3);
}
.ll-team-kebab-menu {
  position: absolute;
  top: calc(100% - 8px);
  right: 8px;
  background: var(--ll-bg-3);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  z-index: 500;
  min-width: 140px;
  overflow: hidden;
}
.ll-team-kebab-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--ll-border);
  color: var(--ll-text);
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s;
}
.ll-team-kebab-item:last-child { border-bottom: none; }
.ll-team-kebab-item:hover { background: var(--ll-bg-4); }
.ll-team-kebab-item.danger { color: var(--ll-red); }

/* ── Pass B.9  Empty state ──────────────────────────────────────── */
.ll-teams-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 24px;
  text-align: center;
}
.ll-empty-icon { font-size: 36px; line-height: 1; }
.ll-empty-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ll-text);
}
.ll-empty-sub {
  font-size: 13px;
  color: var(--ll-text-3);
  margin-bottom: 8px;
}

/* ── Pass B.10  Archived section ────────────────────────────────── */
.ll-teams-archived {
  margin-top: 8px;
}
.ll-archived-toggle {
  background: none;
  border: none;
  color: var(--ll-text-3);
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ll-archived-toggle:hover { color: var(--ll-text-2); }
.ll-archived-count { color: var(--ll-text-3); }
.ll-archived-chevron { font-size: 11px; }
.ll-archived-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
  opacity: 0.6;
}
@media (min-width: 600px) {
  .ll-archived-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Pass B.11  New Team modal ──────────────────────────────────── */
.ll-nt-box {
  max-width: 460px;
  width: 100%;
}

/* Progress bar */
.ll-nt-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 6px;
}
.ll-nt-step {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ll-bg-4);
  border: 1px solid var(--ll-border);
  color: var(--ll-text-3);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ll-nt-step.active {
  background: var(--ll-red);
  border-color: var(--ll-red);
  color: #0d1b2a;
}
.ll-nt-step.done {
  background: rgba(220,38,38,0.12);
  border-color: var(--ll-red);
  color: var(--ll-red);
}
.ll-nt-sep {
  flex: 1;
  height: 1px;
  background: var(--ll-border);
  margin: 0 6px;
}
.ll-nt-step-label {
  font-family: 'Barlow', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--ll-text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

/* Step body */
.ll-nt-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ll-nt-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Sport / Level pill selector */
.ll-nt-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ll-nt-pill {
  padding: 6px 12px;
  background: var(--ll-bg-4);
  border: 1px solid var(--ll-border);
  border-radius: 20px;
  color: var(--ll-text-2);
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  white-space: nowrap;
}
.ll-nt-pill:hover {
  border-color: var(--ll-text-3);
  color: var(--ll-text);
}
.ll-nt-pill.active {
  background: rgba(220,38,38,0.12);
  border-color: var(--ll-red);
  color: var(--ll-red);
}

/* ── END PASS B ──────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════
   FIX 1 — Mobile content overflow
   Prevent right-side clipping by ensuring all content wrappers
   respect the viewport width and use border-box sizing.
   ═══════════════════════════════════════════════════════════════════ */
.ll-tab-content,
.ll-panel,
.ll-panel > *,
.app-main,
.workspace-panel,
.panel-body {
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 599px) {
  .ll-panel {
    padding: 16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .workspace-panel,
  .app-card,
  .panel-body {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-left: 0;
    margin-right: 0;
  }
  /* The actual rounded card wrapper in app.html */
  .app-layout.app-layout-lineuplogix {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-left: 0;
    margin-right: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   FIX 2 — Game Day inputs clipping right edge
   Constrain all form elements inside panels to viewport width.
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 599px) {
  .ll-panel input,
  .ll-panel select,
  .ll-panel textarea,
  .ll-diamond-wizard-step {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .ll-diamond-steps {
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
    padding-bottom: 4px;
  }
  .ll-diamond-steps::-webkit-scrollbar { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   FIX 3 — Roster stats line wrapping
   Prevent stats/exclusions meta line from wrapping to a second line.
   ═══════════════════════════════════════════════════════════════════ */
.ll-player-card-meta,
.ll-player-stats-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Reduce "+ Add tryout player" button to match standard .primary size */
#sb-add-tryout-btn {
  font-size: 0.85rem;
  padding: 7px 14px;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════
   FIX 4 — Hamburger dropdown menu
   ═══════════════════════════════════════════════════════════════════ */
.ll-hamburger-menu {
  position: fixed;
  top: 72px; /* 16px wrapper padding + 48px header + 8px gap */
  right: 12px;
  background: var(--ll-bg-2);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius);
  min-width: 200px;
  z-index: 1250; /* above .site-header (1200) */
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.ll-hamburger-menu.open { display: flex; }
.ll-hamburger-item {
  padding: 14px 16px;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--ll-text);
  cursor: pointer;
  transition: background .12s;
}
.ll-hamburger-item:hover { background: var(--ll-bg-3); }
.ll-hamburger-danger { color: var(--ll-red); }
.ll-hamburger-divider {
  height: 1px;
  background: var(--ll-border);
  margin: 4px 0;
}
.ll-hamburger-version {
  padding: 8px 16px;
  font-size: 11px;
  color: var(--ll-text-3);
}

/* ═══════════════════════════════════════════════════════════════════
   LAYOUT WIDTH FIXES v2
   Verified against actual HTML class names before applying.
   Note: .ll-diamond-workspace does not exist — actual inner wrappers
   are .ll-diamond-stage and .ll-diamond-step. .workspace-panel is
   included defensively. Fix 6 (card meta) is already correct in JS.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Fix 1a  Mobile full bleed ≤599px ───────────────────────────── */
@media (max-width: 599px) {
  .ll-tab-content,
  .app-layout.app-layout-lineuplogix,
  .workspace-panel {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-sizing: border-box;
  }
  .app-main {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 0 80px;
    box-sizing: border-box;
  }
}

/* ── Fix 1b  iPad portrait 600–899px: fill minus sidebar ───────── */
@media (min-width: 600px) and (max-width: 899px) {
  .ll-tab-content,
  .workspace-panel {
    width: calc(100vw - 88px);
    max-width: calc(100vw - 88px);
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
  }
  .app-main,
  .app-layout.app-layout-lineuplogix {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
}

/* ── Fix 1c  Desktop 900px+: fill generously minus sidebar ─────── */
@media (min-width: 900px) {
  .ll-tab-content,
  .workspace-panel {
    width: calc(100vw - 108px);
    max-width: calc(100vw - 108px);
    margin: 0;
    padding: 28px 36px;
    box-sizing: border-box;
  }
  .app-main,
  .app-layout.app-layout-lineuplogix {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }
}

/* ── Fix 2  Game Day inner cards fill content area on desktop ──────
   .ll-diamond-workspace does not exist here. Actual wrappers are
   .ll-diamond-shell (outer flex column), .ll-diamond-stage (the
   bordered card), and .ll-diamond-step (individual step panels).    */
@media (min-width: 900px) {
  .ll-diamond-shell,
  .ll-diamond-stage,
  .ll-diamond-step {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
}

/* ── Fix 3  Mobile panel full bleed ≤599px ───────────────────────── */
@media (max-width: 599px) {
  .ll-panel,
  .ll-diamond-stage {
    border-radius: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ── Fix 4  Step tabs scrollable on mobile ─────────────────────────
   .ll-diamond-steps already has overflow-x:auto from Phase 1 dark
   theme block; this reinforces it at the 599px breakpoint.          */
@media (max-width: 599px) {
  .ll-diamond-steps {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    gap: 8px;
  }
  .ll-diamond-steps::-webkit-scrollbar { display: none; }
}

/* ── Fix 5  Bottom clearance so sticky CTA bar never clips content ─ */
.ll-tab-content,
.app-layout.app-layout-lineuplogix,
.workspace-panel {
  padding-bottom: 80px;
}

/* ── Fix 7  Active gold border on team card — enforced all viewports */
.ll-team-card.active {
  border-left: 3px solid var(--ll-red) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE CLIPPING FIXES v3
   Verified against actual HTML/CSS before applying.
   ═══════════════════════════════════════════════════════════════════ */

/* Global overflow guard — prevents any element from pushing the
   page wider than the viewport on phones.                          */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* ── Fix C1  Zero stacked horizontal padding on wrapper elements ───
   Root cause: at ≤599px, .ll-tab-content (16px, Pass B.1) and
   .app-layout (14px each side, Phase 1) both apply their own
   horizontal padding on top of each other and on top of .ll-panel's
   inner 16px. Total accumulation = 46px eaten per side → overflow.
   Solution: zero the outer two wrappers; let .ll-panel own the
   single content-level gutter (already set to 16px !important).    */
@media (max-width: 599px) {
  .ll-tab-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .app-layout.app-layout-lineuplogix {
    padding-left: 0 !important;
    padding-right: 0 !important;
    /* ── Fix C1b  Kill the white band under the dark header ──────────
       .app-layout-lineuplogix carries background:#fff plus 12px of top
       padding, so on every tab a white strip sat between the header
       gradient and the panel. The panel's own 16px top padding is the
       content gutter and stays — this only removes the extra wrapper
       inset, so the header now meets the panel directly. */
    padding-top: 0 !important;
  }
}

/* ── Fix C2  "No pitcher this game" checkbox row wrapping ──────────
   .player-conflicts-row is display:flex with no flex-wrap, so the
   label text clips off-screen on narrow viewports. Allow wrapping
   and let the span claim remaining space with graceful overflow.    */
@media (max-width: 599px) {
  .player-conflicts-row {
    flex-wrap: wrap;
  }
  .player-conflicts-row span {
    flex: 1;
    min-width: 0;
    word-break: break-word;
  }
}

/* ── Fix C3  Lineup grid cells — prevent player names wrapping ─────
   .ll-diamond-slot has padding:10px 11px and its <span> has
   font-size:0.95rem. On 390px phones a long name like "Kathryn M."
   splits across two lines. Tighten padding, shrink font slightly,
   and clip with ellipsis so the grid stays single-row per player.  */
@media (max-width: 599px) {
  .ll-diamond-inning-grid .ll-diamond-slot {
    padding: 5px 6px;
  }
  .ll-diamond-slot > span {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   TEAMS TILE GRID v1
   Replaces the old rectangle card layout with square tiles.
   Old .ll-team-card rules remain (used by the step-3 confirm preview
   inside the modal); these rules are appended last and win on all
   live tile elements which carry the new class names.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Grid breakpoints: 2 / 3 / 4 columns ──────────────────────── */
.ll-teams-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 600px) {
  .ll-teams-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .ll-teams-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Season group header ─────────────────────────────────────── */
.ll-season-group-header {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  color: var(--ll-text-3);
  text-transform: uppercase;
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--ll-border);
  margin-bottom: 12px;
}
.ll-season-group-header:first-child { padding-top: 4px; }

/* ── Tile root — overrides the old .ll-team-card row layout ─── */
.ll-team-tile {
  position: relative;
  aspect-ratio: 3 / 2.6;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 10px 10px;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  /* Cancel out inherited row-card flex properties */
  flex-wrap: nowrap;
  width: auto;
  height: auto;
}
.ll-team-tile:hover {
  border-color: var(--ll-red);
  box-shadow: 0 4px 16px rgba(232,97,42,0.12);
  transform: translateY(-1px);
}
.ll-team-tile.active {
  border: 2px solid var(--ll-red) !important;
  background: rgba(232,97,42,0.03);
  box-shadow: 0 0 0 1px rgba(232,97,42,0.15), 0 4px 16px rgba(232,97,42,0.1);
}

/* ── Kebab: absolutely positioned top-right corner ─────────── */
.ll-team-tile-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  flex-shrink: unset;
}
.ll-team-tile-kebab {
  background: none;
  border: none;
  color: var(--ll-text-3);
  font-size: 15px;
  cursor: pointer;
  padding: 3px 6px;
  line-height: 1;
  border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
}
.ll-team-tile-kebab:hover {
  color: var(--ll-text);
  background: var(--ll-bg-3);
}

/* ── Sport icon ──────────────────────────────────────────────── */
.ll-team-tile-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

/* ── Team name ───────────────────────────────────────────────── */
.ll-team-tile-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ll-text);
  text-align: center;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  width: 100%;
}

/* ── Meta line ───────────────────────────────────────────────── */
.ll-team-tile-meta {
  font-size: 11px;
  color: var(--ll-text-3);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  padding: 0 4px;
  box-sizing: border-box;
}

/* ── Kebab menu: position:fixed so it always renders above tiles  */
.ll-team-kebab-menu {
  position: fixed !important;
  z-index: 1000 !important;
  background: var(--ll-bg-2);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius);
  min-width: 164px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  overflow: hidden;
}

/* Divider inside kebab menu (separates Delete) */
.ll-team-kebab-divider {
  height: 1px;
  background: var(--ll-border);
}

/* ── Archived tile grid: match breakpoints ───────────────────── */
.ll-archived-grid {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 12px !important;
}
@media (min-width: 600px) {
  .ll-archived-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (min-width: 900px) {
  .ll-archived-grid { grid-template-columns: repeat(4, 1fr) !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE & TILE FIXES v4
   ═══════════════════════════════════════════════════════════════════ */

/* ── Fix 2  Kebab button top-right corner of tile ──────────────────
   The wrapper .ll-team-tile-actions sits in the flex column flow and
   can push the visual centre down. Collapse it with display:contents
   so the layout engine ignores it, then absolutely position the
   button directly inside the tile (nearest position:relative ancestor). */
.ll-team-tile > .ll-team-card-actions {
  display: contents;   /* wrapper becomes layout-invisible, stays in DOM */
}
.ll-team-tile .ll-team-tile-kebab {
  position: absolute !important;
  top: 6px !important;
  right: 6px !important;
  left: auto !important;
  z-index: 2;
  background: none;
  border: none;
  color: var(--ll-text-3);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
}
.ll-team-tile .ll-team-tile-kebab:hover {
  color: var(--ll-text);
  background: var(--ll-bg-3);
}

@media (max-width: 599px) {
  .field-input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
  }
  input[type="date"] {
    min-width: 0 !important;
    display: block !important;
  }
  .field-group {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* ── Fix 4  Prevent iOS Safari auto-zoom on input focus ────────────
   iOS zooms whenever a focused input has font-size < 16px.
   This rule is mobile-only so desktop font sizes are unchanged.      */
@media (max-width: 599px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

@media (max-width: 599px) {
  .ll-rules-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   TEAMS TILE GRID — desktop & iPad height / width fixes
   Mobile keeps aspect-ratio:1/1. Wider viewports cap tile height so
   tiles don't become 280px squares, and grids are forced to 100%
   width so 4-column (desktop) and 3-column (iPad) layouts fill the
   full content area instead of collapsing to their content width.
   ═══════════════════════════════════════════════════════════════════ */

/* Base: grids always fill their container */
.ll-teams-grid {
  width: 100%;
  box-sizing: border-box;
}

/* iPad 600–899px: cap tile height, enforce 3-column fill */
@media (min-width: 600px) and (max-width: 899px) {
  .ll-team-tile {
    aspect-ratio: unset !important;
    height: 160px;
    max-height: 160px;
  }
  .ll-teams-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    width: 100% !important;
  }
}

/* Desktop 900px+: cap tile height, enforce 4-column fill */
@media (min-width: 900px) {
  .ll-team-tile {
    aspect-ratio: unset !important;
    height: 140px;
    max-height: 140px;
  }
  .ll-teams-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    width: 100% !important;
  }
}


.ll-rules-grid,
.ll-rules-grid .field-group {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* ── Toggle switch component ─────────────────────────────────────────────── */
.ll-toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.ll-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.ll-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--ll-bg-4);
  border: 1.5px solid var(--ll-border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.ll-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--ll-text-3);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.ll-toggle-switch input:checked + .ll-toggle-slider {
  background: var(--ll-red);
  border-color: var(--ll-red);
}
.ll-toggle-switch input:checked + .ll-toggle-slider::before {
  transform: translateY(-50%) translateX(18px);
  background: var(--ll-bg);
}
.ll-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 4px;
}
.ll-toggle-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ll-text-2);
}
.ll-tournament-toggle-group {
  margin-top: 4px;
}
.ll-tournament-toggle-group .helper-text {
  color: var(--ll-text-3);
  font-size: 0.78rem;
  margin-top: 2px;
  line-height: 1.4;
}

/* ── Season fairness table: sticky header ────────────────────────────── */
.ll-fairness-thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--ll-bg-2);
  border-bottom: 2px solid var(--ll-border);
  padding-top: 8px;
  padding-bottom: 8px;
}
/* ── Rescue: Add Inning button ───────────────────────────────────────── */
.ll-rescue-top-actions {
  margin-bottom: 14px;
}
.ll-rescue-addinning-btn {
  width: 100%;
  padding: 14px 16px;
  background: rgba(220,38,38,0.10);
  border: 1.5px solid var(--ll-red);
  border-radius: 10px;
  color: var(--ll-red);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, transform 0.08s;
  -webkit-tap-highlight-color: transparent;
  display: block;
}
.ll-rescue-addinning-btn:active {
  background: rgba(220,38,38,0.15);
  transform: scale(0.98);
}
/* ── Record sheet: innings played buttons ─────────────────────────── */
.ll-record-innings-check {
  margin: 14px 0 4px;
}
.ll-record-innings-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ll-text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.ll-record-innings-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.ll-record-inning-btn {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1.5px solid var(--ll-border);
  background: var(--ll-bg-3);
  color: var(--ll-text-3);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.08s;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ll-record-inning-btn.is-active {
  background: rgba(220,38,38,0.12);
  border-color: var(--ll-red);
  color: var(--ll-red);
  font-weight: 800;
}
.ll-record-inning-btn:not(.is-active) {
  opacity: 0.45;
  text-decoration: line-through;
}
.ll-record-inning-btn:active {
  transform: scale(0.9);
}
/* Delete-game button in the Season history card header. --ll-muted doesn't
   exist in this file; --ll-text-3 (#868e96) is the muted grey. The hover tint
   is --ll-red (#C8561F) at 8%, matching .ll-rescue-inning-num.is-selected. */
.ll-season-game-delete {
  background: none;
  border: none;
  color: var(--ll-text-3);
  font-size: 14px;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
  margin-left: auto;
  margin-right: 4px;
  flex-shrink: 0;
}
.ll-season-game-delete:hover,
.ll-season-game-delete:active {
  color: var(--ll-red);
  background: rgba(200, 86, 31, 0.08);
}

/* Step 3 — absent players still appear in the rescue list (so they can be
   marked "showed up"), shown dimmed with a dashed border. */
.ll-rescue-player-btn.is-absent {
  opacity: 0.6;
  border-style: dashed;
  /* The button is display:flex, so the status span would otherwise sit
     inline to the right of the name. Let it wrap onto its own row. */
  flex-wrap: wrap;
}
.ll-rescue-player-status {
  display: block;
  flex: 0 0 100%;   /* full-width row inside the flex button */
  font-size: 0.7rem;
  color: var(--ll-red);
  font-weight: 600;
  margin-top: 2px;
  text-align: left;
}

/* Step 6 — inning picker spacing (the picker itself is #ll-rescue-inning-pick,
   which now also covers the 'They Showed Up!' case). */
.ll-rescue-inning-join {
  margin-top: 12px;
}
.ll-rescue-inning-join.hidden { display: none; }

/* ── Start Game row (Step 4 · Planning) ────────────────────────── */
.ll-start-game-row {
  padding: 8px 10px;
  margin: 2px -10px -8px;
  background: #ffffff;
  border-top: 1px solid var(--ll-border);
}
.ll-start-game-row.hidden { display: none; }
.ll-start-game-btn {
  width: 100%;
  padding: 11px 16px;
  background: linear-gradient(135deg, #111827, #1E293B);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-family: 'Barlow Condensed', Barlow, system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ll-start-game-btn:active { opacity: 0.85; }

/* ── Live Dugout View ──────────────────────────────────── */
/* Note: --ll-muted is not defined in this file; --ll-text-3 is the muted grey. */
.ll-live-view {
  display: flex;
  flex-direction: column;
  /* Edge to edge: negate .app-layout-lineuplogix's 14px side padding */
  margin-left: -14px;
  margin-right: -14px;
  width: calc(100% + 28px);
  border-radius: 0;
  overflow: hidden;
}
.ll-live-view.hidden { display: none; }
/* ≤599px the parent already has zero side padding (padding-left/right: 0
   !important in the mobile full-bleed fixes), so no negative margin there */
@media (max-width: 599px) {
  .ll-live-view {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }
}

.ll-live-header {
  background: linear-gradient(135deg, #111827 0%, #1E293B 100%);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ll-live-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ll-live-team-name {
  font-family: 'Barlow Condensed', Barlow, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ll-live-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(22,163,74,0.2);
  border: 1px solid rgba(22,163,74,0.4);
  color: #16a34a;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}
.ll-live-dot {
  width: 5px;
  height: 5px;
  background: #16a34a;
  border-radius: 50%;
  animation: ll-pulse 1.5s infinite;
}
@keyframes ll-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.ll-live-edit-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: rgba(255,255,255,0.8);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ll-live-inning-bar {
  background: #ffffff;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--ll-border);
}
.ll-live-inning-lbl {
  font-size: 10px;
  font-weight: 800;
  color: var(--ll-text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-right: 2px;
}
.ll-live-inning-pills {
  display: flex;
  gap: 7px;
}
.ll-live-inning-pill {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  border: 1.5px solid var(--ll-border);
  background: var(--ll-bg-3);
  color: var(--ll-text-3);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ll-live-inning-pill.is-active {
  background: var(--ll-red);
  border-color: var(--ll-red);
  color: #ffffff;
}
.ll-live-inning-pill.is-played {
  background: var(--ll-bg-4);
  border-color: var(--ll-border);
  color: var(--ll-border);
}

.ll-live-body {
  position: relative;
  overflow: hidden;
  background: #ffffff;
}

/* Field */
.ll-live-field-wrap {
  background: #ffffff;
  padding: 6px 8px 2px;
}
.ll-live-field-svg { width: 100%; display: block; }

/* Position chips rendered in SVG by JS */
.ll-live-chip-rect {
  cursor: pointer;
  fill: #ffffff;
  stroke: var(--ll-border);
  stroke-width: 1.5;
  rx: 11;
}
.ll-live-chip-rect.is-pitcher {
  fill: #fef3ee;
  stroke: var(--ll-red);
}
.ll-live-chip-rect.is-selected {
  fill: rgba(200,86,31,0.12);
  stroke: var(--ll-red);
  stroke-width: 2;
}
.ll-live-chip-pos {
  font-family: 'Barlow Condensed', Barlow, system-ui, sans-serif;
  font-size: 9px;
  font-weight: 800;
  fill: #94a3b8;
  pointer-events: none;
}
.ll-live-chip-pos.is-pitcher { fill: var(--ll-red); }
.ll-live-chip-name {
  font-family: 'Barlow Condensed', Barlow, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  fill: var(--ll-text);
  pointer-events: none;
}
.ll-live-chip-name.is-pitcher { fill: var(--ll-red); }

/* Panels */
.ll-live-panels {
  display: flex;
  gap: 6px;
  padding: 0 8px 8px;
  background: #ffffff;
  border-bottom: 1px solid var(--ll-border);
}
.ll-live-bench-panel,
.ll-live-unavail-panel {
  flex: 1;
  background: var(--ll-bg-3);
  border: 1px solid var(--ll-border);
  border-radius: 8px;
  padding: 6px 8px;
  min-height: 36px;
}
.ll-live-panel-lbl {
  font-size: 9px;
  font-weight: 800;
  color: var(--ll-text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}
.ll-live-panel-list { }
.ll-live-panel-player {
  font-size: 11px;
  font-weight: 700;
  color: var(--ll-text);
  padding: 2px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ll-live-panel-player.is-bench { color: var(--ll-text); }
.ll-live-panel-player.is-absent { color: var(--ll-text-3); }
.ll-live-panel-player.is-late { color: var(--ll-red); }
.ll-live-panel-player.is-selected {
  color: var(--ll-red);
  font-weight: 900;
}

/* Actions */
.ll-live-actions {
  background: #ffffff;
  padding: 8px 10px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.ll-live-rescue-btn {
  flex: 1;
  background: var(--ll-red-soft);
  border: 1.5px solid var(--ll-red-border);
  border-radius: 10px;
  color: var(--ll-red);
  font-family: 'Barlow Condensed', Barlow, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ll-live-record-btn {
  background: linear-gradient(135deg, #111827, #1E293B);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-family: 'Barlow Condensed', Barlow, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

/* ── Batter tracker ─────────────────────────── */
.ll-batter-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 12px 4px;
  background: #fff;
}
.ll-batter-btn {
  padding: 7px 16px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.03em;
}
.ll-batter-btn-next {
  background: #C8561F;
  border-color: #C8561F;
  color: #ffffff;
}
.ll-batter-label {
  font-size: 9px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Highlighted batter card */
.ll-live-bo-cell.is-up-to-bat {
  background: #C8561F;
  border-color: #C8561F;
}
.ll-live-bo-cell.is-up-to-bat .ll-live-bo-num {
  background: rgba(255,255,255,0.25);
  color: #ffffff;
}
.ll-live-bo-cell.is-up-to-bat .ll-live-bo-name {
  color: #ffffff;
  font-weight: 800;
}

/* ── Season tab: game result badge ──────────────── */
.ll-game-result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
  flex-shrink: 0;
  margin-right: 8px;
  vertical-align: middle;
}
.ll-game-result-badge.win {
  background: rgba(22,163,74,0.12);
  color: #16a34a;
  border: 1px solid rgba(22,163,74,0.3);
}
.ll-game-result-badge.loss {
  background: rgba(200,86,31,0.1);
  color: #C8561F;
  border: 1px solid rgba(200,86,31,0.25);
}
.ll-game-result-badge.tie {
  background: rgba(100,116,139,0.1);
  color: #64748b;
  border: 1px solid rgba(100,116,139,0.2);
}

/* ── In-game scoreboard ─────────────────────────── */
.ll-scoreboard {
  background: #0F172A;
  padding: 8px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.ll-score-row {
  /* FS-C2 (§7): fixed columns so both teams' runs and outs line up whatever
     the team names; the name column takes what's left and truncates. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px 108px;
  align-items: center;
  column-gap: 10px;
  padding: 5px 0;
}
.ll-score-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 2px 0;
}
.ll-score-team {
  font-size: 9px;
  font-weight: 800;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ll-score-runs-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  gap: 2px;
}
.ll-score-outs-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: end;
  gap: 2px;
}
.ll-score-lbl {
  font-size: 7px;
  font-weight: 800;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ll-score-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px; /* FS-C2 (§7): same height as the outs dots, so RUNS / OUTS labels line up */
}
.ll-score-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.ll-score-btn:active { background: rgba(255,255,255,0.12); }
.ll-score-val {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  width: 32px;
  line-height: 26px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ll-score-dots {
  display: flex;
  gap: 0;
  align-items: center;
}
.ll-out-tap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.ll-out-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.ll-out-dot.is-out {
  background: #C8561F;
  border-color: #C8561F;
}

/* ── Site header: live pill + share (live mode only) ─ */
#ll-header-live-pill {
  display: none; /* .is-visible added in live mode */
  margin-left: auto;
}
#ll-header-live-pill.is-visible { display: flex; }
#ll-header-share-btn {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 20px;
  padding: 4px 6px;
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
#ll-header-share-btn.is-visible { display: inline-flex; align-items: center; }
#ll-header-share-btn svg { display: block; }

/* ── Account tab panel ───────────────────────────── */
.ll-acct-card { margin-top: 0; margin-bottom: 10px; }
.ll-acct-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--ll-text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}
.ll-acct-email {
  font-size: 14px;
  font-weight: 700;
  color: var(--ll-text);
  word-break: break-all;
}
.ll-acct-actions { padding: 0 12px; }
.ll-acct-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  border-bottom: 1px solid var(--ll-border);
  padding: 13px 0;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ll-text);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ll-acct-row:last-child { border-bottom: none; }
.ll-acct-row:active { opacity: 0.7; }
.ll-acct-row-arrow { color: var(--ll-text-3); font-size: 16px; }
.ll-acct-signout-wrap {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--ll-border);
}
.ll-acct-signout-btn { width: 100% !important; }
.ll-acct-footer {
  margin: 14px 0 0;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--ll-text-3);
}
.ll-saved-lineup-banner-sub {
  font-size: 11px;
  color: var(--ll-text-3);
  margin-top: 2px;
}

/* ── Pitcher plan redesign ───────────────────────── */
.ll-pitcher-no-game-row {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--ll-border);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ll-pitcher-no-game-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ll-text);
}
.ll-pitcher-no-game-sub {
  font-size: 11px;
  color: var(--ll-text-3);
  margin-top: 2px;
}
.ll-pitcher-plan-section {
  margin-bottom: 10px;
}
.ll-pitcher-section-lbl {
  font-size: 10px;
  font-weight: 800;
  color: var(--ll-text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

/* Individual pitcher card */
.ll-pitcher-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--ll-border);
  overflow: hidden;
  margin-bottom: 8px;
}
.ll-pitcher-card-hdr {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--ll-bg-4);
  background: var(--ll-bg-3);
}
.ll-pitcher-role-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
}
.ll-pitcher-role-badge.is-starter {
  background: rgba(200,86,31,0.12);
  color: var(--ll-red);
}
.ll-pitcher-role-badge.is-reliever {
  background: rgba(37,99,235,0.1);
  color: #2563eb;
}
.ll-pitcher-inn-range {
  font-size: 11px;
  color: var(--ll-text-3);
  font-weight: 600;
  margin-left: auto;
}
.ll-pitcher-remove {
  background: none;
  border: none;
  color: var(--ll-muted, var(--ll-text-3));
  font-size: 15px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.ll-pitcher-card-body {
  padding: 10px 12px;
}
.ll-pitcher-select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--ll-border);
  background: var(--ll-bg-3);
  font-size: 13px;
  font-weight: 600;
  color: var(--ll-text);
  margin-bottom: 10px;
  -webkit-appearance: none;
  appearance: none;
}

/* Inning stepper + pip bar row */
.ll-pitcher-inn-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ll-pitcher-inn-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--ll-text-3);
  white-space: nowrap;
}
.ll-pitcher-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.ll-pitcher-step-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--ll-border);
  background: var(--ll-bg-3);
  font-size: 16px;
  font-weight: 700;
  color: var(--ll-text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.ll-pitcher-step-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.ll-pitcher-step-val {
  font-size: 18px;
  font-weight: 900;
  color: var(--ll-text);
  min-width: 24px;
  text-align: center;
}
.ll-pitcher-pips {
  flex: 1;
  display: flex;
  gap: 3px;
}
.ll-pitcher-pip {
  height: 8px;
  border-radius: 3px;
  flex: 1;
  background: var(--ll-border);
  transition: background 0.2s;
}
.ll-pitcher-pip.is-starter { background: var(--ll-red); }
.ll-pitcher-pip.is-reliever { background: #2563eb; }
.ll-pitcher-pip.is-gap { background: #fbbf24; }

/* Coverage status row */
.ll-pitcher-coverage {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--ll-border);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
}
.ll-pitcher-coverage.is-ok {
  color: #16a34a;
  border-color: rgba(22,163,74,0.25);
  background: rgba(22,163,74,0.04);
}
.ll-pitcher-coverage.is-warn {
  color: #d97706;
  border-color: rgba(251,191,36,0.4);
  background: #fffbeb;
}
.ll-pitcher-coverage.is-info {
  color: #2563eb;
  border-color: rgba(37,99,235,0.2);
  background: rgba(37,99,235,0.04);
}

/* Add reliever button */
.ll-pitcher-add-reliever {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #ffffff;
  border-radius: 10px;
  border: 1.5px dashed var(--ll-border);
  cursor: pointer;
  width: 100%;
  font-size: 13px;
  font-weight: 700;
  color: var(--ll-text-3);
  margin-bottom: 8px;
  -webkit-tap-highlight-color: transparent;
}
.ll-pitcher-add-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ll-bg-4);
  border: 1px solid var(--ll-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* Generate button */
.ll-pitcher-generate-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #111827, #1E293B);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-family: 'Barlow Condensed', Barlow, system-ui,
    sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.15s;
  margin-bottom: 12px;
  display: block;
}
.ll-pitcher-generate-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ── Coach tips tour ─────────────────────────────── */
.ll-tip-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(10,16,28,0.45);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: all;
}
.ll-tip-overlay.hidden { display: none; }

.ll-tip-spotlight {
  position: fixed;
  border-radius: 8px;
  border: 2px solid #C8561F;
  box-shadow:
    0 0 0 4px rgba(200,86,31,0.2),
    0 0 0 9999px rgba(10,16,28,0.45);
  pointer-events: none;
  transition: top 0.3s ease, left 0.3s ease,
    width 0.3s ease, height 0.3s ease;
  z-index: 9001;
}

.ll-tip-card {
  position: relative;
  z-index: 9002;
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  padding: 20px 18px 28px;
  box-shadow: 0 -4px 24px rgba(15,23,42,0.15);
}
.ll-tip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.ll-tip-icon {
  width: 34px;
  height: 34px;
  background: rgba(200,86,31,0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.ll-tip-title {
  font-size: 15px;
  font-weight: 900;
  color: #0F172A;
  font-family: 'Barlow Condensed', Barlow, system-ui,
    sans-serif;
  letter-spacing: 0.02em;
}
.ll-tip-body {
  font-size: 13px;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 16px;
}
.ll-tip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ll-tip-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}
.ll-tip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: width 0.2s, background 0.2s,
    border-radius 0.2s;
}
.ll-tip-dot.is-active {
  background: #C8561F;
  width: 16px;
  border-radius: 3px;
}
.ll-tip-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ll-tip-skip {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  -webkit-tap-highlight-color: transparent;
}
.ll-tip-next {
  background: #C8561F;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 9px 20px;
  cursor: pointer;
  letter-spacing: 0.03em;
  -webkit-tap-highlight-color: transparent;
}

/* ── Live view: batting order grid ──────────────────── */
.ll-live-bo-section {
  background: #ffffff;
  padding: 6px 8px 8px;
  border-bottom: 1px solid var(--ll-border);
}
.ll-live-bo-lbl {
  font-size: 9px;
  font-weight: 800;
  color: var(--ll-muted, var(--ll-text-3));
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 5px;
}
.ll-live-bo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
.ll-live-bo-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--ll-bg-3);
  border: 1px solid var(--ll-border);
  border-radius: 6px;
  padding: 4px 6px;
  min-width: 0;
}
.ll-live-bo-num {
  width: 16px;
  height: 16px;
  background: var(--ll-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 900;
  color: #ffffff;
  flex-shrink: 0;
}
.ll-live-bo-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--ll-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ── Schedule tab (Phase 2): game list, cards, modal bits ───────────── */
.ll-schedule-view { display: flex; flex-direction: column; gap: 10px; }
.ll-schedule-toolbar { display: flex; justify-content: flex-end; }
.ll-schedule-heading { margin: 6px 0 0; }
.ll-schedule-list { display: flex; flex-direction: column; gap: 8px; }
.ll-schedule-empty { color: var(--ll-text-3); font-size: 0.9rem; padding: 12px 4px; }
.ll-sched-card {
  background: var(--ll-bg-2);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  -webkit-tap-highlight-color: transparent;
}
.ll-sched-card.is-live { border-color: var(--ll-red); }
.ll-sched-card.is-complete { cursor: pointer; opacity: 0.9; }
.ll-sched-main { flex: 1; min-width: 0; cursor: pointer; }
.ll-sched-opp { font-weight: 700; color: var(--ll-text); display: flex; align-items: center; gap: 6px; }
.ll-sched-when { font-size: 0.82rem; color: var(--ll-text-2); margin-top: 2px; }
.ll-sched-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ll-sched-badges:empty { display: none; }
.ll-sched-badge {
  font-size: 0.68rem; font-weight: 700; letter-spacing: .02em;
  padding: 2px 7px; border-radius: 999px;
  background: var(--ll-bg-3); color: var(--ll-text-2); border: 1px solid var(--ll-border);
}
.ll-sched-badge.is-live { background: var(--ll-red); color: #fff; border-color: var(--ll-red); }
.ll-sched-badge.is-past { color: #b45309; border-color: #f59e0b; background: rgba(245, 158, 11, 0.12); }
.ll-sched-badge.is-complete { color: #15803d; border-color: #22c55e; background: rgba(34, 197, 94, 0.12); }
.ll-sched-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.ll-sched-open { white-space: nowrap; }
.ll-sched-icons { display: flex; gap: 6px; }
.ll-sched-icons .icon-btn {
  background: var(--ll-bg-3); color: var(--ll-text-2); border: 1px solid var(--ll-border);
  padding: 4px 8px; font-size: 0.85rem;
}
.ll-game-backbar { margin-bottom: 8px; }
.ll-game-back-btn {
  background: none; border: none; padding: 4px 0; cursor: pointer;
  color: var(--ll-text-2); font-weight: 600; font-size: 0.9rem;
}
.ll-game-summary {
  display: flex; align-items: center; gap: 12px;
  background: var(--ll-bg-3); border: 1px solid var(--ll-border); border-radius: var(--ll-radius);
  padding: 12px 14px; margin-bottom: 14px;
}
.ll-game-summary-text { flex: 1; min-width: 0; }
.ll-game-summary-title { font-weight: 700; color: var(--ll-text); }
.ll-game-summary-sub { font-size: 0.82rem; color: var(--ll-text-2); margin-top: 2px; }
.ll-start-over-row { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ll-gm-error { color: var(--ll-red); margin-top: 4px; }
/* Add/Edit Game modal: same sizing idea as the other app modals — narrow,
   centered, with side margins on phones so both edges show */
.ll-gm-box {
  max-width: 420px;
  width: calc(100% - 32px);
  margin: 8vh auto;
}

/* Batter not active this inning (late / left) — marked and skipped */
.ll-live-bo-cell.is-inactive {
  flex-wrap: wrap;
  opacity: 0.5;
  border-style: dashed;
}
.ll-live-bo-note {
  flex-basis: 100%;
  font-size: 8px;
  font-weight: 700;
  color: var(--ll-text-3, var(--ll-text));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── PWA install banner ──────────────────────────────── */
.ll-pwa-banner {
  background: linear-gradient(135deg, #111827, #1E293B);
  border-bottom: 1px solid rgba(200,86,31,0.3);
  padding: 10px 14px;
  position: relative;
  z-index: 50;
}
.ll-pwa-banner.hidden { display: none; }
.ll-pwa-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ll-pwa-banner-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.ll-pwa-banner-text {
  flex: 1;
  min-width: 0;
}
.ll-pwa-banner-title {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
}
.ll-pwa-banner-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  margin-top: 1px;
  line-height: 1.3;
}
.ll-pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.ll-pwa-install-btn {
  background: #C8561F;
  border: none;
  border-radius: 6px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 12px;
  cursor: pointer;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
}
.ll-pwa-install-btn.hidden { display: none; }
.ll-pwa-dismiss-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.ll-pwa-dismiss-btn:active { color: #ffffff; }
/* iOS Safari has no install prompt — show the manual steps instead */
.ll-pwa-ios-steps {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  line-height: 1.4;
}
.ll-pwa-ios-steps strong { color: #ffffff; }
.ll-pwa-ios-steps.hidden { display: none; }
.ll-pwa-share-icon {
  display: inline-block;
  padding: 0 4px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.4;
  margin: 0 2px;
}

/* ── Availability: late inning picker ───────────────── */
.ll-avail-late-picker {
  grid-column: 1 / -1; /* the row is a 2-col grid — span the full width */
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--ll-border);
  width: 100%;
}
.ll-avail-late-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ll-text-3);
  margin-bottom: 6px;
}
.ll-avail-late-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ll-avail-late-pill {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--ll-border);
  background: var(--ll-bg-3);
  color: var(--ll-text-3);
  font-family: 'Barlow Condensed', Barlow, system-ui,
    sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s,
    color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ll-avail-late-pill.is-active {
  background: var(--ll-red);
  border-color: var(--ll-red);
  color: #ffffff;
}

/* ── Planning view: absent/late chips ───────────────── */
.ll-dugout-absent-section {
  width: 100%;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--ll-border);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ll-dugout-absent-chip {
  background: var(--ll-bg-4);
  border: 1px solid var(--ll-border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ll-text-3);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ll-dugout-absent-chip.is-late {
  color: var(--ll-red);
  border-color: var(--ll-red-border);
  background: var(--ll-red-soft);
}
.ll-dugout-absent-chip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ll-text-3);
  flex-shrink: 0;
}
.ll-dugout-absent-chip.is-late .ll-dugout-absent-chip-dot {
  background: var(--ll-red);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DUGOUT SCROLL VIEW — Features 1-5
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Topbar ─────────────────────────────────────────────────────────────── */
.ll-dugout-topbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: var(--ll-bg-2);
  border-bottom: 1px solid var(--ll-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.ll-dugout-game-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ll-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.ll-dugout-topbar-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
}
.ll-dugout-action-row {
  display: flex;
  gap: 5px;
}
.ll-dugout-action-row .ll-dugout-icon-btn {
  flex: 1;
}
#ll-dugout-rescue-btn {
  width: 100%;
  text-align: center;
  display: block;
}

.ll-dugout-icon-btn {
  background: var(--ll-bg-3);
  border: 1px solid var(--ll-border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ll-text-2);
  line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-align: center;
  width: 100%;
}

.ll-dugout-icon-btn:active {
  background: var(--ll-bg-4);
}

#ll-dugout-rescue-btn {
  border-color: var(--ll-red-border);
  color: var(--ll-red);
  background: var(--ll-red-soft);
}
#ll-dugout-start-btn {
  border-color: rgba(22,163,74,0.3);
  color: #16a34a;
  background: rgba(22,163,74,0.06);
}

/* ── Scroll area ─────────────────────────────────────────────────────────── */
.ll-dugout-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 12px;
}

/* ── Swap mode banner ────────────────────────────────────────────────────── */
.ll-dugout-swap-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--ll-red);
  color: #1a1a1a;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 9;
}

.ll-dugout-swap-cancel {
  background: rgba(0,0,0,0.15);
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  color: #1a1a1a;
}

/* ── Batting order strip ─────────────────────────────────────────────────── */
.ll-dugout-batting-strip {
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--ll-border);
}

.ll-dugout-batting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.ll-dugout-batting-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ll-text-3);
}

.ll-dugout-shuffle-btn {
  background: var(--ll-bg-3);
  border: 1px solid var(--ll-border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ll-text-2);
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.ll-dugout-shuffle-btn:active { background: var(--ll-bg-4); }

.ll-dugout-batting-pills {
  /* Was a nowrap horizontal scroller; now a 3-up grid so a 12-player
     order reads as 4 rows with nothing hidden off-screen. */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  overflow-x: visible;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.ll-dugout-batting-pills::-webkit-scrollbar { display: none; }

.ll-dugout-batting-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--ll-bg-3);
  border: 1px solid var(--ll-border);
  border-radius: 20px;
  padding: 3px 6px 3px 4px;
  font-size: 0.78rem;
  /* Step 7 — fill the grid cell instead of sizing to content. */
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  text-align: center;
  overflow: hidden;
}
/* Long names truncate rather than blowing out the 1/4-width cell. */
.ll-dugout-batting-pill .ll-dugout-batting-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ll-dugout-batting-num {
  background: var(--ll-red);
  color: #1a1a1a;
  font-weight: 700;
  font-size: 0.7rem;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ll-dugout-batting-name {
  color: var(--ll-text);
  font-weight: 500;
}

/* ── Inning cards ────────────────────────────────────────────────────────── */
.ll-dugout-inning-card {
  border-bottom: 1px solid var(--ll-border);
  padding: 10px 12px 8px;
  transition: background 0.15s;
}

.ll-dugout-inning-card.is-locked {
  border: 1.5px solid var(--ll-red);
  background: color-mix(in srgb, var(--ll-red) 4%, var(--ll-bg-2));
}

.ll-dugout-inning-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ll-dugout-inning-title {
  font-family: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  font-size: 26px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ll-red);
  line-height: 1;
}

.ll-dugout-lock-btn {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.5;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.ll-dugout-lock-btn:active,
.ll-dugout-lock-btn.is-locked {
  opacity: 1;
}

/* ── 3-column position grid: Infield | P·C | Outfield ───────────────────── */
.ll-dugout-pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  align-items: start;
}

.ll-dugout-pos-slot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  background: var(--ll-bg-3);
  border: 1.5px solid var(--ll-border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  position: relative;
  min-height: auto;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.ll-dugout-pos-slot:active {
  transform: scale(0.96);
}

.ll-dugout-pos-slot.is-locked {
  border-color: var(--ll-red);
  background: color-mix(in srgb, var(--ll-red) 8%, var(--ll-bg-3));
  cursor: default;
}

.ll-dugout-pos-slot.is-swap-selected {
  border-color: var(--ll-blue);
  background: color-mix(in srgb, var(--ll-blue) 12%, var(--ll-bg-3));
  box-shadow: 0 0 0 2px var(--ll-blue);
}

.ll-dugout-pos-slot.is-swap-target {
  border-color: var(--ll-green);
  border-style: dashed;
}

.ll-dugout-pos-slot.is-dragging {
  opacity: 0.4;
}

.ll-dugout-pos-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ll-text-3);
  line-height: 1;
  margin-bottom: 2px;
  display: block;
}

.ll-dugout-pos-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ll-text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

.ll-dugout-pos-lock-icon {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 0.6rem;
  opacity: 0.8;
}

/* ── Bench strip — amber/warm tint ──────────────────────────────────────── */
.ll-dugout-bench-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  background: rgba(245, 166, 35, 0.06);
  border: 1px solid rgba(245, 166, 35, 0.18);
  border-radius: 6px;
  padding: 5px 7px;
}

.ll-dugout-bench-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ll-text-3);
  flex-shrink: 0;
}

.ll-dugout-bench-pill {
  background: var(--ll-bg-4);
  border: 1px solid var(--ll-border);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.75rem;
  color: var(--ll-text-2);
  cursor: pointer;
  transition: border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.ll-dugout-bench-pill.is-swap-target {
  border-color: var(--ll-green);
  border-style: dashed;
}

/* ── Start Game bar ──────────────────────────────────────────────────────── */
.ll-dugout-start-bar {
  padding: 12px;
  background: var(--ll-bg-2);
  border-top: 1px solid var(--ll-border);
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.ll-dugout-start-btn {
  width: 100%;
  font-size: 1rem;
  font-weight: 700;
  padding: 12px;
  letter-spacing: 0.02em;
}

/* ── Live game bar ───────────────────────────────────────────────────────── */
.ll-dugout-game-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--ll-green) 12%, var(--ll-bg-2));
  border-top: 2px solid var(--ll-green);
  position: sticky;
  bottom: 0;
  z-index: 10;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ll-text);
}

.ll-dugout-live-dot {
  width: 8px;
  height: 8px;
  background: var(--ll-green);
  border-radius: 50%;
  flex-shrink: 0;
  animation: ll-pulse 1.4s ease-in-out infinite;
}

@keyframes ll-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTTOM SHEETS (Rescue + Record)
   ══════════════════════════════════════════════════════════════════════════ */

.ll-bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.ll-bottom-sheet.hidden {
  display: none;
}

.ll-bottom-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.ll-bottom-sheet-panel {
  position: relative;
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  padding: 8px 16px 32px;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Step 6 — Lineup Rescue drawer spans the full viewport width. */
  width: 100% !important;
  max-width: 100% !important;
  left: 0 !important;
  right: 0 !important;
  box-sizing: border-box;
  overflow-x: hidden;
}

.ll-bottom-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--ll-border);
  border-radius: 2px;
  margin: 8px auto 16px;
}

.ll-bottom-sheet-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ll-text);
  margin: 0 0 4px;
}

.ll-bottom-sheet-sub {
  font-size: 0.82rem;
  color: var(--ll-text-3);
  margin: 0 0 14px;
}

.ll-bottom-sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.ll-bottom-sheet-actions .primary,
.ll-bottom-sheet-actions .secondary {
  flex: 1;
}

/* ── Rescue: player list ─────────────────────────────────────────────────── */
.ll-rescue-player-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 4px;
}

.ll-rescue-player-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ll-bg-3);
  border: 1.5px solid var(--ll-border);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
  color: var(--ll-text);
  font-size: 0.88rem;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.ll-rescue-player-btn.is-selected {
  border-color: var(--ll-red);
  background: color-mix(in srgb, var(--ll-red) 10%, var(--ll-bg-3));
}

.ll-rescue-jersey {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ll-text-3);
  min-width: 28px;
}

.ll-rescue-player-name {
  font-weight: 600;
}

/* ── Rescue: change type ─────────────────────────────────────────────────── */
.ll-rescue-change-type,
.ll-rescue-inning-pick {
  margin-top: 12px;
}

.ll-rescue-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ll-text-3);
  margin-bottom: 8px;
}

.ll-rescue-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.ll-rescue-option {
  background: var(--ll-bg-3);
  border: 1.5px solid var(--ll-border);
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ll-text);
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.ll-rescue-option.is-selected {
  border-color: var(--ll-red);
  background: color-mix(in srgb, var(--ll-red) 10%, var(--ll-bg-3));
}

/* ── Rescue: inning number buttons ───────────────────────────────────────── */
.ll-rescue-inning-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.ll-rescue-inning-num {
  width: 40px;
  height: 40px;
  background: var(--ll-bg-3);
  border: 1.5px solid var(--ll-border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ll-text);
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.ll-rescue-inning-num.is-selected {
  border-color: var(--ll-red);
  background: color-mix(in srgb, var(--ll-red) 12%, var(--ll-bg-3));
}

/* ── Record sheet: summary ───────────────────────────────────────────────── */
.ll-record-summary {
  background: var(--ll-bg-3);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid var(--ll-border);
}

.ll-record-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--ll-border);
  font-size: 0.85rem;
}

.ll-record-info-row:last-child {
  border-bottom: none;
}

.ll-record-info-label {
  color: var(--ll-text-3);
  font-weight: 500;
}

.ll-record-info-val {
  color: var(--ll-text);
  font-weight: 600;
}

/* ── Body scroll lock when sheet open ────────────────────────────────────── */
body.ll-has-sheet {
  overflow: hidden;
}

/* ── color-mix() fallback for older browsers ─────────────────────────────── */
@supports not (color: color-mix(in srgb, red 10%, blue)) {
  .ll-dugout-pos-slot.is-locked { background: rgba(220,38,38,0.06); }
  .ll-dugout-pos-slot.is-swap-selected { background: rgba(26,111,204,0.12); }
  .ll-dugout-game-bar { background: rgba(39,134,79,0.12); }
  .ll-rescue-player-btn.is-selected,
  .ll-rescue-option.is-selected,
  .ll-rescue-inning-num.is-selected { background: rgba(220,38,38,0.08); }
  .ll-dugout-inning-card.is-locked { background: rgba(220,38,38,0.04); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DUGOUT SCROLL VIEW — Phase 2 enhancements
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Topbar info row ─────────────────────────────────────────────────────── */
.ll-dugout-topbar-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ll-dugout-game-meta {
  font-size: 0.72rem;
  color: var(--ll-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Autosave status indicator ───────────────────────────────────────────── */
.ll-dugout-save-status {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  color: var(--ll-text-3);
  white-space: nowrap;
  flex-shrink: 0;
}
.ll-dugout-save-status.hidden { display: none; }

/* ── FS-C2: Live save / sync status (compact, one line) ─────────────────── */
.ll-live-sync-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 22px;
  margin: 0;
  padding: 3px 14px;
  border: 0;
  border-bottom: 1px solid var(--ll-border);
  background: #ffffff;
  font-family: 'Barlow', sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ll-text-3);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}
.ll-live-sync-status::before {
  content: '';
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ll-green);
}
.ll-live-sync-status[data-state="pending"]::before,
.ll-live-sync-status[data-state="syncing"]::before { background: var(--ll-text-3); }
.ll-live-sync-status[data-state="waiting"] { color: var(--ll-amber); }
.ll-live-sync-status[data-state="waiting"]::before { background: var(--ll-amber); }
.ll-live-sync-status[data-state="unsaved"],
.ll-live-sync-status[data-state="conflict"],
.ll-live-sync-status[data-state="gone"] { color: var(--ll-red); }
.ll-live-sync-status[data-state="unsaved"]::before,
.ll-live-sync-status[data-state="conflict"]::before,
.ll-live-sync-status[data-state="gone"]::before { background: var(--ll-red); }
.ll-live-sync-status[data-state="conflict"] { cursor: pointer; text-decoration: underline; }
.ll-live-sync-status.hidden { display: none; }
.ll-dugout-save-status[data-state="waiting"] { color: var(--ll-amber); }
.ll-dugout-save-status[data-state="unsaved"],
.ll-dugout-save-status[data-state="conflict"],
.ll-dugout-save-status[data-state="gone"] { color: var(--ll-red); }

/* ── FS-C2: offline notice (outside the Live view) ──────────────────────── */
.ll-offline-banner {
  margin: 0;
  padding: 7px 16px;
  background: #fff7ed;
  border-bottom: 1px solid rgba(217,119,6,0.35);
  color: #92400e;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}
.ll-offline-banner.hidden,
body.ll-live-mode .ll-offline-banner { display: none; }

/* ── IN GAME live status badge ───────────────────────────────────────────── */
.ll-dugout-live-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ll-green);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.ll-dugout-live-status.hidden { display: none; }

/* ── Start button active state (game in progress) ────────────────────────── */
.ll-dugout-start-action.ll-dugout-btn-live {
  background: color-mix(in srgb, var(--ll-green) 18%, var(--ll-bg-3));
  border-color: var(--ll-green);
  color: var(--ll-green);
}

/* ── Rescue button prominent when in-game ────────────────────────────────── */
.ll-dugout-rescue-live {
  background: color-mix(in srgb, var(--ll-amber) 15%, var(--ll-bg-3));
  border-color: var(--ll-amber);
  color: var(--ll-amber);
}

/* ── Inning header layout ────────────────────────────────────────────────── */
.ll-dugout-inning-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

/* ── Pitcher name pill ───────────────────────────────────────────────────── */
.ll-dugout-pitcher-pill {
  background: rgba(157, 136, 238, 0.15);
  border: 1px solid rgba(157, 136, 238, 0.3);
  border-radius: 10px;
  padding: 2px 7px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #9d88ee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

/* ── Bench count pill ────────────────────────────────────────────────────── */
.ll-dugout-bench-count-pill {
  background: rgba(107, 113, 148, 0.13);
  border: 1px solid rgba(107, 113, 148, 0.25);
  border-radius: 10px;
  padding: 2px 7px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--ll-text-3);
  white-space: nowrap;
}

/* ── Position column grouping ────────────────────────────────────────────── */
.ll-dugout-pos-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ll-dugout-pos-col-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ll-text-3);
  text-align: center;
  padding-bottom: 1px;
}

/* ── Jersey number below player name ─────────────────────────────────────── */
.ll-dugout-pos-jersey {
  font-size: 9px;
  color: var(--ll-text-3);
  line-height: 1;
  margin-top: 1px;
  display: block;
}

/* ── Regen stagger animation ─────────────────────────────────────────────── */
@keyframes dugoutCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ll-dugout-inning-card.is-regen-in {
  animation: dugoutCardIn 0.3s ease-out both;
}

/* ── Rescue amber pulse (affected rows after fix) ────────────────────────── */
@keyframes dugoutRescuePulse {
  0%   { background-color: transparent; }
  20%  { background-color: rgba(245, 166, 35, 0.28); }
  80%  { background-color: rgba(245, 166, 35, 0.18); }
  100% { background-color: transparent; }
}
.ll-dugout-rescue-pulse {
  animation: dugoutRescuePulse 2s ease-in-out;
}

/* ── Rescue: queued changes list ─────────────────────────────────────────── */
.ll-rescue-queue {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: rgba(245, 166, 35, 0.06);
  border: 1px solid rgba(245, 166, 35, 0.20);
  border-radius: 8px;
}
.ll-rescue-queue.hidden { display: none; }

.ll-rescue-queue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--ll-bg-3);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 0.8rem;
}

.ll-rescue-queue-desc {
  color: var(--ll-text);
  font-weight: 500;
  flex: 1;
  min-width: 0;
}

.ll-rescue-queue-remove {
  background: none;
  border: none;
  color: var(--ll-text-3);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.8rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.ll-rescue-queue-remove:active { color: var(--ll-red); }

/* ── Rescue: Add Change button row ───────────────────────────────────────── */
.ll-rescue-add-row {
  margin-top: 8px;
}
.ll-rescue-add-row.hidden { display: none; }

.ll-rescue-add-btn {
  width: 100%;
  background: var(--ll-bg-3);
  border: 1px dashed var(--ll-border);
  border-radius: 8px;
  padding: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ll-text-2);
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, border-color 0.12s;
}
.ll-rescue-add-btn:active {
  background: var(--ll-bg-4);
  border-color: var(--ll-red);
}

/* ── color-mix() fallback for new locked card ────────────────────────────── */
@supports not (color: color-mix(in srgb, red 10%, blue)) {
  .ll-dugout-start-action.ll-dugout-btn-live { background: rgba(60,179,113,0.18); }
  .ll-dugout-rescue-live { background: rgba(245,166,35,0.15); }
}

/* ── Saved lineup banner (Step 1) ────────────────────────────────────────── */
.ll-saved-lineup-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: color-mix(in srgb, var(--ll-red) 8%, var(--ll-bg-2));
  border: 1px solid color-mix(in srgb, var(--ll-red) 30%, var(--ll-border));
  border-radius: var(--ll-radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.ll-saved-lineup-banner-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}
.ll-saved-lineup-banner-body {
  flex: 1;
  min-width: 0;
}
.ll-saved-lineup-banner-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--ll-red);
  line-height: 1.2;
}
.ll-saved-lineup-banner-sub {
  font-size: 11px;
  color: var(--ll-text-3);
  margin-top: 2px;
}
.ll-saved-lineup-banner-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.ll-saved-lineup-resume-btn {
  background: var(--ll-red);
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #000;
  cursor: pointer;
  white-space: nowrap;
}
.ll-saved-lineup-resume-btn:active { opacity: 0.85; }
.ll-saved-lineup-fresh-btn {
  background: var(--ll-bg-3);
  border: 1px solid var(--ll-border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ll-text-2);
  cursor: pointer;
  white-space: nowrap;
}
.ll-saved-lineup-fresh-btn:active { background: var(--ll-bg-4); }

/* ── Fairness warnings card (Dugout View) ────────────────────────────────── */
.ll-dugout-fairness-card {
  background: color-mix(in srgb, var(--ll-red) 8%, var(--ll-bg-2));
  border: 1px solid color-mix(in srgb, var(--ll-red) 28%, var(--ll-border));
  border-radius: var(--ll-radius-sm);
  margin: 0 0 10px;
  overflow: hidden;
}
.ll-dugout-fairness-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ll-dugout-fairness-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--ll-red);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ll-dugout-fairness-toggle {
  font-size: 10px;
  color: var(--ll-text-3);
  font-weight: 600;
}
.ll-dugout-fairness-body {
  list-style: none;
  margin: 0;
  padding: 0 10px 8px;
}
.ll-dugout-fairness-item {
  font-size: 11px;
  color: var(--ll-text-2);
  line-height: 1.45;
  padding: 2px 0;
  border-top: 1px solid color-mix(in srgb, var(--ll-red) 15%, transparent);
}
.ll-dugout-fairness-item:first-child { border-top: none; }

/* ── Fairness Check footer ───────────────────────────────────────────────── */
.ll-dugout-fairness-check {
  margin: 12px 0 0;
}
.ll-dugout-fairness-check-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ll-text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.ll-dugout-fc-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  height: 36px;
  border-radius: 5px;
  border: 1px solid transparent;
}
.ll-dugout-fc-row:nth-child(even) { background: var(--ll-bg-3); }
.ll-dugout-fc-row.fc-no-bench {
  background: rgba(74, 158, 255, 0.08);
  border-color: rgba(74, 158, 255, 0.18);
}
.ll-dugout-fc-row.fc-no-infield {
  background: rgba(245, 166, 35, 0.08);
  border-color: rgba(245, 166, 35, 0.18);
}
.ll-dugout-fc-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--ll-text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ll-dugout-fc-stat {
  font-size: 11px;
  color: var(--ll-text-2);
  text-align: center;
  min-width: 44px;
}
.ll-dugout-fc-stat-label {
  display: block;
  font-size: 9px;
  color: var(--ll-text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.ll-dugout-fc-header-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ll-text-3);
}
.ll-dugout-fc-header-name { flex: 1; }
.ll-dugout-fc-header-stat { min-width: 44px; text-align: center; }

/* ── Rescue summary card ─────────────────────────────────────────────────── */
.ll-dugout-rescue-summary {
  background: color-mix(in srgb, var(--ll-amber) 10%, var(--ll-bg-2));
  border: 1px solid color-mix(in srgb, var(--ll-amber) 30%, var(--ll-border));
  border-radius: var(--ll-radius-sm);
  padding: 8px 10px;
  margin-bottom: 10px;
  position: relative;
}
.ll-dugout-rescue-summary-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--ll-amber);
  margin-bottom: 4px;
  padding-right: 20px;
}
.ll-dugout-rescue-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 11px;
  color: var(--ll-text-2);
  line-height: 1.5;
}
.ll-dugout-rescue-summary-dismiss {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: var(--ll-text-3);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  line-height: 1;
}

/* ── Batting order swap highlight ────────────────────────────────────────── */
.ll-dugout-batting-pill.is-batting-swap-selected {
  border-color: var(--ll-red);
  background: color-mix(in srgb, var(--ll-red) 12%, var(--ll-bg-3));
  box-shadow: 0 0 0 2px var(--ll-red);
}
.ll-dugout-batting-pill.has-late-flag::after {
  content: '🕐';
  font-size: 8px;
  margin-left: 3px;
  opacity: 0.8;
  vertical-align: middle;
}
.ll-dugout-batting-swap-hint {
  font-size: 10px;
  color: var(--ll-text-3);
  text-align: center;
  padding: 3px 0 2px;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEASON TAB
   ═══════════════════════════════════════════════════════════════════════════ */

/* Shell */
.ll-season-shell {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* No-team placeholder */
.ll-season-noteam {
  padding: 32px 16px;
}

/* Segmented sub-nav */
.ll-season-subnav {
  display: flex;
  gap: 0;
  background: var(--ll-bg-2);
  border-bottom: 1px solid var(--ll-border);
  padding: 0 12px;
  position: sticky;
  top: 48px; /* below site-header */
  z-index: 50;
}

.ll-season-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--ll-text-3);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  text-align: center;
}

.ll-season-tab.active,
.ll-season-tab[aria-selected="true"] {
  color: var(--ll-red);
  border-bottom-color: var(--ll-red);
}

/* Sub-section container */
.ll-season-section {
  padding: 12px 12px 80px;
}

/* ── Game History cards ─────────────────────────────────────────────────── */
.ll-season-game-card {
  background: var(--ll-bg-2);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius);
  margin-bottom: 10px;
}

.ll-season-game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  gap: 8px;
}

.ll-season-game-meta {
  flex: 1;
  min-width: 0;
}

.ll-season-game-opponent {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ll-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ll-season-game-date {
  font-size: 12px;
  color: var(--ll-text-3);
  margin-top: 2px;
}

.ll-season-game-pills {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.ll-season-game-pill {
  font-size: 11px;
  color: var(--ll-text-3);
  background: var(--ll-bg-3);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}

.ll-season-game-chevron {
  font-size: 14px;
  color: var(--ll-text-3);
  flex-shrink: 0;
  transition: transform 0.18s;
}

.ll-season-game-card.is-expanded .ll-season-game-chevron {
  transform: rotate(180deg);
}

.ll-season-game-body {
  display: none;
  border-top: 1px solid var(--ll-border);
  padding: 12px 14px 14px;
}

.ll-season-game-card.is-expanded .ll-season-game-body {
  display: block;
}

/* 3-column fielding breakdown */
.ll-season-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.ll-season-field-col {
  background: var(--ll-bg-3);
  border-radius: var(--ll-radius-sm);
  padding: 8px 10px;
}

.ll-season-field-col-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ll-text-3);
  margin-bottom: 5px;
}

.ll-season-field-player {
  font-size: 12px;
  color: var(--ll-text-2);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Batting order list in expanded card */
.ll-season-batting-list {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ll-border);
}

.ll-season-batting-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ll-text-3);
  margin-bottom: 5px;
}

.ll-season-batting-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ll-text-2);
  padding: 2px 0;
}

.ll-season-batting-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  color: var(--ll-text-3);
  width: 18px;
  flex-shrink: 0;
  text-align: right;
}

/* Skeleton loading */
.ll-season-skeleton {
  background: var(--ll-bg-2);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius);
  margin-bottom: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ll-skel-bar {
  background: var(--ll-bg-3);
  border-radius: 4px;
  animation: ll-skel-pulse 1.2s ease-in-out infinite;
}

@keyframes ll-skel-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* Empty state */
.ll-season-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.ll-season-empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.ll-season-empty-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ll-text-2);
  margin-bottom: 6px;
}

.ll-season-empty-sub {
  font-size: 13px;
  color: var(--ll-text-3);
  line-height: 1.5;
  max-width: 240px;
}

/* ── Season Fairness table ──────────────────────────────────────────────── */
.ll-season-fairness-header {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ll-text-3);
  margin-bottom: 8px;
}

.ll-season-fairness-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ll-season-fairness-table th {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ll-text-3);
  padding: 5px 8px;
  text-align: left;
  border-bottom: 1px solid var(--ll-border);
  background: var(--ll-bg-2);
  position: sticky;
  top: 0; /* table scrolls inside .ll-fc-table-wrap, not the full page */
  z-index: 10;
}

.ll-season-fairness-table th:not(:first-child) {
  text-align: center;
}

.ll-season-fairness-table td {
  padding: 7px 8px;
  color: var(--ll-text);
  border-bottom: 1px solid var(--ll-border);
  vertical-align: middle;
}

.ll-season-fairness-table td:not(:first-child) {
  text-align: center;
  color: var(--ll-text-2);
}

.ll-season-fairness-table tr.ll-fairness-amber td {
  background: color-mix(in srgb, var(--ll-amber) 12%, transparent);
  color: var(--ll-amber);
}

.ll-season-fairness-table tr.ll-fairness-amber td:not(:first-child) {
  color: var(--ll-amber);
}

.ll-season-fairness-table tr:last-child td {
  border-bottom: none;
}

/* Expandable position breakdown row */
.ll-fairness-expand-btn {
  background: none;
  border: none;
  color: var(--ll-text-3);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ll-fairness-pos-breakdown {
  font-size: 11px;
  color: var(--ll-text-3);
  padding: 2px 0 0 0;
  line-height: 1.6;
}

/* ── Ask section ────────────────────────────────────────────────────────── */
.ll-season-ask-wrap {
  max-width: 600px;
}

.ll-season-ask-label {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--ll-text);
  margin-bottom: 4px;
}

.ll-season-ask-hint {
  font-size: 13px;
  color: var(--ll-text-3);
  margin-bottom: 10px;
  line-height: 1.5;
}

.ll-season-ask-textarea {
  width: 100%;
  background: var(--ll-bg-2);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius-sm);
  color: var(--ll-text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  resize: vertical;
  box-sizing: border-box;
}

.ll-season-ask-textarea:focus {
  outline: none;
  border-color: var(--ll-red);
}

.ll-season-ask-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ll-red);
  color: #000;
  border: none;
  border-radius: 8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 28px;
  margin-top: 8px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.ll-season-ask-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ll-season-ask-result {
  margin-top: 16px;
  background: var(--ll-bg-2);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--ll-text);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.ll-season-ask-result.is-error {
  border-color: #c0392b;
  color: #e74c3c;
}

.ll-season-ask-result.is-loading {
  color: var(--ll-text-3);
  font-style: italic;
}

/* Season note in Dugout View */
.ll-season-engine-note {
  background: color-mix(in srgb, var(--ll-red) 10%, var(--ll-bg-2));
  border: 1px solid color-mix(in srgb, var(--ll-red) 30%, var(--ll-border));
  border-radius: var(--ll-radius-sm);
  padding: 7px 12px;
  font-size: 12px;
  color: var(--ll-text-2);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ══════════════════════════════════════════════════════════════════
   Season Tab — Full Game Card body sections (.ll-sgc-*)
   ══════════════════════════════════════════════════════════════════ */

/* Section wrapper inside expanded game card */
.ll-sgc-section {
  padding: 10px 0;
  border-top: 1px solid var(--ll-border);
}
.ll-sgc-section:first-child {
  border-top: none;
  padding-top: 0;
}
.ll-sgc-section-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ll-text-3);
  margin-bottom: 6px;
}

/* Rescue section gets a subtle amber tint */
.ll-sgc-section--rescue {
  background: color-mix(in srgb, var(--ll-amber) 8%, transparent);
  border-radius: var(--ll-radius-sm);
  padding: 10px 10px;
  margin: 0 -10px;
}

/* ── Batting chip strip ── */
.ll-sgc-batting-strip {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.ll-sgc-batting-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--ll-bg-3);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius-sm);
  padding: 4px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ll-sgc-batting-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ll-text-3);
  min-width: 14px;
}
.ll-sgc-batting-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ll-text);
}
.ll-sgc-batting-jersey {
  font-size: 10px;
  color: var(--ll-text-3);
}

/* ── Per-player position pills by inning ── */
.ll-sgc-inning-header {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 3px;
}
.ll-sgc-player-name-hdr {
  width: 90px;
  flex-shrink: 0;
}
.ll-sgc-inn-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--ll-text-3);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.ll-sgc-player-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ll-sgc-player-row {
  display: flex;
  align-items: center;
  gap: 3px;
}
.ll-sgc-player-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--ll-text);
  width: 90px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ll-sgc-pills-wrap {
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Position pills */
.ll-sgc-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  width: 28px;
  height: 20px;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--ll-bg-3);
  color: var(--ll-text-2);
  border: 1px solid var(--ll-border);
}
.ll-sgc-pill--if {
  background: color-mix(in srgb, var(--ll-blue) 15%, var(--ll-bg-2));
  color: var(--ll-blue);
  border-color: color-mix(in srgb, var(--ll-blue) 30%, var(--ll-border));
}
.ll-sgc-pill--of {
  background: color-mix(in srgb, var(--ll-green) 12%, var(--ll-bg-2));
  color: var(--ll-green);
  border-color: color-mix(in srgb, var(--ll-green) 30%, var(--ll-border));
}
.ll-sgc-pill--bench {
  background: color-mix(in srgb, var(--ll-amber) 12%, var(--ll-bg-2));
  color: var(--ll-amber);
  border-color: color-mix(in srgb, var(--ll-amber) 30%, var(--ll-border));
}
.ll-sgc-pill--na {
  color: var(--ll-text-3);
  border-color: transparent;
  background: transparent;
}
/* FS-C2 (§9): played part of the inning before being replaced */
.ll-sgc-pill--also {
  border-style: dashed;
  width: auto;
  min-width: 28px;
  padding: 0 2px;
}
.ll-sgc-footnote {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ll-text-3);
}

/* ── Bench sits list ── */
.ll-sgc-bench-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ll-sgc-bench-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ll-sgc-bench-name {
  font-size: 13px;
  color: var(--ll-text);
}
.ll-sgc-bench-count {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--ll-amber);
}

/* ── Rescue / lineup changes list ── */
.ll-sgc-rescue-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ll-sgc-rescue-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.ll-sgc-rescue-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ll-text);
}
.ll-sgc-rescue-type {
  font-size: 11px;
  color: var(--ll-amber);
}

/* ══════════════════════════════════════════════════════════════════
   Season Tab — Fairness bars + sortable table (.ll-fc-*)
   ══════════════════════════════════════════════════════════════════ */

/* Three charts stacked vertically, each as a card */
.ll-fc-charts-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}
.ll-fc-chart {
  background: var(--ll-bg-2);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius);
  padding: 12px 14px;
}
.ll-fc-chart-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ll-text-2);
  margin-bottom: 10px;
}
.ll-fc-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.ll-fc-bar-row:last-child {
  margin-bottom: 0;
}
.ll-fc-bar-name {
  font-size: 12px;
  color: var(--ll-text);
  width: 88px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* FS-C2 (§8): slim bars on a quiet track; the count sits after the track */
.ll-fc-bar-track {
  flex: 1;
  min-width: 0;
  height: 8px;
  background: var(--ll-bg-3);
  border-radius: 4px;
  overflow: hidden;
}
.ll-fc-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.2s ease;
}
.ll-fc-bar--if  { background: color-mix(in srgb, var(--ll-blue) 80%, #ffffff); }
.ll-fc-bar--bench { background: color-mix(in srgb, var(--ll-amber) 80%, #ffffff); }
.ll-fc-bar--of  { background: color-mix(in srgb, var(--ll-green) 80%, #ffffff); }
.ll-fc-bar-val {
  flex: 0 0 22px;
  text-align: right;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--ll-text);
  font-variant-numeric: tabular-nums;
}
.ll-fc-scale-note {
  font-size: 12px;
  line-height: 1.4;
  color: var(--ll-text-2);
}
/* The table's highlight key, and the highlights themselves */
.ll-fc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ll-text-2);
}
.ll-fc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ll-fc-legend-swatch {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.ll-fc-swatch--amber { background: color-mix(in srgb, var(--ll-amber) 25%, #ffffff); border: 1px solid var(--ll-amber); }
.ll-fc-swatch--red { background: color-mix(in srgb, var(--ll-red) 18%, #ffffff); border: 1px solid var(--ll-red); }
.ll-fc-table td.ll-fc-cell--amber { background: color-mix(in srgb, var(--ll-amber) 14%, #ffffff); color: #92400e; font-weight: 700; }
.ll-fc-table td.ll-fc-cell--red { background: color-mix(in srgb, var(--ll-red) 12%, #ffffff); color: var(--ll-red); font-weight: 700; }

/* Table */
.ll-fc-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 55vh;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius);
  margin-bottom: 10px;
  position: relative;
}
.ll-fc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
/* 8 columns now (AB added) — tighter cells so the table still fits a phone */
@media (max-width: 480px) {
  .ll-fc-table { font-size: 11px; }
  .ll-fc-th, .ll-fc-table td { padding-left: 6px !important; padding-right: 6px !important; }
}
.ll-fc-th {
  background: var(--ll-bg-3);
  color: var(--ll-text-2);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  border-bottom: 1px solid var(--ll-border);
  position: sticky;
  top: 0;
  z-index: 2;
}
.ll-fc-th:not(:first-child) {
  text-align: right;
}
.ll-fc-th.is-sorted {
  color: var(--ll-text);
  background: color-mix(in srgb, var(--ll-blue) 10%, var(--ll-bg-3));
}
.ll-fc-th:active {
  background: color-mix(in srgb, var(--ll-blue) 15%, var(--ll-bg-3));
}
/* ═══════════════════════════════════════════════════════════════════════════
   Step 3 — horizontal overflow guard on the main content wrapper
   ══════════════════════════════════════════════════════════════════════════ */
.ll-tab-content {
  overflow-x: hidden;
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Step 9 — PRINT: don't cut off the batting order
   The batting order is a 4-up CSS grid on screen (Step 7). Grid columns
   don't reflow across printed pages, so for print it reverts to a wrapping
   flex row where each pill sizes to its content and never splits a page.
   ══════════════════════════════════════════════════════════════════════════ */
@media print {
  .ll-dugout-batting-pills {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    overflow: visible !important;
  }
  .ll-dugout-batting-pill {
    flex: 0 0 auto !important;
    width: auto !important;
    overflow: visible !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .ll-dugout-batting-pill .ll-dugout-batting-name {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  /* Chrome (navigation + actions) has no place on paper. */
  .ll-bottom-nav,
  .ll-diamond-nav,
  .site-header,
  .ll-dugout-topbar-actions,
  .ll-diamond-steps {
    display: none !important;
  }

  /* With the fixed bars hidden, drop the padding that reserved room for them. */
  .ll-diamond-shell,
  .ll-dugout-scroll,
  .app-main {
    padding-bottom: 0 !important;
  }
  .ll-dugout-scroll {
    overflow: visible !important;
    max-height: none !important;
  }
}

/* ── Share sheet (Copy Link / Show QR Code / Share…) ───────────────────── */
.ll-share-option-list { display: flex; flex-direction: column; gap: 8px; }
.ll-share-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  background: var(--ll-bg-3);
  border: 1.5px solid var(--ll-border);
  border-radius: 12px;
  color: var(--ll-text);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ll-share-option svg { flex-shrink: 0; color: var(--ll-red); }
.ll-share-option:active { background: var(--ll-bg-4); }
.ll-share-option.hidden { display: none; }
.ll-share-qr-view { text-align: center; }
.ll-share-qr-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ll-text);
  margin: 0 0 14px;
}
.ll-share-qr-box {
  width: min(80vw, 46vh, 360px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  background: #ffffff;
}
.ll-share-qr-box svg { display: block; width: 100%; height: 100%; }
.ll-share-qr-powered {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ll-text-3);
  margin: 12px 0 0;
}

/* ================================================================
   FS-A5 — dynamic field displays (6–12 fielders)
   ================================================================ */

/* Planning cards: columns may shrink below their longest name, so the
   Outfield column always stays on the card (names end in "…" instead). */
.ll-dugout-pos-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ll-dugout-pos-grid.is-two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ll-dugout-pos-col,
.ll-dugout-pos-slot { min-width: 0; }
.ll-dugout-pos-slot { max-width: 100%; }

/* Live field: invisible touch area around each chip (sized and split by
   LL_FIELD.hitAreas so neighbours never share one) */
.ll-live-field-wrap { position: relative; }
.ll-live-chip-hit {
  fill: none;
  pointer-events: all;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Live field: the selected player's position, full name and jersey —
   over the empty corner left of home plate, so nothing moves */
.ll-live-selection {
  position: absolute;
  left: 10px;
  bottom: 4px;
  max-width: calc(36% - 4px);
  pointer-events: none;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ll-text);
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--ll-red);
  border-radius: 6px;
  padding: 2px 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.ll-live-selection:empty { display: none; }
.ll-live-selection-pos {
  font-family: 'Barlow Condensed', Barlow, system-ui, sans-serif;
  font-weight: 800;
  color: var(--ll-red);
  margin-right: 3px;
}

/* Live bench: four or more on the bench → the bench takes the full width in
   two columns and Unavailable moves directly below it */
.ll-live-panels.is-wide { flex-direction: column; }
.ll-live-panels.is-wide .ll-live-bench-panel .ll-live-panel-list,
.ll-live-panels.is-wide .ll-live-unavail-panel .ll-live-panel-list.is-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 10px;
}
.ll-live-panels.is-wide .ll-live-panel-player {
  padding: 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ================================================================
   FS-A6 — Record Game: why a game can't be saved yet
   ================================================================ */
.ll-record-problems {
  margin: 12px 0 4px;
  padding: 10px 12px;
  border: 1.5px solid var(--ll-red);
  border-radius: 10px;
  background: var(--ll-red-soft, #fef3ee);
  color: var(--ll-text);
  font-size: 13px;
  line-height: 1.4;
}
.ll-record-problems-title { font-weight: 800; color: var(--ll-red); margin-bottom: 4px; }
.ll-record-problems-list { margin: 4px 0 6px; padding-left: 18px; }
.ll-record-problems-list li { margin: 2px 0; }
.ll-record-problems-help { font-size: 12px; color: var(--ll-text-3); }

/* ── FS-B — Lineup Rescue: Injury / Temporarily Out ───────────────────────
   The "did they play any part of this inning?" question uses the inning
   buttons' look, just wider; the out status in Live / planning reuses the
   absent styling. */
.ll-rescue-played-pick {
  margin-top: 12px;
}
.ll-rescue-played-btns {
  display: flex;
  gap: 8px;
}
.ll-rescue-inning-num.ll-rescue-played-btn {
  width: auto;
  min-width: 76px;
  height: 44px;
  padding: 0 18px;
}
.ll-dugout-rescue-summary-warn {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 0.78rem;
  color: var(--ll-text-2);
}

/* ── FS-B cleanup — Lineup Rescue: the coach decides an excluded placement ──
   Shown inside the Rescue sheet only when no exclusion-free repair exists.
   Reuses the sheet's player buttons, section labels and primary button; the
   picker steps aside while the coach decides and returns unchanged. */
#ll-rescue-sheet.is-deciding #ll-rescue-subtitle,
#ll-rescue-sheet.is-deciding #ll-rescue-queue,
#ll-rescue-sheet.is-deciding .ll-rescue-top-actions,
#ll-rescue-sheet.is-deciding #ll-rescue-player-list,
#ll-rescue-sheet.is-deciding #ll-rescue-change-type,
#ll-rescue-sheet.is-deciding #ll-rescue-inning-pick,
#ll-rescue-sheet.is-deciding #ll-rescue-played-pick,
#ll-rescue-sheet.is-deciding #ll-rescue-add-row,
#ll-rescue-sheet.is-deciding #ll-rescue-problems,
#ll-rescue-sheet.is-deciding #ll-rescue-fix-btn {
  display: none !important;
}
.ll-rescue-decision {
  margin-top: 4px;
  padding: 12px;
  border: 1.5px solid var(--ll-amber);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ll-amber) 8%, var(--ll-bg-3));
}
.ll-rescue-decision-title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ll-text);
}
.ll-rescue-decision-body {
  margin: 0 0 10px;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--ll-text);
}
.ll-rescue-decision-step {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--ll-text-3);
}
.ll-rescue-decision-list {
  max-height: 260px;
}
.ll-rescue-decision-list > * {
  flex-shrink: 0;            /* scroll the list rather than squash the rows */
}
.ll-rescue-decision-list .ll-rescue-section-label {
  margin: 4px 0 2px;
}
.ll-rescue-decision-btn {
  flex-wrap: wrap;
  min-height: 44px;
}
.ll-rescue-decision-btn .ll-rescue-player-status {
  flex: 0 0 calc(100% - 36px);
  margin-left: 36px;
}
.ll-rescue-decision-note {
  margin: 10px 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ll-text-2);
}
.ll-rescue-decision-apply {
  width: 100%;
  min-height: 46px;
}

/* ── FS-C — Live: "At bats tracked: N" beside the batting-order label ───────
   Same small uppercase label style as "Batting Order"; the number is the
   at-bats Next Batter has credited this game (Prev takes one back). */
.ll-live-bo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.ll-live-bo-head .ll-live-bo-lbl {
  margin-bottom: 0;
}
.ll-live-ab-tracked {
  font-size: 10px;
  font-weight: 700;
  color: var(--ll-text-3);
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ll-live-ab-tracked span {
  color: var(--ll-text);
  font-weight: 800;
}

/* ── FS-C — Record Game: no at-bats tracked ─────────────────────────────────
   Inside the existing Record sheet (no second dialog); the sheet's own two
   buttons become "Return to Live" / "Record without at-bats". */
.ll-record-noab {
  margin: 12px 0 4px;
  padding: 10px 12px;
  border: 1.5px solid var(--ll-amber);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ll-amber) 8%, var(--ll-bg-3));
  color: var(--ll-text);
  font-size: 13px;
  line-height: 1.4;
}
.ll-record-noab-title {
  font-weight: 800;
  margin-bottom: 2px;
}
.ll-record-noab-text {
  margin: 0;
}
/* Two full-width choices, one per line, so neither label wraps at 390 px */
#ll-record-sheet.is-no-ab .ll-bottom-sheet-actions {
  flex-direction: column;
}
#ll-record-sheet.is-no-ab .ll-bottom-sheet-actions .primary,
#ll-record-sheet.is-no-ab .ll-bottom-sheet-actions .secondary {
  min-height: 46px;
  white-space: nowrap;
}

/* FS-C2 (§11): Maximum fielders — what the choice means, above the choices */
.ll-nt-maxf-help {
  margin: 2px 0 8px;
}

/* ── FS-C3: no sign-in on this device and no connection ─────────────────── */
.ll-offline-signin {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  background: var(--ll-bg);
}
.ll-offline-signin.hidden { display: none; }
.ll-offline-signin-card {
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
  background: var(--ll-bg-2);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius);
  padding: 22px 20px;
  color: var(--ll-text);
  text-align: center;
}
.ll-offline-signin-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.ll-offline-signin-card p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ll-text-2);
}
.ll-offline-signin-card .ll-btn-primary { margin-top: 6px; }

/* ── FS-C3: Add / Edit Game — date and time fields on iPhone ────────────────
   iOS draws date and time inputs as native buttons and, unless their
   appearance is none, re-styles them after the page CSS: content-box sizing
   plus a minimum width (WebKit bug 301648). With width: 100% and padding the
   date field ran past the right edge of the modal. appearance: none lets the
   field size like the Opponent field above it; tapping it still opens the
   iOS date / time picker. The value is left-aligned like the other fields
   (iOS centres it), and an empty field keeps one line of height. (Phones
   already get 16 px text in inputs — "Fix 4" above — so no zoom on tap.) */
#ll-game-modal .field-group { min-width: 0; }
#ll-game-modal input[type="date"],
#ll-game-modal input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: calc(1.25em + 18px);
  line-height: 1.25;
  text-align: left;
}
#ll-game-modal input[type="date"]::-webkit-date-and-time-value,
#ll-game-modal input[type="time"]::-webkit-date-and-time-value {
  text-align: left;
  min-height: 1.25em;
}
