:root {
  --amc-canvas: #f8fafc;
  --amc-surface: #ffffff;
  --amc-surface-soft: #f1f5f9;
  --amc-ink: #0f172a;
  --amc-text: #334155;
  --amc-muted: #64748b;
  --amc-line: #e2e8f0;
  --amc-primary: #4f46e5;
  --amc-primary-strong: #4338ca;
  --amc-primary-soft: #eef2ff;
  --amc-success: #047857;
  --amc-success-soft: #ecfdf5;
  --amc-warning: #d97706;
  --amc-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .04);
  --amc-shadow-lg: 0 24px 70px rgba(79, 70, 229, .14);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--amc-ink);
  background: var(--amc-canvas);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--amc-canvas); }
body { margin: 0; min-height: 100vh; background: var(--amc-canvas); color: var(--amc-ink); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(79, 70, 229, .2);
  outline-offset: 2px;
}
button {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  padding: .68rem 1rem;
  background: var(--amc-primary);
  color: #fff;
  font-weight: 750;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .16);
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
button:hover { background: var(--amc-primary-strong); }
button:active { transform: scale(.98); }
button.ghost, .ghost {
  background: var(--amc-surface);
  color: var(--amc-text);
  border: 1px solid var(--amc-line);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
button.ghost:hover, .ghost:hover { background: var(--amc-surface-soft); }
.eyebrow {
  margin: 0 0 .45rem;
  color: var(--amc-primary);
  font: 800 .66rem/1.2 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* AMC-MM login atmosphere: restrained grid, aurora, glass card. */
.route-grid {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 8% 8%, rgba(79, 70, 229, .1), transparent 34%),
    radial-gradient(circle at 92% 88%, rgba(147, 51, 234, .08), transparent 35%),
    linear-gradient(rgba(15, 23, 42, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, .018) 1px, transparent 1px);
  background-size: auto, auto, 40px 40px, 40px 40px;
}
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; }
.login-panel {
  position: relative;
  width: min(500px, 100%);
  padding: clamp(1.7rem, 5vw, 3rem);
  overflow: hidden;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 24px;
  box-shadow: var(--amc-shadow-lg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.login-panel::before {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  top: -150px;
  right: -110px;
  border-radius: 50%;
  background: rgba(79, 70, 229, .08);
  filter: blur(12px);
  pointer-events: none;
}
.brand-mark { display: flex; align-items: center; gap: .55rem; margin-bottom: 2rem; font-weight: 850; }
.brand-mark span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: var(--amc-primary);
  color: #fff;
  box-shadow: 0 8px 22px rgba(79, 70, 229, .24);
}
.brand-mark i { width: 66px; height: 3px; border-radius: 99px; background: linear-gradient(90deg, var(--amc-primary), #818cf8); }
.login-panel h1 { margin: .25rem 0 .8rem; font-size: clamp(2rem, 7vw, 3.15rem); line-height: 1; letter-spacing: -.04em; }
.login-intro { max-width: 39ch; margin: 0 0 1.75rem; color: var(--amc-muted); line-height: 1.65; }
.login-panel label, .dialog-card label { display: block; margin: .85rem 0 .42rem; color: var(--amc-text); font-size: .78rem; font-weight: 800; }
.field-row { display: flex; gap: .6rem; }
.field-row input, .field-row select {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--amc-line);
  border-radius: 12px;
  background: rgba(248, 250, 252, .9);
  color: var(--amc-ink);
  padding: .75rem .85rem;
}
.field-row input:focus, .field-row select:focus { border-color: #818cf8; background: #fff; outline: 3px solid rgba(79, 70, 229, .12); }
.status-line { min-height: 1.35rem; color: var(--amc-muted); font-size: .8rem; }
.locale-switch { display: flex; gap: .3rem; }
.locale-switch button { min-height: 30px; padding: .35rem .58rem; background: transparent; color: var(--amc-muted); box-shadow: none; font-size: .7rem; }
.locale-switch button.active { background: var(--amc-primary-soft); color: var(--amc-primary); }

/* App shell directly follows AMC-MM's slate canvas and white workspace surfaces. */
.assistant-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(400px, 1fr) 292px;
  grid-template-rows: 76px 1fr;
  grid-template-areas: "top top top" "rail main detail";
  background: var(--amc-canvas);
}
.topbar {
  grid-area: top;
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(226, 232, 240, .8);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.wordmark { min-width: 218px; display: flex; align-items: baseline; color: var(--amc-ink); text-decoration: none; }
.wordmark b {
  margin-right: .25rem;
  padding: .2rem .38rem;
  border-radius: 9px;
  background: var(--amc-primary);
  color: #fff;
  font-size: 1.28rem;
  letter-spacing: -.04em;
}
.wordmark span { font-size: 1.28rem; font-weight: 850; letter-spacing: -.04em; }
.wordmark em { margin-left: .55rem; color: var(--amc-muted); font-size: .68rem; font-style: normal; }
.route-passport {
  max-width: 620px;
  margin: auto;
  flex: 1;
  display: flex;
  align-items: center;
  padding: .5rem .72rem;
  background: var(--amc-canvas);
  color: var(--amc-ink);
  border: 1px solid var(--amc-line);
  border-radius: 12px;
  box-shadow: none;
  text-align: left;
}
.route-passport:hover { background: var(--amc-primary-soft); border-color: #c7d2fe; }
.route-stop { min-width: 0; flex: 1; }
.route-stop small { display: block; color: var(--amc-muted); font-size: .58rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.route-stop strong { display: block; overflow: hidden; color: var(--amc-text); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.route-passport > i { position: relative; min-width: 24px; height: 1px; flex: .25; margin: 0 .65rem; background: #c7d2fe; }
.route-passport > i::after { content: ""; position: absolute; right: 0; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--amc-primary); }
.top-actions { display: flex; align-items: center; gap: .45rem; }
.top-actions select { max-width: 150px; border: 1px solid var(--amc-line); border-radius: 10px; background: #fff; color: var(--amc-text); padding: .56rem .65rem; font-size: .75rem; font-weight: 650; }
.top-actions button { min-height: 36px; padding: .5rem .68rem; white-space: nowrap; font-size: .75rem; }

.task-rail { grid-area: rail; padding: 1.2rem .85rem; border-right: 1px solid var(--amc-line); background: #f1f5f9; }
.rail-title { display: flex; align-items: center; justify-content: space-between; padding: .15rem .45rem .85rem; }
.rail-title h2, .detail-panel h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.03em; }
.icon-button { width: 36px; height: 36px; min-height: 36px; padding: 0; display: grid; place-items: center; border-radius: 11px; font-size: 1.15rem; }
.task-item {
  width: 100%;
  display: block;
  margin: .22rem 0;
  padding: .78rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--amc-text);
  box-shadow: none;
  text-align: left;
}
.task-item:hover { background: rgba(255, 255, 255, .75); }
.task-item.active { background: #fff; border-color: var(--amc-line); box-shadow: var(--amc-shadow-sm); }
.task-item strong { display: block; overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.task-item small { color: var(--amc-muted); font-size: .67rem; }

.conversation { grid-area: main; min-width: 0; padding: clamp(1.25rem, 3.5vw, 3rem); background: var(--amc-surface); }
.empty-state { max-width: 620px; margin: 9vh auto; text-align: center; }
.empty-state h2 { margin: .35rem 0 1rem; font-size: clamp(2.25rem, 5.5vw, 4.6rem); line-height: .98; letter-spacing: -.055em; }
.empty-state > p:not(.eyebrow) { max-width: 510px; margin: 0 auto 1.75rem; color: var(--amc-muted); line-height: 1.7; }
.route-orbit {
  position: relative;
  width: 78px;
  height: 78px;
  margin: 0 auto 1.45rem;
  border-radius: 24px;
  background: linear-gradient(145deg, var(--amc-primary), #818cf8);
  box-shadow: 0 18px 38px rgba(79, 70, 229, .24);
  transform: rotate(8deg);
}
.route-orbit::before { content: ""; position: absolute; inset: 18px; border: 2px solid rgba(255, 255, 255, .82); border-radius: 50%; }
.route-orbit span { position: absolute; right: 17px; top: 17px; width: 11px; height: 11px; border: 3px solid var(--amc-primary); border-radius: 50%; background: #fff; }
.task-heading { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--amc-line); }
.task-heading h2 { margin: .45rem 0 0; font-size: clamp(1.7rem, 3.5vw, 2.8rem); line-height: 1; letter-spacing: -.04em; }
.status-pill { display: inline-block; margin: 0; padding: .28rem .52rem; border-radius: 999px; background: var(--amc-primary-soft); color: var(--amc-primary); font-size: .65rem; font-weight: 850; text-transform: uppercase; }
.activity-stream { display: grid; gap: .8rem; padding: 1.6rem 0; }
.message { padding: .9rem 1rem; border: 1px solid var(--amc-line); border-radius: 14px; background: var(--amc-canvas); color: var(--amc-text); line-height: 1.55; }
.message.system { border-color: #c7d2fe; background: var(--amc-primary-soft); }
.message small { display: block; margin-bottom: .3rem; color: var(--amc-muted); font-size: .68rem; }
.review-stack { display: grid; gap: .85rem; }
.review-card { overflow: hidden; border: 1px solid var(--amc-line); border-radius: 16px; background: #fff; box-shadow: var(--amc-shadow-sm); }
.review-head { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1rem; border-bottom: 1px solid var(--amc-line); background: var(--amc-surface-soft); color: var(--amc-ink); }
.review-head small { color: var(--amc-muted); font-family: ui-monospace, monospace; }
.review-body { padding: 1rem; }
.review-body pre { padding: .9rem; overflow: auto; border-radius: 12px; background: #0f172a; color: #e2e8f0; white-space: pre-wrap; word-break: break-word; font: 12px/1.55 ui-monospace, monospace; }
.review-meta { color: var(--amc-muted); word-break: break-all; font: 11px/1.5 ui-monospace, monospace; }
.review-details { display: grid; gap: .65rem; }
.review-detail { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(0, 1.3fr); gap: .75rem; padding-bottom: .65rem; border-bottom: 1px solid var(--amc-line); }
.review-detail:last-child { padding-bottom: 0; border-bottom: 0; }
.review-detail strong { color: var(--amc-muted); font-size: .72rem; }
.review-detail span { min-width: 0; color: var(--amc-text); font-size: .82rem; word-break: break-word; }
.review-actions { display: flex; gap: .55rem; margin-top: .9rem; }
.composer { position: sticky; bottom: 1rem; display: flex; gap: .5rem; margin-top: 1.5rem; padding: .5rem; border: 1px solid var(--amc-line); border-radius: 16px; background: rgba(255, 255, 255, .92); box-shadow: 0 18px 48px rgba(15, 23, 42, .12); backdrop-filter: blur(16px); }
.composer textarea { min-height: 46px; flex: 1; resize: vertical; border: 0; background: transparent; color: var(--amc-ink); padding: .65rem; }
.composer textarea:focus { outline: 0; }

.detail-panel { grid-area: detail; padding: 1.45rem 1.15rem; border-left: 1px solid var(--amc-line); background: var(--amc-canvas); }
.detail-panel dl { margin: 1.25rem 0; }
.detail-panel dt { margin-top: .9rem; color: var(--amc-muted); font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.detail-panel dd { margin: .22rem 0; color: var(--amc-text); font-size: .8rem; font-weight: 750; word-break: break-word; }
.evidence-note { display: flex; gap: .65rem; padding: .85rem; border: 1px solid #a7f3d0; border-radius: 12px; background: var(--amc-success-soft); color: #065f46; font-size: .76rem; line-height: 1.5; }
.evidence-note span { font-weight: 900; }
.evidence-note p { margin: 0; }

dialog { width: 100%; max-width: 650px; padding: 1rem; border: 0; background: transparent; }
dialog::backdrop { background: rgba(15, 23, 42, .46); backdrop-filter: blur(6px); }
.dialog-card { padding: 1.4rem; border: 1px solid rgba(226, 232, 240, .9); border-radius: 20px; background: #fff; box-shadow: 0 28px 80px rgba(15, 23, 42, .2); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.dialog-heading h2 { margin: 0; font-size: 1.7rem; letter-spacing: -.035em; }
.dialog-card > p, .dialog-card form > p, .dialog-card section > p { color: var(--amc-muted); line-height: 1.55; }
.dialog-card textarea { width: 100%; min-height: 84px; padding: .8rem; border: 1px solid var(--amc-line); border-radius: 12px; background: var(--amc-canvas); color: var(--amc-ink); }
.dialog-actions { display: flex; justify-content: flex-end; gap: .55rem; margin-top: 1rem; }
.context-options { display: grid; gap: .55rem; margin-top: 1rem; }
.context-option { padding: .9rem; border: 1px solid var(--amc-line); background: #fff; color: var(--amc-text); box-shadow: none; text-align: left; }
.context-option.active { border-color: #a5b4fc; background: var(--amc-primary-soft); box-shadow: inset 3px 0 var(--amc-primary); }
.context-option span { display: block; margin-top: .25rem; color: var(--amc-muted); font-size: .72rem; }
.toast { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 20; padding: .75rem .95rem; border-radius: 12px; background: #0f172a; color: #fff; box-shadow: 0 18px 50px rgba(15, 23, 42, .25); opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Merchant operations reuse AMC-MM compact cards and forms. */
.business-card { max-height: 88vh; overflow: auto; border-color: var(--amc-line); border-radius: 22px; box-shadow: var(--amc-shadow-lg); }
.business-card h3 { margin: 1.45rem 0 .35rem; color: var(--amc-ink); font-size: 1rem; letter-spacing: -.015em; }
.business-card form + form, .business-card section form + form { margin-top: 1.4rem; padding-top: .25rem; border-top: 1px solid var(--amc-line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea {
  display: block;
  width: 100%;
  margin-top: .38rem;
  padding: .72rem .78rem;
  border: 1px solid var(--amc-line);
  border-radius: 12px;
  background: var(--amc-canvas);
  color: var(--amc-ink);
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: #818cf8; outline: 0; box-shadow: 0 0 0 3px rgba(79, 70, 229, .11); background: #fff; }
.inline-search { display: flex; align-items: flex-end; gap: .55rem; }
.inline-search input { flex: 1; }
.place-results, .catalog-summary { display: grid; gap: .5rem; margin: .9rem 0; }
.place-option { display: flex; flex-direction: column; align-items: flex-start; padding: .78rem .9rem; border: 1px solid var(--amc-line); border-radius: 12px; background: #fff; color: var(--amc-text); box-shadow: none; text-align: left; }
.place-option span { margin-top: .18rem; color: var(--amc-muted); font-size: .74rem; }
.place-option.selected { border-color: #a5b4fc; background: var(--amc-primary-soft); box-shadow: 0 0 0 3px rgba(79, 70, 229, .08); }
.catalog-summary article { padding: .78rem; border: 1px solid var(--amc-line); border-radius: 12px; background: var(--amc-canvas); color: var(--amc-text); }
.catalog-summary .menu-candidate { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.catalog-summary .menu-candidate button { margin-left: auto; padding: .42rem .65rem; }
.candidate-price { width: 8rem !important; margin: 0 !important; padding: .48rem !important; }
.candidate-status { margin-left: auto; font-size: .68rem; font-weight: 850; }
.candidate-status.published { padding: .27rem .5rem; border-radius: 999px; background: #d1fae5; color: #047857; }
.operations-section { margin-top: 1.45rem; padding-top: .25rem; border-top: 1px solid var(--amc-line); }
.operation-card p { margin: .5rem 0; color: var(--amc-muted); }
.operation-actions, .commit-controls { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-top: .65rem; }
.operation-actions button, .commit-controls button { padding: .45rem .65rem; }
.commit-controls select, .commit-controls input { min-width: 0; flex: 1; padding: .52rem; border: 1px solid var(--amc-line); border-radius: 10px; background: #fff; }

@media (max-width: 1000px) {
  .assistant-shell { grid-template-columns: 220px 1fr; grid-template-areas: "top top" "rail main"; }
  .detail-panel { display: none; }
  .route-passport { max-width: none; }
  .wordmark { min-width: auto; }
  .wordmark em { display: none; }
}

@media (max-width: 700px) {
  .review-detail { grid-template-columns: 1fr; gap: .2rem; }
  input, textarea, select { font-size: max(16px, 1em); }
  .assistant-shell { display: block; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .topbar { min-height: 66px; height: auto; padding: .58rem; gap: .55rem; flex-wrap: wrap; }
  .wordmark { flex: 1; }
  .route-passport { order: 3; width: 100%; flex-basis: 100%; }
  .top-actions { gap: .3rem; }
  .top-actions .ghost { padding: .4rem .52rem; font-size: .72rem; }
  .top-actions select { max-width: 110px; padding: .42rem; font-size: .7rem; }
  .task-rail { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; height: calc(70px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; padding: .48rem .55rem env(safe-area-inset-bottom, 0px); border: 0; border-top: 1px solid var(--amc-line); background: rgba(248, 250, 252, .94); backdrop-filter: blur(18px); }
  .rail-title { flex: 0 0 auto; padding: 0 .32rem; }
  .rail-title > div { display: none; }
  .task-rail nav { min-width: 0; display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; }
  .task-rail nav::-webkit-scrollbar { display: none; }
  .task-item { min-width: 126px; margin: 0; padding: .5rem; }
  .task-item small { display: none; }
  .conversation { padding: 1rem; }
  .empty-state { margin: 7vh auto; }
  .empty-state h2 { font-size: 2.45rem; }
  .task-heading h2 { font-size: 2rem; }
  .composer { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .review-actions, .field-row { flex-direction: column; }
  .login-panel { padding: 1.65rem 1.15rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  dialog { padding: .5rem; }
  .dialog-card { padding: 1.1rem; border-radius: 18px; }
  .business-card { max-height: 94vh; }
  .toast { left: .8rem; right: .8rem; bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* Merchant workspace shell: mirrors AMC-MM's compact product navigation while
   keeping the Assistant as one workspace tool instead of the entire interface. */
.assistant-shell {
  grid-template-columns: 224px minmax(0, 1fr);
  grid-template-rows: 76px minmax(0, 1fr);
  grid-template-areas: "top top" "workspace-nav workspace-main";
  height: 100vh;
  overflow: hidden;
}
.workspace-nav {
  grid-area: workspace-nav;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.25rem .85rem;
  border-right: 1px solid var(--amc-line);
  background: #fff;
}
.workspace-nav button {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 45px;
  padding: .7rem .8rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--amc-muted);
  box-shadow: none;
  text-align: left;
}
.workspace-nav button:hover { background: var(--amc-surface-soft); color: var(--amc-ink); }
.workspace-nav button.active {
  border-color: #c7d2fe;
  background: var(--amc-primary-soft);
  color: var(--amc-primary);
  box-shadow: inset 3px 0 var(--amc-primary);
}
.workspace-nav button span { width: 1.2rem; font-size: 1.05rem; text-align: center; }
.workspace-nav button b { font-size: .8rem; }
.workspace-page {
  grid-area: workspace-main;
  min-width: 0;
  overflow-y: auto;
  padding: clamp(1.15rem, 3vw, 2.5rem);
}
.workspace-page > * { width: min(1180px, 100%); margin-right: auto; margin-left: auto; }
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.page-heading h1 { margin: .2rem 0 .4rem; font-size: clamp(1.8rem, 4vw, 2.85rem); letter-spacing: -.045em; }
.page-heading p:not(.eyebrow) { margin: 0; color: var(--amc-muted); line-height: 1.55; }
.amc-card {
  padding: clamp(1rem, 2.3vw, 1.4rem);
  border: 1px solid var(--amc-line);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--amc-shadow-sm);
}
.amc-card h2, .amc-card h3 { margin: .15rem 0 .65rem; letter-spacing: -.025em; }
.amc-card > p:not(.eyebrow), .amc-card form > p:not(.eyebrow) { color: var(--amc-muted); line-height: 1.55; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.management-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.wide-card { grid-column: 1 / -1; }
.onboarding-card { margin-bottom: 1rem; }
.onboarding-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-top: .85rem; }
.onboarding-action {
  min-height: 156px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid var(--amc-line);
  background: var(--amc-canvas);
  color: var(--amc-ink);
  box-shadow: none;
  text-align: left;
}
.onboarding-action:hover { border-color: #a5b4fc; background: var(--amc-primary-soft); }
.onboarding-action.complete { border-color: #a7f3d0; background: var(--amc-success-soft); }
.onboarding-action strong { margin-top: .8rem; font-size: .92rem; }
.onboarding-action p { margin: .35rem 0 0; color: var(--amc-muted); font-size: .75rem; line-height: 1.45; }
.entitlement-status { display: block; margin-top: auto; padding-top: .7rem; color: var(--amc-primary); font-size: .66rem; font-weight: 750; line-height: 1.4; }
.onboarding-action.complete .entitlement-status { color: var(--amc-success); }
.step-state { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: var(--amc-primary); color: #fff; font-weight: 900; }
.onboarding-action.complete .step-state { background: var(--amc-success); }
.step-state::before { content: ""; display: block; }
.step-state.done::before { width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.step-state.pending::before { width: 7px; height: 7px; border: solid #fff; border-width: 2px 2px 0 0; transform: translateX(-1px) rotate(45deg); }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.home-action { display: flex; align-items: center; gap: .9rem; cursor: pointer; }
.home-action:hover { border-color: #c7d2fe; }
.home-action h3, .home-action p { margin: 0; }
.home-action p { margin-top: .3rem; color: var(--amc-muted); font-size: .78rem; line-height: 1.45; }
.home-action { width: 100%; color: var(--amc-ink); text-align: left; box-shadow: var(--amc-shadow-sm); }
.home-action > span:last-child { min-width: 0; }
.home-action strong, .home-action small { display: block; }
.home-action strong { font-size: 1rem; }
.home-action small { margin-top: .3rem; color: var(--amc-muted); font-size: .78rem; font-weight: 500; line-height: 1.45; }
.home-icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: var(--amc-primary-soft); color: var(--amc-primary); font-size: 1.15rem; }
.home-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.location-list { display: grid; gap: .8rem; margin-top: 1rem; }
.location-card { padding: 1rem; border: 1px solid var(--amc-line); border-radius: 14px; background: var(--amc-canvas); }
.location-title { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.location-title h3 { margin: 0; }
.source-badge { padding: .25rem .5rem; border-radius: 999px; background: #e0f2fe; color: #0369a1; font-size: .65rem; font-weight: 800; white-space: nowrap; }
.source-link { color: var(--amc-primary); font-size: .76rem; font-weight: 700; }
.assistant-grid {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 280px;
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "rail main detail";
  padding: 0;
  overflow: hidden;
}
.assistant-grid .task-rail, .assistant-grid .conversation, .assistant-grid .detail-panel { min-height: 0; overflow-y: auto; }

@media (max-width: 1000px) {
  .assistant-shell { grid-template-columns: 194px minmax(0, 1fr); grid-template-areas: "top top" "workspace-nav workspace-main"; }
  .onboarding-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assistant-grid { grid-template-columns: 200px minmax(0, 1fr); grid-template-areas: "rail main"; }
  .assistant-grid .detail-panel { display: none; }
}

@media (max-width: 700px) {
  .assistant-shell { display: block; height: auto; min-height: 100vh; overflow: visible; padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .workspace-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 12;
    height: calc(66px + env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: .12rem;
    padding: .36rem .3rem env(safe-area-inset-bottom, 0px);
    border: 0;
    border-top: 1px solid var(--amc-line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(18px);
  }
  .workspace-nav button { min-height: 54px; flex-direction: column; justify-content: center; gap: .08rem; padding: .25rem .1rem; border: 0; border-radius: 10px; box-shadow: none; }
  .workspace-nav button.active { box-shadow: none; }
  .workspace-nav button span { width: auto; font-size: .95rem; line-height: 1; }
  .workspace-nav button b { max-width: 100%; overflow: hidden; font-size: .55rem; text-overflow: ellipsis; white-space: nowrap; }
  .workspace-page { min-height: calc(100vh - 136px); padding: 1rem; overflow: visible; }
  .management-grid, .home-grid, .onboarding-grid { grid-template-columns: 1fr; }
  .wide-card { grid-column: auto; }
  .onboarding-action { min-height: 118px; }
  .page-heading { align-items: flex-start; }
  .assistant-grid { display: block; padding: 0; }
  .assistant-grid .task-rail { position: static; height: auto; min-height: 64px; padding: .6rem; border-right: 0; border-bottom: 1px solid var(--amc-line); }
  .assistant-grid .conversation { min-height: calc(100vh - 240px); padding: 1rem; }
  .assistant-grid .composer { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  .topbar { position: sticky; top: 0; }
}

/* AMC-MM parity pass: use the same mobile-first app shell, density and drawer
   interaction while preserving 12Eat's real merchant workflows. */
:root {
  --amc-canvas: #f7f9fb;
  --amc-surface-soft: #f1f5f9;
  --amc-primary: #4f46e5;
  --amc-primary-strong: #4338ca;
  --amc-purple: #9333ea;
  --amc-line: rgba(226, 232, 240, .82);
  --amc-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px rgba(15, 23, 42, .035);
  --amc-shadow-lg: 0 25px 60px rgba(100, 116, 139, .20);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
html.dark {
  --amc-canvas: #020617;
  --amc-surface: #0f172a;
  --amc-surface-soft: #1e293b;
  --amc-ink: #f8fafc;
  --amc-text: #e2e8f0;
  --amc-muted: #94a3b8;
  --amc-line: rgba(51, 65, 85, .82);
  --amc-primary-soft: rgba(49, 46, 129, .34);
  --amc-success: #6ee7b7;
  --amc-success-soft: rgba(6, 78, 59, .34);
}
body { background: var(--amc-canvas); }
.menu-open { overflow: hidden; }
::selection { background: rgba(79, 70, 229, .16); }
* { scrollbar-color: #cbd5e1 transparent; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-thumb { border-radius: 99px; background: #cbd5e1; }

.route-grid {
  background:
    radial-gradient(circle at 22% 42%, rgba(99, 102, 241, .13), transparent 34%),
    radial-gradient(circle at 78% 72%, rgba(168, 85, 247, .09), transparent 30%),
    linear-gradient(rgba(15, 23, 42, .012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, .012) 1px, transparent 1px),
    #f8fafc;
  background-size: auto, auto, 40px 40px, 40px 40px, auto;
}
.language-float {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  z-index: 3;
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .48rem .72rem;
  border: 1px solid var(--amc-line);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: #475569;
  box-shadow: 0 2px 8px rgba(15,23,42,.08);
  font-size: .68rem;
  font-weight: 700;
  backdrop-filter: blur(16px);
  cursor: pointer;
}
.language-float svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.login-shell { position: relative; z-index: 1; padding: 2rem 1rem; }
.login-panel {
  width: min(440px, 100%);
  padding: 2.5rem;
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 24px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--amc-shadow-lg);
  backdrop-filter: blur(24px);
  overflow: visible;
}
.login-panel::before { display: none; }
.brand-mark { justify-content: center; margin: 0 0 1rem; }
.brand-mark span {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(145deg, #4f46e5, #9333ea);
  font-size: 1.25rem;
  box-shadow: 0 12px 26px rgba(99,102,241,.28);
}
.login-panel h1 {
  margin: 0 0 .45rem;
  background: linear-gradient(90deg, #4f46e5, #9333ea);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.55rem;
  line-height: 1.2;
  text-align: center;
  letter-spacing: -.035em;
}
.login-intro {
  max-width: 34ch;
  margin: 0 auto 2rem;
  color: #64748b;
  font-size: .83rem;
  line-height: 1.55;
  text-align: center;
}
.login-panel label {
  margin: .95rem .25rem .48rem;
  color: #64748b;
  font: 500 .68rem/1.2 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.login-panel .field-row { display: grid; grid-template-columns: 1fr; gap: .65rem; }
.login-panel .field-row input,
.login-panel .field-row select {
  width: 100%;
  min-height: 50px;
  padding: .85rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  box-shadow: inset 0 1px 2px rgba(15,23,42,.025);
}
.login-panel .field-row button {
  width: 100%;
  min-height: 48px;
  margin-top: .25rem;
  border-radius: 12px;
  background: linear-gradient(90deg, #4f46e5, #9333ea);
  box-shadow: 0 10px 24px rgba(99,102,241,.22);
}
.login-panel .status-line { margin: .8rem 0 0; text-align: center; }
.locale-switch { display: none; }

.assistant-shell {
  position: relative;
  z-index: 1;
  display: block;
  min-height: 100dvh;
  height: auto;
  overflow: visible;
  background: var(--amc-canvas);
}
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  min-height: calc(64px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 1rem 0;
  display: flex;
  align-items: center;
  gap: .6rem;
  border-bottom: 1px solid var(--amc-line);
  background: rgba(255,255,255,.96);
  box-shadow: none;
  backdrop-filter: blur(20px);
}
.dark .topbar { background: rgba(2,6,23,.94); }
.wordmark { min-width: auto; flex: 0 0 auto; }
.wordmark b,
.drawer-logo {
  display: grid;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #4f46e5, #7c3aed);
  color: #fff;
  box-shadow: 0 6px 14px rgba(79,70,229,.2);
  font-size: .8rem;
  font-weight: 900;
}
.route-passport {
  order: 0;
  width: auto;
  flex-basis: auto;
  min-width: 0;
  max-width: none;
  flex: 1;
  margin: 0;
  padding: .2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}
.route-passport:hover { border: 0; background: var(--amc-surface-soft); }
.route-stop strong { color: var(--amc-text); font-size: .76rem; font-weight: 850; }
.route-stop small { margin-top: .16rem; color: var(--amc-muted); font-size: .55rem; letter-spacing: .08em; }
.topbar-controls { display: flex; align-items: center; gap: .1rem; }
.icon-control {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  color: var(--amc-muted);
  box-shadow: none;
}
.icon-control:hover { background: var(--amc-surface-soft); color: var(--amc-ink); }
.icon-control svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-control .sun-icon { display: none; }
.dark .icon-control .moon-icon { display: none; }
.dark .icon-control .sun-icon { display: block; color: #fbbf24; }
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: rgba(15,23,42,.42);
  box-shadow: none;
  backdrop-filter: blur(4px);
}
.workspace-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  z-index: 90;
  width: min(300px, 86vw);
  height: 100dvh;
  padding: max(1.75rem, env(safe-area-inset-top)) 1.75rem max(1.5rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 0;
  border-left: 1px solid var(--amc-line);
  background: var(--amc-canvas);
  box-shadow: -22px 0 60px rgba(15,23,42,.18);
  transform: translateX(105%);
  transition: transform .28s cubic-bezier(.22,1,.36,1);
}
.workspace-nav.open { transform: translateX(0); }
.drawer-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.drawer-heading .icon-control { width: 34px; height: 34px; min-height: 34px; }
.workspace-nav .drawer-workspace {
  width: 100%;
  min-height: 62px;
  padding: .75rem;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: .65rem;
  border: 1px solid var(--amc-line);
  border-radius: 12px;
  background: var(--amc-surface);
  color: var(--amc-text);
  box-shadow: none;
  text-align: left;
  justify-content: stretch;
  flex-direction: initial;
}
.drawer-workspace:hover { background: var(--amc-surface-soft); }
.workspace-nav .drawer-workspace-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: var(--amc-primary); color: #fff; font-size: .72rem; font-weight: 900; }
.drawer-workspace > span:nth-child(2) { min-width: 0; }
.drawer-workspace strong, .drawer-workspace small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-workspace strong { font-size: .75rem; }
.drawer-workspace small { margin-top: .18rem; color: var(--amc-muted); font-size: .6rem; }
.drawer-workspace > svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.drawer-links { flex: 1; min-height: 0; margin: 1.5rem 0; overflow-y: auto; }
.drawer-links button {
  width: 100%;
  min-height: 44px;
  padding: .6rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--amc-text);
  box-shadow: none;
  text-align: left;
  flex-direction: row;
  justify-content: flex-start;
}
.drawer-links button:hover,
.drawer-links button.active { background: transparent; color: var(--amc-primary); box-shadow: none; }
.drawer-links button svg { width: 21px; height: 21px; flex: 0 0 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.drawer-links button b { font-size: .85rem; letter-spacing: .015em; }
.top-actions { padding-top: 1rem; display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; border-top: 1px solid var(--amc-line); }
.top-actions label { color: var(--amc-muted); font: 700 .55rem/1.2 ui-monospace, monospace; letter-spacing: .08em; }
.top-actions select { width: 100%; max-width: none; margin-top: .38rem; padding: .6rem; border-radius: 10px; background: var(--amc-surface); color: var(--amc-text); }
.top-actions .drawer-logout { grid-column: 1 / -1; margin-top: .35rem; min-height: 42px; border: 0; background: transparent; color: #e11d48; box-shadow: none; text-align: left; }

.workspace-page {
  width: 100%;
  min-height: 100dvh;
  padding: calc(64px + env(safe-area-inset-top, 0px) + clamp(1rem, 3vw, 2rem)) clamp(1rem, 4vw, 2.5rem) 2.5rem;
  overflow: visible;
}
.workspace-page > * { width: min(900px, 100%); }
.page-heading { margin-bottom: 1.2rem; align-items: flex-start; }
.page-heading h1 { margin: 0 0 .35rem; font-size: clamp(1.7rem, 4vw, 2.25rem); }
.eyebrow { display: none; }
.page-heading p:not(.eyebrow) { font-size: .86rem; }
.amc-card {
  padding: clamp(1rem, 3vw, 1.4rem);
  border: 1px solid var(--amc-line);
  border-radius: 24px;
  background: var(--amc-surface);
  box-shadow: var(--amc-shadow-sm);
}
.section-heading h2 { margin: 0; font-size: 1rem; }
.status-pill { padding: .36rem .62rem; border-radius: 10px; font-size: .62rem; }
.onboarding-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: .75rem; }
.onboarding-action {
  min-height: 138px;
  padding: .9rem;
  border-radius: 16px;
  background: var(--amc-canvas);
}
.onboarding-action.active { box-shadow: none; }
.step-state { border-radius: 10px; }
.home-grid { margin-top: .9rem; }
.home-action { border-radius: 20px; }
.home-icon { border-radius: 14px; }
.management-grid { gap: 1rem; }
.amc-card h2 { font-size: 1.1rem; }
.amc-card label { color: var(--amc-text); font-size: .72rem; font-weight: 800; }
.form-grid input, .form-grid select, .form-grid textarea,
.inline-search input {
  min-height: 48px;
  border-radius: 12px;
  background: var(--amc-canvas);
  color: var(--amc-ink);
}
.form-grid textarea { min-height: 96px; }
.dark .form-grid input, .dark .form-grid select, .dark .form-grid textarea, .dark .inline-search input { border-color: #334155; background: #0f172a; }
.dark .onboarding-action.complete { border-color: #065f46; background: var(--amc-success-soft); }
.dark .onboarding-action.complete .entitlement-status { color: var(--amc-success); }
.dialog-actions button,
.inline-search button { min-height: 46px; border-radius: 12px; }
.location-card,
.catalog-summary article,
.place-option { border-radius: 16px; }

.assistant-grid { display: grid; min-height: 100dvh; padding: calc(64px + env(safe-area-inset-top, 0px)) 0 0; grid-template-columns: 220px minmax(0,1fr); grid-template-areas: "rail main"; }
.assistant-grid .task-rail { background: var(--amc-canvas); }
.assistant-grid .conversation { background: var(--amc-surface); }
.assistant-grid .detail-panel { display: none; }
.composer { border-radius: 22px; }

dialog { max-width: 580px; }
.dialog-card { border-radius: 24px; background: var(--amc-surface); color: var(--amc-ink); }
.toast { bottom: 1rem; border-radius: 999px; }

@media (max-width: 700px) {
  .language-float { top: max(.75rem, env(safe-area-inset-top)); right: .75rem; }
  .login-panel { padding: 1.7rem 1.15rem; border-radius: 24px; }
  .login-panel h1 { font-size: 1.35rem; }
  .login-intro { margin-bottom: 1.4rem; }
  .topbar { min-height: calc(60px + env(safe-area-inset-top, 0px)); }
  .wordmark b { width: 28px; height: 28px; }
  .workspace-page { min-height: 100dvh; padding: calc(60px + env(safe-area-inset-top, 0px) + 1.15rem) 1rem 2rem; }
  .management-grid, .home-grid, .onboarding-grid { grid-template-columns: 1fr; }
  .onboarding-action { min-height: 116px; }
  .inline-search { align-items: stretch; flex-direction: column; }
  .assistant-grid { display: block; padding-top: calc(60px + env(safe-area-inset-top, 0px)); }
  .assistant-grid .task-rail { position: static; height: auto; min-height: 62px; padding: .65rem; border: 0; border-bottom: 1px solid var(--amc-line); }
  .assistant-grid .conversation { min-height: calc(100dvh - 122px); }
  .assistant-grid .composer { bottom: max(.75rem, env(safe-area-inset-bottom)); }
  .toast { left: .8rem; right: .8rem; bottom: max(.8rem, env(safe-area-inset-bottom)); }
}
