:root {
  color-scheme: light;
  --page-bg: #f3f5f8;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --panel-soft: #f4f6f9;
  --ink-panel: #2f3642;
  --line: #e2e7ef;
  --line-strong: #c7d0dd;
  --text: #20242c;
  --muted: #6b7280;
  --teal: #2f6fed;
  --teal-soft: #eef4ff;
  --accent: #2f6fed;
  --accent-soft: #eef4ff;
  --blue: #2457c5;
  --amber: #b7791f;
  --red: #b42318;
  --rose-strong: #b9524d;
  --shadow: 0 18px 44px rgba(31, 41, 55, 0.08);
  --shadow-soft: 0 8px 22px rgba(31, 41, 55, 0.06);
  --focus: 0 0 0 3px rgba(47, 111, 237, 0.2);
  --radius: 10px;
  --motion: 200ms cubic-bezier(.2, .7, .2, 1);
  --sticky-index-top: 92px;
  --section-scroll-margin: 176px;
}
* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  overflow-x: clip;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  background: var(--page-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1460px, calc(100vw - 44px));
  margin: 28px auto;
  padding: 22px 22px 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 22px 60px rgba(31, 41, 55, 0.08);
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 18px;
  margin: 0 0 18px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(226, 231, 239, 0.9);
  border-radius: 12px;
  padding: 16px 18px;
  backdrop-filter: blur(18px);
  transition: transform var(--motion), opacity var(--motion), box-shadow var(--motion);
}

.topbar > div:first-child {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

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

h1 {
  font-size: 32px;
  line-height: 1.08;
  font-weight: 850;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 16px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 4px;
  width: 100%;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
}

.topbar-nav-shell {
  display: grid;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mode-nav-shell {
  grid-column: 2;
  justify-items: end;
}

#detail-function-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
}

.top-tab-index-toggle {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.topbar.tabs-collapsed .tabs {
  display: none;
}

.tab {
  min-width: 0;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  transition: background var(--motion), color var(--motion), transform var(--motion), box-shadow var(--motion);
}

.tab:hover,
.tab:focus-visible {
  background: var(--accent-soft);
  color: var(--text);
  outline: none;
}

.tab.active {
  background: var(--ink-panel);
  color: white;
  box-shadow: 0 10px 24px rgba(36, 41, 54, 0.18);
  transform: translateY(-1px);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: panel-in 220ms ease both;
}

.panel[hidden] {
  display: none !important;
}

.dsa-entry-panel {
  display: grid;
  gap: 18px;
  min-height: calc(100vh - 132px);
}

.dsa-entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.dsa-entry-head h2 {
  margin: 4px 0 8px;
  color: var(--ink-panel);
}

.dsa-entry-head p:last-child {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.dsa-entry-open {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--ink-panel);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.dsa-workbench-frame {
  width: 100%;
  min-height: 920px;
  border: 1px solid #293548;
  border-radius: var(--radius);
  background: #0b1220;
  box-shadow: var(--shadow-soft);
}

@media (max-width: 720px) {
  .dsa-entry-head {
    display: grid;
  }

  .dsa-workbench-frame {
    min-height: 760px;
  }
}

.mode-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.mode-tab {
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--motion), color var(--motion), box-shadow var(--motion);
}

.mode-tab:hover,
.mode-tab:focus-visible {
  color: var(--text);
  background: var(--accent-soft);
  outline: none;
}

.mode-tab.active {
  color: #fff;
  background: var(--ink-panel);
  box-shadow: 0 10px 24px rgba(36, 41, 54, 0.18);
}

.quick-start-panel {
  display: grid;
  gap: 16px;
}

.quick-start-hero,
.quick-start-card,
.quick-start-result-card,
.quick-start-history-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.quick-start-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
}

.quick-start-hero h2 {
  font-size: 24px;
  line-height: 1.2;
}

.quick-start-hero p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.quick-start-auth {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.quick-start-auth span {
  color: var(--muted);
  font-size: 13px;
}

.quick-start-card {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.quick-start-target,
.quick-start-note {
  display: grid;
  gap: 8px;
}

.quick-start-target span,
.quick-start-note span,
.quick-start-report-type-grid legend,
.quick-start-appendix legend,
.quick-start-event-fields label > span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.quick-start-target input,
.quick-start-target select,
.quick-start-note textarea,
.quick-start-technical-period input,
.quick-start-event-fields input,
.quick-start-auth input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.quick-start-note textarea {
  min-height: 108px;
  resize: vertical;
}

.quick-start-target input:focus,
.quick-start-target select:focus,
.quick-start-note textarea:focus,
.quick-start-technical-period input:focus,
.quick-start-event-fields input:focus,
.quick-start-auth input:focus {
  border-color: rgba(47, 111, 237, 0.5);
  box-shadow: var(--focus);
}

.quick-start-report-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.deep-research-hero {
  border-top: 4px solid #0b4f78;
  background:
    linear-gradient(135deg, rgba(7, 82, 119, 0.06), transparent 42%),
    var(--panel);
}

.deep-research-card {
  border-top: 3px solid rgba(11, 79, 120, 0.72);
}

.deep-research-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr);
  gap: 12px;
}

.deep-research-standard {
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid rgba(11, 79, 120, 0.18);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(11, 79, 120, 0.07), rgba(47, 111, 237, 0.025));
}

.deep-research-standard > strong {
  color: #0b3d6e;
  font-size: 13px;
}

.deep-research-standard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.deep-research-standard-grid span {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid rgba(11, 79, 120, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
  color: #263747;
  font-size: 12px;
  font-weight: 750;
}

.deep-research-technical {
  min-height: auto;
  background: #f8fafc;
}

.quick-start-report-type-grid legend,
.quick-start-appendix legend {
  margin: 0 0 8px;
}

.quick-start-appendix {
  display: grid;
  margin: 0;
  padding: 0;
  border: 0;
}

.quick-start-appendix-option {
  min-height: auto;
}

.quick-start-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  transition: border-color var(--motion), box-shadow var(--motion), transform var(--motion);
}

.quick-start-option:has(input:checked) {
  border-color: rgba(47, 111, 237, 0.55);
  box-shadow: 0 10px 22px rgba(47, 111, 237, 0.12);
}

.quick-start-option:hover {
  transform: translateY(-1px);
}

.quick-start-option input {
  margin-top: 3px;
}

.quick-start-option strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.quick-start-option small {
  display: block;
  color: var(--muted);
  line-height: 1.55;
}

.quick-start-event-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(183, 121, 31, 0.22);
  border-radius: 9px;
  background: rgba(183, 121, 31, 0.06);
}

.quick-start-event-fields label {
  display: grid;
  gap: 6px;
}

.quick-start-event-fields small {
  color: var(--muted);
  font-size: 12px;
}

.quick-start-technical-period {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(180px, 260px) minmax(180px, 260px);
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(47, 111, 237, 0.18);
  border-radius: 9px;
  background: rgba(47, 111, 237, 0.05);
}

.quick-start-technical-period > span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  align-self: center;
}

.quick-start-technical-period label {
  display: grid;
  gap: 6px;
}

.quick-start-technical-period small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quick-start-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.quick-start-download-note {
  flex-basis: 100%;
  color: var(--red);
  font-size: 12px;
  font-weight: 750;
}

.quick-start-progress-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 320px);
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.quick-start-progress-row progress {
  width: 100%;
  height: 10px;
}

.quick-start-stages {
  counter-reset: quick-start-stage;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quick-start-stages li {
  counter-increment: quick-start-stage;
  position: relative;
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.quick-start-stages li::before {
  content: counter(quick-start-stage);
  display: inline-grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
}

.quick-start-stages li:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -6px;
  color: var(--line-strong);
}

.quick-start-stages li.active {
  color: var(--accent-hover);
}

.quick-start-stages li.active::before {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
  box-shadow: var(--focus);
}

.quick-start-stages li.completed {
  color: #16794f;
}

.quick-start-stages li.completed::before {
  content: "✓";
  border-color: rgba(22, 121, 79, 0.35);
  background: rgba(22, 121, 79, 0.08);
  color: #16794f;
}

.quick-start-stages li.failed {
  color: var(--red);
}

.quick-start-stages li.failed::before {
  content: "!";
  border-color: rgba(180, 35, 24, 0.35);
  background: rgba(180, 35, 24, 0.08);
  color: var(--red);
}

.quick-start-output {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  align-items: start;
}

.quick-start-result-card,
.quick-start-history-card {
  padding: 16px;
}

.quick-start-result-card header,
.quick-start-history-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.quick-start-history-card header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quick-start-result {
  display: grid;
  gap: 12px;
}

.quick-start-metadata {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.quick-start-metadata-item {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.quick-start-metadata-item > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.quick-start-metadata-item > strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.quick-start-metadata.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
}

.quick-start-grade-badge {
  grid-column: 1 / -1;
  justify-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(183, 121, 31, 0.1);
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
}

.quick-start-grade-badge.blocked {
  background: rgba(180, 35, 24, 0.08);
  color: var(--red);
}

.quick-start-report-section {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.quick-start-report-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.quick-start-report-section h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.quick-start-report-section p {
  margin: 0;
  color: var(--text);
  line-height: 1.75;
}

.quick-start-qc-issues {
  padding: 12px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 8px;
  background: rgba(180, 35, 24, 0.04);
}

.quick-start-qc-issues > header,
.quick-start-qc-issues li > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quick-start-qc-issues h4,
.quick-start-qc-issues p {
  margin: 0;
}

.quick-start-qc-issues > header span,
.quick-start-qc-issues small {
  color: var(--muted);
  font-size: 12px;
}

.quick-start-qc-issues ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.quick-start-qc-issues li {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-left: 3px solid var(--red);
  background: #fff;
}

.quick-start-qc-issues li.warning {
  border-left-color: var(--amber);
}

.quick-start-qc-issues code {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.quick-start-qc-issues li > div strong {
  color: var(--red);
  font-size: 12px;
}

.quick-start-qc-issues li.warning > div strong {
  color: var(--amber);
}

.quick-start-module-list {
  display: grid;
  gap: 8px;
}

.quick-start-module {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.quick-start-module.failed span {
  color: var(--red);
}

.quick-start-history-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.quick-start-history {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.quick-start-history-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.quick-start-history-check {
  margin: 0;
}

.quick-start-history-item {
  width: 100%;
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

.quick-start-history-item.active {
  border-color: rgba(47, 111, 237, 0.6);
  box-shadow: var(--focus);
}

.quick-start-history-item span,
.quick-start-history-item small {
  color: var(--muted);
  font-size: 12px;
}

.quick-start-history-row-actions {
  display: flex;
  gap: 6px;
}

.quick-start-history-open,
.quick-start-history-delete {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.quick-start-history-delete {
  border-color: rgba(229, 62, 62, 0.28);
  color: var(--red);
}

.module-section {
  scroll-margin-top: var(--section-scroll-margin);
}

.primary-directory {
  position: sticky;
  top: 106px;
  z-index: 90;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.9);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.primary-directory a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: #5f5b53;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.primary-directory a:hover,
.primary-directory a:focus {
  border-color: var(--ink-panel);
  background: var(--ink-panel);
  color: white;
  transform: translateY(-1px);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.metric {
  min-height: 68px;
  padding: 9px 18px;
  border-right: 1px solid var(--line);
  background: transparent;
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric strong {
  font-size: 27px;
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.left-rail,
.main-work,
.screener-box,
.ask-ai-box {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.left-rail {
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.factor-list {
  display: grid;
  gap: 10px;
}

.factor-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #f7f3ea;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.factor-card:hover,
.factor-card.active {
  border-color: rgba(247, 201, 40, 0.8);
  background: #fff8d9;
}

.factor-card.active {
  transform: translateY(-1px);
}

.factor-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.factor-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.factor-rank-button {
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

.factor-card p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.factor-card .stat-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
  font-size: 12px;
  color: var(--muted);
}

.factor-score-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.factor-score-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #f7f3ea;
}

.factor-score-head .eyebrow {
  margin-bottom: 4px;
  font-size: 13px;
}

.factor-rank-wrap {
  max-height: 420px;
  border: 0;
  border-radius: 0;
}

.factor-rank-table {
  width: 100%;
  min-width: 340px;
  border-collapse: collapse;
}

.factor-rank-table th,
.factor-rank-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 12px;
}

.factor-rank-table th {
  position: sticky;
  top: 0;
  background: #fff8f7;
  color: var(--muted);
  z-index: 1;
}

.factor-rank-table .name-cell strong {
  font-size: 13px;
}

.factor-rank-table .name-cell span {
  font-size: 11px;
}

.stat-chip {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.main-work {
  padding: 0;
  min-width: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.calc-card {
  margin-bottom: 14px;
}

.module-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.module-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.module-head .eyebrow,
.screener-head .eyebrow {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 9px;
}

.module-head h2,
.section-heading h2,
.screener-head h2 {
  font-size: 23px;
  line-height: 1.25;
}

.calc-line {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 10px;
}

.calc-line input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 13px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.calc-line input:focus,
.primary-filter-grid input:focus,
.primary-filter-grid select:focus {
  border-color: var(--accent);
  box-shadow: var(--focus);
}

.primary-filter-card {
  margin-bottom: 14px;
}

.primary-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.primary-filter-grid input,
.primary-filter-grid select,
.primary-condition-builder input,
.primary-condition-builder select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.primary-condition-builder {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(120px, 0.5fr) minmax(120px, 0.5fr) auto;
  gap: 10px;
  margin-bottom: 10px;
}

.primary-condition-builder input:focus,
.primary-condition-builder select:focus {
  border-color: var(--accent);
  box-shadow: var(--focus);
}

.primary-condition-list {
  min-height: 34px;
}

.primary-update-card {
  margin-top: 16px;
}

.primary-small-cap-card {
  margin-top: 16px;
}

.primary-latest-weekly-card {
  margin-top: 16px;
}

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

.primary-weekly-meta p {
  margin: 0;
}

.module-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.collapsible-module {
  overflow: hidden;
}

.collapsible-module .module-head {
  margin-bottom: 0;
}

.collapsible-module.expanded .module-head {
  margin-bottom: 12px;
}

.collapsible-content {
  animation: collapse-in 180ms ease both;
}

.module-collapse-toggle {
  min-width: 92px;
}

.module-collapse-toggle::after {
  content: "↓";
  margin-left: 8px;
  font-size: 12px;
}

.collapsible-module.expanded .module-collapse-toggle::after {
  content: "↑";
}

.primary-small-cap-text {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.primary-small-cap-text h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.text-lines {
  display: grid;
  gap: 16px;
}

.text-lines p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f3ea;
  line-height: 1.7;
}

.text-lines .cell-text {
  width: 100%;
}

.text-lines .cell-text.is-collapsible {
  max-width: none;
}

.text-lines .cell-toggle {
  margin-top: 0;
  white-space: nowrap;
}

.upload-dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 150px;
  padding: 22px;
  border: 2px dashed #dfd1b9;
  border-radius: var(--radius);
  background: #f7f3ea;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.upload-dropzone strong {
  color: var(--text);
  font-size: 21px;
}

.upload-dropzone span {
  max-width: 720px;
  line-height: 1.5;
}

.upload-dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.update-progress {
  margin-top: 12px;
}

.update-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #f1dedb;
  overflow: hidden;
}

.update-progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--teal);
  transition: width 0.2s ease;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--ink-panel);
  border-radius: 999px;
  background: var(--ink-panel);
  color: white;
  text-decoration: none;
  font-weight: 800;
}

.primary-update-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.download-button.secondary {
  background: white;
  color: var(--ink-panel);
}

.download-button.disabled {
  pointer-events: none;
  opacity: 0.55;
  border-color: var(--line);
  background: white;
  color: var(--muted);
}

.source-cell {
  max-width: 180px;
  color: var(--muted);
  font-size: 12px !important;
}

button {
  height: 42px;
  border: 1px solid var(--ink-panel);
  border-radius: 999px;
  padding: 0 14px;
  background: var(--ink-panel);
  color: white;
  cursor: pointer;
  font-weight: 700;
  transition: transform var(--motion), box-shadow var(--motion), background var(--motion), border-color var(--motion);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(74, 75, 80, 0.18);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.ghost {
  border-color: var(--line);
  background: white;
  color: var(--text);
}

button.ghost:hover:not(:disabled) {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

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

.data-status-footer {
  scroll-margin-top: var(--section-scroll-margin);
  margin-top: 28px;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
}

.data-status-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.data-status-head h2 {
  font-size: 17px;
}

.data-status-summary,
.data-status-update {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.data-status-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.data-status-summary {
  max-width: 560px;
  text-align: right;
}

.data-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.data-status-item {
  display: grid;
  min-height: 118px;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.data-status-item.missing {
  opacity: 0.68;
}

.data-status-item.incomplete {
  border-color: #dfbdb8;
  background: #fff8f7;
}

.data-status-item.complete .data-status-quality {
  color: var(--accent);
}

.data-status-quality {
  font-weight: 800;
}

.data-status-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.data-status-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}

.data-status-item p,
.data-status-item small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.data-status-item a {
  justify-self: start;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.data-status-update {
  margin-top: 12px;
}

.results-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(430px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.table-wrap {
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.result-table th,
.result-table td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

.result-table th {
  position: sticky;
  top: 0;
  background: #f7f3ea;
  color: var(--muted);
  font-weight: 700;
  z-index: 1;
}

.result-table tr {
  cursor: pointer;
}

.result-table tr:hover,
.result-table tr.selected {
  background: #fff8d9;
}

.name-cell strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

.name-cell span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.score-badge {
  display: inline-flex;
  min-width: 56px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff1c7;
  color: var(--ink-panel);
  font-weight: 800;
}

.score-badge.low {
  background: #ffe7e2;
  color: var(--red);
}

.detail-panel {
  min-height: 440px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.cell-text {
  display: block;
  min-width: 0;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.cell-text.is-collapsible {
  display: -webkit-box;
  max-width: 360px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cell-text.is-collapsible.expanded {
  display: block;
  max-width: none;
  -webkit-line-clamp: unset;
}

.cell-toggle {
  display: inline-flex;
  align-items: center;
  height: 28px;
  margin-top: 5px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--blue);
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
}

.cell-toggle:hover:not(:disabled) {
  background: transparent;
  box-shadow: none;
  color: var(--teal);
  transform: none;
}

.empty-state {
  display: grid;
  min-height: 380px;
  place-items: center;
  color: var(--muted);
}

.empty-state.compact {
  min-height: 120px;
  padding: 18px;
  text-align: center;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.detail-head small {
  color: var(--muted);
}

.score-block {
  min-width: 130px;
  text-align: right;
}

.score-block strong {
  display: block;
  font-size: 36px;
  line-height: 1;
}

.hard-pass {
  color: var(--rose-strong);
}

.hard-fail {
  color: var(--red);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.info-item {
  min-height: 58px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.info-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

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

.factor-score-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.factor-score-table th,
.factor-score-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
}

.factor-score-table th {
  color: var(--muted);
  background: #fff8f7;
}

.bar {
  position: relative;
  height: 8px;
  width: 90px;
  background: #f1dedb;
  border-radius: 999px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.bar.fail span {
  background: var(--red);
}

.detail-note {
  margin: 10px 0 0;
}

.ai-technical-box {
  min-height: 720px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  box-shadow: var(--shadow);
}

.ai-technical-hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 26px 20px;
  border-radius: 9px;
  background: linear-gradient(120deg, #4f7df3 0%, #6e37a5 100%);
  color: #172033;
  text-align: center;
  box-shadow: 0 12px 28px rgba(74, 72, 158, 0.18);
}

.ai-technical-hero h2 {
  margin: 0;
  color: #1f2533;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.ai-technical-hero p,
.ai-technical-hero span {
  margin: 0;
  color: rgba(31, 37, 51, 0.82);
  font-weight: 800;
}

.ai-technical-hero span {
  font-size: 13px;
}

.ai-technical-tabs {
  display: flex;
  gap: 18px;
  align-items: center;
  margin: 0 -18px 18px;
  padding: 0 18px;
  border-bottom: 1px solid #d8dee8;
}

.ai-technical-tabs button {
  position: relative;
  height: 42px;
  border: 0;
  background: transparent;
  color: #5d6678;
  font-weight: 850;
  cursor: pointer;
}

.ai-technical-tabs button.active {
  color: #3857e8;
}

.ai-technical-tabs button.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: #5668ff;
}

.ai-technical-params {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(160px, 0.55fr) minmax(160px, 0.55fr);
  gap: 12px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #e0e5ee;
  border-radius: 10px;
  background: #ffffff;
}

.ai-technical-param-head,
.ai-technical-instruction,
.ai-technical-upload,
.ai-technical-params button {
  grid-column: 1 / -1;
}

.ai-technical-param-head {
  margin: -18px -18px 0;
  padding: 8px 14px;
  background: #d9dde6;
  color: #222837;
  font-weight: 900;
}

.ai-technical-params label {
  display: grid;
  gap: 6px;
  color: #5b6576;
  font-size: 13px;
  font-weight: 800;
}

.ai-technical-params input,
.ai-technical-params textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  background: #ffffff;
  color: #222837;
  outline: none;
  font: inherit;
}

.ai-technical-params input {
  height: 44px;
  padding: 0 12px;
}

.ai-technical-params textarea {
  min-height: 78px;
  resize: vertical;
  padding: 12px;
}

.ai-technical-params input:focus,
.ai-technical-params textarea:focus {
  border-color: #5868f7;
  box-shadow: 0 0 0 3px rgba(88, 104, 247, 0.13);
}

.ai-technical-upload small {
  color: #7a8495;
  font-weight: 700;
}

.ai-technical-upload small.error {
  color: var(--red);
}

.ai-technical-params button {
  height: 46px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(120deg, #4f7df3 0%, #7031a0 100%);
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.ai-technical-params button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.ai-technical-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  color: #445063;
  font-size: 13px;
  font-weight: 800;
}

.ai-technical-progress progress {
  width: 100%;
  height: 10px;
  accent-color: #5a67f0;
}

.ai-technical-history-card {
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfc;
}

.ai-technical-history-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-technical-history-card h3,
.ai-technical-history-card p {
  margin: 0;
}

.ai-technical-history-card p,
.ai-technical-history-item span {
  color: var(--muted);
  font-size: 12px;
}

.ai-technical-history {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.ai-technical-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.ai-technical-history-item {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.ai-technical-history-item:hover,
.ai-technical-history-item:focus-visible {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.ai-technical-history-row-actions {
  display: flex;
  gap: 6px;
}

.ai-technical-history-open,
.ai-technical-history-delete {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.ai-technical-history-delete {
  border-color: rgba(229, 62, 62, 0.28);
  color: var(--red);
}

.ai-technical-results {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(360px, 0.95fr);
  gap: 18px;
}

.ai-technical-chart-panel,
.ai-technical-report-panel {
  min-width: 0;
  border: 1px solid #dfe5ef;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.ai-technical-chart-panel h3,
.ai-technical-report-panel h3 {
  margin: 0;
  padding: 13px 16px;
  border-bottom: 1px solid #e2e8f0;
  color: #1f2937;
  font-size: 15px;
}

.ai-technical-chart {
  min-height: 430px;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #fbfdff;
}

.ai-technical-chart img {
  width: 100%;
  max-height: 680px;
  object-fit: contain;
  border: 1px solid #e0e6f0;
  background: #ffffff;
}

.ai-technical-report {
  height: 610px;
  overflow: auto;
  padding: 22px 24px;
  border-top: 4px solid #8054b9;
  color: #253044;
  background: #ffffff;
  line-height: 1.72;
}

.ai-technical-report h4 {
  margin: 18px 0 8px;
  color: #1d2939;
  font-size: 18px;
  line-height: 1.35;
}

.ai-technical-report h4:first-child {
  margin-top: 0;
}

.ai-technical-report p {
  margin: 0 0 12px;
  color: #334155;
  font-size: 14px;
}

.ai-technical-report p span {
  display: block;
  margin-top: 4px;
  color: #64748b;
}

.ai-technical-audit {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fbff;
}

.ai-technical-audit header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 10px;
  color: #1f2937;
}

.ai-technical-audit header span,
.ai-technical-audit header b {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.ai-technical-audit ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-technical-audit li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid #e4e9f2;
  border-radius: 7px;
  background: #ffffff;
  font-size: 13px;
}

.ai-technical-audit li span {
  color: #8a95a6;
  font-weight: 900;
}

.ai-technical-audit li.passed span {
  color: #198754;
}

.ai-technical-audit li.pending span {
  color: #b45309;
}

.ai-technical-audit li strong {
  color: #263244;
}

.ai-technical-audit li em {
  color: #94a3b8;
  font-size: 12px;
  font-style: normal;
  text-align: right;
}

.ai-technical-audit li small {
  grid-column: 2 / -1;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.ai-technical-tools {
  margin-top: 12px;
}

.ai-technical-tools > strong {
  display: block;
  margin-bottom: 7px;
  color: #475569;
  font-size: 13px;
}

.ai-technical-tools li {
  grid-template-columns: 160px minmax(0, 1fr);
}

.ai-technical-source {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #2b6fe8;
  color: #6b7280;
  font-size: 16px;
  letter-spacing: 0;
}

.ai-technical-chat {
  margin-top: 18px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.ai-technical-chat header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #e2e8f0;
}

.ai-technical-chat header h3,
.ai-technical-chat header p {
  margin: 0;
}

.ai-technical-chat header h3 {
  color: #1f2937;
  font-size: 16px;
}

.ai-technical-chat header p {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.ai-technical-chat-thread {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding: 14px 16px;
  background: #f8fbff;
}

.ai-technical-chat-message {
  max-width: 88%;
  padding: 10px 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  color: #334155;
  background: #ffffff;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.ai-technical-chat-message.user {
  justify-self: end;
  border-color: #b9d1eb;
  background: #eef6ff;
}

.ai-technical-supplements {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.ai-technical-supplements > header,
.ai-technical-supplement > header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-technical-supplements h4 {
  margin: 0;
  color: #1f2937;
  font-size: 15px;
}

.ai-technical-supplements span {
  color: #64748b;
  font-size: 12px;
}

.ai-technical-supplement {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fbff;
}

.ai-technical-supplement img {
  width: 100%;
  border: 1px solid #dbe3ef;
  background: #ffffff;
}

.ai-technical-supplement-report {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.ai-technical-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
}

.ai-technical-chat-upload {
  display: grid;
  grid-column: 1 / -1;
  gap: 5px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.ai-technical-chat-upload input {
  color: #64748b;
  font-size: 12px;
}

.ai-technical-chat-upload small {
  color: #7a8495;
}

.ai-technical-chat-upload small.error {
  color: var(--red);
}

.ai-technical-chat-form textarea {
  min-height: 72px;
  resize: vertical;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  padding: 10px 12px;
  color: #334155;
  background: #ffffff;
}

.ai-technical-chat-form button {
  align-self: end;
}

.screener-box {
  min-height: 520px;
  padding: 28px;
}

.screener-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.screener-builder {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(120px, 0.5fr) minmax(120px, 0.5fr) auto;
  gap: 10px;
  margin-bottom: 12px;
}

.screener-builder select,
.screener-builder input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fffdfc;
  color: var(--text);
  outline: none;
}

.screener-builder select:focus,
.screener-builder input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(207, 111, 111, 0.15);
}

.screener-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

.screener-filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.screener-filters select {
  min-width: 220px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fffdfc;
  color: var(--text);
  outline: none;
}

.screener-filters select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(207, 111, 111, 0.15);
}

.check-line {
  min-height: 42px;
  display: inline-flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px !important;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfc;
  color: var(--text) !important;
  font-weight: 700;
}

.check-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.condition-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
  align-items: center;
  margin-bottom: 12px;
}

.condition-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 8px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff8f7;
  color: var(--text);
  font-size: 13px;
}

.condition-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.condition-chip button {
  display: inline-grid;
  width: 22px;
  height: 22px;
  min-width: 22px;
  place-items: center;
  border-radius: 999px;
  padding: 0;
  line-height: 1;
}

.screener-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.screener-actions p {
  margin: 0;
}

.screener-table-wrap {
  max-height: 620px;
}

.screener-table {
  min-width: 920px;
}

.screener-table tr {
  cursor: default;
}

.strategy-box {
  min-height: 520px;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.strategy-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.strategy-directory {
  position: sticky;
  top: 96px;
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 0 0 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 252, 0.98);
}

.strategy-directory a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff8f7;
  color: #6d5451;
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}

.strategy-directory a:hover,
.strategy-directory a:focus {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.protocol-transfer-board {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfc;
}

.protocol-transfer-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.protocol-transfer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
}

.protocol-transfer-actions label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.protocol-transfer-actions input {
  height: 38px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
}

.protocol-transfer-date-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.protocol-transfer-date-list button {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.protocol-transfer-date-list button span {
  color: var(--muted);
  font-size: 12px;
}

.protocol-transfer-date-list button.active {
  border-color: var(--ink-panel);
  background: var(--ink-panel);
  color: #fff;
}

.protocol-transfer-date-list button.active span {
  color: rgba(255, 255, 255, 0.76);
}

.protocol-transfer-board .muted {
  margin: 0;
}

.protocol-transfer-analysis-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 320px);
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.protocol-transfer-analysis-progress > div {
  display: grid;
  gap: 3px;
}

.protocol-transfer-analysis-progress strong {
  font-size: 14px;
}

.protocol-transfer-analysis-progress span {
  color: var(--muted);
  font-size: 12px;
}

.protocol-transfer-analysis-progress progress {
  width: 100%;
  height: 10px;
  accent-color: var(--teal);
}

.protocol-transfer-table-wrap {
  max-height: 430px;
}

.protocol-transfer-table {
  min-width: 1240px;
}

.protocol-transfer-analysis-state {
  display: inline-block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.protocol-transfer-analysis-state.done {
  color: #147a55;
}

.protocol-transfer-analysis-state.running,
.protocol-transfer-analysis-state.queued {
  color: #9a6700;
}

.protocol-transfer-analysis-state.failed,
.protocol-transfer-analysis-state.partial {
  color: #b42318;
}

.protocol-transfer-analysis-error {
  display: block;
  max-width: 220px;
  margin-top: 4px;
  color: #b42318;
  font-size: 11px;
  line-height: 1.4;
}

.protocol-transfer-pdf-download {
  font-weight: 800;
}

.protocol-transfer-manual-analysis {
  display: grid;
  gap: 7px;
  min-width: 190px;
}

.protocol-transfer-analysis-requirement {
  width: 100%;
  min-height: 58px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
}

.protocol-transfer-analysis-requirement:disabled {
  background: #f2f4f7;
  color: var(--muted);
}

.protocol-transfer-manual-analysis button {
  min-height: 34px;
  padding: 7px 10px;
}

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

.strategy-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfc;
  padding: 16px;
}

.strategy-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.strategy-card h3 {
  margin-bottom: 4px;
  font-size: 18px;
}

.strategy-card header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.fundamental-mine-box {
  min-height: 560px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.fundamental-mine-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.fundamental-mine-head > p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
}

.fundamental-mine-auth {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto minmax(160px, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(54, 95, 140, 0.24);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.fundamental-mine-auth input {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.fundamental-mine-auth span,
.fundamental-mine-auth small {
  color: var(--muted);
  font-size: 12px;
}

.fundamental-mine-auth small {
  grid-column: 1 / -1;
}

.fundamental-mine-form {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(230px, 0.85fr) auto;
  gap: 12px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfc;
}

.fundamental-mine-form label {
  display: grid;
  gap: 7px;
}

.fundamental-mine-form span,
.fundamental-mine-filters label {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.fundamental-mine-form textarea,
.fundamental-mine-form input,
.fundamental-mine-filters input,
.fundamental-mine-filters select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
}

.fundamental-mine-form textarea {
  min-height: 106px;
  resize: vertical;
}

.fundamental-mine-form small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.fundamental-mine-upload input {
  align-self: start;
}

.fundamental-mine-progress-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 320px);
  gap: 16px;
  align-items: center;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(54, 95, 140, 0.24);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.fundamental-mine-progress-card strong,
.fundamental-mine-progress-card span {
  display: block;
}

.fundamental-mine-progress-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.fundamental-mine-progress-card progress {
  width: 100%;
}

.fundamental-mine-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.5fr) minmax(150px, 0.55fr) auto auto;
  gap: 10px;
  margin-bottom: 14px;
}

.fundamental-mine-layout {
  display: grid;
  grid-template-columns: minmax(310px, 0.82fr) minmax(0, 1.4fr);
  gap: 14px;
  align-items: start;
}

.fundamental-mine-history,
.fundamental-mine-detail {
  min-height: 430px;
  max-height: 720px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfc;
}

.fundamental-mine-history-list,
.fundamental-mine-company-list,
.fundamental-mine-findings,
.fundamental-mine-rounds {
  display: grid;
  gap: 9px;
}

.fundamental-mine-job-card,
.fundamental-mine-company-row,
.fundamental-mine-finding,
.fundamental-mine-round {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.fundamental-mine-job-head,
.fundamental-mine-company-row,
.fundamental-mine-detail-head,
.fundamental-mine-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fundamental-mine-job-card h3,
.fundamental-mine-detail h3,
.fundamental-mine-detail h4 {
  margin: 0;
}

.fundamental-mine-job-card p,
.fundamental-mine-detail p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.fundamental-mine-company-row {
  width: 100%;
  cursor: pointer;
  text-align: left;
}

.fundamental-mine-company-row:hover,
.fundamental-mine-company-row:focus-visible {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.fundamental-mine-select {
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.fundamental-mine-select input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

.fundamental-mine-company-open {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.fundamental-mine-company-open strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.fundamental-mine-company-open:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.fundamental-mine-severity {
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.fundamental-mine-detail section {
  margin-top: 18px;
}

.fundamental-mine-detail ul {
  margin: 7px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.fundamental-mine-detail a {
  overflow-wrap: anywhere;
}

.technical-holdings-box {
  min-height: 560px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.technical-holdings-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.technical-holdings-head > p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
}

.technical-holdings-auth,
.technical-holdings-upload,
.technical-holdings-filters {
  display: grid;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.technical-holdings-auth {
  grid-template-columns: minmax(220px, 360px) auto minmax(160px, 1fr);
  padding: 12px 14px;
  border: 1px solid rgba(54, 95, 140, 0.24);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.technical-holdings-upload {
  grid-template-columns: minmax(260px, 1fr) auto minmax(180px, 320px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfc;
}

.technical-holdings-dropzone {
  min-height: 74px;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
}

.technical-holdings-dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--focus);
}

.technical-holdings-dropzone strong {
  color: var(--text);
}

.technical-holdings-dropzone span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.technical-holdings-filters {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.technical-holdings-auth input,
.technical-holdings-upload input,
.technical-holdings-filters select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
}

.technical-holdings-upload label {
  display: grid;
  gap: 7px;
}

.technical-holdings-upload span,
.technical-holdings-auth span {
  color: var(--muted);
  font-size: 12px;
}

.technical-holdings-upload.locked,
.technical-holdings-new-stocks-form.locked,
.technical-holdings-filters.locked,
.technical-holdings-layout.loading {
  opacity: 0.52;
  pointer-events: none;
}

.technical-holdings-upload progress {
  width: 100%;
}

.technical-holdings-summary,
.technical-holdings-portfolio-advice,
.technical-holdings-focus-task,
.technical-holdings-new-stocks-card {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.technical-holdings-new-stocks-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.technical-holdings-new-stocks-card h3 {
  margin: 0;
  font-size: 18px;
}

.technical-holdings-new-stocks-card header > p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: right;
}

.technical-holdings-new-stocks-form {
  display: grid;
  gap: 10px;
}

.technical-holdings-new-file-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.technical-holdings-new-file {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfc;
}

.technical-holdings-new-file span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.technical-holdings-new-file small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.technical-holdings-new-file input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
}

.technical-holdings-new-stocks-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.technical-holdings-new-stocks-form > p {
  margin: 0;
}

.technical-holdings-new-stocks-form > progress {
  width: 100%;
  margin: 0;
}

.technical-holdings-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.technical-holdings-summary-grid > div {
  min-height: 70px;
  padding: 11px 12px;
  border: 1px solid rgba(229, 227, 223, 0.9);
  border-radius: 8px;
  background: #fff8f7;
}

.technical-holdings-summary-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.technical-holdings-summary-grid strong {
  display: block;
  color: var(--text);
  font-size: 22px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.technical-holdings-priority-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.technical-holdings-priority {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfc;
}

.technical-holdings-priority h4 {
  margin-bottom: 9px;
  font-size: 14px;
}

.technical-holdings-priority-list {
  display: grid;
  gap: 8px;
}

.technical-holdings-priority-list button {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 76px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.technical-holdings-priority-list button:hover {
  border-color: var(--line-strong);
  background: var(--teal-soft);
}

.technical-holdings-priority-list strong,
.technical-holdings-priority-list span,
.technical-holdings-priority-list small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.technical-holdings-priority-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.technical-holdings-priority-list small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.technical-signal-window-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.technical-signal-window-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfc;
}

.technical-signal-window-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.technical-signal-window-card h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.technical-signal-window-card header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.technical-signal-window-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.technical-signal-window-columns > div > strong {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.technical-signal-window-list {
  display: grid;
  gap: 6px;
}

.technical-signal-window-stock {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 52px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.technical-signal-window-stock strong,
.technical-signal-window-stock span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.technical-signal-window-stock strong {
  font-size: 12px;
  line-height: 1.3;
}

.technical-signal-window-stock span {
  font-size: 11px;
  line-height: 1.4;
}

.technical-signal-window-stock.today {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.32);
}

.technical-signal-window-stock.watch {
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.28);
  background: #f8fbff;
}

.technical-holdings-portfolio-advice header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.technical-holdings-focus-task header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.technical-holdings-focus-task h3 {
  margin: 0;
  font-size: 18px;
}

.technical-holdings-focus-task progress {
  display: block;
  width: 100%;
  margin: 10px 0;
}

.technical-holdings-focus-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.technical-holdings-focus-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.technical-holdings-portfolio-advice h3 {
  margin: 0;
  font-size: 18px;
}

.technical-holdings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.technical-holdings-actions button {
  white-space: nowrap;
}

.technical-holdings-portfolio-advice-body {
  min-height: 86px;
  padding: 12px;
  border: 1px solid rgba(229, 227, 223, 0.9);
  border-radius: 8px;
  background: #fffdfc;
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.technical-holdings-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(0, 1.4fr);
  gap: 14px;
  align-items: start;
}

.technical-holdings-list,
.technical-holdings-detail {
  min-height: 520px;
  max-height: 820px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfc;
}

.technical-holdings-list {
  padding: 0;
}

.technical-holdings-detail {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.technical-holdings-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.technical-holdings-table th,
.technical-holdings-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 12px;
  vertical-align: top;
}

.technical-holdings-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff8f7;
  color: var(--muted);
}

.technical-holding-row {
  cursor: pointer;
}

.technical-holding-row:hover,
.technical-holding-row.selected {
  background: var(--teal-soft);
}

.technical-holding-row td:first-child strong,
.technical-holding-row td:first-child span {
  display: block;
}

.technical-holding-row td:first-child span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.technical-holdings-signal-meta {
  display: inline-grid;
  gap: 4px;
  min-width: 74px;
}

.technical-holdings-signal-meta span,
.technical-holdings-signal-meta small {
  line-height: 1.25;
}

.technical-holdings-signal-meta small {
  color: var(--muted);
  font-size: 11px;
}

.technical-holdings-score-badge {
  display: inline-flex;
  width: fit-content;
  min-width: 38px;
  justify-content: center;
  padding: 4px 7px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.technical-holdings-chart {
  min-height: 680px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.technical-holdings-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.technical-holdings-chart-head strong,
.technical-holdings-chart-head span {
  display: block;
}

.technical-holdings-chart-head span {
  color: var(--muted);
  font-size: 12px;
}

.technical-holdings-chart-main,
.technical-holdings-chart-macd,
.technical-holdings-chart-rsi {
  width: 100%;
}

.technical-holdings-chart-main {
  height: 360px;
}

.technical-holdings-chart-macd {
  height: 150px;
  border-top: 1px solid var(--line);
}

.technical-holdings-chart-rsi {
  height: 130px;
  border-top: 1px solid var(--line);
}

.technical-holdings-advice {
  display: grid;
  gap: 12px;
}

.technical-holdings-advice section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.technical-holdings-advice h3 {
  margin-bottom: 9px;
}

.technical-holdings-signal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.technical-holdings-signal-list span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f3ea;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.technical-holdings-signal-list .active {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff0ec;
  color: var(--red);
}

.technical-holdings-signal-list .preview {
  border-color: rgba(47, 95, 141, 0.26);
  background: #eef6ff;
  color: var(--blue);
}

.technical-holdings-advice-body {
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.technical-holdings-announcements {
  display: grid;
  gap: 12px;
}

.technical-holdings-announcements section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.technical-holdings-announcements h3 {
  margin-bottom: 8px;
}

.technical-holdings-announcement-meta {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.technical-holdings-announcement-list {
  display: grid;
  gap: 10px;
}

.technical-holdings-announcement-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(229, 227, 223, 0.9);
  border-radius: 8px;
  background: #fffdfc;
}

.technical-holdings-announcement-item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.technical-holdings-announcement-item strong,
.technical-holdings-announcement-item span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.technical-holdings-announcement-item strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.technical-holdings-announcement-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.technical-holdings-announcement-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.technical-holdings-announcement-links {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.technical-holdings-announcement-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.technical-holdings-announcement-links a:hover {
  border-color: var(--line-strong);
  background: #eef6ff;
}

.holdings-announcements-box {
  min-height: 560px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.holdings-announcements-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.holdings-announcements-head > p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
}

.holdings-announcements-dropzone {
  min-height: 74px;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
}

.holdings-announcements-dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--focus);
}

.holdings-announcements-dropzone strong {
  color: var(--text);
}

.holdings-announcements-dropzone span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.holdings-announcements-parsed {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.holdings-announcements-parsed > span {
  color: var(--muted);
  font-size: 12px;
}

.holdings-announcements-parsed-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 190px;
  overflow: auto;
}

.holdings-announcements-parsed-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.holdings-announcements-parsed-item small {
  color: var(--muted);
}

.holdings-announcements-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.holdings-announcements-filters select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
}

.holdings-announcements-filters.locked {
  opacity: 0.52;
  pointer-events: none;
}

.holdings-announcements-summary {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.holdings-announcements-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.holdings-announcements-summary-grid > div {
  min-height: 70px;
  padding: 11px 12px;
  border: 1px solid rgba(229, 227, 223, 0.9);
  border-radius: 8px;
  background: #fff8f7;
}

.holdings-announcements-summary-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.holdings-announcements-summary-grid strong {
  display: block;
  color: var(--text);
  font-size: 22px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.holdings-announcements-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.25fr);
  gap: 14px;
  align-items: start;
}

.holdings-announcements-list,
.holdings-announcements-detail {
  min-height: 520px;
  max-height: 820px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfc;
}

.holdings-announcements-list {
  padding: 0;
}

.holdings-announcements-detail {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
}

.holdings-announcements-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.holdings-announcements-table th,
.holdings-announcements-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 12px;
  vertical-align: top;
}

.holdings-announcements-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff8f7;
  color: var(--muted);
}

.holdings-announcement-row {
  cursor: pointer;
}

.holdings-announcement-row:hover,
.holdings-announcement-row.selected {
  background: var(--teal-soft);
}

.holdings-announcement-row td:first-child strong,
.holdings-announcement-row td:first-child span {
  display: block;
}

.holdings-announcement-row td:first-child span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.holdings-announcements-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.holdings-announcements-detail-head strong,
.holdings-announcements-detail-head span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.holdings-announcements-detail-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pre-market-brief-box {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.pre-market-brief-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.pre-market-brief-head h2 {
  margin: 0;
  font-size: 1.45rem;
}

.pre-market-brief-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pre-market-brief-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 260px);
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.pre-market-brief-status-row p {
  margin: 0;
}

.pre-market-brief-status-row progress {
  width: 100%;
}

.pre-market-brief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.pre-market-brief-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.pre-market-brief-section h3 {
  margin: 0;
  font-size: 1rem;
}

.pre-market-brief-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.pre-market-brief-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.pre-market-brief-table th,
.pre-market-brief-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
}

.pre-market-brief-table th {
  color: #334155;
  background: #eef2f7;
  font-weight: 800;
}

.pre-market-brief-table td strong,
.pre-market-brief-table td small {
  display: block;
}

.pre-market-brief-table td small {
  margin-top: 2px;
  color: var(--muted);
}

.pre-market-brief-preview {
  min-height: 420px;
  max-height: 680px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

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

.strategy-metric {
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.strategy-metric span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.strategy-metric strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 15px;
}

.strategy-image-wrap {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.strategy-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.strategy-chart-stack {
  display: grid;
  gap: 12px;
}

.strategy-chart-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
  overflow: hidden;
}

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

.strategy-chart-head strong {
  font-size: 14px;
}

.strategy-chart-head span {
  color: var(--muted);
  font-size: 12px;
}

.strategy-chart-wrap {
  min-width: 0;
  overflow: auto;
}

.strategy-chart-wrap .monitor-svg-chart {
  min-height: 210px;
}

.strategy-chart-wrap.small .monitor-svg-chart {
  min-height: 150px;
}

.strategy-week-summary {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.strategy-stale {
  margin: -2px 0 12px;
  padding: 9px 10px;
  border: 1px solid #f3c7bd;
  border-radius: 6px;
  background: #fff4ef;
  color: #9a4c3f;
  font-size: 12px;
  line-height: 1.5;
}

.strategy-error {
  margin: 10px 0 0;
  color: var(--red);
  font-size: 12px;
  line-height: 1.45;
}

.ask-ai-box {
  min-height: 520px;
  padding: 28px;
}

.ask-ai-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.ask-ai-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.ask-ai-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff8f7;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.ask-ai-hermes-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.ask-ai-hermes-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  line-height: 1.3;
}

.ask-ai-hermes-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.ask-ai-hermes-card.connected {
  border-color: rgba(54, 95, 140, 0.35);
}

.ask-ai-hermes-card.offline,
.ask-ai-hermes-card.not-configured,
.ask-ai-hermes-card.error {
  border-color: #f3c7bd;
  background: #fff8f7;
}

.ask-ai-hermes-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ask-ai-hermes-actions span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #365f8c;
  font-weight: 800;
}

.ask-ai-htsc-mcp-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(54, 95, 140, 0.28);
  border-radius: 8px;
  background: #f8fbfe;
}

.ask-ai-htsc-copy h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.3;
}

.ask-ai-htsc-copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ask-ai-htsc-status {
  justify-self: end;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdfc;
  color: #365f8c;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.ask-ai-htsc-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ask-ai-htsc-actions button {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--teal);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.ask-ai-htsc-actions button:hover,
.ask-ai-htsc-actions button:focus-visible {
  border-color: rgba(54, 95, 140, 0.42);
  background: var(--accent-soft);
  outline: none;
}

.ask-ai-duration-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(54, 95, 140, 0.22);
  border-radius: 8px;
  background: var(--accent-soft);
  color: #365f8c;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 800;
}

.ask-ai-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
}

.ask-ai-main {
  display: grid;
  grid-template-rows: minmax(280px, 1fr) auto auto;
  gap: 14px;
  min-width: 0;
}

.ask-ai-history {
  min-height: 280px;
  max-height: 674px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfc;
  overflow: auto;
}

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

.ask-ai-history-head strong {
  color: var(--text);
  font-size: 14px;
}

.ask-ai-history-head span {
  color: var(--muted);
  font-size: 12px;
}

.ask-ai-history-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.ask-ai-history-toolbar .ghost {
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 12px;
}

.ask-ai-history-toolbar .danger {
  color: var(--red);
}

.ask-ai-history-group {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.ask-ai-history-group h4 {
  margin: 0;
  color: var(--teal);
  font-size: 12px;
  line-height: 1.3;
}

.ask-ai-history-target {
  display: grid;
  gap: 6px;
}

.ask-ai-history-target strong {
  color: var(--text);
  font-size: 13px;
}

.ask-ai-history-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.ask-ai-history-check {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.ask-ai-history-item {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff8f7;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.ask-ai-history-item.active,
.ask-ai-history-item:hover,
.ask-ai-history-item:focus-visible {
  border-color: rgba(54, 95, 140, 0.35);
  background: var(--accent-soft);
  outline: none;
}

.ask-ai-history-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.ask-ai-history-item em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.ask-ai-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 280px;
  max-height: 520px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfc;
  overflow: auto;
}

.ask-ai-message {
  max-width: min(860px, 100%);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8f7;
}

.ask-ai-message.user {
  align-self: flex-end;
  background: var(--accent-soft);
}

.ask-ai-message.assistant {
  align-self: flex-start;
  background: #ffffff;
}

.ask-ai-message.error {
  border-color: #f3c7bd;
  background: #fff4ef;
}

.ask-ai-message.pending p {
  color: var(--muted);
}

.ask-ai-message span {
  display: block;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.ask-ai-message p {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
}

.ask-ai-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ask-ai-message-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdfc;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.ask-ai-message-actions button:hover,
.ask-ai-message-actions button:focus-visible {
  border-color: rgba(54, 95, 140, 0.35);
  background: var(--accent-soft);
  outline: none;
}

.ask-ai-figure-wrap {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
  padding: 10px;
}

.ask-ai-figure-page {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.ask-ai-figure-page figcaption {
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.ask-ai-figure-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.ask-ai-figure-loading,
.ask-ai-figure-error {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.ask-ai-figure-error {
  color: var(--red);
  background: #fff4ef;
}

.ask-ai-figure-probe {
  position: fixed;
  top: 0;
  left: -20000px;
  width: 1080px;
  pointer-events: none;
  visibility: hidden;
  z-index: -1;
}

.ask-ai-figure-table {
  width: 100%;
  border-collapse: collapse;
}

.ask-ai-auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.ask-ai-auth input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fffdfc;
  color: var(--text);
  outline: none;
}

.ask-ai-auth span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.ask-ai-password-hint {
  grid-column: 1 / -1;
}

.ask-ai-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.ask-ai-composer textarea {
  min-height: 84px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffdfc;
  color: var(--text);
  outline: none;
}

.ask-ai-send-row {
  display: grid;
  grid-template-rows: auto auto;
  gap: 10px;
  min-width: 150px;
}

.ask-ai-send-row select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fffdfc;
  color: var(--text);
  outline: none;
}

.ask-ai-composer textarea:disabled,
.ask-ai-composer button:disabled,
.ask-ai-composer select:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.ask-ai-desktop-card {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfc;
}

.ask-ai-desktop-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.3;
}

.ask-ai-office-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.ask-ai-office-status {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ask-ai-office-status span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #365f8c;
  font-size: 12px;
  font-weight: 800;
}

.ask-ai-office-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: stretch;
}

.ask-ai-office-scene {
  position: relative;
  min-height: 520px;
  border: 1px solid #392a24;
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 12%, rgba(66, 141, 159, 0.32), transparent 24%),
    linear-gradient(145deg, #1e120f 0%, #2d1914 48%, #130d0b 100%);
  overflow: hidden;
}

.ask-ai-office-map {
  display: block;
  width: 100%;
  min-width: 860px;
  height: 100%;
  min-height: 520px;
  color: #ffffff;
}

.ask-ai-office-map text {
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  pointer-events: none;
}

.ask-ai-office-room-label text {
  fill: #161616;
  font-size: 12px;
}

.ask-ai-office-mini-label text {
  font-size: 11px;
}

.ask-ai-office-grid path {
  stroke-width: 1;
}

.ask-ai-office-click-target {
  fill: transparent;
  pointer-events: all;
  stroke: none;
}

.ask-ai-office-partition,
.ask-ai-office-room-wall,
.ask-ai-office-desk-row,
.ask-ai-office-desk-pod,
.ask-ai-office-workstation,
.ask-ai-office-plant,
.ask-ai-office-chair,
.ask-ai-office-aligned-chair,
.ask-ai-office-monitor,
.ask-ai-office-drawfig-studio,
.ask-ai-office-easel,
.ask-ai-office-sofa,
.ask-ai-office-lounge-table {
  vector-effect: non-scaling-stroke;
}

.ask-ai-office-agent {
  cursor: pointer;
  outline: none;
  transform-box: fill-box;
  transform-origin: center;
  transition:
    transform 760ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 220ms ease,
    filter 220ms ease;
}

.ask-ai-office-agent:hover,
.ask-ai-office-agent:focus-visible,
.ask-ai-office-agent.active {
  filter: drop-shadow(0 0 12px rgba(88, 199, 183, 0.58));
}

.ask-ai-office-phase-meeting .ask-ai-office-agent {
  animation: none;
}

.ask-ai-office-phase-done .ask-ai-office-agent {
  animation: none;
}

.ask-ai-office-phase-meeting [data-office-agent="data"] {
  transform: translate(-190px, -30px) scale(0.68);
}

.ask-ai-office-phase-meeting [data-office-agent="news"] {
  transform: translate(-144px, -74px) scale(0.68);
}

.ask-ai-office-phase-meeting [data-office-agent="valuation"] {
  transform: translate(-252px, -30px) scale(0.68);
}

.ask-ai-office-phase-meeting [data-office-agent="strategy"] {
  transform: translate(-332px, -42px) scale(0.68);
}

.ask-ai-office-phase-meeting [data-office-agent="risk"] {
  transform: translate(-380px, 38px) scale(0.68);
}

.ask-ai-office-phase-meeting [data-office-agent="mxscreener"] {
  transform: translate(-224px, 84px) scale(0.68);
}

.ask-ai-office-phase-meeting [data-office-agent="drawfig"] {
  transform: translate(-290px, 72px) scale(0.68);
}

.ask-ai-office-phase-research .ask-ai-office-agent.ask-ai-office-standby-agent,
.ask-ai-office-phase-drawing .ask-ai-office-agent.ask-ai-office-standby-agent {
  opacity: 0.42;
  transform: none;
}

.ask-ai-office-phase-research .ask-ai-office-agent.ask-ai-office-used-agent,
.ask-ai-office-phase-drawing .ask-ai-office-agent.ask-ai-office-used-agent {
  animation: ask-ai-agent-pulse 1.8s ease-in-out infinite;
}

.ask-ai-office-phase-research [data-office-agent="data"] {
  transform: translate(196px, -103px) scale(0.66);
}

.ask-ai-office-phase-research [data-office-agent="news"] {
  transform: translate(281px, -143px) scale(0.66);
}

.ask-ai-office-phase-research [data-office-agent="valuation"] {
  transform: translate(216px, -103px) scale(0.66);
}

.ask-ai-office-phase-research [data-office-agent="strategy"] {
  transform: translate(86px, -103px) scale(0.66);
}

.ask-ai-office-phase-research [data-office-agent="risk"] {
  transform: translate(141px, -23px) scale(0.66);
}

.ask-ai-office-phase-research [data-office-agent="mxscreener"] {
  transform: translate(56px, -23px) scale(0.66);
}

.ask-ai-office-phase-research [data-office-agent="drawfig"] {
  transform: translate(316px, -63px) scale(0.66);
}

.ask-ai-office-phase-drawing [data-office-agent="drawfig"] {
  transform: translate(160px, 4px) scale(0.72);
}

.ask-ai-office-phase-research .ask-ai-office-research-room .ask-ai-office-room-wall,
.ask-ai-office-phase-research .ask-ai-office-research-room .ask-ai-office-whiteboard {
  filter: drop-shadow(0 0 10px rgba(93, 135, 194, 0.38));
}

.ask-ai-office-phase-drawing .ask-ai-office-drawfig-studio .ask-ai-office-room-wall,
.ask-ai-office-phase-drawing .ask-ai-office-easel {
  filter: drop-shadow(0 0 10px rgba(215, 165, 74, 0.42));
}

@keyframes ask-ai-agent-pulse {
  0%,
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(93, 135, 194, 0.34));
  }
  50% {
    opacity: 0.82;
    filter: drop-shadow(0 0 16px rgba(93, 135, 194, 0.62));
  }
}

.ask-ai-office-agent:hover .ask-ai-office-nameplate,
.ask-ai-office-agent:focus-visible .ask-ai-office-nameplate,
.ask-ai-office-agent.active .ask-ai-office-nameplate {
  fill: #365f8c;
  stroke: #d7a54a;
  stroke-width: 2;
}

.ask-ai-office-phase-meeting .ask-ai-office-agent .ask-ai-office-nameplate,
.ask-ai-office-phase-research .ask-ai-office-used-agent .ask-ai-office-nameplate,
.ask-ai-office-phase-drawing .ask-ai-office-used-agent .ask-ai-office-nameplate {
  fill: #172033;
  stroke: #d7a54a;
  stroke-width: 2;
  opacity: 1;
}

.ask-ai-office-nameplate {
  fill: #172033;
  stroke: rgba(255, 255, 255, 0.18);
  transition: fill var(--motion), stroke var(--motion), stroke-width var(--motion);
}

.ask-ai-office-agent text {
  fill: #ffffff;
  font-size: 12px;
}

.ask-ai-office-phase-meeting .ask-ai-office-agent text,
.ask-ai-office-phase-research .ask-ai-office-used-agent text,
.ask-ai-office-phase-drawing .ask-ai-office-used-agent text {
  fill: #ffffff;
  stroke: rgba(13, 18, 28, 0.62);
  stroke-width: 2px;
  paint-order: stroke;
}

.ask-ai-office-detail {
  min-height: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.ask-ai-office-detail strong {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
}

.ask-ai-office-detail p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.7;
}

.ask-ai-office-detail span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #e7f4f2;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.level-box,
.chart-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfc;
  padding: 14px;
}

.level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
}

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

.level-row span {
  color: var(--muted);
}

.price-chart {
  width: 100%;
  min-height: 260px;
  display: block;
}

.price-chart rect {
  fill: #fff8f7;
}

.price-chart text {
  fill: var(--muted);
  font-size: 12px;
}

.chart-line {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2.5;
}

.chart-level {
  stroke: #dcbfba;
  stroke-width: 1;
  stroke-dasharray: 5 5;
}

/* ---------- 市场监控 ---------- */
.monitor-chart-wrap {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfc;
  padding: 14px;
  overflow: auto;
}

.monitor-chart-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.monitor-svg-chart {
  width: 100%;
  min-height: 260px;
  display: block;
}

.monitor-svg-chart.mini {
  min-height: 174px;
}

.monitor-svg-chart rect.bg {
  fill: #fff8f7;
}

.monitor-svg-chart text {
  fill: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 11px;
}

.monitor-svg-chart .chart-grid {
  stroke: #f1dedb;
  stroke-width: 1;
}

.monitor-svg-chart .chart-line {
  fill: none;
  stroke-width: 2.5;
}

.monitor-svg-chart .chart-line.hs300 {
  stroke: #5f6fa0;
}

.monitor-svg-chart .chart-line.zz1000 {
  stroke: var(--teal);
}

.monitor-svg-chart .chart-line.total {
  stroke: #1565c0;
}

.monitor-svg-chart .chart-line.float {
  stroke: #b16a4f;
}

.monitor-svg-chart .chart-line.cap {
  stroke: #1565c0;
}

.monitor-svg-chart .chart-line.amount {
  stroke: #b16a4f;
}

.monitor-svg-chart .chart-line.gdp {
  stroke: #5f6fa0;
}

.monitor-svg-chart .chart-line.strategy-equity {
  stroke: #1565c0;
}

.monitor-svg-chart .chart-line.strategy-week {
  stroke: var(--teal);
}

.monitor-svg-chart .chart-area {
  fill: none;
}

.monitor-svg-chart .chart-dot {
  r: 3;
}

.monitor-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-size: 12px;
}

.monitor-legend.compact {
  gap: 10px;
  margin-top: 6px;
  font-size: 11px;
}

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

.monitor-legend-color {
  width: 14px;
  height: 3px;
  border-radius: 2px;
}

.monitor-legend-color.hs300 { background: #5f6fa0; }
.monitor-legend-color.zz1000 { background: var(--teal); }
.monitor-legend-color.total { background: #1565c0; }
.monitor-legend-color.float { background: #b16a4f; }
.monitor-legend-color.cap { background: #1565c0; }
.monitor-legend-color.amount { background: #b16a4f; }
.monitor-legend-color.gdp { background: #5f6fa0; }
.monitor-legend-color.strategy-equity { background: #1565c0; }
.monitor-legend-color.strategy-week { background: var(--teal); }

.monitor-box {
  min-height: 520px;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.monitor-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.monitor-head .eyebrow {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 9px;
}

.monitor-head h2 {
  font-size: 23px;
  line-height: 1.25;
}

.monitor-directory {
  position: sticky;
  top: 96px;
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 20px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 252, 0.98);
}

.monitor-directory a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff8f7;
  color: #6d5451;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.monitor-directory a:hover,
.monitor-directory a:focus {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.monitor-section {
  margin-bottom: 22px;
  scroll-margin-top: 172px;
}

.monitor-section h3 {
  font-size: 16px;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 3px solid var(--teal);
  color: var(--text);
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.monitor-overview-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

.monitor-mini-chart {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfc;
  padding: 12px;
}

.monitor-mini-chart header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.monitor-mini-chart header div {
  display: grid;
  gap: 3px;
}

.monitor-mini-chart header strong {
  font-size: 14px;
}

.monitor-mini-chart header span,
.monitor-mini-chart header small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.monitor-mini-chart header small {
  max-width: 190px;
  text-align: right;
}

.monitor-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfc;
  padding: 14px;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.monitor-card:hover {
  border-color: var(--teal);
  background: #fff3f1;
  transform: translateY(-1px);
}

.monitor-card.wide {
  grid-column: 1 / -1;
}

.monitor-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.monitor-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.monitor-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.monitor-metric {
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.monitor-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 3px;
}

.monitor-metric strong {
  font-size: 15px;
  color: var(--text);
}

.monitor-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.monitor-signal {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
}

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

.monitor-signal strong {
  font-size: 18px;
  font-weight: 800;
}

.monitor-signal.bull-large {
  border-color: #8c98bd;
  background: #eef1f8;
}

.monitor-signal.bull-large strong {
  color: #405b90;
}

.monitor-signal.bull-small {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.monitor-signal.bull-small strong {
  color: var(--teal);
}

.monitor-signal.crowding-high {
  border-color: var(--red);
  background: #fdecea;
}

.monitor-signal.crowding-high strong {
  color: var(--red);
}

.monitor-signal.crowding-low {
  border-color: #42a5f5;
  background: #e3f2fd;
}

.monitor-signal.crowding-low strong {
  color: #1565c0;
}

.monitor-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.monitor-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

.monitor-table th,
.monitor-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

.monitor-table th {
  position: sticky;
  top: 0;
  background: #fff8f7;
  color: var(--muted);
  font-weight: 700;
}

.monitor-table tbody tr:hover {
  background: #fff0ee;
}

/* ---------- Polished shell, indexing, and motion ---------- */
.app-main {
  display: block;
}

.panel-directory {
  counter-reset: section-index;
  position: sticky;
  top: var(--sticky-index-top);
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 8px;
  margin: 0 0 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.92);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  transition:
    max-height var(--motion),
    margin var(--motion),
    padding var(--motion),
    opacity var(--motion),
    transform var(--motion),
    border-color var(--motion);
}

.panel-directory a {
  counter-increment: section-index;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  transition: background var(--motion), border-color var(--motion), color var(--motion), transform var(--motion);
}

.panel-directory a::before {
  content: counter(section-index, decimal-leading-zero);
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.panel-directory a:hover,
.panel-directory a:focus-visible,
.panel-directory a.active {
  border-color: var(--ink-panel);
  background: var(--ink-panel);
  color: white;
  outline: none;
  transform: translateY(-1px);
}

.panel-directory a:hover::before,
.panel-directory a:focus-visible::before,
.panel-directory a.active::before {
  color: var(--accent);
}

.primary-directory,
.monitor-directory,
.strategy-directory {
  top: var(--sticky-index-top);
}

.screener-directory,
.ask-ai-directory {
  position: sticky;
}

.monitor-section,
#screener-builder,
#screener-condition-list,
#screener-results,
#ask-ai-thread,
#ask-ai-composer {
  scroll-margin-top: var(--section-scroll-margin);
}

.left-rail,
.main-work,
.screener-box,
.strategy-box,
.monitor-box,
.ask-ai-box,
.summary-grid,
.workspace > *,
.results-layout > *,
.screener-builder > *,
.primary-filter-grid > *,
.primary-condition-builder > *,
.ask-ai-main,
.ask-ai-composer > * {
  min-width: 0;
}

.left-rail,
.main-work,
.screener-box,
.strategy-box,
.monitor-box,
.ask-ai-box,
.summary-grid {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.module-card,
.detail-panel,
.table-wrap,
.factor-card,
.monitor-card,
.strategy-card,
.ask-ai-hermes-card,
.ask-ai-history,
.monitor-mini-chart,
.monitor-chart-wrap,
.level-box,
.chart-box,
.strategy-chart-block,
.ask-ai-history,
.ask-ai-thread,
.ask-ai-message {
  border-color: var(--line);
  border-radius: var(--radius);
  transition: border-color var(--motion), box-shadow var(--motion), transform var(--motion), background var(--motion);
}

.module-card,
.detail-panel,
.factor-card,
.monitor-card,
.strategy-card,
.monitor-mini-chart,
.monitor-chart-wrap,
.level-box,
.chart-box,
.strategy-chart-block,
.ask-ai-thread {
  background: var(--panel-soft);
}

.module-card:hover,
.factor-card:hover,
.monitor-card:hover,
.strategy-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.module-card {
  border-left: 0;
  border-top: 4px solid var(--teal);
}

.module-head,
.screener-head,
.strategy-head,
.monitor-head,
.ask-ai-head,
.section-heading {
  border-bottom: 1px solid rgba(229, 227, 223, 0.86);
  padding-bottom: 12px;
}

button,
.download-button,
.download-link {
  transition: background var(--motion), border-color var(--motion), color var(--motion), transform var(--motion), box-shadow var(--motion), opacity var(--motion);
}

button:hover:not(:disabled),
.download-button:hover:not(.disabled),
.download-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(200, 95, 85, 0.16);
}

button:focus-visible,
.download-button:focus-visible,
.download-link:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

button.ghost:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  color: var(--text);
}

input,
select,
textarea {
  transition: border-color var(--motion), box-shadow var(--motion), background var(--motion);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: var(--focus) !important;
}

.result-table th,
.monitor-table th,
.factor-rank-table th,
.factor-score-table th {
  background: #f7f3ea;
  color: var(--muted);
}

.result-table tr:hover,
.result-table tr.selected,
.monitor-table tbody tr:hover {
  background: #fff8d9;
}

.result-table tr.selected {
  box-shadow: inset 3px 0 0 var(--teal);
}

.score-badge {
  background: var(--teal-soft);
  color: var(--rose-strong);
}

.pill,
.stat-chip {
  background: var(--accent-soft);
  color: var(--ink-panel);
}

.empty-state {
  border: 1px dashed rgba(113, 118, 129, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.ask-ai-status {
  background: var(--accent-soft);
  color: var(--accent);
}

.ask-ai-message {
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.ask-ai-composer textarea {
  font-size: 14px;
  line-height: 1.6;
}

.primary-directory a,
.monitor-directory a,
.strategy-directory a {
  min-height: 42px;
  padding: 0 12px;
}

.summary-grid {
  overflow: hidden;
}

.metric {
  position: relative;
}

.metric::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: 8px;
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: rgba(49, 94, 138, 0.34);
}

.upload-dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.review-board,
.prediction-markets-board {
  display: grid;
  gap: 18px;
}

.review-board-head,
.prediction-markets-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.review-actions,
.prediction-markets-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

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

.review-card,
.prediction-accuracy-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.review-card {
  min-height: 220px;
  padding: 16px;
}

.review-card-wide {
  grid-column: 1 / -1;
}

.review-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.review-meta {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.review-body {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.review-body p {
  margin: 0;
}

.prediction-markets-accuracy {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.prediction-accuracy-card {
  display: grid;
  gap: 5px;
  padding: 13px;
}

.prediction-accuracy-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.prediction-accuracy-card strong {
  color: #0f4c81;
  font-size: 22px;
}

.prediction-accuracy-card small {
  color: var(--muted);
  font-size: 12px;
}

.prediction-markets-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.prediction-markets-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

.prediction-markets-table th,
.prediction-markets-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prediction-markets-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.prediction-markets-table td strong {
  display: block;
  margin-bottom: 4px;
}

.prediction-markets-table td small,
.prediction-markets-table td span {
  color: var(--muted);
}

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

@keyframes collapse-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Industry dashboard */
.industry-dashboard-box { display: grid; gap: 18px; }
.industry-dashboard-head, .industry-section-head, .industry-detail-head, .industry-ranking-card header, .industry-detail-module header, .industry-conclusion-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.industry-dashboard-head { padding: 4px 2px 0; }
.industry-dashboard-head h2, .industry-section-head h3, .industry-detail-head h3 { color: var(--ink-panel); }
.industry-dashboard-head p:not(.eyebrow), .industry-detail-head p:not(.eyebrow) { max-width: 760px; margin: 7px 0 0; line-height: 1.55; }
.industry-dashboard-actions, .industry-filters { display: flex; flex-wrap: wrap; align-items: end; justify-content: flex-end; gap: 8px; }
.industry-dashboard-actions label, .industry-filters label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.industry-dashboard-actions select, .industry-filters select { min-height: 34px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); padding: 6px 10px; }
.industry-dashboard-status, .industry-data-quality { border-left: 3px solid var(--teal); background: var(--accent-soft); color: var(--muted); padding: 9px 12px; font-size: 12px; }
.industry-section { display: grid; gap: 12px; scroll-margin-top: var(--section-scroll-margin); }
.industry-temperature { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(320px, 1.5fr) minmax(210px, .8fr); gap: 18px; border: 1px solid var(--line); background: var(--panel); padding: 18px 20px; }
.industry-temperature-main { display: grid; align-content: center; gap: 5px; border-right: 1px solid var(--line); padding-right: 18px; }
.industry-kicker, .industry-temperature-note, .industry-component-row, .industry-benchmark-item small, .industry-detail-module header span, .industry-ranking-card header span, .industry-score-band small, .industry-detail-head-meta small { color: var(--muted); font-size: 12px; }
.industry-temperature-score { color: var(--blue); font-size: 54px; font-weight: 800; letter-spacing: -2px; line-height: 1; }
.industry-temperature-score small { color: var(--muted); font-size: 14px; letter-spacing: 0; margin-left: 5px; }
.industry-regime { width: fit-content; padding: 4px 8px; border-radius: 5px; background: var(--teal-soft); color: var(--teal); font-size: 13px; }
.industry-regime.danger { color: var(--red); background: #fff1f0; }
.industry-regime.negative { color: var(--amber); background: #fff7e5; }
.industry-temperature-main p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.industry-temperature-chart { display: grid; align-content: center; gap: 10px; }
.industry-component-row { display: grid; grid-template-columns: 72px minmax(80px, 1fr) 35px; align-items: center; gap: 8px; }
.industry-component-track { height: 7px; overflow: hidden; border-radius: 4px; background: var(--panel-soft); }
.industry-component-track i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.industry-component-row strong { color: var(--ink-panel); font-size: 12px; text-align: right; }
.industry-temperature-note { display: grid; align-content: center; gap: 10px; border-left: 1px solid var(--line); padding-left: 18px; line-height: 1.45; }
.industry-benchmark-strip { display: grid; gap: 8px; }
.industry-benchmark-note { color: var(--muted); font-size: 11px; line-height: 1.45; }
.industry-benchmark-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.industry-benchmark-item { display: grid; gap: 5px; min-width: 0; border: 1px solid var(--line); background: var(--panel); padding: 12px 14px; }
.industry-benchmark-item span { color: var(--muted); font-size: 12px; }
.industry-benchmark-item strong { color: var(--ink-panel); font-size: 22px; }
.industry-benchmark-daily { color: var(--ink-panel) !important; }
.industry-table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--panel); }
.industry-heatmap-table, .industry-ranking-table table, .industry-leader-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.industry-heatmap-table th, .industry-heatmap-table td, .industry-ranking-table th, .industry-ranking-table td, .industry-leader-table th, .industry-leader-table td { border-bottom: 1px solid var(--line); padding: 9px 8px; white-space: nowrap; text-align: left; vertical-align: middle; }
.industry-heatmap-table th, .industry-ranking-table th, .industry-leader-table th { background: var(--panel-soft); color: var(--muted); font-weight: 700; }
.industry-heatmap-table tbody tr, .industry-ranking-table tbody tr, .industry-leader-table tbody tr { cursor: pointer; transition: background var(--motion); }
.industry-heatmap-table tbody tr:hover, .industry-heatmap-table tbody tr:focus-visible, .industry-heatmap-table tbody tr.selected, .industry-ranking-table tbody tr:hover, .industry-leader-table tbody tr:hover { background: var(--accent-soft); outline: none; }
.industry-heatmap-table td:nth-child(n+3) { min-width: 54px; text-align: center; }
.industry-heatmap-table td:nth-child(n+3).hot { background: rgba(240, 126, 103, .24); }
.industry-heatmap-table td:nth-child(n+3).warm { background: rgba(242, 190, 86, .23); }
.industry-heatmap-table td:nth-child(n+3).cool { background: rgba(139, 199, 158, .22); }
.industry-heatmap-table td:nth-child(n+3).cold { background: rgba(115, 174, 151, .30); }
.industry-heatmap-table td:nth-child(n+3).missing { background: var(--panel-soft); }
.industry-heatmap-table td:nth-child(2) strong, .industry-heatmap-table td:nth-child(2) small { display: block; }
.industry-heatmap-table td:nth-child(2) small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.industry-score { color: var(--ink-panel); font-weight: 800; }
.industry-score.strong { color: #18804b; }
.industry-score.mid { color: #96620f; }
.industry-score.weak { color: var(--red); }
.industry-score.missing { color: #9aa3af; font-weight: 500; }
.industry-ranking-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.industry-ranking-card, .industry-detail-module, .industry-conclusion-card { min-width: 0; border: 1px solid var(--line); background: var(--panel); }
.industry-ranking-card header, .industry-detail-module header, .industry-conclusion-card header { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.industry-ranking-card h4, .industry-detail-module h4, .industry-conclusion-card h4 { margin: 0; color: var(--ink-panel); font-size: 14px; }
.industry-ranking-table { overflow-x: auto; }
.industry-ranking-table table { min-width: 540px; }
.industry-detail-section { gap: 14px; }
.industry-detail-head { border: 1px solid var(--line); border-top: 3px solid var(--blue); background: var(--panel); padding: 18px 20px; }
.industry-detail-head h3 { font-size: 24px; }
.industry-detail-head-meta { display: grid; align-content: start; justify-items: end; gap: 7px; min-width: 170px; }
.industry-detail-head-meta strong { color: #18804b; font-size: 17px; }
.industry-detail-head-meta span { border-radius: 5px; background: var(--teal-soft); color: var(--blue); padding: 5px 8px; font-size: 12px; }
.industry-score-band { display: grid; grid-template-columns: repeat(6, minmax(80px, 1fr)) 1.15fr; border: 1px solid var(--line); background: var(--panel); }
.industry-score-band > div { display: grid; gap: 5px; padding: 12px 14px; border-right: 1px solid var(--line); }
.industry-score-band > div:last-child { border-right: 0; }
.industry-score-band span { color: var(--muted); font-size: 12px; }
.industry-score-band .industry-score { font-size: 22px; }
.industry-score-band .total { background: var(--accent-soft); }
.industry-detail-grid, .industry-detail-bottom-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.industry-detail-module.full { grid-column: 1 / -1; }
.industry-mini-bars { display: flex; align-items: end; gap: 10px; min-height: 145px; padding: 16px; }
.industry-mini-bars > div { display: grid; flex: 1; min-width: 0; height: 108px; align-content: end; justify-items: center; gap: 5px; }
.industry-mini-bars span { width: 100%; overflow: hidden; color: var(--muted); font-size: 9px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.industry-mini-bars i { display: block; width: 70%; min-height: 4px; border-radius: 3px 3px 0 0; background: var(--blue); }
.industry-mini-bars small { color: var(--muted); font-size: 10px; }
.industry-detail-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 14px; }
.industry-detail-metrics > div { display: grid; gap: 5px; padding: 0 12px; border-right: 1px solid var(--line); }
.industry-detail-metrics > div:nth-child(3n), .industry-detail-metrics > div:last-child { border-right: 0; }
.industry-detail-metrics span, .industry-detail-metrics small { color: var(--muted); font-size: 11px; }
.industry-detail-metrics strong { color: var(--ink-panel); font-size: 18px; }
.industry-data-footnote { padding: 0 14px 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.industry-leader-table-wrap { overflow-x: auto; }
.industry-leader-table { min-width: 920px; }
.industry-quadrant { position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; min-height: 230px; margin: 14px; border: 1px solid var(--line-strong); background: linear-gradient(90deg, transparent 49.7%, var(--line) 49.7%, var(--line) 50.3%, transparent 50.3%), linear-gradient(0deg, transparent 49.7%, var(--line) 49.7%, var(--line) 50.3%, transparent 50.3%); }
.industry-quadrant .q { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.industry-quadrant .q1 { background: rgba(90, 181, 119, .16); color: #18804b; }
.industry-quadrant .q2 { background: rgba(242, 190, 86, .15); color: #96620f; }
.industry-quadrant .q3 { background: rgba(146, 153, 165, .10); }
.industry-quadrant .q4 { background: rgba(211, 92, 81, .12); color: var(--red); }
.industry-quadrant .axis-x { position: absolute; right: 8px; bottom: -24px; color: var(--muted); font-size: 10px; font-weight: 500; }
.industry-quadrant .axis-y { position: absolute; left: -12px; top: 7px; color: var(--muted); font-size: 10px; font-weight: 500; writing-mode: vertical-rl; }
.industry-alert-list { display: grid; gap: 0; padding: 0 14px 10px; }
.industry-alert { display: grid; grid-template-columns: 80px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.industry-alert time, .industry-alert span { color: var(--muted); }
.industry-alert strong { color: var(--ink-panel); font-weight: 600; }
.industry-alert.risk strong { color: var(--red); }
.industry-alert.catalyst strong { color: #18804b; }
.industry-conclusion-card { margin-top: 2px; }
.industry-decision-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.industry-decision-card { display: grid; gap: 7px; min-height: 88px; padding: 16px; }
.industry-decision-card strong { color: var(--blue); font-size: 20px; }
.industry-decision-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.industry-conclusion-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.industry-conclusion-grid > div { padding: 14px; border-right: 1px solid var(--line); }
.industry-conclusion-grid > div:last-child { border-right: 0; }
.industry-conclusion-grid b { color: var(--muted); font-size: 12px; }
.industry-conclusion-grid p { margin: 7px 0 0; color: var(--ink-panel); font-size: 12px; line-height: 1.5; }
.industry-data-quality { display: grid; gap: 5px; border-left-color: #8a97a8; background: var(--panel-soft); }
.industry-data-quality div { display: flex; align-items: center; gap: 7px; color: var(--ink-panel); font-size: 13px; }
.industry-data-quality p { margin: 0; line-height: 1.5; }
.industry-quality-dimensions { display: flex; flex-wrap: wrap; gap: 6px; }
.industry-quality-chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; color: var(--muted); font-size: 11px; background: var(--panel); }
.industry-quality-chip.ready { color: #18804b; border-color: rgba(24, 128, 75, .25); }
.industry-quality-chip.partial { color: #9a6a00; border-color: rgba(154, 106, 0, .28); }
.industry-quality-chip.missing { color: #9b4f4f; border-color: rgba(155, 79, 79, .25); }
.industry-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.industry-status-dot.ready { background: #18804b; }

/* Medical industry dashboard */
.medical-dashboard-box { display: grid; gap: 18px; }
.medical-dashboard-head, .medical-benchmark-head, .medical-detail-head, .medical-module-card header, .medical-detail-full header, .medical-ranking-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.medical-dashboard-head { padding: 4px 2px 0; }
.medical-dashboard-head h2, .medical-detail-head h3, .medical-detail-full h4, .medical-ranking-card h4 { color: var(--ink-panel); }
.medical-dashboard-head p:not(.eyebrow), .medical-detail-head p:not(.eyebrow) { max-width: 800px; margin: 7px 0 0; line-height: 1.55; }
.medical-dashboard-actions { display: flex; flex-wrap: wrap; align-items: end; justify-content: flex-end; gap: 8px; }
.medical-dashboard-actions label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.medical-dashboard-actions select { min-height: 34px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); padding: 6px 10px; }
.medical-section { display: grid; gap: 12px; scroll-margin-top: var(--section-scroll-margin); }
.medical-temp-card { display: grid; grid-template-columns: minmax(220px, .7fr) 1.3fr; gap: 18px; border: 1px solid var(--line); background: var(--panel); padding: 18px 20px; }
.medical-temp-score { display: block; color: var(--blue); font-size: 50px; font-weight: 800; letter-spacing: -2px; line-height: 1; }
.medical-temp-regime { display: inline-block; margin-top: 8px; padding: 4px 8px; border-radius: 5px; background: var(--teal-soft); color: var(--teal); font-size: 13px; }
.medical-temp-components { display: grid; grid-template-columns: repeat(3, minmax(100px, 1fr)); gap: 8px; align-content: center; }
.medical-temp-chip { display: grid; gap: 6px; border: 1px solid var(--line); background: var(--panel-soft); padding: 10px; }
.medical-temp-chip span, .medical-temp-chip strong { color: var(--muted); font-size: 11px; }
.medical-temp-chip strong { color: var(--ink-panel); font-size: 18px; }
.medical-benchmark-head { align-items: end; }
.medical-benchmark-head h3 { margin: 0; color: var(--ink-panel); font-size: 16px; }
.medical-benchmark-head span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.medical-benchmark-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.medical-benchmark-card { display: grid; gap: 5px; min-width: 0; border: 1px solid var(--line); background: var(--panel); padding: 12px 14px; }
.medical-benchmark-card > span, .medical-benchmark-card small, .medical-benchmark-card em { color: var(--muted); font-size: 11px; }
.medical-benchmark-card strong { color: var(--ink-panel); font-size: 22px; }
.medical-benchmark-card em { overflow: hidden; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.medical-questions-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.medical-question-card { display: grid; gap: 7px; min-height: 126px; border: 1px solid var(--line); background: var(--panel); padding: 12px 14px; }
.medical-question-card > div { display: flex; gap: 8px; align-items: flex-start; }
.medical-question-card > div span { color: var(--teal); font-family: var(--font-mono); font-size: 11px; }
.medical-question-card strong { color: var(--ink-panel); font-size: 12px; line-height: 1.45; }
.medical-question-card p { margin: 0; color: var(--text); font-size: 12px; line-height: 1.45; }
.medical-question-card small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.medical-heatmap-table { min-width: 1080px; }
.medical-heatmap-table td:first-child small, .medical-ranking-table td:first-child small { display: block; max-width: 210px; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.medical-score-badge { color: var(--ink-panel); }
.medical-ranking-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.medical-ranking-card { min-width: 0; border: 1px solid var(--line); background: var(--panel); }
.medical-ranking-card header, .medical-detail-full header { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.medical-ranking-card header span, .medical-detail-full header span, .medical-module-card header span { color: var(--muted); font-size: 11px; }
.medical-ranking-card h4, .medical-detail-full h4 { margin: 0; font-size: 14px; }
.medical-ranking-table { min-width: 590px; width: 100%; border-collapse: collapse; font-size: 11px; }
.medical-ranking-table th, .medical-ranking-table td, .medical-leader-detail-table th, .medical-leader-detail-table td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; white-space: nowrap; }
.medical-ranking-table th, .medical-leader-detail-table th { background: var(--panel-soft); color: var(--muted); font-weight: 700; }
.medical-ranking-table tbody tr, .medical-leader-detail-table tbody tr { cursor: pointer; }
.medical-ranking-table tbody tr:hover, .medical-ranking-table tbody tr:focus-visible, .medical-leader-detail-table tbody tr:hover, .medical-leader-detail-table tbody tr:focus-visible { background: var(--accent-soft); outline: none; }
.medical-ranking-list { display: grid; gap: 0; padding: 0 14px; }
.medical-ranking-list > div { display: grid; grid-template-columns: minmax(100px, .8fr) 1fr 44px; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.medical-ranking-list span { color: var(--muted); }
.medical-ranking-list b { color: var(--blue); text-align: right; }
.medical-detail-head { border: 1px solid var(--line); border-top: 3px solid var(--teal); background: var(--panel); padding: 18px 20px; }
.medical-detail-head h3 { margin: 0; font-size: 24px; }
.medical-detail-score { display: grid; min-width: 130px; gap: 5px; justify-items: end; }
.medical-detail-score span, .medical-detail-score small { color: var(--muted); font-size: 11px; }
.medical-detail-score strong { color: var(--blue); font-size: 32px; }
.medical-detail-modules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.medical-module-card, .medical-detail-full, .medical-conclusion-card { min-width: 0; border: 1px solid var(--line); background: var(--panel); }
.medical-module-card header { padding: 11px 13px; border-bottom: 1px solid var(--line); }
.medical-module-card h4 { margin: 0; color: var(--ink-panel); font-size: 13px; }
.medical-module-card p { min-height: 48px; margin: 0; padding: 11px 13px 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.medical-module-card > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.medical-module-card > div span { display: grid; gap: 4px; padding: 8px 13px; border-top: 1px solid var(--line); }
.medical-module-card > div small { color: var(--muted); font-size: 10px; }
.medical-module-card > div b { color: var(--ink-panel); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.medical-leader-detail-table { min-width: 980px; width: 100%; border-collapse: collapse; font-size: 11px; }
.medical-detail-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.medical-quadrant { display: grid; grid-template-columns: 1fr 1fr; min-height: 220px; margin: 14px; border: 1px solid var(--line-strong); }
.medical-quadrant > div { display: grid; align-content: center; justify-items: center; gap: 5px; border: 1px solid var(--line); }
.medical-quadrant > div:nth-child(1) { background: rgba(90,181,119,.16); color: #18804b; }
.medical-quadrant > div:nth-child(2) { background: rgba(242,190,86,.15); color: #96620f; }
.medical-quadrant > div:nth-child(3) { background: rgba(146,153,165,.10); color: var(--muted); }
.medical-quadrant > div:nth-child(4) { background: rgba(211,92,81,.12); color: var(--red); }
.medical-quadrant span { font-size: 11px; }
.medical-quadrant b { font-size: 13px; }
.medical-alert-list { display: grid; gap: 0; padding: 0 14px 10px; }
.medical-alert-item { display: grid; gap: 4px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.medical-alert-item strong { color: var(--ink-panel); font-size: 12px; }
.medical-alert-item span, .medical-alert-item small { color: var(--muted); font-size: 10px; }
.medical-risk-title { margin: 15px 14px 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--red); font-size: 13px; }
.medical-conclusion-card { display: grid; gap: 10px; padding: 14px 16px; }
.medical-conclusion-card > strong { color: var(--ink-panel); font-size: 14px; }
.medical-conclusion-card p { margin: 0; color: var(--text); font-size: 12px; line-height: 1.55; }
.medical-conclusion-card > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.medical-conclusion-card > div span { color: var(--muted); font-size: 11px; }
.medical-conclusion-card > div b { color: var(--ink-panel); font-size: 12px; line-height: 1.4; }
.medical-leader-inspector { display: grid; gap: 12px; border: 1px solid var(--line-strong); border-top: 3px solid var(--blue); background: var(--panel); padding: 14px 16px; }
.medical-leader-inspector-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.medical-leader-inspector-head h4 { margin: 3px 0 4px; color: var(--ink-panel); font-size: 18px; }
.medical-leader-inspector-head span, .medical-leader-inspector-note, .medical-leader-source { color: var(--muted); font-size: 11px; }
.medical-leader-inspector-head > strong { color: var(--blue); font-size: 28px; }
.medical-leader-inspector-note, .medical-leader-source { margin: 0; line-height: 1.5; }
.medical-leader-compare { overflow-x: auto; border: 1px solid var(--line); }
.medical-leader-compare > div { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(100px, .7fr) minmax(120px, .8fr); gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 11px; }
.medical-leader-compare > div:last-child { border-bottom: 0; }
.medical-leader-compare-head { background: var(--panel-soft); color: var(--muted); font-weight: 700; }
.medical-leader-compare b { color: var(--ink-panel); }
.medical-leader-score-breakdown { border: 1px solid var(--line); }
.medical-leader-score-breakdown header { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--ink-panel); font-size: 12px; }
.medical-leader-score-breakdown header span { color: var(--blue); font-family: var(--font-mono); }
.medical-leader-score-breakdown > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.medical-leader-score-breakdown > div span { display: grid; gap: 4px; padding: 8px 10px; border-right: 1px solid var(--line); }
.medical-leader-score-breakdown > div span:last-child { border-right: 0; }
.medical-leader-score-breakdown small { color: var(--muted); font-size: 10px; }
.medical-leader-score-breakdown b { color: var(--ink-panel); font-size: 12px; }
@media (max-width: 1100px) {
  .industry-temperature { grid-template-columns: 1fr 1.35fr; }
  .industry-benchmark-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .industry-temperature-note { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 0; padding: 12px 0 0; }
  .industry-score-band { overflow-x: auto; grid-template-columns: repeat(7, minmax(100px, 1fr)); }
  .industry-score-band > div { min-width: 100px; }
}
@media (max-width: 760px) {
  .industry-dashboard-head, .industry-section-head, .industry-detail-head, .industry-ranking-card header, .industry-detail-module header, .industry-conclusion-card header { display: grid; }
  .industry-dashboard-actions, .industry-filters { justify-content: start; }
  .industry-temperature, .industry-benchmark-grid, .industry-ranking-grid, .industry-detail-grid, .industry-detail-bottom-grid, .industry-decision-grid { grid-template-columns: 1fr; }
  .industry-temperature-main { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 14px; }
  .industry-temperature-note { grid-template-columns: 1fr; }
  .industry-detail-head-meta { justify-items: start; }
  .industry-detail-metrics, .industry-conclusion-grid { grid-template-columns: 1fr 1fr; }
  .industry-detail-metrics > div:nth-child(2n), .industry-conclusion-grid > div:nth-child(2n) { border-right: 0; }
  .industry-detail-metrics > div:nth-child(n+3), .industry-conclusion-grid > div:nth-child(n+3) { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
  .industry-alert { grid-template-columns: 65px 1fr; }
  .industry-alert span { grid-column: 2; }
  .medical-dashboard-head, .medical-benchmark-head, .medical-detail-head, .medical-detail-full header, .medical-ranking-card header { display: grid; }
  .medical-dashboard-actions { justify-content: start; }
  .medical-temp-card, .medical-benchmark-grid, .medical-questions-grid, .medical-ranking-grid, .medical-detail-modules, .medical-detail-bottom { grid-template-columns: 1fr; }
  .medical-temp-components { grid-template-columns: repeat(2, minmax(100px, 1fr)); }
  .medical-detail-score { justify-items: start; }
  .medical-conclusion-card > div { grid-template-columns: 1fr; }
  .medical-leader-inspector-head { display: grid; }
  .medical-leader-score-breakdown > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .medical-leader-score-breakdown > div span:nth-child(2n) { border-right: 0; }
}

@media (max-width: 1180px) {
  :root {
    --sticky-index-top: 210px;
    --section-scroll-margin: 280px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
  }

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

  .panel-directory {
    position: sticky;
  }
}

@media (max-width: 1180px) {
  .workspace,
  .results-layout,
  .ai-technical-params,
  .ai-technical-results,
  .screener-builder,
  .primary-filter-grid,
  .primary-condition-builder,
  .fundamental-mine-layout,
  .technical-holdings-summary-grid,
  .technical-holdings-priority-grid,
  .technical-holdings-layout,
  .pre-market-brief-grid,
  .holdings-announcements-summary-grid,
  .holdings-announcements-layout {
    grid-template-columns: 1fr;
  }

  .left-rail {
    order: 2;
  }

  .monitor-mini-chart-grid {
    grid-template-columns: 1fr;
  }

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

  .data-status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --sticky-index-top: 72px;
    --section-scroll-margin: 118px;
  }

  .app-shell {
    width: min(100vw - 18px, 720px);
    padding-top: 0;
  }

  .topbar {
    align-items: stretch;
    grid-template-columns: 1fr;
    gap: 8px;
    top: 8px;
    padding: 10px;
    margin: 0 -9px 10px;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 12px 30px rgba(74, 75, 80, 0.1);
    transform: translateY(0);
    will-change: transform, opacity;
  }

  .topbar h1 {
    font-size: 22px;
    line-height: 1.12;
  }

  .topbar .eyebrow {
    margin-bottom: 3px;
    font-size: 11px;
  }

  .topbar.topbar-hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(-100% - 10px));
  }

  body.mobile-topbar-hidden {
    --sticky-index-top: 8px;
    --section-scroll-margin: 82px;
  }

  .topbar > div:first-child,
  .mode-nav-shell,
  #detail-function-shell {
    grid-column: 1;
    grid-row: auto;
  }

  .mode-nav-shell,
  .mode-tabs {
    width: 100%;
  }

  .mode-tab {
    flex: 1 1 0;
    min-height: 40px;
    padding: 8px 10px;
  }

  #detail-function-shell {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    box-shadow: none;
  }

  .tab {
    min-height: 38px;
    padding: 7px 8px;
    border-radius: 8px;
    font-size: 12px;
    white-space: normal;
  }

  .topbar-nav-shell {
    width: 100%;
    justify-items: stretch;
  }

  .top-tab-index-toggle {
    width: 100%;
    min-height: 38px;
  }

  .info-grid,
  .calc-line,
  .screener-builder,
  .primary-filter-grid,
  .primary-condition-builder {
    grid-template-columns: 1fr;
  }

  .primary-directory {
    position: sticky;
    grid-template-columns: none;
    gap: 6px;
    top: var(--sticky-index-top);
    margin-bottom: 10px;
    padding: 7px;
    border-radius: 10px;
  }

  body.mobile-topbar-hidden .panel-directory,
  body.mobile-topbar-hidden .primary-directory {
    top: 10px;
  }

  .panel-directory {
    position: sticky;
    display: flex;
    grid-template-columns: none;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    max-height: 96px;
  }

  body.mobile-index-collapsed .panel.active .panel-directory {
    top: 8px;
    max-height: 42px;
    margin-bottom: 8px;
    padding: 5px;
    border-color: var(--line-strong);
    border-radius: 14px;
    background: rgba(255, 253, 250, 0.98);
    box-shadow: var(--shadow);
    opacity: 1;
    overflow-x: auto;
    overflow-y: hidden;
    pointer-events: auto;
    transform: none;
    visibility: visible;
  }

  .primary-directory a {
    flex: 0 0 auto;
    min-height: 30px;
    min-width: max-content;
    padding: 0 8px;
    font-size: 11.5px;
  }

  .panel-directory a {
    flex: 0 0 auto;
    min-width: max-content;
    min-height: 30px;
    padding: 0 8px;
    font-size: 11.5px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
    border-radius: 16px;
  }

  .metric {
    min-height: 64px;
    padding: 9px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .metric:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .metric span {
    font-size: 12px;
    margin-bottom: 5px;
  }

  .metric strong {
    font-size: 23px;
  }

  .ai-technical-box,
  .screener-box,
  .strategy-box,
  .fundamental-mine-box,
  .technical-holdings-box,
  .pre-market-brief-box,
  .monitor-box,
  .ask-ai-box,
  .left-rail,
  .main-work {
    padding: 14px;
    border-radius: var(--radius);
  }

  .main-work {
    padding: 0;
  }

  .module-card,
  .detail-panel {
    padding: 12px;
    border-radius: var(--radius);
  }

  .module-head,
  .screener-head,
  .strategy-head,
  .fundamental-mine-head,
  .technical-holdings-head,
  .monitor-head,
  .ask-ai-head,
  .strategy-card header {
    align-items: flex-start;
    flex-direction: column;
  }

  .monitor-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .strategy-directory {
    position: sticky;
    grid-template-columns: none;
  }

  .fundamental-mine-head > p {
    text-align: left;
  }

  .technical-holdings-head > p {
    text-align: left;
  }

  .holdings-announcements-head {
    align-items: stretch;
    flex-direction: column;
  }

  .holdings-announcements-head > p {
    max-width: none;
    text-align: left;
  }

  .fundamental-mine-form,
  .fundamental-mine-auth,
  .fundamental-mine-progress-card,
  .fundamental-mine-filters,
  .technical-holdings-auth,
  .technical-holdings-upload,
  .technical-holdings-new-file-grid,
  .technical-holdings-summary-grid,
  .technical-holdings-priority-grid,
  .technical-holdings-filters,
  .pre-market-brief-status-row,
  .holdings-announcements-summary-grid,
  .holdings-announcements-filters {
    grid-template-columns: 1fr;
  }

  .pre-market-brief-head {
    display: grid;
  }

  .pre-market-brief-actions {
    justify-content: stretch;
  }

  .pre-market-brief-actions button {
    flex: 1 1 120px;
  }

  .pre-market-brief-preview {
    min-height: 320px;
    max-height: 520px;
  }

  .fundamental-mine-form button,
  .fundamental-mine-filters button,
  .technical-holdings-auth button,
  .technical-holdings-upload button,
  .technical-holdings-portfolio-advice button,
  .technical-holdings-focus-task button,
  .fundamental-mine-actions button {
    width: 100%;
  }

  .technical-holdings-portfolio-advice header,
  .technical-holdings-focus-task header,
  .technical-holdings-new-stocks-card header {
    align-items: stretch;
    flex-direction: column;
  }

  .technical-holdings-new-stocks-card header > p {
    max-width: none;
    text-align: left;
  }

  .technical-holdings-actions {
    justify-content: stretch;
  }

  .technical-signal-window-columns {
    grid-template-columns: 1fr;
  }

  .technical-holdings-announcement-item header {
    flex-direction: column;
  }

  .technical-holdings-announcement-links {
    justify-content: flex-start;
  }

  .technical-holdings-list,
  .technical-holdings-detail,
  .holdings-announcements-list,
  .holdings-announcements-detail {
    min-height: 360px;
    max-height: none;
  }

  .technical-holdings-chart {
    min-height: 620px;
  }

  .technical-holdings-chart-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ask-ai-composer {
    grid-template-columns: 1fr;
  }

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

  .ask-ai-htsc-mcp-card {
    grid-template-columns: 1fr;
  }

  .ask-ai-htsc-status {
    justify-self: stretch;
    white-space: normal;
  }

  .ask-ai-htsc-actions {
    grid-template-columns: 1fr;
  }

  .ask-ai-main {
    grid-template-rows: minmax(520px, 1fr) auto auto;
  }

  .ask-ai-thread {
    min-height: 520px;
    max-height: 78vh;
    padding: 12px;
  }

  .ask-ai-message {
    width: 100%;
    max-width: 100%;
  }

  .ask-ai-history {
    max-height: 260px;
  }

  .ask-ai-desktop-card {
    grid-template-columns: 1fr;
  }

  .ask-ai-office-head,
  .ask-ai-office-shell {
    grid-template-columns: 1fr;
  }

  .ask-ai-office-head {
    align-items: stretch;
    flex-direction: column;
  }

  .ask-ai-office-status {
    justify-content: flex-start;
  }

  .ask-ai-office-scene {
    min-height: 430px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ask-ai-office-map {
    min-width: 760px;
    min-height: 430px;
  }

  .ask-ai-auth,
  .ask-ai-hermes-card {
    grid-template-columns: 1fr;
  }

  .ask-ai-auth {
    display: grid;
  }

  .ask-ai-hermes-card,
  .ask-ai-hermes-actions,
  .ask-ai-head-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ask-ai-hermes-actions,
  .ask-ai-head-actions {
    justify-content: flex-start;
  }

  .ask-ai-send-row {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

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

  .protocol-transfer-head {
    align-items: stretch;
    flex-direction: column;
  }

  .protocol-transfer-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .protocol-transfer-actions input,
  .protocol-transfer-actions button,
  .protocol-transfer-actions .download-button {
    width: 100%;
  }

  .protocol-transfer-analysis-progress {
    grid-template-columns: 1fr;
  }

  .protocol-transfer-manual-analysis {
    width: 100%;
    min-width: 0;
  }

  .protocol-transfer-analysis-requirement,
  .protocol-transfer-manual-analysis button {
    width: 100%;
  }

  .monitor-directory {
    position: sticky;
    grid-template-columns: none;
  }

  .data-status-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .data-status-actions {
    justify-content: flex-start;
  }

  .data-status-summary {
    max-width: none;
    text-align: left;
  }

  .data-status-grid {
    grid-template-columns: 1fr;
  }

  .calc-line button,
  .ai-technical-progress,
  .screener-builder button,
  .primary-condition-builder button,
  .module-head button,
  .screener-head button,
  .ask-ai-composer button,
  .ask-ai-auth button,
  .ask-ai-hermes-actions button,
  .ask-ai-htsc-actions button,
  .ask-ai-message-actions button,
  .screener-actions button,
  .download-button,
  .download-link {
    width: 100%;
  }

  .ai-technical-tabs {
    overflow-x: auto;
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .ai-technical-tabs button {
    flex: 0 0 auto;
  }

  .ai-technical-progress {
    grid-template-columns: 1fr;
  }

  .ai-technical-chart {
    min-height: 260px;
    padding: 10px;
  }

  .ai-technical-report {
    height: auto;
    max-height: 72vh;
    padding: 16px;
  }

  .screener-head,
  .module-head,
  .screener-actions,
  .screener-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-update-actions {
    width: 100%;
    flex-direction: column;
  }

  .module-head-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .table-wrap,
  .screener-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .result-table {
    display: block;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .result-table thead {
    display: none;
  }

  .result-table tbody {
    display: grid;
    gap: 10px;
  }

  .result-table tr {
    display: grid;
    gap: 9px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
  }

  .result-table tr:hover,
  .result-table tr.selected {
    background: #fff8f5;
  }

  .result-table tr.selected {
    border-color: rgba(200, 95, 85, 0.42);
  }

  .result-table td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    padding: 0;
    border-bottom: 0;
    font-size: 13px;
    line-height: 1.5;
    align-items: start;
  }

  .result-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
  }

  .result-table td:not([data-label]) {
    display: block;
  }

  .result-table td:not([data-label])::before {
    content: none;
  }

  .result-table td.name-cell {
    display: block;
    padding-bottom: 4px;
  }

  .result-table td.name-cell::before {
    display: none;
  }

  .result-table .name-cell strong {
    font-size: 17px;
  }

  .result-table .name-cell span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
  }

  .cell-text.is-collapsible {
    max-width: 100%;
  }

  .text-lines p {
    display: block;
  }

  .text-lines .cell-toggle {
    margin-top: 2px;
  }

  .cell-toggle {
    justify-self: start;
    height: 24px;
    margin-top: 2px;
  }

  .screener-filters select {
    width: 100%;
  }

  .quick-start-hero,
  .quick-start-auth,
  .quick-start-output,
  .quick-start-progress-row {
    grid-template-columns: 1fr;
  }

  .quick-start-hero {
    display: grid;
  }

  .quick-start-report-type-grid {
    grid-template-columns: 1fr;
  }

  .deep-research-form-grid,
  .deep-research-standard-grid {
    grid-template-columns: 1fr;
  }

  .quick-start-technical-period {
    grid-template-columns: 1fr;
  }

  .quick-start-option {
    min-height: auto;
  }

  h1 {
    font-size: 24px;
  }
}

@media (max-width: 380px) {
  .tabs {
    grid-template-columns: 1fr;
  }
}

/* ---------- ProInv professional research workbench ---------- */

:root {
  --app-sidebar-width: 224px;
  --app-sidebar-collapsed-width: 72px;
  --page-bg: #f5f7fa;
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --ink-panel: #172033;
  --line: #e5eaf0;
  --line-strong: #cbd5e1;
  --text: #172033;
  --muted: #667085;
  --teal: #2563eb;
  --teal-soft: #eff6ff;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --blue: #1d4ed8;
  --amber: #b7791f;
  --red: #b42318;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.055);
  --focus: 0 0 0 3px rgba(37, 99, 235, 0.2);
  --radius: 10px;
  --motion: 200ms cubic-bezier(0.2, 0.7, 0.2, 1);
  --sticky-index-top: 72px;
  --section-scroll-margin: 132px;
}

html {
  background: var(--page-bg);
  scroll-behavior: smooth;
}

body.app-body {
  min-width: 320px;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--page-bg);
  box-shadow: none;
  transition: grid-template-columns var(--motion);
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: var(--app-sidebar-collapsed-width) minmax(0, 1fr);
}

.app-workspace {
  min-width: 0;
  width: 100%;
}

.app-sidebar {
  --bs-offcanvas-width: min(320px, 88vw);
  position: sticky;
  top: 0;
  z-index: 1035;
  display: flex;
  flex-direction: column;
  width: var(--app-sidebar-width);
  height: 100vh;
  border: 0;
  border-right: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  overflow: hidden;
  transition: width var(--motion), box-shadow var(--motion), transform var(--motion);
}

body.sidebar-collapsed .app-sidebar {
  width: var(--app-sidebar-collapsed-width);
}

.app-sidebar-header {
  flex: 0 0 auto;
  min-height: 72px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.app-brand-mark {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.22);
}

.app-brand-mark svg,
.app-sidebar svg,
.mobile-app-bar svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.app-brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.app-brand-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.app-sidebar-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  padding: 12px 10px;
  overflow-x: hidden;
  overflow-y: auto;
}

.app-sidebar .mode-tabs {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 0 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-sidebar .mode-tab,
.app-sidebar .tab {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
  box-shadow: none;
  transform: none;
  transition: color var(--motion), background var(--motion), box-shadow var(--motion);
}

.app-sidebar .mode-tab svg,
.app-sidebar .tab svg {
  flex: 0 0 18px;
  color: #667085;
}

.app-sidebar .mode-tab:hover,
.app-sidebar .mode-tab:focus-visible,
.app-sidebar .tab:hover,
.app-sidebar .tab:focus-visible {
  background: #f1f5f9;
  color: var(--text);
}

.app-sidebar .mode-tab.active,
.app-sidebar .tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.app-sidebar .mode-tab.active svg,
.app-sidebar .tab.active svg {
  color: #fff;
}

.detail-function-shell {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding-top: 12px;
}

#detail-function-shell.detail-function-shell {
  grid-column: auto;
  grid-row: auto;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  width: 100%;
}

.sidebar-index-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 0 8px;
  color: #475467;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.top-tab-index-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.top-tab-index-toggle:hover,
.top-tab-index-toggle:focus-visible {
  background: #eef2f7;
  color: var(--text);
}

.top-tab-index-toggle svg {
  width: 13px;
  height: 13px;
}

.app-sidebar.index-collapsed #top-tab-index {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.app-sidebar .tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  max-height: 960px;
  opacity: 1;
  overflow: hidden;
  transition: max-height var(--motion), opacity var(--motion);
}

.sidebar-group-label {
  display: block;
  margin: 12px 8px 4px;
  color: #98a2b3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.sidebar-group-label:first-child {
  margin-top: 2px;
}

.app-sidebar-toggle {
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 52px;
  margin: 0;
  padding: 8px 20px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: #475467;
  font-size: 12px;
  font-weight: 750;
}

.app-sidebar-toggle:hover,
.app-sidebar-toggle:focus-visible {
  background: #f8fafc;
  color: var(--accent);
}

body.sidebar-collapsed .app-brand-copy,
body.sidebar-collapsed .app-sidebar .mode-tab span,
body.sidebar-collapsed .app-sidebar .tab span,
body.sidebar-collapsed .sidebar-index-heading > span,
body.sidebar-collapsed .top-tab-index-toggle span,
body.sidebar-collapsed .app-sidebar-toggle span {
  display: none;
}

body.sidebar-collapsed .app-sidebar-header {
  justify-content: center;
  padding-inline: 10px;
}

body.sidebar-collapsed .app-sidebar-body {
  padding-inline: 8px;
}

body.sidebar-collapsed .app-sidebar .mode-tab,
body.sidebar-collapsed .app-sidebar .tab,
body.sidebar-collapsed .app-sidebar-toggle,
body.sidebar-collapsed .sidebar-index-heading {
  justify-content: center;
  padding-inline: 8px;
}

body.sidebar-collapsed .sidebar-group-label {
  height: 1px;
  margin: 10px 8px 6px;
  overflow: hidden;
  background: var(--line);
  color: transparent;
}

.mobile-app-bar {
  display: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1015;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  margin: 0;
  padding: 13px clamp(18px, 2.2vw, 32px);
  border: 0;
  border-bottom: 1px solid rgba(229, 234, 240, 0.94);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
  backdrop-filter: blur(16px);
}

.topbar-title {
  min-width: 0;
}

.topbar .eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.03em;
}

.topbar h1 {
  overflow: hidden;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.topbar-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
}

.app-main {
  min-width: 0;
  padding: 20px clamp(16px, 2.2vw, 32px) 32px;
}

.panel.active {
  display: block;
  animation: workbench-panel-in 200ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes workbench-panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel:focus {
  outline: none;
}

.panel-directory-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.panel-directory-toggle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform var(--motion);
}

.panel-directory-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.panel-directory {
  position: sticky;
  top: 72px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: -4px 0 16px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.045);
  overflow-x: auto;
  scrollbar-width: thin;
  backdrop-filter: blur(14px);
}

.panel-directory a {
  flex: 1 1 auto;
  min-width: max-content;
  min-height: 40px;
  padding: 9px 12px;
  border: 0;
  border-radius: 7px;
  color: #667085;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.panel-directory a::before {
  display: none;
}

.panel-directory a:hover,
.panel-directory a:focus-visible,
.panel-directory a.active {
  border: 0;
  background: var(--accent-soft);
  color: var(--accent-hover);
  box-shadow: none;
}

.module-section,
.module-card,
.quick-start-hero,
.quick-start-card,
.quick-start-result-card,
.quick-start-history-card,
.ai-technical-box,
.technical-holdings-box,
.holdings-announcements-box,
.pre-market-brief-box,
.review-box,
.prediction-markets-box,
.monitor-box,
.screener-box,
.strategy-box,
.fundamental-mine-box,
.ask-ai-box {
  border-color: var(--line);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.module-card,
.quick-start-card,
.quick-start-result-card,
.quick-start-history-card {
  border-radius: 10px;
}

button,
input,
select,
textarea {
  min-height: 44px;
  font-family: inherit;
}

button,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  min-height: 44px !important;
}

input[type="checkbox"],
input[type="radio"] {
  min-height: 0;
}

button,
.download-button {
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  box-shadow: none;
}

button:hover:not(:disabled),
.download-button:hover {
  background: var(--accent-hover);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
  transform: translateY(-1px);
}

button.ghost,
.download-button.disabled,
.btn-close {
  border: 1px solid var(--line);
  background-color: #fff;
  color: #475467;
}

.btn-close {
  min-width: 44px;
  box-shadow: none;
  transform: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--focus);
}

input,
select,
textarea {
  border-color: var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus);
}

.muted,
small,
.empty-state {
  color: var(--muted);
}

.summary-grid {
  gap: 0;
  margin-bottom: 16px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.metric {
  min-height: 96px;
  padding: 20px 22px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.metric:last-child {
  border-right: 0;
}

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

.metric strong {
  color: var(--text);
  font-size: 25px;
  font-variant-numeric: tabular-nums;
}

.workspace {
  grid-template-columns: minmax(0, 1fr) minmax(230px, 280px);
  align-items: start;
  gap: 16px;
}

.workspace .left-rail {
  grid-column: 2;
  order: 2;
  position: sticky;
  top: 144px;
}

.workspace .main-work {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.calc-card,
.primary-filter-card {
  border-top: 1px solid var(--line);
}

.primary-filter-grid {
  grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(140px, 1fr));
}

.primary-filter-grid input[type="number"] {
  min-width: 0;
}

.table-wrap,
.screener-table-wrap,
.prediction-markets-table-wrap,
.protocol-transfer-result-wrap {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  overflow: auto;
}

.result-table,
.technical-holdings-table,
.holdings-announcements-table,
.prediction-markets-table {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.result-table thead,
.technical-holdings-table thead,
.holdings-announcements-table thead,
.prediction-markets-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
}

.result-table th,
.technical-holdings-table th,
.holdings-announcements-table th,
.prediction-markets-table th {
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.result-table tbody tr:hover,
.technical-holdings-table tbody tr:hover,
.holdings-announcements-table tbody tr:hover,
.prediction-markets-table tbody tr:hover {
  background: #f8fbff;
}

.quick-start-panel {
  gap: 14px;
}

.quick-start-hero {
  align-items: center;
  padding: 24px 26px;
  border-radius: 10px;
}

.quick-start-hero h2 {
  max-width: 620px;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.2;
}

.quick-start-hero > p {
  max-width: 520px;
  font-size: 14px;
  line-height: 1.75;
}

.quick-start-auth {
  grid-template-columns: minmax(240px, 380px) auto minmax(160px, 1fr);
  padding: 12px;
  border-color: var(--line);
  background: #fff;
}

.quick-start-report-type-grid {
  gap: 10px;
}

.quick-start-option {
  border-color: var(--line);
  background: #fff;
}

.quick-start-option:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.5);
  background: #f8fbff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.quick-start-output {
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.75fr);
  gap: 14px;
}

.ask-ai-box {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.ask-ai-head,
.ask-ai-hermes-card,
.ask-ai-htsc-mcp-card,
.ask-ai-layout,
.ask-ai-desktop-card,
.ask-ai-duration-note {
  margin-inline: 0;
}

.ask-ai-head {
  margin-bottom: 14px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.ask-ai-hermes-card,
.ask-ai-htsc-mcp-card {
  border-color: var(--line);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.ask-ai-hermes-card {
  border-left: 3px solid #16a34a;
}

.ask-ai-htsc-status,
.ask-ai-status,
.ask-ai-hermes-actions span {
  border-color: var(--line);
  background: var(--panel-soft);
  color: #475467;
}

.ask-ai-duration-note {
  border-color: #dbeafe;
  background: #eff6ff;
  color: #1e40af;
}

.ask-ai-layout {
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  align-items: stretch;
}

.ask-ai-history-column {
  min-width: 0;
}

.mobile-section-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.mobile-section-toggle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform var(--motion);
}

.mobile-section-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.ask-ai-history,
.ask-ai-thread,
.ask-ai-auth,
.ask-ai-composer,
.ask-ai-desktop-card {
  border-color: var(--line);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.ask-ai-thread {
  min-height: 420px;
}

.ask-ai-desktop-card {
  margin-top: 16px;
  opacity: 0.92;
}

.data-status-footer {
  margin: 0 clamp(16px, 2.2vw, 32px) 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

@media (min-width: 1200px) {
  .app-sidebar.offcanvas-xl {
    position: sticky;
    visibility: visible !important;
    transform: none !important;
  }

  .panel-directory.collapse {
    display: flex !important;
  }
}

@media (max-width: 1399px) and (min-width: 1200px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 240px;
  }

  .primary-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1199.98px) {
  :root {
    --sticky-index-top: 104px;
    --section-scroll-margin: 124px;
  }

  .app-shell,
  body.sidebar-collapsed .app-shell {
    display: block;
    width: 100%;
  }

  .app-sidebar,
  body.sidebar-collapsed .app-sidebar {
    position: fixed;
    z-index: var(--bs-offcanvas-zindex, 1045);
    width: min(320px, 88vw);
    height: 100vh;
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .app-sidebar-header {
    min-height: 64px;
  }

  body.sidebar-collapsed .app-brand-copy,
  body.sidebar-collapsed .app-sidebar .mode-tab span,
  body.sidebar-collapsed .app-sidebar .tab span,
  body.sidebar-collapsed .sidebar-index-heading > span,
  body.sidebar-collapsed .top-tab-index-toggle span {
    display: initial;
  }

  body.sidebar-collapsed .app-sidebar .mode-tab,
  body.sidebar-collapsed .app-sidebar .tab,
  body.sidebar-collapsed .sidebar-index-heading {
    justify-content: flex-start;
    padding-inline: 11px;
  }

  body.sidebar-collapsed .sidebar-group-label {
    height: auto;
    margin: 12px 8px 4px;
    overflow: visible;
    background: transparent;
    color: #98a2b3;
  }

  .mobile-app-bar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 11px;
    height: 56px;
    padding: 7px 12px;
    border-bottom: 1px solid rgba(229, 234, 240, 0.94);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(16px);
  }

  #mobile-app-bar {
    height: 56px;
  }

  .mobile-navigation-toggle {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--text);
  }

  .mobile-app-bar-title {
    display: grid;
    min-width: 0;
    line-height: 1.15;
  }

  .mobile-app-bar-title span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
  }

  .mobile-app-bar-title strong {
    overflow: hidden;
    margin-top: 2px;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar {
    display: none;
  }

  .app-main {
    padding: 14px 14px 28px;
  }

  .panel-directory-toggle {
    position: sticky;
    top: 64px;
    z-index: 38;
    display: flex;
    margin-bottom: 8px;
  }

  .panel-directory {
    position: sticky;
    top: 116px;
    z-index: 37;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    max-height: min(56vh, 360px);
    margin: 0 0 12px;
    padding: 6px;
    overflow: auto;
  }

  .panel-directory.collapse:not(.show) {
    display: none;
  }

  .panel-directory.collapse.show {
    display: grid;
  }

  .panel-directory a {
    min-width: 0;
    min-height: 44px;
    padding: 9px 10px;
    white-space: normal;
  }

  .workspace,
  .workspace .main-work,
  .workspace .left-rail {
    display: grid;
    grid-column: 1;
    grid-row: auto;
    order: initial;
    position: static;
  }

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

  .workspace .left-rail {
    order: 2;
  }

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

  .data-status-footer {
    margin: 0 14px 22px;
  }
}

@media (max-width: 760px) {
  :root {
    --section-scroll-margin: 116px;
  }

  .app-main {
    padding: 12px 10px 24px;
  }

  .panel-directory-toggle {
    top: 62px;
  }

  .panel-directory {
    top: 114px;
  }

  .quick-start-hero {
    display: grid;
    gap: 16px;
    padding: 20px 18px;
  }

  .quick-start-hero h2 {
    font-size: 23px;
  }

  .quick-start-hero > p {
    font-size: 13px;
  }

  .quick-start-auth,
  .quick-start-output,
  .quick-start-report-type-grid,
  .quick-start-event-fields,
  .quick-start-technical-period,
  .deep-research-form-grid,
  .deep-research-standard-grid {
    grid-template-columns: 1fr;
  }

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

  .quick-start-stages {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 10px;
  }

  .quick-start-stages li:nth-child(3)::after {
    content: none;
  }

  .quick-start-auth {
    gap: 8px;
  }

  .quick-start-card,
  .quick-start-result-card,
  .quick-start-history-card {
    padding: 16px;
  }

  .quick-start-output {
    display: grid;
  }

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

  .metric {
    min-height: 82px;
    padding: 15px 16px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .metric:nth-child(2n) {
    border-right: 0;
  }

  .metric:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .primary-filter-grid,
  .primary-condition-builder,
  .calc-line,
  .ask-ai-htsc-actions,
  .ask-ai-layout {
    grid-template-columns: 1fr;
  }

  .calc-line {
    display: grid;
  }

  .table-wrap,
  .screener-table-wrap,
  .prediction-markets-table-wrap,
  .protocol-transfer-result-wrap,
  .technical-holdings-list,
  .holdings-announcements-list {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .screener-table-wrap {
    overflow-x: auto;
  }

  .ask-ai-head,
  .ask-ai-hermes-card,
  .ask-ai-htsc-mcp-card {
    padding: 16px;
  }

  .ask-ai-layout {
    display: grid;
  }

  .ask-ai-box {
    display: flex;
    flex-direction: column;
  }

  .ask-ai-head {
    order: 1;
  }

  .ask-ai-hermes-card {
    order: 2;
  }

  .ask-ai-box > .panel-directory-toggle {
    order: 3;
  }

  .ask-ai-directory {
    order: 4;
  }

  .ask-ai-duration-note {
    order: 5;
  }

  .ask-ai-layout {
    order: 6;
  }

  .ask-ai-htsc-mcp-card {
    order: 7;
  }

  #ask-ai-office-toggle {
    order: 8;
  }

  #ask-ai-desktop-visual {
    order: 9;
  }

  .mobile-section-toggle {
    display: flex;
    margin-bottom: 8px;
  }

  .ask-ai-history-column {
    display: grid;
  }

  .ask-ai-history-column .ask-ai-history[hidden],
  #ask-ai-desktop-visual[hidden] {
    display: none !important;
  }

  .ask-ai-history {
    width: 100%;
    min-height: 0;
    max-height: 360px;
  }

  .ask-ai-main {
    grid-template-rows: minmax(340px, 1fr) auto auto;
  }

  .ask-ai-thread {
    min-height: 340px;
  }

  .ask-ai-desktop-card {
    margin-top: 12px;
  }

  .data-status-footer {
    margin: 0 10px 18px;
    padding: 16px;
  }

  .data-status-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .panel-directory {
    grid-template-columns: 1fr;
  }

  .mobile-app-bar {
    padding-inline: 9px;
  }

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

  .metric,
  .metric:nth-child(2n),
  .metric:nth-last-child(-n + 2) {
    min-height: 72px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric:last-child {
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .app-shell,
  .app-sidebar,
  .panel.active,
  .panel-directory-toggle svg {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
