:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  color: #1f242c;
  background: #f2f4f8;
  --line: #dfe3ea;
  --line-soft: #edf0f4;
  --muted: #7a8491;
  --muted-bg: #f7f8fb;
  --blue: #2f5f9f;
  --blue-soft: #edf3ff;
  --accent: #ee842f;
  --accent-soft: #fff3e8;
  --red: #df4d5f;
  --green: #319c6a;
  --panel: #ffffff;
  --rail: #e8edf5;
  --shadow: 0 8px 22px rgb(31 41 55 / 6%);
}

* {
  box-sizing: border-box;
  scrollbar-color: rgb(31 41 55 / 24%) transparent;
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgb(31 41 55 / 22%);
}

::-webkit-scrollbar-thumb:hover {
  background: rgb(31 41 55 / 32%);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--muted-bg);
  font-size: 12px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

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

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 9px 5px;
  background: var(--rail);
  border-right: 1px solid #d6deea;
}

.rail a {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #667284;
  font-size: 12px;
  font-weight: 800;
}

.rail a:hover,
.rail .rail-logo {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 4px 14px rgb(30 41 59 / 8%);
}

.workspace {
  min-width: 0;
  padding: 0;
}

.share-workspace {
  min-height: 100vh;
  background: #fff;
}

.market-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(560px, 1fr) 328px;
  gap: 0;
  overflow: hidden;
  background: var(--panel);
  border: 0;
  box-shadow: none;
}

.share-workbench {
  display: block;
  min-height: 100vh;
  overflow: visible;
  background: #fff;
}

.share-workbench .stock-main {
  min-height: 100vh;
  overflow: visible;
  border-right: 0;
}

.share-workbench .stock-sticky-head {
  position: sticky;
  top: 0;
  z-index: 8;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.single-column {
  display: block;
  max-width: 1180px;
  min-height: auto;
  margin: 0 auto;
}

.watch-panel,
.stock-main,
.intel-panel {
  min-width: 0;
  min-height: 0;
}

.watch-panel {
  background: #fbfcff;
  border-right: 1px solid var(--line);
}

.watch-panel-compact {
  overflow: auto;
}

.stock-main {
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #fff;
}

.intel-panel {
  overflow: auto;
  background: #fbfcff;
}

.panel-head,
.quote-head,
.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-head {
  min-height: 58px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-head h1,
.quote-head h1,
.research-card h2,
.intel-card h2,
.report-stage h2 {
  margin: 0;
  letter-spacing: 0;
}

.panel-head h1 {
  font-size: 17px;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.count-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
}

.icon-link {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}

.ticker-add {
  margin: 8px 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.ticker-add label {
  display: block;
  margin-bottom: 8px;
  color: #384250;
  font-size: 12px;
  font-weight: 700;
}

.ticker-add div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
}

.ticker-add input {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid #aeb7c2;
  border-radius: 6px;
  outline: none;
  text-transform: uppercase;
}

.ticker-add input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(245 130 32 / 14%);
}

.ticker-add button,
.primary-action,
.secondary-action,
.published-action,
.danger-action {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.primary-action {
  background: var(--accent);
  color: white;
}

.secondary-action {
  border: 1px solid var(--line);
  background: #f5f7fa;
  color: #334155;
}

.danger-action {
  border: 1px solid #ffd1d8;
  background: #fff5f7;
  color: #c73447;
}

.published-action {
  border: 1px solid #b7e4c7;
  background: #f0fdf4;
  color: #16803c;
}

.ticker-add p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.filter-tabs,
.section-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
  white-space: nowrap;
}

.filter-tabs button,
.section-tabs a {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #fff;
  color: #56616f;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.filter-tabs button:hover,
.filter-tabs button.active,
.section-tabs a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.watch-list {
  display: grid;
}

.watch-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.watch-item[hidden] {
  display: none;
}

.watch-item:hover,
.watch-item.selected {
  background: #f0f4fb;
}

.watch-item.selected {
  box-shadow: inset 2px 0 0 var(--accent);
}

.watch-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.watch-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.watch-item em {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  text-align: right;
}

.watch-table {
  margin: 0 10px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.watch-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 80px 80px 100px;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
}

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

.watch-row:hover {
  background: var(--muted-bg);
}

.watch-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-row span {
  color: #53606d;
  font-size: 12px;
}

.watch-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.watch-row em {
  justify-self: start;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.watch-row-head {
  min-height: 38px;
  background: var(--muted-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quote-head {
  min-height: 72px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.quote-head h1 {
  font-size: 18px;
  line-height: 1.12;
}

.quote-head p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.quote-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.quote-head form {
  flex: 0 0 auto;
}

.soft-progress {
  position: relative;
  height: 14px;
  margin: -1px 14px 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(238 132 47 / 7%);
}

.soft-progress[hidden] {
  display: none;
}

.soft-progress span {
  position: absolute;
  top: 5px;
  left: -35%;
  width: 34%;
  height: 2px;
  border-radius: 999px;
  background: rgb(238 132 47 / 45%);
  animation: soft-progress-slide 1.25s ease-in-out infinite;
}

.soft-progress small {
  position: absolute;
  top: 0;
  right: 8px;
  color: rgb(122 132 145 / 72%);
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
}

.quote-actions.is-running button {
  cursor: progress;
  opacity: 0.72;
}

@keyframes soft-progress-slide {
  0% {
    transform: translateX(0);
  }

  55% {
    transform: translateX(260%);
  }

  100% {
    transform: translateX(420%);
  }
}

.update-notice {
  margin: 8px 10px 0;
  padding: 8px 10px;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 700;
}

.simple-page {
  min-height: 100vh;
  padding: 28px;
  background: var(--muted-bg);
}

.share-result-card {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.share-result-card h1 {
  margin: 0 0 8px;
  font-size: 26px;
}

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

.share-result-list {
  margin: 18px 0;
  border-top: 1px solid var(--line-soft);
}

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

.share-result-list dt {
  color: var(--muted);
  font-weight: 700;
}

.share-result-list dd {
  margin: 0;
  min-width: 0;
  font-weight: 700;
}

.share-url {
  color: var(--accent);
  word-break: break-all;
}

.share-copy-field {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #1f2937;
  font: inherit;
}

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

.panel {
  margin: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.panel h1,
.panel h2 {
  margin: 0 0 8px;
}

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

.kpi-grid > div {
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #fbfcff;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.kpi-grid strong {
  font-size: 14px;
}

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

.compact-table th,
.compact-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  font-size: 12px;
}

.compact-table th {
  color: var(--muted);
  font-weight: 700;
}

.window-switch {
  display: inline-flex;
  gap: 6px;
  margin-top: 6px;
}

.window-switch a {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #425066;
  font-size: 12px;
  font-weight: 700;
  background: #f8fafc;
}

.window-switch a.active {
  border-color: #f59e0b;
  color: #c2410c;
  background: #fff7ed;
}

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

.share-result-actions a {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  text-decoration: none;
}

.workbench-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 12px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #fff;
  white-space: nowrap;
}

@media (min-width: 821px) {
  .futu-workbench {
    height: 100vh;
    min-height: 0;
  }

  .watch-sticky-head {
    position: sticky;
    top: 0;
    background: #fff;
  }

  .stock-sticky-head {
    position: sticky;
    top: 0;
    background: #fff;
  }

  .watch-sticky-head {
    z-index: 7;
    border-bottom: 1px solid var(--line);
    background: #fbfcff;
  }

  .stock-sticky-head {
    z-index: 8;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 8px rgb(31 41 55 / 5%);
  }

  .watch-sticky-head .filter-tabs,
  .stock-sticky-head .workbench-tabs {
    border-bottom: 0;
  }

  .stock-sticky-head .workbench-tabs {
    flex-wrap: wrap;
    min-height: 46px;
    padding-bottom: 6px;
    overflow-x: visible;
  }
}

.workbench-tabs button {
  position: relative;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: #f9fafc;
  color: #495360;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.workbench-tabs button:hover,
.workbench-tabs button.active {
  color: var(--accent);
  background: #fff;
}

.workbench-tabs button.active::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  content: "";
}

.tab-panels {
  min-width: 0;
}

.tab-panel[hidden] {
  display: none;
}

.report-stage,
.chart-stage {
  margin: 10px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  overflow: hidden;
}

.stage-head {
  min-height: 58px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.pipeline span {
  padding: 4px 7px;
  border-radius: 5px;
  background: #f1f3f6;
  color: #52606d;
  font-size: 11px;
  font-weight: 700;
}

.data-source {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.quote-strip {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px 0;
}

.quote-strip strong {
  color: var(--red);
  font-size: 25px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.quote-strip span {
  font-weight: 800;
}

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

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

.quote-strip small {
  color: var(--muted);
  font-weight: 700;
}

.quote-target {
  margin-left: auto;
  color: #5e6c7b;
  font-size: 25px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.chart-canvas {
  min-height: 290px;
  margin: 0 12px;
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
}

.chart-canvas svg {
  display: block;
  width: 100%;
  min-width: 640px;
  height: auto;
}

.chart-canvas text {
  fill: #697581;
  font-size: 11px;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 5px 10px 9px;
}

.quote-grid div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
  padding: 4px 7px;
  border-bottom: 1px solid var(--line-soft);
}

.quote-grid span {
  color: var(--muted);
}

.quote-grid strong {
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.company-profile {
  padding: 0;
}

.profile-block {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.profile-block:last-child {
  border-bottom: 0;
}

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

.profile-block-head h3 {
  margin: 0;
  color: #111827;
  font-size: 15px;
  line-height: 1.2;
}

.profile-block-head span {
  color: #8d96a3;
  font-size: 18px;
  line-height: 1;
}

.profile-text {
  margin: 0;
  color: #1f2933;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.profile-overview .profile-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.profile-meta-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.profile-meta-list div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.profile-meta-list dt {
  color: var(--muted);
  font-size: 12px;
}

.profile-meta-list dd {
  margin: 0;
  color: #111827;
  font-size: 12px;
  line-height: 1.45;
}

.report-preview {
  max-height: 560px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  color: #1f2933;
  background: #fcfdff;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.empty-state,
.empty {
  color: var(--muted);
}

.empty-state {
  padding: 26px 18px;
}

.empty-state strong {
  color: #344050;
}

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

.research-card,
.intel-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.research-card {
  margin: 10px;
  padding: 12px;
}

.report-stage .research-card {
  margin: 10px;
}

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

.research-card h2,
.intel-card h2,
.report-stage h2 {
  font-size: 15px;
  line-height: 1.2;
}

.research-card p {
  margin: 8px 0 0;
  color: #3a4450;
  line-height: 1.55;
}

.section-excerpt {
  margin: 8px 0 0;
  overflow: visible;
  color: #2f3945;
  font: inherit;
  line-height: 1.52;
  white-space: pre-wrap;
}

.daily-target-title {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.daily-target-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.daily-target-strip > div {
  min-width: 0;
  padding: 8px 10px;
  background: #fff;
}

.daily-target-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.daily-target-strip strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-target-strip .daily-action {
  color: var(--red);
}

.daily-conclusion {
  color: var(--red);
  font-weight: 900;
}

.daily-conclusion .decision-alert {
  color: inherit;
  font-weight: inherit;
}

.decision-alert {
  color: var(--red);
  font-weight: 800;
}

.decision-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  margin: 8px 0 10px;
  padding: 10px 12px;
  border: 1px solid #f1c9a8;
  border-radius: 6px;
  background: #fff8f1;
}

.decision-hero span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.decision-hero strong {
  color: var(--accent);
  font-size: 24px;
  line-height: 1;
}

.decision-hero em {
  color: #637083;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.table-scroll {
  overflow-x: auto;
}

.research-card ul,
.intel-card ul {
  margin: 8px 0 0;
  padding-left: 16px;
  color: #3c4652;
  line-height: 1.52;
}

.intel-card {
  margin: 9px;
  padding: 11px;
}

.intel-card p:not(.eyebrow) {
  color: #4e5a66;
  line-height: 1.48;
}

.image-upload {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.image-upload input {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.image-upload button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.image-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.image-grid figure {
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.image-grid img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  background: #f8fafc;
}

.image-grid figcaption {
  padding: 8px 10px;
  color: #4c5865;
  font-size: 12px;
  font-weight: 700;
}

.metrics-list {
  margin: 8px 0 0;
}

.metrics-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}

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

.metrics-list dt {
  color: var(--muted);
}

.metrics-list dd {
  margin: 0;
  font-weight: 700;
}

.text-action {
  display: inline-flex;
  margin-top: 8px;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
}

.run-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.run-list div {
  display: grid;
  gap: 5px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

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

.run-list time {
  color: #384250;
  font-weight: 700;
}

.run-list small {
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.page-head,
.metrics,
.table-panel {
  max-width: 1320px;
  margin: 10px auto;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: none;
}

.page-head h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
}

.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.page-head .eyebrow {
  margin: 0 0 3px;
}

.page-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

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

.metrics div,
.table-panel {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.form-panel {
  max-width: 1320px;
  margin: 0 auto 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.form-panel h2,
.table-panel h2 {
  margin: 0 0 9px;
  font-size: 15px;
  line-height: 1.2;
}

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

.entry-form label {
  display: grid;
  gap: 5px;
  color: #384250;
  font-weight: 700;
  font-size: 12px;
}

.entry-form input,
.entry-form select,
.entry-form textarea {
  width: 100%;
  min-height: 31px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: #fff;
}

.entry-form input:focus,
.entry-form select:focus,
.entry-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(245 130 32 / 12%);
  outline: none;
}

.field-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.entry-form textarea {
  min-height: 90px;
  resize: vertical;
}

.entry-form button,
.compact-action {
  min-height: 31px;
  align-self: end;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.wide-field {
  grid-column: span 2;
}

.compact-action {
  width: 100%;
  margin-top: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

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

th,
td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

th {
  color: var(--muted);
  background: #fbfcff;
  font-size: 11px;
  font-weight: 800;
}

td {
  color: #252b33;
  font-size: 12px;
}

tbody tr:hover {
  background: #f8fafc;
}

th:nth-child(n+3),
td:nth-child(n+3) {
  text-align: right;
}

td:last-child,
th:last-child {
  text-align: left;
}

@media (max-width: 1180px) {
  .market-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .intel-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 820px) {
  .stock-sticky-head,
  .watch-sticky-head {
    position: static;
    box-shadow: none;
  }

  .app-frame {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    width: 100%;
    height: 48px;
    flex-direction: row;
    justify-content: center;
    border-right: 0;
    border-bottom: 1px solid #cfd6e0;
  }

  .workspace {
    padding: 8px;
  }

  .market-layout {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .watch-panel,
  .stock-main {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .quote-head,
  .stage-head,
  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-actions {
    flex-direction: column;
  }

  .quote-head form {
    flex-basis: auto;
  }

  .research-grid,
  .intel-panel,
  .metrics,
  .quote-grid,
  .profile-meta-list div,
  .entry-form {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: auto;
  }

  .watch-row {
    grid-template-columns: minmax(0, 1fr) 56px 56px 80px;
  }
}
