:root {
  color-scheme: light;
  --ink: #19211d;
  --muted: #66716b;
  --paper: #fbfaf6;
  --line: #ded9cd;
  --leaf: #2f7d56;
  --tomato: #c94f3d;
  --gold: #d99d2b;
  --aqua: #317c8e;
  --white: #ffffff;
  --page-bg: #f8f2e8;
  --panel-bg: #fbfaf6;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(47, 125, 86, 0.14), transparent 28rem),
    linear-gradient(145deg, var(--page-bg), #eef5f1 46%, #f6f1e6);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 22px;
  background: color-mix(in srgb, var(--panel-bg) 86%, transparent);
}

.auth-page {
  position: relative;
  display: grid;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  padding: 22px 18px;
  place-items: center;
  isolation: isolate;
}

.auth-background {
  position: absolute;
  inset: -14px;
  z-index: -2;
  background:
    linear-gradient(rgba(13, 16, 14, 0.1), rgba(13, 16, 14, 0.38)),
    url("https://images.unsplash.com/photo-1556911220-bff31c812dba?auto=format&fit=crop&w=1200&q=80") center / cover;
  filter: blur(5px);
  transform: scale(1.035);
}

.auth-page::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: rgba(11, 15, 13, 0.12);
}

.auth-panel {
  display: grid;
  gap: 14px;
  width: min(100%, 328px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 18px;
  background: rgba(251, 250, 246, 0.76);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
}

.auth-brand {
  display: grid;
  justify-items: center;
  text-align: center;
}

.auth-brand-icon {
  width: 78px;
  aspect-ratio: 1;
  margin-bottom: 9px;
  border-radius: 20px;
  box-shadow: 0 12px 26px rgba(25, 33, 29, 0.18);
}

.auth-brand h1 {
  font-size: clamp(2rem, 11vw, 2.8rem);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.link-button {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--leaf);
  font-weight: 950;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.tester-login {
  margin: -2px 0 0;
  border: 1px solid rgba(47, 125, 86, 0.24);
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.45;
}

.tester-login strong {
  display: block;
  margin-bottom: 2px;
  color: var(--leaf);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.users-page {
  display: grid;
  align-content: start;
  gap: 14px;
}

.menus-page {
  display: grid;
  align-content: start;
  gap: 18px;
}

.menus-top-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.menus-top-bar h1 {
  font-size: clamp(2.35rem, 13vw, 3.25rem);
}

.brand-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.header-brand-icon {
  width: 44px;
  aspect-ratio: 1;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(25, 33, 29, 0.14);
}

.compact-brand-title {
  gap: 8px;
}

.compact-brand-title .header-brand-icon {
  width: 38px;
  border-radius: 10px;
}

.compact-brand-title h1 {
  overflow: hidden;
  font-size: clamp(1.45rem, 7vw, 2rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-nav-button {
  min-width: 68px;
}

.sync-status {
  margin: -8px 0 0;
  border: 1px solid rgba(47, 125, 86, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.sync-status.connected {
  border-color: rgba(47, 125, 86, 0.28);
  color: var(--leaf);
}

.sync-status.error {
  border-color: rgba(201, 79, 61, 0.26);
  color: var(--tomato);
}

.create-menu-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 48px;
  border: 1px solid rgba(47, 125, 86, 0.28);
  border-radius: 8px;
  padding: 0 13px;
  background: var(--leaf);
  color: white;
  font-size: 0.9rem;
  font-weight: 950;
  text-align: left;
  box-shadow: 0 14px 34px rgba(47, 125, 86, 0.16);
}

.create-menu-button span {
  display: grid;
  width: 28px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1.2rem;
  line-height: 1;
}

.restaurant-list {
  display: grid;
  gap: 12px;
}

.restaurant-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 14px 34px rgba(25, 33, 29, 0.08);
}

.restaurant-card.is-active {
  border-color: rgba(47, 125, 86, 0.45);
  box-shadow: 0 14px 34px rgba(47, 125, 86, 0.14);
}

.restaurant-card img {
  width: 82px;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: contain;
  background: #f7f1e6;
}

.restaurant-card-placeholder {
  display: grid;
  width: 82px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f4f1ea;
}

.restaurant-card-placeholder::before {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(102, 113, 107, 0.34);
  border-radius: 8px;
  content: "";
}

.restaurant-card strong,
.restaurant-card span {
  display: block;
}

.restaurant-card strong {
  margin-bottom: 4px;
  font-size: 1rem;
}

.restaurant-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.page-top-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.page-top-bar h1 {
  font-size: clamp(1.85rem, 10vw, 2.8rem);
}

.top-bar,
.order-panel,
.matrix-header,
.menu-row {
  display: grid;
  align-items: center;
}

.top-bar {
  grid-template-columns: auto minmax(0, 1fr) 44px;
  gap: 8px;
  padding-bottom: 16px;
}

.kicker {
  margin: 0 0 3px;
  color: var(--leaf);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 12vw, 3.15rem);
  line-height: 0.9;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: 1.25rem;
}

.action-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--white);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.action-button.is-active,
.add-button {
  border-color: var(--leaf);
  background: var(--leaf);
  color: white;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(25, 33, 29, 0.42);
}

.admin-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 21;
  display: grid;
  align-content: start;
  gap: 18px;
  width: min(88vw, 360px);
  height: 100vh;
  overflow-y: auto;
  padding: 18px;
  background: var(--white);
  box-shadow: -22px 0 60px rgba(25, 33, 29, 0.22);
  transform: translateX(105%);
  transition: transform 180ms ease;
}

.admin-drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 12px;
  align-items: center;
}

.drawer-head h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
}

.admin-login,
.auth-form,
.admin-controls,
.user-form {
  display: grid;
  gap: 12px;
}

.admin-login label,
.auth-form label,
.user-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-login input,
.auth-form input,
.user-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fffdfa;
  color: var(--ink);
  outline: none;
  text-transform: none;
}

.admin-login input:focus,
.auth-form input:focus,
.user-form input:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(47, 125, 86, 0.16);
}

.login-message {
  min-height: 18px;
  margin-bottom: 0;
  color: var(--tomato);
  font-size: 0.78rem;
  font-weight: 800;
}

.scan-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.admin-status {
  margin-bottom: 0;
  color: var(--leaf);
  font-size: 0.86rem;
  font-weight: 900;
}

.admin-controls .action-button,
.admin-controls .danger-button,
.auth-form .save-button,
.admin-login .save-button {
  width: 100%;
}

.user-manager {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.create-user-panel {
  display: grid;
  gap: 12px;
}

.method-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.method-tab {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.method-tab.is-active {
  border-color: var(--leaf);
  background: var(--leaf);
  color: white;
}

.pdf-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pdf-options label,
.pdf-item-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.pdf-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pdf-actions .save-button {
  grid-column: 1 / -1;
}

.pdf-item-list {
  display: grid;
  gap: 18px;
}

.pdf-category {
  display: grid;
  gap: 10px;
}

.pdf-category-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fffdfa;
}

.pdf-category-select {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.pdf-category-select strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
}

.pdf-category-select small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.small-toggle {
  display: grid;
  width: 34px;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  padding: 0;
  background: var(--white);
  color: var(--ink);
  font-size: 1.28rem;
  font-weight: 950;
  line-height: 1;
  transition: transform 160ms ease;
}

.small-toggle.is-open {
  transform: rotate(180deg);
}

.pdf-category-items {
  display: grid;
  gap: 8px;
  padding-left: 10px;
}

.pdf-item-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fffdfa;
}

.pdf-item-row strong,
.pdf-item-row small {
  display: block;
}

.pdf-item-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.permission-group {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.permission-group legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.permission-group label {
  grid-template-columns: 18px 1fr;
  align-items: center;
  color: var(--ink);
  font-size: 0.84rem;
  text-transform: none;
}

.permission-group input {
  width: 16px;
}

.user-list {
  display: grid;
  gap: 8px;
}

.user-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  overflow: hidden;
}

.user-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  border: 0;
  padding: 11px 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.user-summary strong {
  display: block;
  font-size: 0.9rem;
}

.user-summary span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.expand-marker {
  color: var(--leaf) !important;
  font-size: 1.1rem !important;
  font-weight: 950 !important;
}

.user-edit-panel {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px;
}

.user-edit-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.user-edit-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fffdfa;
  color: var(--ink);
  outline: none;
  text-transform: none;
}

.user-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.user-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.small-danger {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: #fbebe8;
  color: var(--tomato);
  font-size: 0.76rem;
  font-weight: 900;
}

.hero {
  position: relative;
  min-height: 178px;
  overflow: hidden;
  border-radius: 8px;
  background: #222;
}

.floating-edit-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(25, 33, 29, 0.88);
  color: white;
  font-size: 0.76rem;
  font-weight: 950;
  box-shadow: 0 10px 28px rgba(25, 33, 29, 0.2);
}

.hero img {
  width: 100%;
  height: 214px;
  display: block;
  object-fit: cover;
}

.logo-hero {
  display: grid;
  place-items: center;
  min-height: 178px;
  background: #f7f1e6;
}

.logo-hero img {
  width: min(78%, 280px);
  height: auto;
  max-height: 150px;
  object-fit: contain;
}

.logo-hero.is-empty {
  border: 1px dashed var(--line);
  background: #f4f1ea;
}

.logo-hero.is-empty::before {
  width: 68px;
  height: 68px;
  border: 2px solid rgba(102, 113, 107, 0.22);
  border-radius: 18px;
  content: "";
}

.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.64));
}

.logo-hero::after {
  display: none;
}

.menu-title-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--white);
}

.menu-title-panel h2 {
  overflow: hidden;
  margin-bottom: 0;
  font-size: clamp(1.32rem, 7vw, 1.85rem);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.small-icon-action {
  display: grid;
  width: 36px;
  min-height: 36px;
  place-items: center;
  border: 1px solid rgba(49, 124, 142, 0.32);
  border-radius: 50%;
  padding: 0;
  background: #e8f2f4;
  color: var(--aqua);
  font-size: 1rem;
  font-weight: 950;
}

.hero-copy {
  position: absolute;
  right: 18px;
  bottom: 17px;
  left: 18px;
  z-index: 1;
  color: white;
}

.hero-copy p {
  margin-bottom: 5px;
  color: #f7d16e;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-copy h2 {
  max-width: 330px;
  margin-bottom: 0;
  font-size: 1.45rem;
  line-height: 1.02;
}

.controls {
  display: grid;
  gap: 12px;
  margin: 16px 0 14px;
}

.search-box {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--white);
  color: var(--ink);
  outline: none;
}

.search-box input:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(47, 125, 86, 0.16);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.tab.is-active {
  border-color: var(--leaf);
  background: var(--leaf);
  color: white;
}

.allergy-panel {
  display: grid;
  gap: 11px;
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.section-heading {
  display: grid;
  gap: 2px;
}

.section-heading strong {
  font-size: 1rem;
}

.allergy-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.allergy-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  background: #f8f6f0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.allergy-chip.is-active {
  border-color: var(--tomato);
  background: #fbebe8;
  color: var(--tomato);
}

.matrix-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.matrix-header,
.menu-row {
  grid-template-columns: 42px 48px 62px minmax(0, 1fr);
  gap: 7px;
}

.matrix-header {
  display: none;
}

.menu-grid {
  display: grid;
}

.menu-row {
  min-height: 96px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.item-cell {
  grid-column: 1 / -1;
}

.item-toggle {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.item-title-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.row-edit-button {
  min-height: 26px;
  border: 0;
  border-radius: 999px;
  padding: 0 7px;
  background: var(--ink);
  color: white;
  font-size: 0.66rem;
  font-weight: 950;
}

.item-cell h3 {
  overflow: hidden;
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-cell p {
  margin-top: 5px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.25;
}

.allergen-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.allergen-tag {
  border-radius: 999px;
  padding: 3px 7px;
  background: #f6eee4;
  color: #8a5a28;
  font-size: 0.65rem;
  font-weight: 850;
}

.allergen-tag.none {
  background: #edf5ef;
  color: var(--leaf);
}

.pill {
  display: inline-grid;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #edf5ef;
  color: var(--leaf);
  font-size: 0.7rem;
  font-weight: 900;
}

.diet-pill {
  grid-column: 1;
}

.pill.sea {
  background: #e8f2f4;
  color: var(--aqua);
}

.pill.fire {
  background: #fbebe8;
  color: var(--tomato);
}

.heat-meter {
  grid-column: 2;
  color: var(--tomato);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.price-button {
  grid-column: 3;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: #231b0a;
  font-size: 0.84rem;
  font-weight: 900;
  cursor: default;
}

.price-button.is-added {
  background: var(--leaf);
  color: white;
}

.price-button.editing {
  background: var(--aqua);
  color: white;
  cursor: pointer;
}

.price-button.locked {
  background: #e8e3d8;
  color: var(--muted);
}

.item-details {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding-top: 10px;
}

.item-details[hidden] {
  display: none;
}

.item-details img {
  width: 96px;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: #f4f1ea;
}

.detail-copy {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.35;
}

.empty-state {
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}

.restaurant-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.order-panel {
  position: sticky;
  bottom: 12px;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(25, 33, 29, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 40px rgba(25, 33, 29, 0.14);
  backdrop-filter: blur(14px);
}

.order-panel strong {
  font-size: 1.02rem;
}

.order-total {
  color: var(--leaf);
  font-size: 1.38rem;
  font-weight: 950;
}

.item-dialog {
  width: min(calc(100% - 24px), 420px);
  border: 0;
  border-radius: 12px;
  padding: 0;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(25, 33, 29, 0.3);
}

.item-dialog::backdrop {
  background: rgba(25, 33, 29, 0.42);
}

.item-form {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.dialog-head,
.form-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.dialog-head h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

.item-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.item-form input,
.item-form select,
.item-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fffdfa;
  color: var(--ink);
  outline: none;
  text-transform: none;
}

.item-form input[type="file"] {
  padding: 9px;
}

.color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.color-grid label {
  align-items: start;
}

.color-grid input[type="color"] {
  min-height: 44px;
  padding: 5px;
}

.item-form textarea {
  resize: vertical;
}

.item-form input:focus,
.item-form select:focus,
.item-form textarea:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(47, 125, 86, 0.16);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.single-action {
  grid-template-columns: 1fr;
}

.save-button,
.danger-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 900;
}

.save-button {
  background: var(--leaf);
  color: white;
}

.danger-button {
  background: #fbebe8;
  color: var(--tomato);
}

.delete-menu-button {
  border: 1px solid rgba(191, 74, 50, 0.22);
}

.danger-button:disabled {
  opacity: 0.48;
}

.danger-dialog .item-form {
  gap: 14px;
}

.delete-menu-copy {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.4;
}

.delete-menu-copy strong {
  color: var(--tomato);
}

.delete-menu-warning {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.delete-confirm-step,
.delete-slide-step {
  display: grid;
  gap: 12px;
}

.confirm-slider {
  --confirm-progress: 0%;
  position: relative;
  min-height: 58px;
  overflow: hidden;
  border: 1px solid rgba(191, 74, 50, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(191, 74, 50, 0.18) var(--confirm-progress), transparent var(--confirm-progress)),
    #fff7f4;
  color: var(--tomato);
  touch-action: none;
  user-select: none;
}

.confirm-slider:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(191, 74, 50, 0.18);
}

.confirm-slider-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-left: 74px;
  padding-right: 16px;
  color: rgba(191, 74, 50, 0.78);
  font-size: 0.82rem;
  font-weight: 950;
  text-align: center;
}

.confirm-slider-thumb {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 1;
  display: grid;
  width: 64px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--tomato);
  color: white;
  font-size: 0.76rem;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(191, 74, 50, 0.24);
}

@media (min-width: 720px) {
  body {
    padding: 0;
  }

  .app-shell,
  .auth-page {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .app-shell {
    max-width: 1180px;
    padding: 28px clamp(24px, 5vw, 64px) 42px;
    background: transparent;
  }

  .auth-page {
    max-width: none;
    padding: 32px;
  }

  .auth-panel {
    width: min(100%, 360px);
  }

  .restaurant-list {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }

  .restaurant-card {
    min-height: 130px;
    grid-template-columns: 96px minmax(0, 1fr);
    padding: 12px;
  }

  .restaurant-card img,
  .restaurant-card-placeholder {
    width: 96px;
  }

  .menus-top-bar h1,
  .page-top-bar h1,
  h1 {
    font-size: 2.65rem;
  }

  .compact-brand-title h1 {
    font-size: 1.85rem;
  }

  .admin-drawer {
    width: min(420px, 92vw);
    padding: 22px;
  }

  .item-dialog {
    width: min(calc(100% - 36px), 560px);
  }

  .form-grid,
  .color-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  #menuPage {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 18px 24px;
    align-content: start;
  }

  #menuPage .top-bar {
    grid-column: 1 / -1;
    padding-bottom: 6px;
  }

  #menuPage .hero,
  #menuPage .menu-title-panel,
  #menuPage .controls,
  #menuPage .allergy-panel {
    grid-column: 1;
  }

  #menuPage .matrix-card {
    grid-column: 2;
    grid-row: 2 / span 5;
    align-self: start;
  }

  .hero,
  .logo-hero {
    min-height: 232px;
  }

  .hero img {
    height: 260px;
  }

  .logo-hero img {
    width: min(72%, 320px);
    max-height: 190px;
  }

  .menu-title-panel {
    margin-top: 0;
    padding: 14px;
  }

  .menu-title-panel h2 {
    font-size: 1.55rem;
    white-space: normal;
  }

  .controls {
    margin: 0;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .allergy-panel {
    margin-bottom: 0;
  }

  .matrix-header {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) 76px 86px 96px;
    gap: 12px;
    padding: 12px 14px;
    background: #f5f1e8;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .menu-row {
    grid-template-columns: minmax(320px, 1fr) 76px 86px 96px;
    gap: 12px;
    min-height: 84px;
    padding: 14px;
    align-items: start;
  }

  .item-cell {
    grid-column: 1;
  }

  .diet-pill {
    grid-column: 2;
  }

  .heat-meter {
    grid-column: 3;
    min-height: 36px;
    display: grid;
    align-items: center;
  }

  .price-button {
    grid-column: 4;
  }

  .item-cell h3 {
    font-size: 1.02rem;
  }

  .item-cell p {
    font-size: 0.8rem;
  }

  .item-details {
    grid-column: 1 / -1;
    grid-template-columns: 128px minmax(0, 1fr);
    padding-top: 12px;
  }

  .item-details img {
    width: 128px;
  }

  .users-page {
    max-width: 980px;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 18px 22px;
  }

  .users-page .page-top-bar {
    grid-column: 1 / -1;
  }

  .pdf-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pdf-actions .save-button {
    grid-column: auto;
  }

  .pdf-category-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 0;
  }
}

@media (min-width: 1280px) {
  .app-shell {
    max-width: 1320px;
  }

  #menuPage {
    grid-template-columns: 360px minmax(0, 1fr);
  }
}
