:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  background: #f4f6f8;
  color: #18212f;
}

* {
  box-sizing: border-box;
}

body {
  background:
    linear-gradient(180deg, #eef3f6 0, #f7f8fa 280px),
    #f7f8fa;
  margin: 0;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #d8e0e8;
  display: flex;
  justify-content: space-between;
  min-height: 60px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand,
a {
  color: #125475;
  font-weight: 750;
  text-decoration: none;
}

.brand {
  color: #17212f;
}

nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}

nav a {
  color: #516070;
  font-size: 15px;
}

.nav-form {
  margin: 0;
}

.nav-form button {
  background: transparent;
  border: 0;
  color: #516070;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  padding: 0;
}

main {
  margin: 0 auto;
  max-width: 1180px;
  padding: 34px 20px 72px;
}

.page-head,
.detail-head {
  align-items: end;
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr auto;
  margin-bottom: 22px;
}

.page-title p,
.detail-title p {
  color: #516070;
  font-size: 19px;
  line-height: 1.65;
  margin: 0;
  max-width: 760px;
}

.eyebrow {
  color: #647282;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1 {
  color: #111a26;
  font-size: 50px;
  line-height: 1.04;
  margin: 0 0 14px;
}

h2 {
  color: #17212f;
  font-size: 21px;
  line-height: 1.25;
  margin: 0;
}

.page-meta {
  background: #ffffff;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  min-width: 190px;
  padding: 16px 18px;
}

.page-meta span,
.summary-label,
small {
  color: #647282;
  display: block;
  font-size: 14px;
}

.page-meta strong {
  color: #17212f;
  display: block;
  font-size: 18px;
  margin-top: 6px;
}

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

.summary-card {
  background: #ffffff;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  min-height: 132px;
  padding: 18px;
}

.summary-card.primary {
  border-top: 4px solid #125475;
}

.summary-card.danger {
  border-top: 4px solid #b42318;
}

.summary-card strong {
  color: #111a26;
  display: block;
  font-size: 36px;
  line-height: 1;
  margin: 14px 0 8px;
}

.lookup-panel {
  align-items: end;
  background: #ffffff;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1.5fr;
  margin-bottom: 16px;
  padding: 20px;
}

.lookup-panel p {
  color: #516070;
  line-height: 1.6;
  margin: 8px 0 0;
}

.lookup-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 130px 1fr 120px;
}

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

.lookup-form label span {
  color: #647282;
  font-size: 14px;
  font-weight: 800;
}

.lookup-form input,
.lookup-form select {
  background: #f8fafb;
  border: 1px solid #c9d5df;
  border-radius: 6px;
  color: #17212f;
  font: inherit;
  min-height: 42px;
  padding: 0 12px;
  width: 100%;
}

.lookup-form button {
  background: #125475;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 850;
  min-height: 42px;
  padding: 0 14px;
}

.lookup-form button:hover {
  background: #0d405d;
}

.auth-shell {
  align-items: start;
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr 420px;
  margin-top: 36px;
}

.auth-copy p {
  color: #516070;
  font-size: 19px;
  line-height: 1.65;
  margin: 0;
  max-width: 620px;
}

.auth-card {
  background: #ffffff;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  display: grid;
  gap: 16px;
  padding: 22px;
}

.auth-card label {
  display: grid;
  gap: 8px;
}

.auth-card label span {
  color: #647282;
  font-size: 14px;
  font-weight: 800;
}

.auth-card input,
.admin-user-form select {
  background: #f8fafb;
  border: 1px solid #c9d5df;
  border-radius: 6px;
  color: #17212f;
  font: inherit;
  min-height: 42px;
  padding: 0 12px;
  width: 100%;
}

.auth-card button,
.admin-user-form button {
  background: #125475;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 850;
  min-height: 42px;
  padding: 0 14px;
}

.auth-switch {
  color: #516070;
  margin: 0;
}

.form-alert {
  background: #fff4ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  color: #9a3412;
  font-size: 15px;
  padding: 12px;
}

.admin-user-form {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 100px 110px 130px 100px 140px 100px 80px;
}

.inline-check {
  align-items: center;
  color: #516070;
  display: inline-flex;
  font-size: 14px;
  gap: 6px;
}

.inline-check input {
  accent-color: #125475;
}

.rule-list {
  display: grid;
  gap: 14px;
}

.rule-list div {
  background: #f8fafb;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  padding: 14px 16px;
}

.rule-list h3 {
  color: #17212f;
  font-size: 16px;
  margin: 0 0 8px;
}

.rule-list p {
  margin: 0;
}

.pipeline-strip {
  background: #17212f;
  border-radius: 8px;
  color: #ffffff;
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 22px;
  overflow: hidden;
}

.pipeline-strip div {
  background: #1d2938;
  min-height: 92px;
  padding: 18px;
}

.pipeline-strip strong,
.pipeline-strip small {
  display: block;
}

.pipeline-strip small {
  color: #b8c3ce;
  margin-top: 6px;
}

.step-index {
  align-items: center;
  background: #d9a441;
  border-radius: 50%;
  color: #17212f;
  display: inline-flex;
  font-size: 14px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  margin-bottom: 10px;
  width: 24px;
}

.report-panel {
  background: #ffffff;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  overflow: hidden;
}

.section-head {
  align-items: center;
  border-bottom: 1px solid #d8e0e8;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px 20px;
}

.section-head .eyebrow,
.section-head h2,
.section-head p {
  margin: 0;
}

.section-head p {
  color: #647282;
  font-size: 15px;
}

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

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

th,
td {
  border-bottom: 1px solid #edf1f5;
  padding: 15px 20px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: #f8fafb;
  color: #647282;
  font-size: 13px;
  font-weight: 800;
}

tbody tr:hover {
  background: #f8fafb;
}

td small {
  margin-top: 4px;
}

.ticker-link {
  color: #17212f;
  display: block;
  font-size: 18px;
}

.tag,
.pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 14px;
  font-weight: 850;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
}

.signal-buy {
  background: #e5f6ed;
  color: #14723d;
}

.signal-watch {
  background: #e7f2fb;
  color: #125475;
}

.signal-hold {
  background: #f2f4f7;
  color: #475467;
}

.signal-reduce,
.signal-sell {
  background: #ffe9e7;
  color: #b42318;
}

.risk-low {
  background: #e5f6ed;
  color: #14723d;
}

.risk-medium {
  background: #fff2d5;
  color: #8a5a00;
}

.risk-high {
  background: #ffe9e7;
  color: #b42318;
}

.score {
  background: #e7edf2;
  border-radius: 999px;
  display: inline-flex;
  height: 7px;
  margin-right: 10px;
  overflow: hidden;
  vertical-align: middle;
  width: 82px;
}

.score span {
  background: linear-gradient(90deg, #d9a441, #125475);
  display: block;
}

.row-action {
  border: 1px solid #c9d5df;
  border-radius: 6px;
  color: #125475;
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  min-height: 32px;
  padding: 7px 10px;
}

.row-action:hover {
  background: #e7f2fb;
}

.primary-action {
  background: #125475;
  border-color: #125475;
  color: #ffffff;
}

.primary-action:hover {
  background: #0d405d;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.back {
  color: #516070;
  display: inline-block;
  font-size: 15px;
  margin-bottom: 16px;
}

.decision-grid {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: 300px 1fr;
}

.decision-panel,
.content-section {
  background: #ffffff;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
}

.decision-panel {
  padding: 22px;
  position: sticky;
  top: 82px;
}

.decision-score {
  color: #111a26;
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  margin: 18px 0 14px;
}

.decision-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

dl {
  display: grid;
  gap: 14px;
  margin: 0;
}

dt {
  color: #647282;
  font-size: 14px;
  font-weight: 700;
}

dd {
  color: #17212f;
  font-weight: 800;
  margin: 4px 0 0;
}

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

.content-section {
  padding: 22px;
}

.content-section h2 {
  margin-bottom: 14px;
}

.content-section p,
.content-section li {
  color: #344054;
  line-height: 1.7;
}

.content-section p {
  margin: 0 0 10px;
}

.action-first {
  border-left: 4px solid #125475;
}

.action-list,
.content-section ul {
  margin: 0;
  padding-left: 20px;
}

.action-list li + li,
.content-section li + li {
  margin-top: 8px;
}

.source-list a {
  color: #125475;
  font-weight: 800;
  text-decoration: none;
}

.source-list span {
  color: #647282;
  display: block;
  font-size: 13px;
  margin-top: 2px;
}

.agent-grid,
.two-col {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, 1fr);
}

.agent-grid div {
  background: #f8fafb;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  padding: 14px;
}

.agent-grid span {
  color: #647282;
  display: block;
  font-size: 14px;
}

.agent-grid strong {
  display: block;
  margin-top: 6px;
}

.status-panel {
  margin-top: 18px;
}

.status-list {
  display: grid;
}

.status-list a {
  border-bottom: 1px solid #edf1f5;
  display: grid;
  gap: 5px;
  padding: 18px 20px;
}

.status-list a:last-child {
  border-bottom: 0;
}

.status-list strong {
  color: #17212f;
}

.status-list span {
  color: #516070;
  font-size: 16px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  h1 {
    font-size: 40px;
  }

  .page-head,
  .detail-head,
  .decision-grid {
    grid-template-columns: 1fr;
  }

  .summary-band,
  .pipeline-strip,
  .lookup-panel,
  .lookup-form,
  .agent-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .decision-panel {
    position: static;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
