/* PDCPDhub — navy header, orange accent, white tool panels on a cool grey ground. */
:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --ink: #15212e;
  --muted: #5d6b7a;
  --border: #dde3ea;
  --navy: #0f2236;
  --accent: #c9530f;
  --accent-bright: #ff9a57;
  --accent-soft: #fdeee4;
  --ok: #1f7a4d;
  --ok-soft: #e5f4ec;
  --warn: #8a5200;
  --warn-soft: #fff4dc;
  --danger: #b42318;
  --focus: #2f80ed;
  --card: #0f2236;
  --card-edge: transparent;
  --on-dark: #ffffff;
  --on-dark-muted: #b9c8d8;
  --radius: 12px;
  --gutter: 24px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c141d; --surface: #131e2a; --surface-2: #182634; --ink: #e6edf4; --muted: #93a3b4; --border: #253546;
    --accent: #ff8a3d; --accent-soft: #3a2415; --ok: #5fd39a; --ok-soft: #12301f; --warn: #f3c065; --warn-soft: #33270f;
    --danger: #ff8a80; --card: #0a1724; --card-edge: #253546; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c141d; --surface: #131e2a; --surface-2: #182634; --ink: #e6edf4; --muted: #93a3b4; --border: #253546;
  --accent: #ff8a3d; --accent-soft: #3a2415; --ok: #5fd39a; --ok-soft: #12301f; --warn: #f3c065; --warn-soft: #33270f;
  --danger: #ff8a80; --card: #0a1724; --card-edge: #253546; color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.55; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; z-index: 10; border-radius: 8px; }
.skip-link:focus { left: 16px; }
.header-inner, .hero-inner, .shell, .home, .article, .footer-inner, .footer-meta { max-width: 1240px; margin-left: auto; margin-right: auto; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }

/* Header & hero */
.site-header, .hero { background: var(--navy); color: var(--on-dark); background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 28px 28px; }
.header-inner { padding-block: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: #e8661c; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 19px; }
.brand-name { font-size: 21px; font-weight: 700; letter-spacing: .3px; }
.brand-name b { color: var(--accent-bright); font-weight: 700; }
.header-links { display: flex; gap: 22px; font-size: 15px; }
.header-links a { text-decoration: none; color: var(--on-dark-muted); }
.header-links a:hover, .header-links a[aria-current="page"] { color: var(--on-dark); }
.hero { background-position: 0 -4px; }
.hero-inner { padding-block: 20px 52px; }
.hero-kicker { margin: 0 0 10px; color: var(--accent-bright); font-size: 13px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; }
.hero-title { margin: 0; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.1; letter-spacing: -.5px; max-width: 760px; }
.hero-sub { margin: 14px 0 0; color: var(--on-dark-muted); font-size: 17px; max-width: 660px; }

/* Home */
.home { padding-block: 40px 0; }
.section-title { font-size: 13px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.tool-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tool-card { display: flex; flex-direction: column; height: 100%; gap: 6px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; transition: border-color .15s, transform .15s; }
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool-card-caption { font-size: 12.5px; color: var(--accent); font-weight: 600; }
.tool-card h3 { margin: 0; font-size: 19px; }
.tool-card p { margin: 0; color: var(--muted); font-size: 14.5px; flex: 1; }
.tool-card-go { margin-top: 8px; font-size: 14px; font-weight: 600; }
.guide-card { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; margin-top: 44px; padding-top: 32px; border-top: 1px solid var(--border); }
.about h2 { margin: 0 0 10px; font-size: 22px; }
.about p { color: var(--muted); margin: 0 0 12px; max-width: 65ch; }
.about a { color: var(--accent); }
.disclaimer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.disclaimer h3 { margin: 0 0 8px; font-size: 16px; }
.disclaimer p { font-size: 14px; margin: 0; }

/* Tool page layout */
.shell { padding-block: 28px 0; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.sidebar { min-width: 0; position: sticky; top: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 10px; }
.nav-caption { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); padding: 2px 10px 10px; }
.tool-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tool-nav a { display: block; padding: 9px 10px; border-radius: 9px; text-decoration: none; border: 1px solid transparent; }
.tool-nav a:hover { background: var(--surface-2); }
.tool-nav a[aria-current="page"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.nav-label { font-size: 15px; font-weight: 600; display: flex; flex-direction: column; }
.nav-label small { font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 1px; }
main { min-width: 0; }
.workspace { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.breadcrumb { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.page-heading { padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.page-heading h1, .article h1 { margin: 0; font-size: clamp(25px, 3vw, 31px); letter-spacing: -.3px; line-height: 1.2; }
.lede { margin: 8px 0 0; color: var(--muted); font-size: 16.5px; max-width: 65ch; }

/* Calculator */
.calculator { padding-top: 22px; }
.calculator-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; min-height: 34px; }
.section-heading h2 { margin: 0; font-size: 16px; }
.section-heading > span { font-size: 13px; color: var(--muted); }
#result-status.ready { color: var(--ok); font-weight: 600; }
.tool-buttons { display: flex; gap: 6px; }
.ghost-button { background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 5px 12px; font-size: 13.5px; color: var(--muted); }
.ghost-button:hover { color: var(--ink); border-color: var(--muted); }
.calculator:not(.is-live) .tool-buttons { display: none; }
.field-group { margin: 20px 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); padding-top: 14px; border-top: 1px dashed var(--border); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.input-wrap { position: relative; display: flex; }
.input-wrap input, .input-wrap select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.input-wrap select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input-wrap input:focus, .input-wrap select:focus { border-color: var(--focus); background: var(--surface); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.input-wrap input[aria-invalid="true"] { border-color: var(--danger); }
.input-wrap input:has(+ .input-unit) { padding-right: 58px; }
.input-wrap input::-webkit-outer-spin-button, .input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-wrap input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.input-unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--muted); pointer-events: none; }
.field-hint, .field-error { margin: 4px 0 0; font-size: 12.5px; }
.field-hint { color: var(--muted); }
.field-error { color: var(--danger); font-weight: 600; }
.field-hint:empty, .field-error:empty { display: none; }
.input-footnote { font-size: 13px; color: var(--muted); margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }
.primary-results { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.secondary-results { display: grid; margin-top: 12px; }
.result { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--border); }
.result.primary { flex-direction: column; align-items: flex-start; background: var(--card); box-shadow: inset 0 0 0 1px var(--card-edge); color: var(--on-dark); border: 0; border-radius: 10px; padding: 16px; }
.result-label { font-size: 13.5px; color: var(--muted); }
.result.primary .result-label { color: var(--on-dark-muted); }
.result-value { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.result-value output { font-size: 16px; font-weight: 650; }
.result.primary .result-value output { font-size: 32px; font-weight: 700; letter-spacing: -.5px; color: var(--on-dark); }
.result-value span { font-size: 12.5px; color: var(--muted); }
.result.primary .result-value span { color: var(--accent-bright); font-size: 14px; }
#notices { margin-top: 16px; display: grid; gap: 8px; }
.notice, .note { margin: 0; font-size: 13.5px; padding: 10px 12px; border-radius: 9px; }
.notice.success { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.notice.warning { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.note { background: var(--surface-2); color: var(--muted); border-left: 3px solid var(--border); border-radius: 0 9px 9px 0; }
.raw-panel { margin-top: 14px; font-size: 13px; }
.raw-panel summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.raw-results { display: grid; gap: 4px; margin-top: 8px; }
.raw-results div { display: flex; justify-content: space-between; gap: 12px; }
.raw-results code { font-family: var(--mono); text-align: right; overflow-wrap: anywhere; }

/* Long-form content */
.prose { margin-top: 32px; display: grid; gap: 30px; }
.workspace .prose { padding-top: 28px; border-top: 1px solid var(--border); }
.prose h2 { margin: 0 0 10px; font-size: 21px; }
.prose h3 { margin: 0 0 4px; font-size: 16px; }
.prose p, .prose li { max-width: 68ch; }
.prose p { margin: 0 0 10px; }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.formulas { margin: 0 0 12px; display: grid; gap: 12px; }
.formulas dt { font-weight: 600; font-size: 14px; }
.formulas dd { margin: 3px 0 0; }
.formulas code { display: block; font: 13.5px/1.6 var(--mono); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.example-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 6px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); padding-bottom: 6px; }
th, td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 500; color: var(--muted); }
td { text-align: right; font-weight: 600; white-space: nowrap; }
tr.key td { color: var(--accent); }
.faq { display: grid; gap: 14px; }
.faq h2 { margin-bottom: 0; }
.faq-item p { color: var(--muted); margin: 0; }
.related { list-style: none; padding: 0 !important; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px !important; }
.related li { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; max-width: none; }
.related a { font-weight: 600; text-decoration: none; }
.related a:hover { color: var(--accent); }
.related span { font-size: 13px; color: var(--muted); }
.disclaimer-line { font-size: 13px; color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; padding: 22px; border-radius: var(--radius); background: var(--card); box-shadow: inset 0 0 0 1px var(--card-edge); color: var(--on-dark); }
.cta > div:first-child { min-width: 0; flex: 1 1 320px; }
.cta h2 { margin: 0 0 6px; font-size: 19px; color: var(--on-dark); }
.cta p { margin: 0; color: var(--on-dark-muted); max-width: 60ch; }
.cta strong { color: var(--on-dark); font-weight: 600; overflow-wrap: anywhere; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button { display: inline-block; padding: 10px 16px; border-radius: 9px; background: #e8661c; color: #fff; font-weight: 600; font-size: 14.5px; text-decoration: none; border: 1px solid #e8661c; }
.button:hover { background: #c9530f; border-color: #c9530f; }
.button.ghost { background: transparent; color: var(--on-dark); border-color: rgba(255,255,255,.3); }
.button.ghost:hover { border-color: var(--on-dark); }
.article .prose .cta a { color: inherit; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.service { padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.service p { color: var(--muted); font-size: 14.5px; margin: 0; }
.contact-list { margin: 0 0 14px; display: grid; gap: 0; max-width: 560px; }
.contact-list div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.contact-list dt { color: var(--muted); font-size: 14px; }
.contact-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.footer-contact { font-size: 13px; }
.footer-inner p a { color: var(--accent); }
@media (max-width: 520px) { .contact-list div { grid-template-columns: 1fr; gap: 2px; } }
.article { padding-block: 32px 0; max-width: 860px; }
.article .prose a { color: var(--accent); }

/* Footer */
.site-footer { margin-top: 48px; border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { padding-block: 28px 8px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; font-size: 14px; }
.footer-inner p { color: var(--muted); margin: 6px 0 0; max-width: 46ch; }
.footer-inner ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--ink); }
.footer-meta { padding-block: 8px 28px; font-size: 12.5px; color: var(--muted); margin-top: 0; margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) { .tool-card { transition: none; } .tool-card:hover { transform: none; } }
@media (max-width: 960px) {
  .calculator-layout, .about, .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .hero-inner { padding-block: 14px 40px; }
  .hero-sub { font-size: 15.5px; }
  .header-links { gap: 14px; font-size: 14px; }
  .shell { grid-template-columns: 1fr; gap: 14px; padding-block: 16px 0; }
  .sidebar { position: static; padding: 8px; }
  .nav-caption { display: none; }
  .tool-nav { display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .tool-nav::-webkit-scrollbar { display: none; }
  .tool-nav a { padding: 7px 12px; white-space: nowrap; }
  .nav-label small { display: none; }
  .nav-label { font-size: 14px; }
  .workspace { padding: 18px; }
  .result.primary .result-value output { font-size: 28px; }
}
