* {
  box-sizing: border-box;
}

:root {
  /* Brand colors */
  --catlap-yellow: #fef100;
  --catlap-blue:   #00a3e6;
  --catlap-pink:   #f4519d;
  --catlap-purple: #9b3de6;
  --catlap-green:  #66c343;
  --catlap-orange: #ff7b25;
  --catlap-brown:  #9c4d18;
  --catlap-black:  #000000;

  /* Semantic accent colors (from index.html) */
  --accent-log: #ff9b6b;
  --accent-monitor: #22c55e;
  --accent-charts: #6bc3e6;
  --accent-troubleshoot: #b89de6;
  --accent-conditions: #8bc363;
  --accent-planner: #f4c373;
  --accent-fuel: #e6a86b;
  --accent-analysis: #f48bb1;
  --accent-debrief: #9ca3af;
  --accent-gps: #6bc3e6;

  /* Dark mode theme */
  --page-bg: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-bg-solid: #1e1e32;
  --card-border: rgba(255, 255, 255, 0.1);
  --card-border-hover: rgba(255, 255, 255, 0.15);
  --ink: #ffffff;
  --ink-bright: #ffffff;
  --ink-soft: rgba(255, 255, 255, 0.9);
  --ink-muted: rgba(255, 255, 255, 0.6);

  --max-width: 1100px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 14px;

  /* Input styles */
  --input-bg: rgba(255, 255, 255, 0.1);
  --input-border: rgba(255, 255, 255, 0.2);
  --input-text: #ffffff;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ========== SITE NAVIGATION ========== */
.site-nav {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(20, 20, 35, 0.6) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.85rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.site-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-nav-brand {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-bright);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
}

.site-nav-brand::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #6bc3e6, #b89de6);
  transition: width 0.2s ease;
}

.site-nav-brand:hover::after {
  width: 100%;
}

/* Simple flat nav links */
.site-nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.site-nav-link {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  transition: all 0.15s ease;
}

.site-nav-link:hover {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.06);
}

.site-nav-link.active {
  color: var(--ink-bright);
  background: rgba(255, 255, 255, 0.1);
}

/* Settings icon */
.site-nav-settings {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
  border-radius: 6px;
  color: var(--ink-muted);
  text-decoration: none;
  transition: all 0.15s ease;
  margin-left: auto;
}

.site-nav-settings:hover {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.06);
}

.site-nav-settings svg {
  display: block;
}

@media (max-width: 700px) {
  .site-nav {
    padding: 0.6rem 0.75rem;
  }

  .site-nav-inner {
    gap: 0.5rem;
  }

  .site-nav-brand {
    font-size: 0.8rem;
  }

  .site-nav-links {
    gap: 0.15rem;
  }

  .site-nav-link {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
  }

  .site-nav-settings {
    padding: 0.4rem;
  }

  .site-nav-settings svg {
    width: 16px;
    height: 16px;
  }
}

* {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page-bg);
  background-attachment: fixed;
  color: var(--ink-soft);
  min-height: 100vh;
}

/* ========== UNIFIED PAGE LAYOUTS ========== */

/* Page container - centered content wrapper */
.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-xl);
  padding-top: var(--space-md);
  width: 100%;
  box-sizing: border-box;
}

/* Page header - title area */
.page-header {
  text-align: center;
  margin-bottom: var(--space-xl);
  width: 100%;
  max-width: 600px;
}

.page-tag {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(254, 241, 0, 0.1) 0%, rgba(254, 241, 0, 0.05) 100%);
  border: 1px solid rgba(254, 241, 0, 0.2);
  color: var(--catlap-yellow);
  margin-bottom: var(--space-md);
}

.page-title {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 800;
  color: var(--ink-bright);
  margin: 0 0 var(--space-sm);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.5;
  max-width: 450px;
  margin: 0 auto;
}

/* Section with divider lines */
.page-section {
  width: 100%;
  max-width: 600px;
  margin: 0 auto var(--space-xl) auto;
}

.page-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-bottom: var(--space-md);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.page-section-title::before,
.page-section-title::after {
  content: '';
  height: 1px;
  width: 40px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15));
}

.page-section-title::after {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.15), transparent);
}

/* ========== UNIFIED CARD SYSTEM ========== */

/* Modern card with glass effect */
.card-modern {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.card-modern:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-color: var(--card-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Card with accent bar on top */
.card-accent {
  position: relative;
}

.card-accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent-color, var(--catlap-yellow));
  opacity: 0.5;
  transition: opacity var(--transition-normal);
}

.card-accent:hover::before {
  opacity: 1;
}

/* Card grid layouts */
.card-grid {
  display: grid;
  gap: var(--space-md);
  width: 100%;
}

.card-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.card-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 600px) {
  .card-grid-2,
  .card-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ========== UNIFIED FORM ELEMENTS ========== */

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
  color: var(--ink-soft);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: var(--space-xs);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem var(--space-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-sm);
  color: var(--ink-soft);
  font-size: 1rem;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--catlap-yellow);
  background: rgba(255, 255, 255, 0.1);
}

/* ========== UNIFIED BUTTONS ========== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--border-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
}

.btn-primary {
  background: var(--catlap-yellow);
  color: var(--catlap-black);
  border-color: var(--catlap-yellow);
}

.btn-primary:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-soft);
  border-color: var(--card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--card-border-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: transparent;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

/* ========== UNIFIED STATS/METRICS ========== */

.metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  text-align: center;
}

.metric-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ink-bright);
  line-height: 1.1;
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-top: var(--space-xs);
}

.metric-unit {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink-muted);
}

/* Colored metric variants */
.metric-card[data-color="green"] { border-color: rgba(102, 195, 67, 0.3); }
.metric-card[data-color="green"] .metric-value { color: var(--catlap-green); }

.metric-card[data-color="blue"] { border-color: rgba(107, 195, 230, 0.3); }
.metric-card[data-color="blue"] .metric-value { color: var(--accent-charts); }

.metric-card[data-color="orange"] { border-color: rgba(244, 195, 115, 0.3); }
.metric-card[data-color="orange"] .metric-value { color: var(--accent-planner); }

.metric-card[data-color="pink"] { border-color: rgba(244, 139, 177, 0.3); }
.metric-card[data-color="pink"] .metric-value { color: var(--accent-analysis); }

/* ========== UNIFIED STATUS BADGES ========== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.badge-warning {
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
}

.badge-error {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.badge-info {
  background: rgba(107, 195, 230, 0.15);
  color: #7dd3fc;
}

/* ========== UNIFIED TOGGLE SWITCHES ========== */

.toggle-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-sm);
}

.toggle-group-label {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-right: var(--space-sm);
}

.toggle-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.toggle-btn.active {
  background: var(--catlap-yellow);
  color: var(--catlap-black);
  border-color: var(--catlap-yellow);
  font-weight: 600;
}

/* ========== UTILITIES ========== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-muted { color: var(--ink-muted); }
.text-bright { color: var(--ink-bright); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.full-width { width: 100%; }
.max-w-sm { max-width: 400px; }
.max-w-md { max-width: 600px; }
.max-w-lg { max-width: 800px; }
.max-w-xl { max-width: 1000px; }

/* ========== ENHANCED PAGE SHELL ========== */

/* Modern crew shell with improved spacing */
.crew-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  overflow-x: hidden;
}

.crew-header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.crew-header > div:first-child {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.crew-tag {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(254, 241, 0, 0.1) 0%, rgba(254, 241, 0, 0.05) 100%);
  border: 1px solid rgba(254, 241, 0, 0.2);
  color: var(--catlap-yellow);
  width: fit-content;
}

.crew-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin: 0;
  font-weight: 800;
  text-transform: lowercase;
  color: var(--ink-bright);
  letter-spacing: -0.02em;
}

.crew-subtitle {
  margin: 0;
  font-size: 0.95rem;
  max-width: 500px;
  color: var(--ink-muted);
  line-height: 1.5;
}

.crew-warning {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--catlap-orange);
}

/* Layout */

.crew-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr);
  gap: var(--space-lg);
}

@media (max-width: 900px) {
  .crew-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .crew-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Cards - modernized with glass effect */

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  backdrop-filter: blur(12px);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--card-border-hover);
}

.card h2 {
  margin: 0 0 var(--space-sm);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--ink-bright);
  letter-spacing: -0.01em;
}

.card small {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* Forms */

.inline-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
  align-items: flex-end;
  max-width: 100%;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.85rem;
  min-width: 0;
  max-width: 100%;
}

.form-field label {
  font-weight: 600;
  color: var(--ink-muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--input-text);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--catlap-yellow);
  box-shadow: 0 0 0 2px rgba(254, 241, 0, 0.2);
}

.form-field textarea {
  min-height: 60px;
  resize: vertical;
}

button {
  font: inherit;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink-soft);
  box-shadow: none;
  transition: background 0.15s;
}

button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: none;
  box-shadow: none;
}

button:active {
  background: rgba(255, 255, 255, 0.25);
}

button.primary {
  background: var(--catlap-blue);
  border-color: rgba(0, 130, 180, 0.5);
  color: white;
}

button.primary:hover {
  background: #0090c0;
}

button.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink-soft);
  border: 1px solid var(--card-border);
}

button.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Clock / pills */

.time-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.time-pill {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.1);
  font-weight: 600;
  color: var(--ink-soft);
}

.time-pill strong {
  font-weight: 800;
  color: var(--catlap-yellow);
}

/* Assistance table */

.assist-table-wrapper {
  margin-top: 0.75rem;
  max-height: 380px;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.2);
}

table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  table-layout: fixed;
}

thead {
  position: sticky;
  top: 0;
  background: rgba(30, 30, 50, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1;
}

th, td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  vertical-align: top;
  text-align: left;
}

th {
  color: var(--catlap-yellow);
  font-weight: 700;
}

td {
  color: var(--ink-soft);
}

th:nth-child(1),
td:nth-child(1) {
  width: 60px;
  white-space: nowrap;
}

th:nth-child(2),
td:nth-child(2) {
  width: 120px;
  white-space: nowrap;
}

.assist-plan-cell {
  min-width: 240px;
}

.assist-plan-cell[contenteditable="true"] {
  outline: none;
  border-radius: 4px;
}

.assist-plan-cell:focus-visible {
  box-shadow: 0 0 0 2px var(--catlap-pink);
}

.plan-table-wrapper {
  margin-top: 0.75rem;
  max-height: 380px;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.2);
}

.plan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.plan-table thead {
  position: sticky;
  top: 0;
  background: var(--card-bg-solid);
  z-index: 1;
}

.plan-table th {
  color: var(--catlap-pink);
  font-weight: 600;
}

.plan-table th,
.plan-table td {
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  vertical-align: top;
}

.plan-row-current {
  background: rgba(102, 195, 67, 0.25);
}

.plan-row-current td {
  border-bottom-color: rgba(102, 195, 67, 0.4);
  color: #ffffff;
}

/* speed colours */
.plan-speed-slow {
  font-weight: 700;
  color: var(--catlap-green);
}

.plan-speed-average {
  font-weight: 700;
  color: var(--catlap-blue);
}

.plan-speed-fast {
  font-weight: 700;
  color: var(--catlap-orange);
}

.plan-gear-cell {
  white-space: normal;
}

.gear-tag {
  display: inline-block;
  margin: 0 0.15rem 0.15rem 0;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--catlap-pink);
  font-size: 0.7rem;
  background: rgba(244, 81, 157, 0.2);
  color: var(--catlap-pink);
}

.hour-row-current {
  background: rgba(102, 195, 67, 0.2);
}

.hour-row-current td {
  border-bottom-color: rgba(102, 195, 67, 0.4);
}

/* Lap log */

.log-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.log-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .log-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

.log-checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.log-checkbox-row label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

.log-checkbox-row input[type="checkbox"] {
  width: auto;
}

.log-actions {
  display: flex;
  justify-content: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  align-items: center;
}

.log-status {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* Summary + tables */

.log-summary {
  margin-top: 0.75rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  background: rgba(254, 241, 0, 0.1);
  border: 1px solid rgba(254, 241, 0, 0.2);
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--ink-soft);
}

.log-summary strong {
  font-weight: 800;
  color: var(--catlap-yellow);
}

.log-table-wrapper {
  margin-top: 0.75rem;
  max-height: 320px;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.2);
}

/* =========================
   Fuel buttons
   ========================== */

.fuel-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Base fuel button - rectangular */
.fuel-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink-soft);
  text-align: center;
  transition: background 0.15s;
}

.fuel-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Variants by type */
.fuel-btn.food-fuel {
  background: rgba(102, 195, 67, 0.2);
  border-color: rgba(102, 195, 67, 0.4);
  color: #90ee90;
}

.fuel-btn.food-fuel:hover {
  background: rgba(102, 195, 67, 0.3);
}

.fuel-btn.liquid-fuel {
  background: rgba(0, 163, 230, 0.2);
  border-color: rgba(0, 163, 230, 0.4);
  color: #87ceeb;
}

.fuel-btn.liquid-fuel:hover {
  background: rgba(0, 163, 230, 0.3);
}

.fuel-btn.hybrid-fuel {
  background: rgba(155, 61, 230, 0.2);
  border-color: rgba(155, 61, 230, 0.4);
  color: #dda0dd;
}

.fuel-btn.hybrid-fuel:hover {
  background: rgba(155, 61, 230, 0.3);
}

.fuel-btn.other-fuel {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--ink-muted);
}

.fuel-btn.other-fuel:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Fuel summary text */
.fuel-summary {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* Reset fuel button */
.fuel-reset-btn {
  margin-top: 0.5rem;
  background: rgba(180, 0, 0, 0.2);
  border-color: rgba(180, 0, 0, 0.4);
  color: #ffaaaa;
}

.fuel-reset-btn:hover {
  background: rgba(180, 0, 0, 0.3);
}



.log-table td:nth-child(1) { width: 60px; }
.log-table td:nth-child(2) { width: 80px; }
.log-table td:nth-child(3) { width: 80px; }
.log-table td:nth-child(4) { width: 80px; }
.log-table td:nth-child(5) { width: 80px; }

/* Stats blocks */

/* Stats card layout */

.stats-card {
  margin-top: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem 1.75rem;
  align-items: flex-start;
}

/* Laps full width on wider screens */
.stat-block-wide {
  grid-column: 1 / -1;
}

/* Individual stat blocks */
.stat-block {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Top label + main number */
.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.8;
}

.stat-main {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.stat-unit {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Meta lines inside each block */
.stat-meta {
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-line {
  display: flex;
  flex-wrap: wrap;           /* allow wrap so nothing spills */
  align-items: baseline;
  gap: 0.35rem;
}

.stat-line-label {
  font-size: 0.8rem;
  opacity: 0.85;
}

.stat-line-value {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Badges (targets / status) */
.stat-line-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.15);
  white-space: nowrap;       /* stays on one line but small enough now */
}

/* Optional: tweak good/low/high colors if you use them */
.stat-badge-good {
  background: rgba(0, 180, 120, 0.15);
  border-color: rgba(0, 180, 120, 0.6);
}

.stat-badge-low {
  background: rgba(240, 180, 0, 0.15);
  border-color: rgba(240, 180, 0, 0.6);
}

.stat-badge-high {
  background: rgba(220, 80, 80, 0.15);
  border-color: rgba(220, 80, 80, 0.6);
}

/* Mobile tightening */
@media (max-width: 700px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-block {
    padding: 0.9rem 1rem;
  }

  .stat-value {
    font-size: 1.4rem;
  }
}


/* Charts */

.chart-wrapper {
  margin-top: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  border: 1px solid var(--card-border);
  padding: 0.5rem;
  height: 260px;
  overflow: hidden;
  max-width: 100%;
}

.log-mood {
  font-weight: 700;
}

.mood-good { color: var(--catlap-green); }
.mood-ok   { color: var(--catlap-yellow); }
.mood-bad  { color: var(--catlap-pink); }

.crew-footer-note {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  color: var(--ink-muted);
}

.plan-table-wrapper {
  margin-top: 0.75rem;
}

/* Already defined above - removed duplicate */

/* =========================
   Mobile: pacing plan as cards
   ========================== */

@media (max-width: 700px) {
  /* Hide the table header on mobile */
  .card-clock-plan .plan-table thead {
    display: none;
  }

  /* Treat each row as a card - dark mode */
  .card-clock-plan .plan-table tr {
    display: block;
    margin-bottom: 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    padding: 0.6rem 0.75rem;
  }

  /* Extra pop for current lap - dark green background */
  .card-clock-plan .plan-table tr.plan-row-current {
    background: rgba(102, 195, 67, 0.25);
    border-color: rgba(102, 195, 67, 0.6);
    box-shadow: 0 0 10px rgba(102, 195, 67, 0.3);
  }

  .card-clock-plan .plan-table td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: none;
    padding: 0.2rem 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
  }

  /* Label on the left, value on the right */
  .card-clock-plan .plan-table td::before {
    content: attr(data-label);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    margin-right: 0.5rem;
  }

  /* Lap row title gets a bit more weight */
  .card-clock-plan .plan-table td:first-child {
    font-weight: 800;
    font-size: 0.95rem;
    color: #ffffff;
  }

  .card-clock-plan .plan-table td:first-child::before {
    color: var(--catlap-yellow);
  }

  /* Gear actions wrap nicely as chips */
  .card-clock-plan .plan-gear-cell {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .card-clock-plan .plan-gear-cell::before {
    margin-bottom: 0.15rem;
  }

  .card-clock-plan .gear-tag {
    margin: 0 0.2rem 0.2rem 0;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
  }

  /* Give the whole card section a bit more breathing room */
  .card-clock-plan .plan-table-wrapper {
    max-height: none;
    overflow-x: hidden;
  }
  
  /* Ensure table doesn't overflow on mobile */
  .card-clock-plan .plan-table {
    width: 100%;
    table-layout: fixed;
  }
  
  /* Make sure rows don't extend past container */
  .card-clock-plan .plan-table tr {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
}

.plan-controls {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.plan-controls button {
  font-size: 0.85rem;
  border-radius: 6px;
}

/* ========== LAP ALERT BANNERS ========== */
.lap-alert-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  animation: alert-pulse 0.5s ease-in-out 3;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.alert-2min {
  background: var(--catlap-orange);
  color: white;
}

.alert-30sec {
  background: var(--catlap-pink);
  color: white;
  animation: alert-pulse 0.3s ease-in-out 5;
}

.alert-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.alert-icon {
  font-size: 2rem;
}

.alert-text {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes alert-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

/* Alert toggle in settings */
.alert-toggle-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.alert-toggle-container label {
  font-size: 0.9rem;
}

.test-alert-btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  margin-left: 0.5rem;
  border-radius: 4px;
}

/* Mobile: bigger alert banner */
@media (max-width: 600px) {
  .lap-alert-banner {
    font-size: 1.25rem;
    padding: 0.75rem;
  }
  
  .alert-icon {
    font-size: 1.5rem;
  }
}

/* ========== CURRENT LAP BRIEF PANEL ========== */
.lap-brief {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid var(--catlap-yellow);
  margin-bottom: 1rem;
  overflow: hidden;
  max-width: 100%;
}

.lap-brief-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.lap-brief-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--catlap-yellow);
}

.lap-brief-countdown {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.countdown-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.countdown-time {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  color: var(--catlap-yellow);
  line-height: 1;
}

.countdown-time.urgent {
  color: var(--catlap-pink);
  animation: countdown-pulse 0.5s ease-in-out infinite;
}

@keyframes countdown-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.lap-brief-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
}

.lap-brief-section {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.brief-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.brief-speed {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.brief-speed.speed-slow { color: var(--catlap-green); }
.brief-speed.speed-average { color: var(--catlap-blue); }
.brief-speed.speed-fast { color: var(--catlap-orange); }

.brief-sublabel {
  font-size: 0.7rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* NOW section stats grid */
.now-section {
  min-width: 280px;
}

.now-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.now-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.now-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.2;
}

.now-stat-label {
  font-size: 0.65rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.2rem;
}

.mood-trend-indicator {
  font-size: 0.6rem;
  opacity: 0.8;
}

.now-stat-value.mood-up { color: var(--catlap-green); }
.now-stat-value.mood-down { color: var(--catlap-orange); }
.now-stat-value.mood-steady { color: var(--catlap-blue); }

@media (max-width: 600px) {
  .now-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .now-stat-value {
    font-size: 1rem;
  }

  .now-stat-label {
    font-size: 0.6rem;
  }
}

.brief-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.brief-action-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--catlap-pink);
  color: white;
  border-radius: 4px;
}

.brief-no-actions {
  font-size: 0.8rem;
  opacity: 0.6;
  font-style: italic;
}

/* Fuel targets */
.fuel-targets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.fuel-target {
  text-align: center;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.fuel-target-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--catlap-yellow);
}

.fuel-target-unit {
  font-size: 0.7rem;
  opacity: 0.7;
}

/* Crew checklist */
.checklist-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.2s;
}

.checklist-item:hover {
  background: rgba(255, 255, 255, 0.2);
}

.checklist-item input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
}

.checklist-item input[type="checkbox"]:checked + span {
  text-decoration: line-through;
  opacity: 0.5;
}

.checklist-item.highlight {
  background: var(--catlap-pink);
  font-weight: 600;
}

.checklist-reset-btn {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: white;
  opacity: 0.7;
}

.checklist-reset-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile: stack the grid */
@media (max-width: 800px) {
  .lap-brief-grid {
    grid-template-columns: 1fr;
  }
  
  .countdown-time {
    font-size: 2rem;
  }
  
  .fuel-targets-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .checklist-items {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 500px) {
  .fuel-targets-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .checklist-items {
    grid-template-columns: 1fr 1fr;
  }
}

/* ========== RACE DAY BUTTON ========== */
.race-day-btn {
  background: rgba(255, 107, 53, 0.25);
  color: #ffaa80;
  font-weight: 600;
  border: 1px solid rgba(255, 107, 53, 0.5);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}

.race-day-btn:hover {
  background: rgba(255, 107, 53, 0.35);
}

.race-day-btn:active {
  background: rgba(255, 107, 53, 0.4);
}

/* ========== UNDO BUTTON ========== */
.undo-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--ink-muted);
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
}

.undo-btn:hover {
  background: rgba(255, 100, 100, 0.2);
  border-color: rgba(255, 100, 100, 0.4);
  color: #ff6b6b;
}

/* ========== DUPLICATE WARNING ========== */
.duplicate-warning {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 180, 0, 0.15);
  border: 1px solid rgba(255, 180, 0, 0.4);
  border-radius: 8px;
  color: #ffcc00;
  font-size: 0.9rem;
}

.duplicate-warning strong {
  color: #ffdd44;
}

/* ========== UNDO BUTTON & DUPLICATE WARNING ========== */
.log-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.undo-btn {
  background: rgba(255, 107, 107, 0.2);
  border: 1px solid rgba(255, 107, 107, 0.5);
  color: #ff6b6b;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
}

.undo-btn:hover {
  background: rgba(255, 107, 107, 0.3);
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.undo-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.duplicate-warning {
  margin-top: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: rgba(255, 180, 0, 0.15);
  border: 1px solid rgba(255, 180, 0, 0.5);
  color: var(--catlap-yellow);
  font-size: 0.85rem;
}

/* ========== LAP HEALTH PANEL ========== */
.lap-health-container {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.lap-health-summary {
  width: 100%;
}

/* Health Panel - Main Container */
.health-panel {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: center;
}

.health-panel.health-empty {
  display: flex;
  justify-content: center;
  padding: 2rem;
}

.health-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.health-icon {
  font-size: 1.25rem;
}

/* Health Score Ring */
.health-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.health-score-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: conic-gradient(
    var(--ring-color, var(--catlap-green)) calc(var(--ring-pct, 80) * 3.6deg),
    rgba(255, 255, 255, 0.1) 0deg
  );
}

.health-score-ring::before {
  content: '';
  position: absolute;
  inset: 6px;
  background: var(--bg-card, #1a1a2e);
  border-radius: 50%;
}

.health-score-ring.good {
  --ring-color: var(--catlap-green);
}

.health-score-ring.warn {
  --ring-color: var(--catlap-orange);
}

.health-score-ring.bad {
  --ring-color: var(--catlap-pink);
}

.score-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.score-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink-bright);
}

.score-label {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* Status & Trend */
.health-status {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-icon.good {
  background: rgba(34, 197, 94, 0.2);
  color: var(--catlap-green);
}

.status-icon.warn {
  background: rgba(249, 115, 22, 0.2);
  color: var(--catlap-orange);
}

.status-icon.bad {
  background: rgba(236, 72, 153, 0.2);
  color: var(--catlap-pink);
}

.status-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.trend-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  font-weight: 500;
}

.trend-badge.trend-up {
  background: rgba(34, 197, 94, 0.15);
  color: var(--catlap-green);
}

.trend-badge.trend-down {
  background: rgba(236, 72, 153, 0.15);
  color: var(--catlap-pink);
}

.trend-badge.trend-flat {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-muted);
}

.streak-badge {
  font-size: 0.7rem;
  color: var(--catlap-orange);
  font-weight: 600;
}

.lap-range {
  font-size: 0.7rem;
  color: var(--ink-muted);
}

/* Sparkline Section */
.health-sparkline-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sparkline-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.health-sparkline {
  display: block;
}

/* Macro Progress Bars */
.health-macros {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 180px;
}

.health-macros .macro-bar {
  display: grid !important;
  grid-template-columns: 1fr 45px !important;
  grid-template-rows: auto auto !important;
  gap: 0.15rem 0.5rem !important;
  align-items: center !important;
  height: auto !important;
  width: auto !important;
  background: transparent !important;
  border-radius: 0 !important;
  transition: none !important;
}

.health-macros .macro-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  grid-column: 1;
  grid-row: 1;
}

.health-macros .macro-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.health-macros .macro-values {
  font-size: 0.65rem;
  color: var(--ink-muted);
}

.health-macros .macro-target {
  opacity: 0.6;
}

.health-macros .macro-progress-track {
  grid-column: 1;
  grid-row: 2;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.health-macros .macro-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.health-macros .macro-bar.good .macro-progress-fill {
  background: linear-gradient(90deg, var(--catlap-green) 0%, #6bc363 100%);
}

.health-macros .macro-bar.warn .macro-progress-fill {
  background: linear-gradient(90deg, var(--catlap-orange) 0%, #f4a543 100%);
}

.health-macros .macro-bar.bad .macro-progress-fill {
  background: linear-gradient(90deg, var(--catlap-pink) 0%, #ec4899 100%);
}

.health-macros .macro-progress-marker {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 10px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 1px;
  transform: translateX(-50%);
}

.health-macros .macro-pct {
  grid-column: 2;
  grid-row: 1 / 3;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: right;
}

.health-macros .macro-bar.good .macro-pct {
  color: var(--catlap-green);
}

.health-macros .macro-bar.warn .macro-pct {
  color: var(--catlap-orange);
}

.health-macros .macro-bar.bad .macro-pct {
  color: var(--catlap-pink);
}

/* Responsive - Stack on smaller screens */
@media (max-width: 900px) {
  .health-panel {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .health-main {
    justify-content: center;
  }

  .health-sparkline-section {
    border-left: none;
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 0;
  }

  .health-macros {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .health-score-ring {
    width: 60px;
    height: 60px;
  }

  .score-value {
    font-size: 1.25rem;
  }

  .health-macros {
    min-width: unset;
  }
}

/* ========== PACE COMPLIANCE LADDER ========== */
.pace-ladder-container {
  margin-top: 0.75rem;
  overflow: visible;
}

/* Allow tooltip to overflow the card */
.card:has(.pace-ladder-container) {
  overflow: visible;
}

.pace-ladder {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: visible;
}

.pace-ladder-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 28px;
  position: relative;
}

.pace-ladder-lap {
  width: 35px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-align: right;
  flex-shrink: 0;
}

.pace-ladder-bar {
  flex: 1;
  height: 100%;
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

/* Time scale background markers */
.pace-ladder-scale {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
}

/* The connecting line between plan and actual */
.pace-ladder-line {
  position: absolute;
  top: 50%;
  height: 3px;
  transform: translateY(-50%);
  border-radius: 2px;
}

.pace-line-on-time {
  background: var(--catlap-green);
}

.pace-line-small-miss {
  background: var(--catlap-orange);
}

.pace-line-big-miss {
  background: var(--catlap-pink);
}

/* Plan dot */
.pace-ladder-plan {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--catlap-blue);
  border: 2px solid rgba(255, 255, 255, 0.8);
  z-index: 2;
}

/* Actual dot */
.pace-ladder-actual {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--catlap-yellow);
  border: 2px solid rgba(0, 0, 0, 0.3);
  z-index: 3;
}

/* Time labels */
.pace-ladder-time {
  width: 45px;
  font-size: 0.7rem;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.pace-ladder-time.actual-time {
  color: var(--catlap-yellow);
  font-weight: 600;
}

/* No data state */
.pace-ladder-empty {
  padding: 1rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

/* Legend */
.pace-ladder-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.7rem;
  color: var(--ink-muted);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.25rem;
  vertical-align: middle;
}

.legend-plan {
  background: var(--catlap-blue);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.legend-actual {
  background: var(--catlap-yellow);
}

.legend-line {
  display: inline-block;
  width: 20px;
  height: 3px;
  border-radius: 2px;
  margin-right: 0.25rem;
  vertical-align: middle;
}

.legend-on-time {
  background: var(--catlap-green);
}

.legend-small-miss {
  background: var(--catlap-orange);
}

.legend-big-miss {
  background: var(--catlap-pink);
}

/* Tooltip - positioned to the right to avoid clipping */
.pace-ladder-row[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 45px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.95);
  color: white;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.pace-ladder-row:hover[data-tooltip]::after {
  opacity: 1;
}

/* Mobile */
@media (max-width: 500px) {
  .pace-ladder-lap {
    width: 28px;
    font-size: 0.65rem;
  }
  
  .pace-ladder-time {
    width: 38px;
    font-size: 0.6rem;
  }
}

/* ========== GLOBAL MOBILE OVERFLOW FIX ========== */
@media (max-width: 768px) {
  * {
    max-width: 100vw !important;
  }
  
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
  }
  
  .crew-shell,
  .card,
  .lap-brief,
  table,
  .plan-table-wrapper,
  .chart-wrapper,
  .inline-fields,
  form {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  
  /* Allow log-table-wrapper to scroll horizontally */
  .log-table-wrapper {
    max-width: 100% !important;
    overflow-x: auto !important;
    box-sizing: border-box !important;
  }
  
  img, canvas, svg {
    max-width: 100%;
    height: auto;
  }
  
  /* Prevent any element from causing horizontal scroll - except table wrappers */
  .card > *:not(.log-table-wrapper),
  .lap-brief > *:not(.log-table-wrapper) {
    max-width: 100%;
    overflow-x: hidden;
  }
}


/* ========== PAGE NAVIGATION ========== */
.page-nav {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, transform 0.1s;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.nav-btn:active {
  transform: translateY(0);
}

/* ========== MOBILE TABLE FIX ========== */
@media (max-width: 600px) {
  /* Make tables horizontally scrollable on mobile */
  .log-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Prevent table from squishing - set minimum widths */
  .log-table-wrapper table {
    min-width: 600px;
    table-layout: auto;
  }
  
  /* Session log table (fewer columns) */
  .log-form + .log-summary + .log-table-wrapper table {
    min-width: 500px;
  }
  
  /* Make sure cells don't wrap awkwardly */
  .log-table-wrapper th,
  .log-table-wrapper td {
    white-space: nowrap;
    padding: 0.4rem 0.6rem;
  }
  
  /* Hint that table is scrollable */
  .log-table-wrapper::after {
    content: '← scroll →';
    display: block;
    text-align: center;
    font-size: 0.7rem;
    color: var(--ink-muted);
    padding: 0.25rem;
    opacity: 0.6;
  }
}

/* ========== QUICK WIN #8: BIGGER TAP TARGETS ========== */
#logSubmitBtn {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  min-height: 56px;
  min-width: 160px;
  border-radius: 8px;
  background: rgba(0, 200, 83, 0.25);
  border: 2px solid rgba(0, 200, 83, 0.5);
  color: #66ff88;
}

#logSubmitBtn:hover {
  background: rgba(0, 200, 83, 0.35);
}

#logSubmitBtn:active {
  background: rgba(0, 200, 83, 0.4);
}

/* Undo button slightly bigger too */
#undoLastBtn {
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  min-height: 48px;
  border-radius: 8px;
}

/* Mobile: even bigger */
@media (max-width: 600px) {
  #logSubmitBtn {
    width: 100%;
    padding: 1.25rem 2rem;
    font-size: 1.2rem;
    min-height: 64px;
  }
  
  #undoLastBtn {
    width: 100%;
    margin-top: 0.5rem;
  }
  
  .log-actions {
    flex-direction: column;
  }
}

/* ========== QUICK WIN #9: LAST LAP SUMMARY ========== */
.last-lap-confirmation {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 200, 83, 0.15);
  border: 1px solid rgba(0, 200, 83, 0.3);
  border-radius: 8px;
  font-size: 0.95rem;
  color: #a0ffb0;
  display: none;
}

.last-lap-confirmation.show {
  display: block;
  animation: slideIn 0.3s ease-out;
}

.last-lap-confirmation strong {
  color: #66ff88;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== QUICK WIN #7: PRINT SUMMARY ========== */
.print-btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--ink-soft);
}

.print-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Print styles */
@media print {
  /* Hide non-essential elements */
  .page-nav,
  .chart-wrapper,
  canvas,
  button,
  .nav-btn,
  .inline-fields,
  .pace-ladder-container,
  .intake-legend {
    display: none !important;
  }
  
  /* Reset dark mode for printing */
  body {
    background: white !important;
    color: black !important;
  }
  
  .crew-shell {
    max-width: 100% !important;
    padding: 0.5in !important;
  }
  
  .card {
    background: white !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 1rem !important;
  }
  
  .card h2 {
    color: black !important;
    border-bottom: 2px solid black;
    padding-bottom: 0.25rem;
  }
  
  .stat-value {
    color: black !important;
  }
  
  .stat-label,
  .stat-line-label {
    color: #333 !important;
  }
  
  .stat-line-value {
    color: black !important;
  }
  
  .stat-line-badge {
    background: #eee !important;
    color: #333 !important;
  }
  
  .crew-tag {
    background: black !important;
    color: white !important;
  }
  
  .crew-title {
    color: black !important;
  }
  
  /* Show print timestamp */
  .stats-card::after {
    content: "Printed: " attr(data-print-time);
    display: block;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #666;
  }
}

/* ========== VUE TRANSITIONS ========== */

/* Fade transition - for general content */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.25s ease;
}
.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

/* Fade-slide - for content that slides up while fading */
.fade-slide-enter-active,
.fade-slide-leave-active {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.fade-slide-enter-from {
  opacity: 0;
  transform: translateY(20px);
}
.fade-slide-leave-to {
  opacity: 0;
  transform: translateY(-10px);
}

/* Slide-down - for dropdowns, alerts */
.slide-down-enter-active,
.slide-down-leave-active {
  transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.2s ease;
}
.slide-down-enter-from,
.slide-down-leave-to {
  opacity: 0;
  transform: translateY(-10px);
}

/* Pop - for modals, confirmations */
.pop-enter-active {
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.pop-leave-active {
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.pop-enter-from {
  opacity: 0;
  transform: scale(0.9);
}
.pop-leave-to {
  opacity: 0;
  transform: scale(0.95);
}

/* Slide-right - for toasts, notifications */
.slide-right-enter-active,
.slide-right-leave-active {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.slide-right-enter-from {
  opacity: 0;
  transform: translateX(100%);
}
.slide-right-leave-to {
  opacity: 0;
  transform: translateX(100%);
}

/* Stagger - for lists (use with transition-group) */
.stagger-enter-active {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.stagger-leave-active {
  transition: opacity 0.2s ease, transform 0.2s ease;
  position: absolute;
}
.stagger-enter-from {
  opacity: 0;
  transform: translateX(-20px);
}
.stagger-leave-to {
  opacity: 0;
  transform: translateX(20px);
}
.stagger-move {
  transition: transform 0.3s ease;
}

/* Card entrance - for dashboard cards */
.card-enter-active {
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.card-leave-active {
  transition: opacity 0.2s ease;
}
.card-enter-from {
  opacity: 0;
  transform: translateY(30px);
}
.card-leave-to {
  opacity: 0;
}

/* ========== TOAST NOTIFICATION SYSTEM ========== */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 380px;
}

.toast {
  background: var(--card-bg-solid);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  backdrop-filter: blur(10px);
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.toast-message {
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0.25rem;
  margin: -0.25rem -0.25rem -0.25rem 0;
  font-size: 1rem;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.toast-close:hover {
  opacity: 1;
}

/* Toast variants */
.toast.toast-success {
  border-left: 3px solid var(--catlap-green);
}
.toast.toast-success .toast-icon {
  color: var(--catlap-green);
}

.toast.toast-warning {
  border-left: 3px solid var(--catlap-orange);
}
.toast.toast-warning .toast-icon {
  color: var(--catlap-orange);
}

.toast.toast-error {
  border-left: 3px solid var(--catlap-pink);
}
.toast.toast-error .toast-icon {
  color: var(--catlap-pink);
}

.toast.toast-info {
  border-left: 3px solid var(--catlap-blue);
}
.toast.toast-info .toast-icon {
  color: var(--catlap-blue);
}

/* ========== LOADING STATES ========== */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1rem;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--card-border);
  border-top-color: var(--catlap-yellow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

/* Skeleton loading placeholders */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--card-bg) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    var(--card-bg) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 6px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-text.short {
  width: 40%;
}

.skeleton-text.medium {
  width: 70%;
}

.skeleton-heading {
  height: 1.5rem;
  width: 50%;
  margin-bottom: 1rem;
}

/* ========== SUCCESS ANIMATION ========== */
.success-checkmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--catlap-green);
  color: white;
  font-size: 0.875rem;
  animation: success-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes success-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Button loading state */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1rem;
  height: 1rem;
  margin: -0.5rem 0 0 -0.5rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  color: white;
}

/* ========== MICRO-INTERACTIONS ========== */

/* Pulse animation for attention */
.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Shake animation for errors */
.shake {
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* Bounce for success */
.bounce {
  animation: bounce 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
  60% { transform: translateY(-4px); }
}

/* Glow effect for important elements */
.glow-success {
  box-shadow: 0 0 20px rgba(102, 195, 67, 0.4);
  transition: box-shadow 0.3s ease;
}

.glow-warning {
  box-shadow: 0 0 20px rgba(255, 123, 37, 0.4);
  transition: box-shadow 0.3s ease;
}

.glow-error {
  box-shadow: 0 0 20px rgba(244, 81, 157, 0.4);
  transition: box-shadow 0.3s ease;
}

/* ========== CARD HOVER EFFECTS ========== */
.card-interactive {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card-interactive:active {
  transform: translateY(0);
}

/* Utilities */
.hidden { display: none !important; }

  /* Layout utilities for common inline patterns */
  .u-flex { display: flex; }
  .u-flex-wrap { flex-wrap: wrap; }
  .u-gap-05 { gap: 0.5rem; }
  .u-gap-1 { gap: 1rem; }
  .u-gap-15 { gap: 1.5rem; }
  .u-justify-between { justify-content: space-between; }
  .u-align-center { align-items: center; }
  .u-mb-05 { margin-bottom: 0.5rem; }
  .u-mt-05 { margin-top: 0.5rem; }
  .u-mt-025 { margin-top: 0.25rem; }
  .u-fs-085 { font-size: 0.85rem; }
  .u-opacity-08 { opacity: 0.8; }
  .u-grid-auto-fit { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
  .u-mb-15 { margin-bottom: 1.5rem; }
  .muted-small { color: var(--ink-muted); font-size: 0.85rem; }
  .screen-nav { background: rgba(0,0,0,0.5); padding: 0.4rem 1rem; display: flex; align-items: center; justify-content: space-between; font-size: 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.1); }

/* ========== OFFLINE INDICATOR ========== */
.offline-indicator {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1000;
  max-width: 400px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.status-badge:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.queue-badge {
  background: var(--catlap-yellow);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  min-width: 1.2rem;
  text-align: center;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.status-online .status-dot {
  background: var(--catlap-green);
  box-shadow: 0 0 8px var(--catlap-green);
}

.status-offline .status-dot {
  background: var(--ink-muted);
  animation: none;
}

.status-syncing .status-dot {
  background: var(--catlap-blue);
  animation: pulse 1s ease-in-out infinite;
}

.status-pending .status-dot {
  background: var(--catlap-yellow);
}

.status-online .status-text {
  color: var(--catlap-green);
}

.status-offline .status-text {
  color: var(--ink-muted);
}

.status-syncing .status-text {
  color: var(--catlap-blue);
}

.status-pending .status-text {
  color: var(--catlap-yellow);
}

.status-details {
  margin-top: 0.75rem;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.detail-item:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-icon {
  flex-shrink: 0;
  font-size: 1rem;
}

.offline-message {
  color: var(--ink-muted);
}

.queue-message {
  color: var(--catlap-yellow);
}

.error-message {
  color: var(--catlap-pink);
}

.success-message {
  color: var(--catlap-green);
}

.sync-actions {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--catlap-blue);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  justify-content: center;
}

.sync-btn:hover:not(:disabled) {
  background: var(--catlap-blue-bright, #5bb8e8);
  transform: translateY(-1px);
}

.sync-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sync-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

.fade-enter-active, .fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from, .fade-leave-to {
  opacity: 0;
}

@media (max-width: 768px) {
  .offline-indicator {
    bottom: 0.5rem;
    right: 0.5rem;
    left: 0.5rem;
    max-width: none;
  }

  .status-details {
    font-size: 0.8rem;
  }
}

/* ========== EXPORT BUTTON ========== */
.export-button-wrapper {
  position: relative;
  display: inline-block;
}

.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--catlap-yellow);
  transform: translateY(-1px);
}

.export-btn-primary {
  background: linear-gradient(135deg, var(--catlap-purple), var(--catlap-blue));
  border-color: transparent;
  color: white;
}

.export-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}

.export-btn-minimal {
  background: transparent;
  border: none;
  padding: 0.25rem 0.5rem;
}

.export-btn-disabled,
.export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.export-icon {
  font-size: 1rem;
}

.export-arrow {
  font-size: 0.7rem;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.export-btn:hover .export-arrow {
  transform: translateY(2px);
}

.export-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 280px;
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.5rem;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
}

.export-dropdown-header {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 0.25rem;
}

.export-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-option:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.export-option:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.option-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.option-text {
  flex: 1;
}

.option-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.1rem;
}

.option-desc {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.dropdown-fade-enter-active,
.dropdown-fade-leave-active {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dropdown-fade-enter-from {
  opacity: 0;
  transform: translateY(-8px);
}

.dropdown-fade-leave-to {
  opacity: 0;
  transform: translateY(-4px);
}

@media (max-width: 768px) {
  .export-dropdown {
    left: 0;
    right: auto;
    min-width: 240px;
  }
}

/* ========== TEMPLATE PICKER ========== */
.template-picker {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem;
}

.template-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.template-picker-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.template-icon {
  font-size: 1.2rem;
}

.template-toggle {
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--ink-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.template-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--catlap-yellow);
  color: var(--ink-soft);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  max-height: 300px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.template-grid.expanded {
  max-height: 1000px;
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.template-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--catlap-yellow);
  opacity: 1;
  transition: width 0.2s ease;
}

.template-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.template-card:hover::before {
  width: 6px;
}

.template-card:active {
  transform: translateY(0);
}

/* Template-specific colors */
.template-standard::before {
  background: var(--catlap-yellow);
}
.template-standard .template-card-name {
  color: var(--catlap-yellow);
}

.template-highcarb::before {
  background: var(--catlap-orange);
}
.template-highcarb .template-card-name {
  color: var(--catlap-orange);
}

.template-recovery::before {
  background: var(--catlap-blue);
}
.template-recovery .template-card-name {
  color: var(--catlap-blue);
}

.template-caffeine::before {
  background: var(--catlap-pink);
}
.template-caffeine .template-card-name {
  color: var(--catlap-pink);
}

.template-minimal::before {
  background: var(--catlap-green);
}
.template-minimal .template-card-name {
  color: var(--catlap-green);
}

.template-custom::before {
  background: var(--catlap-purple);
}
.template-custom .template-card-name {
  color: var(--catlap-purple);
}

.template-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.template-card-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.template-card-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.template-value {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--ink-muted);
  font-weight: 600;
}

.template-card-desc {
  font-size: 0.75rem;
  color: var(--ink-muted);
  line-height: 1.3;
}

.template-picker-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.template-picker-footer small {
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.template-picker.compact {
  padding: 0.5rem;
  background: transparent;
  border: none;
}

.template-picker.compact .template-grid {
  gap: 0.5rem;
  max-height: none;
}

.template-picker.compact .template-card {
  padding: 0.75rem;
}

@media (max-width: 768px) {
  .template-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
  }

  .template-card {
    padding: 0.75rem;
  }

  .template-card-name {
    font-size: 0.85rem;
  }
}

/* ========== PWA INSTALL PROMPT ========== */
.install-prompt {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  padding: 0 1rem 1rem 1rem;
}

.install-prompt-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(15, 15, 26, 0.98), rgba(26, 26, 46, 0.98));
  border: 1px solid var(--catlap-yellow);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.install-prompt-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.install-prompt-text {
  flex: 1;
}

.install-prompt-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--catlap-yellow);
  margin-bottom: 0.25rem;
}

.install-prompt-desc {
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.3;
}

.install-prompt-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.install-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.install-btn-primary {
  background: var(--catlap-yellow);
  color: #000;
}

.install-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(254, 241, 0, 0.4);
}

.install-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink-muted);
  border: 1px solid var(--card-border);
}

.install-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--ink-soft);
}

.slide-up-enter-active,
.slide-up-leave-active {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.slide-up-enter-from {
  transform: translateY(100%);
  opacity: 0;
}

.slide-up-leave-to {
  transform: translateY(100%);
  opacity: 0;
}

@media (max-width: 768px) {
  .install-prompt-content {
    flex-wrap: wrap;
    padding: 0.75rem;
  }

  .install-prompt-actions {
    width: 100%;
    justify-content: stretch;
  }

  .install-btn {
    flex: 1;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .install-prompt-content {
    gap: 0.75rem;
  }

  .install-prompt-icon {
    font-size: 1.5rem;
  }

  .install-prompt-title {
    font-size: 0.9rem;
  }

  .install-prompt-desc {
    font-size: 0.75rem;
  }
}
/* ========== PLAN REQUIRED OVERLAY ========== */
.plan-required-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background: var(--page-bg);
}

.plan-required-content {
  text-align: center;
  max-width: 400px;
}

.plan-required-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
}

.plan-required-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--catlap-yellow);
}

.plan-required-text {
  color: var(--ink-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.plan-required-btn {
  display: inline-block;
  background: var(--catlap-yellow);
  color: #000;
  padding: 0.875rem 2rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.plan-required-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(254, 241, 0, 0.25);
}

/* ========== PROFILE TIP BANNER ========== */
.profile-tip-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin: 0 1rem 1rem 1rem;
  font-size: 0.875rem;
}

.profile-tip-banner .tip-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.profile-tip-banner .tip-icon {
  font-size: 1rem;
}

.profile-tip-banner a {
  color: #60a5fa;
  text-decoration: underline;
}

.profile-tip-banner a:hover {
  color: #93c5fd;
}

.profile-tip-banner .dismiss-btn {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.profile-tip-banner .dismiss-btn:hover {
  opacity: 1;
}

@media (max-width: 600px) {
  .profile-tip-banner {
    margin: 0.5rem;
    font-size: 0.8rem;
    padding: 0.6rem 0.75rem;
  }
}

/* ============================================================
   USER AVATAR COMPONENT
   ============================================================ */

.user-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-elevated, #2a2a2a);
  color: var(--text-secondary, #a0a0a0);
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
  user-select: none;
}

.user-avatar--editable {
  cursor: pointer;
  transition: transform var(--transition-fast, 0.15s) ease;
}

.user-avatar--editable:hover {
  transform: scale(1.05);
}

.user-avatar--editable:focus {
  outline: 2px solid var(--catlap-yellow, #f5c518);
  outline-offset: 2px;
}

.user-avatar__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar__initials {
  font-family: inherit;
  letter-spacing: 0.02em;
}

.user-avatar__edit-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity var(--transition-fast, 0.15s) ease;
  color: white;
}

.user-avatar--editable:hover .user-avatar__edit-overlay,
.user-avatar--editable:focus .user-avatar__edit-overlay {
  opacity: 1;
}

/* ============================================================
   IMAGE CROPPER COMPONENT
   ============================================================ */

.image-cropper-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  padding: 1rem;
}

.image-cropper {
  background: var(--surface-base, #1a1a1a);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg, 0 10px 40px rgba(0, 0, 0, 0.5));
}

.image-cropper__header {
  text-align: center;
  margin-bottom: 1rem;
}

.image-cropper__header h3 {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
  color: var(--text-primary, #ffffff);
}

.image-cropper__header p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary, #a0a0a0);
}

.image-cropper__viewport {
  position: relative;
  margin: 0 auto 1rem;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
  cursor: grab;
  touch-action: none;
}

.image-cropper__viewport:active {
  cursor: grabbing;
}

.image-cropper__image {
  /* Don't constrain dimensions - let scale transform control size */
  pointer-events: none;
  will-change: transform;
  /* Ensure image displays at its natural size, scaled by transform */
  max-width: none !important;
  max-height: none !important;
  width: auto !important;
  height: auto !important;
}

.image-cropper__image--dragging {
  transition: none;
}

.image-cropper__mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Radial gradient creates the darkened corners outside the circle */
  background: radial-gradient(
    circle at center,
    transparent 45%,
    rgba(0, 0, 0, 0.7) 45%
  );
}

.image-cropper__circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 90%;
  height: 90%;
  transform: translate(-50%, -50%);
  border: 2px dashed rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  pointer-events: none;
}

.image-cropper__zoom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0 0.5rem;
}

.image-cropper__zoom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: var(--surface-elevated, #2a2a2a);
  color: var(--text-secondary, #a0a0a0);
  cursor: pointer;
  transition: background var(--transition-fast, 0.15s) ease, color var(--transition-fast, 0.15s) ease;
}

.image-cropper__zoom-btn:hover {
  background: var(--surface-hover, #3a3a3a);
  color: var(--text-primary, #ffffff);
}

.image-cropper__slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--surface-elevated, #2a2a2a);
  border-radius: 2px;
  cursor: pointer;
}

.image-cropper__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--catlap-yellow, #f5c518);
  cursor: pointer;
}

.image-cropper__slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: var(--catlap-yellow, #f5c518);
  cursor: pointer;
}

.image-cropper__presets {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.image-cropper__preset-btn {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border-color, #333);
  border-radius: 6px;
  background: var(--surface-elevated, #2a2a2a);
  color: var(--text-secondary, #a0a0a0);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background var(--transition-fast, 0.15s) ease, color var(--transition-fast, 0.15s) ease, border-color var(--transition-fast, 0.15s) ease;
}

.image-cropper__preset-btn:hover {
  background: var(--surface-hover, #3a3a3a);
  color: var(--text-primary, #ffffff);
  border-color: var(--catlap-yellow, #f5c518);
}

.image-cropper__actions {
  display: flex;
  gap: 0.75rem;
}

.image-cropper__btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast, 0.15s) ease, opacity var(--transition-fast, 0.15s) ease;
}

.image-cropper__btn--secondary {
  background: var(--surface-elevated, #2a2a2a);
  color: var(--text-secondary, #a0a0a0);
}

.image-cropper__btn--secondary:hover {
  background: var(--surface-hover, #3a3a3a);
  color: var(--text-primary, #ffffff);
}

.image-cropper__btn--primary {
  background: var(--catlap-yellow, #f5c518);
  color: #000;
}

.image-cropper__btn--primary:hover {
  background: #ffd43b;
}

.image-cropper__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   PHOTO UPLOAD SECTION
   ============================================================ */

.photo-upload-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.photo-upload-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.photo-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border-subtle, #333);
  border-radius: 6px;
  background: var(--surface-elevated, #2a2a2a);
  color: var(--text-secondary, #a0a0a0);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background var(--transition-fast, 0.15s) ease,
              border-color var(--transition-fast, 0.15s) ease,
              color var(--transition-fast, 0.15s) ease;
}

.photo-upload-btn:hover {
  background: var(--surface-hover, #3a3a3a);
  border-color: var(--border-hover, #444);
  color: var(--text-primary, #ffffff);
}

.photo-upload-btn--remove {
  border-color: #552222;
  color: #ff6b6b;
}

.photo-upload-btn--remove:hover {
  background: #331111;
  border-color: #662222;
}

.photo-upload-hint {
  font-size: 0.75rem;
  color: var(--text-tertiary, #666);
}

/* ============================================================
   BANNER UPLOAD SECTION
   ============================================================ */

.banner-upload-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0;
}

.banner-preview {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 4 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
}

.banner-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-preview--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.banner-preview__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.banner-preview__placeholder svg {
  opacity: 0.5;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .image-cropper {
    padding: 1rem;
  }

  .image-cropper__header h3 {
    font-size: 1rem;
  }

  .photo-upload-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .banner-preview {
    max-width: 100%;
  }
}
