/* ═══════════════════════════════════════════════════════════════════════════
   LinkedIn Audience Analyzer — Design System
   ═══════════════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* Brand */
  --blue: #0A66C2;
  --blue-hover: #004182;
  --blue-light: #EFF6FF;
  --blue-dim: #DBEAFE;

  /* Semantic */
  --success: #16A34A;
  --warning: #D97706;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;

  /* Neutrals */
  --bg: #F0F2F5;
  --white: #FFFFFF;
  --border: #E5E7EB;
  --text: #111827;
  --text-2: #374151;
  --muted: #6B7280;
  --muted-light: #9CA3AF;
  --surface: #F9FAFB;

  /* Navbar */
  --nav-h: 56px;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════ NAVBAR ═══════════════════════════════════════════ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.navbar-inner {
  width: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--blue);
  color: var(--white);
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 6px;
  flex-shrink: 0;
}

.brand-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
}

.brand-sep {
  color: var(--muted-light);
  font-size: 0.875rem;
}

.brand-sub {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 400;
}

.navbar-how {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.navbar-how:hover {
  color: var(--blue);
}

/* ═══════════════════════ LAYOUT ═══════════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: calc(100vh - var(--nav-h));
}

/* ─────────────── SIDEBAR ─────────────── */

.sidebar {
  width: 320px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 24px;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}

.sidebar-sep {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.sidebar-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* ─────────────── MAIN CONTENT ─────────────── */

.main-content {
  flex: 1;
  min-width: 0;
  padding: 32px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - var(--nav-h));
}

/* ═══════════════════════ USAGE METER ══════════════════════════════════════ */

.usage-wrap {
  margin-bottom: 4px;
}

.usage-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.usage-label {
  font-size: 0.8125rem;
  color: var(--text-2);
}

.usage-dots {
  font-size: 0.875rem;
  letter-spacing: 2px;
  color: var(--blue);
  font-weight: 600;
}

.usage-dots.limit {
  color: var(--danger);
}

.usage-track {
  height: 6px;
  border-radius: 999px;
  background: #E5E7EB;
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  width: 0%;
  background: var(--blue);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.usage-fill.limit {
  background: var(--danger);
}

.usage-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.usage-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.upgrade-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue);
  padding: 0;
  font-family: inherit;
}

.upgrade-link:hover {
  text-decoration: underline;
}

/* Recent analyses */
.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recent-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.8125rem;
  color: var(--text-2);
  transition: background 0.15s;
}

.recent-list li a:hover {
  background: var(--surface);
}

.recent-list li .recent-url {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-list li .recent-date {
  color: var(--muted);
  font-size: 0.75rem;
}

/* ═══════════════════════ FORMS ════════════════════════════════════════════ */

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-2);
}

.email-badge {
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 4px;
}

.email-badge--optional {
  color: var(--muted);
}

.email-badge--required {
  color: var(--danger);
  font-weight: 600;
}

.field-optional {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}

.post-content-input {
  resize: vertical;
  min-height: 72px;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.field-required {
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--danger);
  margin-left: 4px;
  /* text-transform: uppercase; */
  letter-spacing: 0.03em;
  opacity: 0.85;
}

.input-row {
  position: relative;
}

.input,
.locked-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.input::placeholder {
  color: var(--muted-light);
}

.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.1);
}

.locked-input {
  background: var(--surface);
  color: var(--muted);
  cursor: default;
}

.valid-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  display: none;
  transition: opacity 0.15s;
}

.valid-icon.ok {
  display: block;
  color: var(--success);
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.inline-msg {
  margin-top: 5px;
  font-size: 0.75rem;
  min-height: 16px;
  color: var(--muted);
}

.inline-msg.error {
  color: var(--danger);
}

.inline-msg.ok {
  color: var(--success);
}

.inline-msg.success {
  color: var(--success);
}

/* ═══════════════════════ BUTTONS ══════════════════════════════════════════ */

.primary-btn {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.primary-btn:hover:not(:disabled) {
  background: var(--blue-hover);
}

.primary-btn:disabled {
  background: #93C5FD;
  cursor: not-allowed;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--white);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.ghost-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}

.stop-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 8px 16px;
  border: 1.5px solid var(--danger);
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.stop-btn:hover {
  background: var(--danger);
  color: #fff;
}

.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--blue);
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

/* ═══════════════════════ STATE VIEWS ══════════════════════════════════════ */

.state-view {
  display: none;
  opacity: 0;
  transform: translateY(6px);
}

.state-view.active {
  display: block;
  animation: slideUp 220ms ease forwards;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Email verify card ─── */
.main-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.06);
  padding: 28px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.section-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

.section-sub {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 12px;
}

.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ─── OTP card ─── */
.otp-card {
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding-top: 40px;
}

.otp-card.active {
  display: flex;
  animation: slideUp 220ms ease forwards;
}

.otp-card-inner {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 36px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.otp-email-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.otp-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--text);
}

.otp-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.otp-address {
  font-size: 0.875rem;
  color: var(--muted);
}

.otp-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.otp-cell {
  width: 48px;
  height: 56px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.otp-cell:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.12);
}

.otp-row.error {
  animation: shake 0.28s linear;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

.otp-tools {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.dim {
  color: var(--muted);
  font-size: 0.8125rem;
}

/* ═══════════════════════ EMPTY STATE ══════════════════════════════════════ */

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  min-height: 400px;
  gap: 12px;
}

.empty-icon {
  opacity: 0.7;
  margin-bottom: 8px;
}

.empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-2);
  margin: 0;
  max-width: 360px;
}

.empty-sub {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
  max-width: 400px;
  line-height: 1.55;
}

/* Hide empty state when any content is active */
.main-content:has(#stateEmail.active) .empty-state,
.main-content:has(#stateOtp.active) .empty-state,
.main-content:has(#stateAnalyzing.active) .empty-state,
.main-content:has(.log-card.active) .empty-state,
.main-content:has(.report-card.active) .empty-state {
  display: none !important;
}

/* ═══════════════════════ ANALYZING STATE ══════════════════════════════════ */

#stateAnalyzing.active {
  display: block;
}

.analyzing-card {
  background: var(--white);
  border-radius: 12px;
  border-left: 3px solid var(--blue);
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.analyzing-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.analyzing-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.85);
  }
}

.analyzing-titles {
  flex: 1;
}

.analyzing-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.analyzing-subtitle {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 2px;
  font-style: italic;
}

/* ── Progress steps ── */

.progress-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  animation: stepIn 220ms ease both;
}

.step-item:last-child {
  border-bottom: none;
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  transition: background 0.2s, border-color 0.2s;
}

.step-label {
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

/* Pending */
.step-pending .step-circle {
  border: 2px solid var(--border);
  background: transparent;
}

.step-pending .step-label {
  color: var(--muted-light);
}

/* Active */
.step-active .step-circle {
  border: 2px solid var(--blue);
  background: var(--blue-light);
  position: relative;
}

.step-active .step-circle::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  animation: pulse 1s ease-in-out infinite;
}

.step-active .step-label {
  color: var(--blue);
  font-weight: 600;
}

/* Complete */
.step-complete .step-circle {
  background: var(--success);
  border: 2px solid var(--success);
}

.step-complete .step-circle::after {
  content: '✓';
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
}

.step-complete .step-label {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--muted-light);
}

/* ═══════════════════════ LOG CARD ═════════════════════════════════════════ */

.log-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 16px 20px;
  display: none;
}

.log-card.active {
  display: block;
}

.log-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.log-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

pre#log {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 12px 14px;
  border-radius: 8px;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.75rem;
  line-height: 1.6;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* ═══════════════════════ REPORT CARD ══════════════════════════════════════ */

.report-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: none;
}

.report-card.active {
  display: block;
}

.report-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.report-title-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.report-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  flex: 1;
}

.meta-row {
  display: flex;
  align-items: baseline;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.meta-row-label {
  color: var(--muted);
  white-space: nowrap;
}

.meta-row-sep {
  color: var(--muted);
  padding: 0 4px;
}

.meta-row-val {
  color: var(--text);
  font-weight: 500;
}

.meta-url {
  color: var(--blue);
  text-decoration: none;
  word-break: break-all;
}

.meta-url:hover {
  text-decoration: underline;
}

.copy-md-inline {
  margin-left: 8px;
}

/* ── Report body ── */

.report-md {
  padding: 0 0 24px;
}

/* Default markdown styles (fallback before post-processing) */
.report-md h1,
.report-md h2,
.report-md h3 {
  padding: 16px 24px 0;
  margin: 0 0 8px;
}

.report-md h2 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
}

.report-md p {
  padding: 0 24px;
  margin: 6px 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-2);
}

.report-md ul,
.report-md ol {
  padding: 0 24px 0 44px;
  margin: 6px 0;
}

.report-md li {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-2);
}

.report-md hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 24px;
}

.report-md blockquote {
  margin: 12px 24px;
  padding: 12px 16px;
  background: #FFFBEB;
  border-left: 3px solid var(--warning);
  border-radius: 0 6px 6px 0;
  font-size: 0.875rem;
  color: #92400E;
}

.report-md code {
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.875em;
}

/* ─── Report sections ─── */

.report-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.report-section:last-child {
  border-bottom: none;
}

.report-section h2 {
  font-size: 0.6875rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.07em !important;
  text-transform: uppercase !important;
  color: var(--muted) !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
}

/* ── POST PERFORMANCE SNAPSHOT ── */

.rs-snapshot {
  background: var(--white);
}

.snapshot-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.sc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  border-left: 3px solid var(--border);
}

.sc-card--score {
  border-left-color: var(--blue);
}

.sc-card--segment {
  border-left-color: var(--success);
}

.sc-card--gap {
  border-left-color: var(--warning);
}

.sc-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.sc-value {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.sc-value--sm {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
}

.sc-denom {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
}

.sc-stat {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 2px;
}

.sc-dots {
  margin-top: 6px;
  letter-spacing: 1px;
  font-size: 0.875rem;
}

.dot-on {
  color: var(--blue);
}

.dot-off {
  color: var(--border);
}

/* ── TOP CONNECTIONS ── */

.rs-connections {
  background: var(--white);
}

.cc-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cc-card:last-child {
  margin-bottom: 0;
}

.cc-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(10, 102, 194, 0.1);
}

.cc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.cc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #E5E7EB;
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cc-info {
  flex: 1;
  min-width: 0;
}

.cc-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-role {
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-slug {
  display: block;
  font-size: 0.72rem;
  color: var(--blue);
  text-decoration: none;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  opacity: 0.85;
}

.cc-slug:hover {
  text-decoration: underline;
  opacity: 1;
}

.cc-detail {
  font-size: 0.8125rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 6px;
}

.cc-detail-key {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: capitalize;
}

.cc-message {
  background: var(--blue-light);
  border-left: 3px solid var(--blue);
  border-radius: 0 6px 6px 0;
  padding: 10px 12px;
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--text-2);
  line-height: 1.55;
  margin: 8px 0;
}

.cc-footer {
  margin-top: 10px;
  text-align: right;
}

.cc-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}

.cc-link:hover {
  text-decoration: underline;
}

/* ── WHAT TO FIX NEXT TIME ── */

.rs-fixes {
  background: var(--white);
}

.fix-item {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  list-style: none !important;
  text-indent: 0 !important;
}

.fix-item:last-child {
  border-bottom: none;
}

.fix-arrow-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.fix-body {
  flex: 1;
  min-width: 0;
}

.fix-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.fix-expl {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── AUDIENCE IN ONE LINE ── */

.rs-oneliner {
  background: var(--white);
}

.oneliner-p {
  background: var(--surface) !important;
  border-left: 2px solid var(--blue) !important;
  border-radius: 0 6px 6px 0 !important;
  padding: 12px 16px !important;
  font-size: 0.9375rem !important;
  font-style: italic !important;
  color: var(--text) !important;
  line-height: 1.6 !important;
  margin: 0 !important;
}

/* ═══════════════════════ FEEDBACK CARD ════════════════════════════════════ */

.feedback-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: none;
}

.feedback-card.active {
  display: block;
}

.feedback-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: color 0.15s, background 0.15s;
}

.feedback-toggle:hover {
  color: var(--blue);
  background: var(--blue-light);
}

.feedback-toggle-icon {
  font-size: 1rem;
  font-weight: 700;
  color: inherit;
  line-height: 1;
}

.feedback-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
}

.feedback-body.open {
  display: block;
}

.feedback-prompt {
  font-size: 0.875rem;
  color: var(--text-2);
  margin: 14px 0 10px;
  line-height: 1.5;
}

.feedback-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  background: var(--white);
}

.feedback-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.08);
}

.feedback-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.feedback-submit-btn {
  width: auto !important;
  padding: 0 20px !important;
  flex-shrink: 0;
  font-size: 0.875rem !important;
}

/* ═══════════════════════ WHATSAPP BUTTON ══════════════════════════════════ */

.support-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: #25D366;
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
}

.support-btn:hover {
  filter: brightness(0.93);
}

/* ── CREDIT BADGE ─────────────────────────────────────────────────────────── */

.credit-badge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #111827;
  color: #fff;
  border-radius: 14px;
  padding: 11px 15px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  z-index: 9999;
  min-width: 180px;
}

.credit-made {
  font-size: 0.775rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}

.credit-wa {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  font-family: inherit;
  text-align: left;
  transition: opacity 0.15s;
}

.credit-wa:hover {
  opacity: 0.75;
}

/* ═══════════════════════ RESPONSIVE — under 768px ═════════════════════════ */

@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }

  /* ── Sidebar ── */
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 14px;
  }

  /* Always show sidebar form on mobile too */
  .sidebar #stateUrl {
    display: block !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  /* ── Main content — tighter side gutters ── */
  .main-content {
    padding: 8px;
    padding-bottom: 88px;
    /* room for fixed credit badge */
    gap: 8px;
  }

  .brand-sub {
    display: none;
  }

  /* ── Report card header ── */
  .report-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 14px;
  }

  /* meta-url should not overflow narrow screens */
  .meta-url {
    max-width: 100%;
  }

  /* ── Report sections — reduce inner horizontal padding ── */
  .report-section {
    padding: 14px 12px;
  }

  /* ── Raw markdown fallback elements ── */
  .report-md h1,
  .report-md h2,
  .report-md h3 {
    padding: 10px 12px 0;
  }

  .report-md p {
    padding: 0 12px;
  }

  /* ── Snapshot cards — two-column on tablet, one-column on phone ── */
  .snapshot-cards {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .sc-card {
    padding: 10px 12px;
  }

  /* ── Connection cards ── */
  .cc-card {
    padding: 10px 12px;
  }

  /* Allow role to wrap instead of truncating with ellipsis */
  .cc-role {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  /* ── Input grid (email verify screen) ── */
  .input-grid {
    grid-template-columns: 1fr;
  }

  /* ── OTP card ── */
  .otp-cell {
    width: 40px;
    height: 50px;
    font-size: 1.125rem;
  }

  .otp-card-inner {
    padding: 24px 16px;
  }

  /* ── Analyzing card ── */
  .analyzing-card {
    padding: 14px 12px;
  }

  /* ── Feedback card ── */
  .feedback-toggle {
    padding: 12px 14px;
  }

  .feedback-body {
    padding: 0 14px 16px;
  }

  /* ── Report meta/log head ── */
  .report-head {
    padding: 12px 14px;
  }

  /* ── Compact the fixed credit badge ── */
  .credit-badge {
    bottom: 12px;
    right: 12px;
    padding: 8px 12px;
    gap: 3px;
    min-width: 0;
  }

  .credit-made {
    display: none;
  }

  .credit-wa {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .navbar-inner {
    padding: 0 12px;
  }

  .brand-name {
    display: none;
  }

  .brand-sep {
    display: none;
  }

  /* Single column snapshot on small phones */
  .snapshot-cards {
    grid-template-columns: 1fr;
  }

  .otp-cell {
    width: 36px;
    height: 44px;
    font-size: 1rem;
  }

  /* Even tighter credit badge on small phones */
  .credit-badge {
    bottom: 8px;
    right: 8px;
    padding: 7px 10px;
  }
}