/* Палитра старой версии: тёмный кофе + карамель */
:root {
  --bg: #F5EFEB;
  --header: #2C1D11;
  --accent: #E0A96D;
  --text: #2C1D11;
  --muted: #757575;
  --card: #3E2723;
  --card-hover: #4E342E;
  --card-text: #F5EFEB;
  --panel: #FFFFFF;
  --green: #2EA44F;
  --red: #D32F2F;
  --blue: #0288D1;
  --orange: #E65100;
  --gray: #757575;
  --radius: 12px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { height: 100%; }
body { min-height: 100%; } /* не height: иначе закреплённая шапка уезжает на длинных страницах */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }

/* Шапка */
/* три зоны: слева отчёт и история, по центру логотип, справа корзина и служебные кнопки */
header {
  position: sticky; top: 0; z-index: 10;
  background: var(--header); color: var(--accent);
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.brand-line { cursor: pointer; border-radius: 12px; } /* логотип и название ведут на главный экран */
.brand-line:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.brand-line { display: flex; align-items: center; gap: 12px; }
.logo { height: 52px; }
.brand-name { font: italic bold 28px Georgia, serif; white-space: nowrap; letter-spacing: .5px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.toolbar-left { justify-content: flex-start; }
.toolbar .btn-icon { min-width: 42px; padding: 6px 10px; font-size: 18px; }
@media (max-width: 1280px) { .brand-name { font-size: 24px; } .logo { height: 44px; } }
@media (max-width: 760px) {
  header { grid-template-columns: 1fr; gap: 8px; position: static; } /* на телефоне шапка не закреплена — экран маленький */
  .brand { order: -1; }
  .toolbar, .toolbar-left { justify-content: center; }
  .brand-line { gap: 8px; }
  .brand-name { font-size: 22px; }
  .logo { height: 38px; }
}
.net { font-size: 12px; padding: 2px 10px; border-radius: 20px; color: #fff; white-space: nowrap; }
.net-online { background: var(--green); }
.net-sync { background: var(--blue); }
.net-queue { background: var(--orange); }
.net-offline { background: var(--red); }

main { padding: 16px; max-width: 1280px; margin: 0 auto; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }

/* Кнопки */
button {
  font: inherit; border: 0; border-radius: 10px; cursor: pointer;
  padding: 10px 16px; min-height: 44px;
  background: var(--card); color: var(--card-text); font-weight: 600;
  transition: filter .15s, transform .05s;
}
button:hover { filter: brightness(1.15); }
button:active { transform: scale(.98); }
button:disabled { opacity: .45; cursor: default; filter: none; }
.btn-green { background: var(--green); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-gray { background: var(--gray); color: #fff; }
.btn-accent { background: var(--accent); color: var(--header); }
.btn-small { min-height: 34px; padding: 6px 10px; font-size: 14px; }
.btn-big { font-size: 22px; padding: 22px 28px; min-height: 80px; letter-spacing: .5px; }
.toolbar button { min-height: 38px; padding: 6px 12px; font-size: 14px; }

/* Раскладки */
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 60vh; text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 auto; }
/* Касса — три зоны: 1) слева корзина / очередь (на всю высоту); 2) сверху заголовок и «Назад»;
   3) под ней — кнопки, категории, товары. На главном экране зоны 2 нет — кнопки поднимаются наверх. */
.home {
  display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px 20px; align-items: start;
  grid-template-areas: "side top" "side body";
  grid-template-rows: auto 1fr; /* высокая корзина растягивает только нижнюю строку — заголовок не отъезжает от товаров */
}
.home .side { grid-area: side; }
.home .top-bar { grid-area: top; }
.home .center-col { grid-area: body; }
.home .top-bar[hidden] + .center-col { grid-area: auto; grid-column: 2; grid-row: 1 / span 2; }
/* заголовок у левого края, «Назад» справа; полоса прилипает под шапкой при прокрутке товаров */
.top-bar {
  position: sticky; top: var(--header-h, 0px); z-index: 4; background: var(--bg);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid #E6DAD2;
}
.top-bar .title { margin: 0; text-align: left; }
.top-bar .back-btn { justify-self: end; }
.home .side {
  position: sticky; top: calc(var(--header-h, 0px) + 16px); max-height: calc(100vh - var(--header-h, 0px) - 32px);
  overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
}
.side-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.side-tabs button { background: #EFE6E0; color: var(--text); font-size: 15px; border-radius: 10px 10px 4px 4px; }
.side-tabs button.on { background: #2B1B17; color: #FFC107; }
.back-btn { font-size: 18px; min-height: 64px; padding: 12px 16px; border-radius: 14px; box-shadow: 0 3px 8px rgba(0,0,0,.2);
  width: 240px; max-width: 100%; } /* одинаковая ширина — кнопка не «прыгает» между экранами */
/* Экран кассы — ровно по окну: страница не прокручивается, свою прокрутку имеют только
   левая панель и поле с товарами, если не помещаются. На телефоне — обычная прокрутка страницы. */
@media (min-width: 761px) {
  body.fit { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body.fit header { flex: none; }
  body.fit main { flex: 1; min-height: 0; width: 100%; max-width: none; padding-bottom: 16px; }
  body.fit .home { height: 100%; grid-template-rows: auto minmax(0, 1fr); }
  body.fit .home .side { position: static; max-height: none; height: 100%; min-height: 0; overflow-y: auto; align-self: stretch; }
  body.fit .home .center-col { align-self: stretch; height: 100%; min-height: 0; overflow-y: auto; padding: 2px 6px 2px 2px; }
  body.fit .top-bar { position: static; }
  /* в левой панели прокручивается список (позиции корзины / заказы), заголовок и кнопки оплаты на месте */
  body.fit .home .side { overflow: hidden; }
  body.fit .side > .queue { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
  body.fit .side .panel-scroll { flex: 0 1 auto; min-height: 0; overflow-y: auto; margin-right: -6px; padding-right: 6px; }
}
/* корзина в панели */
.cart-line .head { gap: 8px; align-items: flex-start; }
.cart-line .head span { font-weight: 600; font-size: 14px; }
.cart-line .btn-small { min-height: 38px; padding: 4px 10px; font-size: 17px; }
.cart-controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; align-items: center; margin-top: 8px; }
.cart-qty { text-align: center; font-size: 18px; }
.cart-sum { font-weight: 700; color: var(--accent); white-space: nowrap; }
.cart-line .head .cart-sum { font-size: 16px; font-weight: 700; }
.cart-total { font-size: 19px; font-weight: 800; color: #fff; margin: 10px 0; text-align: right; }
.btn-pay { width: 100%; font-size: 17px; min-height: 52px; }
.btn-pay-method { font-size: 18px; min-height: 56px; min-width: 170px; }
/* комментарий к заказу — виден в очереди без раскрытия состава */
.order-note { background: #FFC107; color: #2B1B17; font-weight: 700; font-size: 14px; border-radius: 8px; padding: 4px 8px; margin: 6px 0 2px; }
.main-buttons { display: grid; gap: 16px; max-width: 600px; margin: 0 auto; width: 100%; align-self: center; padding: 24px 0; }
.main-buttons .btn-big { border-radius: 16px; box-shadow: 0 3px 8px rgba(62,39,35,.25); }
/* «ПРОДАЖА» — вдвое выше остальных, карамельная, крупный шрифт */
.main-buttons .btn-sale {
  min-height: 176px; font-size: 40px; letter-spacing: 2px; border-radius: 22px;
  background: linear-gradient(160deg, #F0C28C 0%, var(--accent) 55%, #C98A4B 100%); color: var(--header);
  box-shadow: 0 8px 22px rgba(62,39,35,.35), inset 0 -4px 0 rgba(0,0,0,.12);
}
.main-secondary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stock-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.stock-choice .btn-big { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.stock-choice .hint { font-size: 14px; font-weight: 500; opacity: .9; }
.main-secondary .btn-big { font-size: 17px; min-height: 84px; padding: 12px 10px; letter-spacing: 0; }
@media (max-width: 1180px) {
  .home { grid-template-columns: 280px minmax(0, 1fr); }
  .back-btn { padding: 10px 14px; font-size: 16px; width: 200px; }
}
@media (max-width: 760px) {
  .home { grid-template-columns: 1fr; grid-template-areas: "top" "body" "side"; grid-template-rows: none; }
  .home .top-bar[hidden] + .center-col { grid-area: body; }
  /* заголовок и «Назад» в одну строку, как на компьютере; при прокрутке полоса прилипает к верху экрана */
  .top-bar { top: 0; padding: 6px 0; }
  .top-bar .title { font-size: 22px; overflow-wrap: anywhere; }
  .home .main-buttons { padding: 0; }
  .main-buttons .btn-sale { min-height: 132px; font-size: 32px; }
  .main-secondary .btn-big { font-size: 15px; min-height: 76px; padding: 10px 6px; }
  .home .side { position: static; max-height: none; overflow: visible; }
  .top-bar .back-btn { width: auto; min-height: 48px; font-size: 15px; padding: 8px 14px; }
  .home { padding-bottom: 72px; } /* место под плавающей «⬆ Наверх» — она не закрывает последние кнопки */
}
.title { font: italic bold 26px Georgia, serif; margin: 4px 0 12px; text-align: center; }
.muted { color: var(--muted); }
.error { color: var(--red); font-weight: 600; }
.panel { background: var(--panel); border-radius: var(--radius); padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* Сетка товаров */
/* все плитки одного размера: строки равной высоты, карточка растянута на всю ячейку */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); grid-auto-rows: 1fr; gap: 12px; align-items: stretch; }
@media (max-width: 760px) { .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.card {
  background: var(--card); color: var(--card-text);
  border-radius: var(--radius); padding: 16px 12px; min-height: 104px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px; text-align: center;
}
.card .name { font-weight: 700; font-style: italic; font-size: 17px; }
.card .price { color: var(--accent); font-weight: 700; font-size: 18px; }
.card.flash { background: #2E7D32; }
/* фото товара на карточке */
.card.with-photo { padding: 0 0 16px; overflow: hidden; justify-content: flex-start; }
.card-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #2B1B17; pointer-events: none; }
.card-photo.no-photo { display: flex; align-items: center; justify-content: center; background: #2B1B17;
  color: #8D6E63; font-size: 15px; font-weight: 600; font-style: italic; }
.card.with-photo .name { padding: 0 10px; }
.card.with-photo .price { margin-top: auto; }
/* Категории — той же сеткой, что товары, плитки крупнее */
.cat-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); align-items: stretch; }
.cat-card { min-height: 130px; justify-content: center; gap: 10px; }
.cat-card .name { font-size: 21px; font-style: normal; letter-spacing: .5px; }
.cat-card .count { color: var(--accent); font-size: 14px; font-weight: 600; }
/* категория с картинкой — как карточка товара: картинка сверху, название и число позиций под ней */
.cat-card.with-photo { justify-content: flex-start; gap: 6px; }
.cat-card.with-photo .count { margin-top: auto; padding: 0 10px; }
@media (max-width: 760px) { .cat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } .cat-card { min-height: 110px; } .cat-card .name { font-size: 18px; } }

/* Очередь заказов */
.queue { background: #2B1B17; color: #eee; border-radius: var(--radius); padding: 12px; }
.queue h3 { margin: 0 0 10px; color: #FFC107; font-size: 15px; }
.queue-item { background: #3E2723; border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.queue-item .head { display: flex; justify-content: space-between; font-weight: 700; }
.queue-item .items { font-size: 13px; color: #ccc; margin: 4px 0 8px; }

/* Таблицы */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; vertical-align: middle; }
th { background: #EFE6E0; font-size: 14px; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.selected td { background: #E0F2F1; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed #eee; }
.kv b { white-space: nowrap; }

/* Формы */
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
label.row { flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: nowrap; } /* галочка слева от подписи */
label.row input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; flex: none; }
input, select, textarea {
  font: inherit; padding: 10px 12px; border: 2px solid #D7CCC8; border-radius: 10px; background: #fff; color: var(--text);
  min-height: 44px; width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice button { background: #EFE6E0; color: var(--text); font-weight: 500; }
.choice button.on { background: var(--card); color: var(--card-text); }
.counter { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.counter .val { min-width: 2ch; text-align: center; font-weight: 700; font-size: 18px; }

/* Окна */
.modal-back {
  position: fixed; inset: 0; background: rgba(20, 12, 6, .55); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: var(--bg); border-radius: 16px; width: min(640px, 100%); max-height: calc(100vh - 32px);
  overflow: auto; padding: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.modal.wide { width: min(980px, 100%); }
.modal h2 { margin: 0 0 14px; font-size: 20px; color: #4A2E2B; }
.modal .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.total { font-size: 20px; font-weight: 800; color: var(--red); }

#toast {
  position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 100;
  background: var(--green); color: #fff; font-size: 22px; font-weight: 700; padding: 22px 30px; border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,.35); text-align: center; max-width: calc(100% - 32px);
  pointer-events: none; /* уведомление не мешает нажимать кнопки под ним */
}
#toast.err { background: var(--red); }

.admin-page { max-width: 1100px; margin: 0 auto; }
/* «← Назад к кассе», название раздела и вкладки не уезжают при прокрутке — прилипают под шапкой */
.page-top, .admin-page > .admin-head {
  position: sticky; top: var(--header-h, 0px); z-index: 5;
  background: var(--bg); margin: -16px -16px 12px; padding: 12px 16px 8px;
  border-bottom: 1px solid #E6DAD2;
}
.page-top .admin-head { margin-bottom: 8px; }
.page-top .tabs { margin-bottom: 0; }
/* открытый раздел в шапке */
.toolbar button.on { box-shadow: 0 0 0 3px #fff inset; }
/* «⬆ Наверх» */
#to-top {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  border-radius: 24px; padding: 10px 18px; box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.admin-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.admin-head h2 { margin: 0; }
.admin-head .btn-sheet { margin-left: auto; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tabs button { background: #EFE6E0; color: var(--text); }
.tabs button.on { background: var(--card); color: var(--card-text); }
/* Вход по PIN, меню пользователя */
.pin-users { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pin-users .pin-user { width: 140px; }
.pin-user { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; min-height: 96px; }
.pin-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--header); font-size: 22px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 4px 0 8px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--card); }
.pin-dots span.on { background: var(--card); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 0 auto; }
.pin-key { font-size: 24px; min-height: 64px; }
.pin-key.btn-green { font-size: 17px; }
.user-menu button { width: 100%; min-height: 52px; font-size: 16px; }
.tg-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.tg-steps input { max-width: 360px; }
/* нажимаемый текст (название блюда, строка состава в «Рецептах») */
.link-btn { background: none; color: inherit; font: inherit; font-weight: inherit; min-height: 0; padding: 4px 6px; margin: -4px -6px;
  text-align: left; border-radius: 6px; }
.link-btn:hover { background: #EFE6E0; filter: none; }
.recipe-link { display: block; margin: 0 -6px; font-weight: 400; }
.recipe-link + .recipe-link { margin-top: 2px; }
/* перетаскивание товаров в «Ценах» */
.drag-cell { width: 1%; padding-right: 0; }
.drag-handle { display: inline-block; padding: 4px 8px; font-size: 20px; line-height: 1; color: var(--muted); cursor: grab;
  touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 6px; }
.drag-handle:hover { background: #EFE6E0; color: var(--text); }
tr.dragging td { background: #FFF3E0; }
tr.dragging .drag-handle { cursor: grabbing; color: var(--text); }
.price-group summary { display: flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; margin-bottom: 8px; }
.price-group summary::-webkit-details-marker { display: none; }
.price-group summary::before { content: "▾"; color: var(--muted); }
.price-group:not([open]) summary::before { content: "▸"; }
.price-group:not([open]) summary { margin-bottom: 0; }

/* Допы блюда в «Рецептах» */
.chip { display: inline-flex; align-items: center; gap: 4px; background: #EFE6E0; border-radius: 16px; padding: 4px 4px 4px 12px; font-weight: 600; font-size: 14px; }
.chip-x { min-height: 0; padding: 2px 8px; border-radius: 12px; background: transparent; color: var(--muted); font-size: 13px; }
.chip-x:hover { background: #E0CFC4; }

/* Колокольчик и уведомления */
.bell { position: relative; }
.bell-badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center;
  box-shadow: 0 0 0 2px var(--header);
}
#notify-pop { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.notify-card {
  pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; background: var(--header); color: #fff;
  border-radius: 14px; padding: 12px 12px 12px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.35);
  animation: notify-in .25s ease-out; transition: opacity .25s, transform .25s;
}
.notify-card.stock { border-left: 4px solid #FFC107; }
.notify-card.message { border-left: 4px solid var(--accent); }
.notify-card.hide { opacity: 0; transform: translateX(20px); }
@keyframes notify-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.notify-card .notify-body { flex: 1; cursor: pointer; min-width: 0; }
.notify-title { font-size: 12px; color: #FFC107; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.notify-card .notify-text { font-size: 15px; margin-top: 2px; overflow-wrap: anywhere; }
.notify-close { background: transparent; color: #ccc; min-height: 0; padding: 2px 6px; font-size: 16px; }
.notify-icon { font-size: 22px; line-height: 1.2; }
.notify-list { gap: 8px; }
.notify-item { display: flex; gap: 10px; background: var(--panel); border-radius: 12px; padding: 10px 12px; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.notify-item.new { box-shadow: 0 0 0 2px var(--accent); }
.notify-item.done { opacity: .55; }
.notify-item .notify-text { font-weight: 600; overflow-wrap: anywhere; }
.notify-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
textarea { font: inherit; padding: 10px 12px; border: 2px solid #D7CCC8; border-radius: 10px; background: #fff; color: var(--text); width: 100%; resize: vertical; }
textarea:focus { outline: none; border-color: var(--accent); }
@media (max-width: 760px) { #notify-pop { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }

/* Статистика */
.stats-filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.stats-filters input[type=date] { width: auto; min-height: 38px; padding: 6px 10px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.stat-tile { background: var(--panel); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 24px; font-weight: 800; margin-top: 2px; white-space: nowrap; }
.stat-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stats-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.chart-box { position: relative; }
.stat-chart { width: 100%; height: auto; display: block; }
.stat-chart .bar { fill: #C98A4B; }
.stat-chart .grid { stroke: #EFE6E0; stroke-width: 1; }
.stat-chart .axis { stroke: #CBB9AE; stroke-width: 1; }
.stat-chart .tick { fill: var(--muted); font-size: 12px; }
.stat-chart .hit { fill: transparent; cursor: default; }
.stat-chart .hit:hover { fill: rgba(62,39,35,.06); }
.chart-tip {
  position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  background: var(--header); color: #fff; font-size: 13px; padding: 6px 10px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
details summary { cursor: pointer; }
.photo-preview { width: 200px; max-width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #EFE6E0; }
.badge.red { background: #FFCDD2; }
.badge.green { background: #C8E6C9; }
