.newton-main {
  min-width: 0;
  padding: 12px 0 80px;
}

.newton-hero {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.62fr);
  align-items: center;
  padding-top: 48px;
}

.newton-owner {
  margin: 0 0 12px !important;
  color: var(--tape-blue) !important;
  font: 700 var(--type-meta)/1.3 "Ubuntu Mono", "Nimbus Mono PS", monospace !important;
  letter-spacing: 0.04em;
}

.newton-hero h1 { max-width: 760px; }

.newton-scope {
  max-width: 720px;
  margin-top: 16px !important;
  color: var(--signal-tertiary) !important;
  font-weight: 400 !important;
  line-height: 1.55 !important;
  text-wrap: pretty;
}

.newton-evidence-link,
.newton-command-node a,
.newton-source-cell a,
.newton-item-source a,
.newton-threshold-history a,
.newton-evidence-group a {
  min-height: 44px;
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  color: var(--tape-blue);
  font-size: var(--type-body);
  text-decoration: none;
  transition: color 150ms ease-out;
}

.newton-evidence-link:hover,
.newton-command-node a:hover,
.newton-source-cell a:hover,
.newton-item-source a:hover,
.newton-threshold-history a:hover,
.newton-evidence-group a:hover { color: var(--profit); }

.newton-evidence-link:active,
.newton-command-node a:active,
.newton-source-cell a:active,
.newton-item-source a:active,
.newton-threshold-history a:active,
.newton-evidence-group a:active { transform: scale(0.97); }

.newton-hero-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  width: min(100%, 384px);
}

.newton-hero-meta .identity-status { min-height: 64px; }
.newton-hero-meta .state-attack { border-left: 2px solid var(--profit); }
.newton-hero-meta .state-defense { border-left: 2px solid var(--risk); }
.newton-hero-meta .state-range,
.newton-hero-meta .state-caution,
.newton-hero-meta .state-stale,
.newton-hero-meta .state-waiting { border-left: 2px solid var(--caution); }

.newton-warnings {
  margin-top: 24px;
  border: 1px solid var(--wire);
  border-left: 2px solid var(--caution);
  border-radius: var(--radius-control);
  background: var(--terminal-raised);
  padding: 12px 16px;
}

.newton-warnings p {
  margin: 0;
  color: var(--signal-secondary);
  font-size: var(--type-body);
}

.newton-warnings p + p { margin-top: 4px; }

.newton-command,
.newton-section {
  min-width: 0;
  margin-top: 64px;
}

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

.newton-section-heading h2 {
  margin: 5px 0 0;
  color: var(--signal-ink);
  font-size: var(--type-key);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.newton-section-heading > p {
  max-width: 540px;
  margin: 0;
  color: var(--signal-tertiary);
  font-size: var(--type-body);
  line-height: 1.55;
  text-align: right;
  text-wrap: pretty;
}

.newton-command-chain {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--wire);
  border-bottom: 1px solid var(--wire);
}

.newton-command-node {
  position: relative;
  min-width: 0;
  min-height: 188px;
  padding: 20px 32px 16px 20px;
}

.newton-command-node + .newton-command-node { border-left: 1px solid var(--wire-soft); }

.newton-command-node:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 20px;
  right: 10px;
  color: var(--signal-muted);
  font: 700 var(--type-body)/1 "Ubuntu Mono", "Nimbus Mono PS", monospace;
}

.newton-command-node > span {
  color: var(--signal-muted);
  font: 700 var(--type-meta)/1.3 "Ubuntu Mono", "Nimbus Mono PS", monospace;
}

.newton-command-node > strong {
  display: block;
  margin-top: 12px;
  color: var(--signal-ink);
  font-size: var(--type-key);
  font-weight: 700;
  line-height: 1.25;
  text-wrap: balance;
}

.newton-command-node > p {
  margin: 8px 0 0;
  color: var(--signal-tertiary);
  font-size: var(--type-body);
  line-height: 1.5;
  text-wrap: pretty;
}

.newton-command-node.state-active > strong,
.newton-command-node.state-bullish > strong,
.newton-command-node.state-improving > strong,
.newton-command-node.state-executed > strong { color: var(--profit); }

.newton-command-node.state-risk > strong,
.newton-command-node.state-bearish > strong { color: var(--risk); }

.newton-command-node.state-waiting > strong,
.newton-command-node.state-rotation > strong { color: var(--caution); }

.newton-threshold-book,
.newton-operation-book {
  overflow: hidden;
  border: 1px solid var(--wire);
  border-radius: var(--radius-panel);
  background: var(--terminal-raised);
}

.newton-threshold-book table,
.newton-operation-book table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.newton-threshold-book th,
.newton-operation-book th {
  background: var(--tape-inset);
  color: var(--signal-muted);
  padding: 12px;
  font: 700 var(--type-meta)/1.3 "Ubuntu Mono", "Nimbus Mono PS", monospace;
  text-align: left;
}

.newton-threshold-book td,
.newton-operation-book td {
  min-width: 0;
  border-top: 1px solid var(--wire-soft);
  color: var(--signal-secondary);
  padding: 12px;
  font-size: var(--type-body);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.newton-threshold-book th:nth-child(1) { width: 8%; }
.newton-threshold-book th:nth-child(2) { width: 18%; }
.newton-threshold-book th:nth-child(3) { width: 15%; }
.newton-threshold-book th:nth-child(4) { width: 14%; }
.newton-threshold-book th:nth-child(5) { width: 24%; }
.newton-threshold-book th:nth-child(6) { width: 21%; }

.newton-operation-book th:nth-child(1) { width: 9%; }
.newton-operation-book th:nth-child(2) { width: 12%; }
.newton-operation-book th:nth-child(3) { width: 11%; }
.newton-operation-book th:nth-child(4) { width: 13%; }
.newton-operation-book th:nth-child(5) { width: 21%; }
.newton-operation-book th:nth-child(6) { width: 16%; }
.newton-operation-book th:nth-child(7) { width: 18%; }

.newton-threshold-book tr.state-active { box-shadow: inset 2px 0 0 var(--tape-blue); }
.newton-threshold-book tr.state-missing { box-shadow: inset 2px 0 0 var(--caution); }
.newton-operation-book tr.state-unconfirmed,
.newton-operation-book tr.state-uncertain { box-shadow: inset 2px 0 0 var(--caution); }
.newton-operation-book tr.state-closed { box-shadow: inset 2px 0 0 var(--risk); }
.newton-operation-book tr.state-intraday { box-shadow: inset 2px 0 0 var(--tape-blue); }

.newton-threshold-book td > strong,
.newton-operation-book td > .tradingview-symbol-link strong {
  color: var(--signal-ink);
  font: 700 var(--type-key)/1 "Ubuntu Mono", "Nimbus Mono PS", monospace;
}

.newton-number,
.newton-source-cell time,
.newton-source-cell small,
.newton-threshold-history time,
.newton-threshold-history small,
.newton-item-source time,
.newton-material-meta time,
.newton-third-party-list time,
.newton-evidence-meta {
  font-family: "Ubuntu Mono", "Nimbus Mono PS", monospace;
  font-variant-numeric: tabular-nums;
}

.newton-source-cell time,
.newton-source-cell small {
  display: block;
  color: var(--signal-muted);
  font-size: var(--type-meta);
}

.newton-trade-action,
.newton-state {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-control);
  padding: 2px 6px;
  font: 700 var(--type-meta)/1.3 "Ubuntu Mono", "Nimbus Mono PS", monospace;
}

.newton-trade-action.action-buy,
.newton-trade-action.action-add { color: var(--profit); }
.newton-trade-action.action-reduce,
.newton-state.state-unconfirmed,
.newton-state.state-uncertain { color: var(--caution); }
.newton-trade-action.action-close,
.newton-state.state-closed { color: var(--risk); }
.newton-trade-action.action-day_trade,
.newton-state.state-intraday { color: var(--tape-blue); }

.newton-threshold-history {
  margin-top: 12px;
  border: 1px solid var(--wire);
  border-radius: var(--radius-panel);
  background: var(--terminal-raised);
}

.newton-threshold-history > summary,
.newton-evidence-group > summary {
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto 16px;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  cursor: pointer;
  list-style: none;
  transition: background-color 150ms ease-out;
}

.newton-threshold-history > summary::-webkit-details-marker,
.newton-evidence-group > summary::-webkit-details-marker { display: none; }
.newton-threshold-history > summary:hover,
.newton-evidence-group > summary:hover { background: var(--tape-surface); }
.newton-threshold-history > summary span,
.newton-evidence-group > summary strong { color: var(--signal-secondary); font-size: var(--type-body); }
.newton-threshold-history > summary small,
.newton-evidence-group > summary span { color: var(--signal-muted); font-size: var(--type-meta); }

.newton-threshold-history > summary i,
.newton-evidence-group > summary i {
  width: 8px;
  height: 8px;
  border-right: 1px solid var(--signal-muted);
  border-bottom: 1px solid var(--signal-muted);
  transform: rotate(45deg);
  transition: transform 150ms cubic-bezier(0.23, 1, 0.32, 1);
}

.newton-threshold-history[open] > summary i,
.newton-evidence-group[open] > summary i { transform: rotate(225deg); }

.newton-threshold-history > ol {
  margin: 0;
  border-top: 1px solid var(--wire-soft);
  background: var(--tape-inset);
  padding: 0 16px;
  list-style: none;
}

.newton-threshold-history li {
  min-height: 56px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 148px 148px auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--wire-soft);
  color: var(--signal-secondary);
  padding: 8px 0;
}

.newton-threshold-history li:last-child { border-bottom: 0; }
.newton-threshold-history li > strong { color: var(--signal-ink); font-family: "Ubuntu Mono", "Nimbus Mono PS", monospace; }
.newton-threshold-history li > time,
.newton-threshold-history li > small { color: var(--signal-muted); font-size: var(--type-meta); }

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

.newton-strategy {
  min-width: 0;
  border: 1px solid var(--wire);
  border-radius: var(--radius-panel);
  background: var(--terminal-raised);
  padding: 16px;
}

.newton-strategy.state-plan { border-left: 2px solid var(--tape-blue); }
.newton-strategy.state-conditional,
.newton-strategy.state-watch { border-left: 2px solid var(--caution); }

.newton-strategy-lead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.newton-strategy-lead strong {
  color: var(--signal-ink);
  font: 700 var(--type-key)/1 "Ubuntu Mono", "Nimbus Mono PS", monospace;
}

.newton-strategy-lead > span {
  color: var(--caution);
  font: 700 var(--type-meta)/1.3 "Ubuntu Mono", "Nimbus Mono PS", monospace;
}

.newton-strategy > p,
.newton-sector > p,
.newton-material-list p,
.newton-third-party-list p {
  margin: 12px 0 0;
  color: var(--signal-secondary);
  font-size: var(--type-body);
  line-height: 1.55;
  text-wrap: pretty;
}

.newton-strategy dl,
.newton-sector dl,
.newton-material-list dl {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 16px 0 0;
}

.newton-strategy dt,
.newton-sector dt,
.newton-material-list dt {
  color: var(--signal-muted);
  font-size: var(--type-meta);
  font-weight: 700;
}

.newton-strategy dd,
.newton-sector dd,
.newton-material-list dd {
  margin: 0;
  color: var(--signal-tertiary);
  font-size: var(--type-body);
  line-height: 1.5;
}

.newton-item-source {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 12px;
}

.newton-item-source time {
  color: var(--signal-muted);
  font-size: var(--type-meta);
  font-weight: 600;
}

.newton-sector-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--wire);
  border-radius: var(--radius-panel);
  background: var(--terminal-raised);
}

.newton-sector {
  min-width: 0;
  border-right: 1px solid var(--wire-soft);
  border-bottom: 1px solid var(--wire-soft);
  padding: 20px;
}

.newton-sector:nth-child(even) { border-right: 0; }
.newton-sector:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
.newton-sector:nth-last-child(2) { border-bottom: 0; }

.newton-sector > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.newton-sector h3 {
  margin: 0;
  color: var(--signal-ink);
  font-size: var(--type-body);
  font-weight: 700;
}

.newton-sector > header span {
  border-radius: var(--radius-control);
  color: var(--signal-muted);
  padding: 2px 6px;
  font: 700 var(--type-meta)/1.3 "Ubuntu Mono", "Nimbus Mono PS", monospace;
}

.newton-sector.state-bullish > header span,
.newton-sector.state-improving > header span { color: var(--profit); }
.newton-sector.state-bearish > header span { color: var(--risk); }
.newton-sector.state-rotation > header span,
.newton-sector.state-waiting > header span { color: var(--caution); }

.newton-symbols {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 12px;
}

.newton-symbols .tradingview-symbol-link {
  min-height: 36px;
  color: var(--signal-secondary);
  font: 700 var(--type-meta)/1 "Ubuntu Mono", "Nimbus Mono PS", monospace;
}

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

.newton-material-columns > section { min-width: 0; }

.newton-material-columns > section > h3 {
  margin: 0 0 12px;
  color: var(--signal-secondary);
  font-size: var(--type-body);
  font-weight: 700;
}

.newton-material-list {
  overflow: hidden;
  border-top: 1px solid var(--wire);
  border-bottom: 1px solid var(--wire);
}

.newton-material-list article {
  min-width: 0;
  border-bottom: 1px solid var(--wire-soft);
  padding: 20px 0;
}

.newton-material-list article:last-child { border-bottom: 0; }

.newton-material-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--signal-muted);
  font-size: var(--type-meta);
}

.newton-material-meta span { color: var(--tape-blue); font-weight: 700; }
.newton-material-list h4 {
  margin: 8px 0 0;
  color: var(--signal-ink);
  font-size: var(--type-body);
  font-weight: 700;
  line-height: 1.4;
}

.newton-material-empty {
  margin: 0;
  color: var(--signal-muted);
  padding: 20px 0;
  font-size: var(--type-body);
}

.newton-third-party-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.newton-third-party-list article {
  min-width: 0;
  border: 1px solid var(--wire);
  border-radius: var(--radius-panel);
  background: var(--terminal-raised);
  padding: 16px;
}

.newton-third-party-list article > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
}

.newton-third-party-list article > header span {
  color: var(--tape-blue);
  font: 700 var(--type-meta)/1.3 "Ubuntu Mono", "Nimbus Mono PS", monospace;
}

.newton-third-party-list article > header strong {
  color: var(--signal-secondary);
  font-size: var(--type-meta);
  text-align: right;
}

.newton-third-party-list article > header time {
  grid-column: 1 / -1;
  color: var(--signal-muted);
  font-size: var(--type-meta);
}

.newton-third-party-list h3 {
  margin: 12px 0 0;
  color: var(--signal-ink);
  font-size: var(--type-body);
  font-weight: 700;
  line-height: 1.4;
}

.newton-evidence-book {
  overflow: hidden;
  border: 1px solid var(--wire);
  border-radius: var(--radius-panel);
  background: var(--terminal-raised);
}

.newton-evidence-group { border-bottom: 1px solid var(--wire-soft); }
.newton-evidence-group:last-child { border-bottom: 0; }
.newton-evidence-group > ol {
  margin: 0;
  border-top: 1px solid var(--wire-soft);
  background: var(--tape-inset);
  padding: 0 16px;
  list-style: none;
}

.newton-evidence-group li {
  border-bottom: 1px solid var(--wire-soft);
  padding: 16px 0;
}

.newton-evidence-group li:last-child { border-bottom: 0; }
.newton-evidence-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--signal-muted); font-size: var(--type-meta); }
.newton-evidence-group blockquote {
  margin: 12px 0 0;
  border-left: 2px solid var(--wire);
  color: var(--signal-secondary);
  padding-left: 12px;
  font-size: var(--type-body);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.newton-question-context {
  margin: 8px 0 0;
  border-left: 2px solid var(--wire);
  color: var(--signal-muted);
  padding-left: 12px;
  font-size: var(--type-meta);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.newton-empty {
  min-height: 112px;
  display: grid;
  align-content: center;
  border: 1px solid var(--wire);
  border-radius: var(--radius-panel);
  background: var(--terminal-raised);
  padding: 20px;
}

.newton-empty.state-loading { border-left: 2px solid var(--caution); }
.newton-empty strong { color: var(--signal-secondary); font-size: var(--type-body); }
.newton-empty p { margin: 8px 0 0; color: var(--signal-muted); font-size: var(--type-body); }
.newton-strategy-list > .newton-empty,
.newton-third-party-list > .newton-empty { grid-column: 1 / -1; }

@media (max-width: 980px) {
  .newton-hero { grid-template-columns: 1fr; }
  .newton-hero-meta { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .newton-command-chain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .newton-command-node:nth-child(3) { border-left: 0; }
  .newton-command-node:nth-child(n + 3) { border-top: 1px solid var(--wire-soft); }
  .newton-third-party-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 840px) {
  .newton-threshold-book,
  .newton-operation-book { overflow: visible; border: 0; background: transparent; }

  .newton-threshold-book table,
  .newton-threshold-book tbody,
  .newton-threshold-book tr,
  .newton-threshold-book td,
  .newton-operation-book table,
  .newton-operation-book tbody,
  .newton-operation-book tr,
  .newton-operation-book td { display: block; width: 100%; }

  .newton-threshold-book thead,
  .newton-operation-book thead { display: none; }

  .newton-threshold-book tr,
  .newton-operation-book tr {
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--wire);
    border-radius: var(--radius-panel);
    background: var(--terminal-raised);
  }

  .newton-threshold-book td,
  .newton-operation-book td {
    min-height: 48px;
    display: grid;
    grid-template-columns: 164px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--wire-soft);
    padding: 10px 12px;
  }

  .newton-threshold-book td:first-child,
  .newton-operation-book td:first-child { border-top: 0; }
  .newton-threshold-book td::before,
  .newton-operation-book td::before {
    content: attr(data-label);
    color: var(--signal-muted);
    font: 700 var(--type-meta)/1.3 "Ubuntu Mono", "Nimbus Mono PS", monospace;
  }

  .newton-source-cell time,
  .newton-source-cell small { display: inline; }
  .newton-threshold-history li { grid-template-columns: 64px minmax(0, 1fr); gap: 4px 12px; padding: 12px 0; }
  .newton-threshold-history li > time,
  .newton-threshold-history li > small,
  .newton-threshold-history li > a { grid-column: 2; }
  .newton-material-columns { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 600px) {
  .newton-main { padding-top: 0; padding-bottom: 64px; }
  .newton-hero { padding-top: 32px; }
  .newton-hero h1 { font-size: var(--type-display); line-height: 1.18; }
  .newton-hero-meta { grid-template-columns: 1fr; }
  .newton-command,
  .newton-section { margin-top: 48px; }
  .newton-section-heading { display: block; margin-bottom: 16px; }
  .newton-section-heading > p { margin-top: 12px; text-align: left; }
  .newton-command-chain { grid-template-columns: 1fr; }
  .newton-command-node {
    min-height: auto;
    border-left: 0 !important;
    border-top: 1px solid var(--wire-soft);
    padding: 16px 32px 16px 0;
  }
  .newton-command-node:first-child { border-top: 0; }
  .newton-command-node:not(:last-child)::after { content: "↓"; }
  .newton-threshold-book td,
  .newton-operation-book td { grid-template-columns: 1fr; gap: 4px; }
  .newton-threshold-history > summary,
  .newton-evidence-group > summary { grid-template-columns: minmax(0, 1fr) 16px; gap: 4px 12px; }
  .newton-threshold-history > summary small,
  .newton-evidence-group > summary span { grid-column: 1; }
  .newton-threshold-history > summary i,
  .newton-evidence-group > summary i { grid-column: 2; grid-row: 1 / span 2; }
  .newton-threshold-history li { grid-template-columns: 1fr; }
  .newton-threshold-history li > time,
  .newton-threshold-history li > small,
  .newton-threshold-history li > a { grid-column: 1; }
  .newton-strategy-list,
  .newton-sector-map,
  .newton-third-party-list { grid-template-columns: 1fr; }
  .newton-sector { border-right: 0; border-bottom: 1px solid var(--wire-soft) !important; }
  .newton-sector:last-child { grid-column: 1; border-bottom: 0 !important; }
  .newton-material-meta { display: grid; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .newton-evidence-link,
  .newton-command-node a,
  .newton-source-cell a,
  .newton-item-source a,
  .newton-threshold-history a,
  .newton-evidence-group a,
  .newton-threshold-history > summary,
  .newton-evidence-group > summary,
  .newton-threshold-history > summary i,
  .newton-evidence-group > summary i { transition-duration: 0.01ms; }
}
