:root {
    --ink: #182027;
    --muted: #68737c;
    --line: #dfe4e8;
    --surface: #ffffff;
    --canvas: #f4f5f2;
    --accent: #e4202b;
    --accent-dark: #bd111d;
    --success: #157f4a;
    --shadow: 0 18px 50px rgba(20, 28, 34, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; }

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background: radial-gradient(circle at 10% 10%, rgba(228, 32, 43, .055), transparent 30rem), var(--canvas);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

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

.topbar {
    position: relative;
    z-index: 100;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px clamp(22px, 5vw, 72px);
    border-bottom: 1px solid rgba(24, 32, 39, .08);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(14px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--accent);
    border-radius: 11px 11px 11px 3px;
    font-size: 14px;
    font-weight: 850;
    letter-spacing: -.03em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.01em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .13em; }
.main-nav { display: flex; align-self: stretch; align-items: center; gap: 8px; margin: 0 auto; }
.nav-group { position: relative; height: 100%; display: flex; align-items: center; }
.nav-group summary { list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-trigger { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; color: var(--muted); cursor: pointer; font-size: 14px; font-weight: 700; user-select: none; }
.nav-trigger:hover, .nav-trigger.is-active, .nav-group[open] > .nav-trigger { color: var(--ink); }
.nav-trigger.is-active::after { content: ""; position: absolute; right: 14px; bottom: -14px; left: 14px; height: 2px; background: var(--accent); }
.nav-chevron { width: 7px; height: 7px; margin-top: -3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s ease; }
.nav-group:hover .nav-chevron, .nav-group:focus-within .nav-chevron, .nav-group[open] .nav-chevron { transform: translateY(3px) rotate(225deg); }
.nav-dropdown { position: absolute; top: calc(100% - 7px); left: 0; z-index: 110; display: none; min-width: 180px; padding: 7px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 14px 34px rgba(20, 28, 34, .16); }
.nav-dropdown::before { content: ""; position: absolute; right: 0; bottom: 100%; left: 0; height: 10px; }
.nav-dropdown-right { right: 0; left: auto; }
.nav-dropdown a { display: block; padding: 10px 12px; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.nav-dropdown a:hover { color: var(--ink); background: #f5f6f6; }
.nav-dropdown a.is-active { color: var(--accent); background: #fff1f2; }
.nav-group:hover .nav-dropdown, .nav-group:focus-within .nav-dropdown, .nav-group[open] .nav-dropdown { display: grid; }

.account { display: flex; align-items: center; gap: 18px; }
.account-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 650; }
.link-button { padding: 0; border: 0; color: var(--muted); background: none; cursor: pointer; font: inherit; font-size: 14px; }
.link-button:hover { color: var(--accent); }

.page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 54px clamp(20px, 5vw, 64px) 72px; flex: 1; }
.page.wide-page { max-width: 1800px; padding-inline: clamp(18px, 2.5vw, 42px); }
.auth-page { display: grid; place-items: center; }
.auth-shell { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 470px); gap: clamp(44px, 8vw, 108px); align-items: center; }
.auth-intro { max-width: 600px; }
.auth-intro h1, .dashboard-heading h1 { margin: 10px 0 16px; font-size: clamp(38px, 5vw, 62px); line-height: 1.04; letter-spacing: -.055em; }
.auth-intro p, .dashboard-heading p { max-width: 570px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.7; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.code-sample { display: inline-block; margin-top: 32px; padding: 13px 17px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .72); color: #38434c; font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.code-sample span { color: var(--accent); }
.feature-list { margin: 30px 0 0; padding: 0; list-style: none; color: #46515a; }
.feature-list li { position: relative; margin: 13px 0; padding-left: 28px; }
.feature-list li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 900; }

.card { border: 1px solid rgba(24, 32, 39, .09); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card { padding: clamp(26px, 4vw, 42px); }
.card-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.025em; }
.card-heading p { margin: 7px 0 0; color: var(--muted); font-size: 14px; }

.form-stack { display: grid; gap: 18px; margin-top: 28px; }
.field { display: grid; gap: 7px; }
.field > span { color: #38434c; font-size: 13px; font-weight: 700; }
.field input {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid #cfd6db;
    border-radius: 9px;
    outline: none;
    background: #fff;
    color: var(--ink);
    font: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(228, 32, 43, .1); }
.field-error { color: #bc1822; font-size: 12px; }
.checkbox { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }

.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border: 0; border-radius: 9px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 750; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--accent); box-shadow: 0 8px 22px rgba(228, 32, 43, .2); }
.button-primary:hover { background: var(--accent-dark); }
.button-full { width: 100%; }
.auth-switch { margin: 26px 0 0; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 14px; }
.auth-switch a { font-weight: 750; }
.auth-alert { margin-top: 22px; }

.dashboard { display: grid; gap: 24px; }
.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 8px; }
.dashboard-heading h1 { margin-bottom: 8px; font-size: clamp(36px, 5vw, 54px); }
.dashboard-heading p { font-size: 16px; }
.user-chip, .counter, .one-time { display: inline-flex; padding: 7px 11px; border-radius: 999px; color: #52606a; background: #e8ebed; font-size: 12px; font-weight: 700; white-space: nowrap; }
.alert { padding: 14px 17px; border-radius: 10px; font-size: 14px; }
.alert-success { border: 1px solid #add9c3; color: #11663d; background: #edf9f2; }
.alert-error { border: 1px solid #efb5ba; color: #9c1420; background: #fff0f1; }

.token-reveal { padding: 24px; border-color: #9fd4ba; background: linear-gradient(135deg, #f5fff9, #fff); }
.token-reveal-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.token-reveal-heading > div { display: flex; align-items: center; gap: 9px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #1ba260; box-shadow: 0 0 0 5px rgba(27, 162, 96, .11); }
.token-reveal p { margin: 12px 0 16px; color: var(--muted); font-size: 14px; }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; border: 1px solid #bfddce; border-radius: 10px; overflow: hidden; background: #fff; }
.copy-row code { padding: 14px; overflow: hidden; color: #33423b; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.button-copy { border-left: 1px solid #bfddce; border-radius: 0; color: #126f42; background: #eaf7f0; }
.button-copy.is-copied { color: #fff; background: var(--success); }

.dashboard-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 24px; }
.issue-card, .usage-card, .token-list-card { padding: 26px; }
.usage-card pre { margin: 23px 0 0; padding: 18px; overflow-x: auto; border-radius: 11px; background: #1e252a; color: #dfe9e3; }
.usage-card code { font: 12px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
.token-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.token-table-wrap { margin: 22px -26px -26px; overflow-x: auto; }
.token-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.token-table th, .token-table td { padding: 15px 20px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
.token-table th { color: #7a858d; background: #fafafa; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.token-table td { color: #5b6770; }
.token-table td strong { color: var(--ink); }
.table-action { text-align: right !important; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.badge-active { color: #126b40; background: #e5f6ed; }
.badge-muted { color: #707a81; background: #eceeef; }
.badge-warn { color: #8e5a0a; background: #fff3d9; }
.badge-superuser { color: #86202a; background: #ffe8ea; }
.button-danger-link { padding: 0; border: 0; color: #b91d28; background: none; cursor: pointer; font: inherit; font-weight: 700; }
.empty-state { display: grid; justify-items: center; padding: 48px 20px 30px; color: var(--muted); text-align: center; }
.empty-state strong { margin-top: 8px; color: var(--ink); }
.empty-state p { margin: 4px 0; font-size: 13px; }
.empty-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #f0f2f2; font-size: 11px; font-weight: 850; }
.superuser-chip { display: inline-flex; padding: 7px 11px; border-radius: 999px; color: #96202a; background: #ffe5e7; font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stat-card { min-height: 116px; display: flex; flex-direction: column; justify-content: space-between; padding: 20px; border: 1px solid rgba(24, 32, 39, .09); border-radius: 15px; background: #fff; }
.stat-card span { color: var(--muted); font-size: 13px; font-weight: 650; }
.stat-card strong { font-size: 32px; line-height: 1; letter-spacing: -.04em; }
.stat-pending { border-color: #eed59e; background: #fffaf0; }
.cache-stats-grid { grid-template-columns: repeat(4, 1fr); }
.stat-cache-active { border-color: #a9d7c0; background: #f3fcf7; }
.user-list-card { padding: 26px; }
.user-list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.search-form { display: flex; align-items: center; gap: 8px; }
.search-form input { width: min(260px, 28vw); min-height: 42px; padding: 9px 13px; border: 1px solid #cfd6db; border-radius: 9px; outline: none; font: inherit; font-size: 13px; }
.search-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(228, 32, 43, .1); }
.button-secondary { border: 1px solid var(--line); color: var(--ink); background: #f7f8f8; }
.button-small { min-height: 34px; padding: 7px 12px; font-size: 12px; }
.button-warning { border: 1px solid #ead08e; color: #82530a; background: #fff7df; }
.button-delete { border: 1px solid #efc2c6; color: #ad1b25; background: #fff3f4; }
.button-token { border: 1px solid #b9d8ca; color: #126940; background: #edf8f2; }
.search-reset { margin-left: 4px; font-size: 12px; font-weight: 700; }
.user-identity { display: flex; align-items: center; gap: 11px; }
.user-identity > span:last-child { display: grid; gap: 2px; }
.user-identity small { color: var(--muted); font-size: 12px; }
.avatar { width: 35px; height: 35px; display: grid; flex: 0 0 35px; place-items: center; border-radius: 10px; color: #92202a; background: #ffedef; font-weight: 850; }
.user-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.user-actions form { margin: 0; }
.edit-shell { width: min(100%, 760px); margin: 0 auto; }
.back-link { display: inline-flex; margin-bottom: 18px; color: var(--muted); font-size: 13px; font-weight: 700; }
.edit-card { padding: clamp(24px, 4vw, 38px); }
.edit-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 27px; border-bottom: 1px solid var(--line); }
.edit-identity { align-items: flex-start; }
.edit-identity h1 { margin: 4px 0 3px; font-size: 28px; line-height: 1.15; letter-spacing: -.035em; }
.edit-identity small { color: var(--muted); }
.avatar-large { width: 54px; height: 54px; flex-basis: 54px; border-radius: 14px; font-size: 20px; }
.edit-badges { display: flex; align-items: center; gap: 7px; }
.edit-form { grid-template-columns: 1fr 1fr; }
.edit-form .form-separator, .edit-form .edit-buttons { grid-column: 1 / -1; }
.form-separator { display: grid; gap: 3px; margin-top: 6px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-separator strong { font-size: 14px; }
.form-separator span { color: var(--muted); font-size: 12px; }
.edit-buttons { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.token-admin-card { margin-top: 22px; }
.token-admin-alert { margin-top: 20px; }
.token-issue-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-top: 24px; }
.issued-token-box { margin-top: 22px; padding: 20px; border: 1px solid #a9d7c0; border-radius: 13px; background: #f5fff9; }
.issued-token-box > p { margin: 12px 0 15px; color: var(--muted); font-size: 13px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 26px -26px -26px; padding: 16px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pagination a { font-weight: 750; }
.pagination small { color: var(--muted); }
.cache-list-toolbar { display: grid; gap: 22px; }
.cache-filter-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cache-filter-form input, .cache-filter-form select { min-height: 42px; padding: 9px 12px; border: 1px solid #cfd6db; border-radius: 9px; outline: none; background: #fff; color: var(--ink); font: inherit; font-size: 13px; }
.cache-filter-form input { width: min(360px, 34vw); }
.cache-filter-form input:focus, .cache-filter-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(228, 32, 43, .1); }
.cache-table-wrap { overflow: visible; }
.cache-url-table { table-layout: fixed; }
.cache-url-table th, .cache-url-table td { padding: 12px 7px; white-space: normal; vertical-align: top; }
.cache-url-table th:nth-child(1), .cache-url-table td:nth-child(1) { width: 28%; }
.cache-url-table th:nth-child(2), .cache-url-table td:nth-child(2) { width: 7%; }
.cache-url-table th:nth-child(3), .cache-url-table td:nth-child(3),
.cache-url-table th:nth-child(4), .cache-url-table td:nth-child(4),
.cache-url-table th:nth-child(5), .cache-url-table td:nth-child(5),
.cache-url-table th:nth-child(6), .cache-url-table td:nth-child(6) { width: 4%; }
.cache-url-table th:nth-child(7), .cache-url-table td:nth-child(7) { width: 9%; }
.cache-url-table th:nth-child(8), .cache-url-table td:nth-child(8) { width: 7%; }
.cache-url-table th:nth-child(9), .cache-url-table td:nth-child(9) { width: 10%; }
.cache-url-table th:nth-child(10), .cache-url-table td:nth-child(10) { width: 12%; }
.cache-url-table th:nth-child(11), .cache-url-table td:nth-child(11) { width: 11%; }
.cache-url-cell { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.cache-url-cell a { color: var(--ink); font-weight: 700; }
.cache-url-cell a:hover { color: var(--accent); }
.cache-metrics { display: flex; gap: 5px; flex-wrap: wrap; }
.cache-metrics span { padding: 4px 7px; border-radius: 6px; background: #f0f2f2; color: #5f6a72; font-size: 11px; font-weight: 700; }
.metric-number { color: var(--ink); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; font-weight: 750; }
.year-cell { position: relative; z-index: 1; min-width: 0; display: inline-block; outline: none; }
.year-current { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfb; }
.year-current small, .year-history small { color: var(--muted); font-size: 10px; font-weight: 700; }
.year-current strong, .year-history strong { color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.year-chevron { width: 7px; height: 7px; flex: 0 0 7px; margin: -3px 1px 0 2px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s ease; }
.year-history { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; display: none; width: max-content; min-width: 150px; max-width: 240px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 12px 30px rgba(20, 28, 34, .16); }
.year-history::before { content: ""; position: absolute; right: 0; bottom: 100%; left: 0; height: 7px; }
.year-history > span { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 4px 3px; }
.year-history > span + span { border-top: 1px solid #eef0f1; }
.year-cell:hover, .year-cell:focus, .year-cell:focus-within { z-index: 20; }
.year-cell:hover .year-chevron, .year-cell:focus .year-chevron, .year-cell:focus-within .year-chevron { transform: translateY(3px) rotate(225deg); }
.year-cell:hover .year-history, .year-cell:focus .year-history, .year-cell:focus-within .year-history { display: grid; }
.images-dashboard { gap: 20px; }
.images-dashboard-heading { margin-bottom: 4px; }
.dashboard-environment { display: flex; align-items: center; gap: 8px; }
.environment-badge { display: inline-flex; padding: 7px 11px; border-radius: 999px; font-size: 11px; font-weight: 850; letter-spacing: .08em; }
.environment-stage { color: #74510f; background: #fff0ca; }
.environment-prod { color: #126b40; background: #e5f6ed; }
.service-unavailable { min-height: 190px; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 34px; text-align: left; }
.service-unavailable h2 { margin: 0; font-size: 23px; }
.service-unavailable p { margin: 6px 0; color: var(--muted); }
.service-unavailable small { color: #8a6a2f; }
.service-status-icon { width: 44px; height: 44px; display: grid; flex: 0 0 44px; place-items: center; border-radius: 50%; color: #9b6713; background: #fff0cd; font-size: 22px; font-weight: 850; }
.service-overview { display: flex; align-items: center; gap: 28px; padding: 19px 22px; }
.service-state { min-width: 180px; display: flex; align-items: center; gap: 13px; }
.service-state > div { display: grid; gap: 2px; }
.service-state small, .service-meta dt { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.service-state strong { font-size: 17px; }
.service-state-dot { width: 10px; height: 10px; display: inline-block; flex: 0 0 10px; border-radius: 50%; }
.status-ok { background: #1ba260; box-shadow: 0 0 0 5px rgba(27, 162, 96, .11); }
.status-degraded { background: #e5a22e; box-shadow: 0 0 0 5px rgba(229, 162, 46, .13); }
.status-down { background: var(--accent); box-shadow: 0 0 0 5px rgba(228, 32, 43, .11); }
.service-meta { min-width: 0; display: grid; flex: 1; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: 20px; margin: 0; }
.service-meta > div { min-width: 0; display: grid; gap: 3px; }
.service-meta dd { margin: 0; overflow: hidden; color: #3f4a52; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.images-stat-grid { display: grid; grid-template-columns: 1.25fr repeat(4, 1fr); gap: 13px; }
.images-stat-grid .stat-card { min-width: 0; }
.images-stat-grid .stat-card small { color: var(--muted); font-size: 11px; }
.image-stat-link { color: var(--ink); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.image-stat-link:hover { color: var(--ink); border-color: #b8c1c7; box-shadow: 0 10px 24px rgba(20, 28, 34, .08); transform: translateY(-2px); }
.image-stat-link small { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.image-stat-link small b { color: var(--accent); font-size: 16px; }
.image-stat-total { border-color: #c5ced5; background: linear-gradient(145deg, #fff, #f5f7f8); }
.image-stat-failed { border-color: #efc4c8; background: #fff5f6; }
.image-stat-failed strong { color: #b61c27; }
.images-dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.diagnostics-card { min-width: 0; padding: 23px; }
.dependency-list { display: grid; gap: 2px; margin-top: 19px; }
.dependency-row { min-height: 43px; display: grid; grid-template-columns: 10px minmax(80px, 1fr) 110px 65px; align-items: center; gap: 13px; border-top: 1px solid #eef0f1; }
.dependency-row:first-child { border-top: 0; }
.dependency-row strong { font-size: 13px; }
.dependency-row span:not(.service-state-dot), .dependency-row small { color: var(--muted); font-size: 12px; }
.dependency-row small { text-align: right; }
.job-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 22px 0 0; }
.job-summary > div { min-width: 0; display: grid; gap: 5px; padding: 13px 10px; border-radius: 9px; background: #f5f7f7; }
.job-summary dt { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.job-summary dd { margin: 0; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.job-summary .job-failed { background: #fff0f1; }
.job-summary .job-failed dd { color: #b61c27; }
.activity-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; }
.activity-heading > span { color: var(--muted); font-size: 11px; }
.activity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 21px; }
.activity-grid > article { padding: 16px; border: 1px solid var(--line); border-radius: 11px; }
.activity-grid > article > strong { font-size: 13px; }
.activity-grid dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 13px 0 0; }
.activity-grid dl > div { display: grid; gap: 3px; }
.activity-grid dt { color: var(--muted); font-size: 10px; }
.activity-grid dd { margin: 0; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.queue-card { overflow: hidden; }
.queue-table-wrap { margin: 21px -23px -23px; }
.queue-table td, .queue-table th { padding-inline: 15px; }
.queue-error { color: #b61c27 !important; font-weight: 800; }
.image-list-dashboard { gap: 18px; }
.image-list-dashboard .dashboard-heading h1 { margin-top: 7px; }
.image-list-dashboard .back-link { margin-bottom: 14px; }
.image-status-nav { display: flex; align-items: center; gap: 5px; padding: 7px; }
.image-status-nav a { min-height: 38px; display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 750; }
.image-status-nav a:hover { color: var(--ink); background: #f5f6f6; }
.image-status-nav a.is-active { color: #fff; background: var(--ink); }
.status-description { display: flex; align-items: flex-start; gap: 13px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .68); }
.status-description-mark { width: 9px; height: 9px; flex: 0 0 9px; margin-top: 6px; border-radius: 50%; background: #8d969c; box-shadow: 0 0 0 5px rgba(92, 105, 113, .09); }
.status-description > div { display: grid; gap: 3px; }
.status-description strong { font-size: 13px; }
.status-description p { max-width: 960px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.status-description-ready { border-color: #b8ddca; background: #f3fcf7; }
.status-description-ready .status-description-mark { background: #1ba260; box-shadow: 0 0 0 5px rgba(27, 162, 96, .1); }
.status-description-stale { border-color: #ecd49d; background: #fffaf0; }
.status-description-stale .status-description-mark { background: #d99621; box-shadow: 0 0 0 5px rgba(217, 150, 33, .11); }
.status-description-failed { border-color: #efc4c8; background: #fff5f6; }
.status-description-failed .status-description-mark { background: var(--accent); box-shadow: 0 0 0 5px rgba(228, 32, 43, .1); }
.image-list-card { min-width: 0; padding: 23px; }
.image-filter-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.image-filter-form label { display: grid; gap: 6px; }
.image-filter-form label > span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.image-filter-form input, .image-filter-form select { min-height: 42px; padding: 9px 12px; border: 1px solid #cfd6db; border-radius: 9px; outline: none; background: #fff; color: var(--ink); font: inherit; font-size: 13px; }
.image-filter-form input:focus, .image-filter-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(228, 32, 43, .1); }
.image-search-field { flex: 1 1 380px; }
.image-search-field input { width: 100%; }
.image-list-error { margin-top: 20px; }
.image-list-empty { padding-bottom: 42px; }
.image-table-wrap { margin: 22px -23px 0; overflow: visible; }
.image-table { table-layout: fixed; }
.image-table th, .image-table td { padding: 12px 9px; vertical-align: middle; white-space: normal; }
.image-table th:nth-child(1), .image-table td:nth-child(1) { width: 6%; padding-left: 18px; }
.image-table th:nth-child(2), .image-table td:nth-child(2) { width: 34%; }
.image-table th:nth-child(3), .image-table td:nth-child(3) { width: 8%; }
.image-table th:nth-child(4), .image-table td:nth-child(4) { width: 10%; }
.image-table th:nth-child(5), .image-table td:nth-child(5) { width: 8%; }
.image-table th:nth-child(6), .image-table td:nth-child(6),
.image-table th:nth-child(7), .image-table td:nth-child(7),
.image-table th:nth-child(8), .image-table td:nth-child(8) { width: 11.3%; }
.image-preview { width: 64px; height: 48px; display: grid; overflow: hidden; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #f1f3f3; }
.image-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.image-preview-empty { color: #9aa2a8; font-size: 12px; }
.image-path-cell { min-width: 0; }
.image-path-cell > div { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.image-path-cell code { color: var(--muted); font-size: 10px; }
.image-path-cell small { overflow: hidden; color: #8a939a; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.image-path-cell > a, .image-path-cell > span { display: block; overflow-wrap: anywhere; color: var(--ink); font-size: 12px; font-weight: 700; line-height: 1.45; }
.image-path-cell > a:hover { color: var(--accent); }
.image-table td > strong, .image-table td > small { display: block; }
.image-table td > small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.image-table .image-has-error { color: #b61c27; font-weight: 750; }
.image-cursor-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding-top: 18px; color: var(--muted); font-size: 12px; }
.image-cursor-nav > :last-child { justify-self: end; }
.footer { padding: 24px; color: #8a9297; text-align: center; font-size: 12px; }

@media (max-width: 1180px) {
    .page.wide-page { max-width: 820px; }
    .service-overview { align-items: flex-start; flex-wrap: wrap; }
    .service-meta { order: 3; flex-basis: 100%; }
    .images-stat-grid { grid-template-columns: repeat(3, 1fr); }
    .images-dashboard-grid { grid-template-columns: 1fr; }
    .job-summary { grid-template-columns: repeat(5, 1fr); }
    .activity-grid { grid-template-columns: 1fr; }
    .image-table-wrap { margin: 22px 0 0; overflow: visible; }
    .image-table, .image-table tbody, .image-table tr, .image-table td { display: block; width: 100%; }
    .image-table { table-layout: auto; }
    .image-table thead { display: none; }
    .image-table tbody { display: grid; gap: 14px; }
    .image-table tr { overflow: hidden; display: grid; grid-template-columns: 96px 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
    .image-table td, .image-table td:nth-child(n) { width: 100%; display: grid; align-content: start; gap: 5px; padding: 11px 14px; border-top: 1px solid var(--line); }
    .image-table td::before { content: attr(data-label); color: #7a858d; font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
    .image-table td:nth-child(1) { grid-row: span 2; border-top: 0; }
    .image-table td:nth-child(2), .image-table td:nth-child(3) { border-top: 0; }
    .image-table td:nth-child(2) { grid-column: 2 / 3; }
    .image-table td:nth-child(3) { grid-column: 3 / 4; }
    .image-preview { width: 68px; height: 56px; }
    .cache-table-wrap { margin: 22px 0 -26px; overflow: visible; }
    .cache-url-table, .cache-url-table tbody, .cache-url-table tr, .cache-url-table td { display: block; width: 100%; }
    .cache-url-table { table-layout: auto; }
    .cache-url-table thead { display: none; }
    .cache-url-table tbody { display: grid; gap: 14px; }
    .cache-url-table tr { overflow: visible; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
    .cache-url-table td,
    .cache-url-table td:nth-child(n) {
        width: 100%;
        display: grid;
        grid-template-columns: 150px minmax(0, 1fr);
        align-items: start;
        gap: 14px;
        padding: 11px 14px;
        border-top: 1px solid var(--line);
    }
    .cache-url-table td:first-child { border-top: 0; }
    .cache-url-table td::before {
        content: attr(data-label);
        color: #7a858d;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .05em;
        text-transform: uppercase;
    }
    .cache-url-table .year-history { width: min(100%, 240px); }
}

@media (max-width: 820px) {
    .topbar { flex-wrap: wrap; }
    .main-nav { order: 3; flex-basis: 100%; justify-content: center; }
    .nav-trigger.is-active::after { bottom: 0; }
    .auth-shell, .dashboard-grid { grid-template-columns: 1fr; }
    .auth-intro { text-align: center; }
    .auth-intro p { margin-inline: auto; }
    .feature-list { display: inline-block; text-align: left; }
    .auth-card { width: min(100%, 520px); margin: 0 auto; }
    .user-list-toolbar { align-items: flex-start; flex-direction: column; }
    .search-form { width: 100%; }
    .search-form input { width: 100%; }
    .cache-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .cache-filter-form input { width: 100%; }
    .service-meta { grid-template-columns: repeat(2, 1fr); }
    .images-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .activity-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 600px) {
    .topbar { min-height: 66px; padding: 11px 17px; }
    .brand-mark { width: 38px; height: 38px; }
    .brand strong { font-size: 14px; }
    .main-nav { gap: 0; }
    .nav-trigger { padding-inline: 8px; font-size: 12px; }
    .nav-trigger.is-active::after { right: 8px; bottom: 0; left: 8px; }
    .account-name { display: none; }
    .page { padding: 34px 16px 50px; }
    .auth-shell { gap: 30px; }
    .auth-intro h1 { font-size: 38px; }
    .auth-intro p { font-size: 16px; }
    .code-sample { display: none; }
    .dashboard-heading { display: block; }
    .user-chip { margin-top: 16px; }
    .token-reveal, .issue-card, .usage-card, .token-list-card { padding: 20px; }
    .copy-row { grid-template-columns: 1fr; }
    .button-copy { border-top: 1px solid #bfddce; border-left: 0; }
    .token-list-heading { align-items: flex-start; }
    .token-table-wrap { margin: 20px -20px -20px; }
    .cache-table-wrap { margin: 20px 0 -20px; }
    .cache-url-table td, .cache-url-table td:nth-child(n) { grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }
    .stats-grid { grid-template-columns: 1fr; gap: 10px; }
    .stat-card { min-height: 94px; }
    .user-list-card { padding: 20px; }
    .search-form { flex-wrap: wrap; }
    .pagination { margin: 20px -20px -20px; }
    .edit-heading { flex-direction: column; }
    .edit-form { grid-template-columns: 1fr; }
    .edit-form .form-separator, .edit-form .edit-buttons { grid-column: auto; }
    .edit-buttons { align-items: stretch; flex-direction: column; }
    .token-issue-form { grid-template-columns: 1fr; }
    .images-dashboard-heading .superuser-chip { display: none; }
    .dashboard-environment { margin-top: 14px; }
    .service-overview { gap: 20px; }
    .service-meta { grid-template-columns: 1fr 1fr; gap: 14px; }
    .images-stat-grid { grid-template-columns: 1fr; gap: 10px; }
    .dependency-row { grid-template-columns: 10px minmax(80px, 1fr) 85px 55px; gap: 9px; }
    .job-summary { grid-template-columns: repeat(2, 1fr); }
    .activity-grid dl { gap: 7px; }
    .queue-table-wrap { overflow-x: auto; }
    .image-status-nav { display: grid; grid-template-columns: 1fr 1fr; }
    .image-status-nav a { justify-content: center; }
    .image-filter-form { align-items: stretch; flex-direction: column; }
    .image-search-field { flex-basis: auto; }
    .image-filter-form .button { width: 100%; }
    .image-table tr { grid-template-columns: 82px minmax(0, 1fr); }
    .image-table td:nth-child(2) { grid-column: 2 / 3; }
    .image-table td:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid var(--line); }
    .image-cursor-nav { grid-template-columns: 1fr 1fr; }
    .image-cursor-nav > span:nth-child(2) { display: none; }
}
