/* Shared monochrome palette from the paper and TV menus. */
:root {
  color-scheme: light;
  --bg: #fff;
  --surface: #fff;
  --surface-soft: #f5f5f5;
  --surface-hover: #ebebeb;
  --ink: #181818;
  --ink-soft: #444;
  --ink-muted: #595959;
  --accent: #181818;
  --on-accent: #fff;
  --border: #c9c9c9;
  --overlay: rgba(0, 0, 0, 0.38);
  --badge-ink: #873333;
  --badge-bg: #fff2f2;
  --status-open: #397044;
  --status-closed: #99443b;
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.05);
  --shadow-md: none;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141414;
  --surface: #1e1e1e;
  --surface-soft: #272727;
  --surface-hover: #333;
  --ink: #f5f5f5;
  --ink-soft: #dedede;
  --ink-muted: #b8b8b8;
  --accent: #f5f5f5;
  --on-accent: #181818;
  --border: #525252;
  --overlay: rgba(0, 0, 0, 0.65);
  --badge-ink: #ffb7b7;
  --badge-bg: #3b2525;
  --status-open: #93c99c;
  --status-closed: #eba89e;
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Montserrat, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

body {
  position: relative;
  overflow-x: hidden;
}

.page {
  position: relative;
  z-index: 2;
  max-width: 1220px;
  margin: 0 auto;
  padding: 26px 18px 42px;
  display: grid;
  gap: 16px;
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.page.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.glass-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
}

.topbar {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
}

.brand-kicker {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.brand-title {
  margin: 6px 0 0;
  font-family: Montserrat, sans-serif;
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  line-height: 1;
  font-weight: 700;
}

.topbar-meta {
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.status-btn {
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.status-btn:hover {
  transform: translateY(-1px);
  background: var(--surface-hover);
}

.status-caret {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink-muted);
  transform: translateY(1px);
  transition: transform 0.2s ease, color 0.2s ease;
}

.status-btn[aria-expanded="true"] .status-caret {
  transform: translateY(1px) rotate(180deg);
  color: var(--ink-soft);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-open);
  box-shadow: none;
}

.status-dot.is-closed {
  background: var(--status-closed);
  box-shadow: none;
}

.hours-overlay {
  position: fixed;
  inset: 0;
  z-index: 11;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.hours-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(420px, calc(100vw - 24px));
  z-index: 12;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.hours-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.hours-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.hours-popover-head h4 {
  margin: 0;
  font-family: Montserrat, sans-serif;
  font-size: 0.95rem;
}

.hours-list {
  display: grid;
  gap: 7px;
}

.hours-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  padding: 5px 7px;
  border-radius: 10px;
}

.hours-row.is-today {
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 700;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.65fr 0.75fr;
  gap: 16px;
}

.menu-section,
.info-section {
  padding: 16px;
}

.info-section {
  align-self: start;
}

.info-section h3 {
  margin: 0;
  font-size: 1.08rem;
  font-family: Montserrat, sans-serif;
}

.cafe-photo-card {
  margin: 12px 0 0;
  border-radius: 14px;
  overflow: hidden;
  height: 190px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  position: relative;
}

.cafe-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.info-section p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.info-hint {
  color: var(--ink-muted);
}

.review-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
  padding: 10px 14px;
  font-size: 0.8rem;
  text-decoration: none;
}

.menu-header h3 {
  margin: 0;
  font-family: Montserrat, sans-serif;
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  line-height: 1;
}

.menu-header p {
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.menu-group-tabs {
  display: inline-flex;
  gap: 8px;
  margin-top: 12px;
}

.group-tab-btn {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.group-tab-btn.active {
  color: var(--on-accent);
  background: var(--accent);
  border-color: transparent;
}

.menu-tabs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.menu-tabs-shell {
  position: relative;
}

.menu-tabs-shell::after {
  content: "";
  position: absolute;
  right: 0;
  top: 10px;
  bottom: 2px;
  width: 34px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
  background: linear-gradient(90deg, transparent, var(--surface));
}

.menu-tabs-shell.can-scroll-right::after {
  opacity: 1;
}

.tabs-scroll-hint {
  position: static;
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--ink-muted);
  opacity: 0;
  transform: translateY(-2px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  white-space: nowrap;
}

.tabs-scroll-hint.visible {
  opacity: 0.92;
  transform: translateY(0);
}

.tab-btn {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  transform: translateY(-1px);
}

.tab-btn.active {
  color: var(--on-accent);
  background: var(--accent);
  border-color: transparent;
}

.menu-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.menu-item {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 12px;
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 10px;
}

.item-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.item-name {
  margin: 0;
  font-size: 0.98rem;
}

.item-badge {
  flex: 0 0 auto;
  margin-top: -2px;
  border: 1px solid var(--badge-ink);
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-ink);
  padding: 2px 6px;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
}

.item-description {
  margin: 6px 0 0;
  min-height: 1.2em;
  font-size: 0.86rem;
  color: var(--ink-muted);
  line-height: 1.4;
}

.item-weight {
  margin: 6px 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.item-variants {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.item-variants li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  padding: 6px 10px;
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.item-variants strong {
  color: var(--ink);
}

.btn {
  border: 0;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  color: var(--on-accent);
  background: var(--accent);
  box-shadow: var(--shadow-md);
  font-weight: 700;
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink-soft);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  isolation: isolate;
  background: var(--bg);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.welcome-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.welcome-card {
  width: min(860px, 100%);
  padding: clamp(28px, 5vw, 52px);
  text-align: center;
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: var(--radius-xl);
  animation: cardEntry 1s ease both;
}

.welcome-card > * {
  position: relative;
  z-index: 1;
}

.welcome-eyebrow {
  margin: 0;
  color: var(--ink-soft);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.welcome-card h1 {
  margin: 8px 0 10px;
  font-family: Montserrat, sans-serif;
  font-size: clamp(2.7rem, 9vw, 4.8rem);
  line-height: 0.95;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.055em;
}

.welcome-text {
  margin: 0 auto;
  max-width: 560px;
  color: var(--ink-soft);
  line-height: 1.55;
  position: relative;
}

.welcome-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.welcome-action {
  appearance: none;
  min-width: 0;
  min-height: 138px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-soft);
  box-shadow: none;
  color: var(--ink);
  padding: 18px 12px 15px;
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
  animation: welcomeActionEntry 0.55s ease both;
}

.welcome-action:nth-child(2) {
  animation-delay: 0.08s;
}

.welcome-action:nth-child(3) {
  animation-delay: 0.16s;
}

.welcome-action:nth-child(4) {
  animation-delay: 0.24s;
}

.welcome-action:hover {
  transform: translateY(-5px);
  border-color: var(--ink);
  background: var(--surface-hover);
  box-shadow: var(--shadow-lg);
}

.welcome-action:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.welcome-action-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--on-accent);
  box-shadow: none;
}

.welcome-action-icon svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome-action--telegram .welcome-action-icon {
  background: var(--accent);
}

.welcome-action--telegram .welcome-action-icon svg {
  fill: currentColor;
  stroke: none;
}

.welcome-action--instagram .welcome-action-icon {
  background: var(--accent);
}

.welcome-action--instagram .icon-fill {
  fill: currentColor;
  stroke: none;
}

.welcome-action--yandex .welcome-action-icon {
  background: var(--accent);
}

.welcome-action--menu .welcome-action-icon {
  background: var(--accent);
  color: var(--on-accent);
}

.welcome-action-label {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.05;
}

.welcome-action-meta {
  color: var(--ink-muted);
  font-size: 0.7rem;
  line-height: 1.1;
}

@keyframes cardEntry {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes welcomeActionEntry {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .info-section {
    order: -1;
  }

  .page {
    padding-bottom: 24px;
  }
}

@media (max-width: 640px) {
  .topbar,
  .menu-section,
  .welcome-card {
    border-radius: 18px;
  }

  .topbar {
    padding: 14px;
  }

  .brand-title {
    font-size: clamp(1.35rem, 7.5vw, 1.8rem);
  }

  .topbar-meta {
    font-size: 0.76rem;
    padding: 6px 8px;
  }

  .tabs-scroll-hint {
    display: block;
    position: static;
    margin-top: 6px;
    font-size: 0.72rem;
  }

  .hours-modal {
    width: calc(100vw - 16px);
  }

  .menu-section {
    padding: 12px;
  }

  .cafe-photo-card {
    height: 150px;
  }

  .menu-group-tabs {
    display: flex;
    width: 100%;
  }

  .group-tab-btn {
    flex: 1;
    text-align: center;
  }

  .item-variants li {
    padding: 6px 8px;
  }

  .welcome-overlay {
    padding: 12px;
  }

  .welcome-card {
    padding: 26px 18px 24px;
  }

  .welcome-card h1 {
    font-size: clamp(2.45rem, 14vw, 3.6rem);
  }

  .welcome-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 22px;
  }

  .welcome-action {
    min-height: 112px;
    border-radius: 18px;
    padding: 13px 9px 11px;
    gap: 6px;
  }

  .welcome-action-icon {
    width: 46px;
    height: 46px;
    border-radius: 15px;
  }

  .welcome-action-icon svg {
    width: 26px;
    height: 26px;
  }

  .welcome-action-label {
    font-size: 0.82rem;
  }

  .welcome-action-meta {
    font-size: 0.64rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .welcome-card,
  .welcome-action {
    animation: none;
  }

  .welcome-action,
  .welcome-overlay {
    transition: none;
  }
}

/* Theme controls are part of each screen, so they remain reachable on mobile. */
.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-hover); }
.theme-toggle svg { width: 18px; height: 18px; flex-shrink: 0; }
.theme-toggle .theme-sun { display: none; }
[data-theme="dark"] .theme-toggle .theme-sun { display: block; }
[data-theme="dark"] .theme-toggle .theme-moon { display: none; }
.welcome-card .theme-toggle { display: flex; margin: 0 0 24px auto; }
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}
.status-btn { min-height: 44px; }
.brand-title, .menu-header h3, .welcome-card h1 { font-weight: 800; }
.menu-header { padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .topbar-actions { width: 100%; justify-content: space-between; gap: 8px; }
  .theme-toggle { padding: 10px 12px; font-size: 0.76rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
