/* CalcSpec — "Field Manual" theme
   Paper #f7f4ed · Ink #1a1a1a · Rust #b35c1e · Rule #dfd8c8
   Headlines: Charter / Source Serif 4 serif
   Body: Source Serif 4 serif
   Numbers: IBM Plex Mono tabular-nums
   Engineering-drawing motifs: L-bracket corner ticks on callouts,
   tick-marked dimension rules under section headings,
   stencil-track uppercase form labels.

   Legacy body class .claude-theme is kept for CSS compatibility.
*/

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,500;0,8..60,600;0,8..60,700;1,8..60,400&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --paper: #f7f4ed;
  --paper-deep: #efe9d8;
  --ink: #1a1a1a;
  --ink-2: #3d3d3d;
  --ink-3: #6b6b6b;
  --rust: #b35c1e;
  --rust-ink: #93471a;
  --rust-soft: #c97638;
  --rule: #dfd8c8;
  --rule-2: #c9bfa6;
  --chip-bg: #ede6d2;
  --warn-wash: #f5ebd9;

  /* Headlines: Charter is system-bundled on macOS/iOS. Source Serif 4 is the
     google-font fallback. Iowan/Georgia behind that. */
  --serif-head: "Charter", "Source Serif 4", "Iowan Old Style", Georgia, serif;
  /* Body uses the same serif stack — this is a typeset reference manual,
     not a web app. Source Serif 4 primary. */
  --serif: "Source Serif 4", "Charter", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", "SF Mono", "Menlo", "Consolas", monospace;

  --max-article: 760px;
  --max-hub: 1100px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.claude-theme {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "onum" 1;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--rust-ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--rust); }

/* Layout */
.ct-shell { max-width: var(--max-article); margin: 0 auto; padding: 0 24px 96px; }
.ct-shell.hub { max-width: var(--max-hub); }

/* Top bar — reads as a publication header */
.ct-topbar {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.ct-topbar-inner {
  max-width: var(--max-hub);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.ct-brand {
  font-family: var(--serif-head);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}
.ct-brand::before {
  content: "";
  display: inline-block;
  width: 12px; height: 12px;
  border: 1.5px solid var(--rust);
  transform: rotate(45deg);
  align-self: center;
}
.ct-topnav { display: flex; gap: 22px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.ct-topnav a { color: var(--ink-2); text-decoration: none; }
.ct-topnav a:hover { color: var(--rust); }
.ct-topnav a.active { color: var(--ink); }
.ct-topnav a.active::after {
  content: "";
  display: block;
  height: 2px;
  background: var(--rust);
  margin-top: 4px;
}

/* Breadcrumbs */
.breadcrumbs {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  padding: 18px 0 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.breadcrumbs a { color: var(--ink-3); text-decoration: none; }
.breadcrumbs a:hover { color: var(--rust); text-decoration: underline; }
.breadcrumbs span[aria-hidden] { margin: 0 8px; color: var(--rule-2); }

/* Headlines */
h1, h2, h3, h4 {
  font-family: var(--serif-head);
  color: var(--ink);
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 0 0 12px;
  line-height: 1.2;
}
h1 { font-size: 40px; font-weight: 600; letter-spacing: -0.015em; margin-top: 8px; }

/* H2 — tick-marked dimension rule.
   A hairline spans the section width with a small vertical "tick" at the
   start and end, echoing how a dimension line is drawn on a drafting sheet. */
h2 {
  font-size: 26px;
  margin-top: 56px;
  padding-top: 20px;
  position: relative;
}
h2::before {
  /* the rule line */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--rule-2);
}
h2::after {
  /* tick marks at both ends, rendered via a gradient trick */
  content: "";
  position: absolute;
  top: -4px; left: 0;
  width: 100%;
  height: 9px;
  background-image:
    linear-gradient(to right, var(--rust) 0, var(--rust) 1px, transparent 1px),
    linear-gradient(to left, var(--rust) 0, var(--rust) 1px, transparent 1px);
  background-repeat: no-repeat;
  background-size: 1px 9px, 1px 9px;
  background-position: 0 0, 100% 0;
  pointer-events: none;
}
h3 {
  font-size: 20px;
  margin-top: 36px;
  font-style: italic;
  font-weight: 500;
}
.lede {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 62ch;
  margin: 8px 0 28px;
  line-height: 1.55;
}

p { margin: 0 0 16px; }
p + p { margin-top: -2px; }

/* Reference header — standard/version metadata */
.ct-ref-header {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 24px;
  padding: 0;
}
.ct-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  background: var(--chip-bg);
  padding: 4px 9px;
  border: 1px solid var(--rule);
  border-radius: 0;
}
.ct-chip strong { color: var(--ink); font-weight: 600; }

/* Glance strip */
.ct-glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  border: 1px solid var(--rule-2);
  background: var(--paper);
  margin: 28px 0 40px;
}
.ct-glance > div {
  padding: 14px 18px;
  border-right: 1px dashed var(--rule-2);
}
.ct-glance > div:last-child { border-right: none; }
.ct-glance-label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.ct-glance-value {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 18px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ct-glance-value .unit { color: var(--ink-3); font-size: 12px; margin-left: 2px; font-weight: 400; }

@media (max-width: 640px) {
  .ct-glance { grid-template-columns: 1fr 1fr; }
  .ct-glance > div { border-right: 1px dashed var(--rule-2); border-bottom: 1px dashed var(--rule-2); }
  .ct-glance > div:nth-child(2n) { border-right: none; }
  .ct-glance > div:nth-last-child(-n+2) { border-bottom: none; }
}

/* Callouts — dimension-annotation frame with L-bracket corner ticks */
.ct-callout {
  position: relative;
  margin: 24px 0;
  padding: 16px 20px 16px 20px;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}
/* Four L-brackets — 10px legs, 1.5px stroke, rust, offset inward 4px */
.ct-callout::before,
.ct-callout::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  pointer-events: none;
}
.ct-callout::before {
  top: -1px; left: -1px;
  border-top: 1.5px solid var(--rust);
  border-left: 1.5px solid var(--rust);
}
.ct-callout::after {
  bottom: -1px; right: -1px;
  border-bottom: 1.5px solid var(--rust);
  border-right: 1.5px solid var(--rust);
}
/* Additional two corners via nested spans injected by .label's sibling ::marker trick
   — simpler: add span.ct-tr and span.ct-bl in HTML, or render as second pseudo tree.
   We use outline-offset with a data-corner pseudo layer below. */
.ct-callout > .ct-corners { display: none; } /* fallback hook */
.ct-callout .label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rust-ink);
  margin-right: 10px;
  font-weight: 600;
}
.ct-callout.note .label { color: var(--ink-2); }
.ct-callout.warn {
  background: var(--warn-wash);
  border-color: var(--rust-soft);
}
.ct-callout.warn .label { color: var(--rust-ink); }
.ct-callout p:last-child { margin-bottom: 0; }

/* Extra two corners using a span hook, so all four L-brackets render */
.ct-callout .ct-tr,
.ct-callout .ct-bl {
  position: absolute;
  width: 12px; height: 12px;
  pointer-events: none;
}
.ct-callout .ct-tr { top: -1px; right: -1px; border-top: 1.5px solid var(--rust); border-right: 1.5px solid var(--rust); }
.ct-callout .ct-bl { bottom: -1px; left: -1px; border-bottom: 1.5px solid var(--rust); border-left: 1.5px solid var(--rust); }

/* Tables — typeset for tabular data */
.ct-table-wrapper {
  margin: 20px 0 28px;
  overflow-x: auto;
  border: 1px solid var(--rule-2);
  background: var(--paper);
}
table.ct-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-family: var(--serif);
}
table.ct-table th,
table.ct-table td {
  padding: 8px 14px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
table.ct-table thead th {
  background: var(--paper-deep);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  border-bottom: 1.5px solid var(--rule-2);
  padding: 10px 14px;
}
table.ct-table td.num,
table.ct-table th.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 13.5px;
}
table.ct-table tbody tr:nth-child(even) { background: rgba(223, 216, 200, 0.22); }
table.ct-table tbody tr:last-child td { border-bottom: none; }
table.ct-table tbody tr:hover { background: var(--paper-deep); }

/* Sources */
.ct-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}
.ct-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 8px;
  border: 1px solid var(--rule-2);
  background: var(--paper);
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  line-height: 1.2;
}
.ct-source-badge:hover { border-color: var(--rust); color: var(--ink); }
.ct-source-badge-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--paper);
  background: var(--rust);
  padding: 2px 6px;
  border-radius: 0;
  font-weight: 500;
}

/* Related */
.ct-related {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  border: 1px solid var(--rule-2);
  background: var(--paper);
  margin: 20px 0;
}
.ct-related a {
  display: block;
  padding: 16px 18px;
  border-right: 1px dashed var(--rule-2);
  border-bottom: 1px dashed var(--rule-2);
  text-decoration: none;
  color: var(--ink);
}
.ct-related a:last-child { border-right: none; }
.ct-related a:hover { background: var(--paper-deep); }
.ct-related a .k {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.ct-related a .t {
  font-family: var(--serif-head);
  font-size: 17px;
  color: var(--ink);
}
@media (max-width: 640px) {
  .ct-related { grid-template-columns: 1fr; }
  .ct-related a { border-right: none; }
}

/* Disclaimer */
.ct-disclaimer {
  margin: 40px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.55;
  font-style: italic;
}

/* Hub calc-card tiles */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--rule-2);
  border: 1px solid var(--rule-2);
  margin: 24px 0;
}
.calc-card {
  display: block;
  padding: 20px 22px;
  background: var(--paper);
  text-decoration: none;
  color: var(--ink);
  position: relative;
}
.calc-card:hover { background: var(--paper-deep); }
.calc-card .k {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rust-ink);
  margin-bottom: 6px;
}
.calc-card h3 {
  font-family: var(--serif-head);
  font-size: 18px;
  margin: 0 0 6px;
  font-weight: 600;
  font-style: normal;
}
.calc-card p {
  font-size: 14px;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.5;
}
.calc-card .arrow {
  position: absolute;
  top: 20px; right: 22px;
  color: var(--rule-2);
  font-family: var(--mono);
}
.calc-card:hover .arrow { color: var(--rust); }

/* App CTA */
.app-cta.compact { margin: 22px 0 0; padding: 14px 18px; }
.app-cta.compact h3 { font-size: 16px; margin: 0; }
.app-cta.compact .eyebrow { margin-bottom: 2px; }
.app-cta {
  position: relative;
  margin: 44px 0 0;
  padding: 22px 24px;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
/* Same L-bracket corner-tick motif for the CTA block */
.app-cta::before,
.app-cta::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  pointer-events: none;
}
.app-cta::before { top: -1px; left: -1px; border-top: 1.5px solid var(--rust); border-left: 1.5px solid var(--rust); }
.app-cta::after  { bottom: -1px; right: -1px; border-bottom: 1.5px solid var(--rust); border-right: 1.5px solid var(--rust); }
.app-cta .ct-tr { position: absolute; top: -1px; right: -1px; width: 14px; height: 14px; border-top: 1.5px solid var(--rust); border-right: 1.5px solid var(--rust); pointer-events: none; }
.app-cta .ct-bl { position: absolute; bottom: -1px; left: -1px; width: 14px; height: 14px; border-bottom: 1.5px solid var(--rust); border-left: 1.5px solid var(--rust); pointer-events: none; }

.app-cta .copy { flex: 1 1 320px; min-width: 260px; }
.app-cta .copy .eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rust-ink);
  margin-bottom: 4px;
}
.app-cta h3 {
  font-family: var(--serif-head);
  font-size: 19px;
  margin: 0 0 4px;
  font-style: normal;
  font-weight: 600;
}
.app-cta p {
  font-size: 14px;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.5;
}
.app-cta .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-app {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  padding: 11px 16px 11px 14px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 0;
  text-transform: uppercase;
  white-space: nowrap;
}
.btn-app:hover { background: var(--rust); color: var(--paper); }
.btn-app .phone { font-size: 15px; }

/* Calculator panel */
.calc-panel {
  border: 1px solid var(--rule-2);
  background: var(--paper);
  margin: 24px 0 0;
}
.calc-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule-2);
}
.calc-form .field {
  background: var(--paper);
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.calc-form label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 500;
}
.calc-form input,
.calc-form select {
  font-family: var(--mono);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule-2);
  padding: 4px 0 6px;
  outline: none;
  width: 100%;
}
.calc-form input:focus,
.calc-form select:focus {
  border-bottom-color: var(--rust);
}
.calc-form .field .hint {
  font-family: var(--serif);
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
  font-style: italic;
}
.calc-form .field.wide { grid-column: 1 / -1; }
.calc-form .field:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 520px) {
  .calc-form { grid-template-columns: 1fr; }
}

.calc-result {
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
  border-top: 1px solid var(--rule-2);
  background: var(--paper-deep);
}
.calc-result .primary { grid-column: 1 / -1; }
.calc-result .k {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.calc-result .v {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.1;
}
.calc-result .primary .v { font-size: 44px; color: var(--rust-ink); font-weight: 500; }
.calc-result .v .unit { font-size: 16px; color: var(--ink-3); margin-left: 4px; font-weight: 400; }
.calc-result .v.sub { font-size: 18px; }
.calc-result .status {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border: 1px solid var(--rule-2);
  background: var(--paper);
  color: var(--ink-2);
}
.calc-result .status.ok { color: #3a5030; border-color: #b8c3a3; }
.calc-result .status.low { color: var(--rust-ink); border-color: var(--rust-soft); background: var(--warn-wash); }
.calc-result .status.high { color: #7a5a1a; border-color: #c9b88a; background: #f5ecd3; }

/* Worked example — monospace, drafting-manual style */
.worked {
  border: 1px solid var(--rule-2);
  background: var(--paper);
  padding: 18px 22px;
  margin: 20px 0;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-2);
  white-space: pre-wrap;
  position: relative;
}
.worked::before {
  content: "";
  position: absolute;
  top: 12px; bottom: 12px; left: 8px;
  width: 2px;
  background: var(--rust);
  opacity: 0.25;
}
.worked .step-k { color: var(--ink-3); }
.worked .result { color: var(--rust-ink); font-weight: 500; }

/* FAQ — disclosure stack */
.faq details {
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
}
.faq details:first-of-type { border-top: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  font-family: var(--serif-head);
  font-size: 18px;
  color: var(--ink);
  list-style: none;
  position: relative;
  padding-right: 28px;
  font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px; top: 0;
  font-family: var(--mono);
  color: var(--rust);
  font-size: 18px;
  font-weight: 500;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 10px 0 4px; font-size: 15px; color: var(--ink-2); }

/* Hub intro */
.hub-intro {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  align-items: end;
  margin-bottom: 32px;
}
.hub-intro .stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule-2);
  border: 1px solid var(--rule-2);
}
.hub-intro .stats div {
  background: var(--paper);
  padding: 12px 14px;
}
.hub-intro .stats .n {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--rust-ink);
  font-variant-numeric: tabular-nums;
}
.hub-intro .stats .k {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-top: 2px;
}
@media (max-width: 720px) {
  .hub-intro { grid-template-columns: 1fr; gap: 20px; }
}

/* Common-mistakes list */
.mistakes {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  border: 1px solid var(--rule-2);
  background: var(--paper);
}
.mistakes li {
  padding: 12px 16px 12px 44px;
  border-bottom: 1px dashed var(--rule-2);
  position: relative;
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.55;
}
.mistakes li:last-child { border-bottom: none; }
.mistakes li::before {
  content: "×";
  position: absolute;
  left: 16px; top: 10px;
  font-family: var(--mono);
  color: var(--rust);
  font-size: 18px;
  font-weight: 500;
}
.mistakes li strong { color: var(--ink); font-weight: 600; }

/* Footer */
.ct-footer {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  margin-top: 64px;
  padding: 24px 24px 40px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ct-footer-inner {
  max-width: var(--max-hub);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.ct-footer a { color: var(--ink-3); text-decoration: none; margin-right: 18px; }
.ct-footer a:hover { color: var(--rust); }

/* ─── Job Sheet (print) ────────────────────────────────────────────── */

/* Screen-only print button (renders next to the result block) */
.print-actions { margin: 14px 0 6px; display: flex; justify-content: flex-end; }
.btn-print-job {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--paper-deep);
  border: 1px solid var(--rule-2);
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.btn-print-job:hover { color: var(--rust-ink); border-color: var(--rust-soft); background: var(--paper); }
.btn-print-job::before { content: "↳ "; color: var(--rust); margin-right: 4px; }

.print-only { display: none; }

@media print {
  @page { margin: 14mm 14mm 16mm; }
  body.claude-theme {
    background: white !important;
    color: black !important;
    font-family: var(--serif);
    font-size: 11pt;
    line-height: 1.45;
  }
  /* Hide page chrome */
  .ct-topbar, .ct-footer, button, .btn-print-job, .print-actions,
  nav { display: none !important; }
  /* Hide everything in main except the calc panel */
  .ct-shell > *:not(.calc-panel) { display: none !important; }
  .ct-shell { padding: 0 !important; max-width: 100% !important; }
  /* Show print-only blocks */
  .print-only { display: block !important; }

  /* Header */
  .print-header {
    border-bottom: 2px solid #000;
    padding-bottom: 8pt;
    margin-bottom: 14pt;
  }
  .print-header .ph-brand {
    font-family: var(--mono);
    font-size: 9.5pt;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #b35c1e;
    margin-bottom: 3pt;
  }
  .print-header .ph-title {
    font-family: var(--serif-head);
    font-size: 18pt;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 4pt;
  }
  .print-header .ph-meta {
    font-family: var(--mono);
    font-size: 8.5pt;
    color: #555;
    letter-spacing: 0.04em;
  }

  /* Page title — hide screen h1, the print header carries it */
  h1 { display: none !important; }

  /* Calc panel */
  .calc-panel {
    border: 1px solid #000 !important;
    padding: 10pt !important;
    background: white !important;
    page-break-inside: avoid;
    margin: 0 !important;
  }
  .calc-form {
    display: block !important;
    background: none !important;
    gap: 0 !important;
  }
  .calc-form .field {
    background: none !important;
    padding: 4pt 0 !important;
    border: none !important;
    border-bottom: 1px dotted #888 !important;
    display: flex;
    align-items: baseline;
    gap: 12pt;
  }
  .calc-form .field:last-child { border-bottom: none !important; grid-column: auto !important; }
  .calc-form .field label {
    font-family: var(--mono);
    font-size: 8.5pt;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #444;
    min-width: 170pt;
    margin: 0;
  }
  .calc-form .field input,
  .calc-form .field select {
    border: none !important;
    background: none !important;
    font-family: var(--serif) !important;
    font-size: 12pt !important;
    color: #000 !important;
    padding: 0 !important;
    appearance: none;
    -webkit-appearance: none;
  }
  .calc-form .field .hint { display: none !important; }

  .calc-result {
    border: 1px solid #000 !important;
    padding: 10pt !important;
    background: #fbfaf6 !important;
    margin-top: 12pt !important;
    page-break-inside: avoid;
  }
  .calc-result .k { font-family: var(--mono); font-size: 8.5pt; color: #444; letter-spacing: 0.04em; text-transform: uppercase; }
  .calc-result .v { font-family: var(--serif-head); font-size: 18pt; color: #000 !important; font-weight: 600; }
  .calc-result .primary .v { font-size: 22pt; }
  .calc-result .v.sub { font-size: 12pt; }
  .calc-result .v .unit { font-size: 9pt; color: #555; }
  .calc-result .status {
    font-family: var(--mono);
    font-size: 9pt;
    border: 1px solid #444 !important;
    background: white !important;
    color: #000 !important;
    padding: 3pt 6pt !important;
    margin-top: 4pt;
  }

  /* Footer with signature lines */
  .print-footer { margin-top: 22pt; page-break-inside: avoid; }
  .print-footer .ph-sig {
    font-family: var(--mono);
    font-size: 9.5pt;
    letter-spacing: 0.04em;
    margin: 14pt 0 0;
    padding-bottom: 2pt;
    border-bottom: 1px solid #000;
    color: #444;
  }
  .print-footer .ph-sig-label {
    text-transform: uppercase;
    font-size: 8pt;
    letter-spacing: 0.08em;
    color: #444;
  }
  .print-footer .ph-foot-meta {
    font-family: var(--mono);
    font-size: 8pt;
    color: #888;
    margin-top: 20pt;
    text-align: center;
    letter-spacing: 0.04em;
  }
}

/* ─── Field Mode (high-contrast calc widget for sun/glove use) ─────── */

.btn-field-toggle {
  display: block;
  margin: 0 0 12px auto;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--paper-deep);
  border: 1px solid var(--rule-2);
  padding: 8px 14px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.btn-field-toggle:hover { color: var(--rust-ink); border-color: var(--rust-soft); }
.btn-field-toggle::before { content: "◑ "; color: var(--rust); margin-right: 4px; }
.btn-field-toggle[aria-pressed="true"] { background: #ffd47e; color: #0e0e10; border-color: #ffd47e; }
.btn-field-toggle[aria-pressed="true"]::before { color: #0e0e10; }

/* Restyle the calc widget when field mode is active.
   Deliberately scoped to .calc-panel and .calc-result only —
   the surrounding article stays paper. */
body.field-mode .calc-panel {
  background: #0e0e10;
  border-color: #2a2a2d;
}
body.field-mode .calc-form { background: #2a2a2d; }
body.field-mode .calc-form .field { background: #0e0e10; }
body.field-mode .calc-form .field label { color: #d0d0c8; }
body.field-mode .calc-form .field input,
body.field-mode .calc-form .field select {
  background: #1a1a1c;
  color: #ffd47e;
  border-color: #3a3a3d;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  caret-color: #ffd47e;
  padding: 12px 12px;
}
body.field-mode .calc-form .field input:focus,
body.field-mode .calc-form .field select:focus {
  border-color: #ffd47e;
  outline: 1px solid #ffd47e;
  outline-offset: 0;
}
body.field-mode .calc-form .field .hint { color: #8c8c84; font-size: 11px; }

body.field-mode .calc-result { background: #0e0e10; }
body.field-mode .calc-result .k { color: #8c8c84; }
body.field-mode .calc-result .v { color: #ffd47e; font-size: 56px; line-height: 1.0; }
body.field-mode .calc-result .primary .v { font-size: 72px; }
body.field-mode .calc-result .v.sub { font-size: 28px; color: #f5f5f0; }
body.field-mode .calc-result .v .unit { color: #8c8c84; }
body.field-mode .calc-result .status {
  background: #1a1a1c;
  color: #ffd47e;
  border-color: #ffd47e;
  font-size: 14px;
  padding: 8px 12px;
}
body.field-mode .calc-result .status.ok { color: #a3d970; border-color: #a3d970; background: #15201a; }
body.field-mode .calc-result .status.low { color: #ff9a4a; border-color: #ff9a4a; background: #2a1d12; }
body.field-mode .calc-result .status.high { color: #ffce4a; border-color: #ffce4a; background: #2a2412; }

/* COLREGs visual sketch — night/sea backdrop, inverts cleanly in field mode */
.colregs-sketch {
  background: var(--ink);
  color: var(--paper);
  padding: 14px 18px;
  border: 1px solid var(--ink-2);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  margin: 6px 0 0;
  overflow-x: auto;
  white-space: pre;
}
body.field-mode .colregs-sketch {
  background: #0e0e10;
  color: #ffd47e;
  border-color: #3a3a3d;
}
