:root {
  --bg-white: #FFFFFF;
  --bg-alabaster: #FAF9F7;
  --bg-hover: #F3F1ED;
  --ink-primary: #1C1B19;
  --ink-secondary: #6E6A63;
  --ink-light: #9E9990;
  --hairline: rgba(28, 27, 25, 0.09);
  --hairline-strong: rgba(28, 27, 25, 0.22);
  --accent: #1C1B19;
  --accent-hover: #363430;
  --success: #2E6F40;
  --success-bg: #EEF6F0;
  --danger: #B84A39;
  --danger-bg: #FDF2F0;
  --warn: #9A6715;
  --warn-bg: #FDF7EC;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background-color: var(--bg-alabaster);
  color: var(--ink-primary);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 410px; background: var(--bg-white); padding: 48px 38px 42px; text-align: center; box-shadow: 0 24px 60px rgba(28, 27, 25, 0.045); }
.brand-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-light); margin-bottom: 10px; }
.login-title { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 36px; font-weight: 500; margin-bottom: 10px; }
.login-sub { font-size: 13.5px; color: var(--ink-secondary); line-height: 1.55; margin-bottom: 28px; }
.error-text { font-size: 13px; color: var(--danger); min-height: 18px; }

.field-group { display: flex; flex-direction: column; gap: 6px; text-align: left; min-width: 0; }
.field-label { font-size: 12px; font-weight: 500; color: var(--ink-secondary); display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 18px; }
.field-hint { font-size: 12px; color: var(--ink-light); }
.muted-hint { color: var(--ink-light); }
.target-folder-badge { color: var(--ink-primary); font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.input, .select {
  width: 100%; height: 42px; padding: 0 13px; font-family: 'Manrope', sans-serif; font-size: 13.5px;
  color: var(--ink-primary); background: var(--bg-alabaster); border: 1px solid var(--hairline);
  border-radius: 2px; outline: none; transition: border-color 0.2s ease, background-color 0.2s ease;
}
.input-sm { height: 36px; font-size: 13px; }
.input:focus, .select:focus { background: var(--bg-white); border-color: var(--ink-primary); }
.input:disabled { opacity: 0.65; cursor: not-allowed; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 18px;
  border-radius: 2px; font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease; white-space: nowrap; text-decoration: none;
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-white); color: var(--ink-primary); border-color: var(--hairline-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-alabaster); border-color: var(--ink-primary); }
.btn-ghost { background: transparent; color: var(--ink-secondary); padding: 0 9px; height: 30px; font-size: 11.5px; letter-spacing: 0.02em; text-transform: none; }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--ink-primary); }
.btn-danger-ghost { background: transparent; color: var(--danger); padding: 0 9px; height: 30px; font-size: 11.5px; letter-spacing: 0.02em; text-transform: none; }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-bg); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 11.5px; }
.btn-xs { height: 30px; padding: 0 10px; font-size: 11px; letter-spacing: 0.03em; }
.btn-icon-logout { width: 36px; height: 36px; padding: 0; flex-shrink: 0; border-radius: 4px; }

.inline-link-btn { background: none; border: none; color: var(--ink-secondary); font-family: 'Manrope', sans-serif; font-size: 11px; text-decoration: underline; cursor: pointer; padding: 0; white-space: nowrap; }
.inline-link-btn:hover { color: var(--ink-primary); }

.topbar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar-inner { max-width: 1420px; margin: 0 auto; padding: 8px 24px; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar-brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.topbar-logo { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 27px; font-weight: 500; white-space: nowrap; }
.topbar-tag { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-light); white-space: nowrap; }
.topbar-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-stats-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-right: 4px; }
.cache-pill { display: inline-flex; align-items: center; gap: 10px; padding: 5px 11px; background: var(--bg-alabaster); border-radius: 2px; font-size: 12px; color: var(--ink-secondary); }
.archive-stat-line { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-secondary); padding-right: 2px; }
.archive-refresh-btn { background: none; border: none; color: var(--ink-light); font-size: 13px; line-height: 1; cursor: pointer; padding: 0 2px; transition: color 0.18s ease, transform 0.25s ease; }
.archive-refresh-btn:hover { color: var(--ink-primary); }
.archive-refresh-btn.spinning { animation: spin360 0.7s linear infinite; pointer-events: none; color: var(--ink-primary); }
@keyframes spin360 { to { transform: rotate(360deg); } }

/* КОМПАКТНЫЙ МИНИ-ДАШБОРД СЪЁМОК ПО ГОДАМ */
.stats-strip-wrap { max-width: 1420px; margin: 18px auto 0; padding: 0 24px; }
.year-dashboard { padding: 12px 22px 11px; }
.year-dash-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.year-dash-title-group { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.year-dash-title { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-secondary); }
.year-dash-sub { font-size: 11px; color: var(--ink-light); }
.year-dash-total { font-size: 12px; font-weight: 600; color: var(--ink-primary); }
.year-bars {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 2px 4px 0;
  border-bottom: 1px solid var(--hairline);
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
}
.year-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 54px;
  flex: 1 1 0;
  max-width: 82px;
  padding-bottom: 6px;
}
.year-col-val { font-size: 11px; font-weight: 500; line-height: 1.15; color: var(--ink-primary); margin-bottom: 4px; white-space: nowrap; }
.year-col-bar { width: 100%; max-width: 34px; min-height: 6px; background: #262522; border-radius: 2px 2px 0 0; transition: height 0.35s ease, background-color 0.2s ease; }
.year-col:hover .year-col-bar { background: #111110; }
.year-col-label { margin-top: 5px; font-size: 11.5px; font-weight: 500; line-height: 1.15; color: var(--ink-secondary); white-space: nowrap; }

.dashboard { max-width: 1420px; margin: 0 auto; padding: 18px 24px calc(72px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: 460px minmax(0, 1fr); gap: 26px; align-items: start; }
.left-column { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.panel { background: var(--bg-white); padding: 24px; box-shadow: 0 12px 36px rgba(28, 27, 25, 0.03); min-width: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--hairline); }
.panel-title { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 25px; font-weight: 500; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }

.links-header { flex-wrap: wrap; }
.links-title-wrap { display: flex; align-items: baseline; gap: 8px; }
.sort-select { width: auto; min-width: 225px; height: 34px; font-size: 12px; padding: 0 10px; }

.folder-combo { position: relative; width: 100%; }
.folder-combo-input-wrap { position: relative; display: flex; align-items: center; }
.folder-combo-input { padding-right: 68px; }
.folder-combo-actions { position: absolute; right: 8px; display: flex; align-items: center; gap: 2px; }
.combo-icon-btn { width: 28px; height: 28px; border: none; background: transparent; color: var(--ink-secondary); border-radius: 2px; cursor: pointer; font-size: 13px; }
.combo-icon-btn:hover { background: var(--bg-hover); color: var(--ink-primary); }
.folder-dropdown { position: absolute; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; background: var(--bg-white); border: 1px solid var(--hairline-strong); box-shadow: 0 18px 42px rgba(28, 27, 25, 0.14); border-radius: 2px; z-index: 55; display: none; flex-direction: column; }
.folder-dropdown.open { display: flex; }
.folder-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 13px; border: none; border-bottom: 1px solid var(--hairline); background: transparent; text-align: left; font-family: 'Manrope', sans-serif; cursor: pointer; }
.folder-option:hover, .folder-option.selected { background: var(--bg-alabaster); }
.folder-opt-name { font-size: 13px; font-weight: 500; color: var(--ink-primary); }
.folder-opt-sub { font-size: 11px; color: var(--ink-light); }
.folder-opt-badge { font-size: 10.5px; padding: 2px 7px; border-radius: 2px; background: var(--success-bg); color: var(--success); }
.folder-dropdown-empty { padding: 14px; font-size: 13px; color: var(--ink-secondary); text-align: center; }

.studio-tabs { display: flex; gap: 6px; background: var(--bg-alabaster); padding: 4px; border-radius: 2px; margin-bottom: 14px; }
.studio-tab { flex: 1 1 0%; height: 32px; border: none; background: transparent; font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 500; color: var(--ink-secondary); border-radius: 2px; cursor: pointer; padding: 0 6px; }
.studio-tab.active { background: var(--bg-white); color: var(--ink-primary); box-shadow: 0 2px 6px rgba(28, 27, 25, 0.06); }

.section-inline-row { display: flex; gap: 8px; align-items: center; }
.section-inline-row .select, .section-inline-row .input { flex: 1 1 auto; min-width: 0; }
.quick-sections-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.chip-btn { height: 27px; padding: 0 9px; border: 1px solid var(--hairline-strong); background: var(--bg-white); border-radius: 2px; font-family: 'Manrope', sans-serif; font-size: 11.5px; color: var(--ink-primary); cursor: pointer; }
.chip-btn:hover { background: var(--bg-alabaster); border-color: var(--ink-primary); }

.dropzone { border: 1.5px dashed var(--hairline-strong); background: var(--bg-alabaster); border-radius: 2px; padding: 18px 14px; text-align: center; transition: border-color 0.2s ease, background-color 0.2s ease; }
.dropzone.dragover { border-color: var(--ink-primary); background: var(--bg-hover); }
.dropzone-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.dropzone-sub { font-size: 11.5px; color: var(--ink-secondary); margin-bottom: 10px; }
.dropzone-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.upload-progress-wrap { display: none; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--bg-alabaster); border-radius: 2px; }
.upload-progress-wrap.active { display: flex; }
.upload-progress-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; }
.progress-track { width: 100%; height: 5px; background: #E2DFD7; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--ink-primary); transition: width 0.2s ease; }

.slug-preview { font-size: 11.5px; color: var(--ink-secondary); background: var(--bg-alabaster); padding: 6px 10px; border-radius: 2px; word-break: break-all; }

/* ВЫБОР ПРЕСЕТА ОФОРМЛЕНИЯ ГАЛЕРЕИ */
.theme-presets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.theme-preset-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  background: var(--bg-alabaster);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  cursor: pointer;
  text-align: left;
  font-family: 'Manrope', sans-serif;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
  min-width: 0;
}
.theme-preset-card:hover {
  background: var(--bg-white);
  border-color: var(--hairline-strong);
}
.theme-preset-card.selected {
  background: var(--bg-white);
  border-color: var(--ink-primary);
  box-shadow: 0 3px 10px rgba(28, 27, 25, 0.06);
}
.theme-preset-card.selected::after {
  content: "✓";
  position: absolute;
  top: 5px;
  right: 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-primary);
}
.theme-mini-preview {
  width: 44px;
  height: 48px;
  border-radius: 2px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(28, 27, 25, 0.1);
}
.theme-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.theme-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.2;
}
.theme-card-desc {
  font-size: 10.5px;
  color: var(--ink-secondary);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Миниатюры 4 пресетов */
.preview-editorial { background: #FAF9F7; }
.preview-editorial .mp-hero { height: 14px; background: #DED9D0; border-radius: 1px; }
.preview-editorial .mp-grid-masonry { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5px; flex: 1; }
.preview-editorial .mp-grid-masonry span { background: #CFC9BE; border-radius: 1px; height: 8px; }
.preview-editorial .mp-grid-masonry span.t-tall { height: 13px; }

.preview-studio { background: #151514; border-color: #2C2B28; }
.preview-studio .mp-hero { height: 14px; background: #2A2926; border-bottom: 1.5px solid #C8A878; border-radius: 1px; }
.preview-studio .mp-grid-masonry { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5px; flex: 1; }
.preview-studio .mp-grid-masonry span { background: #363430; height: 9px; }
.preview-studio .mp-grid-masonry span.t-tall { height: 14px; }

.preview-split { background: #FFFFFF; }
.preview-split .mp-hero-split { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; height: 16px; }
.preview-split .mp-split-img { background: #CFC9BE; border-radius: 1px; }
.preview-split .mp-split-txt { background: #F2EFEA; border-radius: 1px; position: relative; }
.preview-split .mp-split-txt::after { content: ""; position: absolute; left: 3px; right: 5px; top: 7px; height: 2px; background: #9E9990; }
.preview-split .mp-grid-even { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; flex: 1; }
.preview-split .mp-grid-even span { background: #DCD6CC; border-radius: 1px; height: 13px; }

.preview-cinema { background: #F2EDE4; }
.preview-cinema .mp-hero { height: 13px; background: #C8BFB0; border-radius: 1px; }
.preview-cinema .mp-grid-rhythm { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; flex: 1; }
.preview-cinema .mp-grid-rhythm span { background: #D8D0C3; border-radius: 1px; height: 8px; }
.preview-cinema .mp-grid-rhythm span.t-wide { grid-column: 1 / -1; height: 9px; background: #BFB5A4; }

.toggles-stack { display: flex; flex-direction: column; gap: 8px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--bg-alabaster); border-radius: 2px; cursor: pointer; }
.toggle-text { display: flex; flex-direction: column; gap: 2px; }
.toggle-title { font-size: 13px; font-weight: 500; }
.toggle-desc { font-size: 11px; color: var(--ink-secondary); }
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background-color: #D5D1C8; border-radius: 22px; transition: background-color 0.2s ease; }
.slider::before { content: ""; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: #FFFFFF; border-radius: 50%; transition: transform 0.2s ease; }
.switch input:checked + .slider { background-color: var(--ink-primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ВЫБОР ОБЛОЖКИ HERO */
.cover-picker-box { background: var(--bg-alabaster); padding: 12px; border-radius: 2px; }
.cover-stats { font-size: 12px; color: var(--ink-secondary); margin-bottom: 8px; display: flex; justify-content: space-between; }
.cover-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: max-content; align-items: start; gap: 7px; max-height: 240px; overflow-y: auto; }
.cover-more-wrap { margin-top: 8px; text-align: center; }

.cover-thumb {
  position: relative; height: 68px; min-height: 68px; background: #E8E5DE; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; border-radius: 2px; display: flex; align-items: center; justify-content: center;
}
.cover-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.cover-thumb.selected { border-color: var(--ink-primary); }
.cover-thumb.selected::after { content: "✓"; position: absolute; top: 3px; right: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--ink-primary); color: #FFFFFF; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.cover-fallback-label { font-size: 9.5px; color: var(--danger); padding: 3px; text-align: center; word-break: break-all; }

.form-actions { display: flex; gap: 10px; margin-top: 2px; }
.form-actions .btn-primary { flex: 1 1 auto; }

/* КОМПАКТНЫЙ СПИСОК КЛИЕНТСКИХ ССЫЛОК */
.search-bar { margin-bottom: 14px; }
.galleries-list { display: flex; flex-direction: column; gap: 10px; }

.gallery-item {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding: 12px 14px;
  background: var(--bg-alabaster); border: 1px solid var(--hairline); border-radius: 2px; align-items: center;
}
.gallery-thumb {
  width: 84px; height: 64px; background: #E5E1D8; border-radius: 2px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: var(--ink-light); font-size: 11px; flex-shrink: 0;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gallery-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gallery-top-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.gallery-name { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 20px; font-weight: 600; line-height: 1.1; color: var(--ink-primary); }
.gallery-date-pill { font-size: 11.5px; font-weight: 500; color: var(--ink-secondary); white-space: nowrap; }
.gallery-folder { font-size: 11.5px; color: var(--ink-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gallery-bottom-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 2px; }
.badges-row { display: flex; flex-wrap: wrap; gap: 5px; }
.badge { padding: 2px 7px; border-radius: 2px; font-size: 10.5px; font-weight: 500; background: var(--bg-white); color: var(--ink-secondary); border: 1px solid var(--hairline); }
.badge-theme { background: #F1EDE5; color: var(--ink-primary); border-color: rgba(28, 27, 25, 0.14); }
.badge-ok { background: var(--success-bg); color: var(--success); border-color: transparent; }
.badge-expired { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }

.gallery-actions { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.empty-box { text-align: center; padding: 40px 16px; color: var(--ink-secondary); font-size: 13.5px; background: var(--bg-alabaster); border-radius: 2px; }

/* МОДАЛЬНОЕ ОКНО БЕЗОПАСНОСТИ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(24, 23, 21, 0.48); z-index: 150;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
  width: 100%; max-width: 480px; background: var(--bg-white); padding: 22px 24px;
  border-radius: 3px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}
.sec-box { background: var(--bg-alabaster); padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 2px; }
.sec-box-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.sec-desc { font-size: 12px; color: var(--ink-secondary); line-height: 1.48; }
.sec-desc code { background: var(--bg-white); padding: 1px 5px; border: 1px solid var(--hairline); border-radius: 2px; font-size: 11px; color: var(--ink-primary); }

.toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); right: 24px; background: var(--ink-primary); color: #FFFFFF; padding: 12px 18px; border-radius: 3px; font-size: 13px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2); opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity 0.22s ease, transform 0.22s ease; z-index: 200; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1040px) {
  .stats-strip-wrap { margin-top: 12px; padding: 0 12px; }
  .year-dashboard { padding: 11px 14px 10px; }
  .dashboard { grid-template-columns: 1fr; padding: 14px 12px calc(60px + env(safe-area-inset-bottom, 0px)); gap: 16px; }
  .topbar-inner { padding: 6px 12px; min-height: 56px; }
  .topbar-tag, .cache-text, .year-dash-sub { display: none; }
  .topbar-logo { font-size: 23px; }
  .cache-pill { padding: 5px 10px; }
  .panel { padding: 18px 14px; }
  .target-folder-badge { max-width: 165px; }
  .sort-select { min-width: 195px; }
}
@media (max-width: 640px) {
  .archive-stat-line { display: none; }
}
@media (max-width: 520px) {
  .two-cols { grid-template-columns: 1fr; }
  .theme-presets-grid { grid-template-columns: 1fr; }
  .gallery-item { grid-template-columns: 68px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .gallery-thumb { width: 68px; height: 54px; }
  .cover-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cover-thumb { height: 76px; min-height: 76px; }
  .year-bars { gap: 12px; }
  .year-col { min-width: 46px; }
}