:root {
  --bg: #f5f1e8;
  --paper: #fffdf8;
  --ink: #172026;
  --muted: #667078;
  --line: #d8cfc0;
  --dark: #111a20;
  --green: #1d6b57;
  --green-2: #e3f0e9;
  --red: #c84b36;
  --red-2: #fff0eb;
  --gold: #ad7c24;
  --blue: #2d5d7b;
  --shadow: 0 18px 46px rgba(42, 34, 24, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Malgun Gothic", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  width: min(1240px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 28px 0 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 0;
  font-size: clamp(28px, 4.6vw, 54px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(22px, 2.5vw, 34px);
  line-height: 1.16;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.22;
}

main {
  width: min(1240px, calc(100vw - 36px));
  margin: 0 auto;
  padding-bottom: 56px;
}

.mode-tabs,
.language-switch,
.category-tabs,
.board-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-button,
.lang-button,
.category-tabs button,
.ghost-action,
.secondary-action,
.primary-action,
.qty-button,
.status-button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  min-height: 40px;
  padding: 0 14px;
  font-weight: 800;
}

.tab-button.active,
.lang-button.active,
.category-tabs button.active {
  border-color: var(--dark);
  background: var(--dark);
  color: white;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: stretch;
  margin: 8px 0 24px;
}

.hero-copy {
  min-height: 260px;
  padding: 34px;
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(17, 26, 32, 0.92), rgba(17, 26, 32, 0.72)),
    url("https://images.unsplash.com/photo-1554118811-1e0d58224f24?auto=format&fit=crop&w=1400&q=80") center/cover;
  color: white;
}

.hero-copy p {
  max-width: 680px;
  margin: 18px 0 0;
  color: #d8e0e4;
  line-height: 1.7;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 18px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  color: #f7e6ce;
  font-size: 12px;
  font-weight: 900;
}

.hero-card,
.admin-card,
.shop-panel,
.cart-panel,
.menu-card,
.order-ticket,
.status-summary article,
.notice-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.hero-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
  box-shadow: var(--shadow);
}

.hero-card strong {
  display: block;
  margin-bottom: 12px;
  color: var(--green);
  font-size: 16px;
  text-transform: uppercase;
}

.hero-card span {
  display: block;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.2;
}

.hero-card small {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.guest-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.shop-panel,
.cart-panel {
  position: sticky;
  top: 16px;
  overflow: hidden;
}

.shop-photo {
  height: 170px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(17, 26, 32, 0.55)),
    url("https://images.unsplash.com/photo-1504674900247-0877df9cc836?auto=format&fit=crop&w=900&q=80") center/cover;
}

.shop-meta {
  padding: 20px;
}

.shop-meta p,
.muted,
.fine-print {
  color: var(--muted);
  line-height: 1.6;
}

.shop-meta dl {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

.shop-meta div {
  display: grid;
  gap: 3px;
}

dt {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

dd {
  margin: 0;
  font-weight: 750;
}

.language-switch {
  padding: 0 20px 20px;
}

.notice-box {
  margin: 0 20px 20px;
  padding: 16px;
  background: #fbf7ed;
}

.notice-box strong {
  display: block;
  margin-bottom: 8px;
}

.notice-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 16px;
}

.table-field {
  min-width: 190px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf1;
  color: var(--ink);
  outline: none;
}

input {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29, 107, 87, 0.14);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.menu-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  overflow: hidden;
}

.menu-image {
  min-height: 172px;
  background-position: center;
  background-size: cover;
}

.menu-content {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.menu-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.item-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.price {
  color: var(--green);
  font-size: 20px;
  font-weight: 950;
}

.allergy {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.primary-action {
  width: 100%;
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary-action {
  border-color: var(--green);
  background: var(--green-2);
  color: var(--green);
}

.ghost-action {
  background: transparent;
}

.cart-panel {
  padding: 20px;
}

.cart-header,
.cart-line,
.cart-total,
.dialog-head,
.ticket-head,
.ticket-line,
.ticket-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--red);
  color: white;
  font-weight: 900;
}

.cart-items {
  display: grid;
  gap: 10px;
  min-height: 94px;
  margin: 18px 0;
}

.cart-line {
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee3d4;
}

.cart-line strong,
.ticket-line strong {
  display: block;
}

.cart-line small,
.ticket-line small {
  color: var(--muted);
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-button {
  width: 32px;
  min-height: 32px;
  padding: 0;
}

.memo-field {
  margin-top: 12px;
}

.cart-total {
  margin: 18px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-weight: 900;
}

.cart-total strong {
  color: var(--green);
  font-size: 24px;
}

.fine-print {
  margin: 12px 0 0;
  font-size: 12px;
}

.board-layout {
  display: grid;
  gap: 18px;
}

.status-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.status-summary article {
  padding: 18px;
}

.status-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.status-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--green);
  font-size: 30px;
}

.order-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.order-ticket {
  padding: 18px;
}

.order-ticket.new {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 75, 54, 0.12);
}

.ticket-head {
  align-items: start;
  margin-bottom: 14px;
}

.status-chip {
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--green);
  background: var(--green-2);
  font-size: 12px;
  font-weight: 900;
}

.status-chip.new {
  color: var(--red);
  background: var(--red-2);
}

.ticket-lines {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.ticket-line {
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee3d4;
}

.ticket-note {
  margin: 12px 0;
  padding: 12px;
  border-radius: 8px;
  background: #f9f2e4;
  color: var(--muted);
  line-height: 1.55;
}

.status-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.status-button {
  min-height: 36px;
  padding: 0 8px;
  font-size: 12px;
}

.admin-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-card {
  padding: 22px;
}

.admin-card form,
.admin-card {
  display: grid;
  gap: 14px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.qr-preview {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.qr-preview img {
  width: 150px;
  height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

code {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 12px;
  padding: 10px;
  border-radius: 8px;
  background: #f3eadc;
  color: #4a3f33;
  font-size: 12px;
}

.handoff-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 26, 32, 0.56);
}

.dialog-backdrop[hidden] {
  display: none;
}

.dialog {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-radius: 12px;
  background: var(--paper);
  padding: 22px;
  box-shadow: var(--shadow);
}

.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
}

.dialog-lines {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 10px;
  background: var(--dark);
  color: white;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1120px) {
  .guest-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .cart-panel {
    position: static;
    grid-column: 1 / -1;
  }

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

@media (max-width: 820px) {
  .topbar,
  .hero-band,
  .guest-layout,
  .admin-layout,
  .order-board,
  .status-summary {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
  }

  .shop-panel {
    position: static;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  main,
  .topbar {
    width: min(100vw - 24px, 1240px);
  }

  h1 {
    font-size: 30px;
  }

  .hero-copy,
  .admin-card,
  .cart-panel {
    padding: 18px;
  }

  .menu-card {
    grid-template-columns: 1fr;
  }

  .menu-image {
    min-height: 150px;
  }

  .status-actions,
  .two-col,
  .qr-preview {
    grid-template-columns: 1fr;
  }
}
