:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --paper: #fffdf8;
  --paper-strong: #ffffff;
  --ink: #1e2528;
  --muted: #667076;
  --line: #dedbd0;
  --primary: #1f7a57;
  --primary-dark: #11543b;
  --accent: #d5552f;
  --gold: #f1b23d;
  --danger: #b92f2f;
  --ok: #16845a;
  --warn: #a86816;
  --info: #3f68ad;
  --shadow: 0 18px 48px rgba(44, 38, 25, 0.12);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(31, 122, 87, 0.10), transparent 32rem),
    linear-gradient(135deg, #faf8f0 0%, #f4f2ec 44%, #f1f6f4 100%);
  color: var(--ink);
  min-height: 100vh;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

img {
  max-width: 100%;
  display: block;
}

svg {
  width: 1.12rem;
  height: 1.12rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(12rem, auto) 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem clamp(1rem, 3vw, 2.5rem);
  background: rgba(255, 253, 248, 0.88);
  border-bottom: 1px solid rgba(222, 219, 208, 0.8);
  backdrop-filter: blur(18px);
}

.brand,
.account-pill,
.nav-item,
.icon-button,
.primary,
.secondary,
.ghost,
.text-button,
.restaurant-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand {
  gap: 0.75rem;
  color: var(--ink);
  background: transparent;
  text-align: left;
  padding: 0;
}

.brand-mark {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.8rem;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), #36a573);
  box-shadow: 0 10px 24px rgba(31, 122, 87, 0.24);
}

.brand strong {
  display: block;
  font-size: 1.05rem;
}

.brand small,
.muted {
  color: var(--muted);
}

.main-nav {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  min-width: 0;
}

.nav-item {
  gap: 0.42rem;
  height: 2.45rem;
  padding: 0 0.85rem;
  border-radius: 0.75rem;
  color: #4f5b60;
  background: transparent;
  white-space: nowrap;
}

.nav-item.active,
.nav-item:hover {
  color: var(--primary-dark);
  background: rgba(31, 122, 87, 0.10);
}

.account-area {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.55rem;
}

.account-pill {
  gap: 0.45rem;
  min-width: 0;
  height: 2.45rem;
  padding: 0 0.75rem;
  border-radius: 0.75rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.account-pill span {
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-pill em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.page-shell {
  width: min(1380px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.4rem 0 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(22rem, 0.92fr);
  gap: 1.2rem;
  align-items: stretch;
  min-height: min(58vh, 34rem);
}

.hero-copy,
.restaurant-focus,
.content-band,
.filter-panel,
.checkout-panel,
.auth-card,
.profile-card,
.manager-panel {
  border: 1px solid rgba(222, 219, 208, 0.9);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: clamp(1.5rem, 4vw, 3.4rem);
  border-radius: 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  display: inline-block;
  color: var(--primary-dark);
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 0.65rem;
}

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

h1 {
  font-size: clamp(2rem, 3.35vw, 3.7rem);
  line-height: 1.02;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.35rem, 2vw, 2rem);
  margin-bottom: 0.55rem;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.25;
  margin-bottom: 0.45rem;
}

p {
  color: #556166;
  line-height: 1.75;
}

.hero-copy p {
  max-width: 45rem;
  font-size: 1.02rem;
}

.hero-actions,
.action-row,
.toolbar,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.primary,
.secondary,
.ghost,
.danger {
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0 1.05rem;
  border-radius: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #2ca36f);
  box-shadow: 0 12px 24px rgba(31, 122, 87, 0.22);
}

.primary:hover,
.secondary:hover,
.ghost:hover,
.danger:hover {
  transform: translateY(-1px);
}

.secondary {
  color: var(--primary-dark);
  background: #eef8f1;
  border: 1px solid rgba(31, 122, 87, 0.18);
}

.ghost {
  color: #4f5b60;
  background: #fff;
  border: 1px solid var(--line);
}

.danger {
  color: #fff;
  background: var(--danger);
}

.compact {
  min-height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 0.62rem;
  font-size: 0.9rem;
}

.wide {
  width: 100%;
}

.icon-only,
.icon-button {
  width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  border-radius: 0.65rem;
}

.icon-button {
  color: #5a646a;
  background: #fff;
  border: 1px solid var(--line);
}

.heart.active {
  color: #d83e4d;
  background: #fff1f2;
  border-color: rgba(216, 62, 77, 0.22);
}

.text-button {
  gap: 0.35rem;
  padding: 0;
  color: var(--primary-dark);
  background: transparent;
  font-weight: 800;
}

.restaurant-focus {
  border-radius: 0.9rem;
  display: grid;
  grid-template-rows: minmax(14rem, 1fr) auto;
  overflow: hidden;
}

.restaurant-focus > img {
  width: 100%;
  height: 100%;
  min-height: 16rem;
  object-fit: cover;
  background: color-mix(in srgb, var(--accent) 12%, #fff);
}

.restaurant-focus > div {
  padding: 1.25rem;
  border-top: 0.3rem solid var(--accent);
}

.restaurant-focus h2,
.restaurant-focus p {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.75rem;
  padding: 0 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.badge {
  color: var(--primary-dark);
  background: #edf8f0;
}

.status-badge.ok {
  color: #0b6746;
  background: #e7f7ec;
}

.status-badge.warn {
  color: #8c520c;
  background: #fff4dc;
}

.status-badge.danger {
  color: #9f2020;
  background: #ffe8e8;
}

.status-badge.gray {
  color: #5f676c;
  background: #eceff0;
}

.status-badge.info {
  color: #2c5597;
  background: #e9f0ff;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin: 1rem 0 0;
}

.metric-row div,
.stats-grid div {
  padding: 0.85rem;
  border-radius: 0.75rem;
  background: rgba(246, 245, 241, 0.9);
  border: 1px solid rgba(222, 219, 208, 0.78);
}

dt,
dd {
  margin: 0;
}

dt,
.stats-grid span {
  color: var(--muted);
  font-size: 0.8rem;
}

dd,
.stats-grid strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.08rem;
  font-weight: 900;
}

.content-band,
.menu-layout,
.two-column,
.auth-layout,
.profile-layout {
  margin-top: 1.2rem;
}

.content-band {
  padding: 1.2rem;
  border-radius: 0.9rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head.tight {
  margin-bottom: 0.8rem;
}

.section-head h1,
.section-head h2 {
  margin-bottom: 0;
}

.restaurant-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.restaurant-card {
  align-items: stretch;
  justify-content: flex-start;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 13.5rem;
  padding: 0.75rem;
  border-radius: 0.85rem;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  text-align: left;
}

.restaurant-card.active {
  border-color: color-mix(in srgb, var(--accent) 65%, #fff);
  box-shadow: 0 14px 28px color-mix(in srgb, var(--accent) 18%, transparent);
}

.restaurant-card img {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  border-radius: 0.65rem;
  background: #f3f0e7;
}

.restaurant-card span,
.restaurant-card small {
  color: var(--muted);
}

.restaurant-card strong {
  font-size: 1.12rem;
}

.menu-layout {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.filter-panel,
.checkout-panel,
.profile-card {
  position: sticky;
  top: 5.2rem;
  border-radius: 0.9rem;
  padding: 1rem;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 0.85rem;
  border-radius: 0.7rem;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
}

.search-field input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-field.small {
  width: min(20rem, 100%);
  min-height: 2.35rem;
}

.category-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.category-list button {
  min-height: 2.65rem;
  border-radius: 0.68rem;
  color: #556166;
  background: transparent;
  text-align: left;
  padding: 0 0.85rem;
}

.category-list button.active,
.category-list button:hover {
  color: var(--primary-dark);
  background: rgba(31, 122, 87, 0.11);
  font-weight: 800;
}

.mini-panel {
  margin-top: 1rem;
  padding: 0.9rem;
  border-radius: 0.75rem;
  background: #fff7e8;
  border: 1px solid #f4dfb7;
}

.mini-panel p {
  margin-bottom: 0;
  font-size: 0.9rem;
  line-height: 1.65;
}

.menu-area {
  min-width: 0;
}

.hot-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.hot-card {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.75rem;
  min-height: 6.6rem;
  padding: 0.7rem;
  border-radius: 0.85rem;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  background: #fff;
}

.hot-card img {
  width: 100%;
  height: 100%;
  border-radius: 0.65rem;
  object-fit: cover;
}

.hot-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

.hot-card strong {
  display: block;
  margin: 0.15rem 0 0.45rem;
}

.dish-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

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

.dish-card {
  min-width: 0;
  border-radius: 0.9rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(44, 38, 25, 0.07);
}

.dish-card.disabled {
  filter: saturate(0.7);
}

.dish-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 0;
  overflow: hidden;
  background: #f2efe7;
}

.dish-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dish-image .status-badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
}

.dish-body {
  padding: 0.9rem;
}

.dish-title-row {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: flex-start;
}

.dish-title-row h3 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dish-body p {
  min-height: 4.2rem;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.6rem;
}

.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  color: color-mix(in srgb, var(--accent) 65%, #523);
  background: color-mix(in srgb, var(--accent) 10%, #fff);
  font-size: 0.74rem;
  font-weight: 800;
}

.dish-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.8rem;
  margin-top: 0.85rem;
}

.dish-bottom strong {
  display: block;
  font-size: 1.25rem;
  color: var(--accent);
}

.dish-bottom small {
  color: var(--muted);
}

.auth-layout,
.two-column,
.profile-layout,
.management-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 0.42fr);
  gap: 1rem;
  align-items: start;
}

.auth-layout {
  grid-template-columns: minmax(0, 0.95fr) minmax(22rem, 0.65fr);
}

.auth-card {
  border-radius: 0.9rem;
  padding: clamp(1.1rem, 3vw, 2rem);
}

.auth-card.soft {
  background: rgba(255, 255, 255, 0.68);
}

.stack-form {
  display: grid;
  gap: 0.85rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.4rem;
  color: #445055;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: #fff;
  color: var(--ink);
  min-height: 2.65rem;
  padding: 0 0.8rem;
  outline: none;
}

textarea {
  min-height: 6rem;
  resize: vertical;
  padding: 0.75rem 0.8rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(31, 122, 87, 0.55);
  box-shadow: 0 0 0 3px rgba(31, 122, 87, 0.12);
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 1rem;
}

.demo-grid button {
  min-height: 2.35rem;
  border-radius: 0.6rem;
  color: #4f5b60;
  background: #fff;
  border: 1px solid var(--line);
}

.cart-list,
.order-list,
.table-list {
  display: grid;
  gap: 0.75rem;
}

.cart-row,
.order-card,
.table-row {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 0.85rem;
}

.cart-row {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) auto auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.75rem;
}

.cart-row img,
.table-row img {
  width: 5rem;
  height: 5rem;
  border-radius: 0.65rem;
  object-fit: cover;
}

.cart-row span,
.order-head span,
.order-meta span,
.table-row span,
.table-row p,
.profile-card p,
.profile-card span {
  color: var(--muted);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stepper input {
  width: 3rem;
  min-height: 2.35rem;
  text-align: center;
  padding: 0;
}

.checkout-panel {
  align-self: start;
}

.bill {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0;
}

.bill div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.bill .total {
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
}

.bill .total dd {
  color: var(--accent);
  font-size: 1.45rem;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.28rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid var(--line);
}

.segmented button {
  min-height: 2.1rem;
  padding: 0 0.65rem;
  border-radius: 0.55rem;
  color: var(--muted);
  background: transparent;
  font-size: 0.9rem;
}

.segmented button.active {
  color: #fff;
  background: var(--primary);
}

.segmented.large {
  margin-bottom: 1rem;
}

.order-card {
  padding: 1rem;
}

.order-head,
.order-foot,
.order-items div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.order-head {
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.order-head strong {
  display: block;
  margin-bottom: 0.2rem;
}

.order-items {
  display: grid;
  gap: 0.42rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0.8rem 0;
  font-size: 0.92rem;
}

.order-foot {
  align-items: center;
}

.slim .order-card {
  box-shadow: none;
}

.profile-layout {
  grid-template-columns: 18rem minmax(0, 1fr);
}

.profile-card {
  text-align: center;
}

.capability-actions {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0;
}

.avatar {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 0.8rem;
  border-radius: 1.1rem;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--accent));
  font-size: 1.9rem;
  font-weight: 900;
}

.avatar.small {
  width: 3rem;
  height: 3rem;
  margin: 0;
  border-radius: 0.8rem;
  font-size: 1.2rem;
}

.profile-main {
  min-width: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stats-grid div {
  background: #fff;
  min-height: 5.2rem;
}

.stats-grid strong {
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}

.manager-panel {
  min-width: 0;
  border-radius: 0.9rem;
  padding: 1rem;
}

.narrow-panel {
  max-width: 44rem;
}

.table-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem;
}

.table-row strong,
.cart-row strong {
  overflow-wrap: anywhere;
}

.table-row p {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.user-row {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.category-admin-list {
  display: grid;
  gap: 0.55rem;
}

.category-admin-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #fff;
}

.category-admin-list em {
  color: var(--muted);
  font-style: normal;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 8rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.35rem;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  padding: 1.25rem;
}

.empty-state strong {
  color: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.3rem;
  z-index: 50;
  transform: translate(-50%, 1rem);
  min-width: min(28rem, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  color: #fff;
  background: #263034;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.success {
  background: var(--ok);
}

.toast.error {
  background: var(--danger);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(25, 32, 35, 0.42);
}

.modal-card {
  width: min(42rem, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border-radius: 0.9rem;
  padding: 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.upload-box {
  border: 1px dashed color-mix(in srgb, var(--primary) 38%, var(--line));
  border-radius: 0.75rem;
  padding: 0.85rem;
  background: #f7fbf7;
  cursor: pointer;
}

.upload-box input {
  min-height: auto;
  border: 0;
  padding: 0;
  background: transparent;
}

.upload-box em,
.form-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-style: normal;
  line-height: 1.6;
}

.image-preview {
  min-height: 9rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #fff;
  overflow: hidden;
  color: var(--muted);
}

.image-preview img {
  width: 100%;
  height: 13rem;
  object-fit: cover;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.modal-head h2 {
  margin-bottom: 0;
}

@media (max-width: 1180px) {
  .dish-grid,
  .hot-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .management-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .account-area {
    justify-content: flex-start;
  }

  .hero-grid,
  .menu-layout,
  .two-column,
  .auth-layout,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .filter-panel,
  .checkout-panel,
  .profile-card {
    position: static;
  }

  .restaurant-strip {
    grid-template-columns: 1fr;
  }

  .restaurant-card {
    min-height: 0;
  }

  .cart-row {
    grid-template-columns: 4rem minmax(0, 1fr);
  }

  .cart-row > strong,
  .cart-row .stepper {
    grid-column: 2;
  }

  .table-row,
  .user-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .table-row .status-badge,
  .table-row .action-row {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 1rem, 1380px);
    padding-top: 0.75rem;
  }

  .topbar {
    padding: 0.75rem;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .brand small,
  .account-pill em {
    display: none;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.7rem;
  }

  .main-nav {
    grid-column: 1 / -1;
    order: 3;
  }

  .account-area {
    justify-content: flex-end;
  }

  .account-area .primary {
    min-height: 2.25rem;
    padding: 0 0.7rem;
    font-size: 0.88rem;
  }

  .nav-item span {
    font-size: 0.86rem;
  }

  .hero-copy,
  .content-band,
  .auth-card,
  .manager-panel {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-row,
  .hot-row,
  .dish-grid,
  .compact-grid,
  .stats-grid,
  .form-grid,
  .demo-grid {
    grid-template-columns: 1fr;
  }

  .hot-card {
    grid-template-columns: 4.8rem minmax(0, 1fr);
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1 1 auto;
  }

  .order-head,
  .order-foot,
  .order-items div {
    flex-direction: column;
    gap: 0.35rem;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .category-admin-list article {
    grid-template-columns: 1fr;
  }
}
