:root {
  color-scheme: light;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #e9e8dc;
  color: #192e23;
  --paper: #f7f7ed;
  --white: #fffef8;
  --green: #173829;
  --green-light: #e9f0d9;
  --lime: #d3ed86;
  --muted: #506254;
  --border: #dcdfcf;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, .header-link { -webkit-tap-highlight-color: transparent; cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button, input, textarea, select, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #548354; outline-offset: 2px;
}
.app-shell { max-width: 580px; margin-inline: auto; background: var(--paper); min-height: 100vh; min-height: 100dvh; }
.home { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 13px max(18px, env(safe-area-inset-left));
  color: #fffef5; background: var(--green);
}
h1, h2, h3, p { margin: 0; }
.topbar h1 { font-size: 25px; letter-spacing: .02em; }
.header-link {
  color: inherit; font-weight: 650; border: 1px solid #ffffff46; border-radius: 9px; text-decoration: none;
  padding: 8px 12px; min-height: 40px; display: inline-flex; align-items: center; white-space: nowrap;
}
.queue {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 17px max(14px, env(safe-area-inset-right)) 22px max(14px, env(safe-area-inset-left));
}
.notice {
  display: flex; align-items: center; gap: 9px; justify-content: space-between; margin-bottom: 12px;
  background: #f9ebc7; border: 1px solid #e7d8ab; border-radius: 10px; padding: 8px 10px; color: #4c3a16; font-size: 14px;
}
.notice a { font-weight: 700; color: #4d3b15; white-space: nowrap; padding: 6px 0; }
.cards { display: grid; gap: 12px; }
.order-card {
  display: grid; gap: 8px;
  padding: 12px 13px; background: var(--white); border: 1px solid var(--border); border-radius: 12px;
}
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-heading h2 { min-width: 0; font-size: clamp(21px, 5.8vw, 27px); line-height: 1.22; overflow-wrap: anywhere; }
.order-card .chips:empty { display: none; }
.chips, .selected-tags { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; padding: 0; margin: 0; }
.chips li, .tag-chip {
  font-size: 14px; line-height: 1.35; font-weight: 650; padding: 3px 6px; border-radius: 5px;
  color: #26432b; background: var(--green-light);
}
.chips { gap: 6px; }
.chips li, .card-default-preparation { font-size: 16px; line-height: 1.35; padding-block: 4px; }
.chips li { padding-inline: 8px; border-radius: 6px; }
.card-default-preparation { color: var(--muted); }
.chips .negative, .tag-chip.negative { color: #593519; background: #f8e9d0; }
.chips [data-category="preparation"] { color: #214d6b; background: #dfedf7; }
.chips [data-category="add-on"] { color: #58317c; background: #eee3fa; }
.card-actions { display: flex; flex: 0 0 auto; gap: 10px; }
.primary, .danger {
  min-height: 44px; border: 0; padding: 8px 13px; border-radius: 9px; font-weight: 750; background: var(--green); color: white;
}
.card-action {
  inline-size: 64px; min-height: 44px; padding: 6px; border-radius: 9px; border: 1px solid #c9d1c1;
  color: var(--green); background: var(--white); font-size: 16px; font-weight: 750; white-space: nowrap;
}
.complete-button { border-color: var(--green); background: var(--green); color: white; }
.text-button { color: #405747; background: none; border: 0; min-height: 39px; padding: 4px 7px; font-weight: 650; font-size: 14px; }
.empty { display: grid; place-items: center; align-content: center; min-height: min(41vh, 270px); gap: 14px; color: var(--muted); }
.empty p { font-size: 15px; }
.bowl-mark {
  position: relative; width: 42px; height: 24px; border: 2px solid #789277;
  border-radius: 2px 2px 22px 22px; display: inline-block; margin-top: 11px;
}
.bowl-mark::before { content: ""; position: absolute; width: 32px; height: 2px; top: -8px; right: 1px; transform: rotate(-12deg); background: #789277; }
.bowl-mark::after { content: ""; position: absolute; width: 18px; height: 2px; bottom: -5px; left: 10px; background: #789277; }
.dock {
  position: relative; padding: 7px max(13px, env(safe-area-inset-right)) calc(11px + env(safe-area-inset-bottom)) max(13px, env(safe-area-inset-left));
  border-top: 1px solid var(--border); background: #fdfdf4;
}
.dock-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.voice-wave {
  display: block; width: min(220px, 82%); height: auto; margin: 1px auto 7px; pointer-events: none;
  border-radius: 999px; border: 1px solid #467761;
  background: radial-gradient(ellipse at center, #315c49, #173829 75%);
  box-shadow: 0 3px 12px #17382930;
}
@media (prefers-reduced-motion: no-preference) {
  .voice-wave { animation: voice-wave-in 160ms ease-out; }
}
@keyframes voice-wave-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.voice-button, .manual-button { min-height: 62px; border-radius: 11px; font-size: 22px; font-weight: 760; white-space: nowrap; }
.voice-button {
  display: flex; align-items: center; justify-content: center; gap: 11px; border: 1px solid var(--green);
  color: #fffef5; background: var(--green);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.voice-button[aria-disabled="true"] { opacity: .65; }
.voice-button[data-phase="recording"], .voice-button[data-phase="recognizing"] { color: #192d1d; }
.voice-button[data-phase="recording"] { background: #f7ba93; border-color: #b76c49; }
.voice-button[data-phase="recognizing"] { background: #e9efd9; border-color: #bfc9ad; }
.mic-mark { display: inline-block; width: 11px; height: 17px; border: 2px solid currentColor; border-radius: 6px; position: relative; margin-top: -4px; }
.mic-mark::before { position: absolute; content: ""; width: 16px; height: 10px; left: -5px; bottom: -5px; border: 2px solid currentColor; border-top: 0; border-radius: 0 0 10px 10px; }
.mic-mark::after { position: absolute; content: ""; height: 5px; width: 2px; background: currentColor; bottom: -9px; left: 3px; }
.manual-button { padding: 8px 12px; min-width: 87px; border: 1px solid #c6cebb; color: var(--green); background: transparent; }
.snack {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  color: #fffef8; background: #273d30; border-radius: 8px; margin-bottom: 6px; min-height: 37px; padding: 6px 9px; font-size: 14px;
}
.snack button { color: var(--lime); border: 0; background: none; min-height: 35px; padding: 2px 4px; font-weight: 750; white-space: nowrap; }
.order-page-form {
  display: flex; flex-direction: column; height: 100vh; height: 100dvh;
}
.order-page-back { background: transparent; }
.order-page-fields {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px max(14px, env(safe-area-inset-right)) 18px max(14px, env(safe-area-inset-left));
}
.order-fields { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.order-page-footer {
  display: grid; gap: 8px; border-top: 1px solid var(--border); background: #fdfdf4;
  padding: 9px max(14px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}
.order-page-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.order-page-actions button { min-height: 48px; }
.order-success { padding: 7px 10px; border-radius: 8px; background: var(--green-light); color: var(--green); font-weight: 700; }
.order-success:empty { display: none; }
#order-page-error { color: #8c3528; font-size: 14px; }
.settings-title { display: flex; align-items: center; gap: 13px; }
.centered-topbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  padding-inline: max(18px, env(safe-area-inset-left), env(safe-area-inset-right));
}
.centered-topbar > :first-child { justify-self: start; }
.centered-topbar h1 { text-align: center; }
.queue-title { display: flex; align-items: center; gap: 8px; }
.queue-count {
  display: inline-grid; place-items: center; min-inline-size: 26px; aspect-ratio: 1; padding-inline: 5px;
  border-radius: 50%; background: var(--lime); color: var(--green); font-size: 14px; font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.home-topbar .header-link { min-height: 44px; }
.home-topbar .settings-icon { width: 44px; justify-content: center; padding: 0; }
.home-topbar #reset-list { justify-self: end; background: transparent; }
.settings-body { display: grid; gap: 14px; padding: 14px 14px calc(16px + env(safe-area-inset-bottom)); }
.setting-card { display: grid; gap: 16px; background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.setting-card h2 { font-size: 19px; }
.setting-card h3 { font-size: 15px; }
.setting-card p { color: var(--muted); overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.setting-card p:empty { display: none; }
.setting-card progress { width: 100%; accent-color: var(--green); }
.setting-group, .installation, .license-field { display: grid; gap: 8px; }
.setting-card button { justify-self: start; }
.license-line { display: flex; align-items: flex-start; gap: 8px; }
.license-icon {
  display: inline-grid; position: relative; place-items: center; flex: 0 0 18px;
  width: 18px; height: 18px; margin-top: 1.5px; border-radius: 50%;
}
.license-state-icon { color: white; background: #68796a; }
.license-state-icon::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
[data-status="active"] .license-state-icon { background: #217342; }
[data-status="active"] .license-state-icon::before {
  width: 5px; height: 9px; border: solid currentColor; border-width: 0 2px 2px 0;
  border-radius: 0; background: none; transform: translateY(-1px) rotate(45deg);
}
[data-status="attention"] .license-state-icon { background: #a62d31; }
[data-status="attention"] .license-state-icon::before {
  content: "!"; width: auto; height: auto; background: none; font-weight: 800; line-height: 1;
}
.license-clock-icon { border: 1.5px solid currentColor; }
.license-clock-icon::before {
  content: ""; position: absolute; top: 3px; left: 6.5px; width: 4.5px; height: 5px;
  border: solid currentColor; border-width: 0 0 1.5px 1.5px; border-bottom-left-radius: 1px;
}
#license-expiry-value { margin-inline-start: 4px; }
.installation-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#install-id { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
#license-form { display: grid; gap: 14px; }
label, .transcript label { display: block; font-weight: 700; font-size: 15px; }
input:not([type="checkbox"]), textarea, select {
  width: 100%; padding: 8px 9px; min-height: 42px; border-radius: 8px; color: #192e23; border: 1px solid #bac5b3;
  background: #fffefb; font-size: 16px;
}
.secondary {
  background: #eef1e3; border: 1px solid #c9d0bf; border-radius: 8px; color: var(--green);
  min-height: 40px; padding: 7px 9px; white-space: nowrap; font-weight: 650;
}
#activation-status[data-error="true"], #order-error, #reset-error { color: #8c3528; }
#diagnostics-result { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
#diagnostics-result:empty { display: none; }
dialog { color: inherit; background: var(--white); border: 1px solid var(--border); border-radius: 15px; padding: 0; }
dialog::backdrop { background: #182b2180; }
.sheet {
  margin: auto auto 0; inset: auto 0 0; width: min(100%, 580px); max-width: 100%;
  max-height: min(94dvh, 820px); border-radius: 16px 16px 0 0;
}
.sheet-form { display: flex; flex-direction: column; max-height: min(94dvh, 820px); }
.sheet-header, .sheet-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 13px; }
.sheet-header { border-bottom: 1px solid var(--border); }
.sheet-header h2, .confirm h2 { font-size: 21px; }
.sheet-scroll { overflow: auto; overscroll-behavior: contain; min-height: 0; padding: 12px 13px; }
.transcript textarea { display: block; margin: 4px 0 6px; }
.transcript details { color: var(--muted); font-size: 13px; margin-top: 8px; }
.issue-list { font-size: 14px; padding: 8px 9px 8px 25px; margin: 10px 0; border-radius: 7px; background: #f9ebc7; color: #584220; overflow-wrap: anywhere; }
.dish-picker { display: grid; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.dish-picker h3 { font-size: 15px; }
#dish-categories .tag-option { padding-inline: 6px; font-weight: 700; }
#dish-categories .tag-option:not([aria-pressed="true"]) { background: #eef1e3; }
.option-row {
  display: grid; grid-template-columns: 3em minmax(0, 1fr); align-items: start; gap: 7px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.option-row h3 { font-size: 14px; align-self: start; padding-top: 12px; }
.tag-chip { border: 0; min-height: 44px; }
.tag-options { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-option {
  min-width: 44px; min-height: 44px; padding: 5px 8px; border: 1px solid #c9d1c1;
  background: var(--white); border-radius: 8px; color: var(--green); font-size: 14px; white-space: nowrap;
}
.tag-option[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--white); }
.checkline { display: flex; align-items: center; min-height: 40px; gap: 6px; margin-top: 9px; }
.checkline input { inline-size: 20px; block-size: 20px; accent-color: var(--green); }
.sheet-footer { border-top: 1px solid var(--border); flex-direction: column; align-items: stretch; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
#order-error, #reset-error { font-size: 14px; }
.confirm { max-width: calc(100% - 25px); width: 320px; padding: 14px; }
.confirm p { margin: 6px 0 10px; }
.confirm-actions { display: flex; gap: 12px; justify-content: flex-end; }
.confirm-actions button { min-height: 44px; }
#reset-dialog .confirm-actions button { min-inline-size: 56px; }
.danger { background: #84392b; }
