/* ==========================================================================
   Operations Diagnostic — self-contained styles
   Tokens mirror the portfolio site (styles.css) so the page sits inside the
   same design language without importing it. Mobile-first.
   ========================================================================== */

:root {
  --ink: #17211d;
  --muted: #66716b;
  --paper: #f4f1e9;
  --cream: #e9e1d0;
  --lime: #d6f05b;
  --coral: #ec765e;
  --blue: #426b82;
  --line: rgba(23, 33, 29, .16);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Trebuchet MS', 'Segoe UI', sans-serif;
  --shadow: 8px 8px 0 rgba(23, 33, 29, .10);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
}

h1, h2, h3, p, ul, ol, dl { margin-top: 0; }
a { color: inherit; }

.site-header {
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -.02em; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 33px; height: 33px; background: var(--ink); color: var(--lime); font-size: .7rem; }
.nav-link { color: var(--muted); font-size: .82rem; font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 3px; }

main { display: block; }

.screen { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 72px; }

/* ------------------------------------------------------------ intro ---- */
.eyebrow { color: var(--coral); font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; margin: 0 0 18px; }
.intro-heading { font-family: var(--serif); font-weight: 400; letter-spacing: -.045em; font-size: clamp(2.2rem, 9vw, 3.6rem); line-height: .98; margin: 0 0 22px; }
.intro-text { color: var(--muted); font-size: 1.05rem; max-width: 46rem; }
.exhibit-note { border-left: 3px solid var(--lime); padding: 4px 0 4px 16px; color: var(--ink); font-size: .92rem; font-weight: 600; max-width: 42rem; }
.intro-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 26px; }
.intro-meta { color: var(--muted); font-size: .8rem; }

/* ----------------------------------------------------------- buttons ---- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  padding: 14px 18px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s ease;
}
.button:hover { opacity: .92; }
.button-dark { background: var(--ink); color: var(--paper); }
.button-light { background: var(--lime); color: var(--ink); }
.button-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

/* --------------------------------------------------------- progress ----- */
.progress { margin-bottom: 28px; }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.progress-track { position: relative; height: 6px; margin-top: 10px; background: var(--cream); }
.progress-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ink); transition: width .25s ease; }

/* --------------------------------------------------------- questions ---- */
.question { border: none; margin: 0 0 8px; padding: 0; }
.question-legend { display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 10px; }
.question-number { color: var(--coral); font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.question-tag { color: var(--muted); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--line); padding: 2px 7px; }
.question-prompt { font-family: var(--serif); font-weight: 400; font-size: clamp(1.4rem, 6vw, 2rem); line-height: 1.1; letter-spacing: -.03em; margin-bottom: 10px; }
.question-helper { color: var(--muted); font-size: .88rem; margin-bottom: 20px; }

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 16px;
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.option:hover { border-color: var(--ink); }
.option input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--ink); flex: 0 0 auto; }
.option-label { font-size: .95rem; line-height: 1.45; }
.option input:checked + .option-label { font-weight: 700; }
.option:has(input:checked) { border-color: var(--ink); background: var(--cream); box-shadow: var(--shadow); }

.option-extra { margin: -2px 0 6px; padding: 0 16px 4px; }
.option-extra-label { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.option-extra input,
.answer-text,
.email-row input {
  width: 100%;
  padding: 13px 14px;
  font-family: inherit;
  font-size: .96rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
}
.answer-text { min-height: 150px; resize: vertical; }
.answer-text:focus, .option-extra input:focus, .email-row input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

.char-count { color: var(--muted); font-size: .78rem; margin: 8px 0 0; }
.char-count.is-valid { color: var(--blue); font-weight: 700; }

.form-error { color: #a02b2b; font-size: .86rem; font-weight: 700; margin: 16px 0 0; }
.form-actions { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 26px; }
.form-actions .button { width: 100%; }

/* Honeypot: present for bots, out of sight (and out of tab order) for people. */
.spam-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ----------------------------------------------------------- results ---- */
.results-head { border-bottom: 1px solid var(--line); padding-bottom: 26px; margin-bottom: 32px; }
.score-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.score-value { font-family: var(--serif); font-size: clamp(3.2rem, 16vw, 5rem); line-height: .9; letter-spacing: -.05em; }
.score-max { color: var(--muted); font-size: 1.1rem; }
.tier-chip { margin-left: auto; font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; padding: 6px 12px; border: 1px solid var(--ink); }
.tier-chip.tier-hot { background: var(--lime); border-color: var(--ink); }
.tier-chip.tier-warm { background: var(--cream); }
.tier-chip.tier-cold { background: transparent; color: var(--muted); border-color: var(--line); }
.tier-label { color: var(--blue); font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 16px 0 12px; }
.results-heading { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 7vw, 2.4rem); line-height: 1.08; letter-spacing: -.04em; margin-bottom: 14px; }
.results-text { color: var(--muted); }
.echo { border-left: 3px solid var(--line); padding-left: 14px; font-size: .9rem; color: var(--ink); margin-top: 16px; }

.results-block { margin-bottom: 40px; }
.block-title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.3rem, 5.5vw, 1.8rem); line-height: 1.15; letter-spacing: -.03em; margin-bottom: 10px; }
.block-intro { color: var(--muted); font-size: .92rem; }

.bars { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 18px; }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .88rem; }
.bar-name { font-weight: 700; }
.bar-value { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-track { height: 12px; margin-top: 8px; background: var(--cream); border: 1px solid var(--line); }
.bar-fill { display: block; height: 100%; background: var(--blue); }
.bar.is-weakest .bar-fill { background: var(--coral); }
.bar-flag { display: inline-block; margin-top: 8px; font-size: .66rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--coral); }

.report-block { background: #fff; border: 1px solid var(--line); padding: 24px 20px; box-shadow: var(--shadow); }
.report-headline { font-family: var(--serif); font-size: 1.15rem; line-height: 1.3; margin-bottom: 16px; }
.tips { list-style: none; counter-reset: tip; padding: 0; margin: 18px 0; display: flex; flex-direction: column; gap: 16px; }
.tips li { counter-increment: tip; position: relative; padding-left: 40px; font-size: .94rem; }
.tips li::before {
  content: counter(tip, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 2px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--coral);
}
.tips strong { display: block; }
.service-line { color: var(--muted); font-size: .8rem; margin-bottom: 14px; }
.benchmark { border-top: 1px solid var(--line); padding-top: 14px; color: var(--muted); font-size: .86rem; margin: 0; }
.benchmark-label { display: block; font-size: .66rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; }

.cta-block { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.cta-block .button { width: 100%; }
.cta-note { color: var(--muted); font-size: .86rem; margin: 4px 0 0; }

.email-block { background: var(--cream); padding: 22px 20px; }
.field-label { display: block; font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.email-row { display: flex; flex-direction: column; gap: 10px; }
.email-row input { background: #fff; }
.email-message { font-size: .86rem; font-weight: 700; color: var(--blue); margin: 12px 0 0; min-height: 1.2em; }
.email-message.is-error { color: #a02b2b; }

.system-record { border-top: 1px solid var(--line); padding-top: 24px; }
.record-list { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 6px; font-size: .84rem; color: var(--muted); }
.record-list li { word-break: break-word; }
.system-record .button { width: 100%; }

/* ------------------------------------------------------------ footer ---- */
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
  font-size: .74rem;
  color: var(--muted);
}
.site-footer a { color: var(--ink); }

/* --------------------------------------------- analytics funnel panel ---- */
.analytics-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  max-height: 82vh;
  overflow: auto;
  padding: 18px 16px 20px;
  background: #fff;
  border-top: 3px solid var(--ink);
  box-shadow: 0 -10px 30px rgba(23, 33, 29, .18);
  font-size: .84rem;
}
.analytics-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.analytics-title { font-family: var(--serif); font-weight: 400; font-size: 1.2rem; letter-spacing: -.02em; margin: 0 0 6px; }
.analytics-close { border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 1rem; line-height: 1; padding: 6px 10px; cursor: pointer; }
.analytics-note { color: var(--muted); font-size: .76rem; margin-bottom: 14px; }
.analytics-empty { color: var(--muted); }
.analytics-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; margin: 0 0 16px; }
.analytics-summary dt { color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.analytics-summary dd { margin: 0 0 8px; font-weight: 700; }
.analytics-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.analytics-table th, .analytics-table td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.analytics-table thead th { color: var(--muted); font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.analytics-table tbody th { text-align: left; font-weight: 600; white-space: normal; }
.analytics-table td.is-drop { color: var(--coral); font-weight: 800; }
.analytics-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.analytics-stored { color: var(--muted); font-size: .74rem; }

/* ------------------------------------------------------- wider screens -- */
@media (min-width: 640px) {
  .screen { padding: 56px 0 96px; }
  .analytics-panel {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: min(600px, calc(100% - 48px));
    border: 3px solid var(--ink);
    box-shadow: var(--shadow);
    padding: 22px 24px 24px;
  }
  .analytics-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .intro-actions { flex-direction: row; align-items: center; gap: 22px; }
  .form-actions { flex-direction: row; justify-content: space-between; }
  .form-actions .button { width: auto; }
  .cta-block .button { width: auto; }
  .email-row { flex-direction: row; align-items: stretch; }
  .email-row input { flex: 1 1 auto; }
  .email-row .button { white-space: nowrap; }
  .report-block { padding: 30px 28px; }
  .email-block { padding: 28px 28px; }
  .system-record .button { width: auto; }
}
