/* One border value for the dark theme (owner 2026-09-28): 22 percent white on every screen, 35 on
   iOS, where the same line reads fainter ("more in iphone safari"). Every border on the site reads
   var(--bks-line) (or --bks-line-solid where a solid grey is needed), so this is the one place to move it. */
:root { --bks-line: rgba(255,255,255,0.15); --bks-line-solid: #35354f; --bks-lift: 0 1px 3px rgba(255,255,255,0.06); }
/* One value on every device (owner 2026-09-28): the stronger iPhone line of 2026-09-27 answered a Safari extension (Noir) darkening the page, not the phone. */
/* ============================================================
   BOOKSTAD — BOOKSTAD design-system primitives
   Single source of truth for BUTTONS and PILLS site-wide.
   Vertical-alignment quirks (Inter vs FA icon metrics) solved
   ONCE here so consumers just slap on .bookstad-btn / .bookstad-pill +
   a colour modifier. No padding tweaking elsewhere.
   ============================================================ */

/* ============================================================
   .bookstad-btn — canonical button
   Usage:
     <a class="bookstad-btn bookstad-btn-primary">Action</a>
     <button class="bookstad-btn bookstad-btn-ghost bookstad-btn-sm">Cancel</button>
     <a class="bookstad-btn bookstad-btn-secondary bookstad-btn-block">Full-width</a>
   ============================================================ */
.bookstad-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  border-radius: 10px;
  font-family: var(--font-condensed, 'Roboto Condensed'), 'Roboto', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  white-space: nowrap;
  flex-wrap: nowrap;
  user-select: none;
  box-sizing: border-box;
}
/* Defensive: every direct child stays on the single inline line, perfectly
   centered. Prevents any cascading rule from stacking the icon above the
   text on mobile or in narrow contexts. */
.bookstad-btn > * {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.bookstad-btn:hover { transform: translateY(-1px); }
.bookstad-btn:active { transform: translateY(0); }

.bookstad-btn:disabled,
.bookstad-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* — Sizes (height-driven for reliable centering) — */
.bookstad-btn-xs { height: 26px; padding: 0 10px; font-size: 0.65rem; gap: 5px;  border-radius: 7px;  }
.bookstad-btn-sm { height: 32px; padding: 0 14px; font-size: 0.72rem; gap: 6px; border-radius: 8px;  }
.bookstad-btn-lg { height: 46px; padding: 0 24px; font-size: 0.95rem; gap: 10px; border-radius: 12px; }
.bookstad-btn-xl { height: 56px; padding: 0 32px; font-size: 1.05rem; gap: 12px; border-radius: 14px; }
.bookstad-btn-block { display: flex; width: 100%; }

/* — Solid variants — */
.bookstad-btn-primary   { background: var(--brand-blue, #4aa1d9);   color: #fff; }
.bookstad-btn-primary:hover   { background: #5db3ed; box-shadow: 0 6px 16px rgba(74,161,217,0.3); }

.bookstad-btn-secondary { background: var(--brand-orange, #f39220); color: #fff; }
.bookstad-btn-secondary:hover { background: #ffa843; box-shadow: 0 6px 16px rgba(243,146,32,0.3); }

.bookstad-btn-success   { background: #22c55e; color: #fff; }
.bookstad-btn-success:hover   { background: #34d770; box-shadow: 0 6px 16px rgba(34,197,94,0.3); }

.bookstad-btn-danger    { background: #ef4444; color: #fff; }
.bookstad-btn-danger:hover    { background: #f55757; box-shadow: 0 6px 16px rgba(239,68,68,0.3); }

.bookstad-btn-warning   { background: #eab308; color: #1a1a1a; }
.bookstad-btn-warning:hover   { background: #fbbf24; box-shadow: 0 6px 16px rgba(234,179,8,0.3); }

.bookstad-btn-dark      { background: #1a1a2e; color: #fff; border-color: var(--bks-line); }
.bookstad-btn-dark:hover      { background: #24243e; border-color: rgba(255,255,255,0.2); }

/* — Outline / ghost — */
.bookstad-btn-ghost {
  background: transparent;
  color: var(--text, #fff);
  border-color: var(--bks-line);
}
.bookstad-btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.25);
}

.bookstad-btn-outline-primary { background: transparent; color: var(--brand-blue, #4aa1d9); border-color: var(--brand-blue, #4aa1d9); }
.bookstad-btn-outline-primary:hover { background: var(--brand-blue, #4aa1d9); color: #fff; }

.bookstad-btn-outline-secondary { background: transparent; color: var(--brand-orange, #f39220); border-color: var(--brand-orange, #f39220); }
.bookstad-btn-outline-secondary:hover { background: var(--brand-orange, #f39220); color: #fff; }

.bookstad-btn-outline-danger { background: transparent; color: #ef4444; border-color: #ef4444; }
.bookstad-btn-outline-danger:hover { background: #ef4444; color: #fff; }

/* — Link / text — */
.bookstad-btn-link {
  height: auto;
  padding: 0;
  background: transparent;
  color: var(--brand-blue, #4aa1d9);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
}
.bookstad-btn-link:hover { text-decoration: underline; transform: none; }


/* ============================================================
   .bookstad-pill — canonical pill
   Usage:
     <span class="bookstad-pill"><i class="fa-solid fa-tv"></i> 6 TVs</span>
     <span class="bookstad-pill bookstad-pill-blue">Premier League</span>
     <span class="bookstad-pill bookstad-pill-red bookstad-pill-live">LIVE</span>
     <span class="bookstad-pill bookstad-pill-sm bookstad-pill-green">Open</span>
   ============================================================ */
.bookstad-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  font-family: var(--font-condensed, 'Roboto Condensed'), 'Roboto', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--bks-line);
  color: #b8bfcc;
  box-sizing: border-box;
}
.bookstad-pill > strong,
.bookstad-pill > .pill-label,
.bookstad-pill > span,
.bookstad-pill > span > strong { font-size: 12px; line-height: 1; }
/* Number wrapped in <strong> — bright white + bold; icon also bright white;
   only the label text stays dimmer for visual hierarchy. */
.bookstad-pill > i,
.bookstad-pill > strong,
.bookstad-pill > span > strong { color: #fff; }
.bookstad-pill > strong,
.bookstad-pill > span > strong { font-weight: 800; }
.bookstad-pill > .pill-label {
  font-style: normal;
  letter-spacing: 0.06em;
  transition: max-width 0.25s ease, opacity 0.2s ease, margin-left 0.2s ease;
}

/* Mobile: collapse pill to icon + number only. Tap (or focus) re-expands
   the pill with the label visible. Uses actual layout growth (max-width on
   the label) so neighbors reflow rather than getting overlapped. */
@media (max-width: 600px) {
  .bookstad-pill > .pill-label {
    max-width: 0;
    opacity: 0;
    margin-left: -4px;  /* swallow the gap when collapsed */
    overflow: hidden;
    white-space: nowrap;
  }
  .bookstad-pill:hover,
  .bookstad-pill:focus,
  .bookstad-pill:focus-within,
  .bookstad-pill.is-expanded {
    background: rgba(74,161,217,0.16);
    border-color: rgba(74,161,217,0.4);
  }
  .bookstad-pill:hover > .pill-label,
  .bookstad-pill:focus > .pill-label,
  .bookstad-pill:focus-within > .pill-label,
  .bookstad-pill.is-expanded > .pill-label {
    max-width: 80px;
    opacity: 1;
    margin-left: 0;
  }
}

/* All children sit on the same flex centerline; icons follow the one site icon rule (css/bookstad-icon-metrics.css, owner 2026-10-26). */
.bookstad-pill > strong,
.bookstad-pill > em,
.bookstad-pill > span,
.bookstad-btn > strong,
.bookstad-btn > span {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  font-style: normal;
}

/* — Sizes (height-driven, identical centering technique) — */
.bookstad-pill-xs { height: 20px; padding: 0 8px;  font-size: 0.58rem; gap: 4px; }
.bookstad-pill-sm { height: 24px; padding: 0 10px; font-size: 0.65rem; gap: 5px; }
.bookstad-pill-lg { height: 34px; padding: 0 16px; font-size: 0.78rem; gap: 8px; }
.bookstad-pill-xl { height: 40px; padding: 0 20px; font-size: 0.88rem; gap: 10px; }

/* — Soft / outline-coloured variants — */
.bookstad-pill-blue   { background: rgba(74,161,217,0.15); border-color: rgba(74,161,217,0.3); color: #4aa1d9; }
.bookstad-pill-orange { background: rgba(243,146,32,0.15); border-color: rgba(243,146,32,0.3); color: #f39220; }
.bookstad-pill-green  { background: rgba(34,197,94,0.15);  border-color: rgba(34,197,94,0.3);  color: #22c55e; }
.bookstad-pill-red    { background: rgba(239,68,68,0.15);  border-color: rgba(239,68,68,0.3);  color: #ef4444; }
.bookstad-pill-yellow { background: rgba(234,179,8,0.15);  border-color: rgba(234,179,8,0.3);  color: #eab308; }
.bookstad-pill-purple { background: rgba(168,85,247,0.15); border-color: rgba(168,85,247,0.3); color: #a855f7; }
.bookstad-pill-gray   { background: rgba(255,255,255,0.04); border-color: var(--bks-line); color: var(--text-muted, rgba(255,255,255,0.6)); }

/* — Solid filled variants — */
.bookstad-pill-solid                   { border-color: transparent; color: #fff; }
.bookstad-pill-solid.bookstad-pill-blue     { background: var(--brand-blue, #4aa1d9); }
.bookstad-pill-solid.bookstad-pill-orange   { background: var(--brand-orange, #f39220); }
.bookstad-pill-solid.bookstad-pill-green    { background: #22c55e; }
.bookstad-pill-solid.bookstad-pill-red      { background: #ef4444; }
.bookstad-pill-solid.bookstad-pill-yellow   { background: #eab308; color: #1a1a1a; }
.bookstad-pill-solid.bookstad-pill-purple   { background: #a855f7; }
.bookstad-pill-solid.bookstad-pill-gray     { background: rgba(255,255,255,0.12); color: var(--text, #fff); }

/* — LIVE pulsing dot — */
.bookstad-pill-live::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: bookstad-pill-pulse 1.6s ease-in-out infinite;
}

@keyframes bookstad-pill-pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.85); }
}

@media (prefers-reduced-motion: reduce) {
  .bookstad-btn { transition: none; }
  .bookstad-pill-live::before { animation: none; }
}


/* ── Date picker ──────────────────────────────────────────────────────
   Was in frontpage.css, used only by the public calendar and results
   pages. The panel planner needed the same picker and got a native
   <input type="date"> instead, which looked nothing like it (owner
   2026-09-01: "too poor. why not bringing the one from calendar page").
   Moved here, which both layouts load, so there is ONE picker. */
.calendar-popup {
  display: none;
  position: fixed;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  min-width: 280px;
  animation: fadeInUp 0.2s ease;
}

.calendar-popup.open { display: block; }

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.calendar-nav {
  display: flex;
  gap: 8px;
}

.calendar-nav button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.8rem;
  transition: all var(--transition);
}

.calendar-nav button:hover {
  color: var(--text);
  border-color: var(--accent);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.calendar-dow {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 0;
  text-transform: uppercase;
}

.calendar-day {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  margin: 0 auto;
}

.calendar-day:hover {
  background: var(--bg-glass);
  color: var(--text);
}

.calendar-day.today {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
  font-weight: 700;
}

.calendar-day.selected {
  background: var(--accent);
  color: #000;
  font-weight: 700;
}

.calendar-day.other-month {
  color: var(--text-muted);
  opacity: 0.4;
}


/* ── Date ribbon ──────────────────────────────────────────────────────
   The strip of day tiles from the public calendar page. The panel planner
   had its own `af-ribbon-*` version that looked nothing like it and could
   not reach past four weeks. One ribbon now, used by both. */
.date-ribbon {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  user-select: none;
  position: relative;
}

/* TODAY pill — fixed at left of ribbon */
.date-ribbon-today {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 64px;
  height: 72px;
  border-radius: var(--radius-sm);
  background: rgba(102,179,46,0.1);
  border: 1px solid #66b32e;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition);
}
.drt-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #66b32e;
}
.drt-day {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}
.drt-month {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #66b32e;
}
@media (hover: hover) {
  .date-ribbon-today:hover {
    background: rgba(102,179,46,0.25);
    box-shadow: 0 0 12px rgba(102,179,46,0.3);
  }
}
.date-ribbon-today:active {
  transform: scale(0.95);
}

.date-ribbon-arrow {
  flex-shrink: 0;
  width: 28px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(74,161,217,0.08);
  border: 1px solid rgba(74,161,217,0.15);
  color: var(--brand-blue);
  transition: all var(--transition);
  font-size: 1rem;
  cursor: pointer;
}

.date-ribbon-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.date-ribbon-arrow svg {
  width: 18px;
  height: 18px;
  stroke: var(--brand-blue);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) {
  .date-ribbon-arrow:hover {
    background: var(--brand-blue-dim);
    border-color: var(--brand-blue);
  }
}
.date-ribbon-arrow:active {
  transform: scale(0.93);
  background: var(--brand-blue-dim);
}

.date-ribbon-scroll {
  position: relative;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  min-width: 0;
  padding: 4px;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(135deg, rgba(74,161,217,0.05) 0%, rgba(15,15,25,0.6) 50%, rgba(243,147,34,0.03) 100%);
  border: 1px solid rgba(74,161,217,0.1);
  border-radius: var(--radius-sm);
}

.date-ribbon-scroll.dragging {
  cursor: grabbing;
}

.date-ribbon-scroll::-webkit-scrollbar { display: none; }

.date-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bks-line);
  cursor: pointer;
  transition: transform 0.15s ease-out, opacity 0.15s ease-out, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  min-width: 64px;
  width: 64px;
  height: 72px;
  justify-content: center;
}

.date-item-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.date-item-day {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.2;
}

.date-item-month {
  font-size: 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (hover: hover) {
  .date-item:hover {
    background: var(--bg-glass-hover);
    border-color: var(--bks-line);
  }
}
.date-item:active {
  transform: scale(0.93);
}

/* Selected day - solid blue border, blue tinted bg */
.date-item.active {
  background: var(--brand-blue-dim);
  border-color: var(--brand-blue);
  box-shadow: 0 0 16px rgba(74,161,217,0.3), 0 0 4px rgba(74,161,217,0.15);
  z-index: 2;
  position: relative;
}

.date-item.active .date-item-label { color: var(--brand-blue); }
.date-item.active .date-item-day { color: #fff; }
.date-item.active .date-item-month { color: var(--brand-blue); }

/* Today marker when not selected */
.date-item.today:not(.active) .date-item-label {
  color: var(--brand-blue);
  font-weight: 700;
}
.date-item.today:not(.active) {
  border-color: rgba(74,161,217,0.3);
}

/* Owner rule 2026-09-27: the padding is the SAME on all four sides. The icon and the text inside a chip, a pill or a button follow the one site icon rule (css/bookstad-icon-metrics.css, owner 2026-10-26): nothing here sizes or moves them. */
.bookstad-pill { height: auto; padding: 8px; gap: 6px; }
.bookstad-btn { height: auto; padding: 10px; }
.bookstad-btn-sm { height: auto; padding: 8px; }

/* Borders on every object (owner 2026-09-27): a button of any colour carries a light edge. */
.bookstad-btn { border: 1px solid var(--bks-line); }
