:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #18212f;
  --muted: #627084;
  --line: #d9e0ea;
  --accent: #1268b3;
  --accent-dark: #0d4f8a;
  --green: #087f5b;
  --red: #c92a2a;
  --amber: #9a6700;
  --shadow: 0 10px 28px rgba(24, 33, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

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

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  border-color: transparent;
  background: transparent;
}

.nav-toggle:hover {
  background: #e9f2fb;
}

.nav-toggle-line {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.topbar.nav-open .nav-toggle-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.topbar.nav-open .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.topbar.nav-open .nav-toggle-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.layout {
  width: min(1400px, calc(100vw - 40px));
  margin: 24px auto 48px;
}

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

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 700;
}

.panel {
  overflow: hidden;
}

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

.panel-title {
  font-weight: 700;
}

.panel-body {
  padding: 16px;
}

.filters {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, minmax(130px, 180px)) auto auto;
  gap: 10px;
  margin-bottom: 14px;
}

input,
select,
button {
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font: inherit;
}

input,
select {
  padding: 0 10px;
  min-width: 0;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 600;
}

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

.button-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-dark);
  font-weight: 700;
}

button.primary:hover {
  background: var(--accent-dark);
}

button.danger {
  color: var(--red);
  border-color: rgba(201, 42, 42, 0.35);
}

button.full-width,
.full-width {
  width: 100%;
}

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

.toolbar a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--text);
  font-weight: 600;
}

.toolbar a:hover {
  color: var(--accent-dark);
  background: #e9f2fb;
}

.toolbar a.active {
  color: var(--accent-dark);
  background: #e9f2fb;
}

.table-wrap {
  overflow: auto;
}

.market-panel .dataTables_wrapper {
  min-width: 980px;
}

.dt-container .dt-search input,
.dt-container .dt-length select {
  margin-left: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #f9fbfd;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

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

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

.muted {
  color: var(--muted);
}

.loading-state {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  border: 1px dashed rgba(18, 104, 179, 0.32);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--accent);
  text-align: center;
}

.loading-state.compact {
  min-height: 72px;
  flex-direction: row;
  justify-content: flex-start;
  margin-bottom: 14px;
  padding: 12px 14px;
  text-align: left;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 3px solid rgba(18, 104, 179, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}

.loading-state strong,
.loading-state small {
  display: block;
}

.loading-state small {
  margin-top: 2px;
  color: var(--muted);
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}

.status-active,
.status-enabled,
.status-success {
  color: var(--green);
  border-color: rgba(8, 127, 91, 0.28);
  background: rgba(8, 127, 91, 0.08);
}

.status-disabled,
.status-deleted,
.status-rotated {
  color: var(--muted);
  background: #eef2f6;
}

.status-failed,
.status-error {
  color: var(--red);
  border-color: rgba(201, 42, 42, 0.28);
  background: rgba(201, 42, 42, 0.08);
}

.status-warning,
.status-running {
  color: var(--amber);
  border-color: rgba(154, 103, 0, 0.28);
  background: rgba(154, 103, 0, 0.08);
}

.stock-status-l {
  color: var(--green);
  border-color: rgba(8, 127, 91, 0.28);
  background: rgba(8, 127, 91, 0.08);
}

.stock-status-d {
  color: var(--muted);
  background: #eef2f6;
}

.stock-status-p {
  color: var(--amber);
  border-color: rgba(154, 103, 0, 0.28);
  background: rgba(154, 103, 0, 0.08);
}

.stock-directory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.stock-list-panel {
  min-width: 0;
}

.stock-detail-panel {
  position: sticky;
  top: 92px;
  display: flex;
  max-height: calc(100vh - 116px);
  flex-direction: column;
}

.stock-filters,
.stock-local-tools {
  display: grid;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.stock-filters {
  grid-template-columns: minmax(120px, 0.8fr) minmax(120px, 0.8fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(90px, 0.6fr) auto;
}

.stock-local-tools {
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 0.9fr);
}

.stock-panel-title {
  min-width: 0;
}

.stock-list-meta,
.stock-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.stock-list-meta strong,
.stock-detail-meta strong {
  color: var(--text);
  font-weight: 700;
}

.stock-filters label,
.stock-local-tools label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.stock-filters label > span,
.stock-local-tools label > span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stock-symbol-lookup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.stock-table-wrap {
  min-height: 360px;
}

.stock-directory-table {
  min-width: 1180px;
}

.stock-directory-table th,
.stock-directory-table td {
  white-space: nowrap;
}

.stock-directory-table .number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.stock-directory-table .date-cell {
  font-variant-numeric: tabular-nums;
}

.stock-directory-table tr.selected td {
  background: #eef6ff;
}

.stock-row-link {
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}

.stock-row-link:hover {
  color: var(--accent-dark);
  background: transparent;
}

.stock-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.stock-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent-dark);
  font-weight: 700;
}

.stock-action-link:hover {
  background: #e9f2fb;
}

.stock-detail-empty {
  padding: 10px 0;
}

.stock-detail-panel > .panel-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.stock-latest-trade {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.stock-detail-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.stock-detail-highlights > div {
  min-width: 0;
  padding: 0 8px 8px 0;
}

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

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

.stock-detail-highlights strong {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stock-latest-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.stock-latest-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stock-latest-grid > div {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

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

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

.stock-latest-grid strong {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stock-detail-fields {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

.stock-detail-section-title {
  margin-top: 4px;
  padding: 10px 0 2px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
}

.stock-detail-fields > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.stock-detail-fields > .stock-detail-section-title {
  display: block;
  grid-template-columns: none;
  margin-top: 4px;
  padding: 10px 0 2px;
  color: var(--text);
  font-weight: 700;
}

.stock-detail-fields dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stock-detail-fields dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

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

.stock-snapshot-section {
  padding-top: 4px;
}

.stock-snapshots {
  display: grid;
  gap: 10px;
}

.stock-snapshot {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.stock-snapshot-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.stock-snapshot-meta {
  margin: 4px 0 8px;
  font-size: 12px;
}

.stock-snapshot summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 700;
}

.stock-snapshot pre {
  max-height: 260px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 6px;
  background: #111827;
  color: #e5e7eb;
  white-space: pre-wrap;
}

.stock-page-indicator {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--muted);
  font-weight: 700;
}

.stock-page-indicator strong {
  color: var(--text);
}

.pager {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.notice {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.notice.error {
  color: var(--red);
  border-color: rgba(201, 42, 42, 0.28);
  background: rgba(201, 42, 42, 0.06);
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}

.scheduler-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.subnav-button {
  border-color: var(--line);
  background: #fff;
}

.subnav-button.active {
  color: var(--accent-dark);
  border-color: rgba(18, 104, 179, 0.32);
  background: #e9f2fb;
}

.scheduler-job-card {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

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

.scheduler-job-title {
  font-weight: 700;
}

.scheduler-job-inline-notice {
  margin: 12px 16px 0;
  padding: 8px 10px;
  border: 1px solid rgba(18, 104, 179, 0.22);
  border-radius: 6px;
  background: #f1f7fd;
  color: var(--accent-dark);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.scheduler-job-inline-notice.error {
  border-color: rgba(201, 42, 42, 0.28);
  background: rgba(201, 42, 42, 0.06);
  color: var(--red);
}

.scheduler-job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 12px;
}

.split-toolbar {
  justify-content: space-between;
  margin-bottom: 12px;
}

.scheduler-run-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(420px, 1.25fr);
  gap: 16px;
  align-items: start;
}

.scheduler-run-list-panel,
.scheduler-run-inspector {
  min-width: 0;
}

@media (min-width: 901px) {
  #schedulerView {
    overflow: visible;
  }

  .scheduler-run-inspector {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 104px);
    overflow: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
  }
}

.scheduler-run-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scheduler-run-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.scheduler-run-item.selected {
  border-color: rgba(18, 104, 179, 0.38);
  background: #f7fbff;
}

.scheduler-run-item-main,
.scheduler-run-detail,
.scheduler-run-summary {
  min-width: 0;
}

.scheduler-run-title,
.scheduler-step-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.scheduler-run-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.scheduler-run-id,
.scheduler-run-detail code {
  display: block;
  max-width: 100%;
  margin-top: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.scheduler-run-summary {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.scheduler-run-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.scheduler-run-detail {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.scheduler-run-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.scheduler-run-detail-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

.scheduler-run-detail-grid strong {
  overflow-wrap: anywhere;
}

.scheduler-run-steps,
.scheduler-command-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scheduler-step-detail {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}

.scheduler-command-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: start;
  padding-top: 8px;
  border-top: 1px solid rgba(217, 224, 234, 0.72);
  overflow-wrap: anywhere;
}

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

.config-toolbar {
  margin-bottom: 12px;
}

.scheduler-editor-job {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.scheduler-editor-job-head,
.scheduler-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.scheduler-editor-title,
.scheduler-step-title {
  font-weight: 700;
}

.scheduler-editor-grid,
.scheduler-param-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.scheduler-param-grid {
  padding: 12px 0 0;
}

.scheduler-editor-grid label,
.scheduler-param-grid label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.scheduler-editor-grid input,
.scheduler-editor-grid select,
.scheduler-param-grid input,
.scheduler-param-grid select,
.scheduler-param-grid textarea {
  width: 100%;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
}

.scheduler-param-grid textarea {
  min-height: 84px;
  padding: 8px 10px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.scheduler-step-list {
  padding: 0 14px 14px;
}

.scheduler-editor-step {
  padding: 0 0 14px;
  border-top: 1px solid var(--line);
}

.scheduler-editor-step:first-child {
  border-top: 0;
}

.scheduler-step-params {
  padding: 0 14px;
}

.scheduler-check {
  min-height: 36px;
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  color: var(--text) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

.scheduler-check input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.scheduler-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  padding: 0;
}

.scheduler-editor-grid .wide,
.scheduler-param-grid .wide {
  grid-column: 1 / -1;
}

.log-preview {
  margin-top: 16px;
}

.log-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.log-list button {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-list button.active {
  color: var(--accent-dark);
  border-color: rgba(18, 104, 179, 0.32);
  background: #e9f2fb;
}

.scheduler-run-error,
.scheduler-log-error {
  display: block;
  max-width: 720px;
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.scheduler-run-error {
  margin-top: 4px;
}

.scheduler-log-error {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid rgba(201, 42, 42, 0.22);
  border-radius: 6px;
  background: rgba(201, 42, 42, 0.06);
}

.log-preview-body {
  min-height: 220px;
  max-height: 520px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f172a;
  color: #dbeafe;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.section-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.section-title + .table-wrap {
  margin-bottom: 18px;
}

.config-editor {
  width: 100%;
  min-height: 520px;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.inline-log-paths {
  max-width: 360px;
  margin: 0;
  white-space: pre-wrap;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.sidebar {
  align-self: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  box-shadow: var(--shadow);
}

.nav-button {
  width: 100%;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  margin-bottom: 4px;
}

.nav-button.active {
  background: #e9f2fb;
  color: var(--accent-dark);
}

.login-box {
  width: min(420px, calc(100vw - 40px));
  margin: 80px auto;
}

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

.form-grid .wide {
  grid-column: 1 / -1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(24, 33, 47, 0.36);
  z-index: 30;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--panel);
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.secret-output {
  overflow-wrap: anywhere;
  white-space: normal;
  padding: 10px;
  border-radius: 6px;
  background: #f3f6fa;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.hidden {
  display: none !important;
}

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

.kline-controls {
  grid-template-columns: minmax(180px, 1fr) auto minmax(130px, 180px) minmax(150px, 200px);
}

.indicator-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.indicator-btn {
  height: 32px;
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.indicator-btn.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

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

.analysis-grid p {
  margin: 0 0 8px;
}

.analysis-center-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.35fr);
  gap: 18px;
  align-items: start;
}

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

.analysis-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.analysis-filter-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.analysis-filter-grid input,
.analysis-filter-grid select {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.analysis-family-group {
  display: grid;
  gap: 8px;
}

.analysis-family-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.analysis-family-head:hover,
.analysis-family-head.active {
  border-color: rgba(18, 104, 179, 0.42);
  background: #eef6ff;
}

.analysis-family-head span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.analysis-family-head strong {
  color: var(--accent-dark);
}

.analysis-family-head small {
  color: var(--muted);
  font-size: 12px;
}

.analysis-family-head em {
  display: inline-flex;
  min-width: 28px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.analysis-family-cards {
  display: grid;
  gap: 8px;
  padding-left: 10px;
  border-left: 2px solid #e7edf5;
}

.analysis-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--text);
}

.analysis-card:hover,
.analysis-card.active {
  border-color: rgba(18, 104, 179, 0.42);
  background: #eef6ff;
}

.analysis-card-title {
  color: var(--accent-dark);
  font-weight: 700;
}

.analysis-card-desc,
.analysis-card-meta,
.analysis-detail-meta {
  color: var(--muted);
  font-size: 12px;
}

.analysis-card-meta,
.analysis-detail-meta,
.analysis-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.analysis-detail-empty,
.analysis-empty {
  padding: 12px 0;
}

.analysis-detail-block {
  margin-bottom: 18px;
}

.analysis-detail-block h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.analysis-tags {
  margin-top: 10px;
  align-items: center;
}

.analysis-tags strong {
  color: var(--muted);
  font-size: 12px;
}

.analysis-tags span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.analysis-difference {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #f7fbff;
  color: var(--text);
}

.analysis-difference strong {
  color: var(--accent-dark);
  font-size: 13px;
}

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

.analysis-markdown {
  color: var(--text);
  line-height: 1.75;
}

.analysis-markdown h1,
.analysis-markdown h2,
.analysis-markdown h3 {
  margin: 18px 0 8px;
  color: var(--accent-dark);
}

.analysis-markdown h1 {
  font-size: 22px;
}

.analysis-markdown h2 {
  font-size: 18px;
}

.analysis-markdown h3 {
  font-size: 15px;
}

.analysis-markdown p,
.analysis-markdown ul,
.analysis-markdown ol {
  margin: 0 0 10px;
}

.analysis-markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}

.analysis-markdown th,
.analysis-markdown td {
  padding: 8px;
  border: 1px solid var(--line);
  text-align: left;
}

.analysis-markdown code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #eef2f7;
}

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

.analysis-link-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--text);
}

.analysis-link-card:hover {
  border-color: rgba(18, 104, 179, 0.42);
  background: #eef6ff;
}

.analysis-link-card.disabled {
  pointer-events: none;
  opacity: 0.56;
}

.analysis-link-card span {
  color: var(--accent-dark);
  font-weight: 700;
}

.analysis-link-card small {
  color: var(--muted);
  font-size: 12px;
}

.analysis-result-table {
  min-width: 720px;
}

.analysis-admin-tools {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.analysis-run-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.analysis-run-table {
  min-width: 920px;
}

.analysis-run-table code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #eef2f7;
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.analysis-admin-tools .log-preview-body {
  margin-top: 12px;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
}

.chart-section {
  min-height: 240px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.chart-section[data-chart="kline"] {
  min-height: 460px;
}

.chart {
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.training-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1fr) minmax(280px, 0.9fr);
  gap: 16px;
}

.control-section,
.status-section,
.operations-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.control-section h3,
.status-section h3,
.operations-section h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.form-row {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.form-row label,
.quick-jump label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.status-item {
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.status-label {
  color: var(--muted);
  font-size: 12px;
}

.status-value {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.current-day-info {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.op-btn {
  height: 40px;
  color: #fff;
  border: 0;
}

.buy-btn {
  background: var(--red);
}

.sell-btn {
  background: var(--green);
}

.hold-btn {
  background: var(--muted);
}

.quick-jump {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.quick-jump label {
  grid-column: 1 / -1;
}

.log-table .buy-row td {
  background: rgba(201, 42, 42, 0.04);
}

.log-table .sell-row td {
  background: rgba(8, 127, 91, 0.04);
}

.training-charts .chart-tools {
  box-shadow: none;
}

.training-charts .chart-tools .indicator-selector {
  margin: 0;
  padding: 12px;
}

.trade-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.trade-modal-grid > div,
.trade-preview {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.trade-modal-grid span,
.trade-modal-grid strong {
  display: block;
}

.position-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.trade-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}

.report-body p {
  margin: 0 0 8px;
}

.home-layout {
  display: grid;
  gap: 18px;
}

.home-overview {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0 2px;
}

.home-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.home-overview h1 {
  margin: 4px 0 8px;
  font-size: 30px;
  line-height: 1.2;
}

.home-overview p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.home-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  flex: 0 0 auto;
  gap: 8px;
  padding: 0 14px;
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
}

.home-primary-link:hover {
  background: var(--accent-dark);
}

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

.home-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 6px 12px;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
}

.home-card:hover {
  border-color: rgba(18, 104, 179, 0.35);
  background: #f2f7fd;
}

.home-card-icon {
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--accent-dark);
  background: #e9f2fb;
  font-size: 17px;
}

.home-card-title {
  font-size: 16px;
  font-weight: 700;
}

.home-card-desc {
  color: var(--muted);
}

.home-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.home-list {
  display: grid;
  gap: 12px;
}

.home-list div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.home-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.home-list span {
  color: var(--muted);
}

.home-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.home-actions a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-weight: 700;
}

.home-actions a::after {
  content: ">";
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.home-actions a:hover {
  color: var(--accent-dark);
  background: #e9f2fb;
}

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

.docs-index-layout {
  grid-template-columns: minmax(0, 1fr);
}

.docs-sidebar,
.docs-outline {
  position: sticky;
  top: 92px;
  display: flex;
  max-height: calc(100vh - 116px);
  flex-direction: column;
}

.docs-nav,
.doc-outline-nav {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
}

.docs-nav-button {
  min-height: 40px;
  justify-content: space-between;
}

.doc-tree-file,
.doc-tree-toggle {
  width: 100%;
  min-height: 36px;
  padding-left: calc(10px + var(--depth, 0) * 16px);
  border-color: transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.doc-tree-file {
  display: flex;
  align-items: center;
  border-radius: 6px;
  font-weight: 600;
}

.doc-tree-file:hover,
.doc-tree-toggle:hover {
  color: var(--accent-dark);
  background: #e9f2fb;
}

.doc-tree-file.active {
  color: var(--accent-dark);
  background: #e9f2fb;
}

.doc-tree-toggle {
  justify-content: flex-start;
  color: var(--muted);
}

.doc-tree-caret {
  width: 14px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.doc-tree-caret::before {
  content: "-";
}

.doc-tree-dir.collapsed > .doc-tree-toggle .doc-tree-caret::before {
  content: "+";
}

.doc-tree-dir.collapsed > .doc-tree-children {
  display: none;
}

.docs-nav-button.locked {
  color: var(--muted);
}

.doc-lock {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: #f3f6fa;
}

.docs-content-panel {
  min-width: 0;
}

.docs-content-panel > .panel-head {
  align-items: flex-start;
  flex-wrap: wrap;
}

.docs-title-block {
  min-width: 0;
}

.docs-search {
  position: relative;
  display: flex;
  flex: 0 1 430px;
  align-items: center;
  gap: 8px;
  width: min(430px, 100%);
}

.docs-search input[type="search"] {
  width: 100%;
}

.docs-search-clear {
  flex: 0 0 auto;
  color: var(--muted);
  background: #f7f9fc;
}

.docs-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: min(560px, calc(100vw - 32px));
  max-height: min(420px, calc(100vh - 180px));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.docs-search-status {
  padding: 12px;
  color: var(--muted);
}

.docs-search-list {
  display: flex;
  flex-direction: column;
  padding: 6px;
}

.docs-search-result {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 6px;
  color: var(--text);
}

.docs-search-result:hover {
  background: #e9f2fb;
}

.docs-search-result-title {
  font-weight: 700;
}

.docs-search-result-meta,
.docs-search-result-excerpt {
  color: var(--muted);
  font-size: 12px;
}

.docs-search-result-excerpt {
  line-height: 1.5;
}

.docs-search-result mark {
  padding: 0 2px;
  border-radius: 3px;
  background: #ffe8a3;
  color: inherit;
}

.doc-content mark.doc-search-hit {
  padding: 0 2px;
  border-radius: 3px;
  background: #ffe8a3;
  color: inherit;
}

.docs-content {
  overflow-wrap: anywhere;
}

.docs-content h1,
.docs-content h2,
.docs-content h3 {
  margin: 18px 0 10px;
  line-height: 1.25;
}

.docs-content h1:first-child {
  margin-top: 0;
}

.docs-content p {
  margin: 0 0 12px;
}

.doc-content {
  max-width: 860px;
  margin: 0 auto;
  overflow-wrap: anywhere;
}

.docs-index {
  max-width: 1040px;
  margin: 0 auto;
}

.docs-index h1 {
  margin: 0 0 18px;
  font-size: 28px;
}

.docs-index-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.doc-section-card {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--text);
}

.doc-section-card:hover {
  border-color: rgba(18, 104, 179, 0.35);
  background: #f2f7fd;
}

.doc-section-card.locked {
  color: var(--muted);
}

.single-page-hub-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: start;
}

.single-page-filters,
.market-profile-filters,
.market-profile-section-chooser,
.market-profile-axis-controls,
.market-profile-range-controls {
  display: grid;
  gap: 10px;
  align-items: end;
}

.single-page-filters {
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.6fr) minmax(140px, 0.6fr);
  margin-bottom: 14px;
}

.single-page-filters label,
.market-profile-filters label,
.market-profile-filter-range,
.market-profile-axis-controls label,
.market-profile-range-controls label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.single-page-filters span,
.market-profile-filters span,
.market-profile-filter-range span,
.market-profile-axis-controls span,
.market-profile-range-controls span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.market-profile-section-chooser {
  grid-template-columns: repeat(5, minmax(110px, auto));
  justify-content: start;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.market-profile-section-chooser label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.market-profile-section-chooser input {
  width: 15px;
  height: 15px;
}

.single-page-card-grid {
  display: grid;
  gap: 10px;
}

.single-page-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.single-page-card.selected {
  border-color: rgba(18, 104, 179, 0.42);
  background: #eef6ff;
}

.single-page-card-title {
  justify-content: flex-start;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 800;
}

.single-page-card-title:hover {
  background: transparent;
}

.single-page-card p,
.single-page-detail-summary {
  margin: 0;
  color: var(--muted);
}

.single-page-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.single-page-tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(18, 104, 179, 0.2);
  border-radius: 999px;
  background: #eef6ff;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.single-page-card-actions,
.single-page-detail-actions,
.market-profile-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.single-page-card-actions a,
.single-page-card-actions button,
.single-page-subpages a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-dark);
  font-weight: 700;
}

.single-page-detail-panel {
  position: sticky;
  top: 92px;
}

.single-page-detail {
  display: grid;
  gap: 14px;
}

.single-page-subpages,
.single-page-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.single-page-source-list code {
  max-width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f3f6fa;
  color: var(--text);
  overflow-wrap: anywhere;
}

.single-page-readme {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.single-page-empty {
  padding: 14px;
  border: 1px dashed rgba(18, 104, 179, 0.28);
  border-radius: 8px;
  background: #f8fbff;
}

.market-profile-layout {
  display: grid;
  gap: 18px;
}

.market-profile-head-actions {
  justify-content: flex-end;
}

.market-profile-filters {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.market-profile-filter-search {
  grid-column: span 2;
}

.market-profile-filter-range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.market-profile-filter-range-fields input {
  width: 100%;
}

.market-profile-summary {
  margin-bottom: 0;
}

.market-profile-chart-head {
  align-items: flex-start;
}

.market-profile-axis-controls {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  min-width: min(720px, 100%);
}

.market-profile-range-controls {
  grid-template-columns: repeat(4, minmax(110px, 1fr)) auto auto;
  margin-bottom: 12px;
}

.market-profile-main-chart {
  width: 100%;
  height: 620px;
}

.market-profile-selection {
  margin-top: 10px;
  font-size: 12px;
}

.market-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.market-profile-sub-chart {
  width: 100%;
  height: 360px;
}

.market-profile-table {
  min-width: 1320px;
}

.market-profile-table-head {
  align-items: flex-start;
}

.market-profile-table-limit {
  display: flex;
  min-width: 120px;
  flex-direction: column;
  gap: 4px;
}

.market-profile-table-limit span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.market-profile-column-chooser {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.market-profile-column-chooser label {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.market-profile-column-chooser input {
  width: 15px;
  height: 15px;
}

.market-profile-table th {
  background: var(--accent-dark);
  color: #fff;
}

.market-profile-table th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.market-profile-table th[data-sort]:hover,
.market-profile-table th[aria-sort="ascending"],
.market-profile-table th[aria-sort="descending"] {
  background: var(--accent);
}

.market-profile-table .sort-icon {
  margin-left: 5px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
}

.market-profile-table .number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.doc-section-title {
  font-size: 18px;
  font-weight: 700;
}

.doc-section-desc {
  flex: 1;
  color: var(--muted);
}

.doc-section-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.doc-content h1,
.doc-content h2,
.doc-content h3,
.doc-content h4,
.doc-content h5,
.doc-content h6 {
  margin: 24px 0 10px;
  line-height: 1.25;
  scroll-margin-top: 112px;
}

.doc-content h1:first-child,
.doc-content h2:first-child,
.doc-content h3:first-child {
  margin-top: 0;
}

.doc-content h1 {
  font-size: 28px;
}

.doc-content h2 {
  padding-top: 6px;
  border-top: 1px solid var(--line);
  font-size: 21px;
}

.doc-content h3 {
  font-size: 17px;
}

.doc-content p,
.doc-content ul,
.doc-content ol,
.doc-content pre,
.doc-table-wrap {
  margin: 0 0 14px;
}

.doc-content ul,
.doc-content ol {
  padding-left: 22px;
}

.doc-content li + li {
  margin-top: 4px;
}

.doc-content code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #edf2f7;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.92em;
}

.doc-content pre {
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  color: #e5e7eb;
}

.doc-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.doc-table-wrap {
  overflow: auto;
}

.doc-content table {
  min-width: 560px;
  white-space: normal;
}

.doc-outline-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doc-outline-nav a {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muted);
}

.doc-outline-nav a:hover {
  color: var(--accent-dark);
  background: #e9f2fb;
}

.doc-outline-nav .outline-h3 {
  padding-left: 18px;
  font-size: 13px;
}

.doc-empty,
.doc-locked {
  padding: 8px;
}

.doc-login-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
}

.doc-login-link:hover {
  background: var(--accent-dark);
}

@media (max-width: 900px) {
  .summary-grid,
  .filters,
  .home-grid,
  .home-columns,
  .stock-directory-layout,
  .stock-filters,
  .stock-local-tools,
  .admin-layout,
  .docs-layout,
  .docs-index-grid,
  .form-grid,
  .single-page-hub-layout,
  .single-page-filters,
  .market-profile-filters,
  .market-profile-section-chooser,
  .market-profile-axis-controls,
  .market-profile-range-controls,
  .market-profile-grid,
  .analysis-center-layout,
  .analysis-filter-grid,
  .analysis-grid,
  .analysis-link-grid,
  .scheduler-grid,
  .scheduler-run-workspace,
  .scheduler-editor-grid,
  .scheduler-param-grid,
  .training-panel,
  .status-grid,
  .trade-preview {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 16px;
  }

  .brand {
    min-width: 0;
  }

  .layout {
    width: calc(100vw - 24px);
    margin-top: 14px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .toolbar {
    grid-column: 1 / -1;
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }

  .topbar.nav-open .toolbar {
    display: flex;
  }

  .toolbar > * {
    flex: none;
  }

  .toolbar a {
    justify-content: flex-start;
    min-height: 40px;
  }

  .kline-controls,
  .form-row,
  .quick-jump,
  .op-buttons,
  .trade-modal-grid {
    grid-template-columns: 1fr;
  }

  .chart-section,
  .chart-section[data-chart="kline"] {
    min-height: 320px;
  }

  .indicator-btn {
    flex: 1 1 auto;
  }

  .home-overview {
    align-items: stretch;
    flex-direction: column;
  }

  .home-primary-link {
    width: 100%;
  }

  .home-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .docs-sidebar,
  .docs-outline,
  .single-page-detail-panel,
  .stock-detail-panel {
    position: static;
    display: block;
    max-height: none;
  }

  .docs-nav,
  .doc-outline-nav {
    overflow: visible;
  }

  .stock-detail-panel > .panel-body {
    overflow: visible;
  }

  .docs-search {
    flex-basis: 100%;
    width: 100%;
  }

  .docs-search-results {
    left: 0;
    right: auto;
    width: 100%;
  }

  .doc-content {
    max-width: none;
  }

  .market-profile-main-chart {
    height: 480px;
  }

  .market-profile-sub-chart {
    height: 320px;
  }

  .market-profile-filter-search {
    grid-column: auto;
  }

  .stock-subhead,
  .stock-pager {
    align-items: stretch;
    flex-direction: column;
  }

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

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

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

  .stock-detail-fields > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .scheduler-run-item,
  .scheduler-run-detail-grid,
  .scheduler-command-row {
    grid-template-columns: 1fr;
  }

  .scheduler-run-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .scheduler-run-inspector {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}
