/* FullLobby design system — light first.
 *
 * Light is the default and the only default: an operator works with this open
 * for hours in a lit room, and a business owner meets us on a marketing page
 * before they ever sign in. Dark is an opt-in later, not a coin toss.
 *
 * Shape language borrowed from what good dispatch apps already do well: a white
 * card on a soft canvas, one strong accent for the action you are meant to
 * take, generous touch targets, and a map that is a surface rather than a
 * decoration.
 */

:root {
  /* canvas + surface */
  --canvas: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --line: #e4e9f0;
  --line-2: #d3dbe6;

  /* ink */
  --ink: #0b1220;
  --ink-2: #4b5768;
  --ink-3: #77839a;
  --ink-4: #9aa5b8;

  /* brand + state */
  --blue: #1f5ae0;
  --blue-600: #1a4dc4;
  --blue-700: #163fa0;
  --blue-50: #eaf0fe;
  --blue-100: #d6e2fd;
  --green: #0ba05a;
  --green-50: #e6f6ee;
  --amber: #b7791f;
  --amber-50: #fdf3e2;
  --red: #d92d20;
  --red-50: #fdecea;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-2: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-3: 0 12px 40px rgba(16, 24, 40, .14);

  /* Inter is named in older pages but never shipped. A local Inter that is
     missing its space glyph paints "Open your workstation" as one word.
     System UI always has a space. */
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin:0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
  word-spacing: 0;
  font-feature-settings: normal;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }

/* ------------------------------------------------------------- typography */
h1, h2, h3 { margin:0; font-weight: 650; letter-spacing: 0; }
h1 { font-size: 24px; line-height: 1.2; }
h2 { font-size: 20px; line-height: 1.3; }
h3 { font-size: 15px; }
.display { font-size: clamp(32px, 6vw, 52px); line-height: 1.08; font-weight: 700;
           letter-spacing: -.03em; }
.lede { font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase;
           letter-spacing: .09em; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 11px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- layout */
.wrap { max-width: 1080px; margin:0 auto; padding:0 20px; }
.stack { display: grid; gap:14px; align-content: start; }
.stack.tight { gap:10px; }
.row { display: flex; align-items: center; gap:12px; }
.row.wrapped { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.grid { display: grid; gap:14px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.card.flat { box-shadow: none; }
.card.raised { box-shadow: var(--shadow-2); }
.card-head {
  display: flex; align-items: center; gap:12px;
  padding:14px 18px; border-bottom: 1px solid var(--line);
}
.card-body { padding:18px; }
.card-body.tight { padding:0; }
.card-foot { padding:14px 18px; border-top: 1px solid var(--line);
             background: var(--surface-2); }

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-bd: var(--line-2);
  appearance: none;
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: var(--radius-sm);
  padding:14px 18px;
  font-size: 15px;
  font-weight: 620;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap:10px;
  transition: filter .13s, border-color .13s, transform .06s, background .13s;
  min-height: 46px;
  /* A BUTTON IS ONE LINE. "Join FullLobby" stacking into two words reads as
     two buttons, and "Sign in" broken after "Sign" reads as a mistake. If a
     label is too long for the space, the space is wrong -- not the label. */
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--ink-4); }
.btn:active:not(:disabled) { transform: scale(.988); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.primary { --btn-bg: var(--blue); --btn-fg: #fff; --btn-bd: transparent; }
.btn.primary:hover:not(:disabled) { --btn-bg: var(--blue-600); border-color: transparent; }
.btn.go { --btn-bg: var(--green); --btn-fg: #fff; --btn-bd: transparent; }
.btn.danger { --btn-bg: var(--red); --btn-fg: #fff; --btn-bd: transparent; }
.btn.quiet { --btn-bg: var(--surface-3); --btn-bd: transparent; }
.btn.ghost { --btn-bg: transparent; --btn-bd: transparent; color: var(--ink-2); }
.btn.sm { padding:8px 14px; min-height: 36px; font-size: 13px; border-radius: 9px; }
.btn.lg { padding:18px 24px; min-height: 56px; font-size: 17px; border-radius: 12px; }
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* A LANGUAGE CAN BE WIDER THAN ENGLISH.
   Small buttons sit in sticky bars that were measured against English: "Join"
   fits a 390px phone, "Rejoindre" and "Únase a FullLobby" do not, and several
   bars pushed the whole page into a horizontal scroll in French and Spanish
   while looking correct in English and Chinese. The button gives way instead
   of the wording, which holds for any language -- including ones not added
   yet. Only on the narrowest screens; nothing changes on a desktop. */
@media (max-width: 470px) {
  .btn.sm { padding:8px 11px; }
}

/* ----------------------------------------------------------------- inputs */
label.field { display: block; font-size: 12px; font-weight: 620; color: var(--ink-2);
              margin:0 0 8px; }
/* An input with no type attribute is a text input to the BROWSER, but
   input[type=text] does not match it -- so 37 fields across this app were
   falling back to the platform's default box while the field beside them got
   ours. Match every text-like input instead of listing the types, and exclude
   the ones that must keep their native look. */
.input, input:not([type]),
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=search], input[type=tel], input[type=url], input[type=date],
input[type=time], input[type=datetime-local], select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding:14px 14px;
  font-size: 15px;               /* 16px stops iOS zooming on focus */
  outline: none;
  transition: border-color .13s, box-shadow .13s;
  color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.input:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-100);
}
.field-group { margin-bottom:16px; }
.hint { font-size: 12px; color: var(--ink-3); line-height: 1.55; }
.flnav a.on, .flnav a.on span, .flnav a.on em, .flnav a.on .hint, .flnav a.on svg,
.ws-nav a.on, .ws-nav a.on span, .ws-nav a.on em, .ws-nav a.on .hint, .ws-nav a.on svg {
  color: #fff;
}
.error { font-size: 13px; color: var(--red); line-height: 1.5; min-height: 18px; }

/* select needs its own arrow once we style it */
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5768' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right:40px;
}

/* ------------------------------------------------------------------ chips */
.chip {
  display: inline-flex; align-items: center; gap:8px;
  border: 1px solid var(--line-2); border-radius: 999px;
  padding:6px 12px; font-size: 12px; font-weight: 600; color: var(--ink-2);
  background: var(--surface);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); flex: none; }
.chip.on { color: #087443; background: var(--green-50); border-color: #b7e4cd; }
.chip.on .dot { background: var(--green); }
.chip.warn { color: var(--amber); background: var(--amber-50); border-color: #f0dcb4; }
.chip.warn .dot { background: var(--amber); }
.chip.bad { color: var(--red); background: var(--red-50); border-color: #f6cdc8; }
.chip.bad .dot { background: var(--red); }
.chip.blue { color: var(--blue-700); background: var(--blue-50); border-color: var(--blue-100); }
.chip.blue .dot { background: var(--blue); }

.tag { font-size: 11px; font-family: var(--mono); text-transform: uppercase;
       letter-spacing: .06em; border: 1px solid var(--line-2); border-radius: 5px;
       padding:4px 6px; color: var(--blue-700); background: var(--blue-50); flex: none; }

/* ----------------------------------------------------------------- avatar */
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: var(--blue-50); color: var(--blue-700);
  font-weight: 700; font-size: 15px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; font-size: 20px; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }

.stars { display: inline-flex; gap:2px; color: #e8a219; font-size: 13px; }

/* ------------------------------------------------------------------- list */
.list { display: block; }
.list-row {
  display: flex; align-items: center; gap:14px;
  padding:14px 18px; border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.list-row .t { font-weight: 600; font-size: 14px; }
.list-row .s { color: var(--ink-3); font-size: 12px; margin-top:4px; }
.list-row.tappable { cursor: pointer; }
.list-row.tappable:hover { background: var(--surface-2); }

.empty { padding:40px 22px; text-align: center; color: var(--ink-3);
         font-size: 14px; line-height: 1.6; }

/* --------------------------------------------------------------- timeline */
/* the pickup/dropoff pattern: a dot, a line, a dot */
.timeline { display: grid; gap:0; }
.tl-item { display: grid; grid-template-columns: 18px 1fr; gap:12px; position: relative; }
.tl-item .pin { display: grid; place-items: center; padding-top:4px; }
.tl-item .pin i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); display: block; }
.tl-item.end .pin i { background: var(--red); }
.tl-item:not(:last-child) .pin::after {
  content: ""; width: 1.5px; flex: 1; background: var(--line-2);
  margin:4px 0 -4px; min-height: 22px;
}
.tl-item .pin { display: flex; flex-direction: column; align-items: center; }
.tl-item .body { padding-bottom:16px; }
.tl-item .body .l1 { font-size: 14px; font-weight: 560; }
.tl-item .body .l2 { font-size: 12px; color: var(--ink-3); margin-top:2px; }

/* ------------------------------------------------------------------ stats */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap:12px; }
.kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
       padding:14px 14px; }
.kpi .n { font-size: 20px; font-weight: 720; font-variant-numeric: tabular-nums;
          line-height: 1.15; letter-spacing: -.02em; }
.kpi .l { font-size: 11px; color: var(--ink-3); margin-top:6px; font-weight: 550; }

/* bar chart, as in the earnings screen */
.bars { display: flex; align-items: flex-end; gap:8px; height: 132px; padding-top:8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap:8px;
             height: 100%; justify-content: flex-end; }
.bars .bar i { width: 100%; max-width: 34px; background: var(--blue-100); border-radius: 6px 6px 0 0;
               display: block; transition: height .3s; }
.bars .bar.peak i { background: var(--blue); }
.bars .bar span { font-size: 11px; color: var(--ink-3); font-weight: 600; }

/* -------------------------------------------------------------------- map */
.map { width: 100%; height: 220px; background: var(--surface-3); position: relative; }
.map.tall { height: 320px; }
.leaflet-container { font: inherit !important; background: var(--surface-3) !important; }
.leaflet-control-attribution { font-size: 11px !important; background: rgba(255,255,255,.8) !important; }
.map-pin {
  width: 18px; height: 18px; border-radius: 50%; background: var(--blue);
  border: 3px solid #fff; box-shadow: 0 0 0 1px var(--blue), 0 2px 6px rgba(16,24,40,.3);
}
.map-pin.you { background: var(--green); box-shadow: 0 0 0 1px var(--green), 0 2px 6px rgba(16,24,40,.3); }

/* ------------------------------------------------------------------ misc */
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin:0; cursor: pointer; z-index: 2; }
.switch i { position: absolute; inset: 0; background: var(--line-2); border-radius: 999px;
            transition: background .18s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
                   border-radius: 50%; background: #fff; transition: transform .18s;
                   box-shadow: var(--shadow-1); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(22px); }
.switch input:disabled + i { opacity: .5; }

.banner { border-radius: var(--radius); padding:14px 16px; font-size: 13px; line-height: 1.6;
          border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); }
.banner.info { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-700); }
.banner.warn { background: var(--amber-50); border-color: #f0dcb4; color: var(--amber); }
.banner.ok { background: var(--green-50); border-color: #b7e4cd; color: #087443; }
.banner b { display: block; color: inherit; margin-bottom:4px; }

.divider { height: 1px; background: var(--line); margin:4px 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 84px);
  transform: translateX(-50%) translateY(14px);
  background: var(--ink); color: #fff; border-radius: 11px;
  padding:12px 18px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .22s; z-index: 95;
  max-width: 88vw; text-align: center; box-shadow: var(--shadow-3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, #f1f5f9 37%, var(--surface-3) 63%);
            background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* --------------------------------------------------------------- app shell */
.app { display: flex; flex-direction: column; height: 100dvh; }
.app-head {
  flex: none; display: flex; align-items: center; gap:12px;
  padding:calc(var(--safe-t) + 12px) 18px 12px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.app-main { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.app-main .pad { padding:16px; }
.app-nav {
  flex: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom:var(--safe-b);
}
.app-nav button {
  background: none; border: 0; padding:10px 4px 12px; cursor: pointer;
  display: grid; gap:4px; justify-items: center;
  font-size: 11px; font-weight: 620; color: var(--ink-3);
}
.app-nav button.on { color: var(--blue); }
.app-nav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.app-nav .badge {
  position: absolute; transform: translate(14px, -6px);
  background: var(--red); color: #fff; border-radius: 999px;
  font-size: 9.5px; padding:1px 6px; font-weight: 800;
}

/* full-screen takeover, for an incoming call */
.takeover {
  position: fixed; inset: 0; z-index: 90; background: var(--surface);
  display: none; flex-direction: column;
  padding:calc(var(--safe-t) + 24px) 20px calc(var(--safe-b) + 20px);
}
.takeover.on { display: flex; animation: rise .24s cubic-bezier(.2,.7,.3,1); }
@keyframes rise { from { transform: translateY(2.5%); opacity: 0; } to { transform: none; opacity: 1; } }

@media (min-width: 900px) {
  .app-main .pad { padding:24px; max-width: 780px; margin:0 auto; }
}
