/* Reproduce the approved composition; keep background artwork separate from controls. */
:root {
  --bg: #f3f5f3;
  --card: #ffffff87;
  --line: #ffffffb8;
  --shadow: 0 15px 32px #1d493916;
}
.reference-price {
  margin: -4px 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.reference-price summary {
  cursor: pointer;
  color: var(--green);
}
.reference-price small {
  display: block;
  margin-top: 8px;
}
html[data-theme="dark"] {
  --bg: #151b19;
  --card: #242d29bd;
  --line: #c6d5cb30;
  --shadow: 0 15px 40px #0003;
}
body {
  background:
    radial-gradient(ellipse at 70% 22%, #c1d0c97a, transparent 67%),
    linear-gradient(120deg, #edf0ed, #dce6e0 65%, #f4f5f2);
  background-attachment: fixed;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 82% 20%, #3b4e434d, transparent 70%),
    linear-gradient(120deg, #151b19, #25312b);
  background-attachment: fixed;
}
body::before {
  inset: 88px 0 0;
  background: url("/still-outline.svg") right 5vw top 3vh / min(600px, 45vw)
    auto no-repeat;
  opacity: 0.4;
  filter: blur(13px);
  z-index: 0;
}
body[data-page="home"]::before {
  background-position: right -4vw top 0;
  background-size: min(620px, 43vw);
  opacity: 0.75;
  filter: none;
}
html[data-theme="dark"] body::before {
  opacity: 0.28;
  filter: invert(0.8) blur(14px);
}
html[data-theme="dark"] body[data-page="home"]::before {
  opacity: 0.48;
  filter: invert(0.8);
}
header {
  margin: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 23px;
  height: 64px;
  padding: 10px 24px;
  justify-content: flex-start;
  gap: 22px;
  position: relative;
  background: var(--card);
  backdrop-filter: blur(30px);
}
header .brand {
  font-size: 25px;
  letter-spacing: -0.04em;
  border-left: 1px solid #879b8d66;
  padding-left: 22px;
}
header > button:last-child {
  margin-left: auto;
  border-radius: 50%;
  background: var(--pale);
}
main {
  max-width: 1480px;
  padding: 26px 30px 135px;
}
.greeting h1 {
  font-size: 46px;
  letter-spacing: -0.045em;
  margin-bottom: 8px;
}
.greeting p {
  font-size: 22px;
}
.greeting {
  margin-bottom: 22px;
}
.card,
.metric-card,
.quick-actions button,
.recipe-list {
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(25px);
}
.metrics {
  gap: 15px;
  margin: 18px 0 24px;
}
.metric-card {
  display: grid;
  grid-template-columns: 68px 1fr;
  grid-template-rows: auto auto;
  padding: 19px 22px;
  min-height: 122px;
  column-gap: 22px;
  align-content: center;
  color: var(--text);
}
.metric-card > svg {
  position: static;
  width: 49px;
  height: 49px;
  grid-row: 1/3;
  align-self: center;
  margin: 0;
  opacity: 1;
}
.metric-card > span {
  font-size: 17px;
  padding: 0 0 0 22px;
  border-left: 1px solid #839d8d5c;
  line-height: 1.3;
}
.metric-card > strong {
  font-size: 35px;
  line-height: 1.15;
  padding-left: 22px;
  border-left: 1px solid #839d8d5c;
  margin-top: 7px;
  color: var(--text);
  letter-spacing: -0.035em;
}
.events {
  padding: 20px 26px;
}
.events h2 {
  font-size: 27px;
}
.event {
  padding: 14px 0;
}
.event > span:nth-child(2) {
  border-left: 1px solid #839d8d40;
  padding-left: 18px;
}
.event strong {
  font-size: 19px;
}
.event small {
  font-size: 15px;
}
.event-icon {
  width: 50px;
  height: 50px;
  background: transparent;
}
.event-icon svg {
  width: 34px;
  height: 34px;
}
.event-icon img {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  object-fit: cover;
}
.quick-actions {
  gap: 15px;
}
.quick-actions button {
  font-size: 18px;
  min-height: 68px;
  display: flex;
  gap: 16px;
}
.quick-actions button:first-child {
  background: linear-gradient(170deg, #397f68, #245c4d);
  color: #fff;
  border-color: #ffffff70;
  box-shadow:
    inset 0 1px 1px #ffffffb0,
    0 12px 25px #245c4d30;
}
.quick-actions button:nth-child(3) {
  background: var(--card);
  color: var(--text);
  border-color: var(--line);
}
.quick-actions button svg {
  width: 30px;
  height: 30px;
}
.quick-actions button:nth-child(2n) {
  border-color: var(--line);
  color: var(--text);
}
.bottom-nav {
  left: 12px;
  right: 12px;
  bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 4px 12px;
  backdrop-filter: blur(30px);
}
.bottom-nav button {
  flex: 1;
  max-width: 230px;
  flex-direction: row;
  font-size: 18px;
  gap: 13px;
  min-height: 58px;
}
.bottom-nav button + button {
  border-left: 1px solid #839d8d3a;
  border-radius: 0;
}
.bottom-nav button svg {
  width: 29px;
  height: 29px;
}
.bottom-nav button.active {
  background: transparent;
}
.recipe-search {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 18px;
  max-width: 650px;
  margin: 20px 0 24px;
  backdrop-filter: blur(24px);
}
.recipe-search input {
  border: 0;
  background: transparent;
  margin: 0;
}
.recipe-list {
  max-width: 980px;
  padding: 12px 28px;
}
.recipe-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 22px;
  border-bottom: 1px solid #839d8d3a;
  padding: 22px 0;
  margin: 0;
}
.recipe-row:last-child {
  border-bottom: 0;
}
.recipe-row > .drink-photo {
  width: 90px;
  height: 112px;
  object-fit: cover;
  border-radius: 16px;
}
.recipe-row h2 {
  font-size: 25px;
  margin-top: 4px;
}
.recipe-row .actions {
  margin-top: 12px;
}
.recipe-row p {
  line-height: 1.5;
}
.stock-group {
  font-size: 21px;
  margin: 28px 0 16px;
}
.remove-button {
  background: #bf75652a !important;
  color: var(--text) !important;
  border: 1px solid #a65d4c66 !important;
  font-weight: 600;
}
.needs-attention {
  background: #d99b3430;
  color: var(--text);
  border: 1px solid #c28a45;
  font-weight: 650;
}
.request-row:has(.needs-attention) {
  border-left: 4px solid var(--amber);
}
.stock-line .secondary {
  font-size: 13px;
  padding: 8px 12px;
  min-height: 36px;
}
.stock-line details {
  text-align: left;
}
.first-calculator small {
  display: block;
  margin: 9px 0;
}
.energy-fields > p {
  grid-column: 1/-1;
}
.first-calculator select {
  width: 100%;
}
.actions {
  flex-wrap: wrap;
  gap: 10px;
}
button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.actions button:disabled {
  background: var(--pale);
  color: var(--muted);
  border: 1px dashed #8ca49380;
}
@media (min-width: 1100px) {
  body[data-page="home"] .greeting,
  body[data-page="home"] .metrics,
  body[data-page="home"] .events {
    width: 69%;
  }
  body[data-page="home"] main > section:last-child {
    margin-top: 26px;
  }
  body[data-page="home"] main > section:last-child > h2 {
    display: none;
  }
  .quick-actions {
    grid-template-columns: repeat(4, 1fr);
  }
  body:not([data-page="home"]) main > .page-title,
  body:not([data-page="home"]) .recipe-list {
    width: 72%;
  }
}
@media (max-width: 700px) {
  header {
    height: 58px;
    margin: 7px 9px;
    padding: 8px 12px;
    gap: 12px;
    border-radius: 18px;
  }
  header .brand {
    font-size: 20px;
    padding-left: 12px;
  }
  .brand {
    white-space: normal;
  }
  main {
    padding: 17px 16px 130px;
  }
  .greeting {
    margin-bottom: 10px;
    min-height: 87px;
  }
  .greeting h1 {
    font-size: 32px;
  }
  .greeting p {
    font-size: 17px;
  }
  .metrics {
    gap: 12px;
    margin-top: 12px;
  }
  .metric-card {
    grid-template-columns: 35px 1fr;
    gap: 8px;
    min-height: 120px;
    padding: 14px 12px;
  }
  .metric-card > svg {
    width: 30px;
    height: 30px;
  }
  .metric-card > span {
    font-size: 12px;
    padding-left: 10px;
  }
  .metric-card > strong {
    font-size: 23px;
    grid-column: 1 / -1;
    padding-left: 0;
    border-left: 0;
    overflow-wrap: normal;
  }
  .events {
    padding: 17px;
  }
  .events h2 {
    font-size: 23px;
  }
  .event {
    gap: 10px;
  }
  .event strong {
    font-size: 16px;
  }
  .event small {
    font-size: 13px;
  }
  .event > span:nth-child(2) {
    padding-left: 10px;
  }
  .event-icon {
    width: 35px;
    height: 40px;
  }
  .event-icon img {
    width: 35px;
    height: 40px;
  }
  .quick-actions {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .quick-actions button {
    font-size: 14px;
    gap: 10px;
    min-height: 69px;
    padding: 12px;
  }
  .quick-actions button svg {
    width: 24px;
    height: 24px;
  }
  .bottom-nav {
    left: 9px;
    right: 9px;
    bottom: 8px;
    padding: 3px;
  }
  .bottom-nav button {
    flex-direction: column;
    font-size: 12px;
    gap: 4px;
    min-height: 65px;
    padding: 6px;
  }
  .bottom-nav button svg {
    width: 25px;
    height: 25px;
  }
  .recipe-list {
    padding: 5px 16px;
  }
  .recipe-row {
    grid-template-columns: 68px 1fr;
    gap: 14px;
    padding: 18px 0;
  }
  .recipe-row > .drink-photo {
    width: 68px;
    height: 88px;
  }
  .recipe-row h2 {
    font-size: 22px;
  }
  .recipe-row .actions > * {
    font-size: 13px;
    padding: 10px;
  }
  .recipe-row details {
    font-size: 14px;
  }
  body[data-page="home"]::before {
    background-position: right -110px top 40px;
    background-size: 460px;
    opacity: 0.45;
  }
  body::before {
    background-size: 480px;
    background-position: right -80px top 30px;
    opacity: 0.18;
    filter: blur(14px);
  }
  .page-title > h1 {
    font-size: 31px;
  }
}

.recipe-row {
  display: block;
}
.recipe-summary {
  display: grid;
  grid-template-columns: 90px 1fr 24px;
  align-items: center;
  gap: 22px;
  list-style: none;
  padding: 0;
  min-height: 115px;
}
.recipe-summary::-webkit-details-marker {
  display: none;
}
.recipe-summary .drink-photo {
  width: 90px;
  height: 112px;
  object-fit: cover;
  border-radius: 16px;
}
.recipe-summary h2 {
  font-size: 26px;
  margin: 0 0 8px;
}
.recipe-summary > span > span {
  color: var(--muted);
  font-weight: 400;
}
.recipe-content {
  padding: 12px 0 10px 112px;
}
.recipe-row[open] > .recipe-summary {
  margin-bottom: 0;
}
.recipe-row[open] > .recipe-summary > svg {
  transform: rotate(90deg);
}
html[data-theme="dark"] .metric-card strong {
  color: var(--text);
}
html[data-theme="dark"] .metric-card:nth-child(4) strong {
  color: var(--amber);
}
@media (max-width: 700px) {
  .recipe-summary {
    grid-template-columns: 68px 1fr 20px;
    gap: 14px;
    min-height: 90px;
  }
  .recipe-summary .drink-photo {
    width: 68px;
    height: 88px;
  }
  .recipe-summary h2 {
    font-size: 22px;
  }
  .recipe-content {
    padding-left: 0;
  }
}
input[aria-invalid="true"] {
  border: 2px solid #b44d3b;
}
body[data-page="telegram"] .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
body[data-page="telegram"] .tabs button {
  flex: 1 1 160px;
  white-space: normal;
}
.metric-card small {
  grid-column: 2;
  display: block;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 8px;
}
.production-card .page-title {
  gap: 12px;
  flex-wrap: wrap;
}

/* Artwork belongs to the page composition, not a clipped fixed viewport layer. */
body[data-page="home"]::before {
  display: none;
}
body[data-page="home"] #main {
  position: relative;
  isolation: isolate;
}
.home-art {
  position: absolute;
  top: 8px;
  right: 0;
  width: min(32%, 360px);
  height: min(790px, calc(100svh - 105px));
  pointer-events: none;
  z-index: -1;
  opacity: 0.72;
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.home-art img {
  width: auto;
  height: 100%;
  max-width: none;
  flex-shrink: 0;
  display: block;
}
html[data-theme="dark"] .home-art {
  opacity: 0.85;
  filter: invert(0.8) hue-rotate(180deg) brightness(1.6);
}
.reserved-overview {
  margin-top: 28px;
}
.reserved-overview article + article {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.must-ingredient {
  margin: 12px 0;
  min-width: 0;
}
.must-ingredient label,
.must-ingredient input,
.must-ingredient select {
  min-width: 0;
  max-width: 100%;
}
.preview-label {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: normal;
  font-weight: 400;
  margin-top: 3px;
}
@media (min-width: 1100px) {
  body[data-page="home"] .metric-card {
    padding-top: 16px;
    padding-bottom: 16px;
  }
  body[data-page="home"] .metric-card > strong {
    font-size: 36px;
  }
  body[data-page="home"] .greeting h1 {
    font-size: 48px;
  }
  body[data-page="home"] .event {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}
@media (max-width: 700px) {
  .metric-card small {
    grid-column: 1/-1;
    padding-left: 0;
  }
}
.must-ingredient input[readonly] {
  background: var(--pale);
}
.line-allocation small {
  grid-column: 1/-1;
  display: block;
}
@media (max-width: 1099px) {
  body[data-page="home"] .greeting {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(100px, 28vw, 160px);
    align-items: center;
    gap: 12px;
  }
  body[data-page="home"] .greeting > div:first-child {
    min-width: 0;
  }
  .home-art {
    position: static;
    width: 100%;
    height: clamp(230px, 48vw, 300px);
    z-index: auto;
    opacity: 0.85;
  }
}
@media (max-width: 700px) {
  body[data-page="home"] .greeting {
    min-height: 0;
    padding-top: 0;
  }
  .line-allocation {
    grid-template-columns: 1fr;
  }
}
input[aria-invalid="true"] + small {
  color: #b44d3b;
  font-weight: 600;
}
@media (max-width: 359px) {
  body[data-page="home"] .metrics {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 1100px) {
  body:not([data-page="home"]) #main > .page-title h1 {
    font-size: 50px;
    line-height: 1.1;
  }
  .greeting h1 {
    font-size: 52px;
  }
  .metric-card > strong {
    font-size: 40px;
  }
}

/* Главная, вариант A «Водяной знак» — выбран владельцем 23.11.2026.
   Рисунок аппарата лежит фоном у правого края; правая треть уходит за край экрана,
   приветствие и карточки идут сразу под шапкой без отдельной колонки. */
body[data-page="home"] .greeting {
  display: block;
  min-height: 0;
}
.home-art {
  position: absolute;
  top: 0;
  right: 0;
  height: clamp(520px, 76svh, 900px);
  aspect-ratio: 0.5;
  width: auto;
  overflow: hidden;
  display: block;
  opacity: 0.28;
  z-index: -1;
  pointer-events: none;
}
.home-art img {
  height: 100%;
  width: auto;
  max-width: none;
  display: block;
}
html[data-theme="dark"] .home-art {
  opacity: 0.32;
  filter: invert(0.8) hue-rotate(180deg) brightness(1.6);
}
/* Под карточками главной рисунок должен просвечивать, как на согласованном макете:
   сильное размытие стекла стирает тонкие линии аппарата. */
body[data-page="home"] .metric-card,
body[data-page="home"] .events {
  backdrop-filter: blur(2px);
}

/* B1.4: боковое меню поверх нижней панели; последний пункт доступен прокруткой. */
#drawer {
  z-index: 30;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
body.menu-open .shell {
  z-index: 40;
}

/* B4.1: прайс по напиткам — строка названия, под ней фасовки. */
.price-table .price-group th {
  background: var(--pale);
  color: var(--text);
  font-size: 17px;
  text-align: left;
  padding-top: 12px;
  padding-bottom: 12px;
}
.price-table .price-group th:last-child {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}
.price-table td:first-child {
  padding-left: 22px;
}

/* Единая шапка вкладок (Перегоны, Партии, Остатки, Прайс…): один размер заголовка,
   главная кнопка справа в той же строке, подпись и переключатели — отдельными строками. */
#main > .page-title {
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 4px;
}
#main > .page-title > h1 {
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(28px, 6vw, 46px);
  line-height: 1.1;
  margin: 0;
}
#main > .page-title > button,
#main > .page-title > .actions {
  flex-shrink: 0;
  margin-left: auto;
}
#main > .page-sub {
  margin: 0 0 14px;
}
body:not([data-page="telegram"]) #main > .tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
}
#main > .tabs button {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 420px) {
  #main > .page-title > button {
    font-size: 13px;
    padding: 10px 12px;
  }
}

/* Розлив: строки фасовок. */
.bottle-line {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}
.bottle-summary {
  background: var(--pale);
  border-radius: 12px;
  padding: 10px 12px;
}
@media (max-width: 520px) {
  .bottle-line {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
