:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --line: #e5e9f2;
  --line-soft: #eef2f7;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --blue: #2f6bff;
  --blue-strong: #2457d6;
  --green: #16a34a;
  --green-soft: #22c55e;
  --red: #ef4444;
  --red-strong: #dc2626;
  --amber: #f59e0b;
  --shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 22px rgba(15, 23, 42, 0.05);
  --radius: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Pretendard", "Segoe UI", "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.side-ad {
  display: none;
}

.side-ad-inner {
  width: 300px;
  min-height: 600px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}

.side-ad .adsbygoogle {
  width: 100%;
  min-height: 600px;
}

button,
input {
  font: inherit;
}

.page {
  padding: 20px 18px 88px;
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
}

/* ------- Hero ------- */
.hero {
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0f172a 0%, #0b1224 100%);
  color: #fff;
  padding: 26px 30px 30px;
  box-shadow: var(--shadow);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbe7ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero h1 {
  margin: 14px 0 8px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero h1 a {
  color: inherit;
  text-decoration: none;
}

.hero h1 a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hero p {
  margin: 0;
  max-width: 760px;
  color: #b9c4da;
  line-height: 1.6;
  font-size: 14px;
}

.search-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  max-width: 920px;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-wrap input {
  width: 100%;
}

.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  max-height: 320px;
  overflow-y: auto;
}

.search-suggest[hidden] { display: none; }

.search-suggest li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: #0f172a;
  font-size: 14px;
}

.search-suggest li:hover,
.search-suggest li.active {
  background: #eff3ff;
}

.search-suggest .s-name {
  font-weight: 700;
}

.search-suggest .s-meta {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.search-row input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  outline: none;
  border-radius: 12px;
  padding: 0 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.08);
}

.search-row button {
  min-width: 116px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  background: #3661f0;
  color: #fff;
  box-shadow: 0 10px 24px rgba(54, 97, 240, 0.32);
  transition: transform 0.15s ease;
}

.search-row button:hover,
.hero-pills button:hover,
.tab:hover,
.analyze-btn:hover,
.capture-btn:hover {
  transform: translateY(-1px);
}

.hero-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.hero-pills button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5ff;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

/* ------- Layout ------- */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  margin-top: 16px;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}

/* ------- Chart panel ------- */
.chart-panel .panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.chart-panel .panel-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.stock-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.stock-share-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, opacity 0.15s;
}

.stock-share-btn::before {
  content: "";
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='M8.59 13.51 15.42 17.49'/%3E%3Cpath d='M15.41 6.51 8.59 10.49'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='M8.59 13.51 15.42 17.49'/%3E%3Cpath d='M15.41 6.51 8.59 10.49'/%3E%3C/svg%3E") center / contain no-repeat;
}

.stock-share-btn:hover {
  background: rgba(37, 99, 235, 0.13);
  border-color: rgba(37, 99, 235, 0.32);
  transform: translateY(-1px);
}

.stock-share-btn:disabled {
  cursor: wait;
  opacity: 0.6;
}

.meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
  font-weight: 600;
}

.meta-line .dot {
  color: var(--muted-2);
}

.market-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.market-badge[hidden] {
  display: none;
}

.blog-search-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 800;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.blog-search-link::before {
  content: "↗";
  font-size: 11px;
  line-height: 1;
}

.blog-search-link:hover {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.13);
  border-color: rgba(37, 99, 235, 0.32);
  text-decoration: none;
  transform: translateY(-1px);
}

.price-block {
  text-align: right;
}

.price-block strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.price-block span {
  display: inline-block;
  margin-top: 4px;
  font-weight: 700;
  font-size: 13px;
  color: var(--blue);
}

.price-block span.up {
  color: var(--red);
}

.chart-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.period-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: #f1f4f9;
  border-radius: 999px;
}

.tab {
  height: 30px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab.active {
  background: var(--blue-strong);
  color: #fff;
  box-shadow: 0 4px 12px rgba(36, 87, 214, 0.32);
}

.capture-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.capture-btn:hover {
  background: #f8fafc;
}

.ohlc-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.ohlc-line strong {
  font-size: 13px;
  color: var(--text);
  font-weight: 800;
}

.ohlc-line em {
  font-style: normal;
  font-weight: 700;
  color: var(--text);
  margin-left: 2px;
}

.ohlc-line .change {
  font-weight: 700;
}

.ohlc-line .change.down {
  color: var(--blue);
}

.ohlc-line .change.up {
  color: var(--red);
}

.chart-legend {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-legend .legend-title {
  color: var(--text-soft);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 12px;
  height: 3px;
  border-radius: 999px;
  display: inline-block;
}

.chart-legend .ma5 {
  background: var(--green);
}

.chart-legend .ma20 {
  background: var(--amber);
}

.chart-legend .ma60 {
  background: #a855f7;
}

.chart-area {
  width: 100%;
  height: 420px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  font-size: 12px;
  min-width: 160px;
  display: grid;
  gap: 4px;
}

.chart-tooltip .tt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.chart-tooltip .tt-row span {
  color: var(--muted);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-tooltip .tt-row b {
  font-weight: 700;
  color: #0f172a;
}

.chart-tooltip .v-open  { color: #64748b; }
.chart-tooltip .v-high  { color: #ef4444; }
.chart-tooltip .v-low   { color: #3b82f6; }
.chart-tooltip .v-close.up   { color: #dc2626; font-weight: 800; }
.chart-tooltip .v-close.down { color: #2563eb; font-weight: 800; }

.chart-tooltip .dot-ma5::before,
.chart-tooltip .dot-ma20::before,
.chart-tooltip .dot-ma60::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.chart-tooltip .dot-ma5::before  { background: #16a34a; }
.chart-tooltip .dot-ma20::before { background: #f59e0b; }
.chart-tooltip .dot-ma60::before { background: #a855f7; }

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

.metric-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fcfdff;
  padding: 14px 14px;
}

.metric-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
  font-weight: 600;
}

.metric-box strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ------- Supply panel ------- */
.supply-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.supply-head {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.supply-head-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.supply-detail-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.supply-detail-btn:hover {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.supply-period {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: #f1f5f9;
  border-radius: 999px;
  padding: 4px 10px;
  letter-spacing: 0.02em;
}

.supply-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.supply-list {
  display: grid;
  margin: 14px 0 18px;
}

.supply-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.supply-row:last-child {
  border-bottom: 0;
}

.supply-row .label {
  font-size: 14px;
  color: var(--text-soft);
  font-weight: 700;
}

.supply-row .value {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.supply-row .value.plus {
  color: var(--red);
}

.supply-row .value.minus {
  color: var(--blue);
}

.short-section {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fcfdff;
  padding: 12px 14px;
}

.short-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 10px;
  letter-spacing: 0.02em;
}

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

.short-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.short-row .label {
  color: var(--muted);
  font-weight: 600;
}

.short-row .value {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.short-row .value strong {
  font-weight: 700;
}

.short-row .ratio {
  font-size: 11px;
  color: var(--muted-2, #94a3b8);
  font-weight: 600;
}

.short-row .delta {
  font-size: 11px;
  font-weight: 700;
}

.short-row .delta.plus { color: var(--red); }
.short-row .delta.minus { color: var(--blue); }

.power-section {
  display: grid;
  gap: 14px;
  margin-top: 6px;
}

.power-block {
  display: grid;
  gap: 8px;
}

.power-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 700;
}

.power-row strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  transition: width 0.4s ease;
}

.tone-red .bar span {
  background: linear-gradient(90deg, #fb7185, #ef4444);
}

.tone-blue .bar span {
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}

.tone-green .bar span {
  background: linear-gradient(90deg, #4ade80, #16a34a);
}

.analyze-btn {
  margin-top: 22px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, #10b981, #22c55e);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(34, 197, 94, 0.26);
  transition: transform 0.15s ease;
  letter-spacing: -0.01em;
}

/* ------- Analysis panel ------- */
.analysis-panel {
  margin-top: 18px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0f172a 0%, #0b1224 100%);
  color: #f7faff;
  box-shadow: var(--shadow);
}

/* 분석 패널 헤더: 제목 좌측 + 버튼 우측 끝 배치 */
.panel-head.compact {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px 14px;
}
.panel-head.compact > div:first-child {
  min-width: 0;
  flex: 1 1 240px;
}
.panel-head.compact h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.panel-head.compact p {
  margin: 6px 0 0;
  color: #b9c4da;
  font-size: 13px;
}

.panel-head.light {
  color: #f7fbff;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #e8f1ff;
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 800;
}

.section-tag.dark {
  background: rgba(255, 255, 255, 0.08);
  color: #d7e4ff;
}

.analysis-head-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  flex: 0 0 auto;
  margin-left: auto;
}

.re-analyze-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #dbe7ff;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.re-analyze-btn:hover { background: rgba(255, 255, 255, 0.12); }
.re-analyze-btn[hidden] { display: none; }

/* 공유 버튼 — 분석 버튼과 동일 톤, 좀 더 강조 */
.share-btn {
  border: 1px solid rgba(168, 85, 247, 0.4);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(59, 130, 246, 0.12));
  color: #e9d5ff;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.share-btn:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.30), rgba(59, 130, 246, 0.20));
  border-color: rgba(168, 85, 247, 0.6);
  transform: translateY(-1px);
}
.share-btn[hidden] { display: none; }

/* 공유받음 배너 */
.shared-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 16px 12px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.16), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(168, 85, 247, 0.30);
  position: relative;
  overflow: hidden;
}
.shared-banner::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #a855f7, #3b82f6);
}
.shared-banner[hidden] { display: none; }
.shared-banner .sb-icon {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #a855f7, #3b82f6);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.14);
  flex-shrink: 0;
}
.shared-banner .sb-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.shared-banner .sb-text strong {
  font-size: 13px;
  color: #f3e8ff;
  font-weight: 800;
}
.shared-banner .sb-text span {
  font-size: 11.5px;
  color: #cbd5e1;
}

.analysis-history {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.analysis-history[hidden] {
  display: none;
}

.analysis-history > span {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
}

.analysis-history-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.analysis-history button {
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.06);
  color: #dbe7ff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.analysis-history button:hover,
.analysis-history button.active {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(96, 165, 250, 0.5);
  transform: translateY(-1px);
}
/* 토스트 — 하단 중앙 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  z-index: 10000;
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 88vw;
  text-align: center;
}
.toast[hidden] { display: none; }
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error {
  background: rgba(127, 29, 29, 0.95);
  border-color: rgba(248, 113, 113, 0.3);
}

.share-confirm-modal,
.action-confirm-modal,
.message-modal {
  z-index: 90;
}

.share-confirm-card,
.action-confirm-card,
.message-card {
  width: min(440px, calc(100vw - 32px));
}

.share-confirm-body,
.action-confirm-body,
.message-body {
  padding: 18px 20px 20px;
}

.share-confirm-body p,
.action-confirm-body p,
.message-body p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 700;
}

.message-body p {
  white-space: pre-wrap;
  max-height: min(42vh, 360px);
  overflow: auto;
}

.share-confirm-url {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}

.share-confirm-close-btn,
.message-close-btn {
  width: 100%;
  height: 42px;
  margin-top: 16px;
  border: 0;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.share-confirm-close-btn:hover,
.message-close-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.action-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.action-confirm-cancel-btn,
.action-confirm-ok-btn {
  height: 42px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.action-confirm-cancel-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-soft);
}

.action-confirm-ok-btn {
  border: 0;
  background: #10b981;
  color: #fff;
}

.action-confirm-cancel-btn:hover,
.action-confirm-ok-btn:hover {
  transform: translateY(-1px);
}

.action-confirm-cancel-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.action-confirm-ok-btn:hover {
  background: #059669;
}

.scroll-top-btn {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 9000;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(15, 23, 42, 0.88);
  color: #dbeafe;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.24);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}
.scroll-top-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.46);
  background: rgba(30, 41, 59, 0.94);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.30);
}
.scroll-top-btn[hidden] { display: none; }

/* ─── Analysis 패널: 시맨틱 컬러 변수 ─── */
.analysis-panel {
  --a-good: #10b981;
  --a-bad: #ef4444;
  --a-warn: #f59e0b;
  --a-info: #3b82f6;
  --a-violet: #a855f7;
  --a-pink: #ec4899;
  --a-sky: #0ea5e9;
  --a-teal: #14b8a6;
  --a-rose: #f43f5e;
  --a-gold: #eab308;
  --a-slate: #64748b;
  --a-emerald: #10b981;
  --a-amber: #f59e0b;
  --a-line: rgba(255,255,255,0.08);
  --a-line-strong: rgba(255,255,255,0.16);
  --a-card-bg: rgba(255,255,255,0.04);
  --a-text-dim: #b9c4da;
}

/* Hero summary */
.analysis-summary {
  position: relative;
  margin-top: 16px;
  padding: 20px 22px 20px 26px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(168,85,247,0.18), rgba(59,130,246,0.12) 60%, rgba(16,185,129,0.10));
  border: 1px solid rgba(168,85,247,0.30);
  overflow: hidden;
  color: #f8fafc;
}
.analysis-summary::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--a-violet), var(--a-info));
}
.analysis-summary .ah-label {
  font-size: 10px;
  font-weight: 800;
  color: #d8c5f7;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.analysis-summary .ah-text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.65;
  color: #f8fafc;
}
.analysis-summary[hidden] { display: none; }

/* Grid */
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.analysis-grid .full { grid-column: 1 / -1; }

/* Section card */
.sec-card {
  position: relative;
  background: var(--a-card-bg);
  border: 1px solid var(--a-line);
  border-radius: 14px;
  padding: 16px 18px 18px 22px;
  overflow: hidden;
}
.sec-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent, var(--a-info));
}
.sec-card.violet  { --accent: var(--a-violet); }
.sec-card.emerald { --accent: var(--a-emerald); }
.sec-card.amber   { --accent: var(--a-amber); }
.sec-card.gold    { --accent: var(--a-gold); }
.sec-card.pink    { --accent: var(--a-pink); }
.sec-card.sky     { --accent: var(--a-sky); }
.sec-card.slate   { --accent: var(--a-slate); }
.sec-card.rose    { --accent: var(--a-rose); }
.sec-card.teal    { --accent: var(--a-teal); }

.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}
.sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}
.sec-title .icon { font-size: 16px; }
.sec-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--a-text-dim);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Bullets */
.a-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.a-bullets li {
  position: relative;
  padding-left: 16px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #d4def3;
}
.a-bullets li::before {
  content: '';
  position: absolute;
  left: 3px; top: 9px;
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
}
.a-bullets li strong { color: #fff; font-weight: 700; }
.a-bullets li em { color: #e9d5ff; font-style: italic; }

/* Split good/warn/bad */
.split-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.split-block .split-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.split-block.good .split-head { color: var(--a-good); }
.split-block.warn .split-head { color: var(--a-warn); }
.split-block.bad  .split-head { color: var(--a-bad); }
.split-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.split-block li {
  font-size: 13.5px;
  line-height: 1.55;
  color: #d4def3;
  padding-left: 18px;
  position: relative;
}
.split-block.good li::before { content: '✓'; color: var(--a-good); font-weight: 700; position: absolute; left: 0; }
.split-block.warn li::before { content: '!'; color: var(--a-warn); font-weight: 800; position: absolute; left: 0; }
.split-block.bad  li::before { content: '✗'; color: var(--a-bad);  font-weight: 700; position: absolute; left: 0; }

/* Price table */
.price-table {
  width: 100%;
  border-collapse: collapse;
}
.price-table tr { border-bottom: 1px solid var(--a-line); }
.price-table tr:last-child { border-bottom: none; }
.price-table td {
  padding: 10px 4px;
  font-size: 13.5px;
  vertical-align: middle;
}
.price-table .pt-price {
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  width: 110px;
  white-space: nowrap;
}
.price-table .pt-dot { width: 18px; }
.price-table .pt-dot span {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.price-table .pt-label { color: #d4def3; }
.price-table .pt-label strong { color: #fff; font-weight: 700; }
.price-table .pt-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  letter-spacing: 0.04em;
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
}

/* Scenarios 3-color */
.scenarios {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.scenario {
  position: relative;
  padding: 12px 14px;
  border-radius: 10px;
  overflow: hidden;
}
.scenario.up   { background: linear-gradient(135deg, rgba(16,185,129,0.16), rgba(16,185,129,0.05)); border: 1px solid rgba(16,185,129,0.30); }
.scenario.mid  { background: linear-gradient(135deg, rgba(245,158,11,0.16), rgba(245,158,11,0.05)); border: 1px solid rgba(245,158,11,0.30); }
.scenario.down { background: linear-gradient(135deg, rgba(239,68,68,0.16), rgba(239,68,68,0.05)); border: 1px solid rgba(239,68,68,0.30); }
.scenario-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 10px;
}
.scenario-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.scenario.up   .scenario-name { color: #6ee7b7; }
.scenario.mid  .scenario-name { color: #fcd34d; }
.scenario.down .scenario-name { color: #fca5a5; }
.scenario-target {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.scenario-cond {
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.55;
}

.most-likely {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.15);
  font-size: 12.5px;
  color: var(--a-text-dim);
}
.most-likely strong { color: #fcd34d; }

/* Core action box */
.core-action {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(244,63,94,0.16), rgba(244,63,94,0.04));
  border: 1px solid rgba(244,63,94,0.28);
}
.core-action.slate { background: linear-gradient(135deg, rgba(100,116,139,0.20), rgba(100,116,139,0.06)); border-color: rgba(100,116,139,0.35); }
.core-action.teal  { background: linear-gradient(135deg, rgba(20,184,166,0.18), rgba(20,184,166,0.05)); border-color: rgba(20,184,166,0.30); }
.core-action .ca-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: #fda4af;
}
.core-action.slate .ca-label { color: #cbd5e1; }
.core-action.teal  .ca-label { color: #5eead4; }
.core-action .ca-content {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.45;
}

/* Force (세력) badge */
.force-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 11px 14px;
  background: rgba(16,185,129,0.10);
  border: 1px solid rgba(16,185,129,0.30);
  border-radius: 10px;
  gap: 8px;
  flex-wrap: wrap;
}
.force-badge.no    { background: rgba(239,68,68,0.10);  border-color: rgba(239,68,68,0.30); }
.force-badge.maybe { background: rgba(245,158,11,0.10); border-color: rgba(245,158,11,0.30); }
.force-badge .fb-label {
  font-size: 12px;
  color: #cbd5e1;
  font-weight: 600;
}
.force-badge .fb-value {
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--a-good);
}
.force-badge.no    .fb-value { color: #f87171; }
.force-badge.maybe .fb-value { color: #fbbf24; }

/* Pattern callout */
.pattern-callout {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(245,158,11,0.10);
  border-left: 3px solid var(--a-warn);
  border-radius: 6px;
  font-size: 13px;
  color: #fde68a;
  line-height: 1.5;
}
.pattern-callout strong { color: #fbbf24; }

/* 장기 투자자 3-col grid */
.long-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.long-cell {
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--a-line);
  border-radius: 10px;
}
.long-cell .lc-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.long-cell.buy   .lc-label { color: #5eead4; }
.long-cell.cut   .lc-label { color: #fca5a5; }
.long-cell.watch .lc-label { color: #93c5fd; }
.long-cell .lc-value {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.long-cell .lc-note {
  font-size: 12px;
  color: #cbd5e1;
  margin-top: 4px;
  line-height: 1.45;
}

/* Empty */
.analysis-empty {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: #d7e4ff;
  font-size: 13px;
  line-height: 1.6;
}

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

/* ------- Responsive ------- */
@media (max-width: 1080px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .chart-area {
    height: 380px;
  }
}

@media (min-width: 1820px) {
  .side-ad {
    position: fixed;
    top: 110px;
    z-index: 20;
    display: block;
  }

  .side-ad-left {
    left: max(20px, calc((100vw - 1200px) / 2 - 330px));
  }

  .side-ad-right {
    right: max(20px, calc((100vw - 1200px) / 2 - 330px));
  }
}

@media (max-width: 760px) {
  .page {
    padding: 12px 12px 82px;
  }

  .hero {
    padding: 22px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .search-row {
    flex-direction: column;
  }

  .search-row button {
    width: 100%;
  }

  .panel {
    padding: 18px;
  }

  .chart-panel .panel-head {
    flex-direction: column;
  }

  .price-block {
    text-align: left;
  }

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

  .mini-metrics,
  .analysis-grid {
    grid-template-columns: 1fr 1fr;
  }

  .chart-area {
    height: 340px;
  }
}

@media (max-width: 520px) {
  .scroll-top-btn {
    right: 16px;
    bottom: 18px;
    width: 42px;
    height: 42px;
    font-size: 21px;
  }
  .panel-head.compact {
    align-items: flex-start;
  }
  .panel-head.compact > div:first-child {
    flex-basis: 100%;
  }
  .analysis-head-right {
    width: 100%;
    justify-content: flex-end;
  }
  .mini-metrics,
  .analysis-grid {
    grid-template-columns: 1fr;
  }
  .long-grid {
    grid-template-columns: 1fr;
  }
  .analysis-summary {
    padding: 16px 16px 16px 22px;
    font-size: 14px;
  }
  .sec-card { padding: 14px 14px 14px 18px; }

  .ohlc-line {
    gap: 10px;
    font-size: 11px;
  }

  .chart-area {
    height: 300px;
  }
}

.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-card.share-confirm-card,
.modal-card.action-confirm-card,
.modal-card.message-card {
  width: min(440px, calc(100vw - 32px));
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
  flex-shrink: 0;
}
.modal-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}
.modal-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 8px 12px;
  margin: -8px -12px -8px 0;
}
.modal-body {
  padding: 12px 20px 20px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.supply-detail-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  gap: 6px;
  padding: 0 0 12px;
  background: #fff;
  overflow-x: auto;
}
.supply-detail-tabs button {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.supply-detail-tabs button.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.22);
}
.supply-detail-panel {
  display: none;
}
.supply-detail-panel.active {
  display: block;
}
.supply-note {
  margin: 0 0 10px;
  padding: 8px 12px;
  background: #f1f5f9;
  border-left: 3px solid var(--muted);
  border-radius: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.supply-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.supply-table th,
.supply-table td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.supply-table thead th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 42px;
}
.supply-table tbody td:first-child,
.supply-table thead th:first-child {
  text-align: left;
}
.supply-table .up { color: var(--red); font-weight: 600; }
.supply-table .down { color: var(--blue); font-weight: 600; }

/* 모바일: 바텀 시트 스타일 ──────────────────────────── */
@media (max-width: 640px) {
  .modal {
    padding: 0;
    align-items: flex-end;
  }
  .modal-backdrop {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
  }
  .modal-card {
    width: 100%;
    height: auto;
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.18);
    animation: sheetSlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }
  /* 드래그 핸들 — 시트임을 시각적으로 알려줌 */
  .modal-card::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 999px;
    margin: 10px auto 4px;
    flex-shrink: 0;
  }
  .modal-head {
    padding: 10px 18px 14px;
    border-bottom: 1px solid #f1f5f9;
  }
  .modal-head h3 {
    font-size: 15px;
    letter-spacing: -0.01em;
  }
  .modal-close {
    font-size: 24px;
    padding: 8px 10px;
    color: #94a3b8;
  }
  .modal-body {
    padding: 6px 14px 18px;
  }
  .supply-detail-tabs {
    margin: 0 -14px;
    padding: 0 14px 10px;
  }
  .supply-table thead th {
    top: 40px;
  }
  .action-confirm-modal,
  .share-confirm-modal,
  .message-modal {
    align-items: center;
    padding: 18px;
  }
  .action-confirm-modal .modal-card,
  .share-confirm-modal .modal-card,
  .message-modal .modal-card {
    width: min(440px, 100%);
    max-height: calc(100vh - 36px);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    animation: none;
  }
  .action-confirm-modal .modal-card::before,
  .share-confirm-modal .modal-card::before,
  .message-modal .modal-card::before {
    display: none;
  }
  .supply-table {
    font-size: 12px;
  }
  .supply-table th,
  .supply-table td {
    padding: 9px 8px;
    border-bottom: 1px solid #f1f5f9;
  }
  .supply-table thead th {
    background: #f8fafc;
    font-size: 11px;
    color: #64748b;
    text-transform: none;
    letter-spacing: 0;
  }
  /* 줄무늬 — 가독성 향상 */
  .supply-table tbody tr:nth-child(odd) {
    background: #fcfcfd;
  }
  .supply-table tbody tr:nth-child(even) {
    background: #fff;
  }
  /* 숫자 폰트 — 살짝 두껍게, monospace 톤 */
  .supply-table tbody td:not(:first-child) {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
  }
  /* 색상 강조 — 빨강/파랑 */
  .supply-table .up { color: #ef4444; }
  .supply-table .down { color: #3b82f6; }
  /* 날짜 컬럼 좌측 고정 + 디자인 */
  .supply-table tbody td:first-child,
  .supply-table thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    font-weight: 700;
    color: #0f172a;
  }
  .supply-table tbody tr:nth-child(odd) td:first-child {
    background: #fcfcfd;
  }
  .supply-table tbody tr:nth-child(even) td:first-child {
    background: #fff;
  }
  .supply-table thead th:first-child {
    background: #f8fafc;
    z-index: 3;
    color: #64748b;
  }
  /* 우측 그림자 — 좌측 고정 컬럼과 나머지 분리 시각 효과 */
  .supply-table tbody td:first-child::after,
  .supply-table thead th:first-child::after {
    content: '';
    position: absolute;
    top: 0;
    right: -8px;
    width: 8px;
    height: 100%;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.06), transparent);
    pointer-events: none;
  }
}

@keyframes sheetSlideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.analysis-overlay[hidden] { display: none; }
.analysis-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.analysis-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(3px);
}

.analysis-overlay-card {
  position: relative;
  width: min(420px, 100%);
  padding: 26px 24px 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(11, 18, 36, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.32);
  text-align: center;
  color: #f8fbff;
}

.analysis-overlay-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.analysis-overlay-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.analysis-overlay-card strong {
  display: block;
  margin-top: 14px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.analysis-overlay-card p {
  margin: 8px 0 0;
  color: #c9d6ef;
  font-size: 14px;
  line-height: 1.5;
}

.analysis-overlay-timer {
  margin-top: 10px;
  color: #8fb4ff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.analysis-overlay-ad-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(143, 180, 255, 0.18);
  color: #ffd97a;
  font-size: 13px;
  font-weight: 600;
}

.analysis-overlay-ad {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(143, 180, 255, 0.18);
}

.analysis-overlay-ad-label {
  margin-bottom: 8px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.analysis-overlay-ad-slot {
  min-height: 90px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.analysis-overlay-ad-slot:empty::before {
  content: "광고 영역";
  display: grid;
  place-items: center;
  min-height: 90px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.analysis-spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.14);
  border-top-color: #60a5fa;
  border-right-color: #22c55e;
  animation: analysis-spin 0.9s linear infinite;
}

body.analysis-busy {
  overflow: hidden;
}

body.analysis-busy .page {
  pointer-events: none;
  user-select: none;
}

body.analysis-busy .analysis-overlay {
  pointer-events: auto;
}

@keyframes analysis-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
