/* BackroomsAtlas - retro Backrooms default theme */

:root {
    --bg: #16140f;
    --bg-soft: #1c1912;
    --panel: rgba(39, 34, 22, 0.92);
    --panel-2: rgba(55, 46, 29, 0.92);
    --panel-border: rgba(182, 165, 99, 0.24);
    --text: #efe5b7;
    --text-soft: #c7be92;
    --muted: #9f9770;
    --accent: #d9c15f;
    --accent-2: #9bd06b;
    --danger: #ff9b7c;
    --success: #b6e07f;
    --shadow: rgba(0, 0, 0, 0.55);
    --glow: rgba(217, 193, 95, 0.22);
    --grid-line: rgba(255, 235, 160, 0.04);
    --scanline: rgba(255, 255, 255, 0.025);
    --radius: 18px;
    --radius-sm: 12px;
    --radius-xs: 10px;
    --max-width: 1220px;
    --font-body: "Trebuchet MS", "Verdana", "Segoe UI", sans-serif;
    --font-mono: "Courier New", "Consolas", monospace;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font-body);
    background:
        linear-gradient(180deg, rgba(255, 240, 150, 0.06), transparent 30%),
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 3px,
            var(--scanline) 4px
        ),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        radial-gradient(circle at top, rgba(217, 193, 95, 0.14), transparent 33%),
        linear-gradient(180deg, #13110d 0%, #191610 100%);
    background-size: auto, auto, 42px 42px, 42px 42px, auto, auto;
    letter-spacing: 0.01em;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 10%, rgba(255, 244, 180, 0.05), transparent 22%),
        radial-gradient(circle at 90% 20%, rgba(180, 255, 170, 0.04), transparent 18%),
        radial-gradient(circle at 50% 120%, rgba(255, 238, 130, 0.06), transparent 26%);
    mix-blend-mode: screen;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: #f6e499;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(calc(100% - 2rem), var(--max-width));
    margin: 0 auto;
}

.site-shell {
    position: relative;
    z-index: 1;
}

.top-strip {
    border-bottom: 1px solid rgba(244, 226, 151, 0.12);
    background: linear-gradient(180deg, rgba(255, 250, 220, 0.04), rgba(0, 0, 0, 0));
    font-size: 0.9rem;
    color: var(--text-soft);
}

.top-strip .container {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
}

.site-header {
    position: static;
    top: auto;
    z-index: 20;
    backdrop-filter: blur(10px);
    background: linear-gradient(180deg, rgba(14, 12, 9, 0.92), rgba(14, 12, 9, 0.72));
    border-bottom: 1px solid rgba(238, 222, 156, 0.12);
}

.site-header .container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem 0;
}

.brand {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    border: 1px solid rgba(240, 226, 161, 0.16);
    background:
        linear-gradient(180deg, rgba(255, 249, 214, 0.12), rgba(255, 249, 214, 0.04)),
        linear-gradient(135deg, rgba(217, 193, 95, 0.22), rgba(155, 208, 107, 0.16));
    display: grid;
    place-items: center;
    box-shadow: 0 0 0 1px rgba(240, 226, 161, 0.05), 0 14px 40px var(--shadow), inset 0 0 22px rgba(255, 249, 214, 0.05);
    font-family: var(--font-mono);
    font-size: 1.35rem;
    color: var(--accent);
}

.brand-text h1,
.brand-text .brand-title {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.1;
    color: var(--text);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-text p {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.primary-nav {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.primary-nav a,
.primary-nav button,
.button,
button.button {
    appearance: none;
    border: 1px solid rgba(237, 220, 142, 0.12);
    background:
        linear-gradient(180deg, rgba(255, 245, 193, 0.07), rgba(255, 245, 193, 0.01)),
        rgba(46, 38, 24, 0.72);
    color: var(--text);
    padding: 0.72rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.primary-nav a:hover,
.primary-nav button:hover,
.button:hover,
button.button:hover {
    transform: translateY(-1px);
    border-color: rgba(237, 220, 142, 0.35);
    background:
        linear-gradient(180deg, rgba(255, 245, 193, 0.12), rgba(255, 245, 193, 0.02)),
        rgba(60, 50, 32, 0.78);
}

.button.secondary {
    background: rgba(25, 23, 19, 0.7);
}

.button.danger {
    border-color: rgba(255, 155, 124, 0.24);
    color: #ffd4c8;
}

.hero {
    padding: 4rem 0 2.6rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.25rem;
    align-items: stretch;
}

.panel {
    border-radius: var(--radius);
    border: 1px solid var(--panel-border);
    background:
        linear-gradient(180deg, rgba(255, 247, 201, 0.07), rgba(255, 247, 201, 0.01)),
        var(--panel);
    box-shadow: 0 14px 50px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.025);
    padding: 1.25rem;
}

.hero-main {
    padding: 1.6rem;
}

.hero-kicker,
.section-kicker {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--accent-2);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
}

.hero h2 {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 5vw, 3.55rem);
    line-height: 0.95;
    letter-spacing: -0.035em;
}

.hero p {
    margin: 0 0 1rem;
    max-width: 52rem;
    color: var(--text-soft);
    font-size: 1.05rem;
    line-height: 1.7;
}

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

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

.metric-card {
    border-radius: var(--radius-sm);
    padding: 1rem;
    background:
        linear-gradient(180deg, rgba(255, 249, 214, 0.06), rgba(255, 249, 214, 0.015)),
        var(--panel-2);
    border: 1px solid rgba(245, 229, 157, 0.11);
}

.metric-label {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.4rem;
}

.metric-value {
    font-size: 1.9rem;
    font-weight: 800;
}

.grid-3,
.grid-2,
.grid-4 {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.section {
    padding: 1.15rem 0 2.25rem;
}
.section > * {
    width: min(calc(100% - 2.5rem), var(--max-width));
    margin-left: auto;
    margin-right: auto;
}


.section-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-header h3 {
    margin: 0.2rem 0 0;
    font-size: 1.7rem;
    letter-spacing: -0.02em;
}

.section-header p {
    margin: 0.35rem 0 0;
    color: var(--text-soft);
}

.entry-card {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    min-height: 100%;
    position: relative;
}

.entry-card-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.entry-type {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border: 1px solid rgba(245, 229, 157, 0.15);
    color: var(--accent-2);
    background: rgba(25, 32, 18, 0.52);
}

.entry-card h4 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.2;
}

.entry-card p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.65;
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.mini-chip {
    border-radius: 999px;
    padding: 0.38rem 0.65rem;
    background: rgba(255, 248, 218, 0.06);
    border: 1px solid rgba(255, 229, 135, 0.11);
    color: var(--text-soft);
    font-size: 0.82rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    margin-top: auto;
    padding-top: 0.4rem;
}

.search-panel {
    margin-top: 2rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
}

.form-group.span-2 {
    grid-column: span 2;
}

.form-group.span-4 {
    grid-column: span 4;
}

label {
    font-size: 0.87rem;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    color: var(--muted);
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(239, 226, 165, 0.14);
    background: rgba(18, 17, 13, 0.82);
    color: var(--text);
    padding: 0.9rem 1rem;
    font: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.015);
}

textarea {
    resize: vertical;
    min-height: 130px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(217, 193, 95, 0.42);
    box-shadow: 0 0 0 4px rgba(217, 193, 95, 0.08);
}

.form-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.notice {
    padding: 0.95rem 1rem;
    border-radius: 14px;
    margin-bottom: 1rem;
    border: 1px solid rgba(245, 229, 157, 0.15);
    background: rgba(42, 37, 24, 0.82);
}

.notice.success {
    border-color: rgba(182, 224, 127, 0.22);
    color: #ecffd4;
}

.notice.error {
    border-color: rgba(255, 155, 124, 0.22);
    color: #ffe0d5;
}

.notice.notice-warning {
    border-color: rgba(214, 177, 87, 0.26);
    background: rgba(52, 43, 22, 0.9);
    color: var(--text);
}

.verification-banner,
.verification-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.verification-banner strong,
.verification-panel strong {
    display: block;
    margin-bottom: 0.2rem;
}

.verification-banner-copy,
.verification-inline-form,
.verification-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.verification-inline-form,
.verification-banner-actions {
    margin: 0;
}

.stack {
    display: grid;
    gap: 1rem;
}

.entry-hero {
    padding: 2.2rem 0 1.2rem;
}

.entry-title-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.entry-title-row h2 {
    margin: 0.45rem 0 0;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.03em;
}

.meta-board {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 1rem 0 0;
}

.meta-box {
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 249, 214, 0.04);
    border: 1px solid rgba(245, 229, 157, 0.1);
}

.meta-box strong {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.11em;
}

.content-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
    padding-bottom: 2rem;
}

.rich-copy {
    color: var(--text-soft);
    line-height: 1.8;
}

.rich-copy h3,
.rich-copy h4 {
    color: var(--text);
    margin-top: 1.4rem;
    margin-bottom: 0.7rem;
}

.inline-list {
    display: grid;
    gap: 0.75rem;
}

.inline-list .link-row {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(245, 229, 157, 0.08);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.95rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid rgba(245, 229, 157, 0.08);
    vertical-align: top;
}

th {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.82rem;
}

.footer {
    border-top: 1px solid rgba(245, 229, 157, 0.08);
    padding: 2rem 0 3rem;
    color: var(--muted);
}

.footer .container {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.kv-list {
    display: grid;
    gap: 0.55rem;
}

.kv-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px dashed rgba(245, 229, 157, 0.09);
    padding-bottom: 0.55rem;
}

.kv-row span:last-child {
    text-align: right;
    color: var(--text-soft);
}

.detail-list {
    display: grid;
    gap: 0.45rem;
}

.detail-row {
    display: grid;
    grid-template-columns: minmax(8.5rem, 11.5rem) minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(245, 229, 157, 0.08);
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-label {
    color: var(--muted);
    font-size: 0.92rem;
}

.detail-value {
    min-width: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.inline-meta-pair {
    display: inline-flex;
    align-items: baseline;
    gap: 0.48rem;
    flex-wrap: wrap;
}

.inline-meta-pair strong {
    font-size: inherit;
    line-height: inherit;
}

@media (max-width: 640px) {
    .detail-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.2rem;
    }
}

.auth-wrap,
.install-wrap {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 160px);
    padding: 2rem 0;
}

.auth-panel,
.install-panel {
    width: min(860px, 100%);
}

.admin-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 0.76fr) minmax(0, 1.24fr);
}

.admin-sidebar .panel,
.admin-main .panel {
    height: 100%;
}

.small-text {
    color: var(--muted);
    font-size: 0.9rem;
}

.badge-rating {
    font-family: var(--font-mono);
    color: var(--accent);
    letter-spacing: 0.1em;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--text-soft);
}

.utility-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

hr.hr-soft {
    border: 0;
    border-top: 1px solid rgba(245, 229, 157, 0.08);
    margin: 1rem 0;
}

@media (max-width: 1100px) {
    .hero-grid,
    .content-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .meta-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .site-header .container,
    .top-strip .container,
    .section-header,
    .entry-title-row {
        grid-template-columns: 1fr;
        display: grid;
    }

    .primary-nav {
        justify-content: start;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .metric-grid,
    .form-grid,
    .meta-board {
        grid-template-columns: 1fr;
    }

    .form-group.span-2,
    .form-group.span-4 {
        grid-column: span 1;
    }

    .hero {
        padding-top: 2.5rem;
    }

    .panel,
    .hero-main {
        padding: 1rem;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(calc(100% - 1rem), var(--max-width));
    }

    .brand {
        align-items: start;
    }

    .brand-mark {
        width: 48px;
        height: 48px;
        border-radius: 13px;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .entry-title-row h2 {
        font-size: 1.9rem;
    }

    .primary-nav a,
    .button,
    button.button {
        width: 100%;
        text-align: center;
    }
}

.primary-nav a.is-active {
    border-color: rgba(237, 220, 142, 0.38);
    box-shadow: 0 0 0 1px rgba(255, 245, 193, 0.07), 0 0 30px rgba(217, 193, 95, 0.12);
}

.hero-panel-deep {
    position: relative;
    overflow: hidden;
}

.hero-panel-deep::after {
    content: "";
    position: absolute;
    inset: auto -10% -28% 40%;
    height: 220px;
    background: radial-gradient(circle, rgba(217, 193, 95, 0.2), transparent 60%);
    pointer-events: none;
}

.hero-legend-grid,
.board-grid,
.edit-grid {
    display: grid;
    gap: 1rem;
}

.hero-legend-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1.3rem;
}

.legend-tile,
.feature-card,
.network-focus-card,
.planner-stop {
    border-radius: var(--radius-sm);
    border: 1px solid rgba(245, 229, 157, 0.11);
    background: linear-gradient(180deg, rgba(255, 249, 214, 0.06), rgba(255, 249, 214, 0.012)), var(--panel-2);
    padding: 1rem;
}

.legend-tile strong,
.feature-card h4,
.network-focus-card h2 {
    display: block;
    margin-bottom: 0.4rem;
}

.legend-tile span,
.feature-card p {
    color: var(--text-soft);
}

.panel-inset {
    background: linear-gradient(180deg, rgba(255, 248, 205, 0.04), rgba(255, 248, 205, 0.01)), rgba(20, 18, 14, 0.55);
}

.board-mini .board-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(245, 229, 157, 0.08);
}

.board-mini .board-line:last-child,
.kv-row:last-child {
    border-bottom: 0;
}

.feature-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    margin-bottom: 0.85rem;
    background: rgba(217, 193, 95, 0.14);
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 800;
}

.classification-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.classification-chip {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 180px;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(245, 229, 157, 0.11);
    background: rgba(46, 38, 24, 0.58);
}

.classification-chip span,
.list-row small,
.small-text {
    color: var(--muted);
}

.result-pill {
    border-radius: 999px;
    padding: 0.65rem 1rem;
    border: 1px solid rgba(237, 220, 142, 0.15);
    background: rgba(46, 38, 24, 0.6);
    color: var(--text-soft);
    font-weight: 700;
}


.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.meta-board-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.meta-board-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.danger-box {
    border-color: rgba(255, 155, 124, 0.22);
}

.entry-actions-wrap {
    align-items: flex-start;
}

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    background: rgba(46, 38, 24, 0.42);
    border: 1px solid rgba(245, 229, 157, 0.08);
}

.list-row strong,
.list-row small {
    display: block;
}

.compact-stack > * + * {
    margin-top: 0.7rem;
}

.risk-strip {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    background: rgba(18, 16, 13, 0.5);
    border: 1px solid rgba(245, 229, 157, 0.08);
    color: var(--text-soft);
}

.risk-strip-low,
.risk-strip-minimal {
    border-color: rgba(182, 224, 127, 0.22);
}

.risk-strip-moderate {
    border-color: rgba(217, 193, 95, 0.22);
}

.risk-strip-high,
.risk-strip-critical {
    border-color: rgba(255, 155, 124, 0.22);
}

.hint-list {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--text-soft);
}

.hint-list li + li {
    margin-top: 0.55rem;
}

.input-with-button {
    display: flex;
    gap: 0.6rem;
}

.input-with-button > input {
    flex: 1 1 auto;
}

.edit-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
}


.board-grid-large {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 1.0 upgrade pass */

:focus-visible {
    outline: 2px solid rgba(217, 193, 95, 0.9);
    outline-offset: 3px;
}

.skip-link,
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link:focus,
.skip-link:active {
    clip: auto;
    width: auto;
    height: auto;
    margin: 1rem;
    padding: 0.8rem 1rem;
    z-index: 1000;
    background: #111;
    color: var(--text);
    border-radius: 999px;
}

.nav-toggle {
    display: none;
}

.hero-console {
    margin-top: 1rem;
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.hero-console input {
    flex: 1 1 18rem;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.section-chip-row {
    margin-bottom: 1rem;
}

.section-metric-strip {
    margin-bottom: 1.2rem;
}

.entry-card-title {
    margin: 0.2rem 0 0;
    font-size: 1.2rem;
}

.title-tight {
    margin-top: 0;
}

.centered-actions {
    justify-content: center;
}

.inline-form {
    display: inline;
}

.checkbox-inline-input {
    width: 1.05rem;
    min-width: 1.05rem;
    height: 1.05rem;
    margin-right: 0.55rem;
    accent-color: var(--accent);
}

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

.diagnostic-card {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    padding: 1rem;
    background: rgba(18, 16, 12, 0.52);
}

.diagnostic-card p {
    margin: 0.55rem 0 0;
    color: var(--text-soft);
}

.diagnostic-card-ok {
    box-shadow: inset 0 0 0 1px rgba(182, 224, 127, 0.16);
}

.diagnostic-card-warn {
    box-shadow: inset 0 0 0 1px rgba(255, 155, 124, 0.18);
}

@media (max-width: 920px) {
    .site-header .container {
        grid-template-columns: 1fr auto;
        align-items: start;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        appearance: none;
        border: 1px solid rgba(237, 220, 142, 0.12);
        background: rgba(46, 38, 24, 0.72);
        color: var(--text);
        padding: 0.72rem 1rem;
        border-radius: 999px;
        font-weight: 700;
    }

    .primary-nav {
        display: none;
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .primary-nav.is-open {
        display: flex;
    }

    .hero-grid,
    .content-grid,
    .compare-grid,
    .admin-grid,
    .three-column-stage,
    .diagnostic-grid {
        grid-template-columns: 1fr;
    }
}


/* 1.1 layout and copy clean-up */
.site-header .container {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    padding: 0.95rem 0 1rem;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.header-status {
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-right: 0.25rem;
}

.header-action-link {
    appearance: none;
    border: 1px solid rgba(237, 220, 142, 0.12);
    background: rgba(46, 38, 24, 0.66);
    color: var(--text);
    padding: 0.62rem 0.9rem;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.header-action-link:hover {
    border-color: rgba(237, 220, 142, 0.32);
    background: rgba(60, 50, 32, 0.76);
}

.primary-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
}

.primary-nav a,
.primary-nav button,
.button,
button.button {
    padding: 0.66rem 0.92rem;
}

.primary-nav a,
.primary-nav button {
    font-size: 0.94rem;
}

.hero {
    padding: 2rem 0 2.35rem;
}

.hero-grid {
    grid-template-columns: minmax(0, 1.24fr) minmax(320px, 0.76fr);
    gap: 1rem;
}

.hero h1,
.hero h2 {
    margin: 0 0 1rem;
    font-size: clamp(2.2rem, 4.6vw, 3.55rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
    max-width: 13ch;
}

.hero p {
    max-width: 60ch;
}

.hero-console {
    align-items: stretch;
}

.hero-console .button {
    min-width: 140px;
}

.legend-tile {
    min-height: 100%;
}

.section-header h1,
.section-header h2,
.section-header h3 {
    margin: 0.2rem 0 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: -0.02em;
}

.board-mini .board-line,
.list-row,
.compare-row,
.compare-summary-line,
.kv-row {
    min-width: 0;
}

.list-row span,
.compare-row span,
.compare-summary-line span,
.kv-row span {
    overflow-wrap: anywhere;
}

.footer .container {
    align-items: flex-start;
}

@media (max-width: 920px) {
    .site-header .container {
        padding-top: 0.85rem;
    }

    .header-bar {
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .primary-nav {
        display: none;
        width: 100%;
    }

    .primary-nav.is-open {
        display: flex;
    }
}

@media (max-width: 720px) {
    .header-status {
        width: 100%;
        margin-right: 0;
    }

    .header-action-link,
    .nav-toggle {
        flex: 1 1 auto;
        text-align: center;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero h1,
    .hero h2 {
        max-width: none;
    }
}

/* Atlas community + compact layout additions */
.site-header-compact .header-bar-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0 0.65rem;
}
.brand-compact {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.brand-mark {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.7rem;
    border: 1px solid rgba(214, 177, 87, 0.35);
    background: rgba(214, 177, 87, 0.08);
    color: var(--color-accent, #d6b157);
    font-weight: 700;
    letter-spacing: 0.06em;
}
.brand-title {
    text-decoration: none;
}
.brand-text p {
    margin: 0.1rem 0 0;
    color: rgba(241, 228, 196, 0.72);
    font-size: 0.92rem;
}
.header-actions-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.header-status {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(241, 228, 196, 0.68);
}
.header-action-link {
    color: inherit;
    text-decoration: none;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(214, 177, 87, 0.18);
    background: rgba(255,255,255,0.015);
}
.header-action-link:hover,
.header-action-link[aria-current="page"] {
    background: rgba(214, 177, 87, 0.12);
    border-color: rgba(214, 177, 87, 0.35);
}
.primary-nav-compact {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    padding: 0 0 1rem;
}
.primary-nav-compact a {
    text-decoration: none;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(214, 177, 87, 0.16);
    background: rgba(255,255,255,0.01);
}
.primary-nav-compact a[aria-current="page"],
.primary-nav-compact a:hover {
    background: rgba(214, 177, 87, 0.12);
    border-color: rgba(214, 177, 87, 0.35);
}
.nav-toggle {
    display: none;
}
.hero-reworked .hero-grid-reworked,
.hero-grid-reworked {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
}
.hero-panel-deep {
    padding: 1.5rem;
}
.hero-kicker,
.section-kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    color: rgba(214, 177, 87, 0.9);
    margin-bottom: 0.4rem;
}
.hero-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    margin-top: 1rem;
}
.hero-actions-row,
.section-chip-row,
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}
.hero-side-stack,
.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.compact-stack { gap: 0.7rem; }
.wide-stack { gap: 1.2rem; }
.stat-grid-compact,
.hero-stat-grid,
.quick-stats-grid,
.responsive-card-grid,
.grid-3 {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.entry-summary-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
    align-items: stretch;
}
.entry-summary-grid > .panel {
    height: 100%;
}
.entry-summary-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 100%;
}
.entry-summary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.entry-summary-copy {
    margin: 0;
    color: rgba(241, 228, 196, 0.72);
    max-width: 48ch;
    line-height: 1.5;
}
.entry-summary-note {
    margin-top: auto;
    padding-top: 0.1rem;
}
.entry-detail-meta-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.95fr);
    margin-top: 0.95rem;
    align-items: start;
}
.entry-meta-section {
    min-width: 0;
}
.section-kicker-tight {
    margin-bottom: 0.55rem;
}
.quick-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card,
.compact-stat-card {
    border: 1px solid rgba(214, 177, 87, 0.14);
    background: rgba(255,255,255,0.02);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
}
.metric-label,
.small-text,
.metric-card small {
    color: rgba(241, 228, 196, 0.72);
}
.metric-value {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.28rem;
    font-weight: 800;
    line-height: 1.2;
}
.metric-value-empty {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(241, 228, 196, 0.76);
}
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0.95rem;
    border: 1px solid rgba(214, 177, 87, 0.12);
    border-radius: 0.95rem;
    text-decoration: none;
    background: rgba(255,255,255,0.015);
}
.list-row small {
    display: block;
    margin-top: 0.2rem;
    color: rgba(241, 228, 196, 0.68);
}
.classification-chip {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(214, 177, 87, 0.16);
    border-radius: 1rem;
    text-decoration: none;
    min-width: 180px;
    background: rgba(255,255,255,0.02);
}
.directory-toolbar-chunked { padding: 1rem; }
.form-section {
    border-top: 1px solid rgba(214, 177, 87, 0.12);
    padding-top: 1rem;
}
.form-section:first-child {
    border-top: 0;
    padding-top: 0;
}
.atlas-form-layout-balanced,
.entry-body-grid,
.entry-community-grid {
    display: grid;
    gap: 1.1rem;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
    align-items: start;
}
.entry-hero {
    padding: 1.35rem;
}
.entry-hero-header,
.report-card-header,
.card-footer,
.history-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.entry-subtitle { max-width: 70ch; }
.entry-operational-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1rem;
}
.entry-operational-card {
    border: 1px solid rgba(214, 177, 87, 0.14);
    background: rgba(255, 255, 255, 0.018);
    border-radius: 1rem;
    padding: 0.95rem 1rem;
    min-width: 0;
}
.entry-operational-label {
    display: block;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(214, 177, 87, 0.82);
}
.entry-operational-value {
    display: block;
    margin-top: 0.45rem;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.1;
}
.entry-operational-value-small {
    font-size: 1.02rem;
    line-height: 1.35;
}
.entry-operational-meta {
    display: block;
    margin-top: 0.45rem;
    color: rgba(241, 228, 196, 0.72);
    line-height: 1.45;
}
.entry-page-history-panel {
    padding-top: 1rem;
}
.page-history-log {
    max-height: 34rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}
.page-history-log::-webkit-scrollbar {
    width: 0.55rem;
}
.page-history-log::-webkit-scrollbar-thumb {
    background: rgba(214, 177, 87, 0.22);
    border-radius: 999px;
}
.section-header-tight {
    margin-bottom: 0.85rem;
}
.entry-card-clean p,
.report-card p { line-height: 1.55; }
.entry-card-flags,
.compact-entry-meta,
.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.mini-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(214, 177, 87, 0.18);
    background: rgba(255,255,255,0.025);
    font-size: 0.82rem;
}
.mini-chip-accent {
    background: rgba(214, 177, 87, 0.13);
    border-color: rgba(214, 177, 87, 0.38);
}
.report-card,
.warning-card {
    border: 1px solid rgba(214, 177, 87, 0.14);
    border-radius: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.018);
}
.warning-card {
    background: rgba(214, 177, 87, 0.06);
}
.data-grid-list {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.65rem;
}
.data-grid-item {
    border: 1px solid rgba(214, 177, 87, 0.12);
    border-radius: 0.9rem;
    padding: 0.7rem 0.85rem;
    background: rgba(255,255,255,0.015);
}
.data-grid-item span {
    display: block;
    margin-top: 0.2rem;
    color: rgba(241, 228, 196, 0.72);
}
.inline-form-row,
.utility-row.compact-actions,
.form-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}
.compact-button { padding: 0.45rem 0.8rem; }
.narrow-section { max-width: 860px; margin-inline: auto; }
.result-pill {
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(214, 177, 87, 0.18);
    background: rgba(214, 177, 87, 0.08);
    font-size: 0.9rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.checkbox-group label {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
}
.small-list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.35rem;
}
@media (max-width: 980px) {
    .hero-grid-reworked,
    .atlas-form-layout-balanced,
    .entry-body-grid,
    .entry-community-grid,
    .entry-detail-meta-grid,
    .footer-grid,
    .quick-stats-grid,
    .entry-summary-grid,
    .entry-operational-strip,
    .grid-3,
    .responsive-card-grid {
        grid-template-columns: 1fr;
    }
    .hero-search-form {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 820px) {
    .header-bar-compact {
        flex-direction: column;
        align-items: stretch;
    }
    .header-actions-compact {
        justify-content: flex-start;
    }
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.5rem 0.8rem;
        border-radius: 999px;
        border: 1px solid rgba(214, 177, 87, 0.18);
        background: rgba(255,255,255,0.02);
        color: inherit;
    }
    .primary-nav-compact {
        display: none;
        padding-top: 0.15rem;
    }
    .primary-nav-compact.is-open {
        display: flex;
    }
}
@media (max-width: 640px) {
    .primary-nav-compact a,
    .header-action-link,
    .mini-chip {
        font-size: 0.8rem;
    }
    .entry-summary-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .entry-hero,
    .hero-panel-deep,
    .directory-toolbar-chunked,
    .report-card,
    .panel {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }
    .entry-hero-header,
    .report-card-header,
    .card-footer,
    .history-row {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* Header refresh */
.site-header-compact {
    background:
        linear-gradient(180deg, rgba(12, 11, 8, 0.97), rgba(12, 11, 8, 0.88)),
        radial-gradient(circle at top center, rgba(214, 177, 87, 0.08), transparent 45%);
    border-bottom: 1px solid rgba(214, 177, 87, 0.16);
}

.site-header-compact .container {
    padding-top: 0;
    padding-bottom: 0;
}

.site-header-inner {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    padding: 1rem 0 1.05rem;
}

.header-topline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem 1.25rem;
    align-items: center;
}

.brand-lockup {
    min-width: 0;
}

.brand-lockup .brand-mark {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(214, 177, 87, 0.3);
    background:
        linear-gradient(180deg, rgba(255, 244, 198, 0.08), rgba(255, 244, 198, 0.02)),
        rgba(214, 177, 87, 0.08);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.26), inset 0 0 18px rgba(255, 248, 220, 0.04);
    color: #e4cf8f;
    font-size: 1.08rem;
}

.brand-lockup .brand-title {
    display: inline-block;
    text-decoration: none;
    font-size: clamp(1.18rem, 1.8vw, 1.45rem);
    font-weight: 800;
    letter-spacing: 0.08em;
}

.brand-lockup .brand-title:hover {
    color: #f2e6b9;
}

.brand-lockup .brand-text p {
    margin-top: 0.28rem;
    max-width: 58ch;
    color: rgba(241, 228, 196, 0.72);
    font-size: 0.96rem;
    line-height: 1.45;
}

.header-utility {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.header-utility-status {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(214, 177, 87, 0.14);
    background: rgba(255, 255, 255, 0.025);
}

.header-status-label {
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(187, 225, 121, 0.92);
}

.header-status-user {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
}

.header-utility-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.header-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.54rem 0.88rem;
    text-decoration: none;
    border-radius: 999px;
    border: 1px solid rgba(214, 177, 87, 0.16);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.header-action-link:hover,
.header-action-link[aria-current="page"],
.header-action-link.is-active {
    border-color: rgba(214, 177, 87, 0.36);
    background: rgba(214, 177, 87, 0.12);
    transform: translateY(-1px);
}

.header-action-link-strong {
    background: linear-gradient(180deg, rgba(214, 177, 87, 0.18), rgba(214, 177, 87, 0.08));
    border-color: rgba(214, 177, 87, 0.3);
}

.header-action-link-quiet {
    background: rgba(255, 255, 255, 0.01);
    color: rgba(241, 228, 196, 0.84);
}

.nav-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 0.62rem;
    align-items: center;
    padding-top: 0.95rem;
    border-top: 1px solid rgba(214, 177, 87, 0.1);
}

.primary-nav-compact a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.55rem;
    padding: 0.58rem 0.95rem;
    text-decoration: none;
    border-radius: 999px;
    border: 1px solid rgba(214, 177, 87, 0.13);
    background: rgba(255, 255, 255, 0.016);
    font-size: 0.94rem;
    font-weight: 700;
}

.primary-nav-compact a[aria-current="page"],
.primary-nav-compact a:hover,
.primary-nav-compact a.is-active {
    background: linear-gradient(180deg, rgba(214, 177, 87, 0.14), rgba(214, 177, 87, 0.07));
    border-color: rgba(214, 177, 87, 0.36);
}

@media (max-width: 980px) {
    .header-topline {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .header-utility {
        justify-content: flex-start;
    }
}

@media (max-width: 820px) {
    .site-header-inner {
        gap: 0.75rem;
        padding: 0.9rem 0 0.95rem;
    }

    .header-utility {
        width: 100%;
        gap: 0.6rem;
    }

    .header-utility-status {
        order: 1;
    }

    .header-utility-links {
        order: 2;
        flex: 1 1 auto;
    }

    .nav-toggle {
        order: 3;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 2.5rem;
        padding: 0.54rem 0.88rem;
        border-radius: 999px;
        border: 1px solid rgba(214, 177, 87, 0.18);
        background: rgba(255, 255, 255, 0.025);
        color: var(--text);
        font-weight: 700;
    }

    .nav-cluster {
        display: none;
        width: 100%;
        padding-top: 0.75rem;
    }

    .nav-cluster.is-open {
        display: flex;
    }
}

@media (max-width: 640px) {
    .brand-lockup {
        align-items: flex-start;
    }

    .brand-lockup .brand-title {
        font-size: 1.05rem;
    }

    .brand-lockup .brand-text p {
        font-size: 0.9rem;
    }

    .header-utility-status,
    .header-action-link,
    .nav-toggle,
    .primary-nav-compact a {
        width: 100%;
        justify-content: center;
    }

    .header-utility-links {
        width: 100%;
    }
}

/* 1.2 homepage, graph, guide, and performance pass */
body {
    background-size: auto, auto, 38px 38px, 38px 38px, auto, auto;
}

body::before {
    opacity: 0.78;
}

.site-shell {
    isolation: isolate;
}

main {
    display: block;
}



.guide-rule-block h2,
.guide-mini-card h2 {
    margin: 0 0 0.45rem;
    font-size: 1.15rem;
}

.user-menu {
    position: relative;
}

.user-menu-toggle {
    appearance: none;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 2.5rem;
    padding: 0.54rem 0.88rem;
    border-radius: 999px;
    border: 1px solid rgba(214, 177, 87, 0.16);
    background: rgba(255, 255, 255, 0.025);
    color: var(--text);
    font-weight: 700;
}

.user-menu-toggle::-webkit-details-marker {
    display: none;
}

.user-menu-caret {
    font-size: 0.8rem;
    color: var(--muted);
}

.user-menu[open] .user-menu-caret {
    transform: rotate(180deg);
}

.user-menu-panel {
    display: grid;
    gap: 0.4rem;
}

.header-public-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    justify-content: flex-end;
}

.header-utility {
    align-items: flex-start;
}

@media (max-width: 1120px) {
    .graph-layout,
    .graph-layout-local,
    .three-column-stage,
    .guide-highlight-grid,
    .guide-grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .graph-toolbar,
    .graph-toolbar-foot,
    .hero-note-row {
        flex-direction: column;
        align-items: stretch;
    }

    .graph-toolbar-controls,
    .hero-search-form-wide,
    .guide-grid-2,
    .compact-metric-grid,
    .quick-stats-grid {
        grid-template-columns: 1fr;
    }

    .hero-search-form-wide {
        display: grid;
    }

    .hero-search-button {
        width: 100%;
    }

    .graph-stage {
        min-height: 400px;
    }

    .verification-banner,
    .verification-panel {
        align-items: stretch;
    }

    .verification-inline-form,
    .verification-banner-actions,
    .verification-inline-form .button,
    .verification-banner-actions .button {
        width: 100%;
    }
}

@media (max-width: 820px) {
    body {
        background:
            linear-gradient(180deg, rgba(255, 240, 150, 0.03), transparent 25%),
            linear-gradient(90deg, rgba(255, 235, 160, 0.03) 1px, transparent 1px),
            linear-gradient(rgba(255, 235, 160, 0.03) 1px, transparent 1px),
            linear-gradient(180deg, #13110d 0%, #191610 100%);
        background-size: auto, 30px 30px, 30px 30px, auto;
    }

    body::before,
    .hero-panel-deep::after,
    .directory-toolbar::before,
    .planner-panel::before,
    .planner-results::before,
    .network-focus-panel::before,
    .entry-hero-panel::before {
        display: none;
    }

    .site-header {
        backdrop-filter: none;
        background: rgba(12, 11, 8, 0.97);
    }

    .panel,
    .metric-card,
    .brand-mark,
    .graph-stage,
    .legend-tile,
    .feature-card,
    .classification-chip,
    .list-row {
        box-shadow: none;
    }
}

@media (max-width: 640px) {
    .site-header {
        position: static;
    }

    .section > * {
        width: min(calc(100% - 1.35rem), var(--max-width));
    }

    .hero-home-upgrade .hero-search-panel,
    .guide-shell .guide-hero-panel,
    .graph-main-panel,
    .panel {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .graph-node-label {
        font-size: 12px;
    }

    .graph-stage {
        min-height: 360px;
    }

    .user-menu-panel {
        position: static;
        margin-top: 0.5rem;
        min-width: 0;
    }

    .header-public-actions {
        width: 100%;
        justify-content: stretch;
    }
}



.panel,
.graph-main-panel,
.graph-side-panel,
.graph-side-panel > .panel,
.three-column-stage > *,
.hero-grid > *,
.hero-grid-reworked > *,
.entry-card,
.entry-card-header > *,
.list-row > *,
.card-footer > * {
    min-width: 0;
}

.list-row,
.graph-node-list .list-row,
.entry-card,
.entry-card p,
.small-text,
.notice,
.graph-detail-card p,
.entry-photo-card-body strong,
.entry-photo-card-body,
.form-hint {
    overflow-wrap: anywhere;
}

.list-row {
    align-items: flex-start;
}

.list-row span,
.list-row > span,
.list-row > a,
.card-footer .utility-row,
.header-public-actions,
.hero-actions {
    min-width: 0;
}

.list-row strong,
.list-row small {
    max-width: 100%;
}

.form-hint {
    margin: 0.15rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.ordered-list {
    padding-left: 1.2rem;
}

.ordered-list li + li {
    margin-top: 0.45rem;
}

.spaced-top {
    margin-top: 1rem;
}

.entry-card-photo {
    display: block;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(214, 177, 87, 0.14);
    background: rgba(255, 255, 255, 0.02);
    aspect-ratio: 16 / 9;
}

.entry-card-photo img,
.entry-photo-link img,
.entry-hero-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.entry-hero-photo-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 1.1rem;
    border: 1px solid rgba(214, 177, 87, 0.16);
    background: rgba(255, 255, 255, 0.02);
    aspect-ratio: 16 / 9;
    margin-top: 1rem;
}

.entry-hero-photo {
    display: block;
}

.entry-hero-photo-meta {
    position: absolute;
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.entry-hero-actions {
    margin-top: 0.2rem;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.entry-hero-actions .button {
    white-space: nowrap;
}

.entry-photo-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 0.85rem;
}

.entry-photo-card {
    display: grid;
    gap: 0;
    border: 1px solid rgba(214, 177, 87, 0.14);
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.entry-photo-card.is-top-photo {
    border-color: rgba(214, 177, 87, 0.36);
    box-shadow: 0 0 0 1px rgba(214, 177, 87, 0.12);
}

.entry-photo-link {
    display: block;
    aspect-ratio: 16 / 10;
    background: rgba(0, 0, 0, 0.22);
}

.entry-photo-card-body {
    display: grid;
    gap: 0.75rem;
    padding: 0.95rem;
}

.graph-stage {
    min-height: 620px;
    touch-action: none;
    cursor: grab;
}

.graph-stage.is-panning {
    cursor: grabbing;
}

.graph-svg {
    display: block;
    width: 100%;
    height: 100%;
}

.graph-node {
    cursor: pointer;
}

.graph-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 245, 193, 0.02);
}

.graph-detail-card,
.graph-node-list {
    min-width: 0;
}

@media (max-width: 980px) {
    .graph-stage {
        min-height: 460px;
    }
}

@media (max-width: 720px) {
    .graph-stage {
        min-height: 400px;
    }

    .entry-photo-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .section > * {
        width: min(calc(100% - 1rem), var(--max-width));
    }

    .graph-main-panel,
    .graph-side-panel > .panel,
    .entry-photo-card-body,
    .panel {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .graph-stage {
        min-height: 360px;
        margin-top: 0.85rem;
    }

    .graph-toolbar-controls {
        width: 100%;
    }

    .graph-toolbar-controls input,
    .graph-toolbar-controls select,
    .entry-hero-actions .button,
    .card-footer .button,
    .inline-form-row .button {
        width: 100%;
    }

    .entry-hero-photo-meta {
        left: 0.6rem;
        right: 0.6rem;
        bottom: 0.6rem;
    }
}


/* 1.4 graph layout expansion and reliable panning */
.graph-page-shell .graph-layout {
    grid-template-columns: 1fr;
}

.graph-page-shell .graph-side-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.graph-page-shell .graph-side-panel > .panel {
    height: 100%;
}

.graph-page-shell .graph-main-panel {
    padding: 1.25rem;
}

.graph-stage {
    user-select: none;
    -webkit-user-select: none;
    min-height: 680px;
}

.graph-stage-global {
    min-height: 820px;
}

.graph-stage-local {
    min-height: 640px;
}

.graph-page-shell .graph-toolbar-controls {
    width: min(100%, 32rem);
}

.graph-page-shell .graph-node-list {
    max-height: 28rem;
    overflow: auto;
    padding-right: 0.25rem;
}

@media (max-width: 1280px) {
    .graph-page-shell .graph-side-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .graph-stage {
        min-height: 520px;
    }

    .graph-stage-global {
        min-height: 620px;
    }

    .graph-page-shell .graph-side-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .graph-stage {
        min-height: 420px;
    }

    .graph-stage-global {
        min-height: 500px;
    }

    .graph-stage-local {
        min-height: 420px;
    }
}


/* 1.5 graph mobile fit and selection popover */
.graph-shell,
.graph-layout,
.graph-main-panel,
.graph-stage {
    min-width: 0;
    max-width: 100%;
}

.graph-main-panel,
.graph-page-shell .graph-main-panel {
    overflow: hidden;
}

.graph-stage {
    width: 100%;
    height: auto;
}

.graph-hover-tooltip,
.graph-selection-popover {
    position: absolute;
    cursor: default;
    border: 1px solid rgba(214, 177, 87, 0.24);
    background: rgba(19, 17, 13, 0.96);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(10px);
}

.graph-hover-tooltip {
    z-index: 13;
    pointer-events: none;
    width: min(16rem, calc(100% - 1.5rem));
    display: grid;
    gap: 0.2rem;
    padding: 0.65rem 0.8rem;
    border-radius: 0.8rem;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 120ms ease, transform 120ms ease;
}

.graph-hover-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.graph-hover-tooltip strong {
    font-size: 0.94rem;
    line-height: 1.35;
}

.graph-hover-tooltip span {
    color: var(--text-soft);
    font-size: 0.84rem;
    line-height: 1.35;
}

.graph-selection-popover {
    z-index: 15;
    pointer-events: auto;
    width: min(22rem, calc(100% - 1.5rem));
    display: grid;
    gap: 0.8rem;
    padding: 0.95rem;
    border-radius: 1rem;
}

.graph-hover-tooltip[hidden],
.graph-selection-popover[hidden] {
    display: none;
}

.graph-selection-popover-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.graph-selection-popover-head strong {
    font-size: 1rem;
    line-height: 1.35;
}

.graph-selection-popover p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.62;
}

.graph-selection-popover-metrics,
.graph-selection-popover-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.graph-selection-popover-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.15rem;
}

.graph-selection-popover-actions .button {
    min-height: 2.3rem;
}

.graph-selection-close {
    appearance: none;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid rgba(214, 177, 87, 0.16);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1;
}

.graph-selection-close:hover {
    background: rgba(214, 177, 87, 0.14);
}

@media (max-width: 640px) {
    .graph-page-shell .graph-main-panel,
    .graph-main-panel {
        padding: 0.95rem;
    }

    .graph-toolbar h1 {
        font-size: clamp(1.55rem, 8vw, 2.1rem);
    }

    .graph-stage {
        min-height: 460px;
    }

    .graph-stage-global {
        min-height: 540px;
    }

    .graph-selection-popover,
    .graph-selection-popover.is-mobile-docked {
        left: 0.75rem !important;
        right: 0.75rem !important;
        top: auto !important;
        bottom: 0.75rem !important;
        width: auto;
        max-width: none;
    }

    .graph-hover-tooltip {
        display: none !important;
    }
}

/* 1.6 mobile home + header fit pass */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.site-header,
.site-header .container,
.site-header-inner,
.header-topline,
.header-utility,
.header-utility-links,
.primary-nav-compact,
.hero-grid,
.hero-grid-reworked,
.home-side-panel,
.section,
.panel,
.list-row {
    min-width: 0;
}

.brand-lockup,
.brand-lockup .brand,
.brand-lockup .brand-text {
    min-width: 0;
}

.brand-lockup .brand-text p {
    overflow-wrap: anywhere;
}

.home-side-panel .list-row,
.home-side-panel .panel,
.home-side-panel .small-text {
    max-width: 100%;
}

@media (max-width: 1100px) {
    .hero-home-upgrade .hero-grid-reworked,
    .hero-home-upgrade.hero .hero-grid-reworked,
    .hero-home-upgrade .hero-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .hero-home-upgrade .hero-search-panel,
    .hero-home-upgrade .home-side-panel {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 820px) {
    .header-utility {
        align-items: stretch;
    }

    .header-utility-status,
    .header-utility-links,
    .user-menu,
    .user-menu-toggle,
    .nav-toggle {
        width: 100%;
    }

    .header-utility-links {
        justify-content: stretch;
    }

    .user-menu-toggle,
    .nav-toggle,
    .header-action-link {
        min-height: 2.75rem;
    }

    .user-menu-panel {
        width: 100%;
        min-width: 0;
    }

    .home-side-panel {
        order: 2;
    }

    .hero-home-upgrade .hero-search-panel {
        order: 1;
    }
}

@media (max-width: 640px) {
    .container,
    .section > * {
        width: min(calc(100% - 1rem), var(--max-width));
    }

    .site-header-inner {
        padding: 0.75rem 0 0.8rem;
        gap: 0.65rem;
    }

    .header-topline {
        gap: 0.8rem;
    }

    .brand-lockup .brand {
        align-items: flex-start;
        gap: 0.75rem;
    }

    .brand-lockup .brand-mark {
        width: 3rem;
        height: 3rem;
        border-radius: 0.85rem;
        flex: 0 0 3rem;
    }

    .brand-lockup .brand-title {
        font-size: 1.05rem;
        line-height: 1.1;
        letter-spacing: 0.06em;
    }

    .brand-lockup .brand-text p {
        margin-top: 0.2rem;
        font-size: 0.9rem;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .header-status-label {
        font-size: 0.7rem;
    }

    .header-status-user {
        font-size: 0.98rem;
    }

    .header-action-link,
    .user-menu-toggle,
    .nav-toggle,
    .primary-nav-compact a {
        width: 100%;
        justify-content: center;
    }

    .primary-nav-compact {
        gap: 0.55rem;
    }

    .hero {
        padding-top: 1rem;
    }

    .hero-home-upgrade .hero-search-panel,
    .home-side-panel .panel,
    .panel {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .home-side-panel .list-row {
        padding: 0.8rem;
    }
}

input[type="checkbox"],
input[type="radio"] {
    appearance: auto;
    -webkit-appearance: auto;
    width: 1.05rem;
    min-width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0.3rem;
    background: transparent;
    box-shadow: none;
    accent-color: var(--accent);
    flex: 0 0 auto;
    vertical-align: top;
}

input[type="radio"] {
    border-radius: 999px;
}

.checkbox-group label,
.checkbox-row {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.7rem;
    font-weight: 600;
    line-height: 1.45;
}

.checkbox-group label input,
.checkbox-row input,
.checkbox-inline-input {
    position: relative;
    top: 0.18rem;
    margin: 0;
}

.checkbox-row span {
    flex: 1 1 auto;
    display: block;
}

input[type="file"] {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border-radius: 14px;
    border: 1px solid rgba(239, 226, 165, 0.14);
    background: rgba(18, 17, 13, 0.82);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.015);
}

input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
    appearance: none;
    -webkit-appearance: none;
    margin-right: 0.8rem;
    padding: 0.65rem 0.95rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(214, 177, 87, 0.22);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover {
    background: rgba(214, 177, 87, 0.12);
}

.small-button {
    padding: 0.5rem 0.82rem;
    font-size: 0.84rem;
}

.graph-inline-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.graph-jump-chip {
    font: inherit;
}

/* 1.6 graph controls, one-way cues, and planner diagnostics */
.graph-arrowhead {
    fill: currentColor;
}

.graph-link.is-one-way {
    stroke-dasharray: 8 7;
}

.graph-selection-popover-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.graph-legend-swatch-one-way {
    background: transparent;
    border: 2px dashed currentColor;
}

/* 1.7 graph mobile reliability and compact controls */
.graph-stage {
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: contain;
}

.graph-inline-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.75rem, 1fr));
    width: 100%;
    gap: 0.6rem;
    align-items: stretch;
}

.graph-inline-controls .button,
.graph-inline-controls button.button {
    width: 100%;
    min-height: 2.8rem;
    text-align: center;
}

.graph-stage.is-compact .graph-node-label {
    display: none;
}

.graph-stage.is-compact .graph-node.is-active .graph-node-label,
.graph-stage.is-compact .graph-node.is-neighbor .graph-node-label,
.graph-stage.is-compact .graph-node:focus-visible .graph-node-label {
    display: block;
    font-size: 0.72rem;
}

.graph-stage.is-compact .graph-hover-tooltip {
    display: none !important;
}

.graph-stage.is-compact .graph-selection-popover {
    max-height: calc(100% - 1.5rem);
    overflow: auto;
    padding-bottom: max(0.95rem, env(safe-area-inset-bottom));
}

@media (max-width: 640px) {
    .graph-toolbar-tools {
        padding-top: 0.75rem;
    }

    .graph-inline-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .graph-inline-controls .button,
    .graph-inline-controls button.button {
        min-height: 2.7rem;
        padding: 0.68rem 0.8rem;
        font-size: 0.82rem;
        letter-spacing: 0.01em;
    }

    .graph-toolbar-foot .small-text {
        line-height: 1.5;
    }

    .graph-detail-card,
    .graph-node-list {
        max-height: none;
    }
}


.graph-legend-swatch-cluster {
    border-style: solid;
    background: rgba(102, 95, 72, 0.92);
}

.graph-inline-controls .button:is(:hover, :focus-visible),
.graph-toolbar-tools .button:is(:hover, :focus-visible) {
    background: rgba(214, 177, 87, 0.14);
    border-color: rgba(214, 177, 87, 0.3);
}

.graph-stage .button,
.graph-selection-popover .button {
    accent-color: var(--accent);
}

@media (max-width: 640px) {
    .page-history-log {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
}
