* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

:root {
  --bg: #08090c;
  --surface: #12141a;
  --surface-2: #191d26;
  --border: #272d3a;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --danger: #ef4444;
  --warn: #facc15;
  --share: #2563eb;
  --ok: #22c55e;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.app {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: clamp(8px, 1vw, 16px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* TOPBAR */
.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  position: sticky;
  top: 6px;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 10px; }
.siren-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 12px var(--danger);
  animation: pulse 1.1s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}
.brand-title { font-size: 14px; font-weight: 800; letter-spacing: 0.06em; color: #fff; }
.brand-sub { font-size: 11px; color: var(--warn); font-weight: 600; font-variant-numeric: tabular-nums; }

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #0b0d12;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.nav-pill {
  background: transparent;
  color: #cbd5e1;
  border: none;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-pill.active {
  background: var(--danger);
  color: #fff;
}
.pill-count {
  background: rgba(0,0,0,0.35);
  color: var(--warn);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
}

.top-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.btn, .chip, .btn-mini {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 7px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
}
.btn:hover, .chip:hover, .btn-mini:hover { border-color: var(--warn); }
.btn.active, .chip.active, .btn-warn { background: var(--warn); color: #09090b; border-color: var(--warn); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-share { background: var(--share); color: #fff; border-color: var(--share); }
.btn-account { background: #1e293b; border-color: #38bdf8; color: #e0f2fe; }
.btn-mini { padding: 5px 9px; font-size: 11px; white-space: nowrap; }

.mobile-cats {
  display: none; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none;
}
.mobile-cats::-webkit-scrollbar { display: none; }
.mob-cat-btn {
  flex: 0 0 auto; background: var(--surface); color: #d1d5db;
  border: 1px solid var(--border); padding: 8px 12px; border-radius: 6px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.mob-cat-btn.active { background: var(--danger); color: #fff; border-color: var(--danger); }

/* WORKSPACE 3 COLUMNS (FULL SCREEN FLUID) */
.workspace {
  flex: 1;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(260px, 19vw) minmax(420px, 1fr) minmax(300px, 23vw);
  gap: clamp(10px, 1vw, 16px);
  align-items: stretch;
}
.workspace.exhibition { grid-template-columns: 1fr; }
.workspace.exhibition .col-left, .workspace.exhibition .col-right { display: none; }
.col-left, .col-center, .col-right { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card-danger {
  border-color: rgba(239, 68, 68, 0.5);
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.25), var(--surface));
}
.card-share {
  border-color: rgba(37, 99, 235, 0.55);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.16), var(--surface));
}
.card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: var(--warn);
  border-bottom: 1px solid var(--border); padding-bottom: 7px;
}
.badge-live, .badge-warn, .badge-muted, .badge-admin {
  font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 800;
}
.badge-live { background: var(--danger); color: #fff; }
.badge-warn { background: var(--warn); color: #000; }
.badge-admin { background: #38bdf8; color: #09090b; }
.badge-muted { background: #262c36; color: #cbd5e1; }

.cat-grid { display: flex; flex-direction: column; gap: 6px; }
.cat-btn {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  text-align: left; background: var(--surface-2); color: #e5e7eb;
  border: 1px solid var(--border); padding: 9px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.cat-btn.active { background: var(--danger); border-color: var(--danger); color: #fff; }

.field-label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--muted); }
select, input, textarea {
  width: 100%; background: #0a0c10; color: #fff;
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: 12px;
}
textarea { resize: vertical; line-height: 1.45; }
.tool-box, .muted-box {
  font-size: 12px; line-height: 1.45; color: #d1d5db;
  background: #0d1016; padding: 9px; border-radius: 6px; border: 1px solid var(--border);
}
code { color: #facc15; font-size: 11px; }

.aqi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.aqi-item {
  background: #0d1016; border: 1px solid var(--border); border-radius: 6px;
  padding: 8px; display: flex; flex-direction: column; gap: 3px;
}
.aqi-city { font-size: 10px; color: var(--muted); font-weight: 700; }
.aqi-val { font-size: 16px; color: var(--warn); font-variant-numeric: tabular-nums; }

.stage-card {
  background: var(--surface); border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; height: 100%;
}
.stage-banner {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: #141720; border-bottom: 1px solid var(--border);
}
.cat-badge {
  background: var(--danger); color: #fff; font-weight: 900; font-size: 12px;
  padding: 3px 7px; border-radius: 4px;
}
.cat-headline { flex: 1; font-size: 14px; font-weight: 900; letter-spacing: 0.03em; color: #fff; }
.canvas-wrap { width: 100%; flex: 1; height: clamp(320px, 46vh, 640px); min-height: 300px; background: #0b0d11; position: relative; }
.workspace.exhibition .stage-card { min-height: calc(100vh - 88px); }
.workspace.exhibition .canvas-wrap { height: clamp(420px, 62vh, 820px); }
#sceneCanvas { display: block; width: 100%; height: 100%; }
.stage-caption {
  padding: 8px 12px; font-size: 12px; font-weight: 700; text-align: center;
  color: #fca5a5; background: #101218; border-top: 1px solid var(--border);
}

.counter-panel {
  padding: 12px 14px; background: linear-gradient(180deg, #1b0d10, #111319);
  border-top: 1px solid rgba(239, 68, 68, 0.4); display: flex; flex-direction: column; gap: 6px;
}
.counter-top {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; font-weight: 800; color: #fca5a5;
}
.elapsed { color: var(--warn); font-variant-numeric: tabular-nums; }
.counter-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.big-num {
  font-size: 32px; font-weight: 900; color: var(--danger);
  font-variant-numeric: tabular-nums; line-height: 1.05;
  text-shadow: 0 0 18px rgba(239, 68, 68, 0.35);
}
.big-unit { font-size: 13px; font-weight: 800; color: #f3f4f6; text-transform: uppercase; }
.counter-sub { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-size: 12px; color: #d1d5db; }
.accent-warn { color: var(--warn); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: 11px; }

.hazard-tape {
  background: repeating-linear-gradient(-45deg, #facc15, #facc15 12px, #09090b 12px, #09090b 24px);
  padding: 6px;
}
.hazard-inner {
  background: #facc15; color: #09090b; font-size: 12px; font-weight: 900;
  text-align: center; padding: 7px 10px; letter-spacing: 0.02em;
}

.controls-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 8px; padding: 10px 12px; background: #12151c; border-top: 1px solid var(--border);
}
.mode-group, .util-group { display: flex; flex-wrap: wrap; gap: 6px; }
.inline-panel {
  padding: 12px; background: #0d1016; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.hidden { display: none !important; }
.cal-summary { font-size: 14px; font-weight: 800; color: var(--warn); }
.cal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-form { display: grid; grid-template-columns: 110px 1fr auto; gap: 6px; }
.schedule-list {
  list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 150px; overflow-y: auto;
}
.schedule-list li {
  display: flex; justify-content: space-between; align-items: center;
  background: #151923; padding: 7px 9px; border-radius: 6px; font-size: 12px; border: 1px solid var(--border);
}
.del-btn { background: transparent; color: #f87171; border: none; font-size: 16px; font-weight: 800; cursor: pointer; }

.vn-stat-highlight { font-size: 13px; line-height: 1.5; color: #fff; font-weight: 700; }
.quote-box {
  font-size: 12px; line-height: 1.45; color: #fca5a5;
  border-left: 3px solid var(--danger); padding-left: 9px; font-style: italic;
}
.consequences-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.consequences-list li {
  font-size: 12px; line-height: 1.45; color: #e5e7eb; background: #0d1016;
  border: 1px solid var(--border); border-left: 3px solid var(--warn);
  padding: 8px 9px; border-radius: 5px;
}

.quick-share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.quick-share-row button:last-child { grid-column: 1 / -1; }
.share-feedback { font-size: 11px; color: #4ade80; min-height: 14px; font-weight: 700; }

.pledge-list { display: flex; flex-direction: column; gap: 7px; }
.pledge-item {
  display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.4;
  background: #0d1016; border: 1px solid var(--border); padding: 8px; border-radius: 6px; cursor: pointer;
}
.pledge-item input { width: 15px; height: 15px; margin-top: 2px; accent-color: var(--warn); }
.hotline-box {
  font-size: 11px; line-height: 1.45; color: #fde047;
  background: rgba(127, 29, 29, 0.3); border: 1px solid rgba(239, 68, 68, 0.45);
  padding: 8px 10px; border-radius: 6px; font-weight: 700;
}
.sources-list { display: flex; flex-direction: column; gap: 6px; }
.sources-list a {
  color: #60a5fa; font-size: 12px; text-decoration: none;
  padding: 6px 8px; background: #0d1016; border: 1px solid var(--border); border-radius: 5px;
}
.sources-list a:hover { border-color: #60a5fa; text-decoration: underline; }

/* ========================================================================= */
/* NEWS PORTAL & PODCAST PLAYER (FACEBOOK-STYLE FEED)                        */
/* ========================================================================= */
.news-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(420px, 1fr);
  gap: 14px;
  align-items: start;
}
.news-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 68px; }
.podcast-card {
  border-color: rgba(250, 204, 21, 0.5);
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.12), var(--surface));
}
.podcast-now {
  font-size: 12px; line-height: 1.45; color: #fef08a;
  background: #0c0e14; padding: 9px; border-radius: 6px; border: 1px solid var(--border);
}
.podcast-controls { display: grid; grid-template-columns: 1.2fr 1fr 0.8fr; gap: 6px; }
.podcast-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.news-filter-list { display: flex; flex-wrap: wrap; gap: 6px; }

.news-feed-col { display: flex; flex-direction: column; gap: 14px; max-width: 920px; width: 100%; }
.login-prompt {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
  background: #0d1016; border: 1px dashed #38bdf8; padding: 10px 12px; border-radius: 8px;
  font-size: 12px; color: #e0f2fe;
}
.composer-form { display: flex; flex-direction: column; gap: 10px; }
.composer-row-2 { display: grid; grid-template-columns: 1fr 220px; gap: 8px; }
.media-attach-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.media-attach-bar input[type="text"] { flex: 1; min-width: 200px; }
.file-btn { display: inline-flex; align-items: center; gap: 5px; background: #1e293b; border-color: #334155; }
.media-preview {
  background: #090b10; border: 1px solid var(--border); border-radius: 8px; padding: 8px;
  max-height: 280px; overflow: hidden; display: flex; justify-content: center;
}
.media-preview img, .media-preview video { max-height: 260px; max-width: 100%; border-radius: 6px; }
.composer-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.pin-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--warn); cursor: pointer; }
.pin-check input { width: 15px; height: 15px; }
.composer-btns { display: flex; gap: 8px; margin-left: auto; }

.news-feed-list { display: flex; flex-direction: column; gap: 14px; }
.post-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.post-card.pinned { border-color: var(--warn); box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.2); }
.post-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.post-author-wrap { display: flex; align-items: center; gap: 10px; }
.post-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--danger);
  color: #fff; font-weight: 900; font-size: 13px; display: flex; align-items: center; justify-content: center;
}
.post-author-name { font-size: 13px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 6px; }
.post-meta { font-size: 11px; color: var(--muted); }
.post-title { font-size: 16px; font-weight: 900; color: #fff; line-height: 1.35; }
.post-body { font-size: 13px; line-height: 1.6; color: #e5e7eb; white-space: pre-line; }
.post-media { border-radius: 8px; overflow: hidden; background: #090b10; border: 1px solid var(--border); }
.post-media img, .post-media video { width: 100%; max-height: 440px; object-fit: cover; display: block; }
.post-media iframe { width: 100%; height: 340px; border: 0; display: block; }

.post-actions {
  display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border);
}
.post-actions .btn { flex: 1; min-width: 110px; text-align: center; }
.btn-podcast { background: rgba(250, 204, 21, 0.14); border-color: var(--warn); color: var(--warn); }

.comments-box {
  background: #0d1016; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
}
.comment-item { font-size: 12px; line-height: 1.4; color: #d1d5db; padding-bottom: 6px; border-bottom: 1px solid #1e2430; }
.comment-item:last-of-type { border-bottom: none; padding-bottom: 0; }
.comment-form { display: flex; gap: 6px; }

/* ========================================================================= */
/* WEEKLY TRENDS & AI UPGRADE PROMPTS VIEW                                   */
/* ========================================================================= */
.trends-layout { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.trends-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 12px; }
.trend-card {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--warn);
  border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.trend-title { font-size: 14px; font-weight: 900; color: #fff; }
.trend-prompt {
  background: #0a0c10; border: 1px solid #334155; padding: 10px; border-radius: 6px;
  font-size: 12px; line-height: 1.5; color: #fde047;
}
.growth-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.growth-box {
  background: #0d1016; border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.5; color: #d1d5db;
}
.growth-box strong { color: #38bdf8; font-size: 13px; }

/* MODALS */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 14px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(4px); }
.modal-card {
  position: relative; z-index: 1; width: 100%; max-width: 880px; max-height: 92vh;
  overflow-y: auto; background: #12151d; border: 1px solid #334155; border-radius: 12px;
  display: flex; flex-direction: column;
}
.modal-sm { max-width: 480px; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--border); background: #171c26;
}
.modal-head h2 { font-size: 14px; font-weight: 900; color: var(--warn); letter-spacing: 0.04em; }
.modal-body { display: grid; grid-template-columns: 300px 1fr; gap: 16px; padding: 16px; }
.modal-single { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.modal-col { display: flex; flex-direction: column; gap: 10px; }
.section-label { font-size: 11px; font-weight: 800; color: #93c5fd; letter-spacing: 0.04em; }
.qr-box {
  background: #ffffff; padding: 12px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.social-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.social-fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.social-zalo { background: #0068ff; border-color: #0068ff; color: #fff; }
.social-x { background: #0f172a; border-color: #475569; color: #fff; }
.social-tg { background: #0ea5e9; border-color: #0ea5e9; color: #fff; }
.pr-tabs { display: flex; flex-wrap: wrap; gap: 6px; }

.quick-admin-box, .auth-form, .account-status-card {
  background: #0d1016; border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
}

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; }
  .mobile-cats { display: flex; }
  .col-left .cat-grid { display: none; }
  .canvas-wrap { height: 310px; }
  .big-num { font-size: 26px; }
  .news-layout { grid-template-columns: 1fr; }
  .news-side { position: static; }
}
@media (max-width: 760px) {
  .modal-body { grid-template-columns: 1fr; }
  .social-grid { grid-template-columns: repeat(2, 1fr); }
  .composer-row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .plan-form { grid-template-columns: 1fr; }
}
