/* =========================================================================
   Tattoo Office — визуальная система
   Эстетика: корпоративный интерфейс конца 2000-х / начала 2010-х.
   Глянцевые панели, скруглённые окна, канцелярские иконки, Helvetica.
   ========================================================================= */

/* ---------------------------------- тема --------------------------------- */
:root {
  --bg:            #f4f4f4;
  --bg-2:          #dedede;
  --panel:         #ffffff;
  --panel-2:       #f7f7f7;
  --panel-edge:    rgba(0,0,0,.10);
  --panel-gloss:   rgba(255,255,255,.85);
  --ink:           #0a0a0a;
  --ink-2:         #4a4a4a;
  --ink-3:         #8b8b8b;
  --beige:         #dfdfdf;
  --beige-2:       #ececec;
  --line:          rgba(0,0,0,.14);
  --accent:        #1a1a1a;
  --shadow-lg:     0 18px 40px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.08);
  --shadow-md:     0 8px 20px rgba(0,0,0,.10), 0 1px 3px rgba(0,0,0,.07);
  --shadow-sm:     0 3px 10px rgba(0,0,0,.10);
  --radius:        30px;
  --radius-sm:     16px;
  --pattern-ink:   rgba(0,0,0,.055);
  --polaroid-bg:   #fff;
  --field:         #fff;
  --ok:            #5b5b5b;
  --warn:          #5f5f5f;
  --bad:           #3f3f3f;
}

:root[data-theme="dark"] {
  --bg:            #1b1b1b;
  --panel:         #202020;
  --panel-2:       #262626;
  --panel-edge:    rgba(255,255,255,.10);
  --panel-gloss:   rgba(255,255,255,.06);
  --ink:           #efefef;
  --ink-2:         #c0c0c0;
  --ink-3:         #888888;
  --beige:         #353535;
  --beige-2:       #282828;
  --line:          rgba(255,255,255,.16);
  --accent:        #efefef;
  --shadow-lg:     0 18px 40px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.4);
  --shadow-md:     0 8px 20px rgba(0,0,0,.45);
  --shadow-sm:     0 3px 10px rgba(0,0,0,.4);
  --pattern-ink:   rgba(255,255,255,.05);
  --polaroid-bg:   #e7e7e7;
  --field:         #171717;
  --ok:            #adadad;
  --warn:          #b1b1b1;
  --bad:           #9c9c9c;
}

/* ---------------------------------- база --------------------------------- */
* { box-sizing: border-box; }

/* Атрибут hidden должен побеждать любой авторский display,
   иначе скрытая модалка перекрывает страницу невидимой подложкой. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: "Helvetica Neue", HelveticaNeue, Helvetica, Arial, "Nimbus Sans", sans-serif;
  font-size: 15px;
  line-height: 1.35;
  color: var(--ink);
  background-color: var(--bg);
  background-image: url("../assets/pattern.svg");
  background-size: 200px 200px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  transition: background-color .35s ease, color .35s ease;
}

:root[data-theme="dark"] body { background-image: url("../assets/pattern-dark.svg"); }

/* на мобильных страница скроллится целиком */
@media (max-width: 700px) {
  body { overflow: auto; }
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
a:hover { opacity: .62; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

img { max-width: 100%; display: block; }

h1, h2, h3 { font-weight: 700; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p  { margin: 0 0 .8em; }

::selection { background: var(--ink); color: var(--bg); }


/* ------------------------------- курсор ----------------------------------- */
/* Классический набор Windows XP из .cur сконвертирован в PNG: .cur не
   понимает Safari, а PNG тянут все современные браузеры. Оригиналы лежат
   в assets/cursors/src. У каждого правила есть штатный запасной курсор
   через запятую — если картинка почему-то не загрузится, указатель не
   пропадёт. */
html { cursor: url("../assets/cursors/arrow.png") 10 10, default; }
*, *::before, *::after { cursor: inherit; }

a, button, summary, label,
.slot, .tab, .dot, .lang__btn, .theme, .menu__link, .work, .thumbs img,
[role="button"] {
  cursor: url("../assets/cursors/link.png") 10 10, pointer;
}

input, textarea, [contenteditable="true"] {
  cursor: url("../assets/cursors/beam.png") 15 16, text;
}
select, input[type="date"], input[type="checkbox"], input[type="radio"] {
  cursor: url("../assets/cursors/link.png") 10 10, pointer;
}

button[disabled], .btn[disabled], .slot[disabled], input[disabled], select[disabled] {
  cursor: url("../assets/cursors/no.png") 10 10, not-allowed;
}

.polaroid { cursor: url("../assets/cursors/pin.png") 5 1, grab; }
.polaroid.is-dragging { cursor: url("../assets/cursors/pin.png") 5 1, grabbing; }
.drift--static .polaroid { cursor: url("../assets/cursors/link.png") 10 10, pointer; }

.textarea { cursor: url("../assets/cursors/beam.png") 15 16, text; }
.modal__backdrop { cursor: url("../assets/cursors/no.png") 10 10, default; }

/* --------------------------- общая форма панели --------------------------- */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transition: background .35s ease, border-color .35s ease;
}
/* глянцевый блик сверху — фирменная черта эпохи */
.panel::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 44%;
  border-radius: inherit;
  border-bottom-left-radius: 60% 24px;
  border-bottom-right-radius: 60% 24px;
  background: linear-gradient(to bottom, var(--panel-gloss), transparent);
  pointer-events: none;
}

/* ------------------------------ шапка сайта -------------------------------- */
/* Один цельный корпус по присланному SVG: слева невысокая полоса ABOUT,
   справа — блок логотипа повыше, оба встык к краям окна, без разрыва между
   ними — переход отлит плавной ступенькой (радиус 26 везде). Форма рисуется
   в <svg id="headerShapePath">, координаты пересчитывает js/app.js при
   загрузке и ресайзе — так углы остаются идеальными окружностями при любой
   ширине экрана. Само содержимое (ABOUT/лого) лежит поверх прозрачными
   слоями .fringe/.brand — фона у них больше нет. */
.header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 176px;
  z-index: 45;
  pointer-events: none;
}
.header__shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 18px 34px rgba(0,0,0,.14)) drop-shadow(0 2px 6px rgba(0,0,0,.08));
}
:root[data-theme="dark"] .header__shape { filter: drop-shadow(0 18px 34px rgba(0,0,0,.5)) drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.header__shape path {
  fill: var(--panel);
  stroke: var(--panel-edge);
  stroke-width: 1;
  transition: fill .35s ease, stroke .35s ease;
}

.fringe {
  position: absolute;
  top: 0; left: 0;
  width: calc(100% - 372px);
  height: 70px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 34px;
  pointer-events: auto;
}
.fringe__label {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .01em;
  flex: none;
}

/* ---------------------------- шапка с логотипом --------------------------- */
.brand {
  position: absolute;
  top: 0; right: 0;
  width: 372px;
  height: 176px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px 0 26px;
  pointer-events: auto;
}
.brand__logo { flex: 1 1 auto; min-width: 0; display: block; }
.brand__logo img {
  width: 100%;
  height: auto;
  max-height: 118px;
  object-fit: contain;
}
:root[data-theme="dark"] .brand__logo img { filter: invert(1); }

.brand__controls {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  font-size: 16px;
}

.marquee {
  position: relative;
  flex: 1;
  overflow: hidden;
  height: 26px;
  /* мягкое затухание по краям */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
}
.marquee__track {
  position: absolute;
  top: 0; left: 0;
  white-space: nowrap;
  font-style: italic;
  font-size: 17px;
  line-height: 26px;
  will-change: transform;
}
.marquee__track span { padding-right: 90px; }

.lang { display: flex; align-items: center; gap: 1px; }
.lang__sep { opacity: .5; }
.lang__btn {
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: .55;
}
.lang__btn[aria-current="true"] { opacity: 1; font-weight: 700; }
.lang__btn:hover { opacity: .8; }

.theme { display: flex; align-items: center; gap: 5px; }
.theme__icon { font-size: 15px; }
.theme__state { text-decoration: underline; text-underline-offset: 2px; }

/* --------------------------------- сцена ---------------------------------- */
.stage {
  position: fixed;
  top: 90px; left: 24px;
  width: calc(100% - 468px);
  height: calc(100% - 114px);
  overflow: hidden;
  outline: none;
}
.stage__inner {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 26px 34px 34px;
  border-radius: var(--radius);
}
/* Своего ползунка у блока контента нет: справа стоит декоративная
   полоса прокрутки, две сразу выглядели бы мусором. Колесо и клавиши
   при этом работают как обычно. */
.stage__inner { scrollbar-width: none; -ms-overflow-style: none; }
.stage__inner::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* На вкладке мастеров плашки под карточками нет: они лежат прямо на фоне.
   Скрываем корпус стола, оставляя саму область прокрутки. */
.stage--bare {
  /* поле карточек должно доставать до нижнего края страницы */
  height: calc(100% - 90px);
  background: none;
  border-color: transparent;
  box-shadow: none;
}
.stage--bare::before { display: none; }

/* появление страницы */
.view-enter { animation: viewIn .34s cubic-bezier(.2,.7,.3,1) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px) scale(.995); }
  to   { opacity: 1; transform: none; }
}

/* заголовок раздела с глянцевым маркером */
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.section-head h1,
.section-head .crumbs {
  font-size: 21px;
  font-style: italic;
  font-weight: 400;      /* название раздела не жирное */
  margin: 0;
}
.crumbs a { font-style: normal; }
.section-head .spacer { flex: 1; }

/* Канцелярские кнопки из макета: активный пункт — кнопка «в анфас»,
   неактивный — воткнутая под углом. */
.bullet {
  flex: none;
  width: 21px; height: 21px;
  background: url("../assets/pin-active.png") center/contain no-repeat;
}
.pin {
  flex: none;
  width: 21px; height: 21px;
  background: url("../assets/pin.png") center/contain no-repeat;
}
/* в тёмной теме металл слегка подсвечиваем, а не инвертируем */
:root[data-theme="dark"] .bullet,
:root[data-theme="dark"] .pin { filter: brightness(1.35) contrast(.9); }

/* -------------------------------- правая колонка -------------------------- */
.rail {
  position: fixed;
  top: 194px; right: 98px; bottom: 24px;
  width: 322px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 20;
  pointer-events: none;   /* пустое место между панелями не перехватывает клики */
}
.rail > * { pointer-events: auto; }

/* «Menu:» стоит слева от столбца пунктов, в отдельной «пятке» сверху —
   форма по присланному menu.svg, дуги считает js/app.js (paintMenuShape),
   как и для шапки. Сама подпись «Menu:» при этом начинается на той же
   вертикали, что и «Log in:» и подвал — этого просит текущий макет. */
.menu {
  position: relative;
  padding: 22px 26px 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.menu__shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 18px 34px rgba(0,0,0,.14)) drop-shadow(0 2px 6px rgba(0,0,0,.08));
}
:root[data-theme="dark"] .menu__shape { filter: drop-shadow(0 18px 34px rgba(0,0,0,.5)) drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.menu__shape path {
  fill: var(--panel);
  stroke: var(--panel-edge);
  stroke-width: 1;
  transition: fill .35s ease, stroke .35s ease;
}
.menu__title {
  position: relative;
  z-index: 1;
  font-size: 19px;
  flex: none;
}
.menu__list {
  position: relative;
  z-index: 1;
  list-style: none; margin: 0; padding: 0; flex: 1 1 auto;
}
.menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
}
.menu__link {
  font-size: 18px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: transform .18s ease;
}
.menu__item[aria-current="true"] .menu__link { font-style: italic; font-weight: 500; }
.menu__link:hover { transform: translateX(2px); opacity: .65; }

/* панель входа — простая плашка без «пятки», подпись стоит прямо внутри */
.login { padding: 18px 26px 20px; border-radius: 26px; }
.login__row { display: flex; align-items: baseline; gap: 10px; flex-wrap: nowrap; }
.login__label { font-size: 18px; flex: none; }
.login__links { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin-left: auto; }
.login__links a { font-size: 17px; }
.login__user { font-size: 14px; color: var(--ink-2); margin-top: 6px; }

/* подвал — прижат к низу боковой колонки, как в макете */
.foot {
  margin-top: auto;
  padding: 15px 64px 15px 22px;
  background: var(--beige-2);
  border-radius: 26px;
  font-size: 12.5px;
  color: var(--ink-2);
  box-shadow: var(--shadow-md);
}
.foot::before { display: none; }
.foot__links { line-height: 1.6; }
.foot__copy { margin-top: 4px; font-weight: 700; color: var(--ink); }
.foot__copy span { font-weight: 400; color: var(--ink-2); }
.foot__mark {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  opacity: .8;
}
:root[data-theme="dark"] .foot__mark { filter: invert(.85); }

/* декоративная полоса скролла справа */
.deco-scroll {
  position: fixed;
  top: 194px; right: 24px; bottom: 24px;
  width: 26px;
  border-radius: 14px;
  background: linear-gradient(to right, #d5d5d5, #f4f4f4 40%, #cfcfcf);
  border: 1px solid var(--panel-edge);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.14);
  z-index: 15;
}
:root[data-theme="dark"] .deco-scroll { background: linear-gradient(to right, #2a2a2a, #3b3b3b 40%, #262626); }
.deco-scroll__thumb {
  position: absolute;
  left: 2px; right: 2px; top: 2px;
  height: 78px;
  border-radius: 12px;
  background:
    linear-gradient(to right, rgba(255,255,255,.9), rgba(255,255,255,.25) 45%, rgba(0,0,0,.05)),
    linear-gradient(to bottom, #fdfdfd, #d8d8d8);
  border: 1px solid rgba(0,0,0,.18);
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: top .12s linear;
}
:root[data-theme="dark"] .deco-scroll__thumb {
  background: linear-gradient(to bottom, #565656, #363636);
  border-color: rgba(255,255,255,.14);
}

/* ======================= ГЛАВНАЯ: летающие полароиды ====================== */
/* Поле, внутри которого летают карточки: занимает всю свободную высоту
   окна, поэтому траектории широкие, а не зажатые в полосу. */
/* Поле карточек занимает всю оставшуюся высоту стола, а не фиксированную:
   при жёсткой высоте карточки упирались в невидимую границу заметно выше
   нижнего края страницы. */
.stage--bare .stage__inner { display: flex; flex-direction: column; padding-bottom: 6px; }
.stage--bare .view-enter { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

.drift {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 380px;
  overflow: hidden;
  border-radius: 8px;
}

/* Карточку можно схватить и перетащить, поэтому курсор — рука.
   Белой полароидной рамки нет: только сама фотография и подпись. */
.polaroid {
  position: absolute;
  top: 0; left: 0;
  width: 132px;
  padding: 0;
  background: none;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
  transition: filter .2s ease;
}
.polaroid.is-dragging { filter: brightness(1.03); }
/* Перехватывать жест пальца можно только там, где карточки правда таскают:
   в обычной сетке это сломало бы прокрутку страницы. */
.drift:not(.drift--static) .polaroid { touch-action: none; }
.polaroid__img {
  width: 100%;
  aspect-ratio: 3 / 3.4;
  object-fit: cover;
  background: #ddd;
  display: block;
  /* нативный drag картинки отменяет наш pointer-capture — отключаем */
  -webkit-user-drag: none;
  /* лёгкая тень отделяет карточки там, где они лежат внахлёст */
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
.polaroid__cap {
  padding: 6px 2px 8px;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  color: var(--ink);
  /* карточки узкие: длинное имя переносим, а не обрезаем многоточием */
  overflow-wrap: anywhere;
}
/* подпись лежит на фоне окна, а не на белой рамке */
:root[data-theme="dark"] .polaroid__cap { color: var(--ink); }

.polaroid:hover { z-index: 9 !important; }
.polaroid:hover .polaroid__img { box-shadow: 0 14px 30px rgba(0,0,0,.26); }
.polaroid:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* сетка-фолбэк для мобильных и для reduce-motion */
.drift--static {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 20px;
  height: auto;
  min-height: 0;
}
.drift--static .polaroid { position: static; width: auto; transform: none; }

/* ============================ профиль мастера ============================= */
.master {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 34px;
  align-items: start;
}
.master__photo {
  width: 100%;
  aspect-ratio: 3 / 3.6;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.master__name { font-size: 19px; margin: 16px 0 2px; }
.master__meta { font-size: 15px; color: var(--ink-2); display: flex; gap: 22px; }
.master__bio { margin-top: 14px; font-size: 15px; max-width: 30ch; }

.tabs { display: flex; gap: 22px; align-items: center; }
.tab { display: inline-flex; align-items: center; gap: 9px; font-size: 17px; }
.tab__label { text-decoration: underline; text-underline-offset: 3px; }
.tab[aria-selected="true"] .tab__label { font-style: italic; }

.works {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 18px 16px;
  margin-top: 20px;
}
.work { cursor: pointer; }
.work__img {
  width: 100%;
  aspect-ratio: 3 / 3.5;
  object-fit: cover;
  background: var(--panel-2);
  border: 1px solid var(--line);
  transition: transform .2s ease, box-shadow .2s ease;
}
.work:hover .work__img { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.work__cap { text-align: center; font-size: 12.5px; padding-top: 7px; color: var(--ink-2); }

/* ============================== элементы форм ============================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.22);
  background: linear-gradient(to bottom, #ffffff, #ececec 52%, #e0e0e0);
  box-shadow: 0 2px 5px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.9);
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: transform .12s ease, box-shadow .18s ease, filter .18s ease;
}
.btn:hover { filter: brightness(1.03); box-shadow: 0 5px 12px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.9); }
.btn:active { transform: translateY(1px) scale(.995); box-shadow: inset 0 2px 5px rgba(0,0,0,.22); }
.btn--primary {
  background: linear-gradient(to bottom, #3a3a3a, #101010);
  color: #fff;
  border-color: #000;
}
.btn--ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.btn--sm { min-height: 32px; padding: 0 16px; font-size: 14px; text-decoration: none; }
.btn[disabled] { opacity: .45; pointer-events: none; }
:root[data-theme="dark"] .btn {
  background: linear-gradient(to bottom, #3b3b3b, #242424);
  border-color: rgba(255,255,255,.2);
  box-shadow: 0 2px 5px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.1);
}
:root[data-theme="dark"] .btn--primary { background: linear-gradient(to bottom, #f1f1f1, #d4d4d4); color: #111; }

.field { margin-bottom: 14px; max-width: 460px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.07);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--ink);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.07), 0 0 0 3px rgba(0,0,0,.07);
}
.textarea { min-height: 110px; resize: vertical; }
.hint { font-size: 12.5px; color: var(--ink-3); }
.error { color: var(--bad); font-size: 13px; margin-top: 8px; min-height: 1em; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.stack-16 > * + * { margin-top: 16px; }

/* ======================= вход / регистрация по макету ==================== */
.auth {
  max-width: 720px;
  margin: 40px auto 0;
  padding-left: 90px;
}
.auth__meme { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 34px; }
.auth__memeImg {
  width: 360px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--panel-2);
}
.auth__memeCap {
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: pre-line;
  padding-bottom: 2px;
}

.auth__row { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 20px; }
.auth__field { flex: 0 1 380px; }
.auth__field label {
  display: block;
  font-size: 19px;
  color: var(--ink);
  margin-bottom: 8px;
}
.auth__hint { font-size: 12.5px; color: var(--ink-2); padding-bottom: 12px; }

/* поле-пилюля с внутренней тенью — «вдавленное», как в макете */
.input--pill {
  border-radius: 999px;
  padding: 13px 24px;
  font-size: 17px;
  background: linear-gradient(to bottom, #ececec, #f7f7f7);
  border-color: rgba(0,0,0,.12);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.10), 0 1px 0 #fff;
}
:root[data-theme="dark"] .input--pill {
  background: linear-gradient(to bottom, #262626, #2e2e2e);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.5);
}
.input--pill::placeholder { color: var(--ink-3); }

.auth__switch { margin: -4px 0 0; font-size: 13px; }
.auth__switch a { color: var(--ink-2); }
.auth__go { display: flex; justify-content: center; margin-top: 46px; }
.auth__demo { text-align: center; margin-top: 14px; }
.auth__note { max-width: 460px; margin: 26px auto 0; text-align: center; }

.btn--big {
  min-height: 52px;
  padding: 0 54px;
  font-size: 18px;
  border-radius: 999px;
}

/* ============================= профиль в кабинете ======================== */
.profile { display: grid; grid-template-columns: 260px 1fr; gap: 34px; align-items: start; }
.profile__ava {
  width: 230px; height: 230px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.profile__form { max-width: 420px; }
.profile__form label { font-size: 13px; color: var(--ink-2); }
/* поле без рамки — значение читается как текст, но остаётся редактируемым */
.input--plain {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 2px 0;
  font-size: 19px;
}
.input--plain:focus {
  box-shadow: 0 2px 0 var(--ink);
  border: 0;
}
.input--plain:disabled { color: var(--ink); opacity: 1; }
.profile__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
}

/* ==================== карточка вошедшего в правой колонке ================ */
.login--user { padding: 14px 22px 14px 18px; }
.who { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.who__ava {
  width: 54px; height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-2);
  flex: none;
}
.who__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.who__name { font-size: 19px; }
.who__role { font-size: 12.5px; color: var(--ink-3); }
.who__out {
  display: block;
  margin: 6px 0 0 68px;
  font-size: 14px;
  color: var(--ink-3);
}

/* карточка-документ */
.card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.card + .card { margin-top: 12px; }
.card__title { font-weight: 700; margin-bottom: 4px; }
.card__meta { font-size: 13px; color: var(--ink-2); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.prose { max-width: 66ch; font-size: 15px; }
.prose li { margin-bottom: 6px; }

/* штамп «архивный документ» */
.stamp {
  display: inline-block;
  padding: 6px 14px;
  border: 2px solid currentColor;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  transform: rotate(-4deg);
  opacity: .7;
}
.stamp--ok { color: var(--ok); }
.stamp--warn { color: var(--warn); }
.stamp--bad { color: var(--bad); }

/* ============================== бронирование ============================== */
.book-grid { margin-top: 18px; }
.book-head {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.slot {
  padding: 9px 6px;
  text-align: center;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(to bottom, #fff, #f0f0f0);
  transition: transform .12s ease, background .18s ease, color .18s ease;
}
:root[data-theme="dark"] .slot { background: linear-gradient(to bottom, #2b2b2b, #232323); }
.slot:hover:not([disabled]) { transform: translateY(-1px); }
.slot[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.slot[disabled] {
  opacity: .42;
  cursor: not-allowed;
  background: repeating-linear-gradient(-45deg, var(--panel-2) 0 5px, var(--panel) 5px 10px);
}
.slot__by { display: block; font-size: 10.5px; color: var(--ink-3); }

.legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--ink-2); margin-top: 12px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--line); border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
.legend .is-free { background: #fff; }
.legend .is-mine { background: var(--ink); }
.legend .is-busy { background: repeating-linear-gradient(-45deg, #ddd 0 4px, #fff 4px 8px); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }

/* ============================ интерьер / карта =========================== */
.interior { display: grid; grid-template-columns: 1.15fr .85fr; gap: 30px; align-items: start; }
.interior__stagebox {
  border: 1px solid var(--line);
  background: var(--panel-2);
  aspect-ratio: 4 / 3.1;
  overflow: hidden;
  position: relative;
}
.interior__stagebox img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.thumbs img { aspect-ratio: 4/3; object-fit: cover; border: 1px solid var(--line); cursor: pointer; transition: transform .18s ease; }
.thumbs img:hover { transform: translateY(-2px); }
.dots { display: flex; gap: 6px; justify-content: center; margin-top: 14px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); opacity: .4; }
.dot[aria-current="true"] { opacity: 1; }

.map {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  aspect-ratio: 16/9;
}

/* ================================ модалка ================================ */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(20,20,20,.42); backdrop-filter: blur(2px); animation: fade .2s ease both; }
.modal__window {
  position: relative;
  width: min(680px, calc(100vw - 40px));
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  animation: pop .24s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(10px) } to { opacity: 1; transform: none } }
.modal__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
}
.modal__title { font-weight: 700; }
.modal__x { font-size: 15px; opacity: .55; }
.modal__x:hover { opacity: 1; }
.modal__body { padding: 18px; overflow: auto; }
.modal__body img { max-height: 62vh; margin: 0 auto; object-fit: contain; }

/* ================================= тост ================================== */
.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  z-index: 200;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .28s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px) } to { opacity: 1; transform: translate(-50%, 0) } }

/* ============================== адаптивность ============================= */
@media (max-width: 1240px) {
  .fringe { gap: 14px; padding: 0 22px; width: calc(100% - 344px); height: 58px; }
  .brand { width: 300px; height: 120px; padding: 0 14px 0 18px; gap: 12px; }
  .brand__logo img { max-height: 84px; }
  .rail { width: 280px; right: 82px; top: 138px; }
  .deco-scroll { top: 138px; }
  .stage { width: calc(100% - 410px); top: 72px; height: calc(100% - 96px); }
}

@media (max-width: 700px) {
  body { background-size: 130px 130px; }
  /* цельная форма из SVG — только для широкого экрана; в узкой колонке
     возвращаемся к двум простым плашкам друг под другом */
  .header { position: static; height: auto; }
  .header__shape { display: none; }
  .fringe {
    position: static;
    width: auto;
    height: auto;
    margin: 14px 16px 0;
    padding: 14px 20px;
    background: var(--panel);
    border: 1px solid var(--panel-edge);
    box-shadow: var(--shadow-lg);
    border-radius: 26px;
  }
  .brand {
    position: static;
    width: auto;
    height: auto;
    margin: 14px 16px;
    padding: 16px 20px;
    background: var(--panel);
    border: 1px solid var(--panel-edge);
    box-shadow: var(--shadow-lg);
    border-radius: 26px;
    justify-content: space-between;
  }
  .brand__logo { flex: 0 1 auto; }
  .brand__logo img { max-height: 62px; width: auto; }
  .brand__controls { flex-direction: row; gap: 18px; align-items: center; }
  .stage {
    position: static;
    width: auto;
    height: auto;
    margin: 0 16px 16px;
  }
  .stage__inner { position: static; padding: 20px; }
  .rail { position: static; width: auto; margin: 0 16px 24px; }
  .foot { margin-top: 0; }
  /* в узкой колонке форма из SVG не нужна — обычная плашка, как у входа */
  .menu {
    background: var(--panel);
    border: 1px solid var(--panel-edge);
    box-shadow: var(--shadow-lg);
    border-radius: 26px;
  }
  .menu__shape { display: none; }
  .deco-scroll { display: none; }
  .master { grid-template-columns: 1fr; gap: 20px; }
  .master__photo { max-width: 260px; }
  .interior { grid-template-columns: 1fr; }
  .drift { height: auto; min-height: 0; }
}

@media (max-width: 480px) {
  .brand { flex-direction: column; align-items: flex-start; gap: 12px; }
  .brand__logo img { max-height: 48px; }
  .works { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* --------------------------- бережный режим ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* доступность фокуса */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
