:root {
  --bg-0: #f7f2e3;
  --bg-1: #eee0bc;
  --bg-2: #dfd1aa;
  --ink-0: #2f2a1e;
  --ink-1: #5b513e;
  --line: #d4c4a0;
  --brand: #2f6c46;
  --brand-strong: #1f4f33;
  --warn: #aa4e13;
  --warn-bg: #fff0e3;
  --good: #2f6f73;
  --good-bg: #eaf8f8;
  --card: rgba(255, 255, 255, 0.72);
  --shadow: 0 14px 36px rgba(71, 56, 18, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "NanumSquare", "Malgun Gothic", sans-serif;
  color: var(--ink-0);
  background:
    radial-gradient(circle at 8% 6%, #fff7d8 0%, transparent 28%),
    radial-gradient(circle at 96% 10%, #dcefd7 0%, transparent 24%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 56%, var(--bg-2) 100%);
  position: relative;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(1.2px);
  opacity: 0.45;
  pointer-events: none;
  z-index: -1;
}

.bg-shape-1 {
  width: 340px;
  height: 340px;
  right: -80px;
  bottom: -140px;
  background: linear-gradient(130deg, #fff7d6, #ffd89f);
}

.bg-shape-2 {
  width: 240px;
  height: 240px;
  left: -60px;
  top: 90px;
  background: linear-gradient(130deg, #d9f1d2, #c6e8d4);
}

.site-header {
  padding: 22px clamp(16px, 3vw, 42px) 8px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
}

.brand-kicker {
  margin: 0;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  color: var(--ink-1);
}

.brand h1 {
  margin: 6px 0 0;
  font-size: clamp(1.8rem, 2.4vw, 2.6rem);
  line-height: 1.15;
}

.brand-note {
  margin: 7px 0 0;
  color: var(--ink-1);
  font-size: 0.92rem;
}

.header-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-link {
  text-decoration: none;
  color: #3a3528;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.admin-link:hover {
  background: #fffdf6;
}

.nav-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-1);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease;
}

.nav-btn:hover {
  transform: translateY(-1px);
  background: #fffdf8;
}

.nav-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand-strong);
}

.journey-strip {
  margin: 0 clamp(14px, 3vw, 42px);
  padding: 12px;
  border: 1px solid rgba(209, 192, 152, 0.9);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(3px);
}

.journey-strip h2 {
  margin: 0;
  font-size: 1rem;
}

.journey-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
}

.journey-item {
  background: #fffef8;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}

.journey-stage {
  margin: 0 0 6px;
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ebf6ee;
  color: var(--brand-strong);
  font-size: 0.76rem;
  font-weight: 700;
}

.journey-item strong {
  display: block;
  font-size: 0.92rem;
}

.journey-item span {
  display: block;
  margin-top: 6px;
  color: var(--ink-1);
  font-size: 0.82rem;
  line-height: 1.4;
}

.layout {
  display: grid;
  grid-template-columns: minmax(250px, 1.1fr) minmax(300px, 1.35fr) minmax(260px, 1fr);
  gap: 14px;
  padding: 12px clamp(14px, 3vw, 42px) 28px;
}

.panel {
  background: var(--card);
  border: 1px solid rgba(209, 192, 152, 0.9);
  box-shadow: var(--shadow);
  border-radius: 18px;
  backdrop-filter: blur(3px);
}

.panel-left,
.panel-right,
.panel-center {
  padding: 14px;
}

.panel-right {
  max-height: calc(100vh - 210px);
  overflow: auto;
}

.search-wrap {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.search-wrap label {
  font-size: 0.9rem;
  color: var(--ink-1);
}

.search-wrap input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  background: #fffef8;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.list-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

#topic-count {
  margin: 0;
  color: var(--ink-1);
  font-size: 0.88rem;
}

.digest-topic-count {
  margin: 8px 0 0;
  color: #6c5a3c;
  font-size: 0.8rem;
  font-weight: 700;
}

.digest-filter-wrap {
  margin-top: 10px;
}

.digest-filter-btn {
  border: 1px solid #c8b895;
  border-radius: 999px;
  background: #fffdf7;
  color: #4b3f2a;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 10px;
  cursor: pointer;
}

.digest-filter-btn:hover {
  background: #fff6df;
}

.digest-filter-btn.active {
  border-color: #2b6844;
  background: #eaf6ee;
  color: #1f5535;
}

.topic-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.topic-item-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffef7;
  padding: 10px;
  cursor: pointer;
}

.topic-item-btn.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand) inset;
}

.topic-item-btn strong {
  display: block;
  font-size: 0.94rem;
  line-height: 1.35;
}

.topic-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid #d6c5a4;
  background: #fbf3dd;
  color: #6a5330;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
}

.topic-item-btn span {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--ink-1);
}

.detail-card {
  background: #fffef9;
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 460px;
  padding: 16px;
}

.detail-card h2 {
  margin-top: 0;
  margin-bottom: 10px;
  line-height: 1.3;
}

.detail-meta {
  margin: 0 0 12px;
  color: var(--ink-1);
  font-size: 0.84rem;
}

.detail-summary {
  margin: 0 0 12px;
  font-weight: 700;
  color: var(--brand-strong);
}

.detail-body {
  margin: 0;
  line-height: 1.7;
}

.detail-subtitle {
  margin: 16px 0 8px;
  font-size: 0.95rem;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.detail-list.warn {
  color: #7c3f14;
}

.detail-source {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 0.9rem;
}

.side-card {
  background: #fffef8;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.side-card + .side-card {
  margin-top: 10px;
}

.side-card h2 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.flat-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.flat-list li {
  color: var(--ink-1);
  line-height: 1.45;
}

.quick-card-btn {
  width: 100%;
  text-align: left;
  border: 1px solid #c9d9cb;
  border-radius: 10px;
  background: #f7fff8;
  cursor: pointer;
  padding: 9px;
}

.quick-card-btn.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand) inset;
}

.quick-card-btn strong {
  display: block;
  font-size: 0.9rem;
}

.quick-card-btn span {
  display: block;
  margin-top: 5px;
  font-size: 0.8rem;
  color: var(--ink-1);
}

.digest-highlight-btn {
  width: 100%;
  text-align: left;
  border: 1px solid #d8c69c;
  border-radius: 10px;
  background: #fff8e7;
  cursor: pointer;
  padding: 9px;
}

.digest-highlight-btn.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand) inset;
}

.digest-highlight-btn strong {
  display: block;
  font-size: 0.9rem;
}

.digest-highlight-btn span {
  display: block;
  margin-top: 5px;
  font-size: 0.8rem;
  color: var(--ink-1);
}

.alert-item {
  list-style: none;
  background: #fffdf9;
  border: 1px dashed #dfcca4;
  border-radius: 10px;
  padding: 8px;
}

.alert-title {
  margin: 0;
  font-weight: 700;
}

.alert-meta {
  margin: 5px 0;
  font-size: 0.8rem;
}

.risk-chip {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.risk-high {
  background: #ffe2d3;
  color: #8d3d0f;
}

.risk-medium {
  background: #fff3d8;
  color: #8d6512;
}

.risk-low {
  background: var(--good-bg);
  color: #205a5e;
}

.question-item p {
  margin: 0;
}

.score-chip {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e8f0ff;
  color: #2c4f8b;
  font-size: 0.76rem;
  font-weight: 700;
}

.faq-list {
  display: grid;
  gap: 8px;
}

.faq-item {
  border: 1px solid #e2d4b1;
  border-radius: 9px;
  padding: 8px 9px;
  background: #fffdf7;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: #3b3425;
}

.faq-item p {
  margin: 8px 0 0;
  color: var(--ink-1);
  line-height: 1.5;
}

.faq-meta {
  font-size: 0.78rem;
  color: #6e6248;
}

.source-note {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: #6f644e;
}

.side-card li em {
  color: var(--warn);
  font-style: normal;
}

.analysis-section {
  margin: 0 clamp(14px, 3vw, 42px) 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 14px;
}

.analysis-card {
  background: var(--card);
  border: 1px solid rgba(209, 192, 152, 0.9);
  box-shadow: var(--shadow);
  border-radius: 16px;
  backdrop-filter: blur(3px);
  padding: 12px;
}

.analysis-card h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.analysis-card h3 {
  margin: 10px 0 8px;
  font-size: 0.9rem;
  color: var(--ink-1);
}

.cluster-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.cluster-item {
  border: 1px solid #e2d4b1;
  border-radius: 10px;
  background: #fffdf7;
  padding: 8px;
}

.cluster-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.cluster-head strong {
  font-size: 0.86rem;
  line-height: 1.35;
}

.cluster-bar {
  margin: 6px 0;
  height: 8px;
  border-radius: 999px;
  background: #ece1c3;
  overflow: hidden;
}

.cluster-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2f6c46, #65a661);
}

.cluster-question {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-1);
  line-height: 1.4;
}

.question-top-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 7px;
}

.question-top-item {
  border: 1px solid #e2d4b1;
  border-radius: 10px;
  background: #fffdf7;
  padding: 8px;
}

.question-top-item p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.4;
}

.trend-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.trend-table th,
.trend-table td {
  border: 1px solid #e5d8b7;
  padding: 6px;
  text-align: left;
  vertical-align: top;
  line-height: 1.35;
}

.trend-table th {
  background: #fbf3dd;
  color: #4a412e;
}

.trend-event-item {
  list-style: none;
  border: 1px dashed #ddc99f;
  border-radius: 9px;
  padding: 8px;
  background: #fffdf8;
}

.trend-event-item p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
}

.trend-event-impact {
  margin-top: 5px !important;
  color: var(--ink-1);
}

@media (max-width: 1200px) {
  .journey-list {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .analysis-section {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

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

  .panel-right {
    max-height: none;
    overflow: visible;
  }

  .detail-card {
    min-height: 280px;
  }

  .journey-list {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .analysis-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .journey-list {
    grid-template-columns: 1fr;
  }

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

  .header-actions {
    justify-items: start;
    width: 100%;
  }
}
