:root {
  --primary: #2451b8;
  --accent: #0d7e8c;
  --primary-tint: #eaf0fb;
  --accent-tint: #eef7f8;

  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f0f3f9;
  --text: #10182b;
  --muted: #5b6577;
  --border: #e2e8f2;
  --shadow: 0 1px 2px rgba(16,24,43,.06), 0 8px 24px rgba(16,24,43,.06);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020; --surface: #141a2c; --surface-2: #1b2338;
    --text: #eef2fb; --muted: #9aa6bd; --border: #263049;
    --primary-tint: #17233f; --accent-tint: #10262b;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--primary); }

/* Header */
header { position: sticky; top: 0; z-index: 10; background: var(--surface);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.bar { max-width: 900px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.2px; }
.logo img { width: 30px; height: 30px; border-radius: 8px; }
.logo small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: 0; }
.spacer { flex: 1; }
select, button { font: inherit; }
select { background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; }

.btn { border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn.ok { background: var(--accent); color: #fff; }
.btn.danger { background: transparent; color: #c0392b; border: 1px solid #e6b9b3; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.big { padding: 12px 20px; font-size: 15px; }

main { max-width: 900px; margin: 0 auto; padding: 16px; }

/* status strip */
.status { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.pill { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }
.pill b { color: var(--text); }

/* tabs */
.tabs { display: flex; gap: 6px; margin: 8px 0 16px; }
.tab { padding: 8px 12px; border-radius: 999px; cursor: pointer; color: var(--muted); border: 1px solid transparent; }
.tab.active { background: var(--primary-tint); color: var(--primary); font-weight: 600; }

/* proposal cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h3 { margin: 2px 0 6px; font-size: 16px; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.chip { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 3px 8px; border-radius: 6px; background: var(--accent-tint); color: var(--accent); }
.chip.src { background: var(--primary-tint); color: var(--primary); }
.chip.demo { background: #fff3cd; color: #8a6d0b; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.badge.approval { background: #fdecc8; color: #8a5b00; }
.badge.confirm { background: #f8d7da; color: #842029; }
.badge.auto { background: #d1f0dc; color: #0f6b3a; }
.risk { font-size: 11px; color: var(--muted); }
.summary { color: var(--text); margin: 4px 0 10px; }
.why { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.plan { margin: 0 0 12px; padding-left: 18px; color: var(--text); }
.plan li { margin: 2px 0; }
.action { background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.confirm-wrap { font-size: 13px; color: #842029; display: flex; align-items: center; gap: 6px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* login overlay */
.overlay { position: fixed; inset: 0; background: var(--bg); display: none; align-items: center; justify-content: center; z-index: 50; }
.overlay.show { display: flex; }
.login { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; width: min(360px, 90vw); text-align: center; }
.login input { width: 100%; padding: 12px; margin: 14px 0; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow);
  opacity: 0; transition: opacity .2s; z-index: 60; }
.toast.show { opacity: 1; }

@media (max-width: 520px) {
  .logo small { display: none; }
  .btn.big { width: 100%; }
  .bar .spacer { display: none; }
}
