:root {
  color-scheme: dark;
  --navy: #071a36;
  --blue: #0c46a0;
  --cyan: #77e7ff;
  --paper: #e8f6ff;
  --ink: #ecfbff;
  --muted: #9ac6d7;
  --line: rgba(119, 231, 255, 0.34);
  --orange: #ff9d3b;
  --green: #68ff9a;
  --red: #ff5b6b;
  --shadow: 0 28px 80px rgba(2, 15, 36, 0.42);
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(119, 231, 255, 0.12) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(0deg, rgba(119, 231, 255, 0.10) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(119, 231, 255, 0.20) 1px, transparent 1px) 0 0 / 160px 160px,
    linear-gradient(0deg, rgba(119, 231, 255, 0.18) 1px, transparent 1px) 0 0 / 160px 160px,
    linear-gradient(135deg, #06142b, #0b326d 56%, #06142b);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(125deg, transparent 0 38%, rgba(255, 157, 59, 0.16) 38% 42%, transparent 42% 100%),
    repeating-linear-gradient(45deg, transparent 0 34px, rgba(119, 231, 255, 0.08) 35px 36px);
  animation: draftSlide 20s linear infinite;
}

button, input, select { font: inherit; }
button { border: 0; }
a { color: var(--cyan); font-weight: 900; }

.blueprint-axis {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  color: rgba(119, 231, 255, 0.22);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}
.blueprint-axis span { position: absolute; }
.blueprint-axis span:nth-child(1) { left: 22px; bottom: 28px; }
.blueprint-axis span:nth-child(2) { right: 18px; top: 45%; writing-mode: vertical-rl; }
.blueprint-axis span:nth-child(3) { left: 50%; top: 18px; transform: translateX(-50%); }

.app-shell { position: relative; z-index: 1; width: min(1460px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 42px; }

.masthead, .tool-panel, .result-panel, .details-panel, .legal-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(236, 251, 255, 0.10), rgba(5, 20, 43, 0.64)), rgba(5, 20, 43, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.masthead { min-height: 340px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 390px); gap: 26px; padding: 28px; position: relative; overflow: hidden; }
.masthead::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px dashed rgba(119, 231, 255, 0.32);
}
.masthead::after {
  content: "ΔP=(G×P×C)/100";
  position: absolute;
  right: 30px;
  bottom: 24px;
  color: rgba(119, 231, 255, 0.18);
  font-size: clamp(2rem, 6vw, 6rem);
  font-weight: 950;
}

.brand-block { position: relative; z-index: 1; display: flex; gap: 18px; align-items: flex-start; align-self: end; }
.brand-mark { display: grid; place-items: center; width: 66px; height: 66px; flex: 0 0 66px; border: 1px solid var(--cyan); border-radius: 50%; color: var(--navy); background: var(--cyan); font-weight: 1000; }
.eyebrow { margin: 0 0 9px; color: var(--orange); font-size: 0.74rem; font-weight: 950; letter-spacing: 0.11em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 860px; margin-bottom: 12px; font-size: clamp(2.4rem, 5.8vw, 6.4rem); line-height: 0.86; letter-spacing: 0; text-transform: uppercase; }
h2 { margin-bottom: 0; font-size: 1.3rem; }
h3 { margin-bottom: 14px; }
.lead { max-width: 760px; color: rgba(236, 251, 255, 0.76); font-weight: 650; line-height: 1.6; }

.masthead-meta { position: relative; z-index: 1; display: grid; gap: 10px; }
.masthead-meta span { display: block; min-height: 76px; padding: 13px; border: 1px solid var(--line); background: rgba(7, 26, 54, 0.62); color: rgba(236, 251, 255, 0.82); font-weight: 850; }

.workspace { display: grid; grid-template-columns: minmax(420px, 0.94fr) minmax(500px, 1.06fr); gap: 18px; margin-top: 18px; }
.tool-panel, .result-panel { min-height: 650px; padding: 26px; }
.panel-heading, .details-header, .result-heading { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }

.fuel-fieldset { margin: 24px 0; padding: 0; border: 0; }
.fuel-fieldset legend { margin-bottom: 12px; color: var(--cyan); font-weight: 950; }
.fuel-toggle, .input-grid, .metric-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fuel-toggle input { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.fuel-toggle label { min-height: 110px; padding: 16px; border: 1px solid var(--line); background: rgba(7, 26, 54, 0.52); cursor: pointer; transition: transform 160ms ease, background 160ms ease, border-color 160ms ease; }
.fuel-toggle label:hover { transform: translateY(-2px); border-color: var(--orange); }
.fuel-toggle input:checked + label { background: rgba(119, 231, 255, 0.14); border-color: var(--cyan); }
.fuel-toggle span { display: block; margin-bottom: 8px; color: var(--ink); font-weight: 950; }
.fuel-toggle small { display: block; color: var(--muted); font-size: 0.84rem; line-height: 1.35; }

.field { display: grid; gap: 8px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field > span { color: var(--cyan); font-size: 0.78rem; font-weight: 950; text-transform: uppercase; }
select, input { width: 100%; height: 50px; border: 1px solid var(--line); background: rgba(7, 26, 54, 0.70); color: var(--ink); padding: 0 13px; outline: none; font-weight: 800; }
select { color-scheme: dark; }
select:focus, input:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255, 157, 59, 0.12); }
select:disabled, input:disabled { color: rgba(236, 251, 255, 0.42); cursor: not-allowed; }
.money-input { position: relative; }
.money-input input { padding-right: 62px; }
.money-input span { position: absolute; right: 13px; top: 50%; color: var(--orange); font-size: 0.76rem; font-weight: 950; translate: 0 -50%; }
.validation-message { min-height: 42px; margin: 18px 0 10px; color: var(--red); font-weight: 900; line-height: 1.45; }
.validation-message:empty { min-height: 18px; }
.form-actions, .details-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.primary-action, .secondary-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: var(--radius); font-weight: 950; cursor: pointer; }
.primary-action { min-width: 226px; padding: 0 18px; background: var(--orange); color: var(--navy); }
.primary-action:disabled { background: rgba(236, 251, 255, 0.18); color: rgba(236, 251, 255, 0.48); cursor: not-allowed; }
.secondary-action { min-width: 126px; padding: 0 15px; border: 1px solid var(--line); background: rgba(7, 26, 54, 0.52); color: var(--ink); }
[data-lucide] { width: 18px; height: 18px; }
.status-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--cyan); font-size: 0.74rem; font-weight: 950; text-transform: uppercase; }
.status-chip.is-ready { color: var(--green); }
.status-chip.is-warning { color: var(--orange); }

.visual-strip { position: relative; min-height: 260px; margin: 24px 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(7, 26, 54, 0.84); }
.visual-strip::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(119, 231, 255, 0.12) 1px, transparent 1px) 0 0 / 42px 42px, linear-gradient(0deg, rgba(119, 231, 255, 0.12) 1px, transparent 1px) 0 0 / 42px 42px; }
.visual-strip canvas { position: relative; z-index: 1; display: block; width: 100%; height: 260px; }
.visual-overlay { position: absolute; left: 18px; top: 16px; z-index: 2; display: grid; gap: 4px; color: rgba(236, 251, 255, 0.72); }
.visual-overlay strong { color: #fff; font-size: 1.45rem; }
.headline-result { display: grid; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(119, 231, 255, 0.13); }
.headline-result span, .headline-result small { color: var(--muted); font-weight: 850; }
.headline-result strong { color: #fff; font-size: clamp(2.3rem, 4.8vw, 4.6rem); line-height: 0.96; letter-spacing: 0; }
.metric-list { margin: 12px 0 0; }
.metric-list div { min-height: 104px; padding: 14px; border: 1px solid var(--line); background: rgba(7, 26, 54, 0.52); }
.metric-list dt, .detail-table dt { color: var(--cyan); font-size: 0.74rem; font-weight: 950; text-transform: uppercase; }
.metric-list dd, .detail-table dd { margin: 7px 0 0; color: var(--ink); font-size: 1.12rem; font-weight: 950; line-height: 1.35; }
.details-panel { margin-top: 18px; padding: 24px; }
.details-header { align-items: center; }
.details-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr); gap: 24px; padding-top: 22px; }
.detail-table dl { display: grid; margin: 0; }
.detail-table dl div { display: grid; grid-template-columns: minmax(150px, 0.58fr) minmax(0, 1fr); gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.detail-table dd small { display: block; margin-top: 5px; color: var(--orange); font-size: 0.8rem; }
.warning-panel { margin-top: 22px; padding: 16px; border-left: 4px solid var(--orange); background: rgba(255, 157, 59, 0.13); color: #ffe2c0; font-weight: 850; line-height: 1.5; }
.warning-panel.is-blocking { border-left-color: var(--red); background: rgba(255, 91, 107, 0.12); color: #ffd0d5; }
.legal-note { display: grid; gap: 8px; margin-top: 18px; padding: 16px; color: var(--muted); font-size: 0.88rem; line-height: 1.55; }

@media (max-width: 1060px) { .masthead, .workspace, .details-grid { grid-template-columns: 1fr; } .tool-panel, .result-panel { min-height: auto; } }
@media (max-width: 700px) { .app-shell { width: min(100% - 20px, 1460px); padding-top: 18px; } .brand-block, .panel-heading, .details-header { display: grid; } .masthead, .tool-panel, .result-panel, .details-panel { padding: 18px; } .fuel-toggle, .input-grid, .metric-list { grid-template-columns: 1fr; } .detail-table dl div { grid-template-columns: 1fr; gap: 4px; } .primary-action, .secondary-action { width: 100%; } }
@media print { body { background: #fff; color: #111; } .blueprint-axis { display: none !important; } .app-shell { width: 100%; padding: 0; } .masthead, .tool-panel, .visual-strip, .form-actions, .details-actions, .legal-note a { display: none !important; } .workspace { display: block; } .result-panel, .details-panel { min-height: auto; margin: 0 0 16px; border-color: #ccc; background: #fff; color: #111; box-shadow: none; } .details-panel[hidden] { display: none !important; } }
@keyframes draftSlide { to { background-position: 260px 0, 180px 0; } }

/* Theme activation hooks for unified preview. */
.blueprint-axis.theme-decor { display: block; }
