/* Shared building blocks: surfaces, controls, data display, overlays. */

/* ===================== CARDS ===================== */

.card {
    position: relative;
    background: var(--glass), var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex; flex-direction: column; gap: 12px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow-sm);
    transition: border-color var(--t), box-shadow var(--t) var(--ease-out), transform var(--t) var(--ease-out);
}
/* A gradient hairline that catches the light along the top edge. */
.card::before {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
    background: var(--hairline);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: .8;
}
/* Spotlight that follows the pointer (--mx/--my are set by app.js). */
.card::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -200px), rgba(var(--accent-rgb), .14), transparent 45%);
    opacity: 0; transition: opacity var(--t-slow);
}
.card:hover::after { opacity: 1; }
.card > * { position: relative; z-index: 1; }
a.card { color: var(--text); }
a.card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow-lift); transform: translateY(-2px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head a { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.card-head a .ico { transition: transform var(--t) var(--ease-out); }
.card-head a:hover .ico { transform: translateX(3px); }

/* ===================== BUTTONS ===================== */

.btn {
    position: relative; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 8px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: var(--glass), var(--surface-2); color: var(--text);
    box-shadow: inset 0 1px 0 var(--glass-edge);
    font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: transform var(--t-fast) var(--ease-out), background var(--t-fast), border-color var(--t-fast), box-shadow var(--t), filter var(--t-fast);
}
.btn:hover { background: var(--glass), var(--surface-3); border-color: rgba(var(--accent-rgb), .45); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--nebula); background-size: 160% 100%; border-color: transparent; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 6px 22px rgba(110, 100, 255, .4); }
.btn.primary:hover { box-shadow: var(--glow); background-position: 100% 0; filter: brightness(1.06); }
/* A sheen sweeps across primary buttons on hover. */
.btn.primary::after {
    content: ""; position: absolute; inset: 0; transform: translateX(-120%);
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
}
.btn.primary:hover::after { transform: translateX(120%); transition: transform .7s var(--ease-out); }
.btn.success { background: rgba(94, 230, 160, .14); border-color: rgba(94, 230, 160, .4); color: var(--ok); }
.btn.success:hover { background: rgba(94, 230, 160, .22); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: rgba(255, 122, 138, .1); border-color: rgba(255, 122, 138, .4); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 4px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; padding: 12px; }

.icon-btn {
    display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted);
    font-size: 16px; cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.small { width: 26px; height: 26px; font-size: 15px; }

/* ===================== FORM CONTROLS ===================== */

input, select, textarea {
    font: inherit; color: var(--text);
    background: var(--field); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: 8px 12px; min-width: 0;
    transition: border-color var(--t-fast), box-shadow var(--t), background var(--t-fast);
}
input:hover, select:hover, textarea:hover { border-color: rgba(var(--accent-rgb), .4); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
select option { background: var(--surface-solid); }
textarea { resize: vertical; width: 100%; }
input[type="search"] { flex: 1 1 260px; }
.card > input[type="search"], .stack > input[type="search"], .form label > input[type="search"] { flex: none; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
label.inline { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
label.radio { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; cursor: pointer; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form label:not(.inline):not(.radio):not(.switch) { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.field-label { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.grid-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-form .span { grid-column: 1 / -1; }
.grid-form.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .grid-form, .grid-form.two { grid-template-columns: 1fr; } }
.small-input { padding: 5px 10px; font-size: 12.5px; }
.mono-input { font-family: var(--mono); font-size: 13px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs button {
    position: relative;
    display: inline-flex; align-items: center; gap: 6px;
    font: inherit; font-weight: 600; color: var(--muted);
    background: none; border: 0; padding: 10px 14px; cursor: pointer; white-space: nowrap;
    transition: color var(--t-fast);
}
.tabs button::after {
    content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px;
    background: var(--nebula); transform: scaleX(0); transition: transform var(--t) var(--ease-out);
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); }
.tabs button.active::after { transform: scaleX(1); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button {
    font: inherit; font-size: 13px; font-weight: 600; color: var(--muted);
    background: none; border: 0; border-radius: 9px; padding: 6px 12px; cursor: pointer;
    transition: color var(--t-fast), background var(--t) var(--ease-out), box-shadow var(--t);
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--nebula-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong), var(--shadow-sm); }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 99px; padding: 0; position: relative; cursor: pointer; background: var(--surface-3); }
.switch input::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
    border-radius: 50%; background: var(--faint); box-shadow: var(--shadow-sm);
    transition: transform var(--t) var(--ease-spring), background var(--t);
}
.switch input:checked { background: rgba(94, 230, 160, .25); border-color: var(--ok); }
.switch input:checked::after { transform: translateX(18px); background: var(--ok); }

.chip {
    font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
    padding: 3px 10px; border-radius: 99px; color: var(--muted);
    background: transparent; border: 1px solid var(--border-strong);
    transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.chip:hover { color: var(--text); }
.chip.on { color: var(--text); background: var(--nebula-soft); border-color: var(--accent); }
.chip-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 4px; font: inherit; }
.chip-x:hover { color: var(--danger); }

/* ===================== DATA ===================== */

.pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: 99px;
    background: var(--surface-2); border: 1px solid var(--border);
    font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.pill.warn { color: var(--warn); border-color: rgba(247, 201, 92, .4); background: rgba(247, 201, 92, .08); }
.pill.lock { color: var(--gold); border-color: rgba(247, 201, 92, .4); background: rgba(247, 201, 92, .08); }
.count { font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--surface-3); border-radius: 99px; padding: 1px 8px; }
.state-active { color: var(--ok); border-color: rgba(94, 230, 160, .4); background: rgba(94, 230, 160, .08); }
.state-scheduled { color: var(--violet); border-color: rgba(167, 139, 250, .45); background: rgba(167, 139, 250, .1); }
.state-expired { color: var(--muted); }
.state-revoked { color: var(--danger); border-color: rgba(255, 122, 138, .4); background: rgba(255, 122, 138, .08); }

.table-wrap {
    overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--glass), var(--surface); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow-sm);
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th {
    font-size: 10.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .09em;
    position: sticky; top: 0; background: var(--overlay); backdrop-filter: blur(12px);
}
.card .table th { background: transparent; position: static; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tr.clickable { cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr.clickable:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.table.compact td, .table.compact th { padding: 8px 6px; }
.card .table th, .card .table td { padding-left: 4px; }
.clip { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.kv.cols { grid-template-columns: repeat(2, max-content 1fr); }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; }
@media (max-width: 760px) { .kv.cols { grid-template-columns: max-content 1fr; } }

.user { display: inline-flex; align-items: center; gap: 7px; vertical-align: middle; font-weight: 600; }
.user img { width: 22px; height: 22px; border-radius: 50%; }
a.user { color: var(--text); }
a.user:hover span { text-decoration: underline; text-underline-offset: 3px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { gap: 4px; color: var(--text); overflow: hidden; }
.stat .glow {
    position: absolute; z-index: 0; right: -50px; top: -60px; width: 190px; height: 190px; border-radius: 50%;
    background: radial-gradient(circle, rgba(157, 140, 255, .45), transparent 70%);
    transition: transform var(--t-slow) var(--ease-out);
}
.stat:nth-child(4n+2) .glow { background: radial-gradient(circle, rgba(124, 196, 250, .42), transparent 70%); }
.stat:nth-child(4n+3) .glow { background: radial-gradient(circle, rgba(240, 166, 232, .38), transparent 70%); }
.stat:nth-child(4n+4) .glow { background: radial-gradient(circle, rgba(247, 201, 92, .34), transparent 70%); }
.stat:hover .glow { transform: scale(1.25); }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat-value { font-family: var(--display); font-size: 34px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -.03em; }
.stat-sub { color: var(--muted); font-size: 12.5px; }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 190px 1fr 32px; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; }
.bar { display: block; height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 99px; transform-origin: left; animation: grow-x .9s var(--ease-out) both; transition: width var(--t-slow) var(--ease-out); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .bar-row { grid-template-columns: 1fr 70px 24px; } }

.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.history li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.history li:last-child { border-bottom: 0; }

.quote, .md-quote {
    margin: 0; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere;
    background: var(--surface-2); border-left: 3px solid var(--violet); border-radius: 8px;
}

/* Status colours: same meaning as the Discord bug cards. */
.status-NEEDS_INFO { --status: var(--warn); }
.status-OPEN { --status: var(--sky); }
.status-UNDER_INVESTIGATION { --status: var(--danger); }
.status-PATCHED { --status: var(--ok); }
.bar-fill, .dot { background: var(--status, var(--violet)); }
.status-pill { color: var(--status); border-color: color-mix(in srgb, var(--status) 45%, transparent); }

/* ===================== STATES ===================== */

.empty {
    padding: 40px 16px; text-align: center; color: var(--muted); font-weight: 600;
    border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2);
    animation: fade-up var(--t-slow) var(--ease-out) both;
}
.empty::before {
    content: ""; display: block; width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .35), transparent 40%), var(--nebula);
    opacity: .55; box-shadow: 0 0 30px rgba(var(--accent-rgb), .35);
    animation: float 6s ease-in-out infinite;
}

.loading { display: flex; flex-direction: column; gap: 14px; }
.skeleton-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.skeleton {
    border-radius: var(--radius); border: 1px solid var(--border);
    background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%) 0 0 / 300% 100%;
    animation: shimmer 1.4s linear infinite;
}
.skeleton.tile { height: 104px; }
.skeleton.block { height: 220px; }
.skeleton.line { height: 14px; border-radius: 99px; }

.error-box {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-radius: var(--radius-sm); font-weight: 600;
    background: rgba(255, 122, 138, .1); border: 1px solid rgba(255, 122, 138, .35); color: var(--danger);
    animation: shake .4s var(--ease-out);
}
.crash { align-items: flex-start; }
.crash pre { margin: 0; max-width: 100%; overflow: auto; font: 12px/1.5 var(--mono); color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; }
.hint { flex: 1 1 240px; text-align: right; }
@media (max-width: 760px) { .hint { text-align: left; } }

/* ===================== DIALOG ===================== */

.dialog {
    width: min(580px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
    padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
    background: var(--glass), var(--overlay); color: var(--text);
    backdrop-filter: blur(28px) saturate(1.6); -webkit-backdrop-filter: blur(28px) saturate(1.6);
    box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow), 0 0 80px rgba(var(--accent-rgb), .14);
    animation: dialog-in var(--t-slow) var(--ease-out);
}
.dialog.wide { width: min(780px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(5, 6, 20, .5); backdrop-filter: blur(8px); animation: fade-in var(--t) var(--ease-out); }
.dialog.closing { animation: dialog-out var(--t) var(--ease-in-out) forwards; }
.dialog.closing::backdrop { animation: fade-out var(--t) var(--ease-in-out) forwards; }
.dialog-head {
    position: sticky; top: 0; z-index: 2;
    display: flex; align-items: center; justify-content: space-between; padding: 16px 20px;
    border-bottom: 1px solid var(--border); background: var(--overlay);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.dialog-head::before { content: ""; position: absolute; inset: 0; background: var(--nebula-soft); pointer-events: none; }
.dialog-head > * { position: relative; }
.dialog-head h2 { font-size: 18px; }
.dialog-body { padding: 18px 20px 20px; }
.detail { display: flex; flex-direction: column; gap: 14px; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.qa { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.qa .q { font-weight: 700; }
.qa .a { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ===================== TOASTS ===================== */

.toasts {
    position: fixed; right: 18px; bottom: 18px; z-index: 100;
    display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 36px));
}
.toast {
    position: relative; overflow: hidden;
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 10px 12px 14px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 600;
    background: var(--surface-solid); border: 1px solid var(--border-strong);
    --tone: var(--ok);
    animation: toast-in var(--t-slow) var(--ease-spring);
}
.toast.err { --tone: var(--danger); }
.toast.leaving { animation: toast-out var(--t) var(--ease-in-out) forwards; }
.toast-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: none; color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, transparent); }
.toast-msg { flex: 1; padding-top: 2px; overflow-wrap: anywhere; }
.toast .icon-btn { width: 26px; height: 26px; margin: -2px 0; }
.toast-timer {
    position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--tone); opacity: .7;
    transform-origin: left; animation: countdown var(--toast-ms, 4500ms) linear forwards;
}
.toast:hover .toast-timer { animation-play-state: paused; }

/* ===================== COMMAND PALETTE ===================== */

.palette-scrim {
    position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-start;
    padding: 12vh 16px 16px; background: rgba(5, 6, 20, .55); backdrop-filter: blur(6px);
    animation: fade-in var(--t) var(--ease-out);
}
.palette-scrim.closing { animation: fade-out var(--t) var(--ease-in-out) forwards; }
.palette {
    width: min(620px, 100%); max-height: min(560px, 76vh); display: flex; flex-direction: column; overflow: hidden;
    border-radius: var(--radius-lg); border: 1px solid var(--border-strong); background: var(--glass), var(--overlay);
    backdrop-filter: blur(28px) saturate(1.6); -webkit-backdrop-filter: blur(28px) saturate(1.6);
    box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow), 0 0 80px rgba(var(--accent-rgb), .22);
    animation: palette-in var(--t-slow) var(--ease-spring);
}
.palette-scrim.closing .palette { animation: dialog-out var(--t) var(--ease-in-out) forwards; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette-input input { flex: 1; border: 0; background: none; padding: 4px 0; font-size: 16px; box-shadow: none; }
.palette-input input:focus { box-shadow: none; }
.palette-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.palette-section { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding: 10px 10px 4px; }
.palette-item {
    display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer;
    color: var(--text); transition: background var(--t-fast);
}
.palette-item .nav-icon { width: 32px; height: 32px; }
.palette-item.sel { background: var(--nebula-soft); box-shadow: inset 0 0 0 1px var(--border); }
.palette-item.sel .nav-icon { background: var(--nebula); color: #fff; }
.palette-item .sub { color: var(--muted); font-size: 12px; }
.palette-item .go { margin-left: auto; color: var(--faint); opacity: 0; transform: translateX(-4px); transition: opacity var(--t-fast), transform var(--t) var(--ease-out); }
.palette-item.sel .go { opacity: 1; transform: none; }
.palette-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--faint); }
.palette-foot span { display: inline-flex; align-items: center; gap: 6px; }
.palette-empty { padding: 28px; text-align: center; color: var(--muted); }

/* ===================== THEME MENU ===================== */

.dropdown-wrap { position: relative; }
.dropdown {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 170px;
    padding: 6px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface-solid);
    box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px;
    transform-origin: top right; animation: pop-in var(--t) var(--ease-spring);
}
.dropdown button {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
    font: inherit; font-weight: 600; color: var(--muted); background: none; border: 0; cursor: pointer; text-align: left;
}
.dropdown button:hover { background: var(--surface-2); color: var(--text); }
.dropdown button.on { color: var(--text); background: var(--nebula-soft); }
.dropdown button.on::after { content: "•"; margin-left: auto; color: var(--accent); }

/* ===================== NOTIFICATION BELL ===================== */

.icon-btn.bell { position: relative; }
.bell-count {
    position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
    display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; background: var(--danger);
    box-shadow: 0 0 0 2px var(--bg); animation: pop-in var(--t) var(--ease-spring);
}
.notif-menu { width: min(380px, calc(100vw - 32px)); padding: 0; max-height: 70vh; display: flex; flex-direction: column; }
.notif-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.notif-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.dropdown .notif {
    width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 10px;
    font: inherit; text-align: left; color: var(--text); background: none; border: 0; cursor: pointer;
}
.dropdown .notif:hover { background: var(--surface-2); }
.dropdown .notif.unread { background: var(--nebula-soft); }
.notif-emoji { font-size: 16px; line-height: 1.3; }
.notif-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-title { font-weight: 600; }
.notif-body { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { color: var(--faint); font-size: 11.5px; }
.notif-empty { padding: 18px; text-align: center; margin: 0; }

/* Canned replies editor */
.canned-list { display: flex; flex-direction: column; gap: 10px; }
.canned-item { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.canned-pick { align-self: flex-start; max-width: 100%; }
.audit-row { display: flex; align-items: center; gap: 12px; }
.audit-row.undone > .grow > div { text-decoration: line-through; color: var(--muted); }

/* Sortable tables */
.data-table { display: flex; flex-direction: column; gap: 8px; }
.th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; }
.th-sort:hover, .th-sort.on { color: var(--text); }
.th-sort:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
.th-arrow { font-size: 9px; opacity: .5; }
.th-sort.on .th-arrow { opacity: 1; color: var(--accent); }
.table th.num, .table td.num { text-align: right; }
.shortcuts td:first-child { white-space: nowrap; color: var(--muted); }
/* Member picker (temporary access) */
.avatar-sm { width: 24px; height: 24px; border-radius: 50%; flex: none; }
.pick-list { list-style: none; margin: 0; padding: 4px; display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pick-list button { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.pick-list button:hover, .pick-list button:focus-visible { background: var(--surface-2); }

/* Admin > Panel look */
.look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.look-slot { display: flex; gap: 12px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.look-preview { flex: none; width: 110px; height: 72px; border-radius: 10px; display: grid; place-items: center; background: var(--nebula-soft) center / cover no-repeat; border: 1px solid var(--border); }
.look-fields { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }

/* Install as an app */
.install-banner { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; }
.install-banner img { width: 44px; height: 44px; border-radius: 11px; flex: none; box-shadow: 0 6px 18px rgba(110, 100, 255, .35); }
.install-banner strong { display: block; }
.install-steps ol { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.share-glyph { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--surface-3); font-size: 13px; }
@media (max-width: 560px) {
    .install-banner { flex-wrap: wrap; padding-right: 44px; }
    .install-banner .btn.primary { width: 100%; }
    .install-banner .install-hide { position: absolute; top: 10px; right: 10px; }
}
