:root {
  --ink: #102033;
  --muted: #5c6b7a;
  --paper: #eef3f8;
  --card: #ffffff;
  --line: #c5d0dc;
  --navy: #0b3a6e;
  --navy-2: #062847;
  --amber: #e87722;
  --amber-bg: #fff1e4;
  --green: #2a7a52;
  --green-bg: #e3f3ea;
  --red: #b42318;
  --red-bg: #fde8e6;
  --shadow: 0 18px 50px rgba(6, 40, 71, 0.22);
  --font: "Segoe UI", "Calibri", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #071a2e;
}

button, .btn { font: inherit; cursor: pointer; border: 0; border-radius: 8px; }

.btn-orange {
  background: var(--amber);
  color: #fff;
  padding: 0.9rem 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.btn-orange:hover { filter: brightness(1.05); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.7rem 1rem;
  color: var(--ink);
}
.btn-ghost.light {
  border-color: rgba(255,255,255,0.35);
  color: #fff;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

/* —— Hero (TakeOff-inspired grid) —— */
.hero {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(7, 26, 46, 0.2), rgba(7, 26, 46, 0.55)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(255,255,255,0.05) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(255,255,255,0.05) 31px 32px),
    linear-gradient(160deg, #0a4a8a 0%, #07284e 55%, #05182c 100%);
  color: #fff;
}
.hero-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
}
.logo { font-weight: 800; letter-spacing: 0.02em; }
.logo small {
  display: block;
  font-weight: 500;
  opacity: 0.7;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.chip-quiet { font-size: 0.8rem; opacity: 0.75; margin-right: 0.8rem; }
.hero-nav-right { display: flex; align-items: center; gap: 0.5rem; }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  align-items: center;
}
.badge {
  display: inline-block;
  background: rgba(232, 119, 34, 0.18);
  color: #ffd7b0;
  border: 1px solid rgba(232, 119, 34, 0.45);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  line-height: 1.08;
  margin: 0.8rem 0 1rem;
  font-weight: 800;
}
.hero h1 em {
  font-style: normal;
  color: var(--amber);
}
.lead { font-size: 1.08rem; line-height: 1.5; opacity: 0.92; max-width: 36rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem; margin: 1.4rem 0 1.2rem; }
.micro { font-size: 0.85rem; opacity: 0.75; }
.chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
  max-width: 34rem;
}
.chips li {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
}

.preview-sheet {
  position: relative;
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 320px;
}
.hero[data-phase="upload"] .preview-sheet {
  box-shadow: var(--shadow);
}
.hero[data-phase="upload"] .preview-sheet.dragover {
  box-shadow: var(--shadow), 0 0 0 3px #e87722;
}
.preview-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  background: #eef3f8;
  font-size: 0.78rem;
  font-weight: 700;
}
.reading-pill {
  background: #e87722;
  color: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  white-space: nowrap;
}
.hero[data-phase="reading"] .reading-pill { animation: blink 1.4s ease-in-out infinite; }
.hero[data-phase="overview"] .reading-pill {
  background: var(--navy);
  animation: none;
}
.preview-frame { position: relative; background: #d9e1ea; }
.preview-plan {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  user-select: none;
  background: #d9e1ea;
}
.hero[data-phase="upload"] .preview-plan { display: none; }
.hero[data-phase="upload"] .preview-frame {
  min-height: 320px;
  background: #eef3f8;
  padding: 0.7rem 0.75rem 0.85rem;
}
.file-picker { display: none; max-height: 380px; overflow: auto; }
.hero[data-phase="upload"] .file-picker { display: block; }
.file-picker-path {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.file-group {
  margin: 0.55rem 0 0.3rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7a8a9a;
}
.file-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  width: 100%;
  margin: 0 0 0.28rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
  font: inherit;
  color: var(--ink);
}
.file-row .fname { font-weight: 700; font-size: 0.82rem; }
.file-row .fmeta { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.file-row.ready {
  border-color: rgba(232, 119, 34, 0.55);
  box-shadow: 0 0 0 1px rgba(232, 119, 34, 0.2);
  cursor: pointer;
}
.file-row.ready:hover { background: #fff7ef; }
.file-row.ready .fmeta { color: #c45a0c; font-weight: 700; }
.file-row.locked {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f4f7fa;
}
.hero-scan {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #e87722, transparent);
  animation: heroScan 2.2s linear infinite;
  pointer-events: none;
}
.hero[data-phase="reading"] .hero-scan { display: block; }
.hero-steps {
  display: none;
  position: absolute;
  left: 0.8rem;
  bottom: 0.8rem;
  margin: 0;
  padding: 0.65rem 0.8rem;
  list-style: none;
  width: min(240px, calc(100% - 1.6rem));
  background: rgba(11, 58, 110, 0.94);
  color: #fff;
  border-radius: 12px;
  font-size: 0.78rem;
  box-shadow: var(--shadow);
}
.hero[data-phase="reading"] .hero-steps { display: block; }
.hero-steps li {
  opacity: 0.4;
  padding: 0.18rem 0;
}
.hero-steps li.on { opacity: 1; color: #ffd7b0; font-weight: 700; }
.hero-steps li.done { opacity: 0.9; }
.hero-steps li.done::before { content: "✓ "; color: #9ee0c0; }
.hero-steps li.on::before { content: "▸ "; }
.preview-list {
  display: none;
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: 236px;
  background: #0b3a6e;
  color: #fff;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  box-shadow: var(--shadow);
  font-size: 0.78rem;
}
.hero[data-phase="overview"] .preview-list { display: block; }
.preview-list header { font-weight: 800; margin-bottom: 0.4rem; }
.preview-list header small { display: block; font-weight: 500; opacity: 0.7; }
.preview-list p { margin: 0.25rem 0; opacity: 0.95; }
.preview-list b { color: #ffd7b0; font-weight: 700; }
.preview-list footer { margin-top: 0.5rem; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 0.4rem; }
.hero-bar { max-width: 22rem; margin: 1rem 0 0; }

@keyframes heroScan {
  0% { top: 0; }
  100% { top: calc(100% - 3px); }
}
@keyframes blink {
  50% { opacity: 0.55; }
}

.bar {
  height: 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 1rem;
}
.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--amber);
  transition: width 0.35s linear;
}

/* App chrome — same studio as the cover */
.app {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  color: #fff;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(255,255,255,0.035) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(255,255,255,0.035) 31px 32px),
    linear-gradient(160deg, #0a4a8a 0%, #07284e 55%, #05182c 100%);
}
.app.on { display: flex; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.2rem;
  background: transparent;
  color: #fff;
}
.top-tools { display: flex; align-items: center; gap: 0.6rem; }
.brand { font-weight: 700; }
.brand span { opacity: 0.7; font-weight: 500; margin-left: 0.5rem; font-size: 0.85rem; }
.mode {
  display: flex;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 0.15rem;
}
.mode button {
  background: transparent;
  color: #d7e2ee;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
}
.mode button.active { background: #fff; color: var(--navy); }

.pitch-caption {
  margin: 0;
  padding: 0.55rem 1.2rem;
  background: var(--amber);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  padding: 0 1.2rem 0.9rem;
  background: transparent;
  border: 0;
}
.t-card {
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.82rem;
  color: #e8eef5;
}
.t-card strong {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9eb0c4;
  font-weight: 700;
}
.t-card b { display: block; font-size: 1.25rem; margin: 0.15rem 0; color: #fff; }
.t-card.warn { border-color: rgba(232, 119, 34, 0.45); background: rgba(232, 119, 34, 0.12); }
.t-card.warn b { color: #ffd7b0; }
.t-card.ok { border-color: rgba(80, 180, 120, 0.4); background: rgba(42, 122, 82, 0.2); }
.t-card.extra { border-color: rgba(255,255,255,0.2); }
.trust.specialist { background: transparent; }

.main {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  flex: 1;
  min-height: 0;
}
.plan-wrap, .side { padding: 0 1.2rem 1.2rem; }
.plan-wrap { border-right: 0; }
.plan-card {
  background: #fff;
  color: var(--ink);
  border: 0;
  border-radius: 14px;
  padding: 0;
  height: calc(100vh - 230px);
  min-height: 420px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.sheet-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.55rem 0.85rem;
  background: #eef3f8;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
}
.pin-legend {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  color: var(--muted);
}
.pin-legend .lg {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  margin-right: 0.15rem;
  vertical-align: middle;
}
.pin-legend .lg.room { background: #0b3a6e; }
.pin-legend .lg.code { background: #c45a0c; }
.pin-legend .lg.extra { background: #5c6b7a; }
.reading-pill.idle {
  animation: none;
  background: var(--navy);
}
.zoom-tools { display: flex; gap: 0.25rem; }
.zoom-tools button {
  width: 2rem;
  height: 1.7rem;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--navy);
  font-weight: 800;
  border-radius: 6px;
}
.viewport {
  position: relative;
  height: calc(100% - 2.4rem);
  overflow: hidden;
  background: #d9e1ea;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.viewport.drag { cursor: grabbing; }
.stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1600px;
  pointer-events: none;
}
.stage img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}
.marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.pin {
  position: absolute;
  margin-left: -14px;
  margin-top: -22px;
  background: #e87722;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.18rem 0.38rem;
  border-radius: 4px;
  border: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  white-space: nowrap;
  z-index: 2;
  pointer-events: auto;
}
.pin.sel { background: #0b3a6e; z-index: 3; }
.pin.room { background: #0b3a6e; }
.pin.code { background: #c45a0c; }
.pin.extra { background: #5c6b7a; }
.pin.room.sel, .pin.code.sel, .pin.extra.sel { outline: 2px solid #fff; }
.plan-card h2, .side h2 { font-size: 0.95rem; margin: 0 0 0.6rem; color: #fff; }

.side { overflow: auto; max-height: calc(100vh - 170px); min-width: 0; }
.basket-head { margin-bottom: 0.7rem; }
.basket-head h2 { margin: 0; }
.basket-head p { margin: 0.15rem 0 0; font-size: 0.82rem; color: #ffd7b0; }
.side .checks, .side .compare { color: var(--ink); }
.side table.compare { background: #fff; border-radius: 10px; overflow: hidden; }
.basket-room {
  background: #0b3a6e;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  margin-bottom: 0.7rem;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.basket-room.sel { outline: 2px solid var(--amber); }
.basket-room h3 { margin: 0 0 0.4rem; font-size: 0.95rem; color: #fff; }
.basket-room h3 small {
  display: block;
  font-weight: 500;
  font-size: 0.78rem;
  opacity: 0.72;
  margin-top: 0.1rem;
}
.basket-room.extras { background: rgba(11, 58, 110, 0.72); }
.line-block { border-top: 1px solid rgba(255,255,255,0.12); padding: 0.35rem 0 0.15rem; }
.line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.28rem;
  font-size: 0.88rem;
}
.blocker {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--amber-bg);
  color: #8a5508;
}
.need {
  margin: 0.25rem 0 0.35rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #ffd7b0;
  overflow-wrap: break-word;
  max-width: 100%;
}
.need.always { color: #d7e2ee; }

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.2rem 1.1rem;
  border-top: 0;
  background: transparent;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.7);
}

.checks { list-style: none; padding: 0; margin: 0 0 1rem; }
.checks li {
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.35rem;
  border-radius: 8px;
  font-size: 0.85rem;
  background: rgba(180, 35, 24, 0.16);
  color: #ffd0cc;
  border: 1px solid rgba(255,255,255,0.08);
  overflow-wrap: break-word;
}
.checks li.ok { background: rgba(42, 122, 82, 0.28); color: #d4f5e4; }
table.compare {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.72rem;
  margin-bottom: 1rem;
}
table.compare th, table.compare td {
  border: 1px solid var(--line);
  padding: 0.4rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}
table.compare th { background: var(--navy); color: #fff; }

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 39, 68, 0.45);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 20;
}
.modal.on { display: flex; }
.modal .box {
  background: #fff;
  max-width: 520px;
  width: 100%;
  border-radius: 12px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
  color: var(--ink);
}
.modal h2 { margin-top: 0.3rem; }
.stamp {
  display: inline-block;
  border: 2px solid var(--amber);
  color: var(--amber);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  transform: rotate(-4deg);
}
.hint { margin-top: 1.25rem; font-size: 0.9rem; color: var(--muted); }
.detail {
  display: none;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.6rem;
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: #d7e2ee;
}
.detail.on { display: block; }

/* Pitch: projector-friendly */
body.pitch .hero h1,
body.pitch .app { font-size: 18px; }
body.pitch .trust div { font-size: 1rem; padding: 0.8rem; }
body.pitch .brand, body.pitch .side h2, body.pitch .basket-room h3 { font-size: 1.15rem; }
body.pitch .line { font-size: 1.02rem; }
body.pitch .hero-nav .chip-quiet,
body.pitch .micro { display: none; }
body.pitch .plan-card { min-height: 520px; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .main { grid-template-columns: 1fr; }
  .trust { grid-template-columns: 1fr 1fr; }
  .plan-card { height: 360px; }
  .chips { grid-template-columns: 1fr; }
  .preview-list { position: static; width: auto; margin: 0.6rem; }
  .hero-steps { width: auto; right: 0.8rem; }
}
