/* Pitchsense Systems — runbook style */

:root {
  color-scheme: light;
  --off: #f6f5f0;
  --paper: #ffffff;
  --ink: #20262b;
  --slate: #3f4a54;
  --muted: #555d64;
  --olive: #566b2c;
  --olive-deep: #3f5020;
  --olive-wash: #eaeedd;
  --line: #d9d8cf;
  --line-strong: #9b9c90;
  --control: #73776a;
  --alert: #9b2c22;
  --alert-wash: #fbece9;
  --focus: #3f5020;

  --head: "Segoe UI Semibold", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--off); color: var(--ink); font-family: var(--body); font-size: 1.04rem; line-height: 1.6; }
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 600; line-height: 1.2; margin: 0 0 0.55em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2.05rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--olive-deep); }
p, ul, ol { margin: 0 0 1em; }
a { color: var(--olive-deep); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.label { font-family: var(--head); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--olive-deep); margin-bottom: 0.6rem; }

.wrap { width: 100%; max-width: 74rem; margin: 0 auto; padding: 0 var(--gutter); }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 20; background: var(--ink); color: #fff; padding: 0.6rem 1rem; text-decoration: none; }
.skip-link:focus { top: 1rem; color: #fff; }

/* Header */
.site-header { background: var(--paper); border-bottom: 3px solid var(--olive); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 2rem; padding-top: 0.9rem; padding-bottom: 0.9rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--head); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.brand svg { width: 1.8rem; height: 1.8rem; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; font-family: var(--head); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.site-nav li + li::before { content: "|"; color: var(--line-strong); padding: 0 0.7rem; }
.site-nav a { color: var(--slate); text-decoration: none; padding: 0.3rem 0; display: inline-block; }
.site-nav a:hover { color: var(--olive-deep); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--olive-deep); text-decoration: underline; text-decoration-thickness: 2px; }

/* Opening */
.opening { padding: clamp(2.5rem, 6vw, 4.25rem) 0 clamp(2rem, 4vw, 3rem); }
.intro-grid { display: grid; gap: 1.5rem 3rem; }
.intro-grid > * { min-width: 0; }
.opening .lead { font-size: 1.15rem; max-width: 40rem; }
.proc-list { list-style: none; padding: 0; margin: 0; counter-reset: pl; border-top: 2px solid var(--ink); }
.proc-list li { counter-increment: pl; border-bottom: 1px solid var(--line); }
.proc-list a { display: grid; grid-template-columns: 3.5rem 1fr; padding: 0.6rem 0; color: var(--ink); text-decoration: none; }
.proc-list a::before { content: "PR-" counter(pl); font-family: var(--head); font-size: 0.78rem; letter-spacing: 0.08em; color: var(--olive-deep); padding-top: 0.2rem; }
.proc-list a:hover b { text-decoration: underline; }
.proc-list b { font-family: var(--head); font-weight: 600; }
.proc-list span { grid-column: 2; color: var(--muted); font-size: 0.92rem; }
.opening .tools { color: var(--muted); font-size: 0.93rem; margin-top: 0.9rem; }
.btn { display: inline-block; background: var(--olive); color: #fff; text-decoration: none; font-family: var(--head); font-weight: 600; font-size: 0.98rem; letter-spacing: 0.04em; padding: 0.7rem 1.2rem; border: 0; cursor: pointer; transition: background-color 0.15s ease; }
.btn:hover { background: var(--olive-deep); color: #fff; }
.opening .scope { font-size: 0.92rem; color: var(--muted); margin-top: 1rem; max-width: 40rem; }
@media (min-width: 60rem) { .intro-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }

/* Migration waves chart */
.waves-fig { margin: 2.25rem 0 0; background: var(--paper); border: 1px solid var(--line-strong); padding: 1rem 1.1rem 0.9rem; }
.waves-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; margin-bottom: 0.75rem; }
.waves-head h2 { font-size: 1.1rem; margin: 0; }
.waves-head .tag { font-family: var(--head); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-strong); padding: 0.05rem 0.45rem; }
.months { display: none; }
.waves { list-style: none; padding: 0; margin: 0; counter-reset: w; }
.waves li { counter-increment: w; display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 0.1rem 0.6rem; padding: 0.6rem 0; border-top: 1px solid var(--line); }
.waves li::before { content: counter(w); grid-row: 1 / span 3; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; background: var(--slate); color: #fff; font-family: var(--head); font-size: 0.85rem; }
.waves li.crit::before { background: var(--olive); }
.w-name { font-family: var(--head); font-weight: 600; }
.w-when { font-size: 0.9rem; color: var(--olive-deep); font-weight: 600; }
.w-desc { font-size: 0.92rem; color: var(--muted); }
.w-track { display: none; }
.waves-fig figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; }
@media (min-width: 60rem) {
  .months { display: grid; grid-template-columns: 17rem repeat(6, minmax(0, 1fr)); font-family: var(--head); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--ink); padding-bottom: 0.3rem; }
  .months span:first-child { grid-column: 2; }
  .waves li { grid-template-columns: 2rem 15rem minmax(0, 1fr); align-items: center; gap: 0 0 ; column-gap: 0; padding: 0.55rem 0; }
  .waves li::before { grid-row: 1 / span 2; }
  .w-name { grid-column: 2; grid-row: 1; }
  .w-desc { grid-column: 2; grid-row: 2; font-size: 0.85rem; padding-right: 1rem; }
  .w-when { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .w-track { display: block; grid-column: 3; grid-row: 1 / span 2; position: relative; height: 1.6rem; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(16.666% - 1px), var(--line) calc(16.666% - 1px), var(--line) 16.666%); }
  .w-bar { position: absolute; top: 0.2rem; bottom: 0.2rem; background: var(--slate); }
  .crit .w-bar { background: var(--olive); }
  .b1 { left: 0; width: 16.666%; }
  .b2 { left: 16.666%; width: 33.333%; }
  .b3 { left: 33.333%; width: 33.333%; }
  .b4 { left: 50%; width: 41.666%; }
  .b5 { left: 83.333%; width: 16.666%; }
}

/* Sections */
.section { padding: clamp(2.75rem, 6vw, 4.25rem) 0; border-top: 1px solid var(--line); }
.section-paper { background: var(--paper); }
.section .intro { color: var(--muted); max-width: 44rem; }

/* Procedures */
.proc { background: var(--paper); border: 1px solid var(--line-strong); border-left: 6px solid var(--olive); margin-top: 1.75rem; }
.proc-head { padding: 1rem 1.25rem 0.75rem; border-bottom: 1px solid var(--line); }
.proc-head .label { margin-bottom: 0.25rem; }
.proc-head h3 { margin: 0 0 0.35rem; }
.proc-head p { margin: 0; color: var(--muted); max-width: 48rem; }
.proc-grid { display: grid; gap: 0; }
.proc-grid > div { padding: 1rem 1.25rem; min-width: 0; }
.proc-grid > div + div { border-top: 1px solid var(--line); }
.proc-grid ul, .proc-grid ol { margin: 0; padding-left: 1.2rem; }
.proc-grid li { margin-bottom: 0.35rem; font-size: 0.97rem; }
.proc-grid ol li::marker { font-family: var(--head); color: var(--olive-deep); }
.proc-note { margin: 0; padding: 0.7rem 1.25rem; background: var(--off); border-top: 1px solid var(--line); font-size: 0.93rem; color: var(--muted); }
@media (min-width: 60rem) { .proc-grid { grid-template-columns: 1fr 1.35fr 1fr; } .proc-grid > div + div { border-top: 0; border-left: 1px solid var(--line); } }

/* Restore test box */
.restore { display: grid; gap: 1.5rem 3rem; align-items: start; }
.restore > * { min-width: 0; }
.restore-box { background: var(--slate); color: #eef0ee; padding: 1.25rem 1.4rem; }
.restore-box h3 { color: #fff; }
.restore-box ol { margin: 0; padding-left: 1.2rem; }
.restore-box li { margin-bottom: 0.45rem; }
.restore-box li::marker { color: #cfdba6; font-family: var(--head); }
.targets { border: 2px solid var(--ink); background: var(--paper); padding: 1rem 1.2rem; }
.targets dl { margin: 0; }
.targets dt { font-family: var(--head); font-weight: 600; margin-top: 0.6rem; }
.targets dt:first-child { margin-top: 0; }
.targets dd { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.95rem; }
@media (min-width: 60rem) { .restore { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }

.billing { margin-top: 1.5rem; font-size: 0.95rem; color: var(--muted); max-width: 48rem; border-top: 1px dashed var(--line-strong); padding-top: 0.8rem; }

/* Resource */
.res { display: grid; gap: 1.5rem 3rem; align-items: center; }
.res > * { min-width: 0; }
.res-sample { overflow-x: auto; }
.res-sample table { border-collapse: collapse; width: 100%; min-width: 24rem; font-size: 0.85rem; background: var(--paper); }
.res-sample th, .res-sample td { border: 1px solid var(--line-strong); padding: 0.35rem 0.5rem; text-align: left; height: 1.9rem; }
.res-sample th { background: var(--olive-wash); font-family: var(--head); font-weight: 600; }
@media (min-width: 60rem) { .res { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }

/* About */
.about { display: grid; gap: 1.5rem 3rem; }
.about > * { min-width: 0; }
.about p { max-width: 42rem; }
.scope-list { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.scope-list li { counter-increment: s; display: grid; grid-template-columns: 2.2rem 1fr; padding: 0.5rem 0; border-bottom: 1px solid var(--line); font-size: 0.97rem; }
.scope-list li::before { content: counter(s, decimal-leading-zero); font-family: var(--head); color: var(--olive-deep); }
@media (min-width: 60rem) { .about { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }

/* Contact: change request panel */
.cr { background: var(--paper); border: 2px solid var(--ink); max-width: 56rem; }
.cr-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem 1rem; background: var(--ink); color: #fff; padding: 0.7rem 1.1rem; }
.cr-head h3 { margin: 0; font-size: 1rem; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; }
.cr-head p { margin: 0; font-size: 0.85rem; color: #d7dbd2; }
.cr-body { padding: 1.1rem 1.1rem 1.3rem; }
.cr-notice { border-left: 5px solid var(--alert); background: var(--alert-wash); padding: 0.75rem 1rem; margin-bottom: 1.25rem; font-size: 0.95rem; }
.cr-notice p { margin: 0 0 0.3rem; }
.cr-notice p:last-child { margin: 0; }
.cr-notice strong { color: var(--alert); }
fieldset { border: 0; margin: 0 0 1rem; padding: 0; min-width: 0; }
legend { font-family: var(--head); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--olive-deep); padding: 0; margin-bottom: 0.6rem; border-bottom: 1px solid var(--line); width: 100%; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.field-row { display: grid; gap: 0 1.25rem; }
.field-row > * { min-width: 0; }
@media (min-width: 46rem) { .field-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.field { margin-bottom: 1rem; }
.field label { display: block; font-family: var(--head); font-weight: 600; font-size: 0.95rem; margin-bottom: 0.3rem; }
.field .req { color: var(--alert); }
.field .optional { font-family: var(--body); font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.field-hint { font-size: 0.88rem; color: var(--muted); margin: -0.05rem 0 0.4rem; }
.field input, .field select, .field textarea { display: block; width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--control); border-radius: 0; padding: 0.55rem 0.7rem; min-height: 2.8rem; transition: border-color 0.15s ease; }
.field textarea { resize: vertical; min-height: 8rem; line-height: 1.5; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--olive-deep); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--olive-deep); }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; -webkit-appearance: none; padding-right: 2.4rem; cursor: pointer; }
.select-wrap::after { content: ""; position: absolute; right: 0.9rem; top: 50%; width: 0.45rem; height: 0.45rem; border-right: 2px solid var(--olive-deep); border-bottom: 2px solid var(--olive-deep); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.field [aria-invalid="true"] { border: 2px solid var(--alert); padding: calc(0.55rem - 1px) calc(0.7rem - 1px); background: #fffafa; }
.field-error { color: var(--alert); font-size: 0.9rem; font-weight: 700; margin: 0.35rem 0 0; }
.field-error::before { content: "Error: "; }
.field-count { font-size: 0.78rem; color: var(--muted); text-align: right; margin: 0.25rem 0 0; }
.field-count.is-near { color: var(--alert); font-weight: 700; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.error-summary { border: 2px solid var(--alert); background: var(--alert-wash); padding: 0.8rem 1rem; margin-bottom: 1.1rem; }
.error-summary h4 { color: var(--alert); text-transform: none; letter-spacing: 0; font-size: 0.98rem; margin: 0 0 0.3rem; }
.error-summary ul { margin: 0; padding-left: 1.2rem; }
.error-summary a { color: var(--alert); font-weight: 700; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.25rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.form-actions .btn:disabled { background: var(--line-strong); color: var(--ink); cursor: not-allowed; }
.form-privacy { font-size: 0.88rem; color: var(--muted); margin: 0; }
.form-status:empty { display: none; }
.form-status { margin-top: 1rem; padding: 0.75rem 1rem; border-left: 5px solid var(--line-strong); background: var(--off); font-size: 0.97rem; }
.form-status:focus { outline: none; }
.form-status:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.form-status.is-success { border-left-color: var(--olive); background: var(--olive-wash); color: var(--ink); }
.form-status.is-error { border-left-color: var(--alert); background: var(--alert-wash); color: var(--alert); }
.form-noscript { border-left: 5px solid var(--line-strong); padding: 0.7rem 1rem; margin-top: 1rem; }

/* Footer */
.site-footer { background: var(--slate); color: #dfe3e1; padding: 1.75rem 0 1.5rem; font-size: 0.9rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #cfdba6; }
.site-footer :focus-visible { outline-color: #cfdba6; }
.footer-top { display: grid; gap: 1rem; }
.footer-top p { margin: 0; max-width: 48rem; }
.footer-top ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-family: var(--head); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.footer-legal { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 1.5rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid #5d6872; font-size: 0.88rem; }
.footer-legal p { margin: 0; }
.footer-legal a[aria-current="page"] { color: #cfdba6; }
@media (min-width: 56rem) { .footer-top { grid-template-columns: 1fr auto; } }
@media (max-width: 30rem) { .footer-legal { flex-direction: column; gap: 0.4rem; } }

/* Docs */
.doc { padding: clamp(2rem, 5vw, 3.25rem) 0 3.5rem; }
.doc-head { max-width: 52rem; margin-bottom: 1.5rem; }
.doc-meta { color: var(--muted); font-size: 0.92rem; }
.doc-body { max-width: 44rem; }
.doc-body h2 { font-size: 1.3rem; margin-top: 2rem; padding-top: 0.6rem; border-top: 2px solid var(--olive); }
.doc-body ul { padding-left: 1.2rem; }
.summary { background: var(--paper); border-left: 6px solid var(--olive); padding: 0.9rem 1.1rem; margin-bottom: 1.5rem; }
.summary p:last-child { margin-bottom: 0; }

/* Runbook template */
.rb-grid { display: grid; gap: 0; border: 2px solid var(--ink); background: var(--paper); max-width: 64rem; }
.rb-grid > div { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line-strong); min-height: 3.6rem; min-width: 0; }
.rb-grid span { font-family: var(--head); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--olive-deep); }
.rb-grid small { color: var(--muted); font-size: 0.82rem; }
@media (min-width: 44rem) { .rb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .rb-grid > div { border-right: 1px solid var(--line-strong); } }
.rb-warn { border-left: 5px solid var(--alert); background: var(--alert-wash); padding: 0.6rem 0.9rem; font-size: 0.95rem; max-width: 64rem; margin: 1rem 0; }
.rb-part { margin-top: 1.75rem; max-width: 64rem; }
.rb-part h2 { font-size: 1.2rem; display: flex; gap: 0.6rem; align-items: baseline; }
.rb-part h2 span { font-size: 0.75rem; letter-spacing: 0.12em; color: #fff; background: var(--olive-deep); padding: 0.1rem 0.45rem; }
.rb-part .how { color: var(--muted); font-size: 0.95rem; }
.scroll { overflow-x: auto; }
.rb-table { width: 100%; border-collapse: collapse; background: var(--paper); font-size: 0.88rem; min-width: 52rem; }
.rb-table th, .rb-table td { border: 1px solid var(--line-strong); padding: 0.45rem 0.55rem; text-align: left; vertical-align: top; }
.rb-table thead th { background: var(--ink); color: #fff; font-family: var(--head); font-weight: 600; border-color: var(--ink); }
.rb-table .ex td { font-style: italic; color: var(--muted); }
.rb-table td.n { width: 2.6rem; text-align: center; font-family: var(--head); color: var(--olive-deep); }
.rb-table .blank td { height: 2.4rem; }
.signoff { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.2rem 2rem; max-width: 64rem; }
.signoff li { display: flex; gap: 0.6rem; align-items: flex-end; padding-top: 1rem; }
.signoff span { font-family: var(--head); font-weight: 600; white-space: nowrap; }
.signoff li::after { content: ""; flex: 1; border-bottom: 1.5px solid var(--ink); min-width: 3rem; }
@media (min-width: 44rem) { .signoff { grid-template-columns: repeat(2, 1fr); } }
.rb-foot { margin-top: 2rem; padding-top: 0.9rem; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }
.print-hint { color: var(--muted); font-size: 0.92rem; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

@media print {
  @page { size: A4 landscape; margin: 11mm; }
  body { background: #fff; color: #000; font-size: 9.5pt; line-height: 1.35; }
  .skip-link, .site-nav, .print-hint, .no-print, .site-footer { display: none !important; }
  .site-header { border-bottom: 2px solid #000; }
  .site-header .wrap, .wrap { padding: 0; max-width: none; }
  .site-header .wrap { padding-bottom: 2mm; }
  a { color: #000; text-decoration: none; }
  .doc { padding: 4mm 0 0; }
  h1 { font-size: 18pt; }
  .rb-grid { grid-template-columns: repeat(3, 1fr); border-color: #000; }
  .rb-grid > div { min-height: 13mm; border-color: #555; }
  .rb-grid span { color: #000; }
  .rb-warn { background: none; border-left-color: #000; }
  .rb-part { margin-top: 5mm; }
  .rb-part h2 { font-size: 12pt; break-after: avoid; }
  .rb-part h2 span { background: none; color: #000; border: 1px solid #000; }
  .scroll { overflow: visible; }
  .rb-table { min-width: 0; font-size: 8.5pt; }
  .rb-table thead th { background: #e5e5e5; color: #000; border-color: #555; }
  .rb-table th, .rb-table td { border-color: #555; padding: 1.3mm 1.6mm; }
  .rb-table thead { display: table-header-group; }
  .rb-table tr { break-inside: avoid; }
  .rb-table .blank td { height: 8mm; }
  .signoff { grid-template-columns: repeat(2, 1fr); }
}
