/* Ocelot PWA — mitad WhatsApp, mitad to-do (doc 10). Móvil-first. */
:root {
  --bg: #0e1413;
  --surface: #1a2422;
  --surface-2: #223029;
  --ink: #e8efec;
  --ink-dim: #9db4ab;
  --accent: #25d366;
  --accent-dark: #0b3d2e;
  --danger: #e35d5d;
  --warn: #e3b35d;
  --radius: 14px;
  font-size: 16px;
}
* { box-sizing: border-box; margin: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
  min-height: 100dvh; display: flex; flex-direction: column;
}
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  background: var(--accent-dark);
}
.brand { font-weight: 700; letter-spacing: .3px; }
.icon-btn { background: none; border: 0; color: var(--ink); font-size: 1.2rem; cursor: pointer; }

main { flex: 1; padding: 16px; padding-bottom: 90px; max-width: 680px; width: 100%; margin: 0 auto; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  display: flex; background: var(--surface);
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid #2c3b36;
}
.tab {
  flex: 1; padding: 10px 0 8px; background: none; border: 0; color: var(--ink-dim);
  font-size: 1.2rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
  position: relative;
}
.tab span { font-size: .7rem; }
.tab.active { color: var(--accent); }
.tab em {
  position: absolute; top: 4px; right: 26%;
  background: var(--danger); color: #fff; border-radius: 10px;
  font-size: .65rem; font-style: normal; padding: 1px 6px;
}

/* --- Tarjetas --- */
.card {
  background: var(--surface); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px;
}
.card h4 { font-size: .95rem; margin-bottom: 4px; }
.muted { color: var(--ink-dim); font-size: .82rem; }
.quote {
  border-left: 3px solid var(--accent); padding: 6px 10px; margin-top: 8px;
  background: var(--surface-2); border-radius: 0 8px 8px 0;
  font-style: italic; font-size: .85rem; color: var(--ink-dim);
}
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 10px; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .8px; color: var(--ink-dim); cursor: pointer;
}
.row-actions { display: flex; gap: 8px; margin-top: 10px; }
button.pill {
  border: 0; border-radius: 999px; padding: 7px 14px; font-size: .82rem;
  cursor: pointer; background: var(--surface-2); color: var(--ink);
}
button.pill.ok { background: var(--accent); color: #06281a; font-weight: 600; }
button.pill.no { background: var(--danger); color: #fff; }
button.primary {
  background: var(--accent); color: #06281a; border: 0; border-radius: var(--radius);
  padding: 12px; font-weight: 700; font-size: 1rem; cursor: pointer; width: 100%;
}

/* --- Briefing --- */
.briefing {
  background: linear-gradient(135deg, #0b3d2e, #14543f);
  border-radius: var(--radius); padding: 16px; margin-bottom: 18px;
  white-space: pre-wrap; line-height: 1.45; font-size: .92rem;
}
.briefing .muted { margin-bottom: 8px; display: block; }

/* --- Chat --- */
.chat-log { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.bubble {
  max-width: 85%; padding: 10px 14px; border-radius: 16px; line-height: 1.4;
  font-size: .92rem; white-space: pre-wrap;
}
.bubble.user { align-self: flex-end; background: #1f5c46; border-bottom-right-radius: 4px; }
.bubble.ai { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 4px; }
.bubble .cite { display: block; margin-top: 8px; font-size: .78rem; color: var(--ink-dim); }
.chat-input {
  position: fixed; bottom: calc(58px + env(safe-area-inset-bottom)); left: 0; right: 0;
  display: flex; gap: 8px; padding: 10px 14px; background: var(--bg);
  max-width: 680px; margin: 0 auto;
}
.chat-input input {
  flex: 1; border: 0; border-radius: 999px; padding: 12px 18px;
  background: var(--surface); color: var(--ink); font-size: .95rem; outline: none;
}
.chat-input button {
  border: 0; border-radius: 50%; width: 46px; height: 46px;
  background: var(--accent); color: #06281a; font-size: 1.1rem; cursor: pointer;
}

/* --- Misc --- */
.empty { text-align: center; color: var(--ink-dim); padding: 48px 16px; line-height: 1.6; }
dialog {
  border: 0; border-radius: var(--radius); background: var(--surface); color: var(--ink);
  width: min(420px, 90vw); padding: 22px;
}
dialog::backdrop { background: rgba(0,0,0,.6); }
.settings-form { display: flex; flex-direction: column; gap: 14px; }
.settings-form input {
  width: 100%; margin-top: 6px; padding: 10px; border-radius: 8px;
  border: 1px solid #2c3b36; background: var(--bg); color: var(--ink);
}
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-2);
  font-size: .7rem; margin-right: 6px; color: var(--ink-dim); }
.tag.warn { color: var(--warn); }
