:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #0f172a;
  --muted: #5c667a;
  --line: #d9e0e9;
  --primary: #2457d6;
  --primary-dark: #173f9e;
  --accent: #0f766e;
  --warning: #a15c00;
  --danger: #b42318;
  --success: #12715b;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

button, input { font: inherit; }

button { cursor: pointer; }

a { color: inherit; }

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.narrow { width: min(900px, calc(100% - 32px)); }

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--text);
  color: white;
  border-radius: 8px;
}

.skip-link:focus { top: 16px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(217, 224, 233, .9);
}

.header-inner,
.footer-inner,
.section-heading,
.panel-header,
.result-card-header,
.comparison-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-inner { min-height: 74px; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--text);
  color: white;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.brand strong,
.brand small { display: block; }

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.privacy-pill {
  padding: 8px 12px;
  border: 1px solid #b9ded7;
  color: var(--success);
  background: #effaf7;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.hero {
  padding: 84px 0 72px;
  background:
    radial-gradient(circle at 80% 10%, rgba(36, 87, 214, .14), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f7f8fb 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: 12px;
  font-weight: 800;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 790px;
  margin-bottom: 22px;
  font-size: clamp(2.5rem, 5vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: -.045em;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -.025em;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.hero-copy {
  max-width: 740px;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions,
.toolbar,
.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions { margin: 28px 0 24px; }

.button {
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 11px 16px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

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

.button-primary {
  color: white;
  background: var(--primary);
}

.button-primary:hover { background: var(--primary-dark); }

.button-secondary {
  color: var(--text);
  background: white;
  border-color: var(--line);
}

.button-ghost {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.trust-list {
  padding: 0;
  margin: 0;
  list-style: none;
  color: var(--muted);
  font-size: 14px;
}

.trust-list li::before {
  content: "✓";
  color: var(--success);
  font-weight: 900;
  margin-right: 7px;
}

.hero-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow);
}

.mini-metric {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 14px;
  border-bottom: 1px solid var(--line);
}

.mini-metric:last-child { border-bottom: 0; }

.mini-metric span { color: var(--muted); }
.mini-metric strong { text-align: right; }

.section { padding: 72px 0; }

.section-heading { margin-bottom: 26px; }

.updated-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.notice {
  margin-bottom: 18px;
  padding: 13px 15px;
  border: 1px solid #c8d8ff;
  border-radius: 12px;
  background: #f2f6ff;
  color: #294985;
  font-size: 14px;
}

.scenario-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.scenario-tab {
  padding: 14px 18px;
  text-align: left;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 13px;
  font-weight: 800;
}

.scenario-tab span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
}

.scenario-tab.active {
  color: var(--primary);
  background: white;
  border-color: #9db4ee;
  box-shadow: 0 8px 20px rgba(36,87,214,.08);
}

.scenario-panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 30px rgba(15,23,42,.04);
}

.text-button {
  padding: 8px 0;
  border: 0;
  color: var(--primary);
  background: transparent;
  font-weight: 800;
}

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

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

.field label {
  font-size: 13px;
  font-weight: 800;
}

.field-help {
  min-height: 34px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.field input {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  color: var(--text);
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(36,87,214,.12);
}

.input-wrap { position: relative; }

.input-wrap input { padding-right: 58px; }

.unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}

.results-section {
  background: #eef2f7;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.result-card,
.comparison-card,
.recommendation-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 32px rgba(15,23,42,.05);
}

.result-card { padding: 24px; }

.result-card-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scenario-badge {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: white;
  background: var(--primary);
  font-weight: 900;
}

.scenario-badge.alt { background: var(--accent); }

.status-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-badge.good { background: #e9f8f3; color: var(--success); }
.status-badge.warn { background: #fff4e5; color: var(--warning); }
.status-badge.bad { background: #fff0ee; color: var(--danger); }

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0;
}

.metric {
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-2);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
}

.analysis-box {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.analysis-box strong { color: var(--text); }

.comparison-card,
.recommendation-card {
  margin-top: 18px;
  padding: 24px;
}

.comparison-summary {
  max-width: 390px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.comparison-table-wrap { overflow-x: auto; }

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.comparison-table th,
.comparison-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.comparison-table th:first-child,
.comparison-table td:first-child { text-align: left; }

.comparison-table th {
  color: var(--muted);
  font-size: 12px;
}

.delta-positive { color: var(--success); font-weight: 800; }
.delta-negative { color: var(--danger); font-weight: 800; }
.delta-neutral { color: var(--muted); font-weight: 800; }

.recommendation-card ul {
  padding-left: 20px;
  margin-bottom: 0;
}

.recommendation-card li { margin-bottom: 8px; }

.methodology { background: white; }

.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
}

.method-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.method-grid p,
.disclaimer {
  color: var(--muted);
  font-size: 14px;
}

.disclaimer {
  margin-top: 20px;
  padding: 15px;
  border-left: 4px solid var(--primary);
  background: #f7f9ff;
}

.site-footer {
  padding: 34px 0;
  color: #cbd5e1;
  background: var(--text);
}

.footer-inner p {
  margin: 4px 0 0;
  font-size: 13px;
}

@media (max-width: 920px) {
  .hero-grid,
  .result-grid { grid-template-columns: 1fr; }

  .hero-card { max-width: 560px; }

  .form-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .container,
  .narrow { width: min(100% - 20px, 1180px); }

  .site-header { position: static; }

  .header-inner,
  .section-heading,
  .panel-header,
  .comparison-header,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .privacy-pill { display: none; }

  .hero { padding: 54px 0 46px; }

  h1 { font-size: 2.65rem; }

  .section { padding: 52px 0; }

  .scenario-tabs,
  .form-grid,
  .metric-grid,
  .method-grid { grid-template-columns: 1fr; }

  .scenario-panel,
  .result-card,
  .comparison-card,
  .recommendation-card { padding: 18px; }

  .toolbar { width: 100%; }
  .toolbar .button { flex: 1 1 auto; }

  .comparison-summary { text-align: left; }
}

@media print {
  :root { --bg: #fff; }

  .no-print,
  .site-header,
  .hero,
  .methodology,
  .site-footer,
  .notice,
  .scenario-tabs,
  #planner { display: none !important; }

  body { background: #fff; }

  .results-section {
    padding: 0;
    background: #fff;
    border: 0;
  }

  .container { width: 100%; }

  .result-grid { grid-template-columns: 1fr 1fr; }

  .result-card,
  .comparison-card,
  .recommendation-card {
    box-shadow: none;
    break-inside: avoid;
  }

  .section-heading::before {
    content: "Factory Scenario Lab — Production Capacity & Staffing Planner";
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
  }

  .button { display: none !important; }
}
