/* Material Design 3 Expressive — Roboto Flex, rounded symbols, bold type, generous shape */

:root {
  --md-ref-typeface-plain: "Roboto Flex", "Roboto", system-ui, sans-serif;
  --md-ref-typeface-brand: "Roboto Flex", "Roboto", system-ui, sans-serif;

  /* Primary — coffee green */
  --md-sys-color-primary: #1b5e20;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #b8e6bc;
  --md-sys-color-on-primary-container: #07230b;

  /* Secondary — warm espresso (expressive contrast) */
  --md-sys-color-secondary: #6d4c3d;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #ffdcc6;
  --md-sys-color-on-secondary-container: #311300;

  /* Tertiary — sage accent */
  --md-sys-color-tertiary: #4a6350;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #cce8d1;
  --md-sys-color-on-tertiary-container: #082010;

  /* Surfaces — warm neutrals */
  --md-sys-color-surface: #faf8f6;
  --md-sys-color-surface-dim: #e8e4e0;
  --md-sys-color-surface-container-low: #f4f1ed;
  --md-sys-color-surface-container: #eeeae6;
  --md-sys-color-surface-container-high: #e8e4e0;
  --md-sys-color-surface-container-highest: #ffffff;

  --md-sys-color-on-surface: #1c1b19;
  --md-sys-color-on-surface-variant: #4a4540;

  --md-sys-color-outline: #7c756e;
  --md-sys-color-outline-variant: #cec4ba;

  --md-sys-state-hover: 0.08;
  --md-sys-state-focus: 0.12;
  --md-sys-state-press: 0.12;

  --md-sys-color-error: #ba1a1a;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-on-error-container: #410002;

  --md-sys-color-success: #1b5e20;
  --md-sys-color-success-container: #dff6e1;
  --md-sys-color-info: #1565c0;
  --md-sys-color-info-container: #d8e8ff;

  /* Expressive shape — larger, softer corners */
  --md-sys-shape-corner-extra-small: 8px;
  --md-sys-shape-corner-small: 12px;
  --md-sys-shape-corner-medium: 20px;
  --md-sys-shape-corner-large: 28px;
  --md-sys-shape-corner-extra-large: 32px;
  --md-sys-shape-corner-full: 9999px;

  /* Softer, broader elevation (M3 expressive feel) */
  --md-elevation-1: 0 1px 2px rgba(29, 27, 22, 0.08), 0 2px 8px rgba(29, 27, 22, 0.06);
  --md-elevation-2: 0 2px 6px rgba(29, 27, 22, 0.1), 0 8px 20px rgba(29, 27, 22, 0.08);
  --md-elevation-3: 0 4px 12px rgba(29, 27, 22, 0.12), 0 12px 32px rgba(29, 27, 22, 0.1);

  --bg: var(--md-sys-color-surface);
  --card: var(--md-sys-color-surface-container-highest);
  --text: var(--md-sys-color-on-surface);
  --muted: var(--md-sys-color-on-surface-variant);
  --accent: var(--md-sys-color-primary);
  --accent-hover: #154918;
  --border: var(--md-sys-color-outline-variant);
  --error: var(--md-sys-color-error);
  --success: var(--md-sys-color-success);
  --info: var(--md-sys-color-info);
}

* {
  box-sizing: border-box;
}

.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.md-body {
  margin: 0;
  font-family: var(--md-ref-typeface-plain);
  font-optical-sizing: auto;
  background:
    radial-gradient(100% 90% at 100% -10%, color-mix(in srgb, var(--md-sys-color-primary-container) 55%, transparent) 0%, transparent 52%),
    radial-gradient(80% 60% at -5% 105%, color-mix(in srgb, var(--md-sys-color-secondary-container) 45%, transparent) 0%, transparent 48%),
    var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  line-height: 1.5;
  min-height: 100vh;
}

/* Typography — MD3 Expressive (Roboto Flex + optical size / weight variation) */
.md-display-small {
  font-family: var(--md-ref-typeface-brand);
  font-size: 2.25rem;
  font-weight: 400;
  line-height: 2.75rem;
  letter-spacing: -0.02em;
  margin: 0;
  font-variation-settings: "opsz" 36, "wdth" 100, "GRAD" 0;
}

.md-headline-medium {
  font-family: var(--md-ref-typeface-brand);
  font-size: 2rem;
  font-weight: 500;
  line-height: 2.375rem;
  letter-spacing: -0.015em;
  margin: 0;
  font-variation-settings: "opsz" 32, "wdth" 100, "GRAD" 0;
}

.md-headline-small {
  font-family: var(--md-ref-typeface-brand);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 2.125rem;
  letter-spacing: -0.01em;
  margin: 0;
  font-variation-settings: "opsz" 28, "wdth" 100, "GRAD" 0;
}

.md-title-medium {
  font-family: var(--md-ref-typeface-plain);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5rem;
  letter-spacing: 0.00625em;
  font-variation-settings: "opsz" 17, "wdth" 100, "GRAD" 0;
}

.md-title-small {
  font-family: var(--md-ref-typeface-plain);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  letter-spacing: 0.01em;
  font-variation-settings: "opsz" 14, "wdth" 100, "GRAD" 0;
}

.md-body-medium {
  font-family: var(--md-ref-typeface-plain);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.375rem;
  letter-spacing: 0.0175em;
  font-variation-settings: "opsz" 14, "wdth" 100, "GRAD" 0;
}

.md-label-large {
  font-family: var(--md-ref-typeface-plain);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  letter-spacing: 0.01em;
  font-variation-settings: "opsz" 14, "wdth" 100, "GRAD" 0;
}

/* Top app bar — expressive large-corner container */
.mdc-top-app-bar {
  background: color-mix(in srgb, var(--md-sys-color-surface-container-highest) 92%, var(--md-sys-color-primary-container));
  color: var(--md-sys-color-on-surface);
  box-shadow: var(--md-elevation-1);
  border-bottom: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 65%, transparent);
}

.mdc-top-app-bar__row {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0.875rem 1.125rem;
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.mdc-top-app-bar__title {
  font-family: var(--md-ref-typeface-brand);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.875rem;
  color: var(--md-sys-color-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 24, "wdth" 100, "GRAD" 25;
}

.mdc-top-app-bar__title:hover {
  text-decoration: none;
  opacity: 0.92;
}

.mdc-top-app-bar__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
  font-family: var(--md-ref-typeface-plain);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.55rem 1rem;
  border-radius: var(--md-sys-shape-corner-full);
  transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1), transform 0.2s cubic-bezier(0.2, 0, 0, 1);
  font-variation-settings: "opsz" 14, "wdth" 100, "GRAD" 0;
}

.nav a:hover {
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent);
  text-decoration: none;
  transform: translateY(-1px);
}

.nav a:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.inline {
  display: inline;
  margin: 0;
}

.link-btn {
  background: none;
  border: none;
  padding: 0.55rem 1rem;
  font-family: var(--md-ref-typeface-plain);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--md-sys-color-secondary);
  cursor: pointer;
  border-radius: var(--md-sys-shape-corner-full);
  text-decoration: none;
  transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1);
  font-variation-settings: "opsz" 14, "wdth" 100, "GRAD" 0;
}

.link-btn:hover {
  background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
  text-decoration: none;
}

.link-btn:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.main {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.1rem 1rem 2.25rem;
}

.flashes {
  list-style: none;
  padding: 0;
  margin: 0 0 0.85rem;
}

.flash {
  padding: 1rem 1.125rem;
  border-radius: var(--md-sys-shape-corner-medium);
  margin-bottom: 0.5rem;
  font-family: var(--md-ref-typeface-plain);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--md-elevation-1);
  font-variation-settings: "opsz" 14, "wdth" 100, "GRAD" 0;
}

.flash-error {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.flash-success {
  background: var(--md-sys-color-success-container);
  color: #1b5e20;
}

.flash-info {
  background: var(--md-sys-color-info-container);
  color: #0d47a1;
}

/* Cards */
.card {
  background: var(--md-sys-color-surface-container-highest);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 80%, transparent);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 1.75rem;
  box-shadow: var(--md-elevation-1);
}

.card.narrow {
  max-width: 22rem;
  margin: 2rem auto;
}

.card.narrow h1 {
  margin: 0 0 0.5rem;
}

.card.narrow .muted {
  margin: 0 0 1.25rem;
}

.mdc-elevation-1 {
  box-shadow: var(--md-elevation-1);
}

.mdc-elevation-2 {
  box-shadow: var(--md-elevation-2);
}

/* Outlined text fields (login) */
.stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.md-outlined-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.md-outlined-field__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  letter-spacing: 0.03125em;
}

.md-outlined-field input {
  padding: 0.875rem 1.125rem;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-small);
  font-size: 1rem;
  font-family: var(--md-ref-typeface-plain);
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  transition: border-color 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1);
  font-variation-settings: "opsz" 17, "wdth" 100, "GRAD" 0;
}

.md-outlined-field input:hover {
  border-color: var(--md-sys-color-on-surface);
}

.md-outlined-field input:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 1px var(--md-sys-color-primary);
}

.muted {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.875rem;
  font-family: var(--md-ref-typeface-plain);
  font-variation-settings: "opsz" 14, "wdth" 100, "GRAD" 0;
}

code {
  font-size: 0.8125rem;
  font-family: ui-monospace, monospace;
  background: var(--md-sys-color-surface-container);
  padding: 0.15em 0.4em;
  border-radius: var(--md-sys-shape-corner-extra-small);
  border: 1px solid var(--md-sys-color-outline-variant);
}

a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Buttons — filled (M3 Expressive) */
.mdc-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  font-family: var(--md-ref-typeface-plain);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  cursor: pointer;
  border-radius: var(--md-sys-shape-corner-full);
  transition: box-shadow 0.25s cubic-bezier(0.2, 0, 0, 1), background-color 0.25s cubic-bezier(0.2, 0, 0, 1), transform 0.2s cubic-bezier(0.2, 0, 0, 1);
  font-variation-settings: "opsz" 14, "wdth" 100, "GRAD" 0;
}

.mdc-button--filled {
  min-height: 2.75rem;
  padding: 0 1.625rem;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-elevation-2);
}

.mdc-button--filled:hover {
  background: var(--accent-hover);
  box-shadow: var(--md-elevation-2);
  transform: translateY(-1px);
}

.mdc-button--filled:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.primary.mdc-button--filled,
button.primary:not(.mdc-button--outlined) {
  min-height: 2.75rem;
  padding: 0 1.625rem;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--md-ref-typeface-plain);
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: var(--md-elevation-2);
  font-variation-settings: "opsz" 14, "wdth" 100, "GRAD" 0;
  transition: box-shadow 0.25s cubic-bezier(0.2, 0, 0, 1), background-color 0.25s cubic-bezier(0.2, 0, 0, 1), transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

button.primary:not(.mdc-button--outlined):hover {
  background: var(--accent-hover);
  box-shadow: var(--md-elevation-3);
  transform: translateY(-1px);
}

button.primary:not(.mdc-button--outlined):focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

/* Outlined + error button */
.mdc-button--outlined {
  min-height: 2.5rem;
  padding: 0 1.5rem;
  background: transparent;
  border: 1px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-primary);
}

.mdc-button--outlined:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}

.mdc-button--error.mdc-button--outlined {
  border-color: var(--md-sys-color-error);
  color: var(--md-sys-color-error);
}

.mdc-button--error.mdc-button--outlined:hover {
  background: color-mix(in srgb, var(--md-sys-color-error) 8%, transparent);
}

.danger.mdc-button--outlined,
button.danger {
  min-height: 2.75rem;
  padding: 0 1.625rem;
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--md-ref-typeface-plain);
  letter-spacing: 0.03em;
  cursor: pointer;
  background: transparent;
  color: var(--md-sys-color-error);
  border: 1px solid var(--md-sys-color-error);
  font-variation-settings: "opsz" 14, "wdth" 100, "GRAD" 0;
  transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1), transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.danger.mdc-button--outlined:hover,
button.danger:hover {
  background: var(--md-sys-color-error-container);
}

button.danger:focus-visible {
  outline: 2px solid var(--md-sys-color-error);
  outline-offset: 2px;
}

/* Menu */
.menu-intro h1 {
  margin: 0 0 0.25rem;
}

.menu-intro p {
  margin: 0.3rem 0 0;
  line-height: 1.45;
}

.category {
  margin-top: 1.35rem;
  background: var(--md-sys-color-surface-container-highest);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 75%, transparent);
  border-radius: var(--md-sys-shape-corner-extra-large);
  padding: 1rem 1.125rem 0.35rem;
  box-shadow: var(--md-elevation-1);
}

.category h2 {
  margin: 0 0 0.75rem;
  font-family: var(--md-ref-typeface-plain);
  color: var(--md-sys-color-secondary);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.875rem;
  text-align: center;
  text-transform: none;
  letter-spacing: 0.02em;
  font-variation-settings: "opsz" 24, "wdth" 100, "GRAD" 0;
}

.category--favorites {
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 22%, var(--md-sys-color-outline-variant));
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--md-sys-color-primary-container) 35%, var(--md-sys-color-surface-container-highest)) 0%,
    var(--md-sys-color-surface-container-highest) 48%
  );
}

.category--favorites h2 {
  color: var(--md-sys-color-primary);
  font-size: 1.625rem;
  line-height: 2rem;
  font-variation-settings: "opsz" 28, "wdth" 100, "GRAD" 25;
}

.favorites-group {
  margin-top: 0.75rem;
}

.favorites-group:first-of-type {
  margin-top: 0;
}

.favorites-group__title {
  margin: 0 0 0.5rem;
  color: var(--md-sys-color-on-surface-variant);
  font-family: var(--md-ref-typeface-plain);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  letter-spacing: 0.02em;
  font-variation-settings: "opsz" 20, "wdth" 100, "GRAD" 0;
}

.item-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.item-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 0;
}

.item-info strong {
  font-family: var(--md-ref-typeface-plain);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--md-sys-color-on-surface);
  font-variation-settings: "opsz" 17, "wdth" 100, "GRAD" 0;
}

.item-price {
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
}

.item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.item-row:last-child {
  border-bottom: none;
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.qty-stepper input[type="number"] {
  width: 2.85rem;
  padding: 0.4rem 0.3rem;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-small);
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
  -moz-appearance: textfield;
}

.qty-stepper input[type="number"]:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 1px var(--md-sys-color-primary);
}

.qty-stepper input[type="number"]::-webkit-outer-spin-button,
.qty-stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.mdc-icon-button.qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.mdc-icon-button.qty-btn .material-symbols-rounded {
  font-size: 1.35rem;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}

.mdc-icon-button.qty-btn:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
  border: none;
}

.mdc-icon-button.qty-btn:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.menu-form {
  padding-bottom: 4.75rem;
}

.menu-fab {
  position: fixed;
  z-index: 40;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  margin: 0;
  pointer-events: none;
}

.menu-fab__btn {
  pointer-events: auto;
  box-shadow: var(--md-elevation-3);
  border-radius: var(--md-sys-shape-corner-full);
  padding: 1.1rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  max-width: calc(100vw - 2rem);
  line-height: 1.25;
  text-align: center;
  font-variation-settings: "opsz" 17, "wdth" 100, "GRAD" 0;
  transition: box-shadow 0.3s cubic-bezier(0.2, 0, 0, 1), transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.menu-fab__btn:hover {
  box-shadow: var(--md-elevation-3), 0 0 0 3px color-mix(in srgb, var(--md-sys-color-primary-container) 65%, transparent);
  transform: translateY(-2px) scale(1.02);
}

.mdc-fab-extended.menu-fab__btn {
  gap: 0.5rem;
}

.menu-fab__icon {
  font-size: 1.35rem;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Group order */
.order-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.order-card {
  background: var(--md-sys-color-surface-container-highest);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 75%, transparent);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 1rem 1.125rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--md-elevation-2);
}

.order-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.35rem;
}

.order-card time {
  font-size: 0.8125rem;
  color: var(--md-sys-color-on-surface-variant);
}

.order-card .total {
  font-weight: 700;
  color: var(--md-sys-color-primary);
}

.order-card .lines {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.875rem;
}

.group-order .meta-times {
  margin-top: -0.15rem;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.group-order .meta-sep {
  margin: 0 0.35rem;
}

.order-list.single {
  margin-top: 0.35rem;
}

.orders-page h1 {
  margin: 0 0 0.25rem;
}

.orders-page > p.muted:not(.meta-times) {
  margin: 0.3rem 0 0;
  line-height: 1.45;
}

.group-card {
  padding-bottom: 0;
}

.consolidated {
  list-style: none;
  padding: 0;
  margin: 0;
}

.consolidated-line {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.consolidated-line:last-of-type {
  border-bottom: none;
}

.line-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.line-main .line-total {
  font-weight: 500;
  color: var(--md-sys-color-primary);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.by-user {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
}

.by-user .chip {
  white-space: nowrap;
  padding: 0.25rem 0.65rem;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  font-weight: 600;
  font-family: var(--md-ref-typeface-plain);
  font-size: 0.8125rem;
  font-variation-settings: "opsz" 14, "wdth" 100, "GRAD" 0;
}

.by-user--chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  align-items: center;
}

.chip-row {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.chip-remove-form {
  display: inline;
  margin: 0;
}

.chip-remove-btn {
  background: color-mix(in srgb, var(--md-sys-color-error) 10%, transparent);
  border: none;
  padding: 0.25rem 0.5rem;
  margin: 0;
  font-family: var(--md-ref-typeface-plain);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--md-sys-color-error);
  cursor: pointer;
  border-radius: var(--md-sys-shape-corner-full);
  text-decoration: none;
  font-variation-settings: "opsz" 12, "wdth" 100, "GRAD" 0;
}

.chip-remove-btn:hover {
  background: var(--md-sys-color-error-container);
  text-decoration: none;
}

.chip-remove-btn:focus-visible {
  outline: 2px solid var(--md-sys-color-error);
  outline-offset: 1px;
}

.group-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.35rem;
  padding: 0.65rem 0 0;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  font-family: var(--md-ref-typeface-plain);
  font-size: 1rem;
  font-weight: 600;
  font-variation-settings: "opsz" 17, "wdth" 100, "GRAD" 0;
}

.group-total strong {
  color: var(--md-sys-color-primary);
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-variation-settings: "opsz" 20, "wdth" 100, "GRAD" 25;
}

.clear-order-form {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}

.clear-order-hint {
  margin: 0.75rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}

/* color-mix fallback for older Safari — graceful degradation */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .md-body {
    background: var(--md-sys-color-surface);
  }

  .mdc-top-app-bar {
    background: var(--md-sys-color-surface-container-highest);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
  }

  .card {
    border: 1px solid var(--md-sys-color-outline-variant);
  }

  .category {
    border: 1px solid var(--md-sys-color-outline-variant);
  }

  .category--favorites {
    border: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container-highest);
  }

  .order-card {
    border: 1px solid var(--md-sys-color-outline-variant);
  }

  .menu-fab__btn:hover {
    box-shadow: var(--md-elevation-3);
  }

  .chip-remove-btn {
    background: rgba(186, 26, 26, 0.1);
  }

  .nav a:hover {
    background-color: rgba(27, 94, 32, 0.12);
  }

  .link-btn:hover {
    background-color: rgba(93, 64, 55, 0.08);
  }

  .mdc-icon-button.qty-btn:hover {
    background: rgba(0, 0, 0, 0.06);
  }

  .mdc-button--outlined:hover {
    background: rgba(27, 94, 32, 0.08);
  }

  .mdc-button--error.mdc-button--outlined:hover {
    background: rgba(186, 26, 26, 0.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav a:hover,
  .mdc-button--filled:hover,
  button.primary:not(.mdc-button--outlined):hover,
  .menu-fab__btn:hover {
    transform: none;
  }

  .mdc-button,
  button.primary:not(.mdc-button--outlined),
  .menu-fab__btn,
  .nav a {
    transition-duration: 0.01ms;
  }
}