:root {
  --ink: #11110F;
  --muted: #67665F;
  --border: #E7E6DF;
  --accent: #4C7ACE;
  --bg: #FFFFFF;
  --secondary: #FFCA0A;
  --surface: #F6F6F2;
}
:root[data-theme="dark"] {
  --ink: #FFFFFF;
  --muted: #999B92;
  --border: #42433D;
  --bg: #1A1B18;
  --surface: #1D1E1A;
}
:root[data-theme="dark"] .profile-btn-danger { background: rgba(230, 111, 81, 0.16); color: #DF795F; }
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
a { color: inherit; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

/* Announcement bar + floating header (landing, pricing) */
body.has-floating-header { padding-top: 96px; }

.announce-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 0 16px;
  z-index: 80;
}
.announce-bar a { color: var(--secondary); text-decoration: underline; margin-left: 4px; flex-shrink: 0; }

.floating-header {
  position: fixed;
  top: 38px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: 0;
  box-shadow: none;
  background: var(--bg);
  z-index: 70;
  transition: top 0.3s ease, max-width 0.3s ease, border-radius 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.floating-header.scrolled {
  top: 50px;
  width: calc(100% - 32px);
  max-width: 1120px;
  border-color: var(--border);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(17, 17, 15, 0.07);
}
@media (max-width: 720px) {
  .floating-header.scrolled { border-radius: 20px; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.brand span { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; color: var(--ink); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.nav-menu a {
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-menu a:hover { color: var(--ink); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-ghost {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface); }
.btn-dark {
  background: var(--ink);
  color: var(--bg);
}
.btn-dark:hover { opacity: 0.9; }
.btn-secondary {
  background: var(--secondary);
  color: #11110F;
}
.btn-secondary:hover { opacity: 0.9; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--ink);
  cursor: pointer;
  padding: 4px;
}

.nav-overlay { display: contents; }
.nav-overlay-close { display: none; }
.nav-overlay-actions { display: none; }

@media (max-width: 720px) {
  .header-actions { display: none; }
  .menu-toggle { display: inline-flex; }

  .nav-overlay {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 90;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.98);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }
  .nav-overlay.open {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
  }
  .nav-overlay-close {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    border: none;
    color: var(--ink);
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 24px;
  }

  .nav-menu {
    position: static;
    transform: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 0;
  }
  .nav-menu a {
    padding: 14px 0;
    width: 100%;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
  }

  .nav-overlay-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .nav-overlay-actions .btn { width: 100%; height: 48px; }
}

.validator-tool {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.validator-tool-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.validator-tool-box textarea {
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  min-height: 130px;
  max-height: 320px;
  width: 100%;
  overflow-y: auto;
}
.validator-tool-box textarea::placeholder { color: #99978F; }

.validator-tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.validator-cta {
  height: 46px;
  padding: 0 28px;
  border-radius: 10px;
  border: none;
  background: var(--secondary);
  color: #11110F;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.validator-cta:hover { opacity: 0.92; }
.validator-cta:disabled { opacity: 0.6; cursor: not-allowed; }

.validator-test-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.validator-test-link:hover { color: var(--ink); }
.validator-test-link:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 640px) {
  .validator-tool-footer { flex-direction: column-reverse; align-items: stretch; }
  .validator-cta { width: 100%; }
}

.private {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.private i { font-size: 18px; }

.private-popover {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  width: 280px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 32px rgba(17, 17, 15, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 20;
}
.private-popover.open,
.private:hover .private-popover { opacity: 1; visibility: visible; transform: translateY(0); }
.private-popover::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 18px;
  width: 12px;
  height: 12px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: translateY(-6px) rotate(45deg);
}
.private-popover-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.private-popover-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}
@media (max-width: 480px) {
  .private-popover { width: 240px; left: -8px; }
}

.switch {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 20px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: left 0.15s ease;
}
.switch.off { background: #DEDDD7; }
.switch.off::after { left: 2px; }

.btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(17, 17, 15, 0.25);
  border-top-color: #11110F;
  animation: foundly-spin 0.7s linear infinite;
}
@keyframes foundly-spin {
  to { transform: rotate(360deg); }
}

.idea-error {
  display: none;
  color: #E66F51;
  font-size: 13px;
  margin-top: 10px;
  text-align: left;
}

/* ---------- Idea validation progress animation ---------- */
.idea-progress-stage {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  width: 100%;
  max-width: 900px;
  margin: 24px auto 0;
  padding: 40px 24px;
  --ip-scale: 1.2;
}

@media (min-width: 400px) { .idea-progress-stage { --ip-scale: 1.35; } }
@media (min-width: 540px) { .idea-progress-stage { --ip-scale: 1.6; } }
@media (min-width: 700px) { .idea-progress-stage { --ip-scale: 1.8; } }
/* .app-main gains a 240px sidebar margin at this width — keep scale
   conservative right at the crossover so the animation still fits. */
@media (min-width: 861px) { .idea-progress-stage { --ip-scale: 1.8; } }
@media (min-width: 1024px) { .idea-progress-stage { --ip-scale: 2; } }
@media (min-width: 1280px) { .idea-progress-stage { --ip-scale: 2.2; } }
@media (min-width: 1600px) { .idea-progress-stage { --ip-scale: 2.4; } }

/* Outer frame: sizes/centers the visible animation area, scales responsively
   with --ip-scale. Inner .ip-anim-scaler stays a fixed 220x170 logical box
   (every stage's markup/JS is authored against that size) and is blown up
   visually via CSS transform, so every existing animation keeps working
   unchanged at any breakpoint or zoom level. Scale is capped so 220/170 * scale
   never exceeds this viewport's own box — otherwise the transform pushes
   content (map edges, floating avatars near the edge of their 220x170 box)
   past the clip boundary and it gets visibly cut off. */
.ip-anim-viewport {
  width: 100%;
  max-width: 560px;
  height: calc(170px * var(--ip-scale));
  max-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ip-anim-scaler {
  width: 220px;
  height: 170px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(var(--ip-scale));
}

.ip-dynamic-text {
  margin: 0;
  font-size: clamp(15px, 1.6vw, 19px);
  font-weight: 600;
  text-align: center;
  max-width: 420px;
  min-height: 40px;
  background-image: linear-gradient(
    100deg,
    var(--muted) 0%,
    var(--muted) 38%,
    var(--ink) 50%,
    var(--muted) 62%,
    var(--muted) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ip-text-shimmer 2s linear infinite;
}

@keyframes ip-text-shimmer {
  0% { background-position: 140% 0; }
  100% { background-position: -140% 0; }
}

/* Stage 1 — Understanding the idea: pulsing dot + expanding sonar waves */
.ip-understand {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ip-understand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  z-index: 1;
  animation: ip-understand-dot-pulse 1.8s ease-in-out infinite;
}
@keyframes ip-understand-dot-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.ip-understand-wave {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  animation: ip-understand-wave-expand 1.8s ease-out infinite;
}
.ip-understand-wave--1 { animation-delay: 0s; }
.ip-understand-wave--2 { animation-delay: 0.6s; }
.ip-understand-wave--3 { animation-delay: 1.2s; }
@keyframes ip-understand-wave-expand {
  0% { transform: scale(1); opacity: 0.65; }
  100% { transform: scale(4.2); opacity: 0; }
}

/* Stage 2 — Market sizing: world map with blinking countries + hotspots */
.ip-map-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}
.ip-map {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
}
.ip-map .jvm-zoom-btn { display: none; }
.ip-map-hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ip-map-hotspot {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--accent);
  animation: ip-hotspot-dot 2.6s ease-in-out infinite;
}
.ip-map-hotspot::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  animation: ip-hotspot-ping 2.6s ease-out infinite;
}
.ip-map-hotspot--a { top: 34%; left: 21%; animation-delay: 0s; }
.ip-map-hotspot--b { top: 27%; left: 49%; animation-delay: 0.6s; }
.ip-map-hotspot--c { top: 38%; left: 74%; animation-delay: 1.2s; }
.ip-map-hotspot--d { top: 62%; left: 32%; animation-delay: 1.8s; }
@keyframes ip-hotspot-dot {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  15%, 55% { opacity: 1; transform: scale(1); }
  80% { opacity: 0; transform: scale(0.8); }
}
@keyframes ip-hotspot-ping {
  0% { transform: scale(0.4); opacity: 0.9; }
  70%, 100% { transform: scale(2.4); opacity: 0; }
}

/* Stage 3 — Demand signals: orbiting particles around a rotating platform logo */
.ip-reddit {
  position: relative;
  width: 100px;
  height: 100px;
}
.ip-orbit-ring {
  position: absolute;
  inset: 3px;
  border: 1.5px dashed var(--border);
  border-radius: 50%;
  animation: ip-orbit-spin 7s linear infinite;
}
.ip-particle-orbit {
  position: absolute;
  inset: 0;
  animation: ip-orbit-spin linear infinite;
}
.ip-particle-orbit--a { inset: 0; animation-duration: 3.2s; }
.ip-particle-orbit--b { inset: 14px; animation-duration: 4.6s; animation-direction: reverse; }
.ip-particle-orbit--c { inset: -8px; animation-duration: 6s; }
.ip-particle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.85;
}
@keyframes ip-orbit-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.ip-logo-wrap {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  z-index: 2;
  animation: ip-logo-breathe 2.4s ease-in-out infinite;
}
.ip-signal-logo-img {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 66%;
  height: 66%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.ip-signal-logo-img.is-active { opacity: 1; }
@keyframes ip-logo-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Stage 4 — Customer profiling: real profile photos floating in/out */
.ip-profiles {
  position: relative;
  width: 100%;
  height: 100%;
}
.ip-profile-avatar {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--bg);
  background: var(--surface);
  opacity: 0;
  transform: scale(0.6);
  animation: ip-profile-float 3.6s ease-in-out infinite;
}
.ip-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ip-profile-avatar:nth-child(1) { animation-delay: 0s; }
.ip-profile-avatar:nth-child(2) { animation-delay: 0.5s; }
.ip-profile-avatar:nth-child(3) { animation-delay: 1s; }
.ip-profile-avatar:nth-child(4) { animation-delay: 1.5s; }
.ip-profile-avatar:nth-child(5) { animation-delay: 2s; }
.ip-profile-avatar:nth-child(6) { animation-delay: 2.5s; }
.ip-profile-avatar:nth-child(7) { animation-delay: 3s; }
@keyframes ip-profile-float {
  0% { opacity: 0; transform: scale(0.6); }
  18%, 72% { opacity: 1; transform: scale(1); }
  92%, 100% { opacity: 0; transform: scale(0.7); }
}

/* Stage 5 — Competitor scan: tiles popping in with real favicon logos */
.ip-competitors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ip-competitor-tile {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ip-tile-pop 3.6s ease-in-out infinite;
}
.ip-competitor-tile img {
  width: 62%;
  height: 62%;
  object-fit: contain;
}
@keyframes ip-tile-pop {
  0% { opacity: 0; transform: scale(0.7); }
  10%, 80% { opacity: 1; transform: scale(1); }
  94%, 100% { opacity: 0; transform: scale(0.85); }
}

/* Stage 6 — Business model: bars growing/shrinking in cascade */
.ip-viability {
  width: 100px;
  height: 90px;
}
.ip-viability-bar {
  fill: var(--border);
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: scaleY(0.2);
  animation: ip-viability-grow 2.8s ease-in-out infinite;
}
@keyframes ip-viability-grow {
  0%, 100% { transform: scaleY(0.2); fill: var(--border); }
  42%, 62% { transform: scaleY(var(--h)); fill: var(--green, #23885A); }
}

/* Stage 7 — Finalizing: opportunity gauge sweep */
.ip-gauge {
  width: 150px;
  height: 95px;
}
.ip-gauge-tick {
  transition: stroke 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
  .ip-anim-viewport * { animation: none !important; }
  .ip-dynamic-text {
    animation: none !important;
    background-image: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    color: var(--muted);
  }
}

/* ---------- Recent results ---------- */
.recent-section {
  width: 100%;
  max-width: 720px;
  margin-top: 40px;
}
.recent-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
}
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  background: var(--bg);
}
.recent-item:hover { background: var(--surface); }
.recent-info { flex: 1; min-width: 0; }
.recent-idea {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-verdict { font-size: 12px; color: var(--muted); margin-top: 2px; }
.recent-time { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.recent-item > i { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.recent-empty {
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

/* Mini arc gauge (semi-circle dial, e.g. Recent list, Library cards) */
.mini-arc {
  position: relative;
  width: 72px;
  flex-shrink: 0;
}
.mini-arc svg { display: block; width: 100%; height: auto; }
.mini-arc span {
  position: absolute;
  left: 0;
  right: 0;
  top: 82%;
  transform: translateY(-50%);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-card img.auth-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  margin-bottom: 24px;
}

.auth-card h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
}

.auth-choice { width: 100%; margin-bottom: 4px; }

.auth-btn {
  width: 100%;
  height: 52px;
  border-radius: 999px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 12px;
}
.auth-btn-google {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
}
.auth-btn-google:hover { background: var(--surface); }
.auth-btn-google img { width: 20px; height: 20px; }
.auth-btn-email {
  background: var(--ink);
  color: var(--bg);
}
.auth-btn-email:hover { opacity: 0.9; }

.auth-form { width: 100%; text-align: left; }

.form-field { margin-bottom: 14px; }
.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.form-field input {
  width: 100%;
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
}
.form-field input:disabled { opacity: 0.7; }
.form-field input:focus { border-color: var(--ink); }

.auth-submit {
  width: 100%;
  height: 50px;
  border-radius: 999px;
  border: none;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
}
.auth-submit:hover { opacity: 0.9; }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-message {
  width: 100%;
  font-size: 13px;
  line-height: 1.5;
  margin-top: 14px;
  text-align: left;
}
.auth-message.error { color: #E66F51; }
.auth-message.success { color: #23885A; }

/* ---------- Welcome onboarding ---------- */
.welcome-card { max-width: 420px; }
.welcome-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 28px; }
.welcome-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--border); transition: width 0.2s ease, background 0.2s ease; }
.welcome-dot.active { width: 18px; background: var(--ink); }

.welcome-steps { width: 100%; }

.welcome-step {
  display: none;
  width: 100%;
  position: relative;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.welcome-step.active { display: block; }
.welcome-step.slide-out-left { opacity: 0; transform: translateX(-24px); }
.welcome-step.slide-out-right { opacity: 0; transform: translateX(24px); }
.welcome-step.slide-in-left { opacity: 0; transform: translateX(-24px); }
.welcome-step.slide-in-right { opacity: 0; transform: translateX(24px); }

.welcome-prev {
  display: block;
  width: 100%;
  margin-top: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
}
.welcome-prev:hover { color: var(--ink); text-decoration: underline; }

.welcome-question {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  text-align: center;
}

.gender-grid { display: flex; gap: 14px; margin-bottom: 24px; }
.gender-option { flex: 1; cursor: pointer; }
.gender-card {
  background: var(--secondary);
  border-radius: 20px;
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 3px solid transparent;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.gender-option:hover .gender-card { transform: translateY(-2px); }
.gender-option.selected .gender-card { border-color: var(--ink); }
.gender-card img { width: 88px; height: 88px; object-fit: contain; margin-bottom: 10px; }
.gender-card span { font-size: 14px; font-weight: 700; color: #11110F; }

@media (max-width: 420px) {
  .gender-card img { width: 68px; height: 68px; }
  .welcome-question { font-size: 22px; }
}

.option-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.option-row:hover { background: var(--surface); }
.option-row.selected { border-color: var(--ink); background: var(--surface); }
.option-main { display: flex; align-items: center; gap: 12px; }
.option-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
  color: var(--ink);
  transition: background 0.15s ease;
}
.option-row.selected .option-icon { background: var(--secondary); }
.option-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.option-row.selected .option-check { background: var(--ink); border-color: var(--ink); }
.option-check svg { opacity: 0; transition: opacity 0.15s ease; }
.option-row.selected .option-check svg { opacity: 1; }
.option-list.multi .option-check { border-radius: 6px; }

.auth-terms {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 20px 0 0;
}
.auth-terms a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
}

.auth-switch {
  color: var(--muted);
  font-size: 14px;
  margin-top: 32px;
}
.auth-switch a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
}

/* ---------- App (sidebar layout) ---------- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  z-index: 50;
  transition: width 0.18s ease;
}

.app-main {
  margin-left: 240px;
  transition: margin-left 0.18s ease;
}

@media (min-width: 861px) {
  .sidebar.collapsed { width: 76px; }
  .sidebar.collapsed ~ .app-main { margin-left: 76px; }
  .sidebar.collapsed .sidebar-label { display: none; }
  .sidebar.collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .sidebar.collapsed .sidebar-nav a { justify-content: center; padding-left: 0; padding-right: 0; }
  .sidebar.collapsed .sidebar-profile-link { justify-content: center; padding-left: 0; padding-right: 0; }
  .sidebar.collapsed .sidebar-guest-actions { display: none !important; }
  .sidebar.collapsed .sidebar-collapse-btn { justify-content: center; padding-left: 0; padding-right: 0; }
  .sidebar.collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }
}

.sidebar .brand {
  padding: 8px 8px 20px;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.sidebar-nav-group-label {
  padding: 0 12px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sidebar-collapse-btn:hover { background: var(--surface); color: var(--ink); }
.sidebar-collapse-btn i { font-size: 15px; width: 15px; text-align: center; }
@media (max-width: 860px) {
  .sidebar-collapse-btn { display: none; }
}
.sidebar-nav-bottom {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.sidebar-profile-link { padding: 8px !important; }
.sidebar-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--secondary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sidebar-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-profile-avatar span { font-size: 13px; font-weight: 800; color: #11110F; }
.sidebar-profile-info { min-width: 0; }
.sidebar-profile-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-profile-plan {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 860px) {
  .sidebar-profile-link { padding: 10px !important; }
  .sidebar-profile-avatar { width: 40px; height: 40px; }
  .sidebar-profile-avatar span { font-size: 15px; }
  .sidebar-profile-name { font-size: 16px; }
  .sidebar-profile-plan { font-size: 13px; }
}

.sidebar-guest-actions { display: flex; flex-direction: column; gap: 10px; }
.sidebar-guest-actions .btn { width: 100%; }
.sidebar-user-actions { display: flex; flex-direction: column; }

.app-topbar-guest-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.plan-btn { border: none; width: 100%; font-family: inherit; cursor: pointer; }

.ph-head { display: flex; gap: 16px; align-items: flex-start; }
.ph-head-thumb { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex-shrink: 0; background: var(--surface); }
.ph-head-name { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 4px; }
.ph-head-tagline { font-size: 14px; color: var(--muted); margin: 0 0 10px; line-height: 1.4; }
.ph-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-topic-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
}

.ph-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
  margin: 20px 0;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ph-stat { text-align: center; }
.ph-stat-value { font-size: 17px; font-weight: 800; color: var(--ink); }
.ph-stat-value.ph-orange { color: #E66F51; }
.ph-stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

.ph-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); margin: 22px 0 10px; }
.ph-description { font-size: 14px; color: var(--ink); line-height: 1.6; white-space: pre-line; }

.ph-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.ph-media-item { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 4/3; background: var(--surface); display: block; }
.ph-media-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-media-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(17, 17, 15, 0.25); color: #FFFFFF; font-size: 22px; }

.ph-makers { display: flex; flex-direction: column; gap: 12px; }
.ph-maker { display: flex; gap: 10px; align-items: flex-start; }
.ph-maker-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--surface); }
.ph-maker-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.ph-maker-headline { font-size: 12px; color: var(--muted); margin-top: 1px; }
.ph-maker-links { display: flex; gap: 8px; margin-top: 4px; }
.ph-maker-links a { font-size: 11px; color: var(--accent); text-decoration: none; }
.ph-maker-links a:hover { text-decoration: underline; }

.ph-links-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.ph-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--ink);
}
.ph-link-btn:hover { background: var(--surface); }
.ph-link-btn.ph-link-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ph-link-btn.ph-link-primary:hover { opacity: 0.88; }

@media (max-width: 640px) {
  .ph-head { gap: 12px; }
  .ph-head-thumb { width: 52px; height: 52px; }
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.sidebar-nav a i { font-size: 17px; width: 17px; text-align: center; }
.sidebar-nav a:hover { background: var(--surface); color: var(--ink); }
.sidebar-nav a.active { background: var(--surface); color: var(--ink); }

.app-main {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}

.app-section { display: none; }
.app-section.active { display: block; }


.empty-state {
  margin: 24px;
  padding: 60px 24px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  text-align: center;
  color: var(--muted);
}
.empty-state i {
  font-size: 28px;
  color: var(--muted);
  margin-bottom: 12px;
  display: block;
}
.empty-state p { margin: 0; font-size: 15px; }

.access-locked {
  max-width: 420px;
  margin: 80px auto;
  padding: 0 24px;
  text-align: center;
}
.access-locked-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.access-locked h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 8px; }
.access-locked p { font-size: 14px; color: var(--muted); line-height: 1.5; margin: 0 0 24px; }
.access-locked-btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.access-locked-btn:hover { opacity: 0.9; }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 24px 24px 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg);
}
.dash-stat { padding: 22px 24px; border-right: 1px solid var(--border); }
.dash-stat:last-child { border-right: none; }
.dash-stat-label { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.dash-stat-accent { color: var(--ink); font-weight: 700; }
.dash-stat-num { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 6px; }
.dash-stat-desc { font-size: 12px; color: var(--muted); line-height: 1.4; margin: 0; }

.dash-carousel {
  position: relative;
  margin: 20px 24px 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg);
}
.dash-carousel-track { display: flex; transition: transform 0.3s ease; }
.dash-carousel-slide {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 28px 40px;
}
.dash-carousel-thumb {
  flex-shrink: 0;
  width: 380px;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
.dash-carousel-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dash-carousel-thumb-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 28px; }
.dash-carousel-body { min-width: 0; }
.dash-carousel-body h3 { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 8px; max-width: 520px; }
.dash-carousel-body p { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0 0 18px; max-width: 520px; }
.dash-carousel-btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.dash-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.dash-carousel-prev { left: 16px; }
.dash-carousel-next { right: 16px; }
.dash-carousel-dots { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 0 18px; }
.dash-carousel-dot { width: 7px; height: 7px; border-radius: 50%; border: none; background: var(--border); cursor: pointer; padding: 0; }
.dash-carousel-dot.active { background: var(--ink); width: 16px; border-radius: 4px; }

.dash-tools { padding: 32px 24px; }
.dash-tools-header h3 { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 4px; }
.dash-tools-header p { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.dash-tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.dash-tool-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: inherit;
  background: none;
  font-family: inherit;
  text-align: left;
  width: 100%;
}
.dash-tool-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--ink);
  font-size: 22px;
  margin-bottom: 4px;
}
.dash-tool-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.dash-tool-desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 0; flex: 1; }
.dash-tool-btn {
  display: inline-block;
  align-self: flex-start;
  margin-top: 4px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.dash-tool-btn:hover { background: var(--surface); }

@media (max-width: 1100px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-stat:nth-child(2) { border-right: none; }
  .dash-stat:nth-child(3), .dash-stat:nth-child(4) { border-top: 1px solid var(--border); }
  .dash-tools-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-carousel-thumb { width: 280px; }
}
@media (max-width: 640px) {
  .dash-stats { grid-template-columns: 1fr; margin: 16px 16px 0; }
  .dash-stat { border-right: none !important; border-top: 1px solid var(--border); }
  .dash-stat:first-child { border-top: none; }
  .dash-carousel { margin: 16px 16px 0; }
  .dash-carousel-slide { flex-direction: column; align-items: stretch; gap: 0; padding: 0; text-align: left; }
  .dash-carousel-thumb { width: 100%; aspect-ratio: 16 / 9; border-radius: 0; }
  .dash-carousel-body { padding: 20px; }
  .dash-carousel-nav { display: none; }
  .dash-tools { padding: 24px 16px; }
  .dash-tools-grid { grid-template-columns: 1fr; }
}

/* ---------- AI Assistant (floating widget) ---------- */
.ai-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: var(--bg);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(17, 17, 15, 0.25);
  z-index: 80;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.ai-fab:hover { transform: translateY(-2px); }
.ai-fab.open { background: var(--secondary); color: #11110F; }

.ai-panel {
  position: fixed;
  right: 24px;
  bottom: 92px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 140px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(17, 17, 15, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 79;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.ai-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.ai-panel-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ai-panel-header-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ai-panel-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.ai-panel-avatar img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.ai-panel-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.ai-panel-status { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.ai-panel-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.ai-panel-icon-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.ai-panel-icon-btn:hover { background: var(--surface); color: var(--ink); }

.ai-history {
  position: absolute;
  top: 58px;
  left: 8px;
  right: 8px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(17, 17, 15, 0.16);
  padding: 6px;
  z-index: 2;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.ai-history.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.ai-history-list { display: flex; flex-direction: column; gap: 2px; }
.ai-history-empty { padding: 10px; font-size: 13px; color: var(--muted); }
.ai-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
}
.ai-history-item:hover, .ai-history-item.active { background: var(--surface); }
.ai-history-item-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-history-item-delete {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.ai-history-item:hover .ai-history-item-delete { display: flex; }
.ai-history-item-delete:hover { background: var(--border); color: var(--ink); }

.ai-messages { flex: 1; overflow-y: auto; padding: 18px 16px; }
.ai-empty { text-align: center; margin-top: 8px; }
.ai-empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  font-size: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-empty h2 { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 6px; }
.ai-empty p { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0 0 18px; }
.ai-suggestions { display: flex; flex-direction: column; gap: 8px; }
.ai-suggestion-chip {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.ai-suggestion-chip:hover { border-color: var(--ink); }

.ai-msg { margin: 0 0 16px; display: flex; gap: 8px; }
.ai-msg-user { justify-content: flex-end; }
.ai-msg-user .ai-msg-bubble {
  max-width: 88%;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 13px;
  border-radius: 16px 16px 4px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.ai-msg-assistant { align-items: flex-start; }
.ai-msg-avatar {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.ai-msg-avatar img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.ai-msg-content { flex: 1; min-width: 0; }
.ai-msg-assistant .ai-msg-bubble {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
}
.ai-msg-markdown p { margin: 0 0 10px; }
.ai-msg-markdown p:last-child { margin-bottom: 0; }
.ai-msg-markdown h3, .ai-msg-markdown h4, .ai-msg-markdown h5 { margin: 14px 0 6px; font-weight: 800; letter-spacing: -0.01em; }
.ai-msg-markdown h3:first-child, .ai-msg-markdown h4:first-child, .ai-msg-markdown h5:first-child { margin-top: 0; }
.ai-msg-markdown ul, .ai-msg-markdown ol { margin: 0 0 10px; padding-left: 20px; }
.ai-msg-markdown li { margin-bottom: 4px; }
.ai-msg-markdown code { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ai-msg-markdown pre { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; overflow-x: auto; margin: 0 0 10px; }
.ai-msg-markdown pre code { background: none; border: none; padding: 0; }
.ai-msg-markdown a { color: var(--ink); text-decoration: underline; }
.ai-msg-error { color: #E66F51; font-size: 13px; }

.ai-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.ai-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: aiTypingBounce 1.1s infinite ease-in-out; }
.ai-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aiTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.ai-composer-wrap { flex-shrink: 0; padding: 10px 12px 12px; }
.ai-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg);
}
.ai-composer textarea {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  resize: none;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.5;
  max-height: 140px;
  padding: 6px 0;
}
.ai-composer textarea::placeholder { color: var(--muted); }
.ai-send-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.ai-send-btn:disabled { opacity: 0.3; cursor: default; }

@media (max-width: 480px) {
  .ai-fab { right: 16px; bottom: 16px; }
  .ai-panel {
    right: 12px;
    left: 12px;
    bottom: 84px;
    width: auto;
    max-width: none;
    height: auto;
    max-height: calc(100vh - 110px);
  }
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 20px 24px 24px;
}
.feed-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(17, 17, 15, 0.06);
}
.feed-card-site {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
}
.feed-card-favicon { width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0; object-fit: cover; }
.feed-card-site-text { min-width: 0; }
.feed-card-site-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-card-site-url {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-card-site:hover .feed-card-site-name { text-decoration: underline; }
.feed-card-desc-wrap {
  max-height: calc(2.8em + 12px);
  min-height: 0;
  flex-shrink: 0;
  overflow: hidden;
}
.feed-card-desc {
  padding: 0 14px 12px;
  font-size: 12px;
  color: var(--ink);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.feed-card-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 480px;
  background: #11110F;
  cursor: pointer;
}
.feed-card-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #11110F;
}
.feed-card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: rgba(17, 17, 15, 0.5);
  color: #FFFFFF;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.feed-card-play i { margin-left: 2px; }
.feed-card-video-wrap.is-playing .feed-card-play {
  opacity: 0;
  pointer-events: none;
}
.feed-card-video-wrap:not(.is-playing):hover .feed-card-play { transform: translate(-50%, -50%) scale(1.06); }
.feed-loading { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 14px; }

.lib-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 24px 0;
}
.lib-header-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 20px;
}
.lib-header-text {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.lib-header-text h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.lib-header-text span {
  color: var(--muted);
  font-size: 14px;
}

.validator-history-title {
  padding: 32px 24px 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.validator-open-btn {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: none;
  background: var(--secondary);
  color: #11110F;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.validator-open-btn i { display: inline-flex; align-items: center; font-size: 14px; line-height: 1; }
.validator-open-btn:hover { opacity: 0.92; }

.validator-inline-card {
  position: relative;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  margin: 20px 24px 24px;
}
@media (max-width: 640px) {
  .validator-inline-card { padding: 20px; margin: 16px 16px 20px; }
}

.ph-powered-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.ph-powered-logo { height: 16px; width: auto; display: block; }
.ph-powered-logo-dark { display: none; }
:root[data-theme="dark"] .ph-powered-logo-light { display: none; }
:root[data-theme="dark"] .ph-powered-logo-dark { display: block; }

.lib-maker-avatars { display: flex; align-items: center; }
.lib-maker-avatars img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg);
  margin-left: -8px;
  background: var(--surface);
}
.lib-maker-avatars img:first-child { margin-left: 0; }

.library-toolbar {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 24px 0;
}

.library-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 220px;
  padding: 0 16px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
}
.library-search i { color: var(--muted); font-size: 15px; flex-shrink: 0; }
.library-search input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
}
.library-search input::placeholder { color: var(--muted); }

.lib-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
}
.lib-filter-btn:hover { background: var(--surface); }
.lib-filter-btn i:first-child { font-size: 15px; color: var(--muted); }
.lib-filter-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--secondary);
}

.lib-filter-panel {
  display: none;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin: 12px 24px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.lib-filter-panel.open { display: flex; }
.lib-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}
.lib-filter-field label {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.lib-filter-field select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
}
.lib-filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.lib-filter-clear,
.lib-filter-apply {
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}
.lib-filter-clear {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
}
.lib-filter-clear:hover { background: var(--surface); }
.lib-filter-apply {
  border: none;
  background: var(--ink);
  color: var(--bg);
}
.lib-filter-apply:hover { opacity: 0.9; }

.lib-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 28px 24px 32px;
  flex-wrap: wrap;
}
.lib-page-btn, .lib-page-nav {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lib-page-btn:hover, .lib-page-nav:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.lib-page-btn.active {
  background: var(--secondary);
  color: #11110F;
  font-weight: 800;
}
.lib-page-nav { border-color: var(--border); color: var(--ink); }
.lib-page-nav:disabled { opacity: 0.35; cursor: default; }
.lib-page-nav:disabled:hover { background: transparent; }
.lib-page-ellipsis { color: var(--muted); font-size: 13px; padding: 0 4px; }

.library-table-wrap {
  margin: 12px 0 24px;
  border-top: 1px solid var(--border);
  overflow-x: auto;
}

.library-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 14px;
}
.library-table thead th {
  background: var(--surface);
  text-align: left;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.01em;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.library-table th.lib-sortable { cursor: pointer; user-select: none; }
.library-table th.lib-sortable:hover { color: var(--ink); }
.library-table th.lib-sortable.active { color: var(--ink); }
.lib-sort-icon { font-size: 11px; margin-left: 2px; opacity: 0.5; }
.library-table th.lib-sortable.active .lib-sort-icon { opacity: 1; }

.library-table tbody tr.library-row { border-bottom: 1px solid var(--border); cursor: pointer; }
.library-table tbody tr.library-row:last-child { border-bottom: none; }
.library-table tbody tr.library-row:hover { background: var(--surface); }
.library-table td { padding: 14px 24px; vertical-align: middle; }

.lib-detail-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--secondary);
  color: #11110F;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.lib-detail-cta:hover { opacity: 0.9; }

.lib-detail-powered {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.lib-modal-carousel {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
}
.lib-modal-carousel img {
  scroll-snap-align: start;
  flex: 0 0 auto;
  height: 130px;
  width: auto;
  max-width: 180px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--border);
}

.ph-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 15, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.ph-modal {
  position: relative;
  background: var(--bg);
  border-radius: 18px;
  padding: 28px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}
.ph-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ph-modal-close:hover { background: var(--border); }

@media (max-width: 640px) {
  .ph-modal { padding: 22px; max-height: 90vh; }
  .ph-modal-close { top: 12px; right: 12px; }
}

.lib-col-idea { max-width: 360px; }
.lib-idea-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lib-idea-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}
.lib-idea-icon i { display: flex; }
.lib-idea-thumb { object-fit: cover; padding: 0; }
.lib-idea-text { min-width: 0; }
.lib-idea-title {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}
.lib-idea-title:hover { text-decoration: underline; }
.lib-idea-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
  margin-top: 2px;
}

.lib-col-score { white-space: nowrap; }
.lib-col-score .mini-arc { width: 56px; }
.lib-col-score .mini-arc span { font-size: 12px; }

.lib-col-mrr { white-space: nowrap; }

.lib-col-metric { white-space: nowrap; text-align: center; }
.lib-metric-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.lib-metric-cell .so-score-gauge { position: relative; width: 48px; }
.lib-metric-cell .so-score-gauge svg { display: block; width: 100%; height: auto; }
.lib-metric-cell .so-score-pct { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 11px; font-weight: 800; color: var(--ink); }
.lib-metric-cell .so-gauge { position: relative; width: 48px; }
.lib-metric-cell .so-gauge svg { display: block; width: 100%; height: auto; }
.lib-metric-cell .so-num { font-size: 11px; color: var(--ink); }
.lib-metric-cell .so-bars { display: flex; align-items: flex-end; gap: 2px; height: 20px; width: 48px; }
.lib-metric-cell .so-bars div { flex: 1; background: #4C7ACE; border-radius: 1px 1px 0 0; }
.lib-metric-cell .so-demand-bars { display: flex; align-items: flex-end; gap: 2px; height: 20px; width: 48px; }
.lib-metric-cell .so-demand-bar { flex: 1; height: 100%; border-radius: 2px; background: var(--surface); border: 1px solid var(--border); }
.lib-metric-cell .so-demand-bar.filled { background: #4C7ACE; border-color: transparent; }
.lib-metric-cell .so-linechart { display: block; width: 48px; height: 20px; }
.lib-metric-cell .so-diffbars { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 20px; width: 48px; }
.lib-metric-cell .so-diffbar { flex: 1; max-width: 10px; border-radius: 1px 1px 0 0; background: var(--surface); border: 1px solid var(--border); }
.lib-metric-cell .so-diffbar.filled { border-color: transparent; }

@media (max-width: 640px) {
  .lib-header { padding: 20px 16px 0; }
  .library-toolbar { margin: 20px 16px 0; }
  .library-search { min-width: 0; flex-basis: 100%; }
  .library-table-wrap { margin: 12px 0 20px; }
  .lib-filter-panel { margin: 12px 16px 0; }
}

.library-tag {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}

.ph-votes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #E66F51;
  white-space: nowrap;
}
.ph-votes i { font-size: 11px; }

.lib-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
}
.lib-rating i { font-size: 11px; color: #FFCA0A; }

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--ink);
  cursor: pointer;
  padding: 4px;
}

.sidebar-close {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: none;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
}

.app-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.app-topbar .brand img { width: 24px; height: 24px; }
.app-topbar .brand span { font-size: 16px; }

body.no-scroll { overflow: hidden; }

@media (max-width: 860px) {
  .app-main { margin-left: 0; padding-top: 56px; }

  .app-topbar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: var(--bg);
  }
  .sidebar-toggle { display: inline-flex; }

  .sidebar {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    border-right: none;
    background: var(--bg);
    z-index: 70;
    display: flex;
    flex-direction: column;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.98);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }
  .sidebar.open {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
  }
  .sidebar .brand { display: none; }
  .sidebar-close { display: flex; }

  .sidebar-nav-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .sidebar-nav {
    gap: 4px;
  }
  .sidebar-nav a {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.01em;
    padding: 16px 10px;
    gap: 16px;
    color: var(--ink);
    border-radius: 14px;
  }
  .sidebar-nav a i { font-size: 24px; width: 24px; color: var(--muted); }
  .sidebar-nav a.active { background: var(--surface); }

  .sidebar-bottom { margin-top: 0; flex-shrink: 0; }

  .sidebar-nav-group-label { font-size: 13px; padding: 0 10px 10px; }

  .sidebar-profile-link { padding: 14px !important; }
  .sidebar-profile-avatar { width: 48px; height: 48px; }
  .sidebar-profile-avatar span { font-size: 18px; }
  .sidebar-profile-name { font-size: 18px; }
  .sidebar-profile-plan { font-size: 14px; }
}

/* ---------- Plans (mandatory subscription page) ---------- */
.plans-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.plans-topbar-actions { display: flex; align-items: center; gap: 16px; }
.plans-back-link {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.plans-back-link:hover { text-decoration: underline; }
.plans-logout-link {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.plans-logout-link:hover { color: var(--ink); }
.plans-msg {
  text-align: center;
  color: #E66F51;
  font-size: 13px;
  margin: 20px 0 0;
  min-height: 18px;
}

/* ---------- Pricing ---------- */
.pricing-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

.pricing-hero {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 48px;
}
.pricing-hero h1 {
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
.pricing-hero p {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
  line-height: 1.5;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}

.plan-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
.plan-card.popular {
  border: 2px solid var(--secondary);
  box-shadow: 0 12px 32px rgba(255, 202, 10, 0.18);
}

.plan-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--secondary);
  color: #11110F;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 0;
}
.plan-badge i { font-size: 13px; }

.plan-body {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.plan-name {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 6px;
}

.plan-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 20px;
  min-height: 38px;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}
.plan-price .amount {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.plan-price .period {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.plan-credits {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 20px;
}

.plan-btn {
  display: block;
  width: 100%;
  text-align: center;
  height: 44px;
  line-height: 44px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.plan-btn:hover { opacity: 0.9; }
.plan-btn-popular { background: var(--secondary); color: #11110F; }

.plan-whats-inside {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 24px 0 4px;
}

.plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.plan-features li:first-child { border-top: none; }
.plan-features li i {
  color: #7D6507;
  font-size: 13px;
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .pricing-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
}
@media (max-width: 560px) {
  .pricing-wrap { padding: 40px 20px 64px; }
}

/* FAQ */
.faq-section {
  max-width: 720px;
  margin: 96px auto 0;
}
.faq-section h2 {
  text-align: center;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 20px;
  background: var(--bg);
}
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: none;
  border: none;
  padding: 18px 0;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
}
.faq-q i {
  color: var(--muted);
  font-size: 14px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-item.open .faq-q i { transform: rotate(180deg); }
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-a-inner { overflow: hidden; }
.faq-a p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 18px;
}

/* Footer */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 64px 24px 32px;
  margin-top: 96px;
}
.footer-top {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 48px;
}
.footer-brand .brand { margin-bottom: 12px; }
.footer-brand p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  max-width: 260px;
}
.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 16px;
}
.footer-col {
  display: flex;
  flex-direction: column;
}
.footer-col a {
  display: block;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  padding: 6px 0;
}
.footer-col a:hover { color: var(--ink); }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-bottom p { margin: 0; color: var(--muted); font-size: 13px; }
.footer-social { display: flex; gap: 14px; }
.footer-social a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
}
.footer-social a:hover { background: var(--surface); }

@media (max-width: 900px) {
  .footer-top { grid-template-columns: repeat(3, 1fr); }
  .footer-brand { grid-column: 1 / -1; margin-bottom: 8px; }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Profile ---------- */
.profile-identity {
  display: flex;
  align-items: center;
  gap: 18px;
}

.avatar-upload {
  position: relative;
  flex-shrink: 0;
}
.avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.avatar-circle span { font-size: 24px; font-weight: 800; color: #11110F; }
.avatar-edit {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  border: 2px solid var(--bg);
}

.profile-identity-info { min-width: 0; }
.profile-name { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.profile-email { font-size: 13px; color: var(--muted); margin-top: 3px; }
.profile-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.profile-btn {
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: none;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.profile-btn:hover { opacity: 0.9; }
.profile-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.profile-btn-ghost { background: var(--surface); color: var(--ink); }
.profile-btn-danger { background: #FFE1D4; color: #E66F51; }

.profile-msg {
  font-size: 13px;
  margin: 10px 0 0;
  display: none;
}
.profile-msg.visible { display: block; }
.profile-msg.error { color: #E66F51; }
.profile-msg.success { color: #23885A; }

/* Card system used throughout the redesigned settings page — every group
   (profile, name, password, preferences, danger zone) is its own bordered
   card instead of one long list separated by thin dividers. */
.set-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 16px;
}
.set-card-profile {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface);
}
.set-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}
.set-card-title { font-size: 14.5px; font-weight: 700; }
.set-card-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.set-toggle-btn {
  flex-shrink: 0;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.set-toggle-btn:hover { background: var(--surface); }

.set-inline-form { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.set-inline-form .set-input { flex: 1; min-width: 160px; }
.set-inline-form .profile-btn { flex-shrink: 0; }
.set-input {
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
}
.set-input:focus { border-color: var(--ink); }

.set-password-form { margin-top: 16px; }

.set-card-danger {
  border-color: rgba(230, 111, 81, 0.35);
  background: rgba(230, 111, 81, 0.05);
}

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}
.pref-row:first-child { padding-top: 4px; }
.pref-row:last-child { padding-bottom: 0; }
.pref-row + .pref-row { border-top: 1px solid var(--border); }
.pref-name { font-size: 14px; font-weight: 600; }
.pref-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }

.danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}
.danger-row:first-child { padding-top: 4px; }
.danger-row:last-child { padding-bottom: 0; }
.danger-row:not(:last-of-type) { border-bottom: 1px solid rgba(230, 111, 81, 0.25); }
.danger-row .profile-btn-danger { flex-shrink: 0; }

@media (max-width: 480px) {
  .danger-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .set-card-profile { flex-direction: column; align-items: flex-start; }
}

/* ---------- Settings page ---------- */
.settings-shell { display: flex; align-items: flex-start; min-height: 100%; }

.settings-side {
  width: 240px;
  flex-shrink: 0;
  padding: 24px 16px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.settings-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding: 0 8px;
}
.settings-back i { font-size: 14px; }

.settings-side-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.settings-side-nav a i { font-size: 16px; width: 17px; text-align: center; }
.settings-side-nav a:hover { background: var(--surface); color: var(--ink); }
.settings-side-nav a.active { background: var(--surface); color: var(--ink); }
.settings-side-nav a.settings-side-danger { color: #E66F51; }
:root[data-theme="dark"] .settings-side-nav a.settings-side-danger { color: #DF795F; }
.settings-side-nav a.settings-side-danger.active { background: #FFE1D4; }
:root[data-theme="dark"] .settings-side-nav a.settings-side-danger.active { background: rgba(230, 111, 81, 0.16); }

.settings-side-logout {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: none;
  background: none;
  color: #E66F51;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border-radius: 10px;
}
.settings-side-logout:hover { background: var(--surface); }
:root[data-theme="dark"] .settings-side-logout { color: #DF795F; }

.settings-content { flex: 1; min-width: 0; max-width: 640px; padding: 40px 40px 60px; }
.settings-pane { display: none; }
.settings-pane.active { display: block; }
.settings-pane h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
.settings-pane-desc { color: var(--muted); font-size: 14px; margin: 0 0 28px; }
.settings-divider { height: 1px; background: var(--border); margin: 24px 0; }
.settings-subhead { font-size: 15px; font-weight: 700; margin: 0 0 16px; }
.settings-subhead-danger { color: #E66F51; }
:root[data-theme="dark"] .settings-subhead-danger { color: #DF795F; }

/* Premium branded hero card for the current plan — deliberately inverted
   (dark card, light text) so Billing reads as a "this is the important
   card on this page" moment instead of just another bordered box. */
.billing-hero {
  padding: 26px;
  border-radius: 20px;
  background: var(--ink);
  color: var(--bg);
  margin-bottom: 10px;
}
.billing-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.billing-hero-label { font-size: 12px; color: rgba(255,255,255,0.6); margin-bottom: 4px; }
:root[data-theme="dark"] .billing-hero-label { color: rgba(17,17,15,0.55); }
.billing-hero-plan { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.billing-hero-grid {
  display: flex;
  gap: 32px;
  padding-top: 18px;
  margin-bottom: 22px;
  border-top: 1px solid rgba(255,255,255,0.14);
}
:root[data-theme="dark"] .billing-hero-grid { border-top-color: rgba(17,17,15,0.14); }
.billing-hero-stat { display: flex; flex-direction: column; gap: 4px; }
.billing-hero-stat-label { font-size: 12px; color: rgba(255,255,255,0.6); }
:root[data-theme="dark"] .billing-hero-stat-label { color: rgba(17,17,15,0.55); }
.billing-hero-stat-value { font-size: 15px; font-weight: 700; }
.billing-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.billing-hero-actions .profile-btn { background: var(--bg); color: var(--ink); }
.billing-hero-actions .profile-btn-ghost { background: transparent; color: var(--bg); border: 1px solid rgba(255,255,255,0.3); }
:root[data-theme="dark"] .billing-hero-actions .profile-btn-ghost { color: var(--ink); border-color: rgba(17,17,15,0.3); }

.billing-table-wrap { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.billing-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.billing-table th {
  text-align: left;
  padding: 10px 16px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}
.billing-table td { padding: 12px 16px; border-top: 1px solid var(--border); color: var(--ink); }
.billing-status-pill {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

@media (max-width: 480px) {
  .billing-hero-grid { gap: 20px; }
  .billing-hero-actions { flex-direction: column; }
  .billing-hero-actions .profile-btn { width: 100%; }
}

@media (max-width: 860px) {
  .settings-shell { flex-direction: column; }
  .settings-side {
    width: 100%;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
    overflow-x: auto;
    gap: 12px;
  }
  .settings-back { padding: 0; flex-shrink: 0; }
  .settings-side-nav { flex-direction: row; flex-shrink: 0; }
  .settings-side-nav a { white-space: nowrap; }
  .settings-side-logout { margin-top: 0; flex-shrink: 0; white-space: nowrap; }
  .settings-content { padding: 24px 16px 40px; max-width: none; }
}

/* ---------- Inline report viewer (view-result / view-idea shown inside /app) ---------- */
#view-report {
  --report-card: #FFFFFF;
  --green: #23885A;
  --green-bg: #DFF5E8;
  --orange: #DBB52D;
  --orange-bg: #FFE1D4;
  --red: #E66F51;
  --red-bg: #FFE1D4;
  --blue: #4C7ACE;
  --track: #E7E6DF;
  --chart-bar-bg: #B9CEF9;
  background: var(--bg);
  position: relative;
  min-height: 100vh;
}
:root[data-theme="dark"] #view-report {
  --report-card: #1A1B18;
  --green-bg: rgba(35, 136, 90, 0.16);
  --orange-bg: rgba(219, 181, 45, 0.16);
  --red-bg: rgba(230, 111, 81, 0.16);
  --track: #42433D;
  --chart-bar-bg: #233E53;
}

#view-report .report {
  max-width: none;
  margin: 0;
  padding: 24px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Makes these wrapper divs participate in the grid as if their .card
   children were direct grid items, instead of collapsing them all into a
   single grid cell/column. */
#personalReport, #libraryReport { display: contents; }
#personalReport[hidden], #libraryReport[hidden] { display: none; }
#view-report .idea-header-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
#view-report .idea-header-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  background: var(--surface);
  border: 1px solid var(--border);
}
#view-report .idea-header-icon i { display: flex; }
#view-report .idea-header-text { min-width: 0; }
#view-report .idea-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0;
}
#view-report .idea-description {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 8px 0 0;
}
@media (max-width: 560px) {
  #view-report .idea-header-icon { width: 44px; height: 44px; border-radius: 13px; font-size: 19px; }
  #view-report .idea-title { font-size: 19px; }
}

#view-report .report-topbar {
  max-width: none;
  margin: 0;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
#view-report .report-topbar a {
  color: var(--ink);
  font-weight: 400;
  text-decoration: underline;
}
#view-report .report-topbar a:hover { opacity: 0.75; }
#view-report .report-topbar .crumb-sep { font-size: 11px; color: var(--muted); }
#view-report .report-topbar .crumb-current { color: var(--ink); font-weight: 400; }

#view-report .card {
  background: var(--report-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 22px;
}

#view-report .qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
#view-report .qa-item { }
#view-report .qa-q { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
#view-report .qa-a { font-size: 13px; color: var(--ink); line-height: 1.55; margin: 0; }
@media (max-width: 480px) {
  #view-report .qa-grid { grid-template-columns: 1fr; }
}

#view-report .section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 18px;
}
#view-report .section-title i { font-size: 15px; color: var(--muted); }
#view-report .section-title .brand-tag {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
#view-report .brand-tag img { width: auto; height: 13px; display: block; }

#view-report p.lead { font-size: 14px; line-height: 1.6; color: var(--ink); margin: 0; }

#view-report .so-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
#view-report .so-cell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
#view-report .so-cell:nth-child(4n) { border-right: none; }
#view-report .so-cell:nth-child(n+5) { border-bottom: none; }
#view-report .so-label { font-size: 12px; font-weight: 400; color: var(--muted); }
#view-report .so-num { font-size: 13px; font-weight: 600; color: var(--ink); }
#view-report .so-plain { font-size: 15px; font-weight: 400; color: var(--ink); }

#view-report .so-score-gauge,
#view-report .so-gauge,
#view-report .so-bars,
#view-report .so-demand-bars,
#view-report .so-linechart,
#view-report .so-diffbars {
  width: 84px;
}
#view-report .so-score-gauge { position: relative; }
#view-report .so-score-gauge svg { display: block; width: 100%; height: auto; }
#view-report .so-score-pct { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 17px; font-weight: 800; color: var(--ink); }
#view-report .so-gauge { position: relative; }
#view-report .so-gauge svg { display: block; width: 100%; height: auto; }

#view-report .so-bars { display: flex; align-items: flex-end; gap: 3px; height: 28px; }
#view-report .so-bars div { flex: 1; background: #4C7ACE; border-radius: 2px 2px 0 0; }

#view-report .so-demand-bars { display: flex; align-items: flex-end; gap: 3px; height: 24px; }
#view-report .so-demand-bar { flex: 1; height: 100%; border-radius: 3px; background: var(--surface); border: 1px solid var(--border); }
#view-report .so-demand-bar.filled { background: #4C7ACE; border-color: transparent; }

#view-report .so-linechart { display: block; height: 32px; }

#view-report .so-diffbars { display: flex; align-items: flex-end; gap: 6px; height: 28px; }
#view-report .so-diffbar { flex: 1; border-radius: 2px 2px 0 0; background: var(--surface); border: 1px solid var(--border); }
#view-report .so-diffbar.filled { border-color: transparent; }

@media (max-width: 900px) {
  #view-report .so-grid { grid-template-columns: repeat(2, 1fr); }
  #view-report .so-cell:nth-child(4n) { border-right: 1px solid var(--border); }
  #view-report .so-cell:nth-child(2n) { border-right: none; }
  #view-report .so-cell:nth-child(n+5) { border-bottom: 1px solid var(--border); }
  #view-report .so-cell:nth-child(n+7) { border-bottom: none; }
}
@media (max-width: 420px) {
  #view-report .so-grid { grid-template-columns: 1fr; }
  #view-report .so-cell { border-right: none !important; border-bottom: 1px solid var(--border); }
  #view-report .so-cell:last-child { border-bottom: none; }
}

#view-report .reddit-list { display: flex; flex-direction: column; gap: 12px; }
#view-report .reddit-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  background: var(--report-card);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
#view-report .reddit-card:hover { box-shadow: 0 8px 20px rgba(17, 17, 15, 0.06); border-color: var(--muted); }
#view-report .reddit-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
#view-report .reddit-icon-img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
#view-report .reddit-head .sub { font-size: 12px; font-weight: 700; }
#view-report .reddit-head .site { font-size: 11px; color: var(--muted); }
#view-report .reddit-card h5 { margin: 0; font-weight: 700; line-height: 1.4; color: var(--ink); }
#view-report .reddit-reactions { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); font-weight: 600; }
#view-report .reddit-reactions span { display: flex; align-items: center; gap: 5px; }
#view-report .reddit-reactions i { font-size: 14px; }
#view-report .comm-note { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 12px 0 0; }

#view-report .evidence-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  #view-report .evidence-row { grid-template-columns: 1fr; }
}

#view-report .advantage-risks-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  #view-report .advantage-risks-row { grid-template-columns: 1fr; }
}

#view-report .map-box {
  width: calc(100% + 44px);
  margin: 0 -22px 16px;
  aspect-ratio: 16 / 9;
  background: var(--report-card);
  position: relative;
  overflow: hidden;
}
#view-report .map-box svg { display: block; width: 100%; height: 100%; }
#view-report .country-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
#view-report .country-flag { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(17, 17, 15, 0.06); }
#view-report .country-name { width: 92px; flex-shrink: 0; color: var(--ink); }
#view-report .country-bar-track { flex: 1; height: 6px; background: var(--surface); border-radius: 999px; overflow: hidden; }
#view-report .country-bar-fill { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
#view-report .country-val { width: 34px; text-align: right; color: var(--muted); font-size: 12px; flex-shrink: 0; }
#view-report .reco-box { margin-top: 14px; padding: 12px; background: var(--surface); border-radius: 10px; font-size: 13px; color: var(--muted); line-height: 1.5; }
#view-report .reco-box b { color: var(--ink); }

#view-report .market-customer-row {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  #view-report .market-customer-row { grid-template-columns: 1fr; }
}

#view-report .market-meta-row { display: flex; gap: 32px; }
#view-report .market-meta-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 5px; }
#view-report .market-meta-value { font-size: 14px; font-weight: 700; }

#view-report .trend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin: 0 -12px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}
#view-report .trend-row:not(:last-of-type) { border-bottom: 1px solid var(--border); }
#view-report .trend-row:hover { background: var(--surface); }
#view-report .trend-row span { font-size: 13px; font-weight: 400; }
#view-report .trend-row svg { width: 90px; height: 32px; flex-shrink: 0; }

#view-report .show-more {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 14px;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}
#view-report .show-more:hover { background: var(--border); }

#view-report .bars-chart { display: flex; align-items: flex-end; gap: 4px; height: 70px; margin-bottom: 14px; }
#view-report .bars-chart div { flex: 1; background: var(--blue); border-radius: 3px 3px 0 0; opacity: 0.85; }
#view-report .field-label { font-size: 13px; font-weight: 700; color: var(--ink); text-transform: none; letter-spacing: 0; margin: 14px 0 6px; }
#view-report .field-label:first-of-type { margin-top: 0; }
#view-report .age-value, #view-report .gender-value { font-size: 14px; font-weight: 400; }
#view-report .chip-box { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 6px; }

#view-report .sat-competition-row {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 16px;
  align-items: start;
}
#view-report .saturation-card, #view-report .competition-card {
  border: 1px solid var(--border);
  border-radius: 16px;
}
#view-report .sat-labels-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
#view-report .sat-gauge { width: 100%; max-width: 220px; margin: 0 auto; }
#view-report .sat-gauge svg { display: block; width: 100%; height: auto; }
#view-report .sat-value-row { display: flex; justify-content: center; margin-top: 6px; }
#view-report .count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
#view-report .competitor-table-wrap { overflow-x: auto; }
#view-report .competitor-table { width: 100%; min-width: 460px; border-collapse: collapse; }
#view-report .competitor-table td { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
#view-report .competitor-table tr:last-child td { border-bottom: none; }
#view-report .comp-td-name { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
#view-report .comp-favicon { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
#view-report .comp-td-name a { color: var(--accent); text-decoration: none; }
#view-report .comp-td-name a:hover { text-decoration: underline; }
#view-report .comp-td-desc { color: var(--muted); max-width: 360px; }
#view-report .comp-td-price { color: var(--ink); white-space: nowrap; text-align: right; }
#view-report .demand-table .comp-td-desc { color: var(--ink); }
#view-report .demand-source { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
#view-report .demand-table .demand-source-name { font-size: 13px; color: var(--ink); font-weight: 400; }
#view-report .demand-table .demand-source-sub { font-size: 11px; color: var(--muted); }
#view-report .comp-td-link { width: 32px; text-align: right; }
#view-report .comp-td-link a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
}
#view-report .comp-td-link a:hover { background: var(--surface); color: var(--ink); }
@media (max-width: 900px) {
  #view-report .sat-competition-row { grid-template-columns: 1fr; }
}

#view-report .adv-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
#view-report .adv-row:last-child { border-bottom: none; }
#view-report .adv-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  flex-shrink: 0;
}
#view-report .adv-icon-high { background: var(--green-bg); color: var(--green); }
#view-report .adv-icon-medium { background: var(--orange-bg); color: var(--orange); }
#view-report .adv-icon-low { background: var(--surface); color: var(--muted); }
#view-report .adv-row-text { font-size: 14px; color: var(--ink); line-height: 1.5; }

#view-report .revpot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: 24px;
  margin-bottom: 20px;
}
#view-report .revpot-label { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
#view-report .revpot-minmax { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
#view-report .revpot-box {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--report-card, transparent);
  box-sizing: border-box;
}
#view-report .revpot-box:focus { outline: none; border-color: var(--accent, #4C7ACE); }
#view-report .revpot-result {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}
:root[data-theme="dark"] #view-report .revpot-result { background: rgba(255, 255, 255, 0.04); }
#view-report .revpot-result-label { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
#view-report .revpot-result-value { font-size: 26px; font-weight: 700; color: var(--ink); }
#view-report .revpot-result-value .unit { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 2px; }
#view-report .revpot-result-arr { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
@media (max-width: 780px) {
  #view-report .revpot-grid { grid-template-columns: 1fr; gap: 20px; }
}
#view-report .slider-track { position: relative; height: 4px; background: var(--border); border-radius: 999px; }
#view-report .slider-fill { position: absolute; top: 0; left: 0; height: 100%; background: var(--blue); border-radius: 999px; }
#view-report .slider-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px var(--blue);
  pointer-events: none;
}
#view-report .slider-input {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 24px;
  margin: 0;
  transform: translateY(-50%);
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
#view-report .slider-input::-webkit-slider-runnable-track { background: transparent; }
#view-report .slider-input::-moz-range-track { background: transparent; }
#view-report .slider-input::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; background: transparent; }
#view-report .slider-input::-moz-range-thumb { width: 20px; height: 20px; border: none; background: transparent; }
#view-report .mono-bars { display: flex; align-items: flex-end; gap: 5px; height: 50px; margin-top: 14px; }
#view-report .mono-bars div { flex: 1; background: var(--blue); border-radius: 3px 3px 0 0; }

#view-report .risk-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
#view-report .risk-row:last-child { border-bottom: none; }
#view-report .risk-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  flex-shrink: 0;
}
#view-report .risk-icon-high { background: var(--red-bg); color: var(--red); }
#view-report .risk-icon-medium { background: var(--orange-bg); color: var(--orange); }
#view-report .risk-icon-low { background: var(--green-bg); color: var(--green); }
#view-report .risk-row-text { font-size: 14px; color: var(--ink); line-height: 1.5; }

#view-report .badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
#view-report .badge-high { background: var(--red-bg); color: var(--red); }
#view-report .badge-medium { background: var(--orange-bg); color: var(--orange); }
#view-report .badge-low { background: var(--green-bg); color: var(--green); }
#view-report .badge-pos-high { background: var(--green-bg); color: var(--green); }
#view-report .badge-pos-medium { background: var(--orange-bg); color: var(--orange); }
#view-report .badge-pos-low { background: var(--surface); color: var(--muted); }

#view-report .report-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 40;
}
#view-report .report-empty {
  max-width: 400px;
  margin: 80px auto;
  text-align: center;
  padding: 0 24px;
}
#view-report .loading-arc { width: 120px; }
#view-report .loading-arc svg { display: block; width: 100%; height: auto; }
#view-report .report-empty h2 { font-size: 18px; font-weight: 800; margin: 0 0 8px; }
#view-report .report-empty p { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

#view-report .report-export-row { display: flex; justify-content: center; margin-top: 4px; }
#view-report .btn-export-pdf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px; border-radius: 999px;
  background: transparent; border: 1px solid var(--border); color: var(--ink);
  font-size: 14.5px; font-weight: 700; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
#view-report .btn-export-pdf:hover { background: var(--surface); border-color: var(--muted); }
#view-report .btn-export-pdf:active { transform: scale(0.99); }

@media print {
  .app-topbar, .sidebar, .ai-fab, .ai-panel, #view-report .report-topbar, #view-report .btn-export-pdf, #view-report .report-export-row {
    display: none !important;
  }
  .app-main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .app-layout { display: block !important; }
  body { background: #fff !important; }
}
