/* PRSense — Design System v2 (prsense.web.id)
   NOTE: class names + CSS variable NAMES are contracts used by JS
   (ui.js progress bar, app.js score bar, charts, wordcloud).
   Values may change freely; names must not. */

/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  /* Canvas */
  --canvas: #0E0F11;
  --surface: #16181C;
  --surface-2: #1D2026;
  --surface-3: #252830;

  /* Ink */
  --ink: #F1F2F4;
  --body: #9EA3AE;
  --body-strong: #C8CAD0;
  --muted: #5C6070;

  /* Accent — single: Amber Warmth (Instagram-adjacent warmth) */
  --accent: #F59E0B;
  --accent-dim: rgba(245,158,11,.12);
  --accent-active: #D97706;

  /* Semantic */
  --green: #34D399;
  --red: #F87171;
  --on-primary: #0E0F11;

  /* Lines */
  --line: rgba(255,255,255,.07);
  --line-strong: rgba(255,255,255,.12);

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4),0 4px 12px -4px rgba(0,0,0,.3);
  --shadow-md: 0 2px 4px rgba(0,0,0,.5),0 16px 40px -16px rgba(0,0,0,.5);
  --shadow-lg: 0 4px 8px rgba(0,0,0,.6),0 32px 64px -24px rgba(0,0,0,.6);
  --shadow-accent: 0 8px 32px -8px rgba(245,158,11,.25);

  /* Easing */
  --ease: cubic-bezier(.32,.72,0,1);
  --ease-soft: cubic-bezier(.22,.61,.36,1);
  --spring: cubic-bezier(.34,1.56,.64,1);

  /* Typography */
  --display: "Outfit", system-ui, sans-serif;
  --sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", monospace;

  /* Spacing */
  --xs: 6px; --sm: 10px; --md: 16px; --lg: 24px; --xl: 32px; --xxl: 56px;

  /* Radius */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-2xl: 28px; --r-pill: 9999px;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--display);
  background: var(--canvas);
  color: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}

/* Film grain — fixed texture overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: .018;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ─── Nav ────────────────────────────────────────────────── */
.top-nav {
  position: sticky;
  top: 12px;
  z-index: 40;
  display: flex;
  align-items: center;
  height: 54px;
  margin: 12px 16px 0;
  padding: 0 10px 0 20px;
  border-radius: var(--r-xl);
  gap: var(--sm);
  background: rgba(22,24,28,.82);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.brand {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--ink);
  white-space: nowrap;
}
.nav-tagline {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  margin-left: 4px;
}
.nav-spacer { flex: 1; }
.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--body);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  transition: color .25s var(--ease-soft), background .25s var(--ease-soft);
  white-space: nowrap;
}
.nav-link:hover { color: var(--ink); background: var(--surface-2); }

.usage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  letter-spacing: .01em;
  white-space: nowrap;
  animation: fadeIn .6s var(--ease) both;
}
.usage-pill b { color: var(--accent); font-weight: 700; }
@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.07); box-shadow: 0 0 0 3px rgba(245,158,11,.25); }
  100% { transform: scale(1); }
}
.usage-pill.bump { animation: bump .6s var(--ease); }

/* Mobile Burger Button */
.nav-burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  transition: all .2s var(--ease-soft);
  color: var(--ink);
  z-index: 45;
}
.nav-burger-btn:hover, .nav-burger-btn:focus-visible {
  background: var(--surface-3);
  border-color: var(--accent);
}
.nav-burger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s var(--ease);
}
.nav-burger-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-burger-btn.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-burger-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav Drawer & Backdrop */
.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 72px;
  left: 12px;
  right: 12px;
  z-index: 50;
  background: rgba(22, 24, 28, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2xl);
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.mobile-nav-drawer.open {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.mobile-user-info {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.usage-pill-mobile {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: var(--r-pill);
}
.usage-pill-mobile b {
  color: var(--accent);
  font-weight: 700;
}
.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s var(--ease-soft);
}
.mobile-nav-link:hover, .mobile-nav-link.active {
  background: var(--surface-2);
  color: var(--ink);
}
.mobile-nav-link.active {
  color: var(--accent);
  font-weight: 600;
}
.mobile-nav-link svg {
  flex-shrink: 0;
  color: currentColor;
}
.mobile-nav-link.logout {
  color: var(--muted);
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.mobile-nav-link.logout:hover {
  color: var(--red);
  background: rgba(248, 113, 113, 0.08);
}
.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 48;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
}
.mobile-nav-backdrop.open {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* ─── Page Container ─────────────────────────────────────── */
.container { max-width: 1080px; margin: 0 auto; padding: var(--lg) var(--xl); }

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 64px;
  align-items: center;
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5rem);
}

/* Left column */
.hero-left { min-width: 0; }

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--accent);
  margin-bottom: 22px;
}
.kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-dim); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

.hero-title {
  font-size: clamp(2.4rem, 4.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.04em;
  color: var(--ink);
  margin-bottom: 20px;
}
.title-accent {
  color: var(--accent);
  position: relative;
}

.hero-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--body);
  max-width: 52ch;
  margin-bottom: 36px;
}

/* Input form */
.input-stack { display: flex; flex-direction: column; gap: 8px; max-width: 540px; }
.input-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}
.input-row { display: flex; gap: 8px; }

.text-input {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 400;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  padding: 0 18px;
  height: 54px;
  min-height: 54px;
  flex: 1 1 auto;
  min-width: 0;
  outline: none;
  transition: border-color .25s var(--ease-soft), box-shadow .25s var(--ease-soft);
}
.text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.text-input::placeholder { color: var(--muted); }

.button-primary {
  font-family: var(--display);
  font-size: 14.5px;
  font-weight: 600;
  background: var(--accent);
  color: var(--on-primary);
  border: none;
  border-radius: var(--r-xl);
  padding: 0 28px;
  height: 54px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-accent);
  transition: background .25s var(--ease-soft), transform .2s var(--spring), box-shadow .25s var(--ease-soft);
}
.button-primary:hover {
  background: var(--accent-active);
  transform: translateY(-1px);
  box-shadow: 0 12px 36px -8px rgba(245,158,11,.35);
}
.button-primary:active { transform: scale(.97) translateY(0); }
.button-primary:disabled {
  background: var(--surface-3);
  color: var(--muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.error-text { color: var(--red); font-size: 13px; margin-top: 4px; }

/* Reassuring status notice (Amber) */
.status-notice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  margin-top: 10px;
  animation: rise .4s var(--ease) both;
}
.notice-main {
  display: flex;
  align-items: center;
  gap: 10px;
}
.notice-icon { font-size: 16px; }
.notice-text { font-size: 13.5px; color: var(--ink); line-height: 1.45; }
.notice-actions {
  display: flex;
  gap: 8px;
  margin-left: 26px;
}
.notice-btn-primary {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent);
  color: var(--on-primary);
  border: none;
  border-radius: var(--r-pill);
  padding: 5px 14px;
  cursor: pointer;
  transition: all .2s var(--ease-soft);
}
.notice-btn-primary:hover { background: var(--accent-active); }
.notice-btn-subtle {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 5px 14px;
  cursor: pointer;
  transition: all .2s var(--ease-soft);
}
.notice-btn-subtle:hover { background: rgba(255, 255, 255, 0.1); }

/* Right column — preview cards */
.hero-right {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-orb {
  position: absolute;
  inset: -40px;
  background: radial-gradient(ellipse 70% 60% at 60% 50%, rgba(245,158,11,.07), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  animation: rise .9s var(--ease) both;
  transition: transform .35s var(--ease-soft), box-shadow .35s var(--ease-soft);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card-1 { animation-delay: .15s; }
.stat-card-2 { animation-delay: .25s; }
.stat-card-3 { animation-delay: .35s; }

.stat-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  margin-bottom: 8px;
}
.stat-val {
  display: block;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-val.positive { color: var(--green); }
.stat-sub { font-size: 12px; color: var(--muted); }

.mini-topics { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.mini-topics li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--body-strong);
}
.dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-pos { background: var(--green); }
.dot-neg { background: var(--red); }

.stat-quote {
  display: block;
  font-size: 13px;
  line-height: 1.55;
  color: var(--body-strong);
  font-style: italic;
}

/* ─── How It Works ───────────────────────────────────────── */
.how-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--line);
}
.section-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--muted);
  margin-bottom: 36px;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.step-item {
  background: var(--canvas);
  padding: 28px 24px;
  transition: background .3s var(--ease-soft);
}
.step-item:hover { background: var(--surface); }

.step-num {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: .1em;
  margin-bottom: 16px;
}
.step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -.02em;
}
.step-body {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--body);
}

/* ─── Status Bar ─────────────────────────────────────────── */
.status-bar {
  display: none;
  align-items: center;
  gap: var(--sm);
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  margin: var(--lg) 0;
  font-size: 14px;
  color: var(--body);
  box-shadow: var(--shadow-sm);
}
.status-bar.visible { display: flex; animation: rise .5s var(--ease) both; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-stop {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  background: transparent;
  border: 1px solid rgba(248,113,113,.3);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  cursor: pointer;
  height: 32px;
  white-space: nowrap;
  margin-left: auto;
  transition: background .25s var(--ease-soft), color .25s var(--ease-soft);
}
.btn-stop:hover { background: var(--red); color: var(--canvas); }

/* ─── Dashboard ──────────────────────────────────────────── */
.dashboard { display: none; }
.dashboard.visible { display: block; }

/* History Context Banner */
.history-context-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--r-xl);
  padding: 14px 20px;
  margin-bottom: var(--lg);
  animation: rise .5s var(--ease) both;
}
.banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.banner-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--accent);
  color: var(--on-primary);
  padding: 3px 10px;
  border-radius: var(--r-pill);
}
.banner-date {
  font-size: 13px;
  font-family: var(--mono);
  color: var(--ink);
}
.banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.banner-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s var(--ease-soft);
}
.banner-btn:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  color: var(--accent);
}
.banner-btn-accent {
  background: var(--accent);
  color: var(--on-primary);
  border-color: var(--accent);
  font-weight: 700;
}
.banner-btn-accent:hover {
  background: var(--accent-active);
  color: var(--on-primary);
}

/* Metrics */
.metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--md);
  margin-bottom: var(--lg);
}
.metric-box {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2xl);
  padding: var(--xl);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform .4s var(--ease-soft), box-shadow .4s var(--ease-soft);
}
.metric-box:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.metric-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .16em;
  margin-bottom: 10px;
}
.metric-value {
  font-family: var(--mono);
  font-size: 40px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.03em;
  line-height: 1.1;
}

/* Score bar */
.score-bar { width: 100%; max-width: 200px; margin: 14px auto 0; }
.score-track {
  height: 5px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.score-fill { height: 100%; border-radius: 999px; transition: width .6s var(--ease), background .6s var(--ease); }
.score-labels { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 9px; color: var(--muted); margin-top: 4px; }
.score-bd { display: flex; justify-content: center; gap: var(--md); margin-top: 10px; font-size: 11px; }
.sc-p { color: var(--green); font-weight: 600; }
.sc-n { color: var(--muted); }
.sc-neg { color: var(--red); font-weight: 600; }

/* AI Summary */
.summary-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2xl);
  padding: 20px 28px 20px 32px;
  margin-bottom: var(--lg);
  position: relative;
  box-shadow: var(--shadow-sm);
}
.summary-card::before {
  content: "";
  position: absolute;
  top: 18px; left: 0;
  width: 3px;
  height: calc(100% - 36px);
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.summary-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--accent);
  margin-bottom: 6px;
}
.summary-text { font-size: 14px; line-height: 1.7; color: var(--body-strong); }

/* Charts */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--md);
  margin-bottom: var(--lg);
}
.chart-box {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2xl);
  padding: var(--xl);
  text-align: center;
  overflow: hidden;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}
.chart-box-dark {
  background: #0A0A0C;
  border-color: var(--line);
  box-shadow: var(--shadow-lg);
}
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--body-strong);
  margin-bottom: var(--md);
  letter-spacing: -.01em;
  text-align: left;
}
.section-title.on-dark { color: var(--ink); }
.chart-box canvas { display: block; margin: 0 auto; max-width: 100%; max-height: 300px; }

/* Wordcloud */
.wordcloud-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  padding: var(--sm);
  min-height: 100px;
  width: 100%;
  align-content: center;
}
.wc-word {
  display: inline-block;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: default;
  transition: opacity .3s var(--ease-soft), transform .3s var(--ease-soft);
}
.wc-word:hover { opacity: 1 !important; transform: translateY(-2px); }

/* Topics */
.topics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--md);
  margin-bottom: var(--lg);
}
.topic-box {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2xl);
  padding: var(--xl);
  box-shadow: var(--shadow-sm);
}
.topic-list { list-style: none; }
.topic-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--body-strong);
  transition: padding-left .25s var(--ease-soft);
}
.topic-list li:last-child { border-bottom: none; }
.topic-list li:hover { padding-left: 6px; }
.topic-count {
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--r-pill);
  padding: 2px 10px;
  border: 1px solid rgba(245,158,11,.2);
}

/* Verbatim */
.verbatim-box {
  background: #0A0A0C;
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  padding: var(--xl);
  margin-bottom: var(--lg);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.verbatim-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: var(--md);
}
.verbatim-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.v-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--body);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  cursor: pointer;
  transition: all .2s var(--ease-soft);
}
.v-tab:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}
.v-tab.active {
  background: var(--surface-3);
  color: var(--ink);
  border-color: var(--accent);
}
.v-badge {
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
}
.v-badge.pos { color: var(--green); background: rgba(52, 211, 153, 0.12); }
.v-badge.neu { color: var(--body); background: rgba(158, 163, 174, 0.12); }
.v-badge.neg { color: var(--red); background: rgba(248, 113, 113, 0.12); }

.verbatim-feed {
  max-height: 380px;
  overflow-y: auto;
  margin-bottom: var(--md);
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.verbatim-item {
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  transition: background .2s var(--ease-soft);
}
.verbatim-item:last-child { border-bottom: none; }
.verbatim-item:hover { background: rgba(255,255,255,.02); }
.verbatim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.verbatim-username { font-size: 12px; font-weight: 600; color: var(--muted); }
.verbatim-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  letter-spacing: .02em;
}
.verbatim-tag.st-pos { color: var(--green); background: rgba(52, 211, 153, 0.12); }
.verbatim-tag.st-neu { color: var(--body); background: rgba(158, 163, 174, 0.12); }
.verbatim-tag.st-neg { color: var(--red); background: rgba(248, 113, 113, 0.12); }

.verbatim-body { font-size: 14px; color: var(--ink); line-height: 1.55; }
.verbatim-meta { display: flex; gap: var(--sm); margin-top: 6px; font-size: 11px; font-family: var(--mono); color: var(--muted); }

.dot-pos { background: var(--green); }
.dot-neu { background: var(--muted); }
.dot-neg { background: var(--red); }

.btn-export {
  display: block;
  margin: 0 auto;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  background: rgba(255,255,255,.05);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 10px 24px;
  cursor: pointer;
  transition: border-color .25s, background .25s, transform .2s var(--spring);
}
.btn-export:hover { border-color: var(--accent); background: rgba(255,255,255,.08); transform: translateY(-1px); }
.btn-export:active { transform: scale(.98); }

/* ─── Footer ─────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: var(--xxl) var(--xl);
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: var(--xl);
}

/* ─── Entrance Animations ────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.hero-kicker  { animation: rise .7s var(--ease) both; }
.hero-title   { animation: rise .7s var(--ease) .07s both; }
.hero-body    { animation: rise .7s var(--ease) .14s both; }
.input-stack  { animation: rise .7s var(--ease) .2s both; }
.how-section  { animation: rise .7s var(--ease) .1s both; }

.dashboard.visible .metric-box            { animation: rise .6s var(--ease) both; }
.dashboard.visible .metric-box:nth-child(2){ animation-delay: .08s; }
.dashboard.visible .summary-card          { animation: rise .6s var(--ease) .14s both; }
.dashboard.visible .charts-row            { animation: rise .6s var(--ease) .2s both; }
.dashboard.visible .topics-row            { animation: rise .6s var(--ease) .26s both; }
.dashboard.visible .verbatim-box          { animation: rise .6s var(--ease) .32s both; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; gap: 48px; }
  .hero-right { display: none; }
}

@media (max-width: 860px) {
  .nav-tagline { display: none; }
}

@media (max-width: 768px) {
  .container { padding: var(--md); }
  .top-nav { margin: 10px 12px 0; padding: 0 10px 0 16px; height: 50px; }
  .nav-link { display: none; }
  .usage-pill { display: none; }
  .nav-btn-profile { display: none !important; }
  .nav-burger-btn { display: flex; }
  .brand { margin-right: auto; }

  .hero { padding: 2.5rem 0 2rem; }
  .hero-title { font-size: clamp(1.85rem, 6.5vw, 2.3rem); line-height: 1.18; }
  .hero-body { font-size: 14.5px; line-height: 1.55; }

  .input-row { flex-direction: column !important; gap: 12px !important; }
  .text-input {
    flex: none !important;
    width: 100% !important;
    height: 64px !important;
    min-height: 64px !important;
    font-size: 16px !important;
    padding: 0 20px !important;
    border-radius: var(--r-xl) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
  }
  .button-primary {
    flex: none !important;
    width: 100% !important;
    height: 54px !important;
    min-height: 54px !important;
    font-size: 15.5px !important;
    font-weight: 700 !important;
    border-radius: var(--r-xl) !important;
    box-sizing: border-box !important;
  }

  .steps-grid { grid-template-columns: 1fr; gap: 14px; }
  .metrics-row, .charts-row, .topics-row { grid-template-columns: 1fr; }
  .metric-value { font-size: 32px; }

  .wordcloud-container { min-height: 80px; gap: 6px 10px; }
  .chart-box, .chart-box-dark { padding: var(--md); }

  .hero-kicker, .hero-title, .hero-body, .input-stack { animation: none; }
  .history-context-banner { flex-direction: column; align-items: stretch; text-align: center; }
  .history-context-banner .banner-left { justify-content: center; }
  .history-context-banner .banner-actions { justify-content: center; width: 100%; }
  .history-context-banner .banner-btn { flex: 1; justify-content: center; text-align: center; }
  .verbatim-box-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 480px) {
  .steps-grid { grid-template-columns: 1fr; }
  .login-card { padding: 32px 20px; }
  .form-input { font-size: 16px; }
}

/* ─── Profile Navigation Button & Modal ─────────────────── */
.nav-btn-profile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 5px 14px;
  cursor: pointer;
  height: 32px;
  transition: all .2s var(--ease-soft);
}
.nav-btn-profile:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 9, 11, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease-soft);
}
.modal-overlay.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(22, 24, 28, 0.98);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2xl);
  padding: 30px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 24px 50px rgba(0,0,0,.7);
  transform: translateY(12px) scale(0.98);
  transition: transform .25s var(--ease);
}
.modal-overlay.active .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.3px;
}
.modal-subtitle {
  font-size: 12.5px;
  color: var(--body);
  margin-top: 2px;
}
.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  line-height: 1;
  transition: all .2s var(--ease-soft);
}
.modal-close-btn:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  padding-bottom: 2px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.modal-tab-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--body);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .2s var(--ease-soft);
}
.modal-tab-btn:hover {
  color: var(--ink);
}
.modal-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.modal-field {
  margin-bottom: 14px;
  text-align: left;
}
.modal-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--body-strong);
  margin-bottom: 5px;
}
.modal-input {
  width: 100%;
  height: 44px;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s var(--ease-soft), box-shadow .2s var(--ease-soft);
}
.modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}
.modal-help {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.modal-alert {
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  margin-bottom: 16px;
  display: none;
}
.modal-alert.error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: var(--red);
  display: block;
}
.modal-alert.success {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: var(--green);
  display: block;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.btn-modal-cancel {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: var(--body);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 8px 18px;
  cursor: pointer;
  height: 38px;
  transition: all .2s var(--ease-soft);
}
.btn-modal-cancel:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.btn-modal-save {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  background: var(--accent);
  color: #0E0F11;
  border: none;
  border-radius: var(--r-pill);
  padding: 8px 22px;
  cursor: pointer;
  height: 38px;
  box-shadow: var(--shadow-accent);
  transition: all .2s var(--ease-soft);
}
.btn-modal-save:hover {
  background: var(--accent-active);
  transform: translateY(-1px);
}
.btn-modal-save:active {
  transform: scale(.98);
}

@media (max-width: 640px) {
  .modal-overlay {
    padding: 10px;
    align-items: flex-end;
  }
  .modal-dialog {
    max-height: 88vh;
    padding: 22px 18px 20px;
    border-radius: 24px 24px 18px 18px;
    margin-bottom: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  }
  .modal-title { font-size: 18px; }
  .modal-subtitle { font-size: 12px; }
  .modal-input { height: 46px; font-size: 16px; }
  .modal-actions {
    flex-direction: row;
    gap: 8px;
  }
  .btn-modal-cancel, .btn-modal-save {
    flex: 1;
    text-align: center;
    justify-content: center;
    height: 42px;
  }
}


