/* The Perna Team look: brand red #c9001f, black title bars, red accents, big numbers on black. */
:root {
  --red: #c9001f;
  --red-dark: #a00019;
  --ink: #222;
  --soft: #5c5c5c;
  --line: #d9d9d9;
  --tint: #f5f5f5;
  --wide: 1100px;
  --text: "Avenir Next", Avenir, "Segoe UI", Lato, "Helvetica Neue", Arial, sans-serif;
  --heavy: "Arial Black", "Avenir Next", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--tint); color: var(--ink); font-family: var(--text); font-size: 16px; line-height: 1.5; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--red); }
h1, h2, p { margin: 0; }
.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Header */
.top { background: #fff; border-bottom: 4px solid var(--red); }
.top-inner { max-width: var(--wide); margin: 0 auto; padding: 12px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.brand img { width: 150px; }
.brand-site { padding-left: 14px; border-left: 1px solid var(--line); font-weight: 700; font-size: 18px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 18px; font-size: 15px; }
.nav form { display: contents; }
.nav a, .nav .link-button { color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav .link-button:hover { color: var(--red); }
.nav a[aria-current="page"] { border-bottom-color: var(--red); font-weight: 600; }

/* Title bar */
.title-bar { background: #000; color: #fff; padding: 22px 0; }
.title-bar h1 { font-size: 28px; font-weight: 300; letter-spacing: .5px; line-height: 1.2; text-transform: uppercase; }
.subhead { margin-top: 4px; color: #ddd; }

/* Layout */
.main { flex: 1; padding-top: 24px; padding-bottom: 48px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.split-wide-first { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 22px; }
.card h2 { font-size: 20px; color: var(--red); font-weight: 700; margin-bottom: 14px; }
.narrow { max-width: 520px; }
.results { position: sticky; top: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack > .button { align-self: flex-start; }
.lead { margin-bottom: 16px; }
.section-note { margin: -4px 0 14px; color: var(--soft); font-size: 15px; }
.choice-group { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.choice-group legend { margin-bottom: 4px; padding: 0; font-size: inherit; letter-spacing: 0; text-transform: none; color: inherit; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 6px; cursor: pointer; }
.choice input { width: 20px; min-height: 0; height: 20px; margin: 0; accent-color: var(--red); }
.choice:has(input:checked) { border-color: var(--red); background: #fdf2f4; font-weight: 600; }
.result-detail { display: block; font-size: 13px; color: var(--soft); font-weight: 400; }
.result-emphasis .result-detail { color: #ddd; }
.empty { color: var(--soft); text-align: center; padding: 24px 0; }

/* Forms */
.form-section { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.form-section + .form-section { margin-top: 10px; }
legend { padding: 0; margin-bottom: 12px; font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--red); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-weight: 600; font-size: 15px; }
.optional { font-weight: 400; color: var(--soft); }
.field-help { font-size: 14px; color: var(--soft); }
.field-error { font-size: 14px; color: var(--red-dark); font-weight: 600; }
input, textarea, select { width: 100%; min-height: 44px; padding: 9px 12px; font: inherit; color: inherit; background: #fff; border: 1.5px solid #8c8c8c; border-radius: 6px; }
input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.has-error input, .has-error textarea { border-color: var(--red); }
.input-unit { position: relative; display: block; }
.input-unit::before, .input-unit::after { position: absolute; top: 50%; transform: translateY(-50%); color: var(--soft); pointer-events: none; }
.input-unit-money::before { content: "$"; left: 12px; }
.input-unit-money input { padding-left: 26px; }
.input-unit-percent::after { content: "%"; right: 12px; }
.input-unit-percent input { padding-right: 30px; }
.form-error { background: #fdecef; border-left: 4px solid var(--red); padding: 10px 14px; margin-bottom: 14px; }

/* Buttons */
.button { display: inline-block; min-height: 44px; padding: 10px 22px; font: inherit; font-weight: 700; color: #fff; background: var(--red); border: 0; border-radius: 6px; cursor: pointer; text-decoration: none; }
.button:hover { background: var(--red-dark); }
.button-secondary { color: var(--ink); background: #fff; border: 1.5px solid var(--ink); }
.button-secondary:hover { background: var(--tint); }
.pdf-button { margin-top: 16px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.link-button { padding: 0; font: inherit; color: var(--red); background: none; border: 0; cursor: pointer; text-decoration: underline; }
.nav .link-button { text-decoration: none; }
.danger { color: var(--red-dark); }
.delete-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Messages */
.notice { background: #fff; border-left: 4px solid #000; padding: 10px 14px; margin-bottom: 16px; }
.sample-banner { background: var(--red); color: #fff; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 15px; }
.fine-print { margin-top: 14px; font-size: 14px; color: var(--soft); }
.results-waiting { padding: 24px; color: var(--soft); text-align: center; background: var(--tint); border-radius: 8px; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs-small a { padding: 4px 14px; font-size: 15px; }
.tabs a { padding: 8px 18px; background: #fff; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none; font-weight: 600; }
.tabs a[aria-current="page"] { background: #000; border-color: #000; color: #fff; }

/* Results */
.result-list { margin: 0; }
.result-row { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.result-row dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-emphasis { background: #000; color: #fff; padding: 14px; margin: 8px 0; border: 0; border-radius: 8px; align-items: center; }
.result-emphasis dd { font-family: var(--heavy); font-size: 24px; }
code { font-size: 16px; overflow-wrap: anywhere; }

.headline { background: #000; color: #fff; border-radius: 10px; padding: 20px; text-align: center; margin-bottom: 16px; }
.headline-label, .headline-detail { display: block; font-size: 15px; color: #ddd; }
.headline-value { display: block; font-family: var(--heavy); font-size: clamp(30px, 6vw, 42px); line-height: 1.25; }
.headline-value small { font-family: var(--text); font-size: 16px; font-weight: 400; }

/* Tables */
.table-wrap { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); }
thead th { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--soft); white-space: nowrap; }
tbody th { font-weight: 600; }
.num { text-align: right; white-space: nowrap; }
.compare td, .compare thead th:not(:first-child) { text-align: right; white-space: nowrap; }
.compare tfoot th, .compare tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid #000; }
.compare tbody th { font-weight: 400; }
.actions { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.inactive { color: var(--soft); }

/* Admin */
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.card-head h2 { margin-bottom: 0; }
.cleanup { margin-bottom: 20px; }
.entry-actions { margin-bottom: 16px; }
.entry-delete { margin-top: 20px; }
.cleanup form { margin-top: 14px; }
.count-badge { display: inline-block; min-width: 20px; padding: 0 6px; font-size: 13px; font-weight: 700; line-height: 20px; text-align: center; color: #fff; background: var(--red); border-radius: 10px; }
.tag-old { display: inline-block; padding: 0 8px; font-size: 13px; font-weight: 700; color: #fff; background: var(--red); border-radius: 4px; }
.answers-heading { margin: 16px 0 2px; font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--red); }
.answers-heading:first-of-type { margin-top: 0; }
.answers dd { white-space: normal; text-align: right; overflow-wrap: anywhere; }

/* Footer */
.foot { background: #000; color: #ddd; padding: 18px 0; font-size: 14px; }

/* Sign-in and landing pages */
.sign-in-page { align-items: center; justify-content: center; padding: 20px; background: #000; }
.sign-in-card { width: 100%; max-width: 420px; background: #fff; border-top: 6px solid var(--red); border-radius: 10px; padding: 30px; }
.sign-in-logo { width: 240px; margin: 0 auto 20px; }
.sign-in-card h1 { font-size: 24px; font-weight: 700; text-align: center; }
.sign-in-tagline { text-align: center; color: var(--soft); margin-bottom: 20px; }
.sign-in-card .button { align-self: stretch; }
.create-account { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; }
.create-account p { margin-bottom: 8px; font-weight: 600; }
.create-account .button { display: block; }
.forgot-text { margin: 12px 0 16px; }
.signup-link { margin-top: 16px; text-align: center; font-weight: 600; }
.site-links { display: flex; flex-direction: column; gap: 12px; }
.site-link { display: block; padding: 16px; border: 1.5px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; }
.site-link:hover { border-color: var(--red); }
.site-link strong { display: block; color: var(--red); font-size: 18px; }

/* Phones */
@media (max-width: 800px) {
  .split, .split-wide-first { grid-template-columns: minmax(0, 1fr); }
  .results { position: static; }
  .title-bar h1 { font-size: 24px; }
  .card { padding: 18px; }
  .brand img { width: 120px; }
  .nav { width: 100%; }
  .compare th, .compare td { padding-left: 4px; padding-right: 4px; }
  .compare thead th { white-space: normal; }
}

/* Print: only the comparison and its disclaimer */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; display: block; }
  .title-bar { background: none; color: #000; padding: 0 0 12px; border-bottom: 3px solid var(--red); }
  .subhead { color: var(--soft); }
  .split { display: block; }
  .card { border: 0; padding: 0; position: static; }
  .headline, .result-emphasis { background: none; color: #000; border: 2px solid #000; }
  .headline-label, .headline-detail { color: var(--soft); }
  .sample-banner { background: none; color: var(--red); border: 2px solid var(--red); }
}
