/* ==============================================================
   ЛАВРОВА ЯНА / ХУДОЖНИК — минималистичная галерея
   Двухрежимная тема: тёмная по умолчанию + светлая
   ============================================================== */

:root {
  --bg:        #f9f9f9;   /* светлая тема */
  --fg:        #1a1a1a;
  --line:      #e5e5e5;
  --card:      #ffffff;
  --soft:      #f0f0f0;
  --muted:     #777777;
  --accent:    #111111;
  --accent-fg: #ffffff;
  --nav-hover: #f0f0f0;

  --ok:      #15803d;  --ok-bg:   #dcfce7;
  --warn:    #b45309;  --warn-bg: #fef3c7;
  --bad:     #b91c1c;  --bad-bg:  #fee2e2;

  --shadow: 0 10px 30px -18px rgba(0,0,0,.25);
}

.dark {
  --bg:        #1b1c20;   /* тёмная тема */
  --fg:        #f3f3f3;
  --line:      #2e3036;
  --card:      #222327;
  --soft:      #26272b;
  --muted:     #9a9b9f;
  --accent:    #f3f3f3;
  --accent-fg: #1b1c20;
  --nav-hover: #26272b;

  --ok:      #4ade80;  --ok-bg:   rgba(74,222,128,.12);
  --warn:    #fbbf24;  --warn-bg: rgba(251,191,36,.12);
  --bad:     #f87171;  --bad-bg:  rgba(248,113,113,.12);

  --shadow: 0 14px 40px -20px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ----------------------------- Хедер ----------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
}

.site-header .container {
  display: flex; align-items: center; gap: 16px;
  height: 96px;
}

.logo { display: block; line-height: 1.08; letter-spacing: .06em; }
.logo .l1 {
  font-size: 38px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; display: block; line-height: 1;
}
.logo .l2 {
  font-size: 12px; font-weight: 400; text-transform: uppercase;
  color: var(--muted); letter-spacing: .5em; margin-top: 7px; display: block;
}

.main-nav { display: flex; gap: 32px; margin-left: auto; }
.main-nav a {
  font-size: 17px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .14em; color: var(--muted);
  padding: 8px 0; border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.main-nav a:hover { color: var(--fg); }
.main-nav a.active { color: var(--fg); border-bottom-color: var(--fg); }

.header-tools { display: flex; align-items: center; gap: 14px; margin-left: 28px; }

/* Переключатель языка (RU/EN) */
.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; letter-spacing: .14em;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px;
  background: transparent; cursor: pointer; transition: border-color .2s;
}
.lang-toggle:hover { border-color: var(--fg); }
.lang-toggle .lang-item { color: var(--muted); opacity: .5; transition: color .2s, opacity .2s; }
.lang-toggle .lang-item.active { color: var(--fg); opacity: 1; }
.lang-toggle .lang-sep { color: var(--muted); opacity: .45; font-size: 11px; }

/* Переключатель темы — Sun/Moon */
.theme-toggle {
  position: relative; width: 48px; height: 26px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: var(--soft);
  cursor: pointer; transition: background .3s, border-color .3s; flex: none;
}
.theme-toggle .tt-icon {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--muted); pointer-events: none;
}
.theme-toggle .tt-icon svg { width: 100%; height: 100%; display: block; }
.theme-toggle .tt-sun  { left: 6px; }
.theme-toggle .tt-moon { right: 6px; }
.theme-toggle .tt-thumb {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); transition: left .28s cubic-bezier(.4,0,.2,1), background .3s;
}
.dark .theme-toggle .tt-thumb { left: 24px; }

/* Мобильное меню */
.menu-btn { display: none; background: none; border: none; border-radius: 0; width: 40px; height: 40px; padding: 0; color: var(--fg); cursor: pointer; align-items: center; justify-content: center; }
.menu-btn svg { width: 24px; height: 24px; }

@media (max-width: 900px) {
  .header-tools { margin-left: auto; }
  .main-nav {
    display: none; position: absolute; top: 96px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    flex-direction: column; gap: 0; padding: 8px 24px 16px; margin-left: 0;
    box-shadow: 0 20px 30px -20px rgba(0,0,0,.3);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
  .main-nav a:last-child { border-bottom: none; }
  .menu-btn { display: inline-flex; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .lang-toggle { padding: 4px 6px; font-size: 12px; letter-spacing: .1em; }
  .logo .l1 { font-size: 22px; letter-spacing: .08em; }
  .logo .l2 { letter-spacing: .34em; }
  .site-header .container { height: 84px; gap: 6px; }
  .header-tools { gap: 10px; }
  .theme-toggle { width: 42px; }
  .menu-btn { width: 36px; height: 36px; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .header-tools { gap: 10px; }
}
@media (min-width: 901px) and (max-width: 1140px) {
  .site-header .container { gap: 20px; }
  .logo .l1 { font-size: 30px; }
  .main-nav { gap: 26px; margin-left: auto; }
  .main-nav a { font-size: 15px; letter-spacing: .1em; }
  .header-tools { gap: 10px; }
}

/* ----------------------------- Контент --------------------------- */
.section { padding: 60px 0; }
#bio { padding: 50px 0 45px; min-height: auto; }
#contact { padding: 45px 0 40px; min-height: auto; }

#gallery { padding-top: 30px; }

/* Фильтр */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 0 24px; }
.filter-btn {
  font-size: 13px; letter-spacing: .04em; color: var(--muted);
  border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 7px 18px; cursor: pointer; transition: all .2s;
}
.filter-btn:hover { color: var(--fg); border-color: var(--muted); }
.filter-btn.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

/* Сетка карточек — Grid: верхний ряд идеально выровнен, пропорции картин сохранены */
.grid-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
  padding: 4px 0 8px;
}
@media (min-width: 768px)  { .grid-gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-gallery { grid-template-columns: repeat(4, 1fr); } }

/* Карточка работы */
.art-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.art-card:hover { border-color: var(--muted); box-shadow: 0 14px 40px -20px rgba(0,0,0,.7), 0 0 0 1px var(--line); }

.art-thumb {
  display: block; overflow: hidden; background: var(--soft); position: relative;
  aspect-ratio: 4 / 5; /* fallback, перекрывается inline-соотношением из размеров */
}
.art-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.art-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.art-title { font-size: 17px; font-weight: 500; letter-spacing: .01em; margin: 0; line-height: 1.35; }
.art-title a:hover { opacity: .8; }
.art-meta { font-size: 12px; color: var(--muted); margin: 0; }
.art-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Бейджи статусов */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500; letter-spacing: .05em;
  border-radius: 999px; padding: 4px 12px; width: fit-content;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { color: var(--ok);  background: var(--ok-bg); }
.badge.amber { color: var(--warn); background: var(--warn-bg); }
.badge.red   { color: var(--bad); background: var(--bad-bg); }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 8px; padding: 10px 18px; font-size: 13px; letter-spacing: .02em;
  border: 1px solid transparent; cursor: pointer; transition: all .2s; white-space: nowrap;
  background: var(--accent); color: var(--accent-fg);
}
.btn:hover { opacity: .86; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--fg); }
.btn-ghost:hover { border-color: var(--fg); opacity: 1; }
.btn-sm { padding: 7px 13px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { opacity: .85; }

.price { font-size: 15px; font-weight: 600; }

/* Секции Биография / Контакты */
.section-title {
  font-size: 26px; font-weight: 500; letter-spacing: -.01em; margin: 0 0 24px;
  display: flex; align-items: center; gap: 16px;
}
.section-title::after { content: ""; height: 1px; flex: 1; background: var(--line); }

.bio-grid { display: flex; gap: 56px; align-items: center; }
.bio-portrait {
  flex: none; width: min(300px, 38%); aspect-ratio: 3/4;
  border-radius: 8px; overflow: hidden; border: 1px solid var(--line);
}
.bio-portrait img { width: 100%; height: 100%; object-fit: cover; }
.bio-text { color: var(--muted); font-size: 18px; line-height: 1.85; flex: 1; }
.bio-text p { margin: 0 0 16px; }
.bio-text strong { color: var(--fg); font-weight: 600; }
.bio-facts {
  display: flex; gap: 52px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 22px; margin-top: 8px;
}
.bio-facts .fact b { display: block; font-size: 18px; font-weight: 600; color: var(--fg); letter-spacing: .02em; }
.bio-facts .fact span { display: block; font-size: 12.5px; margin-top: 4px; letter-spacing: .06em; }

/* Три блока-выделения над фото и текстом биографии */
.bio-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin: 0 0 40px;
}
.bio-highlight {
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: 10px;
  padding: 22px 24px;
  background: var(--card);
}
.bio-highlight .hl-num {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .24em;
  color: var(--muted);
}
.bio-highlight .hl-eye {
  display: block;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.bio-highlight p {
  margin: 10px 0 0;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--fg);
}
.bio-read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.bio-read-more::after {
  content: '→';
  transition: transform .2s;
}
.bio-read-more:hover::after { transform: translateX(3px); }

/* Попап «Читать подробнее» — полный текст биографии */
.modal-bio-card { max-width: 720px; text-align: left; }
.bio-modal-body {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

@media (max-width: 768px) {
  .bio-grid { flex-direction: column; gap: 28px; align-items: flex-start; }
  .bio-portrait { width: 100%; max-width: 320px; }
  .bio-facts { gap: 26px; }
  .bio-highlights { gap: 14px; margin-bottom: 32px; }
  .bio-highlight { padding: 18px 20px; }
  .bio-modal-body { font-size: 16px; }
}

.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.contact-card {
  border: 1px solid var(--line); border-radius: 8px; padding: 22px;
  display: flex; align-items: center; gap: 16px; transition: border-color .2s;
}
.contact-card:hover { border-color: var(--fg); }
.contact-card .ic {
  width: 42px; height: 42px; flex: none; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; background: var(--soft); border: 1px solid var(--line);
}
.contact-card .ic svg { width: 18px; height: 18px; }
.contact-card .ic-img { width: 20px; height: 20px; object-fit: contain; display: none; }
.contact-card .ic-img.ic-light { display: block; }
.dark .contact-card .ic-img.ic-light { display: none; }
.dark .contact-card .ic-img.ic-dark { display: block; }
.contact-card small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.contact-card span { font-size: 14px; }

/* ----------------------------- Футер ----------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; margin-top: 40px; }
.site-footer .container { display: flex; justify-content: center; text-align: center; }
.site-footer small { color: var(--muted); font-size: 12px; letter-spacing: .06em; }

/* --------------------------- Страница работы --------------------- */
.work-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 48px; align-items: start; }
@media (max-width: 900px) { .work-layout { grid-template-columns: 1fr; } }

.work-viewer {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: var(--soft); box-shadow: var(--shadow);
}
.work-viewer img { width: 100%; height: auto; cursor: zoom-in; }

.work-info { position: sticky; top: 118px; display: flex; flex-direction: column; gap: 18px; }
.work-info h1 { font-size: 30px; font-weight: 500; margin: 0; letter-spacing: -.01em; line-height: 1.2; }
.work-info .lead { color: var(--muted); margin: 0; }

.spec-list { border-top: 1px solid var(--line); }
.spec-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.spec-row dt { color: var(--muted); }
.spec-row dd { margin: 0; font-weight: 500; text-align: right; }

.zoom-hint { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.zoom-hint svg { width: 15px; height: 15px; }

/* ----------------------------- Формы ----------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.form-grid .col-2 { grid-column: span 2; }
.form-grid .col-3 { grid-column: span 3; }
.form-grid .col-6 { grid-column: span 6; }
@media (max-width: 768px) { .form-grid .col-1, .form-grid .col-2, .form-grid .col-3, .form-grid .col-6 { grid-column: span 6; } }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.field input, .field select, .field textarea {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  color: var(--fg); padding: 10px 13px; font-size: 14px; font-family: inherit;
  transition: border-color .2s; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--muted);
}
.field input[type="file"] { padding: 8px; }
.field input[type="file"]::file-selector-button {
  background: var(--soft); border: 1px solid var(--line); border-radius: 6px;
  color: var(--fg); padding: 7px 13px; margin-right: 12px; cursor: pointer; font-size: 12px;
}
.field .hint { font-size: 11px; color: var(--muted); }

/* Панель админа */
.admin-panel { padding: 40px 0; }
.admin-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 26px; margin-bottom: 28px; box-shadow: var(--shadow);
}
.admin-card h2 { margin: 0 0 20px; font-size: 18px; font-weight: 500; }
.admin-card h3 {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.admin-card h4 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
}
.admin-card .admin-card {
  margin-top: 24px;
}
.admin-workspace {
  width: 100%;
  margin-bottom: 0;
}
.admin-workspace > .form-grid {
  align-items: start;
}
.admin-workspace > .form-grid > .col-6 > .admin-card {
  margin-bottom: 0;
}
.admin-workspace form .form-grid {
  margin-bottom: 18px;
}
.admin-workspace .admin-card {
  box-shadow: none;
}
.admin-workspace > .admin-card,
.admin-workspace > .form-grid .admin-card {
  background: var(--soft);
}
.admin-workspace > .admin-card > form > div + div {
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.admin-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.admin-tab {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--fg);
  border-radius: 10px;
  padding: 9px 14px;
  transition: all .2s ease;
}
.admin-tab:hover { background: var(--soft); }
.admin-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-fg);
}

.admin-card form > button {
  margin-top: 20px;
}
.artwork-preview-field { align-self: end; }
.admin-workspace > .admin-card > form > .bio-fact-block {
  border-top: none;
  padding-top: 16px;
  margin-top: 20px;
}
.bio-fact-block {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}
.bio-fact-block .form-grid { margin-bottom: 0; }
.admin-card .bio-fact-block h4 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--fg);
}
.artwork-preview {
  width: min(100%, 260px);
  min-height: 130px;
  overflow: hidden;
  position: relative;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.artwork-preview img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; -khtml-user-drag: none; -moz-user-drag: none; -o-user-drag: none; user-drag: none; }
.artwork-preview.is-dragging { cursor: grabbing; }
.crop-modal-card { max-width: 620px; text-align: left; }
.crop-modal-hint { margin: -8px 0 20px; color: var(--muted); font-size: 13px; }
.crop-ratio-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.crop-ratio-option {
  display: flex; min-height: 72px; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--muted); cursor: pointer;
  font: inherit; font-size: 11px; transition: border-color .15s, background .15s, color .15s;
}
.crop-ratio-option:hover { border-color: var(--fg); color: var(--fg); }
.crop-ratio-option.active { border-color: var(--accent); background: var(--accent); color: var(--accent-fg); }
.ratio-icon { display: block; border: 2px solid currentColor; border-radius: 2px; }
.ratio-portrait { width: 14px; height: 19px; }
.ratio-square { width: 17px; height: 17px; }
.ratio-landscape { width: 22px; height: 16px; }
.crop-editor { width: 100%; max-width: 320px; min-height: 0; margin: 0 auto; }
.crop-zoom-label { margin: 10px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.crop-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@media (max-width: 640px) {
  .crop-modal-card { padding: 18px; }
  .crop-editor { max-width: 100%; }
  .crop-modal-actions { flex-direction: column-reverse; }
  .crop-modal-actions .btn { width: 100%; }
}

@media (max-width: 1024px) {
  .admin-workspace > .form-grid > .col-6 {
    grid-column: span 6;
  }
  .admin-workspace > .form-grid > .col-6 + .col-6 {
    margin-top: 20px;
  }
}

@media (max-width: 640px) {
  .admin-panel { padding: 24px 0; }
  .admin-card { padding: 18px; }
  .admin-tabs { gap: 8px; }
  .admin-tab { flex: 1 1 100%; justify-content: center; }
  .admin-table { min-width: 680px; }
  .admin-card h2 { font-size: 17px; }
  .admin-card h3 { font-size: 15px; }
  .admin-card h4 { font-size: 16px; }
}

.bio-image-preview {
  min-height: 170px;
  width: 100%;
  border: 1px dashed var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--soft);
}
.bio-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th:last-child, .admin-table td:last-child {
  position: sticky; right: 0; background: var(--card);
  box-shadow: -8px 0 10px -10px rgba(0,0,0,.35);
}
.admin-table th:last-child { background: var(--bg); }
.admin-table th {
  text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-thumb { width: 52px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg a {
  padding: 6px 10px; font-size: 11px; letter-spacing: .03em; color: var(--muted);
  border-right: 1px solid var(--line); transition: all .15s;
}
.seg a:last-child { border-right: none; }
.seg a:hover { color: var(--fg); }
.seg a.active { color: var(--ok); background: var(--ok-bg); }
.seg a.active[data-st="reserved"] { color: var(--warn); background: var(--warn-bg); }
.seg a.active[data-st="sold"] { color: var(--bad); background: var(--bad-bg); }

.icon-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--line); border-radius: 7px;
  color: var(--fg); padding: 7px 11px; font-size: 12px; cursor: pointer; transition: border-color .2s;
}
.icon-btn:hover { border-color: var(--fg); }
.icon-btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.icon-btn svg { width: 14px; height: 14px; }

.alert {
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px;
  font-size: 13px; margin-bottom: 20px; display: flex; gap: 10px; align-items: center;
}
.alert.error { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }
.alert.success { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }

/* Модальное окно QR */
.modal {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px); padding: 20px;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 26px; max-width: 400px; width: 100%; text-align: center; box-shadow: var(--shadow);
}
.modal-card h3 { margin: 0 0 16px; font-size: 17px; font-weight: 500; }
.modal-card .qr-box { display: flex; justify-content: center; padding: 14px; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.modal-card .qr-url { font-size: 12px; color: var(--muted); word-break: break-all; margin: 12px 0 16px; }
.modal-card .row { display: flex; gap: 10px; justify-content: center; }

.buy-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 0; }
.buy-actions a, .buy-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); color: var(--fg); text-decoration: none; font-size: 13px; }
.buy-actions a:hover, .buy-actions button:hover { border-color: var(--fg); }
.buy-actions .buy-primary { background: var(--accent); color: var(--accent-fg); border-color: transparent; }

@media (max-width: 640px) {
  .buy-actions { grid-template-columns: 1fr; }
}

/* Логин */
.login-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 34px; box-shadow: var(--shadow);
}
.login-card .lock {
  width: 46px; height: 46px; margin: 0 auto 16px; border-radius: 50%;
  background: var(--soft); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.login-card .lock svg { width: 20px; height: 20px; }
.login-card h1 { font-size: 20px; font-weight: 500; text-align: center; margin: 0 0 6px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 22px; }

.empty { text-align: center; padding: 60px 0; color: var(--muted); }

/* Утилиты */
.muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }

/* Биография: портрет-заглушка */

/* Production polish: quiet motion, clear type and resilient small screens. */
:root { --muted: #6a6a6a; }
.dark { --muted: #afb0b6; }
html { scroll-padding-top: 120px; scrollbar-gutter: stable; }
body { line-height: 1.5; font-size: 16px; }
button,input,textarea,select { font: inherit; }
button { color: inherit; }
figure { margin: 0; }
a,button,input,select,textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 5px; }
.section { scroll-margin-top: 112px; }
.site-header { border-bottom: 1px solid var(--line); }
.site-header .container { gap: 16px; }
.logo { flex-shrink: 0; }
.logo .l1 { font-size: clamp(22px, 2.5vw, 34px); letter-spacing: .07em; }
.logo .l2 { font-size: 11px; letter-spacing: .38em; }
.main-nav { gap: 24px; }
.main-nav a { min-height: 44px; display: flex; align-items: center; font-size: 14px; letter-spacing: .1em; }
.header-tools { margin-left: 20px; gap: 12px; }
.lang-toggle { min-height: 44px; border-radius: 8px; padding: 8px 10px; }
.lang-toggle .lang-item { opacity: 1; }
.theme-toggle { height: 44px; width: 48px; border-color: transparent; background: transparent; }
.theme-toggle::before { content: ''; position: absolute; top: 8px; left: -1px; width: 48px; height: 26px; border: 1px solid var(--line); border-radius: 30px; background: var(--soft); }
.theme-toggle .tt-thumb { top: 11px; left: 2px; }
.dark .theme-toggle .tt-thumb { left: 24px; }
.menu-btn { width: 44px; height: 44px; flex: none; }
.gallery-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin: 16px 0 36px; }
.eyebrow { margin: 0 0 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .18em; font-size: 12px; }
.gallery-intro h1 { margin: 0; font-size: clamp(32px, 3.6vw, 48px); line-height: 1.15; letter-spacing: -.035em; font-weight: 500; }
.gallery-caption { margin: 0 0 4px; max-width: 230px; font-size: 15px; line-height: 1.6; color: var(--muted); }
.filter-bar { gap: 8px; padding-bottom: 28px; }
.filter-btn { min-height: 44px; display: inline-flex; align-items: center; padding: 9px 16px; font-size: 14px; }
.gallery-columns-grid,.gallery-col { min-width: 0; }
.art-card { box-shadow: none; border-radius: 10px; }
.art-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); border-color: var(--muted); }
.art-thumb img { transition: transform .6s cubic-bezier(.2,.65,.3,1); }
@media (hover:hover) { .art-thumb:hover img { transform: scale(1.025); } }
.art-body { gap: 10px; padding: 18px; }
.art-title { font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.art-meta { font-size: 14px; line-height: 1.55; }
.badge { font-size: 12px; letter-spacing: .01em; padding: 5px 10px; }
.price { font-size: 16px; font-variant-numeric: tabular-nums; }
.btn { min-height: 44px; font-size: 14px; }
.art-footer { margin-top: 6px; }
.bio-text { font-size: 17px; line-height: 1.8; max-width: 700px; }
.bio-highlights { gap: 16px; }
.bio-highlight .hl-eye { font-size: 12px; }
.bio-highlight { border-top-width: 1px; padding: 24px; }
.contact-card { border-radius: 10px; }
.contact-card > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.site-footer small { font-size: 14px; letter-spacing: .01em; }
.work-layout { gap: 40px; }
.work-viewer { box-shadow: none; }
.zoom-hint { font-size: 14px; align-items: flex-start; }
.zoom-hint svg { flex-shrink: 0; margin-top: 4px; }
.dialog-open { overflow: hidden; }
.modal { padding: 24px; background: rgba(0,0,0,.64); backdrop-filter: blur(8px); overscroll-behavior: contain; }
.modal-card { max-height: calc(100dvh - 48px); overflow-y: auto; animation: dialog-enter .22s ease-out; }
.modal-card h3 { font-size: 22px; line-height: 1.35; }
.buy-actions a { font-size: 14px; min-height: 48px; }
.buy-actions a:hover { border-color: var(--fg); }
.art-lightbox { z-index: 150; }
.art-lightbox > img { height: 88dvh; width: 92vw; max-height: 88dvh; max-width: 92vw; object-fit: contain; border-radius: 3px; }
.lightbox-close { position: absolute; top: 16px; right: 20px; width: 48px; height: 48px; font-size: 36px; line-height: 1; border: 1px solid rgba(255,255,255,.4); background: #242424; color: white; border-radius: 50%; cursor: pointer; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 200; background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 6px; }
.skip-link:focus { top: 12px; }
.reveal-in { animation: gallery-enter .45s ease-out both; }
@keyframes gallery-enter { from { transform: translateY(12px); } to { transform: none; } }
@keyframes dialog-enter { from { opacity: .5; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
@media (max-width: 1100px) and (min-width: 901px) {
 .main-nav { gap: 18px; } .header-tools { margin-left: 8px; gap: 8px; }
 .main-nav a { font-size: 12px; } .logo .l1 { font-size: 28px; }
}
@media (max-width: 900px) {
 .header-tools { margin-left: auto; }
 .main-nav { top: 96px; } .work-info { position: static; }
 .work-layout { gap: 28px; }
 .gallery-caption { max-width: 190px; }
}
@media (max-width: 640px) {
 html { scroll-padding-top: 96px; }
 .site-header .container { height: 84px; gap: 8px; }
 .logo .l1 { font-size: clamp(17px, 5.4vw, 22px); letter-spacing: .03em; }
 .logo .l2 { font-size: 10px; letter-spacing: .25em; margin-top: 6px; }
 .header-tools { gap: 4px; margin-left: auto; }
 .lang-toggle { padding: 6px; font-size: 11px; gap: 3px; }
 .main-nav { top: 84px; padding: 8px 16px 16px; }
 .main-nav a { font-size: 14px; }
 .gallery-intro { margin: 8px 0 28px; flex-direction: column; align-items: flex-start; gap: 14px; }
 .gallery-caption { max-width: 290px; margin: 0; }
 .eyebrow { font-size: 11px; }
 .filter-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 16px; margin-bottom: 12px; scrollbar-width: thin; }
 .filter-btn { white-space: nowrap; flex-shrink: 0; }
 .art-title { font-size: 20px; }
 .section { padding: 36px 0; scroll-margin-top: 96px; }
 #bio { padding-top: 40px; } #contact { padding-top: 32px; }
 .bio-highlights { grid-template-columns: 1fr; gap: 12px; margin-bottom: 24px; }
 .bio-highlight { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; }
 .bio-highlight .hl-eye { margin: 0; letter-spacing: .1em; }
 .bio-highlight p { margin: 0; font-size: 18px; text-align: right; }
 .bio-portrait { width: min(100%,300px); }
 .work-info h1 { font-size: 28px; }
 .modal { padding: 16px; } .modal-card { padding: 24px; max-height: calc(100dvh - 32px); }
 .modal-card h3 { font-size: 20px; }
 .login-wrap { padding: 24px 16px; } .login-card { max-width: 100%; }
}
@media (max-width: 360px) { .logo .l2 { letter-spacing: .18em; } .lang-toggle { font-size: 10px; } .header-tools { gap: 0; } }
@media (prefers-reduced-motion: reduce) {
 html { scroll-behavior: auto; }
 *,*::before,*::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Atelier palette — quiet mineral tones, soft light, fine paper grain. */
:root {
  --bg: #f5f2ec;
  --fg: #302e2a;
  --card: #fcfaf6;
  --soft: #eae6de;
  --line: rgba(87,76,59,.17);
  --muted: #70695f;
  --accent: #38342d;
  --accent-fg: #faf8f2;
  --nav-hover: #eae6de;
  --header-bg: rgba(245,242,236,.92);
  --ambient: rgba(172,144,104,.08);
  --ambient-soft: rgba(255,255,255,.5);
  --grain-opacity: .075;
  --focus-ring: #927b59;
}
.dark {
  --bg: #1c1d1b;
  --fg: #eeeae3;
  --card: #242522;
  --soft: #2b2c28;
  --line: rgba(222,207,184,.15);
  --muted: #b2ada3;
  --accent: #e9e1d5;
  --accent-fg: #25241f;
  --nav-hover: #2b2c28;
  --header-bg: rgba(28,29,27,.91);
  --ambient: rgba(177,144,103,.08);
  --ambient-soft: rgba(114,129,112,.025);
  --grain-opacity: .045;
  --focus-ring: #c6b393;
}
body {
  isolation: isolate;
  background: radial-gradient(ellipse 95% 820px at 6% 0%,var(--ambient),transparent 75%),radial-gradient(ellipse 85% 1100px at 100% 35%,var(--ambient-soft),transparent 80%),var(--bg);
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url('grain.png') repeat; opacity: var(--grain-opacity);
}
::selection { background: var(--accent); color: var(--accent-fg); }
:focus-visible { outline-color: var(--focus-ring); }
.site-header { background: var(--header-bg); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.logo .l1 { font-weight: 500; letter-spacing: .085em; }
.main-nav a { font-weight: 400; }
.gallery-intro h1 { font-weight: 400; letter-spacing: -.04em; }
.eyebrow { color: var(--muted); }
.art-card { border-color: var(--line); background: var(--card); box-shadow: 0 4px 18px rgba(0,0,0,.025); }
.art-card:hover { border-color: rgba(163,144,114,.48); box-shadow: 0 8px 28px rgba(0,0,0,.09); }
.art-title { font-weight: 400; }
.btn { transition: background-color .2s ease,color .2s ease,border-color .2s ease,opacity .2s ease; }
.filter-btn.active { box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.section-title { gap: 16px; font-weight: 400; }
.section-index { color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.bio-highlight { border-top: 1px solid var(--line); background: transparent; }
.bio-highlight p { font-weight: 400; }
.contact-card { background: transparent; position: relative; transition: background .25s ease,border-color .25s ease; }
.contact-card:hover { background: var(--card); border-color: rgba(163,144,114,.48); }
.contact-card .ic { transition: transform .25s ease; }
@media (hover:hover) { .contact-card:hover .ic { transform: translateY(-2px); } }
/* The language control is an unboxed typographic picker, not a pill toggle. */
.language-picker { position: relative; flex: none; }
.language-trigger {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 44px; min-height: 44px; padding: 8px 3px;
  border: 0; border-radius: 4px; background: transparent; color: var(--fg);
  font-size: 12px; font-weight: 500; letter-spacing: .08em; cursor: pointer;
  transition: opacity .2s ease;
}
.language-trigger:hover { opacity: .68; }
.language-trigger svg { transition: transform .2s ease; color: var(--muted); }
.language-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.language-menu {
  position: absolute; right: 0; top: calc(100% + 5px); min-width: 170px; padding: 6px;
  background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14); z-index: 80; animation: language-enter .15s ease-out;
}
.language-menu.hidden { display: none; }
.language-option {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  min-height: 44px; padding: 10px 12px; border-radius: 5px;
  font-size: 14px; transition: background .18s ease;
}
.language-option:hover,.language-option:focus-visible { background: var(--soft); }
.language-option.is-current { background: var(--soft); }
.language-code { color: var(--muted); font-size: 11px; letter-spacing: .08em; }
@keyframes language-enter { from { transform: translateY(-4px); } to { transform: none; } }
/* Portrait is a real editable content asset. The demo label disappears on replacement. */
.bio-grid { gap: clamp(32px,6vw,80px); align-items: center; }
.bio-portrait { width: min(340px,36%); max-width: none; aspect-ratio: auto; border: none; background: transparent; border-radius: 0; overflow: visible; }
.bio-photo { position: relative; aspect-ratio: 3/4; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--soft); }
.bio-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bio-portrait figcaption { margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.5; letter-spacing: .005em; }
.bio-text { min-width: 0; font-size: 18px; line-height: 1.85; }
.bio-text-preview p { margin: 0 0 1.2em; }
.bio-text-preview p:last-child { margin-bottom: 0; }
.bio-read-more { min-height: 44px; margin-top: 16px; font-size: 15px; gap: 12px; }
.bio-read-more::after { font-size: 20px; font-weight: 300; }
.modal-bio-card { max-width: 760px; padding: 32px; text-align: left; }
.bio-reading-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.bio-reading-header .eyebrow { margin: 0 0 10px; font-size: 11px; }
.bio-reading-header h3 { margin: 0; font-weight: 400; font-size: 28px; letter-spacing: -.02em; }
.dialog-close-icon { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.dialog-close-icon:hover { background: var(--soft); }
.bio-modal-body { max-height: min(60dvh,600px); padding-right: 16px; font-size: 18px; line-height: 1.85; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; overflow-wrap: anywhere; }
.bio-modal-body p { margin: 0 0 1.3em; }
.bio-modal-body p:last-child { margin-bottom: 0; }
/* Genuine formu.pro outline; the mask inherits the current theme ink colour. */
.site-footer { margin-top: 48px; padding: 28px 0; background: transparent; }
.site-footer .footer-layout { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; text-align: left; }
.site-footer small { font-size: 13px; letter-spacing: 0; }
.developer-credit { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.developer-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 0 6px 2px; color: var(--fg); transition: opacity .2s ease; }
.developer-link:hover { opacity: .65; }
.developer-mark { display: block; width: 120px; height: 26px; background-color: currentColor; -webkit-mask: url('brand/formu-logo.png') center/contain no-repeat; mask: url('brand/formu-logo.png') center/contain no-repeat; }
.reveal-in { animation-fill-mode: backwards; }
@media (max-width: 900px) { .main-nav { background: var(--bg); } }
@media (max-width: 768px) {
 .bio-grid { align-items: stretch; gap: 28px; }
 .bio-portrait { width: 100%; max-width: 420px; }
 .bio-text { font-size: 17px; }
}
@media (max-width: 640px) {
 .header-tools { gap: 4px; }
 .language-trigger { font-size: 11px; gap: 3px; }
 .language-menu { right: -48px; }
 .logo .l1 { font-size: clamp(17px,5.4vw,22px); letter-spacing: .03em; }
 .gallery-intro h1 { font-size: 34px; }
 .section-title { font-size: 25px; gap: 12px; }
 .bio-portrait { max-width: none; }
 .bio-photo { aspect-ratio: 4/4.6; }
 .bio-photo img { object-position: 50% 38%; }
 .bio-portrait figcaption { font-size: 13px; }
 .bio-text { font-size: 17px; line-height: 1.85; }
 .modal-bio-card { padding: 24px; }
 .bio-reading-header { margin-bottom: 20px; gap: 16px; }
 .bio-reading-header h3 { font-size: 24px; }
 .bio-modal-body { max-height: 56dvh; font-size: 16px; line-height: 1.85; padding-right: 10px; }
 .site-footer .footer-layout { flex-direction: column; justify-content: center; text-align: center; gap: 10px; }
 .site-footer { margin-top: 32px; padding: 24px 0; }
}
@media (prefers-reduced-motion: reduce) {
 .language-menu { animation: none; }
 .contact-card .ic,.art-thumb img { transition: none; }
}

/* Quiet, material-like labels instead of saturated storefront chips. */
.badge { border:1px solid var(--line); border-radius:4px; padding:4px 8px; gap:7px; font-size:14px; line-height:1.35; font-weight:400; letter-spacing:.025em; }
.badge.green { color:#466650; background:#e9eee5; border-color:#cbd5c5; }
.badge.amber { color:#795e38; background:#f0e9dd; border-color:#ddd0bb; }
.badge.red { color:#74615e; background:#eee8e5; border-color:#d9ccc7; }
.dark .badge.green { color:#bac8b0; background:#2a3029; border-color:#454e3f; }
.dark .badge.amber { color:#d0bea0; background:#332f27; border-color:#574b38; }
.dark .badge.red { color:#c1b2ac; background:#302b29; border-color:#51443f; }
.badge .dot { width:4px; height:4px; flex:0 0 4px; }
/* A gallery retains one stable frame, so changing views never shifts the page. */
.art-gallery { position:relative; min-width:0; aspect-ratio:var(--gallery-ratio,1); background:var(--soft); overflow:hidden; }
.gallery-viewport { display:flex; width:100%; height:100%; overflow-x:auto; overflow-y:hidden; scroll-snap-type:x mandatory; scrollbar-width:none; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; }
.gallery-viewport::-webkit-scrollbar { display:none; }
.gallery-slide { position:relative; flex:0 0 100%; width:100%; height:100%; min-width:0; scroll-snap-align:start; scroll-snap-stop:always; }
.gallery-image-link { display:block; width:100%; height:100%; }
.art-gallery .gallery-slide img { display:block; width:100%; height:100%; object-fit:cover; user-select:none; transition:filter .35s ease; }
.detail-gallery .gallery-slide img { object-fit:contain; }
.gallery-arrow { position:absolute; top:50%; transform:translateY(-50%); width:44px; height:44px; padding:12px; display:flex; align-items:center; justify-content:center; border:1px solid rgba(238,234,227,.28); border-radius:50%; background:rgba(27,28,25,.55); color:#f1ece3; backdrop-filter:blur(12px); cursor:pointer; opacity:0; transition:opacity .25s ease, background .25s ease, border-color .25s ease; z-index:2; }
.gallery-arrow svg { width:20px; height:20px; }
.gallery-prev { left:12px; }.gallery-next { right:12px; }
.art-gallery:hover .gallery-arrow,.art-gallery:focus-within .gallery-arrow { opacity:1; }
.gallery-arrow:hover { background:rgba(27,28,25,.88); border-color:rgba(238,234,227,.6); }
.art-gallery:hover .gallery-arrow:disabled,.art-gallery:focus-within .gallery-arrow:disabled { opacity:.28; cursor:default; }
.gallery-pagination { position:absolute; right:12px; bottom:12px; display:flex; align-items:center; gap:7px; min-height:26px; padding:4px 8px; border:1px solid rgba(238,234,227,.22); border-radius:4px; background:rgba(27,28,25,.56); color:#f1ece3; font-size:14px; line-height:1; letter-spacing:.04em; font-variant-numeric:tabular-nums; backdrop-filter:blur(10px); pointer-events:none; }
.gallery-pagination-divider { width:12px; height:1px; background:rgba(238,234,227,.45); }
.gallery-viewport:focus-visible { outline:2px solid var(--accent); outline-offset:-3px; }
.work-viewer { min-width:0; }
.gallery-upload-preview { display:flex; flex-wrap:wrap; gap:10px; }
.gallery-upload-preview img { width:72px; height:80px; object-fit:cover; border-radius:4px; }
.gallery-admin-image { display:flex; align-items:flex-start; gap:16px; padding:16px 0; border-bottom:1px solid var(--line); }
.gallery-admin-image>img { width:80px; height:100px; object-fit:cover; border-radius:4px; }
.gallery-admin-fields { display:grid; grid-template-columns:1fr 1fr; gap:12px; min-width:0; flex:1; }
.gallery-admin-fields label { display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--muted); min-width:0; }
.gallery-admin-fields label.gallery-delete { flex-direction:row; align-items:center; }
.gallery-delete input { width:16px; height:16px; }
@media (hover:none) { .gallery-arrow { display:none; } }
@media (max-width:640px) { .gallery-admin-fields { grid-template-columns:1fr; } }
@media (prefers-reduced-motion:reduce) { .gallery-viewport { scroll-behavior:auto; } .gallery-arrow,.art-gallery .gallery-slide img { transition:none; } }

/* The label and its arrow are one non-wrapping, vertically centred control. */
.bio-read-more { display:inline-flex; flex-flow:row nowrap; align-items:center; justify-content:flex-start; width:auto; max-width:100%; white-space:nowrap; line-height:1.2; }
.bio-read-more::after { content:none; }
.bio-read-more > span { display:block; }
.read-more-arrow { display:block; flex:0 0 20px; width:20px; height:20px; margin:0; transition:transform .2s ease; }
.bio-read-more:hover .read-more-arrow { transform:translateX(3px); }
/* Biography uses the same native swipe mechanics, with a portrait-sized frame. */
.bio-gallery { aspect-ratio:3/4; border:1px solid var(--line); border-radius:10px; }
.bio-gallery .gallery-slide img { position:static; inset:auto; object-fit:cover; }
.gallery-dots { display:none; }
@media (max-width:640px) {
 .filter-bar { --fade-left:0px; --fade-right:0px; scrollbar-width:none; -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 var(--fade-left),#000 calc(100% - var(--fade-right)),transparent 100%); mask-image:linear-gradient(90deg,transparent 0,#000 var(--fade-left),#000 calc(100% - var(--fade-right)),transparent 100%); }
 .filter-bar::-webkit-scrollbar { display:none; }
 .filter-bar.has-more-left { --fade-left:32px; }
 .filter-bar.has-more-right { --fade-right:40px; }
 .gallery-pagination { display:none; }
 .gallery-dots { position:absolute; display:flex; align-items:center; justify-content:center; gap:7px; bottom:12px; left:50%; transform:translateX(-50%); padding:9px 11px; min-height:26px; border:1px solid rgba(238,234,227,.2); border-radius:20px; background:rgba(27,28,25,.5); backdrop-filter:blur(10px); pointer-events:none; }
 .gallery-dot { display:block; width:6px; height:6px; border-radius:6px; background:rgba(246,241,232,.48); transition:width .24s ease,background-color .24s ease; }
 .gallery-dot.is-active { width:18px; background:#f6f1e8; }
 .bio-gallery { aspect-ratio:4/4.6; }
}
@media (prefers-reduced-motion:reduce) { .gallery-dot,.read-more-arrow { transition:none; } }
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
