.site-updater {
    color: #202925;
    background: #edf0ee;
}

.site-updater .container {
    max-width: 1380px;
    gap: 0;
    padding: 22px;
    border-radius: 6px;
    box-shadow: 0 12px 32px rgba(31, 42, 37, 0.08);
}

.site-updater .header-row {
    order: 0;
    padding: 0 0 18px;
    border-bottom: 0;
}

.admin-eyebrow,
.admin-login-eyebrow {
    margin: 0 0 5px;
    color: #477262;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
}

.admin-header-note {
    margin: 5px 0 0;
    color: #738078;
    font-size: 13px;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-session {
    color: #53625b;
    font-size: 12px;
}

.site-updater .btn-config,
.site-updater .btn-admin-logout {
    min-height: 38px;
    border-radius: 5px;
}

.admin-nav {
    order: 1;
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    gap: 3px;
    padding: 6px;
    margin: 0 0 14px;
    overflow-x: auto;
    border: 1px solid #dfe5e1;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 5px 18px rgba(28, 38, 33, 0.06);
    scrollbar-width: none;
}

.admin-nav::-webkit-scrollbar { display: none; }

.admin-nav button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 9px 13px;
    border: 0;
    border-radius: 4px;
    color: #46544e;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
}

.admin-nav button:hover,
.admin-nav button:focus-visible,
.admin-nav button.is-active {
    color: #fff;
    background: #315f50;
    outline: 0;
}

.site-updater [hidden] {
    display: none !important;
}

.admin-summary {
    order: 2;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.admin-summary > div {
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid #dfe5e1;
    border-left: 3px solid #477262;
    border-radius: 5px;
    background: #fff;
}

.admin-summary span {
    display: block;
    margin-bottom: 7px;
    color: #738078;
    font-size: 12px;
}

.admin-summary strong {
    display: block;
    overflow: hidden;
    color: #202925;
    font-size: 22px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-dashboard {
    order: 2;
    min-width: 0;
    margin-bottom: 14px;
}

.dashboard-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    margin-bottom: 12px;
    border: 1px solid #dbe3de;
    border-radius: 6px;
    background: linear-gradient(115deg, #ffffff 0%, #f1f6f3 72%, #eef4f8 100%);
}

.dashboard-kicker {
    margin: 0 0 5px !important;
    color: #477262 !important;
    font-size: 10px !important;
    font-weight: 800;
}

.dashboard-intro h3 {
    margin: 0;
    color: #202925;
    font-size: 21px;
    line-height: 1.25;
}

.dashboard-intro p:not(.dashboard-kicker) {
    margin: 6px 0 0;
    color: #68766f;
    font-size: 13px;
}

.dashboard-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-server-time {
    color: #718079;
    font-size: 11px;
}

.site-updater .btn-dashboard-refresh,
.dashboard-panel-head > button,
.dashboard-subhead button {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid #ccd8d1;
    color: #315f50;
    background: #fff;
    font-size: 12px;
}

.site-updater .btn-dashboard-refresh:hover,
.dashboard-panel-head > button:hover,
.dashboard-subhead button:hover {
    border-color: #477262;
    background: #edf4f0;
}

.admin-dashboard .admin-summary {
    margin-bottom: 12px;
}

.admin-dashboard .admin-summary > div {
    position: relative;
    overflow: hidden;
    border-left-width: 1px;
}

.admin-dashboard .admin-summary > div::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #477262;
    content: "";
}

.admin-dashboard .admin-summary > div:nth-child(2)::before { background: #c58a23; }
.admin-dashboard .admin-summary > div:nth-child(3)::before { background: #326fa8; }
.admin-dashboard .admin-summary > div:nth-child(4)::before { background: #7a5a94; }

.admin-summary small {
    display: block;
    margin-top: 6px;
    overflow: hidden;
    color: #8a958f;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-summary .summary-task {
    font-size: 16px;
    line-height: 1.35;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
    gap: 12px;
    margin-bottom: 12px;
}

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

.dashboard-panel {
    min-width: 0;
    padding: 16px;
    border: 1px solid #dfe5e1;
    border-radius: 6px;
    background: #fff;
}

.dashboard-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 13px;
}

.dashboard-panel h4 {
    margin: 0;
    color: #202925;
    font-size: 15px;
}

.dashboard-panel-head p {
    margin: 5px 0 0;
    color: #7a8780;
    font-size: 11px;
    line-height: 1.5;
}

.dashboard-cycle,
.dashboard-run-badge {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 4px;
    color: #315f50;
    background: #e9f2ed;
    font-size: 10px;
    font-weight: 800;
}

.dashboard-run-badge.is-running {
    color: #825a0c;
    background: #fff2d7;
}

.dashboard-freshness-bar {
    height: 5px;
    margin-bottom: 6px;
    overflow: hidden;
    border-radius: 3px;
    background: #edf0ee;
}

.dashboard-freshness-bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #3d8168;
    transition: width .35s ease;
}

.dashboard-source-row {
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr) minmax(118px, auto);
    align-items: center;
    gap: 10px;
    padding: 10px 2px;
    border-bottom: 1px solid #edf0ee;
}

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

.dashboard-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9aa49f;
}

.dashboard-status-dot.status-fresh { background: #2f855a; }
.dashboard-status-dot.status-due { background: #d39a2f; }
.dashboard-status-dot.status-stale { background: #c54848; }
.dashboard-status-dot.status-never { background: #7c8791; }

.dashboard-source-name,
.dashboard-source-due {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.dashboard-source-name strong {
    overflow: hidden;
    color: #2d3732;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-source-name small,
.dashboard-source-due small {
    overflow: hidden;
    color: #8a958f;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-source-due { justify-items: end; }

.source-status {
    color: #66736c;
    font-size: 10px;
    font-weight: 800;
}

.source-status.status-fresh { color: #237448; }
.source-status.status-due { color: #946515; }
.source-status.status-stale { color: #ae3535; }

.dashboard-run-facts {
    display: grid;
    gap: 0;
    margin: 0 0 12px;
}

.dashboard-run-facts > div {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #edf0ee;
}

.dashboard-run-facts dt {
    color: #7b8781;
    font-size: 11px;
}

.dashboard-run-facts dd {
    min-width: 0;
    margin: 0;
    color: #303b36;
    font-size: 11px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.dashboard-run-facts .result-error { color: #ae3535; }
.dashboard-run-facts .result-success { color: #237448; }

.dashboard-inventory {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 13px 0;
}

.dashboard-inventory > div {
    display: grid;
    gap: 3px;
    padding: 10px;
    border-left: 3px solid #3977a9;
    background: #f5f8fa;
}

.dashboard-inventory > div:nth-child(2) { border-left-color: #7a5a94; }
.dashboard-inventory span { color: #66736c; font-size: 10px; }
.dashboard-inventory strong { color: #24302a; font-size: 19px; }
.dashboard-inventory small { color: #89938e; font-size: 9px; }

.dashboard-subhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 2px;
    margin-bottom: 5px;
    color: #3c4741;
    font-size: 11px;
    font-weight: 800;
}

.dashboard-subhead button {
    min-height: 28px;
    padding: 4px 7px;
    border-color: transparent;
}

.dashboard-error-item {
    overflow: hidden;
    padding: 7px 0;
    border-bottom: 1px solid #f0e5e5;
    color: #8d4141;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-error-item:last-child { border-bottom: 0; }

.dashboard-activity-item {
    padding: 10px 2px;
    border-bottom: 1px solid #edf0ee;
}

.dashboard-activity-item:last-child { border-bottom: 0; }

.dashboard-activity-item > div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.dashboard-activity-item strong {
    min-width: 0;
    overflow: hidden;
    color: #2d3732;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-activity-item span {
    flex: 0 0 auto;
    color: #376f91;
    font-size: 9px;
    font-weight: 800;
}

.dashboard-activity-item .change-added { color: #237448; }
.dashboard-activity-item .change-removed { color: #ae3535; }

.dashboard-activity-item p {
    display: -webkit-box;
    margin: 5px 0;
    overflow: hidden;
    color: #5f6c65;
    font-size: 11px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.dashboard-activity-item time {
    color: #929b96;
    font-size: 9px;
}

.dashboard-empty {
    padding: 18px 4px;
    color: #8a958f;
    font-size: 11px;
    text-align: center;
}

.dashboard-empty-good { color: #39775b; }

#adminFeedback { order: 3; }
#adminCollection { order: 4; }
.admin-run-status { order: 5; }
#adminMaintenance { order: 6; }
#adminMaintenance + .merge-panel,
#adminMaintenance + .merge-panel + .merge-panel { order: 7; }
#adminAppearance { order: 8; }
#adminLogCard { order: 9; }

.site-updater .panel,
.site-updater .merge-panel,
.site-updater .log-card,
.site-updater .theme-panel,
.admin-run-status {
    border: 1px solid #dfe5e1;
    border-radius: 6px;
    background: #fff;
}

.site-updater .panel,
.site-updater .merge-panel,
.site-updater .log-card,
.admin-run-status {
    padding: 16px;
}

.site-updater .panel-grid {
    gap: 10px;
}

.site-updater .panel-title,
.site-updater .merge-title,
.site-updater .log-title {
    color: #202925;
    font-size: 16px;
}

.site-updater .header-row h2::after {
    content: "";
    display: block;
    width: 54px;
    height: 3px;
    margin-top: 9px;
    border-radius: 2px;
    background: var(--site-accent, #315f50);
}

.site-updater .panel-title,
.site-updater .merge-title,
.site-updater .log-title,
.site-updater .theme-panel-title,
.site-updater .merge-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.35;
}

.site-updater .panel-title::before,
.site-updater .merge-title::before,
.site-updater .log-title::before,
.site-updater .theme-panel-title::before,
.site-updater .merge-card-title::before {
    content: "";
    flex: 0 0 3px;
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: var(--site-accent, #315f50);
}

.site-updater .merge-card-title::before {
    height: 14px;
}

.site-updater .merge-card {
    padding: 12px 0;
    border: 0;
    border-top: 1px solid #e7ebe8;
    border-radius: 0;
    background: transparent;
}

.site-updater .merge-card:first-child { border-top: 0; }
.site-updater .merge-workspace { gap: 22px; }
.site-updater button { border-radius: 5px; }

.admin-run-status {
    margin-bottom: 14px;
}

.admin-run-status .status-line {
    margin-top: 0;
}

.admin-run-status .progress-wrap {
    margin-bottom: 0;
}

.feedback-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0 14px;
    border-top: 1px solid #e7ebe8;
}

.feedback-tabs {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.feedback-tabs button {
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid #d8dfdb;
    color: #526059;
    background: #f7f9f8;
}

.feedback-tabs button.is-active {
    color: #fff;
    border-color: #315f50;
    background: #315f50;
}

.feedback-search {
    display: grid;
    width: min(360px, 100%);
    gap: 5px;
    color: #66736c;
    font-size: 11px;
}

.feedback-search input {
    box-sizing: border-box;
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #d5ddd8;
    border-radius: 5px;
    color: #202925;
    background: #fff;
    font: inherit;
}

.admin-review-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
    border-top: 1px solid #e7ebe8;
}

.admin-review-column {
    padding-top: 14px;
}

.admin-feedback-column {
    padding-right: 14px;
    border-right: 1px solid #e7ebe8;
}

.admin-review-scroll {
    max-height: 620px;
    border-top: 0;
}

.admin-review-row {
    padding: 14px 4px;
}

.admin-review-row-head strong {
    font-size: 14px;
}

.feedback-details {
    display: grid;
    gap: 8px;
    margin: 11px 0 0;
}

.feedback-details > div {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
}

.feedback-details dt {
    color: #75817b;
    font-size: 12px;
}

.feedback-details dd {
    min-width: 0;
    margin: 0;
    color: #303b36;
    font-size: 13px;
    line-height: 1.65;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.feedback-details a {
    color: #245c9b;
}

.feedback-record-id {
    color: #8a948f;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
}

.admin-review-actions {
    justify-content: flex-end;
}

.admin-login-page {
    min-height: 100vh;
    padding: 0;
    background: #e9eeeb;
}

.admin-login-shell {
    box-sizing: border-box;
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.admin-login-panel {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    width: min(520px, 100%);
    gap: 18px;
    padding: 26px;
    border: 1px solid #d5ddd8;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(35, 48, 42, 0.12);
}

.admin-login-mark {
    display: grid;
    width: 54px;
    height: 54px;
    border-radius: 6px;
    place-items: center;
    color: #fff;
    background: #315f50;
    font-size: 23px;
    font-weight: 800;
}

.admin-login-copy h1 {
    margin: 0;
    color: #202925;
    font-size: 25px;
}

.admin-login-copy p:last-child {
    margin: 7px 0 0;
    color: #66736c;
    font-size: 13px;
    line-height: 1.7;
}

.admin-login-form {
    grid-column: 1 / -1;
    display: grid;
    gap: 7px;
    padding-top: 18px;
    border-top: 1px solid #e7ebe8;
}

.admin-login-form label {
    color: #48564f;
    font-size: 13px;
    font-weight: 700;
}

.admin-password-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 86px;
    gap: 8px;
}

.admin-password-row input,
.admin-password-row button {
    box-sizing: border-box;
    min-height: 46px;
    border-radius: 5px;
    font: inherit;
}

.admin-password-row input {
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid #cbd5cf;
    font-size: 16px;
}

.admin-password-row button {
    border: 0;
    color: #fff;
    background: #315f50;
    font-weight: 800;
    cursor: pointer;
}

.admin-login-message {
    min-height: 20px;
    margin: 0;
    color: #a43232;
    font-size: 12px;
}

@media (max-width: 820px) {
    .site-updater .container {
        padding: 12px;
    }

    .site-updater .header-row {
        display: grid;
        gap: 12px;
    }

    .admin-header-actions {
        justify-content: flex-start;
    }

    .admin-session {
        width: 100%;
    }

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

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

    .feedback-toolbar {
        display: grid;
        align-items: stretch;
    }

    .feedback-search {
        width: 100%;
    }

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

    .admin-feedback-column {
        padding-right: 0;
        border-right: 0;
        border-bottom: 1px solid #e7ebe8;
    }
}

@media (max-width: 520px) {
    .admin-nav {
        margin-right: -12px;
        margin-left: -12px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .admin-summary > div {
        padding: 12px;
    }

    .dashboard-intro {
        display: grid;
        align-items: start;
        padding: 15px;
    }

    .dashboard-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        justify-content: stretch;
    }

    .dashboard-server-time {
        align-self: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dashboard-panel {
        padding: 13px;
    }

    .dashboard-panel-head p {
        max-width: 240px;
    }

    .dashboard-source-row {
        grid-template-columns: 9px minmax(0, 1fr) 86px;
        gap: 8px;
    }

    .dashboard-source-name strong {
        white-space: normal;
    }

    .dashboard-source-due small {
        max-width: 86px;
    }

    .dashboard-run-facts > div {
        grid-template-columns: 80px minmax(0, 1fr);
    }

    .admin-summary strong {
        font-size: 19px;
    }

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

    .feedback-tabs button {
        width: 100%;
        min-height: 42px;
    }

    .feedback-details > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .admin-review-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .admin-login-shell {
        align-items: end;
        padding: 0;
    }

    .admin-login-panel {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 13px;
        padding: 20px 16px max(22px, env(safe-area-inset-bottom));
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 7px 7px 0 0;
    }

    .admin-login-mark {
        width: 44px;
        height: 44px;
        font-size: 19px;
    }

    .admin-login-copy h1 {
        font-size: 21px;
    }

    .admin-password-row {
        grid-template-columns: 1fr;
    }
}
