:root {
  --bg: #f3efe7;
  --surface: rgba(255, 251, 245, 0.74);
  --surface-strong: rgba(255, 251, 245, 0.92);
  --panel: rgba(255, 255, 255, 0.58);
  --line: rgba(36, 42, 39, 0.1);
  --ink: #14211f;
  --muted: #64716f;
  --deep: #102228;
  --teal: #236d72;
  --teal-soft: #d7ece8;
  --ember: #e68e6b;
  --moss: #9aa97c;
  --shadow: 0 20px 60px rgba(19, 33, 31, 0.1);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(35, 109, 114, 0.16), transparent 28%),
    radial-gradient(circle at bottom left, rgba(230, 142, 107, 0.13), transparent 24%),
    linear-gradient(180deg, #f7f4ee 0%, #efe9df 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(36, 42, 39, 0.1);
  border-radius: 14px;
  background: rgba(255, 251, 245, 0.72);
  color: var(--ink);
  padding: 12px 14px;
  outline: 0;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.is-hidden {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 30px 14px 20px;
  color: #f1f0ea;
  background:
    linear-gradient(180deg, rgba(11, 28, 34, 0.96), rgba(10, 24, 29, 0.98)),
    linear-gradient(160deg, rgba(35, 109, 114, 0.24), transparent);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand-lockup {
  padding: 8px 14px 12px;
}

.brand-mark {
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.brand-mark em {
  color: #69b8bc;
  font-style: normal;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-label {
  margin: 0 14px 6px;
  color: rgba(241, 240, 234, 0.54);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav-item {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(241, 240, 234, 0.88);
  transition: background 180ms ease, transform 180ms ease, color 180ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  background: rgba(237, 241, 241, 0.12);
  color: #fff;
  transform: translateX(2px);
}

.nav-badge,
.status-dot {
  color: #f5cfbd;
  font-size: 0.75rem;
}

.topic-list {
  display: grid;
  gap: 10px;
  padding: 0 14px;
}

.topic-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(241, 240, 234, 0.88);
  text-align: left;
}

.topic-pill::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--topic);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.topic-pill.is-active {
  color: #fff;
  font-weight: 800;
}

.profile-card {
  margin-top: auto;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.profile-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.profile-head img,
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-head strong,
.profile-head span,
.profile-foot {
  display: block;
}

.profile-head span,
.profile-foot {
  color: rgba(241, 240, 234, 0.66);
  font-size: 0.88rem;
}

.progress-rail {
  height: 8px;
  margin: 16px 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-rail span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #dfb86f, #67c2b5);
}

.profile-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.workspace {
  padding: 18px 18px 24px;
}

.topbar,
.hero,
.content-grid {
  margin: 0 auto;
  max-width: 1380px;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 8px 6px 20px;
}

.searchbar,
.ghost-button,
.primary-button,
.context-panel,
.side-section,
.stream-card,
.feature-slab,
.upload-zone {
  backdrop-filter: blur(18px);
}

.searchbar {
  min-height: 48px;
  border-radius: 18px;
  background: rgba(255, 251, 245, 0.58);
  border: 1px solid rgba(36, 42, 39, 0.08);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.searchbar input {
  border: 0;
  background: transparent;
  padding: 0;
}

kbd {
  border-radius: 10px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(36, 42, 39, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ghost-button,
.primary-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(36, 42, 39, 0.08);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.ghost-button {
  background: rgba(255, 251, 245, 0.58);
}

.primary-button {
  background: linear-gradient(135deg, var(--teal), #2f8682);
  color: #f3f7f5;
}

.ghost-button:hover,
.primary-button:hover,
.upload-zone:hover {
  transform: translateY(-1px);
}

.icon-only {
  width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 6px 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  color: #213533;
  font-size: clamp(3.6rem, 8vw, 5.8rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 500;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 14px;
}

.hero-meta div {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 251, 245, 0.44);
  border: 1px solid rgba(36, 42, 39, 0.08);
}

.hero-meta strong {
  display: block;
  font-size: 1.25rem;
}

.hero-meta span {
  color: var(--muted);
  font-size: 0.88rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
}

.main-column,
.side-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.segment-bar,
.section-heading,
.panel-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.segment-tabs,
.panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segment-tab,
.panel-tab {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
}

.segment-tab.is-active,
.panel-tab.is-active {
  color: var(--teal);
  background: rgba(35, 109, 114, 0.12);
}

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

.stream-card,
.feature-slab,
.context-panel,
.side-section {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(36, 42, 39, 0.08);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stream-card {
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
}

.stream-card.is-selected {
  border-color: rgba(35, 109, 114, 0.34);
  background: rgba(255, 251, 245, 0.88);
}

.stream-card::after {
  content: "";
  position: absolute;
  inset: auto -15% -60% auto;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(35, 109, 114, 0.08), transparent 65%);
  pointer-events: none;
}

.card-tag,
.mini-label {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(20, 33, 31, 0.05);
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stream-card h2,
.side-section h3,
.context-panel h3,
.feature-slab h2 {
  font-family: "Cormorant Garamond", serif;
  letter-spacing: -0.03em;
}

.stream-card h2 {
  margin: 12px 0 8px;
  font-size: clamp(1.7rem, 2vw, 2.35rem);
  line-height: 0.96;
}

.stream-card p {
  margin: 0;
  color: var(--muted);
}

.thread-meta,
.people-row,
.file-row,
.leader-row {
  display: flex;
  align-items: center;
}

.thread-meta {
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.avatar-stack {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.avatar-stack img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 251, 245, 0.94);
  margin-left: -8px;
  object-fit: cover;
}

.avatar-stack span {
  margin-left: 10px;
  color: var(--muted);
}

.card-preview {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.chart-line {
  width: 180px;
  height: 48px;
  align-self: end;
}

.chart-line path {
  fill: none;
  stroke: #54b5b2;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.file-pill,
.vault-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(36, 42, 39, 0.08);
}

.file-pill strong,
.vault-card strong {
  display: block;
  font-size: 0.92rem;
}

.file-pill span,
.vault-card span,
.thread-stat,
.contributor-role {
  color: var(--muted);
  font-size: 0.82rem;
}

.image-preview {
  margin-top: 16px;
  width: min(100%, 260px);
  aspect-ratio: 1.7;
  border-radius: 18px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.12)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=960&q=80")
      center / cover;
}

.upload-zone,
.feature-slab,
.context-panel,
.side-section {
  padding: 18px;
}

.full-width {
  width: 100%;
  margin-top: 16px;
}

.avatar-placeholder {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(105, 184, 188, 0.18);
  color: #dff7f5;
  font-weight: 800;
}

.thread-actions,
.reply-form,
.status-list,
.compact-form,
.row-actions {
  display: grid;
  gap: 10px;
}

.thread-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 16px 0;
}

.reply-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.reply-item {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(36, 42, 39, 0.08);
}

.reply-item p {
  margin: 6px 0;
}

.reply-item span,
.status-list span,
.admin-row span {
  color: var(--muted);
  font-size: 0.88rem;
}

.status-list {
  margin-top: 14px;
}

.status-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(36, 42, 39, 0.08);
}

.modal {
  width: min(560px, calc(100vw - 28px));
  border: 0;
  border-radius: 22px;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(10, 24, 29, 0.44);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 24px;
  border-radius: 22px;
  background: #fffaf2;
  box-shadow: 0 24px 80px rgba(10, 24, 29, 0.26);
}

.modal-card h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 2.2rem;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(20, 33, 31, 0.06);
}

.form-message {
  min-height: 22px;
  color: #bf5a3d;
}

.admin-body {
  min-height: 100vh;
  background: #f4f1ea;
}

.admin-shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.admin-topbar,
.admin-panel,
.admin-stats div {
  border: 1px solid rgba(36, 42, 39, 0.08);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-radius: 24px;
  padding: 20px;
}

.admin-topbar h1,
.admin-panel h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 0;
}

.admin-topbar h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.admin-stats div {
  padding: 16px;
  border-radius: 18px;
}

.admin-stats strong {
  display: block;
  font-size: 1.5rem;
}

.admin-stats span {
  color: var(--muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-panel {
  border-radius: 24px;
  padding: 18px;
}

.admin-panel.wide {
  grid-column: 1 / -1;
}

.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(36, 42, 39, 0.08);
}

.admin-row strong,
.admin-row span {
  display: block;
}

.admin-row i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
}

.row-actions {
  grid-auto-flow: column;
  align-items: center;
}

.compact-form {
  grid-template-columns: 1fr 1fr 56px auto;
  align-items: center;
  margin-top: 12px;
}

.upload-zone {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  border: 1px dashed rgba(36, 42, 39, 0.14);
  background: rgba(255, 251, 245, 0.48);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, border-color 180ms ease;
}

.upload-zone:hover {
  border-color: rgba(35, 109, 114, 0.34);
}

.upload-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(35, 109, 114, 0.12);
  color: var(--teal);
  font-size: 1.2rem;
}

.feature-slab h2,
.side-section h3,
.context-panel h3 {
  margin: 8px 0 0;
  font-size: 2rem;
}

.tight h3 {
  margin: 0;
  font-size: 1.85rem;
}

.inline-action {
  color: var(--muted);
}

.vault-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.vault-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.vault-card .vault-accent {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(35, 109, 114, 0.18), rgba(230, 142, 107, 0.18));
}

.context-panel p,
.event-card p,
.ranked-list li,
.leader-row {
  color: var(--muted);
}

.context-copy {
  margin-top: 18px;
}

.bullet-points {
  padding-left: 18px;
}

.people-row {
  margin-top: 16px;
  gap: 8px;
}

.people-row img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.event-card {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 14px;
  align-items: end;
}

.event-cover {
  width: 96px;
  aspect-ratio: 0.82;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(52, 119, 123, 0.08), rgba(230, 142, 107, 0.18)),
    url("https://images.unsplash.com/photo-1517048676732-d65bc937f952?auto=format&fit=crop&w=700&q=80")
      center / cover;
}

.event-badge {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(232, 93, 57, 0.12);
  color: #bf5a3d;
  font-size: 0.74rem;
}

.ranked-list {
  margin: 12px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 12px;
}

.ranked-list li {
  padding-left: 6px;
}

.thread-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.leaderboard {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.leader-row {
  justify-content: space-between;
  gap: 14px;
}

.leader-row .person {
  display: flex;
  gap: 12px;
  align-items: center;
}

.leader-row img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.sparkline {
  width: 72px;
  height: 22px;
}

.sparkline path {
  fill: none;
  stroke: #63b7b4;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 1220px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .side-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .context-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 16px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .topic-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    flex-direction: column;
    align-items: start;
  }

  .hero-meta,
  .vault-grid {
    grid-template-columns: 1fr;
  }

  .file-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .upload-zone,
  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .compact-form,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 12px;
  }

  .side-column {
    grid-template-columns: 1fr;
  }

  .segment-bar,
  .section-heading,
  .panel-tabs,
  .thread-row,
  .event-card {
    grid-template-columns: 1fr;
    display: grid;
  }

  .file-strip {
    grid-template-columns: 1fr;
  }

  .avatar-stack {
    margin-left: 0;
  }

  .thread-actions,
  .row-actions {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }
}
