/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f3f4f6;
  --card-bg: #fff;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --text: #111827;
  --text-muted: #6b7280;
  --accent: #ffea13;
  --nav-bg: #000;
  --radius: 6px;
  --radius-card: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-card: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
  width: 100%;
  padding: 1.25rem 1rem 2rem;
}

.logo-font {
  font-family: 'Orbitron', monospace;
  letter-spacing: 0.05em;
}

/* ── Site nav (black bar) ── */
.site-nav {
  background: var(--nav-bg);
  color: #fff;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.05);
}
.site-nav-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-nav-brand {
  display: flex;
  align-items: center;
}
.site-nav-logo {
  height: 64px;
  width: auto;
  display: block;
}
.site-nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.site-nav-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
}
.site-nav-link {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  transition: color 0.15s;
}
.site-nav-link:hover {
  color: #d1d5db;
}
#btn-logout.site-nav-link {
  display: none;
}
body[data-authed="1"] #btn-logout.site-nav-link {
  display: inline-block;
}
@media (max-width: 640px) {
  .site-nav-title { display: none; }
  .site-nav-logo { height: 48px; }
  .site-nav-inner { height: 64px; }
}

/* ── Site footer (black bar) ── */
.site-footer {
  background: var(--nav-bg);
  color: #fff;
  padding: 1.5rem 1rem;
  margin-top: auto;
}
.site-footer-inner {
  max-width: 1600px;
  margin: 0 auto;
  text-align: center;
}
.site-footer-logo {
  height: 56px;
  width: auto;
  display: inline-block;
  margin-bottom: 0.5rem;
}
.site-footer-copy {
  color: #9ca3af;
  font-size: 0.85rem;
}

/* ── Layout ── */
.toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  max-width: 1600px;
  margin: 0 auto 1rem;
  padding: 0.6rem 0.8rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.toolbar #btn-generate {
  width: auto;
  padding: 0.55rem 1.25rem;
  font-size: 0.95rem;
}
.toolbar-spacer {
  flex: 1;
}
.controls-row {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(340px, 1.1fr);
  gap: 1rem;
  max-width: 1600px;
  margin: 0 auto 1rem;
  align-items: start;
}
.controls-row.collapsed {
  display: none;
}
.controls-row .card {
  margin-bottom: 0;
}
.schedule-row {
  width: 100%;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
}
.card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--border);
}

/* ── Buttons ── */
button, .btn-file {
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
  padding: 0.6rem;
  font-size: 0.95rem;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary {
  background: #e5e7eb;
  color: var(--text);
}
.btn-secondary:hover { background: #d1d5db; }
.btn-danger {
  background: var(--danger);
  color: #fff;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}
.btn-danger:hover { background: var(--danger-hover); }
.btn-edit {
  background: #f59e0b;
  color: #fff;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}
.btn-edit:hover { background: #d97706; }
.btn-file {
  display: inline-block;
  background: #e5e7eb;
  color: var(--text);
  text-align: center;
}
.btn-file:hover { background: #d1d5db; }
.hidden { display: none !important; }

/* ── Club Form ── */
.club-form {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.club-form input[type="text"],
.club-form input[type="number"] {
  flex: 1;
  min-width: 80px;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.club-form button {
  background: var(--primary);
  color: #fff;
}
.club-form button:hover { background: var(--primary-hover); }

.import-row {
  margin-bottom: 0.75rem;
}
.import-row .btn-file {
  width: 100%;
  padding: 0.45rem;
}

/* ── Club List ── */
.club-list {
  max-height: 260px;
  overflow-y: auto;
}
.club-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.85rem;
}
.club-item-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.club-item-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}
.club-item-actions {
  display: flex;
  gap: 0.3rem;
}
.club-total {
  font-weight: 600;
  font-size: 0.9rem;
  padding-top: 0.5rem;
  text-align: right;
}

/* ── Generate row at the bottom of Configuration card ── */
.config-generate-row {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.config-generate-row .btn-generate {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

/* ── Config checkbox row ── */
.config-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.config-checkbox-row input[type="checkbox"] {
  margin-top: 0.15rem;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.config-checkbox-row label {
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  line-height: 1.4;
}

/* ── Config Grid ── */
.config-grid {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 0.5rem 0.75rem;
  align-items: center;
}
.config-grid label {
  font-size: 0.85rem;
}
.config-grid input {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  text-align: right;
}
.config-grid input:disabled {
  background: #f3f4f6;
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}
.config-grid label.disabled {
  opacity: 0.5;
}

/* ── Action Buttons ── */
.action-buttons {
  margin-bottom: 1rem;
}

/* ── Save / Load ── */
.save-load-row {
  display: flex;
  gap: 0.5rem;
}
.save-load-row > * {
  flex: 1;
  text-align: center;
}

/* ── Schedule Output ── */
#schedule-output .card {
  overflow-x: auto;
}
.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--border);
}
.schedule-header h2 {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 1.4rem;
  font-weight: 700;
}
.schedule-header-tools {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.schedule-header .btn-save-warmup {
  width: auto;
  padding: 0.55rem 1.4rem;
  flex-shrink: 0;
}
.highlight-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.highlight-combo {
  position: relative;
  display: inline-block;
}
.highlight-select {
  padding: 0.45rem 3rem 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 0.9rem;
  min-width: 220px;
  cursor: text;
}
.highlight-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.highlight-clear,
.highlight-toggle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.highlight-clear { right: 28px; font-size: 1.05rem; }
.highlight-toggle { right: 4px; font-size: 0.85rem; }
.highlight-clear:hover,
.highlight-toggle:hover {
  background: #f3f4f6;
  color: var(--text);
}
/* Hide × when input is empty */
.highlight-combo input:placeholder-shown ~ .highlight-clear {
  display: none;
}
/* Rotate chevron when open */
.highlight-combo[data-open="true"] .highlight-toggle {
  transform: translateY(-50%) rotate(180deg);
}

/* Prev / next stepper beside the highlight picker */
.highlight-cycle {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 0.1rem;
}
.highlight-step {
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
}
.highlight-step:hover {
  background: #f3f4f6;
  color: var(--text);
}
.highlight-step:active {
  background: #e5e7eb;
}
.highlight-step:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: -2px;
}
.highlight-position {
  min-width: 4.5rem;
  text-align: center;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  user-select: none;
}

.highlight-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.15), 0 4px 6px -4px rgba(0,0,0,0.1);
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}
.highlight-combo[data-open="true"] .highlight-options {
  display: block;
}
.highlight-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}
.highlight-option.active,
.highlight-option:hover {
  background: #eff6ff;
}
.highlight-option[aria-selected="true"] {
  font-weight: 600;
  background: #dbeafe;
}
.highlight-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
.highlight-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.highlight-empty {
  padding: 0.5rem 0.7rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  cursor: default;
}

/* ── Highlight-club dim/emphasis ── */
.club-tag.dimmed {
  opacity: 0.18;
  filter: grayscale(0.85);
  transition: opacity 0.15s, filter 0.15s;
}
.club-tag.highlighted {
  box-shadow: 0 0 0 2px var(--text), 0 0 0 4px var(--accent, #ffea13);
  transform: scale(1.04);
  transition: transform 0.15s;
  position: relative;
  z-index: 2;
}
.drop-cell.cell-dimmed {
  background: repeating-linear-gradient(
    45deg,
    rgba(0,0,0,0.015),
    rgba(0,0,0,0.015) 6px,
    rgba(0,0,0,0.04) 6px,
    rgba(0,0,0,0.04) 12px
  );
}
.drop-cell.cell-dimmed.outside-lane {
  background: repeating-linear-gradient(
    45deg,
    rgba(59, 130, 246, 0.04),
    rgba(59, 130, 246, 0.04) 6px,
    rgba(59, 130, 246, 0.08) 6px,
    rgba(59, 130, 246, 0.08) 12px
  );
}
.drop-cell.cell-dimmed .lane-load-bar,
.drop-cell.cell-dimmed .lane-load-fill {
  opacity: 0.35;
}
.drop-cell.cell-dimmed .lane-total {
  opacity: 0.45;
}

.export-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* ── Schedule Table ── */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.schedule-table th,
.schedule-table td {
  border: 1px solid var(--border);
  padding: 0.5rem;
  text-align: left;
  vertical-align: top;
}
.schedule-table th {
  background: #f9fafb;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}
.schedule-table td.session-label {
  background: #f9fafb;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.schedule-table td.total-cell {
  background: #f9fafb;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
}
.outside-lane {
  background: #eff6ff;
}
th.outside-lane {
  background: #dbeafe;
}

/* ── Club Tags ── */
.club-tag {
  display: block;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.82rem;
  margin-bottom: 0.2rem;
  font-weight: 500;
  text-align: left;
  user-select: none;
  -webkit-user-drag: element;
}

/* ── Lane Load Bar ── */
.lane-load-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin-top: 0.4rem;
  overflow: hidden;
}
.lane-load-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

/* ── Lane Total ── */
.lane-total {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ── Summary ── */
.summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat-box {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  text-align: center;
}
.stat-box .stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}
.stat-box .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.split-list {
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.split-list li {
  margin-left: 1.2rem;
  margin-bottom: 0.2rem;
}

/* ── Print Styles ── */
@media print {
  body {
    background: #fff;
    padding: 0;
    font-size: 10pt;
  }
  header h1 {
    font-size: 14pt;
    margin-bottom: 0.5rem;
  }
  .controls-row,
  .toolbar,
  .help-section {
    display: none;
  }
  .schedule-row {
    width: 100%;
  }
  .drag-hint {
    display: none;
  }
  /* Purely an on-screen control — a "3 / 36" counter means nothing on paper. */
  .highlight-cycle {
    display: none;
  }
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
  .export-row {
    display: none;
  }
  .schedule-table {
    font-size: 9pt;
  }
  .schedule-table th,
  .schedule-table td {
    padding: 0.3rem 0.4rem;
  }
  .club-tag {
    font-size: 8pt;
    padding: 0.1rem 0.3rem;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .outside-lane,
  th.outside-lane {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .lane-load-bar {
    display: none;
  }
  .summary-stats .stat-box {
    border: 1px solid #ccc;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* ── Help section ── */
.help-section {
  max-width: 1600px;
  margin: 2rem auto 1rem;
}
.help-section details {
  display: block;
}
.help-section summary {
  cursor: pointer;
  list-style: none;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.help-section summary::-webkit-details-marker { display: none; }
.help-section summary h2 {
  display: inline-block;
  font-size: 1rem;
  margin: 0;
  padding: 0;
  border: none;
}
.help-section summary::before {
  content: '▸ ';
  color: var(--text-muted);
  font-size: 0.85rem;
}
.help-section details[open] summary::before {
  content: '▾ ';
}
.help-section h3 {
  font-size: 0.9rem;
  margin: 1rem 0 0.4rem;
  color: var(--primary);
}
.help-section p {
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}
.help-list {
  font-size: 0.88rem;
  line-height: 1.6;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
}
.help-list li {
  margin-bottom: 0.2rem;
}
.help-section code {
  background: #f3f4f6;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  font-size: 0.82rem;
}

.warning-banner {
  background: #fef3c7;
  border: 1px solid #d97706;
  border-left: 4px solid #d97706;
  color: #78350f;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.4;
}
.cell-breach {
  background: #fef2f2 !important;
  outline: 2px solid #dc2626;
  outline-offset: -2px;
}
.over-cap {
  color: #dc2626;
  font-weight: 700;
}

@media (max-width: 900px) {
  .controls-row {
    grid-template-columns: 1fr;
  }
  .toolbar {
    flex-wrap: wrap;
  }
}

/* ── Drag & Drop ── */
.draggable-lane,
.draggable-club,
.cell-handle {
  cursor: grab;
}
.draggable-lane:active,
.draggable-club:active,
.cell-handle:active {
  cursor: grabbing;
}
.drop-cell {
  position: relative;
}
.cell-handle {
  position: absolute;
  top: 3px;
  right: 4px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  opacity: 0.85;
  user-select: none;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.cell-handle:hover {
  opacity: 1;
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.drag-source {
  opacity: 0.35;
}
.drag-over {
  outline: 3px dashed var(--primary);
  outline-offset: -3px;
  background: #dbeafe !important;
}
body.dragging .draggable-lane > *:not(.drag-source),
body.dragging .drop-cell > *:not(.cell-handle):not(.drag-source) {
  pointer-events: none;
}
.drag-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-style: italic;
}

/* ── Library views (login / meets / warmups / editor) ── */
.btn-link {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
}
.btn-link:hover {
  text-decoration: underline;
}
.view {
  max-width: 1600px;
  margin: 0 auto;
}
.view.hidden {
  display: none;
}
.login-card {
  max-width: 420px;
  margin: 3rem auto;
  padding: 2rem;
}
.login-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 1.25rem;
  text-align: center;
}
.login-card form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.8rem;
}
.login-card label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}
.login-card input {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
}
.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.login-card .error {
  color: var(--danger);
  font-size: 0.9rem;
  min-height: 1.2em;
}
.inline-form {
  display: flex;
  gap: 0.5rem;
  margin: 0.8rem 0 1rem;
  flex-wrap: wrap;
}
.inline-form input {
  flex: 1 1 160px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}
.library-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.meet-row,
.warmup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.1s;
}
.meet-row:hover,
.warmup-row:hover {
  box-shadow: var(--shadow-card);
}
.meet-row-main,
.warmup-row .warmup-open-btn {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex: 1;
}
.meet-open-btn,
.warmup-open-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 0.3rem 0;
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  color: var(--text);
}
.meet-open-btn strong,
.warmup-open-btn strong {
  font-size: 1.05rem;
  color: var(--primary);
}
.meet-open-btn:hover strong,
.warmup-open-btn:hover strong {
  text-decoration: underline;
}
.meet-date,
.meet-venue,
.meet-count,
.warmup-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.meet-row-actions,
.warmup-row-actions {
  display: flex;
  gap: 0.4rem;
}
.meet-row-actions button,
.warmup-row-actions button {
  font-size: 0.82rem;
  padding: 0.3rem 0.6rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.meet-row-actions button:hover,
.warmup-row-actions button:hover {
  background: #f3f4f6;
}
.meet-delete-btn:hover,
.warmup-delete-btn:hover {
  background: var(--danger) !important;
  color: #fff;
  border-color: var(--danger);
}
.breadcrumb {
  margin-bottom: 0.6rem;
}
.editor-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1600px;
  margin: 0 auto 1rem;
  padding: 0.9rem 1.1rem;
}
.editor-header .editor-title {
  flex: 1;
  font-size: 1.4rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.editor-header .editor-meet {
  color: var(--text-muted);
  font-weight: 500;
}
.editor-header .editor-sep {
  color: var(--text-muted);
  margin: 0 0.5rem;
}
.editor-header .editor-warmup {
  font-weight: 700;
  color: var(--text);
}
.editor-header .btn-save-warmup {
  width: auto;
  padding: 0.55rem 1.4rem;
}
.editor-header #btn-refresh-warmup {
  width: auto;
  padding: 0.55rem 1rem;
  white-space: nowrap;
}
.editor-header #btn-refresh-warmup:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Bottom Save bar */
.editor-footer-actions {
  max-width: 1600px;
  margin: 1.5rem auto 0;
  padding: 1rem 0;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}
.editor-footer-actions .btn-save-warmup {
  width: auto;
  padding: 0.7rem 2rem;
  font-size: 1rem;
  min-width: 200px;
}

/* Meets / warmups view headings */
#warmups-meet-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
  border-bottom: none;
  padding-bottom: 0;
}
#warmups-meet-meta {
  margin-bottom: 0.5rem;
}
.warmups-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.warmups-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.warmups-header-actions button {
  width: auto;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}
.publish-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 6px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.publish-label {
  color: var(--text-muted);
}
.publish-status a {
    color: black;
  word-break: break-all;
  flex: 1;
  min-width: 200px;
}
.warmup-public-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
}
.warmup-public-toggle input {
  margin: 0;
}
.muted {
  color: var(--text-muted);
}
.error {
  color: var(--danger);
}

/* ── Modal (worksheet picker) ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal.hidden {
  display: none !important;
}
.modal-card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.25), 0 8px 10px -6px rgba(0,0,0,0.15);
  animation: modal-pop 0.12s ease-out;
}
@keyframes modal-pop {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.modal-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  border-bottom: none;
  padding-bottom: 0;
}
.modal-card p {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.modal-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}
.modal-card select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: #fff;
}
.modal-card select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.modal-actions button {
  width: auto;
  padding: 0.55rem 1.1rem;
}

@media print {
  .site-nav,
  .site-footer,
  .modal,
  #btn-logout,
  #view-login,
  #view-meets,
  #view-warmups,
  .editor-header {
    display: none !important;
  }
}
