:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --text: #1d2130;
    --muted: #6b7185;
    --border: #e3e5ee;
    --accent: #ee6123;
    --accent-hover: #d4521a;
    --accent-soft: #fdeee6;
    --danger: #c62828;
    --danger-soft: #fdecec;
    --success: #2e7d32;
    --success-strong: #2e7d32; /* filled green buttons: readable with white text */
    --radius: 10px;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #12141b;
        --surface: #1b1e28;
        --text: #e8eaf2;
        --muted: #9aa0b4;
        --border: #2c3040;
        --accent-soft: #3a2419;
        --danger-soft: #3a1e1e;
        --success: #66bb6a;
        --success-strong: #2f8f3e;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--accent); }

h1:focus { outline: none; }

/* Sticky, slightly see-through header. */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: saturate(1.6) blur(12px);
    -webkit-backdrop-filter: saturate(1.6) blur(12px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner, .page {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 62px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    text-decoration: none;
}

.brand .tld { color: var(--accent); }
.brand img { border-radius: 7px; }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; transition: background-color .15s, color .15s; }
.nav a:hover { color: var(--text); background: var(--bg); }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.login-btn { text-decoration: none; }
.login-btn.active { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

/* Account menu: avatar chip that opens a small panel. */
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; user-select: none; transition: border-color .15s, background-color .15s; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover, .user-menu[open] summary { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--bg); }
/* On the account pages the chip stands in for the (active) Account link. */
.user-menu:has(.menu-item.active) summary { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.user-menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.user-menu summary .avatar.sm { width: 30px; height: 30px; font-size: .7rem; }
.user-chip-text { display: grid; line-height: 1.15; max-width: 150px; }
.user-chip-text strong { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-text span { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu .chevron { color: var(--muted); transition: transform .2s; }
.user-menu[open] .chevron { transform: rotate(180deg); }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; padding: 6px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 16px 40px rgba(0,0,0,.28); display: grid; gap: 2px; transform-origin: top right; animation: menu-in .16s ease-out; z-index: 60; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .user-menu .menu { animation: none; } }
.menu-head { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.menu-head > div { display: grid; gap: 2px; min-width: 0; justify-items: start; }
.menu-head strong { overflow-wrap: anywhere; }
.menu-head .tag { margin-top: 4px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: none; color: var(--text); font: inherit; font-size: .9rem; font-weight: 500; text-decoration: none; cursor: pointer; text-align: left; }
.menu-item .i { color: var(--muted); }
.menu-item:hover, .menu-item:focus-visible { background: var(--bg); outline: none; }
.menu-item.active { color: var(--accent); }
.menu-item.active .i { color: var(--accent); }
.menu-item.danger:hover, .menu-item.danger:focus-visible { color: var(--danger); background: var(--danger-soft); }
.menu-item.danger:hover .i { color: var(--danger); }
.logout-form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--border); }

.page { padding-top: 32px; padding-bottom: 64px; }

.hero { text-align: center; margin: 24px 0 32px; }
.hero h1 { font-size: 2.25rem; margin: 0 0 8px; }
.hero p { color: var(--muted); margin: 0; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.card h2 { font-size: 1.1rem; margin: 0 0 16px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 280px; min-width: 0; }

input:not([type]), input[type=text], input[type=url], input[type=password], input[type=search], input[type=datetime-local], select {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
}

input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--bg); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 12px; font-size: .875rem; }

.error { color: var(--danger); background: var(--danger-soft); padding: 10px 14px; border-radius: 8px; margin-top: 12px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.result { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.result .details { flex: 1 1 300px; min-width: 0; }
.result .short-url { font-size: 1.4rem; font-weight: 700; word-break: break-all; }
.result img { width: 160px; height: 160px; border-radius: 8px; background: #fff; padding: 6px; }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    background: var(--accent-soft);
    color: var(--accent);
}

.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.success { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.kpi .value { font-size: 1.75rem; font-weight: 700; }
.kpi .label { color: var(--muted); font-size: .875rem; }

.chart { display: flex; align-items: flex-end; gap: 2px; height: 180px; padding-top: 8px; }
.chart .bar { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.chart .bar:hover { opacity: 1; }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; margin-top: 6px; }

.breakdown { list-style: none; margin: 0; padding: 0; }
.breakdown li { position: relative; padding: 6px 10px; margin-bottom: 4px; border-radius: 6px; overflow: hidden; display: flex; justify-content: space-between; gap: 12px; }
.breakdown li .fill { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); z-index: 0; }
.breakdown li span { position: relative; z-index: 1; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .875rem; white-space: nowrap; }
td.url { max-width: 320px; }
.table-wrap { overflow-x: auto; }
.nowrap, .badge { white-space: nowrap; }
td.actions { text-align: right; }
td.actions .row { justify-content: flex-end; gap: 6px; }
input[type=checkbox], input[type=radio] { flex-shrink: 0; }

/* The admin tables have up to nine columns: give them more room than the 960px reading width. */
body:has(.admin-page) .page, body:has(.admin-page) .topbar-inner { max-width: 1180px; }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }

/* Blazor template defaults */
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after { content: "An error has occurred."; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs button { white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px; }
.tabs button .i { opacity: .75; }
.tabs button.active .i { opacity: 1; color: var(--accent); }
.tabs button {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    padding: 10px 14px;
    margin-bottom: -1px;
    cursor: pointer;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.badge.muted-badge { background: var(--border); color: var(--muted); }
.choice { display: grid; gap: 10px; }
input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type=number] {
    padding: 8px 10px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
}
input[type=number]:disabled { opacity: .5; }
.notes { margin: 16px 0 0; padding-left: 18px; font-size: .875rem; display: grid; gap: 4px; }
/* Hints followed by the form's buttons: give the buttons room to breathe. */
.notes + .row { margin-top: 20px; }

/* Admin sign-in and forms */
.auth-card { max-width: 440px; margin: 40px auto; }
.auth-card h1 { font-size: 1.5rem; margin: 0 0 16px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.narrow { max-width: 420px; }
.form-grid label { display: grid; gap: 6px; font-weight: 500; }
.hint { font-size: .85rem; font-weight: 400; }
.notice { background: var(--accent-soft); color: var(--text); padding: 10px 14px; border-radius: 8px; margin: 0 0 16px; }
.secret { margin-top: 16px; padding: 14px; border: 1px dashed var(--accent); border-radius: 8px; background: var(--accent-soft); }
.secret code { word-break: break-all; }

.danger-box { margin-top: 16px; padding: 16px; border: 2px solid var(--danger); border-radius: 8px; background: var(--danger-soft); }
.danger-box h3 { margin: 0 0 8px; color: var(--danger); }
.danger-box p, .danger-box ul { margin: 0 0 10px; }


/* ---------- Toasts (Components/Toasts) ---------- */
.toaster {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    --tone: var(--success);
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 14px 12px 16px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(12px) saturate(1.4);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .28), 0 0 0 1px color-mix(in srgb, var(--tone) 18%, transparent) inset;
    overflow: hidden;
    pointer-events: auto;
    animation: toast-in .42s cubic-bezier(.2, 1.2, .35, 1) both;
}
.toast.toast-error { --tone: var(--danger); }
.toast.toast-info { --tone: var(--accent); }
.toast.leaving { animation: toast-out .26s ease-in both; }

.toast-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--tone) 16%, transparent);
    color: var(--tone);
    animation: toast-pop .5s cubic-bezier(.2, 1.5, .4, 1) .08s both;
}
.toast-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.toast-icon .draw { stroke-dasharray: 24; stroke-dashoffset: 24; animation: toast-draw .38s ease-out .22s forwards; }

.toast-body { min-width: 0; padding-top: 5px; }
.toast-body strong { display: block; font-size: .95rem; line-height: 1.3; }
.toast-body ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.toast-body li { color: var(--muted); font-size: .85rem; line-height: 1.35; overflow-wrap: anywhere; }

.toast-close {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.toast-close:hover { background: var(--border); color: var(--text); }
.toast-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

/* Shrinks over the toast's lifetime: how long until it goes away. */
.toast-timer {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--tone);
    opacity: .75;
    transform-origin: left;
    animation: toast-timer var(--toast-duration, 4s) linear forwards;
}

@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px) scale(.97); } }
@keyframes toast-pop { from { transform: scale(.4); } to { transform: none; } }
@keyframes toast-draw { to { stroke-dashoffset: 0; } }
@keyframes toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (max-width: 560px) {
    .toaster { right: 16px; left: 16px; bottom: 16px; width: auto; }
}

/* ---------- Save button with progress (Shared/SaveButton) ---------- */
.save-btn { display: inline-grid; transition: background-color .25s, border-color .25s, transform .12s; }
.save-btn:active:not(:disabled) { transform: scale(.97); }
.save-btn > span {
    grid-area: 1 / 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity .2s, transform .25s cubic-bezier(.2, 1.2, .4, 1);
}
.save-btn .save-busy, .save-btn .save-done { opacity: 0; transform: translateY(8px); }
.save-btn.is-busy .save-label, .save-btn.is-done .save-label { opacity: 0; transform: translateY(-8px); }
.save-btn.is-busy .save-busy, .save-btn.is-done .save-done { opacity: 1; transform: none; }
.save-btn.is-busy, .save-btn.is-done { opacity: 1; cursor: default; }
.save-btn.is-done { background: var(--success-strong); border-color: var(--success-strong); color: #fff; }

.save-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: save-spin .7s linear infinite;
}
.save-done svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.save-btn.is-done .save-done path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: toast-draw .35s ease-out .05s forwards; }

@keyframes save-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .toast, .toast.leaving, .toast-icon, .save-btn > span { animation: none; transition: none; }
    .toast-icon .draw, .save-btn.is-done .save-done path { animation: none; stroke-dashoffset: 0; }
    .save-spinner { animation-duration: 1.6s; }
}

/* ---------- Links list filters (Admin → Links) ---------- */
.filter-bar {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) repeat(2, minmax(190px, auto)) auto;
    gap: 12px 14px;
    align-items: end;
    padding: 16px;
    margin-bottom: 16px;
}
.filter-field { display: grid; gap: 6px; font-size: .85rem; font-weight: 600; min-width: 0; }
.filter-field input { width: 100%; }
.filter-field input[type=datetime-local] { color-scheme: light dark; }
.filter-actions { display: flex; gap: 8px; }
.filter-presets { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .85rem; }

.chip {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 999px;
    padding: 4px 12px;
    font: inherit;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

@media (max-width: 760px) {
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .filter-search, .filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .filter-bar { grid-template-columns: 1fr; }
}

/* ---------- Links list: toolbar and multi-select (Admin → Links) ---------- */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 8px 10px; }
.btn .icon, .btn.small .icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.small:has(.icon) { display: inline-flex; align-items: center; gap: 6px; }

.bulk-bar {
    position: sticky;
    top: 8px;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin: 0 0 10px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent-soft) 80%, var(--surface));
    box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
    animation: bulk-in .22s cubic-bezier(.2, 1.2, .4, 1);
}
.bulk-bar.confirming { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); background: color-mix(in srgb, var(--danger-soft) 85%, var(--surface)); }
.bulk-bar .spacer { flex: 1; }
.bulk-count { font-variant-numeric: tabular-nums; }
.bulk-reason { padding: 6px 10px !important; width: 220px !important; font-size: .9rem !important; }

.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

th.select-col, td.select-col { width: 36px; padding-right: 0; }
tbody tr.selected td { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
tbody tr { transition: background-color .15s; }

@keyframes bulk-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bulk-bar { animation: none; } }

/* ---------- Audit log (Account → Audit log) ---------- */
.audit-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.audit-head h1 { margin: 0; font-size: 1.5rem; }
.audit-head p { margin: 4px 0 0; font-size: .9rem; }

.audit-categories { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; }
.chip-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.audit-card { padding: 8px 20px 16px; }
.audit-day {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 14px 0 8px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: .9rem;
}
.audit-day .muted { font-weight: 400; font-size: .8rem; }

.audit-list { list-style: none; margin: 0; padding: 0; }
.audit-item {
    --tone: var(--muted);
    position: relative;
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.audit-item:last-child { border-bottom: 0; }
.audit-item.tone-good { --tone: var(--success); }
.audit-item.tone-bad { --tone: var(--danger); }
.audit-item.tone-warn { --tone: var(--accent); }

/* A thin timeline joining the icons of one day. */
.audit-item::before {
    content: "";
    position: absolute;
    left: 17px;
    top: 50px;
    bottom: -14px;
    width: 2px;
    background: var(--border);
}
.audit-item:last-child::before { display: none; }

.audit-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    color: var(--tone);
    background: color-mix(in srgb, var(--tone) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent);
}
.audit-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.audit-main { min-width: 0; display: grid; gap: 4px; }
.audit-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; line-height: 1.45; }
.audit-actor { font-weight: 700; }
.audit-id { color: var(--muted); font-size: .8rem; margin-left: -3px; }
.audit-target {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .85rem;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    overflow-wrap: anywhere;
}
.audit-details {
    color: var(--muted);
    font-size: .875rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.audit-details.expanded { -webkit-line-clamp: unset; display: block; }
.audit-more { justify-self: start; font-size: .8rem; }
.audit-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .78rem; }
.audit-meta .mono { opacity: .85; }
.audit-when { color: var(--muted); font-size: .8rem; white-space: nowrap; padding-top: 2px; }

.audit-empty { display: grid; justify-items: center; gap: 6px; padding: 40px 0 28px; text-align: center; }
.audit-empty svg { width: 36px; height: 36px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; }

@media (max-width: 560px) {
    .audit-item { grid-template-columns: 32px 1fr; }
    .audit-when { grid-column: 2; padding: 0; }
    .audit-icon { width: 32px; height: 32px; }
    .audit-item::before { left: 15px; top: 46px; }
}
