/* Библиотека Малика — стили. Тёплый минимализм с мягкими детскими акцентами. */

:root {
  color-scheme: light;
  --bg: #F7F5EF;
  --surface: #FFFFFF;
  --surface-2: #F1EEE5;
  --surface-3: #E8E4D8;
  --text: #22262A;
  --text-2: #5E6469;
  --text-3: #8A9096;
  --line: #E2DED3;
  --line-strong: #CFCABB;
  --accent: #326B5C;
  --accent-strong: #26564A;
  --accent-soft: #E3EFEA;
  --accent-text: #FFFFFF;
  --yellow: #E9B949;
  --yellow-soft: #FBF1D6;
  --danger: #B5473C;
  --danger-soft: #F8E5E2;
  --ok: #2F7A4B;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(34, 38, 42, 0.06), 0 6px 20px rgba(34, 38, 42, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --nav-h: 64px;
  --topbar-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tap: 44px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body.has-overlay { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.25; }
p { margin: 0 0 0.75em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Иконки */
.icon { display: inline-flex; width: 24px; height: 24px; flex: 0 0 auto; vertical-align: middle; }
.icon svg { width: 100%; height: 100%; }
.icon.small { width: 18px; height: 18px; }
.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Каркас */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: var(--topbar-h); padding: var(--safe-t) 12px 0 12px;
  background: rgba(247, 245, 239, 0.94); backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; }
.topbar-titles { min-width: 0; padding: 8px 4px; }
.topbar-title { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right .btn-ghost { padding: 0 10px; }
.topbar-subtitle { font-size: 13px; color: var(--text-2); }
.topbar-right { display: flex; align-items: center; gap: 4px; }
.main { flex: 1; padding: 12px 16px calc(var(--nav-h) + var(--safe-b) + 24px); max-width: 1120px; width: 100%; margin: 0 auto; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--surface); border-top: 1px solid var(--line);
}
.navbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: 0; color: var(--text-2); font-size: 12px; font-weight: 500; text-decoration: none; min-height: var(--tap);
}
.navbtn.is-active { color: var(--accent); }
.navbtn .icon { width: 26px; height: 26px; }
.navbtn-add .icon { background: var(--accent); color: #fff; border-radius: 50%; width: 36px; height: 36px; padding: 6px; }

@media (min-width: 900px) {
  :root { --nav-h: 0px; }
  .bottomnav { position: static; display: flex; justify-content: center; gap: 8px; height: auto; padding: 8px 16px; border-top: 0; border-bottom: 1px solid var(--line); background: transparent; }
  .app { flex-direction: column; }
  .bottomnav { order: 1; }
  .topbar { order: 0; }
  .main { order: 2; padding-bottom: 48px; }
  .navbtn { flex-direction: row; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 15px; }
  .navbtn.is-active { background: var(--accent-soft); }
  .navbtn-add .icon { width: 26px; height: 26px; padding: 3px; }
}

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; text-decoration: none; white-space: nowrap; transition: background 0.15s, transform 0.08s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 17px; }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap);
  border: 0; border-radius: 50%; background: transparent; color: var(--text-2);
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn.is-active { color: var(--accent); background: var(--accent-soft); }
.iconbtn.is-warn { color: var(--danger); }
.iconbtn.is-pending { color: #9A7A1F; }

/* Поля */
.field { margin-bottom: 14px; }
.label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.input, .textarea, .select-btn {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 16px;
}
.input:focus, .textarea:focus, .select-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.textarea { resize: vertical; min-height: 88px; line-height: 1.4; }
.select-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; }
.select-btn .placeholder { color: var(--text-3); }
.select-btn .icon { color: var(--text-3); }
.hint { font-size: 13px; color: var(--text-3); margin-top: 6px; }
.field-review .input, .field-review .select-btn, .field-review .textarea { border-color: var(--yellow); background: #FFFCF4; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-field { min-height: var(--tap); padding: 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.field-review .chips-field { border-color: var(--yellow); background: #FFFCF4; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 14px; line-height: 1.3; min-height: 30px;
}
.chip > span:not(.icon) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .icon { width: 16px; height: 16px; }
.chip-x { display: inline-flex; border: 0; background: transparent; padding: 2px; margin-right: -4px; color: var(--text-2); border-radius: 50%; }
.chip-x .icon { width: 16px; height: 16px; }
.chip-accent { background: var(--accent-soft); color: var(--accent-strong); }
.chip-review { background: var(--yellow-soft); color: #7A5B12; font-weight: 600; font-size: 12px; min-height: 22px; padding: 2px 8px; }
.chip-muted { color: var(--text-2); }
.chip-filter { border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; }
.chip-filter.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.chip-add { background: transparent; border: 1px dashed var(--line-strong); color: var(--accent); cursor: pointer; }
.section-title { font-size: 14px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; margin: 20px 0 10px; }
.row { display: flex; gap: 8px; align-items: center; }
.row-wrap { flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--text-2); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }

/* Карточки и панели */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card + .card { margin-top: 10px; }
.card-title { font-size: 17px; font-weight: 650; margin-bottom: 6px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-strong); font-size: 15px; }
.notice .icon { flex: 0 0 auto; margin-top: 1px; }
.notice-warn { background: var(--yellow-soft); color: #7A5B12; }
.notice-danger { background: var(--danger-soft); color: var(--danger); }
.notice-muted { background: var(--surface-2); color: var(--text-2); }
details.expander { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
details.expander > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-weight: 600; min-height: var(--tap); }
details.expander > summary::-webkit-details-marker { display: none; }
details.expander > summary .icon { transition: transform 0.15s; color: var(--text-3); }
details.expander[open] > summary .icon { transform: rotate(180deg); }
details.expander > .expander-body { padding: 4px 14px 14px; border-top: 1px solid var(--line); }

/* Каталог */
.catalog-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.searchbar { position: relative; }
.searchbar .input { padding-left: 42px; padding-right: 42px; background: var(--surface); }
.searchbar > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.searchbar .iconbtn { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; }
.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .chip { flex: 0 0 auto; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.catalog-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (max-width: 359px) { .grid { grid-template-columns: 1fr; } }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; } }
.book-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-align: left; padding: 0; cursor: pointer; color: inherit; text-decoration: none; transition: box-shadow 0.15s, transform 0.08s;
}
.book-card:hover { box-shadow: var(--shadow); }
.book-card:active { transform: scale(0.99); }
.book-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.book-card.is-archived { opacity: 0.7; }
.cover { position: relative; width: 100%; aspect-ratio: 3 / 4; background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: contain; }
.cover-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; padding: 8px; text-align: center; }
.cover-placeholder .icon { width: 36px; height: 36px; color: var(--accent); opacity: 0.6; }
.book-body { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.book-title { font-weight: 650; font-size: 15px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.book-author { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--text-3); }
.book-meta .inv { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-2); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.book-tags { display: flex; gap: 4px; flex-wrap: wrap; font-size: 11px; color: var(--text-2); }
.tag { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tag-section { background: var(--accent-soft); color: var(--accent-strong); }
.tag-status { background: var(--yellow-soft); color: #7A5B12; }
.view-toggle { display: none; }
@media (min-width: 900px) { .view-toggle { display: inline-flex; gap: 2px; } }

/* Таблица (компьютер) */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--text-2); font-weight: 600; font-size: 13px; background: var(--surface-2); position: sticky; top: 0; }
.table tr { cursor: pointer; }
.table tr:hover td { background: #FBFAF6; }
.table .thumb { width: 36px; height: 48px; object-fit: contain; background: var(--surface-2); border-radius: 4px; }
.table .thumb-ph { width: 36px; height: 48px; border-radius: 4px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-3); }

/* Пустые состояния и загрузка */
.empty { text-align: center; padding: 40px 16px; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-art { width: 72px; height: 72px; border-radius: 24px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.empty-art .icon { width: 36px; height: 36px; }
.empty-title { font-size: 18px; font-weight: 650; color: var(--text); }
.empty-text { max-width: 360px; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--text-2); padding: 16px 0; }

/* Детальная карточка */
.detail { display: grid; gap: 16px; }
@media (min-width: 720px) { .detail { grid-template-columns: 280px 1fr; align-items: start; } }
.detail-cover { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center; max-width: 100%; }
@media (max-width: 719px) { .detail-cover { width: min(62vw, 260px); margin: 0 auto; } }
.detail-cover img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.detail-title { font-size: 22px; font-weight: 700; line-height: 1.25; }
.detail-author { font-size: 16px; color: var(--text-2); margin-top: 4px; }
.kv { display: grid; grid-template-columns: minmax(110px, 36%) 1fr; gap: 8px 12px; font-size: 15px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.photos-row { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-thumb { width: 72px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); cursor: zoom-in; }
.inv-big { display: inline-block; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent-strong); background: var(--accent-soft); padding: 2px 8px; border-radius: 8px; font-size: 14px; }

/* Форма */
.form { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; }
.form-cover { display: flex; gap: 14px; align-items: flex-start; }
.form-cover .cover-box { width: 96px; height: 128px; flex: 0 0 auto; border-radius: var(--radius-sm); border: 1px dashed var(--line-strong); background: var(--surface); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.form-cover .cover-box img { width: 100%; height: 100%; object-fit: contain; }
.form-cover .cover-actions { display: flex; flex-direction: column; gap: 6px; }
.save-bar { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 10; padding: 12px 0 4px; background: linear-gradient(to top, var(--bg) 70%, rgba(247,245,239,0)); display: flex; gap: 8px; }
@media (min-width: 900px) { .save-bar { bottom: 0; } }
.photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.photo-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: var(--surface-2); cursor: zoom-in; }
.photo-item .photo-tools { display: flex; justify-content: space-between; align-items: center; padding: 4px; gap: 2px; }
.photo-item .photo-tools .iconbtn { width: 36px; height: 36px; }
.photo-kind { font-size: 12px; border: 0; background: var(--surface-2); border-radius: 6px; padding: 4px 6px; max-width: 100%; }
.datalist-wrap { position: relative; }

/* Панели (sheet) и диалоги */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(34, 38, 42, 0); display: flex; align-items: flex-end; justify-content: center; transition: background 0.18s; }
.backdrop.open { background: rgba(34, 38, 42, 0.42); }
.sheet {
  width: 100%; max-height: 92vh; max-height: 92dvh; background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transform: translateY(24px); opacity: 0; transition: transform 0.18s ease-out, opacity 0.18s;
  padding-bottom: var(--safe-b);
}
.backdrop.open .sheet { transform: none; opacity: 1; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--line); position: relative; }
.sheet-grip { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 36px; height: 4px; border-radius: 2px; background: var(--line-strong); }
.sheet-title { font-weight: 650; font-size: 17px; padding-top: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { overflow-y: auto; padding: 14px 16px; -webkit-overflow-scrolling: touch; }
.sheet-footer { padding: 10px 16px; border-top: 1px solid var(--line); }
.dialog-buttons { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.dialog-buttons .btn { flex: 1 1 auto; }
.dialog-message { white-space: pre-line; }
@media (min-width: 640px) {
  .backdrop { align-items: center; }
  .sheet { max-width: 520px; border-radius: 18px; max-height: 86vh; }
  .sheet-grip { display: none; }
  .sheet-title { padding-top: 0; }
  .sheet-viewer { max-width: 900px; }
  .dialog-buttons .btn { flex: 0 1 auto; }
}
.viewer { display: flex; align-items: center; justify-content: center; }
.viewer-img { max-height: 76vh; max-width: 100%; object-fit: contain; border-radius: 8px; }

/* Выбор значений */
.picker { display: flex; flex-direction: column; gap: 10px; }
.picker-list { display: flex; flex-direction: column; }
.picker-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--tap); padding: 8px 4px; border: 0; background: transparent; text-align: left; border-bottom: 1px solid var(--line); }
.picker-row:last-child { border-bottom: 0; }
.picker-row.is-checked .picker-label { font-weight: 600; color: var(--accent-strong); }
.picker-box { width: 24px; height: 24px; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #fff; }
.picker-box.is-checkbox { border-radius: 6px; }
.picker-box.is-radio { border-radius: 50%; }
.is-checked .picker-box { background: var(--accent); border-color: var(--accent); }
.picker-box .icon { width: 18px; height: 18px; }
.picker-empty { color: var(--text-3); padding: 16px 4px; text-align: center; }
.picker-custom { padding-top: 4px; }
.picker-custom-row { display: flex; gap: 8px; }
.picker-add { justify-content: flex-start; padding-left: 4px; }

/* Уведомления */
#toast-root { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 60; display: flex; justify-content: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 560px; width: 100%; padding: 10px 8px 10px 14px; border-radius: var(--radius); background: #2B3034; color: #fff; box-shadow: var(--shadow); font-size: 15px; animation: rise 0.18s ease-out; flex-wrap: wrap; }
.toast-icon { color: var(--yellow); }
.toast-success .toast-icon { color: #9BD7A8; }
.toast-text { flex: 1 1 160px; }
.toast-actions { display: flex; gap: 4px; }
.toast-btn { background: transparent; border: 0; color: #FFD97A; font-weight: 700; padding: 8px 10px; min-height: 40px; border-radius: 8px; }
.toast-btn:hover { background: rgba(255,255,255,0.08); }
.toast-close { color: #cfd3d6; width: 40px; height: 40px; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Добавление */
.add-options { display: grid; gap: 12px; }
.add-option { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: left; color: inherit; text-decoration: none; min-height: 72px; }
.add-option:hover { box-shadow: var(--shadow); }
.add-option .icon { width: 32px; height: 32px; color: var(--accent); flex: 0 0 auto; }
.add-option-title { font-weight: 650; font-size: 17px; }
.add-option-text { color: var(--text-2); font-size: 14px; }
.add-option.is-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.add-option.is-primary .icon { color: #fff; }
.add-option.is-primary .add-option-text { color: rgba(255,255,255,0.85); }

/* Этапы обработки */
.steps { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.step { display: flex; align-items: center; gap: 12px; color: var(--text-3); }
.step .step-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.step.is-active { color: var(--text); font-weight: 600; }
.step.is-active .step-dot { border-color: var(--accent); color: var(--accent); }
.step.is-done { color: var(--text-2); }
.step.is-done .step-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.step .icon { width: 18px; height: 18px; }

/* Списки в настройках */
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 52px; border-bottom: 1px solid var(--line); text-align: left; background: transparent; border-left: 0; border-right: 0; border-top: 0; color: inherit; text-decoration: none; }
.list-row:last-child { border-bottom: 0; }
button.list-row:hover, a.list-row:hover { background: var(--surface-2); }
.list-row .grow { display: flex; flex-direction: column; gap: 2px; }
.list-row .list-sub { font-size: 13px; color: var(--text-2); }
.list-row .icon { color: var(--text-3); }
.counter { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* Импорт */
.import-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px; }
.import-item + .import-item { margin-top: 10px; }
.import-item.is-off { opacity: 0.6; }
.import-item-head { display: flex; gap: 10px; align-items: flex-start; }
.import-item-head input[type="checkbox"] { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); flex: 0 0 auto; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge-new { background: var(--accent-soft); color: var(--accent-strong); }
.badge-update { background: #E3EAF5; color: #2F4F7D; }
.badge-dup { background: var(--yellow-soft); color: #7A5B12; }
.badge-off { background: var(--surface-2); color: var(--text-2); }
.diff { font-size: 14px; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin-top: 8px; }
.diff .from { color: var(--text-3); text-decoration: line-through; }
.check { display: flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
pre.code { padding: 10px; overflow-x: auto; white-space: pre; }

/* Прочее */
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.sr-only { position: absolute; left: -9999px; }
input[type="file"].hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width 0.3s; }
.update-banner { position: fixed; top: calc(var(--topbar-h) + var(--safe-t) + 8px); left: 12px; right: 12px; z-index: 40; display: flex; justify-content: center; }
.update-banner .notice { box-shadow: var(--shadow); max-width: 520px; width: 100%; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .spin svg { animation: none; }
}
