:root {
  --bg: #f4efe6;
  --bg-alt: #efe6d6;
  --panel: rgba(255, 252, 246, 0.88);
  --panel-strong: #fffaf1;
  --line: rgba(60, 50, 36, 0.12);
  --text: #1f1a14;
  --muted: #65594b;
  --deep-green: #17352d;
  --deep-green-soft: #24493e;
  --bronze: #8f633b;
  --shadow: 0 18px 40px rgba(73, 54, 28, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(143, 99, 59, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(23, 53, 45, 0.15), transparent 26%),
    linear-gradient(180deg, #f8f4ec 0%, var(--bg) 46%, #ece3d2 100%);
}

.page-shell {
  height: 100vh;
  padding: 32px;
  overflow: hidden;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 20px;
  height: 100%;
}

.panel,
.controls,
.report-card,
.detail-empty {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.sidebar,
.content-stage,
.detail-panel {
  min-height: 0;
}

.sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
}

.content-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 20px;
  min-width: 0;
}

.controls-panel {
  min-width: 0;
}

.recommendation-card {
  display: grid;
  gap: 8px;
  padding: 16px 20px;
  border: 1px solid rgba(23, 53, 45, 0.18);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(143, 99, 59, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(255, 250, 241, 0.98), rgba(245, 237, 224, 0.94));
  box-shadow: 0 22px 44px rgba(40, 31, 18, 0.12);
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.recommendation-card:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 53, 45, 0.28);
  box-shadow: 0 26px 52px rgba(40, 31, 18, 0.16);
}

.recommendation-empty:hover {
  transform: none;
  border-color: rgba(23, 53, 45, 0.18);
  box-shadow: 0 22px 44px rgba(40, 31, 18, 0.12);
}

.recommendation-headline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.recommendation-kicker,
.recommendation-stock,
.recommendation-date {
  margin: 0;
}

.recommendation-kicker {
  color: var(--bronze);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: none;
}

.recommendation-date {
  color: var(--deep-green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-left: auto;
}

.recommendation-company {
  margin: 0;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.detail-section-intro {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
}

.detail-section-intro::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(60, 50, 36, 0.16), rgba(60, 50, 36, 0.04));
}

.detail-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bronze);
}

.recommendation-stock {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.recommendation-reason {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.controls,
.detail-empty,
.detail-view {
  border-radius: 24px;
}

.controls {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.control {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.control input,
.control select,
button {
  border: 1px solid rgba(34, 28, 20, 0.12);
  border-radius: 14px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
}

.control input,
.control select {
  padding: 12px 14px;
}

.list-summary {
  margin: 14px 4px 10px;
  color: var(--muted);
  font-size: 13px;
}

.report-list {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.detail-panel { overflow: hidden; }

.report-card {
  padding: 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
  text-align: left;
}

.report-card:hover,
.report-card.active {
  transform: translateY(-1px);
  border-color: rgba(23, 53, 45, 0.24);
  background: rgba(255, 251, 246, 0.98);
}

.report-card header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.report-card h3,
.detail-stock,
.panel h3 {
  margin: 0;
}

.report-card h3 {
  font-size: 16px;
  font-weight: 700;
}

.card-thesis {
  margin: 10px 0 6px;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 500;
}

.detail-thesis,
.detail-summary,
.panel p,
dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.card-date {
  color: var(--bronze);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.card-code {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.list-decision-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(23, 53, 45, 0.1);
  color: var(--deep-green);
  font-size: 11px;
  font-weight: 700;
}

.list-decision-pill.positive {
  background: rgba(23, 53, 45, 0.1);
  color: var(--deep-green);
}

.list-decision-pill.strong_positive {
  background: rgba(15, 63, 42, 0.16);
  color: #0f3f2a;
}

.list-decision-pill.neutral {
  background: rgba(111, 101, 88, 0.12);
  color: #65594b;
}

.list-decision-pill.negative {
  background: rgba(108, 60, 51, 0.12);
  color: #6c3c33;
}

.list-decision-pill.strong_negative {
  background: rgba(86, 36, 28, 0.16);
  color: #56241c;
}

.detail-view {
  display: grid;
  gap: 8px;
  height: 100%;
  overflow-y: auto;
  padding: 14px 24px 24px;
}

.detail-empty {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.detail-header {
  display: flex;
  justify-content: flex-start;
  gap: 20px;
  align-items: start;
}

.detail-header-main {
  display: grid;
  gap: 10px;
}

.detail-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.detail-headline-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.detail-company,
.detail-stock,
.detail-date {
  margin: 0;
}

.detail-company {
  margin: 0;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.detail-stock {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

.detail-date {
  color: var(--deep-green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.detail-overall-panel {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.detail-decision-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.decision-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  background: #1d5a49;
  color: #fbf6ee;
  font-size: 12px;
  font-weight: 700;
}

.decision-pill.positive {
  background: #1d5a49;
}

.decision-pill.strong-positive {
  background: #0e6a4a;
}

.decision-pill.neutral {
  background: #8a7459;
}

.decision-pill.negative {
  background: #a24d3f;
}

.decision-pill.strong-negative {
  background: #8b3428;
}

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

.factor-section {
  display: grid;
  gap: 14px;
}

.factor-section-header h3,
.factor-section-header p {
  margin: 0;
}

.factor-section-header p {
  color: var(--muted);
  font-size: 13px;
}

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

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

.panel h3 {
  font-size: 15px;
  font-weight: 700;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.factor-panel {
  display: grid;
  align-content: start;
}

.factor-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(23, 53, 45, 0.1);
  color: var(--deep-green);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.factor-badge.positive {
  background: rgba(23, 53, 45, 0.1);
  color: var(--deep-green);
}

.factor-badge.neutral {
  background: rgba(111, 101, 88, 0.12);
  color: #65594b;
}

.factor-badge.negative {
  background: rgba(108, 60, 51, 0.12);
  color: #6c3c33;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

dd {
  margin-left: 0;
  font-size: 13px;
}

button {
  padding: 10px 14px;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

@media (max-width: 1080px) {
  body,
  .page-shell {
    height: auto;
    overflow: visible;
  }

  .page-grid,
  .detail-grid,
  .factor-grid {
    height: auto;
  }

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

  .content-stage { gap: 16px; }

  .detail-header {
    flex-direction: column;
  }

  .detail-decision-wrap {
    justify-content: flex-start;
  }

  .report-list,
  .detail-view {
    overflow: visible;
  }

  .recommendation-card {
    border-radius: 22px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 18px;
  }

  .page-grid {
    gap: 14px;
  }

  .detail-view,
  .controls,
  .report-card,
  .panel {
    border-radius: 20px;
  }

  .recommendation-card {
    padding: 14px 16px;
    border-radius: 20px;
  }

  .controls {
    padding: 14px;
  }

  .sidebar {
    gap: 0;
  }

  .controls .control:not(:first-child),
  .list-summary,
  .report-list,
  .sidebar .list-summary,
  .sidebar .report-list {
    display: none;
  }

  .control span {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .control input {
    padding: 11px 12px;
  }

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