:root {
  color-scheme: light;
  --ink: #17211c;
  --muted: #6f7c75;
  --line: #dfe8e2;
  --surface: #ffffff;
  --canvas: #f3f7f4;
  --green: #087f5b;
  --green-bright: #12a879;
  --green-soft: #e8f7f1;
  --red: #d94c4c;
  --red-soft: #fff0f0;
  --blue: #3978d2;
  --amber: #d58a15;
  --purple: #8057c7;
  --pink: #cc5890;
  --shadow: 0 18px 55px rgba(26, 58, 42, 0.08);
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(18, 168, 121, 0.08), transparent 31rem),
    linear-gradient(180deg, #f8faf8 0, var(--canvas) 28rem);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

.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;
}

.site-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.site-header {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  position: relative;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  border-radius: 14px 14px 14px 5px;
  box-shadow: 0 9px 22px rgba(8, 127, 91, 0.25);
}

.brand-mark svg {
  width: 23px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 20px;
  letter-spacing: 0.03em;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.12em;
  margin-top: 3px;
}

.header-tools {
  width: min(630px, 100%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.header-tools .search-wrap {
  width: auto;
  flex: 1;
}

.news-link {
  width: auto;
  height: 50px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(31, 65, 48, 0.06);
  text-decoration: none;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.news-link:hover,
.news-link:focus-visible {
  color: white;
  background: var(--green);
  border-color: var(--green);
  transform: translateY(-2px);
}

.news-link svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.news-link span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.search-wrap {
  width: min(390px, 100%);
  position: relative;
}

.search-form {
  height: 50px;
  display: flex;
  align-items: center;
  position: relative;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(31, 65, 48, 0.06);
  transition: 160ms ease;
}

.search-form:focus-within {
  border-color: rgba(8, 127, 91, 0.7);
  box-shadow: 0 0 0 4px rgba(8, 127, 91, 0.09), 0 8px 30px rgba(31, 65, 48, 0.07);
}

.search-icon {
  width: 19px;
  position: absolute;
  left: 16px;
  color: #8c9992;
}

.search-form input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 82px 0 46px;
  color: var(--ink);
  font-size: 14px;
}

.search-form input::placeholder {
  color: #9ba69f;
}

.search-form input::-webkit-search-cancel-button {
  display: none;
}

.clear-button,
.search-button {
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.clear-button {
  width: 30px;
  height: 30px;
  position: absolute;
  right: 46px;
  color: #8b9690;
  background: transparent;
  border-radius: 9px;
}

.clear-button:hover {
  background: #f0f3f1;
  color: var(--ink);
}

.clear-button svg {
  width: 16px;
}

.search-button {
  width: 36px;
  height: 36px;
  position: absolute;
  right: 7px;
  color: white;
  background: var(--green);
  border-radius: 11px;
  transition: 150ms ease;
}

.search-button:hover {
  background: #066b4d;
  transform: translateX(1px);
}

.search-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.search-button svg {
  width: 18px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.search-button.loading .arrow-icon {
  display: none;
}

.search-button.loading .spinner {
  display: block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.search-results {
  width: 100%;
  max-height: 320px;
  overflow-y: auto;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  padding: 7px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  animation: menu-in 150ms ease both;
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-5px); }
}

.search-option {
  width: 100%;
  border: 0;
  padding: 11px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border-radius: 11px;
  cursor: pointer;
  text-align: left;
}

.search-option:hover,
.search-option:focus-visible {
  background: var(--green-soft);
  outline: 0;
}

.search-option strong {
  font-size: 14px;
}

.search-option span {
  color: var(--muted);
  font: 600 12px ui-monospace, SFMono-Regular, Consolas, monospace;
}

main {
  flex: 1;
}

.error-banner {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  color: #a92f2f;
  background: var(--red-soft);
  border: 1px solid #ffd8d8;
  border-radius: 14px;
  font-size: 14px;
}

.error-banner svg {
  width: 20px;
  flex: 0 0 auto;
}

.empty-state {
  min-height: 610px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 70px 20px;
}

.empty-visual {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  margin-bottom: 30px;
  color: var(--green);
  background: linear-gradient(145deg, #effaf5, #d8f2e6);
  border: 1px solid rgba(8, 127, 91, 0.11);
  border-radius: 44px 44px 44px 12px;
  box-shadow: 0 22px 60px rgba(8, 127, 91, 0.13);
}

.empty-visual svg {
  width: 68px;
  stroke-width: 2.1;
}

.eyebrow,
.section-label {
  margin: 0;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.empty-state h1 {
  margin: 9px 0 10px;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.04em;
}

.empty-state > p:not(.eyebrow) {
  width: min(520px, 100%);
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.quick-start {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 29px;
}

.quick-start button {
  border: 1px solid var(--line);
  padding: 9px 13px;
  color: #415049;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.quick-start button:hover {
  color: var(--green);
  border-color: rgba(8, 127, 91, 0.3);
  background: white;
}

.quick-start span {
  margin-left: 5px;
  color: #8c9892;
  font-family: ui-monospace, monospace;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas:
    "market side"
    "advertisement side";
  gap: 22px;
  align-items: start;
  animation: dashboard-in 300ms ease both;
}

.dashboard-main {
  display: contents;
}

@keyframes dashboard-in {
  from { opacity: 0; transform: translateY(8px); }
}

.market-card,
.indicator-card,
.sentiment-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(216, 227, 220, 0.85);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.market-card {
  grid-area: market;
  padding: 30px;
}

.stock-summary {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e9efeb;
}

.stock-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 11px;
}

.stock-heading h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 39px);
  letter-spacing: -0.04em;
}

.stock-heading > span {
  color: #85918b;
  font: 600 17px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.live-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 13px;
  margin-top: 13px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  color: #087253;
  background: var(--green-soft);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}

.live-badge i {
  width: 6px;
  height: 6px;
  background: var(--green-bright);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(18, 168, 121, 0.12);
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 2px;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.text-button:hover {
  color: var(--green);
}

.text-button svg {
  width: 14px;
}

.text-button.loading svg {
  animation: spin 0.7s linear infinite;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.toggle-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle {
  width: 28px;
  height: 17px;
  position: relative;
  background: #ccd5d0;
  border-radius: 20px;
  transition: 160ms ease;
}

.toggle::after {
  content: "";
  width: 11px;
  height: 11px;
  position: absolute;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: 160ms ease;
}

.toggle-label input:checked + .toggle {
  background: var(--green);
}

.toggle-label input:checked + .toggle::after {
  transform: translateX(11px);
}

.price-block {
  min-width: 185px;
  text-align: right;
}

.price-block strong {
  display: block;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.price-change {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.price-change.up { color: var(--red); }
.price-change.down { color: var(--green); }
.price-change.neutral { color: var(--muted); }

.price-block small {
  display: block;
  margin-top: 5px;
  color: #929d97;
  font-size: 11px;
}

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

.intraday-note {
  display: inline-block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.range-picker {
  display: flex;
  padding: 4px;
  background: #f0f4f1;
  border-radius: 11px;
}

.range-picker button {
  min-width: 43px;
  padding: 7px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.range-picker button:hover {
  color: var(--ink);
}

.range-picker button.active {
  color: var(--green);
  background: white;
  box-shadow: 0 3px 9px rgba(39, 70, 54, 0.09);
}

.chart-legend {
  min-height: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-item i {
  width: 15px;
  height: 2px;
  background: var(--legend-color);
  border-radius: 2px;
}

.chart-box {
  width: 100%;
  position: relative;
}

.price-chart-box {
  height: 345px;
}

.rsi-chart-box {
  height: 140px;
}

.chart-box canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
}

.chart-tooltip {
  min-width: 148px;
  max-width: 205px;
  position: absolute;
  z-index: 5;
  pointer-events: none;
  padding: 10px 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 10px 30px rgba(27, 51, 39, 0.15);
  backdrop-filter: blur(8px);
  font-size: 10px;
}

.tooltip-date {
  padding-bottom: 6px;
  margin-bottom: 5px;
  color: var(--muted);
  border-bottom: 1px solid #ebefec;
  font-weight: 700;
}

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

.tooltip-row strong {
  color: var(--tooltip-color, var(--ink));
  font-variant-numeric: tabular-nums;
}

.rsi-section {
  margin-top: 34px;
  padding-top: 25px;
  border-top: 1px solid #e9efeb;
}

.rsi-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.rsi-heading > div > span,
.card-heading > div > span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.threshold-labels {
  display: flex;
  gap: 14px;
  font-size: 9px;
  font-weight: 750;
}

.threshold-labels span:first-child { color: var(--red); }
.threshold-labels span:last-child { color: var(--blue); }

.dashboard-side {
  grid-area: side;
  display: grid;
  gap: 22px;
  min-width: 0;
}

.ad-card {
  min-width: 0;
  min-height: 320px;
  grid-area: advertisement;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  padding: 23px 25px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(216, 227, 220, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.ad-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.ad-card-heading h2 {
  margin: 5px 0 0;
  font-size: 18px;
}

.ad-card-heading > span {
  padding: 5px 9px;
  color: #738078;
  background: #eef3f0;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.ad-slot {
  min-width: 0;
  min-height: 250px;
  flex: 1;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(8, 127, 91, 0.035), rgba(8, 127, 91, 0.008)),
    #f8faf9;
  border: 1px dashed #d7e2dc;
  border-radius: 18px;
}

.ad-slot::before {
  content: "ADVERTISEMENT";
  position: absolute;
  color: #b8c3bd;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.ad-slot .adsbygoogle {
  width: 100%;
  min-height: 250px;
  position: relative;
  z-index: 1;
}

.dashboard-side > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.indicator-card {
  padding: 25px;
}

.sentiment-card {
  padding: 25px;
}

.sentiment-heading,
.sentiment-title,
.sentiment-scale {
  display: flex;
  align-items: center;
}

.sentiment-heading {
  justify-content: space-between;
  gap: 12px;
}

.sentiment-title {
  gap: 9px;
}

.sentiment-title h2 {
  margin: 0;
  font-size: 18px;
}

.sentiment-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--green);
}

.sentiment-icon svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sentiment-state {
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 10px;
}

.sentiment-state.greed { color: #087253; background: #dcf8ec; border: 1px solid #9ce6ca; }
.sentiment-state.fear { color: #b73535; background: #ffebeb; border: 1px solid #f5baba; }
.sentiment-state.neutral { color: #58645d; background: #edf1ef; border: 1px solid #dae2de; }

.sentiment-scale {
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
  font-size: 10px;
}

.sentiment-scale span:first-child { color: var(--red); }
.sentiment-scale span:last-child { color: var(--green); }

.sentiment-scale strong {
  color: var(--green);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.sentiment-track {
  height: 11px;
  margin-top: 8px;
  overflow: hidden;
  background: linear-gradient(90deg, #f6c4c4, #f2e4c7 48%, #caeadf);
  border: 1px solid rgba(198, 215, 205, 0.8);
  border-radius: 999px;
}

.sentiment-track i {
  width: 0;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, #41b993, #18aa7c);
  border-radius: inherit;
  transition: width 420ms ease;
}

.sentiment-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 17px;
}

.sentiment-metrics > div {
  min-width: 0;
  padding: 13px;
  background: #f7f8f7;
  border-radius: 13px;
}

.sentiment-metrics span {
  display: block;
  color: #89958f;
  font-size: 10px;
}

.sentiment-metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.sentiment-metrics strong.positive { color: #009b69; }
.sentiment-metrics strong.negative { color: #c34242; }

.sentiment-note {
  margin: 16px 0 0;
  padding: 13px;
  color: #65736c;
  background: #fbfcfb;
  border: 1px solid #edf1ef;
  border-radius: 13px;
  font-size: 10px;
  line-height: 1.7;
}

.card-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
}

.heading-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 10px;
}

.heading-icon svg {
  width: 18px;
}

.ma-list {
  display: grid;
  gap: 3px;
}

.ma-row {
  min-height: 59px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eef2ef;
}

.ma-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ma-color {
  width: 3px;
  height: 31px;
  background: var(--ma-color);
  border-radius: 3px;
}

.ma-copy span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.ma-copy strong {
  display: block;
  margin-top: 3px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.status-pill {
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.status-pill.above {
  color: #087253;
  background: var(--green-soft);
}

.status-pill.below {
  color: #a83434;
  background: #ffeded;
}

.rsi-summary {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
  padding: 12px 13px;
  background: #f5f7f5;
  border-radius: 12px;
}

.rsi-summary span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.rsi-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

.rsi-state {
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 850;
}

.rsi-state.high { color: #ad3434; background: #ffe7e7; }
.rsi-state.low { color: #2265b7; background: #e5f0ff; }
.rsi-state.mid { color: #58645d; background: #e7ece9; }

.disclaimer {
  margin: 19px 0 0;
  padding: 13px;
  color: #587168;
  background: #eff8f4;
  border-left: 3px solid #6ab497;
  border-radius: 4px 10px 10px 4px;
  font-size: 10px;
  line-height: 1.65;
}

.watchlist-card {
  width: 100%;
  max-width: 100%;
  padding: 23px 25px;
  overflow-x: clip;
  contain: inline-size;
  isolation: isolate;
  color: white;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.13), transparent 12rem),
    #0a7456;
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(8, 101, 75, 0.18);
}

.watchlist-card > *,
.watchlist-card .google-auto-placed,
.watchlist-card ins.adsbygoogle,
.watchlist-card iframe {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.watchlist-card .section-label {
  color: #9ee1c9;
}

.watchlist-card h2 {
  margin: 5px 0 15px;
  font-size: 19px;
}

.watchlist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.watchlist button {
  padding: 9px 10px;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
}

.watchlist button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.watchlist span,
.watchlist b {
  display: block;
}

.watchlist span {
  font-size: 11px;
  font-weight: 700;
}

.watchlist b {
  margin-top: 3px;
  color: #aee4d1;
  font: 600 9px ui-monospace, monospace;
}

.comparison-section {
  margin-top: 28px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(216, 227, 220, 0.9);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.comparison-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.comparison-heading h2 {
  margin: 5px 0 6px;
  font-size: clamp(23px, 3vw, 32px);
  letter-spacing: -0.035em;
}

.comparison-heading > div:first-child > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.comparison-presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.comparison-presets button,
.comparison-range button {
  padding: 7px 11px;
  color: #547067;
  background: #f2f7f4;
  border: 1px solid #dfe9e3;
  border-radius: 9px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.comparison-presets button:hover,
.comparison-presets button:focus-visible,
.comparison-presets button.active,
.comparison-range button:hover,
.comparison-range button:focus-visible,
.comparison-range button.active {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.comparison-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) auto;
  gap: 10px;
  margin-top: 24px;
}

.comparison-form label {
  min-width: 0;
}

.comparison-form label span {
  display: block;
  margin: 0 0 6px 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.comparison-input {
  width: 100%;
  height: 45px;
  padding: 0 13px;
  color: var(--ink);
  background: #f8faf9;
  border: 1px solid #dfe8e3;
  border-radius: 12px;
  outline: none;
  font: 750 13px ui-monospace, SFMono-Regular, Consolas, monospace;
  text-transform: uppercase;
}

.comparison-input:focus {
  border-color: rgba(8, 127, 91, 0.7);
  box-shadow: 0 0 0 4px rgba(8, 127, 91, 0.08);
}

.comparison-submit {
  min-width: 112px;
  height: 45px;
  align-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  color: white;
  background: var(--green);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 9px 22px rgba(8, 127, 91, 0.2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.comparison-submit:hover { background: #076e4f; }
.comparison-submit:disabled { cursor: wait; opacity: 0.75; }
.comparison-submit.loading .spinner { display: block; }

.comparison-message {
  margin: 14px 0 0;
  padding: 11px 13px;
  color: #9f3434;
  background: #fff0f0;
  border: 1px solid #f4caca;
  border-radius: 10px;
  font-size: 11px;
}

.comparison-results {
  margin-top: 25px;
  padding-top: 22px;
  border-top: 1px solid #e9efeb;
}

.comparison-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.comparison-toolbar > span {
  color: var(--muted);
  font-size: 10px;
}

.comparison-range {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.comparison-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  margin-top: 17px;
}

.comparison-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #5e6c65;
  font-size: 11px;
  font-weight: 750;
}

.comparison-legend i {
  width: 20px;
  height: 3px;
  background: var(--comparison-color);
  border-radius: 3px;
}

.comparison-chart-box {
  height: 320px;
  margin-top: 12px;
  padding: 12px 0 0;
  background: linear-gradient(180deg, rgba(245, 250, 247, 0.7), rgba(255, 255, 255, 0));
  border-radius: 16px;
}

.comparison-chart-box canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.comparison-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.comparison-card {
  min-width: 0;
  padding: 17px;
  background: #f8faf9;
  border: 1px solid #e6ede9;
  border-top: 4px solid var(--comparison-color);
  border-radius: 15px;
}

.comparison-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.comparison-card-heading strong,
.comparison-card-heading span {
  display: block;
}

.comparison-card-heading strong {
  font-size: 15px;
}

.comparison-card-heading span {
  margin-top: 3px;
  color: var(--muted);
  font: 650 10px ui-monospace, monospace;
}

.comparison-return {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.comparison-return.positive { color: #008f62; }
.comparison-return.negative { color: #c34242; }

.comparison-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.comparison-stats div {
  padding: 9px;
  background: white;
  border-radius: 9px;
}

.comparison-stats span,
.comparison-stats strong {
  display: block;
}

.comparison-stats span {
  color: var(--muted);
  font-size: 9px;
}

.comparison-stats strong {
  margin-top: 4px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.comparison-mood {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}

.comparison-mood b {
  color: var(--ink);
  font-size: 11px;
}

.advanced-analysis {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 28px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(216, 227, 220, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.advanced-analysis-heading,
.analysis-card-heading,
.correlation-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.advanced-analysis-heading h2,
.analysis-card-heading h3,
.correlation-heading h3 {
  margin: 3px 0 0;
  letter-spacing: -0.025em;
}

.advanced-analysis-heading h2 { font-size: 24px; }
.analysis-card-heading h3,
.correlation-heading h3 { font-size: 17px; }

.advanced-analysis-heading > div > p:last-child,
.advanced-analysis-heading > span,
.analysis-card-heading > span,
.correlation-heading > span {
  color: var(--muted);
  font-size: 10px;
}

.advanced-analysis-heading > div > p:last-child {
  margin: 7px 0 0;
}

.performance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.performance-card {
  min-width: 0;
  padding: 17px;
  background: #f8faf9;
  border: 1px solid #e5ede8;
  border-top: 4px solid #a5b2ab;
  border-radius: 14px;
}

.performance-card.positive { border-top-color: var(--green); }
.performance-card.negative { border-top-color: var(--red); }
.performance-card span,
.performance-card strong,
.performance-card small { display: block; }

.performance-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.performance-card strong {
  margin-top: 7px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.performance-card.positive strong { color: var(--green); }
.performance-card.negative strong { color: #bd3c3c; }

.performance-card small {
  margin-top: 7px;
  overflow: hidden;
  color: #829088;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr);
  gap: 14px;
  margin-top: 14px;
}

.analysis-card,
.correlation-panel {
  min-width: 0;
  padding: 20px;
  background: #f8faf9;
  border: 1px solid #e5ede8;
  border-radius: 16px;
}

.technical-signal-list {
  display: grid;
  gap: 9px;
  margin-top: 17px;
}

.technical-signal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  background: white;
  border: 1px solid #e9efeb;
  border-left: 4px solid #9aa9a1;
  border-radius: 11px;
}

.technical-signal.positive { border-left-color: var(--green); }
.technical-signal.negative { border-left-color: var(--red); }
.technical-signal strong,
.technical-signal span { display: block; }
.technical-signal strong { font-size: 12px; }
.technical-signal span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.technical-signal b {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: #53645b;
  background: #edf2ef;
  border-radius: 999px;
  font-size: 9px;
}

.technical-signal.positive b { color: #087253; background: #e2f6ee; }
.technical-signal.negative b { color: #b33d3d; background: #fdeaea; }

.level-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 17px;
}

.level-summary > div {
  min-width: 0;
  padding: 13px 9px;
  text-align: center;
  background: white;
  border: 1px solid #e9efeb;
  border-radius: 11px;
}

.level-summary span,
.level-summary strong,
.level-summary small,
.level-summary b { display: block; }
.level-summary span { color: var(--muted); font-size: 9px; }
.level-summary strong { margin-top: 5px; font-size: 17px; font-variant-numeric: tabular-nums; }
.level-summary small { margin-top: 5px; color: #849089; font-size: 8px; }
.level-summary b { margin-top: 5px; font-size: 9px; }
.level-summary b.positive { color: var(--green); }
.level-summary b.negative { color: var(--red); }
.level-summary b.warning { color: var(--amber); }
.level-summary b.watch { color: var(--blue); }
.level-summary b.neutral { color: var(--muted); }

.level-track {
  position: relative;
  height: 7px;
  margin: 21px 5px 0;
  background: linear-gradient(90deg, #5c91d9, #dce7df 50%, #e7a33c);
  border-radius: 999px;
}

.level-track i {
  position: absolute;
  top: 50%;
  width: 15px;
  height: 15px;
  background: white;
  border: 4px solid var(--green);
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(23, 33, 28, 0.18);
  transform: translate(-50%, -50%);
}

.level-track-labels {
  display: flex;
  justify-content: space-between;
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 8px;
}

.monthly-analysis-card { margin-top: 14px; }
.monthly-heatmap-scroll,
.correlation-scroll { overflow-x: auto; }

.monthly-heatmap {
  display: grid;
  grid-template-columns: 64px repeat(12, minmax(51px, 1fr));
  gap: 5px;
  min-width: 790px;
  margin-top: 17px;
}

.heatmap-corner,
.heatmap-month,
.heatmap-year,
.heatmap-cell {
  display: grid;
  place-items: center;
  min-height: 35px;
  border-radius: 7px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.heatmap-corner,
.heatmap-month {
  min-height: 25px;
  color: var(--muted);
  font-weight: 800;
}

.heatmap-year {
  color: var(--ink);
  background: #edf2ef;
  font-weight: 850;
}

.heatmap-cell {
  color: #9aa59f;
  background: white;
  border: 1px solid #edf1ef;
  font-weight: 750;
}

.correlation-panel { margin-top: 14px; }
.correlation-matrix {
  width: 100%;
  min-width: 520px;
  margin-top: 16px;
  border-spacing: 5px;
  table-layout: fixed;
}

.correlation-matrix th,
.correlation-matrix td {
  height: 48px;
  padding: 8px;
  text-align: center;
  background: white;
  border-radius: 9px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.correlation-matrix thead th {
  height: 30px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
}

.correlation-matrix th:first-child {
  width: 150px;
  text-align: left;
}

.correlation-matrix tbody th strong,
.correlation-matrix tbody th span { display: block; }
.correlation-matrix tbody th strong { font-size: 11px; }
.correlation-matrix tbody th span {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.seo-guide {
  margin-top: 22px;
  padding: 30px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 247, 241, 0.7));
  border: 1px solid rgba(216, 227, 220, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.seo-guide h2 {
  margin: 4px 0 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.seo-guide > p:not(.eyebrow):not(.seo-disclaimer) {
  max-width: 850px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.seo-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.seo-feature-grid article {
  padding: 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #e2ebe5;
  border-radius: 13px;
}

.seo-feature-grid h3 {
  margin: 0;
  font-size: 13px;
}

.seo-feature-grid p,
.seo-disclaimer {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.seo-disclaimer {
  padding-top: 14px;
  border-top: 1px solid #dfe9e3;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 2px 35px;
  color: #8b9790;
  font-size: 10px;
}

footer p {
  margin: 0;
  color: #68756e;
  font-weight: 800;
}

footer a {
  color: var(--green);
  text-decoration: none;
}

footer a:hover,
footer a:focus-visible {
  text-decoration: underline;
}

@media (max-width: 950px) {
  .dashboard {
    grid-template-columns: 1fr;
    grid-template-areas:
      "market"
      "side"
      "advertisement";
  }

  .dashboard-side {
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  }

  .comparison-form {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
  }

  .comparison-submit {
    grid-column: 1 / -1;
  }

  .performance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-detail-grid { grid-template-columns: 1fr; }
  .seo-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .site-shell {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    padding: 22px 0;
  }

  .search-wrap {
    width: 100%;
  }

  .header-tools {
    width: 100%;
  }

  .empty-state {
    min-height: 520px;
    padding-top: 45px;
  }

  .empty-visual {
    width: 108px;
    height: 108px;
    border-radius: 35px 35px 35px 10px;
  }

  .empty-visual svg {
    width: 55px;
  }

  .market-card {
    padding: 20px 15px;
    border-radius: 20px;
  }

  .stock-summary {
    flex-direction: column;
  }

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

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

  .range-picker {
    width: 100%;
  }

  .range-picker button {
    min-width: 0;
    flex: 1;
  }

  .price-chart-box {
    height: 300px;
  }

  .dashboard-side {
    grid-template-columns: 1fr;
  }

  .indicator-card,
  .sentiment-card,
  .watchlist-card,
  .ad-card {
    padding: 20px;
  }

  .comparison-section {
    padding: 20px 15px;
    border-radius: 20px;
  }

  .comparison-heading,
  .comparison-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .comparison-presets {
    justify-content: flex-start;
  }

  .comparison-form {
    grid-template-columns: 1fr;
  }

  .comparison-submit {
    width: 100%;
    grid-column: auto;
  }

  .comparison-chart-box {
    height: 260px;
  }

  .comparison-cards {
    grid-template-columns: 1fr;
  }

  .advanced-analysis {
    padding: 20px 15px;
    border-radius: 20px;
  }

  .advanced-analysis-heading,
  .analysis-card-heading,
  .correlation-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .performance-grid { grid-template-columns: 1fr; }
  .analysis-card { padding: 16px; }
  .technical-signal { align-items: flex-start; flex-direction: column; }
  .level-summary { grid-template-columns: 1fr; }

  .seo-guide {
    padding: 20px 15px;
    border-radius: 20px;
  }

  .seo-feature-grid { grid-template-columns: 1fr; }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
}

@media (max-width: 480px) {
  .header-tools {
    display: grid;
    grid-template-columns: 1fr;
  }

  .news-link {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
