/* =====================================================
   JETLAG SYNC — Plain CSS port of the original Tailwind UI
   ===================================================== */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
  color: #1a1c1e;
  font-family:
    "Inter",
    "Helvetica Neue",
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font-family: inherit;
}

::selection {
  background: rgba(249, 115, 22, 0.25);
}

.text-orange {
  color: #f97316;
}
.text-green {
  color: #10b981;
}
.text-rose {
  color: #f43f5e;
}
.text-indigo {
  color: #4f46e5;
}
.text-amber {
  color: #f59e0b;
}
.text-sky {
  color: #38bdf8;
}
.text-slate-100 {
  color: #f1f5f9;
}
.text-slate-200 {
  color: #e2e8f0;
}
.text-slate-300 {
  color: #cbd5e1;
}
.text-slate-400 {
  color: #94a3b8;
}
.text-slate-500 {
  color: #64748b;
}
.text-gray-400 {
  color: #9ca3af;
}
.text-gray-500 {
  color: #6b7280;
}
.text-gray-600 {
  color: #4b5563;
}
.text-gray-700 {
  color: #374151;
}
.text-gray-800 {
  color: #1f2937;
}
.text-gray-900 {
  color: #111827;
}
.text-orange-500 {
  color: #f97316;
}
.text-orange-600 {
  color: #ea580c;
}
.text-orange-700 {
  color: #c2410c;
}
.text-rose-400 {
  color: #fb7185;
}
.text-rose-500 {
  color: #f43f5e;
}
.text-green-600 {
  color: #16a34a;
}
.text-green-700 {
  color: #15803d;
}
.text-sky-300 {
  color: #7dd3fc;
}
.text-sky-400 {
  color: #38bdf8;
}
.text-emerald-400 {
  color: #34d399;
}
.text-indigo-700 {
  color: #4338ca;
}
.text-indigo-900 {
  color: #312e81;
}

/* Layout */
.app-root {
  position: relative;
  min-height: 100vh;
}
.bg-atmosphere {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 400px;
  background: linear-gradient(
    180deg,
    rgba(249, 115, 22, 0.05) 0%,
    rgba(249, 115, 22, 0) 100%
  );
  pointer-events: none;
  z-index: 0;
}
.container {
  position: relative;
  z-index: 10;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 16px 24px;
}
@media (min-width: 640px) {
  .container {
    padding: 32px 24px 24px;
  }
}
@media (min-width: 1024px) {
  .container {
    padding: 32px 32px 24px;
  }
}

/* Header */
.app-header {
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 32px;
  margin-bottom: 32px;
}
@media (min-width: 768px) {
  .app-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
.app-header__brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand-icon {
  width: 56px;
  height: 56px;
  background: #f97316;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 10px 20px -5px rgba(249, 115, 22, 0.25);
  animation: brandPulse 2.5s ease-in-out infinite;
}
@keyframes brandPulse {
  0%,
  100% {
    box-shadow: 0 10px 20px -5px rgba(249, 115, 22, 0.25);
  }
  50% {
    box-shadow: 0 10px 28px -5px rgba(249, 115, 22, 0.45);
  }
}
.app-title {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 28px;
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.02em;
  color: #111827;
}
.app-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 4px 0 0;
  max-width: 560px;
  line-height: 1.5;
}
.app-header__specs {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.spec-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.2s;
}
.spec-card:hover {
  border-color: #fed7aa;
}
.spec-icon {
  display: inline-flex;
}
.spec-label {
  display: block;
  font-size: 10px;
  color: #9ca3af;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.spec-value {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
}

/* Tab switcher */
.tab-switcher {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}
.tab-switcher .tab-btn {
  flex: 1 1 0;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.tab-switcher .tab-btn .tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tab-switcher .tab-btn + .tab-btn {
  margin-left: 4px;
}
.tab-switcher .tab-btn:hover {
  color: #111827;
  background: #f9fafb;
}
.tab-switcher .tab-btn.active.planner {
  background: #f97316;
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(249, 115, 22, 0.4);
}
.tab-switcher .tab-btn.active.live {
  background: #4f46e5;
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(79, 70, 229, 0.4);
}

/* Science section */
.science-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.science-header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 16px;
  margin-bottom: 16px;
}
.science-title {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
  margin: 0;
  letter-spacing: -0.01em;
}
.science-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.science-item {
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.2s;
}
.science-item__btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #1f2937;
  transition: background 0.15s;
}
.science-item__btn:hover {
  background: rgba(243, 244, 246, 0.5);
}
.science-item__btn .tag {
  color: #f97316;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
}
.science-item__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.science-item__icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.science-item__icon svg {
  width: 16px;
  height: 16px;
}
.science-item__body {
  padding: 0 16px 14px;
  border-top: 1px solid #f3f4f6;
  background: #fff;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.7;
}
.science-item__body p {
  margin: 12px 0 0;
}
.science-disclaimer {
  text-align: center;
  font-size: 11px;
  color: #9ca3af;
  margin: 24px 0 0;
}

/* Footer */
.app-footer {
  text-align: center;
  font-size: 11px;
  color: #9ca3af;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  margin: 48px 0 24px;
}

.app-main{
  margin: 20px 0px;
}
/* Cards shared */
.card {
  background: #fff;
  border: 1px solid #f3f4f6;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}
.card-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
}
.card-indigo-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, #818cf8 0%, #4338ca 100%);
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111827;
  margin: 0;
  font-family: "Space Grotesk", "Inter", sans-serif;
}
.section-subtitle {
  font-size: 11px;
  color: #9ca3af;
  margin: 4px 0 0;
}

/* Buttons */
.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  background: transparent;
}
.btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.btn-orange {
  background: #f97316;
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(249, 115, 22, 0.4);
}
.btn-orange:hover {
  background: #ea580c;
  box-shadow: 0 10px 25px -10px rgba(249, 115, 22, 0.5);
}
.btn-indigo {
  background: #4f46e5;
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(79, 70, 229, 0.4);
}
.btn-indigo:hover {
  background: #4338ca;
}
.btn-green {
  background: #16a34a;
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(22, 163, 74, 0.4);
}
.btn-green:hover {
  background: #15803d;
}
.btn-sky {
  background: #0284c7;
  color: #fff;
}
.btn-sky:hover {
  background: #0369a1;
}
.btn-ghost {
  background: #fff;
  color: #374151;
  border: 1px solid #e5e7eb;
}
.btn-ghost:hover {
  border-color: #fed7aa;
  color: #111827;
}
.btn-soft {
  background: #f3f4f6;
  color: #1f2937;
}
.btn-soft:hover {
  background: #e5e7eb;
}
.btn-danger {
  background: #f43f5e;
  color: #fff;
}
.btn-danger:hover {
  background: #e11d48;
}
.btn-block {
  width: 100%;
}
.btn-sm {
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 10px;
}

/* Inputs */
.input,
.select,
textarea.input {
  background: #f9fafb;
  border: 2px solid #f3f4f6;
  border-radius: 12px;
  padding: 10px;
  font-size: 12px;
  color: #1f2937;
  outline: none;
  transition:
    border 0.2s,
    background 0.2s;
  width: 100%;
  font-family: inherit;
}
.input.mono,
.select.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.input:focus,
.select:focus {
  border-color: #fb923c;
  background: #fff;
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* Grid utilities */
.grid {
  display: grid;
  gap: 16px;
}
.grid-1 {
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .grid-md-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .grid-lg-12 {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  .grid-lg-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .grid-lg-8 {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}
@media (min-width: 1280px) {
  .grid-xl-12 {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  .col-xl-8 {
    grid-column: span 8;
  }
  .col-xl-4 {
    grid-column: span 4;
  }
  .col-xl-12 {
    grid-column: span 12;
  }
}
@media (min-width: 1024px) {
  .col-lg-4 {
    grid-column: span 4;
  }
  .col-lg-8 {
    grid-column: span 8;
  }
}

/* Planner */
.planner-settings {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.settings-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f97316;
}
.settings-title-row h3 {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
  margin: 0;
}
.settings-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-row > label {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.fatigue-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.fatigue-tile {
  text-align: center;
  font-size: 10px;
  color: #4b5563;
  padding: 8px 4px;
  border-radius: 14px;
  border: 2px solid #f3f4f6;
  background: #f9fafb;
  transition: all 0.2s;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.3;
}
.fatigue-tile:hover {
  border-color: #d1d5db;
}
.fatigue-tile.active.green {
  border-color: #10b981;
  background: #ecfdf5;
  color: #047857;
  font-weight: 700;
}
.fatigue-tile.active.orange {
  border-color: #f97316;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 700;
}
.fatigue-tile.active.yellow {
  border-color: #eab308;
  background: #fefce8;
  color: #a16207;
  font-weight: 700;
}
.fatigue-tile.active.red {
  border-color: #f43f5e;
  background: #fff1f2;
  color: #b91c1c;
  font-weight: 700;
}

.settings-cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.settings-cols-2 .col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-cols-2 label {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 4px;
}
.settings-cols-2 label svg {
  color: #9ca3af;
}

.timezone-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
  align-items: center;
}
.timezone-row input[type="range"] {
  width: 100%;
  accent-color: #f97316;
  margin-top: 8px;
}
.tz-badge {
  background: #fff7ed;
  border: 2px solid #ffedd5;
  border-radius: 14px;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  color: #c2410c;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
}
.helper-text {
  font-size: 10px;
  color: #9ca3af;
  line-height: 1.5;
}

.tip-box {
  background: rgba(255, 247, 237, 0.6);
  border: 1px solid #ffedd5;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tip-box h4 {
  font-size: 11px;
  font-weight: 800;
  color: #c2410c;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tip-box h4 svg {
  color: #f97316;
}
.tip-box p {
  font-size: 11px;
  color: #c2410c;
  margin: 0;
  line-height: 1.6;
}
.tip-box p b {
  font-weight: 700;
}

/* Chart area */
.chart-card {
  padding: 24px;
}
.chart-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 16px;
  margin-bottom: 16px;
}
@media (min-width: 640px) {
  .chart-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
.chart-legend {
  display: flex;
  gap: 16px;
  font-size: 11px;
  flex-wrap: wrap;
}
.chart-legend .item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
}
.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.swatch-flight {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid #3b82f6;
}
.swatch-landing {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
}

.target-status {
  padding: 8px 12px;
  border-radius: 14px;
  border: 2px solid;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.target-status.ok {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #047857;
}
.target-status.warn {
  background: #fefce8;
  border-color: #fef08a;
  color: #a16207;
}
.target-status .label {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 800;
  opacity: 0.6;
  letter-spacing: 0.05em;
}
.target-status .value {
  font-size: 13px;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
}

.target-advice {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 2px solid;
  font-size: 12px;
  line-height: 1.6;
  display: flex;
  gap: 12px;
}
.target-advice.ok {
  background: #ecfdf5;
  border-color: #d1fae5;
  color: #065f46;
}
.target-advice.fail {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}
.target-advice .advice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.target-advice .advice-icon svg {
  width: 22px;
  height: 22px;
}
.target-advice p {
  margin: 0;
}
.target-advice p.title {
  font-weight: 800;
  margin-bottom: 4px;
}
.target-advice p.body {
  color: inherit;
  opacity: 0.9;
}

.chart-wrap {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 12px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: visible;
}
.chart-wrap svg {
  display: block;
  width: 100%;
  overflow: visible;
  cursor: crosshair;
  user-select: none;
}
.chart-footnote {
  font-size: 11px;
  color: #64748b;
  text-align: center;
  margin-top: 4px;
  font-family: "JetBrains Mono", monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.chart-footnote svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.chart-footnote b {
  color: #fb7185;
  font-weight: 600;
}

.chart-tooltip {
  position: absolute;
  z-index: 20;
  background: rgba(2, 6, 23, 0.95);
  border: 1px solid #1e293b;
  color: #f1f5f9;
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  font-size: 12px;
  max-width: 240px;
  pointer-events: none;
  backdrop-filter: blur(4px);
  font-family: "Inter", sans-serif;
  font-weight: 500;
}
.chart-tooltip h5 {
  margin: 0 0 4px;
  font-size: 12px;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 4px;
  color: #38bdf8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chart-tooltip .tooltip-phase {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chart-tooltip .tooltip-phase svg {
  width: 12px;
  height: 12px;
}
.chart-tooltip .row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
}
.chart-tooltip .row .v {
  font-family: "JetBrains Mono", monospace;
  color: #e2e8f0;
}
.chart-tooltip .row .v.ok {
  color: #34d399;
  font-weight: 700;
}
.chart-tooltip .row .v.sky {
  color: #7dd3fc;
}
.chart-tooltip .status {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(15, 23, 42, 0.6);
  color: #cbd5e1;
  font-style: italic;
  font-size: 11px;
  line-height: 1.5;
}

/* Sleep / nap planner cards */
.planner-tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
}
.planner-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.planner-tile-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 6px;
}
.planner-tile-head h3 svg {
  color: #f97316;
}
.planner-tile-head .count {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-weight: 700;
}
.planner-tile p {
  font-size: 11px;
  color: #9ca3af;
  margin: 0 0 12px;
}

.sleep-list,
.nap-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 12px;
}
.sleep-row,
.nap-row {
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.sleep-row .info b {
  color: #1f2937;
  font-weight: 800;
}
.sleep-row .info .meta {
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.sleep-row .info .gain {
  color: #f97316;
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}
.empty-row {
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  padding: 12px;
  font-style: italic;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px dashed #e5e7eb;
}
.row-del {
  background: transparent;
  border: 0;
  color: #f43f5e;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
  cursor: pointer;
}
.row-del:hover {
  background: #fff1f2;
}

.input-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.input-grid-3 .col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.input-grid-3 label {
  font-size: 10px;
  color: #6b7280;
  font-weight: 700;
}

.warn-text {
  font-size: 10px;
  color: #f43f5e;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 12px;
  padding: 8px 10px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 6px;
}
.warn-text svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Live logger */
.live-config {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.compass-icon {
  width: 64px;
  height: 64px;
  background: #fff7ed;
  border: 2px solid #ffedd5;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f97316;
  animation: compassSpin 8s linear infinite;
}
@keyframes compassSpin {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}
.live-config h3 {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.01em;
}
.live-config p {
  font-size: 12px;
  color: #6b7280;
  max-width: 520px;
  margin: 8px auto 0;
  line-height: 1.6;
}

.live-config .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 480px;
  text-align: left;
  margin-top: 8px;
}
.live-config .row .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f9fafb;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #f3f4f6;
}
.live-config .row .field label {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}
.live-config .row .field select {
  font-size: 12px;
}

.live-dash {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.live-dash-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-width: 768px) {
  .live-dash-head {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
.live-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.live-status-icon {
  width: 48px;
  height: 48px;
  background: #fff7ed;
  border: 1px solid #ffedd5;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f97316;
}
.live-status-icon svg {
  width: 22px;
  height: 22px;
}
.live-status-row h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-pill {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 999px;
}
.status-pill.flight {
  background: #fff7ed;
  border: 1px solid #ffedd5;
  color: #c2410c;
}
.status-pill.landed {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #047857;
}
.live-status-row .sub {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "JetBrains Mono", monospace;
}
.live-status-row .sub b {
  color: #c2410c;
}

.score-badge {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  padding: 12px 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.score-badge .num {
  font-size: 28px;
  font-weight: 900;
  font-family: "JetBrains Mono", monospace;
  color: #f97316;
  line-height: 1.1;
}
.score-badge .lab {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 800;
  color: #9ca3af;
  letter-spacing: 0.05em;
}
.score-badge .divider {
  width: 2px;
  height: 32px;
  background: #e5e7eb;
}
.score-badge .target {
  font-size: 11px;
  color: #6b7280;
  max-width: 160px;
  line-height: 1.4;
}
.score-badge .target b {
  color: #111827;
}

.stage-tip {
  margin-top: 20px;
  background: rgba(255, 247, 237, 0.5);
  border: 1px solid #ffedd5;
  padding: 14px;
  border-radius: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: #c2410c;
  line-height: 1.6;
}
.stage-tip svg {
  color: #f97316;
  flex-shrink: 0;
}
.stage-tip b {
  font-weight: 700;
}

.console-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.console-card h3 {
  font-size: 13px;
  font-weight: 800;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 12px;
  margin: 0;
}
.console-card h3 svg {
  color: #f97316;
}

.action-block {
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
}
.action-block h4 {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.action-block h4 svg {
  color: #f97316;
}
.action-block p {
  font-size: 11px;
  color: #6b7280;
  margin: 4px 0 0;
  line-height: 1.5;
}

.sleep-timer {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  padding: 14px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sleep-timer .row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}
.sleep-timer .label {
  color: #4338ca;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sleep-timer .label .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  animation: ping 1.6s linear infinite;
}
@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  80%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}
.sleep-timer .clock {
  font-family: "JetBrains Mono", monospace;
  color: #312e81;
  font-weight: 800;
  font-size: 12px;
}

.input-row-flex {
  display: flex;
  gap: 8px;
}
.input-row-flex input {
  width: 96px;
}

/* Live ledger */
.ledger-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ledger-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ledger-head h3 {
  font-size: 13px;
  font-weight: 800;
  color: #111827;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ledger-head h3 svg {
  color: #f97316;
}
.ledger-head .reset {
  font-size: 10px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f9fafb;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #f3f4f6;
  font-weight: 700;
}
.ledger-head .reset:hover {
  color: #f43f5e;
}

.ledger-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.ledger-empty {
  font-size: 12px;
  color: #9ca3af;
  font-style: italic;
  text-align: center;
  padding: 24px 0;
}
.ledger-row {
  position: relative;
  padding-left: 18px;
  border-left: 1px solid #f3f4f6;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  padding-bottom: 8px;
}
.ledger-row .dot {
  position: absolute;
  left: -5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
}
.ledger-row .dot.flight_sleep {
  background: #6366f1;
}
.ledger-row .dot.nap {
  background: #fb923c;
  animation: ping 1.6s linear infinite;
}
.ledger-row .dot.caffeine {
  background: #16a34a;
}
.ledger-row .dot.landing {
  background: #f97316;
}
.ledger-row .content {
  flex: 1;
}
.ledger-row .time {
  font-size: 11px;
  color: #9ca3af;
  font-family: "JetBrains Mono", monospace;
}
.ledger-row .desc {
  color: #1f2937;
  font-weight: 700;
  margin-top: 2px;
  line-height: 1.5;
}
.ledger-row .meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.ledger-row .meta-row .chip {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f9fafb;
  font-family: "JetBrains Mono", monospace;
  color: #c2410c;
  font-weight: 800;
  border: 1px solid #f3f4f6;
}
.ledger-row .meta-row .delta {
  font-size: 10px;
  font-weight: 700;
}
.ledger-row .meta-row .delta.positive {
  color: #16a34a;
}
.ledger-row .meta-row .delta.negative {
  color: #f43f5e;
}
.ledger-row .del {
  background: transparent;
  border: 0;
  color: #9ca3af;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
}
.ledger-row .del:hover {
  color: #f43f5e;
}

/* Target pulse for the 10 PM marker */
.target-pulse {
  animation: targetPulse 1.8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes targetPulse {
  0%,
  100% {
    r: 7;
  }
  50% {
    r: 9;
  }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  padding: 24px;
  border-radius: 16px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}
.modal-card .icon {
  color: #facc15;
  font-size: 48px;
  line-height: 1;
}
.modal-card h4 {
  font-size: 16px;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0;
}
.modal-card p {
  font-size: 12px;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.5;
}
.modal-card p b {
  color: #38bdf8;
}
.stars-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.star-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #020617;
  border: 1px solid #1e293b;
  color: #cbd5e1;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.star-btn:hover {
  background: #1e293b;
}
.star-btn.active {
  background: #facc15;
  border-color: #fde047;
  color: #422006;
}
.modal-card .manual-hours {
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid #1e293b;
  padding: 10px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  font-size: 11px;
  color: #94a3b8;
}
.modal-card .manual-hours input {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 4px;
  text-align: center;
  width: 96px;
  color: #f1f5f9;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}
.modal-actions {
  display: flex;
  gap: 8px;
}
.modal-actions .btn {
  flex: 1;
}
.warn-row {
  font-size: 11px;
  color: #fb7185;
  background: rgba(244, 63, 94, 0.05);
  padding: 6px 10px;
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-radius: 6px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 6px;
}
.warn-row svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Responsive helpers */
@media (max-width: 640px) {
  .app-title {
    font-size: 22px;
  }
  .app-subtitle {
    font-size: 12px;
  }
  .spec-card {
    padding: 8px 10px;
  }
  .spec-value {
    font-size: 11px;
  }
}
