:root {
  --bg: #0b0e14;
  --bg-soft: #12161f;
  --card: #151a25;
  --card-2: #1a2130;
  --border: #232b3a;
  --text: #e8ecf3;
  --text-dim: #9aa4b5;
  --text-faint: #6b7688;
  --accent: #2dd4bf;
  --accent-dim: #134e4a;
  --red: #f87171;
  --red-dim: #4c1d24;
  --amber: #fbbf24;
  --amber-dim: #4a3a12;
  --green: #34d399;
  --green-dim: #124a38;
  --blue: #60a5fa;
  --blue-dim: #1e3a5f;
  --radius: 14px;
  --radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  line-height: 1.55;
  min-height: 100dvh;
}

.app { max-width: 720px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }

/* ── Top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 14px) 18px 10px;
  background: rgba(11, 14, 20, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 26px; }
.brand-text h1 { font-size: 17px; font-weight: 700; letter-spacing: 0.2px; }
.brand-sub { font-size: 11.5px; color: var(--text-dim); }

.icon-btn {
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  width: 38px; height: 38px; font-size: 19px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { transform: scale(0.94); background: var(--border); }

/* ── Date bar ── */
.datebar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 15;
}
.datebar .icon-btn { width: 40px; height: 40px; font-size: 24px; color: var(--text-dim); }
.datepicker { position: relative; flex: 1; display: flex; justify-content: center; }
.datepicker input[type="date"] {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer;
}
.date-display {
  font-size: 15.5px; font-weight: 600; padding: 8px 22px;
  background: var(--card-2); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); white-space: nowrap;
}

/* ── Content ── */
.content { flex: 1; padding: 14px 16px calc(env(safe-area-inset-bottom) + 70px); }
.loading { text-align: center; color: var(--text-faint); padding: 48px 0; font-size: 14px; }

.error-box {
  background: var(--red-dim); border: 1px solid rgba(248,113,113,0.3);
  border-radius: var(--radius); padding: 18px 16px; margin: 8px 0;
}
.error-box h3 { color: var(--red); font-size: 15px; margin-bottom: 6px; }
.error-box p { color: var(--text-dim); font-size: 13.5px; }

/* Status banner */
.status-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
  border: 1px solid; font-size: 13.5px; flex-wrap: wrap;
}
.status-banner .sb-label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.status-banner .sb-actions { display: flex; gap: 8px; }
.status-banner button {
  border: none; border-radius: 10px; padding: 8px 16px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: transform 0.1s; -webkit-tap-highlight-color: transparent;
}
.status-banner button:active { transform: scale(0.95); }
.status-banner.pending { background: var(--amber-dim); border-color: rgba(251,191,36,0.35); }
.status-banner.approved { background: var(--green-dim); border-color: rgba(52,211,153,0.35); }
.status-banner.rejected { background: var(--red-dim); border-color: rgba(248,113,113,0.35); }
.btn-approve { background: var(--green); color: #052e22; }
.btn-reject { background: var(--red); color: #3c0a10; }

/* Brief */
.brief-head { margin: 6px 0 14px; }
.brief-head h2 { font-size: 18.5px; font-weight: 700; letter-spacing: 0.2px; }
.brief-head .brief-note { margin-top: 8px; font-size: 13px; color: var(--text-dim); font-style: italic; }

.section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 14px 6px; margin-bottom: 12px; }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.section-head .sec-icon { font-size: 17px; }
.section-head h3 { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text); }
.section .sec-count { font-size: 11.5px; color: var(--text-faint); font-weight: 500; margin-left: auto; }

.item { padding: 10px 0; border-top: 1px solid rgba(35,43,58,0.6); }
.item:first-of-type { border-top: none; }
.item-head { display: flex; gap: 8px; align-items: baseline; }
.item-title { font-size: 14px; font-weight: 650; color: var(--text); flex: 1; }
.item-label { font-size: 12px; white-space: nowrap; font-weight: 700; }
.item-label.lbl-ok { color: var(--green); }
.item-label.lbl-warn { color: var(--amber); }
.item-label.lbl-rumor { color: var(--red); }
.item-desc { font-size: 13.5px; color: var(--text-dim); margin-top: 5px; }
.item-links { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px; }
.item-links a {
  font-size: 12px; color: var(--blue); text-decoration: none;
  background: var(--blue-dim); border-radius: 8px; padding: 4px 10px;
  word-break: break-all;
}
.item-links a:active { opacity: 0.7; }

/* Section-specific icon colors */
.sec-direct { border-left: 3px solid var(--red); }
.sec-sector { border-left: 3px solid var(--amber); }
.sec-macro { border-left: 3px solid var(--blue); }
.sec-events { border-left: 3px solid var(--green); }

.brief-foot { margin-top: 6px; font-size: 12px; color: var(--text-faint); font-style: italic; line-height: 1.5; }

/* Footer */
.footbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 15;
  background: rgba(11, 14, 20, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 10px 18px calc(env(safe-area-inset-bottom) + 10px);
  text-align: center;
}
.foot-note { font-size: 11px; color: var(--text-faint); }

/* Empty state */
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-faint); }
.empty-state .es-icon { font-size: 44px; margin-bottom: 12px; }
.empty-state h3 { color: var(--text-dim); font-size: 16px; margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; }

/* Days strip (desktop) */
@media (min-width: 640px) {
  .app { max-width: 780px; }
  .content { padding: 18px 20px calc(env(safe-area-inset-bottom) + 40px); }
  .footbar { position: static; }
  .item-desc { font-size: 14px; }
}
