:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-muted: #eef3f8;
    --text: #16202f;
    --muted: #5d6a7e;
    --border: #d6deea;
    --primary: #0f6fff;
    --primary-dark: #0d57c8;
    --success: #11795a;
    --warning: #ad6c00;
    --danger: #b22828;
    --navy: #0d1f35;
    --radius: 18px;
    --shadow: 0 14px 34px rgba(16, 31, 53, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
}

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

.narrow {
    width: min(760px, 100%);
}

.site-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
}

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

.brand {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--navy);
}

.desktop-nav {
    display: none;
    align-items: center;
    gap: 1rem;
}

.desktop-nav a,
.stack-nav a {
    font-weight: 600;
}

.menu-toggle {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 999px;
    padding: 0.7rem 1rem;
    font-weight: 700;
}

.mobile-nav {
    padding: 0 1rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.mobile-nav a,
.mobile-nav form {
    display: block;
    margin-top: 0.75rem;
}

.site-main {
    padding: 1rem 0 4rem;
}

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

.hero-grid,
.split-grid,
.dashboard-grid,
.card-grid,
.admin-shell {
    display: grid;
    gap: 1.25rem;
}

.hero-grid {
    align-items: center;
}

.eyebrow {
    display: inline-block;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

h1,
h2,
h3 {
    line-height: 1.2;
    margin-top: 0;
    color: var(--navy);
}

h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
}

.lead {
    font-size: 1.08rem;
    color: var(--muted);
}

.section {
    padding: 2rem 0;
}

.section-muted {
    background: linear-gradient(180deg, var(--surface-muted), rgba(238, 243, 248, 0.3));
}

.section-accent {
    background: linear-gradient(180deg, rgba(15, 111, 255, 0.08), rgba(15, 111, 255, 0.02));
}

.section-heading {
    margin-bottom: 1.25rem;
}

.content-card-list {
    display: grid;
    gap: 1rem;
}

.card,
.auth-card,
.dashboard-hero,
.hero-form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.button,
button,
input,
select,
textarea {
    font: inherit;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: 14px;
    padding: 0.9rem 1.2rem;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
}

.button-primary {
    background: var(--primary);
    color: #fff;
}

.button-primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.button-secondary {
    background: var(--surface);
    color: var(--navy);
    border-color: var(--border);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin: 1.25rem 0;
}

.center-row {
    justify-content: center;
}

.full-width {
    width: 100%;
}

.helper-line,
.small-note,
.muted-inline {
    color: var(--muted);
}

.stack-form {
    display: grid;
    gap: 0.9rem;
}

label {
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.95rem 1rem;
    background: #fff;
}

textarea {
    resize: vertical;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-weight: 600;
}

.checkbox-row input {
    width: auto;
    margin-top: 0.2rem;
}

.flash-stack {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.flash {
    padding: 1rem 1.1rem;
    border-radius: 14px;
    font-weight: 700;
}

.flash-success {
    background: rgba(17, 121, 90, 0.12);
    color: var(--success);
}

.flash-error {
    background: rgba(178, 40, 40, 0.1);
    color: var(--danger);
}

.flash-warning {
    background: rgba(173, 108, 0, 0.12);
    color: var(--warning);
}

.flash-debug {
    background: rgba(13, 31, 53, 0.1);
    color: var(--navy);
}

.site-popup-region {
    position: fixed;
    bottom: 1rem;
    z-index: 1200;
    display: grid;
    gap: 0.75rem;
    width: min(24rem, calc(100vw - 2rem));
    pointer-events: none;
}

.site-popup-region-status {
    right: 1rem;
}

.site-popup-region-debug {
    left: 1rem;
}

.site-popup {
    pointer-events: auto;
    border-radius: 14px;
    border: 1px solid transparent;
    box-shadow: 0 12px 28px rgba(13, 31, 53, 0.2);
    padding: 0.85rem 1rem;
    font-weight: 700;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.site-popup.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.site-popup.is-closing {
    opacity: 0;
    transform: translateY(8px);
}

.site-popup-message {
    white-space: pre-wrap;
    word-break: break-word;
}

.site-popup-success {
    background: #e8f9f0;
    border-color: #73c79f;
    color: #0a5a3f;
}

.site-popup-warning {
    background: #fff7d8;
    border-color: #e7c866;
    color: #6f5600;
}

.site-popup-error {
    background: #ffe4e2;
    border-color: #e69b98;
    color: #7f1b1b;
}

.site-popup-debug {
    background: #10253a;
    border-color: #264662;
    color: #edf4fc;
    font-weight: 600;
    padding: 0.8rem;
}

.site-popup-debug-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.site-popup-debug-title {
    font-size: 0.92rem;
    letter-spacing: 0.01em;
}

.site-popup-icon-button,
.site-popup-action-button {
    border: 1px solid rgba(237, 244, 252, 0.45);
    background: rgba(237, 244, 252, 0.1);
    color: inherit;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

.site-popup-icon-button {
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    line-height: 1;
}

.site-popup-action-button {
    padding: 0.35rem 0.7rem;
}

.site-popup-icon-button:hover,
.site-popup-action-button:hover {
    background: rgba(237, 244, 252, 0.2);
}

.site-popup-icon-button:disabled,
.site-popup-action-button:disabled {
    opacity: 0.75;
    cursor: default;
}

.site-popup-debug-content {
    margin: 0;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.85rem;
    line-height: 1.35;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.65rem;
}

.site-popup-debug-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.list-clean,
.signal-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.signal-list li,
.list-clean li {
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}

.signal-list li:last-child,
.list-clean li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-weight: 800;
}

.badge-real,
.badge-likely-real {
    background: rgba(17, 121, 90, 0.14);
    color: var(--success);
}

.badge-unclear {
    background: rgba(173, 108, 0, 0.12);
    color: var(--warning);
}

.badge-likely-fake,
.badge-fake {
    background: rgba(178, 40, 40, 0.12);
    color: var(--danger);
}

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

.result-score {
    text-align: right;
    display: grid;
    gap: 0.35rem;
}

.result-score strong,
.stat {
    font-size: 2rem;
    font-weight: 800;
}

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

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

.table th {
    color: var(--muted);
    font-size: 0.95rem;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 2rem 0 3rem;
}

.footer-grid {
    display: grid;
    gap: 1rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.honeypot {
    position: absolute;
    left: -9999px;
}

.admin-sidebar .stack-nav {
    display: grid;
    gap: 0.75rem;
}

.dashboard-layout {
    display: grid;
    gap: 1.25rem;
}

.dashboard-sidebar .stack-nav {
    display: grid;
    gap: 0.75rem;
}

.dashboard-content {
    min-width: 0;
}

.page-intro {
    margin-bottom: 1.25rem;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.9rem 0.7rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: 0.95rem;
}

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

.mini-stack {
    display: grid;
    gap: 0.85rem;
}

.signal-meta {
    display: block;
    color: var(--muted);
    font-size: 0.95rem;
}

.stack-nav {
    display: grid;
    gap: 0.65rem;
}

.stack-nav a {
    padding: 0.45rem 0;
}

.badge-misleading,
.badge-recycled-out-of-context,
.badge-under-community-dispute,
.badge-needs-expert-review {
    background: rgba(173, 108, 0, 0.12);
    color: var(--warning);
}

.badge-impersonation-suspected,
.badge-scam-pattern-match {
    background: rgba(178, 40, 40, 0.12);
    color: var(--danger);
}

code {
    background: rgba(15, 31, 53, 0.06);
    border-radius: 8px;
    padding: 0.15rem 0.35rem;
}

.auth-shell {
    min-height: calc(100vh - 160px);
}

.auth-card-wrap {
    width: min(560px, calc(100% - 2rem));
    margin: 0 auto;
}

.auth-links {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.center {
    text-align: center;
}

.inline-form {
    display: inline;
}

.disclaimer {
    color: var(--muted);
    margin-top: 1.5rem;
}

.home-launch-hero {
    padding-bottom: 2rem;
}

.launch-hero-grid,
.launch-path-grid,
.launch-action-grid {
    display: grid;
    gap: 1.25rem;
}

.launch-panel {
    display: grid;
    gap: 1rem;
    background: linear-gradient(180deg, rgba(15, 111, 255, 0.06), #fff);
}

.launch-step-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 1rem;
}

.launch-step-list li {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}

.launch-step-list p {
    margin: 0.3rem 0 0;
    color: var(--muted);
}

.step-pill {
    min-width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    background: rgba(15, 111, 255, 0.16);
    color: var(--primary-dark);
}

.launch-path-card,
.launch-action-card {
    display: grid;
    gap: 0.8rem;
    align-content: start;
}

.launch-path-card p,
.launch-action-card p {
    color: var(--muted);
    margin: 0;
}

.launch-action-card .button {
    width: fit-content;
}

.launch-cta {
    text-align: center;
}

.member-ui .site-main {
    padding: 0.5rem 0 1.5rem;
}

.member-ui .header-inner {
    min-height: 62px;
}

.member-ui .section {
    padding: 0.9rem 0;
}

.member-ui h1 {
    font-size: clamp(1.45rem, 2.6vw, 2rem);
    margin-bottom: 0.45rem;
}

.member-ui h2 {
    font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.member-ui .lead {
    font-size: 0.98rem;
    margin: 0.2rem 0 0.55rem;
}

.member-ui .card,
.member-ui .dashboard-hero,
.member-ui .hero-form-card {
    padding: 0.95rem;
    border-radius: 14px;
}

.member-ui .button {
    padding: 0.72rem 0.95rem;
    border-radius: 12px;
}

.member-ui .button-primary {
    box-shadow: 0 8px 20px rgba(15, 111, 255, 0.24);
}

.member-ui .button-primary:hover {
    box-shadow: 0 10px 24px rgba(13, 87, 200, 0.26);
}

.member-ui .button-row {
    margin: 0.75rem 0;
    gap: 0.6rem;
}

.member-ui .small-note {
    font-size: 0.9rem;
}

.workspace-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.45rem;
}

.workspace-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.workspace-nav a {
    font-weight: 700;
    color: var(--navy);
    border: 1px solid var(--border);
    background: var(--surface-muted);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    line-height: 1.2;
}

.workspace-nav a:hover {
    text-decoration: none;
    border-color: var(--primary);
}

.workspace-nav a.is-active {
    background: rgba(15, 111, 255, 0.12);
    border-color: rgba(15, 111, 255, 0.45);
    color: var(--primary-dark);
}

.member-overview {
    align-items: center;
}

.member-quick-actions {
    margin: 0;
}

.quick-stats {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.stat-tile {
    display: grid;
    gap: 0.15rem;
    align-content: center;
}

.stat-lite {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.1;
}

.member-panels {
    display: grid;
    gap: 0.75rem;
}

.focus-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.55rem 0 0.9rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.focus-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.38rem 0.72rem;
    background: var(--surface);
    color: var(--navy);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.focus-chip:hover {
    text-decoration: none;
    border-color: var(--primary);
}

.focus-chip.is-active {
    background: rgba(15, 111, 255, 0.12);
    border-color: rgba(15, 111, 255, 0.45);
    color: var(--primary-dark);
}

.focus-stack {
    display: grid;
    gap: 0.75rem;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.22rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.76rem;
    line-height: 1.1;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}

.chip.badge-real,
.chip.badge-likely-real {
    border-color: rgba(17, 121, 90, 0.24);
}

.chip.badge-unclear,
.chip.badge-misleading,
.chip.badge-recycled-out-of-context,
.chip.badge-under-community-dispute,
.chip.badge-needs-expert-review {
    border-color: rgba(173, 108, 0, 0.24);
}

.chip.badge-likely-fake,
.chip.badge-fake,
.chip.badge-impersonation-suspected,
.chip.badge-scam-pattern-match {
    border-color: rgba(178, 40, 40, 0.24);
}

.status-neutral {
    background: rgba(15, 31, 53, 0.07);
    color: var(--navy);
    border-color: rgba(15, 31, 53, 0.18);
}

.status-pending {
    background: rgba(173, 108, 0, 0.12);
    color: var(--warning);
    border-color: rgba(173, 108, 0, 0.28);
}

.status-good {
    background: rgba(17, 121, 90, 0.14);
    color: var(--success);
    border-color: rgba(17, 121, 90, 0.3);
}

.status-bad {
    background: rgba(178, 40, 40, 0.12);
    color: var(--danger);
    border-color: rgba(178, 40, 40, 0.28);
}

.table td .chip {
    vertical-align: middle;
}

.compact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.compact-list li {
    display: grid;
    gap: 0.12rem;
    padding: 0.35rem 0 0.5rem;
    border-bottom: 1px solid var(--border);
}

.compact-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.member-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(15, 31, 53, 0.08);
    padding-bottom: 0.55rem;
}

.check-type-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.7rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.check-type-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.38rem 0.72rem;
    color: var(--navy);
    font-weight: 700;
    line-height: 1.2;
    background: var(--surface-muted);
}

.check-type-nav a:hover {
    text-decoration: none;
    border-color: var(--primary);
}

.check-type-nav a.is-active {
    background: rgba(15, 111, 255, 0.12);
    border-color: rgba(15, 111, 255, 0.45);
    color: var(--primary-dark);
}

.field-grid-2 {
    display: grid;
    gap: 0.7rem;
}

.compact-form {
    gap: 0.68rem;
}

.inline-details {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.55rem 0.7rem;
    background: rgba(238, 243, 248, 0.45);
}

.inline-details summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--navy);
}

.inline-details[open] {
    background: rgba(238, 243, 248, 0.72);
}

.details-body {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.6rem;
}

.compact-table-wrap {
    max-height: min(56vh, 480px);
    overflow: auto;
}

.member-ui .site-footer {
    padding: 1rem 0 1.5rem;
}

@media (max-width: 767px) {
    .site-popup-region {
        width: min(20rem, calc(100vw - 2rem));
    }

    .site-popup-region-status {
        bottom: 8.25rem;
    }
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
    }

    .menu-toggle,
    .mobile-nav {
        display: none;
    }

    .hero-grid,
    .split-grid {
        grid-template-columns: 1.2fr 0.8fr;
    }

    .launch-hero-grid {
        grid-template-columns: 1.2fr 0.8fr;
    }

    .launch-hero-grid-single {
        grid-template-columns: minmax(0, 1fr);
    }

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

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

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

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

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

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

    .member-ui .dashboard-layout {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .footer-grid,
    .admin-shell,
    .dashboard-layout {
        grid-template-columns: 280px minmax(0, 1fr);
    }
}
