.app-shell {
    --sidebar-width: 252px;
    min-height: 100vh;
    margin: 0;
    background: #f3f6f8;
    color: #17212b;
}

.app-shell.sidebar-open {
    overflow: hidden;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    padding: 28px 18px 20px;
    background: #0b1220;
    color: #fff;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 8px 36px;
    font-size: 1.08rem;
    font-weight: 800;
}

.radar-mark {
    position: relative;
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid color-mix(in srgb, var(--brand) 65%, transparent);
    border-radius: 50%;
}

.radar-mark::before,
.radar-mark::after {
    position: absolute;
    content: "";
    border: 1px solid color-mix(in srgb, var(--brand) 52%, transparent);
    border-radius: 50%;
}

.radar-mark::before {
    width: 20px;
    height: 20px;
}

.radar-mark::after {
    width: 9px;
    height: 9px;
}

.radar-mark i {
    position: absolute;
    top: 5px;
    left: 50%;
    width: 2px;
    height: 11px;
    background: var(--brand);
    border-radius: 2px;
    transform: rotate(38deg);
    transform-origin: 50% 11px;
}

.app-nav {
    display: grid;
    gap: 7px;
}

.app-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 13px;
    border-radius: 10px;
    color: #aeb9ca;
    font-weight: 650;
    text-decoration: none;
    transition: background .16s ease, color .16s ease;
}

.app-nav a:hover,
.app-nav a:focus-visible {
    background: #141e2f;
    color: #fff;
}

.app-nav a.is-active {
    background: color-mix(in srgb, var(--brand) 15%, #101a2a);
    color: #fff;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border: 1px solid currentColor;
    border-radius: 50%;
}

.is-active .nav-dot {
    border-color: var(--brand);
    background: var(--brand);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent);
}

.sidebar-trust {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding: 13px;
    border: 1px solid #263145;
    border-radius: 10px;
    color: #aeb9ca;
    font-size: .78rem;
    line-height: 1.35;
}

.status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent);
}

.app-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    min-height: 72px;
    align-items: center;
    gap: 16px;
    padding: 0 clamp(20px, 4vw, 54px);
    border-bottom: 1px solid #e0e6ea;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(14px);
}

.topbar-title {
    font-weight: 800;
}

.profile-menu {
    position: relative;
    margin-left: auto;
}

.profile-menu summary {
    display: flex;
    cursor: pointer;
    list-style: none;
    align-items: center;
    gap: 9px;
    font-size: .88rem;
    font-weight: 700;
}

.profile-menu summary::-webkit-details-marker {
    display: none;
}

.avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #dffbef;
    color: #08764b;
}

.profile-popover {
    position: absolute;
    top: 45px;
    right: 0;
    display: grid;
    min-width: 230px;
    gap: 8px;
    padding: 14px;
    border: 1px solid #dfe5e8;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 48px rgba(11, 18, 32, .14);
}

.profile-popover span {
    overflow: hidden;
    color: #627083;
    font-size: .78rem;
    text-overflow: ellipsis;
}

.profile-popover a,
.link-button {
    border: 0;
    background: none;
    color: #17212b;
    font: inherit;
    font-size: .88rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.app-content {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 40px 0 64px;
}

.app-footer {
    display: flex;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    gap: 18px;
    padding: 18px 0 26px;
    border-top: 1px solid #dfe5e8;
    color: #6b7787;
    font-size: .78rem;
}

.app-footer span {
    margin-right: auto;
}

.app-footer a {
    color: inherit;
}

.sidebar-toggle {
    display: none;
    border: 0;
    background: transparent;
    color: #17212b;
    font-size: 1.4rem;
}

.sidebar-close {
    display: none;
}

.page-heading,
.site-context,
.progress-strip,
.section-heading,
.metric-grid,
.action-list,
.site-grid,
.settings-grid {
    margin-bottom: 24px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.page-heading h1,
.empty-state h1 {
    max-width: 780px;
    margin: 5px 0 8px;
    font-size: clamp(1.65rem, 4vw, 2.5rem);
    line-height: 1.1;
    letter-spacing: -.035em;
}

.page-heading p,
.empty-state p {
    margin: 0;
    color: #627083;
}

.eyebrow {
    color: #08764b;
    font-size: .75rem;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.panel-card {
    border: 1px solid #e0e6ea;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(11, 18, 32, .035);
}

.site-context {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 17px;
}

.site-context strong {
    display: block;
    margin-bottom: 2px;
}

.site-context small {
    color: #6b7787;
}

.site-context .button {
    margin-left: auto;
}

.site-switcher {
    margin-left: auto;
}

.site-switcher select {
    min-height: 38px;
    max-width: 260px;
    padding: 7px 32px 7px 10px;
    border: 1px solid #cfd7dc;
    border-radius: 8px;
    background: #fff;
    color: #17212b;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.muted {
    color: #627083;
}

.progress-strip {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px 20px;
    padding: 18px 20px;
}

.progress-track {
    grid-column: 1 / -1;
    height: 7px;
    overflow: hidden;
    border-radius: 10px;
    background: #e8edf0;
}

.progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
}

.progress-track [data-progress="0"] { width: 0; }
.progress-track [data-progress="1"] { width: 33.333%; }
.progress-track [data-progress="2"] { width: 66.666%; }
.progress-track [data-progress="3"] { width: 100%; }

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.35rem;
}

.section-heading p {
    margin: 4px 0 0;
    color: #6b7787;
    font-size: .86rem;
}

.action-list {
    display: grid;
    gap: 16px;
}

.action-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 17px 28px;
    overflow: hidden;
    padding: 23px;
}

.action-card::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--brand);
    content: "";
}

.action-card.impact-attention::before {
    background: #f5a524;
}

.action-card.is-exploratory::before {
    background: #4f79d8;
}

.action-meta,
.action-evidence,
.action-buttons,
.metric-delta,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.action-card h3 {
    margin: 8px 0 9px;
    font-size: 1.16rem;
}

.action-card p {
    max-width: 760px;
    margin: 0;
    color: #586777;
    line-height: 1.55;
}

.action-side {
    min-width: 155px;
    text-align: right;
}

.action-side strong {
    display: block;
    margin-bottom: 4px;
    font-size: 1.05rem;
}

.action-side small {
    color: #6b7787;
}

.action-buttons {
    grid-column: 1 / -1;
    padding-top: 3px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #e9f9f2;
    color: #08764b;
    font-size: .72rem;
    font-weight: 800;
}

.badge.warning {
    background: #fff4dc;
    color: #8e5b00;
}

.badge.experiment {
    background: #eaf0ff;
    color: #315da8;
}

.badge.neutral {
    background: #eef2f4;
    color: #52606f;
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid #cfd7dc;
    border-radius: 9px;
    background: #fff;
    color: #17212b;
    font: inherit;
    font-size: .86rem;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.button:hover,
.button:focus-visible {
    border-color: #8796a5;
}

.button-primary {
    border-color: #22b875;
    background: var(--brand);
    color: var(--brand-contrast, #071810);
}

.button-danger {
    border-color: #f0b4b4;
    color: #b42318;
}

.destructive-menu {
    font-size: .82rem;
}

.destructive-menu summary {
    color: #a43a3a;
    cursor: pointer;
}

.destructive-menu form,
.destructive-confirm {
    display: grid;
    gap: 8px;
}

.destructive-menu form {
    margin-top: 10px;
}

.destructive-confirm {
    grid-template-columns: auto 1fr;
    align-items: start;
    max-width: 260px;
    color: #596673;
    font-size: .76rem;
    line-height: 1.35;
}

.button-small {
    min-height: 34px;
    padding: 7px 11px;
    font-size: .78rem;
}

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

.metric-card {
    padding: 18px;
}

.metric-card small {
    display: block;
    margin-bottom: 10px;
    color: #6b7787;
}

.metric-card strong {
    display: block;
    margin-bottom: 7px;
    font-size: 1.55rem;
}

.metric-delta {
    color: #147a50;
    font-size: .78rem;
}

.metric-delta.down {
    color: #bd2c2c;
}

.metric-delta.neutral {
    color: #6b7787;
}

.empty-state {
    padding: clamp(30px, 6vw, 64px);
    text-align: center;
}

.empty-state p {
    max-width: 620px;
    margin: 0 auto 24px;
    line-height: 1.6;
}

.flash {
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid #c7e9d9;
    border-radius: 10px;
    background: #ecfbf4;
    color: #0d6845;
}

.flash-error {
    border-color: #f2c4c4;
    background: #fff2f2;
    color: #a92121;
}

.flash-warning {
    border-color: #f1dab0;
    background: #fff8e8;
    color: #80530a;
}

.site-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.site-card {
    display: grid;
    gap: 13px;
    padding: 20px;
}

.site-card h2 {
    overflow-wrap: anywhere;
    margin: 0;
    font-size: 1.04rem;
}

.site-card p {
    margin: 0;
    color: #627083;
    font-size: .85rem;
}

.site-card footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.site-card footer .button:first-child {
    margin-right: auto;
}

.form-card {
    padding: clamp(22px, 4vw, 34px);
}

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

.form-field {
    display: grid;
    gap: 7px;
}

.form-field.full {
    grid-column: 1 / -1;
}

.form-field label,
.form-field > span {
    font-size: .82rem;
    font-weight: 750;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 45px;
    padding: 10px 12px;
    border: 1px solid #cfd7dc;
    border-radius: 9px;
    background: #fff;
    color: #17212b;
    font: inherit;
}

.form-field textarea {
    min-height: 110px;
    resize: vertical;
}

.form-help {
    color: #6b7787;
    font-size: .76rem;
    line-height: 1.45;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(240px, .7fr);
    gap: 20px;
}

.detail-section {
    padding: 24px;
}

.detail-section h2 {
    margin: 0 0 13px;
    font-size: 1.1rem;
}

.detail-section p,
.detail-section li {
    color: #52606f;
    line-height: 1.6;
}

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

.evidence-table th,
.evidence-table td {
    padding: 11px 8px;
    border-bottom: 1px solid #e6ebee;
    text-align: left;
    vertical-align: top;
}

.evidence-table th {
    color: #667384;
    font-size: .78rem;
}

.copy-box {
    position: relative;
    padding: 14px;
    border: 1px dashed #bdc8cf;
    border-radius: 9px;
    background: #f8fafb;
}

.detail-main {
    display: grid;
    gap: 20px;
}

.action-stack {
    display: grid;
    gap: 9px;
    margin-top: 18px;
}

.action-stack .button {
    width: 100%;
}

.filter-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 22px;
    overflow-x: auto;
    padding: 4px;
    border: 1px solid #dfe5e8;
    border-radius: 11px;
    background: #fff;
}

.filter-tabs a {
    flex: 0 0 auto;
    padding: 9px 13px;
    border-radius: 8px;
    color: #5c6978;
    font-size: .82rem;
    font-weight: 750;
    text-decoration: none;
}

.filter-tabs a.is-active {
    background: #0b1220;
    color: #fff;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
    gap: 18px;
}

.form-card h2 {
    margin: 7px 0 18px;
}

.check-list {
    display: grid;
    gap: 11px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.check-list li {
    position: relative;
    padding-left: 25px;
    color: #52606f;
}

.check-list li::before {
    position: absolute;
    top: 3px;
    left: 0;
    display: grid;
    width: 16px;
    height: 16px;
    place-items: center;
    border-radius: 50%;
    content: "";
}

.check-list .is-ok::before {
    background: #32d583;
    box-shadow: inset 0 0 0 5px #dff8eb;
}

.check-list .is-pending::before {
    background: #f5a524;
    box-shadow: inset 0 0 0 5px #fff0d0;
}

.inline-notice {
    padding: 12px 14px;
    border: 1px solid #f1dab0;
    border-radius: 9px;
    background: #fff8e8;
    color: #80530a;
    font-size: .82rem;
    line-height: 1.5;
}

.learning-notice {
    margin-bottom: 22px;
    padding: 17px 19px;
}

.learning-notice p {
    margin: 7px 0 0;
}

.connection-list {
    display: grid;
    gap: 10px;
}

.connection-list article {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 14px 0;
    border-top: 1px solid #e6ebee;
}

.connection-list article > div {
    display: grid;
    gap: 4px;
    margin-right: auto;
}

.connection-list small {
    color: #6b7787;
}

@media (max-width: 800px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 580px) {
    .connection-list article {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .connection-list article > div {
        width: 100%;
    }
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(4, 9, 17, .55);
}

@media (max-width: 980px) {
    .app-sidebar {
        visibility: hidden;
        transform: translateX(-102%);
        transition: transform .2s ease, visibility 0s linear .2s;
    }

    .app-sidebar.is-open {
        visibility: visible;
        transform: translateX(0);
        transition-delay: 0s;
    }

    .app-main {
        margin-left: 0;
    }

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

    .sidebar-close {
        position: absolute;
        top: 14px;
        right: 14px;
        display: inline-grid;
        width: 36px;
        height: 36px;
        border: 1px solid rgba(255, 255, 255, .2);
        border-radius: 10px;
        background: transparent;
        color: #fff;
        cursor: pointer;
        font-size: 1.4rem;
        place-items: center;
    }

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

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

@media (max-width: 680px) {
    .app-content,
    .app-footer {
        width: min(100% - 28px, 1180px);
    }

    .app-content {
        padding-top: 26px;
    }

    .profile-name {
        display: none;
    }

    .page-heading,
    .site-context,
    .section-heading,
    .app-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-context .button {
        margin-left: 0;
    }

    .site-switcher {
        width: 100%;
        margin-left: 0;
    }

    .site-switcher select {
        width: 100%;
        max-width: none;
    }

    .action-card,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .action-side {
        text-align: left;
    }

    .action-buttons {
        grid-column: 1;
    }

    .metric-grid,
    .site-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-field.full {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar,
    .app-nav a {
        transition: none;
    }
}

.auth-page {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 18% 12%, rgba(50, 213, 131, .14), transparent 25rem),
        #0b1220;
    color: #17212b;
}

.auth-wrap {
    display: grid;
    width: min(480px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    align-content: center;
    gap: 20px;
    padding: 40px 0;
}

.auth-wrap-wide {
    width: min(680px, calc(100% - 32px));
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    font-weight: 850;
    text-decoration: none;
}

.auth-card {
    padding: clamp(25px, 6vw, 42px);
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
}

.auth-card h1 {
    margin: 7px 0 8px;
    font-size: clamp(1.7rem, 5vw, 2.25rem);
    letter-spacing: -.035em;
}

.auth-card > p {
    margin: 0 0 24px;
    color: #627083;
    line-height: 1.5;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-submit {
    width: 100%;
    min-height: 47px;
}

.auth-switch {
    margin: 22px 0 0 !important;
    color: #627083;
    font-size: .86rem;
    text-align: center;
}

.auth-switch a {
    color: #08764b;
    font-weight: 750;
}

.auth-trust {
    margin: 0;
    color: #9dabbc;
    font-size: .78rem;
    text-align: center;
}

.check-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #52606f;
    font-size: .82rem;
    line-height: 1.5;
}

.check-field input {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: #22b875;
}

.form-grid > .full {
    grid-column: 1 / -1;
}

.property-list {
    display: grid;
    gap: 12px;
}

.property-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px;
    cursor: pointer;
}

.property-option > input {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    accent-color: #22b875;
}

.property-main {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.property-main strong,
.property-main small {
    overflow: hidden;
    text-overflow: ellipsis;
}

.property-main small,
.property-meta small {
    color: #6b7787;
    font-size: .76rem;
}

.property-meta {
    display: grid;
    justify-items: end;
    gap: 4px;
    margin-left: auto;
}

.property-option.is-disabled {
    cursor: not-allowed;
    opacity: .58;
}

@media (max-width: 680px) {
    .form-grid > .full {
        grid-column: auto;
    }

    .property-option {
        align-items: flex-start;
    }

    .property-meta {
        display: none;
    }
}
