/* Handoff v1 mock — CED Service — navy/teal, mobile-first ~390px */
:root {
  --navy: #0B1F33;
  --navy-2: #122a42;
  --teal: #0E7C7B;
  --teal-light: #14a3a1;
  --teal-soft: rgba(14, 124, 123, 0.12);
  --bg: #f4f7f9;
  --surface: #ffffff;
  --text: #0B1F33;
  --muted: #5a6b7a;
  --border: #e2e8ee;
  --danger: #c0392b;
  --danger-soft: rgba(192, 57, 43, 0.1);
  --ok: #1a7f4b;
  --ok-soft: rgba(26, 127, 75, 0.12);
  --warn: #b7791f;
  --radius: 14px;
  --nav-h: 64px;
  --status-h: 28px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --shadow: 0 2px 12px rgba(11, 31, 51, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #1a1a1a;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Phone shell for desktop preview */
.app-shell {
  max-width: 390px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0,0,0,0.35);
}

/* Fake status bar (installable feel) */
.status-bar {
  height: var(--status-h);
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.status-bar .icons { display: flex; gap: 6px; align-items: center; opacity: 0.9; }
.status-bar .dot { width: 14px; height: 8px; border: 1.5px solid #fff; border-radius: 2px; position: relative; }
.status-bar .dot::after { content: ""; position: absolute; right: -3px; top: 1.5px; width: 1.5px; height: 4px; background: #fff; border-radius: 1px; }

/* Top app header */
.app-header {
  background: var(--navy);
  color: #fff;
  padding: 12px 16px 14px;
  flex-shrink: 0;
}
.app-header h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.app-header .sub {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 2px;
}
.app-header .brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

/* Main scroll area */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(var(--nav-h) + 20px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}
.main.chat-main {
  padding: 12px 12px calc(var(--nav-h) + 72px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 390px;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  z-index: 50;
  box-shadow: 0 -4px 20px rgba(11, 31, 51, 0.06);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}
.bottom-nav a.active { color: var(--teal); }
.bottom-nav .nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}
.bottom-nav .badge {
  position: absolute;
  top: 8px;
  margin-left: 18px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  padding: 0 3px;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.card p, .card .meta {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.card .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s, opacity 0.15s;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--teal);
  color: #fff;
  width: 100%;
}
.btn-primary:hover { background: var(--teal-light); }
.btn-ghost {
  background: transparent;
  color: var(--teal);
  border: 1px solid var(--border);
}
.btn-approve {
  background: var(--ok);
  color: #fff;
  flex: 1;
}
.btn-deny {
  background: var(--danger-soft);
  color: var(--danger);
  flex: 1;
}
.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.btn-sm { padding: 8px 12px; font-size: 13px; }

/* Forms */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}
.otp-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.otp-row input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
}
.otp-row input:focus {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 0 0 3px var(--teal-soft);
}

/* Chat bubbles */
.bubble {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}
.bubble.ea {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text);
}
.bubble.me {
  align-self: flex-end;
  background: var(--teal);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.bubble .who {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 3px;
}
.bubble.me .who { color: rgba(255,255,255,0.85); }
.bubble .time {
  font-size: 10px;
  opacity: 0.55;
  margin-top: 5px;
  text-align: right;
}
.day-sep {
  align-self: center;
  font-size: 11px;
  color: var(--muted);
  background: rgba(11,31,51,0.06);
  padding: 4px 10px;
  border-radius: 20px;
  margin: 6px 0;
}

/* Composer */
.composer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  width: 100%;
  max-width: 390px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  z-index: 40;
}
.composer textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  max-height: 100px;
  min-height: 42px;
  outline: none;
  line-height: 1.35;
}
.composer textarea:focus { border-color: var(--teal); }
.composer .send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

/* Chips / pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pill-pending { background: #fff3cd; color: var(--warn); }
.pill-approved { background: var(--ok-soft); color: var(--ok); }
.pill-denied { background: var(--danger-soft); color: var(--danger); }
.pill-active { background: var(--teal-soft); color: var(--teal); }

/* Login page */
.login-page {
  background: var(--navy);
  min-height: 100vh;
  color: #fff;
  display: flex;
  flex-direction: column;
}
.login-hero {
  padding: 48px 24px 32px;
  text-align: center;
}
.login-hero .logo-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  font-size: 24px;
  margin: 0 auto 18px;
}
.login-hero h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.login-hero .tagline {
  margin-top: 8px;
  font-size: 15px;
  opacity: 0.8;
  font-weight: 400;
}
.login-hero .desk-price {
  margin-top: 16px;
  display: inline-block;
  background: rgba(14,124,123,0.25);
  border: 1px solid rgba(14,124,123,0.5);
  color: #7ee0df;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.login-card {
  background: var(--bg);
  color: var(--text);
  border-radius: 24px 24px 0 0;
  padding: 28px 20px 40px;
  flex: 1;
  margin-top: auto;
}
.login-card h2 {
  font-size: 18px;
  margin-bottom: 6px;
}
.login-card .hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}
.login-note {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}
.step { display: none; }
.step.active { display: block; }

/* Account */
.ath-tip {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.ath-tip strong { display: block; margin-bottom: 4px; font-size: 14px; }
.ath-tip span { font-size: 12px; opacity: 0.85; line-height: 1.4; }

.kv { display: flex; flex-direction: column; gap: 10px; }
.kv-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.kv-item:last-child { border-bottom: none; }
.kv-item .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.kv-item .v { font-size: 14px; font-weight: 600; text-align: right; }

.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 8px 0 10px;
}

/* Help */
.escalate-box {
  background: var(--teal-soft);
  border: 1px solid rgba(14,124,123,0.3);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 8px;
}
.faq-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "+ ";
  color: var(--teal);
  font-weight: 700;
}
.faq-item[open] summary::before { content: "− "; }
.faq-item p {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  bottom: calc(var(--nav-h) + 16px + var(--safe-bottom));
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
  max-width: 340px;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.amount { font-size: 20px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }
