/* Cinematic Khayar: presentation layer for the existing, unchanged calculator. */
:root {
  --ink: #102c3a;
  --muted: #51646a;
  --teal: #1d9e93;
  --teal-dark: #102c3a;
  --pale: #e8f1ec;
  --paper: #f4f1e8;
  --line: #d8dfd8;
  --white: #fffefa;
  --amber: #91704a;
  --shadow: 0 8px 28px rgba(16, 44, 58, .035);
}
body,
html[dir=ltr] body {
  font-family: var(--khayar-font, Arial), Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.75;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.topbar {
  height: auto;
  min-height: 108px;
  padding-block: 16px;
  padding-inline: max(28px, calc((100vw - 1424px) / 2));
  background: #fffefa;
  border-bottom: 1px solid #d8dfd8;
  gap: 20px;
}
.brand { min-width: 0; }
.brand-logo { width: 200px; height: 58px; }
.brand small, html[dir=ltr] .brand small {
  margin-top: 1px;
  font-size: 10px;
  letter-spacing: .025em;
}
.header-meta { flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.pill {
  background: #f0f5ee;
  border-color: #d9e5d9;
  font-size: 11px;
  padding: 6px 12px;
}
.pill i { background: #287b64; }
.version, html[dir=ltr] .version { font-size: 11px; }
.language-toggle {
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 6px;
  border-color: #b9c8c2;
  background: transparent;
}
.visual-return-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  max-width: 100%;
  padding: 8px 14px;
  border: 1px solid #b9c8c2;
  border-radius: 6px;
  color: #102c3a;
  background: transparent;
  font: 600 12px/1.4 var(--khayar-font, Arial), Tahoma, sans-serif;
  text-decoration: none;
  text-align: center;
}
.visual-return-home::before { content: "↗"; font-size: 17px; font-weight: 400; }
html[dir=rtl] .visual-return-home::before { content: "↖"; }
.visual-return-home:hover { background: #e8f1ec; border-color: #6f988d; }
main { max-width: 1424px; padding: 24px 28px 26px; }
.reference-nav {
  margin: 0 0 34px;
  padding: 0 0 17px;
  gap: 5px 20px;
  border-bottom: 1px solid var(--line);
}
.reference-nav a {
  padding: 9px 0;
  min-height: 40px;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  font-weight: 500;
  color: #41616a;
  box-shadow: inset 0 -1px transparent;
  transition: color 180ms ease, box-shadow 180ms ease;
}
.reference-nav a:hover {
  background: transparent;
  color: #123d3d;
  box-shadow: inset 0 -1px #237867;
}
.intro { gap: 48px; margin: 0 0 38px; align-items: center; }
.intro > div:first-child { min-width: 0; }
.eyebrow { font-size: 11px; color: #2e7769; letter-spacing: .09em; margin-bottom: 12px; }
h1, html[dir=ltr] h1 {
  font-size: clamp(30px, 3.8vw, 49px);
  line-height: 1.16;
  font-weight: 500;
  letter-spacing: -.035em;
  margin: 0 0 16px;
  max-width: 800px;
  text-wrap: balance;
}
html[dir=rtl] h1 { line-height: 1.55; letter-spacing: -.02em; }
.intro-copy, html[dir=ltr] .intro-copy { font-size: 15px; line-height: 1.8; max-width: 700px; }
.scope-note {
  flex-basis: 300px;
  max-width: 310px;
  border-inline-start: 1px solid #93afa0;
  padding: 8px 0;
  padding-inline-start: 23px;
  font-size: 12px;
}
.scope-note strong { font-size: 13px; line-height: 1.7; }
.scope-note p { font-size: 12px; }
.scope-symbol { color: #397c69; }
.workspace { grid-template-columns: 310px minmax(0, 1fr); gap: 24px; }
.panel { padding: 25px; border-radius: 10px; box-shadow: var(--shadow); }
.controls { top: 22px; border-top: 3px solid #277a6b; padding: 23px; }
.panel-top { margin-bottom: 22px; }
.step { width: 28px; height: 28px; background: #e8f1ec; border: 1px solid #d1e2d6; }
h2, html[dir=ltr] .section-title h2 { font-size: 18px; font-weight: 600; line-height: 1.5; }
label, .controls .input-grid label { font-size: 12px; font-weight: 600; }
input, select { border-radius: 6px; background: #fff; border-color: #bacac2; min-height: 46px; }
select { font-size: 12px; padding-inline: 12px 30px; }
input { font-size: 15px; }
.helper, .controls .helper { font-size: 11px; line-height: 1.8; }
.number-field span { font-size: 10px; }
.case-tools { gap: 12px; flex-wrap: wrap; }
.case-tools .button, .file-label { min-height: 36px; font-size: 11px; }
.file-label { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 5px; }
.button { min-height: 44px; border-radius: 6px; font-size: 12px; padding: 12px 16px; }
.primary { background: #102c3a; box-shadow: 0 4px 12px #102c3a10; }
.primary:hover { background: #1b4c52; }
.secondary { background: #e8f1ec; }
.subtle:hover { color: #102c3a; background: #f0f3ec; }
.assumptions { font-size: 11px; line-height: 1.9; }
.notice { background: #edf2e9; border: 1px solid #d3dfd0; border-radius: 10px; padding: 38px 26px; }
.notice.loading { animation-duration: 2.2s; }
.results { min-width: 0; }
.results .panel { margin-top: 22px; }
.decision-card {
  padding: 31px;
  border-radius: 11px;
  background: #102c3a;
  box-shadow: 0 14px 35px rgba(16,44,58,.09);
  border-top: 3px solid #75b4a3;
}
.decision-card::before {
  width: 370px;
  height: 370px;
  top: -215px;
  inset-inline-end: -80px;
  inset-inline-start: auto;
  border-color: #83b3a51a;
  box-shadow: 0 0 0 30px #ffffff03, 0 0 0 60px #ffffff02;
}
.decision-card .eyebrow { color: #9bd3c4; font-size: 11px; letter-spacing: .06em; }
.decision-card h2, html[dir=ltr] .decision-card h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -.02em;
  margin: 20px 0 12px;
}
html[dir=rtl] .decision-card h2 { line-height: 1.65; }
.decision-card > p, html[dir=ltr] .decision-card > p { font-size: 13px; line-height: 1.85; color: #d6e1df; }
.decision-status { font-size: 10px; padding: 5px 11px; }
.metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding-top: 25px; margin-top: 26px; }
.metrics > div { min-width: 0; }
.metrics strong, html[dir=ltr] .metrics strong { font-size: clamp(25px, 2.9vw, 35px); font-weight: 400; letter-spacing: -.02em; }
.metrics span, html[dir=ltr] .metrics span { font-size: 11px; line-height: 1.6; color: #c6dcd6; }
.metrics small, html[dir=ltr] .metrics small { font-size: 10px; color: #a9c2bc; }
.decision-card > .risk-note { font-size: 11px; color: #ded9be; padding-top: 16px; }
.section-title { gap: 15px; margin-bottom: 20px; }
.section-note { font-size: 11px; }
.reference-boundary { background: #f2f4ec; border: 0; border-inline-start: 2px solid #a6b997; border-radius: 0; font-size: 11px; }
.bhp-metrics { gap: 13px; }
.bhp-stat { border-radius: 6px; border-color: #dce3da; padding: 18px; background: #fafbf6; }
.bhp-stat h3 { font-size: 13px; line-height: 1.65; }
.bhp-stat-row { font-size: 12px; }
.bhp-stat-row strong { font-size: 24px; font-weight: 400; }
.bhp-stat-row.selected strong { color: #1c6d5b; font-weight: 600; }
.bhp-stat small { font-size: 10px; }
.tradeoff { background: #edf4ec; border-radius: 0 6px 6px 0; border-inline-start-color: #40866d; padding: 15px 18px; }
.tradeoff > strong { font-size: 13px; }
.tradeoff ul { font-size: 12px; }
.tradeoff p { font-size: 11px; }
table { font-size: 12px; }
th { background: #f0f3eb; padding: 12px 14px; font-size: 11px; color: #3e5b5e; }
td { padding: 15px 14px; }
.tag { font-size: 10px; padding: 5px 9px; }
summary { min-height: 32px; font-size: 12px; color: #355c5d; line-height: 1.75; }
details p { font-size: 12px; }
.window-panel > p { font-size: 13px; }
.day-cell { min-width: 49px; padding: 9px 6px; border-radius: 5px; }
.day-cell strong { font-size: 16px; font-weight: 500; }
.day-cell small { font-size: 9px; }
.plan-selectors select { font-size: 12px; }
.branch-details { font-size: 12px; gap: 8px; }
.branch-details span { padding: 7px 10px; border-radius: 4px; }
.gantt-chart { min-width: 600px; }
.gantt-header, .gantt-row, html[dir=ltr] .gantt-header, html[dir=ltr] .gantt-row { grid-template-columns: 180px 1fr; }
.gantt-row { min-height: 41px; margin: 12px 0; }
.task-label { font-size: 12px; }
.task-label small { font-size: 10px; }
.task-lane, .task-bar { height: 29px; border-radius: 3px; }
.task-bar { font-size: 10px; background: #367867; }
.task-bar.info { background: #2b657c; }
.task-bar.fixed { background: #856a36; }
.limits-panel h2 { font-size: 16px; }
.limits-panel > p, #audit-readable p, #audit-readable ul { font-size: 12px; line-height: 1.85; }
.error { border-radius: 7px; font-size: 13px; }
footer { font-size: 11px; padding-top: 22px; margin-top: 40px; color: #52665e; }
:is(button, a, summary, input, select, .file-label):focus-visible {
  outline: 3px solid #27816c;
  outline-offset: 4px;
}
@media (max-width: 1120px) {
  .workspace { grid-template-columns: 280px minmax(0,1fr); gap: 19px; }
  .panel { padding: 21px; }
  .intro { gap: 30px; }
  .scope-note { flex-basis: 260px; max-width: 275px; }
  .decision-card { padding: 25px; }
  .metrics { gap: 12px; }
  .section-title { align-items: flex-start; flex-direction: column; gap: 6px; }
  .bhp-stat-row { flex-wrap: wrap; gap: 4px 10px; }
}
@media (max-width: 800px) {
  .topbar { padding: 15px 20px; gap: 15px; }
  .brand-logo { width: 165px; height: 49px; }
  .header-meta { gap: 8px; }
  .version, .pill { display: none; }
  main { padding: 22px 20px; }
  .reference-nav { gap: 3px 17px; margin-bottom: 29px; padding-bottom: 14px; }
  .reference-nav a { font-size: 11px; }
  .intro { display: block; margin-bottom: 28px; }
  h1, html[dir=ltr] h1 { font-size: clamp(31px, 6vw, 45px); }
  .scope-note { max-width: 100%; margin-top: 23px; padding-inline-start: 17px; }
  .workspace { display: flex; flex-direction: column; gap: 22px; }
  .controls { position: static; width: 100%; }
  .results { width: 100%; }
  .input-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .bhp-stat-row { display: flex; }
  .bhp-stat h3 { min-height: 0; }
  .metrics { gap: 15px; }
  .metrics strong, html[dir=ltr] .metrics strong { font-size: 28px; }
  .actions { flex-wrap: wrap; }
  footer { flex-direction: column; gap: 5px; }
}
@media (max-width: 480px) {
  .topbar { align-items: flex-start; gap: 12px; padding: 15px 16px; flex-wrap: wrap; }
  .brand-logo { width: 148px; height: 45px; }
  .header-meta { flex: 1; }
  .language-toggle { min-height: 40px; font-size: 11px; padding: 9px 12px; }
  .visual-return-home { min-height: 40px; font-size: 11px; padding: 8px 10px; }
  main { padding-inline: 16px; }
  .reference-nav { gap: 2px 15px; }
  .intro-copy, html[dir=ltr] .intro-copy { font-size: 14px; }
  .panel, .controls { padding: 19px; }
  .decision-card { padding: 24px 19px; }
  .decision-top { align-items: flex-start; gap: 10px; }
  .decision-status { font-size: 9px; max-width: 46%; }
  .metrics { grid-template-columns: 1fr; gap: 13px; }
  .metrics > div {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    gap: 4px 15px;
    border: 0;
    border-bottom: 1px solid #ffffff22;
    padding: 0 0 13px;
  }
  .metrics strong, html[dir=ltr] .metrics strong { margin: 0; font-size: 29px; }
  .metrics small { grid-column: 1/-1; }
  .metrics > div:last-child { padding: 0; }
  .bhp-metrics { grid-template-columns: 1fr; }
  .bhp-stat { padding: 16px; }
  .bhp-stat-row { justify-content: space-between; }
  .bhp-stat-row span { font-size: 11px; }
  .plan-selectors { grid-template-columns: 1fr; }
  .case-tools { gap: 12px; }
  .actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  body { background: white; }
  .visual-return-home, .reference-nav, .language-toggle { display: none !important; }
  main { max-width: none; padding: 15px 0; }
  .topbar { min-height: 0; padding: 8px 0; }
  .workspace { display: block; }
  .panel, .decision-card { box-shadow: none; border-radius: 0; }
  .decision-card, .decision-card > p, .decision-card h2, .decision-card .eyebrow, .decision-card > .risk-note { color: #102c3a !important; }
  .metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .metrics span, .metrics small { color: #365956; }
  .gantt-chart { min-width: 0; }
}

.quick-guide{display:flex;align-items:center;gap:20px;flex-wrap:wrap;background:#e5eddf;border:1px solid #c9d7c2;border-radius:6px;padding:18px 22px;margin:0 0 28px;font-size:13px}.quick-guide strong{font-weight:600}.quick-guide span{flex:1;min-width:220px}.quick-guide a{font-weight:600;text-decoration:underline;text-underline-offset:4px}.quick-guide a:focus-visible{outline:3px solid #ba6e3b;outline-offset:4px}
