/* =========================================================================
   PULSE × 1990 AGENCY — DESIGN TOKENS
   Red · Black · White. Light + Dark modes.
   Variable names preserved so existing components keep working.
   ========================================================================= */

:root {
  /* ---- Brand scale (all reds, no other hues) ----------------------------- */
  --brand-500: #EC2024;   /* 1990 Red — Primary */
  --brand-600: #C81319;   /* pressed / hover */
  --brand-700: #9E0E13;
  --brand-400: #FF3A3D;
  --brand-300: #FF6B6D;
  --brand-200: #FFB4B6;
  --brand-100: #FFE5E6;
  --brand-50:  #FFF2F3;
  --accent-red: #FF0000;  /* pure red highlight per cheatsheet */

  /* ---- Accent aliases — collapsed into neutrals/red ---------------------- *
   * The old design used violet/mint/amber/sky/rose. 1990 brand is red-only,
   * so every accent now maps to red or grayscale. Existing JSX references
   * keep rendering — they just pick up brand colors instead of rainbow. */
  --violet-500: #EC2024;  --violet-100: #FFE5E6;
  --mint-500:   #111111;  --mint-100:   #E8E8E8;
  --amber-500:  #EC2024;  --amber-100:  #FFE5E6;
  --rose-500:   #EC2024;  --rose-100:   #FFE5E6;
  --sky-500:    #111111;  --sky-100:    #E8E8E8;

  /* Semantic signals (KPI states) — reuses the same palette */
  --signal-good:    #111111;  /* over-delivering = black, confident */
  --signal-good-bg: #E8E8E8;
  --signal-warn:    #EC2024;  /* under = red alert */
  --signal-warn-bg: #FFE5E6;
  --signal-live:    #EC2024;  /* pulsing red dot */

  /* ---- Neutrals — near-black to white ----------------------------------- */
  --ink-900: #111111;     /* primary black */
  --ink-800: #1A1A1A;     /* near-black, table rows */
  --ink-700: #2B2B2B;
  --ink-600: #4A4A4A;
  --ink-500: #6E6E6E;
  --ink-400: #999999;
  --ink-300: #CCCCCC;
  --ink-200: #E5E5E5;
  --ink-100: #F0F0F0;
  --ink-50:  #F7F7F7;
  --white:   #FFFFFF;

  /* ---- Surfaces (light mode default) ------------------------------------ */
  --bg:            #FFFFFF;
  --bg-elevated:   #F7F7F7;
  --bg-panel:      #FFFFFF;
  --bg-raised:     #FFFFFF;
  --bg-inverse:    #111111;
  --text-primary:  #111111;
  --text-secondary:#4A4A4A;
  --text-muted:    #6E6E6E;
  --text-inverse:  #FFFFFF;
  --border:        #E5E5E5;
  --border-strong: #CCCCCC;
  --border-muted:  #F0F0F0;

  /* ---- Platform colors — grayscale (brand is mono) ----------------------- */
  --tiktok-a: #111111;
  --tiktok-b: #EC2024;
  --ig-a:     #111111;
  --ig-b:     #EC2024;
  --ig-c:     #111111;
  --fb:       #111111;

  /* ---- Typography -------------------------------------------------------- */
  /* Montserrat matches the 1990 Agency website and supports Vietnamese marks well. */
  --font-display: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans:    'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'SFMono-Regular', ui-monospace, monospace;

  /* ---- Radii — 1990 is sharp, keep things tight ------------------------- */
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
  --r-2xl: 16px;
  --r-full: 999px;

  /* ---- Shadows — muted; sharp brand doesn't lean on blur --------------- */
  --sh-xs: 0 1px 0 rgba(0,0,0,0.04);
  --sh-sm: 0 1px 2px rgba(0,0,0,0.06);
  --sh-md: 0 2px 6px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --sh-lg: 0 8px 20px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --sh-brand: 0 6px 18px rgba(236, 32, 36, 0.24);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* =========================================================================
   DARK MODE — invert surfaces, keep brand red intact
   ========================================================================= */
[data-theme="dark"] {
  --brand-500: #EC2024;
  --brand-600: #FF3A3D;
  --brand-400: #FF6B6D;
  --brand-100: #3A0A0B;
  --brand-50:  #1F0607;

  --violet-500: #EC2024;  --violet-100: #3A0A0B;
  --mint-500:   #FFFFFF;  --mint-100:   #2A2A2A;
  --amber-500:  #EC2024;  --amber-100:  #3A0A0B;
  --rose-500:   #EC2024;  --rose-100:   #3A0A0B;
  --sky-500:    #FFFFFF;  --sky-100:    #2A2A2A;

  --signal-good:    #FFFFFF;
  --signal-good-bg: #2A2A2A;
  --signal-warn:    #EC2024;
  --signal-warn-bg: #3A0A0B;

  --ink-900: #FFFFFF;
  --ink-800: #F0F0F0;
  --ink-700: #CCCCCC;
  --ink-600: #999999;
  --ink-500: #777777;
  --ink-400: #555555;
  --ink-300: #3A3A3A;
  --ink-200: #2A2A2A;
  --ink-100: #1F1F1F;
  --ink-50:  #181818;
  --white:   #111111;   /* "white surface" now resolves to black */

  --bg:            #111111;
  --bg-elevated:   #1A1A1A;
  --bg-panel:      #1A1A1A;
  --bg-raised:     #1F1F1F;
  --bg-inverse:    #FFFFFF;
  --text-primary:  #FFFFFF;
  --text-secondary:#CCCCCC;
  --text-muted:    #999999;
  --text-inverse:  #111111;
  --border:        #2A2A2A;
  --border-strong: #3A3A3A;
  --border-muted:  #1F1F1F;

  --tiktok-a: #FFFFFF;
  --tiktok-b: #EC2024;
  --ig-a:     #FFFFFF;
  --ig-b:     #EC2024;
  --ig-c:     #FFFFFF;
  --fb:       #FFFFFF;

  --sh-xs: 0 1px 0 rgba(0,0,0,0.4);
  --sh-sm: 0 1px 2px rgba(0,0,0,0.3);
  --sh-md: 0 2px 8px rgba(0,0,0,0.4);
  --sh-lg: 0 8px 24px rgba(0,0,0,0.5);
  --sh-brand: 0 6px 18px rgba(236, 32, 36, 0.35);
}

/* =========================================================================
   BASE
   ========================================================================= */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg);
  font-feature-settings: 'tnum' 1, 'ss01' 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* Brand text flourish */
.display {
  font-family: var(--font-display);
  letter-spacing: 0;
  text-transform: uppercase;
  font-weight: 900;
  line-height: 0.95;
}
.overline {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
}

/* =========================================================================
   PRIMITIVES
   ========================================================================= */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 600;
  background: var(--ink-100); color: var(--text-primary);
  border: 1px solid var(--border);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.chip.mint,
.chip.good { background: var(--ink-900); color: var(--text-inverse); border-color: var(--ink-900); }
.chip.rose,
.chip.warn,
.chip.brand { background: var(--brand-500); color: #FFFFFF; border-color: var(--brand-500); }
.chip.amber { background: var(--brand-100); color: var(--brand-500); border-color: transparent; }
.chip.violet { background: var(--ink-100); color: var(--text-primary); border-color: transparent; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.posts-tab-panel {
  padding: 0;
  overflow: hidden;
}
.posts-tab-tablewrap {
  overflow-x: auto;
}
.posts-tab-cardgrid {
  display: none;
}
.post-mobile-card {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  padding: 14px;
  min-width: 0;
}
.post-mobile-card .post-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.post-mobile-card .post-row:first-of-type {
  border-top: 0;
}
.post-mobile-card .post-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  flex: 0 0 88px;
}
.post-mobile-card .post-value {
  min-width: 0;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
@media (max-width: 680px) {
  .posts-tab-tablewrap {
    display: none;
  }
  .posts-tab-cardgrid {
    display: grid;
    gap: 10px;
    padding: 12px;
  }
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: var(--r-md);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em;
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border-strong);
  transition: all 0.15s var(--ease);
}
.btn:hover { border-color: var(--text-primary); }
.btn.primary {
  background: var(--text-primary); color: var(--text-inverse);
  border-color: var(--text-primary);
}
.btn.primary:hover { background: var(--ink-700); border-color: var(--ink-700); }
.btn.brand {
  background: var(--brand-500); color: #FFFFFF;
  border-color: var(--brand-500);
}
.btn.brand:hover { background: var(--brand-600); border-color: var(--brand-600); box-shadow: var(--sh-brand); }
.btn.ghost { border-color: transparent; color: var(--text-secondary); }
.btn.ghost:hover { background: var(--ink-100); border-color: transparent; color: var(--text-primary); }

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  letter-spacing: 0;
}

/* 1990 signature: red asterisk, red vertical rule */
.brand-rule {
  display: inline-block;
  width: 3px; height: 1em;
  background: var(--brand-500);
  vertical-align: -0.12em;
  margin-right: 10px;
}
.asterisk {
  color: var(--brand-500);
  font-weight: 900;
  display: inline-block;
  transform: translateY(0.05em);
}

/* =========================================================================
   SCROLLBAR
   ========================================================================= */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 0; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-300); }

/* Selection */
::selection { background: var(--brand-500); color: #FFFFFF; }
