:root {
  --ink: #27251f;
  --muted: #68756f;
  --paper: #f3f6f3;
  --white: #fff;
  --accent: #c94e36;
  --accent-dark: #a73b29;
  --line: #dde6df;
  --green: #28704e;
  --shadow: 0 3px 12px rgba(30, 59, 43, .045);
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); background: var(--paper);
  font: 15px/1.65 "DM Sans", "Noto Sans SC", system-ui, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; }
.site-header {
  min-height: 68px; padding: 0 max(24px, calc((100vw - 1180px) / 2));
  display: flex; align-items: center; justify-content: space-between; gap: 16px 20px; flex-wrap: wrap;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--ink); font-size: 20px; font-weight: 800; white-space: nowrap;
}
.hero-heading {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; width: 100%; min-width: 0;
}
.hero-heading > div { min-width: 0; }
.hero-logo {
  width: 120px; height: 120px; flex: 0 0 auto; display: block;
  object-fit: contain; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255,255,255,.9);
}
.site-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; min-width: 0; max-width: 100%; }
.site-header nav > a, .link-button { display: inline-flex; align-items: center; min-height: 40px; }
.site-header nav > a { color: var(--muted); font-weight: 500; }
.site-header nav > a:hover { color: var(--accent-dark); }
.nav-user, .muted { color: var(--muted); }
.nav-user { min-width: 0; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-form { display: inline; margin: 0; }
.link-button { border: 0; background: none; padding: 0; color: var(--accent-dark); cursor: pointer; }
.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 48px; flex: 1; }
.site-footer { padding: 20px; text-align: center; background: #eaf0eb; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.hero {
  min-height: 126px; margin-bottom: 28px; padding: 12px 0 20px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
  justify-content: space-between;
}
.hero h1 { margin: 2px 0 0; font-size: 30px; line-height: 1.25; }
.hero p { margin: 5px 0 0; color: var(--muted); }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 700; margin: 0 0 4px; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { font-size: 30px; line-height: 1.25; margin: 0; }
h2 { font-size: 20px; margin: 0; }
h3 { font-size: 18px; margin: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 18px; }
.section-heading p { color: var(--muted); margin: 5px 0 0; font-size: 13px; }
.dish-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.wish-form { max-width: 760px; margin: 0 0 28px; }
.wish-form textarea { min-height: 110px; }
.wish-list { display: grid; gap: 10px; }
.wish-card { padding: 16px 18px; }
.wish-card p { margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.wish-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 12px; color: var(--muted); font-size: 12px; }
.wish-status { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 10px; background: #fff2dc; color: #81562e; font-size: 12px; font-weight: 700; }
.wish-status.reviewed { color: #346b53; background: #e4f0e7; }
.wish-status.fulfilled { color: #514b42; background: #eeeae2; }
.wish-staff-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dish-card, .panel, .review-card { border: 1px solid var(--line); background: var(--white); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.dish-visual {
  position: relative;
  /* Use a taller, photo-friendly frame so common landscape dish photos do not
     look like a small strip inside a wide card. contain still keeps every
     pixel visible for square and portrait photos. */
  aspect-ratio: 4 / 3;
  background: var(--paper);
}
.dish-image, .dish-placeholder {
  width: 100%; height: 100%; display: block; object-fit: contain;
}
.dish-image { background: var(--paper); padding: 6px; }
.dish-placeholder { display: grid; place-items: center; color: #68756f; background: #e7ede8; font-size: 58px; font-weight: 800; }
.dish-content { padding: 15px; }
.dish-title, .review-top, .order-heading, .order-bottom, .total-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dish-title { align-items: baseline; }
.dish-title h1, .dish-title h3 { min-width: 0; }
.dish-title a { color: var(--ink); }
.price { color: var(--accent-dark); font-size: 19px; font-weight: 700; white-space: nowrap; }
.description { min-height: 42px; color: var(--muted); margin: 7px 0 10px; font-size: 13px; }
.dish-meta { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 5px 8px; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.card-reviews { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 10px; }
.card-reviews p { color: var(--muted); margin: 0 0 6px; font-size: 12px; }
.card-reviews .stars { margin-right: 5px; }
.review-link { display: inline-block; font-size: 12px; margin-top: 4px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
input:not([type=checkbox]), textarea, select {
  width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px;
  color: var(--ink); background: #fff; outline: 0;
}
input:focus, textarea:focus, select:focus { border-color: #bc765f; box-shadow: 0 0 0 3px rgba(207,89,55,.12); }
textarea { resize: vertical; }
.dish-controls { display: grid; grid-template-columns: minmax(0, 1fr) 100px; align-items: end; gap: 12px; }
.dish-controls > div { min-width: 0; }
.dish-controls label { margin: 0 0 5px; font-size: 12px; color: var(--muted); }
.quantity-stepper { display: grid; grid-template-columns: minmax(28px, 1fr) 30px; grid-template-rows: 21px 21px; align-items: center; gap: 2px 7px; min-height: 44px; width: min(105px, 100%); }
.quantity-value { grid-column: 1; grid-row: 1 / 3; }
.quantity-button { width: 30px; height: 21px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff2ee; color: var(--accent-dark); font-size: 9px; line-height: 1; font-weight: 700; cursor: pointer; }
.quantity-up { grid-column: 2; grid-row: 1; }
.quantity-down { grid-column: 2; grid-row: 2; }
.quantity-button:hover:not(:disabled) { background: #f8dfd8; }
.quantity-button:disabled { color: #a9afa9; background: #f0f2ef; cursor: not-allowed; }
.quantity-value { display: block; min-width: 20px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.checkout { padding: 20px; margin-top: 16px; }
.checkout:not(.login-prompt) { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.checkout h2 { margin-bottom: 4px; }
.checkout .muted { margin-top: 0; }
.checkout-copy { min-width: 0; }
.delivery-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 16px; margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.delivery-summary strong { color: var(--ink); }
.delivery-summary > * { overflow-wrap: anywhere; min-width: 0; }
.delivery-missing { color: #9a4837; font-size: 13px; margin: 5px 0 0; }
.checkout > .button { flex: 0 0 auto; }
.button:disabled, .button:disabled:hover { color: #717b75; background: #dfe5e0; cursor: not-allowed; transform: none; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.full-width { grid-column: 1 / -1; }
.cooking-options { min-width: 0; margin: 22px 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--line); }
.cooking-options > legend { padding: 0 8px 0 0; font-size: 17px; font-weight: 700; }
.cooking-option-row { min-width: 0; margin: 8px 0 14px; padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--line); }
.cooking-option-row > legend { color: var(--muted); font-size: 12px; }
.cooking-option-row .field-grid { align-items: end; gap: 0 12px; }
.cooking-option-row .form-field { min-width: 0; }
.cooking-option-row label { margin-top: 8px; }
.option-checkbox { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; font-size: 13px; }
.option-checkbox input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--green); }
.delete-option { color: #874238; }
.cooking-option-list { min-width: 0; }
.cooking-options > .button { margin-top: 4px; }
.notice { padding: 11px 13px; border-left: 3px solid #c88739; background: #fbf5e9; color: #695331; font-size: 13px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 18px; border: 0; border-radius: 999px; font-weight: 700; cursor: pointer; text-decoration: none !important; transition: transform .16s, background .16s, box-shadow .16s; }
.button:hover { transform: translateY(-1px); }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); }
.secondary { color: #514b42; background: #eeeae2; }
.ghost { color: var(--accent-dark); background: #fff2ee; }
.danger { color: white; background: #8b4032; }
.small { min-height: 38px; padding: 6px 15px; font-size: 12px; }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.reviews-section { margin-top: 56px; }
.review-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.review-card { padding: 16px; }
.review-card p { margin: 10px 0; }
.review-card time { color: var(--muted); font-size: 11px; }
.stars { color: #a56a18; font-weight: 700; white-space: nowrap; }
.panel { padding: 18px; }
.auth-card, .form-card { max-width: 680px; margin: 12px auto; padding: 24px; }
.form-card a { overflow-wrap: anywhere; }
.form-card input[type=file] { max-width: 100%; }
.customer-create { max-width: 900px; margin: 0 0 18px; }
.form-group { min-width: 0; border: 0; margin: 22px 0 0; padding: 0; }
.form-group + .form-group { border-top: 1px solid var(--line); padding-top: 20px; }
.form-group legend { font-size: 14px; font-weight: 700; padding: 0 0 4px; }
.form-group + .form-group legend { padding-right: 12px; }
.form-field { min-width: 0; }
.form-field label { margin: 10px 0 5px; }
.form-actions { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; }
.form-card .form-actions .button { margin: 0; }
.auth-card h1, .form-card h1 { margin: 4px 0 8px; }
.auth-card .button, .form-card .button { margin-top: 15px; }
.auth-card > form > .button, .form-card form > .button { width: 100%; }
.help-text { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.6; margin: 6px 0; }
.help-text ul { padding-left: 18px; margin: 6px 0; }
.field-error, .form-errors { color: #a52920; font-size: 13px; }
.field-error { margin: 5px 0; }
.form-errors ul { padding-left: 20px; }
.messages { margin-bottom: 18px; }
.message { padding: 11px 14px; border-radius: 8px; background: #e8f1ea; color: #315a3e; }
.message.error { color: #852d24; background: #f9e9e5; }
.message.warning { color: #6b4c20; background: #fbf3e0; }
.order-card { padding: 18px; }
.order-heading { border-bottom: 1px solid var(--line); padding-bottom: 13px; margin-bottom: 12px; }
.order-heading > div { display: grid; gap: 3px; min-width: 0; }
.order-heading strong { overflow-wrap: anywhere; }
.order-heading .muted { font-size: 13px; }
.order-number { font-size: 22px; line-height: 1.4; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.status { flex-shrink: 0; }
.status, .badge { display: inline-flex; align-items: center; color: #81562e; background: #f5ead8; border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.compact-list { margin: 10px 0; padding: 0; list-style: none; }
.compact-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); overflow-wrap: anywhere; }
.compact-list li span { white-space: nowrap; }
.order-bottom { border-top: 1px solid var(--line); padding-top: 13px; margin-top: 13px; }
.stack { display: grid; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 38px 20px; }
.back-link { display: inline-block; margin: 0 0 18px; }
.order-detail { max-width: 850px; margin: 0 auto; }
.order-detail > h2 { font-size: 16px; margin-top: 24px; }
.delivery-block { padding: 14px 16px; background: var(--paper); border-radius: 6px; }
.delivery-block h2 { font-size: 14px; }
.delivery-block p { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.delivery-block .tracking-number { color: var(--ink); border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.timeline { display: flex; justify-content: space-between; margin: 22px 0; position: relative; }
.timeline span { flex: 1; text-align: center; color: #aaa49b; font-size: 12px; }
.timeline span:before { content: ""; display: block; height: 5px; background: #e9e5dd; margin-bottom: 8px; }
.timeline span:first-child:before { border-radius: 5px 0 0 5px; }
.timeline span:last-child:before { border-radius: 0 5px 5px 0; }
.timeline span.active { color: var(--green); font-weight: 700; }
.timeline span.active:before { background: #6f9b7b; }
.line-item { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: start; gap: 10px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line-image { width: 74px; height: 74px; border-radius: 8px; object-fit: contain; background: var(--paper); }
.line-placeholder { display: grid; place-items: center; background: var(--paper); color: var(--muted); font-weight: 700; }
.line-info { min-width: 0; display: grid; gap: 3px; overflow-wrap: anywhere; }
.line-info > span { color: var(--muted); font-size: 13px; }
.line-subtotal { font-size: 14px; white-space: nowrap; }
.line-item > .review-form, .line-item > .review-confirmation { grid-column: 2 / -1; min-width: 0; }
.review-form { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 6px; display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; align-items: end; gap: 9px; }
.review-form label { margin: 4px 0; }
.review-form .button { margin: 0 0 4px; }
.review-confirmation { font-size: 13px; margin: 6px 0; }
.total-row { padding-top: 16px; margin-top: 12px; border-top: 1px solid var(--line); font-size: 18px; }
.advance-form { display: flex; align-items: end; gap: 12px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px; }
.advance-form label { width: min(360px, 100%); min-width: 0; margin: 0; }
.advance-form .button { flex-shrink: 0; }
.manage-row { display: flex; align-items: center; gap: 15px; }
.manage-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.manage-main h2 { font-size: 17px; }
.manage-main p { color: var(--muted); font-size: 13px; margin: 5px 0 0; }
.manage-image { width: 64px; height: 64px; object-fit: contain; border-radius: 4px; background: var(--paper); }
.customer-row { align-items: center; padding: 16px 18px; }
.customer-row .button-row { justify-content: flex-end; }
.customer-username { font-size: 12px; font-weight: 400; }
.customer-address { color: var(--muted); overflow-wrap: anywhere; }
.badge { margin-left: 4px; color: #6b655c; background: #eeeae2; font-size: 10px; padding: 3px 9px; }
.badge.active { color: #346b53; background: #e4f0e7; }
.top-gap { margin-top: 18px; }
.dish-detail { max-width: 850px; margin: 0 auto; }
.dish-detail-image { display: block; width: 100%; height: 360px; margin-top: 20px; border-radius: 6px; object-fit: contain; background: var(--paper); padding: 10px; }
.dish-detail > h2 { font-size: 18px; margin: 25px 0 12px; }
.dish-detail .review-card { margin-top: 12px; box-shadow: none; }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin-top: 24px; }
:focus-visible { outline: 3px solid #bc765f; outline-offset: 3px; }
@media (max-width: 900px) {
  .dish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-grid { grid-template-columns: repeat(2, 1fr); }
  .section-heading { flex-wrap: wrap; }
  .customer-row { flex-wrap: wrap; }
  .customer-row > .button-row { width: 100%; }
}
@media (max-width: 620px) {
  .site-header { min-height: 64px; padding: 12px 14px 4px; gap: 4px 12px; flex-wrap: wrap; }
  .site-header nav { width: 100%; gap: 4px 18px; font-size: 13px; }
  .nav-user { display: none; }
  .container { width: calc(100% - 28px); padding-top: 16px; }
  .hero { min-height: 100px; padding: 8px 0 15px; margin-bottom: 22px; }
  .hero h1 { font-size: 27px; }
  .dish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .review-grid, .field-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .dish-visual { aspect-ratio: 4 / 3; }
  .description { min-height: 0; }
  .dish-controls { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .dish-title h3 { font-size: 15px; }
  .dish-content { padding: 10px; }
  .price { font-size: 16px; }
  input:not([type=checkbox]), textarea, select { font-size: 16px; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .section-heading h1 { font-size: 26px; }
  .manage-row { flex-wrap: wrap; }
  .manage-row > .button-row { width: 100%; }
  .customer-row { align-items: flex-start; }
  .customer-row .button-row { justify-content: flex-start; }
  .customer-row .button-row .button { flex: 1 1 auto; }
  .small { min-height: 42px; }
  .form-actions > .button { width: 100%; }
  .line-item { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px 10px; }
  .line-image { width: 56px; height: 56px; border-radius: 6px; }
  .line-item > .review-form, .line-item > .review-confirmation { grid-column: 1 / -1; }
  .review-form { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 17px; }
  .checkout:not(.login-prompt) { align-items: flex-start; flex-direction: column; gap: 13px; padding: 16px; }
  .checkout:not(.login-prompt) > .button { width: 100%; }
  .order-heading { align-items: flex-start; }
  .order-number { font-size: 17px; }
  .advance-form { flex-wrap: wrap; }
  .advance-form label { width: 100%; }
  .delivery-block { padding: 12px; }
  .dish-detail-image { height: 260px; }
}
