.chart-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.chart-modes button {
  border-radius: 14px 14px 0 14px;
  border: 1px solid rgba(140, 170, 200, 0.35);
  background: transparent;
  color: inherit;
  padding: 6px 12px;
  font: 600 12px Outfit, "IBM Plex Sans", sans-serif;
  cursor: pointer;
}
.chart-modes button.on {
  background: #1a1916;
  color: #fffdf9;
  border-color: transparent;
}
html[data-theme="light"] .chart-modes button {
  border-color: rgba(28, 25, 21, 0.16);
  color: #1a1916;
}
html[data-theme="light"] .chart-modes button.on {
  background: #1a1916;
  color: #fffdf9;
}
body.planner-page .ops-grid {
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  align-items: start;
}
body.planner-page .col-left { grid-column: 1; grid-row: 1 / span 2; }
body.planner-page .col-center { grid-column: 2; grid-row: 1; min-width: 0; }
body.planner-page .col-right {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-width: 0;
}
body.planner-page .mast h1,
body.planner-page .planner-rail h1 {
  font-family: Outfit, "IBM Plex Sans", sans-serif;
  letter-spacing: -0.03em;
}
@media (max-width: 1100px) {
  body.planner-page .ops-grid { grid-template-columns: 1fr; }
  body.planner-page .col-left,
  body.planner-page .col-center,
  body.planner-page .col-right {
    grid-column: 1;
    grid-row: auto;
  }
  body.planner-page .col-right { grid-template-columns: 1fr; }
}

body.simple .shell,
body.simple .planner-shell,
body.simple .loading-screen,
body.simple #moonAssist { display: none !important; }
body.simple {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(78, 140, 180, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(224, 177, 74, 0.08), transparent 50%),
    #0b0e13;
  min-height: 100vh;
  height: auto !important;
  overflow-x: hidden;
  overflow-y: auto !important;
  color: #e8edf2;
}
html[data-theme="light"] body.simple {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(78, 140, 180, 0.1), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(224, 177, 74, 0.08), transparent 50%),
    #f3f0ea !important;
  color: #1a1916 !important;
}

.simple-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
  font-family: Outfit, "IBM Plex Sans", sans-serif;
  transition: grid-template-columns 0.25s ease;
}
body.luna-collapsed .simple-wrap {
  grid-template-columns: minmax(0, 1fr);
}
body.luna-collapsed .sp-luna { display: none !important; }
.simple-plan { min-width: 0; }
.sp-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.sp-top h1 { margin: 0; }
.site-field {
  display: block;
  margin: 8px 0 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #8fa3b8);
}
.site-select,
#simple-site {
  width: 100%;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px 14px 0 14px !important;
  background: var(--panel, #171e2a) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%8fa3b8' d='M1 1l5 5 5-5'/></svg>") no-repeat right 14px center;
  color: inherit;
  padding: 14px 40px 14px 14px;
  font: 600 15px Outfit, "IBM Plex Sans", sans-serif;
  margin-bottom: 18px;
}
html[data-theme="light"] .site-select,
html[data-theme="light"] #simple-site {
  background-color: #fffdf9;
  border-color: rgba(28, 25, 21, 0.14);
  color: #1a1916;
}
.simple-plan h1 {
  font-size: clamp(34px, 5vw, 48px);
  letter-spacing: -0.045em;
  margin: 0 0 8px;
  line-height: 1.05;
}
.simple-plan .lede {
  margin: 0 0 22px;
  color: var(--muted, #8fa3b8);
  max-width: 38rem;
  line-height: 1.45;
}
.sp-sec-head { margin: 0 0 12px; }
.sp-sec-head h2 {
  margin: 0 0 4px;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #8fa3b8);
  font-weight: 600;
}
.sp-sec-head p { margin: 0; color: var(--muted, #8fa3b8); font-size: 14px; }
.sp-empty {
  border-radius: 18px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted, #8fa3b8);
}

.simple-plan select,
.simple-plan input[type="number"],
.simple-plan .drop {
  width: 100%;
  box-sizing: border-box;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 22, 28, 0.92);
  color: inherit;
  padding: 14px 16px;
  font: 600 15px Outfit, "IBM Plex Sans", sans-serif;
}
.simple-plan .drop {
  display: block;
  text-align: center;
  cursor: pointer;
  margin-top: 10px;
}
.simple-plan .drop input { display: none; }
.simple-plan .err { color: #e07a6a; min-height: 1.2em; margin: 8px 0 0; }
.simple-plan .loaded { margin: 8px 0 0; color: #c5ddd0; font-weight: 600; }
.mode-row {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}
.mode-row button {
  border-radius: 14px 14px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: inherit;
  padding: 8px 14px;
  font: 600 13px Outfit, sans-serif;
  cursor: pointer;
}
.mode-row button.on {
  background: #fffdf9;
  color: #1a1916;
  border-color: transparent;
}
.space-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.space-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #9aa6b4;
}
.sp-btn {
  border: 0;
  border-radius: 14px 14px 0 14px;
  background: #fffdf9;
  color: #1a1916;
  padding: 12px 16px;
  font: 700 14px Outfit, sans-serif;
  cursor: pointer;
}
.sp-btn.ghost {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.sp-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.cal { display: grid; gap: 14px; margin-top: 8px; }
.day {
  border-radius: 20px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.day h3 {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa6b4;
}
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.slot {
  display: grid;
  gap: 2px;
  border: 0;
  border-radius: 14px 14px 0 14px !important;
  padding: 12px 12px 11px;
  background: var(--panel, #171e2a);
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: 600 14px Outfit, sans-serif;
  box-shadow: inset 3px 0 0 transparent;
  transition: transform 0.15s ease, background 0.15s ease;
}
.slot.best {
  outline: 1px solid rgba(224, 177, 74, 0.55);
  outline-offset: 1px;
}
.slot:hover { transform: translateY(-1px); }
.slot.go { box-shadow: inset 3px 0 0 var(--go, #3ecf8e); }
.slot.caution { box-shadow: inset 3px 0 0 var(--caution, #e0b14a); }
.slot.nogo { box-shadow: inset 3px 0 0 var(--nogo, #e25b5b); }
.slot.on { outline: 2px solid var(--text, #e6eef8); outline-offset: 1px; }
.slot-time { font-size: 13px; color: var(--text, #e6eef8); }
.slot-call { font-size: 16px; letter-spacing: -0.02em; }
.slot.go .slot-call { color: var(--go, #3ecf8e); }
.slot.caution .slot-call { color: var(--caution, #e0b14a); }
.slot.nogo .slot-call { color: var(--nogo, #e25b5b); }
.slot-score { font-size: 12px; color: var(--muted, #8fa3b8); }

#sp-sheet {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: 72px 20px 24px;
}
#sp-sheet[hidden] { display: none !important; }
.sp-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 14, 19, 0.72);
  backdrop-filter: blur(6px);
}
.sp-sheet-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(80vh, 760px);
  overflow: auto;
  border-radius: 14px 14px 0 14px !important;
  background: linear-gradient(165deg, var(--panel-hi, rgba(28, 37, 51, 0.96)), var(--panel-lo, rgba(18, 24, 33, 0.98)));
  border: 1px solid var(--line, rgba(140, 170, 200, 0.14));
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-panel, 0 18px 48px rgba(0, 0, 0, 0.35));
  color: var(--text, #e6eef8);
}
.sheet-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 14px 14px 0 14px !important;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.sheet-where { margin: 0; color: var(--muted, #8fa3b8); font-size: 13px; }
.sheet-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 4px;
}
.sheet-top h2 { margin: 0; font-size: 36px; letter-spacing: -0.04em; }
.sheet-top h2.go { color: var(--go, #3ecf8e); }
.sheet-top h2.caution { color: var(--caution, #e0b14a); }
.sheet-top h2.nogo { color: var(--nogo, #e25b5b); }
.sheet-score { font-size: 28px; font-weight: 700; }
.sheet-score span { font-size: 14px; color: var(--muted, #8fa3b8); font-weight: 500; }
.sheet-meta { margin: 0 0 14px; color: var(--muted, #8fa3b8); }
.sheet-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sheet-list li {
  border-radius: 14px 14px 0 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line, rgba(140, 170, 200, 0.14));
}
.sheet-row, .sheet-vals {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.sheet-call { font-size: 12px; letter-spacing: 0.06em; font-weight: 700; }
.sheet-list .go .sheet-call { color: var(--go, #3ecf8e); }
.sheet-list .caution .sheet-call { color: var(--caution, #e0b14a); }
.sheet-list .nogo .sheet-call { color: var(--nogo, #e25b5b); }
.sheet-vals { margin-top: 4px; font-size: 13px; color: var(--muted, #8fa3b8); }
.sheet-vals strong { color: var(--text, #e6eef8); font-size: 15px; }
.sheet-bar {
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px 0 4px;
  overflow: hidden;
}
.sheet-bar i { display: block; height: 100%; border-radius: inherit; }
.sheet-room { font-size: 12px; color: var(--muted, #8fa3b8); }
.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

#sp-margin { margin-top: 26px; }
.margin-clock {
  position: relative;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-bottom: 12px;
}
.margin-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--go, #3ecf8e), var(--caution, #e0b14a));
}
.margin-clock span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 13px Outfit, sans-serif;
}
.margin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.margin-chip {
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.margin-chip b { display: block; font-size: 12px; margin-bottom: 6px; }
.margin-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 4px;
}
.margin-track i { display: block; height: 100%; }
.margin-chip span { font-size: 11px; color: #9aa6b4; }
.margin-chip.over span { color: var(--nogo, #e25b5b); }

#sp-stage {
  margin-top: 26px;
  border-radius: 22px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
#sp-stage[hidden] { display: none !important; }
#sp-stage h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -0.03em; }
#simple-graph-sub { margin: 0 0 12px; color: var(--muted, #8fa3b8); font-size: 14px; }
#sp-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.haz-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 7px 11px;
  font: 600 12px Outfit, sans-serif;
  cursor: pointer;
  opacity: 0.55;
  user-select: none;
}
.haz-toggle.on { opacity: 1; background: rgba(255, 255, 255, 0.05); }
.haz-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.haz-toggle i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.graph-box {
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel-lo, rgba(18, 24, 33, 0.97));
}
.graph-box canvas { width: 100%; display: block; }
.sp-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.sp-luna {
  position: sticky;
  top: 76px;
  border-radius: 22px;
  padding: 16px;
  background: linear-gradient(165deg, var(--panel-hi, rgba(28, 37, 51, 0.94)), var(--panel-lo, rgba(18, 24, 33, 0.97)));
  border: 1px solid var(--line, rgba(140, 170, 200, 0.14));
  min-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sp-luna h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.sp-luna .luna-lede {
  margin: 0;
  color: var(--muted, #8fa3b8);
  font-size: 13px;
  line-height: 1.4;
}
#sp-luna-log {
  flex: 1;
  min-height: 240px;
  max-height: 52vh;
  overflow: auto;
  display: grid;
  gap: 8px;
  align-content: start;
}
#sp-luna-log p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
}
#sp-luna-log .bot { background: rgba(255, 255, 255, 0.05); }
#sp-luna-log .user {
  background: #fffdf9;
  color: #1a1916;
  justify-self: end;
  max-width: 92%;
}
#sp-luna-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
#sp-luna-input {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0b0e13;
  color: inherit;
  padding: 11px 14px;
  font: 500 13px Outfit, sans-serif;
}

@media (max-width: 960px) {
  .simple-wrap { grid-template-columns: 1fr; }
  .sp-luna { position: static; min-height: 0; }
  .space-grid { grid-template-columns: 1fr; }
}

html[data-theme="light"] .simple-plan .lede,
html[data-theme="light"] .sp-sec-head h2,
html[data-theme="light"] .sp-sec-head p,
html[data-theme="light"] .day h3,
html[data-theme="light"] .slot-time,
html[data-theme="light"] .slot-score,
html[data-theme="light"] .sheet-where,
html[data-theme="light"] .sheet-meta,
html[data-theme="light"] .sheet-vals,
html[data-theme="light"] .sheet-room,
html[data-theme="light"] .margin-chip span,
html[data-theme="light"] #simple-graph-sub,
html[data-theme="light"] .sp-luna .luna-lede { color: #5c564c; }
html[data-theme="light"] .simple-plan select,
html[data-theme="light"] .simple-plan input[type="number"],
html[data-theme="light"] .simple-plan .drop,
html[data-theme="light"] .day,
html[data-theme="light"] .slot,
html[data-theme="light"] .sp-sheet-card,
html[data-theme="light"] #sp-stage,
html[data-theme="light"] .graph-box,
html[data-theme="light"] .sp-luna,
html[data-theme="light"] .margin-chip,
html[data-theme="light"] .sheet-list li {
  background: #fffdf9;
  color: #1a1916;
  border-color: rgba(28, 25, 21, 0.1);
}
html[data-theme="light"] .mode-row button.on,
html[data-theme="light"] .sp-btn { background: #1a1916; color: #fffdf9; }
html[data-theme="light"] .mode-row button { border-color: rgba(28, 25, 21, 0.14); }
html[data-theme="light"] .slot.on { outline-color: #1a1916; }
html[data-theme="light"] #sp-luna-log .bot { background: #f3f0ea; }
html[data-theme="light"] #sp-luna-input {
  background: #f3f0ea;
  border-color: rgba(28, 25, 21, 0.12);
  color: #1a1916;
}
html[data-theme="light"] .sp-btn.ghost {
  border-color: rgba(28, 25, 21, 0.16);
  color: #1a1916;
}
html[data-theme="light"] .sp-sheet-backdrop { background: rgba(40, 36, 30, 0.4); }

/* cut-corner sitewide */
.simple-plan, .sp-luna, .sp-sheet-card, .graph-box, .slot, .drop,
.panel, .hz-cell, .dose-cell, .metric, .base-pick, #ops-banner,
.mode-row button, .sp-btn, .chart-modes button, input, select, .loaded, .err {
  border-radius: 14px 14px 0 14px !important;
}
