:root {
  color-scheme: light;
  --bg: #f3efe5;
  --bg-accent: #d7e8d4;
  --panel: rgba(255, 252, 246, 0.88);
  --panel-strong: #fffaf2;
  --text: #1d2a1f;
  --muted: #5b675e;
  --line: rgba(29, 42, 31, 0.12);
  --action: #1f6b4f;
  --action-strong: #124432;
  --gold: #b5842f;
  --shadow: 0 20px 60px rgba(53, 61, 44, 0.12);
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(181, 132, 47, 0.16), transparent 30%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-accent) 100%);
}

.page {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.hero,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  padding: 40px;
  border-radius: 28px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 107, 79, 0.26), transparent 70%);
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-family: "Space Grotesk", sans-serif;
  color: var(--gold);
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  line-height: 1.2;
  font-weight: 700;
}

.lede {
  max-width: 760px;
  margin: 20px 0 0;
  line-height: 1.7;
  color: var(--muted);
}

.analysis-input-row {
  display: grid;
  gap: 8px;
  max-width: 760px;
  margin-top: 24px;
}

.input-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}

.analysis-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font: inherit;
}

.analysis-input:focus {
  outline: 2px solid rgba(31, 107, 79, 0.22);
  border-color: var(--action);
}

.hero-actions,
.panel-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  flex-wrap: wrap;
}

.hero-action-buttons,
.panel-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.action-button,
.secondary-button {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, opacity 160ms ease;
  font: inherit;
}

.mini-action-button {
  margin-left: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border-radius: 999px;
  padding: 3px 8px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.mini-action-button.is-loading,
.mini-action-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.action-button {
  background: linear-gradient(135deg, var(--action) 0%, var(--action-strong) 100%);
  color: white;
  padding: 16px 22px;
  border-radius: 999px;
  font-weight: 700;
}

.secondary-button {
  background: var(--panel-strong);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 999px;
}

.action-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.action-button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.action-button-unavailable {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.action-button-unavailable:hover {
  transform: none;
}

.job-status {
  color: var(--muted);
  font-size: 14px;
}

.hero-status {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.relay-status {
  font-size: 13px;
  color: var(--action-strong);
  font-weight: 700;
}

.panel {
  margin-top: 24px;
  padding: 28px;
  border-radius: 24px;
}

.analysis-list {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.calendar-panel {
  margin-top: 24px;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 24px;
  margin-top: 18px;
}

.calendar-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.calendar-label {
  min-width: 112px;
  text-align: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.calendar-weekdays span {
  padding: 0 4px;
}

.calendar-cell {
  min-height: 84px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: white;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.calendar-cell:hover {
  transform: translateY(-1px);
}

.calendar-cell.is-empty {
  cursor: default;
  background: rgba(255, 255, 255, 0.35);
}

.calendar-cell.is-selected {
  border-color: var(--action);
  background: rgba(31, 107, 79, 0.08);
}

.calendar-cell.is-active-day {
  box-shadow: inset 0 0 0 1px rgba(31, 107, 79, 0.18);
}

.calendar-day {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.calendar-count {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  display: grid;
  gap: 4px;
}

.calendar-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  margin-right: 6px;
}

.calendar-dot-general {
  background: var(--gold);
}

.calendar-dot-deep {
  background: var(--action);
}

.calendar-dot-monitor {
  background: #355c9a;
}

.calendar-dot-monitor-history {
  background: #8a8f99;
}

.calendar-count-total {
  font-weight: 700;
  color: var(--text);
}

.calendar-count-row {
  display: inline-flex;
  align-items: center;
}

.monitor-count-detail {
  padding-left: 14px;
  font-size: 12px;
}

.history-side {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.55);
}

.stock-query-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  justify-content: start;
}

.stock-query-row-modal {
  margin-top: 18px;
}

.stock-query-row .input-label {
  grid-column: 1 / -1;
}

.stock-query-row .analysis-input {
  min-width: min(520px, 100%);
}

.stock-query-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  margin-top: 18px;
}

.stock-search-results {
  display: grid;
  gap: 10px;
}

.stock-search-item {
  text-align: left;
  border: 1px solid var(--line);
  background: white;
  border-radius: 18px;
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease;
}

.stock-search-item:hover {
  transform: translateY(-1px);
  border-color: var(--action);
}

.stock-search-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.latest-pill {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(31, 107, 79, 0.12);
  color: var(--action-strong);
  font-size: 11px;
  vertical-align: middle;
}

.history-head {
  display: grid;
  gap: 6px;
}

.stock-history-section {
  margin-top: 18px;
}

.stock-history-section h4 {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.98rem;
}

.stock-history-meta {
  margin-bottom: 8px;
}

.stock-history-meta-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.history-toggle-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--action-strong);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.history-summary {
  color: var(--muted);
  font-size: 14px;
}

.history-pager {
  margin-top: 14px;
}

.history-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.history-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.history-item h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.history-type-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 8px;
  vertical-align: middle;
}

.history-type-general {
  background: rgba(181, 132, 47, 0.16);
  color: #7b5619;
}

.history-type-deep {
  background: rgba(31, 107, 79, 0.14);
  color: var(--action-strong);
}

.history-item p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.history-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

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

.history-stocks li {
  font-size: 14px;
  line-height: 1.45;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.history-monitor-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.history-monitor-block h5 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
}

.history-monitor-list {
  margin-top: 10px;
}

.clickable-stock {
  cursor: pointer;
  font-weight: 700;
}

.clickable-stock:hover {
  color: var(--action-strong);
}

.detail-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  font-size: 12px;
  color: var(--action-strong);
  vertical-align: middle;
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 28, 22, 0.45);
  backdrop-filter: blur(6px);
}

.modal-dialog {
  position: relative;
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: 12px auto;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-scroll {
  overflow: auto;
  max-height: calc(100vh - 24px);
  padding: 28px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  z-index: 1;
}

.modal-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.modal-section h3 {
  font-size: 1rem;
}

.modal-section p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.modal-subtext {
  font-size: 14px;
}

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

.monitor-log-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.monitor-log-item strong {
  color: var(--ink);
}

.monitor-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
}

.monitor-status-waiting {
  background: rgba(184, 151, 58, 0.15);
  color: #7b5619;
}

.monitor-status-active {
  background: rgba(31, 107, 79, 0.14);
  color: var(--action-strong);
}

.monitor-status-terminal {
  background: rgba(133, 41, 31, 0.14);
  color: #7e3026;
}

.evaluation-meta {
  margin-top: 10px;
}

.stance-chip {
  display: inline-flex;
  align-items: center;
  margin: 0 8px 8px 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
}

.stance-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
}

.stance-badge-compact {
  margin-left: 8px;
  padding: 3px 8px;
  font-size: 11px;
  vertical-align: middle;
}

.deep-analysis-status-badge {
  margin-left: 6px;
  padding: 3px 8px;
  font-size: 11px;
  vertical-align: middle;
}

.evaluation-logic {
  margin: 10px 0 0;
}

.evaluation-logic p {
  margin: 6px 0 0;
}

.trigger-block {
  margin-top: 6px;
}

.bubble-risk-scale {
  margin: 8px 0 14px;
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.96));
}

.bubble-risk-scale__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.bubble-risk-scale__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.bubble-risk-scale__value {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.bubble-risk-scale__bar {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #c8463a 0%, #db7a3a 24%, #dfb94e 48%, #8fba67 74%, #2f8f64 100%);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.12);
}

.bubble-risk-scale__edge {
  position: absolute;
  top: -18px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.bubble-risk-scale__edge--left {
  left: 0;
}

.bubble-risk-scale__edge--right {
  right: 0;
}

.bubble-risk-scale__ticks {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.bubble-risk-scale__ticks span {
  border-right: 1px solid rgba(255, 255, 255, 0.45);
}

.bubble-risk-scale__ticks span:last-child {
  border-right: none;
}

.bubble-risk-scale__marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 8px;
}

.bubble-risk-scale__pin {
  width: 4px;
  height: 28px;
  border-radius: 999px;
  background: #0f172a;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.88);
}

.bubble-risk-scale__label {
  margin-top: -2px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: white;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.bubble-guidance-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 10px;
}

.bubble-guidance-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--ink);
  font-size: 12px;
}

.bubble-guidance-chip strong {
  font-weight: 700;
}

.bubble-guidance-chip em {
  font-style: normal;
  color: var(--muted);
}

.trigger-list {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.value-framework {
  display: grid;
  gap: 10px;
  margin: 12px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.value-status-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.value-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.value-status-chip.is-suitability {
  background: rgba(181, 132, 47, 0.14);
  color: #7a5a1a;
}

.value-status-chip.is-margin {
  background: rgba(31, 107, 79, 0.12);
  color: var(--action-strong);
}

.value-framework-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.technical-framework {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.technical-frame-section {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
}

.technical-frame-section h5 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.92rem;
}

.technical-status-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.technical-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.technical-status-chip.is-structure {
  background: rgba(31, 107, 79, 0.12);
  color: var(--action-strong);
}

.technical-status-chip.is-alignment {
  background: rgba(181, 132, 47, 0.14);
  color: #7a5a1a;
}

.technical-status-chip.is-entry {
  background: rgba(22, 92, 161, 0.12);
  color: #0f4c89;
}

.technical-status-chip.is-setup {
  background: rgba(115, 124, 119, 0.12);
  color: #4f5c52;
}

.technical-status-chip.is-holding {
  background: rgba(123, 86, 171, 0.12);
  color: #5d3c8e;
}

.technical-frame-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.technical-risk-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.technical-risk-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.stance-positive {
  background: rgba(31, 107, 79, 0.12);
  color: var(--action-strong);
}

.stance-neutral {
  background: rgba(181, 132, 47, 0.14);
  color: #7a5a1a;
}

.stance-hold {
  background: rgba(115, 124, 119, 0.12);
  color: #4f5c52;
}

.evidence-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.evidence-list li {
  line-height: 1.55;
}

.evidence-source {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.evidence-source a {
  color: var(--action);
}

.agent-opinion-list {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.agent-opinion-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  padding: 14px;
}

.agent-opinion-card h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.agent-opinion-card p {
  margin: 8px 0 0;
}

.deep-analysis-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  padding: 14px;
}

.deep-analysis-card p {
  margin: 10px 0 0;
}

.deep-analysis-progress {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
}

.timeline-deep-summary {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.timeline-deep-summary p {
  margin: 10px 0 0;
}

.timeline-markdown {
  margin-top: 12px;
}

.timeline-markdown summary {
  cursor: pointer;
  color: var(--action-strong);
  font-weight: 600;
}

.timeline-markdown pre {
  margin: 10px 0 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(18, 28, 22, 0.04);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.original-report {
  margin: 10px 0 0;
  padding: 16px;
  border-radius: 18px;
  background: #172119;
  color: #f6f3ea;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.55;
}

.empty-state {
  padding: 32px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.4);
}

.analysis-card {
  background: var(--panel-strong);
  border-radius: 22px;
  border: 1px solid var(--line);
  padding: 24px;
}

.analysis-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.analysis-summary {
  color: var(--muted);
  margin: 14px 0 0;
  line-height: 1.6;
}

.sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.sector-card {
  padding: 16px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
}

.sector-card h3 {
  font-size: 1rem;
}

.sector-card p {
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

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

.stock-list li {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.45;
}

.ticker {
  display: inline-block;
  min-width: 48px;
  margin-right: 6px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: var(--action);
}

.warning {
  margin-top: 12px;
  color: #865d10;
  font-size: 13px;
}

@media (max-width: 640px) {
  .page {
    width: min(100vw - 20px, 1120px);
    padding: 24px 0 40px;
  }

  .hero,
  .panel {
    padding: 22px;
  }

  .hero-status {
    justify-items: start;
  }

  .hero-action-buttons,
  .panel-head-actions {
    width: 100%;
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .stock-query-layout,
  .stock-query-row {
    grid-template-columns: 1fr;
  }

  .calendar-cell {
    min-height: 70px;
    padding: 8px;
  }

  .modal-scroll {
    padding: 22px;
  }
}
