:root {
  --bg: #0d0d0e;
  --surface: #171719;
  --surface-2: #202023;
  --surface-3: #2a292c;
  --text: #f7f3ef;
  --muted: #a6a0a0;
  --line: rgba(255,255,255,.09);
  --accent: #f46b2b;
  --accent-2: #ff9a56;
  --cream: #f5e7d8;
  --danger: #ff5b5b;
  --success: #58d68d;
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

.bottom-nav.bottom-nav { grid-template-columns: repeat(5,minmax(0,1fr)); }
.bottom-nav.bottom-nav.has-admin { grid-template-columns: repeat(6,minmax(0,1fr)); }
#academyButton svg { flex: none; margin: 2px auto; }
.ingredient-link { border:0; padding:0; background:none; text-align:left; color:var(--accent-2); cursor:pointer; font-weight:600; }
.ingredient-link small { display:block; font-size:12px; margin-top:5px; color:var(--muted); font-weight:400; }
.recipe-reference { width:100%; display:flex; justify-content:space-between; gap:12px; padding:14px 0; text-align:left; border:0; border-bottom:1px solid var(--line); background:none; cursor:pointer; }
.recipe-reference small { color:var(--accent-2); }
.link-editor-row { display:block; margin:18px 0; }
.link-editor-row select { margin-top:8px; width:100%; }
#linksDialog { overflow-y:auto; }
#linkError { color:var(--danger); }
.photo-open { display:block; width:100%; border:0; padding:0; background:var(--surface); cursor:zoom-in; }
.photo-open span { display:block; padding:8px; color:var(--muted); font-size:12px; }
.photo-dialog { background:#080808; color:white; border:0; padding:48px 8px 8px; width:100vw; max-width:100vw; height:100dvh; max-height:100dvh; margin:0; }
.photo-dialog::backdrop { background:#000e; }
.photo-dialog img { width:100%; height:100%; object-fit:contain; }
.photo-close { position:absolute; top:max(8px,env(safe-area-inset-top)); right:12px; z-index:1; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { overscroll-behavior-y: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.catalog-results-heading { margin-top: 24px; }
.catalog-category-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 2px 20px; }
.catalog-action { min-height: 44px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 750; cursor: pointer; }
.catalog-action-primary { border-color: rgba(244,107,43,.35); color: var(--accent-2); }
.catalog-action:focus-visible, .chip:focus-visible, .nav-button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.bar-appearance-list { display: grid; gap: 10px; }
.bar-appearance-row { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.bar-settings-avatar { width: 46px; height: 46px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; border: 2px solid var(--bar-color); color: var(--bar-color); background: color-mix(in srgb, var(--bar-color) 12%, var(--surface)); font-weight: 850; }
.bar-settings-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bar-settings-copy strong { display: block; margin-bottom: 9px; }
.bar-settings-copy label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.bar-settings-copy input { width: 76px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--surface-2); }
.metro-colors { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.metro-colors button { width: 22px; height: 22px; padding: 0; border: 2px solid transparent; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.metro-colors button.selected { border-color: white; box-shadow: 0 0 0 2px var(--swatch); }
.bar-photo-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.file-button { position: relative; overflow: hidden; cursor: pointer; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.bar-photo-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.schedule-people-list { display: grid; gap: 8px; }
.schedule-person-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.schedule-person-row label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; }
.schedule-person-row input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--surface-2); }
.schedule-person-meta { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.schedule-person-actions { display: flex; gap: 6px; }
.person-colors { margin-top: 12px; }
.person-color-default { background: var(--surface-3) !important; color: var(--muted); font-size: 15px; line-height: 1; }
@media (max-width: 560px) { .schedule-person-row { grid-template-columns: 1fr; } .schedule-person-actions button { flex: 1; } }
.settings-launchers { margin-top: 20px; }
.settings-tile { min-height: 112px; }
.settings-dialog .dialog-header { display: grid; grid-template-columns: 40px 1fr 40px; gap: 10px; text-align: center; }
.settings-dialog .dialog-header h2 { margin: 3px 0 0; font-size: 17px; }
.settings-dialog-scroll { height: calc(100% - 72px); overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px calc(42px + var(--safe-bottom)); }
.settings-dialog-scroll > .field-help { margin: 0 0 16px; line-height: 1.45; }
@media (max-width: 560px) { .bar-appearance-row { grid-template-columns: 42px minmax(0,1fr); } .bar-appearance-row > [data-save-bar] { grid-column: 1 / -1; width: 100%; } }
.shift-time-settings { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.shift-time-settings > strong { display: block; margin-bottom: 10px; font-size: 12px; }
.shift-time-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.shift-time-grid label { display: grid; align-items: stretch; gap: 5px; font-size: 11px; }
.shift-time-grid input { width: 100%; min-width: 0; padding: 10px; font-size: 13px; }
.schedule-person-actions { flex-wrap: wrap; justify-content: flex-end; }
.schedule-person-actions .danger-text { width: 100%; text-align: right; color: #ff9b86; }
.schedule-archived { margin-top: 24px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.schedule-archived h3 { margin: 0 0 12px; font-size: 14px; }
.schedule-archived-person { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .schedule-person-actions .danger-text { text-align: center; } }

.app-shell { min-height: 100vh; max-width: 760px; margin: 0 auto; background: var(--bg); }
.topbar {
  height: 76px; padding: max(12px, env(safe-area-inset-top)) 18px 10px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, rgba(13,13,14,.98), rgba(13,13,14,.82), transparent);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo-frame { width: 108px; height: 42px; overflow: visible; background: transparent; }
.brand-logo { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 5px 13px rgba(0,0,0,.35)); }
.profile-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; cursor: pointer; }

.main-content { padding: 4px 16px calc(96px + var(--safe-bottom)); }
.view { display: none; animation: view-in .22s ease both; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }

.section-kicker { color: var(--accent-2); font-size: 10px; font-weight: 850; letter-spacing: .18em; }

.search-wrap { margin: 18px 0 22px; height: 54px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; padding: 0 14px; gap: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.15); }
.search-wrap:focus-within { border-color: rgba(244,107,43,.65); box-shadow: 0 0 0 4px rgba(244,107,43,.08); }
.search-icon { color: var(--accent-2); font-size: 26px; line-height: 1; transform: rotate(-15deg); }
.search-input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 15px; }
.search-input::placeholder { color: #777276; }
.search-clear { flex: 0 0 40px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface-3); font-size: 20px; cursor: pointer; }
.sticky-search { position: sticky; top: 72px; z-index: 12; margin-top: 14px; }

.section-block { margin: 28px 0; }
.section-heading, .page-title-row { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
h1, h2 { margin: 0; }
.section-heading h2 { margin-top: 4px; font-size: 23px; font-weight: 760; }
.page-title-row { align-items: center; margin: 12px 2px 4px; }
.page-title-row h1 { margin-top: 4px; font-family: Georgia, serif; font-size: 34px; font-weight: 500; }
.text-button { border: 0; background: transparent; color: var(--accent-2); font-weight: 700; cursor: pointer; }
.count-badge, .admin-badge { border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; color: var(--muted); background: var(--surface); font-size: 12px; font-weight: 800; }
.admin-badge { color: #18100a; background: var(--accent-2); border: 0; }

.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.category-card { min-height: 112px; border: 1px solid var(--line); border-radius: 21px; background: linear-gradient(145deg, var(--surface-2), var(--surface)); padding: 16px; text-align: left; cursor: pointer; position: relative; overflow: hidden; }
.category-card::after { content: ""; position: absolute; width: 80px; height: 80px; right: -22px; bottom: -32px; border-radius: 50%; background: radial-gradient(circle, rgba(244,107,43,.22), transparent 67%); }
.category-number { display: block; color: var(--accent-2); font-family: Georgia, serif; font-size: 28px; }
.category-card strong { display: block; margin-top: 14px; font-size: 15px; }
.category-card small { display: block; color: var(--muted); margin-top: 3px; }
.skeleton-grid::before, .skeleton-grid::after { content: ""; height: 112px; border-radius: 21px; background: linear-gradient(100deg, var(--surface) 25%, var(--surface-2) 45%, var(--surface) 65%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position-x: -200%; } }

.horizontal-list { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.horizontal-list::-webkit-scrollbar { display: none; }
.mini-card { flex: 0 0 195px; min-height: 120px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); padding: 15px; text-align: left; cursor: pointer; }
.mini-card .mini-cat { color: var(--accent-2); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; }
.mini-card strong { display: block; margin-top: 13px; font-size: 17px; line-height: 1.15; }
.mini-card small { color: var(--muted); display: block; margin-top: 8px; }

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 1px 0 13px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 9px 13px; font-size: 12px; color: var(--muted); cursor: pointer; }
.chip.active { color: #1b1009; background: var(--accent-2); border-color: transparent; font-weight: 800; }
.cards-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.tech-card { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; width: 100%; min-height: 92px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); padding: 15px 16px; text-align: left; cursor: pointer; }
.tech-card:active, .category-card:active, .mini-card:active { transform: scale(.985); }
.card-category { color: var(--accent-2); font-size: 10px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.tech-card strong { display: block; margin: 6px 0 5px; min-width: 0; overflow-wrap: anywhere; font-size: 17px; line-height: 1.18; }
.card-meta { color: var(--muted); display: -webkit-box; min-width: 0; max-width: 100%; overflow: hidden; overflow-wrap: anywhere; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 12px; line-height: 1.35; }
.card-arrow { width: 37px; height: 37px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--accent-2); font-size: 24px; }
.empty-state { text-align: center; color: var(--muted); padding: 60px 20px; border: 1px dashed var(--line); border-radius: 22px; }
.empty-state span { display: block; font-size: 36px; margin-bottom: 10px; color: var(--accent-2); }

.bottom-nav { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: 0; width: min(760px,100%); display: grid; grid-template-columns: repeat(4,1fr); background: rgba(20,20,22,.94); backdrop-filter: blur(22px); border-top: 1px solid var(--line); padding: 8px 10px calc(8px + var(--safe-bottom)); }
.nav-button { min-height: 48px; border: 0; background: transparent; color: #7f7b7e; display: grid; justify-items: center; gap: 2px; cursor: pointer; }
.nav-button span { font-size: 22px; line-height: 1; height: 27px; }
.nav-button small { font-size: 10px; font-weight: 700; }
.nav-button.active { color: var(--accent-2); }

.primary-action-card { width: 100%; border: 0; border-radius: 24px; padding: 18px; background: linear-gradient(135deg, #ff8a42, #d84c1e); color: #190c07; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; text-align: left; margin: 20px 0 12px; cursor: pointer; }
.action-icon { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.24); font-size: 28px; }
.primary-action-card strong, .primary-action-card small { display: block; }
.primary-action-card strong { font-size: 17px; }
.primary-action-card small { opacity: .72; margin-top: 3px; }
.chevron { font-size: 30px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.restore-tile { grid-column: 1 / -1; min-height: 112px; border-color: rgba(244,107,43,.28); }
.admin-tile { min-height: 140px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); padding: 16px; text-align: left; cursor: pointer; }
.tile-icon { width: 42px; height: 42px; border-radius: 15px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent-2); font-size: 23px; margin-bottom: 17px; }
.admin-tile strong, .admin-tile small { display: block; }
.admin-tile small { color: var(--muted); margin-top: 5px; }
.info-card { margin-top: 14px; border-radius: 20px; padding: 17px; background: var(--surface); border: 1px solid var(--line); }
.info-card p { color: var(--muted); line-height: 1.5; margin: 7px 0 0; font-size: 13px; }
.warning-card { border-color: rgba(244,107,43,.22); }

.sheet-dialog, .small-dialog { color: var(--text); border: 0; padding: 0; background: var(--surface); box-shadow: 0 -20px 70px rgba(0,0,0,.55); }
.sheet-dialog { width: min(760px,100%); max-width: none; height: min(91vh,900px); margin: auto auto 0; border-radius: 30px 30px 0 0; overflow: hidden; }
.sheet-dialog::backdrop, .small-dialog::backdrop { background: rgba(0,0,0,.67); backdrop-filter: blur(4px); }
.sheet-dialog[open] { animation: sheet-up .25s ease both; }
@keyframes sheet-up { from { transform: translateY(30px); opacity: .4; } }
.sheet-handle { width: 44px; height: 5px; background: #5a565a; border-radius: 99px; margin: 9px auto 1px; }
.dialog-header { min-height: 58px; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-actions { display: flex; gap: 8px; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 22px; cursor: pointer; }
.card-detail { height: calc(100% - 72px); overflow-y: auto; padding: 20px 18px calc(35px + var(--safe-bottom)); }
.detail-category { color: var(--accent-2); font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.card-detail h1 { font-family: Georgia, serif; font-size: clamp(34px,9vw,54px); font-weight: 500; line-height: 1; margin: 9px 0 10px; }
.detail-section { color: var(--muted); font-size: 13px; }
.variant-picker { display: grid; gap: 7px; max-width: 220px; margin: 18px 0 4px; color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.variant-picker select { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--text); }
.superjuice-card{grid-column:1/-1;max-width:680px;padding:26px;border:1px solid var(--line);border-radius:24px;background:var(--surface)}.superjuice-card h2{margin:10px 0;font:500 34px Georgia,serif}.superjuice-card p,.superjuice-card>small{color:var(--muted);line-height:1.55}.superjuice-card label{display:grid;gap:8px;max-width:280px;margin:20px 0;color:var(--muted);font-size:12px;font-weight:700}.superjuice-card input{font-size:22px}.superjuice-tabs{display:flex;gap:8px;margin-top:18px}.superjuice-tabs button{padding:10px 16px;border:1px solid var(--line);border-radius:999px;background:var(--surface-2);color:var(--muted)}.superjuice-tabs button.active{background:var(--accent);color:white}.superjuice-result{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:20px 0}.superjuice-result div{padding:16px;border-radius:16px;background:var(--surface-2)}.superjuice-result b,.superjuice-result span{display:block}.superjuice-result b{font-size:24px;color:var(--accent-2)}.superjuice-result span{margin-top:4px;color:var(--muted);font-size:11px}.superjuice-card details{margin:20px 0;line-height:1.65}.superjuice-card summary{cursor:pointer;color:var(--accent-2);font-weight:700}@media(max-width:560px){.superjuice-result{grid-template-columns:1fr}.superjuice-card{padding:20px}}
.ingredient-list { list-style: none; padding: 0; margin: 25px 0; border-top: 1px solid var(--line); }
.ingredient-list li { padding: 13px 1px; border-bottom: 1px solid var(--line); line-height: 1.35; }
.detail-block { margin: 17px 0; border-radius: 18px; background: var(--surface-2); padding: 15px; }
.detail-block h3 { color: var(--accent-2); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; margin: 0 0 8px; }
.detail-block p { white-space: pre-wrap; margin: 0; line-height: 1.52; font-size: 14px; }

.editor-dialog { height: min(91vh,900px); height: min(91dvh,900px); }
.editor-dialog[open] { display: flex; flex-direction: column; }
.editor-dialog > .sheet-handle { flex-shrink: 0; }
.editor-dialog > form { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.editor-dialog .editor-header { flex-shrink: 0; }
.editor-dialog .form-scroll { flex: 1; min-height: 0; height: auto; overflow-y: auto; overscroll-behavior-y: contain; }
.editor-alias-notice { margin: 0 0 20px; padding: 13px 15px; border: 1px solid rgba(244,107,43,.3); border-radius: 14px; background: rgba(244,107,43,.08); color: var(--text); font-size: 12px; line-height: 1.5; }
.editor-header h2 { font-size: 17px; }
.save-button { border: 0; color: #1a0e07; background: var(--accent-2); border-radius: 12px; padding: 9px 12px; font-weight: 800; cursor: pointer; }
.form-scroll { height: calc(100% - 70px); overflow-y: auto; padding: 18px 16px calc(45px + var(--safe-bottom)); }
.field-label { display: block; color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 15px; }
.field-input { width: 100%; margin-top: 7px; border: 1px solid var(--line); outline: 0; border-radius: 15px; background: #101012; color: var(--text); padding: 13px 14px; font-size: 15px; }
.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(244,107,43,.09); }
.textarea { resize: vertical; min-height: 78px; line-height: 1.45; }
.field-help { display: block; margin-top: 6px; font-weight: 400; color: #706c70; }
.danger-zone { display: grid; gap: 9px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.secondary-button, .danger-button { width: 100%; border-radius: 15px; padding: 13px 16px; cursor: pointer; font-weight: 750; }
.secondary-button { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); margin-top: 14px; }
.danger-button { border: 1px solid rgba(255,91,91,.3); background: rgba(255,91,91,.08); color: var(--danger); }

.small-dialog { width: min(360px, calc(100% - 32px)); border-radius: 26px; margin: auto; }
.category-dialog-body { position: relative; padding: 26px 22px 22px; }
.category-dialog-body h2 { margin: 8px 42px 8px 0; font-family: Georgia, serif; font-size: 26px; font-weight: 500; }
.category-dialog-body p { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.category-dialog-body .field-label { margin-bottom: 0; }
.category-dialog-body .dialog-main-button { margin-top: 20px; }
.profile-card { padding: 24px; text-align: center; position: relative; }
.dialog-close { position: absolute; right: 13px; top: 13px; }
.profile-avatar { width: 70px; height: 70px; margin: 10px auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--cream); color: #241116; font-family: Georgia, serif; font-size: 34px; }
.profile-card h2 { font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.profile-card p { color: var(--accent-2); margin: 7px 0; }
.dev-notice { margin-top: 16px; padding: 9px; border-radius: 12px; background: rgba(244,107,43,.1); color: var(--accent-2); font-size: 12px; }

.global-loader { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; transition: opacity .22s; }
.global-loader.hidden { opacity: 0; pointer-events: none; display: grid !important; }
.global-loader span { width: 38px; height: 38px; border: 3px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; z-index: 120; left: 50%; bottom: calc(86px + var(--safe-bottom)); transform: translate(-50%,20px); width: min(420px,calc(100% - 32px)); padding: 13px 16px; border-radius: 15px; background: #f6eee7; color: #261710; font-size: 13px; font-weight: 650; opacity: 0; pointer-events: none; transition: .22s; box-shadow: 0 12px 35px rgba(0,0,0,.35); }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.toast.error { background: #ffdddd; color: #5b1717; }

@media (min-width: 600px) {
  .main-content { padding-left: 24px; padding-right: 24px; }
  .category-grid { grid-template-columns: repeat(3,1fr); }
  .cards-grid { grid-template-columns: repeat(2,1fr); }
  .card-meta { max-width: 100%; }
}
.bottom-nav { grid-template-columns: repeat(4,1fr); }
.bottom-nav.has-admin { grid-template-columns: repeat(5,1fr); }

/* Совместная инвентаризация */
.inventory-title-row { align-items: flex-start; }
.inventory-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 17px 0; padding: 4px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.inventory-tabs button { min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; }
.inventory-tabs button.active { background: var(--surface-3); color: var(--accent-2); box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.live-badge { border: 1px solid var(--line); border-radius: 999px; padding: 8px 10px; color: var(--muted); background: var(--surface); font-size: 10px; font-weight: 850; white-space: nowrap; }
.live-badge.active { color: #8be0a5; border-color: rgba(85,207,125,.28); background: rgba(85,207,125,.09); }
.inventory-empty { margin: 28px 0; padding: 38px 22px; text-align: center; border: 1px dashed var(--line); border-radius: 24px; background: var(--surface); }
.inventory-empty-icon { width: 54px; height: 54px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 18px; color: #21130b; background: var(--accent-2); font-size: 28px; }
.inventory-empty h2 { margin: 0; font-size: 20px; }
.inventory-empty p { margin: 9px auto 0; color: var(--muted); max-width: 390px; line-height: 1.45; font-size: 13px; }
.inventory-session-card { margin: 18px 0 12px; padding: 17px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border: 1px solid rgba(244,107,43,.22); border-radius: 22px; background: linear-gradient(145deg, rgba(244,107,43,.11), var(--surface)); }
.inventory-session-picker { display: block; margin: 18px 0 10px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.inventory-session-picker select { width: 100%; height: 48px; margin-top: 7px; padding: 0 13px; border: 1px solid var(--line); border-radius: 15px; outline: 0; background: var(--surface); color: var(--text); font-size: 15px; font-weight: 750; }
.inventory-session-picker + .inventory-session-card { margin-top: 10px; }
.inventory-session-card small, .inventory-session-card strong, .inventory-session-card span { display: block; }
.inventory-session-card small { color: var(--accent-2); font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.inventory-session-card strong { margin-top: 6px; font-size: 19px; }
.inventory-session-card span { color: var(--muted); margin-top: 4px; font-size: 11px; }
.round-refresh { flex: 0 0 42px; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); color: var(--accent-2); font-size: 22px; cursor: pointer; }
.inventory-zones { padding-top: 3px; }
.inventory-zones .chip b { margin-left: 5px; font-size: 10px; opacity: .75; }
.inventory-progress-card { margin-bottom: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.inventory-progress-copy { display: flex; align-items: baseline; gap: 7px; }
.inventory-progress-copy strong { font-size: 17px; }
.inventory-progress-copy span { color: var(--muted); font-size: 11px; }
.inventory-progress-track { height: 5px; overflow: hidden; margin-top: 10px; border-radius: 999px; background: var(--surface-3); }
.inventory-progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.inventory-search-wrap { position: sticky; top: 71px; z-index: 11; margin: 19px 0 22px; }
.inventory-items { display: grid; gap: 10px; }
.inventory-item { padding: 15px; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); transition: border-color .2s; }
.inventory-item.counted { border-color: rgba(85,207,125,.25); }
.inventory-item header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.inventory-item header small, .inventory-item header strong { display: block; }
.inventory-item header small { color: var(--accent-2); font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.inventory-item header strong { margin-top: 5px; font-size: 18px; }
.inventory-total { color: #8be0a5; font-family: Georgia, serif; font-size: 19px; white-space: nowrap; }
.inventory-controls { display: grid; grid-template-columns: .8fr 1.15fr .9fr; gap: 8px; margin-top: 14px; }
.inventory-controls label { color: var(--muted); font-size: 10px; font-weight: 700; }
.inventory-controls select, .inventory-controls input { width: 100%; height: 42px; margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; outline: 0; background: #101012; color: var(--text); padding: 0 8px; font-size: 14px; }
.stepper { display: grid; grid-template-columns: 36px minmax(38px,1fr) 36px; margin-top: 6px; }
.stepper input { margin: 0; border-radius: 0; padding: 0 3px; text-align: center; appearance: textfield; }
.stepper button { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 19px; cursor: pointer; }
.stepper button:first-child { border-radius: 12px 0 0 12px; }
.stepper button:last-child { border-radius: 0 12px 12px 0; }
.inventory-quarters { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.inventory-quarters > span:first-child { color: var(--muted); font-size: 10px; }
.inventory-quarters button { border: 1px solid var(--line); border-radius: 999px; padding: 6px 9px; background: var(--surface-2); color: var(--text); font-size: 10px; cursor: pointer; }
.inventory-saved { margin-left: auto; color: var(--muted); font-size: 10px; }
.inventory-item.counted .inventory-saved { color: #8be0a5; }
.inventory-admin { margin: 30px 0 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.inventory-admin-actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.inventory-action { min-height: 120px; padding: 13px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.inventory-action > span { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; border-radius: 12px; color: var(--accent-2); background: var(--surface-3); font-size: 20px; }
.inventory-action strong, .inventory-action small { display: block; }
.inventory-action strong { font-size: 13px; }
.inventory-action small { color: var(--muted); margin-top: 4px; font-size: 9px; line-height: 1.3; }
.inventory-action.primary { border-color: rgba(244,107,43,.3); background: rgba(244,107,43,.08); }
.inventory-session-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.inventory-session-actions .secondary-button { margin: 0; }
.inventory-dialog-body { position: relative; padding: 27px 22px 22px; }
.inventory-dialog-body h2 { margin: 6px 0 23px; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.dialog-main-button { width: 100%; padding: 13px; margin-top: 6px; }
.archive-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 25px 2px 16px; }
.archive-heading h2 { margin-top: 5px; font-size: 22px; }
.inventory-archive-list { display: grid; gap: 16px; }
.archive-restaurant { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.archive-restaurant > header { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 11px; padding: 14px; background: linear-gradient(135deg, rgba(244,107,43,.1), transparent); border-bottom: 1px solid var(--line); }
.archive-restaurant-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--accent-2); color: #201008; font-family: Georgia, serif; font-size: 23px; }
.archive-restaurant header span { display: block; color: var(--accent-2); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.archive-restaurant header h3 { margin: 4px 0 0; font-size: 17px; }
.archive-restaurant header > b { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--muted); font-size: 11px; }
.archive-session-list { display: grid; }
.archive-session-card { display: grid; grid-template-columns: 1.15fr .8fr auto; align-items: center; gap: 10px; min-height: 72px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.archive-session-card:last-child { border-bottom: 0; }
.archive-date strong, .archive-date span, .archive-result strong, .archive-result span { display: block; }
.archive-date strong { font-size: 13px; }
.archive-date span, .archive-result span { color: var(--muted); margin-top: 4px; font-size: 9px; }
.archive-result strong { color: #8be0a5; font-family: Georgia, serif; font-size: 16px; }
.archive-actions { display: flex; gap: 5px; }
.archive-actions button { min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 10px; font-weight: 750; cursor: pointer; }
.archive-actions .archive-delete { color: var(--danger); border-color: rgba(255,91,91,.22); }

@media (max-width: 430px) {
  .inventory-controls { grid-template-columns: .85fr 1.15fr; }
  .inventory-controls > label:last-child { grid-column: 1 / -1; }
  .inventory-admin-actions { grid-template-columns: 1fr 1fr; }
  .inventory-admin-actions .inventory-action:first-child { grid-column: 1 / -1; min-height: 95px; }
  .inventory-session-actions { grid-template-columns: 1fr; }
  .archive-session-card { grid-template-columns: 1fr auto; }
  .archive-result { grid-row: 2; }
  .archive-actions { grid-row: 1 / 3; grid-column: 2; }
}

/* Version 2.1: bar mode, structured ingredients and photos */
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.bar-mode-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--accent-2); font-size: 14px; font-weight: 900; cursor: pointer; }
.bar-mode-button.active { background: var(--accent-2); color: #1b1009; border-color: transparent; }

.mini-card { position: relative; overflow: hidden; display: flex; align-items: flex-end; }
.mini-card.has-photo { padding: 0; min-height: 155px; }
.mini-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini-card.has-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 10%, rgba(8,8,9,.92) 95%); }
.mini-card-copy { position: relative; z-index: 1; display: block; width: 100%; }
.mini-card.has-photo .mini-card-copy { padding: 15px; }

.tech-card { grid-template-columns: 58px minmax(0,1fr) auto; padding: 12px; }
.tech-card-photo, .tech-card-placeholder { width: 58px; height: 66px; border-radius: 15px; }
.tech-card-photo { object-fit: cover; background: var(--surface-2); }
.tech-card-placeholder { display: grid; place-items: center; background: linear-gradient(145deg, var(--surface-3), var(--surface-2)); color: var(--accent-2); font-family: Georgia, serif; font-size: 24px; }
.tech-card-copy { min-width: 0; }
.skeleton-card { min-height: 92px; grid-template-columns: 1fr; background: linear-gradient(100deg,var(--surface) 25%,var(--surface-2) 45%,var(--surface) 65%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }

.admin-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 18px 0 0; }
.admin-stats article { min-height: 92px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 14px 12px; }
.admin-stats strong { display: block; color: var(--accent-2); font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.admin-stats small { display: block; color: var(--muted); margin-top: 5px; line-height: 1.2; }
.admin-manage { margin-top: 24px; }
.compact-heading { margin-bottom: 0; }
.admin-search-results { display: grid; gap: 8px; }
.small-empty { padding: 25px 16px; }
.small-empty span { font-size: 25px; }

.detail-photo-wrap { margin: -4px -2px 22px; height: min(44vh,390px); border-radius: 24px; overflow: hidden; background: var(--surface-2); }
.detail-photo { width: 100%; height: 100%; object-fit: cover; }
.ingredient-list li { display: grid; grid-template-columns: 30px 1fr; gap: 9px; align-items: start; }
.ingredient-list li > span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--accent-2); font-size: 11px; font-weight: 850; }
.ingredient-list li > strong { font-weight: 600; padding-top: 3px; }

.photo-editor { margin: 0 0 20px; }
.photo-preview { height: 205px; border-radius: 21px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview.empty-photo { border-style: dashed; color: var(--muted); }
.photo-preview.empty-photo span::before { content: "◫"; display: block; text-align: center; color: var(--accent-2); font-size: 34px; margin-bottom: 7px; }
.photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.compact-button { margin-top: 9px; padding: 11px 12px; font-size: 13px; }

.ingredients-editor { margin-bottom: 18px; }
.ingredients-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.inline-add-button { border: 0; border-radius: 11px; padding: 8px 10px; background: rgba(244,107,43,.12); color: var(--accent-2); font-size: 12px; font-weight: 800; cursor: pointer; }
.ingredient-rows { display: grid; gap: 8px; }
.ingredient-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 7px; align-items: center; padding: 7px; border: 1px solid var(--line); border-radius: 15px; background: #101012; transition: opacity .15s, border-color .15s, transform .15s; }
.ingredient-row.dragging { opacity: .55; border-color: var(--accent); transform: scale(.99); }
.drag-handle { height: 42px; border: 0; background: transparent; color: #777276; font-size: 18px; cursor: grab; touch-action: none; }
.drag-handle:active { cursor: grabbing; }
.ingredient-input { min-width: 0; width: 100%; height: 42px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.ingredient-row-actions { display: flex; gap: 3px; }
.ingredient-row-actions button { width: 30px; height: 34px; border: 0; border-radius: 9px; background: var(--surface-2); color: var(--muted); cursor: pointer; }
.ingredient-row-actions .remove-ingredient { color: var(--danger); }

.profile-setting { width: 100%; margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-2); display: flex; justify-content: space-between; align-items: center; text-align: left; cursor: pointer; }
.profile-setting strong, .profile-setting small { display: block; }
.profile-setting small { color: var(--muted); margin-top: 3px; }
.setting-state { color: var(--muted); font-size: 12px; font-weight: 850; }
.setting-state.active { color: var(--accent-2); }

/* Kрупный режим для быстрой работы за баром */
body.bar-mode .main-content { padding-left: 10px; padding-right: 10px; }
body.bar-mode .category-card { min-height: 135px; }
body.bar-mode .category-card strong { font-size: 18px; }
body.bar-mode .search-wrap { height: 64px; }
body.bar-mode .search-input { font-size: 18px; }
body.bar-mode .tech-card { min-height: 116px; grid-template-columns: 72px minmax(0,1fr) 46px; }
body.bar-mode .tech-card-photo, body.bar-mode .tech-card-placeholder { width: 72px; height: 86px; }
body.bar-mode .tech-card strong { font-size: 21px; }
body.bar-mode .card-category { font-size: 11px; }
body.bar-mode .card-meta { font-size: 14px; }
body.bar-mode .card-arrow { width: 44px; height: 44px; }
body.bar-mode .card-detail { padding-left: 15px; padding-right: 15px; }
body.bar-mode .card-detail h1 { font-size: clamp(46px,12vw,72px); }
body.bar-mode .detail-category { font-size: 13px; }
body.bar-mode .detail-section { font-size: 17px; }
body.bar-mode .ingredient-list li { padding: 18px 2px; grid-template-columns: 38px 1fr; gap: 12px; }
body.bar-mode .ingredient-list li > span { width: 34px; height: 34px; font-size: 14px; }
body.bar-mode .ingredient-list li > strong { font-size: 21px; line-height: 1.28; }
body.bar-mode .detail-block { padding: 19px; }
body.bar-mode .detail-block h3 { font-size: 12px; }
body.bar-mode .detail-block p { font-size: 19px; line-height: 1.52; }
body.bar-mode .icon-button { width: 48px; height: 48px; font-size: 25px; }
body.bar-mode .dialog-header { min-height: 68px; }

@media (max-width: 430px) {
  .ingredient-row { grid-template-columns: 27px minmax(0,1fr); }
  .ingredient-row-actions { grid-column: 2; justify-content: flex-end; margin-top: -3px; }
  .ingredient-row-actions button { width: 38px; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-stats article:last-child { grid-column: 1 / -1; }
}

.academy-button img {width:38px;height:38px;object-fit:contain}.academy-button {padding:0!important}
#academyPanel:not([hidden]){position:fixed;inset:0;z-index:10000;display:block;background:#0d0d0e}
body.academy-open{overflow:hidden}
#academyBack{position:absolute;z-index:2;top:max(10px,env(safe-area-inset-top));left:12px;margin:0;padding:10px 15px;background:rgba(25,25,27,.92);backdrop-filter:blur(14px);color:white;border:1px solid rgba(255,255,255,.12);border-radius:999px;font:700 13px/1.2 inherit;cursor:pointer;box-shadow:0 8px 24px #0005}
.telegram-academy #academyBack{display:none}
#academyFrame{display:block;width:100%;height:100%;border:0;background:#0d0d0e}
@media (max-width: 360px) {
  .bottom-nav { padding-left: 2px; padding-right: 2px; }
  .nav-button { min-width: 0; padding: 0; grid-template-columns: minmax(0, 1fr); }
  .nav-button small { width: 100%; max-width: 100%; overflow: hidden; white-space: nowrap; font-size: 8px; letter-spacing: -.03em; text-align: center; }
}
