:root {
  --bg: #f5f5f5;
  --ink: #2d3142;
  --muted: #4f5d75;
  --soft: #7a8399;
  --hairline: rgba(45,49,66,.14);
  --accent: #eb6c36;
  --font-sans: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, Consolas, Menlo, monospace;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.5;
    /* opacity only: a transform here would make <body> the containing block for every
       position:fixed element (bottom sheets, overlays). No fill-mode, so nothing lingers. */
    animation: fadeIn 250ms ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Shared Nav */
#site-nav-container {
    position: sticky;
    top: 0;
    height: 56px;
    background: rgba(245, 245, 245, 0.95);
    backdrop-filter: blur(8px);
    z-index: 1000;
    border-bottom: 1px solid var(--hairline);
    display: flex;
    align-items: center;
    padding: 0 24px;
    justify-content: space-between;
}
.site-nav {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    font-weight: 600;
    font-size: 16px;
}
.nav-links {
    display: flex;
    gap: 24px;
}
.nav-links a {
    text-decoration: none;
    color: var(--soft);
    font-weight: 500;
}
.nav-links a:hover, .nav-links a:focus {
    color: var(--ink);
}
.nav-links a.active {
    color: var(--accent);
}
.nav-pill-wrap {
    position: relative;
}
.nav-pill {
    font-family: var(--font-sans);
    font-size: 12px;
    background: rgba(0,0,0,0.05);
    padding: 4px 10px;
    border: none;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 500;
    cursor: pointer;
}
.nav-pill:hover {
    background: rgba(0,0,0,0.08);
}
.signin-dialog {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid var(--hairline);
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
}
.signin-dialog input {
    font-family: inherit;
    border: 1px solid var(--hairline);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 14px;
    width: 150px;
}
.signin-dialog button {
    font-family: inherit;
    cursor: pointer;
    border: 1px solid var(--hairline);
    background: white;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
}
.signin-dialog button:hover {
    background: #eee;
}

@media (max-width: 760px) {
    #site-nav-container {
        padding: 0 12px;
    }
    .nav-brand {
        display: none;
    }
    .nav-links {
        width: 100%;
        justify-content: space-around;
        gap: 0;
    }
    /* phones: keep the pill — it is the only way to sign in — as a compact second row */
    .site-nav { flex-wrap: wrap; row-gap: 4px; padding-bottom: 6px; }
    .nav-pill { display: inline-block; font-size: 12px; padding: 4px 10px; margin: 0 auto; }
}

.page-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* Overview specific */
.hero-section {
    margin-bottom: 40px;
}
.hero-section h1 {
    font-size: clamp(24px, 4vw, 36px);
    line-height: 1.3;
    margin-bottom: 24px;
}
.hero-svg-container {
    position: relative;
    background: white;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 40px;
}
#replay-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: var(--bg);
    border: 1px solid var(--hairline);
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: var(--ink);
}
.content-section p {
    margin-bottom: 16px;
}
.outcomes-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin: 32px 0;
}
.outcome-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--hairline);
}
.outcome-card svg {
    margin-bottom: 12px;
}
details {
    background: white;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    margin-bottom: 32px;
}
summary {
    padding: 16px;
    cursor: pointer;
    font-weight: 600;
}
.details-content {
    padding: 0 16px 16px;
}

.status-line {
    font-size: 12px;
    color: var(--soft);
    margin-top: 40px;
}
.cta {
    margin-top: 40px;
    text-align: center;
}
.btn-cta {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
}
.btn-cta:hover {
    background: #d65c26;
}

/* Dimensions specific */
.dimensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
}
.dim-card {
    background: white;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    outline: none;
    position: relative;
    color: var(--ink);
    transition: transform 0.2s, box-shadow 0.2s;
}
.dim-card:hover, .dim-card:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: var(--accent);
}
.dim-icon-wrapper {
    margin-bottom: 16px;
    color: var(--accent);
    height: 50px;
    width: 50px;
}
.dim-code {
    font-family: var(--font-mono);
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 8px;
    font-size: 14px;
}
.dim-info h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
}
.dim-info p {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}
.footnote {
    margin-top: 40px;
    font-size: 13px;
    color: var(--soft);
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--hairline);
}

/* Slide Panel */
.panel-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 2000;
}
.panel-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.slide-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 100vw;
    height: 100%;
    background: white;
    box-shadow: -4px 0 12px rgba(0,0,0,0.1);
    z-index: 2001;
    transition: right 0.3s ease-out;
    padding: 40px 24px;
    box-sizing: border-box;
}
.slide-panel.active {
    right: 0;
}
.panel-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--soft);
}
.panel-info h3 {
    margin-top: 0;
    color: var(--accent);
}
.panel-info p {
    color: var(--muted);
    font-size: 15px;
}
.panel-detail {
    margin-top: 24px;
    font-size: 15px;
    line-height: 1.6;
}
@media (max-width: 760px) {
    .slide-panel {
        top: auto;
        bottom: -100%;
        right: 0;
        width: 100%;
        height: auto;
        min-height: 30vh;
        max-height: 80vh;
        border-radius: 16px 16px 0 0;
        transition: bottom 0.3s ease-out;
        padding: 48px 24px 40px;
    }
    .slide-panel.active {
        bottom: 0;
        right: 0;
    }
}

footer { padding: 32px 24px; text-align: center; color: var(--soft); font-size: 12px; }

/* View Transitions */
@view-transition {
    navigation: auto;
}

/* Dimensions teaser box (overview) */
.dims-box { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 20px; background: white; border: 1px solid var(--hairline); border-left: 4px solid var(--accent); border-radius: 8px; padding: 18px 20px; margin: 0 0 32px; text-decoration: none; color: var(--ink); transition: border-color 200ms ease-out, transform 200ms ease-out; }
.dims-box:hover, .dims-box:focus-visible { border-color: var(--accent); transform: translateY(-1px); outline: none; }
.dims-box-text { display: flex; flex-direction: column; gap: 4px; }
.dims-box-text strong { font-size: 16px; }
.dims-box-text span { font-size: 14px; color: var(--muted); }
.dims-box-codes { display: flex; gap: 6px; }
.dims-box-codes i { font-style: normal; font-family: var(--font-mono, ui-monospace, Consolas, Menlo, monospace); font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--hairline); border-radius: 4px; padding: 3px 5px; background: var(--bg); }
.dims-box:hover .dims-box-codes i { color: var(--accent); border-color: var(--accent); }
.dims-box-arrow { color: var(--accent); font-weight: 600; white-space: nowrap; font-size: 14px; }
@media (max-width: 760px) {
  .dims-box { grid-template-columns: 1fr; gap: 12px; }
  .dims-box-codes { flex-wrap: wrap; }
}

/* Method page */
.method-page h2 { font-size: 22px; margin: 36px 0 12px; }
.method-page h4 { margin: 18px 0 6px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.lede { font-size: 16px; color: var(--muted); margin: 0 0 20px; }
.muted { color: var(--muted); font-size: 14px; }
.status-banner { background: rgba(235,108,54,.08); border: 1px solid var(--accent); border-radius: 8px; padding: 14px 18px; font-size: 15px; line-height: 1.5; margin: 8px 0 28px; }
.status-banner strong { color: var(--accent); display: block; margin-bottom: 4px; }
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 12px 0 24px; }
.method-grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.method-card { background: white; border: 1px solid var(--hairline); border-radius: 8px; padding: 16px 18px; }
.method-card strong { display: block; margin-bottom: 6px; }
.method-card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.method-kicker { font-family: var(--font-mono, ui-monospace, Consolas, Menlo, monospace); font-size: 10.5px; letter-spacing: .14em; color: var(--soft); margin-bottom: 8px; }
.mono-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; }
.mono-list li { font-family: var(--font-mono, ui-monospace, Consolas, Menlo, monospace); font-size: 12.5px; background: var(--bg); border: 1px solid var(--hairline); border-radius: 4px; padding: 6px 10px; overflow-wrap: anywhere; }
.pipeline { list-style: none; counter-reset: none; padding: 0; margin: 0 0 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.pipeline li { display: flex; gap: 12px; align-items: flex-start; background: white; border: 1px solid var(--hairline); border-radius: 8px; padding: 14px 16px; }
.pipeline li > div { display: flex; flex-direction: column; gap: 3px; }
.pipeline li strong { font-size: 15px; }
.pipeline li span:last-child { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.step-n { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: white; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }

.h2-tag { display: inline-block; font-family: var(--font-mono, ui-monospace, Consolas, Menlo, monospace); font-size: 10.5px; letter-spacing: .1em; color: var(--soft); border: 1px solid var(--hairline); border-radius: 4px; padding: 2px 6px; margin-left: 8px; vertical-align: middle; text-transform: uppercase; }
/* the sign-in dialog must float above the phone bottom sheet (z 2000) wherever it was opened from */
@media (max-width: 760px) {
  .signin-dialog { position: fixed; top: 72px; left: 50%; right: auto; transform: translateX(-50%); width: min(92vw, 360px); z-index: 3000; }
}


/* v02.11 — Protocol page and Dimensions page additions */
.tag { display: inline-block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; border-radius: 999px; padding: 2px 9px; margin-left: 6px; vertical-align: middle; border: 1px solid transparent; }
.tag.done { background: rgba(45,49,66,.08); color: var(--muted); }
.tag.pilot { background: rgba(235,108,54,.12); color: var(--accent); }
.tag.planned { background: transparent; color: var(--soft); border-color: var(--hairline); }
.method-page h3.sub { font-size: 16px; margin: 26px 0 8px; }
.rq-list { margin: 0 0 8px; padding-left: 20px; }
.rq-list li { margin: 6px 0; line-height: 1.5; }
.rq-list b { color: var(--accent); margin-right: 4px; }
.table-wrap { overflow-x: auto; margin: 10px 0 10px; border: 1px solid var(--hairline); border-radius: 8px; background: white; }
.db-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.db-table th, .db-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.db-table th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); background: rgba(45,49,66,.03); }
.db-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.db-table tr.total td { font-weight: 600; border-bottom: none; background: rgba(235,108,54,.06); }
.flow { list-style: none; padding: 0; margin: 0 0 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; counter-reset: flow; }
.flow li { background: white; border: 1px solid var(--hairline); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.flow li > b { font-size: 24px; color: var(--accent); line-height: 1.1; font-variant-numeric: tabular-nums; }
.flow li > span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.flow li::after { content: "→"; position: absolute; right: -11px; top: 14px; color: var(--soft); font-size: 14px; }
.flow li:last-child::after { content: none; }
.ask-box { background: white; border: 1px solid var(--accent); border-radius: 10px; padding: 16px 20px; margin: 28px 0; }
.ask-box ol { margin: 8px 0 6px; padding-left: 22px; }
.ask-box li { margin: 8px 0; line-height: 1.5; }
.coding-status { margin-top: 20px; }
.page-content > .lede { max-width: 820px; }
@media (max-width: 640px) {
  .flow { grid-template-columns: 1fr 1fr; }
  .flow li::after { content: none; }
  .db-table { font-size: 13px; }
  .db-table th, .db-table td { padding: 7px 9px; }
}

.db-table.cmap td, .db-table.cmap th { font-size: 12.5px; line-height: 1.4; }
.db-table.cmap td:first-child { white-space: normal; min-width: 120px; }
.method-grid .method-card.wide { grid-column: 1 / -1; }
