:root {
    --rpw-bg: #f4f2f0;
    --rpw-surface: #ffffff;
    --rpw-text: #3d3a38;
    --rpw-muted: #6b6560;
    --rpw-accent: #e1543d;
    --rpw-accent-dark: #b83d00;
    --rpw-nav: #1a1719;
    --rpw-nav-light: #292226;
    --rpw-gold: #c9922a;
    --rpw-safe: #2d6a4f;
    --rpw-border: rgba(26, 23, 25, 0.08);
    --rpw-shadow: 0 8px 30px rgba(26, 23, 25, 0.08);
    --font-body: 'Open Sans', system-ui, sans-serif;
    --font-title: 'Dosis', system-ui, sans-serif;
    --header-h: 4.25rem;
    --tabbar-h: 4.5rem;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--rpw-text);
    background: var(--rpw-bg);
    line-height: 1.6;
}

body.drawer-open { overflow: hidden; }

a { color: var(--rpw-accent); text-decoration: none; }
a:hover { color: var(--rpw-accent-dark); }
img { max-width: 100%; height: auto; display: block; }

.site-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

/* Safety strip */
.safety-strip {
    background: linear-gradient(90deg, var(--rpw-accent) 0%, var(--rpw-accent-dark) 100%);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
    padding: 0.45rem 1rem;
}

.safety-strip span { opacity: 0.92; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--rpw-nav);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

.site-header__inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1rem;
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff;
    flex-shrink: 0;
}

.site-logo__mark,
.site-logo img {
    height: 3.25rem;
    width: auto;
}

.site-logo__text {
    display: none;
    flex-direction: column;
    line-height: 1.15;
}

.site-logo__name {
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.site-logo__tag {
    font-size: 0.68rem;
    opacity: 0.72;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.site-nav {
    display: none;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.site-nav a,
.site-nav .link-button {
    color: rgba(255,255,255,0.88);
    font-family: var(--font-title);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.site-nav a:hover,
.site-nav .link-button:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.site-nav a.is-active {
    color: #fff;
    background: rgba(255,255,255,0.12);
}

.site-nav a.nav-cta {
    background: var(--rpw-accent);
    color: #fff !important;
}

.site-nav a.nav-cta:hover {
    background: var(--rpw-accent-dark);
}

.link-button {
    background: none;
    border: 0;
    cursor: pointer;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.header-actions--desktop { display: none; }

.menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 0.75rem;
    background: rgba(255,255,255,0.04);
    color: #fff;
    cursor: pointer;
}

.menu-btn svg { width: 1.25rem; height: 1.25rem; }

.header-report {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: var(--rpw-accent);
    color: #fff !important;
    font-family: var(--font-title);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.header-report:hover { background: var(--rpw-accent-dark); color: #fff; }

/* Mobile drawer */
.mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
}

.mobile-drawer[aria-hidden="false"] { pointer-events: auto; }

.mobile-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    opacity: 0;
    transition: opacity 0.2s;
}

.mobile-drawer[aria-hidden="false"] .mobile-drawer__backdrop { opacity: 1; }

.mobile-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(20rem, 88vw);
    height: 100%;
    background: var(--rpw-nav);
    color: #fff;
    transform: translateX(100%);
    transition: transform 0.22s ease;
    display: flex;
    flex-direction: column;
    padding: 1rem 1rem calc(1rem + var(--safe-bottom));
    box-shadow: -8px 0 40px rgba(0,0,0,0.25);
}

.mobile-drawer[aria-hidden="false"] .mobile-drawer__panel { transform: translateX(0); }

.mobile-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-drawer__title {
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 700;
}

.mobile-drawer__links {
    display: grid;
    gap: 0.35rem;
    overflow-y: auto;
}

.mobile-drawer__links a,
.mobile-drawer__links .link-button {
    display: block;
    padding: 0.85rem 0.75rem;
    border-radius: 0.75rem;
    color: rgba(255,255,255,0.92);
    font-family: var(--font-title);
    font-weight: 600;
    font-size: 0.95rem;
}

.mobile-drawer__links a:hover,
.mobile-drawer__links .link-button:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.mobile-drawer__links a.is-active { background: rgba(225,84,61,0.18); color: #fff; }

.mobile-drawer__links a.drawer-cta {
    background: var(--rpw-accent);
    color: #fff;
    text-align: center;
    margin-top: 0.5rem;
}

.mobile-drawer__section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.mobile-drawer__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.55;
    margin-bottom: 0.5rem;
}

.mobile-drawer__social {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
}

.mobile-drawer__social a {
    color: rgba(255,255,255,0.72);
    font-size: 0.85rem;
}

/* Bottom tab bar */
.mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: var(--tabbar-h);
    padding-bottom: var(--safe-bottom);
    background: rgba(26, 23, 25, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.08);
}

.mobile-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    color: rgba(255,255,255,0.68);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.45rem 0.25rem;
}

.mobile-tabbar a svg { width: 1.2rem; height: 1.2rem; }

.mobile-tabbar a.is-active { color: #fff; }

.mobile-tabbar a.tabbar-cta {
    color: #fff;
    background: linear-gradient(180deg, var(--rpw-accent) 0%, var(--rpw-accent-dark) 100%);
    border-radius: 1rem 1rem 0 0;
    margin-top: -0.35rem;
    padding-top: 0.65rem;
}

.mobile-tabbar a.tabbar-cta svg { width: 1.35rem; height: 1.35rem; }

/* Flash */
.flash {
    background: #e8f5ec;
    border-bottom: 1px solid #b7dfc4;
    color: var(--rpw-safe);
    padding: 0.75rem 1rem;
    text-align: center;
    font-weight: 600;
}

/* Hero */
.hero {
    position: relative;
    background: var(--rpw-nav);
    color: #fff;
    min-height: clamp(22rem, 55vh, 32rem);
}

.hero__inner {
    position: relative;
    min-height: inherit;
}

.hero-slide {
    display: none;
    min-height: inherit;
    background: var(--rpw-nav) center/cover no-repeat;
    background-image:
        linear-gradient(135deg, rgba(26,23,25,0.88) 0%, rgba(26,23,25,0.55) 55%, rgba(225,84,61,0.25) 100%),
        var(--hero-image, none);
}

.hero-slide.is-active { display: block; }

.hero-slide__overlay {
    max-width: 42rem;
    margin: 0 auto;
    padding: 2.5rem 1rem 3rem;
    min-height: inherit;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    margin-bottom: 0.85rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero h1 {
    font-family: var(--font-title);
    font-size: clamp(1.85rem, 5vw, 2.75rem);
    margin: 0 0 0.75rem;
    line-height: 1.08;
}

.hero p {
    font-size: 1.05rem;
    max-width: 36rem;
    opacity: 0.92;
    margin: 0;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    display: flex;
    gap: 0.45rem;
}

.hero-dots button {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    border: 0;
    background: rgba(255,255,255,0.35);
    cursor: pointer;
    padding: 0;
}

.hero-dots button.is-active { background: var(--rpw-accent); width: 1.25rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.8rem 1.25rem;
    background: var(--rpw-accent);
    color: #fff !important;
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 0;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.btn:hover {
    background: var(--rpw-accent-dark);
    color: #fff;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.85);
}

.btn-secondary:hover { background: rgba(255,255,255,0.08); }

.btn-outline {
    background: transparent;
    border: 2px solid var(--rpw-accent);
    color: var(--rpw-accent) !important;
}

.btn-outline:hover {
    background: var(--rpw-accent);
    color: #fff !important;
}

/* Sections */
.section { padding: 2.5rem 1rem; }
.section--white { background: var(--rpw-surface); }
.section--dark {
    background: var(--rpw-nav);
    color: rgba(255,255,255,0.92);
}
.section--accent {
    background: linear-gradient(135deg, var(--rpw-accent) 0%, var(--rpw-accent-dark) 100%);
    color: #fff;
}
.section__inner { max-width: 60rem; margin: 0 auto; }
.section__header { margin-bottom: 1.5rem; }
.section__eyebrow {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rpw-accent);
    margin-bottom: 0.35rem;
}
.section--dark .section__eyebrow,
.section--accent .section__eyebrow { color: rgba(255,255,255,0.72); }

.section h2 {
    font-family: var(--font-title);
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin: 0 0 0.75rem;
    line-height: 1.15;
}

.section p { margin: 0 0 1rem; color: inherit; }
.section p:last-child { margin-bottom: 0; }

/* Quick actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
}

.quick-action {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem;
    border-radius: 1rem;
    background: var(--rpw-surface);
    border: 1px solid var(--rpw-border);
    box-shadow: var(--rpw-shadow);
    color: var(--rpw-text);
    min-height: 7rem;
}

.quick-action:hover {
    border-color: rgba(225,84,61,0.35);
    color: var(--rpw-text);
    transform: translateY(-2px);
}

.quick-action--primary {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--rpw-nav) 0%, var(--rpw-nav-light) 100%);
    color: #fff;
    border: 0;
}

.quick-action--primary:hover { color: #fff; }

.quick-action__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(225,84,61,0.12);
    color: var(--rpw-accent);
}

.quick-action--primary .quick-action__icon {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.quick-action__title {
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 700;
}

.quick-action__desc {
    font-size: 0.85rem;
    opacity: 0.78;
    line-height: 1.45;
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 1rem;
    padding: 1.25rem;
}

.card h3 {
    font-family: var(--font-title);
    margin: 0 0 0.5rem;
    color: #fff;
}

.card p { opacity: 0.85; margin-bottom: 1rem; }

/* Page headers */
.page-header {
    background: linear-gradient(180deg, var(--rpw-nav) 0%, var(--rpw-nav-light) 100%);
    color: #fff;
    padding: 2rem 1rem 2.25rem;
}

.page-header__inner {
    max-width: 60rem;
    margin: 0 auto;
}

.page-header__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.65;
    margin-bottom: 0.35rem;
}

.page-header h1 {
    font-family: var(--font-title);
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    line-height: 1.1;
}

.page-body {
    max-width: 44rem;
    margin: -1rem auto 0;
    padding: 0 1rem 3rem;
}

.page-body__card {
    background: var(--rpw-surface);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--rpw-shadow);
    border: 1px solid var(--rpw-border);
}

.page-body__card :first-child { margin-top: 0; }
.page-body__card :last-child { margin-bottom: 0; }

/* Forms */
.form-panel {
    max-width: 44rem;
    margin: -1rem auto 0;
    padding: 0 1rem 3rem;
}

.form-panel__card {
    background: var(--rpw-surface);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--rpw-shadow);
    border: 1px solid var(--rpw-border);
}

.form-grid { display: grid; gap: 1rem; }
.form-grid label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.92rem;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid #d8d2cc;
    border-radius: 0.65rem;
    font: inherit;
    background: #fff;
}

.form-grid textarea { min-height: 140px; resize: vertical; }
.form-grid--two { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* IRS */
.irs-table-wrap { overflow-x: auto; padding: 0 1rem 3rem; }
.irs-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--rpw-shadow);
}

.irs-table th, .irs-table td {
    border-bottom: 1px solid var(--rpw-border);
    padding: 0.75rem;
    text-align: left;
    font-size: 0.9rem;
}

.irs-table th {
    background: var(--rpw-nav);
    color: #fff;
    font-family: var(--font-title);
}

.irs-detail {
    max-width: 44rem;
    margin: -1rem auto 0;
    padding: 0 1rem 3rem;
}

.irs-detail dl {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0.75rem 1rem;
    background: #fff;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--rpw-border);
    box-shadow: var(--rpw-shadow);
}

.irs-detail dt { font-weight: 700; color: var(--rpw-nav); }
.barcode { text-align: center; margin: 1rem 0; }

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

/* Map */
.sector-map {
    height: clamp(20rem, 58vh, 34rem);
    width: 100%;
    border-top: 3px solid var(--rpw-accent);
    border-bottom: 3px solid var(--rpw-nav);
}

.sector-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 1rem 1rem 2rem;
}

.sector-legend__chip {
    display: inline-block;
    padding: 0.25rem 0.55rem;
    border: 2px solid var(--rpw-accent);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-title);
    background: #fff;
    color: var(--rpw-nav);
}

.map-error {
    padding: 2rem;
    text-align: center;
    color: var(--rpw-muted);
}

/* Footer */
.site-footer {
    background: var(--rpw-nav);
    color: rgba(255,255,255,0.88);
    padding: 2rem 1rem calc(2rem + var(--tabbar-h) + var(--safe-bottom));
}

.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--rpw-accent); }

.site-footer__top {
    max-width: 60rem;
    margin: 0 auto 1.5rem;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.site-footer__brand img { max-height: 3rem; width: auto; margin-bottom: 0.75rem; }
.site-footer__brand p { margin: 0; opacity: 0.85; }

.site-footer__links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 1rem;
}

.site-footer__bottom {
    max-width: 60rem;
    margin: 0 auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    font-size: 0.82rem;
    opacity: 0.72;
}

.inline-form { display: inline; }

/* Desktop */
.header-actions--mobile { display: flex; }

@media (min-width: 900px) {
    .header-actions--mobile { display: none; }
    .site-logo__text { display: flex; }
    .site-nav { display: flex; }
    .header-actions { margin-left: 0; }
    .header-actions--desktop { display: flex; }
    .header-actions--mobile { display: none; }
    .mobile-tabbar { display: none; }
    .site-footer { padding-bottom: 2rem; }
    .quick-actions { grid-template-columns: repeat(4, 1fr); }
    .quick-action--primary { grid-column: span 2; }
}

@media (max-width: 899px) {
    body { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom)); }
    .site-footer__top { grid-template-columns: 1fr; }
    .irs-detail dl { grid-template-columns: 1fr; }
}

@media (min-width: 640px) {
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) and (max-width: 1099px) {
    .site-nav a { padding: 0.5rem 0.55rem; font-size: 0.76rem; }
}
