/* ------------------------------------------------------------
   Staging banner
------------------------------------------------------------ */
.staging-banner,
.offline-banner {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 3px 14px;
  border-radius: 10px;
  opacity: 0.85;
  pointer-events: none;
  text-transform: uppercase;
}
.staging-banner {
  background: #e67e22;
  color: #fff;
}
.offline-banner {
  background: #e74c3c;
  color: #fff;
  bottom: 88px;
}

/* ------------------------------------------------------------
   Dark theme defaults
------------------------------------------------------------ */
:root {
  --bg: #0b0b10;
  --bg-alt: #14141c;
  --border: #2a2a3a;
  --text: #f7f7ff;
  --muted: #a3a3c2;

  --green: #2ecc71;
  --blue: #3498db;
  --red: #e74c3c;

  --radius-lg: 18px;
  --radius-xl: 24px;
}

/* ------------------------------------------------------------
   Light theme overrides
------------------------------------------------------------ */
body.theme-light {
  --bg: #f4f4f8;
  --bg-alt: #ffffff;
  --border: #d0d0e0;
  --text: #15151f;
  --muted: #666688;

  --green: #1c8b4f;
  --blue: #1f6fb3;
  --red: #c0392b;
}

/* ------------------------------------------------------------
   W&B out of envelope theme overrides
------------------------------------------------------------ */

body.theme-dark.wb-alert {
  --bg: #200000;
  --bg-alt: #360000;
  --border: #883333;
}

body.theme-light.wb-alert {
  --bg: #ffecec;
  --bg-alt: #fff5f5;
  --border: #ffb3b3;
}


/* ============================================================
   GLOBAL FORM STYLES
   Reusable form components across the entire app
============================================================ */

/* Form container */
.app-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Form grid layouts */
.form-grid {
  display: grid;
  gap: 12px;
}
.form-grid-1 { grid-template-columns: 1fr; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Form label */
.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 4px;
}

/* Touch-friendly input */
.form-input {
  width: 100%;
  font-size: 1.1rem;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

/* Remove spinner arrows on numeric inputs */
.form-input[type="number"]::-webkit-outer-spin-button,
.form-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.form-input[type="number"] {
  -moz-appearance: textfield;
}

/* Select dropdowns */
select.form-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Textarea */
.form-textarea {
  width: 100%;
  font-size: 1.1rem;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.5;
  min-height: 100px;
  resize: vertical;
}

/* Legacy alias for backwards compatibility */
.movement-input-lg {
  width: 100%;
  font-size: 1.1rem;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  box-sizing: border-box;
}

/* Form toggle switches */
.form-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.form-toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
}
.form-toggle-label input[type="checkbox"] {
  display: none;
}
.toggle-slider {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--border);
  border-radius: 13px;
  transition: background 0.2s ease;
}
.toggle-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--bg);
  border-radius: 50%;
  transition: transform 0.2s ease;
}
.form-toggle-label input[type="checkbox"]:checked + .toggle-slider {
  background: var(--tiger-primary);
}
.form-toggle-label input[type="checkbox"]:checked + .toggle-slider::after {
  transform: translateX(22px);
}
.toggle-text {
  flex: 1;
}

/* Date inputs - use system font, not monospace */
input[type="date"],
input[type="datetime-local"] {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
  cursor: pointer;
}

body.theme-light input[type="date"],
body.theme-light input[type="datetime-local"] {
  color-scheme: light;
}

/* Make entire date input clickable to open picker */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.2) !important;
  opacity: 0.9;
  cursor: pointer;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

/* Revert icon filter for light theme */
body.theme-light input[type="date"]::-webkit-calendar-picker-indicator,
body.theme-light input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: none !important;
}

/* Position relative for the picker indicator positioning */
input[type="date"],
input[type="datetime-local"] {
  position: relative;
}


/* ------------------------------------------------------------
   Global resets
------------------------------------------------------------ */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

/* ------------------------------------------------------------
   App layout
------------------------------------------------------------ */
.app {
  width: 100%;
  max-width: 900px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 8px) 8px
    env(safe-area-inset-bottom, 8px);
}

/* ------------------------------------------------------------
   Header
------------------------------------------------------------ */
.app-header {
  padding: 8px 8px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-header-main {
  display: flex;
  flex-direction: column;
  text-align: center;
  flex: 1;
}

.app-header h1 {
  font-size: 1.3rem;
  margin: 0;
}

.app-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 2px;
}

.app-header-actions {
  display: flex;
  gap: 6px;
}

/* Header icon buttons */
.header-icon-button {
  background: transparent;
  border-radius: 16px;
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.header-icon-button:active {
  transform: scale(0.95);
}

/* ------------------------------------------------------------
   Main content
------------------------------------------------------------ */
.view-container {
  flex: 1;
  margin-top: 4px;
  margin-bottom: 8px;
  padding: 8px 0;
  overflow-y: auto;
}

/* ------------------------------------------------------------
   Footer
------------------------------------------------------------ */
.app-footer {
  display: flex;
  justify-content: center;
  padding: 8px 0 0;
}

.footer-button {
  flex: 1;
  max-width: 280px;
}

/* ------------------------------------------------------------
   Buttons
------------------------------------------------------------ */
button {
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  background: #2c2c40;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

body.theme-light button:not(.header-icon-button):not(.tiger-btn) {
  background: #e4e4f0;
  color: #15151f;
}

button:active {
  transform: scale(0.98);
}

/* Hide scrollbars for main content */
.view-container {
  scrollbar-width: none;       /* Firefox */
}

.view-container::-webkit-scrollbar {
  width: 0;
  height: 0;
}


/* ------------------------------------------------------------
   TOC — Solid color cards
------------------------------------------------------------ */
.toc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 4px 12px;
}

/* Reset All Checklists button */
.toc-reset-container {
  padding: 24px 4px 12px;
  display: flex;
  justify-content: center;
}

.toc-reset-btn {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 10px 24px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  transition: color 200ms, border-color 200ms;
}

.toc-reset-btn .toc-reset-progress {
  position: absolute;
  inset: 0;
  background: rgba(231, 76, 60, 0.35);
  transform: scaleX(0);
  transform-origin: left;
}

.toc-reset-btn.holding .toc-reset-progress {
  transform: scaleX(1);
  transition: transform 1000ms linear;
}

.toc-reset-btn.holding {
  color: #e74c3c;
  border-color: rgba(231, 76, 60, 0.5);
}

.toc-reset-btn.confirmed {
  color: #2ecc71;
  border-color: rgba(46, 204, 113, 0.5);
}

.toc-reset-btn .toc-reset-label {
  position: relative;
  z-index: 1;
}

.toc-card {
  border-radius: var(--radius-xl);
  padding: 14px 18px;
  min-height: 70px;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: white;
  font-weight: 600;
  transition: transform 120ms ease-out;
}

.toc-card:active {
  transform: scale(0.97);
}

.type-preflight,
.type-postflight {
  background: rgba(46, 204, 113, 0.18);
  border: 1px solid rgba(46, 204, 113, 0.35);
}

body.theme-dark .type-preflight,
body.theme-dark .type-postflight {
  background: rgba(46, 204, 113, 0.24);
}

body.theme-light .type-preflight,
body.theme-light .type-postflight {
  background: rgba(46, 204, 113, 0.21);
}

.toc-card.type-preflight:active,
.toc-card.type-postflight:active {
  background: rgba(46, 204, 113, 0.32);
}

.type-inflight {
  background: rgba(52, 152, 219, 0.18);
  border: 1px solid rgba(52, 152, 219, 0.35);
}

body.theme-dark .type-inflight {
  background: rgba(52, 152, 219, 0.24);
}

body.theme-light .type-inflight {
  background: rgba(52, 152, 219, 0.21);
}

.toc-card.type-inflight:active {
  background: rgba(52, 152, 219, 0.32);
}

.type-emergency {
  background: rgba(255, 50, 50, 0.18);
  border: 1px solid rgba(255, 80, 80, 0.35);
}

body.theme-dark .type-emergency {
  background: rgba(255, 60, 60, 0.24);
}

body.theme-light .type-emergency {
  background: rgba(255, 70, 70, 0.21);
}

.toc-card.type-emergency:active {
  background: rgba(255, 50, 50, 0.32);
}

.toc-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.toc-type {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* ------------------------------------------------------------
   Main Menu – Button Tiles
------------------------------------------------------------ */
/* Aircraft State Summary */
.aircraft-state-summary {
  padding: 16px 20px;
  margin-bottom: 0;
}

.aircraft-state-loading {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 12px;
}

.aircraft-state-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.aircraft-state-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.aircraft-state-item.aircraft-state-fuel-tank {
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.aircraft-state-item.aircraft-state-fuel-tank:first-of-type {
  border-top: 1px solid var(--border);
}

.aircraft-state-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.aircraft-state-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.aircraft-state-fuel-value {
  color: var(--green, #4ade80);
}

.aircraft-state-fuel-total {
  grid-column: span 2;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
  padding-top: 8px;
}

.aircraft-state-cache-note {
  text-align: center;
  font-size: 11px;
  color: #e67e22;
  opacity: 0.8;
  padding-top: 6px;
  font-style: italic;
}

/* Toast notification */
.app-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(46, 204, 113, 0.95);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  text-align: center;
  max-width: 90vw;
}
.app-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.aircraft-state-error {
  display: flex;
  justify-content: center;
  padding: 16px;
}

.aircraft-state-error-msg {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Loading state for aircraft state values */
.aircraft-state-loading-value {
  opacity: 0.4;
  animation: aircraft-state-pulse 1.5s ease-in-out infinite;
}

@keyframes aircraft-state-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.2; }
}

.main-menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

/* Stack into 1 column on small screens */
@media (max-width: 500px) {
  .main-menu {
    grid-template-columns: 1fr;
  }
}

.main-menu-card {
  position: relative;
  border-radius: 16px;
  padding: 20px;
  background: rgba(44, 44, 64, 0.6);
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: center;
  user-select: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  transition:
    transform 120ms ease-out,
    box-shadow 120ms ease-out,
    background 120ms ease-out,
    border-color 120ms ease-out;
}

.main-menu-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.main-menu-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  background: rgba(52, 52, 84, 0.7);
}

.main-menu-card:active {
  transform: scale(0.97);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

/* Title + subtitle styling */
.main-menu-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.main-menu-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  opacity: 0.8;
}

/* Dark mode */
body.theme-dark .main-menu-card {
  background: rgba(44, 44, 64, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Light mode */
body.theme-light .main-menu-card {
  background: rgba(255, 255, 255, 0.7);
  border-color: #d0d0e0;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

body.theme-light .main-menu-card:hover {
  background: rgba(255, 255, 255, 0.85);
}

body.theme-light .main-menu-subtitle {
  color: #666688;
}

/* Emergency tile styling (red emphasis) */
.main-menu-card.menu-emergency {
  background: rgba(255, 50, 50, 0.18);
  border: 1px solid rgba(255, 80, 80, 0.35);
}

body.theme-dark .main-menu-card.menu-emergency {
  background: rgba(255, 60, 60, 0.24);
}

body.theme-light .main-menu-card.menu-emergency {
  background: rgba(255, 70, 70, 0.21);
}

.main-menu-card.menu-emergency:hover,
.main-menu-card.menu-emergency:active {
  background: rgba(255, 50, 50, 0.32);
  transform: translateY(-3px);
}

/* ------------------------------------------------------------
   Checklist page
------------------------------------------------------------ */
.checklist-card {
  border-radius: var(--radius-xl);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 10px 14px;
  margin: 0 4px 8px;
}

/* Slide animations */
.page-enter-from-right {
  animation: slideInFromRight 200ms ease-out;
}

.page-enter-from-left {
  animation: slideInFromLeft 200ms ease-out;
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.checklist-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}

.checklist-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.checklist-type-preflight .checklist-title,
.checklist-type-postflight .checklist-title {
  color: var(--green);
}

.checklist-type-inflight .checklist-title {
  color: var(--blue);
}

.checklist-type-emergency .checklist-title {
  color: var(--red);
}

.checklist-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.checklist-item-critical {
  border-color: rgba(231, 76, 60, 0.7);
}

.checklist-item input[type="checkbox"] {
  width: 26px;
  height: 26px;
  accent-color: var(--blue);
}

.badge-critical {
  margin-left: auto;
  background: rgba(231, 76, 60, 0.18);
  color: var(--red);
  padding: 2px 6px;
  font-size: 0.7rem;
  border-radius: 10px;
  font-weight: 700;
}

.checklist-controls {
  display: flex;
  gap: 10px;
  margin: 12px 4px;
}

.checklist-controls button {
  flex: 1;
  padding: 12px 16px;
}

.submit-row {
  margin: 16px 4px 8px;
}

.submit-row button {
  width: 100%;
  padding: 12px 16px;
}

/* ------------------------------------------------------------
   Applet Shared Styles (calculators, performance views)
------------------------------------------------------------ */
.applet-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 4px 16px;
}

.applet-best-card {
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #1b2836, #111827);
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

body.theme-light .applet-best-card {
  background: linear-gradient(135deg, #dfe7f5, #c9d6f2);
  border-color: rgba(100, 116, 139, 0.5);
}

.applet-best-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 4px;
}

.applet-best-speed {
  font-size: 2.4rem;
  font-weight: 800;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.applet-best-unit {
  font-size: 1rem;
  opacity: 0.8;
}

.applet-note {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.applet-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.applet-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.applet-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.applet-field-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.applet-input-wrap {
  display: flex;
  align-items: center;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 8px 10px;
  background: var(--bg-alt);
}

.applet-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.1rem; /* >=16px to avoid iOS zoom */
  padding: 6px 4px;
  outline: none;
}

.applet-input-wrap input::-webkit-outer-spin-button,
.applet-input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.applet-input-wrap input[type="number"] {
  -moz-appearance: textfield;
}

.applet-input-unit {
  font-size: 0.9rem;
  color: var(--muted);
  margin-left: 8px;
}

.applet-output-card {
  margin-top: 8px;
  border-radius: var(--radius-xl);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.applet-output-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.applet-output-main {
  font-size: 2.0rem;
  font-weight: 800;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.applet-output-unit {
  font-size: 1rem;
  opacity: 0.8;
}

.applet-output-note {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Slightly larger touch targets on coarse pointers */
@media (pointer: coarse) {
  .applet-input-wrap {
    padding: 10px 12px;
  }
  .applet-input-wrap input {
    font-size: 1.2rem;
    padding: 8px 4px;
  }
}

/* ------------------------------------------------------------
   Touch optimizations
------------------------------------------------------------ */
@media (pointer: coarse) {
  button {
    padding: 14px 18px;
    font-size: 1.05rem;
  }

  .checklist-item {
    min-height: 60px;
  }
}

/* ------------------------------------------------------------
   Startup Splash Screen
------------------------------------------------------------ */
.splash {
  position: fixed;  /* full-screen overlay */
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top, 16px) 16px
    env(safe-area-inset-bottom, 16px);
  overflow: hidden;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* IMPORTANT: no z-index or positioning here, so it doesn't create its own stacking context */
.splash-inner {
  text-align: center;
  max-width: 480px;
  width: 100%;
  /* no position, no z-index */
}

.splash-logo-row {
  position: relative;  /* participate in splash's stacking context */
  z-index: 2;          /* above lines */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  animation: splashFadeUp 750ms ease-out forwards;
}

.splash-logo {
  max-width: 160px;
  width: 70vw;
}

.splash-tail {
  max-width: 280px;
  width: 75vw;
}

/* ------------------------------------------------------------
   Uber-style diagonal lines (center), even spacing
   ~28° from vertical (or your chosen angle), behind logo/tail
------------------------------------------------------------ */
.splash-stripes {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;              /* even spacing */
  z-index: 1;             /* behind .splash-logo-row */
  pointer-events: none;
}

/* All lines: same thickness, same animation */
.splash-stripes .stripe {
  width: 3px;             /* same thickness */
  height: 90vh;           /* final length */
  background: #888;
  border-radius: 16px;
  box-shadow: 0 0 12px rgba(204, 204, 204, 0.7);

  transform-origin: center center;
  transform: rotate(10deg) scaleY(0); /* your current angle */
  opacity: 0;
  animation: lineGrow 1.4s ease-out forwards;
}

/* subtle cascade in time only */
.splash-stripes .stripe:nth-child(1) { animation-delay: 0.00s; }
.splash-stripes .stripe:nth-child(2) { animation-delay: 0.10s; }
.splash-stripes .stripe:nth-child(3) { animation-delay: 0.20s; }
.splash-stripes .stripe:nth-child(4) { animation-delay: 0.30s; }

/* diagonal line grow animation */
@keyframes lineGrow {
  0% {
    transform: rotate(10deg) scaleY(0);
    opacity: 0;
  }
  40% {
    transform: rotate(10deg) scaleY(0.6);
    opacity: 1;
  }
  100% {
    transform: rotate(10deg) scaleY(1);
    opacity: 0.7;
  }
}

/* Splash logo fade-up */
@keyframes splashFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------------------------------------------
   Weight & Balance
------------------------------------------------------------ */
.wb-seating-diagram {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.wb-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.wb-envelope-svg {
  width: 100%;
  max-width: 100%;
  height: 220px;
  border-radius: var(--radius-lg);
  background: #111;
  cursor: pointer;
}

body.theme-light .wb-envelope-svg {
  background: #f0f0f5;
}

.wb-grid-rect {
  fill: none;
  stroke: var(--border);
  stroke-width: 0.6;
}

.wb-env-normal {
  fill: rgba(52, 152, 219, 0.08);
  stroke: #3498db;
  stroke-width: 1.4;
}

.wb-env-utility {
  fill: rgba(46, 204, 113, 0.03);
  stroke: #2ecc71;
  stroke-width: 1.2;
  stroke-dasharray: 4 3;
}

.wb-fuel-line {
  stroke: #f1c40f;
  stroke-width: 1.6;
}

/* Layout for the two fuel tiles */
/* Container for the two fuel tiles */
.movement-fuel-tiles {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

/* Reuse seat-card visual style; this only tweaks layout/spacing */
.movement-fuel-tile {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 10px 8px; /* slightly tighter than seats */
}

/* Make sure they fit side-by-side on iPhone-ish widths */
@media (max-width: 380px) {
  .movement-fuel-tiles {
    gap: 8px;
  }
}

/* Titles & labels inside the tile */
.movement-fuel-tank-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.movement-fuel-subtitle {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Touch-friendly numeric inputs */
.movement-input-fuel-lg {
  margin-top: 4px;
  font-size: 1.2rem;
  padding: 0.5rem 0.4rem;
  width: 80%;
  max-width: 140px;
  text-align: center;
  border-radius: 8px;
}

/* Remove spinner controls so it feels more “tile keypad” like */
.movement-input-fuel-lg::-webkit-inner-spin-button,
.movement-input-fuel-lg::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.movement-input-fuel-lg[type="number"] {
  -moz-appearance: textfield;
}

/* Totals row under the tiles */
.movement-fuel-total-block {
  margin-top: 10px;
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--movement-card-bg, rgba(0,0,0,0.03));
}

body.dark .movement-fuel-total-block {
  background: rgba(255,255,255,0.04);
}

.movement-fuel-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-top: 4px;
}

.movement-fuel-total-label {
  opacity: 0.8;
}

.movement-fuel-total-value {
  font-variant-numeric: tabular-nums;
  font-size:150%;
}

/* Read-only fuel display (movement edit view) */
.movement-fuel-readonly-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 480px) {
  .movement-fuel-readonly-grid {
    grid-template-columns: 1fr;
  }
}

.movement-fuel-readonly-card {
  background: var(--movement-card-bg, rgba(0,0,0,0.03));
  border-radius: 10px;
  padding: 12px;
}

body.dark .movement-fuel-readonly-card {
  background: rgba(255,255,255,0.04);
}

.movement-fuel-readonly-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.movement-fuel-readonly-tanks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.movement-fuel-readonly-tank {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 50px;
  padding: 6px 4px;
  background: rgba(0,0,0,0.03);
  border-radius: 6px;
}

body.dark .movement-fuel-readonly-tank {
  background: rgba(255,255,255,0.05);
}

.movement-fuel-readonly-tank.movement-fuel-readonly-total {
  background: var(--accent-light, rgba(59, 130, 246, 0.1));
  border: 1px solid var(--accent, #3b82f6);
}

body.dark .movement-fuel-readonly-tank.movement-fuel-readonly-total {
  background: rgba(59, 130, 246, 0.15);
}

.movement-fuel-readonly-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  opacity: 0.7;
  letter-spacing: 0.3px;
}

.movement-fuel-readonly-value {
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.movement-fuel-readonly-unit {
  font-size: 0.65rem;
  opacity: 0.6;
}

.movement-fuel-burn-summary {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--success-light, rgba(34, 197, 94, 0.1));
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body.dark .movement-fuel-burn-summary {
  background: rgba(34, 197, 94, 0.15);
}

.movement-fuel-burn-label {
  font-size: 0.85rem;
  opacity: 0.85;
}

.movement-fuel-burn-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--success, #22c55e);
}

.wb-cg-point {
  fill: #e74c3c;
  stroke: #ffffff;
  stroke-width: 1.2;
}

.wb-seat-chip {
  flex: 1;
  padding: 6px 10px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.wb-seat-chip:active {
  transform: scale(0.97);
}

.wb-row-rear .wb-seat-chip {
  flex: 1;
}

/* Passenger picker list container */
.wb-passenger-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px 0;
}

/* Individual passenger row (tall, touch-friendly) */
.wb-passenger-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  
  padding: 18px 16px;          /* ⬅️ Increase touch area */
  min-height: 60px;            /* ⬅️ Ensures tall rows */
  
  font-size: 1.1rem;
  border-radius: 12px;
  
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  
  cursor: pointer;
  transition: background 0.2s ease;
}

/* Tap feedback */
.wb-passenger-item:active {
  background: rgba(255,255,255,0.08);
  transform: scale(0.98);
}

/* Name & weight styling */
.wb-passenger-name {
  font-weight: 600;
}

.wb-passenger-weight {
  opacity: 0.8;
  font-size: 0.95rem;
}

body.theme-light .wb-passenger-item {
  background: #f6f6ff;
}

.wb-passenger-name {
  font-weight: 500;
}

.wb-passenger-weight {
  color: var(--muted);
}

.wb-passenger-empty {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 6px 2px;
}


/* Axes, ticks, labels */
.wb-axis-label {
  fill: var(--muted);
  font-size: 9px;
}

.wb-tick {
  stroke: var(--border);
  stroke-width: 0.5;
}

.wb-tick-label {
  fill: var(--muted);
  font-size: 8px;
}

.wb-tick-label-x {
  text-anchor: middle;
}

.wb-tick-label-y {
  text-anchor: end;
}

.wb-status {
  margin-top: 10px;
  font-size: 0.9rem;
  text-align: center;
  font-weight: 600;
}

.wb-status.wb-ok {
  color: #2ecc71;
}

.wb-status.wb-bad {
  color: #e74c3c;
}

.sync-status {
  margin-top: 16px;
  font-size: 0.75rem;
  text-align: center;
  color: var(--muted);
  opacity: 0.7;
}

.wb-passenger-item.wb-passenger-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wb-passenger-item.wb-passenger-clear {
  border-style: dashed;
  justify-content: flex-start;
  gap: 8px;
}

.wb-passenger-item.wb-passenger-clear .wb-passenger-name {
  font-weight: 500;
}

/* ============================================================
   GLOBAL DATA CARD STYLES
   Reusable card grid patterns for reference data displays
============================================================ */

/* Section container */
.data-section {
  margin: 0 4px 16px;
}

/* Section hint/intro text */
.data-section-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 8px;
}

/* Section/group title */
.data-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 16px 4px 6px;
}

/* Responsive card grid */
.data-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

/* Individual data card */
.data-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 10px 12px;
}

/* Card variants */
.data-card-warning {
  background-color: rgba(231, 76, 60, 0.1);
  border-color: rgba(231, 76, 60, 1);
}

.data-card-info {
  background-color: rgba(52, 152, 219, 0.1);
  border-color: rgba(52, 152, 219, 0.6);
}

.data-card-success {
  background-color: rgba(46, 204, 113, 0.1);
  border-color: rgba(46, 204, 113, 0.6);
}

.data-card-emergency {
  background-color: rgba(255, 50, 50, 0.18);
  border-color: rgba(255, 80, 80, 0.5);
}

/* Card header row (code/label + value) */
.data-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

/* Card code/key (left side of header) */
.data-card-code {
  font-weight: 700;
  font-size: 0.9rem;
}

.data-card-code sub {
  font-size: 0.65em;
  vertical-align: baseline;
  line-height: 0;
  position: relative;
  top: 0.25em;
}

/* Card value (right side of header) */
.data-card-value {
  font-weight: 700;
  font-size: 1.05rem;
}

/* Value unit suffix */
.data-card-unit {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-left: 2px;
}

/* Card description label */
.data-card-label {
  font-size: 0.8rem;
}

/* Card note/footnote */
.data-card-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 3px;
}

/* POH citation */
.data-card-poh {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 4px;
  opacity: 0.7;
  font-style: italic;
}

/* Squawk-specific styles */
.squawk-status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
}

.squawk-status-open {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}

.squawk-status-in_work {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fcd34d;
}

.squawk-status-deferred {
  background: rgba(156, 163, 175, 0.2);
  border-color: rgba(156, 163, 175, 0.5);
  color: #d1d5db;
}

.squawk-status-resolved {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
  color: #86efac;
}

.squawk-resolved {
  opacity: 0.7;
}

.squawk-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.squawk-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

.squawk-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.squawk-attachment {
  font-size: 0.85rem;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  color: #93c5fd;
}

.squawk-no-attachments {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

/* Legacy V-Speed aliases for backwards compatibility */
.vspeeds-section { margin: 0 4px 16px; }
.vspeeds-intro { font-size: 0.8rem; color: var(--muted); margin: 0 0 8px; }
.vspeeds-group-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 16px 4px 6px; }
.vspeeds-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.vspeed-card { border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg-alt); padding: 10px 12px; }
.vspeed-limit { background-color: rgba(231, 76, 60, 0.1); border-color: rgba(231, 76, 60, 1); }
.vspeed-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.vspeed-code { font-weight: 700; font-size: 0.9rem; }
.vspeed-code sub { font-size: 0.65em; vertical-align: baseline; line-height: 0; position: relative; top: 0.25em; }
.vspeed-kias { font-weight: 700; font-size: 1.05rem; }
.vspeed-unit { font-size: 0.75rem; opacity: 0.8; margin-left: 2px; }
.vspeed-label { font-size: 0.8rem; }
.vspeed-note { font-size: 0.75rem; color: var(--muted); margin-top: 3px; }

/* Reference section wrapper on TOC */
.ref-section {
  margin-top: 12px;
  padding: 0 4px 12px;
}

.ref-heading {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 6px;
}


/* ------------------------------------------------------------
   Power settings reference
------------------------------------------------------------ */
.power-section {
  padding: 8px 4px 16px;
}

.power-intro {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 4px 12px;
}

.power-group-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 16px 4px 6px;
}

.power-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 4px 8px;
}

.power-card {
  border-radius: var(--radius-lg);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 10px 14px;
}

.power-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.power-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.power-airspeed {
  font-weight: 700;
  font-size: 1rem;
}

.power-unit {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-left: 2px;
}

.power-row-middle {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.power-field {
  min-width: 80px;
}

.power-field-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.power-field-value {
  font-size: 0.9rem;
}

.power-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.power-card-pattern {
  border-style: dashed;
}

/* ------------------------------------------------------------
   Phone reference
------------------------------------------------------------ */
.phones-root {
  display: flex;
  flex-direction: column;
  gap: 24px;              /* increased spacing */
  padding: 0 4px 20px;
}

.phone-card {
  border-radius: var(--radius-xl);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top:10px;
}

.phone-card-featured {
  border-color: var(--blue);
}

.phone-main {
  display: flex;
  flex-direction: column;
}

.phone-name {
  font-weight: 600;
}

.phone-location {
  font-size: 0.85rem;
  color: var(--muted);
}

.phone-link {
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text); /* or #fff */
}

/* ------------------------------------------------------------
   Passenger Profiles
------------------------------------------------------------ */
.passengers-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 4px 20px;
}

.passenger-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.passenger-search {
  flex: 1;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.9rem;
}

.passenger-add-btn {
  padding: 10px 14px;
  font-size: 0.85rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #2c2c40;
  color: var(--text);
  white-space: nowrap;
}

body.theme-light .passenger-add-btn {
  background: #e4e4f0;
}

.passenger-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.passenger-section-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 8px 4px 2px;
}

.passenger-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.passenger-card {
  border-radius: var(--radius-xl);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.12s ease-out, background 0.15s ease-out, border-color 0.15s ease-out;
}

.passenger-card:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.05);
}

.passenger-card:active {
  transform: scale(0.98);
}

.passenger-card-inactive {
  opacity: 0.5;
}

.passenger-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.passenger-name {
  font-weight: 600;
}

.passenger-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.passenger-weight {
  font-weight: 500;
}

.passenger-badge {
  padding: 2px 6px;
  border-radius: 16px;
  border: 1px solid var(--border);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.passenger-badge-cfi {
  border-color: var(--blue);
}

/* Passenger badges */
.passenger-badge-family {
  background: #6b21a8;           /* violet-ish */
  color: #f9fafb;
}

/* W&B passenger picker small tag */
.wb-passenger-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 16px;
  font-size: 0.65rem;
  background: rgba(148, 163, 184, 0.18);
  color: #e5e7eb;
}

body.theme-light .wb-passenger-tag {
  background: rgba(15, 23, 42, 0.08);
  color: #111827;
}

.wb-passenger-tag-family {
  background: rgba(147, 51, 234, 0.25);
  color: #e9d5ff;
}

body.theme-light .wb-passenger-tag-family {
  background: rgba(147, 51, 234, 0.15);
  color: #4b5563;
}

.passenger-status-pill {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.passenger-empty {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 4px 6px;
}

/* ------------------------------------------------------------
   Passenger Edit Form (inside wb-modal)
------------------------------------------------------------ */
.passenger-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.passenger-form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

.passenger-form-row label span {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 2px;
}

.passenger-form-row input[type="text"],
.passenger-form-row input[type="number"] {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.95rem;
}

body.theme-light .passenger-form-row input[type="text"],
body.theme-light .passenger-form-row input[type="number"] {
  background: #f7f7ff;
}

.passenger-form-flags {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.passenger-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.passenger-flag input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.passenger-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}


/* ------------------------------------------------------------
   Flight Log – Movements List
------------------------------------------------------------ */
.logs-layout {
  margin: 0 4px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.logs-header-main {
  display: flex;
  flex-direction: column;
}

.logs-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.logs-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.logs-new-button {
  font-size: 0.9rem;
  padding: 8px 14px;
}

.logs-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.logs-filter-input {
  flex: 1;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 6px 10px;
  background: var(--bg-alt);
  color: var(--text);
  font-size: 0.85rem;
}

.logs-filter-button {
  font-size: 0.9rem;
  padding: 8px 12px;
}

/* Movement cards */
.movement-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.movement-list-empty {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 6px 2px;
}

.movement-card {
  border-radius: var(--radius-xl);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.movement-card:hover,
.movement-card:active {
  background: rgba(255,255,255,0.05);
  transform: translateY(-1px);
}

.movement-card-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.movement-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.movement-date {
  font-size: 0.9rem;
  font-weight: 500;
}

.movement-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.movement-tag-flight {
  border-color: var(--blue);
  color: var(--blue);
}

.movement-tag-ground {
  border-color: var(--muted);
  color: var(--muted);
}

.movement-tag-taxi {
  border-color: var(--green);
  color: var(--green);
}

.movement-route {
  font-size: 0.95rem;
  font-weight: 600;
}

.movement-meta,
.movement-meta-secondary {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.movement-be {
  text-align: right;
}

/* ------------------------------------------------------------
   Flight Log – Movement Detail
------------------------------------------------------------ */
.movement-detail {
  margin: 0 4px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.movement-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.movement-back-button {
  font-size: 0.9rem;
  padding: 6px 10px;
}

.movement-detail-title {
  margin: 0;
  font-size: 1.1rem;
}

.movement-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.movement-section {
  border-radius: var(--radius-xl);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 10px 14px;
}

.movement-section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.movement-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.movement-form-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.movement-form-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

@media (min-width: 640px) {
  .movement-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.movement-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.movement-form input[type="text"],
.movement-form input[type="number"],
.movement-form input[type="datetime-local"],
.movement-form select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
}

/* Override for touch-friendly large inputs */
.movement-form input.movement-input-lg,
.movement-form select.movement-input-lg {
  font-size: 1.1rem;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-alt);
}

.movement-notes {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  resize: vertical;
}

.movement-occupants-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.movement-occupant-pill {
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 4px 10px;
  font-size: 0.8rem;
}

.movement-occupant-name {
  font-weight: 500;
}

.movement-occupant-meta {
  margin-left: 6px;
  color: var(--muted);
}

.movement-occupants-actions {
  margin-top: 8px;
}

.movement-section-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.movement-error {
  min-height: 1em;
  font-size: 0.8rem;
  color: var(--red);
}

.movement-save-button {
  width: 100%;
}

/* ------------------------------------------------------------
   Flight Logs
------------------------------------------------------------ */
.logs-root {
  margin: 0 4px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-card {
  border-radius: var(--radius-xl);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 120ms ease-out, box-shadow 120ms ease-out;
}

.log-card:active {
  transform: scale(0.97);
}

.log-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.log-route {
  font-weight: 600;
}

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

.log-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.log-chip {
  padding: 2px 8px;
  border-radius: 16px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.log-chip-flight {
  background: rgba(52, 152, 219, 0.18);
  color: #3498db;
}

.log-chip-ground_run {
  background: rgba(231, 76, 60, 0.18);
  color: #e74c3c;
}

.log-chip-taxi_only {
  background: rgba(155, 89, 182, 0.18);
  color: #9b59b6;
}

.log-flight-type {
  color: var(--muted);
}

.log-times {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.log-time-block {
  flex: 1;
  font-size: 0.82rem;
}

.log-time-label {
  color: var(--muted);
  margin-bottom: 2px;
}

.log-time-value {
  font-weight: 600;
}

.logs-empty {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Detail view */
.logs-detail {
  margin: 0 4px 16px;
  border-radius: var(--radius-xl);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 12px 14px;
}

.logs-detail-header {
  margin-bottom: 10px;
}

.logs-detail-route {
  font-weight: 600;
}

.logs-detail-date {
  font-size: 0.85rem;
  color: var(--muted);
}

.logs-detail-type,
.logs-detail-biz {
  font-size: 0.85rem;
}

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

.logs-detail-group h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 4px;
}

.logs-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.logs-detail-passengers,
.logs-detail-notes {
  margin-top: 10px;
}

.logs-detail-passengers h3,
.logs-detail-notes h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 4px;
}

.log-pax-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.log-pax-main {
  display: flex;
  flex-direction: column;
}

.log-pax-name {
  font-weight: 600;
}

.log-pax-meta span {
  color: var(--muted);
  font-size: 0.75rem;
}

.log-pax-purpose {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
}

/* ------------------------------------------------------------
   Movement detail
------------------------------------------------------------ */
.movement-detail {
  margin: 0 4px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.movement-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg-alt);
}

.movement-detail-date {
  font-size: 0.9rem;
  color: var(--muted);
}

.movement-detail-route {
  font-size: 1.05rem;
  font-weight: 600;
}

.movement-detail-city {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}

.movement-detail-type {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.movement-subsection-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 4px;
}

.movement-detail-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 8px;
  opacity: 0.8;
}

/* Readonly time display (for engine times in edit form) */
.movement-readonly-time {
  padding: 10px 12px;
  background: var(--bg-alt, rgba(0,0,0,0.03));
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  opacity: 0.8;
}

body.dark .movement-readonly-time {
  background: rgba(255,255,255,0.05);
}

.movement-readonly-badge {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: normal;
  opacity: 0.7;
}

/* Card wrapper */
.movement-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 10px 12px;
}

.movement-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 6px;
}

/* Times block */
.movement-time-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.03);
}

.movement-time-row:first-of-type {
  border-top: none;
}

.movement-time-label {
  color: var(--muted);
  min-width: 110px;
}

.movement-time-values {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 2px;
}

.movement-time-main {
  font-weight: 600;
}

.movement-time-tz {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-left: 4px;
}

.movement-time-utc {
  font-size: 0.75rem;
  color: var(--muted);
}

.movement-time-toggle-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.movement-time-toggle-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
}

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

.movement-time-toggle-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  cursor: pointer;
}

.movement-time-toggle-btn:active {
  transform: scale(0.97);
}

/* Summary rows */
.movement-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.9rem;
}

.movement-summary-row span:first-child {
  color: var(--muted);
}

/* Passengers list */
.movement-pax-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.movement-pax-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.movement-pax-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.movement-pax-meta {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.movement-pax-weight {
  font-size: 0.9rem;
  font-weight: 600;
}

.movement-empty {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Notes */
.movement-notes p {
  margin: 0;
  font-size: 0.9rem;
}

/* ============================================================
   FLIGHT LOGS – LIST VIEW
============================================================ */

.logs-section {
  padding: 1rem;
}

.logs-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.logs-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.logs-card:hover,
.logs-card:active {
  background: rgba(255,255,255,0.05);
  transform: translateY(-1px);
}

.logs-card-main {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.logs-card-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  opacity: 0.8;
}

.logs-card-id {
  font-weight: 600;
  letter-spacing: 0.5px;
}

.logs-card-date {
  font-style: italic;
}

.logs-card-route {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.logs-card-airport {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.logs-card-city {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  opacity: 0.85;
}

.logs-card-arrow {
  color: var(--muted);
  font-weight: 400;
}

.logs-card-warning {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: #f59e0b;
  margin-top: 4px;
}

.logs-card-warning .warning-icon {
  font-size: 0.85rem;
}

.logs-card-needs-fuel {
  border-left: 3px solid #f59e0b;
}

.logs-card-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  opacity: 0.85;
  font-size: 0.85rem;
}

.logs-card-note {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  opacity: 0.75;
}

.logs-card-times {
  font-size: 0.85rem;
  opacity: 0.9;
  color: var(--accent, #f9a825);
}

.logs-card-passengers {
  font-size: 0.85rem;
  opacity: 0.85;
}

.logs-card-roles-purposes {
  font-size: 0.8rem;
  color: #a0aec0;
  margin-top: 4px;
}

.logs-card-roles {
  color: #68d391;
}

.logs-card-purposes {
  color: #63b3ed;
}

.logs-card-notes {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-style: italic;
  opacity: 0.65;
  line-height: 1.3;
}

/* Pinned footer for logs list */
.logs-section-with-footer {
  padding-bottom: 5rem;
}

.logs-footer-pinned {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 1rem;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  z-index: 100;
}

/* ============================================================
   FLIGHT LOGS – DETAIL VIEW
============================================================ */

.logs-detail-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.logs-detail-header {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.logs-detail-id {
  font-weight: 700;
  font-size: 1.2rem;
}
.logs-detail-date {
  opacity: 0.75;
}

.logs-detail-route-main {
  font-weight: 600;
  font-size: 1.25rem;
}

.logs-detail-type {
  margin-top: 0.25rem;
  opacity: 0.7;
}

.logs-times-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.logs-time-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
}

.logs-time-label {
  font-size: 0.85rem;
  opacity: 0.75;
}

.logs-time-value {
  font-size: 1.25rem;
  font-weight: 600;
}

.logs-time-sub {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 0.1rem;
}

.logs-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.logs-metric {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
}

.logs-metric-label {
  font-size: 0.85rem;
  opacity: 0.75;
}

.logs-metric-value {
  font-size: 1.2rem;
  font-weight: 600;
}

.logs-business {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.logs-business-label {
  opacity: 0.6;
}

.logs-notes {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  margin-top: 1rem;
}

.movement-map-card {
  padding: 0;
  overflow: hidden;
}

.movement-map-image {
  display: block;
  width: 100%;
  height: auto;
}

.movement-toggle-button {
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
}

/* ============================================================
   PASSENGERS ON MOVEMENT
============================================================ */

.logs-pax-section {
  margin-top: 2rem;
}

.logs-pax-title {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.logs-pax-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.8rem;
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.logs-pax-main {
  display: flex;
  flex-direction: column;
}

.logs-pax-name {
  font-weight: 600;
}

.logs-pax-role,
.logs-pax-station {
  font-size: 0.85rem;
  opacity: 0.75;
}

.logs-pax-weight {
  font-size: 1rem;
  font-weight: 600;
}

/* ------------------------------------------------------------
   Full-screen Image Modal (for movement map)
------------------------------------------------------------ */

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top, 16px)
           env(safe-area-inset-right, 16px)
           env(safe-area-inset-bottom, 16px)
           env(safe-area-inset-left, 16px);
}

.image-modal.hidden {
  display: none;
}

.image-modal-inner {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto; /* allows panning if zoomed */
}

.image-modal-inner img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* allow browser’s native pinch/pan */
  touch-action: auto;
}

.image-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 6px 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ------------------------------------------------------------
   Receipt Viewer Modal (with pinch-to-zoom)
------------------------------------------------------------- */
.receipt-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
}

.receipt-viewer-modal.hidden {
  display: none;
}

.receipt-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top, 12px));
  background: rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.receipt-viewer-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}

.receipt-viewer-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.receipt-viewer-close:active {
  background: rgba(255, 255, 255, 0.2);
}

.receipt-viewer-container {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  touch-action: none;
  cursor: default;
}

.receipt-viewer-loading {
  position: absolute;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
}

.receipt-viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: opacity 0.2s ease;
  will-change: transform;
}

.receipt-viewer-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
  background: rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.receipt-viewer-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  min-width: 44px;
}

.receipt-viewer-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

.receipt-viewer-zoom-level {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  min-width: 50px;
  text-align: center;
}

/* Fuel Row Receipt Button */
.fuel-row-receipt-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.fuel-row-receipt-pending {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 6px 12px;
  background: rgba(240, 180, 41, 0.15);
  border: 1px solid rgba(240, 180, 41, 0.3);
  border-radius: 8px;
  color: #f0b429;
  font-size: 0.85rem;
  animation: pulse-pending 1.5s ease-in-out infinite;
}

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

/* Receipt Upload Section */
.receipt-upload-section {
  display: flex;
  gap: 8px;
  align-items: center;
}

.receipt-upload-section .tiger-btn {
  flex-shrink: 0;
}

/* Receipt Prompt Modal */
.receipt-prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.receipt-prompt-modal.hidden {
  display: none;
}

.receipt-prompt-content {
  background: #1a1a1a;
  border-radius: 16px;
  padding: 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.receipt-prompt-title {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.receipt-prompt-message {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.receipt-prompt-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Receipt Capture Modal */
.receipt-capture-modal {
  position: fixed;
  inset: 0;
  z-index: 11500;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
}

.receipt-capture-modal.hidden {
  display: none;
}

.receipt-capture-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top, 16px));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.receipt-capture-title {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
}

.receipt-capture-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 20px;
}

.receipt-capture-icon {
  font-size: 4rem;
  opacity: 0.8;
}

.receipt-capture-message {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  text-align: center;
  max-width: 280px;
}

.receipt-capture-status {
  color: #f0b429;
  font-size: 0.95rem;
  text-align: center;
  min-height: 24px;
}

.receipt-capture-status.success {
  color: #4ade80;
}

.receipt-capture-status.error {
  color: #ef4444;
}

.receipt-capture-actions {
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Receipt Discrepancy Modal */
.receipt-discrepancy-modal {
  max-width: 400px;
  width: 90%;
}

.receipt-discrepancy-modal h2 {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
}

.receipt-discrepancy-modal .modal-description {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 16px 0;
}

.discrepancy-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.discrepancy-row {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
}

.discrepancy-label {
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.discrepancy-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.discrepancy-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.discrepancy-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.discrepancy-option:has(input:checked) {
  background: rgba(46, 204, 113, 0.15);
  border-color: var(--green);
}

.discrepancy-option input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.discrepancy-value {
  font-weight: 600;
  font-size: 1rem;
  flex: 1;
}

.discrepancy-value.existing {
  color: var(--blue);
}

.discrepancy-value.extracted {
  color: var(--green);
}

.discrepancy-source {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Receipt Conflict Summary (shown after smart merge) */
.conflict-summary {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
}

.conflict-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.conflict-row:last-child {
  border-bottom: none;
}

.conflict-label {
  font-weight: 600;
  width: 80px;
  color: var(--muted);
}

.conflict-kept {
  color: var(--blue);
  flex: 1;
}

.conflict-receipt {
  color: var(--muted);
  flex: 1;
  text-decoration: line-through;
  opacity: 0.7;
}

.conflict-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
}

/* Interactive Conflict Resolution Modal */
.conflict-resolution-modal {
  max-width: 400px;
}

.conflict-resolution-modal .conflict-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
}

.conflict-field-label {
  font-weight: 600;
  color: var(--fg);
  font-size: 0.9rem;
}

.conflict-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.conflict-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.conflict-option input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.conflict-option .conflict-value {
  flex: 1;
  color: var(--fg);
}

.conflict-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.conflict-badge.current {
  background: var(--blue);
  color: white;
}

.conflict-badge.receipt {
  background: var(--orange);
  color: white;
}

/* Make the map card obviously tappable */
.movement-map-card {
  cursor: zoom-in;
}

.movement-day-flag {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  margin-right: 0.4rem;
  border-radius: 16px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--accent-bg, #ffebcc);
  color: var(--accent-fg, #8b4a00);
  font-weight: 600;
}

/* ---------------------------------------------------------
   Shared button style – used by all main UI buttons
--------------------------------------------------------- */
.tiger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 8px 16px;
  border-radius: 16px;
  border: none;

  font-size: 0.9rem;
  font-weight: 600;

  background: #C41E3A;        /* bright aviation blue */
  color: white;

  box-shadow: 0 2px 6px rgba(0,0,0,0.18);

  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

/* Hover / touch */
.tiger-btn:hover {
  background: #851629;
}

.tiger-btn:active {
  transform: scale(0.96);
}


/* ---------------------------------------------------------
   Variant: Secondary Button (used for local/zulu toggle)
--------------------------------------------------------- */
.tiger-btn-secondary {
  background: #444;
  color: #fff;
}

.tiger-btn-secondary:hover {
  background: #333;
}

/* Dark mode aware (optional) */
body.theme-dark .tiger-btn-secondary {
  background: #666;
  color: #fff;
}

body.theme-light .tiger-btn-secondary {
  background: #d1d5db;
  color: #1f2937;
}

body.theme-light .tiger-btn-secondary:hover {
  background: #9ca3af;
}

/* Disabled state for tiger-btn */
.tiger-btn:disabled,
.tiger-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.tiger-btn:disabled:hover,
.tiger-btn[disabled]:hover {
  transform: none;
  background: inherit;
}

.tiger-btn-secondary:disabled,
.tiger-btn-secondary[disabled] {
  background: #444;
}

body.theme-light .tiger-btn-secondary:disabled,
body.theme-light .tiger-btn-secondary[disabled] {
  background: #d1d5db;
}

/* Danger button for destructive actions */
.tiger-btn-danger {
  background: #dc2626;
  color: #fff;
  border: none;
}

.tiger-btn-danger:hover {
  background: #b91c1c;
}

.tiger-btn-danger:disabled,
.tiger-btn-danger[disabled] {
  background: #7f1d1d;
  opacity: 0.6;
  cursor: not-allowed;
}

body.theme-light .tiger-btn-danger {
  background: #dc2626;
  color: #fff;
}

body.theme-light .tiger-btn-danger:hover {
  background: #b91c1c;
}

/* Green success button */
.tiger-btn-success {
  background: #16a34a;
  color: #fff;
  border-color: #22c55e;
}

.tiger-btn-success:hover {
  background: #15803d;
}

body.theme-light .tiger-btn-success {
  background: #16a34a;
  color: #fff;
}

body.theme-light .tiger-btn-success:hover {
  background: #15803d;
}

/* ---------------------------------------------------------
   Confirmation Modal
--------------------------------------------------------- */
.confirm-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: modalFadeIn 0.15s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.confirm-modal {
  background: var(--card-bg, #1e1e1e);
  border-radius: 12px;
  padding: 24px;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: modalSlideIn 0.15s ease-out;
}

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

body.theme-light .confirm-modal {
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.confirm-modal-title {
  margin: 0 0 12px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
}

body.theme-light .confirm-modal-title {
  color: #111;
}

.confirm-modal-message {
  margin: 0 0 24px 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary, rgba(255, 255, 255, 0.8));
}

body.theme-light .confirm-modal-message {
  color: #444;
}

.confirm-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.confirm-modal-actions .tiger-btn {
  min-width: 80px;
}

/* ---------------------------------------------------------
   Footer Main Menu button
--------------------------------------------------------- */
.footer-button.tiger-btn {
  font-size: 1rem;
  padding: 10px 20px;
}

/* Make sure footer background doesn't hide it */
#toc-button {
  z-index: 50;
}

/* Bigger touch-friendly inputs - inherits from global .movement-input-lg */
.movement-form-touch .movement-input-lg {
  font-size: 1.1rem;
  padding: 12px 14px;
}

/* 2-column grid that stacks on small screens */
.movement-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  overflow: hidden;
}

/* Only go 2-column on wider screens where datetime inputs fit */
@media (min-width: 540px) {
  .movement-form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Labels in grid must constrain their children */
.movement-form-grid-2 .movement-label {
  display: block;
  overflow: hidden;
  min-width: 0;
}

/* Force datetime-local inputs to fit container */
.movement-form-grid-2 input[type="datetime-local"],
input.movement-datetime-input {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  min-height: 44px;
  font-size: 0.85rem;
  padding: 10px 8px;
}

@media (min-width: 540px) {
  .movement-form-grid-2 input[type="datetime-local"],
  input.movement-datetime-input {
    font-size: 1rem;
    padding: 12px 14px;
  }
}

/* Ensure movement form doesn't overflow viewport */
.movement-summary-card {
  overflow: hidden;
  max-width: 100%;
}

.movement-summary-card .movement-form {
  max-width: 100%;
  overflow: hidden;
}

/* Seat grid: 2-up cards */
/* Seat cards layout tweaks */
.movement-seat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.movement-seat-card {
  flex: 0 0 calc(50% - 10px); /* roughly half width */
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  box-sizing: border-box;
}

/* Empty seat: dotted border, subtle styling */
.movement-seat-card.movement-seat-empty {
  border-style: dotted;
  background-color: transparent;
}

.movement-seat-empty-label {
  opacity: 0.7;
}

/* Assigned seat: solid border & slightly filled */
.movement-seat-card.movement-seat-assigned {
  border-style: solid;
  background-color: rgba(255, 255, 255, 0.06);
}

/* Hide the flight type dropdown when the seat is empty */
.movement-seat-card.movement-seat-empty .movement-seat-flighttype-wrapper {
  visibility: hidden;
  height: 0;
  margin-top: 0;
  padding-top: 0;
}

/* Role dropdown (for pilots) */
.movement-seat-role-wrapper {
  margin-top: 6px;
}

.movement-seat-role {
  width: 100%;
  font-size: 0.9rem;
  padding: 8px 10px;
}

body.theme-light .movement-seat-card.movement-seat-assigned {
  background-color: rgba(0, 0, 0, 0.04);
}

.movement-seat-title {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-bottom: 4px;
}

.movement-seat-name {
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.movement-seat-remove {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.7;
  flex-shrink: 0;
}

.movement-seat-remove:hover {
  opacity: 1;
}

/* Empty seat indicator: dotted outline around "Empty" */
.movement-seat-empty-label {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 16px;
  border: 1px dotted currentColor;
  opacity: 0.7;
}

/* Notes full-width card styling */
.movement-notes-wrapper {
  width: 100%;
}

.movement-notes-textarea {
  width: 100%;
  resize: vertical;
  min-height: 100px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  padding: 12px 14px;
  font-size: 1.1rem;
  font-family: inherit;
  line-height: 1.5;
  box-sizing: border-box;
}

/* ============================================================
   Takeoff Distance Calculator
============================================================ */

.calc-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
}

/* Two-column layout for wider screens */
.calc-section.calc-two-col {
  flex-direction: column;
}

.calc-left-col,
.calc-right-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 720px) {
  .calc-section.calc-two-col {
    flex-direction: row;
    align-items: flex-start;
  }

  .calc-left-col {
    flex: 1;
    min-width: 0;
  }

  .calc-right-col {
    flex: 1;
    min-width: 0;
    position: sticky;
    top: 12px;
  }
}

@media (min-width: 900px) {
  .calc-left-col {
    flex: 1.1;
  }

  .calc-right-col {
    flex: 0.9;
  }
}

.calc-card {
  background: var(--card-bg, rgba(20,20,20,0.9));
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  flex: 1;
}

body.theme-light .calc-card {
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.calc-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

/* Global calculator section title */
.calc-title {
  font-size: 1.1rem;
  font-weight: 600;
}

/* 2×2 grid layout for inputs */
.calc-grid {
  display: grid;
  gap: 8px;
}

.calc-grid-2col {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 480px) {
  .calc-grid-2col {
    grid-template-columns: 1fr 1fr;
  }
}

/* Global calculator field container */
.calc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Global calculator field label */
.calc-label {
  font-size: 0.85rem;
  opacity: 0.85;
}

/* Global calculator help/hint text */
.calc-help {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 6px;
}

/* Global calculator input field */
.calc-input {
  width: 100%;
  font-size: 1.25rem;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.55);
  color: #fff;
  text-align: center;
  min-height: 58px;
  box-sizing: border-box;
  line-height: 28px;
}

body.theme-light .calc-input {
  background: #f3f4f6;
  border-color: rgba(0,0,0,0.14);
  color: #111827;
}

/* Remove spinner arrows on numeric inputs */
.calc-input[type="number"]::-webkit-outer-spin-button,
.calc-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.calc-input[type="number"] {
  -moz-appearance: textfield;
}

/* Left-align dropdown/select elements */
select.calc-input {
  text-align: left;
  padding-right: 48px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
}

body.theme-light select.calc-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23374151' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
}

/* Temp unit toggle (shared by any calculator with temperature input) */
.calc-temp-toggle {
  display: inline-flex;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(15,23,42,0.8);
  overflow: hidden;
  font-size: 0.7rem;
}

body.theme-light .calc-temp-toggle {
  border-color: rgba(0,0,0,0.2);
  background: #e5e7eb;
}

.calc-temp-btn {
  padding: 3px 7px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1.2;
}

.calc-temp-btn-active {
  background: #3b82f6;
  color: #ffffff;
}

.calc-results-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* label left, value right */
.calc-result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.95rem;
}

.calc-result-row-main {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 4px;
}

.calc-result-label {
  opacity: 0.85;
}

.calc-result-value {
  font-variant-numeric: tabular-nums;
}

/* Note & POH reference */
.calc-output-note {
  margin-top: 8px;
  font-size: 0.8rem;
  opacity: 0.76;
}

.calc-footnote {
  margin-top: 10px;
  font-size: 0.8rem;
  text-align: center;
  opacity: 0.8;
}

/* Global button row */
.calc-button-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Global button styles */
.calc-button {
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.calc-button:hover {
  background: rgba(255,255,255,0.15);
}

.calc-button:active {
  transform: translateY(1px);
}

body.theme-light .calc-button {
  background: #e5e7eb;
  border-color: rgba(0,0,0,0.15);
  color: #1f2937;
}

body.theme-light .calc-button:hover {
  background: #d1d5db;
}

.calc-button-danger {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.4);
  color: #fca5a5;
}

.calc-button-danger:hover {
  background: rgba(220, 38, 38, 0.3);
}

body.theme-light .calc-button-danger {
  background: #fee2e2;
  border-color: rgba(220, 38, 38, 0.3);
  color: #dc2626;
}

body.theme-light .calc-button-danger:hover {
  background: #fecaca;
}

/* Global modal styles */
.calc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 16px;
}

.calc-modal-backdrop.hidden {
  display: none;
}

.calc-modal {
  background: var(--card-bg, #1a1a2e);
  border-radius: 16px;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.theme-light .calc-modal {
  background: #fff;
  border-color: rgba(0,0,0,0.1);
}

.calc-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
}

.calc-modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.calc-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
  padding: 4px 8px;
  line-height: 1;
}

.calc-modal-close:hover {
  opacity: 1;
}

.calc-modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

/* Output card */
.calc-output-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #123020;
  border-radius: 12px;
  padding: 12px;
  color: #e8ffe8;
}

.theme-light .calc-output-card {
  background: #e7f5eb;
  color: #103018;
}

/* Risk-based output card colors */
.calc-output-card.risk-conservative {
  background: #123020;
  border: 1px solid rgba(46, 204, 113, 0.4);
}
.theme-light .calc-output-card.risk-conservative {
  background: #e7f5eb;
  border: 1px solid rgba(46, 204, 113, 0.5);
}

.calc-output-card.risk-acceptable {
  background: #2a2810;
  border: 1px solid rgba(241, 196, 15, 0.5);
}
.theme-light .calc-output-card.risk-acceptable {
  background: #fef9e7;
  color: #3d3000;
  border: 1px solid rgba(241, 196, 15, 0.6);
}

.calc-output-card.risk-high {
  background: #2a1010;
  border: 1px solid rgba(231, 76, 60, 0.5);
}
.theme-light .calc-output-card.risk-high {
  background: #fdedec;
  color: #4a1010;
  border: 1px solid rgba(231, 76, 60, 0.5);
}

/* Risk banner */
.calc-risk-banner {
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 8px;
}

.calc-risk-banner.risk-conservative {
  background: rgba(46, 204, 113, 0.25);
  color: #2ecc71;
}
.theme-light .calc-risk-banner.risk-conservative {
  background: rgba(46, 204, 113, 0.2);
  color: #1c8b4f;
}

.calc-risk-banner.risk-acceptable {
  background: rgba(241, 196, 15, 0.25);
  color: #f1c40f;
}
.theme-light .calc-risk-banner.risk-acceptable {
  background: rgba(241, 196, 15, 0.25);
  color: #9a7d0a;
}

.calc-risk-banner.risk-high {
  background: rgba(231, 76, 60, 0.25);
  color: #e74c3c;
}
.theme-light .calc-risk-banner.risk-high {
  background: rgba(231, 76, 60, 0.2);
  color: #c0392b;
}

/* Wrapper so we can position the F/C toggle inside the input */
.calc-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

/* Center text visually by matching left padding to right (toggle space) */
.calc-input-wrap .calc-input {
  padding-left: 76px;
  padding-right: 76px; /* space for the toggle pill */
}

/* Temp toggle pill inside the input, right side */
.calc-temp-toggle-inline {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  border-radius: 16px;
  overflow: hidden;
}

/* --- Obstacle checkbox row --- */
.obstacle-row {
  margin-top: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* Flexible label acting as a hit-target */
.obstacle-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

/* Hide the native checkbox */
.obstacle-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Big custom checkbox square */
.obstacle-box {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid var(--input-border);
  background: var(--input-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

/* Checkmark */
.obstacle-toggle input[type="checkbox"]:checked + .obstacle-box {
  background: var(--accent);
  border-color: var(--accent);
}

.obstacle-toggle input[type="checkbox"]:checked + .obstacle-box::after {
  content: "✔";
  color: white;
  font-size: 20px;
  font-weight: bold;
}

/* Label text */
.obstacle-label {
  font-size: 1.1rem;
  color: var(--text-color);
}

/* Light & Dark theme support */
body.theme-dark .obstacle-box {
  background: #1b1b1b;
  border-color: #555;
}

body.theme-dark .obstacle-label {
  color: #e5e5e5;
}

.movement-fuel-summary-card {
  margin-top: 12px;
}

.movement-fuel-summary-block {
  padding-top: 4px;
}

.movement-fuel-summary-heading {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.movement-fuel-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin: 2px 0;
}

.movement-fuel-summary-label {
  opacity: 0.75;
}

.movement-fuel-summary-value {
  font-variant-numeric: tabular-nums;
}

.movement-fuel-summary-row-total .movement-fuel-summary-label {
  font-weight: 600;
  opacity: 0.9;
}

.movement-fuel-summary-row-total .movement-fuel-summary-value {
  font-weight: 600;
}

/* ============================================================
   Fuel Ledger – Clean Dark/Light + Color-Coded Pills
============================================================ */

.fuel-log-section {
  padding: 16px;
}

.fuel-log-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
}

.fuel-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* Fuel Entry Form Styles */
.fuel-entry-total {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
}

.fuel-entry-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 0 4px;
}

.fuel-entry-actions .tiger-btn {
  flex: 1;
  padding: 14px 20px;
  font-size: 1rem;
}

/* Editable fuel log rows */
.fuel-row-editable {
  cursor: pointer;
  position: relative;
}

.fuel-row-editable:hover,
.fuel-row-editable:active {
  background: rgba(255,255,255,0.08);
}

body.theme-light .fuel-row-editable:hover,
body.theme-light .fuel-row-editable:active {
  background: rgba(0,0,0,0.04);
}

.fuel-row-edit-hint {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
  margin-top: 6px;
  opacity: 0.7;
}

/* ============================
   LIST CONTAINER
============================ */
.fuel-log-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================
   BASE ROW CARD
============================ */
.fuel-row {
  border-radius: 12px;
  padding: 14px 16px;
  background: #1a1a1a;        /* DARK THEME */
  border: 1px solid #333;
  color: #f3f3f3;
  box-shadow: 0 1px 3px rgba(0,0,0,0.45);
}

.light-mode .fuel-row {
  background: #ffffff;         /* LIGHT THEME */
  border-color: #d7d7d7;
  color: #202020;
}

/* Inner layout */
.fuel-row-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fuel-row-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

/* On narrow screens, stack type label and date vertically */
@media (max-width: 380px) {
  .fuel-row-top {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================
   COLOR PILLS FOR EVENT TYPES
============================ */
.fuel-row-title {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* Movement end → BLUE */
.fuel-row-movement .fuel-row-title {
  background: #2563eb;
  color: #ffffff;
}

/* Refuel → GREEN */
.fuel-row-refuel .fuel-row-title {
  background: #16a34a;
  color: #ffffff;
}

/* Fuel drain → RED */
.fuel-row-drain .fuel-row-title {
  background: #dc2626;
  color: #ffffff;
}

/* Fuel burn → BLUE */
.fuel-row-burn .fuel-row-title {
  background: #2563eb;
  color: #ffffff;
}

/* Snapshot → AMBER */
.fuel-row-snapshot .fuel-row-title {
  background: #f59e0b;
  color: #000000;
}

/* Adjustment → PURPLE */
.fuel-row-adjustment .fuel-row-title {
  background: #7c3aed;
  color: #ffffff;
}

/* Light mode pills stay strong-colored */
.light-mode .fuel-row-title {
  color: #ffffff !important;
}

/* ============================
   LEFT BORDER COLOR CODING
============================ */
.fuel-row-refuel {
  border-left: 3px solid #16a34a;
}

.fuel-row-burn {
  border-left: 3px solid #2563eb;
}

.fuel-row-drain {
  border-left: 3px solid #dc2626;
}

.fuel-row-snapshot {
  border-left: 3px solid #f59e0b;
}

.fuel-row-adjustment {
  border-left: 3px solid #7c3aed;
}

/* Date next to pill */
.fuel-row-date {
  font-size: 0.85rem;
  opacity: 0.75;
}

/* ============================
   META / SUBTEXT
============================ */
.fuel-row-meta,
.fuel-row-sub {
  display: flex;
  justify-content: space-between;
  font-size: 0.90rem;
}

.fuel-row-meta-secondary {
  display: flex;
  justify-content: space-between;
  font-size: 0.80rem;
  opacity: 0.7;
  flex-wrap: wrap;
  gap: 6px;
}

.fuel-row-movement-link {
  color: var(--accent, #f5a623);
  text-decoration: none;
  opacity: 1;
}

.fuel-row-movement-link:hover {
  text-decoration: underline;
}

/* Notes */
.fuel-row-notes {
  font-size: 0.80rem;
  opacity: 0.7;
  line-height: 1.35;
  margin-top: 6px;
}

/* ============================
   VIRTUAL ADJUSTMENT CARD
   (discrepancy warning)
============================ */
.fuel-row-virtual-adjustment {
  background: linear-gradient(135deg, #2d1f1f 0%, #1a1a1a 100%) !important;
  border: 2px dashed #f87171 !important;
  position: relative;
}

.fuel-row-virtual-adjustment::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(248, 113, 113, 0.03) 10px,
    rgba(248, 113, 113, 0.03) 20px
  );
  pointer-events: none;
  border-radius: 10px;
}

.light-mode .fuel-row-virtual-adjustment {
  background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%) !important;
  border-color: #ef4444 !important;
}

.light-mode .fuel-row-virtual-adjustment::before {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(239, 68, 68, 0.05) 10px,
    rgba(239, 68, 68, 0.05) 20px
  );
}

.fuel-virtual-actions {
  position: relative;
  z-index: 1;
}

/* Incomplete anchor highlighting */
.fuel-row-anchor-incomplete {
  border: 2px dashed #ef4444 !important;
  background: linear-gradient(135deg, #2d1f1f 0%, var(--bg-alt) 100%) !important;
}

.light-mode .fuel-row-anchor-incomplete {
  background: linear-gradient(135deg, #fef2f2 0%, var(--bg-alt) 100%) !important;
}

/* Incomplete virtual adjustment (grayed out) */
.fuel-row-virtual-incomplete {
  border-color: #6b7280 !important;
  opacity: 0.7;
}

.fuel-row-virtual-incomplete::before {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(107, 114, 128, 0.05) 10px,
    rgba(107, 114, 128, 0.05) 20px
  ) !important;
}

/* Bottom summary note */
.fuel-log-note {
  opacity: 0.65;
  margin-top: 20px;
  font-size: 0.85rem;
  text-align: center;
}


/* ============================================================
   Cruise Performance Calculator Styles
============================================================ */

.cruise-section {
  display: grid;
  gap: 14px;
  padding: 12px;
}

.cruise-card {
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--card-border, rgba(255,255,255,0.12));
  background: var(--card-bg, rgba(255,255,255,0.06));
}

body:not(.dark) .cruise-card {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.10);
}

/* cruise-title removed - use .calc-title instead */

.cruise-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* cruise-label removed - use .calc-label instead */

.cruise-input {
  width: 100%;
  text-align: right;
  font-size: 22px;
  font-weight: 700;
  height: 64px;             /* tall for touch */
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.20);
  color: inherit;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

/* remove spinners */
.cruise-input::-webkit-outer-spin-button,
.cruise-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cruise-input[type=number] { -moz-appearance: textfield; }

body:not(.dark) .cruise-input {
  background: rgba(255,255,255,0.85);
  border-color: rgba(0,0,0,0.15);
  color: rgba(0,0,0,0.90);
}

.cruise-btn {
  width: 100%;
  height: 64px;
  font-size: 18px;
  font-weight: 800;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.12);
  color: inherit;
}

body:not(.dark) .cruise-btn {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.12);
}

.cruise-temp-wrap {
  position: relative;
}

.cruise-temp-input {
  padding-right: 110px; /* room for pills inside */
}

.cruise-temp-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  gap: 6px;
}

.cruise-pill {
  height: 38px;
  min-width: 44px;
  padding: 0 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: inherit;
  font-weight: 800;
  font-size: 14px;
}

.cruise-pill-on {
  background: rgba(255,255,255,0.18);
}

body:not(.dark) .cruise-pill {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.12);
}

body:not(.dark) .cruise-pill-on {
  background: rgba(0,0,0,0.12);
}

.cruise-output-card .cruise-result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

body:not(.dark) .cruise-output-card .cruise-result-row {
  border-bottom-color: rgba(0,0,0,0.10);
}

.cruise-result-label {
  font-size: 14px;
  opacity: 0.85;
}

.cruise-result-value {
  font-size: 28px;
  font-weight: 900;
}

.cruise-unit {
  font-size: 14px;
  font-weight: 800;
  opacity: 0.8;
  margin-left: 6px;
}

.cruise-note {
  margin-top: 10px;
  font-size: 13px;
  opacity: 0.8;
}

.cruise-footnote {
  font-size: 12px;
  opacity: 0.75;
  text-align: right;
  padding: 0 6px;
}

.cruise-rpm-slider {
    color: red;
  width: 100%;
  margin: 10px 0 10px 0;
}

.cruise-chart-wrap {
  margin-top: 12px;
}

.cruise-chart {
  width: 100%;
  height: 220px;      /* adjust to taste */
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.10);
}

body:not(.dark) .cruise-chart {
  border-color: rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.65);
}

.cruise-range {
  width: 100%;
  margin-top: 8px;
}

/* ============================================================
   Rate of Climb Calculator (.roc-*)
============================================================ */

.roc-section { max-width: 100%; overflow-x: hidden; }
.roc-section * { box-sizing: border-box; }

.roc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 700px) {
  .roc-grid { grid-template-columns: 1fr; }
}

.roc-card {
  background: rgba(30,34,44,0.92);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
}
.theme-light .roc-card {
  background: #fff;
  border-color: rgba(0,0,0,0.10);
}

/* roc-title removed - use .calc-title instead */

/* roc-field removed - use .calc-field instead */
/* roc-label removed - use .calc-label instead */

.roc-input {
  width: 100%;
  font-size: 1.15rem;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.45);
  color: #fff;
  text-align: left;
  line-height: 24px;
  box-sizing: border-box;
  -moz-appearance: textfield;
}
.roc-input::-webkit-outer-spin-button,
.roc-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.theme-light .roc-input {
  background: #f3f4f6;
  border-color: rgba(0,0,0,0.12);
  color: #111;
}
select.roc-input { text-align: left; }

.roc-output-card {
  background: rgba(20,26,36,0.95);
  border: 1px solid rgba(255,255,255,0.12);
}
.theme-light .roc-output-card {
  background: #f8fafc;
  border-color: rgba(0,0,0,0.10);
}

.roc-result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.theme-light .roc-result-row {
  border-color: rgba(0,0,0,0.06);
}
.roc-result-row:last-child { border-bottom: none; }

.roc-result-label {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.85;
}
.roc-result-value {
  font-size: 20px;
  font-weight: 900;
}
.roc-result-row-main .roc-result-value {
  font-size: 26px;
  color: #4ade80;
}
.theme-light .roc-result-row-main .roc-result-value {
  color: #16a34a;
}

.roc-unit {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.7;
  margin-left: 4px;
}

.roc-note {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  white-space: pre-line;
}
.theme-light .roc-note {
  background: rgba(0,0,0,0.05);
}

.roc-footnote {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 12px;
  text-align: center;
}

.roc-temp-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.roc-temp-wrap .roc-input {
  padding-right: 70px;
}
.roc-temp-toggle {
  position: absolute;
  right: 6px;
  display: flex;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
}
.roc-temp-btn {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
}
.roc-temp-btn-active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.theme-light .roc-temp-btn { color: rgba(0,0,0,0.5); }
.theme-light .roc-temp-btn-active {
  background: rgba(0,0,0,0.1);
  color: #111;
}

.roc-hint {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 6px;
}

.roc-mode-seg {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.18);
  margin-bottom: 14px;
  padding: 4px;
  gap: 4px;
}
.roc-mode-btn {
  flex: 1;
  padding: 10px 14px;
  font-weight: 800;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  min-height: 40px;
  border-radius: 7px;
}
.roc-mode-btn.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.theme-light .roc-mode-btn { color: rgba(0,0,0,0.6); }
.theme-light .roc-mode-btn.active {
  background: rgba(0,0,0,0.08);
  color: #111;
}

.roc-locate-btn {
  width: 46px;
  height: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(120,200,255,0.4);
  background: rgba(120,200,255,0.18);
  color: rgba(255,255,255,0.9);
  cursor: pointer;
}
.roc-locate-btn:active { transform: translateY(1px); }

/* ================================================
   Cruise Performance Calculator (.cruise-*)
   ================================================ */

/* Prevent iOS "double width" / weird scaling */
.cruise-section { max-width: 100%; overflow-x: hidden; }
.cruise-section * { box-sizing: border-box; }
.cruise-section canvas { max-width: 100%; }

/* ---------- Baseline ---------- */
.cruise-input.dark {
  background: rgba(0,0,0,0.35) !important;
  color: rgba(255,255,255,0.95) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.cruise-input.dark::placeholder { color: rgba(255,255,255,0.55) !important; }

/* Shared pill-shaped segmented button (Cruise, Holding) */
.cruise-section .seg,
.hold-seg {
  display: flex;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.25);
  padding: 4px;
  gap: 4px;
}
.cruise-section .seg button,
.hold-seg button {
  flex: 1;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 15px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: rgba(255,255,255,0.55);
  min-height: 44px;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.cruise-section .seg button.seg-on,
.hold-seg button.seg-on { background: rgba(45,45,50,0.95); color: rgba(255,255,255,0.95); }
.cruise-section .seg button:active,
.hold-seg button:active { transform: translateY(1px); }

.cruise-section .touch-check { transform: scale(1.7); transform-origin: left center; margin-right: 12px; }
.cruise-section .mini-btn {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  font-weight: 900;
  min-height: 44px;
}
.cruise-section .mini-btn:active { transform: translateY(1px); }
.cruise-section .btn-primary { border: 1px solid rgba(120,200,255,0.40); background: rgba(120,200,255,0.18); }

/* Make cards breathe a bit */
.cruise-card { border-radius: 18px; }

#cruise-station-input, #cruise-course-mag { height: 46px !important; }

/* ---------- Mobile-first overrides ---------- */
@media (max-width: 640px) {
  .cruise-section { padding-left: 10px; padding-right: 10px; }

  .cruise-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* dynamic 2-col => 1-col */
  #cruise-dynamic-panel > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Dynamic (station) tiles => 1-col */
  #cruise-dyn-station-wrap > div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Current tiles => 2-col on phone */
  .cruise-output-card > div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Recommendations => 1-col */
  #cruise-reco-wrap {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .cruise-output-card span, .cruise-output-card div { line-height: 1.15; }
  .cruise-output-card .calc-title { margin-bottom: 8px; }
}

@media (max-width: 380px) {
  /* tiny phones: Current tiles single column */
  .cruise-output-card > div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* Holding Entry Planner - styles now combined with Cruise .seg above */

/* ============================================================
   FLIGHT EVENT LOGGER
   ============================================================ */

/* Header button for flight events */
.flight-event-btn {
  margin-right: 8px;
  flex-shrink: 0;
}

/* Modal overlay */
.flight-event-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flight-event-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
}

.flight-event-modal-content {
  position: relative;
  background: var(--bg-alt);
  border-radius: var(--radius-xl);
  padding: 20px;
  width: 90%;
  max-width: 360px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.flight-event-modal-title {
  text-align: center;
  font-size: 1.2rem;
  margin: 0 0 12px 0;
  color: var(--text);
}

/* Event buttons grid */
.flight-event-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.flight-event-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  min-height: 72px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s ease;
}

.flight-event-button:hover {
  border-color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.flight-event-button:active {
  transform: scale(0.96);
  border-color: var(--green);
  background: rgba(46, 204, 113, 0.1);
}

/* Success animation class */
.flight-event-button.success {
  border-color: var(--green) !important;
  background: rgba(46, 204, 113, 0.2) !important;
  animation: flight-event-pulse 0.4s ease;
}

@keyframes flight-event-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.flight-event-icon {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.flight-event-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

/* Cancel button */
.flight-event-cancel {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.flight-event-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.flight-event-cancel:active {
  transform: scale(0.98);
}

/* Pending indicator on header button */
.flight-event-btn.has-pending::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  animation: pending-pulse 1.5s ease-in-out infinite;
}

@keyframes pending-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Recent Events Section */
.flight-event-recent {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.flight-event-recent-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.flight-event-recent-list {
  max-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flight-event-recent-loading,
.flight-event-recent-empty {
  text-align: center;
  padding: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.flight-event-recent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.flight-event-recent-item.pending {
  border-style: dashed;
  opacity: 0.7;
}

.flight-event-recent-item-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.flight-event-recent-item-details {
  flex: 1;
  min-width: 0;
}

.flight-event-recent-item-type {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.flight-event-recent-item-airport {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.85rem;
  margin-left: 4px;
}

.flight-event-recent-item-time {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.flight-event-recent-item-status {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(231, 76, 60, 0.2);
  color: var(--red);
  flex-shrink: 0;
}

/* Fuel Event Button (full width, half height) */
.flight-event-fuel-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s ease;
}

.flight-event-fuel-button:hover {
  border-color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.flight-event-fuel-button:active {
  transform: scale(0.98);
  border-color: var(--green);
  background: rgba(46, 204, 113, 0.1);
}

.flight-event-fuel-button .flight-event-icon {
  font-size: 1.6rem;
  margin-bottom: 0;
}

.flight-event-fuel-button .flight-event-label {
  font-size: 1rem;
}

/* Flight Event Panels (Engine and Fuel) */
.flight-event-panel {
  padding: 4px 0;
}

.flight-event-panel-title {
  text-align: center;
  font-size: 1.2rem;
  margin: 0 0 20px 0;
  color: var(--text);
}

.flight-event-input-group {
  margin-bottom: 16px;
}

.flight-event-time-input-group {
  margin-bottom: 20px;
}

.flight-event-input-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Large touch-friendly numeric input with +/- buttons */
.flight-event-time-input-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--bg);
}

.flight-event-time-input {
  flex: 1;
  min-width: 0;
  padding: 16px 12px;
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
}

.flight-event-time-input::placeholder {
  color: var(--muted);
  opacity: 0.5;
}

.flight-event-time-input:focus {
  outline: none;
}

.flight-event-increment-btn {
  width: 64px;
  min-width: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-alt);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.flight-event-increment-btn:first-child {
  border-right: 1px solid var(--border);
}

.flight-event-increment-btn:last-child {
  border-left: 1px solid var(--border);
}

.flight-event-increment-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.flight-event-increment-btn:active {
  background: rgba(46, 204, 113, 0.2);
  color: var(--green);
}

/* Select and text inputs for fuel panel */
.flight-event-select {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

.flight-event-select:focus {
  outline: none;
  border-color: var(--green);
}

.flight-event-text-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.2rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  box-sizing: border-box;
}

.flight-event-text-input:focus {
  outline: none;
  border-color: var(--green);
}

/* Panel button row */
.flight-event-panel-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.flight-event-panel-cancel {
  flex: 1;
  padding: 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.flight-event-panel-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.flight-event-panel-submit {
  flex: 1;
  padding: 14px;
  background: var(--green);
  border: none;
  border-radius: var(--radius-lg);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.flight-event-panel-submit:hover {
  filter: brightness(1.1);
}

.flight-event-panel-submit:active {
  transform: scale(0.98);
}

/* Fuel Balance Display */
.flight-event-fuel-balance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 14px 20px;
  margin-bottom: 16px;
  background: rgba(46, 204, 113, 0.08);
  border: 1px solid rgba(46, 204, 113, 0.25);
  border-radius: var(--radius-lg);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.fuel-bal-tank {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.fuel-bal-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fuel-bal-num {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--green);
  letter-spacing: -0.02em;
}

.fuel-bal-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  align-self: center;
}

.fuel-bal-tot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.fuel-bal-tot .fuel-bal-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fuel-bal-tot .fuel-bal-num {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--green);
  letter-spacing: -0.02em;
}

/* Quick Fuel Action Grid */
.fuel-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.fuel-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 90px;
}

.fuel-action-btn:active {
  transform: scale(0.97);
}

.fuel-action-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.fuel-action-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.fuel-action-desc {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Action button variants */
.fuel-action-full {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(46, 204, 113, 0.05));
  border-color: rgba(46, 204, 113, 0.4);
}
.fuel-action-full:hover {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.25), rgba(46, 204, 113, 0.1));
  border-color: rgba(46, 204, 113, 0.6);
}

.fuel-action-full.success {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.5), rgba(46, 204, 113, 0.3));
  border-color: rgba(46, 204, 113, 0.9);
}

.fuel-action-partial {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.15), rgba(52, 152, 219, 0.05));
  border-color: rgba(52, 152, 219, 0.4);
}
.fuel-action-partial:hover {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.25), rgba(52, 152, 219, 0.1));
  border-color: rgba(52, 152, 219, 0.6);
}

.fuel-action-dipstick {
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.15), rgba(241, 196, 15, 0.05));
  border-color: rgba(241, 196, 15, 0.4);
}
.fuel-action-dipstick:hover {
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.25), rgba(241, 196, 15, 0.1));
  border-color: rgba(241, 196, 15, 0.6);
}

.fuel-action-drain {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.15), rgba(231, 76, 60, 0.05));
  border-color: rgba(231, 76, 60, 0.4);
}
.fuel-action-drain:hover {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.25), rgba(231, 76, 60, 0.1));
  border-color: rgba(231, 76, 60, 0.6);
}

/* Fuel form views */
.fuel-form-view {
  animation: fadeIn 0.2s ease;
}

.fuel-form-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.fuel-form-back {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 10px 16px;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.fuel-form-back:active {
  transform: scale(0.97);
  background: var(--bg-card);
}

.fuel-form-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.fuel-form-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 16px 0;
  padding: 8px 12px;
  background: rgba(241, 196, 15, 0.1);
  border-radius: var(--radius);
  border-left: 3px solid rgba(241, 196, 15, 0.5);
}

/* Full width submit buttons in fuel forms */
.fuel-submit-full-width {
  width: 100%;
  margin-top: 16px;
}

.fuel-submit-full-width.tiger-btn-success {
  background: #16a34a;
  color: #fff;
  border-color: #22c55e;
}

.fuel-submit-full-width.tiger-btn-success:hover {
  background: #15803d;
}

/* Precision toggle for drain */
.fuel-precision-toggle {
  margin: 16px 0;
  padding: 16px;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.fuel-precision-label {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
}

.fuel-precision-label input[type="checkbox"] {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  accent-color: var(--green);
  cursor: pointer;
  border-radius: 6px;
}

.fuel-precision-text {
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.3;
}

.fuel-precision-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 8px 0 0 42px;
}

/* Conditional fields container */
.fuel-conditional-fields {
  transition: opacity 0.2s ease;
}

.fuel-conditional-fields.hidden {
  display: none;
}

/* Current fuel balance display (fuel log entry page) */
.fuel-current-balance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-alt, rgba(255,255,255,0.05));
  border-radius: 8px;
  font-size: 0.95rem;
}

.fuel-current-balance .fuel-balance-label {
  color: var(--text-muted, #888);
  font-weight: 500;
}

.fuel-current-balance .fuel-balance-value {
  font-weight: 600;
  color: var(--text, #fff);
}

.fuel-current-balance .fuel-balance-total {
  color: var(--text-muted, #888);
  font-size: 0.85rem;
}

/* Tank inputs side by side */
.fuel-tank-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.fuel-tank-group {
  margin-bottom: 0;
  min-width: 0; /* Prevent grid blowout */
}

.fuel-tank-group .flight-event-input-label {
  text-align: center;
  font-size: 0.75rem;
}

.fuel-tank-group .flight-event-time-input-row {
  min-width: 0; /* Prevent flex blowout */
}

.fuel-tank-group .flight-event-time-input {
  font-size: 1.2rem;
  padding: 10px 4px;
  min-width: 0; /* Allow shrinking */
}

.fuel-tank-group .flight-event-increment-btn {
  width: 40px;
  min-width: 40px;
  font-size: 1.4rem;
  padding: 0;
}

/* Full Fuel Button */
.flight-event-full-fuel-btn {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: rgba(52, 152, 219, 0.15);
  border: 2px solid rgba(52, 152, 219, 0.4);
  border-radius: var(--radius-lg);
  color: #3498db;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.flight-event-full-fuel-btn:hover {
  background: rgba(52, 152, 219, 0.25);
  border-color: #3498db;
}

.flight-event-full-fuel-btn:active {
  transform: scale(0.98);
  background: rgba(52, 152, 219, 0.3);
}

.flight-event-full-fuel-btn.hidden {
  display: none;
}

/* Price field (hide for non-refuel) */
#fuel-price-field.hidden {
  display: none;
}

/* New vendor field (hide until "Add new" selected) */
#fuel-new-vendor-field.hidden {
  display: none;
}

/* Movement field (hide for non-fuel_burn) */
#fuel-movement-field.hidden {
  display: none;
}

/* ================================================
   Generic Modal Overlay
   ================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 20px;
}

.modal-box {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  max-width: 360px;
  width: 100%;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-box h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.modal-box p {
  color: var(--muted);
  line-height: 1.5;
  margin: 12px 0;
}

/* ================================================
   Device Registration Modal
   ================================================ */
.device-register-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 20px;
}

.device-register-content {
  background: var(--surface);
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  border: 1px solid var(--border);
}

.device-register-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--text);
}

.device-register-description {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 20px 0;
  line-height: 1.4;
}

.device-register-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  margin-bottom: 16px;
  box-sizing: border-box;
  text-align: center;
}

.device-register-input:focus {
  outline: none;
  border-color: var(--accent);
}

.device-register-input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.device-register-button {
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.device-register-button:hover {
  background: var(--accent-hover);
}

.device-register-button:active {
  transform: translateY(1px);
}

.device-register-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ------------------------------------------------------------
   Tank Switch Timer - persistent banner
------------------------------------------------------------ */
.tank-switch-banner {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  cursor: pointer;
  flex-shrink: 0;
}

.tank-switch-tank-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green);
  background: rgba(46, 204, 113, 0.15);
  padding: 2px 6px;
  border-radius: 5px;
}

.tank-switch-countdown {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Overdue state */
.tank-switch-banner.overdue {
  border-color: var(--red);
}

.tank-switch-banner.overdue .tank-switch-countdown {
  color: var(--red);
  animation: tank-blink 0.8s ease-in-out infinite;
}

.tank-switch-banner.overdue .tank-switch-tank-label {
  color: var(--red);
  background: rgba(231, 76, 60, 0.15);
}

@keyframes tank-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ------------------------------------------------------------
   Tank Switch - quick menu buttons
------------------------------------------------------------ */
.flight-event-tank-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.tank-switch-modal-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(52, 152, 219, 0.3);
  background: rgba(52, 152, 219, 0.08);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}

.tank-switch-modal-btn:active {
  background: rgba(52, 152, 219, 0.2);
  transform: translateY(1px);
}

.tank-switch-modal-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Tank reset timer modal picker */
.tank-reset-time-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 16px 0 4px;
}

.tank-reset-inc-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.6rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.tank-reset-inc-btn:active {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--green);
}

.tank-reset-time-display {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
  min-width: 60px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tank-reset-unit-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 16px;
}

/* Engine start - tank selector */
.engine-tank-select-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.engine-tank-btn {
  padding: 10px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
}

.engine-tank-btn.selected {
  border-color: var(--green);
  background: rgba(46, 204, 113, 0.12);
  color: var(--green);
}

/* ------------------------------------------------------------
   Tank Switch Alert Modal
------------------------------------------------------------ */
.tank-switch-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.tank-switch-alert-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  text-align: center;
  max-width: 320px;
  width: 90%;
}

.tank-switch-alert-icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.tank-switch-alert-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.tank-switch-alert-msg {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.tank-switch-alert-overdue {
  font-size: 2rem;
  font-weight: 700;
  color: var(--red);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.tank-switch-alert-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tank-switch-alert-btn {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.tank-switch-alert-btn:active {
  transform: translateY(1px);
}

.tank-switch-alert-confirm {
  background: var(--green);
  color: #fff;
}

.tank-switch-alert-snooze {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* Escalated alert — full screen flash */
.tank-switch-alert-overlay.escalated {
  animation: tank-escalate-flash 0.6s ease-in-out infinite;
}

.tank-switch-alert-overlay.escalated .tank-switch-alert-box {
  border-color: var(--red);
  box-shadow: 0 0 40px rgba(231, 76, 60, 0.5);
}

.tank-switch-alert-overlay.escalated .tank-switch-alert-title {
  color: var(--red);
  animation: tank-blink 0.5s ease-in-out infinite;
}

@keyframes tank-escalate-flash {
  0%, 100% { background: rgba(231, 76, 60, 0.25); }
  50% { background: rgba(231, 76, 60, 0.6); }
}


/* ── App version footer ─────────────────────────────────────────────────── */
.app-version-footer {
  text-align: center;
  padding: 16px 0 24px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.05em;
  pointer-events: none;
  user-select: none;
}
