/* SCOUT OS Omni-Stream — Liquid Glassmorphism 2.0
   Single continuous conversational feed. Dependency-free. */
:root {
  --bg: #070b12;
  --bg2: #0b111c;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-2: rgba(255, 255, 255, 0.085);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-hi: rgba(255, 255, 255, 0.16);
  --text: #eaf1f8;
  --muted: #93a1b5;
  --accent: #38e1c6;
  --accent-2: #7aa2ff;
  --accent-dim: rgba(56, 225, 198, 0.14);
  --green: #3ddc84;
  --red: #ff5d5d;
  --amber: #ffb454;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 0.9, 0.28, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); font-family: var(--font);
  min-height: 100vh; padding: 12px 12px 110px;
  line-height: 1.45; background: var(--bg);
  overflow-x: hidden;
}

/* aurora backdrop */
body::before, body::after {
  content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
}
body::before {
  background:
    radial-gradient(42% 34% at 18% 8%, rgba(56, 225, 198, 0.13), transparent 70%),
    radial-gradient(38% 30% at 84% 16%, rgba(122, 162, 255, 0.14), transparent 70%),
    radial-gradient(30% 26% at 60% 95%, rgba(178, 102, 255, 0.10), transparent 70%);
  animation: drift 26s ease-in-out infinite alternate;
}
body::after {
  background: radial-gradient(60% 45% at 50% 110%, rgba(56, 225, 198, 0.06), transparent 70%);
  animation: drift 34s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(2%, 2%, 0) scale(1.06); }
}

.glass {
  background: linear-gradient(160deg, var(--glass-2), var(--glass) 45%, rgba(255,255,255,0.03));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: 0 18px 50px rgba(0,0,0,0.45), inset 0 1px 0 var(--glass-hi);
}

/* ---------- header ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; margin-bottom: 14px;
  position: sticky; top: 10px; z-index: 20;
  animation: rise 0.55s var(--ease) both;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand-mark {
  font-size: 26px; color: var(--accent);
  text-shadow: 0 0 18px rgba(56, 225, 198, 0.65);
  animation: markpulse 3.2s ease-in-out infinite;
}
@keyframes markpulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.82; transform: scale(1.07); }
}
.brand h1 {
  margin: 0; font-size: 19px; font-weight: 700; letter-spacing: 0.4px;
  background: linear-gradient(100deg, #fff 30%, var(--accent) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand .sub { margin: 1px 0 0; font-size: 11.5px; color: var(--muted); letter-spacing: 0.2px; }
.live-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: 1.6px; color: var(--green);
  padding: 6px 12px; border-radius: 999px;
  background: rgba(61, 220, 132, 0.10); border: 1px solid rgba(61, 220, 132, 0.35);
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 10px var(--green);
  animation: heartbeat 1.6s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); opacity: 1; }
  14% { transform: scale(1.45); opacity: 0.85; }
  28% { transform: scale(1); opacity: 1; }
  42% { transform: scale(1.3); opacity: 0.9; }
  56% { transform: scale(1); opacity: 1; }
}
.ledger-link {
  font-size: 12px; color: var(--accent); text-decoration: none;
  padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(56,225,198,0.3);
  background: rgba(56,225,198,0.08); white-space: nowrap;
}

/* ---------- feed ---------- */
#feed {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 680px; margin: 0 auto; width: 100%;
}
.ocard {
  padding: 18px; animation: rise 0.5s var(--ease) both;
}
.ocard:nth-child(2) { animation-delay: 0.06s; }
.ocard:nth-child(3) { animation-delay: 0.12s; }
.ocard:nth-child(4) { animation-delay: 0.18s; }
.ocard:nth-child(5) { animation-delay: 0.24s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.kicker {
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 6px;
}
.ocard h2 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.ocard .cbody { color: var(--text); font-size: 14px; margin: 0 0 12px; }
.ocard .cbody .muted { color: var(--muted); }
.quiet-banner {
  border: 1px solid rgba(255,180,84,0.35); background: rgba(255,180,84,0.08);
  border-radius: 12px; padding: 12px 14px; font-size: 13.5px; margin-bottom: 12px;
}

/* bento grid */
.bento { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 14px; }
.tile {
  background: rgba(255,255,255,0.045); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 12px 13px;
}
.tile.span2 { grid-column: span 2; }
.tile .tnum { font-size: 22px; font-weight: 800; color: #fff; }
.tile .tnum.good { color: var(--green); }
.tile .tnum.warn { color: var(--amber); }
.tile .tlabel { font-size: 11px; color: var(--muted); letter-spacing: 0.4px; margin-top: 2px; }
.tl { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.tl li { padding: 7px 0 7px 18px; position: relative; border-left: 2px solid rgba(122,162,255,0.35); margin-left: 6px; }
.tl li::before {
  content: ""; position: absolute; left: -6px; top: 12px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 8px rgba(122,162,255,0.7);
}
.tl li.done::before { background: var(--green); box-shadow: 0 0 8px rgba(61,220,132,0.7); }
.tl .tt { color: var(--muted); font-size: 11.5px; }

/* 3-tier action stack */
.astack { display: flex; flex-direction: column; gap: 10px; }
.abtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn {
  appearance: none; border: 1px solid var(--glass-border); border-radius: 12px;
  padding: 12px 10px; font-size: 13.5px; font-weight: 700; font-family: var(--font);
  color: var(--text); background: rgba(255,255,255,0.06); cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s;
  min-height: 48px;
}
.btn:active { transform: scale(0.97); }
.btn.opt-a {
  background: linear-gradient(120deg, rgba(56,225,198,0.22), rgba(122,162,255,0.22));
  border-color: rgba(56,225,198,0.45);
  box-shadow: 0 0 18px rgba(56,225,198,0.18);
}
.btn.opt-b { background: rgba(255,255,255,0.05); }
.cbox { display: flex; gap: 8px; align-items: stretch; }
.cbox input {
  flex: 1; min-width: 0; border-radius: 12px; border: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.25); color: var(--text);
  padding: 12px 14px; font-size: 14px; font-family: var(--font);
  outline: none; transition: border-color 0.2s;
}
.cbox input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56,225,198,0.12); }
.cbox input::placeholder { color: var(--muted); }
.mic-btn {
  width: 52px; min-width: 52px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(122,162,255,0.4); background: rgba(122,162,255,0.12);
  color: var(--accent-2); font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s var(--ease), background 0.15s;
}
.mic-btn:active { transform: scale(0.93); }
.mic-btn.listening { background: rgba(255,93,93,0.2); border-color: var(--red); color: var(--red); animation: heartbeat 1.2s infinite; }
.clabel { font-size: 10.5px; letter-spacing: 1.4px; color: var(--muted); font-weight: 700; }

/* status pills */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--glass-border); background: rgba(255,255,255,0.05);
  transition: border-color 0.3s, color 0.3s;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill .lat { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.pill.ok { border-color: rgba(61,220,132,0.45); color: var(--green); }
.pill.ok .dot { background: var(--green); box-shadow: 0 0 8px var(--green); animation: heartbeat 2s infinite; }
.pill.bad { border-color: rgba(255,93,93,0.5); color: var(--red); }
.pill.bad .dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.pill.loading .dot { animation: heartbeat 1s infinite; }

/* task terminal inside card */
.term-form { display: flex; gap: 8px; margin-bottom: 10px; }
.term-form input {
  flex: 1; min-width: 0; border-radius: 12px; border: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.25); color: var(--text);
  padding: 12px 14px; font-size: 14px; font-family: var(--mono); outline: none;
}
.term-form input:focus { border-color: var(--accent); }
.outbox { list-style: none; margin: 0 0 4px; padding: 0; font-size: 13px; }
.outbox li {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 10px; margin-bottom: 6px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
  animation: rise 0.3s var(--ease) both;
}
.outbox .ts { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.outbox .tx { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.outbox .lid { color: var(--accent); font-family: var(--mono); font-size: 10.5px; }
.outbox .rm {
  border: none; background: none; color: var(--muted); font-size: 18px; cursor: pointer;
  padding: 4px 8px; border-radius: 8px; min-width: 44px; min-height: 44px;
}
.outbox .empty { color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); margin: 0 0 10px; }

/* floating voice button */
.voice-fab {
  position: fixed; right: 18px; bottom: calc(20px + env(safe-area-inset-bottom));
  width: 68px; height: 68px; border-radius: 50%; cursor: pointer; z-index: 50;
  border: 1px solid rgba(56,225,198,0.5); color: #062a26;
  background: radial-gradient(circle at 35% 30%, #7df0dd, var(--accent) 60%, #1fae97);
  box-shadow: 0 0 30px rgba(56,225,198,0.45), 0 10px 28px rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.18s var(--ease), box-shadow 0.18s;
}
.voice-fab:active { transform: scale(0.92); }
.voice-fab .wave { display: none; position: absolute; gap: 3px; align-items: flex-end; height: 26px; }
.voice-fab .wave i { width: 3px; background: #062a26; border-radius: 2px; animation: wv 0.7s ease-in-out infinite; }
.voice-fab .wave i:nth-child(1) { height: 40%; animation-delay: 0s; }
.voice-fab .wave i:nth-child(2) { height: 80%; animation-delay: 0.12s; }
.voice-fab .wave i:nth-child(3) { height: 100%; animation-delay: 0.24s; }
.voice-fab .wave i:nth-child(4) { height: 65%; animation-delay: 0.36s; }
.voice-fab .wave i:nth-child(5) { height: 45%; animation-delay: 0.48s; }
@keyframes wv { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1); } }
.voice-fab.listening { box-shadow: 0 0 44px rgba(255,93,93,0.6), 0 10px 28px rgba(0,0,0,0.5); border-color: var(--red); }
.voice-fab.listening .mic { display: none; }
.voice-fab.listening .wave { display: flex; }
.voice-fab.speaking { animation: heartbeat 1.4s infinite; }

/* toasts */
.toast-wrap {
  position: fixed; left: 12px; right: 12px; bottom: calc(100px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; z-index: 60; pointer-events: none;
  max-width: 680px; margin: 0 auto;
}
.toast {
  background: rgba(10, 16, 26, 0.92); border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 12px; padding: 11px 15px; font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: toastin 0.3s var(--ease) both; pointer-events: auto;
}
.toast.ok { border-color: rgba(61,220,132,0.5); }
.toast.warn { border-color: rgba(255,180,84,0.5); }
@keyframes toastin {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* tooltips (CSS-only) */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%); white-space: normal; width: max-content; max-width: 240px;
  background: rgba(10,16,26,0.95); border: 1px solid var(--glass-border);
  padding: 7px 11px; border-radius: 9px; font-size: 12px; color: var(--text); z-index: 70;
  pointer-events: none; animation: toastin 0.2s var(--ease) both;
}

.foot {
  max-width: 680px; margin: 18px auto 0; display: flex; justify-content: space-between;
  font-size: 11.5px; color: var(--muted); padding: 0 4px;
}
.resolved { opacity: 0.55; }
.resolved .astack { display: none; }

/* 360px polish */
@media (max-width: 420px) {
  body { padding: 8px 8px 110px; }
  .ocard { padding: 15px 13px; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .brand h1 { font-size: 17px; }
  .abtns { grid-template-columns: 1fr; }
  .btn { min-height: 52px; }
  .voice-fab { width: 62px; height: 62px; right: 14px; }
  .tile .tnum { font-size: 19px; }
}

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