/* ==========================================================================
   Mirage Floors · Lytx dealer portal — 2026 light editorial system
   Tokens follow the Mirage BI platform (Spring 2026): warm paper canvas,
   ink typography, restrained gold, fine hairlines.
   ========================================================================== */

* { box-sizing: border-box; }

:root {
    --canvas: #faf8f2;          /* warm off-white page */
    --paper: #ffffff;           /* panels */
    --inset: #f4f0e4;           /* soft warm inset */
    --ink: #191816;
    --navy: #455970;
    --muted: rgba(25, 24, 22, 0.62);
    --faint: rgba(25, 24, 22, 0.42);
    --line: rgba(25, 24, 22, 0.12);
    --line-strong: rgba(25, 24, 22, 0.24);
    --gold: #b29f55;
    --gold-deep: #a18f5f;
    --gold-pale: #f4f0df;
    --teal: #5f7f7c;
    --green: #27ae60;
    --amber: #c98a1a;
    --code-bg: #1d1d1b;
    --shadow: 0 18px 50px rgba(43, 40, 31, 0.10);
    --shadow-sm: 0 6px 18px rgba(43, 40, 31, 0.06);
    --radius: 4px;
    --font: 'Poppins', 'Avenir Next', Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* legacy aliases kept for any inline references */
    --brand-gold: var(--gold);
    --brand-gold-600: var(--gold-deep);
    --brand-gold-700: #8f7d4c;
    --card: var(--paper);
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    background-color: var(--canvas);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a { color: inherit; }
button, select, input { font: inherit; }

#dealers-grid, #rc { scroll-margin-top: 84px; }

.container {
    width: min(1180px, calc(100% - 3rem));
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Header / footer
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(250, 248, 242, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .85rem;
    text-decoration: none;
    color: var(--ink);
    min-width: 0;
}

.brand-logo { height: 26px; width: auto; }

.brand-name {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.brand-name b { color: var(--ink); }

.site-nav { display: flex; gap: .25rem; }

.nav-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: .45rem .7rem;
    border-bottom: 2px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--ink);
    border-bottom-color: var(--gold);
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--canvas);
    color: var(--muted);
    font-size: 12.5px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 72px;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Type primitives
   -------------------------------------------------------------------------- */
.eyebrow, .section-header, .step-header, .dealer-badge, .hero-badge {
    display: block;
    margin: 0 0 .9rem;
    color: var(--teal);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.section-title {
    margin: 0 0 .75rem;
    font-size: clamp(1.9rem, 3.2vw, 2.6rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.01em;
    color: var(--ink);
}

.section-description, .lede {
    margin: 0;
    max-width: 640px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.section-description a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.mono { font-family: var(--mono); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 44px;
    padding: .65rem 1.2rem;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.btn-primary {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.btn-primary:hover { background: #2c2a26; border-color: #2c2a26; }

.btn-outline {
    background: transparent;
    color: var(--ink);
    border-color: var(--line-strong);
}

.btn-outline:hover { border-color: var(--ink); background: var(--paper); }

.btn-gold {
    background: var(--gold);
    color: var(--ink);
    border-color: var(--gold);
}

.btn-gold:hover { background: var(--gold-deep); border-color: var(--gold-deep); }

/* --------------------------------------------------------------------------
   Masthead (home + dealer)
   -------------------------------------------------------------------------- */
.hero-section {
    position: relative;
    overflow: hidden;
    padding: 4.5rem 0 3.5rem;
    background: var(--canvas);
    border-bottom: 1px solid var(--line);
    isolation: isolate;
}

/* faint drafting grid, as on the 2026 BI cover pages */
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(25, 24, 22, .07) 1px, transparent 1px),
        linear-gradient(0deg, rgba(25, 24, 22, .05) 1px, transparent 1px);
    background-size: 42px 42px;
    -webkit-mask-image: linear-gradient(110deg, rgba(0,0,0,.5), transparent 65%);
    mask-image: linear-gradient(110deg, rgba(0,0,0,.5), transparent 65%);
    pointer-events: none;
}

.hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .8fr);
    gap: 4rem;
    align-items: end;
}

.hero-section.compact .hero-content {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.hero-logo { height: 54px; width: auto; display: block; margin-bottom: 2rem; }

.hero-title {
    margin: 0;
    font-size: clamp(2.4rem, 5.2vw, 4.4rem);
    line-height: .98;
    font-weight: 700;
    letter-spacing: -.02em;
    max-width: 14ch;
    overflow-wrap: anywhere;
}

.hero-section.compact .hero-title { max-width: 22ch; font-size: clamp(2rem, 4.2vw, 3.4rem); }

.hero-subtitle {
    margin: 1.5rem 0 0;
    max-width: 560px;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.55;
}

.hero-ctas { margin-top: 2rem; display: flex; gap: .75rem; flex-wrap: wrap; }

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.75rem;
    margin-top: 1.5rem;
    font-size: 13px;
    color: var(--muted);
}

.hero-meta b { color: var(--ink); font-weight: 600; }
.hero-meta .mono { font-size: 12px; color: var(--navy); }

.hero-aside { display: flex; flex-direction: column; align-items: flex-end; gap: .75rem; }

/* Coverage panel — the BI "campaign panel" idiom */
.stats-section {
    background: var(--paper);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow);
}

.stats-title {
    margin: 0;
    min-height: 52px;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    background: linear-gradient(180deg, #77736d, #1d1d1b);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; }

.stat-item {
    padding: 1.25rem 1.25rem 1.1rem;
    border-bottom: 1px solid var(--line);
}

.stat-item:nth-child(odd) { border-right: 1px solid var(--line); }
.stat-item:nth-last-child(-n+2) { border-bottom: 0; }

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--gold);
    letter-spacing: -.02em;
}

.stat-label {
    margin-top: .45rem;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Main content
   -------------------------------------------------------------------------- */
.main-content {
    width: min(1180px, calc(100% - 3rem));
    margin: 0 auto;
    padding: 3.5rem 0 4rem;
}

.section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem 3rem;
    align-items: end;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--ink);
}

/* Filters */
.filter-bar { display: flex; gap: .75rem; align-items: center; }
.filter-label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.filter-select {
    appearance: none;
    -webkit-appearance: none;
    min-width: 200px;
    padding: .6rem 2.4rem .6rem .85rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23191816' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .85rem center;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
}
.filter-select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(178, 159, 85, .2); }

/* Dealer register — territory groups + rows, scales to many dealers */
.dealers-grid { display: grid; gap: 2.5rem; margin-bottom: 3.5rem; }

.territory-group { display: grid; gap: 0; }

.territory-head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0 0 .6rem;
    border-bottom: 1px solid var(--line-strong);
}

.territory-head h3 { margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.territory-head .tag { font-size: 12px; color: var(--muted); font-weight: 500; }
.territory-head a { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--navy); text-decoration: none; }
.territory-head a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.dealer-card {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1.4fr) minmax(120px, .7fr) minmax(90px, .45fr) auto;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    transition: background .15s ease;
}

.dealer-card:hover { background: rgba(255, 255, 255, .7); }

.dealer-index { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.dealer-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.dealer-meta { display: contents; }
.dealer-meta-item { min-width: 0; }
.dealer-meta-label { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .1rem; }
.dealer-meta-value { font-size: 13.5px; font-weight: 600; color: var(--navy); }
.dealer-meta-value.mono { font-family: var(--mono); font-weight: 500; letter-spacing: .02em; }

.dealer-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }

.dealer-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem .85rem;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.dealer-link.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.dealer-link.primary:hover { background: #2c2a26; }
.dealer-link.secondary { color: var(--ink); border-color: var(--line-strong); background: var(--paper); }
.dealer-link.secondary:hover { border-color: var(--ink); }

.dealers-empty { padding: 2.5rem 0; color: var(--muted); border-bottom: 1px solid var(--line); }

/* Quick RC access */
.alt-access-section {
    padding: 2rem 0 0;
    border-top: 1px solid var(--ink);
}

.alt-access-title { margin: 0 0 .5rem; font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.alt-access-description { margin: 0 0 1.5rem; color: var(--muted); max-width: 560px; }

.rc-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: .75rem;
}

.rc-link {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .8rem 1rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--ink);
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.rc-link:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.rc-link svg { color: var(--faint); flex: none; }

.rc-code { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--gold-deep); letter-spacing: .04em; }
.rc-dealer-name { font-size: 13px; color: var(--muted); margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------------------
   Dealer guide
   -------------------------------------------------------------------------- */
.utility-bar { display: flex; justify-content: flex-end; gap: .5rem; }

.guide-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 2.5rem 3.5rem;
    align-items: start;
}

.guide-main { min-width: 0; display: grid; gap: 2.5rem; }
.guide-side { display: grid; gap: 1.5rem; position: sticky; top: 84px; }

/* Account record (dealer-info-card) */
.dealer-info-card {
    background: var(--paper);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-sm);
}

.dealer-info-card h2 {
    margin: 0;
    padding: .85rem 1.15rem;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(180deg, #77736d, #1d1d1b);
}

.dealer-info-grid { display: grid; }

.dealer-info-item {
    padding: .85rem 1.15rem;
    border-bottom: 1px solid var(--line);
}

.dealer-info-item:last-child { border-bottom: 0; }

.dealer-info-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: .2rem;
}

.dealer-info-value { font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.dealer-info-value.mono { font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--navy); }

/* Step section */
.step-section {
    padding-top: .25rem;
}

.step-title {
    margin: 0 0 .6rem;
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.015em;
}

.step-description { margin: 0 0 1.5rem; color: var(--muted); max-width: 620px; line-height: 1.6; }

/* The primary deliverable: the installation script */
.script-panel {
    border: 1px solid var(--ink);
    background: var(--paper);
    box-shadow: var(--shadow);
    margin: 0 0 2rem;
}

.script-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 1.15rem;
    border-bottom: 1px solid var(--ink);
    background: var(--gold-pale);
}

.script-panel-head strong { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.script-panel-head span { font-size: 12.5px; color: var(--muted); }

.script-container {
    position: relative;
    background: var(--code-bg);
    color: #eae6da;
    padding: 1.6rem 1.5rem;
    padding-right: 9.5rem;
    font-family: var(--mono);
    overflow-x: auto;
}

.script-container code {
    display: block;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.7;
    font-size: 1rem;
}

.script-container code .tok-tag { color: var(--gold); font-weight: 700; }
.script-container code .tok-attr { color: #9ccfcb; }
.script-container code .tok-string { color: #f0e6c8; text-decoration: underline; text-decoration-color: rgba(178,159,85,.5); text-underline-offset: 4px; }
.script-container code .tok-punc { color: #a8a49a; }

.copy-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    min-width: 8rem;
    padding: .55rem .9rem;
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    background: var(--gold);
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.copy-button:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
.copy-button.copied { background: var(--green); border-color: var(--green); color: #fff; }

.script-panel-foot {
    padding: .7rem 1.15rem;
    font-size: 12.5px;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.script-panel-foot b { color: var(--ink); font-weight: 600; }

/* Instructions */
.instructions-list { counter-reset: step-counter; list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line-strong); }

.instructions-list li {
    counter-increment: step-counter;
    position: relative;
    padding: .95rem 0 .95rem 3.25rem;
    border-bottom: 1px solid var(--line);
    line-height: 1.5;
    font-size: 15px;
}

.instructions-list li b { font-weight: 600; }
.instructions-list li code { font-family: var(--mono); font-size: 13px; background: var(--inset); padding: .1rem .35rem; border-radius: 3px; }

.instructions-list li::before {
    content: counter(step-counter, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 1.05rem;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--gold-deep);
    letter-spacing: .04em;
}

/* Reference columns (features-grid) */
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--ink);
}

.feature-card { min-width: 0; }

.feature-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0 0 .75rem;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink);
}

.feature-title span {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    color: #fff;
    background: var(--green);
}

.feature-card.warning .feature-title span { background: var(--amber); }

.feature-list { list-style: none; padding: 0; margin: 0; }

.feature-list li {
    padding: .55rem 0 .55rem 1.1rem;
    position: relative;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    color: rgba(25, 24, 22, .82);
}

.feature-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1.05rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--gold);
}

/* Territory */
.territory-print-section { padding-top: 2rem; border-top: 1px solid var(--ink); }
.territory-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.territory-head-row h3 { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; }
.territory-head-row p { margin: 0; font-size: 13px; color: var(--muted); }

.map-card {
    background: var(--paper);
    border: 1px solid var(--line-strong);
    padding: .5rem;
    box-shadow: var(--shadow-sm);
}

.map-canvas { border: 1px solid var(--line); background: var(--inset); }

.leaflet-container { font-family: var(--font); }
.leaflet-container .legend {
    background: rgba(255, 255, 255, .95);
    border: 1px solid var(--line-strong);
    padding: .5rem .7rem;
    font-size: 12px;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}
.leaflet-bar { border: 1px solid var(--line-strong) !important; box-shadow: var(--shadow-sm) !important; border-radius: var(--radius) !important; }

/* Streets / Satellite segmented control */
.leaflet-container .map-style-toggle {
    display: inline-flex;
    padding: 2px;
    background: rgba(255, 255, 255, .95);
    border: 1px solid var(--line-strong) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-sm) !important;
}
.leaflet-container .map-style-toggle button {
    appearance: none;
    border: 0;
    border-radius: 3px;
    padding: .35rem .7rem;
    background: transparent;
    color: var(--muted);
    font: 600 12px/1 var(--font);
    letter-spacing: .04em;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.leaflet-container .map-style-toggle button:hover { color: var(--ink); }
.leaflet-container .map-style-toggle button.active { background: var(--ink); color: #fff; }
/* keep the zoom control from overlapping the toggle */
.leaflet-top.leaflet-left { display: flex; flex-direction: column; }
.leaflet-top.leaflet-left .map-style-toggle { order: -1; }
.leaflet-bar a { color: var(--ink) !important; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: 2.5rem;
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color .15s ease;
}

.back-link:hover { color: var(--ink); }

/* Print-only elements */
.print-hide { }
.print-report-heading, .print-report-footer { display: none; }

/* --------------------------------------------------------------------------
   Print — two pages: guide, then territory map
   -------------------------------------------------------------------------- */
@media print {
  @page { size: Letter portrait; margin: 10mm 11mm 12mm; }

  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  html, body {
    width: auto; min-height: 0; margin: 0; padding: 0;
    background: #fff !important; color: var(--ink); font-size: 9pt;
  }

  .site-header, .site-footer, .print-hide, .copy-button, .back-link, .dealer-actions, .map-style-toggle { display: none !important; }

  .hero-section {
    padding: 0 0 3mm; margin: 0 0 3mm; border-bottom: .6mm solid var(--gold); background: #fff !important;
    break-inside: avoid;
  }
  .hero-section::before { display: none; }
  .hero-logo { display: none; }
  .hero-content, .hero-section.compact .hero-content { display: block; }
  .hero-aside { display: none; }
  .eyebrow, .dealer-badge { margin: 0 0 1.5mm; font-size: 7pt; }
  .hero-title, .hero-section.compact .hero-title { max-width: none; margin: 0 0 1.5mm; font-size: 20pt; line-height: 1.08; }
  .hero-subtitle { max-width: none; margin: 0; font-size: 8.5pt; line-height: 1.4; }
  .hero-meta { margin-top: 1.5mm; font-size: 7.5pt; gap: 1mm 5mm; }

  .main-content { width: 100%; max-width: none; margin: 0; padding: 0; }

  .print-report-heading {
    display: flex; align-items: center; gap: 4mm; padding: 0 0 3mm; margin: 0 0 4mm;
    border-bottom: .3mm solid var(--line-strong); break-inside: avoid;
  }
  .print-report-heading img { width: 24mm; height: auto; }
  .print-report-heading span, .print-report-heading strong { display: block; }
  .print-report-heading span { color: var(--muted); font-size: 7pt; letter-spacing: .08em; text-transform: uppercase; }
  .print-report-heading strong { font-size: 13pt; line-height: 1.2; }

  .guide-grid { display: flex; flex-direction: column; gap: 0; }
  .guide-side { position: static; display: block; order: -1; margin: 0 0 4mm; }
  .guide-main { display: block; }

  .dealer-info-card, .feature-card, .step-section, .map-card, .script-panel { box-shadow: none !important; break-inside: avoid; }

  .dealer-info-card { margin: 0; border: .3mm solid var(--ink); }
  .dealer-info-grid { grid-template-columns: 1.4fr 1fr .7fr 1.9fr; }
  .dealer-info-card h2 { padding: 1.5mm 3mm; font-size: 7pt; background: var(--ink) !important; }
  .dealer-info-item { padding: 2mm 3mm; border-bottom: 0; border-right: .2mm solid var(--line); }
  .dealer-info-item:last-child { border-right: 0; }
  .dealer-info-label { font-size: 6.5pt; }
  .dealer-info-value { font-size: 8.5pt; }
  .dealer-info-value.mono { font-size: 7pt; }

  .step-section { margin: 0 0 4mm; padding: 0; }
  .step-header { margin-bottom: 1mm; font-size: 7pt; letter-spacing: .2em; }
  .step-title { margin: 0 0 1.5mm; font-size: 14pt; }
  .step-description { margin: 0 0 2.5mm; font-size: 8pt; line-height: 1.35; max-width: none; }

  .script-panel { margin: 0 0 3mm; border: .3mm solid var(--ink); }
  .script-panel-head { padding: 1.5mm 3mm; border-bottom: .3mm solid var(--ink); background: var(--gold-pale) !important; }
  .script-panel-head strong { font-size: 7.5pt; }
  .script-panel-head span { font-size: 7pt; }
  .script-container { padding: 2.5mm 4mm !important; overflow: visible; background: var(--code-bg) !important; }
  .script-container code { font-size: 7.6pt; line-height: 1.45; }
  .script-panel-foot { padding: 1.5mm 3mm; font-size: 7pt; }

  .instructions-list { margin: 0; }
  .instructions-list li { padding: 1mm 0 1mm 7mm; font-size: 7.5pt; line-height: 1.3; break-inside: avoid; }
  .instructions-list li::before { top: 1.3mm; font-size: 6.5pt; }
  .instructions-list li code { font-size: 7pt; background: none; padding: 0; }

  .features-grid { grid-template-columns: 1fr 1fr; gap: 6mm; padding-top: 3mm; margin: 0; border-top: .3mm solid var(--ink); }
  .feature-title { margin-bottom: 1mm; font-size: 7pt; }
  .feature-title span { width: 3.5mm; height: 3.5mm; font-size: 6pt; }
  .feature-list li { padding: .5mm 0 .5mm 3mm; font-size: 7.3pt; line-height: 1.25; }
  .feature-list li::before { top: 1.6mm; width: 1.1mm; height: 1.1mm; }

  .territory-print-section { break-before: page; margin: 0 !important; padding-top: 2mm; border-top: 0; }
  .territory-head-row { margin: 0 0 3mm; padding-bottom: 2mm; border-bottom: .6mm solid var(--gold); }
  .territory-head-row h3 { font-size: 15pt !important; }
  .territory-head-row p { font-size: 7.5pt; }
  .territory-print-section .map-card { padding: 2mm !important; border: .3mm solid var(--ink); }
  .territory-print-section #map { height: 165mm !important; }

  .print-report-footer {
    display: flex; justify-content: space-between; gap: 5mm; margin-top: 4mm; padding-top: 2mm;
    border-top: .25mm solid var(--line-strong); color: var(--muted); font-size: 7pt;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1024px) {
    .hero-content, .hero-section.compact .hero-content { grid-template-columns: 1fr; gap: 2.5rem; align-items: start; }
    .hero-aside { align-items: stretch; }
    .guide-grid { grid-template-columns: 1fr; }
    .guide-side { position: static; }
    .dealer-info-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
    .dealer-info-item { border-right: 1px solid var(--line); }
    .dealer-card { grid-template-columns: 2.25rem minmax(0, 1fr) auto; }
    .dealer-card .dealer-meta-item { display: none; }
}

@media screen and (max-width: 768px) {
    .container, .main-content { width: min(1180px, calc(100% - 2rem)); }
    .header-inner { height: 56px; }
    .brand-name { display: none; }
    .hero-section { padding: 2.5rem 0 2.25rem; }
    .hero-logo { height: 44px; margin-bottom: 1.25rem; }
    .main-content { padding: 2.25rem 0 3rem; }
    .section-head { grid-template-columns: 1fr; align-items: start; }
    .filter-select { width: 100%; }
    .dealer-card { grid-template-columns: minmax(0, 1fr); gap: .75rem; padding: 1rem 0; }
    .dealer-index { display: none; }
    .dealer-actions { justify-content: flex-start; }
    .dealer-link { flex: 1 1 auto; justify-content: center; }
    .rc-links { grid-template-columns: minmax(0, 1fr); }
    .features-grid { grid-template-columns: 1fr; gap: 1.75rem; }
    .script-panel-head { flex-direction: column; align-items: flex-start; gap: .2rem; }
    .script-container { padding: 4.25rem 1.15rem 1.35rem; }
    .script-container code { font-size: .9rem; }
    .copy-button { top: .85rem; right: .85rem; left: .85rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .utility-bar { justify-content: stretch; }
    .utility-bar .btn { flex: 1; }
}
