/* ============================================================
   Print Profiles — design system
   ============================================================ */

:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #fafbfc;
    --ink: #16181d;
    --ink-2: #3f4551;
    --muted: #7c8494;
    --border: #e6e8ee;
    --border-strong: #d6dae2;

    --accent: #e8590c;
    --accent-hover: #d34f0a;
    --accent-soft: #fdeee3;
    --accent-ring: rgba(232, 89, 12, .18);

    --success: #148a4c;
    --success-soft: #e6f6ec;
    --warning: #b45309;
    --warning-soft: #fdf3e0;
    --danger: #d3312f;
    --danger-soft: #fdeceb;
    --info: #47536b;
    --info-soft: #eef1f6;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(22, 24, 29, .05);
    --shadow: 0 1px 2px rgba(22, 24, 29, .04), 0 4px 12px -2px rgba(22, 24, 29, .06);
    --shadow-lg: 0 4px 10px rgba(22, 24, 29, .06), 0 16px 32px -8px rgba(22, 24, 29, .12);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    font-feature-settings: 'cv02', 'cv03', 'cv11';
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.015em; line-height: 1.25; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { flex-shrink: 0; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 28px; }

::selection { background: var(--accent-soft); color: var(--ink); }

/* ---------- Turbo progress bar ---------- */
.turbo-progress-bar { height: 2px; background: var(--accent); }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    border-bottom: 1px solid var(--border);
}

.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(145deg, #ff7a2f 0%, var(--accent) 60%, #c44608 100%);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 2px 6px rgba(232, 89, 12, .35);
}
.brand-name { font-size: 15.5px; font-weight: 700; letter-spacing: -0.02em; }
.brand-name em { font-style: normal; color: var(--accent); }

.topbar-nav { display: flex; align-items: center; gap: 6px; }
.topbar-toggle {
    display: none;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}
.topbar-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.topbar-toggle-close { display: none; }
.topbar-toggle[aria-expanded="true"] .topbar-toggle-open { display: none; }
.topbar-toggle[aria-expanded="true"] .topbar-toggle-close { display: inline-flex; }
.topbar-link {
    padding: 7px 12px;
    border-radius: 8px;
    color: var(--ink-2);
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.topbar-link:hover { background: var(--info-soft); color: var(--ink); }

/* ---------- Page scaffolding ---------- */
.page { padding: 34px 28px 64px; }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--muted);
}
.breadcrumb a { color: var(--muted); transition: color .15s ease; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb svg { opacity: .55; }
.breadcrumb .current { color: var(--ink-2); font-weight: 500; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-header h1 { font-size: 24px; }
.page-subtitle { margin-top: 6px; color: var(--muted); font-size: 14px; max-width: 62ch; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.footer {
    padding: 22px 28px 40px;
    color: var(--muted);
    font-size: 12.5px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    font: inherit;
    font-size: 13.5px;
    font-weight: 560;
    letter-spacing: -0.006em;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease, color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }

.btn-primary {
    background: var(--ink);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), var(--shadow-sm);
}
.btn-primary:hover { background: #2b2e36; }

.btn-accent {
    background: var(--accent);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 3px rgba(232, 89, 12, .4);
}
.btn-accent:hover { background: var(--accent-hover); }

.btn-secondary { background: var(--surface); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: #c2c8d2; background: var(--surface-2); }

.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--info-soft); }

.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }

.btn[disabled], .is-submitting .btn[type=submit] { opacity: .6; pointer-events: none; }

/* ---------- Pills & badges ---------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 570;
    letter-spacing: 0;
    line-height: 1.5;
    white-space: nowrap;
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.pill-slate { background: var(--info-soft); color: var(--info); }
.pill-green { background: var(--success-soft); color: var(--success); }
.pill-amber { background: var(--warning-soft); color: var(--warning); }
.pill-red { background: var(--danger-soft); color: var(--danger); }
.pill-accent { background: var(--accent-soft); color: var(--accent-hover); }
.pill-outline { background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink-2); }

/* ---------- Version rating ---------- */
.rating-compact {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #fff6d8;
    color: #8a5a00;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}
.rating-compact span { color: #f2a900; font-size: 14px; line-height: 1; }
.rating-field { margin-bottom: 18px; }
.rating-stars {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    max-width: 280px;
}
.rating-star {
    display: grid;
    place-items: center;
    width: 100%;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--border-strong);
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
    transition: color .12s ease, background .12s ease, transform .08s ease;
}
.rating-star:hover { background: #fff8e5; transform: translateY(-1px); }
.rating-star.is-filled { color: #f2a900; }
.rating-star:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.rating-meta { display: flex; align-items: center; gap: 12px; margin-top: 5px; }
.rating-output { color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.rating-clear {
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 12.5px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.rating-clear:hover { color: var(--ink); }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}
.card-title { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 620; letter-spacing: -0.01em; }
.card-title svg { color: var(--muted); }
.card-body { padding: 20px; }
.card-body--flush { padding: 0; }

/* interactive card (model tiles) */
.card-link { display: block; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.card-link:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.stat-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--info-soft);
    color: var(--ink-2);
}
.stat-icon--accent { background: var(--accent-soft); color: var(--accent); }
.stat-icon--green { background: var(--success-soft); color: var(--success); }
.stat-value { font-size: 20px; font-weight: 680; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ---------- Model grid ---------- */
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.model-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; min-height: 148px; }
.model-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.model-card h2 { font-size: 15.5px; }
.model-card-desc {
    color: var(--muted);
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.model-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12.5px; }
.model-card-meta .arrow { color: var(--border-strong); transition: color .15s ease, transform .15s ease; }
.card-link:hover .arrow { color: var(--accent); transform: translateX(2px); }

/* ---------- Search ---------- */
.search {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.search svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input {
    width: 240px;
    padding: 9px 12px 9px 38px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font: inherit;
    font-size: 13.5px;
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th {
    padding: 10px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 640;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}
.table tbody td { padding: 13px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr[data-href]:hover { background: var(--surface-2); }
.table .num { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.table .row-arrow { color: var(--border-strong); }
.table tbody tr:hover .row-arrow { color: var(--accent); }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.label { display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); letter-spacing: -0.004em; }

.input, select.input, textarea.input {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 13.5px;
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.6; }
select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237c8494' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
}

.help { margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.errors { margin: 6px 0 0; padding: 0; list-style: none; color: var(--danger); font-size: 12.5px; font-weight: 500; }
.field--invalid .input { border-color: var(--danger); }
.field--invalid .input:focus { box-shadow: 0 0 0 3px rgba(211, 49, 47, .15); }

.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 24px; }

/* centered form page */
.form-page { max-width: 560px; margin: 0 auto; }

/* ---------- Dropzone ---------- */
.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 30px 20px;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type=file], [data-dropzone] input[type=file] { display: none; }
.dropzone-icon { color: var(--muted); transition: color .15s ease, transform .2s ease; }
.dropzone:hover .dropzone-icon, .dropzone.is-drag .dropzone-icon { color: var(--accent); transform: translateY(-2px); }
.dropzone-title { font-size: 13.5px; font-weight: 600; }
.dropzone-hint { color: var(--muted); font-size: 12.5px; }

.dropzone--hero { padding: 56px 24px; }
.dropzone--hero .dropzone-title { font-size: 15.5px; }

/* upload overlay */
form.is-uploading { position: relative; }
form.is-uploading .dropzone { pointer-events: none; opacity: .45; }
form.is-uploading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 26px;
    height: 26px;
    border: 2.5px solid var(--accent-soft);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    z-index: 2;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Spec chips ---------- */
.spec-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
}
.spec-chip { display: flex; align-items: center; gap: 12px; padding: 15px 18px; background: var(--surface); }
.spec-chip svg { color: var(--muted); }
.spec-chip-value { font-family: var(--mono); font-size: 15px; font-weight: 620; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.spec-chip-value small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.spec-chip-label { color: var(--muted); font-size: 11.5px; margin-top: 1px; }

/* ---------- Version layout ---------- */
.version-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.version-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.version-rail { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 84px; }
@media (max-width: 1080px) {
    .version-layout { grid-template-columns: 1fr; }
    .version-rail { position: static; order: -1; }
}

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.def-list { margin: 0; padding: 6px 0; }
.def-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 20px;
}
.def-row + .def-row { border-top: 1px solid var(--surface-2); }
.def-key { color: var(--muted); font-size: 12.5px; }
.def-val {
    font-family: var(--mono);
    font-size: 12.5px;
    font-weight: 560;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}
.def-val small { color: var(--muted); font-weight: 450; }

/* ---------- Filaments ---------- */
.swatch {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
    display: inline-block;
    vertical-align: -3px;
}
.filament-active-row { background: var(--accent-soft) !important; }
.hex { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-transform: uppercase; }

/* ---------- Plates ---------- */
.plate-panel {
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .045), transparent 45%),
        linear-gradient(180deg, #191c22, #101318);
    border-radius: var(--radius-sm);
    padding: 20px;
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.plate-panel img { max-height: 320px; border-radius: 8px; }
.plate-side { display: flex; flex-direction: column; gap: 10px; }
.plate-side img { max-height: 96px; border-radius: 6px; }
.plate-side-label { color: rgba(255, 255, 255, .5); font-size: 11px; text-align: center; letter-spacing: .05em; text-transform: uppercase; }
.plate-caption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px 0; }
.plate-caption .name { font-weight: 600; font-size: 13px; }
.plate-caption .objects { color: var(--muted); font-size: 12.5px; }

/* ---------- Photos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.photo-tile { position: relative; }
.photo-tile-img {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-2);
    cursor: zoom-in;
}
.photo-tile-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .25s ease; }
.photo-tile-img:hover img { transform: scale(1.03); }
.photo-tile-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity .15s ease;
}
.photo-tile:hover .photo-tile-actions { opacity: 1; }
.icon-btn {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: rgba(16, 18, 24, .62);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background .15s ease;
}
.icon-btn:hover { background: rgba(211, 49, 47, .92); }
.caption-input {
    width: 100%;
    margin-top: 7px;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    font: inherit;
    font-size: 12.5px;
    color: var(--ink-2);
    transition: border-color .15s ease, background .15s ease;
}
.caption-input::placeholder { color: var(--muted); }
.caption-input:hover { background: var(--info-soft); }
.caption-input:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

.photo-upload-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    aspect-ratio: 4 / 3;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 550;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.photo-upload-tile:hover, .photo-upload-tile.is-drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
form.photo-upload-tile { position: relative; margin: 0; }
form.photo-upload-tile.is-uploading { opacity: .55; pointer-events: none; }

/* ---------- Meta list (rail) ---------- */
.meta-list { display: flex; flex-direction: column; }
.meta-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 0; font-size: 13px; }
.meta-row + .meta-row { border-top: 1px solid var(--surface-2); }
.meta-key { color: var(--muted); }
.meta-val { font-weight: 550; text-align: right; overflow-wrap: anywhere; }
.meta-val.num { font-family: var(--mono); font-size: 12.5px; }

/* ---------- Empty state ---------- */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 64px 24px;
    text-align: center;
}
.empty-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--info-soft);
    color: var(--muted);
    margin-bottom: 4px;
}
.empty h3 { font-size: 15px; }
.empty p { color: var(--muted); font-size: 13px; max-width: 42ch; }
.empty .btn { margin-top: 10px; }

/* ---------- Toasts ---------- */
#toasts {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #1b1e24;
    color: #f4f5f7;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    line-height: 1.45;
    animation: toast-in .25s cubic-bezier(.21, 1.02, .73, 1);
}
.toast.is-leaving { animation: toast-out .2s ease forwards; }
.toast svg { margin-top: 1px; }
.toast--success svg { color: #4ade80; }
.toast--danger svg { color: #f87171; }
.toast-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .55);
    cursor: pointer;
    padding: 2px;
    border-radius: 6px;
}
.toast-close:hover { color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px) scale(.97); } }

/* ---------- Lightbox ---------- */
dialog.lightbox {
    border: none;
    border-radius: 16px;
    padding: 0;
    background: transparent;
    max-width: min(92vw, 1100px);
    max-height: 90vh;
    overflow: visible;
}
dialog.lightbox::backdrop { background: rgba(12, 14, 18, .78); backdrop-filter: blur(6px); }
dialog.lightbox img { max-width: min(92vw, 1100px); max-height: 86vh; border-radius: 14px; box-shadow: var(--shadow-lg); }
.lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
}

/* ---------- Login ---------- */
.login-page {
    min-height: calc(100vh - 68px);
    display: grid;
    place-items: center;
    padding: 48px 0;
}

.login-card {
    width: min(100%, 420px);
    padding: 28px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.login-brand h1 {
    font-size: 22px;
    margin-bottom: 2px;
}

.login-brand h1 em {
    font-style: normal;
    color: var(--accent);
}

.login-subtitle {
    color: var(--muted);
    font-size: 13px;
}

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

.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(211, 49, 47, .18);
}

.topbar-user {
    padding: 7px 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }
.text-muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

@media (max-width: 720px) {
    .topbar-inner {
        height: auto;
        min-height: 60px;
        flex-wrap: wrap;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .topbar-toggle { display: grid; }
    .topbar-nav {
        display: none;
        flex: 0 0 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding-top: 10px;
        margin-top: 10px;
        border-top: 1px solid var(--border);
    }
    .topbar-nav.is-open { display: flex; }
    .topbar-nav .topbar-link,
    .topbar-nav .btn {
        width: 100%;
        min-height: 44px;
        justify-content: flex-start;
        padding: 10px 12px;
        font-size: 14px;
    }
    .topbar-nav .btn-primary { justify-content: center; order: -1; }
    .topbar-user {
        width: 100%;
        padding: 10px 12px 4px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .version-table th,
    .version-table td { padding-left: 10px; padding-right: 10px; }
    .version-table th:nth-child(n+4),
    .version-table td:nth-child(n+4) { display: none; }
    .page { padding: 24px 18px 48px; }
    .container { padding: 0 18px; }
    .page-header h1 { font-size: 20px; }
    .search input { width: 100%; }
}
