:root {
  --bg: #f7f5fb;
  --bg-soft: #f1eef8;
  --card: #ffffff;
  --card-soft: #f6f4ff;
  --border: rgba(23, 18, 53, 0.12);
  --border-soft: rgba(23, 18, 53, 0.08);
  --text-primary: #1d1633;
  --text-muted: #7a7695;
  --purple: #5c64ff;
  --purple-light: #eef0ff;
  --purple-border: #cfd3ff;
  --blue: #4f46ef;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --shadow-card: 0 30px 60px rgba(14, 6, 54, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
}

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

input,
textarea {
  font: inherit;
  border: none;
  background: transparent;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0 32px;
}

.container.narrow {
  width: min(1040px, 100%);
}

.app-header {
  background: #fff;
  border-bottom: 1px solid rgba(23, 18, 53, 0.06);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 rgba(23, 18, 53, 0.05);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f0eeff, #d9d5ff);
  color: var(--purple);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.brand-title {
  font-weight: 600;
  font-size: 18px;
}

.primary-nav {
  display: inline-flex;
  justify-self: center;
  gap: 14px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  color: #9a98b4;
  font-weight: 500;
  border: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav-link .nav-icon {
  width: 28px;
  height: 28px;
  color: var(--purple);
}

.nav-link.is-active {
  color: var(--purple);
  background: var(--purple-light);
  border-color: rgba(92, 100, 255, 0.2);
}

.auth-actions {
  display: inline-flex;
  gap: 12px;
  justify-self: end;
}

.ghost-action {
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid rgba(23, 18, 53, 0.14);
  background: #fff;
  color: var(--text-primary);
}

.solid-action {
  padding: 11px 26px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 14px 30px rgba(79, 70, 239, 0.3);
}

.page-stack {
  flex: 1;
  padding: 48px 0 80px;
}

.page {
  display: none;
}

.page.is-active {
  display: block;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.page-heading h1 {
  margin: 8px 0 6px;
  font-size: clamp(32px, 4vw, 40px);
}

.page-subtitle {
  margin: 0;
  color: var(--text-muted);
  max-width: 480px;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--purple);
  font-weight: 600;
  margin: 0;
}

.primary-action {
  border-radius: 999px;
  padding: 12px 24px;
  background: var(--purple);
  color: #fff;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.filter-row.compact {
  margin-top: 8px;
}

.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  background: #fff;
  color: var(--text-primary);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip .caret {
  font-size: 12px;
  color: var(--text-muted);
}

.search-field {
  flex: 1 1 220px;
  max-width: 320px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  background: #fff;
}

.search-field svg {
  width: 18px;
  height: 18px;
}

.search-field input {
  width: 100%;
  outline: none;
  color: var(--text-primary);
}

.feedback-stream {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stream-card {
  display: flex;
  gap: 20px;
  padding: 24px 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 18px 36px rgba(12, 6, 38, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stream-card.is-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 50px rgba(12, 6, 38, 0.08);
}

.vote-stack {
  width: 56px;
  min-width: 56px;
  height: 78px;
  border-radius: 24px;
  border: 1px solid var(--border-soft);
  background: var(--card-soft);
  color: var(--text-primary);
  font-weight: 600;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.vote-stack span:first-child {
  font-size: 18px;
}

.vote-stack--large {
  width: 64px;
  min-width: 64px;
  height: 96px;
  font-size: 20px;
}

.stream-content h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.stream-content p {
  margin: 0 0 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

.stream-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.stream-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: #f1f1f7;
  font-size: 13px;
  font-weight: 500;
  color: #5e5f74;
}

.status-pill--review {
  background: rgba(92, 100, 255, 0.14);
  color: var(--purple);
}

.crumb-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
}

.single-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 28px;
}

.single-card {
  padding: 32px 36px 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.single-header {
  display: flex;
  gap: 20px;
}

.single-header h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 38px);
}

.single-header p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--purple);
  font-weight: 600;
  border-radius: 999px;
  padding: 8px 18px;
  border: 1px solid var(--purple-border);
  background: var(--purple-light);
}

.comment-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  color: var(--purple);
}

.discussion-panel {
  border: 1px solid var(--purple-border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  background: linear-gradient(180deg, #f7f5ff, #f1f0ff);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.discussion-panel h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.discussion-panel p {
  margin: 0;
  color: var(--text-primary);
}

.perk-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.perk-list li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.perk-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--purple-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--purple);
}

.comments-empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  background: var(--bg-soft);
  color: var(--text-muted);
}

.comment-icon--large {
  display: block;
  width: 88px;
  height: 88px;
  padding: 18px;
  border-radius: 26px;
  border: 2px solid rgba(23, 18, 53, 0.2);
  background: #f4f4ff;
  margin: 0 auto 18px;
  color: rgba(23, 18, 53, 0.65);
}

.single-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-card);
  padding: 28px;
}

.subscribe-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: rgba(92, 100, 255, 0.08);
  border: 1px solid var(--purple-border);
}

.subscribe-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--purple);
}

.post-info h3 {
  margin: 0 0 16px;
}

.post-info dl {
  margin: 0;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(23, 18, 53, 0.08);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row dt {
  font-weight: 500;
  color: var(--text-muted);
}

.poster {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--purple-light);
  color: var(--purple);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.upvote-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-weight: 600;
  margin-right: 8px;
}

.powered-by {
  margin: 32px auto 48px;
  padding: 12px 24px;
  background: #fff;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  box-shadow: 0 18px 38px rgba(12, 6, 38, 0.08);
}

.powered-icon {
  font-size: 18px;
}

.powered-by .provider-link {
  color: var(--purple);
  font-weight: 600;
  text-decoration: none;
}

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.roadmap-column {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.column-label {
  display: flex;
  align-items: center;
  gap: 12px;
}

.column-label p {
  margin: 0;
  font-weight: 600;
}

.column-label small {
  color: var(--text-muted);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.status-dot--planned {
  background: #f0932b;
}

.status-dot--progress {
  background: #f8b84a;
}

.status-dot--done {
  background: #33c27f;
}

.roadmap-empty {
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  padding: 36px 16px;
  text-align: center;
  background: var(--card-soft);
  color: var(--text-muted);
}

.roadmap-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  background: var(--bg-soft);
  display: flex;
  gap: 16px;
}

.roadmap-card h3 {
  margin: 0 0 8px;
}

@media (max-width: 960px) {
  .single-layout {
    grid-template-columns: 1fr;
  }

  .single-sidebar {
    order: -1;
  }
}

@media (max-width: 720px) {
  .header-inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .primary-nav {
    justify-self: flex-start;
  }

  .auth-actions {
    justify-self: flex-start;
  }

  .page-heading {
    flex-direction: column;
  }

  .filter-row,
  .filter-row.compact {
    flex-direction: column;
    align-items: stretch;
  }

  .chip,
  .search-field,
  .primary-action,
  .ghost-action,
  .solid-action {
    width: 100%;
    justify-content: center;
  }

  .stream-card,
  .single-card,
  .card,
  .roadmap-column {
    padding: 24px;
  }
}

/* Auth Modal Styles */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.modal-backdrop[hidden] {
  display: none;
}

.auth-modal {
  position: relative;
  width: min(100%, 440px);
  background: #ffffff;
  border-radius: 24px;
  padding: 36px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.auth-modal .close-button {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #070707;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.auth-modal .close-button:hover {
  background: rgba(0, 0, 0, 0.12);
}

.auth-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-content[hidden] {
  display: none;
}

.auth-title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  color: #070707;
}

.auth-subtitle {
  margin: -12px 0 0;
  font-size: 16px;
  color: rgba(7, 7, 7, 0.6);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  font-size: 14px;
  font-weight: 500;
  color: #070707;
}

.form-field input {
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  color: #070707;
  background: #ffffff;
  transition: border-color 0.15s ease;
}

.form-field input:focus {
  outline: none;
  border-color: #070707;
}

.form-field input::placeholder {
  color: rgba(7, 7, 7, 0.4);
}

.full-width {
  width: 100%;
}

.auth-switch {
  margin: 0;
  text-align: center;
  font-size: 15px;
  color: rgba(7, 7, 7, 0.7);
}

.text-link {
  background: none;
  border: none;
  padding: 0;
  color: #070707;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  font-size: inherit;
}

.text-link:hover {
  color: rgba(7, 7, 7, 0.7);
}

/* Tag Dropdown Styles */
.filter-row {
  position: relative;
}

.tag-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 140px;
  background: #ffffff;
  border: 1px solid rgba(7, 7, 7, 0.12);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 8px;
  min-width: 160px;
  z-index: 100;
}

.tag-option {
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  color: #070707;
  cursor: pointer;
  transition: background 0.15s ease;
  display: block;
}

.tag-option:hover {
  background: rgba(7, 7, 7, 0.06);
}

.status-pill {
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.status-pill:hover {
  transform: translateY(-1px);
  opacity: 0.85;
}
