/* =========================================================
   Prompt Vault design system
   ========================================================= */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font: 'Inter', 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'Cascadia Code', 'JetBrains Mono', ui-monospace, Consolas, monospace;

  /* light */
  --bg: #f4f4f8;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(139, 108, 255, .10), transparent 60%);
  --s1: #ffffff;
  --s2: #f7f7fb;
  --s3: #ececf3;
  --s4: #e2e2ec;
  --line: rgba(20, 20, 50, .09);
  --line-2: rgba(20, 20, 50, .16);
  --text: #16161f;
  --text-2: #4a4a5c;
  --muted: #7a7a8e;
  --accent: #7c5cff;
  --accent-2: #6a48f5;
  --accent-ink: #5b3ce0;
  --accent-soft: rgba(124, 92, 255, .11);
  --grad: linear-gradient(135deg, #8b6cff 0%, #b46cff 55%, #e06cd2 100%);
  --ok: #17a364;
  --warn: #c88a00;
  --bad: #dd4a4a;
  --shadow-1: 0 1px 2px rgba(20, 20, 50, .06), 0 1px 1px rgba(20, 20, 50, .04);
  --shadow-2: 0 8px 28px rgba(20, 20, 60, .10), 0 2px 6px rgba(20, 20, 60, .05);
  --shadow-3: 0 24px 70px rgba(10, 10, 40, .28);
  --r-lg: 16px;
  --r: 12px;
  --r-sm: 9px;
  --side-w: 236px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0f;
    --bg-grad: radial-gradient(1200px 700px at 100% -10%, rgba(139, 108, 255, .13), transparent 60%), radial-gradient(900px 600px at -10% 110%, rgba(224, 108, 210, .07), transparent 60%);
    --s1: #121219; --s2: #17171f; --s3: #1f1f2a; --s4: #282835;
    --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
    --text: #ededf4; --text-2: #b9b9c8; --muted: #8a8a9e;
    --accent: #9a80ff; --accent-2: #8b6cff; --accent-ink: #b8a6ff; --accent-soft: rgba(154, 128, 255, .14);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 10px 30px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
    --shadow-3: 0 30px 80px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0f;
  --bg-grad: radial-gradient(1200px 700px at 100% -10%, rgba(139, 108, 255, .13), transparent 60%), radial-gradient(900px 600px at -10% 110%, rgba(224, 108, 210, .07), transparent 60%);
  --s1: #121219; --s2: #17171f; --s3: #1f1f2a; --s4: #282835;
  --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
  --text: #ededf4; --text-2: #b9b9c8; --muted: #8a8a9e;
  --accent: #9a80ff; --accent-2: #8b6cff; --accent-ink: #b8a6ff; --accent-soft: rgba(154, 128, 255, .14);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 10px 30px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
  --shadow-3: 0 30px 80px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg-grad), var(--bg); background-attachment: fixed;
  color: var(--text); font: 14px/1.5 var(--font); font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
::selection { background: var(--accent-soft); }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .9em; }
code { background: var(--s3); padding: 1px 6px; border-radius: 6px; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
kbd {
  font: 600 11px var(--font); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-2);
  background: var(--s2); color: var(--muted); box-shadow: inset 0 -1px 0 var(--line-2);
}
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { flex: 1; }
.ico { flex: none; display: block; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--s4); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--s1) 70%, transparent); backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: var(--text); font-weight: 750; font-size: 16.5px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 4px 14px rgba(139, 108, 255, .4); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 550; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--s3); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent-ink); }
.nav a.on .ico { color: var(--accent); }
.side-cta { margin: 16px 0 8px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.side-search {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--s2); color: var(--muted); font: inherit; cursor: pointer; text-align: left;
}
.side-search:hover { border-color: var(--line-2); color: var(--text); }
.side-search span { flex: 1; }
.side-row { display: flex; gap: 6px; align-items: center; }
.main { min-width: 0; padding: 26px 30px 60px; max-width: 1560px; width: 100%; }
.view { animation: viewIn .22s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

/* page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; font-weight: 750; letter-spacing: -.03em; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--s1);
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-1);
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s, filter .15s;
}
.btn:hover { background: var(--s2); border-color: var(--line-2); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary, .btn.grad { color: #fff; border-color: transparent; background: var(--grad); box-shadow: 0 6px 20px -6px rgba(139, 108, 255, .65); }
.btn.primary:hover, .btn.grad:hover { filter: brightness(1.07) saturate(1.05); background: var(--grad); }
.btn.big { padding: 11px 20px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; gap: 5px; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--s3); }
.btn.danger { color: var(--bad); }
.btn.danger:not(.ghost) { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn kbd { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .25); color: #fff; box-shadow: none; margin-left: 2px; }
.btn.grad .ico.spin { animation: spin .6s cubic-bezier(.3, .7, .3, 1); }
@keyframes spin { to { transform: rotate(360deg); } }
.file-btn { position: relative; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 30px; height: 30px; padding: 0 7px;
  border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--s3); color: var(--text); }
.icon-btn.on { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.chance { font-size: 11px; font-weight: 700; }

.input {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--s2); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: var(--muted); opacity: .8; }
.input:hover { border-color: color-mix(in srgb, var(--accent) 25%, var(--line-2)); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--s1); }
textarea.input { resize: vertical; line-height: 1.5; }
select.input { width: auto; cursor: pointer; padding-right: 30px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a9e' stroke-width='2.5' 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 10px center; }
.input.w { width: 74px; text-align: center; }
.btn:focus-visible, .icon-btn:focus-visible, .card:focus-visible, .nav a:focus-visible, .chip-btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.search-field { position: relative; display: flex; align-items: center; }
.search-field .ico { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.search-field .input { padding-left: 34px; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; user-select: none; color: var(--text-2); }
.check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.check.wrap { white-space: normal; align-items: flex-start; margin-bottom: 12px; line-height: 1.5; }
.check.wrap input { margin-top: 2px; flex: none; }
label { display: block; }
.lbl, .ed-fields label, .form-grid > label, .row2 > label, .row3 > label {
  display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; margin-bottom: 12px; color: var(--text-2);
}
.lbl small, .ed-fields small, .form-grid small { font-weight: 450; color: var(--muted); }
.ed-fields label.check, .form-grid label.check { flex-direction: row; font-weight: 500; }
.hint { margin-top: 2px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row2 select.input, .row3 select.input, .form-grid select.input { width: 100%; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.seg { display: inline-flex; background: var(--s3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--muted); padding: 5px 11px; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600; transition: background .15s, color .15s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--s1); color: var(--text); box-shadow: var(--shadow-1); }

.switch { position: relative; width: 36px; height: 21px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--s4); border-radius: 21px; transition: .18s; }
.switch span::after { content: ''; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .18s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(15px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
  background: var(--s3); color: var(--text-2); white-space: nowrap; border: 1px solid transparent;
}
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge.base { border-color: var(--line-2); background: transparent; }
.badge.base.warn { border-color: var(--warn); color: var(--warn); }
.badge.base.bad { border-color: var(--bad); color: var(--bad); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--accent)) 20%, transparent); }

/* ---------- Surfaces ---------- */
.panel {
  background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow-1);
}
.panel > p { margin: 0 0 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h3 { display: flex; align-items: center; gap: 8px; }
.panel-head h3 .ico { color: var(--accent); }
details.panel > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 650; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary .ico.chev { margin-left: auto; color: var(--muted); transition: transform .2s; }
details.panel[open] > summary { margin-bottom: 12px; }
details.panel[open] > summary .ico.chev { transform: rotate(180deg); }
.empty {
  padding: 34px 18px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty .ico { color: var(--accent); opacity: .8; }
.empty.small { padding: 16px; gap: 6px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar > .input.grow, .toolbar > .search-field { flex: 1 1 240px; }
.tb-title { font-size: 20px; margin-right: 6px; }
.tb-field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.tb-field .inline { display: flex; gap: 6px; }

/* ---------- Thumbs ---------- */
.thumb, .mini { object-fit: cover; background: var(--s3); display: block; }
.ph {
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c, var(--accent)) 75%, #000), color-mix(in srgb, var(--c, var(--accent)) 35%, #000));
}
.ph .ph-init { font-weight: 800; letter-spacing: -.03em; opacity: .95; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.mini { width: 38px; height: 38px; border-radius: 9px; flex: none; font-size: 14px; }
.mini.ph .ph-init { font-size: 13px; }

/* ---------- Builder ---------- */
.b-controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px 16px; margin-bottom: 18px;
  background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1);
}
.b-controls .grow { flex: 1 1 200px; }
.b-controls .tb-field select.input { min-width: 120px; }
.b-controls .check { align-self: center; padding-bottom: 2px; }
.chip-toggle {
  display: inline-flex; align-items: center; gap: 6px; align-self: center; padding: 8px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--s2); color: var(--text-2); font: inherit; font-weight: 600; font-size: 13px;
}
.chip-toggle.on { background: color-mix(in srgb, #f5b400 14%, transparent); border-color: color-mix(in srgb, #f5b400 50%, transparent); color: #e0a200; }
.b-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); gap: 20px; align-items: start; }
.b-right { position: sticky; top: 20px; }

/* hero (character) slot */
.hero {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; margin-bottom: 16px; overflow: hidden;
  background: var(--s1); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-2);
}
.hero::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); opacity: .9;
}
.hero.locked { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.hero-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.hero-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: start; }
.hero-row + .hero-row { padding-top: 14px; border-top: 1px solid var(--line); }
.hero-img { position: relative; width: 150px; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-2); cursor: pointer; }
.hero-img .thumb { width: 100%; height: 100%; }
.hero-img .ph .ph-init { font-size: 46px; }
.hero-info { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.hero-name-row { display: flex; align-items: flex-start; gap: 8px; }
.hero-name { font-size: 26px; font-weight: 780; letter-spacing: -.03em; line-height: 1.1; cursor: pointer; }
.hero-name:hover { color: var(--accent-ink); }
.hero-name-row .icon-btn { margin-left: auto; }
.hero-prompt { color: var(--muted); font-family: var(--mono); font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.outfits { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.outfits-head { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.outfits-head .icon-btn { height: 24px; min-width: 24px; padding: 0 5px; }
.outfit-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 4px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--s2); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600;
  transition: all .15s;
}
.chip-btn.noimg { padding-left: 11px; }
.chip-btn img, .chip-btn .ph { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; font-size: 10px; }
.chip-btn:hover { border-color: var(--accent); color: var(--text); }
.chip-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.hero-empty {
  display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 14px; border: 1.5px dashed var(--line-2); color: var(--muted);
}
.hero-empty .ph-big { width: 74px; aspect-ratio: 3/4; border-radius: 12px; display: grid; place-items: center; background: var(--s3); color: var(--accent); }

/* regular slots */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 18px; }
.slot {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 12px;
  background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.slot:hover { border-color: var(--line-2); }
.slot.locked { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--s1); }
.slot-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.slot-title { display: flex; align-items: center; gap: 8px; font-weight: 650; min-width: 0; }
.slot-title small { font-weight: 600; }
.slot.neg .slot-title { color: var(--bad); }
.slot-btns { display: inline-flex; gap: 1px; align-items: center; }
.slot-btns .icon-btn { height: 28px; min-width: 28px; padding: 0 5px; }
.slot-body { display: flex; flex-direction: column; gap: 6px; min-height: 44px; }
.slot-item {
  display: flex; align-items: center; gap: 10px; padding: 4px; padding-right: 2px; border-radius: 11px; background: var(--s2); border: 1px solid var(--line);
}
.slot-item .mini { width: 36px; height: 36px; border-radius: 8px; }
.slot-item-name { flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: var(--text); font: inherit; font-weight: 600; }
.slot-item-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-item-name small { display: block; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.slot-item-name:hover span { color: var(--accent-ink); }
.slot-add {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px; border-radius: 11px; cursor: pointer;
  border: 1.5px dashed var(--line-2); background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 13px; transition: all .15s;
}
.slot-add:hover { border-color: var(--c, var(--accent)); color: var(--text); background: color-mix(in srgb, var(--c, var(--accent)) 7%, transparent); }
.slot-add.sm { padding: 5px; }
.slot-note { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.flash { animation: flash .7s ease; }
@keyframes flash {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); transform: scale(.985); }
  60% { box-shadow: 0 0 0 6px transparent; transform: scale(1); }
}

/* LoRA stack */
.lora-list { display: flex; flex-direction: column; gap: 8px; }
.lora-row {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) minmax(90px, 170px) auto auto auto; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 12px; background: var(--s2); border: 1px solid var(--line); transition: opacity .2s;
}
.lora-row.off { opacity: .45; }
.lora-row.bad { border-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.lora-row input[type=range] { width: 100%; accent-color: var(--accent); }
.lr-name { min-width: 0; }
.lr-meta { display: flex; gap: 6px; align-items: center; overflow: hidden; white-space: nowrap; margin-top: 2px; }
.lr-meta .mono { overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.link { border: 0; background: none; padding: 0; color: var(--text); font: inherit; font-weight: 650; cursor: pointer; text-align: left; }
.link:hover { color: var(--accent-ink); }

/* Output */
.out { background: var(--s1); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow-2); }
.out-block { margin-bottom: 16px; }
.out-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.out-head h3 { display: flex; align-items: center; gap: 7px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.out-head .actions { display: flex; gap: 4px; align-items: center; }
.prompt-view {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.85; padding: 12px; border-radius: 12px; background: var(--s2);
  border: 1px solid var(--line); max-height: 320px; overflow-y: auto; word-break: break-word;
}
.prompt-view .seg-part {
  border-radius: 5px; padding: 1px 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone;
  background: color-mix(in srgb, var(--c, var(--muted)) 13%, transparent); box-shadow: inset 0 -1.5px 0 color-mix(in srgb, var(--c, var(--muted)) 60%, transparent);
}
.prompt-view .seg-part.plain { background: none; box-shadow: none; color: var(--text-2); }
.prompt-view .seg-sep { color: var(--muted); }
.prompt-view.empty-prompt { color: var(--muted); font-family: var(--font); }
.out-text { font-family: var(--mono); font-size: 12.5px; background: var(--s2); }
.out-text.neg { color: color-mix(in srgb, var(--bad) 65%, var(--text)); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend .dot { width: 7px; height: 7px; box-shadow: none; }
.lora-out { margin: 0 0 6px; padding: 10px 12px; background: var(--s2); border: 1px solid var(--line); border-radius: 12px; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.out-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.warnings {
  background: color-mix(in srgb, var(--warn) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px;
}
.warnings div { display: flex; gap: 7px; align-items: flex-start; }
.warnings .ico { color: var(--warn); margin-top: 2px; }
.ref-strip { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 2px; }
.ref-strip img { width: 58px; height: 74px; object-fit: cover; border-radius: 10px; flex: none; box-shadow: var(--shadow-1); }
.tokens { font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* ---------- Cards (library, picker) ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; background: var(--s1); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; cursor: pointer; box-shadow: var(--shadow-1);
  transition: transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .18s, border-color .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.card.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.card-media { position: relative; aspect-ratio: 1 / 1; background: var(--s3); overflow: hidden; }
.card.portrait .card-media { aspect-ratio: 3 / 4; }
.card-media .thumb { width: 100%; height: 100%; transition: transform .4s ease; }
.card:hover .card-media .thumb { transform: scale(1.04); }
.card-media .ph .ph-init { font-size: 40px; }
.card-media::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 55%; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, .35) 50%, transparent);
}
.card-overlay { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 10px 12px; color: #fff; }
.card-title { font-weight: 720; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 8px rgba(0, 0, 0, .4); }
.card-source { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-body { padding: 9px 12px 11px; display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.card-sub { color: var(--muted); font-size: 11.5px; font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub.clamp3 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.card-tags:empty { display: none; }
.card-top { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 2; display: flex; gap: 6px; justify-content: flex-end; }
.card-top .tl { margin-right: auto; display: flex; gap: 6px; }
.glass-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; border: 0; cursor: pointer;
  background: rgba(10, 10, 20, .5); backdrop-filter: blur(8px); color: rgba(255, 255, 255, .9); opacity: 0; transform: translateY(-3px);
  transition: opacity .15s, transform .15s, background .15s;
}
.glass-btn:hover { background: var(--accent-2); }
.card:hover .glass-btn, .card:focus-within .glass-btn, .glass-btn.on { opacity: 1; transform: none; }
.glass-btn.on { color: #ffc93d; }
.glass-btn.on .ico { fill: currentColor; }
.glass-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 9px; background: rgba(10, 10, 20, .55); backdrop-filter: blur(8px); color: #fff; font-size: 11px; font-weight: 700; }
.card-actions { position: absolute; z-index: 2; left: 8px; right: 8px; top: calc(100% - 0px); display: none; }
.card .hover-actions {
  position: absolute; z-index: 2; inset: auto 8px 8px 8px; display: flex; gap: 6px; opacity: 0; transform: translateY(6px); transition: opacity .15s, transform .15s;
}
.card:hover .hover-actions, .card:focus-within .hover-actions { opacity: 1; transform: none; }
.card:has(.hover-actions):hover .card-overlay, .card:has(.hover-actions):focus-within .card-overlay { opacity: 0; }
.card-overlay { transition: opacity .15s; }
.hover-actions .btn { flex: 1; backdrop-filter: blur(8px); background: rgba(255, 255, 255, .92); color: #15151f; border-color: transparent; }
.hover-actions .btn.grad { background: var(--grad); color: #fff; }
.card.compact .card-media { aspect-ratio: 4 / 3; }
.card.compact.portrait .card-media { aspect-ratio: 3 / 4; }
.card.compact .card-title { font-size: 13.5px; }
.grid.presets { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid.presets .card-media { aspect-ratio: 16 / 10; }
.preset-actions { display: flex; gap: 4px; padding: 0 10px 10px; flex-wrap: wrap; }

/* ---------- Library ---------- */
.lib { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; }
.lib-side { position: sticky; top: 20px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.side-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 10px 4px; }
.side-btn {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px;
  border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 550; cursor: pointer; text-align: left; transition: background .15s, color .15s;
}
.side-btn > span { display: flex; align-items: center; gap: 9px; min-width: 0; }
.side-btn small { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.side-btn:hover { background: var(--s3); color: var(--text); }
.side-btn.on { background: var(--s1); color: var(--text); box-shadow: var(--shadow-1); border: 1px solid var(--line); padding: 7px 9px; }
.side-sep { height: 1px; background: var(--line); margin: 6px 6px; }
.tag-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tag {
  border: 1px solid var(--line-2); background: var(--s1); color: var(--text-2); border-radius: 20px; padding: 4px 11px;
  cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 550; transition: all .15s;
}
.tag small { color: var(--muted); }
.tag:hover { border-color: var(--accent); }
.tag.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag.on small { color: rgba(255, 255, 255, .8); }
.group-head { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; font-size: 16px; font-weight: 750; margin: 14px 0 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.group-head:first-child { margin-top: 0; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(6, 6, 12, .6); backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; animation: fade .15s;
}
.modal {
  width: 100%; max-width: 460px; background: var(--s1); border: 1px solid var(--line-2); border-radius: 20px; padding: 22px;
  box-shadow: var(--shadow-3); animation: pop .2s cubic-bezier(.2, .9, .3, 1.15);
}
.modal.wide { max-width: 980px; }
.modal h3 { margin-bottom: 12px; font-size: 18px; font-weight: 720; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.97); opacity: 0; } }

/* editor */
.ed-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.ed-head h3 { margin: 0; flex: 1; }
.ed-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; }
.ed-img { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; align-self: start; }
.drop {
  aspect-ratio: 3 / 4; border: 1.5px dashed var(--line-2); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-align: center; color: var(--muted); cursor: pointer; overflow: hidden; background: var(--s2); font-size: 13px; transition: all .15s;
}
.drop.square { aspect-ratio: 1 / 1; }
.drop.big { aspect-ratio: auto; padding: 30px; margin-bottom: 12px; }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.drop img { width: 100%; height: 100%; object-fit: cover; }
.ed-img-actions { display: flex; gap: 6px; }
.ed-img-actions .btn { flex: 1; }
.ed-section { padding: 14px 0 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.ed-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.ed-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.ed-section-head .ico { color: var(--accent); }
.ed-section-head small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); margin-left: auto; }
.linked { display: flex; flex-direction: column; gap: 8px; }
.linked select.input { width: 100%; }
.link-row { display: flex; align-items: center; gap: 10px; padding: 4px; border-radius: 10px; background: var(--s2); border: 1px solid var(--line); }
.input-wrap { position: relative; display: block; }
.input-wrap .input { padding-right: 42px; }
.in-btn {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 32px; height: 30px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--muted);
}
.in-btn:hover { background: var(--accent-soft); color: var(--accent-ink); }
.fav-toggle { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--s2); color: var(--muted); cursor: pointer; }
.fav-toggle.on { color: #f5b400; border-color: color-mix(in srgb, #f5b400 50%, transparent); background: color-mix(in srgb, #f5b400 12%, transparent); }
.fav-toggle.on .ico { fill: currentColor; }
.modal-foot { position: sticky; bottom: -22px; margin: 18px -22px -22px; padding: 14px 22px; background: color-mix(in srgb, var(--s1) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); border-radius: 0 0 20px 20px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* outfit editor */
.variant-list { display: flex; flex-direction: column; gap: 10px; }
.variant-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; padding: 10px; border-radius: 14px; background: var(--s2); border: 1px solid var(--line); }
.variant-row .drop { aspect-ratio: 3 / 4; border-radius: 10px; font-size: 11px; gap: 2px; }
.variant-fields { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.variant-fields .input { padding: 7px 10px; }
.variant-lora { display: flex; gap: 6px; }
.variant-lora select.input { flex: 1; width: auto; min-width: 0; }

/* picker */
.picker-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.picker-head h3 { margin: 0 8px 0 0; display: flex; align-items: center; gap: 8px; }
.picker-head .search-field { flex: 1; min-width: 180px; }
.picker-grid { max-height: 60vh; overflow-y: auto; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 4px 2px; }
.picker-hint { margin: 4px 0 12px; }

/* random character */
.rc .modal-actions { margin-top: 18px; }
.rc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.rc-head h3 { margin: 0 auto 0 0; display: flex; align-items: center; gap: 8px; }
.rc-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; animation: pop .25s cubic-bezier(.2, .9, .3, 1.15); }
.rc-img .thumb, .rc-img .ph { width: 100%; aspect-ratio: 3 / 4; border-radius: 16px; box-shadow: var(--shadow-2); }
.rc-img .ph .ph-init { font-size: 64px; }
.rc-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rc-name { font-size: 30px; font-weight: 800; line-height: 1.05; letter-spacing: -.035em; }
.rc-info .lora-out { margin: 0; }

/* ---------- History / import ---------- */
.hist { display: flex; flex-direction: column; gap: 10px; }
.hist-row, .parsed { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; box-shadow: var(--shadow-1); }
.hist-pos { font-family: var(--mono); font-size: 12.5px; margin: 6px 0; word-break: break-word; line-height: 1.6; }
.hist-neg { font-family: var(--mono); font-size: 12px; color: color-mix(in srgb, var(--bad) 65%, var(--text)); margin-bottom: 4px; word-break: break-word; }
.hist-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.parsed { display: flex; gap: 14px; margin-bottom: 10px; background: var(--s2); }
.parsed > img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; flex: none; }
.parsed.err { color: var(--bad); display: block; }
.scan-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 14px 0; }
.scan-list { max-height: 460px; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; }
.scan-row { display: flex; gap: 12px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.scan-row:hover { background: var(--s2); }
.scan-row:last-child { border-bottom: 0; }
.scan-row.exists { opacity: .7; }
.scan-row input { accent-color: var(--accent); }
.scan-row .mini { width: 48px; height: 48px; }
.import { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; align-items: start; }
.import .panel { margin: 0; }

/* ---------- Settings ---------- */
.settings { max-width: 900px; }
.cat-list { display: flex; flex-direction: column; gap: 6px; }
.cat-row { display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 12px; background: var(--s2); border: 1px solid var(--line); }
.icon-in { width: 52px; text-align: center; flex: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .check { white-space: normal; align-self: center; }

/* ---------- Command palette ---------- */
.palette-backdrop { align-items: flex-start; padding-top: 12vh; }
.palette { max-width: 620px; padding: 0; overflow: hidden; }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.palette-search .ico { color: var(--muted); }
.palette-search input { flex: 1; border: 0; background: transparent; color: var(--text); font: 500 16px var(--font); outline: none; }
.palette-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.palette-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.palette-item .mini { width: 34px; height: 34px; }
.palette-item .pi-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--s3); color: var(--accent); flex: none; }
.palette-item .pi-text { flex: 1; min-width: 0; }
.palette-item .pi-text b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .pi-text small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item.on { background: var(--accent-soft); }
.palette-item.on .pi-hint { opacity: 1; }
.pi-hint { opacity: 0; font-size: 11.5px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.palette-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.palette-empty { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; background: var(--s1); color: var(--text); border: 1px solid var(--line-2);
  padding: 10px 14px; border-radius: 12px; box-shadow: var(--shadow-2); animation: toastIn .25s cubic-bezier(.2, .9, .3, 1.2);
  transition: opacity .3s, transform .3s; max-width: 380px; font-weight: 550;
}
.toast .ico { color: var(--accent); }
.toast.ok .ico { color: var(--ok); }
.toast.err .ico { color: var(--bad); }
.toast.out { opacity: 0; transform: translateX(20px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.fatal { max-width: 560px; margin: 15vh auto; padding: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .b-cols { grid-template-columns: 1fr; }
  .b-right { position: static; }
}
@media (max-width: 900px) {
  :root { --side-w: 72px; }
  .sidebar { padding: 14px 10px; align-items: center; }
  .brand-name, .nav a span, .side-cta .lbl-txt, .side-search span, .side-search kbd, .side-cta kbd { display: none; }
  .brand { padding: 4px 0 14px; }
  .nav a { padding: 10px; justify-content: center; }
  .side-search { justify-content: center; padding: 10px; }
  .side-cta { padding: 11px; }
  .lib { grid-template-columns: 1fr; }
  .lib-side { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .side-btn { flex: none; }
  .side-sep, .side-label { display: none; }
}
@media (max-width: 640px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 30; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px 8px;
    border-right: 0; border-top: 1px solid var(--line); justify-content: space-around;
  }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; gap: 0; flex: 1; justify-content: space-around; }
  .side-cta { margin: 0; width: auto; flex: none; padding: 10px 14px; }
  .main { padding: 16px 14px 90px; }
  .page-head h1 { font-size: 22px; }
  .hero-row { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .hero-img { width: 96px; }
  .hero-name { font-size: 20px; }
  .ed-grid, .rc-body { grid-template-columns: 1fr; }
  .ed-img { position: static; max-width: 200px; }
  .rc-img { max-width: 200px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .lora-row { grid-template-columns: auto auto minmax(0, 1fr) auto auto; }
  .lora-row input[type=range] { grid-column: 1 / -1; grid-row: 2; }
  .lora-row .input.w { display: none; }
  .form-grid, .row2, .row3, .import { grid-template-columns: 1fr; }
  .out-actions { grid-template-columns: 1fr; }
  .parsed { flex-direction: column; }
  #toasts { bottom: 80px; right: 12px; left: 12px; align-items: stretch; }
}
@media (hover: none) {
  .glass-btn, .card .hover-actions { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.card.drop-target, .grid.drop-target { outline: 2px dashed var(--accent); outline-offset: 4px; }

/* ---------- Updates ---------- */
.update-banner {
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; margin-bottom: 4px;
  background: var(--s2); border: 1px solid var(--line-2); font-size: 12.5px; animation: toastIn .25s ease;
}
.update-banner.ready { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.ub-row { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-2); }
.ub-row .ub-text { flex: 1; }
.update-banner .ico { color: var(--accent); }
.update-banner .btn .ico { color: #fff; }
.ub-bar { height: 5px; border-radius: 5px; background: var(--s4); overflow: hidden; }
.ub-bar.big { height: 7px; margin-top: 12px; }
.ub-bar span { display: block; height: 100%; background: var(--grad); border-radius: inherit; transition: width .3s ease; }
.about-row { display: flex; align-items: center; gap: 14px; }
.about-logo { width: 46px; height: 46px; border-radius: 12px; box-shadow: 0 6px 18px rgba(139, 108, 255, .35); }
@media (max-width: 900px) {
  .update-banner { padding: 8px; align-items: center; }
  .update-banner .ub-text, .update-banner .ub-row b { display: none; }
  .update-banner .ub-bar { width: 100%; }
}
@media (max-width: 640px) { #update-banner { display: none; } }

/* ---------- Backups ---------- */
.bk-folder { display: flex; align-items: center; gap: 10px; margin: 12px 0; min-width: 0; }
.bk-folder code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bk-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.bk-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: var(--s2); border: 1px solid var(--line); }
.bk-kind { flex: none; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px; background: var(--s3); color: var(--text-2); min-width: 98px; text-align: center; }
.bk-kind.manual { background: var(--accent-soft); color: var(--accent-ink); }
.bk-kind.before-update { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.bk-kind.before-restore { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
@media (max-width: 640px) { .bk-kind { min-width: 0; } }
