@font-face {
  font-family: InterVariable;
  src: url("risorse/InterVariable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --navy: #0a3560;
  --blue: #0a477f;
  --header: #0d447b;
  --accent: #0098d8;
  --muted: #555;
  --line: #d3dce4;
  --gray: #ededed;
  --tint: #f0f5f9;
  font: 16px/1.5 InterVariable, Inter, Arial, sans-serif;
  color: var(--navy);
  background: white;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.shell { max-width: 1330px; margin: auto; padding-inline: clamp(16px, 4vw, 56px); }
.masthead { background: var(--header); color: white; }
.mast-inner, footer, .result-head, .form-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.mast-inner { min-height: 72px; }
.brand { flex: 0 1 171px; }
.brand img { display: block; width: 100%; max-width: 171px; height: auto; }
.tool-nav { display: flex; align-items: center; gap: clamp(12px, 3vw, 36px); }
.tool-nav a { color: white; font-size: .92rem; font-weight: 560; text-decoration: none; }
.tool-nav a:hover { text-decoration: underline; }
.print-brand { display: none; }
a { color: var(--blue); text-underline-offset: .17em; }
.intro { padding-block: clamp(34px, 5vw, 65px) clamp(26px, 4vw, 44px); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.1rem, 4.7vw, 3.75rem); line-height: 1.08; letter-spacing: -.042em; font-weight: 650; color: var(--blue); }
.intro p { color: var(--muted); font-size: clamp(1rem, 2vw, 1.18rem); margin-top: 13px; }
.layout { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); gap: clamp(16px, 2.5vw, 30px); align-items: start; }
form { display: grid; gap: 16px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 12px; padding: clamp(16px, 2.4vw, 25px); }
.panel-heading { display: flex; align-items: center; margin-bottom: 16px; }
h2 { font-size: 1.3rem; line-height: 1.2; letter-spacing: -.02em; }
h3 { font-size: 1.06rem; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 15px; }
.fields + .fields, [data-mode]:not([hidden]) { margin-top: 14px; }
label { display: flex; flex-direction: column; font-size: .91rem; line-height: 1.35; font-weight: 650; gap: 6px; min-width: 0; }
input, select, button { font: inherit; }
input:not([type=checkbox]), select {
  width: 100%; min-width: 0; min-height: 43px; padding: 8px 10px;
  background: white; color: var(--navy); border: 1px solid #aebdcf; border-radius: 7px;
}
select { appearance: none; padding-right: 28px; background: linear-gradient(45deg, transparent 50%, #43546d 50%) calc(100% - 15px) center / 5px 5px no-repeat, linear-gradient(135deg, #43546d 50%, transparent 50%) calc(100% - 10px) center / 5px 5px no-repeat white; }
.check { flex-direction: row; align-items: start; margin-top: 12px; gap: 9px; }
.check input { accent-color: var(--blue); width: 16px; height: 16px; margin: 2px 0 0; flex: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.hint { color: var(--muted); font-size: .9rem; margin-top: 10px; }
details { border-top: 1px solid var(--line); margin-top: 17px; padding-top: 12px; }
details .fields { margin-top: 12px; }
summary { font-weight: 700; cursor: pointer; }
.form-actions { justify-content: start; flex-wrap: wrap; }
button { font-weight: 650; cursor: pointer; min-height: 42px; padding: 8px 14px; border-radius: 999px; border: 1px solid transparent; }
button:hover { filter: brightness(.92); }
.primary { background: var(--blue); color: white; padding-inline: 20px; }
.secondary { background: white; color: var(--blue); border-color: var(--blue); }
.outline { border-color: #b1cee3; color: white; background: transparent; padding: 6px 12px; font-size: .88rem; }
.item { margin: 10px 0; border: 1px solid var(--line); border-radius: 8px; padding: 11px; }
.item .fields { margin-top: 9px; }
.item-top { display: flex; align-items: end; gap: 8px; }
.item-top label { flex: 1; }
.item-top button { flex: none; }
.item .hint:empty { display: none; }
.results { background: var(--tint); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.result-head { color: white; background: var(--header); min-height: 66px; padding: 12px 19px; }
.result-head h2:focus-visible { outline-offset: 5px; }
#result-body { padding: clamp(13px, 2vw, 19px); display: grid; gap: 12px; }
.empty { color: var(--muted); padding: 14px 5px; }
.main-number, .phase { background: white; padding: 15px; border-radius: 8px; }
.main-number strong { display: block; font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -.05em; line-height: 1.15; margin-bottom: 3px; }
.main-number span, .phase p { color: var(--muted); }
.phase p { font-size: .9rem; margin-top: 4px; }
.phase ul, .warnings { padding-left: 20px; margin: 8px 0 0; }
.phase li { margin: 4px 0; }
.phase-with-photo { display: grid; grid-template-columns: minmax(0, 1fr) clamp(92px, 10.5vw, 135px); gap: 14px; align-items: start; }
.phase-content { min-width: 0; }
.machine-photo { margin: 0; text-align: center; }
.machine-photo img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 6px; background: var(--gray); }
.machine-photo figcaption { margin-top: 4px; color: var(--muted); font-size: .75rem; }
.warnings { background: #fff3da; color: #5d4009; border-radius: 9px; padding: 10px 13px 10px 30px; margin: 0; }
.assumptions { background: white; border: 0; margin: 0; border-radius: 9px; padding: 11px 14px; }
.assumption-list { font-size: .87rem; margin: 7px 0 0; padding-left: 19px; }
.stale { background: #fff3da; border-radius: 8px; padding: 9px 12px; }
.scope { color: #344861; font-size: .88rem; }
.project-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 15px; background: white; border-radius: 8px; }
.project-cta p { flex: 1 1 210px; font-size: .92rem; font-weight: 650; }
.project-cta a { display: inline-flex; align-items: center; min-height: 42px; border-radius: 999px; font-weight: 650; text-decoration: none; }
.project-cta a:hover { background: var(--navy); }
.outdated .project-cta { display: none; }
.examples { padding-top: clamp(30px, 5vw, 60px); scroll-margin-top: 20px; }
.examples h2 { color: var(--blue); font-size: clamp(1.45rem, 3vw, 2rem); }
.example-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.example-card { display: grid; align-content: start; gap: 5px; text-align: left; min-height: 82px; padding: 14px 16px; background: var(--gray); color: var(--blue); border-radius: 8px; }
.example-card:hover { background: var(--tint); border-color: var(--blue); filter: none; }
.example-card span { font-size: .86rem; font-weight: 450; color: var(--muted); }
footer { border-top: 1px solid var(--line); font-size: .9rem; margin-block: 34px 0; padding-block: 16px 21px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) { .fields { grid-template-columns: minmax(0, 1fr); } .item .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print {
  :root { background: white; color: #111; font: 10.5pt/1.35 Arial, sans-serif; }
  .shell { max-width: none; padding: 0; }
  .masthead, form, footer, .examples, .intro p, #print, .project-cta, .outdated > :not(.stale) { display: none !important; }
  .intro { padding: 0 0 14px; }
  .print-brand { display: block; width: 115px; height: auto; margin-bottom: 10px; }
  h1 { font-size: 23pt; }
  .layout { display: block; }
  .results, .result-head { background: white; color: #111; border: none; }
  .result-head { padding: 0; min-height: 0; }
  #result-body { padding: 8px 0 0; gap: 6px; }
  .main-number, .phase { border: 1px solid #bbb; padding: 6px 9px; break-inside: avoid; }
  .phase p { margin-top: 2px; }
  .phase-with-photo { grid-template-columns: minmax(0, 1fr) 57px; gap: 8px; }
  .machine-photo figcaption { font-size: .67rem; }
  .assumptions { padding: 0; }
  a { color: #111; }
}
