:root {
  color-scheme: light;
  --bg: #eef2f0;
  --surface: #ffffff;
  --surface-strong: #f7faf8;
  --ink: #17211d;
  --muted: #64736d;
  --line: #dce5e1;
  --green: #0f8a5f;
  --red: #c64545;
  --amber: #bc7a16;
  --teal: #0a7c83;
  --navy: #26354a;
  --shadow: 0 18px 50px rgba(31, 47, 40, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 84% 18%, rgba(198, 69, 69, 0.14), transparent 30%),
    linear-gradient(135deg, rgba(38, 53, 74, 0.08) 0 12%, transparent 12% 100%),
    linear-gradient(rgba(238, 242, 240, 0.95), rgba(238, 242, 240, 0.98));
  background-size: cover;
  background-position: center;
  color: var(--ink);
  font-family:
    "Noto Sans TC",
    "Microsoft JhengHei",
    system-ui,
    sans-serif;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 26px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
}

.brand-title,
.brand-subtitle,
.eyebrow,
.section-label,
.panel-label {
  margin: 0;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
}

.brand-subtitle,
.section-label,
.panel-label,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
}

.nav-item svg,
button svg,
.sector-card svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 2;
}

.nav-item.active,
.nav-item:hover {
  background: #fdeaea;
  color: var(--red);
}

.nav-watchlist {
  border: 1px solid rgba(198, 69, 69, 0.18);
  background: rgba(255, 255, 255, 0.72);
}

.side-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.panel-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.main {
  padding: 28px;
}

.topbar,
.board-header,
.section-heading,
.toolbar,
.market-notes,
.sector-card div,
.compact,
.watchlist-actions {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.05;
}

h2 {
  font-size: 22px;
}

.toolbar {
  gap: 10px;
}

.icon-button,
.primary-button,
.ghost-button,
.segmented button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

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

.market-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) minmax(260px, 0.8fr) minmax(280px, 0.9fr);
  gap: 16px;
}

.index-board,
.signal-board,
.briefing,
.watchlist,
.event-panel,
.sector-card {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.index-board,
.signal-board,
.briefing,
.watchlist,
.event-panel {
  padding: 20px;
}

.board-header,
.section-heading {
  justify-content: space-between;
  gap: 14px;
}

.index-value {
  margin-top: 8px;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 900;
  line-height: 1;
}

.status-pill {
  border-radius: 999px;
  padding: 7px 10px;
  color: #fff;
  font-weight: 900;
}

.status-pill.up {
  background: var(--red);
}

.status-pill.down {
  background: var(--green);
}

.market-kline-panel {
  position: relative;
  height: 260px;
  margin: 22px 0 18px;
  padding: 10px 8px 6px;
  border: 1px solid rgba(87, 116, 111, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(239, 248, 244, 0.82), rgba(249, 251, 250, 0.96)),
    #f7faf8;
}

.market-index-tabs {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(29, 48, 64, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(29, 48, 64, 0.08);
}

.market-index-tabs button {
  border: 0;
  border-radius: 6px;
  padding: 5px 9px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.market-index-tabs button.active {
  color: #fff;
  background: #20344e;
}

#market-kline-chart {
  display: block;
  width: 100%;
  height: 100%;
}

.market-notes {
  justify-content: space-between;
  gap: 12px;
}

.market-notes div {
  min-width: 0;
}

.market-notes strong,
.market-notes span {
  display: block;
}

.market-notes strong {
  color: var(--muted);
  font-size: 13px;
}

.market-notes span {
  margin-top: 4px;
  font-weight: 900;
}

.signal-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.signal-item {
  padding: 14px;
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  background: var(--surface-strong);
}

.signal-item span,
.signal-item strong {
  display: block;
}

.signal-item span {
  color: var(--muted);
  font-size: 13px;
}

.signal-item strong {
  margin-top: 4px;
  font-size: 17px;
}

.risk-score-list {
  display: grid;
  gap: 6px;
  margin-top: 2px;
  width: 100%;
}

.risk-score {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) minmax(32px, auto) 34px;
  width: min(100%, 240px);
  height: 32px;
  align-items: center;
  column-gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.signal-item .risk-score,
.signal-item .risk-score-name,
.signal-item .risk-score-value,
.signal-item .risk-lights {
  display: grid;
}

.signal-item .risk-lights {
  display: inline-flex;
  flex-direction: row;
}

.risk-score-name,
.risk-score-value,
.risk-lights {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-score-value {
  justify-self: end;
  font-variant-numeric: tabular-nums;
}

.risk-lights {
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 3px;
  width: 32px;
}

.risk-lights i {
  display: block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.72), 0 0 8px currentColor;
}

.risk-score.fallback {
  border-color: rgba(15, 138, 95, 0.28);
  background: #eef8f3;
}

.risk-score.safe {
  border-color: rgba(15, 138, 95, 0.26);
  background: #eef8f3;
}

.risk-score.safe .risk-lights i {
  background: var(--green);
  color: var(--green);
}

.risk-score.caution {
  border-color: rgba(188, 122, 22, 0.3);
  background: #fff7e8;
}

.risk-score.caution .risk-lights i {
  background: #d9a11b;
  color: #d9a11b;
}

.risk-score.warning {
  border-color: rgba(188, 122, 22, 0.34);
  background: #fff1dc;
}

.risk-score.warning .risk-lights i {
  background: var(--amber);
  color: var(--amber);
}

.risk-score.danger {
  border-color: rgba(198, 69, 69, 0.32);
  background: #fdecec;
}

.risk-score.danger .risk-lights i {
  background: var(--red);
  color: var(--red);
}

.risk-score.unknown .risk-lights i {
  background: var(--muted);
  color: var(--muted);
}

.signal-item.hot {
  border-color: var(--red);
}

.signal-item.warn {
  border-color: var(--green);
}

.briefing p:last-child {
  margin: 12px 0 0;
  color: #384842;
  font-size: 14px;
  line-height: 1.65;
}

.market-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 56px;
  gap: 6px;
  margin-top: 16px;
}

.tile {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 6px;
  background: #dce5e1;
  color: #fff;
  line-height: 1.15;
  overflow: hidden;
}

.tile strong,
.tile small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile strong {
  font-size: 13px;
  font-weight: 900;
}

.tile small {
  font-size: 12px;
  font-weight: 800;
  opacity: 0.92;
}

.tile.strong {
  background: linear-gradient(135deg, #c64545, #a93737);
}

.tile.mid {
  background: linear-gradient(135deg, #0a7c83, #09646a);
}

.tile.weak {
  background: linear-gradient(135deg, #2f9a72, #247c5c);
}

.tile.flat {
  background: linear-gradient(135deg, #bc7a16, #9c6110);
}

.section-row,
.workspace {
  margin-top: 18px;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
}

.segmented button {
  min-width: 58px;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: var(--navy);
  color: #fff;
}

.sector-momentum-section {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.momentum-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.momentum-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 58px;
  gap: 12px;
  min-height: 148px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.momentum-card.positive {
  border-color: rgba(198, 69, 69, 0.28);
}

.momentum-card.negative {
  border-color: rgba(15, 138, 95, 0.28);
}

.momentum-rank,
.momentum-score {
  font-weight: 900;
}

.momentum-rank {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
}

.momentum-body {
  min-width: 0;
}

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

.momentum-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.momentum-title span {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.momentum-bar {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce5e1;
}

.momentum-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--red));
}

.momentum-meta,
.momentum-detail,
.momentum-empty {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.momentum-detail {
  color: #384842;
}

.momentum-score {
  align-self: start;
  justify-self: end;
  color: var(--red);
  font-size: 24px;
  line-height: 1;
}

.momentum-card.negative .momentum-score {
  color: var(--green);
}

.momentum-empty {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  font-weight: 800;
}

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

.sector-card {
  min-height: 164px;
  padding: 16px;
  border-color: var(--line);
}

.sector-card div {
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.sector-card strong {
  display: block;
  margin-top: 16px;
  font-size: 24px;
}

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

.sector-card.positive {
  border-color: rgba(198, 69, 69, 0.26);
  background: linear-gradient(180deg, rgba(198, 69, 69, 0.1), rgba(255, 255, 255, 0.94));
}

.sector-card.negative {
  border-color: rgba(15, 138, 95, 0.26);
  background: linear-gradient(180deg, rgba(15, 138, 95, 0.1), rgba(255, 255, 255, 0.94));
}

.sector-card.neutral {
  border-color: rgba(188, 122, 22, 0.26);
  background: linear-gradient(180deg, rgba(188, 122, 22, 0.1), rgba(255, 255, 255, 0.94));
}

.positive strong {
  color: var(--red);
}

.negative strong,
.down-text {
  color: var(--green);
}

.neutral strong,
.flat-text {
  color: var(--amber);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 16px;
}

.watchlist-page {
  grid-template-columns: minmax(0, 1fr);
}

.table {
  display: grid;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: 0.7fr 1fr 0.85fr 0.85fr 1fr 52px;
  gap: 10px;
  min-height: 48px;
  align-items: center;
  padding: 0 14px;
  border-top: 1px solid var(--line);
}

.table-row:first-child {
  border-top: 0;
}

.table-row-pending {
  background: #fff8ea;
}

.table-head {
  background: #f1f6f4;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.up-text {
  color: var(--red);
}

.watchlist {
  min-width: 0;
}

.watchlist-heading {
  align-items: flex-start;
}

.watchlist-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.watchlist-form,
.group-name-form {
  display: grid;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.watchlist-form {
  grid-template-columns: minmax(140px, 1fr) minmax(150px, 0.85fr) minmax(150px, 0.85fr) auto;
  margin-top: 16px;
}

.group-name-form {
  grid-template-columns: minmax(180px, 1fr) auto;
  margin-top: 10px;
}

.watchlist-form label,
.group-name-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.watchlist-form label span,
.group-name-form label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.watchlist-form input,
.watchlist-form select,
.group-name-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.group-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.group-tabs button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.group-tabs button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.group-tabs button small {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: rgba(32, 52, 78, 0.08);
  color: inherit;
  font-size: 11px;
}

.group-tabs button.active {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.group-tabs button.active small {
  background: rgba(255, 255, 255, 0.18);
}

#watchlist-rows {
  display: grid;
}

.data-status-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 20px;
  align-items: center;
  margin-top: 4px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.data-status-badge.pending {
  border: 1px solid #f0c66d;
  background: #fff1c7;
  color: #815b00;
}

.remove-stock {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green);
}

.empty-state {
  display: none;
  margin: 12px 0 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-weight: 800;
}

.empty-state.show {
  display: block;
}

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

.timeline {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.timeline div {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

time {
  color: var(--teal);
  font-weight: 900;
}

.timeline span {
  color: #384842;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 14px;
  }

  .nav-list {
    display: flex;
  }

  .side-panel {
    display: none;
  }

  .market-grid,
  .workspace {
    grid-template-columns: 1fr;
  }

  .momentum-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sector-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .topbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    width: 100%;
  }

  .primary-button {
    flex: 1;
  }

  .market-notes,
  .momentum-list,
  .sector-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .table {
    overflow-x: auto;
  }

  .table-row {
    min-width: 760px;
  }

  .watchlist-actions {
    justify-content: flex-start;
  }

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

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

.stock-link,
.back-link {
  color: var(--red);
  font-weight: 900;
  text-decoration: none;
}

.stock-link:hover,
.back-link:hover {
  text-decoration: underline;
}

.stock-page {
  min-height: 100vh;
}

.stock-main {
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.stock-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
}

.stock-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 10px;
  min-width: min(520px, 100%);
}

.stock-summary div {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.stock-summary span,
.stock-summary strong {
  display: block;
}

.stock-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stock-summary strong {
  margin-top: 5px;
  font-size: 22px;
}

.chart-dashboard {
  display: grid;
  gap: 14px;
}

.stock-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 14px;
  align-items: start;
}

.stock-chart-column {
  min-width: 0;
}

.company-info-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.info-card {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.company-card h2,
.info-card h3 {
  margin: 0;
}

.company-card p:not(.section-label) {
  margin: 8px 0 0;
  color: #384842;
  font-size: 14px;
  line-height: 1.6;
}

.info-pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.info-pill-row span {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.info-card-heading {
  margin-bottom: 12px;
}

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

.analysis-metric {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.analysis-metric span,
.analysis-metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.analysis-metric strong {
  display: block;
  margin: 4px 0;
  color: var(--ink);
  font-size: 17px;
}

.analysis-section {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.analysis-section:first-of-type {
  margin-top: 0;
}

.analysis-section strong {
  color: var(--ink);
  font-size: 13px;
}

.analysis-section ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 17px;
  color: #384842;
  font-size: 13px;
  line-height: 1.55;
}

.technical-summary {
  display: grid;
  gap: 7px;
}

.technical-summary div {
  padding: 9px 10px;
  border-left: 3px solid var(--teal);
  border-radius: 8px;
  background: var(--surface-strong);
  color: #384842;
  font-size: 13px;
  line-height: 1.5;
}

.analysis-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

.chart-panel {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.chart-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.time-range-controls {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.time-range-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 54px;
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.time-range-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.time-range-button.active,
.time-range-button:hover {
  background: var(--navy);
  color: #fff;
}

.chart-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.chart-panel canvas {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.chart-error {
  margin: 12px 0 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 760px) {
  .stock-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .stock-summary {
    grid-template-columns: 1fr;
  }

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

  .chart-toolbar {
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
  }

  .chart-note {
    line-height: 1.5;
  }
}
.ohlc-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.ohlc-panel-top {
  margin-bottom: 14px;
}

.ohlc-panel div {
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(235, 244, 240, 0.86));
  box-shadow: var(--shadow);
}

.ohlc-panel span,
.ohlc-panel strong {
  display: block;
}

.ohlc-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.ohlc-panel strong {
  margin-top: 6px;
  font-size: 24px;
  line-height: 1.1;
}

@media (max-width: 900px) {
  .ohlc-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stock-detail-grid {
    grid-template-columns: 1fr;
  }

  .company-info-panel {
    order: -1;
  }
}
#combo-chart {
  height: 640px;
}

@media (max-width: 760px) {
  #combo-chart {
    height: 600px;
  }
}
