/* EquSign admin – modern design, ljust & mörkt tema */
:root {
  --accent: #6366f1;
  --accent-2: #a855f7;
  --accent-soft: color-mix(in oklab, var(--accent) 12%, transparent);
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;
  --line: #e6e8f0;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;

  --t-image: #3b82f6; --t-video: #ec4899; --t-html: #10b981;

  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / .06);
  --shadow: 0 1px 3px rgb(15 23 42 / .06), 0 8px 24px -8px rgb(15 23 42 / .10);
  --shadow-lg: 0 24px 64px -12px rgb(15 23 42 / .30);

  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] {
  --bg: #0b0d14; --surface: #12151f; --surface-2: #1a1e2b; --text: #e8eaf2; --text-2: #a3abc2; --muted: #6b7390; --line: #242a3a;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -8px rgb(0 0 0 / .5);
  --shadow-lg: 0 24px 64px -12px rgb(0 0 0 / .7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d14; --surface: #12151f; --surface-2: #1a1e2b; --text: #e8eaf2; --text-2: #a3abc2; --muted: #6b7390; --line: #242a3a;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -8px rgb(0 0 0 / .5);
    --shadow-lg: 0 24px 64px -12px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
button, input, select { font: inherit; color: inherit; }
.sub { color: var(--text-2); margin: 4px 0 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }

/* Ikoner */
i[data-icon] { display: inline-flex; width: 18px; height: 18px; flex: none; }
i[data-icon] svg { width: 100%; height: 100%; }

/* Formulär */
input, select {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 9px 12px; outline: none; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--text-2); }
.form-error { color: var(--danger); min-height: 1.2em; margin: 0; font-size: 13px; }

/* Knappar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface);
  font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; transition: .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -6px color-mix(in oklab, var(--accent) 70%, transparent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary:disabled { opacity: .45; cursor: default; box-shadow: none; filter: none; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: transparent; }
.btn.lg { padding: 12px 18px; font-size: 15px; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm);
  border: 0; background: transparent; color: var(--text-2); cursor: pointer; transition: .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); background: color-mix(in oklab, var(--danger) 10%, transparent); }
.icon-btn:disabled { opacity: .3; cursor: default; background: transparent; }
.icon-btn i[data-icon] { width: 16px; height: 16px; }

/* Logo */
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--grad); flex: none; position: relative;
  box-shadow: 0 6px 16px -6px color-mix(in oklab, var(--accent) 80%, transparent);
}
.logo-mark::after {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M11 9h10M11 16h8M11 23h10M11 9v14' stroke='white' stroke-width='3' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") center/70% no-repeat;
}
.logo-mark.xl { width: 64px; height: 64px; border-radius: 18px; }
.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.brand-sub { font-size: 12px; color: var(--muted); }

/* Inloggning */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--grad); color: #fff; display: grid; place-items: center; padding: 48px; position: relative; overflow: hidden; }
.login-art::before, .login-art::after { content: ""; position: absolute; border-radius: 50%; background: rgb(255 255 255 / .08); }
.login-art::before { width: 520px; height: 520px; top: -160px; right: -160px; }
.login-art::after { width: 360px; height: 360px; bottom: -120px; left: -80px; }
.login-art-inner { max-width: 420px; position: relative; z-index: 1; }
.login-art h2 { font-size: 34px; line-height: 1.15; margin: 28px 0 14px; }
.login-art p { opacity: .85; font-size: 16px; margin: 0; }
.login-art .logo-mark { background: rgb(255 255 255 / .18); box-shadow: none; backdrop-filter: blur(6px); }
.login-form-wrap { display: grid; place-items: center; padding: 32px; }
.login-form { width: min(360px, 100%); display: grid; gap: 18px; }
.login-form h1 { font-size: 26px; margin-top: 24px; }

/* Skal */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px;
  padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--line);
}
.sidebar > .brand-row { padding: 4px 8px; }
.nav { display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-2); cursor: pointer; text-align: left; font-weight: 500; transition: .15s;
}
.nav-item span { flex: 1; }
.nav-item em { font-style: normal; font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 1px 8px; border-radius: 99px; }
.nav-item em:empty { display: none; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.active em { background: var(--surface); color: var(--accent); }
:root[data-theme="dark"] .nav-item.active { color: #a5b4fc; }
.sidebar-foot { margin-top: auto; display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 12px; }

.main { padding: 32px 40px 64px; min-width: 0; }
.view { max-width: 1280px; margin: 0 auto; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 28px; font-weight: 700; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }

/* Verktygsrad */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--line); }
.segmented button { border: 0; background: transparent; padding: 6px 14px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-weight: 500; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.search { position: relative; flex: 1; max-width: 320px; margin-left: auto; }
.search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search input { width: 100%; padding-left: 34px; }

/* Typ-pill */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.pill i[data-icon] { width: 12px; height: 12px; }
.pill.image { color: var(--t-image); background: color-mix(in oklab, var(--t-image) 12%, transparent); }
.pill.video { color: var(--t-video); background: color-mix(in oklab, var(--t-video) 12%, transparent); }
.pill.html  { color: var(--t-html);  background: color-mix(in oklab, var(--t-html) 12%, transparent); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); padding: 4px 10px; border-radius: 99px; }
.chip i[data-icon] { width: 14px; height: 14px; }

/* Media-grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 20px; }
.media-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: .2s; box-shadow: var(--shadow-sm); }
.media-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.thumb { aspect-ratio: 16/9; background: #0b0d14; position: relative; display: grid; place-items: center; overflow: hidden; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { color: rgb(255 255 255 / .7); display: grid; place-items: center; gap: 6px; font-size: 12px; }
.thumb .ph i[data-icon] { width: 32px; height: 32px; }
.thumb.html { background: linear-gradient(135deg, #064e3b, #0f766e); }
.thumb.video { background: linear-gradient(135deg, #500724, #831843); }
.thumb .overlay {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-end; gap: 6px; padding: 10px;
  background: linear-gradient(to top, rgb(0 0 0 / .55), transparent 55%); opacity: 0; transition: .2s;
}
.media-card:hover .overlay, .media-card:focus-within .overlay { opacity: 1; }
.overlay .icon-btn { background: rgb(255 255 255 / .92); color: #0f172a; width: 34px; height: 34px; }
.overlay .icon-btn:hover { background: #fff; }
.overlay .icon-btn.danger:hover { color: var(--danger); background: #fff; }
.thumb .pill { position: absolute; top: 10px; left: 10px; background: rgb(255 255 255 / .92); backdrop-filter: blur(4px); }
.media-body { padding: 12px 14px 14px; display: grid; gap: 8px; }
.name-input { border: 1px solid transparent; background: transparent; font-weight: 600; padding: 4px 6px; margin: -4px -6px; font-size: 14.5px; width: calc(100% + 12px); }
.name-input:hover { border-color: var(--line); }
.media-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12.5px; }
.dur-field { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 99px; padding: 2px 4px 2px 10px; color: var(--text-2); }
.dur-field i[data-icon] { width: 13px; height: 13px; }
.dur-field input { width: 46px; border: 0; background: transparent; padding: 3px 2px; text-align: right; box-shadow: none !important; }
.dur-field small { padding-right: 6px; }

/* Tomt läge */
.empty {
  grid-column: 1 / -1; text-align: center; padding: 56px 24px; border: 2px dashed var(--line); border-radius: var(--r-lg);
  color: var(--text-2); display: grid; justify-items: center; gap: 10px; background: var(--surface);
}
.empty .empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty .empty-icon i { width: 26px; height: 26px; }
.empty h3 { color: var(--text); font-size: 17px; }
.empty p { margin: 0; max-width: 380px; }

/* Spellistor */
.pl-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.pl-list { display: grid; gap: 8px; position: sticky; top: 24px; }
.pl-card {
  text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 14px 16px; cursor: pointer;
  display: grid; gap: 6px; transition: .15s; box-shadow: var(--shadow-sm);
}
.pl-card:hover { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }
.pl-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pl-card strong { font-size: 14.5px; }
.pl-card .meta { display: flex; gap: 10px; color: var(--muted); font-size: 12.5px; }
.pl-card .meta span { display: inline-flex; align-items: center; gap: 4px; }
.pl-card .meta i { width: 13px; height: 13px; }

.pl-editor { padding: 0; overflow: hidden; }
.pl-editor-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.pl-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; border: 1px solid transparent; background: transparent; padding: 4px 8px; margin: -4px -8px; width: 100%; }
.pl-title:hover { border-color: var(--line); }
.pl-editor-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pl-editor-bar .spacer { flex: 1; }
.dirty-note { font-size: 12.5px; color: var(--warn); display: inline-flex; align-items: center; gap: 6px; }
.dirty-note::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.pl-body { display: grid; grid-template-columns: 1fr 270px; min-height: 420px; }
.pl-items { padding: 16px; display: grid; gap: 8px; align-content: start; }
.pl-items .empty { padding: 40px 16px; }
.item {
  display: grid; grid-template-columns: 20px 20px 80px 1fr auto auto; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); transition: box-shadow .15s, border-color .15s, opacity .15s;
}
.item:hover { border-color: color-mix(in oklab, var(--accent) 30%, var(--line)); }
.item.dragging { opacity: .4; }
.item.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.item.drop-after { box-shadow: 0 3px 0 var(--accent); }
.item .grip { cursor: grab; color: var(--muted); display: grid; place-items: center; }
.item .grip i { width: 16px; height: 16px; }
.item .num { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; }
.mini { width: 80px; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background: #0b0d14; display: grid; place-items: center; color: rgb(255 255 255 / .75); }
.mini { position: relative; }
.mini img, .mini video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.vbadge { position: absolute; right: 4px; bottom: 4px; width: 18px; height: 18px; border-radius: 5px; background: rgb(0 0 0 / .6); color: #fff; display: grid; place-items: center; }
.vbadge i[data-icon] { width: 11px !important; height: 11px !important; }
.mosaic { display: grid; gap: 3px; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: var(--surface-2); margin-bottom: 4px; }
.mosaic .mini { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.mosaic.n2 { grid-template-columns: 1fr 1fr; }
.mosaic.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.mosaic.n3 .mini:first-child { grid-row: span 2; }
.mosaic.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.empty-mosaic { place-items: center; color: var(--muted); }
.empty-mosaic i { width: 28px; height: 28px; }
.mini i[data-icon] { width: 20px; height: 20px; }
.mini.html { background: linear-gradient(135deg, #064e3b, #0f766e); }
.mini.video { background: linear-gradient(135deg, #500724, #831843); }
.item .title { min-width: 0; display: grid; gap: 3px; justify-items: start; }
.item .title div { font-weight: 500; overflow: hidden; max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.item .acts { display: flex; }

.library { border-left: 1px solid var(--line); background: var(--surface-2); padding: 16px; display: grid; gap: 12px; align-content: start; max-height: 640px; overflow: hidden; grid-template-rows: auto auto 1fr; }
.library h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.library .search { max-width: none; margin: 0; }
.lib-list { display: grid; gap: 6px; overflow: auto; padding-right: 2px; }
.lib-item {
  display: grid; grid-template-columns: 64px 1fr 28px; gap: 10px; align-items: center; padding: 6px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: left; transition: .15s;
}
.lib-item:hover { border-color: var(--accent); }
.lib-item .mini { width: 64px; }
.lib-item .lt { min-width: 0; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-item .add { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.lib-item .add i { width: 14px; height: 14px; }
.pl-placeholder { padding: 80px 24px; }

/* Enheter */
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.device-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 14px; box-shadow: var(--shadow-sm); }
.device-top { display: flex; align-items: center; gap: 12px; }
.device-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.device-icon.on { background: color-mix(in oklab, var(--ok) 14%, transparent); color: var(--ok); }
.device-top .name-input { font-size: 16px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.on { color: var(--ok); }
.status.on .dot { background: var(--ok); animation: pulse 2s infinite; }
.status.warn { color: var(--warn); }
.status.warn .dot { background: var(--warn); }
.device-icon.warn { background: color-mix(in oklab, var(--warn) 14%, transparent); color: var(--warn); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--ok) 60%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.now {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); font-size: 13px; min-height: 42px;
}
.now i[data-icon] { color: var(--accent); width: 16px; height: 16px; }
.now span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now .lbl { color: var(--muted); }
.device-card select { width: 100%; }
.device-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.device-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); font-size: 12.5px; }
.alert { font-size: 12.5px; color: var(--danger); background: color-mix(in oklab, var(--danger) 10%, transparent); padding: 8px 10px; border-radius: var(--r-sm); }
.info { font-size: 12.5px; color: var(--accent); background: var(--accent-soft); padding: 8px 10px; border-radius: var(--r-sm); }

/* Modal */
.modal { border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(440px, calc(100vw - 32px)); }
.modal.sm { width: min(380px, calc(100vw - 32px)); }
.modal::backdrop { background: rgb(15 23 42 / .45); backdrop-filter: blur(4px); }
.modal[open] { animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
.modal form { padding: 24px; display: grid; gap: 16px; }
.modal h2 { font-size: 19px; }
.modal-head { display: grid; gap: 4px; }
.modal-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.code-input { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 28px; letter-spacing: .4em; text-align: center; text-transform: uppercase; padding: 14px; font-weight: 600; }
.code-input::placeholder { color: var(--line); }

/* Dra-och-släpp & uppladdning */
.drop-overlay { position: fixed; inset: 0; z-index: 40; background: color-mix(in oklab, var(--accent) 22%, rgb(15 23 42 / .5)); backdrop-filter: blur(6px); display: grid; place-items: center; pointer-events: none; }
.drop-card { background: var(--surface); border: 2px dashed var(--accent); border-radius: var(--r-lg); padding: 40px 56px; display: grid; justify-items: center; gap: 8px; box-shadow: var(--shadow-lg); }
.drop-card i { width: 40px; height: 40px; color: var(--accent); }
.drop-card strong { font-size: 18px; }
.drop-card span { color: var(--text-2); }
.upload-card { position: fixed; right: 24px; bottom: 24px; width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow-lg); z-index: 45; display: grid; gap: 10px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width .2s; }

/* Toasts */
.toasts { position: fixed; top: 20px; right: 20px; z-index: 60; display: grid; gap: 8px; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; min-width: 260px; max-width: 420px; padding: 12px 14px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: slide .2s ease;
}
.toast i { width: 18px; height: 18px; color: var(--ok); margin-top: 1px; }
.toast.err i { color: var(--danger); }
.toast.out { opacity: 0; transform: translateX(12px); transition: .25s; }
@keyframes slide { from { opacity: 0; transform: translateX(12px); } }

/* Responsivt */
@media (max-width: 1100px) {
  .pl-body { grid-template-columns: 1fr; }
  .library { border-left: 0; border-top: 1px solid var(--line); max-height: 380px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; z-index: 10; border-right: 0; border-bottom: 1px solid var(--line); gap: 8px; }
  .sidebar > .brand-row .brand-sub, .sidebar > .brand-row > div:last-child { display: none; }
  .nav { display: flex; flex: 1; }
  .nav-item span, .sidebar-foot .nav-item span, .nav-item em { display: none; }
  .nav-item { width: auto; }
  .sidebar-foot { margin: 0; border: 0; padding: 0; display: flex; }
  .main { padding: 20px 16px 48px; }
  .search { max-width: none; flex-basis: 100%; margin-left: 0; }
  .page-head { align-items: flex-start; }
  .pl-layout { grid-template-columns: 1fr; }
  .pl-list { position: static; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .item { grid-template-columns: 20px 64px 1fr auto; }
  .item .num, .item .acts { display: none; }
  .item .mini { width: 64px; }
}
.pl-card .mosaic { aspect-ratio: 16/7; }
.chip.warn { color: var(--warn); background: color-mix(in oklab, var(--warn) 12%, transparent); }

/* ===================== v0.4: miniatyrer, spellistevy, bibliotek ===================== */
/* Bildyta med skimmer tills miniatyren laddats */
.vis { position: relative; overflow: hidden; background: #0b0d14; display: grid; place-items: center; color: rgb(255 255 255 / .75); }
.vis.html { background: linear-gradient(135deg, #064e3b, #0f766e); }
.vis.video { background: linear-gradient(135deg, #3b0a1e, #6b1235); }
.vis img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .25s ease; pointer-events: none; }
.vis.loading img { opacity: 0; }
.vis.loading { background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in oklab, var(--surface-2) 60%, var(--surface)) 50%, var(--surface-2) 70%) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.vis > i[data-icon] { width: 28%; height: auto; max-width: 36px; aspect-ratio: 1; }
.vdur { position: absolute; right: 6px; bottom: 6px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; background: rgb(0 0 0 / .65); padding: 1px 6px; border-radius: 5px; }
.vis-card { aspect-ratio: 16/9; }
.vis-card .pill { position: absolute; top: 10px; left: 10px; background: rgb(255 255 255 / .92); backdrop-filter: blur(4px); }
.vis-card .overlay {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-end; gap: 6px; padding: 10px;
  background: linear-gradient(to top, rgb(0 0 0 / .55), transparent 55%); opacity: 0; transition: .2s;
}
.media-card:hover .vis-card .overlay, .media-card:focus-within .vis-card .overlay { opacity: 1; }
.vis-card .overlay .icon-btn { background: rgb(255 255 255 / .92); color: #0f172a; width: 34px; height: 34px; }
.vis-card .overlay .icon-btn.danger:hover { color: var(--danger); background: #fff; }
.vis-mini { width: 128px; aspect-ratio: 16/9; border-radius: 8px; flex: none; }
.vis-mini .vdur { font-size: 10px; right: 4px; bottom: 4px; }

/* Spellistkort med mosaik */
.pl-card { padding: 10px; gap: 10px; }
.pl-card .mosaic { aspect-ratio: 16/8; margin: 0; }
.mosaic .vis { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.mosaic .vis .vdur { display: none; }
.pl-card-body { display: grid; gap: 4px; padding: 0 4px 2px; }

/* Editor */
.pl-editor-head { gap: 14px; }
.pl-editor-head .pl-title { flex: 1; margin: -4px 0; }
.pl-editor-bar { gap: 8px; }
.timeline { display: grid; gap: 6px; }
.tl-bar { display: flex; gap: 3px; height: 54px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.tl-seg { position: relative; flex-basis: 0; min-width: 18px; padding: 0; border: 0; cursor: pointer; overflow: hidden; background: #111; }
.tl-seg .vis { position: absolute; inset: 0; }
.tl-seg .vis > i[data-icon] { max-width: 18px; }
.tl-seg::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--t-image); }
.tl-seg.video::after { background: var(--t-video); }
.tl-seg.html::after { background: var(--t-html); }
.tl-seg:hover { filter: brightness(1.15); }
.tl-seg:hover .tl-num, .tl-seg:focus-visible .tl-num { opacity: 1; }
.tl-num { position: absolute; top: 4px; left: 5px; font-size: 11px; font-weight: 700; color: #fff; background: rgb(0 0 0 / .55); border-radius: 5px; padding: 0 5px; opacity: .85; }
.tl-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.plist { padding: 16px; display: grid; gap: 8px; align-content: start; }
.plist .empty { padding: 48px 16px; }
.pitem {
  display: grid; grid-template-columns: 18px 26px auto 1fr auto auto; align-items: center; gap: 14px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  transition: box-shadow .15s, border-color .15s, opacity .15s, background .3s;
}
.pitem:hover { border-color: color-mix(in oklab, var(--accent) 35%, var(--line)); box-shadow: var(--shadow-sm); }
.pitem.dragging { opacity: .4; }
.pitem.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.pitem.drop-after { box-shadow: 0 3px 0 var(--accent); }
.pitem.flash { background: var(--accent-soft); }
.pitem .grip { cursor: grab; color: var(--muted); display: grid; place-items: center; }
.pitem .grip i { width: 16px; height: 16px; }
.pnum { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); font-variant-numeric: tabular-nums; }
.pinfo { min-width: 0; display: grid; gap: 6px; }
.pname { font-weight: 600; font-size: 14.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.pmeta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.stepper input { width: 84px; text-align: center; border: 0; background: transparent; padding: 5px 2px; box-shadow: none !important; font-variant-numeric: tabular-nums; }
.stepper input::placeholder { color: var(--muted); font-size: 12.5px; }
.stepper .unit { font-size: 12px; color: var(--muted); padding-right: 4px; }
.stepper .icon-btn { width: 28px; height: 28px; background: var(--surface); box-shadow: var(--shadow-sm); }
.pitem .acts { display: flex; gap: 2px; }

/* Biblioteksdialog */
.modal.xl { width: min(1120px, calc(100vw - 32px)); height: min(820px, calc(100vh - 48px)); padding: 0; }
.modal.xl[open] { display: grid; grid-template-rows: auto auto 1fr auto; }
.lib-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 24px 10px; }
.lib-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 6px 24px 14px; border-bottom: 1px solid var(--line); }
.lib-tools .search { margin-left: auto; }
.lib-grid { overflow: auto; padding: 18px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; align-content: start; background: var(--bg); }
.lib-foot { display: flex; align-items: center; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--line); }
.spacer { flex: 1; }
.tile { text-align: left; padding: 0; border: 2px solid transparent; border-radius: 14px; background: var(--surface); cursor: pointer; overflow: hidden; box-shadow: var(--shadow-sm); transition: border-color .12s, transform .12s, box-shadow .12s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile.selected { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.vis-tile { aspect-ratio: 16/9; }
.sel-badge { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: rgb(0 0 0 / .25); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 1px 4px rgb(0 0 0 / .3); }
.tile.selected .sel-badge { background: var(--accent); border-color: var(--accent); }
.in-list { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 600; color: #fff; background: rgb(0 0 0 / .55); padding: 2px 7px; border-radius: 99px; }
.tile-body { padding: 10px 12px 12px; display: grid; gap: 6px; }
.tile-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
  .pitem { grid-template-columns: 18px auto 1fr auto; }
  .pitem .pnum { display: none; }
  .pitem .stepper { grid-column: 3; justify-self: start; }
  .pitem .acts { grid-column: 4; grid-row: 1 / span 2; flex-direction: column; }
}
@media (max-width: 700px) {
  .vis-mini { width: 96px; }
  .pitem { grid-template-columns: auto 1fr; gap: 10px; }
  .pitem .grip { display: none; }
  .pitem .stepper { grid-column: 1 / -1; }
  .pitem .acts { grid-column: 1 / -1; grid-row: auto; flex-direction: row; justify-content: flex-end; }
  .modal.xl { width: 100vw; height: 100dvh; max-width: none; max-height: none; border-radius: 0; }
  .lib-grid { grid-template-columns: repeat(2, 1fr); padding: 12px; gap: 10px; }
  .lib-tools .search { flex-basis: 100%; margin: 0; }
}

/* Toasts nere till höger så de inte täcker sidhuvudets knappar */
.toasts { top: auto; bottom: 20px; right: 20px; z-index: 80; }
@media (max-width: 860px) {
  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; }
  /* Spellistor som horisontell rad med kompakta kort */
  .pl-list { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 6px; scroll-snap-type: x mandatory; }
  .pl-card { flex: 0 0 200px; scroll-snap-align: start; }
}
.lib-grid { grid-auto-rows: max-content; }
@media (max-width: 700px) {
  .pitem { grid-template-columns: auto 1fr auto; row-gap: 10px; }
  .pitem .vis-mini { grid-column: 1; }
  .pitem .pinfo { grid-column: 2 / -1; }
  .pitem .stepper { grid-column: 1 / span 2; justify-self: start; }
  .pitem .acts { grid-column: 3; grid-row: 2; flex-direction: row; }
}

/* ===================== v0.5: mappar + snabblista ===================== */
.small { font-size: 12.5px; }
.drop-card .small { color: var(--muted); }

/* Media-layout med mappträd */
.media-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.folder-tree { position: sticky; top: 24px; padding: 8px; max-height: calc(100vh - 48px); overflow: auto; display: grid; gap: 1px; }
.tree-row { display: flex; align-items: center; border-radius: 8px; padding-left: calc(var(--d) * 14px); transition: background .12s; }
.tree-row:hover { background: var(--surface-2); }
.tree-row.active { background: var(--accent-soft); }
.tree-row.active .tree-name { color: var(--accent); font-weight: 600; }
:root[data-theme="dark"] .tree-row.active .tree-name { color: #a5b4fc; }
.tree-tog { width: 22px; height: 30px; flex: none; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.tree-tog i { width: 14px; height: 14px; transition: transform .15s; }
.tree-tog.open i { transform: rotate(90deg); }
.tree-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 8px 6px 2px; cursor: pointer; text-align: left; color: var(--text-2); }
.tree-name i { width: 16px; height: 16px; flex: none; color: var(--muted); }
.tree-name span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-name em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.drop-hover { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft) !important; }

.media-main { min-width: 0; display: grid; gap: 16px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-height: 34px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 10px; border-radius: 8px; cursor: pointer; color: var(--text-2); font-weight: 500; }
.crumb i { width: 15px; height: 15px; }
.crumb:hover { background: var(--surface-2); color: var(--text); }
.crumb.current { color: var(--text); font-weight: 600; cursor: default; }
.crumb.current:hover { background: none; }
.crumb-sep { color: var(--muted); display: inline-grid; }
.crumb-sep i { width: 14px; height: 14px; }

/* Mappkort i rutnätet */
.folder-card { display: flex; align-items: center; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); transition: .15s; align-self: start; }
.folder-card:hover { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); box-shadow: var(--shadow); }
.folder-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 6px; cursor: pointer; text-align: left; color: inherit; }
.folder-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; background: color-mix(in oklab, #f59e0b 16%, transparent); color: #d97706; }
.folder-icon i { width: 22px; height: 22px; }
.folder-icon.sm { width: 32px; height: 32px; border-radius: 9px; }
.folder-icon.sm i { width: 17px; height: 17px; }
.folder-text { min-width: 0; display: grid; gap: 2px; }
.folder-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-text span { font-size: 12.5px; color: var(--muted); }
.folder-acts { display: flex; opacity: 0; transition: opacity .15s; }
.folder-card:hover .folder-acts, .folder-card:focus-within .folder-acts { opacity: 1; }
.media-card[draggable="true"] { cursor: grab; }
.path-chip { justify-self: start; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 0; padding: 3px 9px; border-radius: 99px; cursor: pointer; }
.path-chip i { width: 13px; height: 13px; color: #d97706; }

/* Spellistesidan: listor som rad överst, editor + snabblista under */
.pl-strip { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 14px; scroll-snap-type: x proximity; }
.pl-strip .pl-card { flex: 0 0 210px; scroll-snap-align: start; }
.pl-strip .pl-card .mosaic { aspect-ratio: 16/7; }
.pl-work { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.quick-lib { position: sticky; top: 24px; display: grid; grid-template-rows: auto auto auto 1fr; gap: 10px; padding: 14px; max-height: calc(100vh - 48px); min-height: 360px; }
.ql-head { display: flex; align-items: baseline; justify-content: space-between; }
.ql-head h3 { font-size: 15px; }
.quick-lib .search { max-width: none; margin: 0; }
.ql-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 0; min-height: 32px; font-size: 13px; }
.ql-crumbs .crumb { padding: 4px 6px; }
.ql-list { overflow: auto; display: grid; gap: 4px; align-content: start; margin: 0 -6px; padding: 0 6px 4px; }
.ql-folder { display: flex; align-items: center; gap: 10px; padding: 6px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; color: inherit; }
.ql-folder:hover { background: var(--surface-2); }
.ql-folder em { font-style: normal; font-size: 12px; color: var(--muted); }
.ql-folder > i[data-icon] { width: 15px; height: 15px; color: var(--muted); }
.ql-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 10px; align-items: center; padding: 6px; border-radius: 10px; cursor: grab; border: 1px solid transparent; transition: background .12s, border-color .12s; }
.ql-item:hover { background: var(--surface-2); border-color: var(--line); }
.ql-item.dragging { opacity: .5; }
.ql-item .vis-mini { width: 72px; border-radius: 6px; }
.ql-item .vis-mini .vdur { display: none; }
.ql-text { min-width: 0; display: grid; gap: 2px; }
.ql-name { flex: 1; min-width: 0; font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tdot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--t-image); }
.tdot.video { background: var(--t-video); }
.tdot.html { background: var(--t-html); }
.ql-item .add { background: var(--accent-soft); color: var(--accent); opacity: 0; }
.ql-item:hover .add, .ql-item .add:focus-visible { opacity: 1; }
.ql-empty { padding: 16px 6px; }
.plist.drop-end { box-shadow: inset 0 -3px 0 var(--accent); }
.plist { min-height: 160px; }
.tile-path { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-path i { width: 12px; height: 12px; color: #d97706; flex: none; }
#libFolder { max-width: 220px; }

@media (max-width: 1180px) {
  .pl-work { grid-template-columns: 1fr; }
  .quick-lib { display: none; }
}
@media (max-width: 860px) {
  .media-layout { grid-template-columns: 1fr; }
  .folder-tree { display: none; }
  .page-head > .row { flex-wrap: wrap; }
  .folder-acts { opacity: 1; }
}

/* ===================== v0.5.1: kompaktare knappar ===================== */
.btn { padding: 6px 12px; gap: 6px; font-size: 13.5px; line-height: 20px; border-radius: 8px; }
.btn i[data-icon] { width: 16px; height: 16px; }
.btn.primary { box-shadow: 0 2px 6px -2px color-mix(in oklab, var(--accent) 60%, transparent); }
.btn.primary:hover { box-shadow: 0 4px 10px -3px color-mix(in oklab, var(--accent) 60%, transparent); }
.btn.lg { padding: 10px 16px; font-size: 14.5px; }
.page-head { align-items: center; }
.page-head h1 { font-size: 26px; }
.page-head .sub { margin-top: 2px; }
.icon-btn { width: 30px; height: 30px; }
.segmented button { padding: 5px 12px; font-size: 13.5px; }
.lib-foot .btn, .modal-actions .btn { min-width: 84px; }

/* Grupprubriker i mediarutnätet (Mappar / Filer) */
.grid-section { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.grid-section i[data-icon] { width: 15px; height: 15px; }
.grid-section em { font-style: normal; font-weight: 500; letter-spacing: 0; text-transform: none; background: var(--surface-2); padding: 0 7px; border-radius: 99px; }
.grid-section::after { content: ""; flex: 1; height: 1px; background: var(--line); margin-left: 4px; }
.grid-section:not(:first-child) { margin-top: 12px; }
.media-grid .folder-card { padding: 4px 6px; }

/* ===================== v0.7: visningsinställningar per enhet ===================== */
.disp { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.disp > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; font-weight: 500; font-size: 13.5px; }
.disp > summary::-webkit-details-marker { display: none; }
.disp > summary i[data-icon] { width: 15px; height: 15px; color: var(--muted); }
.disp > summary span { flex: 1; }
.disp > summary em { font-style: normal; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.disp > summary > i:last-child { transition: transform .15s; }
.disp[open] > summary > i:last-child { transform: rotate(90deg); }
.disp-body { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 4px 12px 12px; align-items: start; }
.disp-preview { width: 96px; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); margin-top: 4px; }
.disp-preview.portrait { width: 54px; aspect-ratio: 9/16; justify-self: center; }
.disp-preview img { width: 100%; height: 100%; display: block; transition: .2s; }
.disp-rows { display: grid; gap: 8px; min-width: 0; }
.disp-row { display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.disp-row.dim { opacity: .5; }
.disp-row select { padding: 4px 8px; font-size: 12.5px; }
.segmented.sm { padding: 2px; border-radius: 8px; justify-self: start; }
.segmented.sm button { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.swatches { display: flex; gap: 6px; }
.swatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; padding: 0; position: relative; }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.swatch.custom { background: conic-gradient(#ef4444, #f59e0b, #10b981, #3b82f6, #a855f7, #ef4444); overflow: hidden; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }

.disp-body { grid-template-columns: 1fr; gap: 12px; }
.disp-preview { justify-self: center; width: 140px; margin-top: 0; }
.disp-preview.portrait { width: 62px; }
.disp-row { grid-template-columns: 72px 1fr; }
.disp-row select { justify-self: start; min-width: 120px; }
.segmented.sm button { padding: 3px 8px; }

/* ===================== v0.8: fjärruppdatering ===================== */
.btn.sm { padding: 3px 10px; font-size: 12.5px; }
.upd { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); }
.upd > i[data-icon] { width: 15px; height: 15px; flex: none; color: var(--accent); }
.upd.ok > i[data-icon] { color: var(--ok); }
.upd.fail { color: var(--danger); background: color-mix(in oklab, var(--danger) 10%, transparent); }
.upd.fail > i[data-icon] { color: var(--danger); }
.upd.busy > i[data-icon] { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.upd-text { flex: 1; min-width: 0; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-ui { width: 30px; height: 18px; border-radius: 99px; background: var(--line); position: relative; transition: .2s; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: .2s; }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(12px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-label { font-size: 12px; color: var(--muted); }
