:root {
  --red: #c62828;
  --green: #2e7d32;
  --orange: #e65100;
  --blue: #1565c0;
  --text: #202124;
  --muted: #757575;
  --line: #e7e7e7;
  --bg: #f3f4f6;
  --card: #fff;
  --shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  width: min(720px, 100%);
  margin: 0 auto;
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

.search-panel {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: calc(14px + env(safe-area-inset-top)) 14px 12px;
  background: #c62828;
  color: #fff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.13);
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 21px;
  line-height: 1.2;
}

.search-panel p {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.search-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

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

input, button {
  border: 0;
  border-radius: 8px;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 12px;
  color: var(--text);
  font-size: 16px;
}

button {
  min-height: 44px;
  width: 72px;
  background: #fff;
  color: var(--red);
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
}

.suggest-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(320px, 58vh);
  overflow-y: auto;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.suggest-item + .suggest-item {
  border-top: 1px solid #f0f0f0;
}

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

.suggest-item strong {
  font-size: 14px;
}

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

.suggest-market {
  flex: none;
  color: var(--muted);
  font-size: 11px;
}

.status-text {
  min-height: 18px;
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.86);
}

.heartbeat-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
}

.heartbeat-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.heartbeat-toggle input {
  width: 14px;
  height: 14px;
  flex: none;
}

#heartbeatText {
  flex: 1;
  min-width: 0;
}

#refreshNow {
  width: auto;
  min-height: 32px;
  padding: 5px 9px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--red);
  font-size: 12px;
}

#refreshNow:disabled {
  background: rgba(255, 255, 255, 0.68);
  color: rgba(198, 40, 40, 0.72);
  cursor: default;
}

.hidden {
  display: none;
}

.tab-view.hidden {
  display: none;
}

.page-panel {
  padding: calc(18px + env(safe-area-inset-top)) 14px 16px;
  background: #c62828;
  color: #fff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.13);
}

.page-panel h1 {
  font-size: 22px;
}

.page-panel p {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
}

.inner-etf-view {
  min-height: 100vh;
  background: var(--bg);
}

.inner-etf-panel {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(16px + env(safe-area-inset-top)) 14px 14px;
}

.inner-etf-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inner-etf-title {
  flex: 1 1 auto;
  min-width: 0;
}

.inner-etf-panel h1 {
  font-size: 21px;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.inner-etf-panel p {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.inner-etf-back {
  width: 38px;
  min-height: 38px;
  flex: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  font-weight: 400;
}

.inner-etf-manual-pull {
  width: auto;
  min-width: 78px;
  min-height: 34px;
  flex: none;
  padding: 6px 10px;
  border-radius: 7px;
  background: #fff;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.inner-etf-manual-pull:disabled {
  background: rgba(255, 255, 255, 0.55);
  color: rgba(198, 40, 40, 0.72);
}

.inner-etf-section {
  padding: 12px 10px 0;
}

.inner-etf-status {
  padding: 20px 12px;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
  box-shadow: var(--shadow);
}

.inner-etf-status.hidden {
  display: none;
}

.inner-etf-sector-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.inner-etf-sector-list.hidden {
  display: none;
}

.inner-etf-sector-card {
  width: auto;
  min-height: 112px;
  padding: 13px 12px;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow);
}

.inner-etf-sector-card span,
.inner-etf-sector-card strong,
.inner-etf-sector-card em,
.inner-etf-sector-card small {
  display: block;
}

.inner-etf-sector-card span {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.inner-etf-sector-card strong {
  margin-top: 9px;
  color: var(--red);
  font-size: 25px;
  line-height: 1;
}

.inner-etf-sector-card em {
  margin-top: 8px;
  color: #6b7280;
  font-size: 12px;
  font-style: normal;
}

.inner-etf-sector-card small {
  margin-top: 4px;
  color: #9aa0a6;
  font-size: 11px;
}

.inner-etf-sector-card.active {
  box-shadow: inset 0 0 0 2px rgba(198, 40, 40, 0.72), var(--shadow);
}

.inner-etf-detail {
  margin-top: 12px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow-x: auto;
  overflow-y: hidden;
}

.inner-etf-result-page .inner-etf-detail {
  margin-top: 0;
}

.inner-etf-detail.hidden {
  display: none;
}

.inner-etf-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid #f0f1f3;
}

.inner-etf-detail-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.inner-etf-detail-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.inner-etf-detail-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
}

.inner-etf-detail-head button {
  width: auto;
  min-height: 30px;
  padding: 4px 9px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 12px;
}

.inner-etf-detail-head .outer-fund-realtime-refresh,
.inner-etf-detail-head .inner-etf-realtime-refresh {
  background: #fff2f2;
  color: var(--red);
  font-weight: 800;
}

.inner-etf-detail-head .outer-fund-realtime-refresh:disabled,
.inner-etf-detail-head .inner-etf-realtime-refresh:disabled {
  background: #f3f4f6;
  color: #9aa0a6;
}

.inner-etf-table-head,
.outer-fund-table-head,
.inner-etf-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 64px 68px 78px;
  align-items: center;
  gap: 7px;
}

.inner-etf-table-head,
.inner-etf-list {
  min-width: 420px;
}

.inner-etf-table-head,
.outer-fund-table-head {
  padding: 10px 12px;
  color: #9aa0a6;
  font-size: 12px;
}

.outer-fund-table-head,
.outer-fund-row {
  grid-template-columns: 50px minmax(0, 1fr) minmax(260px, 280px);
  gap: 8px;
}

.outer-fund-table-head {
  grid-template-columns: 50px minmax(0, 1fr) repeat(4, minmax(58px, 1fr));
}

.inner-etf-sort-bar,
.outer-fund-sort-bar {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
  border-bottom: 1px solid #f1f2f4;
  overflow-x: auto;
}

.inner-etf-sort-bar button,
.outer-fund-sort-bar button {
  width: auto;
  min-width: 64px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #edf0f4;
  border-radius: 6px;
  background: #f7f8fa;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.inner-etf-sort-bar button.active,
.outer-fund-sort-bar button.active {
  border-color: rgba(198, 40, 40, 0.22);
  background: #fff2f2;
  color: var(--red);
}

.outer-fund-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
}

.outer-fund-metric {
  min-width: 0;
  text-align: right;
}

.outer-fund-metric-label {
  display: none;
}

.outer-fund-metric-value {
  display: block;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.outer-fund-metric-value.up {
  color: var(--red);
}

.outer-fund-metric-value.down {
  color: var(--green);
}

.inner-etf-change,
.inner-etf-net-value,
.inner-etf-amount {
  min-width: 0;
  text-align: right;
  white-space: nowrap;
}

.inner-etf-net-value {
  color: #374151;
  font-size: 12px;
  font-weight: 800;
}

.outer-fund-metric-value.flat {
  color: #6b7280;
}

.inner-etf-row {
  width: 100%;
  min-height: 58px;
  padding: 9px 12px;
  border-top: 1px solid #f1f2f4;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.inner-etf-row.active {
  background: #fff7f7;
}

.inner-etf-code {
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.inner-etf-name {
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.inner-etf-change,
.inner-etf-amount {
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.inner-etf-change.up {
  color: var(--red);
}

.inner-etf-change.down {
  color: var(--green);
}

.inner-etf-change.flat {
  color: #8c9099;
}

.pick-panel,
.picker-tool-panel {
  position: sticky;
  top: 0;
  z-index: 14;
  padding: calc(16px + env(safe-area-inset-top)) 14px 14px;
}

.pick-panel h1,
.picker-tool-panel h1 {
  font-size: 22px;
  line-height: 1.18;
}

.pick-panel p,
.picker-tool-panel p {
  max-width: 100%;
  line-height: 1.45;
}

.home-panel {
  width: 100%;
  max-width: 100%;
  padding: calc(120px + env(safe-area-inset-top)) 12px 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f7fb 100%);
  overflow-x: hidden;
}

.home-market-hero {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 16;
  display: flex;
  align-items: center;
  width: min(720px, 100vw);
  max-width: 100vw;
  min-width: 0;
  min-height: calc(102px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 24px 0;
  transform: translateX(-50%);
  border-radius: 0 0 8px 8px;
  background: #cf2429;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}

.home-market-hero h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 900;
}

.home-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 72px);
  justify-content: start;
  gap: 16px;
  margin-top: 22px;
}

.home-tool-entry {
  width: auto;
  min-height: 104px;
  padding: 8px 0 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.home-tool-entry strong {
  display: block;
  margin-top: 13px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.home-index-panel {
  margin-top: 10px;
}

.home-index-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.home-index-head span:last-child {
  text-align: right;
}

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

.home-index-card {
  min-height: 94px;
  padding: 12px 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, #eefbf6 0%, #f7fffb 100%);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.08);
}

.home-index-card.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

.home-index-card span,
.home-index-card strong,
.home-index-card em {
  display: block;
}

.home-index-card span {
  color: #1f2933;
  font-size: 14px;
  font-weight: 500;
}

.home-index-card strong {
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
}

.home-index-card em {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.25;
  font-style: normal;
  font-weight: 700;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border: 2px solid currentColor;
  color: #ffa726;
  font-size: 18px;
  font-weight: 800;
}

.tool-k {
  clip-path: polygon(25% 6%, 75% 6%, 94% 50%, 75% 94%, 25% 94%, 6% 50%);
}

.tool-ah {
  border-radius: 10px;
  color: #8e7dff;
}

.tool-list {
  border-radius: 10px;
  color: #ff9800;
}

.tool-cash {
  border-radius: 10px;
  color: #fdd835;
}

.tool-topic {
  border-radius: 10px;
  color: #ff4d67;
}

.home-market-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 10px;
  padding: 12px 10px 0;
}

.market-card-stack {
  display: grid;
  gap: 10px;
}

.market-card {
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
}

.market-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 16px 10px;
}

.market-card-head h2 {
  padding: 0;
  color: #30343a;
  font-size: 17px;
  font-weight: 500;
}

.market-card-head span {
  color: #9aa0a6;
  font-size: 24px;
  line-height: 1;
}

.home-live-list {
  padding: 0 14px 12px;
}

.home-live-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  padding: 14px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.home-live-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.home-live-main strong,
.home-live-main span,
.home-live-main em,
.home-live-change strong,
.home-live-change span {
  display: block;
}

.home-live-main strong {
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
}

.home-live-main span {
  margin-top: 10px;
  color: #6f7782;
  font-size: 12px;
  line-height: 1.55;
}

.home-live-main em {
  display: inline-flex;
  width: fit-content;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(205, 35, 47, 0.15);
  color: #ff5a67;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.home-live-change {
  text-align: right;
}

.home-live-change strong {
  color: #ff3b53;
  font-size: 19px;
  font-weight: 700;
}

.home-live-change span {
  margin-top: 6px;
  color: #6f6f6f;
  font-size: 11px;
}

.home-heat-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.78fr 0.78fr;
  gap: 2px;
  padding: 0 14px 14px;
}

.heat-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 124px;
  padding: 12px;
  background: #fff3f4;
  color: #ff4a57;
}

.heat-cell.heat-1 {
  background: #ffdfe2;
}

.heat-cell.heat-2 {
  background: #ffecef;
}

.heat-cell.heat-3 {
  background: #fff7f8;
}

.heat-cell strong,
.heat-cell span {
  display: block;
}

.heat-cell strong {
  font-size: 13px;
  font-weight: 600;
}

.heat-cell span {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
}

.home-mainflow-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 14px 16px;
}

.mainflow-cell {
  min-height: 122px;
  padding: 16px 12px;
  border-radius: 16px;
  background: radial-gradient(circle at top, rgba(255, 235, 238, 0.95), rgba(255, 245, 246, 1));
  color: #ff6b72;
  box-shadow: inset 0 0 0 1px rgba(198, 40, 40, 0.05);
}

.mainflow-cell strong,
.mainflow-cell span {
  display: block;
}

.mainflow-cell strong {
  color: #4b2f31;
  font-size: 14px;
  font-weight: 700;
}

.mainflow-cell span {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
}

.mainflow-cell span:last-child {
  margin-top: 4px;
}

.home-feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 10px 0;
}

.feature-strip-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: auto;
  min-height: 74px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
  color: var(--text);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
}

.feature-strip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 2px solid currentColor;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
}

.feature-red {
  color: #ff4a57;
}

.feature-yellow {
  color: #ffd54f;
}

.feature-strip-item strong {
  font-size: 14px;
  font-weight: 500;
}

.home-bottom-grid {
  padding-bottom: 12px;
}

.market-card-topic,
.market-card-sector {
  min-height: 272px;
}

.topic-card-body,
.sector-card-body {
  padding: 0 16px 18px;
}

.topic-card-body strong,
.topic-card-body span,
.sector-card-body strong,
.sector-card-body span,
.sector-card-body em {
  display: block;
}

.topic-card-body strong,
.sector-card-body strong {
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.topic-card-body span {
  margin-top: 18px;
  color: #6f7782;
  font-size: 15px;
  line-height: 1.55;
}

.sector-card-body .sector-pct {
  margin-top: 14px;
  color: #ff4a57;
  font-size: 20px;
  font-weight: 700;
}

.sector-card-body .sector-label {
  margin-top: 18px;
  color: #626b75;
  font-size: 15px;
}

.sector-card-body .sector-amount {
  margin-top: 8px;
  color: #ff4a57;
  font-size: 18px;
  font-weight: 700;
}

.sector-mini-chart {
  position: relative;
  height: 86px;
  margin-top: 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 59, 83, 0.08) 0%, rgba(255, 59, 83, 0) 100%);
  overflow: hidden;
}

.sector-mini-chart svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.watch-view {
  min-height: 100vh;
}

.watch-panel {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(20px + env(safe-area-inset-top)) 18px 18px;
}

.watch-panel h1 {
  font-size: 24px;
}

.watch-panel p {
  margin-top: 6px;
  font-size: 14px;
}

.history-panel {
  padding: 12px 14px 0;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.history-head h2 {
  padding: 0;
  font-size: 16px;
}

.history-head button {
  width: auto;
  padding: 4px 8px;
  border-radius: 4px;
  background: #eee;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.history-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 3px;
  scrollbar-width: none;
}

.history-list::-webkit-scrollbar {
  display: none;
}

.history-item {
  width: auto;
  min-width: 118px;
  flex: 0 0 auto;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow);
}

.history-item strong,
.history-item span {
  display: block;
  white-space: nowrap;
}

.history-item strong {
  font-size: 13px;
}

.history-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.watch-section,
.short-term-section,
.picker-section {
  padding-top: 16px;
}

.watch-group-panel {
  margin: 0 10px 12px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.watch-live-status {
  margin: 0 10px 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

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

.watch-group-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.watch-group-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.watch-group-action {
  width: auto;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  box-shadow: none;
}

.watch-group-action.ghost {
  border: 1px solid #f1c6c6;
  background: #fff5f5;
  color: var(--red);
}

.watch-group-action.active {
  background: #333;
  color: #fff;
  border-color: #333;
}

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

.watch-group-list.is-reordering {
  touch-action: none;
  user-select: none;
}

.watch-group-item {
  min-width: 0;
  transition: transform .16s ease, opacity .16s ease;
}

.watch-group-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f3f4f6;
  color: var(--text);
  text-align: left;
  box-shadow: none;
  touch-action: manipulation;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.watch-group-chip strong,
.watch-group-chip span {
  display: block;
  min-width: 0;
  line-height: 1.2;
}

.watch-group-chip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-group-chip span {
  flex: none;
  color: var(--muted);
  font-size: 12px;
}

.watch-group-item.active .watch-group-chip {
  border-color: var(--red);
  background: #fff5f5;
  color: var(--red);
}

.watch-group-item.active .watch-group-chip span {
  color: var(--red);
}

.watch-group-item.dragging {
  opacity: .62;
  transform: scale(.98);
}

.watch-group-item.dragging .watch-group-chip {
  border-color: var(--red);
  box-shadow: 0 8px 20px rgba(211, 31, 39, .16);
}

.watch-group-item.drag-over .watch-group-chip {
  border-color: var(--red);
  background: #fff8f8;
  transform: translateY(-2px);
}

.watch-group-tools {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.watch-group-tool {
  width: 100%;
  min-height: 30px;
  padding: 4px 6px;
  border-radius: 6px;
  background: #f4f4f4;
  color: var(--muted);
  font-size: 12px;
  box-shadow: none;
}

.watch-group-tool.danger {
  background: #fff0f0;
  color: var(--red);
}

.watch-group-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  margin-top: 10px;
}

.watch-group-form input {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 16px;
}

.watch-group-form button {
  width: auto;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  box-shadow: none;
}

.watch-group-form button:last-child {
  background: #f1f1f1;
  color: var(--muted);
}

.strategy-picker {
  padding: 12px 10px calc(118px + env(safe-area-inset-bottom));
}

.strategy-tabs {
  position: sticky;
  z-index: 8;
  top: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 0 10px;
  background: var(--bg);
}

.strategy-tab {
  width: 100%;
  min-height: 42px;
  padding: 7px 8px;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.strategy-tab.active {
  background: #fff5f5;
  color: var(--red);
}

.strategy-tab.active::after {
  content: "";
  display: block;
  width: 24px;
  height: 3px;
  margin: 5px auto 0;
  border-radius: 999px;
  background: #ffb300;
}

.strategy-list {
  display: grid;
  gap: 10px;
  padding-top: 4px;
  margin: 0 auto;
  max-width: 560px;
}

.strategy-list.hidden {
  display: none;
}

.strategy-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 90px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  white-space: normal;
  box-shadow: var(--shadow);
}

.strategy-icon {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  width: 54px;
  height: 54px;
  padding: 9px;
  border: 1px solid #f2dfcf;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8, #fff0dd);
}

.strategy-icon i {
  display: block;
  width: 8px;
  border: 2px solid currentColor;
  border-top-width: 4px;
  border-bottom-width: 4px;
  background: #fff;
}

.strategy-icon i:nth-child(1) {
  height: 18px;
}

.strategy-icon i:nth-child(2) {
  height: 31px;
}

.strategy-icon i:nth-child(3) {
  height: 24px;
}

.strategy-icon-shape,
.strategy-icon-band {
  color: #d44735;
}

.strategy-icon-risk {
  color: #e88a00;
}

.strategy-icon-weak {
  color: #27955e;
}

.strategy-content {
  min-width: 0;
  overflow-wrap: anywhere;
}

.strategy-content strong,
.strategy-content em,
.strategy-content small {
  display: block;
}

.strategy-content strong {
  font-size: 17px;
  line-height: 1.25;
  word-break: keep-all;
}

.strategy-content em {
  width: max-content;
  max-width: 100%;
  margin-top: 7px;
  padding: 3px 8px;
  border-radius: 5px;
  background: #fff4e8;
  color: #c96b00;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.strategy-content small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: normal;
}

.trend-signal-list {
  gap: 12px;
}

.trend-date-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0 2px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trend-date-toolbar label {
  flex: none;
  color: var(--text);
}

.trend-date-toolbar select {
  min-width: 142px;
  max-width: 180px;
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid #fde0d1;
  border-radius: 7px;
  background: #fff;
  color: var(--red);
  font: inherit;
  outline: none;
}

.trend-date-toolbar span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.trend-signal-card {
  align-items: flex-start;
  min-height: 116px;
}

.trend-signal-stocks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.trend-signal-stocks i {
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 5px;
  background: #fff5f5;
  color: var(--red);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
}

.picker-section {
  padding-top: 16px;
  padding-bottom: calc(110px + env(safe-area-inset-bottom));
}

.picker-card {
  margin: 0 10px;
  padding: 13px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.picker-field + .picker-field {
  margin-top: 12px;
}

.picker-field label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.picker-field textarea {
  width: 100%;
  min-height: 124px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  color: var(--text);
  font: 13px/1.55 Consolas, "SFMono-Regular", monospace;
  resize: vertical;
  outline: none;
}

.picker-field textarea:focus {
  border-color: #e4aaaa;
  background: #fff;
}

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

.picker-scope {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  box-shadow: none;
}

.picker-scope.active {
  border-color: #efb1b1;
  background: #fff5f5;
  color: var(--red);
}

.picker-pool-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.picker-condition-grid span {
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid #f0dfdf;
  border-radius: 8px;
  background: #fffafa;
}

.picker-condition-grid em,
.picker-condition-grid strong {
  display: block;
}

.picker-condition-grid em {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
}

.picker-condition-grid strong {
  margin-top: 4px;
  color: var(--red);
  font-size: 14px;
}

.formula-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.formula-examples button {
  width: auto;
  min-height: 34px;
  padding: 6px 9px;
  border-radius: 6px;
  background: #fff5f5;
  color: var(--red);
  font-size: 12px;
  box-shadow: none;
}

.picker-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.picker-actions button {
  flex: none;
  width: 98px;
  background: var(--red);
  color: #fff;
}

.picker-actions span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.picker-results {
  margin-top: 16px;
}

.picker-result-list {
  display: grid;
  gap: 8px;
  margin: 0 10px;
}

.picker-result-card {
  display: grid;
  grid-template-columns: minmax(118px, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  width: auto;
  min-height: 72px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow);
}

.picker-stock strong,
.picker-stock span,
.picker-hit strong,
.picker-hit em {
  display: block;
}

.picker-stock strong {
  font-size: 15px;
}

.picker-stock span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.picker-hit {
  text-align: right;
}

.picker-hit strong {
  font-size: 16px;
}

.picker-hit em {
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.picker-result-card .chips {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.watch-section {
  padding-bottom: calc(110px + env(safe-area-inset-bottom));
}

.short-term-panel {
  position: sticky;
  top: 0;
  z-index: 14;
}

.short-term-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.short-term-top > div {
  min-width: 0;
}

.short-term-section {
  padding-bottom: calc(110px + env(safe-area-inset-bottom));
}

.short-term-chart-card {
  margin: 0 10px 10px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.short-term-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.short-term-chart-head h2 {
  padding: 0;
  font-size: 15px;
  line-height: 1.25;
}

.short-term-chart-head span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.short-term-curve {
  min-height: 154px;
}

.short-term-curve svg {
  display: block;
  width: 100%;
  height: auto;
}

.curve-grid line {
  stroke: #e7e7e7;
  stroke-dasharray: 5 5;
}

.curve-grid text {
  font-size: 10px;
}

.curve-axis {
  stroke: #555;
  stroke-width: 1.4;
}

.curve-line {
  fill: none;
  stroke: #e8901d;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.curve-labels text {
  fill: var(--text);
  font-size: 11px;
}

.short-term-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0 10px 10px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.short-term-toolbar strong,
.short-term-toolbar label,
.short-term-toolbar span {
  display: block;
}

.short-term-toolbar strong {
  font-size: 16px;
  line-height: 1.25;
}

.short-term-toolbar span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.short-term-toolbar label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.short-term-toolbar input {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  color: var(--text);
  font-size: 14px;
}

.date-select-toolbar,
.week-month-date-toolbar {
  display: grid;
  gap: 5px;
}

.date-select-toolbar select,
.week-month-date-toolbar select {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  color: var(--text);
  font-size: 14px;
}

.short-term-refresh {
  width: 100%;
  min-height: 38px;
  background: var(--red);
  color: #fff;
  box-shadow: none;
}

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

.short-term-manual-pull {
  background: #fff4ea;
  color: #b24b00;
  border: 1px solid rgba(178, 75, 0, 0.16);
}

.manual-pull-status {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
}

.manual-pull-status.hidden {
  display: none;
}

.manual-pull-status.loading {
  background: #fff7ed;
  color: #9a3412;
}

.manual-pull-status.success {
  background: #f0fdf4;
  color: #15803d;
}

.manual-pull-status.error {
  background: #fef2f2;
  color: #b91c1c;
}

.short-term-table-head {
  display: grid;
  grid-template-columns: minmax(102px, 1.2fr) repeat(3, minmax(50px, 1fr));
  gap: 8px;
  margin: 0 10px 6px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.short-term-table-head button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 28px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: none;
}

.short-term-table-head button:not(:first-child) {
  justify-content: flex-end;
  text-align: right;
}

.short-term-table-head button::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 12px;
  flex: none;
  background:
    linear-gradient(135deg, transparent 50%, #b0b0b0 50%) top 1px left 0 / 7px 5px no-repeat,
    linear-gradient(315deg, transparent 50%, #b0b0b0 50%) bottom 1px left 0 / 7px 5px no-repeat;
  opacity: 0.7;
}

.short-term-table-head button.active {
  color: var(--red);
}

.short-term-table-head button.active::after {
  opacity: 1;
}

.short-term-table-head button.sort-desc::after {
  background:
    linear-gradient(135deg, transparent 50%, #b0b0b0 50%) top 1px left 0 / 7px 5px no-repeat,
    linear-gradient(315deg, transparent 50%, var(--red) 50%) bottom 1px left 0 / 7px 5px no-repeat;
}

.short-term-table-head button.sort-asc::after {
  background:
    linear-gradient(135deg, transparent 50%, var(--red) 50%) top 1px left 0 / 7px 5px no-repeat,
    linear-gradient(315deg, transparent 50%, #b0b0b0 50%) bottom 1px left 0 / 7px 5px no-repeat;
}

.short-term-table-head span:not(:first-child) {
  text-align: right;
}

.week-month-table-head {
  grid-template-columns: minmax(96px, 1.15fr) repeat(4, minmax(46px, 1fr));
}

.short-term-list {
  display: grid;
  gap: 8px;
  margin: 0 10px;
}

.week-month-group {
  display: grid;
  gap: 8px;
}

.week-month-group + .week-month-group {
  margin-top: 14px;
}

.week-month-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 0 2px;
  border-radius: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  text-align: left;
}

.week-month-group-head h3 {
  flex: 1;
  margin: 0;
  color: var(--red);
  font-size: 15px;
  line-height: 1.25;
}

.week-month-group-head span {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.week-month-group-head i {
  width: 8px;
  height: 8px;
  flex: none;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .16s ease;
}

.week-month-group.collapsed .week-month-group-head i {
  transform: rotate(-45deg);
}

.week-month-group-list {
  display: grid;
  gap: 8px;
}

.week-month-group-list[hidden] {
  display: none;
}

.week-month-group-empty {
  margin: 0;
  padding: 12px;
}

.short-term-card {
  display: grid;
  grid-template-columns: minmax(102px, 1.2fr) minmax(168px, 1.8fr);
  gap: 8px 10px;
  align-items: center;
  width: 100%;
  min-height: 78px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow);
}

.short-term-main strong,
.short-term-main em {
  display: block;
}

.short-term-main strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.short-term-main em {
  margin-top: 2px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.short-term-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(46px, 1fr));
  gap: 8px;
}

.week-month-trend-card .short-term-metrics {
  grid-template-columns: repeat(4, minmax(42px, 1fr));
}

.short-term-metrics span,
.short-term-metrics em,
.short-term-metrics small {
  display: block;
  text-align: right;
}

.short-term-metrics em {
  font-style: normal;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.short-term-metrics small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
}

.short-term-card .chips {
  grid-column: 1 / -1;
  margin-top: 0;
}

.watch-table-head {
  display: grid;
  grid-template-columns: minmax(118px, 1.25fr) repeat(3, minmax(48px, 1fr));
  align-items: center;
  gap: 8px;
  margin: 0 82px 6px 10px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.watch-table-head span {
  display: block;
}

.watch-table-head > span:not(:first-child) {
  text-align: right;
}

.watch-sort-head {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: auto;
  min-height: 28px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
}

.watch-sort-head.active {
  color: var(--red);
}

.watch-sort-head i {
  position: relative;
  width: 7px;
  height: 12px;
  flex: none;
}

.watch-sort-head i::before,
.watch-sort-head i::after {
  content: "";
  position: absolute;
  left: 0;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.watch-sort-head i::before {
  top: 0;
  border-bottom: 5px solid #b0b0b0;
}

.watch-sort-head i::after {
  bottom: 0;
  border-top: 5px solid #b0b0b0;
}

.watch-sort-head.sort-desc i::after {
  border-top-color: var(--red);
}

.watch-sort-head.sort-asc i::before {
  border-bottom-color: var(--red);
}

.watch-list {
  display: grid;
  gap: 8px;
  margin: 0 10px;
}

.watch-card {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.watch-card-body {
  flex: 1;
  min-width: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.watch-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.watch-info,
.watch-info strong,
.watch-info span,
.watch-info em {
  display: block;
}

.watch-info {
  min-width: 112px;
}

.watch-title {
  display: flex !important;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.watch-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-price {
  flex: none;
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.watch-info .watch-code {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.watch-limit {
  display: inline-block !important;
  width: fit-content;
  margin-top: 5px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}

.watch-limit.up {
  background: #ffebee;
  color: var(--red);
}

.watch-limit.down {
  background: #e8f5e9;
  color: var(--green);
}

.watch-profile {
  display: grid;
  gap: 5px;
  flex: 1 1 136px;
  min-width: 126px;
  max-width: 210px;
}

.watch-profile.loading {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.watch-business,
.watch-themes {
  display: flex !important;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
}

.watch-business em,
.watch-themes em {
  flex: none;
  min-width: 26px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.6;
}

.watch-business strong {
  display: -webkit-box !important;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.watch-themes > span {
  display: flex !important;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.watch-themes > span > span {
  display: inline-flex !important;
  max-width: 88px;
  overflow: hidden;
  padding: 1px 4px;
  border-radius: 6px;
  background: #fff1f2;
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(48px, 1fr));
  gap: 8px;
  flex: 1;
}

.watch-metrics span,
.watch-metrics em,
.watch-metrics small {
  display: block;
  text-align: right;
}

.watch-metrics em {
  font-style: normal;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.watch-metrics small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
}

.watch-pulse .watch-metrics em {
  animation: quotePulse 0.45s ease;
}

.watch-position {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(96px, 0.9fr);
  gap: 8px;
  margin: 0 12px 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.watch-position label,
.watch-position-result {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.watch-position span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
}

.watch-position input {
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f9fb;
  color: var(--text);
  font-size: 13px;
  box-shadow: none;
}

.watch-position-result strong {
  min-height: 34px;
  padding: 7px 8px;
  border-radius: 8px;
  background: #f8f9fb;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.watch-position-result.up strong {
  background: #ffebee;
  color: var(--red);
}

.watch-position-result.down strong {
  background: #e8f5e9;
  color: var(--green);
}

.watch-card-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 64px;
}

.watch-group-select,
.watch-remove {
  width: 64px;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: #f0f1f3;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
}

.watch-group-select {
  overflow: hidden;
  padding: 4px 6px;
  background: #fff5f5;
  color: var(--red);
  text-overflow: ellipsis;
  white-space: nowrap;
  outline: none;
}

.watch-remove {
  min-height: 34px;
}

.empty-state {
  margin: 0 10px;
  padding: 18px 14px;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
  box-shadow: var(--shadow);
}

.stock-header {
  margin: 12px 10px 0;
  padding: 16px 14px 14px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.stock-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stock-line strong {
  font-size: 22px;
  line-height: 1.15;
}

.stock-line span {
  color: var(--muted);
  font-size: 12px;
}

.watch-add-btn {
  width: auto;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid #f1c6c6;
  border-radius: 6px;
  background: #fff5f5;
  color: var(--red);
  font-size: 13px;
  line-height: 1;
  box-shadow: none;
}

.watch-add-btn.active {
  border-color: #e3e3e3;
  background: #f3f3f3;
  color: var(--muted);
}

.price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.price {
  font-size: 38px;
  line-height: 1;
  font-weight: 800;
}

.price-change {
  font-size: 16px;
  font-weight: 700;
}

.quote-pulse .price,
.quote-pulse .price-change {
  animation: quotePulse 0.45s ease;
}

@keyframes quotePulse {
  0% {
    opacity: 0.55;
  }

  100% {
    opacity: 1;
  }
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  padding: 10px 8px;
  border-radius: 8px;
  background: #f6f7f8;
  text-align: center;
}

.detail-grid > div {
  min-width: 0;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.detail-grid strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.25;
  word-break: break-word;
}

.detail-grid .f10-row {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid #eceff3;
  text-align: left;
}

.detail-grid .f10-row strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.detail-grid .f10-profit-row em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.f10-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.f10-themes span {
  display: inline-flex;
  max-width: 96px;
  overflow: hidden;
  padding: 1px 4px;
  border-radius: 6px;
  background: #fff1f2;
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.f10-themes em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.business-reality-section {
  margin-top: 10px;
}

.business-reality-card {
  display: grid;
  gap: 10px;
  margin: 0 10px;
  padding: 12px;
  border-left: 4px solid #f9a825;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.business-reality-card.danger {
  border-left-color: var(--red);
  background: #fff8f8;
}

.business-reality-card.watch {
  border-left-color: #f9a825;
  background: #fffaf0;
}

.business-reality-card.solid {
  border-left-color: var(--green);
  background: #f7fff8;
}

.business-reality-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.business-reality-head span {
  flex: none;
  padding: 3px 7px;
  border-radius: 6px;
  background: #fff1f2;
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
}

.business-reality-card.watch .business-reality-head span {
  background: #fff4d6;
  color: #b7791f;
}

.business-reality-card.solid .business-reality-head span {
  background: #e8f5e9;
  color: var(--green);
}

.business-reality-head strong {
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.business-reality-card p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
}

.business-reality-list {
  display: grid;
  gap: 6px;
}

.business-reality-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
}

.business-reality-item span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
}

.business-reality-item strong {
  min-width: 0;
  color: var(--text);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.business-reality-item.danger strong {
  color: var(--red);
}

.business-reality-item.watch strong {
  color: #9a6510;
}

.business-reality-item.solid strong {
  color: var(--green);
}

.business-reality-card small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
}

.research-rating-section {
  margin-top: 10px;
}

.research-rating-card {
  display: grid;
  gap: 10px;
  margin: 0 10px;
  padding: 12px;
  border-left: 4px solid #d8dce4;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.research-rating-card.solid {
  border-left-color: var(--green);
}

.research-rating-card.watch {
  border-left-color: var(--orange);
}

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

.research-rating-summary div {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f7f8fa;
}

.research-rating-summary span,
.research-rating-summary strong {
  display: block;
  min-width: 0;
}

.research-rating-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.research-rating-summary strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.research-rating-block {
  display: grid;
  gap: 7px;
}

.research-rating-block h3 {
  margin: 0;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.25;
}

.research-rating-block p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.research-rating-collapsed p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.research-rating-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.research-rating-tags span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 7px;
  background: #f1f3f4;
  color: #5f6368;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.research-rating-tags span.positive {
  background: #fff1f2;
  color: var(--red);
}

.research-rating-tags span.neutral,
.research-rating-tags span.watch {
  background: #fff7e6;
  color: #a16207;
}

.research-rating-tags span.negative {
  background: #e8f5e9;
  color: var(--green);
}

.research-rating-tags strong {
  font-size: 13px;
}

.research-report-list {
  display: grid;
  gap: 7px;
}

.research-report-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 8px;
  border-radius: 7px;
  background: #f8fafc;
}

.research-report-item.muted {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.research-report-item strong,
.research-report-item span,
.research-report-item em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.research-report-item strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.research-report-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.research-report-item em {
  color: var(--red);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.35;
  text-align: right;
}

.research-rating-card small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
}

.section {
  margin-top: 16px;
}

.section h2,
.section-title h2 {
  padding: 0 14px 8px;
  font-size: 16px;
  line-height: 1.25;
}

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

.meta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 14px;
  color: var(--muted);
  font-size: 11px;
}

.announcement-risk-actions {
  justify-content: flex-end;
}

.risk-toggle {
  padding: 6px 9px;
  border: 1px solid rgba(210, 39, 48, 0.18);
  border-radius: 8px;
  background: #fff5f5;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.risk-toggle:disabled {
  border-color: #eee;
  background: #f6f6f6;
  color: var(--muted);
}

.flow-list,
.confirm-list,
.risk-list,
.channel-card,
.long-term-card,
.behavior-summary,
.analysis-list,
.advice-list,
.ai-card,
.verdict-card,
.disclaimer {
  margin: 0 10px;
}

.flow-row,
.confirm-card,
.risk-card,
.channel-card,
.long-term-card,
.behavior-summary,
.analysis-card,
.advice-card,
.ai-card,
.verdict-card {
  background: var(--card);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.flow-row {
  padding: 12px 12px 11px;
  margin-bottom: 8px;
}

.flow-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.flow-metrics {
  display: flex;
  gap: 12px;
  flex: none;
}

.flow-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.flow-money-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.flow-money-detail div {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 7px;
  background: #f8f8f8;
}

.flow-money-detail span,
.flow-money-detail strong {
  display: block;
}

.flow-money-detail span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.flow-money-detail strong {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
}

.flow-money-detail strong.neutral {
  color: var(--text);
}

.flow-volume {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  padding: 8px 9px;
  border-radius: 7px;
  background: #f7f7f7;
  color: var(--muted);
}

.flow-volume span,
.flow-volume strong {
  display: block;
}

.flow-volume span {
  flex: none;
  font-size: 11px;
  font-weight: 800;
}

.flow-volume strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.flow-volume.up {
  background: #fff3f3;
}

.flow-volume.up span,
.flow-volume.up strong {
  color: var(--red);
}

.flow-volume.down {
  background: #eef8f0;
}

.flow-volume.down span,
.flow-volume.down strong {
  color: var(--green);
}

.flow-bottom .chips {
  margin-top: 0;
}

.flow-behavior {
  min-width: 168px;
  text-align: right;
}

.flow-behavior strong,
.flow-behavior span {
  display: block;
}

.flow-behavior strong {
  font-size: 14px;
  line-height: 1.25;
}

.flow-behavior span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.flow-behavior.up strong {
  color: var(--red);
}

.flow-behavior.down strong {
  color: var(--green);
}

.flow-behavior.neutral strong {
  color: var(--muted);
}

.net-ratio-card {
  margin: 2px 10px 0;
  padding: 13px 14px;
  border-radius: 8px;
  background: #151515;
  color: #e8e8e8;
  box-shadow: var(--shadow);
}

.net-ratio-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.25;
}

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

.net-ratio-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.net-ratio-item strong,
.net-ratio-item em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.net-ratio-item strong {
  font-weight: 800;
}

.net-ratio-item em {
  color: #cfcfcf;
  font-style: normal;
}

.net-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: #9e9e9e;
}

.net-ratio-item.up .net-dot {
  background: #ef5350;
}

.net-ratio-item.down .net-dot {
  background: #66bb6a;
}

.net-ratio-item.warn .net-dot {
  background: #ffea00;
}

.net-ratio-item.up strong {
  color: #ff8a80;
}

.net-ratio-item.down strong {
  color: #a5d6a7;
}

.net-ratio-item.warn strong {
  color: #fff176;
}

.flow-name strong {
  display: block;
}

.flow-name span,
.metric span,
.card-sub {
  color: var(--muted);
  font-size: 11px;
}

.metric {
  text-align: right;
}

.metric strong {
  display: block;
  white-space: nowrap;
  font-size: 14px;
}

.confirm-card,
.risk-card,
.analysis-card,
.advice-card {
  padding: 13px;
  margin-bottom: 8px;
}

.risk-card {
  border-left: 4px solid #ddd;
}

.risk-card.high {
  border-left-color: var(--red);
  background: #fff8f8;
}

.risk-card.medium {
  border-left-color: var(--orange);
  background: #fffaf2;
}

.risk-card.low {
  border-left-color: var(--green);
  background: #f7fff8;
}

.risk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.risk-title {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 800;
}

.risk-card.high .risk-title {
  color: var(--red);
}

.risk-card.medium .risk-title {
  color: var(--orange);
}

.risk-card.low .risk-title {
  color: var(--green);
}

.risk-card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.risk-reasons {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  background: rgba(210, 39, 48, 0.08);
}

.risk-reasons strong {
  color: var(--red);
  font-size: 12px;
}

.risk-reasons span {
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.risk-notices {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.risk-notices div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.035);
}

.risk-notices span {
  color: var(--muted);
  font-size: 11px;
}

.risk-notices em {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.behavior-summary {
  padding: 13px;
  margin-bottom: 8px;
  border-left: 4px solid #ddd;
}

.behavior-summary.up {
  border-left-color: var(--red);
  background: #fff8f8;
}

.behavior-summary.down {
  border-left-color: var(--green);
  background: #f7fff8;
}

.behavior-summary.warn,
.behavior-summary.watch {
  border-left-color: var(--orange);
  background: #fffaf2;
}

.behavior-summary-head {
  display: block;
}

.behavior-summary-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.behavior-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.behavior-tags span {
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(198, 40, 40, 0.08);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.behavior-summary.down .behavior-tags span {
  background: rgba(46, 125, 50, 0.08);
  color: var(--green);
}

.behavior-summary.warn .behavior-tags span,
.behavior-summary.watch .behavior-tags span {
  background: rgba(230, 81, 0, 0.08);
  color: var(--orange);
}

.behavior-summary p {
  margin-top: 10px;
  color: var(--muted);
}

.advice-card {
  border-left: 4px solid #ddd;
}

.advice-card.buy,
.advice-card.consider {
  border-left-color: var(--red);
  background: #fff8f8;
}

.advice-card.sell,
.advice-card.reduce,
.advice-card.warn {
  border-left-color: var(--orange);
  background: #fffaf2;
}

.advice-card.hold {
  border-left-color: #9aa0a6;
}

.ai-generate {
  width: auto;
  min-height: 34px;
  margin-right: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  box-shadow: none;
}

.ai-card {
  width: auto;
  max-width: 100%;
  min-width: 0;
  padding: 13px;
  margin-bottom: 8px;
  border-radius: 8px;
  border-left: 0;
  background: #151515;
  color: #d6d6d6;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ai-card.good {
  border-top: 4px solid #d32f2f;
}

.ai-card.warn {
  border-top: 4px solid #fdd835;
}

.ai-card.danger {
  border-top: 4px solid #e51c2c;
}

.ai-verdict {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
}

.ai-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 14px;
  border: 1px solid #3a3a3a;
  border-bottom: 0;
}

.ai-row {
  display: grid;
  grid-template-columns: minmax(112px, 0.95fr) minmax(0, 1.05fr);
  border-bottom: 1px solid #3a3a3a;
}

.ai-row span {
  min-width: 0;
  padding: 9px 8px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ai-row span + span {
  border-left: 1px solid #3a3a3a;
}

.ai-head span {
  color: #f1f1f1;
  text-align: center;
  font-weight: 800;
}

.ai-signal {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.ai-signal i {
  width: 12px;
  height: 12px;
  flex: none;
  border-radius: 50%;
  background: #9e9e9e;
}

.ai-signal i.danger {
  background: #e51c2c;
}

.ai-signal i.warn {
  background: #ffea00;
}

.ai-signal i.good {
  background: #d32f2f;
}

.ai-signal i.neutral {
  background: #9e9e9e;
}

.ai-final {
  margin-top: 12px;
  color: #f1f1f1;
  font-weight: 800;
  line-height: 1.65;
}

.ai-disclaimer {
  margin-top: 10px;
  color: #8f8f8f;
  font-size: 11px;
}

.ai-qa-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 14px;
}

.ai-qa-form input {
  min-width: 0;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #202020;
  color: #f1f1f1;
  font-size: 14px;
  outline: none;
}

.ai-qa-form input::placeholder {
  color: #8f8f8f;
}

.ai-qa-form input:focus {
  border-color: #5a5a5a;
  background: #242424;
}

.ai-qa-form button {
  width: auto;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  box-shadow: none;
}

.ai-qa-answer {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #202020;
  color: #dcdcdc;
  line-height: 1.7;
}

.ai-qa-answer strong {
  display: block;
  margin-bottom: 8px;
  color: #f4f4f4;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ai-qa-answer p {
  margin: 7px 0 0;
  color: #dcdcdc;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.ai-qa-answer p:first-child {
  margin-top: 0;
}

.ai-report {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 2px 0 0;
}

.ai-report-lead,
.ai-report-final {
  color: #f1f1f1;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.75;
}

.ai-report-section {
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid #2d2d2d;
}

.ai-report-section h3 {
  margin: 0 0 10px;
  color: #f5f5f5;
  font-size: 16px;
  line-height: 1.35;
}

.ai-report-section h4 {
  margin: 0 0 9px;
  color: #f1f1f1;
  font-size: 13px;
  line-height: 1.45;
}

.ai-report-section p {
  margin: 8px 0 0;
  color: #d7d7d7;
  font-size: 13px;
  line-height: 1.75;
}

.ai-report-section ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #d7d7d7;
  font-size: 13px;
  line-height: 1.75;
}

.ai-report-note {
  color: #f1f1f1 !important;
  font-weight: 800;
}

.ai-report-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #333;
  border-radius: 8px;
}

.ai-report-table table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

.ai-report-table th,
.ai-report-table td {
  padding: 10px 11px;
  border-right: 1px solid #333;
  border-bottom: 1px solid #333;
  color: #dcdcdc;
  font-size: 12px;
  line-height: 1.55;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-report-table th {
  background: #232323;
  color: #f4f4f4;
  font-weight: 800;
}

.ai-report-table tr:last-child td {
  border-bottom: 0;
}

.ai-report-table th:last-child,
.ai-report-table td:last-child {
  border-right: 0;
}

.confirm-head,
.analysis-head,
.advice-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  justify-content: space-between;
}

.bar-track {
  height: 12px;
  margin-top: 10px;
  border-radius: 6px;
  background: #f1f1f1;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  min-width: 0;
  border-radius: 6px;
}

.confirm-card {
  border-left: 4px solid #ddd;
}

.confirm-card.up,
.confirm-card.normal {
  border-left-color: var(--red);
}

.confirm-card.down,
.confirm-card.warn {
  border-left-color: var(--green);
}

.confirm-card.watch {
  border-left-color: var(--orange);
}

.channel-card,
.long-term-card {
  padding: 13px;
  border-left: 4px solid #ddd;
}

.long-term-card {
  margin-top: 12px;
}

.channel-card.up,
.long-term-card.up {
  border-left-color: var(--red);
}

.channel-card.down,
.channel-card.warn,
.long-term-card.down,
.long-term-card.warn {
  border-left-color: var(--green);
}

.channel-card.watch,
.long-term-card.watch {
  border-left-color: var(--orange);
}

.channel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.channel-head strong {
  font-size: 16px;
}

.channel-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
  padding: 10px 8px;
  border-radius: 8px;
  background: #f7f7f7;
}

.long-term-grid {
  grid-template-columns: repeat(2, 1fr);
}

.channel-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.channel-grid strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.channel-position {
  margin-top: 12px;
}

.channel-track {
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, #dcedc8, #fff3e0, #ffcdd2);
}

.long-term-track {
  background: linear-gradient(90deg, #e3f2fd, #f1f8e9, #fff3e0, #ffcdd2);
}

.channel-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -50%);
}

.channel-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.chips,
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.chip,
.tag,
.badge {
  padding: 3px 7px;
  border-radius: 4px;
  background: #f3f3f3;
  color: var(--muted);
  font-size: 11px;
}

.desc,
.verdict-card p,
.advice-card p,
.analysis-card p,
.confirm-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.basis {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 7px;
  border-radius: 4px;
  background: #f7f7f7;
  color: var(--muted);
  font-size: 11px;
}

.verdict-card {
  padding: 18px 14px;
  text-align: center;
  border-top: 4px solid #ddd;
}

.verdict-main {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  line-height: 1.25;
}

.score {
  display: inline-flex;
  gap: 6px;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #f7f7f7;
  color: var(--muted);
  font-size: 11px;
}

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

.down {
  color: var(--green);
}

.flat,
.neutral {
  color: var(--muted);
}

.fill-up {
  background: linear-gradient(90deg, #ffcdd2, #ef5350);
}

.fill-down {
  background: linear-gradient(90deg, #c8e6c9, #66bb6a);
}

.fill-flat {
  background: #d9d9d9;
}

.disclaimer {
  padding: 18px 12px 0;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(720px, 100%);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #ececec;
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
  transform: translateX(-50%);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: auto;
  min-height: 48px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.nav-item span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 20px;
  line-height: 1;
}

.nav-item .capital-icon {
  position: relative;
  width: 24px;
  height: 24px;
}

.capital-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  bottom: 4px;
  width: 4px;
  height: 8px;
  border-radius: 2px 2px 0 0;
  background: currentColor;
  box-shadow: 7px -4px 0 currentColor, 14px -8px 0 currentColor;
}

.capital-icon::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.nav-item strong {
  font-size: 11px;
  font-weight: 600;
}

.nav-item.active {
  color: var(--red);
}

.nav-item.active span {
  background: #fff1f1;
}

@media (max-width: 520px) {
  .app {
    width: 100%;
  }

  .heartbeat-panel {
    flex-wrap: wrap;
  }

  .pick-panel,
  .picker-tool-panel {
    padding: calc(12px + env(safe-area-inset-top)) 12px 11px;
  }

  .pick-panel h1,
  .picker-tool-panel h1 {
    font-size: 20px;
  }

  .pick-panel p,
  .picker-tool-panel p {
    margin-top: 3px;
    font-size: 12px;
  }

  .picker-section {
    padding-top: 12px;
  }

  #heartbeatText {
    flex-basis: 100%;
    order: 3;
  }

  #refreshNow {
    margin-left: auto;
  }

  .flow-head {
    align-items: flex-start;
  }

  .flow-metrics {
    gap: 10px;
  }

  .flow-money-detail {
    gap: 6px;
  }

  .flow-money-detail div {
    padding: 7px 6px;
  }

  .flow-money-detail strong {
    font-size: 12px;
  }

  .flow-volume {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .flow-volume strong {
    text-align: left;
  }

  .confirm-head,
  .analysis-head,
  .advice-head,
  .channel-head {
    gap: 10px;
  }
}

@media (max-width: 360px) {
  h1 {
    font-size: 19px;
  }

  .search-panel p {
    display: none;
  }

  .search-form {
    margin-top: 10px;
  }

  button {
    width: 64px;
  }

  .price {
    font-size: 34px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .watch-card {
    flex-direction: column;
  }

  .watch-group-head {
    align-items: stretch;
    flex-direction: column;
  }

  .watch-group-actions {
    width: 100%;
  }

  .watch-group-action {
    flex: 1;
  }

  .watch-group-list {
    grid-template-columns: 1fr;
  }

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

  .watch-group-form button {
    width: 100%;
  }

  .watch-table-head {
    display: none;
  }

  .watch-main {
    align-items: stretch;
    flex-direction: column;
  }

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

  .watch-position-result {
    grid-column: 1 / -1;
  }

  .watch-info {
    min-width: 0;
  }

  .watch-profile {
    width: 100%;
    max-width: none;
  }

  .watch-themes > span > span {
    max-width: 112px;
  }

  .watch-metrics em,
  .watch-metrics small {
    text-align: left;
  }

  .watch-card-actions {
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
  }

  .watch-group-select,
  .watch-remove {
    width: 100%;
    min-height: 40px;
  }

  .flow-head {
    flex-direction: column;
    gap: 8px;
  }

  .flow-metrics {
    justify-content: space-between;
    width: 100%;
  }

  .flow-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .flow-behavior {
    min-width: 0;
    text-align: left;
  }

  .net-ratio-item {
    grid-template-columns: 10px 1fr;
  }

  .net-ratio-item em {
    grid-column: 2;
  }

  .research-rating-summary,
  .research-report-item {
    grid-template-columns: 1fr;
  }

  .research-report-item em {
    text-align: left;
  }

  .metric {
    text-align: left;
  }

  .channel-head {
    flex-direction: column;
  }

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

  .ai-card {
    padding: 12px 10px;
  }

  .ai-verdict {
    font-size: 15px;
  }

  .ai-row {
    grid-template-columns: minmax(98px, 0.92fr) minmax(0, 1.08fr);
  }

  .ai-row span {
    padding: 8px 6px;
    font-size: 12px;
  }

  .ai-signal {
    gap: 5px;
  }

  .ai-signal i {
    width: 10px;
    height: 10px;
  }

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

  .ai-qa-form button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .home-panel {
    padding: calc(104px + env(safe-area-inset-top)) 10px 10px;
  }

  .home-market-hero {
    width: 100vw;
    max-width: 100vw;
    min-height: calc(88px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 18px 0;
  }

  .home-market-hero h1 {
    font-size: 24px;
  }

  .home-tool-grid {
    grid-template-columns: repeat(2, 66px);
    gap: 14px;
    margin-top: 18px;
  }

  .home-tool-entry {
    min-height: 92px;
  }

  .home-tool-entry strong {
    margin-top: 10px;
    font-size: 11px;
  }

  .home-index-head {
    font-size: 12px;
  }

  .home-index-card {
    min-height: 84px;
    padding: 10px 8px;
  }

  .home-index-card span {
    font-size: 13px;
  }

  .home-index-card strong {
    font-size: 21px;
  }

  .tool-badge {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  .home-market-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 10px 0;
  }

  .inner-etf-section {
    padding: 10px 10px 0;
  }

  .inner-etf-sector-list {
    grid-template-columns: 1fr;
  }

  .inner-etf-sector-card {
    min-height: 94px;
  }

  .inner-etf-detail {
    overflow-x: hidden;
  }

  .inner-etf-table-head,
  .inner-etf-list {
    width: 100%;
    min-width: 0;
  }

  .inner-etf-table-head,
  .inner-etf-row {
    grid-template-columns: 48px minmax(82px, 1fr) 56px 48px 56px;
    gap: 4px;
  }

  .outer-fund-table-head,
  .outer-fund-row {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 7px 10px;
  }

  .outer-fund-table-head {
    display: none;
  }

  .inner-etf-table-head {
    padding: 9px 8px;
  }

  .inner-etf-row {
    padding: 9px 8px;
  }

  .inner-etf-name {
    font-size: 13px;
  }

  .inner-etf-change,
  .inner-etf-net-value,
  .inner-etf-amount {
    font-size: 11px;
  }

  .inner-etf-code {
    font-size: 11px;
  }

  .outer-fund-row {
    align-items: start;
    min-height: auto;
    padding: 12px 10px;
  }

  .outer-fund-row .inner-etf-code {
    padding-top: 1px;
  }

  .outer-fund-row .inner-etf-name {
    font-size: 14px;
    line-height: 1.35;
  }

  .outer-fund-metrics {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding-top: 2px;
  }

  .outer-fund-metric {
    padding: 6px 4px;
    border-radius: 6px;
    background: #f8fafc;
    text-align: left;
  }

  .outer-fund-metric-label {
    display: block;
    margin-bottom: 2px;
    color: #9aa0a6;
    font-size: 10px;
    line-height: 1;
  }

  .outer-fund-metric-value {
    font-size: 12px;
    font-weight: 800;
  }

  .market-card-stack {
    grid-template-columns: 1fr;
  }

  .market-card,
  .feature-strip-item {
    border-radius: 16px;
  }

  .market-card-head {
    padding: 14px 14px 10px;
  }

  .market-card-head h2 {
    font-size: 15px;
  }

  .home-live-list {
    padding: 0 14px 14px;
  }

  .home-live-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px 0;
  }

  .home-live-main strong {
    font-size: 16px;
    line-height: 1.25;
  }

  .home-live-main span {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.45;
  }

  .home-live-main em {
    margin-left: 6px;
  }

  .home-live-change strong {
    font-size: 16px;
  }

  .home-live-change span {
    font-size: 10px;
  }

  .home-heat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0 14px 14px;
  }

  .heat-cell {
    min-height: 112px;
    padding: 10px 8px;
  }

  .heat-cell strong {
    font-size: 12px;
    line-height: 1.3;
    word-break: break-all;
  }

  .heat-cell span {
    margin-top: 6px;
    font-size: 13px;
  }

  .home-mainflow-list {
    gap: 8px;
    padding: 0 14px 14px;
  }

  .mainflow-cell {
    min-height: 104px;
    padding: 14px 10px;
  }

  .mainflow-cell strong {
    font-size: 13px;
    line-height: 1.3;
  }

  .mainflow-cell span {
    margin-top: 6px;
    font-size: 13px;
  }

  .home-feature-strip {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 10px 0;
  }

  .feature-strip-item {
    justify-content: flex-start;
    min-height: 62px;
    padding: 0 14px;
  }

  .feature-strip-item strong {
    font-size: 14px;
  }

  .home-bottom-grid {
    padding-bottom: calc(110px + env(safe-area-inset-bottom));
  }

  .market-card-topic,
  .market-card-sector {
    min-height: auto;
  }

  .topic-card-body,
  .sector-card-body {
    padding: 0 14px 16px;
  }

  .topic-card-body strong,
  .sector-card-body strong {
    font-size: 22px;
  }

  .topic-card-body span {
    margin-top: 12px;
    font-size: 14px;
  }

  .sector-card-body .sector-pct {
    margin-top: 10px;
    font-size: 18px;
  }

  .sector-card-body .sector-label {
    margin-top: 12px;
    font-size: 14px;
  }

  .sector-card-body .sector-amount {
    font-size: 16px;
  }

  .sector-mini-chart {
    height: 74px;
    margin-top: 10px;
  }
}
