:root {
  color-scheme: light;
  --ink: #17211c;
  --muted: #6d766f;
  --line: #dfe4df;
  --paper: #f6f5f0;
  --surface: #ffffff;
  --green: #143c2c;
  --green-2: #205f45;
  --mint: #dceadf;
  --lime: #d9f24f;
  --warm: #f2eadc;
  --danger: #9a4138;
  --shadow: 0 18px 50px rgba(23, 33, 28, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 2%, rgba(217, 242, 79, 0.22), transparent 24rem),
    var(--paper);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.topbar {
  min-height: 84px;
  padding: 18px clamp(22px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(23, 33, 28, 0.12);
  background: rgba(246, 245, 240, 0.84);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--green);
  background: var(--lime);
  font-size: 22px;
  font-weight: 900;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.eyebrow,
.section-label {
  color: var(--green-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.window-chip {
  padding: 10px 14px;
  border: 1px solid rgba(23, 33, 28, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  color: var(--muted);
}

main {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 72px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: 34px;
}

.hero h2,
.methodology h2 {
  margin: 8px 0 10px;
  max-width: 780px;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 500;
}

.hero-copy {
  max-width: 690px;
  color: var(--muted);
  line-height: 1.75;
}

.privacy-note {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
  padding: 15px 17px;
  border: 1px solid rgba(23, 60, 44, 0.16);
  border-radius: 16px;
  background: rgba(220, 234, 223, 0.72);
}

.privacy-note div {
  display: grid;
  gap: 3px;
}

.privacy-note strong {
  font-size: 13px;
}

.privacy-note span:last-child {
  color: var(--muted);
  font-size: 11px;
}

.privacy-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #39a268;
  box-shadow: 0 0 0 5px rgba(57, 162, 104, 0.15);
}

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

.stat {
  min-height: 124px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.stat.featured {
  color: white;
  border-color: var(--green);
  background: var(--green);
}

.stat-value {
  display: block;
  margin-bottom: 18px;
  font-family: Georgia, serif;
  font-size: 36px;
  line-height: 1;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.featured .stat-label {
  color: rgba(255, 255, 255, 0.7);
}

.workspace {
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sidebar {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #fbfbf8;
}

.controls {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.search {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
}

.search:focus-within {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(32, 95, 69, 0.1);
}

.search svg {
  width: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}

.filters {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  overflow-x: auto;
}

.filter {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}

.filter.active {
  color: white;
  border-color: var(--green);
  background: var(--green);
}

.list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px 8px;
  color: var(--muted);
  font-size: 11px;
}

.text-button {
  padding: 4px;
  border: 0;
  color: var(--green-2);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

.conversation-list {
  max-height: 720px;
  padding: 8px 10px 16px;
  overflow: auto;
}

.conversation-item {
  width: 100%;
  margin: 2px 0;
  padding: 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  border: 0;
  border-radius: 15px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.conversation-item:hover,
.conversation-item.active {
  background: var(--mint);
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.conversation-item[data-kind="anonymous"] .avatar {
  color: var(--green);
  background: var(--warm);
}

.item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 750;
}

.item-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.item-preview {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-badges,
.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.badge {
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--green-2);
  background: rgba(32, 95, 69, 0.09);
  font-size: 9px;
  font-weight: 750;
}

.badge.handoff {
  color: var(--danger);
  background: rgba(154, 65, 56, 0.1);
}

.detail {
  min-width: 0;
  background:
    linear-gradient(rgba(255,255,255,.93), rgba(255,255,255,.93)),
    radial-gradient(circle at 80% 0, var(--mint), transparent 28rem);
}

.empty-state {
  min-height: 680px;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 18px;
  color: var(--green);
  background: var(--mint);
  font-size: 24px;
}

.empty-state h3 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 500;
}

.empty-state p {
  margin: 8px 0 0;
  font-size: 12px;
}

.detail-header {
  padding: 24px 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.detail-header h3 {
  margin: 0;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 25px;
  font-weight: 500;
}

.detail-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.transcript {
  max-height: 720px;
  padding: 24px 28px 54px;
  overflow: auto;
}

.session-block + .session-block {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px dashed var(--line);
}

.session-label {
  margin: 0 auto 20px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--paper);
  font-size: 10px;
}

.message {
  width: min(78%, 690px);
  margin-bottom: 14px;
}

.message.user {
  margin-left: auto;
}

.message-meta {
  margin: 0 4px 6px;
  color: var(--muted);
  font-size: 10px;
}

.message.user .message-meta {
  text-align: right;
}

.bubble {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 6px 18px 18px 18px;
  background: #f7f7f3;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.65;
}

.message.user .bubble {
  color: white;
  border-color: var(--green);
  border-radius: 18px 6px 18px 18px;
  background: var(--green);
}

.message.handoff .bubble {
  color: #652f29;
  border-color: rgba(154, 65, 56, 0.2);
  background: #f9e8e5;
}

.message-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 220px));
  gap: 8px;
  margin-top: 8px;
}

.message-images button {
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 13px;
  background: transparent;
  cursor: zoom-in;
}

.message-images img {
  width: 100%;
  height: 170px;
  display: block;
  object-fit: cover;
}

.methodology {
  margin-top: 28px;
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(250px, 0.75fr) minmax(0, 1.25fr);
  gap: 34px;
  border-radius: 24px;
  color: white;
  background: var(--green);
}

.methodology h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 44px);
}

.methodology .section-label {
  color: var(--lime);
}

.methodology ol {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
  counter-reset: notes;
}

.methodology li {
  min-height: 50px;
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.55;
  counter-increment: notes;
}

.methodology li::before {
  content: counter(notes, decimal-leading-zero);
  color: var(--lime);
  font-family: Georgia, serif;
  font-size: 17px;
}

#image-dialog {
  max-width: min(92vw, 1100px);
  max-height: 92vh;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 18px;
  background: #111;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.4);
}

#image-dialog::backdrop {
  background: rgba(11, 16, 13, 0.8);
  backdrop-filter: blur(10px);
}

#dialog-image {
  max-width: 88vw;
  max-height: 80vh;
  display: block;
  border-radius: 18px 18px 0 0;
  object-fit: contain;
}

#dialog-caption {
  margin: 0;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

.dialog-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--green-2);
  cursor: pointer;
  font-size: 22px;
}

.no-results {
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1120px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  main {
    width: min(100% - 24px, 680px);
    padding-top: 34px;
  }

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

  .privacy-note {
    min-width: 0;
  }

  .workspace {
    display: block;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .conversation-list {
    max-height: 330px;
  }

  .detail-header {
    padding: 20px;
  }

  .transcript {
    max-height: none;
    padding: 20px;
  }

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

@media (max-width: 560px) {
  .topbar {
    padding: 14px;
  }

  .eyebrow,
  .window-chip {
    display: none;
  }

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

  .stat {
    min-height: 104px;
  }

  .message {
    width: 90%;
  }

  .hero h2 {
    font-size: 38px;
  }
}
