/* Seascape Console — Phase 1 PWA (read-only). "Sea glass" native-iOS system,
   built to the approved v5 mockups. CSP-strict: no inline styles anywhere. */

:root {
  --bg: #F2F3F5;
  --bg-top: #FBFCFD;
  --card: #FFFFFF;
  --frost: rgba(255, 255, 255, 0.78);
  --hair: rgba(22, 34, 46, 0.09);
  --hair-2: rgba(22, 34, 46, 0.16);
  --ink: #1C2430;
  --muted: #5F6B78;
  --faint: #97A1AC;
  --accent: #0A74DE;
  --accent-deep: #085FB8;
  --ok: #1E9E6A;
  --danger: #D93B2B;
  --danger-soft: rgba(217, 59, 43, 0.07);
  --paper: #FBF6E7;
  --paper-ink: #38352B;
  --paper-muted: #7C7767;
  --ch-airbnb: #F2685C;
  --ch-vrbo: #3E7BC0;
  --ch-direct: #23A08C;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg-top), var(--bg) 34%) fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button { font-family: inherit; cursor: pointer; }
.boot { padding: 40vh 0; text-align: center; color: var(--faint); }

#app { max-width: 520px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  background: var(--frost);
  backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--hair);
  display: flex; align-items: center; gap: 10px;
}
.nav .back { color: var(--accent); font-size: 16px; font-weight: 550; display: inline-flex; align-items: center; gap: 3px; background: none; border: none; padding: 4px 2px; }
.nav .title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.nav .spacer { flex: 1; }
.nav .cog { width: 32px; height: 32px; border-radius: 50%; background: var(--card); border: 1px solid var(--hair); display: grid; place-items: center; color: var(--muted); }
.largehead { padding: 6px 16px 4px; }
.largehead h1 { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }

/* ---------- status strip ---------- */
.strip {
  margin: 8px 14px 4px; padding: 10px 14px; border-radius: 14px;
  background: var(--frost); border: 1px solid var(--hair);
  backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 1px 2px rgba(16, 24, 32, 0.04);
  display: flex; flex-direction: column; gap: 5px;
}
.strip .l1 { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.strip .l1 .live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 15%, transparent); flex: none; }
.strip .l1 .sp { color: var(--faint); font-weight: 400; }
.strip .l1 .unk { color: var(--danger); font-weight: 650; }
.strip .l2 { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.strip .l2 b { color: var(--ink); font-weight: 650; }
.strip.degraded { border-color: color-mix(in srgb, var(--danger) 38%, var(--hair)); background: color-mix(in srgb, var(--danger) 6%, var(--card)); }
.strip .degrow { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 650; color: var(--danger); }
.strip .degsub { font-size: 11.5px; color: var(--muted); }

/* ---------- section label ---------- */
.seclabel { padding: 16px 20px 8px; font-size: 13px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; }
.seclabel s { text-decoration: none; color: var(--faint); font-weight: 400; font-size: 12px; }

/* ---------- inbox list ---------- */
.list { padding: 0 14px 24px; display: flex; flex-direction: column; gap: 9px; }
.row {
  background: var(--card); border: 1px solid var(--hair); border-radius: 14px;
  padding: 12px 13px; display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: center;
  box-shadow: 0 1px 2px rgba(16, 24, 32, 0.04); text-align: left; width: 100%; border: 1px solid var(--hair);
}
.row:active { background: #F6F8FA; }
.ava {
  width: 42px; height: 42px; border-radius: 50%; position: relative; flex: none;
  background: linear-gradient(180deg, #E9EDF1, #DDE3E9);
  display: grid; place-items: center; font-size: 16px; font-weight: 650; color: var(--muted);
  box-shadow: inset 0 0 0 1px rgba(22, 34, 46, 0.06);
}
.ava .chdot { position: absolute; bottom: -1px; right: -1px; width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--card); }
.chdot.airbnb { background: var(--ch-airbnb); } .chdot.vrbo { background: var(--ch-vrbo); } .chdot.direct { background: var(--ch-direct); }
.body2 { min-width: 0; }
.rl1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rl1 .rname { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl1 .rage { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; flex: none; display: inline-flex; align-items: center; gap: 5px; }
.rl2 { margin-top: 2px; font-size: 13.5px; color: #3D4854; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl2 .esc { color: var(--danger); font-weight: 650; }
.rl2 .st-drafting { color: var(--faint); font-style: italic; }
.rl2 .st-sending { color: var(--accent); font-style: italic; }
.rl3 { margin-top: 2px; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.emptybucket { padding: 30px 16px; text-align: center; color: var(--faint); font-size: 14px; }

/* ---------- draft card ---------- */
.scroller { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.cardhead { padding: 8px 16px 14px; }
.cardhead .ct { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.cardhead .cs { margin-top: 4px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.cardhead .cs .chdot { position: static; width: 8px; height: 8px; border: none; border-radius: 50%; flex: none; }
.cardhead .cc { margin-top: 7px; font-size: 12.5px; color: var(--faint); }
.cardhead .cc .tw { font-weight: 700; color: var(--muted); }
.cardhead .cc .tw.esc { color: var(--danger); }
.cardbody { padding: 0 16px 16px; }
.escbanner { border-radius: 13px; padding: 11px 13px; margin-bottom: 12px; background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 26%, transparent); }
.escbanner .h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--danger); }
.escbanner .s { font-size: 12px; color: var(--muted); margin-top: 4px; }
.bubble { border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; background: var(--card); border: 1px solid var(--hair); box-shadow: 0 1px 2px rgba(16, 24, 32, 0.04); }
.bubble .who { font-size: 11.5px; font-weight: 600; color: var(--faint); margin-bottom: 5px; display: flex; justify-content: space-between; }
.bubble .txt { font-size: 15px; color: var(--ink); }
.draftlabel { display: flex; align-items: center; gap: 8px; margin: 4px 2px 8px; }
.draftlabel .ln { height: 1px; flex: 1; background: var(--hair); }
.draftlabel s { text-decoration: none; font-size: 11.5px; color: var(--muted); font-weight: 650; }
.paper {
  background: var(--paper); color: var(--paper-ink); border-radius: 16px; padding: 15px 16px 14px;
  box-shadow: 0 1px 2px rgba(60, 50, 20, 0.08), 0 8px 22px -14px rgba(60, 50, 20, 0.25);
  border: 1px solid rgba(90, 80, 40, 0.10);
}
.paper .ptxt { font-size: 15.5px; line-height: 1.55; white-space: pre-wrap; }
.paper .sig { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(90, 80, 40, 0.12); font-size: 12px; color: var(--paper-muted); }
.notes { margin-top: 12px; display: grid; gap: 8px; }
.noterow { display: flex; gap: 9px; font-size: 12.5px; color: var(--muted); align-items: flex-start; }
.noterow .dotm { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); margin-top: 6px; flex: none; }
.convo-open { margin: 12px 0 4px; width: 100%; padding: 11px; border-radius: 13px; background: transparent; border: none; color: var(--accent); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 600; }

/* approve dock (read-only phase: informational, disabled) */
.dock {
  border-top: 1px solid var(--hair); background: var(--frost);
  backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  padding: 12px 16px calc(12px + var(--safe-bottom));
}
.approve {
  width: 100%; border: none; border-radius: 14px; padding: 15px; font-size: 15.5px; font-weight: 650;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: #E7EAEE; color: #9AA4AF; box-shadow: inset 0 0 0 1px var(--hair);
}
.dock .ro-note { text-align: center; font-size: 11px; color: var(--faint); margin-top: 9px; }

/* ---------- conversation ---------- */
.snapnote { margin: 0 16px 10px; font-size: 11px; color: var(--faint); text-align: center; }
.thread { padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 16px; font-size: 15px; line-height: 1.45; }
.msg .mt { font-size: 10.5px; color: var(--faint); margin-top: 5px; font-variant-numeric: tabular-nums; }
.msg.in { align-self: flex-start; background: var(--card); border: 1px solid var(--hair); border-bottom-left-radius: 5px; box-shadow: 0 1px 2px rgba(16, 24, 32, 0.04); }
.msg.out { align-self: flex-end; background: linear-gradient(180deg, #2E90E8, var(--accent-deep)); color: #fff; border-bottom-right-radius: 5px; }
.msg.out .mt { color: rgba(255, 255, 255, 0.65); }
.msg.draft { align-self: flex-end; background: var(--paper); color: var(--paper-ink); border: 1px solid rgba(90, 80, 40, 0.10); border-bottom-right-radius: 5px; box-shadow: 0 6px 16px -10px rgba(60, 50, 20, 0.3); }
.msg.draft .dtag { font-size: 10.5px; font-weight: 650; color: var(--paper-muted); }
.daymark { align-self: center; font-size: 10.5px; color: var(--faint); padding: 4px 0; }

/* ---------- login ---------- */
.login { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 28px calc(40px + var(--safe-bottom)); text-align: center; gap: 6px; }
.login .mark { width: 68px; height: 68px; border-radius: 20px; background: linear-gradient(160deg, #2E90E8, var(--accent-deep)); display: grid; place-items: center; box-shadow: 0 10px 24px -10px rgba(10, 116, 222, 0.5); margin-bottom: 16px; }
.login h1 { font-size: 26px; font-weight: 720; letter-spacing: -0.02em; margin: 0; }
.login p { color: var(--muted); font-size: 14.5px; margin: 8px 0 24px; max-width: 30ch; }
.login .signin { border: none; border-radius: 14px; padding: 15px 22px; font-size: 16px; font-weight: 650; color: #fff; background: linear-gradient(180deg, #2E90E8, var(--accent-deep)); box-shadow: 0 8px 20px -8px rgba(10, 116, 222, 0.55); display: inline-flex; align-items: center; gap: 9px; }
.login .err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 14px; }

/* ---------- banner (degraded / offline) ---------- */
.banner { margin: 8px 14px 0; padding: 9px 13px; border-radius: 12px; font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.banner.warn { background: color-mix(in srgb, var(--danger) 8%, var(--card)); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 26%, transparent); }

.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

svg { display: block; }
