/* iam.firm.in — theme_04 Warm Paper Field Dossier */
:root {
  --bg: #f5efe6;
  --surface: #fffdf9;
  --ink: #292524;
  --accent: #b45309;
  --muted: #57534e;
  --line: #d6cdbd;
  --accent-soft: #f3e3cd;
  --ok: #166534;
  --warn: #b45309;
  --bad: #991b1b;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(41, 37, 36, .08), 0 8px 24px rgba(41, 37, 36, .06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  line-height: 1.55;
}
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin-top: 0; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }

/* header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; }
.brand { font-weight: 700; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: .02em; }
.brand-dot { color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: .92rem; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--accent); text-decoration: underline; }

/* disclosure banner — above the fold */
.disclosure-banner {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: .85rem;
}
.disclosure-banner .wrap { padding: 8px 20px; display: flex; gap: 10px; align-items: baseline; }
.disclosure-banner strong { color: var(--accent); text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }

/* hero */
.hero { padding: 48px 0 24px; }
.hero .kicker { font-family: system-ui, sans-serif; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.hero p.lede { font-size: 1.1rem; max-width: 720px; color: var(--muted); }

/* dossier sheet */
.sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin: 32px 0;
}
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 20px; }
.sheet-head .stamp { font-family: system-ui, sans-serif; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tab {
  font-family: system-ui, sans-serif; font-size: .9rem;
  background: transparent; border: 1px solid var(--line); border-bottom: none;
  border-radius: 8px 8px 0 0; padding: 9px 16px; cursor: pointer; color: var(--muted);
}
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 700; border-color: var(--line); border-bottom: 1px solid var(--surface); margin-bottom: -1px; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tab-panel[hidden] { display: none; }

/* forms */
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 18px; }
label.f { display: block; font-family: system-ui, sans-serif; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 8px 10px; font: inherit; font-size: .95rem;
  background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-family: system-ui, sans-serif; font-size: .88rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.check-row input { width: auto; margin-top: 3px; }
.check-row.missing-mandatory { border-color: var(--bad); background: #fdf3f3; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin: 0 0 16px; }
legend { font-family: system-ui, sans-serif; font-size: .85rem; font-weight: 700; padding: 0 6px; }

.btn {
  font-family: system-ui, sans-serif; font-size: .9rem; font-weight: 600;
  background: var(--ink); color: var(--surface); border: none; border-radius: 7px;
  padding: 10px 18px; cursor: pointer;
}
.btn:hover, .btn:focus-visible { background: var(--accent); outline: none; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn.secondary:hover { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  font-family: system-ui, sans-serif; font-size: .82rem; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; color: var(--muted);
}
.chip:hover, .chip:focus-visible { border-color: var(--accent); color: var(--accent); }

/* results */
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.stat .k { font-family: system-ui, sans-serif; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat .v { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.verdict { font-family: system-ui, sans-serif; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; display: inline-block; }
.verdict.ready, .verdict.comfortable, .verdict.calm { background: #dcfce7; color: var(--ok); }
.verdict.nearly-ready, .verdict.tight, .verdict.brisk { background: #fef3c7; color: var(--warn); }
.verdict.not-ready, .verdict.refuel-required, .verdict.rough { background: #fee2e2; color: var(--bad); }

/* svg charts */
.chart-box { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 14px 0; overflow-x: auto; }
.chart-box svg { display: block; width: 100%; height: auto; min-width: 480px; }
.chart-box .axis { stroke: var(--line); stroke-width: 1; }
.chart-box .grid { stroke: #efe9de; stroke-width: 1; }
.chart-box text { font-family: system-ui, sans-serif; font-size: 10px; fill: var(--muted); }

/* tables */
table.ref { width: 100%; border-collapse: collapse; font-family: system-ui, sans-serif; font-size: .86rem; }
table.ref th, table.ref td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
table.ref th { background: var(--accent-soft); }
.scroll-x { overflow-x: auto; }

/* float plan printable card */
.float-card { border: 2px solid var(--ink); border-radius: 8px; padding: 20px; background: #fff; font-family: system-ui, sans-serif; }
.float-card h3 { font-family: inherit; }
.float-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 20px; }
.float-grid dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.float-grid dd { margin: 0 0 8px; font-weight: 600; }
.receipt { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .78rem; word-break: break-all; background: #f8f4ec; border: 1px solid var(--line); border-radius: 8px; padding: 12px; white-space: pre-wrap; }

/* reference sections */
.prose { max-width: 760px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 48px; }
.footer-row { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; padding: 22px 20px; font-family: system-ui, sans-serif; font-size: .85rem; color: var(--muted); }
.footer-row nav a { color: var(--muted); margin-right: 16px; text-decoration: none; }
.footer-row nav a:hover { color: var(--accent); text-decoration: underline; }

/* print */
@media print {
  .site-header, .site-nav, .tabs, .btn-row, .disclosure-banner, .no-print { display: none !important; }
  body { background: #fff; }
  .sheet { box-shadow: none; border: none; }
  .tab-panel { display: block !important; }
}
@media (max-width: 640px) {
  .header-row { flex-direction: column; align-items: flex-start; }
  .sheet { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
