:root {
  --bg: #0b1020;
  --panel: rgba(17, 24, 39, 0.88);
  --panel-border: rgba(148, 163, 184, 0.16);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --good: #ef4444;
  --bad: #22c55e;
  --shadow: 0 18px 40px rgba(2, 6, 23, 0.35);
}

body[data-page='notes-home'] {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(3, 8, 19, 0.9), rgba(9, 31, 44, 0.58) 44%, rgba(15, 23, 42, 0.78)),
    url('../images/programming-notes-hero.png') center / cover fixed;
  color: #f8fafc;
}

body[data-page='notes-home']::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.9)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 88px
    );
  pointer-events: none;
}

.notes-home-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.notes-home-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}

.notes-home-brand,
.notes-home-links,
.notes-hero-actions,
.notes-lab-actions,
.notes-footer {
  display: flex;
  align-items: center;
}

.notes-home-brand {
  gap: 12px;
  color: #f8fafc;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.notes-home-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #d9fbff;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(18px);
}

.notes-home-links {
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 20, 34, 0.38);
  backdrop-filter: blur(18px);
}

.notes-home-links a {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 6px;
  color: rgba(226, 232, 240, 0.86);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.notes-home-links a:hover,
.notes-home-links a:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  outline: none;
}

.notes-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.58fr);
  gap: 24px;
  align-items: end;
  min-height: clamp(620px, 82vh, 760px);
  padding: 64px 0 80px;
}

.notes-hero-copy {
  max-width: 720px;
}

.notes-eyebrow {
  margin: 0 0 14px;
  color: #9cf6ff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.notes-hero h1 {
  max-width: 640px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 1.02;
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.notes-hero-lead {
  max-width: 650px;
  margin: 24px 0 0;
  color: rgba(232, 244, 255, 0.88);
  font-size: clamp(16px, 1.7vw, 20px);
  line-height: 1.9;
}

.notes-hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.notes-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.notes-button span {
  font-size: 16px;
}

.notes-button:hover,
.notes-button:focus-visible,
.notes-tool-link:hover,
.notes-tool-link:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.notes-button-primary {
  border: 1px solid rgba(164, 244, 255, 0.58);
  background: rgba(14, 165, 233, 0.92);
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(8, 145, 178, 0.28);
}

.notes-button-secondary {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  backdrop-filter: blur(18px);
}

.notes-glass-panel,
.notes-glass-card,
.notes-lab-section,
.notes-about-section {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
    rgba(8, 18, 33, 0.42);
  box-shadow:
    0 24px 60px rgba(2, 6, 23, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(22px);
}

.notes-hero-panel {
  align-self: end;
  padding: 24px;
}

.notes-panel-label {
  margin: 0 0 18px;
  color: #fde68a;
  font-size: 13px;
  font-weight: 900;
}

.notes-topic-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notes-topic-list li {
  display: grid;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.notes-topic-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.notes-topic-list strong,
.notes-card-grid h3,
.notes-lab-copy h2,
.notes-about-section h2 {
  color: #ffffff;
}

.notes-topic-list strong {
  font-size: 16px;
}

.notes-topic-list span,
.notes-glass-card p,
.notes-lab-copy p,
.notes-about-section p {
  color: rgba(226, 232, 240, 0.82);
  line-height: 1.75;
}

.notes-section {
  margin-bottom: 24px;
  scroll-margin-top: 80px;
}

.notes-section-heading {
  margin-bottom: 16px;
}

.notes-section-heading h2,
.notes-lab-copy h2,
.notes-about-section h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: 0;
}

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

.notes-glass-card {
  min-height: 238px;
  padding: 22px;
}

.notes-card-index {
  display: inline-flex;
  margin-bottom: 40px;
  color: #fcd34d;
  font-size: 13px;
  font-weight: 900;
}

.notes-glass-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.notes-glass-card p {
  margin: 12px 0 0;
}

.notes-lab-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.7fr);
  gap: 24px;
  align-items: center;
  padding: 28px;
}

.notes-lab-copy p,
.notes-about-section p {
  margin: 16px 0 0;
  max-width: 720px;
}

.notes-lab-actions {
  flex-direction: column;
  gap: 10px;
}

.notes-tool-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(3, 10, 22, 0.36);
  color: #f8fafc;
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.notes-tool-link:hover,
.notes-tool-link:focus-visible {
  border-color: rgba(156, 246, 255, 0.64);
  background: rgba(14, 116, 144, 0.3);
}

.notes-tool-link strong {
  color: #9cf6ff;
  font-size: 18px;
}

.notes-about-section {
  padding: 28px;
}

.notes-footer {
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 24px 0 34px;
  color: rgba(226, 232, 240, 0.72);
  font-size: 13px;
}

.notes-footer a {
  color: rgba(226, 232, 240, 0.82);
  text-decoration: none;
}

.notes-footer a:hover,
.notes-footer a:focus-visible {
  color: #ffffff;
  outline: none;
}

@media (max-width: 920px) {
  .notes-home-shell {
    width: min(100% - 28px, 760px);
  }

  .notes-home-nav {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 18px 0 8px;
  }

  .notes-home-links {
    width: 100%;
    justify-content: space-between;
  }

  .notes-home-links a {
    flex: 1;
    text-align: center;
  }

  .notes-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 56px 0 40px;
  }

  .notes-hero-panel {
    align-self: stretch;
  }

  .notes-card-grid,
  .notes-lab-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body[data-page='notes-home'] {
    background-attachment: scroll;
    background-position: 58% center;
  }

  .notes-home-shell {
    width: min(calc(100vw - 20px), 370px);
    margin-left: 10px;
    margin-right: auto;
  }

  .notes-home-links {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .notes-home-links a {
    flex: 0 0 auto;
    min-width: 78px;
  }

  .notes-hero {
    padding-top: 40px;
  }

  .notes-hero h1 {
    font-size: clamp(40px, 14vw, 56px);
  }

  .notes-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .notes-button {
    width: 100%;
  }

  .notes-hero-panel,
  .notes-glass-card,
  .notes-lab-section,
  .notes-about-section {
    padding: 18px;
  }

  .notes-glass-card {
    min-height: auto;
  }

  .notes-card-index {
    margin-bottom: 28px;
  }
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  padding: 32px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: rgba(17, 24, 39, 0.92);
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 24px;
}

.login-brand h1 {
  font-size: 30px;
  line-height: 1.2;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  padding: 0 14px;
  background: rgba(2, 6, 23, 0.54);
  color: var(--text);
  font: inherit;
}

.login-form input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.72);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

.login-form .primary-button {
  width: 100%;
}

.login-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(248, 113, 113, 0.38);
  border-radius: 12px;
  background: rgba(127, 29, 29, 0.24);
  color: #fecaca;
  font-size: 14px;
}

.auth-logout-button {
  width: auto;
  min-width: 104px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 24%),
    linear-gradient(180deg, #020617, #0f172a 55%, #111827);
  color: var(--text);
}

.app-shell {
  position: relative;
  width: min(1600px, calc(100% - 32px));
  margin: 24px auto 40px;
}

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

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

h1 { margin: 0; font-size: 32px; }

.status-banner {
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--panel-border);
  color: var(--muted);
  margin-bottom: 20px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.summary-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.summary-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-card span { color: var(--muted); font-size: 13px; }
.summary-card strong { font-size: 24px; font-weight: 700; }

.dashboard-overview-panel {
  margin-bottom: 20px;
  padding: 18px 24px 24px;
  overflow: hidden;
}

.dashboard-overview-panel .panel-header {
  padding: 0 0 18px;
}

.dashboard-overview-panel .status-banner {
  margin: 0 0 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.64);
}

.dashboard-overview-panel .summary-grid {
  margin-bottom: 0;
}

.dashboard-overview-panel .summary-card {
  background: rgba(15, 23, 42, 0.74);
  border-color: rgba(125, 211, 252, 0.16);
  box-shadow: none;
}

.dashboard-toolbar {
  margin-bottom: 20px;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.control-panel {
  overflow: hidden;
}

.control-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: 14px;
  padding: 18px 24px 10px;
  align-items: end;
}

.control-form-dashboard {
  padding-bottom: 12px;
  grid-template-columns:
    minmax(220px, 1fr)
    minmax(180px, 0.8fr)
    minmax(260px, 1.1fr)
    minmax(360px, 1.6fr)
    minmax(220px, 0.9fr);
  align-items: stretch;
}

.control-form-dashboard-compact {
  padding-bottom: 12px;
  grid-template-columns:
    minmax(180px, 0.8fr)
    minmax(260px, 1.1fr)
    minmax(360px, 1.4fr)
    minmax(220px, 0.9fr);
  align-items: stretch;
}

body[data-page='dashboard-workbench'] .control-form-dashboard-compact {
  grid-template-columns:
    minmax(180px, 0.8fr)
    minmax(260px, 1.1fr)
    minmax(220px, 0.9fr)
    minmax(360px, 1.4fr);
}

.control-form-price-data {
  grid-template-columns: minmax(320px, 1fr);
  align-items: stretch;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text);
  outline: none;
  color-scheme: dark;
}

.field input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  filter: brightness(0) invert(1);
}

.date-input-shell {
  position: relative;
}

.date-input-shell input[type="text"] {
  padding-right: 48px;
}

.date-input-picker {
  position: absolute;
  top: 50%;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(248, 250, 252, 0.88);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 140ms ease, color 140ms ease;
}

.date-input-picker:hover,
.date-input-picker:focus-visible {
  background: rgba(34, 211, 238, 0.14);
  color: #f8fafc;
  outline: none;
}

.date-input-picker svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.date-native-proxy {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.field input:focus,
.field select:focus {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.field select option,
.field select optgroup {
  color: #000;
}

.field-compact {
  gap: 6px;
}

.date-window-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(125, 211, 252, 0.34);
  background: rgba(15, 23, 42, 0.82);
  min-height: 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.date-window-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.date-window-eyebrow {
  margin: 0 0 6px;
  color: #67e8f9;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.range-preview {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: #f8fafc;
}

.range-chip-trail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.range-chip {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(30, 41, 59, 0.82));
  color: #dbeafe;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.range-chip:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(103, 232, 249, 0.75);
  background: linear-gradient(180deg, rgba(8, 47, 73, 0.96), rgba(14, 116, 144, 0.72));
  color: #f8fafc;
}

.range-chip.active {
  border-color: rgba(103, 232, 249, 0.94);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.98), rgba(14, 165, 233, 0.96));
  color: #f8fafc;
  box-shadow:
    0 10px 22px rgba(14, 165, 233, 0.24),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.range-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.date-window-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.date-window-divider {
  min-width: 44px;
  padding: 11px 0;
  border-radius: 999px;
  background: rgba(8, 47, 73, 0.72);
  border: 1px solid rgba(103, 232, 249, 0.18);
  color: #bae6fd;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.date-window-card .field span {
  color: #c4f1ff;
}

.date-window-card .field input,
.date-window-card .field select {
  min-height: 50px;
  border-color: rgba(125, 211, 252, 0.3);
  background:
    linear-gradient(180deg, rgba(8, 47, 73, 0.82), rgba(15, 23, 42, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(15, 23, 42, 0.18);
}

.date-window-card .field input:hover,
.date-window-card .field select:hover {
  border-color: rgba(103, 232, 249, 0.52);
}

.date-window-card .field input:focus,
.date-window-card .field select:focus {
  border-color: rgba(103, 232, 249, 0.94);
  box-shadow:
    0 0 0 4px rgba(34, 211, 238, 0.16),
    0 10px 24px rgba(8, 145, 178, 0.16);
}

.symbol-window-card {
  justify-content: space-between;
}

.market-scope-card {
  justify-content: space-between;
}

.data-directory-card {
  justify-content: space-between;
}

.market-download-panel {
  width: 100%;
}

.market-download-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 16px;
}

.market-download-grid-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.market-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

#price-data-download-start { order: 0; }
#price-data-stop { order: 1; }

.market-download-actions .primary-button,
.market-download-actions .danger-button {
  width: auto;
  min-width: 168px;
}

.market-download-advanced {
  display: grid;
  gap: 14px;
}

.market-download-advanced summary {
  display: none;
}

.market-download-advanced-body {
  display: grid;
  gap: 14px;
}

.market-download-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.market-download-secondary-actions .ghost-button {
  width: auto;
  min-width: 168px;
}

.market-download-checkbox {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.52);
}

.market-download-checkbox input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: #22d3ee;
}

.market-download-checkbox span {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 700;
}

.market-download-checkbox small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.market-download-notes {
  display: grid;
  gap: 8px;
}

.market-download-notes .scope-description {
  margin: 0;
}

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

.price-data-warning-card {
  display: grid;
  gap: 12px;
}

.price-data-warning-list {
  display: grid;
  gap: 12px;
}

.price-data-warning-item,
.price-data-warning-empty {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.52);
}

.price-data-warning-item p,
.price-data-warning-empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.price-data-warning-empty strong {
  color: #e2e8f0;
  font-size: 15px;
}

.price-data-warning-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.price-data-warning-main strong {
  color: #f8fafc;
  font-size: 16px;
}

.price-data-warning-main span {
  color: #94a3b8;
  font-size: 13px;
}

.price-data-warning-meta {
  font-size: 12px;
}

.price-data-warning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.price-data-warning-button {
  min-height: 40px;
  height: 40px;
  width: auto;
  padding: 0 14px;
  font-size: 13px;
}

.directory-preview {
  font-size: 18px;
  line-height: 1.5;
  word-break: break-all;
}

.directory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.strategy-window-card {
  justify-content: space-between;
}

.secondary-button-inline,
.ghost-button {
  min-height: 44px;
  height: 44px;
  width: auto;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 14px;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.46);
  color: #e2e8f0;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.ghost-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(103, 232, 249, 0.52);
  background: rgba(8, 47, 73, 0.62);
}

.symbol-preview {
  font-size: 26px;
  letter-spacing: 0.1em;
}

.symbol-window-card .field input {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.symbol-window-card .field select {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.symbol-window-card .field input::placeholder {
  letter-spacing: 0.08em;
}

.dashboard-symbol-card .dashboard-symbol-search-input {
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.dashboard-symbol-card .dashboard-symbol-search-input::placeholder {
  letter-spacing: 0.02em;
  color: #94a3b8;
}

.price-data-range-card .range-preview {
  font-size: 18px;
}

.scope-description {
  margin: 0;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.7;
}

.adjust-preview {
  font-size: 22px;
}

.adjust-window-card .field select {
  font-size: 16px;
  font-weight: 700;
}

.dashboard-symbol-card .range-preview,
.dashboard-adjust-card .range-preview {
  font-size: 20px;
}

.dashboard-adjust-card {
  justify-content: space-between;
}

.dashboard-screening-card {
  justify-content: space-between;
}

.dashboard-screening-card .range-preview {
  font-size: 22px;
}

.dashboard-range-filter-group {
  display: grid;
  gap: 10px;
}

.dashboard-range-filter-label {
  font-size: 13px;
  font-weight: 700;
  color: #e0f2fe;
}

.dashboard-range-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-board-filter-group {
  display: grid;
  gap: 12px;
}

.dashboard-board-filter-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(191, 219, 254, 0.72);
}

.dashboard-board-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-board-filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.52);
  color: #e2e8f0;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.dashboard-board-filter-option:hover {
  transform: translateY(-1px);
  border-color: rgba(103, 232, 249, 0.42);
  background: rgba(12, 74, 110, 0.32);
}

.dashboard-board-filter-option input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #22d3ee;
  flex: 0 0 auto;
}

.dashboard-board-filter-option span {
  font-size: 14px;
  font-weight: 600;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: 148px;
  min-height: 56px;
  height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #f8fafc;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.22);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(14, 165, 233, 0.28);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: 148px;
  min-height: 56px;
  height: 56px;
  padding: 0 20px;
  border-radius: 18px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(15, 23, 42, 0.72);
  color: #cfefff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.secondary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(103, 232, 249, 0.58);
  background: rgba(12, 74, 110, 0.52);
}

.primary-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.secondary-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff5f5;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.24);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.danger-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(220, 38, 38, 0.3);
}

.danger-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.form-feedback {
  margin: 0;
  padding: 0 24px 22px;
  color: var(--muted);
  font-size: 13px;
}

.form-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px 22px;
  flex-wrap: wrap;
}

.form-meta .form-feedback {
  padding: 0;
}

.form-meta #stock-selection-feedback {
  flex-basis: 100%;
}

.stock-selection-notify-card {
  justify-content: space-between;
}

.stock-selection-notify-card .range-preview {
  font-size: 20px;
}

.stock-selection-notify-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stock-selection-notify-card .stock-selection-eastmoney-checkbox {
  flex: 1 1 220px;
  min-height: 52px;
  margin-top: 0;
  padding: 12px 14px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.52);
}

.stock-selection-notify-card .stock-selection-eastmoney-checkbox:hover {
  border-color: rgba(103, 232, 249, 0.42);
  background: rgba(12, 74, 110, 0.32);
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-hint.error {
  color: #fecaca;
}

.stock-selection-stale-banner {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(120, 53, 15, 0.22);
  color: #fde68a;
  line-height: 1.7;
}

.form-feedback.error {
  color: #fecaca;
}

.sync-progress-panel {
  margin: 0 24px 18px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  background: rgba(15, 23, 42, 0.76);
}

.sync-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.sync-progress-eyebrow {
  margin: 0 0 6px;
  color: #67e8f9;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sync-progress-percent {
  color: #f8fafc;
  font-size: 26px;
  font-weight: 700;
}

.sync-progress-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.88);
  overflow: hidden;
}

.sync-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #38bdf8);
  transition: width 220ms ease;
}

.sync-progress-meta,
.sync-progress-detail {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.sync-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  padding: 0 24px 24px;
}

.sync-summary-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.62);
}

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

.sync-summary-card strong {
  display: block;
  color: #f8fafc;
  font-size: 22px;
  line-height: 1.35;
}

.dataset-section {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  margin-top: 4px;
}

.dataset-section-header {
  padding-top: 18px;
}

.dataset-list {
  display: grid;
  gap: 12px;
  max-height: 320px;
  padding: 18px 24px 24px;
  overflow: auto;
}

.dataset-item,
.dataset-empty {
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.62);
}

.dataset-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.dataset-item-top strong {
  font-size: 18px;
}

.dataset-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  font-size: 12px;
  text-transform: uppercase;
}

.dataset-line,
.dataset-saved {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.dataset-path {
  display: block;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.6);
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
}

.stock-selection-results {
  padding: 0 24px 24px;
}

.stock-selection-progress-panel {
  margin: 4px 24px 0;
}

.stock-selection-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stock-selection-summary-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(125, 211, 252, 0.16);
  background: rgba(15, 23, 42, 0.74);
}

.stock-selection-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stock-selection-summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.stock-selection-table-wrap {
  margin-top: 16px;
  padding: 0;
  border-radius: 20px;
  border: 1px solid rgba(125, 211, 252, 0.16);
  background: rgba(15, 23, 42, 0.68);
  position: relative;
  isolation: isolate;
}

.stock-selection-prebuy-panel {
  margin-top: 14px;
}

.stock-selection-prebuy-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.stock-selection-prebuy-header h3 {
  margin: 0;
  font-size: 18px;
}

.stock-selection-prebuy-header .form-hint {
  margin-top: 6px;
}

.stock-selection-prebuy-toggle-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.stock-selection-eastmoney-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.68);
}

.stock-selection-eastmoney-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.stock-selection-eastmoney-header h3 {
  margin: 0;
  font-size: 18px;
}

.stock-selection-eastmoney-header .form-hint {
  margin-top: 6px;
}

.stock-selection-eastmoney-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stock-selection-eastmoney-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.stock-selection-eastmoney-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: rgba(226, 232, 240, 0.92);
  font-size: 14px;
}

.stock-selection-eastmoney-checkbox input {
  width: 18px;
  height: 18px;
}

.stock-selection-eastmoney-preview {
  margin: 14px 0 0;
  padding: 14px 16px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.7);
  color: rgba(224, 242, 254, 0.96);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.stock-selection-prebuy-toggle {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  white-space: nowrap;
}

.stock-selection-prebuy-toggle:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.stock-selection-table-wrap table {
  min-width: 920px;
}

.stock-selection-action-button {
  min-height: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13px;
}

.stock-selection-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.stock-selection-pagination-button {
  min-width: 52px;
  height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.72));
  color: rgba(226, 232, 240, 0.92);
  font-size: 17px;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.stock-selection-pagination-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(103, 232, 249, 0.48);
  background: linear-gradient(180deg, rgba(12, 74, 110, 0.46), rgba(15, 23, 42, 0.82));
  color: #f8fafc;
}

.stock-selection-pagination-button.is-active {
  border-color: rgba(34, 211, 238, 0.56);
  background: linear-gradient(180deg, rgba(8, 47, 73, 0.96), rgba(14, 116, 144, 0.8));
  color: #ecfeff;
  box-shadow: 0 12px 26px rgba(8, 145, 178, 0.18), inset 0 1px 0 rgba(186, 230, 253, 0.18);
}

.stock-selection-pagination-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.stock-selection-pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  color: rgba(226, 232, 240, 0.9);
  font-size: 16px;
  white-space: nowrap;
}

.stock-selection-pagination-jump-input {
  width: 88px;
  height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.72));
  color: #f8fafc;
  font-size: 18px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.stock-selection-pagination-jump-input:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.56);
  background: linear-gradient(180deg, rgba(8, 47, 73, 0.96), rgba(14, 116, 144, 0.72));
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.stock-selection-pagination-jump-total {
  color: rgba(148, 163, 184, 0.9);
}

.stock-selection-result-row.is-current {
  background: rgba(14, 116, 144, 0.18);
}

.stock-selection-result-row.is-placeholder {
  pointer-events: none;
}

.stock-selection-result-row.is-placeholder:hover {
  background: transparent;
}

.stock-selection-placeholder-cell {
  display: block;
  min-height: 40px;
  visibility: hidden;
}

#stock-selection-summary-hint {
  margin-top: 14px;
}

.modal-backdrop[hidden],
.maintenance-overlay[hidden] {
  display: none;
}

.modal-backdrop,
.maintenance-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.modal-backdrop {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 15, 28, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card,
.maintenance-card {
  width: min(640px, calc(100vw - 32px));
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(10, 18, 32, 0.96), rgba(15, 23, 42, 0.96));
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.42);
}

.modal-card {
  padding: 22px 22px 20px;
}

.modal-card-wide {
  width: min(1080px, calc(100vw - 32px));
}

.strategy-modal-card {
  display: flex;
  flex-direction: column;
  max-height: min(860px, calc(100vh - 48px));
  overflow: hidden;
}

.modal-card-header h2,
.maintenance-card h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

.modal-eyebrow,
.maintenance-eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.modal-card-body {
  margin-top: 14px;
}

.strategy-modal-card .modal-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal-message,
.maintenance-card p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.modal-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.modal-summary-card {
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.6);
}

.modal-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.modal-summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 19px;
}

.modal-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.strategy-modal-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 6px;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}

.strategy-library-panel,
.strategy-editor-panel {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.56);
  padding: 18px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.strategy-library-header h3,
.strategy-editor-header h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.strategy-library-header p,
.strategy-editor-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.strategy-profile-list {
  display: grid;
  flex: 1 1 auto;
  gap: 10px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 4px;
}

.strategy-profile-item {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.68);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.strategy-profile-item:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(103, 232, 249, 0.48);
  background: rgba(8, 47, 73, 0.78);
}

.strategy-profile-item.active {
  border-color: rgba(103, 232, 249, 0.88);
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.38), rgba(15, 23, 42, 0.86));
  box-shadow: 0 14px 28px rgba(8, 145, 178, 0.18);
}

.strategy-profile-item strong {
  display: block;
  font-size: 16px;
}

.strategy-profile-item span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.strategy-editor-panel {
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.strategy-editor-header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-bottom: 12px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.88) 78%, rgba(15, 23, 42, 0));
}

.strategy-editor-form {
  display: grid;
  gap: 14px;
  align-content: start;
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
  padding-right: 8px;
}

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

.strategy-editor-panel::-webkit-scrollbar,
.strategy-profile-list::-webkit-scrollbar {
  width: 10px;
}

.strategy-editor-panel::-webkit-scrollbar-track,
.strategy-profile-list::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.52);
  border-radius: 999px;
}

.strategy-editor-panel::-webkit-scrollbar-thumb,
.strategy-profile-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.86), rgba(14, 165, 233, 0.72));
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.38);
}

.strategy-editor-panel,
.strategy-profile-list {
  scrollbar-color: rgba(34, 211, 238, 0.86) rgba(15, 23, 42, 0.52);
  scrollbar-width: thin;
}

#strategy-buy-position-cash-field[hidden],
#strategy-add-position-cash-field[hidden] {
  display: none;
}

.field input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin-top: 12px;
  accent-color: #22d3ee;
}

.strategy-preview {
  line-height: 1.5;
}

.maintenance-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(10px);
}

.maintenance-card {
  padding: 24px 24px 22px;
  text-align: center;
}

body.ui-locked {
  overflow: hidden;
}

body[data-page="strategy-management"] .modal-backdrop {
  position: static;
  inset: auto;
  display: block;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}

body[data-page="strategy-management"] .strategy-modal-card {
  width: 100%;
  max-height: min(860px, calc(100vh - 220px));
  min-height: min(760px, calc(100vh - 220px));
}

body[data-page="strategy-management"] .modal-card-actions {
  margin-top: 18px;
}

body[data-page="strategy-management"].ui-locked {
  overflow: auto;
}

.chart-panel-large { grid-column: 1 / span 2; }
.table-panel { grid-column: 1 / span 2; }

.panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px 0;
}

.panel-header h2 { margin: 0 0 6px; font-size: 20px; }
.panel-header p { margin: 0; color: var(--muted); font-size: 13px; }

.control-panel > .panel-header > .price-timeframe-tabs {
  display: none;
}

.price-timeframe-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.price-timeframe-tab {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  color: #dbeafe;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.price-timeframe-tab:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(103, 232, 249, 0.72);
  background: rgba(8, 47, 73, 0.84);
  color: #f8fafc;
}

.price-timeframe-tab.active {
  border-color: rgba(103, 232, 249, 0.96);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.98), rgba(14, 165, 233, 0.96));
  color: #f8fafc;
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.2);
}

.price-timeframe-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.price-ma-settings {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.price-ma-setting {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.6);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
}

.price-ma-setting span {
  color: #7dd3fc;
  letter-spacing: 0.04em;
}

.price-ma-setting input {
  width: 56px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 10px;
  background: rgba(8, 47, 73, 0.72);
  color: #f8fafc;
  font: inherit;
  text-align: center;
  outline: none;
}

.price-ma-setting input:focus {
  border-color: rgba(103, 232, 249, 0.92);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
}

.price-ma-setting input::-webkit-outer-spin-button,
.price-ma-setting input::-webkit-inner-spin-button {
  margin: 0;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.chart-box {
  position: relative;
  width: 100%;
  height: 360px;
  padding: 8px 14px 18px;
}

.chart-box-xl { height: 560px; }

.chart-box-price {
  overflow: hidden;
}

.price-inspector {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 5;
  width: min(200px, calc(100% - 28px));
  max-height: calc(100% - 24px);
  overflow: auto;
  padding: 14px 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(20, 26, 38, 0.9);
  box-shadow: 0 16px 36px rgba(2, 6, 23, 0.42);
  backdrop-filter: blur(10px);
}

.price-inspector.is-dragging {
  box-shadow: 0 22px 42px rgba(2, 6, 23, 0.52);
}

.price-inspector__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  cursor: grab;
  touch-action: none;
}

.price-inspector.is-dragging .price-inspector__header {
  cursor: grabbing;
}

.price-inspector__drag-badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.14);
  color: #fef08a;
  font-size: 12px;
  font-weight: 700;
}

.price-inspector__title {
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 700;
}

.price-inspector__reset {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.price-inspector__reset:hover {
  color: #e2e8f0;
}

.price-inspector__date {
  margin-bottom: 14px;
  color: #f8fafc;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.price-inspector__rows {
  display: grid;
  gap: 7px;
}

.price-inspector__row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: baseline;
}

.price-inspector__label {
  color: #cbd5e1;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.price-inspector__value {
  text-align: right;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 700;
}

.price-inspector__value--up {
  color: #ff5b5b;
}

.price-inspector__value--down {
  color: #2ddc74;
}

.price-inspector__value--accent {
  color: #22d3ee;
}

.price-inspector__value--ma1 {
  color: #38bdf8;
}

.price-inspector__value--ma2 {
  color: #f59e0b;
}

.price-inspector__value--ma3 {
  color: #fb7185;
}

.price-inspector__value--ma4 {
  color: #34d399;
}

.price-inspector__value--wrap {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.price-inspector__measure {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.price-inspector__measure-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.price-inspector__measure-title {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
}

.price-inspector__measure-hint,
.price-inspector__measure-empty {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.6;
}

.price-inspector__divider {
  height: 1px;
  margin: 2px 0 4px;
  background: rgba(148, 163, 184, 0.12);
}

.table-wrap {
  margin-top: 18px;
  padding: 0 22px 24px;
  overflow: auto;
}

.table-wrap-sticky {
  max-height: min(720px, 72vh);
  overflow-x: auto;
  overflow-y: auto;
  position: relative;
  isolation: isolate;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: left;
  font-size: 14px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #111827;
  color: var(--muted);
  font-weight: 600;
  box-shadow: inset 0 -1px 0 rgba(148, 163, 184, 0.14);
}

tbody tr:hover { background: rgba(30, 41, 59, 0.5); }

.positive { color: var(--good); }
.negative { color: var(--bad); }

.primary-button,
.secondary-button,
.ghost-button {
  text-decoration: none;
}

.page-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
}

.module-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.module-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.module-nav-link:hover,
.module-nav-link:focus-visible {
  border-color: rgba(56, 189, 248, 0.48);
  background: rgba(8, 47, 73, 0.74);
  outline: none;
  transform: translateY(-1px);
}

.module-nav-link.active {
  border-color: rgba(103, 232, 249, 0.78);
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.34), rgba(15, 23, 42, 0.84));
  box-shadow: 0 16px 30px rgba(8, 145, 178, 0.14);
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 20px;
  margin-bottom: 20px;
}

.portal-hero-panel,
.module-card {
  padding: 24px;
}

.portal-eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.portal-lead {
  margin: 12px 0 0;
  color: rgba(226, 232, 240, 0.92);
  font-size: 16px;
  line-height: 1.8;
}

.portal-meta-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

.portal-meta-item {
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.56);
}

.portal-meta-item strong,
.module-card h2 {
  display: block;
  margin: 0;
  font-size: 18px;
}

.portal-meta-item span,
.module-card p {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}

.module-section {
  margin-bottom: 20px;
}

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

.module-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.module-card:hover,
.module-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(103, 232, 249, 0.44);
  background: linear-gradient(180deg, rgba(8, 47, 73, 0.24), rgba(17, 24, 39, 0.88));
  outline: none;
}

.module-card-meta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(125, 211, 252, 0.92);
  font-size: 13px;
}

.module-page-shell {
  display: grid;
  gap: 20px;
}

.module-page-header {
  padding: 24px;
}

.module-page-header h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.module-page-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.summary-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.visualization-summary-grid {
  grid-template-columns: repeat(5, minmax(170px, 1fr));
}

.visualization-filter-panel,
.visualization-chart-grid {
  margin-bottom: 20px;
}

.visualization-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  padding: 18px 24px 24px;
}

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

.visualization-chart-panel {
  overflow: hidden;
}

.visualization-chart-box {
  height: 420px;
}

.visualization-table-panel {
  overflow: hidden;
}

.visualization-table-shell {
  max-height: 760px;
  overflow: auto;
  padding: 0 24px 24px;
  position: relative;
  isolation: isolate;
}

.visualization-table-shell::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.visualization-table-shell::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.52);
  border-radius: 999px;
}

.visualization-table-shell::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.86), rgba(14, 165, 233, 0.72));
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.4);
}

.visualization-table-shell {
  scrollbar-color: rgba(56, 189, 248, 0.86) rgba(15, 23, 42, 0.52);
  scrollbar-width: thin;
}

.visualization-table {
  width: 100%;
  border-collapse: collapse;
}

.visualization-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #020617;
  box-shadow: inset 0 -1px 0 rgba(148, 163, 184, 0.14);
}

.visualization-table th,
.visualization-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 14px;
  text-align: left;
}

.visualization-table th {
  color: #cbd5e1;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.visualization-table td {
  color: #e2e8f0;
}

.visualization-table th:nth-child(n + 4),
.visualization-table td:nth-child(n + 4) {
  text-align: right;
}

.visualization-table tbody tr:hover {
  background: rgba(8, 47, 73, 0.22);
}

.visualization-table-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1200px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .control-grid { grid-template-columns: 1fr; }
  .control-form { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .control-form-dashboard { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .control-form-price-data .data-directory-card,
  .control-form-price-data .market-scope-card,
  .control-form-price-data .price-data-range-card,
  .control-form-price-data .adjust-window-card {
    grid-column: 1 / -1;
  }
  .market-download-grid {
    grid-template-columns: 1fr;
  }
  .price-data-warning-grid {
    grid-template-columns: 1fr;
  }
  .control-form-dashboard .date-window-card {
    grid-column: 1 / -1;
  }
  .sync-summary-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
  .stock-selection-summary-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
  .panel-actions {
    width: 100%;
  }
  .panel-header .primary-button {
    width: 100%;
  }
  .panel-actions .secondary-button {
    width: 100%;
  }
  .stock-selection-eastmoney-header {
    flex-direction: column;
  }
  .stock-selection-eastmoney-actions {
    width: 100%;
  }
  .stock-selection-eastmoney-actions .secondary-button,
  .stock-selection-eastmoney-actions .primary-button {
    width: 100%;
  }
  .dashboard-grid { grid-template-columns: 1fr; }
  .chart-panel-large, .table-panel { grid-column: auto; }
  .visualization-summary-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
  .visualization-filter-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 980px) {
  .portal-hero,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .control-form-dashboard-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page='dashboard-workbench'] .control-form-dashboard-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .visualization-chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    width: 100%;
    margin: 0 auto 24px;
    padding: 12px;
  }

  .panel,
  .summary-card {
    border-radius: 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .topbar-actions .primary-button,
  .topbar-actions .secondary-button,
  .topbar-actions .ghost-button {
    width: 100%;
    min-height: 48px;
  }

  .danger-button { width: 100%; }
  .summary-grid { grid-template-columns: 1fr; }

  .control-form {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .control-form-dashboard-compact { grid-template-columns: 1fr; }
  body[data-page='dashboard-workbench'] .control-form-dashboard-compact { grid-template-columns: 1fr; }
  .market-download-grid-fields { grid-template-columns: 1fr; }
  .price-data-warning-grid { grid-template-columns: 1fr; }
  .date-window-grid { grid-template-columns: 1fr; }
  .dashboard-range-filter-grid { grid-template-columns: 1fr; }
  .date-window-divider { display: none; }
  .form-meta { flex-direction: column; }

  .module-nav {
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0 -12px 14px;
    padding: 0 12px 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .module-nav::-webkit-scrollbar {
    display: none;
  }

  .module-nav-link {
    flex: 0 0 auto;
    width: auto;
    min-height: 44px;
    padding: 10px 15px;
    white-space: nowrap;
  }

  .portal-hero-panel,
  .module-card,
  .module-page-header {
    padding: 16px;
  }

  .module-page-shell {
    gap: 14px;
  }

  .module-page-header h2 {
    font-size: 20px;
  }

  .module-page-header p,
  .page-subtitle {
    font-size: 12px;
    line-height: 1.6;
  }

  .panel-header {
    padding: 16px 16px 0;
  }

  .panel-header h2 {
    font-size: 18px;
  }

  .panel-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .panel-actions .primary-button,
  .panel-actions .secondary-button,
  .panel-actions .ghost-button {
    width: 100%;
  }

  .date-window-card {
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    min-height: auto;
  }

  .date-window-header {
    gap: 10px;
  }

  .range-preview,
  .directory-preview {
    font-size: 15px;
  }

  .directory-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  #price-data-directory-select {
    display: none;
  }

  .market-download-grid {
    gap: 12px;
  }

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

  .market-download-actions .primary-button,
  .market-download-actions .danger-button {
    width: 100%;
    min-height: 52px;
  }

  .market-download-advanced {
    display: block;
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.5);
    overflow: hidden;
  }

  .market-download-advanced summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 14px;
    color: #dbeafe;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
  }

  .market-download-advanced summary::-webkit-details-marker {
    display: none;
  }

  .market-download-advanced summary::after {
    content: '+';
    color: #67e8f9;
    font-size: 20px;
    line-height: 1;
  }

  .market-download-advanced[open] summary {
    border-bottom: 1px solid rgba(56, 189, 248, 0.14);
  }

  .market-download-advanced[open] summary::after {
    content: '-';
  }

  .market-download-advanced-body {
    gap: 12px;
    padding: 12px;
  }

  .market-download-secondary-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .market-download-secondary-actions .ghost-button {
    width: 100%;
  }

  .market-download-checkbox {
    padding: 12px;
    border-radius: 14px;
  }

  .market-download-checkbox small {
    grid-column: 1 / -1;
  }

  .sync-progress-panel,
  .stock-selection-progress-panel {
    margin: 0 14px 14px;
    padding: 16px;
    border-radius: 16px;
  }

  .sync-summary-grid,
  .stock-selection-results {
    padding: 0 14px 16px;
  }

  .stock-selection-prebuy-header,
  .stock-selection-eastmoney-header {
    flex-direction: column;
  }

  .stock-selection-prebuy-toggle-row {
    justify-content: stretch;
  }

  .stock-selection-prebuy-toggle {
    width: 100%;
  }

  .table-wrap,
  .table-wrap-sticky,
  .stock-selection-table-wrap,
  .visualization-table-shell {
    padding: 0;
    overflow: visible;
  }

  .visualization-table-shell {
    max-height: none;
  }

  body[data-page='stock-selection-workbench'] .stock-selection-table-wrap table,
  body[data-page='dashboard-workbench'] .table-panel table,
  body[data-page='stock-selection-visualization'] .visualization-table {
    min-width: 0;
    width: 100%;
  }

  body[data-page='stock-selection-workbench'] .stock-selection-table-wrap thead,
  body[data-page='dashboard-workbench'] .table-panel thead,
  body[data-page='stock-selection-visualization'] .visualization-table thead {
    display: none;
  }

  body[data-page='stock-selection-workbench'] .stock-selection-table-wrap tbody,
  body[data-page='dashboard-workbench'] .table-panel tbody,
  body[data-page='stock-selection-visualization'] .visualization-table tbody {
    display: grid;
    gap: 12px;
  }

  body[data-page='stock-selection-workbench'] .stock-selection-table-wrap tr,
  body[data-page='dashboard-workbench'] .table-panel tr,
  body[data-page='stock-selection-visualization'] .visualization-table tr {
    display: grid;
    border: 1px solid rgba(125, 211, 252, 0.16);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.66);
    overflow: hidden;
  }

  body[data-page='stock-selection-workbench'] .stock-selection-table-wrap td,
  body[data-page='dashboard-workbench'] .table-panel td,
  body[data-page='stock-selection-visualization'] .visualization-table td {
    display: grid;
    grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    text-align: right;
    word-break: break-word;
  }

  body[data-page='stock-selection-workbench'] .stock-selection-table-wrap td:last-child,
  body[data-page='dashboard-workbench'] .table-panel td:last-child,
  body[data-page='stock-selection-visualization'] .visualization-table td:last-child {
    border-bottom: 0;
  }

  body[data-page='stock-selection-workbench'] .stock-selection-table-wrap td::before,
  body[data-page='dashboard-workbench'] .table-panel td::before,
  body[data-page='stock-selection-visualization'] .visualization-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    text-align: left;
  }

  body[data-page='stock-selection-workbench'] .stock-selection-table-wrap td[colspan],
  body[data-page='dashboard-workbench'] .table-panel td[colspan],
  body[data-page='stock-selection-visualization'] .visualization-table td[colspan] {
    display: block;
    padding: 16px;
    text-align: center;
  }

  body[data-page='stock-selection-workbench'] .stock-selection-table-wrap td[colspan]::before,
  body[data-page='dashboard-workbench'] .table-panel td[colspan]::before,
  body[data-page='stock-selection-visualization'] .visualization-table td[colspan]::before {
    content: none;
  }

  .stock-selection-action-button {
    width: 100%;
  }

  .chart-box {
    height: 300px;
    padding: 4px 8px 12px;
  }

  .chart-box-xl {
    height: 380px;
  }

  .sync-progress-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .sync-summary-grid {
    grid-template-columns: 1fr;
  }
  .stock-selection-summary-grid {
    grid-template-columns: 1fr;
  }
  .price-inspector {
    width: min(246px, calc(100% - 24px));
    padding: 12px 12px 14px;
  }
  .price-inspector__row {
    grid-template-columns: 64px 1fr;
  }
  .price-inspector__date {
    font-size: 20px;
  }
  .modal-card-actions {
    flex-direction: column;
  }
  .modal-card-actions button {
    width: 100%;
  }
  .modal-summary-grid {
    grid-template-columns: 1fr;
  }
  .strategy-modal-layout {
    grid-template-columns: 1fr;
  }
  .strategy-editor-grid {
    grid-template-columns: 1fr;
  }
  .visualization-summary-grid,
  .visualization-filter-grid {
    grid-template-columns: 1fr;
  }
  .visualization-chart-box {
    height: 360px;
  }
  .visualization-table-shell {
    padding: 4px 16px 18px;
  }
  .visualization-topbar-actions {
    width: 100%;
    flex-direction: column;
  }
  .visualization-topbar-actions .ghost-button,
  .visualization-topbar-actions .secondary-button {
    width: 100%;
  }
  h1 { font-size: 26px; }
}

body[data-page='notes-home'] {
  min-height: 100vh;
  overflow-x: hidden;
  color: #172554;
  background: #eef6ff;
}

body[data-page='notes-home']::before {
  content: none;
}

body[data-page='notes-home'] .notes-page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 24px;
}

body[data-page='notes-home'] .glass {
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 24px 70px rgba(59, 130, 246, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

body[data-page='notes-home'] .notes-hero {
  display: block;
  min-height: auto;
  margin: 0;
  padding: clamp(28px, 5vw, 56px);
  border-radius: 36px;
}

body[data-page='notes-home'] .notes-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  color: #4338ca;
  font-size: 14px;
  font-weight: 800;
}

body[data-page='notes-home'] .notes-hero h1 {
  max-width: 820px;
  margin: 18px 0 14px;
  color: #172554;
  font-size: clamp(36px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

body[data-page='notes-home'] .notes-intro {
  max-width: 760px;
  margin: 0;
  color: #334155;
  font-size: 18px;
  line-height: 1.8;
}

body[data-page='notes-home'] .notes-actions,
body[data-page='notes-home'] .notes-card-actions,
body[data-page='notes-home'] .notes-footer-tags,
body[data-page='notes-home'] .notes-site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body[data-page='notes-home'] .notes-actions {
  margin-top: 22px;
}

body[data-page='notes-home'] .notes-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: #4338ca;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

body[data-page='notes-home'] .notes-action:hover,
body[data-page='notes-home'] .notes-action:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 30px rgba(59, 130, 246, 0.18);
  outline: none;
}

body[data-page='notes-home'] .notes-action-primary {
  background: rgba(67, 56, 202, 0.9);
  color: #ffffff;
}

body[data-page='notes-home'] .notes-content {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 22px;
  margin-top: 24px;
}

body[data-page='notes-home'] .notes-content-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-page='notes-home'] .notes-card,
body[data-page='notes-home'] .notes-mini {
  border-radius: 28px;
}

body[data-page='notes-home'] .notes-card {
  padding: 26px;
}

body[data-page='notes-home'] .notes-card h2 {
  margin: 0 0 14px;
  color: #172554;
  font-size: 22px;
}

body[data-page='notes-home'] .notes-card p,
body[data-page='notes-home'] .notes-card li {
  color: #334155;
  font-size: 15px;
  line-height: 1.8;
}

body[data-page='notes-home'] .notes-card p {
  margin: 0;
}

body[data-page='notes-home'] .notes-card ul {
  margin: 0;
  padding-left: 20px;
}

body[data-page='notes-home'] .notes-code-card {
  overflow: hidden;
  border-radius: 28px;
}

body[data-page='notes-home'] .notes-window-bar {
  display: flex;
  gap: 8px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.36);
}

body[data-page='notes-home'] .notes-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #8b5cf6;
  opacity: 0.75;
}

body[data-page='notes-home'] pre {
  margin: 0;
  padding: 24px;
  overflow-x: auto;
  background: rgba(15, 23, 42, 0.82);
  color: #dbeafe;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 14px;
  line-height: 1.7;
}

body[data-page='notes-home'] .notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

body[data-page='notes-home'] .notes-mini {
  padding: 20px;
}

body[data-page='notes-home'] .notes-mini strong {
  display: block;
  margin-bottom: 8px;
  color: #312e81;
  font-size: 16px;
}

body[data-page='notes-home'] .notes-mini span {
  color: #475569;
  font-size: 14px;
  line-height: 1.7;
}

body[data-page='notes-home'] .notes-card-actions {
  margin-top: 18px;
}

body[data-page='notes-home'] .notes-footer-tags {
  margin-top: 22px;
}

body[data-page='notes-home'] .notes-pill {
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: #4338ca;
  font-size: 13px;
  font-weight: 800;
}

body[data-page='notes-home'] .notes-site-footer {
  align-items: center;
  justify-content: center;
  padding: 28px 0 0;
  color: #475569;
  font-size: 13px;
}

body[data-page='notes-home'] .notes-site-footer a {
  color: #4338ca;
  font-weight: 800;
  text-decoration: none;
}

body[data-page='notes-home'] .notes-site-footer a:hover,
body[data-page='notes-home'] .notes-site-footer a:focus-visible {
  color: #312e81;
  outline: none;
}

body[data-page='notes-home'] .notes-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 14px 18px;
  border-radius: 26px;
}

body[data-page='notes-home'] .notes-brand,
body[data-page='notes-home'] .notes-toplinks {
  display: flex;
  align-items: center;
}

body[data-page='notes-home'] .notes-brand {
  gap: 10px;
  color: #172554;
  font-size: 15px;
  font-weight: 900;
  text-decoration: none;
}

body[data-page='notes-home'] .notes-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: rgba(67, 56, 202, 0.9);
  color: #ffffff;
  font-size: 13px;
}

body[data-page='notes-home'] .notes-toplinks {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

body[data-page='notes-home'] .notes-toplinks a,
body[data-page='notes-home'] .notes-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: #4338ca;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

body[data-page='notes-home'] .notes-login-button[data-authenticated='true'] {
  background: rgba(67, 56, 202, 0.9);
  color: #ffffff;
}

body[data-page='notes-home'] .notes-list-section {
  margin-top: 24px;
}

body[data-page='notes-home'] .notes-section-heading {
  margin-bottom: 14px;
}

body[data-page='notes-home'] .notes-section-heading h2 {
  margin: 12px 0 0;
  color: #172554;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.15;
}

body[data-page='notes-home'] .notes-list-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

body[data-page='notes-home'] .notes-note-card {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  padding: 20px;
  border-radius: 28px;
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

body[data-page='notes-home'] .notes-note-card:hover,
body[data-page='notes-home'] .notes-note-card:focus-visible {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 30px 76px rgba(59, 130, 246, 0.22);
  outline: none;
}

body[data-page='notes-home'] .notes-note-index {
  color: #4338ca;
  font-size: 13px;
  font-weight: 900;
}

body[data-page='notes-home'] .notes-note-card h3 {
  margin: 32px 0 10px;
  color: #172554;
  font-size: 20px;
  line-height: 1.35;
}

body[data-page='notes-home'] .notes-note-card p {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.7;
}

body[data-page='notes-home'] .notes-read-link {
  margin-top: auto;
  color: #4338ca;
  font-size: 13px;
  font-weight: 900;
}

body[data-page='notes-home'] .notes-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(8px);
}

body[data-page='notes-home'] .notes-modal[hidden] {
  display: none;
}

body[data-page='notes-home'] .notes-modal-card {
  width: min(440px, 100%);
  padding: 26px;
  border-radius: 28px;
}

body[data-page='notes-home'] .notes-modal-card h2 {
  margin: 0 0 10px;
  color: #172554;
  font-size: 26px;
}

body[data-page='notes-home'] .notes-modal-card p {
  margin: 0;
  color: #334155;
  line-height: 1.8;
}

body[data-page='notes-home'] .notes-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

body[data-page='note-article'] {
  min-height: 100vh;
  color: #172554;
  background: #eef6ff;
}

body[data-page='note-article'] .glass {
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 24px 70px rgba(59, 130, 246, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

body[data-page='note-article'] .note-page {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

body[data-page='note-article'] .note-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

body[data-page='note-article'] .note-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: #4338ca;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

body[data-page='note-article'] .notes-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  color: #4338ca;
  font-size: 14px;
  font-weight: 800;
}

body[data-page='note-article'] .note-article {
  padding: clamp(24px, 5vw, 48px);
  border-radius: 34px;
}

body[data-page='note-article'] .note-article h1 {
  margin: 18px 0 14px;
  color: #172554;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.05;
}

body[data-page='note-article'] .note-lead {
  max-width: 760px;
  margin: 0 0 28px;
  color: #334155;
  font-size: 18px;
  line-height: 1.8;
}

body[data-page='note-article'] .note-article h2 {
  margin: 28px 0 10px;
  color: #312e81;
  font-size: 24px;
}

body[data-page='note-article'] .note-article p {
  color: #334155;
  line-height: 1.85;
}

body[data-page='note-article'] .note-article pre {
  margin: 14px 0 0;
  padding: 20px;
  overflow-x: auto;
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.86);
  color: #dbeafe;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 14px;
  line-height: 1.75;
}

body[data-page='login'] {
  min-height: 100vh;
  color: #172554;
  background: #eef6ff;
}

body[data-page='login'] .login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

body[data-page='login'] .login-panel {
  width: min(520px, 100%);
  padding: clamp(28px, 5vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 24px 70px rgba(59, 130, 246, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

body[data-page='login'] .login-brand {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

body[data-page='login'] .login-home-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: #172554;
  font-size: 15px;
  font-weight: 900;
  text-decoration: none;
}

body[data-page='login'] .login-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: rgba(67, 56, 202, 0.9);
  color: #ffffff;
  font-size: 13px;
}

body[data-page='login'] .notes-tag {
  width: fit-content;
}

body[data-page='login'] .login-brand h1 {
  margin: 0;
  color: #172554;
  font-size: clamp(34px, 7vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
}

body[data-page='login'] .login-brand p {
  margin: 0;
  color: #334155;
  font-size: 16px;
  line-height: 1.8;
}

body[data-page='login'] .login-form {
  display: grid;
  gap: 16px;
}

body[data-page='login'] .login-form label {
  display: grid;
  gap: 8px;
  color: #312e81;
  font-size: 14px;
  font-weight: 900;
}

body[data-page='login'] .login-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.5);
  color: #172554;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

body[data-page='login'] .login-form input:focus {
  border-color: rgba(67, 56, 202, 0.5);
  outline: none;
  box-shadow:
    0 0 0 4px rgba(67, 56, 202, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

body[data-page='login'] .login-form .primary-button {
  width: 100%;
  min-height: 52px;
  border-radius: 999px;
  background: rgba(67, 56, 202, 0.92);
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(67, 56, 202, 0.18);
}

body[data-page='login'] .login-error {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: 18px;
  background: rgba(254, 226, 226, 0.62);
  color: #991b1b;
  font-size: 14px;
}

body[data-page='login'] .login-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  color: #64748b;
  font-size: 13px;
}

body[data-page='login'] .login-footer a {
  color: #4338ca;
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 520px) {
  body[data-page='login'] .login-page {
    place-items: center start;
    padding: 20px 10px;
  }

  body[data-page='login'] .login-panel {
    width: min(calc(100vw - 20px), 370px);
    padding: 28px;
    border-radius: 28px;
  }

  body[data-page='login'] .login-brand h1 {
    font-size: clamp(32px, 11vw, 42px);
  }

  body[data-page='login'] .login-footer {
    flex-direction: column;
  }
}

@media (max-width: 860px) {
  body[data-page='notes-home'] .notes-content,
  body[data-page='notes-home'] .notes-content-secondary,
  body[data-page='notes-home'] .notes-grid,
  body[data-page='notes-home'] .notes-list-grid {
    grid-template-columns: 1fr;
  }

  body[data-page='notes-home'] .notes-page {
    width: min(100% - 32px, 720px);
    padding: 28px 0 20px;
  }
}

@media (max-width: 520px) {
  body[data-page='notes-home'] .notes-page {
    width: min(calc(100vw - 20px), 370px);
    margin-left: 10px;
    margin-right: auto;
  }

  body[data-page='notes-home'] .notes-hero {
    border-radius: 28px;
  }

  body[data-page='notes-home'] .notes-hero h1 {
    font-size: clamp(34px, 11vw, 44px);
    line-height: 1.08;
  }

  body[data-page='notes-home'] .notes-intro {
    font-size: 16px;
  }

  body[data-page='notes-home'] .notes-actions,
  body[data-page='notes-home'] .notes-card-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  body[data-page='notes-home'] .notes-action {
    width: 100%;
  }

  body[data-page='notes-home'] .notes-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-page='notes-home'] .notes-toplinks {
    justify-content: flex-start;
  }

  body[data-page='notes-home'] .notes-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
