@charset "UTF-8";
/* Consumer order app. Look and tokens come from the Carri sandbox frontend
   (mobot-sandbox/frontend/styles.css :2-11 and its mobile bottom tab bar);
   nothing robot-specific came with them: no fleet grid, fault banner, speed,
   distance, battery or map.

   MOBILE FIRST. The base rules are the phone layout: a 16px side gutter, a
   bottom tab bar, one column. min-width queries add the sidebar and the
   three-up home cards. Nothing may scroll sideways at 375px, so every flex or
   grid child that holds user text has min-width: 0 and wraps long names. */

:root {
  --ink: #173b35;
  --ink-soft: #5e746f;
  --mint-deep: #2f695e;
  --mint: #bcded0;
  --mint-pale: #e5f0e9;
  --sand: #f3efe5;
  --paper: #fffdf8;
  --peach: #e9ad83;
  --line: rgba(23, 59, 53, .13);
  --shadow: 0 12px 32px rgba(42, 67, 57, .09);
  --good: #2e7456;
  --warn: #9b5d36;
  --bad: #9b3d36;
  --gutter: 16px;
  --header-h: 52px;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html { overflow-x: hidden; overflow-x: clip; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: #f7f3ea;
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--peach); outline-offset: 3px; }
h1:focus { outline: none; }
p { margin: 0; }
.muted { color: var(--ink-soft); font-size: 14px; }

/* ---- shell ------------------------------------------------------------- */
.app-shell { min-height: 100dvh; }
.app-header {
  position: sticky; top: 0; z-index: 15;
  min-height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255, 253, 248, .94); border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(23, 59, 53, .05); backdrop-filter: blur(18px);
}
.header-logo { display: inline-flex; min-height: 44px; align-items: center; }
.header-logo img { display: block; width: auto; height: 31px; object-fit: contain; }
.live-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 99px;
  background: #f8e7d9; color: var(--warn); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.live-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.live-pill[data-live="true"] { background: #e0f0e6; color: var(--good); }

.shell-body { display: block; }
.tabbar {
  position: fixed; inset: auto 0 0; z-index: 20;
  height: calc(68px + env(safe-area-inset-bottom));
  padding: 6px max(12px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(12px, env(safe-area-inset-left));
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  background: rgba(255, 253, 248, .94); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(23, 59, 53, .045); backdrop-filter: blur(18px);
}
.tab {
  position: relative; min-height: 54px; padding: 5px 4px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-soft); font-size: 10px; font-weight: 600;
}
.tab::after {
  content: ""; position: absolute; left: 50%; bottom: 1px; width: 16px; height: 2px; border-radius: 2px;
  background: var(--mint-deep); opacity: 0; transform: translateX(-50%) scaleX(.5); transition: opacity .2s ease, transform .2s ease;
}
.tab.is-active { color: var(--mint-deep); }
.tab.is-active::after { opacity: 1; transform: translateX(-50%) scaleX(1); }
.tab-icon { position: relative; display: grid; place-items: center; width: 24px; height: 22px; }
.tab-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-badge {
  position: absolute; top: -6px; left: 13px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
  background: var(--peach); color: var(--ink); font-size: 10px; line-height: 16px; text-align: center;
}

.workspace {
  min-width: 0; min-height: calc(100dvh - var(--header-h));
  padding: 18px max(var(--gutter), env(safe-area-inset-right)) calc(92px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
}
.view { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; animation: reveal .3s ease both; }
.view > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } }

/* ---- type -------------------------------------------------------------- */
.page-intro { display: grid; gap: 6px; margin: 2px 2px 4px; }
.page-intro h1 { margin: 0; font: 400 30px/1.08 Georgia, serif; letter-spacing: -.03em; overflow-wrap: anywhere; }
.page-intro h1 .arrow { color: var(--mint-deep); }
.page-intro > p:last-child:not(.eyebrow) { color: var(--ink-soft); font-size: 15px; line-height: 1.45; }
.eyebrow { margin: 0; color: var(--mint-deep); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; overflow-wrap: anywhere; }
.note { color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.back-link { align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.back-link span { font-size: 22px; line-height: 1; }

/* ---- surfaces ---------------------------------------------------------- */
.card { display: grid; gap: 12px; padding: 18px; border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); min-width: 0; }
.notice {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px;
  padding: 14px 16px; border-radius: 16px; background: var(--mint-pale); color: var(--ink); font-size: 14px; line-height: 1.4;
}
.notice.is-error { background: #f8e7d9; color: var(--warn); }
.notice-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.empty { display: grid; justify-items: start; gap: 8px; padding: 22px; border: 1px dashed var(--line); border-radius: 22px; color: var(--ink-soft); }
.empty strong { color: var(--ink); font: 400 22px Georgia, serif; }
.progress-strip {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; border-radius: 16px;
  background: var(--mint); font-size: 14px; font-weight: 700;
}
.progress-strip .progress-go { margin-left: auto; font-size: 20px; }
.progress-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--peach); box-shadow: 0 0 0 4px rgba(233, 173, 131, .3); }

/* ---- buttons ----------------------------------------------------------- */
.primary-button, .secondary-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 13px 20px;
  border: 0; border-radius: 14px; font-weight: 700; text-align: center; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.primary-button { background: var(--ink); color: #fff; box-shadow: 0 10px 20px rgba(23, 59, 53, .18); }
.primary-button:hover { transform: translateY(-2px); }
.primary-button:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; transform: none; }
.primary-button.small { min-height: 40px; padding: 9px 14px; font-size: 14px; }
.primary-button.big { min-height: 64px; font-size: 20px; }
.secondary-button { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.text-button { min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--mint-deep); font-size: 14px; font-weight: 700; cursor: pointer; }
.text-button.danger { color: var(--bad); }
.block { display: flex; width: 100%; }

/* ---- home -------------------------------------------------------------- */
.home-actions { display: grid; gap: 12px; }
.action-card {
  position: relative; overflow: hidden; display: grid; gap: 8px; align-content: end; justify-items: start;
  min-height: 210px; padding: 22px; border-radius: 22px; box-shadow: var(--shadow);
}
.action-card::after {
  content: ""; position: absolute; width: 150px; height: 150px; right: -52px; top: -50px;
  border: 1px dashed rgba(23, 59, 53, .2); border-radius: 50%;
  box-shadow: 0 0 0 30px rgba(255, 255, 255, .13), 0 0 0 60px rgba(255, 255, 255, .09);
}
.action-card > * { position: relative; z-index: 1; }
.action-card h2 { margin: 0; font: 400 30px/1.04 Georgia, serif; letter-spacing: -.035em; }
.action-card > p:not(.eyebrow) { max-width: 320px; color: #40655d; font-size: 14px; line-height: 1.45; }
.action-card .primary-button { margin-top: 6px; }
.action-send { background: var(--mint); }
.action-fetch { background: var(--paper); }
.action-relay { background: var(--mint-pale); }

/* ---- forms ------------------------------------------------------------- */
.form { gap: 16px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
select, input[type="text"] {
  width: 100%; min-width: 0; min-height: 50px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 14px; background: #fbfaf5;
  font-size: 16px; /* 16px stops iOS zooming the page on focus */
}
select:disabled { opacity: .55; }
.field-error { color: var(--bad); font-size: 14px; font-weight: 600; line-height: 1.4; }
.route-pair { display: grid; gap: 12px; margin: 0; }
.route-pair div { display: grid; gap: 3px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.route-pair dt { color: var(--ink-soft); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.route-pair dd { margin: 0; font: 400 22px/1.15 Georgia, serif; overflow-wrap: anywhere; }

/* ---- orders ------------------------------------------------------------ */
.order-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.order-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 15px 16px;
  border-radius: 18px; background: var(--paper); border: 1px solid rgba(23, 59, 53, .07);
}
.order-row.needs-you { border-color: var(--peach); box-shadow: 0 0 0 3px rgba(233, 173, 131, .25); }
.order-top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.order-kind { color: var(--ink-soft); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.order-route { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 16px; min-width: 0; }
.order-route strong { font-weight: 700; overflow-wrap: anywhere; }
.order-line { color: var(--ink-soft); font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.order-time { color: var(--ink-soft); font-size: 12px; white-space: nowrap; align-self: end; }

.status-badge {
  display: inline-block; height: max-content; padding: 6px 10px; border-radius: 99px;
  font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap;
}
.status-badge.tone-active { background: #e0f0e6; color: var(--good); }
.status-badge.tone-wait { background: var(--mint-pale); color: var(--mint-deep); }
.status-badge.tone-good { background: var(--mint); color: var(--ink); }
.status-badge.tone-warn { background: #f8e7d9; color: var(--warn); }
.status-badge.tone-bad { background: #f4dedb; color: var(--bad); }
.status-badge.tone-muted { background: #e8e8e4; color: var(--ink-soft); }

.status-card { justify-items: start; }
.status-card h2 { margin: 0; font: 400 26px/1.1 Georgia, serif; letter-spacing: -.02em; }
.status-card p { color: var(--ink-soft); font-size: 15px; line-height: 1.45; }
.callout { display: grid; gap: 12px; justify-items: start; padding: 16px 18px; border-radius: 22px; background: #f8e7d9; color: #6f4223; font-weight: 600; line-height: 1.4; }
.callout .primary-button { width: 100%; }

.code-card { justify-items: center; text-align: center; background: var(--mint); }
.code-card .eyebrow { justify-self: start; }
.code-card .note { color: #40655d; text-align: left; }
.code-digits { font: 400 56px/1 Georgia, serif; letter-spacing: .22em; padding-left: .22em; }
.robot-name { font: 400 26px/1.1 Georgia, serif; overflow-wrap: anywhere; }

.timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; color: var(--ink-soft); font-size: 14px; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 4px; top: 50%; bottom: -50%; width: 2px; background: var(--line); }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); position: relative; z-index: 1; }
.timeline li.is-latest { color: var(--ink); font-weight: 700; }
.timeline li.is-latest .timeline-dot { background: var(--mint-deep); box-shadow: 0 0 0 4px rgba(47, 105, 94, .18); }
.timeline-time { font-size: 12px; white-space: nowrap; }

/* ---- scan and robot ---------------------------------------------------- */
.scan-frame { position: relative; width: 100%; max-width: 420px; margin: 0 auto; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 22px; background: var(--ink); }
.scan-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-reticle { position: absolute; inset: 16%; border: 3px solid var(--peach); border-radius: 18px; box-shadow: 0 0 0 999px rgba(23, 59, 53, .35); }

.code-entry { min-height: 68px; font: 400 36px Georgia, serif; letter-spacing: .5em; padding-left: calc(14px + .5em); text-align: center; }
.stop-card { justify-items: start; }
.stop-place { font: 400 28px/1.1 Georgia, serif; overflow-wrap: anywhere; }
.steps { display: flex; gap: 8px; width: 100%; margin: 0; padding: 0; list-style: none; }
.steps li { flex: 1; padding: 8px 10px; border-radius: 12px; background: var(--mint-pale); color: var(--ink-soft); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-align: center; text-transform: uppercase; }
.steps li.is-current { background: var(--ink); color: #fff; }
.steps li.is-done { background: var(--mint); color: var(--ink); }
.stop-card .primary-button { width: 100%; }
.done-card { justify-items: center; text-align: center; }
.done-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--mint); color: var(--ink); font-size: 32px; font-weight: 800; }

/* ---- toasts ------------------------------------------------------------ */
.toasts {
  position: fixed; z-index: 30; left: var(--gutter); right: var(--gutter);
  bottom: calc(80px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto; display: grid; gap: 2px; padding: 14px 16px; border-radius: 17px;
  background: var(--ink); color: #fff; box-shadow: 0 20px 55px rgba(23, 59, 53, .28);
  animation: toast-in .3s ease both;
}
.toast strong { font-size: 14px; overflow-wrap: anywhere; }
.toast span { color: #bed0ca; font-size: 12px; overflow-wrap: anywhere; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } }

/* ---- wider screens: sidebar instead of the bottom bar ------------------- */
@media (min-width: 621px) {
  :root { --gutter: 28px; }
  .shell-body { display: grid; grid-template-columns: 208px minmax(0, 1fr); }
  .tabbar {
    position: sticky; inset: auto; top: var(--header-h); align-self: start; z-index: 5;
    height: calc(100dvh - var(--header-h)); padding: 24px 16px;
    display: flex; flex-direction: column; gap: 6px; align-content: start;
    background: var(--mint-pale); border: 0; border-right: 1px solid rgba(47, 105, 94, .08); box-shadow: none; backdrop-filter: none;
  }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 14px; font-size: 14px; }
  .tab::after { display: none; }
  .tab:hover { background: rgba(255, 255, 255, .55); color: var(--ink); }
  .tab.is-active { background: var(--paper); color: var(--ink); box-shadow: 0 9px 24px rgba(48, 90, 76, .08); }
  .tab-badge { left: 14px; }
  .workspace { padding: 32px clamp(24px, 4vw, 56px) 60px; }
  .page-intro h1 { font-size: 40px; }
  .toasts { left: auto; right: 28px; bottom: 28px; width: 340px; }
}
@media (min-width: 900px) {
  .view { max-width: 960px; }
  .home-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .action-card { min-height: 300px; }
  .view:not(#screen-home) > *:not(.page-intro) { max-width: 560px; }
  .order-list { max-width: 720px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
