:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #657085;
  --line: #d9e0eb;
  --line-strong: #b8c3d5;
  --teal: #0f766e;
  --teal-dark: #0b5f59;
  --blue: #1d4ed8;
  --rose: #be123c;
  --amber: #b45309;
  --green-soft: #dff7ec;
  --blue-soft: #e7efff;
  --rose-soft: #ffe4eb;
  --amber-soft: #fff0d7;
  --blue-line: #b8ccff;
  --amber-line: #f4c66d;
  --green-line: #9ddfbe;
  --shadow: 0 14px 38px rgba(23, 32, 51, 0.08);
  --supplier-accent: var(--teal);
  --supplier-soft: var(--green-soft);
  --supplier-line: var(--green-line);
  --products-accent: var(--blue);
  --products-soft: var(--blue-soft);
  --products-line: var(--blue-line);
  --note-accent: var(--amber);
  --note-soft: var(--amber-soft);
  --note-line: var(--amber-line);
  --closure-accent: var(--rose);
  --closure-soft: var(--rose-soft);
  --closure-line: #ffc1d1;
  --account-accent: #6d28d9;
  --account-soft: #f0e9ff;
  --account-line: #d5c5ff;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100svh;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg);
}

main {
  min-height: 100svh;
}

.view {
  min-height: 100svh;
  padding: max(12px, env(safe-area-inset-top)) 14px
    max(12px, env(safe-area-inset-bottom));
}

.home-head,
.order-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 10px;
}

.login-view {
  display: grid;
  min-height: calc(100svh - 36px);
  align-content: center;
  gap: 16px;
}

.login-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-help {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-size: 21px;
  font-weight: 800;
}

.title-block {
  min-width: 0;
}

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

h1 {
  overflow-wrap: anywhere;
  font-size: 1.42rem;
  line-height: 1.15;
}

h2 {
  font-size: 1.08rem;
}

h3 {
  font-size: 1rem;
}

.subtle {
  color: var(--muted);
  font-size: 0.88rem;
}

.mode-grid {
  display: grid;
  gap: 10px;
  margin: 2px 0 16px;
}

.main-menu {
  display: grid;
  gap: 12px;
}

.main-menu-card {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 82px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.main-menu-card.create {
  border-color: var(--blue-line);
  background: var(--blue-soft);
}

.main-menu-card.history {
  border-color: var(--amber-line);
  background: var(--amber-soft);
}

.main-menu-card.suppliers {
  border-color: var(--green-line);
  background: var(--green-soft);
}

.main-menu-card.account {
  border-color: var(--account-line);
  background: var(--account-soft);
}

.main-menu-card.create .mode-icon {
  background: var(--blue);
}

.main-menu-card.history .mode-icon {
  background: var(--amber);
}

.main-menu-card.suppliers .mode-icon {
  background: var(--teal);
}

.main-menu-card.account .mode-icon {
  background: var(--account-accent);
}

.main-menu-card strong {
  display: block;
  font-size: 1.08rem;
}

.main-menu-card span:not(.mode-icon) {
  color: var(--muted);
  font-size: 0.9rem;
}

.mode-card,
.order-card,
.product-card,
.paper-panel,
.finish-panel,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mode-card {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 74px;
  padding: 12px;
  border-width: 2px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.mode-card.products {
  border-color: var(--blue-line);
  background: var(--blue-soft);
}

.mode-card.note {
  border-color: var(--amber-line);
  background: var(--amber-soft);
}

.mode-card strong {
  display: block;
  font-size: 1.08rem;
}

.mode-card span:not(.mode-icon) {
  color: var(--muted);
  font-size: 0.9rem;
}

.mode-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
}

.mode-card.products .mode-icon {
  background: var(--blue);
}

.mode-card.note .mode-icon {
  background: var(--amber);
}

.mode-card:active,
.main-menu-card:active,
.primary-button:active,
.secondary-button:active,
.danger-button:active,
.file-button:active,
.supplier-choice:active,
.order-card-open:active,
.switch-button:active,
.tab-button:active {
  transform: translateY(1px);
}

.chevron {
  color: var(--muted);
  font-size: 1.5rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}

.count-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef2f7;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.draft {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-pill.closed {
  color: var(--teal-dark);
  background: var(--green-soft);
}

.order-list {
  display: grid;
  gap: 8px;
}

.account-note {
  padding: 12px 14px;
  border: 1px solid var(--account-line);
  border-radius: 8px;
  background: var(--account-soft);
  color: #4c1d95;
  font-size: 0.9rem;
  font-weight: 700;
}

.account-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.account-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--account-line);
  border-left: 6px solid var(--account-accent);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.account-card-head div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.account-card-head strong {
  overflow-wrap: anywhere;
  font-size: 1.04rem;
}

.account-card-head span:not(.status-pill),
.account-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.account-card .primary-button {
  background: var(--account-accent);
  box-shadow: 0 8px 18px rgba(109, 40, 217, 0.16);
}

.tab-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}

.tab-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.tab-button.active {
  border-color: var(--teal);
  background: var(--green-soft);
  color: var(--teal-dark);
}

.order-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-left-width: 6px;
}

.order-card.draft {
  border-left-color: var(--amber);
  background: #fffaf0;
}

.order-card.closed {
  border-left-color: var(--teal);
  background: #f2fbf7;
}

.order-card-open {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.order-card-main {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 10px;
}

.order-card-title {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.order-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.missing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.missing-tags span,
.no-photo-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 800;
}

.no-photo-status {
  background: var(--amber-soft);
  color: var(--amber);
}

.order-card-actions {
  display: grid;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.empty-state {
  display: grid;
  min-height: 110px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.order-head {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: calc(-1 * max(12px, env(safe-area-inset-top))) -14px 0;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 251, 0.94);
  backdrop-filter: blur(12px);
}

.order-head .title-block {
  flex: 1;
}

.icon-button {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 800;
  cursor: pointer;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 12px;
}

.step-button {
  min-height: 44px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.step-button.active {
  border-color: var(--teal);
  background: var(--green-soft);
  color: var(--teal-dark);
  font-weight: 800;
}

.order-step-supplier .step-button.active {
  border-color: var(--supplier-accent);
  background: var(--supplier-soft);
  color: var(--teal-dark);
}

.order-step-products .step-button.active {
  border-color: var(--products-accent);
  background: var(--products-soft);
  color: var(--products-accent);
}

.order-step-note .step-button.active {
  border-color: var(--note-accent);
  background: var(--note-soft);
  color: var(--note-accent);
}

.order-step-closure .step-button.active {
  border-color: var(--closure-accent);
  background: var(--closure-soft);
  color: var(--closure-accent);
}

.form-stack {
  display: grid;
  gap: 12px;
  padding-bottom: 88px;
}

.field-grid,
.product-fields {
  display: grid;
  gap: 12px;
}

.step-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left-width: 6px;
  border-radius: 8px;
  background: var(--surface);
}

.supplier-panel {
  border-color: var(--supplier-line);
  border-left-color: var(--supplier-accent);
  background: linear-gradient(90deg, rgba(223, 247, 236, 0.72), #fff 38%);
}

.field {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 8px;
}

.password-toggle {
  min-height: 48px;
  padding: 0 10px;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

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

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

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.primary-button,
.secondary-button,
.danger-button,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 15px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.secondary-button {
  border-color: var(--blue-line);
  background: var(--blue-soft);
  color: var(--blue);
}

.danger-button {
  border-color: var(--rose-soft);
  background: var(--rose-soft);
  color: var(--rose);
}

.danger-button.small {
  min-height: 42px;
  width: 100%;
}

.secondary-button.small,
.primary-button.small {
  min-height: 42px;
  width: 100%;
  padding: 0 10px;
  font-size: 0.9rem;
}

.secondary-button.inline,
.primary-button.inline {
  width: auto;
  min-height: 40px;
}

.danger-button.confirm {
  border-color: var(--rose);
  background: var(--rose);
  color: #fff;
}

.file-button {
  width: 100%;
  background: var(--blue-soft);
  color: var(--blue);
}

.file-button.gallery {
  background: var(--green-soft);
  color: var(--teal-dark);
}

.no-photo-row {
  display: grid;
  gap: 8px;
}

.no-photo-button {
  width: 100%;
}

.no-photo-button.selected {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: var(--amber);
}

.hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.supplier-search-field {
  margin: 0 0 10px;
}

.empty-state.compact {
  min-height: 58px;
  padding: 14px;
}

.supplier-list {
  display: grid;
  gap: 10px;
}

.supplier-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.supplier-card div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.supplier-card span {
  color: var(--muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.supplier-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(58px, auto));
  gap: 6px;
}

.linked-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.supplier-toolbar {
  margin: 0 0 12px;
}

.supplier-editor {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

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

.supplier-step-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.supplier-new-button {
  min-height: 48px;
  white-space: nowrap;
}

.selected-supplier-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--supplier-line);
  border-radius: 8px;
  background: var(--supplier-soft);
}

.selected-supplier-card div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.selected-supplier-card span,
.selected-supplier-card small {
  color: var(--muted);
  font-size: 0.82rem;
}

.selected-supplier-card strong {
  overflow-wrap: anywhere;
}

.order-supplier-form {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--supplier-line);
  border-radius: 8px;
  background: var(--surface);
}

.supplier-picker {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 4px 0;
}

.supplier-choice {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.supplier-choice.selected {
  border-color: var(--teal);
  background: var(--green-soft);
}

.supplier-choice span {
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.total-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.order-step-products .total-strip {
  border-color: var(--products-line);
  background: linear-gradient(90deg, rgba(231, 239, 255, 0.88), #fff 52%);
}

.order-step-closure .total-strip,
.order-step-note .total-strip {
  border-color: var(--note-line);
}

.metric-strip {
  align-items: stretch;
}

.metric-strip span {
  display: grid;
  gap: 2px;
}

.total-strip span,
.review-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.total-strip strong,
.review-head strong {
  color: var(--teal-dark);
  font-size: 1.08rem;
}

.product-list {
  display: grid;
  gap: 12px;
}

.product-list.compact {
  gap: 8px;
}

.product-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
  color: var(--muted);
  font-weight: 800;
}

.order-step-products .product-progress {
  border-color: var(--products-line);
  background: var(--products-soft);
  color: var(--products-accent);
}

.product-list-panel {
  display: grid;
  gap: 10px;
}

.product-card,
.paper-panel,
.finish-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  box-shadow: none;
}

.product-card {
  border-left: 6px solid var(--products-accent);
}

.paper-panel {
  border-left: 6px solid var(--note-accent);
  background: linear-gradient(90deg, rgba(255, 240, 215, 0.75), #fff 42%);
}

.finish-panel {
  border-left: 6px solid var(--closure-accent);
  background: linear-gradient(90deg, rgba(255, 228, 235, 0.72), #fff 42%);
}

.product-card.collapsed {
  background: #f9fbfd;
}

.product-card.collapsed .product-head {
  align-items: start;
}

.product-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.product-head > div {
  min-width: 0;
}

.product-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(58px, auto));
  gap: 6px;
}

.product-form-actions {
  display: grid;
  gap: 10px;
}

.review-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}

.order-step-closure .review-panel {
  border-color: var(--closure-line);
  background: #fff8fa;
}

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.review-head span {
  color: var(--muted);
  font-weight: 800;
}

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

.review-grid div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.review-grid strong,
.review-line strong {
  overflow-wrap: anywhere;
}

.review-lines {
  display: grid;
  gap: 8px;
}

.review-line {
  display: block;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.review-line:first-child {
  border-top: 0;
  padding-top: 0;
}

.review-line span {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.review-line strong {
  color: var(--muted);
  font-size: 0.88rem;
}

.box-controls {
  display: grid;
  grid-template-columns: 34px minmax(28px, auto) 34px;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.volume-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}

.switch-button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.switch-button.active {
  border-color: var(--teal);
  background: var(--green-soft);
  color: var(--teal-dark);
}

.icon-button.mini {
  width: 34px;
  height: 34px;
  min-height: 34px;
  font-size: 1rem;
}

.calc-panel {
  display: grid;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}

.calc-panel span {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-weight: 700;
}

.calc-panel strong {
  color: var(--teal-dark);
  overflow-wrap: anywhere;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 9px;
}

.photo-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9edf5;
}

.photo-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(23, 32, 51, 0.82);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.action-bar {
  position: sticky;
  bottom: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 -14px calc(-1 * max(12px, env(safe-area-inset-bottom)));
  padding: 10px 14px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(245, 247, 251, 0.96);
  backdrop-filter: blur(12px);
}

.action-bar.single {
  grid-template-columns: 1fr;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 16px;
  z-index: 20;
  max-width: 720px;
  margin: 0 auto;
  padding: 13px 14px;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  text-align: center;
  box-shadow: 0 14px 34px rgba(23, 32, 51, 0.22);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

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

@media (min-width: 720px) {
  .view {
    padding-right: 24px;
    padding-left: 24px;
  }

  .order-head {
    margin-right: -24px;
    margin-left: -24px;
    padding-right: 24px;
    padding-left: 24px;
  }

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

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

  .field-grid .wide,
  .finish-panel .wide {
    grid-column: 1 / -1;
  }

  .action-bar {
    margin-right: -24px;
    margin-left: -24px;
    padding-right: 24px;
    padding-left: 24px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .app-shell {
    max-width: none;
    min-height: auto;
    background: #fff;
  }

  .view {
    max-width: none;
    padding: 0;
  }

  .home-head,
  .stepper,
  .action-bar,
  .photo-actions,
  .no-photo-row,
  .photo-remove,
  .print-button {
    display: none !important;
  }

  .order-head {
    position: static;
    margin: 0 0 12px;
    padding: 0 0 10px;
    border-bottom: 1px solid #d9e0eb;
    background: #fff;
  }

  .order-head .icon-button {
    display: none;
  }

  .form-stack {
    padding-bottom: 0;
  }

  .finish-panel,
  .review-panel,
  .product-card,
  .paper-panel {
    border-color: #d9e0eb;
    background: #fff;
    box-shadow: none;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: auto;
    border: 0;
    padding: 0;
    background: #fff;
  }
}
