:root {
  color-scheme: dark;
  --graphite-950: #080a0d;
  --graphite-900: #0f1217;
  --graphite-850: #141820;
  --graphite-800: #1a1f28;
  --graphite-700: #29303b;
  --grey-500: #818997;
  --grey-300: #bcc2cb;
  --white: #ffffff;
  --orange: #f57c00;
  --orange-bright: #ff8a00;
  --orange-soft: #39210e;
  --blue: #3d86f7;
  --green: #23c774;
  --red: #f05c62;
  --border: rgba(255, 255, 255, 0.1);
  --surface: rgba(20, 24, 32, 0.94);
  --focus: #ffd08a;
  --header-height: 162px;
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--graphite-950);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--white);
  background:
    linear-gradient(180deg, rgba(245, 124, 0, 0.05), transparent 280px),
    var(--graphite-950);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  min-height: 44px;
}

button {
  color: inherit;
}

button:not(:disabled),
a[href],
select,
input[type="checkbox"] {
  cursor: pointer;
}

button:disabled,
a[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: var(--graphite-950);
  background: var(--white);
  border-radius: 4px;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: 100%;
  min-height: 100vh;
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  background: rgba(8, 10, 13, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1400px;
  min-height: 52px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--white);
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  color: var(--orange-bright);
  font-size: 14px;
  font-weight: 900;
  border: 2px solid var(--orange);
  border-radius: 8px;
}

.brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 16px;
}

.brand-copy span {
  margin-top: 4px;
  overflow: hidden;
  color: var(--grey-500);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions,
.mode-indicator {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 8px;
}

.current-user {
  max-width: 180px;
  overflow: hidden;
  padding: 8px 10px;
  color: var(--white);
  background: var(--graphite-800);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-indicator {
  gap: 6px;
  color: var(--grey-300);
  font-size: 12px;
}

.mode-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(35, 199, 116, 0.12);
}

.storage-warning .mode-dot {
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(245, 124, 0, 0.14);
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--white);
  background: var(--graphite-800);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 26px;
  font-weight: 400;
}

.primary-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-width: 680px;
  margin: 12px auto 0;
  padding-bottom: 10px;
}

.primary-tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 0 8px;
  color: var(--grey-300);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.primary-tab.is-active {
  color: var(--graphite-950);
  background: var(--orange-bright);
  box-shadow: 0 8px 24px rgba(245, 124, 0, 0.18);
}

.tab-icon {
  display: none;
  color: currentColor;
  font-size: 10px;
  font-weight: 900;
}

.tab-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  place-items: center;
  color: var(--white);
  background: rgba(0, 0, 0, 0.45);
  border-radius: 10px;
  font-size: 11px;
}

.app-main {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px max(14px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.app-view[hidden] {
  display: none;
}

.orders-layout {
  display: grid;
  min-width: 0;
}

.orders-column,
.standalone-view {
  min-width: 0;
}

.view-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.view-heading h1 {
  margin: 3px 0 0;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--orange-bright);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.today {
  color: var(--grey-500);
  font-size: 13px;
  white-space: nowrap;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.metric {
  display: grid;
  min-width: 0;
  min-height: 74px;
  padding: 10px 12px;
  background: var(--graphite-850);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.metric span {
  overflow: hidden;
  color: var(--grey-500);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric strong {
  align-self: end;
  font-size: 24px;
  line-height: 1;
}

.metric-new {
  background: var(--orange-soft);
  border-color: rgba(245, 124, 0, 0.38);
}

.metric-new span,
.metric-new strong {
  color: var(--orange-bright);
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  background: var(--graphite-850);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.search-field:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.12);
}

.search-symbol {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-left: 14px;
  border: 2px solid var(--grey-500);
  border-radius: 50%;
}

.search-symbol::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 7px;
  height: 2px;
  content: "";
  background: var(--grey-500);
  transform: rotate(45deg);
  transform-origin: left center;
}

.search-field input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 46px 0 12px;
  color: var(--white);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 14px;
}

.search-field input::placeholder {
  color: var(--grey-500);
}

.clear-search {
  position: absolute;
  right: 4px;
  display: grid;
  width: 40px;
  min-height: 40px;
  padding: 0;
  place-items: center;
  color: var(--grey-300);
  background: transparent;
  border: 0;
  font-size: 24px;
}

.filter-group {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  min-width: 0;
}

.filter-label {
  color: var(--grey-500);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.filter-button {
  display: inline-flex;
  min-width: max-content;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  color: var(--grey-300);
  background: var(--graphite-850);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.filter-button span {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  place-items: center;
  color: var(--grey-300);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  font-size: 11px;
}

.filter-button.is-active {
  color: var(--graphite-950);
  background: var(--orange-bright);
  border-color: var(--orange-bright);
}

.filter-button.is-active span {
  color: var(--white);
  background: rgba(0, 0, 0, 0.42);
}

.list-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 8px;
}

.list-summary strong {
  font-size: 14px;
}

.list-summary span {
  color: var(--grey-500);
  font-size: 12px;
}

.order-list {
  display: grid;
  gap: 6px;
}

.order-row {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 11px;
  width: 100%;
  min-height: 76px;
  padding: 10px 10px 10px 8px;
  align-items: center;
  text-align: left;
  background: var(--graphite-850);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: transform 160ms ease, opacity 160ms ease;
}

.compact-list .order-row {
  min-height: 56px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.order-row:hover,
.order-row.is-selected {
  border-color: rgba(245, 124, 0, 0.55);
  transform: translateY(-1px);
}

.order-row.is-selected {
  background: var(--orange-soft);
}

.order-row.is-unread::before {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--orange-bright);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--orange);
}

.hide-unread-highlight .order-row.is-unread::before {
  display: none;
}

.avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--white);
  background: var(--orange);
  border-radius: 50%;
  font-size: 18px;
  font-weight: 900;
}

.avatar-tone-0 { background: #f57c00; }
.avatar-tone-1 { background: #3d86f7; }
.avatar-tone-2 { background: #23a867; }
.avatar-tone-3 { background: #7c5ce0; }
.avatar-tone-4 { background: #d94b68; }
.avatar-tone-5 { background: #168ca1; }

.compact-list .avatar {
  width: 40px;
  height: 40px;
  font-size: 15px;
}

.order-main {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.order-name,
.order-service {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-name {
  padding-right: 12px;
  font-size: 15px;
  font-weight: 800;
}

.order-service {
  color: var(--grey-300);
  font-size: 13px;
}

.compact-list .order-service {
  font-size: 12px;
}

.order-meta {
  display: grid;
  align-self: stretch;
  justify-items: end;
  align-content: space-between;
  gap: 5px;
  padding-top: 2px;
}

.order-time {
  padding-right: 11px;
  color: var(--grey-500);
  font-size: 11px;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.status-new { color: var(--orange-bright); }
.status-active,
.status-in_progress { color: #f4c95d; }
.status-done { color: var(--green); }
.status-archived { color: var(--grey-500); }

.empty-state,
.detail-placeholder {
  display: grid;
  justify-items: center;
  text-align: center;
}

.empty-state {
  padding: 48px 20px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.empty-state[hidden] {
  display: none;
}

.detail-placeholder[hidden] {
  display: none;
}

.empty-symbol,
.placeholder-index {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  color: var(--orange-bright);
  background: var(--orange-soft);
  border: 1px solid rgba(245, 124, 0, 0.3);
  border-radius: 8px;
  font-weight: 900;
}

.empty-state h2,
.detail-placeholder h2 {
  margin: 16px 0 6px;
  font-size: 20px;
}

.empty-state p,
.detail-placeholder p {
  max-width: 340px;
  margin: 0 0 18px;
  color: var(--grey-500);
  line-height: 1.5;
}

.secondary-button,
.danger-button,
.primary-button,
.action-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.primary-button {
  color: var(--graphite-950);
  background: var(--orange-bright);
  border: 1px solid var(--orange-bright);
}

.secondary-button,
.action-link {
  color: var(--white);
  background: var(--graphite-800);
  border: 1px solid var(--border);
}

.danger-button {
  color: var(--red);
  background: rgba(240, 92, 98, 0.08);
  border: 1px solid rgba(240, 92, 98, 0.32);
}

.order-detail {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: none;
  min-width: 0;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-y: auto;
  background: var(--graphite-900);
}

.detail-open .order-detail {
  display: block;
}

.detail-open {
  overflow: hidden;
}

.detail-placeholder {
  align-content: center;
  min-height: 420px;
}

.detail-content[hidden] {
  display: none;
}

.detail-content {
  max-width: 760px;
  margin: 0 auto;
}

.detail-topbar,
.detail-title-row,
.detail-actions,
.form-actions {
  display: flex;
  align-items: center;
}

.detail-topbar {
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin-bottom: 18px;
}

.detail-id {
  color: var(--grey-500);
  font-size: 12px;
  font-weight: 800;
}

.detail-close {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--white);
  background: var(--graphite-800);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 24px;
}

.detail-title-row {
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-title-row .avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
}

.detail-title-row h2 {
  margin: 2px 0 7px;
  font-size: 24px;
  line-height: 1.1;
}

.detail-service {
  margin: 0;
  color: var(--grey-300);
  line-height: 1.4;
}

.detail-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.detail-section {
  padding: 17px 0;
  border-top: 1px solid var(--border);
}

.detail-section h3 {
  margin: 0 0 12px;
  color: var(--grey-300);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.detail-grid,
.system-status {
  display: grid;
  gap: 0;
  margin: 0;
}

.detail-grid div,
.system-status div {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-grid dt,
.system-status dt {
  color: var(--grey-500);
  font-size: 12px;
}

.detail-grid dd,
.system-status dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

.customer-message {
  margin: 0;
  color: var(--grey-300);
  line-height: 1.6;
  white-space: pre-wrap;
}

.status-select,
.select-setting select,
.note-form textarea {
  width: 100%;
  color: var(--white);
  background: var(--graphite-800);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.status-select,
.select-setting select {
  min-height: 46px;
  padding: 0 12px;
}

.note-form textarea {
  min-height: 96px;
  padding: 12px;
  resize: vertical;
}

.form-actions {
  justify-content: flex-end;
  margin-top: 8px;
}

.timeline,
.notes-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li,
.note-item {
  position: relative;
  padding-left: 18px;
  color: var(--grey-300);
  font-size: 13px;
  line-height: 1.45;
}

.timeline li::before,
.note-item::before {
  position: absolute;
  top: 6px;
  left: 0;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--orange);
  border-radius: 50%;
}

.timeline time,
.note-item time {
  display: block;
  margin-top: 2px;
  color: var(--grey-500);
  font-size: 11px;
}

.standalone-view {
  max-width: 920px;
  margin: 0 auto;
}

.local-notice {
  padding: 16px;
  margin-bottom: 14px;
  background: var(--orange-soft);
  border-left: 3px solid var(--orange);
  border-radius: 0 8px 8px 0;
}

.local-notice strong {
  color: var(--orange-bright);
}

.local-notice p {
  margin: 6px 0 0;
  color: var(--grey-300);
  font-size: 13px;
  line-height: 1.5;
}

.chat-list {
  display: grid;
  gap: 7px;
}

.chat-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 11px;
  min-height: 72px;
  padding: 10px;
  align-items: center;
  text-align: left;
  background: var(--graphite-850);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.chat-row .avatar {
  width: 44px;
  height: 44px;
}

.chat-copy {
  min-width: 0;
}

.chat-copy strong,
.chat-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-copy span {
  margin-top: 4px;
  color: var(--grey-500);
  font-size: 13px;
}

.settings-view {
  max-width: 760px;
}

.passkey-settings {
  margin: 22px 0;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.passkey-heading,
.passkey-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.passkey-heading h2,
.passkey-revoke-form h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.passkey-list {
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.passkey-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.passkey-row > div {
  display: grid;
  min-width: 0;
  gap: 6px;
  overflow-wrap: anywhere;
}

.passkey-row strong { font-size: 14px; }
.passkey-row small { color: var(--grey-500); font-size: 12px; line-height: 1.5; }
.passkey-row .passkey-invalid { color: var(--orange); }
.passkey-row button { min-height: 44px; }
.passkey-enrollment summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-size: 14px; }
.passkey-settings .auth-form { max-width: 440px; margin-top: 12px; }
.passkey-settings .auth-form input { min-width: 0; width: 100%; }
.passkey-revoke-form { padding-top: 18px; border-top: 1px solid var(--border); }
.passkey-form-actions { justify-content: flex-start; }
.passkey-login-actions { display: grid; gap: 8px; margin: 16px 0 22px; }
.passkey-login-actions .field-help { margin: 0; }
.passkey-settings button,
.passkey-login-actions button { white-space: normal; overflow-wrap: anywhere; }

@media (max-width: 359px) {
  .passkey-row { grid-template-columns: minmax(0, 1fr); }
  .passkey-row button { justify-self: start; }
}

.settings-section {
  margin-bottom: 14px;
  padding: 16px;
  background: var(--graphite-850);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.settings-section > h2,
.danger-zone h2 {
  margin: 0 0 11px;
  font-size: 15px;
}

.setting-row,
.select-setting {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.setting-row span,
.select-setting span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.setting-row strong,
.select-setting strong {
  font-size: 14px;
}

.setting-row small,
.select-setting small {
  color: var(--grey-500);
  font-size: 12px;
  line-height: 1.4;
}

.setting-row input[type="checkbox"] {
  width: 46px;
  height: 26px;
  flex: 0 0 46px;
  accent-color: var(--orange);
}

.select-setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 180px);
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-color: rgba(240, 92, 98, 0.22);
}

.danger-zone h2 {
  margin-bottom: 5px;
}

.danger-zone p {
  margin: 0;
  color: var(--grey-500);
  font-size: 12px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  z-index: 90;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
  max-width: 440px;
  min-height: 48px;
  padding: 13px 16px;
  color: var(--white);
  background: var(--graphite-700);
  border: 1px solid var(--border);
  border-left: 3px solid var(--orange);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.36);
  font-size: 13px;
  line-height: 1.4;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast[hidden] {
  display: block;
  pointer-events: none;
  opacity: 0;
  transform: translateY(14px);
}

@media (max-width: 420px) {
  .current-user {
    max-width: 96px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .mode-indicator span:last-child {
    display: none;
  }

  .primary-tab {
    gap: 4px;
    font-size: 12px;
  }

  .metrics {
    gap: 5px;
  }

  .metric {
    padding: 9px;
  }

  .order-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .avatar {
    width: 44px;
    height: 44px;
  }

  .status-badge {
    padding: 0 5px;
    font-size: 9px;
  }

  .detail-grid div,
  .system-status div {
    grid-template-columns: minmax(86px, 0.72fr) minmax(0, 1.28fr);
  }

  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (min-width: 700px) {
  .app-header {
    padding-right: 24px;
    padding-left: 24px;
  }

  .app-main {
    padding: 28px 24px 48px;
  }

  .tab-icon {
    display: inline;
  }

  .filters {
    gap: 9px;
  }

  .view-heading h1 {
    font-size: 40px;
  }

  .metrics {
    gap: 10px;
  }
}

@media (min-width: 900px) {
  :root {
    --header-height: 128px;
  }

  .app-header {
    padding-top: 14px;
  }

  .brand-row {
    min-height: 48px;
  }

  .primary-tabs {
    width: 520px;
    margin-top: -48px;
    margin-bottom: 0;
    padding-bottom: 12px;
  }

  .app-main {
    padding-top: 32px;
  }

  .orders-layout {
    grid-template-columns: minmax(360px, 0.85fr) minmax(420px, 1.15fr);
    gap: 24px;
    align-items: start;
  }

  .orders-column {
    min-width: 0;
  }

  .order-detail {
    position: sticky;
    z-index: 1;
    top: calc(var(--header-height) + 20px);
    display: block;
    max-height: calc(100vh - var(--header-height) - 40px);
    padding: 20px;
    overflow-y: auto;
    background: var(--graphite-900);
    border: 1px solid var(--border);
    border-radius: 8px;
  }

  .detail-open {
    overflow: auto;
  }

  .detail-close {
    display: none;
  }

  .detail-content {
    max-width: none;
  }

  .toast {
    left: auto;
    width: 400px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

.push-settings .setting-row {
  align-items: center;
}

.push-settings .settings-note {
  margin: 10px 0 0;
}

.push-settings[data-push-state="enabled"] [data-push-status] {
  color: var(--green, #79c998);
}

.push-settings[data-push-state="error"] [data-push-status],
.push-settings[data-push-state="denied"] [data-push-status] {
  color: var(--orange);
}

.settings-note {
  margin: -2px 0 14px;
  color: var(--grey-500);
  font-size: 12px;
  line-height: 1.5;
}

.staff-form {
  display: grid;
  gap: 12px;
}

.staff-form + .staff-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.staff-form label {
  display: grid;
  gap: 6px;
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
}

.staff-form input,
.staff-form select {
  min-height: 44px;
  width: 100%;
  padding: 0 12px;
  color: var(--white);
  background: var(--graphite-900);
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.city-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.city-checklist legend { padding: 0 4px; font-size: 13px; font-weight: 800; }
.city-checklist .field-help { grid-column: 1 / -1; margin: 0; }
.city-choice { display: flex !important; align-items: center; gap: 8px; font-weight: 600 !important; }
.city-choice input { min-height: 18px; width: 18px; padding: 0; accent-color: var(--orange); }
.staff-invite-link { margin: 0; overflow-wrap: anywhere; }
.staff-invite-link a { color: var(--orange); font-weight: 800; }
.staff-city-form h3 { margin: 0; font-size: 14px; }

.auth-shell {
  display: grid;
  min-height: 100vh;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  place-items: center;
  background:
    linear-gradient(180deg, rgba(245, 124, 0, 0.12), transparent 42%),
    var(--graphite-950);
}

.auth-panel {
  width: min(100%, 520px);
  padding: clamp(22px, 5vw, 42px);
  background: rgba(20, 24, 32, 0.97);
  border: 1px solid var(--border);
  border-top: 3px solid var(--orange);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.auth-panel-wide {
  width: min(100%, 980px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.auth-panel h1 {
  max-width: 760px;
  margin: 8px 0 12px;
  font-size: clamp(32px, 7vw, 54px);
  line-height: 1.02;
  letter-spacing: 0;
}

.auth-panel h2 {
  margin: 0 0 18px;
  font-size: 20px;
  letter-spacing: 0;
}

.auth-lead {
  margin: 0 0 28px;
  color: var(--grey-300);
  font-size: 15px;
  line-height: 1.65;
}

.pwa-install-card {
  display: grid;
  gap: 10px;
  margin: 0 0 26px;
  padding: 16px;
  background: rgba(8, 11, 16, 0.54);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.pwa-install-eyebrow {
  margin: 0;
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pwa-install-button {
  justify-self: start;
}

.pwa-install-help {
  margin: 0;
  color: var(--grey-300);
  font-size: 13px;
  line-height: 1.45;
}

.auth-grid {
  display: grid;
  gap: 18px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-grid > .auth-form,
.recovery-flow,
.recovery-codes-panel {
  padding: 20px;
  background: var(--graphite-900);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--grey-300);
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--white);
  background: var(--graphite-800);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.auth-form input:focus {
  border-color: var(--orange);
}

.auth-error {
  min-height: 24px;
  margin-bottom: 10px;
  color: #ff9aa0;
  font-size: 14px;
}

.auth-qr {
  width: min(100%, 240px);
  aspect-ratio: 1;
  padding: 8px;
  justify-self: center;
  object-fit: contain;
  background: var(--white);
  border-radius: 6px;
}

.auth-qr:not([src]) {
  display: none;
}

.auth-secret {
  display: block;
  min-height: 44px;
  padding: 12px;
  overflow-wrap: anywhere;
  color: var(--orange-bright);
  background: var(--graphite-950);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.field-help,
.setup-stage-note,
.setup-status {
  margin: 0;
  color: var(--grey-400);
  font-size: 14px;
  line-height: 1.5;
}

.setup-status {
  min-height: 21px;
}

.setup-status[data-tone="error"] {
  color: #ff9aa0;
}

.setup-status[data-tone="success"] {
  color: #a7e8c2;
}

.setup-stage[aria-disabled="true"] {
  opacity: 0.58;
}

.setup-stage[aria-disabled="false"] {
  opacity: 1;
}

.auth-recovery {
  margin-top: 24px;
  border-top: 1px solid var(--border);
}

.auth-recovery summary {
  min-height: 48px;
  padding-top: 16px;
  color: var(--grey-300);
  cursor: pointer;
}

.recovery-flow {
  margin-top: 20px;
}

.recovery-flow form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.recovery-codes-panel {
  margin-top: 18px;
}

.recovery-codes-panel ol,
[data-recovery-codes] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 22px;
  padding-left: 26px;
  color: var(--orange-bright);
  font-family: Consolas, monospace;
}

.text-button {
  min-height: 44px;
  margin-top: 18px;
  padding: 0;
  color: var(--grey-300);
  background: transparent;
  border: 0;
  text-decoration: underline;
}

.primary-button {
  text-decoration: none;
}

@media (min-width: 760px) {
  .auth-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
:root .order-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
:root .order-photos img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; border: 1px solid #555; border-radius: 6px; background: #111; }
