/* Финальная редактура интерфейса: читаемая типографика, фирменная маття и безопасный mobile-first. */
:root {
  --polish-gutter: clamp(18px, 4vw, 64px);
}

html,
body,
#app {
  width: 100%;
  max-width: 100%;
}

#app {
  overflow: clip;
}

#app img,
#app svg,
#app video,
#app canvas {
  max-width: 100%;
}

#app :where(header, main, section, article, figure, div, nav) {
  min-width: 0;
}

/* Большие фразы читаются как смысл, а не как декоративная стенка. */
.director-hero h1,
.preorder-hero h1,
.mushroom-hero h1,
.my-tea-hero h1,
.mood-quiz aside h1,
.choice-stage > header h2,
.director-featured > header h2,
.cold-editorial h2,
.tea-library > header h2,
.catalog-chapter > header h2,
.mushroom-chapter > header h2 {
  max-width: 980px;
  font-family: var(--sans);
  font-weight: 800;
  font-style: normal;
  line-height: .98;
  letter-spacing: -.055em;
  text-wrap: balance;
  overflow-wrap: normal;
}

.director-hero h1 {
  font-size: clamp(58px, 6.6vw, 108px);
}

.preorder-hero h1,
.mushroom-hero h1,
.my-tea-hero h1,
.mood-quiz aside h1 {
  font-size: clamp(54px, 6.1vw, 92px);
}

.choice-stage > header h2,
.director-featured > header h2,
.cold-editorial h2,
.tea-library > header h2,
.catalog-chapter > header h2,
.mushroom-chapter > header h2 {
  font-size: clamp(42px, 4.6vw, 68px);
}

.choice-stage > header,
.director-featured > header,
.tea-library > header,
.catalog-chapter > header,
.mushroom-chapter > header {
  width: 100%;
  max-width: var(--director-width);
}

/* Маття: одна взрослая съёмка, настоящий знак бренда и три простые позиции. */
.matcha-chapter > div {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  isolation: isolate;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.matcha-chapter > div::before {
  content: "";
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--paper-warm) url("../../img/matcha-lineup-v2.png") center / cover no-repeat;
  border-bottom: 1px solid var(--ink);
}

.matcha-chapter > div::after {
  content: "";
  z-index: 2;
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  justify-self: start;
  width: clamp(118px, 13vw, 188px);
  aspect-ratio: 1;
  margin: 0 0 clamp(18px, 2.4vw, 34px) clamp(18px, 2.4vw, 34px);
  background: rgba(252, 250, 244, .94) url("../../img/brand/logo-color.png") center / 78% no-repeat;
  border: 1px solid rgba(14, 14, 14, .45);
  border-radius: 50%;
  box-shadow: 0 20px 50px rgba(61, 38, 22, .16);
  backdrop-filter: blur(10px);
}

.director-matcha {
  grid-row: 2;
  min-height: 285px;
  padding: clamp(24px, 2.7vw, 38px);
  background: var(--paper);
}

.director-matcha:nth-of-type(2) {
  background: var(--paper-warm);
}

.director-matcha header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.director-matcha header span,
.director-matcha header small {
  color: var(--terra);
  font: 500 9px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.director-matcha h3 {
  margin-top: 34px;
  font-size: clamp(26px, 2.4vw, 38px);
}

.director-matcha > p {
  max-width: 340px;
}

.matcha-photo {
  display: none !important;
}

/* Грибная карта — сначала понятная фотография, затем факты и ограничения. */
.mushroom-stage {
  max-width: var(--director-width);
  margin: 0 auto 18px;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 8;
  border: 1px solid var(--ink);
  border-radius: var(--director-radius);
  background: var(--paper-warm);
}

.mushroom-stage > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.mushroom-stage figcaption {
  position: absolute;
  left: clamp(18px, 3vw, 42px);
  bottom: clamp(18px, 3vw, 42px);
  width: min(430px, calc(100% - 36px));
  padding: 20px;
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 18px;
  align-items: center;
  background: rgba(252, 250, 244, .94);
  border: 1px solid rgba(14, 14, 14, .42);
  border-radius: 18px;
  box-shadow: 0 20px 55px rgba(61, 38, 22, .16);
  backdrop-filter: blur(12px);
}

.mushroom-stage figcaption img {
  width: 86px;
  height: 86px;
  object-fit: contain;
}

.mushroom-stage figcaption span {
  color: var(--terra);
  font: 500 8px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mushroom-stage figcaption b {
  display: block;
  margin-top: 7px;
  font-size: 17px;
}

.mushroom-stage figcaption p {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
}

.mushroom-philosophy {
  gap: 0;
  border: 1px solid var(--ink);
  border-radius: var(--director-radius);
  overflow: hidden;
}

.director-mushroom {
  min-height: 690px;
  border: 0;
  border-right: 1px solid var(--ink);
  border-radius: 0;
  background: rgba(252, 250, 244, .76);
}

.director-mushroom:last-child {
  border-right: 0;
}

.director-mushroom h3 {
  margin-top: 44px;
}

.director-mushroom > p {
  min-height: 132px;
}

.mushroom-benefits {
  margin: 4px 0 18px;
}

.mushroom-benefits > span {
  display: block;
  margin-bottom: 9px;
  color: var(--text-dim);
  font: 500 8px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mushroom-benefits > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mushroom-benefits i {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--ink);
  font-size: 10px;
  font-style: normal;
}

.director-mushroom dl {
  margin-top: auto;
}

.director-mushroom dl dd {
  line-height: 1.45;
}

/* Контейнеры, которые раньше визуально обрезались на узком экране. */
.cold-editorial,
.cold-editorial > div,
.cold-editorial figure,
.home-cold figure > img:first-child,
.journal-empty,
.editorial-studio,
.network-console,
.loyalty-story {
  max-width: 100%;
}

.home-cold figure > img:first-child {
  width: 100%;
}

@media (max-width: 980px) {
  .director-mushroom {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .director-mushroom:last-child {
    border-bottom: 0;
  }

  .director-mushroom > p {
    min-height: 0;
  }
}

@media (max-width: 600px) {
  .director-hero h1,
  .preorder-hero h1,
  .mushroom-hero h1,
  .my-tea-hero h1,
  .mood-quiz aside h1 {
    width: 100%;
    max-width: 100%;
    font-size: clamp(39px, 12.2vw, 52px);
    line-height: .98;
    letter-spacing: -.055em;
  }

  .choice-stage > header h2,
  .director-featured > header h2,
  .cold-editorial h2,
  .tea-library > header h2,
  .catalog-chapter > header h2,
  .mushroom-chapter > header h2 {
    width: 100%;
    max-width: 100%;
    font-size: clamp(34px, 10.7vw, 44px);
    line-height: 1.01;
    letter-spacing: -.05em;
  }

  .director-hero-copy > p,
  .preorder-hero p,
  .mushroom-hero p,
  .my-tea-hero p {
    max-width: 100%;
    font-size: 15px;
    line-height: 1.6;
  }

  .choice-stage,
  .director-featured,
  .tea-library,
  .catalog-chapter,
  .mushroom-chapter,
  .my-tea-page,
  .journal-wrap,
  .events-wrap,
  .team-shell,
  .dash-wrap {
    width: 100%;
    max-width: 100%;
    padding-left: 18px;
    padding-right: 18px;
  }

  .director-featured > header,
  .choice-stage > header,
  .tea-library > header,
  .catalog-chapter > header,
  .mushroom-chapter > header {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .matcha-chapter > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .matcha-chapter > div::before {
    grid-column: 1;
    grid-row: 1;
    aspect-ratio: 16 / 9;
    background-position: center;
  }

  .matcha-chapter > div::after {
    grid-column: 1;
    grid-row: 1;
    width: 74px;
    margin: 0 0 10px 10px;
  }

  .director-matcha {
    min-height: 240px;
    padding: 24px 20px !important;
  }

  .director-matcha:nth-of-type(1) { grid-row: 2; }
  .director-matcha:nth-of-type(2) { grid-row: 3; }
  .director-matcha:nth-of-type(3) { grid-row: 4; }

  .mushroom-stage {
    aspect-ratio: auto;
    border-radius: 20px;
  }

  .mushroom-stage > img {
    aspect-ratio: 16 / 9;
    object-position: center;
  }

  .mushroom-stage figcaption {
    position: static;
    width: 100%;
    padding: 13px;
    grid-template-columns: 60px 1fr;
    gap: 12px;
    border: 0;
    border-top: 1px solid var(--ink);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .mushroom-stage figcaption img {
    width: 60px;
    height: 60px;
  }

  .mushroom-stage figcaption b {
    font-size: 14px;
  }

  .mushroom-stage figcaption p {
    display: none;
  }

  .mushroom-philosophy {
    grid-template-columns: minmax(0, 1fr);
    border-radius: 20px;
  }

  .director-mushroom {
    width: 100%;
    padding: 24px 20px;
  }

  .director-mushroom header {
    align-items: flex-start;
  }

  .director-mushroom header small {
    max-width: 62%;
    overflow-wrap: anywhere;
  }

  .director-mushroom h3 {
    margin-top: 30px;
    font-size: 34px;
  }

  .catalog-index {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    scroll-padding-inline: 18px;
    overscroll-behavior-inline: contain;
  }

  .catalog-index::after {
    content: "";
    flex: 0 0 18px;
  }

  .cold-editorial,
  .cold-editorial > div,
  .cold-editorial figure,
  .home-cold figure > img:first-child,
  .journal-empty {
    width: 100%;
    max-width: 100%;
  }

  .journal-empty {
    margin-left: 0;
    margin-right: 0;
    padding: 28px 20px;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px 18px;
  }

  .journal-empty img {
    width: 72px;
    height: 90px;
  }

  .journal-empty h2 {
    max-width: 100%;
    font-size: 33px;
    overflow-wrap: anywhere;
  }

  .foot-grid,
  .foot-base {
    width: 100%;
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .matcha-chapter > div::after,
  .mushroom-stage figcaption {
    backdrop-filter: none;
  }
}

/* Реальная чайная: сначала визит и заказ, затем редакционный рассказ. */
.tea-house-hero {
  min-height: 900px;
  grid-template-columns: minmax(0, 1.03fr) minmax(420px, .78fr);
  background:
    radial-gradient(circle at 12% 48%, rgba(184, 92, 44, .09), transparent 34%),
    var(--paper);
}

.tea-house-status {
  width: 100%;
  max-width: 700px;
  margin: 0 0 26px !important;
  padding: 10px 0;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font: 500 9px var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.tea-house-status span,
.tea-house-status button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tea-house-status span i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 5px rgba(90, 117, 96, .12);
}

.tea-house-status button {
  border: 0;
  background: transparent;
  color: var(--terra);
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.tea-house-hero .hero-actions {
  margin-top: 30px;
}

.order-steps {
  max-width: 700px;
  margin: 42px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.order-steps li {
  min-height: 76px;
  padding: 14px 12px 14px 0;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 8px;
  align-items: center;
  border-right: 1px solid var(--line);
}

.order-steps li + li { padding-left: 14px; }
.order-steps li:last-child { border-right: 0; }
.order-steps b { color: var(--terra); font: 500 9px var(--mono); }
.order-steps span { font-size: 13px; font-weight: 750; }

.tea-house-stage {
  min-height: 650px;
  padding: 30px;
  background: var(--terra);
  color: var(--cream);
  border: 1px solid var(--ink);
  overflow: hidden;
}

.tea-house-stage::before {
  border-color: rgba(244, 236, 216, .42);
  box-shadow: 0 0 0 55px rgba(244, 236, 216, .045), 0 0 0 110px rgba(14, 14, 14, .04);
}

.tea-house-stage::after {
  content: "茶";
  position: absolute;
  right: -.08em;
  bottom: -.2em;
  z-index: -1;
  color: rgba(244, 236, 216, .09);
  font: 900 300px/1 var(--cjk);
}

.tea-house-stage > img {
  width: min(390px, 92%);
  height: 390px;
  filter: drop-shadow(0 28px 35px rgba(14, 14, 14, .18));
}

.tea-house-stage figcaption {
  position: relative;
  z-index: 2;
  border-color: rgba(244, 236, 216, .5);
}

.tea-house-stage figcaption p { color: rgba(244, 236, 216, .72); }
.tea-house-stage figcaption button {
  margin-top: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cream);
  font-weight: 800;
  cursor: pointer;
}

.tea-house-dock {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 240px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper-warm);
}

.tea-house-dock article,
.tea-house-dock > button {
  min-height: 138px;
  padding: 24px clamp(18px, 2.8vw, 42px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  border: 0;
  border-right: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.tea-house-dock article > span {
  margin-bottom: 14px;
  color: var(--terra);
  font: 500 8px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tea-house-dock article b { font-size: 15px; }
.tea-house-dock article p,
.tea-house-dock article a { margin: 7px 0 0; color: var(--text-dim); font-size: 11px; line-height: 1.45; }
.tea-house-dock article a { color: var(--terra); text-decoration: none; }
.tea-house-dock > button {
  justify-content: space-between;
  border-right: 0;
  background: var(--ink);
  color: var(--cream);
  font-weight: 800;
  cursor: pointer;
}
.tea-house-dock > button i { color: var(--terra); font-size: 24px; font-style: normal; }

/* Поиск превращает длинное меню в быстрый мобильный инструмент. */
.menu-toolbox {
  padding: 22px max(4vw, 24px);
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 36px;
  align-items: end;
  background:
    linear-gradient(90deg, rgba(184, 92, 44, .07), transparent 52%),
    var(--paper-warm);
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}

.menu-toolbox > div > span {
  display: block;
  margin-bottom: 8px;
  color: var(--terra);
  font: 500 8px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.menu-toolbox label {
  min-height: 54px;
  display: grid;
  grid-template-columns: 32px 1fr 38px;
  align-items: center;
  border-bottom: 1px solid rgba(14, 14, 14, .58);
}

.menu-toolbox input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 650 17px var(--sans);
}

.menu-toolbox input::placeholder { color: rgba(14, 14, 14, .42); }
.menu-toolbox label button { border: 0; background: transparent; color: var(--terra); font-size: 24px; cursor: pointer; }
.menu-toolbox ol { margin: 0; padding: 0; display: flex; list-style: none; }
.menu-toolbox li { min-width: 125px; padding: 16px; display: grid; grid-template-columns: 22px 1fr; border-left: 1px solid var(--line); font-size: 11px; }
.menu-toolbox li b { color: var(--terra); font: 500 8px var(--mono); }
.menu-search-hidden { display: none !important; }
.menu-search-empty { padding: 70px 20px; text-align: center; background: var(--paper); border-bottom: 1px solid var(--ink); }
.menu-search-empty img { width: 100px; height: 100px; object-fit: contain; }
.menu-search-empty h2 { margin: 20px 0 10px; font-size: clamp(30px, 4vw, 52px); }
.menu-search-empty p { max-width: 540px; margin: 0 auto 24px; color: var(--text-dim); line-height: 1.6; }

/* Оформление заказа — как спокойный рабочий чек, а не длинная форма. */
.checkout-heading { display: grid; grid-template-columns: 1fr 110px; gap: 28px; align-items: center; }
.checkout-heading img { width: 105px; height: 105px; object-fit: contain; }
.checkout-heading p { max-width: 570px; margin: 0; color: var(--text-dim); line-height: 1.55; }
.checkout-error { margin: 14px 0 0; padding: 13px 15px; border: 1px solid var(--terra); background: rgba(184, 92, 44, .08); color: var(--terra); font-size: 12px; line-height: 1.45; }
.fulfillment-pick label { cursor: pointer; }
.fulfillment-pick label:has(input:checked) { border-color: var(--terra); background: rgba(184, 92, 44, .07); }
.preorder-success dl { margin: 24px 0 0; border-top: 1px solid var(--ink); text-align: left; }
.preorder-success dl div { padding: 12px 0; display: grid; grid-template-columns: 100px 1fr; gap: 16px; border-bottom: 1px solid var(--line); }
.preorder-success dt { color: var(--text-dim); font-size: 10px; }
.preorder-success dd { margin: 0; font-weight: 750; }

/* Кабинеты на телефоне: рабочая информация выше декоративной статистики. */
@media (max-width: 980px) {
  .tea-house-hero { grid-template-columns: 1fr; min-height: auto; }
  .tea-house-stage { min-height: 520px; }
  .tea-house-dock { grid-template-columns: repeat(2, 1fr); }
  .tea-house-dock article:nth-child(2) { border-right: 0; }
  .tea-house-dock article:nth-child(3), .tea-house-dock > button { border-top: 1px solid var(--ink); }
  .menu-toolbox { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 600px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }

  .topbar {
    height: 68px !important;
    padding: 8px 12px !important;
    gap: 8px !important;
    background: rgba(244, 236, 216, .96) !important;
    backdrop-filter: blur(18px) !important;
  }

  .topbar .logo { min-width: 48px; }
  .topbar .brand-logo-mark { width: 44px !important; height: 44px !important; }
  .topbar .logo-text, .topbar .sync-state, .topbar .login-btn { display: none !important; }
  .topbar .nav-auth { margin-left: auto; }
  .topbar .city-chip { min-width: 0; padding: 7px 10px !important; }
  .topbar .city-chip small { display: none; }
  .topbar .city-chip b { font-size: 11px; }
  .topbar .cart-btn { width: 46px !important; height: 46px !important; flex: 0 0 46px; }

  .tabbar {
    height: calc(66px + env(safe-area-inset-bottom)) !important;
    padding: 5px 4px env(safe-area-inset-bottom) !important;
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0 !important;
    overflow: hidden !important;
    background: rgba(252, 250, 244, .98) !important;
    border-top: 1px solid rgba(30, 24, 18, .16) !important;
    box-shadow: 0 -10px 32px rgba(30, 24, 18, .08) !important;
  }

  .tabbar a {
    min-width: 0 !important;
    padding: 6px 2px !important;
    gap: 3px !important;
    font-size: 8px !important;
    color: rgba(14, 14, 14, .64) !important;
  }
  .tabbar a.active { color: var(--terra) !important; }
  .tabbar a i { font-size: 16px !important; }

  .tea-house-hero { padding: 94px 16px 16px; gap: 18px; }
  .tea-house-status { margin-bottom: 22px !important; }
  .tea-house-status button { max-width: 48%; justify-content: flex-end; text-align: right; }
  .tea-house-hero h1 { font-size: clamp(42px, 12.8vw, 54px); line-height: .94; }
  .tea-house-hero .hero-actions { display: grid !important; grid-template-columns: 1fr; }
  .tea-house-hero .hero-actions .btn { width: 100%; min-height: 54px; }
  .order-steps { margin-top: 28px; }
  .order-steps li { min-height: 64px; padding: 10px 5px; display: grid; grid-template-columns: 1fr; gap: 4px; }
  .order-steps li + li { padding-left: 9px; }
  .order-steps span { font-size: 10px; }

  .tea-house-stage { min-height: 410px; padding: 18px; border-radius: 22px; }
  .tea-house-stage > img { width: min(280px, 88%); height: 245px; }
  .tea-house-stage figcaption { padding-top: 16px; }
  .tea-house-stage figcaption b { font-size: 17px; }
  .tea-house-stage figcaption p { font-size: 12px; }
  .tea-house-stage::after { font-size: 210px; }

  .tea-house-dock { grid-template-columns: 1fr 1fr; }
  .tea-house-dock article, .tea-house-dock > button { min-height: 128px; padding: 17px 14px; }
  .tea-house-dock article:nth-child(3) { border-right: 1px solid var(--ink); }
  .tea-house-dock article b { font-size: 12px; }
  .tea-house-dock article p { font-size: 9px; }
  .tea-house-dock > button { font-size: 12px; }

  .choice-stage article { min-height: 330px; border-radius: 20px; }
  .choice-stage h3 { font-size: 31px; }
  .director-tea { padding: 24px 0 !important; }
  .director-tea h3 { margin-top: 24px; font-size: 28px; }
  .director-tea > p { font-size: 13px; }
  .director-tea dl div { grid-template-columns: 92px 1fr; }

  .menu-real-hero { padding-bottom: 36px; }
  .menu-real-hero > img { width: 145px; height: 145px; }
  .menu-toolbox { padding: 17px 16px 14px; }
  .menu-toolbox ol { display: grid; grid-template-columns: repeat(3, 1fr); }
  .menu-toolbox li { min-width: 0; padding: 10px 7px; grid-template-columns: 1fr; gap: 5px; }
  .menu-toolbox label { min-height: 50px; }
  .catalog-index { top: 68px; }
  .catalog-index button { min-height: 48px; padding: 0 15px; }

  .cart { width: 100% !important; max-width: 100% !important; top: auto !important; bottom: 0; height: min(82svh, 720px) !important; transform: translateY(110%) !important; border-radius: 22px 22px 0 0 !important; }
  .cart.open { transform: translateY(0) !important; }
  .cart-head { padding: 18px; }
  .cart-body { padding: 10px 18px; }
  .cart-item { align-items: flex-start; gap: 12px; }
  .cart-foot { padding: 15px 18px calc(16px + env(safe-area-inset-bottom)); }

  .checkout-sheet { width: calc(100vw - 12px); max-height: calc(100svh - 12px); padding: 22px 15px !important; border-radius: 22px !important; }
  .checkout-heading { grid-template-columns: 1fr 68px; gap: 12px; }
  .checkout-heading img { width: 68px; height: 68px; }
  .checkout-heading h2 { font-size: 35px; }
  .checkout-heading p { grid-column: 1 / -1; font-size: 12px; }
  .checkout-summary { margin: 20px 0; }
  .checkout-summary > div, .checkout-summary > strong { font-size: 12px; }
  .fulfillment-pick label { min-height: 78px; }
  .checkout-fields { gap: 10px; }
  .checkout-fields input, .checkout-fields select, .checkout-note textarea { min-height: 48px; font-size: 16px; }
  .preorder-success dl div { grid-template-columns: 78px 1fr; }

  .dash-hero, .team-hero { padding: 92px 16px 32px !important; }
  .dash-hero .dash-name, .team-hero .dash-name { font-size: clamp(34px, 10vw, 46px) !important; line-height: .96 !important; }
  .dash-intent { margin-top: 16px !important; font-size: 13px !important; }
  .dash-hero + .wrap, .team-hero + .wrap { padding: 22px 14px 76px !important; }
  .spirit-row { grid-template-columns: repeat(2, 1fr) !important; }
  .spirit { min-height: 104px !important; padding: 15px !important; }
  .spirit .sv { font-size: 25px !important; }
  .dash-grid { gap: 10px !important; }
  .dash-card { padding: 20px 17px !important; border-radius: 16px !important; }
  .orders-grid { grid-template-columns: 1fr !important; }
  .order-card { min-width: 0; padding: 17px !important; border-radius: 16px !important; }
  .oc-top, .oc-foot { gap: 10px; }
  .oc-items { overflow-wrap: anywhere; }
  .admin-tabs { top: 68px !important; margin-inline: -14px !important; padding-inline: 14px !important; overflow-x: auto; border-radius: 0 !important; }
  .admin-tabs .atab { min-width: 112px !important; }
  .foot { margin-top: 0 !important; }
}

/* ===== Доступность ===== */

/* Подпись, доступная скринридеру, но не занимающая места в макете.
   Используется там, где визуально роль поля ясна из контекста. */
.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;
}

/* Сообщение о недоступной главе журнала. */
.journal-missing {
  margin: 0 0 28px;
  padding: 14px 18px;
  border-left: 3px solid var(--terra, #b85c2c);
  background: rgba(184, 92, 44, .07);
  border-radius: 4px;
  font-size: 15px;
  line-height: 1.5;
}

/* Видимый фокус на интерактивных элементах: без него навигация с клавиатуры
   вслепую. Применяется только к focus-visible, чтобы не мешать мыши. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--terra, #b85c2c);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ============================================================
   ФОРМАТЫ ПОДАЧИ, ЗАВАРИВАНИЕ, УСЛУГИ И СОВЕТЫ МАСТЕРОВ
   Продолжение утверждённого языка: та же бумага, терракота и
   тонкие линии. Новые блоки, не новый стиль.
   ============================================================ */

/* Выбор формата подачи в конфигураторе. */
.format-options label span em {
  display: block;
  margin-top: 8px;
  color: var(--terra);
  font: 700 12px/1.3 var(--display);
  font-style: normal;
}

.builder-hint {
  margin: 12px 0 0;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.55;
}

.builder-hint a { color: var(--terra); }

.amanita-note {
  padding: 12px 14px;
  border-left: 2px solid var(--terra);
  background: rgba(184, 92, 44, .06);
}

/* Карта заваривания внутри конфигуратора. */
.brew-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.brew-guide-grid article {
  padding: 16px;
  display: grid;
  gap: 6px;
  align-content: start;
  background: var(--paper);
}

.brew-guide-grid span { color: var(--terra); font: 500 8px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.brew-guide-grid b { font: 700 20px/1.1 var(--display); }
.brew-guide-grid small { color: var(--text-dim); font-size: 11px; line-height: 1.4; }

/* Мудрость Чайного Деда в конфигураторе. */
.builder-wisdom {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  background: var(--paper-warm) !important;
}

.builder-wisdom img { width: 42px; height: 42px; object-fit: contain; }
.builder-wisdom span { display: block; color: var(--terra); font: 500 8px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.builder-wisdom b { display: block; margin: 8px 0 6px; font: 400 italic 18px/1.35 var(--serif); }

.oc-logistics {
  margin-top: 12px;
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.oc-logistics span { color: var(--text-dim); }
.oc-logistics b { color: var(--terra); text-align: right; }

@media (max-width: 600px) {
  .oc-logistics { align-items: flex-start; flex-direction: column; }
  .oc-logistics b { text-align: left; }
}

/* Фотографии из действующего меню: не рисуем продукт заново и не меняем
   утверждённую айдентику. Снимок становится частью взрослой журнальной
   композиции, а название и цена остаются отдельным доступным слоем. */
.real-menu-photo {
  position: relative;
  overflow: hidden;
  margin: 0;
  min-width: 0;
  background: #17120f;
  border: 1px solid var(--ink);
  border-radius: var(--director-radius);
}

.real-menu-photo > img:first-child {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.real-menu-photo figcaption {
  position: absolute;
  inset: auto 18px 18px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: calc(100% - 36px);
  padding: 10px 14px;
  background: rgba(252, 250, 244, .93);
  border: 1px solid rgba(14, 14, 14, .42);
  border-radius: 999px;
  box-shadow: 0 16px 45px rgba(20, 12, 8, .22);
  backdrop-filter: blur(12px);
}

.real-menu-photo figcaption img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
}

.real-menu-photo figcaption span {
  color: var(--ink);
  font: 500 9px/1.35 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.home-cold .real-menu-photo {
  min-height: min(720px, 74vw);
  border-radius: 0;
}

.home-cold .real-menu-photo > img:first-child {
  object-position: center 42%;
}

.cold-lineup.real-menu-photo {
  aspect-ratio: 4 / 3;
  max-height: 920px;
}

.cold-lineup.real-menu-photo > img:first-child {
  object-position: center;
}

/* Реальный снимок маття занимает всю верхнюю полосу, три карточки продолжают
   её в той же сетке. Псевдоизображение старой версии больше не используется. */
.matcha-chapter > .matcha-real-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.matcha-chapter > .matcha-real-grid::before,
.matcha-chapter > .matcha-real-grid::after {
  content: none;
}

.matcha-real-photo {
  grid-column: 1 / -1;
  grid-row: 1;
  aspect-ratio: 4 / 3;
  max-height: 900px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
}

.matcha-real-photo > img:first-child {
  object-position: center 47%;
}

.matcha-real-grid .director-matcha {
  grid-row: 2;
}

@media (max-width: 600px) {
  .home-cold .real-menu-photo {
    min-height: 0;
    aspect-ratio: 4 / 5;
  }

  .cold-lineup.real-menu-photo,
  .matcha-real-photo {
    aspect-ratio: 4 / 5;
  }

  .real-menu-photo figcaption {
    inset: auto 10px 10px 10px;
    max-width: calc(100% - 20px);
    padding: 8px 11px;
  }

  .real-menu-photo figcaption img {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .real-menu-photo figcaption span {
    font-size: 8px;
  }

  .matcha-chapter > .matcha-real-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .matcha-real-photo,
  .matcha-real-grid .director-matcha {
    grid-column: 1;
  }

  .matcha-real-photo { grid-row: 1; }
  .matcha-real-grid .director-matcha:nth-of-type(1) { grid-row: 2; }
  .matcha-real-grid .director-matcha:nth-of-type(2) { grid-row: 3; }
  .matcha-real-grid .director-matcha:nth-of-type(3) { grid-row: 4; }

  .preorder-builder,
  .checkout-sheet {
    overflow-x: hidden;
  }

  .builder-head > div,
  .checkout-heading > div {
    min-width: 0;
  }

  .builder-head h2,
  .checkout-heading h2 {
    max-width: 100%;
    overflow-wrap: anywhere;
    text-wrap: balance;
  }

  .builder-head {
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 10px;
  }

  .builder-head img {
    width: 56px;
    height: 56px;
  }

  .builder-head h2 {
    font-size: clamp(28px, 8.35vw, 33px);
    line-height: .98;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }
}
.builder-wisdom small { color: var(--text-dim); font-size: 12px; line-height: 1.5; }

/* Расшифровка цены: гость видит, из чего сложилась сумма. */
.builder-total { display: grid; gap: 4px; min-width: 0; }
.builder-total b { font: 700 30px/1 var(--display); }

#builderBreakdown {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  max-width: 420px;
}

#builderBreakdown li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--line);
  color: var(--text-dim);
  font-size: 11px;
}

#builderBreakdown li b { color: var(--ink); font: 700 11px var(--sans); }

/* Выбор услуги: категория церемонии и число гостей. */
.service-picker { width: min(680px, calc(100vw - 32px)); }
.service-picker form > section { padding: 24px 30px; border-bottom: 1px solid var(--ink); }
.service-picker form > footer { padding: 22px 30px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }

/* Карточка услуги в меню. */
.service-chapter { background: var(--paper-warm); }
.service-chapter > div {
  max-width: var(--director-width);
  margin: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.director-service {
  min-width: 0;
  padding: 26px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  transition: transform .35s ease;
}

.director-service:nth-child(2n) { border-right: 0; }
.director-service:nth-child(n+3) { border-top: 1px solid var(--line); }
.director-service:hover { transform: translateY(-4px); }
.director-service > span { color: var(--terra); font: 500 9px var(--mono); text-transform: uppercase; letter-spacing: .09em; }

.service-mark {
  height: 96px;
  margin: 18px 0;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
}

.service-mark i { font-size: 46px; color: var(--terra); }
.director-service h3 { margin: 0 0 12px; font: 700 26px/1.05 var(--display); }
.director-service > p { margin: 0 0 18px; color: var(--text-dim); line-height: 1.55; }

.service-tiers { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 6px; }
.service-tiers li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 5px; border-bottom: 1px dashed var(--line); font-size: 12px; }
.service-tiers b { font: 700 13px var(--display); }
.service-addon { display: block; margin-bottom: 18px; color: var(--sage); font-size: 11px; }
.director-service footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.director-service footer > b { display: grid; font: 700 20px var(--display); }
.director-service footer em { color: var(--text-dim); font: 400 9px var(--mono); font-style: normal; text-transform: uppercase; }
.director-service footer button { min-height: 44px; padding: 10px 15px; display: flex; gap: 14px; border: 1px solid var(--ink); border-radius: 99px; background: transparent; color: var(--ink); font-weight: 800; cursor: pointer; }
.director-service footer button:hover { background: var(--terra); border-color: var(--terra); color: var(--cream); }

/* Параметры заваривания и цепочка рекомендаций в карточке чая. */
.tea-brew-line {
  margin: 18px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tea-brew-line span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--text-dim);
  font: 500 9px var(--mono);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.tea-pairing {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.tea-pairing li {
  padding: 11px 0;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 4px 12px;
  border-bottom: 1px solid var(--line);
}

.tea-pairing span { color: var(--terra); font: 500 8px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .07em; }
.tea-pairing b { font-size: 13px; }
.tea-pairing small { grid-column: 2; color: var(--text-dim); font-size: 11px; line-height: 1.45; }

.tea-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ghost-action { background: transparent !important; color: var(--text-dim) !important; }
.ghost-action:hover { color: var(--ink) !important; border-color: var(--ink) !important; }
.director-tea footer > b { display: grid; gap: 3px; }
.director-tea footer em { color: var(--text-dim); font: 400 9px var(--mono); font-style: normal; text-transform: uppercase; }

/* Совет мастера в карточке чая. */
.tea-advice {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-left: 2px solid var(--terra);
  background: rgba(184, 92, 44, .05);
}

.tea-advice span { display: block; margin-bottom: 7px; color: var(--terra); font: 500 8px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.tea-advice p { margin: 0; font: 400 italic 14px/1.5 var(--serif); }
.tea-advice cite { display: block; margin-top: 8px; color: var(--text-dim); font: 500 9px var(--mono); font-style: normal; }

/* Подкатегории чая и счётчик поиска. */
.catalog-subindex {
  position: sticky;
  top: 126px;
  z-index: 19;
  display: flex;
  gap: 0;
  overflow-x: auto;
  background: rgba(247, 241, 229, .96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.catalog-subindex::-webkit-scrollbar { display: none; }

.catalog-subindex button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font: 500 9px var(--mono);
  text-transform: uppercase;
  letter-spacing: .05em;
  cursor: pointer;
}

.catalog-subindex button:hover { background: var(--terra); color: var(--cream); }
.catalog-index button.is-accent { color: var(--terra); font-weight: 700; }
.menu-search-count { display: block; margin-top: 8px; color: var(--terra); font: 500 9px var(--mono); text-transform: uppercase; }
.tea-shelf { scroll-margin-top: 180px; }

/* Экран заваривания. */
.brew-params { display: grid; gap: 0; margin-top: 26px; border-top: 1px solid var(--line); }
.brew-params div { padding: 13px 0; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px; border-bottom: 1px solid var(--line); }
.brew-params dt { color: var(--text-dim); font: 500 9px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.brew-params dd { margin: 0; font-weight: 700; font-size: 13px; }

.brew-actions { margin-top: 24px; display: flex; gap: 9px; flex-wrap: wrap; }

.brew-mode { display: flex; gap: 2px; margin: 0 auto 18px; padding: 3px; background: var(--cream); border: 1px solid var(--line); border-radius: 3px; }
.brew-mode button { flex: 1; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 2px; background: transparent; color: var(--text-dim); font: 700 11px var(--sans); cursor: pointer; }
.brew-mode button.active { background: var(--terra); color: var(--cream); }

.brew-wisdom { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.brew-wisdom img { width: 34px; height: 34px; margin-bottom: 10px; }
.brew-wisdom b { display: block; font: 400 italic 16px/1.4 var(--serif); }
.brew-wisdom small { display: block; margin-top: 7px; color: var(--text-dim); font-size: 11px; line-height: 1.5; }

.brew-freeform { margin: 14px 0 0; color: var(--text-dim); font-size: 11px; line-height: 1.5; }

.brew-advice { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.brew-advice article { padding: 14px 16px; background: var(--paper-warm); border: 1px solid var(--line); }
.brew-advice h3 { margin: 0 0 7px; font: 700 16px var(--display); }
.brew-advice p { margin: 0; color: var(--text-dim); font-size: 12px; line-height: 1.55; }
.brew-advice cite { display: block; margin-top: 9px; color: var(--terra); font: 500 9px var(--mono); font-style: normal; }

/* Лента советов в журнале. */
.advice-feed { padding-bottom: 110px; }
.advice-feed > header { margin-bottom: 34px; display: grid; gap: 12px; max-width: 780px; }
.advice-feed > header h2 { margin: 0; font: 700 clamp(34px, 4.2vw, 58px)/.98 var(--display); }
.advice-feed > header p { margin: 0; color: var(--text-dim); line-height: 1.65; }
.advice-feed > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.advice-feed article { padding: 22px; display: flex; flex-direction: column; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: var(--panel); }
.advice-feed article > span { color: var(--terra); font: 500 9px var(--mono); text-transform: uppercase; letter-spacing: .07em; }
.advice-feed h3 { margin: 20px 0 10px; font: 700 20px/1.15 var(--display); }
.advice-feed p { margin: 0 0 18px; color: var(--text-dim); font-size: 13px; line-height: 1.6; }
.advice-feed footer { margin-top: auto; padding-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.advice-feed cite { color: var(--text-dim); font: 500 9px var(--mono); font-style: normal; }
.advice-feed footer a { color: var(--terra); font: 700 10px var(--sans); text-decoration: none; }

/* Доставка, оплата и мудрость в подтверждении заказа. */
.delivery-note { margin: 14px 0; padding: 12px 14px; border-left: 2px solid var(--terra); background: rgba(184, 92, 44, .06); color: var(--text-dim); font-size: 12px; line-height: 1.55; }
.delivery-note a { color: var(--terra); font-weight: 700; white-space: nowrap; }

.payment-pick { margin: 18px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.payment-pick .builder-step { grid-column: 1 / -1; margin-bottom: 0; }
.payment-pick label { min-height: 76px; padding: 14px; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.payment-pick span { display: grid; gap: 5px; }
.payment-pick small { color: var(--text-dim); font-size: 11px; line-height: 1.4; }
.payment-pick input:disabled + span { opacity: .55; }
.payment-pick label:has(input:disabled) { cursor: not-allowed; }

.success-wisdom { margin: 20px 0 0; padding: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font: 400 italic 16px/1.45 var(--serif); }
.success-wisdom cite { display: block; margin-top: 9px; color: var(--terra); font: 500 9px var(--mono); font-style: normal; }

/* Поле выбора сорта в редакции. */
.publication-tea small { color: var(--text-dim); font: 500 9px var(--mono); }

/* ——— Планшет ——— */
@media (max-width: 980px) {
  .advice-feed > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-chapter > div { grid-template-columns: minmax(0, 1fr); }
  .director-service { border-right: 0; border-top: 1px solid var(--line); }
  .director-service:first-child { border-top: 0; }
  .brew-guide-grid { grid-template-columns: minmax(0, 1fr); }
  .brew-params div { grid-template-columns: 140px minmax(0, 1fr); }
}

/* ——— Телефон ——— */
@media (max-width: 600px) {
  .catalog-subindex { top: 112px; }
  .tea-shelf { scroll-margin-top: 164px; }
  .tea-pairing li { grid-template-columns: minmax(0, 1fr); }
  .tea-pairing small { grid-column: 1; }
  .tea-card-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .director-tea footer, .director-service footer { align-items: stretch; flex-direction: column; gap: 12px; }
  .format-options, .payment-pick { grid-template-columns: minmax(0, 1fr); }
  .brew-params div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .advice-feed { padding-bottom: 80px; }
  .advice-feed > div { grid-template-columns: minmax(0, 1fr); border-left: 0; }
  .advice-feed article { border-right: 0; }
  #builderBreakdown { max-width: 100%; }
  .preorder-builder form > footer { align-items: stretch; }
  .service-picker form > section { padding: 20px 17px; }
  .service-picker form > footer { padding: 18px 17px; align-items: stretch; flex-direction: column; }
}

/* ============================================================
   ИСПРАВЛЕНИЯ АДАПТИВНОСТИ
   Дизайн не меняется — устраняются дефекты, из-за которых им
   нельзя было пользоваться на телефоне и планшете.
   ============================================================ */

/* 1. Мёртвая зона навигации 861–900 px.
   brand-2026.css скрывает верхнее меню при ≤900, а таб-панель включалась
   только при ≤860. В полосе 861–900 px пользователь оставался вообще без
   навигации: ни ссылок сверху, ни панели снизу. */
@media (max-width: 900px) {
  .tabbar { display: flex; }
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
}

/* 2. Таб-панель: высота и безопасная зона на всех мобильных ширинах,
   а не только ≤600 px. Иначе на iPad и в ландшафте подписи попадали
   под жест «домой», а футер перекрывался. */
@media (max-width: 900px) {
  .tabbar {
    min-height: calc(64px + env(safe-area-inset-bottom));
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom)) !important;
    align-items: flex-start;
  }

  .tabbar a { min-height: 46px; justify-content: center; }
}

/* Таб-панель строится из ролевой модели в app.js и может содержать
   5 или 6 пунктов. Фиксированные шесть колонок молча срезали лишний,
   поэтому раскладка задаётся по факту. */
@media (max-width: 600px) {
  .tabbar {
    grid-template-columns: none !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(0, 1fr) !important;
    overflow: visible !important;
  }

  /* 8px было ниже предела читаемости. */
  .tabbar a { font-size: 9.5px !important; }
  .tabbar a i { font-size: 17px !important; }
}

/* 3. Тач-цели: минимум 44×44 px по рекомендации платформ.
   Раньше крестик закрытия был ≈20 px, удаление позиции ≈16 px,
   избранное ≈18 px — попасть пальцем было трудно. */
.modal-x {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.modal-card .modal-x { top: 10px; right: 10px; }
.modal-x:hover { background: rgba(14, 14, 14, .06); }

.ci-del {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 20px;
}

.ci-del:hover { background: rgba(184, 92, 44, .1); }

.card .fav, .tea-card .fav {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  top: 6px;
  right: 6px;
  border-radius: 50%;
}

/* 4. Сетки с фиксированным минимумом трека шире экрана 320–360 px.
   minmax(360px) и minmax(320px) не помещались в контейнер и обрезались
   правилом overflow: clip. */
@media (max-width: 720px) {
  .author-grid, .dessert-grid, .cold-grid, .services-grid, .orders-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* 5. Модалка: динамическая высота вьюпорта вместо vh.
   На мобильном Safari 86vh считается по большому вьюпорту, поэтому
   низ карточки уходил под адресную строку. */
.modal-card { max-height: min(86svh, 900px); overscroll-behavior: contain; }
.cart-body { overscroll-behavior: contain; }

/* 6. Тост не должен перекрывать открытую модалку и вылезать за экран. */
.toast {
  z-index: 65;
  max-width: min(420px, calc(100vw - 32px));
  text-align: center;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}

/* 7. Липкие панели каталога встают точно под плавающей шапкой.
   Высота шапки в полосе 601–900 px равна 70 px, а панели рассчитывали
   на 68 px и заезжали под неё. */
@media (max-width: 900px) {
  .catalog-index { top: 74px; }
  .catalog-subindex { top: 118px; }
  .tea-library, .catalog-chapter, .mushroom-chapter { scroll-margin-top: 168px; }
}

@media (max-width: 600px) {
  .catalog-index { top: 70px; }
  .catalog-subindex { top: 114px; }
}

/* 8. Вкладки управляющей: sticky был объявлен только через top, без position,
   поэтому не работал. Заодно убираем перенос, который ломал сетку. */
.admin-tabs { position: sticky; }

@media (max-width: 900px) {
  .admin-tabs { flex-wrap: nowrap; top: 74px; }
}

/* 9. Корзина: кнопка оформления не должна попадать под жест «домой»
   на всех мобильных ширинах, а не только ≤600 px. */
@media (max-width: 900px) {
  .cart-foot { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

/* 10. Аварийный перенос длинных слов в крупных заголовках.
   overflow-wrap: normal запрещал разрыв, а overflow: clip не давал
   даже доскроллить обрезанное. */
@media (max-width: 980px) {
  .director-hero h1,
  .preorder-hero h1,
  .mushroom-hero h1,
  .my-tea-hero h1,
  .mood-quiz aside h1,
  .choice-stage > header h2,
  .director-featured > header h2,
  .cold-editorial h2,
  .tea-library > header h2,
  .catalog-chapter > header h2,
  .mushroom-chapter > header h2 {
    overflow-wrap: anywhere;
  }
}

/* 11. Картинки в корзине и модалках не были защищены от переполнения:
   правило max-width покрывало только #app. */
.modal img, .modal svg, .cart img, .foot img {
  max-width: 100%;
}

/* Пропорции не должны искажаться при сжатии. */
#app img, .modal img, .cart img { height: auto; }
.director-ded-stage > img, .tea-house-stage > img, .preorder-hero > img,
.mushroom-hero > img, .my-tea-hero > img, .builder-head img,
.checkout-heading img, .preorder-success img, .journal-hero > img {
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

/* 12. Вкладки рабочего кабинета: шесть пунктов в скролле без индикации.
   Фикс лежал в неподключённом revamp-2026.css. */
@media (max-width: 720px) {
  .team-shell > nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
  }

  .team-shell > nav button {
    min-width: 0;
    min-height: 46px;
    padding: 9px 6px;
    font-size: 10px;
    line-height: 1.25;
    white-space: normal;
  }
}

/* 13. Поля ввода не должны вызывать зум при фокусе на iOS:
   для этого достаточно шрифта 16 px. Раньше это было выставлено
   только в оформлении заказа. */
@media (max-width: 900px) {
  input, select, textarea { font-size: 16px; }
  .gram-control input { font-size: 22px; }
}

/* 14. Экран заваривания на телефоне: одна колонка, без горизонтального
   скролла у быстрого выбора сортов. */
@media (max-width: 900px) {
  .brew-workspace { grid-template-columns: minmax(0, 1fr); }
  .brew-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; overflow: visible; }
  .brew-quick button { flex: initial; min-height: 46px; }
}

/* 15. Ни одно системное состояние не уходит в браузерный голубой.
   Фокус остаётся заметным, но говорит на языке бренда. */
html { accent-color: var(--terra); }

::selection {
  color: var(--ink);
  background: rgba(184, 92, 44, .24);
}

::-moz-selection {
  color: var(--ink);
  background: rgba(184, 92, 44, .24);
}

a, button, input, select, textarea, [role="button"] {
  -webkit-tap-highlight-color: rgba(184, 92, 44, .16);
}

input[type="checkbox"],
input[type="radio"],
input[type="range"],
progress {
  accent-color: var(--terra) !important;
}

select option:checked {
  color: var(--cream);
  background: var(--terra);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--terra);
  box-shadow: 0 0 0 1000px var(--paper) inset;
  transition: background-color 9999s ease-out 0s;
}

/* 16. Точная навеска выглядит как рабочий инструмент чайного мастера,
   а не как стандартное числовое поле браузера. */
.tea-gram-picker {
  width: min(100%, 470px);
  padding: 8px;
  border: 1px solid rgba(14, 14, 14, .72);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(184, 92, 44, .09), transparent 46%),
    var(--paper-warm);
  box-shadow: 0 18px 42px rgba(46, 28, 17, .09);
}

.gram-control.tea-gram-control {
  width: 100%;
  grid-template-columns: 68px minmax(0, 1fr) 68px;
  border: 0;
  border-radius: 15px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(14, 14, 14, .15);
}

.tea-gram-control > button {
  min-width: 0;
  min-height: 104px;
  display: grid;
  place-content: center;
  gap: 2px;
  color: var(--terra);
  background: transparent;
  border: 0;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.tea-gram-control > button:first-child { border-right: 1px solid var(--line); }
.tea-gram-control > button:last-child { border-left: 1px solid var(--line); }

.tea-gram-control > button b {
  font: 400 30px/1 var(--serif);
}

.tea-gram-control > button small {
  color: var(--text-dim);
  font: 600 8px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tea-gram-control > button:hover {
  color: var(--cream);
  background: var(--terra);
}

.tea-gram-control > button:hover small { color: currentColor; }
.tea-gram-control > button:active { transform: scale(.96); }

.tea-gram-control > label {
  min-width: 0;
  padding: 13px 12px 10px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
}

.gram-eyebrow {
  color: var(--text-dim);
  font: 600 8px/1.3 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.gram-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
}

.gram-value input {
  width: min(112px, 28vw);
  height: auto;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  text-align: right;
  font: 500 42px/.95 var(--serif) !important;
  appearance: textfield;
}

.gram-value input::-webkit-inner-spin-button,
.gram-value input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.gram-value > b {
  color: var(--terra);
  font: 600 15px/1 var(--mono);
}

.gram-live-price {
  min-height: 14px;
  color: var(--terra);
  font: 600 9px/1.35 var(--mono);
  letter-spacing: .04em;
}

.gram-scale {
  height: 18px;
  margin: 0 17px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-top: 1px solid rgba(184, 92, 44, .38);
}

.gram-scale i {
  width: 1px;
  height: 5px;
  display: block;
  background: var(--terra);
}

.gram-scale i:nth-child(odd) { height: 9px; }

.gram-quick button.active,
.gram-quick button[aria-pressed="true"] {
  color: var(--cream);
  background: var(--terra);
  border-color: var(--terra);
}

/* 17. Референсные фотографии задают направление, но в интерфейсе остаются
   только чистые постановочные композиции без фона торговой точки. */
.home-cold .real-menu-photo {
  min-height: 560px;
  padding: clamp(18px, 3vw, 44px);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 76% 24%, rgba(184, 92, 44, .13), transparent 31%),
    var(--paper-warm);
}

.home-cold .real-menu-photo > img:first-child,
.cold-lineup.real-menu-photo > img:first-child {
  object-fit: contain;
}

.cold-lineup.real-menu-photo {
  aspect-ratio: 3 / 1;
  max-height: none;
  padding: clamp(12px, 2vw, 30px);
  background: var(--paper-warm);
}

.matcha-real-photo {
  min-height: 0;
  aspect-ratio: 16 / 9;
  background: var(--paper-warm);
}

.matcha-real-photo > img:first-child {
  object-position: center;
  object-fit: cover;
}

@media (max-width: 600px) {
  .tea-gram-picker { width: 100%; border-radius: 19px; }
  .gram-control.tea-gram-control { grid-template-columns: 58px minmax(0, 1fr) 58px; }
  .tea-gram-control > button { min-height: 96px; }
  .gram-value input { width: min(96px, 30vw); font-size: 38px !important; }

  .home-cold .real-menu-photo,
  .cold-lineup.real-menu-photo {
    min-height: 0;
    aspect-ratio: 4 / 3;
    padding: 14px;
  }

  .matcha-real-photo {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
}
