/* Viewport shell: the game never grows with its lists or charts. */
:root {
  color-scheme: dark;
  --bg: #101923;
  --panel: #17232f;
  --panel-soft: #1c2a38;
  --line: #2e4050;
  --text: #eff4f8;
  --muted: #a6b8c8;
  --green: #8be4b0;
  --red: #ff98a1;
  --amber: #f5ca81;
  --accent: #b6d6ff;
  --row-height: 32px;
  --dialog-padding: 24px;
  font-family: Inter, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body {
  background:
    radial-gradient(ellipse at 85% 0%, #233646 0, transparent 45%), var(--bg);
  color: var(--text);
  line-height: 1.35;
  font-size: 13px;
}
button,
input,
select {
  font: inherit;
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
button:hover:enabled {
  filter: brightness(1.15);
}
[hidden],
.hidden {
  display: none !important;
}
h1,
h2,
h3,
p,
figure {
  margin: 0;
}
h1 {
  font-size: 21px;
  letter-spacing: -0.06em;
  line-height: 1.1;
}
h1 span {
  color: var(--green);
}
h2 {
  font-size: 15px;
  letter-spacing: -0.025em;
}
strong,
.quote,
.clock,
td:not(:first-child) {
  font-variant-numeric: tabular-nums;
}
.app-shell {
  height: 100dvh;
  width: 100%;
  padding: 12px;
  display: grid;
  grid-template-rows: auto 55px 64px 42px minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
}
.topbar,
.header-actions,
.brand,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.brand {
  justify-content: flex-start;
}
.brand-icon {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: var(--bg);
  height: 32px;
  width: 32px;
  font-size: 25px;
  font-weight: 800;
}
.eyebrow,
.label {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}
.eyebrow {
  margin-bottom: 2px;
}
.button {
  padding: 6px 12px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 650;
}
.header-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}
.control-icon,
.tutorial-short-label {
  display: none;
}
.install-button {
  border-color: var(--green);
  color: var(--green);
}
.primary,
.buy {
  background: var(--green);
  color: #10251a;
  border-color: var(--green);
}
.quiet {
  background: transparent;
}
.sell {
  background: #412c37;
  color: #ffc1c6;
  border-color: #744752;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  min-width: 0;
  min-height: 0;
}
.run-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 12px 9px;
  overflow: hidden;
}
.run-bar > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 12px;
  min-width: 0;
}
.run-bar h2 {
  font-size: 15px;
}
.run-bar #objective {
  grid-column: 1/-1;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.run-bar #runScore {
  display: none;
}
.run-bar .eyebrow {
  margin: 0;
}
.clock {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
}
.clock > span:first-child {
  font-size: 28px;
  letter-spacing: -0.04em;
  font-weight: 750;
}
.clock > span:last-child {
  font-size: 10px;
  color: var(--muted);
}
.clock.urgent {
  color: var(--amber);
}
progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  border: 0;
  background: var(--line);
  color: var(--green);
}
progress::-webkit-progress-bar {
  background: var(--line);
}
progress::-webkit-progress-value {
  background: var(--green);
}
progress::-moz-progress-bar {
  background: var(--green);
}
.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-width: 0;
}
.stat-box {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  padding: 6px 12px;
  gap: 1px;
  min-width: 0;
}
.stat-box > strong {
  font-size: 20px;
  letter-spacing: -0.04em;
}
.sub-value {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.up {
  color: var(--green) !important;
}
.down {
  color: var(--red) !important;
}
.event-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: #292a25;
  border: 1px solid #59503c;
  border-radius: 7px;
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
}
.event-marker {
  color: var(--amber);
}
.event-banner p {
  flex: 1;
  min-width: 0;
}
.event-banner > span:last-child {
  font-size: 10px;
  color: var(--amber);
  white-space: nowrap;
}
.view-tabs {
  display: none;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr) minmax(0, 1.05fr);
  grid-template-rows: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  min-width: 0;
}
.market-panel {
  grid-column: 1;
  grid-row: 1/3;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trade-panel {
  grid-column: 2;
  grid-row: 1/3;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.holdings-panel {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.news-panel {
  grid-column: 3;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.panel-header {
  flex-shrink: 0;
  min-height: 25px;
}
.badge {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.market-toolbar {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.field {
  flex: 1;
  min-width: 0;
}
.field label,
.quantity-heading label {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 3px;
}
input,
select {
  width: 100%;
  height: 32px;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #111d28;
  color: var(--text);
}
.table-wrap {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 12px;
  white-space: nowrap;
  table-layout: fixed;
}
th {
  height: 26px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  font-weight: 600;
}
th,
td {
  padding: 0 5px;
  border-bottom: 1px solid var(--line);
}
td {
  height: var(--row-height);
}
th:first-child,
td:first-child {
  text-align: left;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.market-table th:first-child {
  width: 40%;
}
.market-table th:last-child {
  width: 13%;
}
.market-table th:nth-child(2) {
  width: 25%;
}
.market-table th:nth-child(3) {
  width: 22%;
}
.stock-select {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: none;
  color: var(--text);
  border: 0;
  height: 28px;
  width: 100%;
  padding: 1px 3px;
  text-align: left;
  border-radius: 4px;
  justify-content: center;
  overflow: hidden;
}
.stock-select strong {
  font-size: 12px;
  line-height: 1.15;
  flex-shrink: 0;
}
.stock-select small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.15;
  flex-shrink: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-table tr.selected {
  background: #223748;
}
.market-table tbody tr {
  cursor: pointer;
}
.market-table tbody tr:focus-within {
  box-shadow: inset 0 0 0 2px var(--amber);
}
.market-table tr.selected .stock-select strong {
  color: var(--accent);
}
.market-table tbody tr:hover {
  background: #21313f;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  min-height: 28px;
  border-top: 1px solid var(--line);
  padding-top: 4px;
  color: var(--muted);
  font-size: 10px;
}
.pager button {
  height: 26px;
  min-width: 32px;
  padding: 2px 7px;
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.quote {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
}
.quote > strong {
  font-size: 28px;
  letter-spacing: -0.05em;
}
.quote > span {
  font-size: 11px;
}
.muted {
  color: var(--muted);
  font-size: 11px;
}
.profile {
  font-size: 11px;
  line-height: 1.35;
  flex-shrink: 0;
}
.chart-figure {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.chart-figure svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
}
.chart-figure figcaption {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 9px;
  color: var(--muted);
  flex-shrink: 0;
}
.position-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  background: #111d28;
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 10px;
  flex-shrink: 0;
}
.position-summary span:nth-child(2) {
  color: var(--muted);
}
.position-summary strong {
  margin-left: auto;
}
#orderForm {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 8px;
}
.quantity-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  grid-column: 1/-1;
}
.quantity-heading label {
  margin: 0;
}
.quantity-heading .muted {
  font-size: 10px;
}
#quantity {
  grid-column: 1;
}
.presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  grid-column: 1/-1;
}
.presets button {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-soft);
  color: var(--muted);
  height: 30px;
  padding: 3px 2px;
  font-size: 10px;
}
.order-total {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  font-size: 11px;
}
.order-total span {
  font-size: 9px;
  color: var(--muted);
}
.trade-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  grid-column: 1/-1;
}
.trade-actions .button {
  min-height: 34px;
}
.order-hint {
  grid-column: 1/-1;
  color: var(--muted);
  font-size: 10px;
  min-height: 27px;
  line-height: 1.3;
}
.feedback {
  font-size: 10px;
  min-height: 26px;
  flex-shrink: 0;
  line-height: 1.3;
}
.portfolio-figure {
  flex: 0 1 65px;
  min-height: 32px;
}
.holdings-panel table {
  font-size: 10px;
}
.holdings-panel th {
  font-size: 8px;
}
.holdings-panel th:first-child {
  width: 16%;
}
.holdings-panel th:nth-child(2) {
  width: 13%;
}
.holdings-panel th:nth-child(3) {
  width: 24%;
}
.holdings-panel th:nth-child(4) {
  width: 28%;
}
.holdings-panel th:last-child {
  width: 19%;
}
.holdings-panel .stock-select {
  font-size: 10px;
}
.empty-state {
  color: var(--muted);
  font-size: 11px;
}
.exit-button {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 4px;
  color: var(--red);
  height: 26px;
  padding: 2px 6px;
  font-size: 10px;
}
.live-dot {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: var(--amber);
}
.news-intro {
  font-size: 10px;
  color: var(--muted);
}
.news-list,
.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.news-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.news-list li {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.news-meta {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  font-size: 9px;
  color: var(--muted);
}
.news-list h3 {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.news-list p {
  color: var(--muted);
  font-size: 10px;
}
.news-list li.expired {
  opacity: 0.7;
}
/* History and instructions are deliberate overlays, outside the playing field. */
dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: min(560px, calc(100% - 24px));
  max-height: 90dvh;
  padding: 0;
  box-shadow: 0 25px 100px #0008;
}
dialog::backdrop {
  background: #060e19dd;
}
.dialog-content {
  padding: var(--dialog-padding);
  min-width: 0;
  overflow-wrap: anywhere;
}
.dialog-content > :last-child {
  margin-bottom: 0;
}
.dialog-content h2 {
  font-size: 24px;
  margin-bottom: 12px;
}
.classroom-link { color: var(--green); font-weight: 700; }
.dialog-content p {
  margin-bottom: 12px;
  font-size: 13px;
}
.instructions {
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
}
.instructions li {
  margin: 10px 0;
}
.instructions strong {
  color: var(--text);
}
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.result-total {
  font-size: 36px;
  font-weight: 750;
  letter-spacing: -0.05em;
}
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}
.result-grid > div {
  background: var(--bg);
  padding: 10px;
  border-radius: 6px;
}
.result-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.result-grid strong {
  font-size: 13px;
}
.activity-list li {
  padding: 8px 0;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  font-size: 11px;
}
.activity-list time {
  color: var(--muted);
}
.activity-list span:last-child {
  margin-left: auto;
  color: var(--muted);
}
#closeActivity {
  margin-top: 16px;
}
.settings-presets {
  margin: 12px 0;
}
.settings-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.settings-mode-grid:has(#difficultySettings[hidden]) {
  grid-template-columns: 1fr;
}
#settingsForm .muted {
  font-size: 11px;
}
.round-results {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}
.round-results li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
#settingsForm label {
  display: block;
  margin-bottom: 8px;
}
#durationHelp {
  margin-top: 6px;
}
#cashHelp {
  margin-top: 6px;
}
dialog .pager {
  margin-block: 12px;
}
@media (max-width: 600px) {
  :root {
    --dialog-padding: 18px;
  }
  .topbar {
    gap: 4px;
  }
  .header-actions .button {
    padding-left: 5px;
    padding-right: 5px;
  }
  .brand h1 {
    font-size: 14px;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  clip-path: inset(50%);
  background: var(--green);
  color: var(--bg);
  padding: 10px;
  z-index: 10;
}
.skip-link:focus {
  clip-path: none;
}
/* Small windows get full-size panels with instant navigation, never a long page. */
@media (max-width: 1099px) {
  .app-shell {
    grid-template-rows: auto 50px 60px 42px 34px minmax(0, 1fr);
    padding: 8px;
    gap: 6px;
  }
  .view-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }
  .view-tabs button {
    background: var(--panel);
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 5px;
    font-weight: 650;
    font-size: 12px;
  }
  .view-tabs button[aria-pressed="true"] {
    background: #294458;
    color: var(--text);
    border-color: #668fae;
  }
  .layout {
    display: block;
    position: relative;
  }
  .layout > [data-panel] {
    height: 100%;
    width: 100%;
    display: none;
  }
  .layout[data-view="market"] > [data-panel="market"],
  .layout[data-view="trade"] > [data-panel="trade"],
  .layout[data-view="holdings"] > [data-panel="holdings"],
  .layout[data-view="news"] > [data-panel="news"] {
    display: flex;
  }
  .trade-panel {
    max-width: 760px;
    margin: auto;
  }
  .profile {
    font-size: 12px;
  }
  .news-list h3 {
    font-size: 18px;
  }
  .news-meta,
  .news-list p {
    font-size: 12px;
  }
  .news-intro {
    font-size: 12px;
  }
  .portfolio-figure {
    flex-basis: 100px;
  }
  .holdings-panel table {
    font-size: 12px;
  }
  .holdings-panel th,
  .holdings-panel .stock-select {
    font-size: 11px;
  }
}
@media (max-width: 600px) {
  :root {
    --row-height: 38px;
  }
  .app-shell {
    grid-template-rows: auto 45px 66px 57px 34px minmax(0, 1fr);
    gap: 5px;
    padding: 6px;
  }
  h1 {
    font-size: 17px;
  }
  .brand-icon,
  .brand .eyebrow {
    display: none;
  }
  .header-actions {
    gap: 4px;
  }
  .header-actions .button {
    padding: 5px 7px;
    min-height: 30px;
    font-size: 10px;
  }
  .header-actions .control-label,
  .tutorial-label {
    display: none;
  }
  .header-actions .control-icon {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }
  .header-actions .button:has(.control-icon) {
    width: 30px;
    height: 30px;
    padding: 0;
  }
  .tutorial-short-label {
    display: inline;
  }
  .run-bar {
    padding: 4px 8px 7px;
  }
  .run-bar > div:first-child {
    display: block;
  }
  .run-bar h2 {
    font-size: 12px;
  }
  .run-bar #objective {
    display: none;
  }
  .run-bar .eyebrow {
    font-size: 8px;
  }
  .clock {
    display: block;
    text-align: right;
  }
  .clock > span:first-child {
    display: block;
    font-size: 23px;
    line-height: 1;
  }
  .clock > span:last-child {
    font-size: 8px;
  }
  .stat-box {
    padding: 5px 8px;
  }
  .label {
    font-size: 8px;
    letter-spacing: 0;
  }
  .stat-box > strong {
    font-size: 15px;
  }
  .sub-value {
    font-size: 8px;
    white-space: normal;
  }
  .event-banner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px;
    padding: 4px 8px;
    font-size: 10px;
  }
  .event-marker {
    display: none;
  }
  .event-banner p {
    grid-column: 1/-1;
  }
  .event-banner > span:last-child {
    font-size: 9px;
    grid-column: 1/-1;
  }
  .panel {
    padding: 8px;
  }
  .panel-header .eyebrow {
    display: none;
  }
  .panel-header {
    min-height: 22px;
  }
  h2 {
    font-size: 14px;
  }
  .market-toolbar {
    gap: 6px;
  }
  .stock-select {
    height: 34px;
  }
  .stock-select small {
    font-size: 10px;
  }
  .stock-select strong {
    font-size: 12px;
  }
  .market-table {
    font-size: 11px;
  }
  .field label {
    font-size: 10px;
  }
  .trade-panel {
    gap: 5px;
  }
  .quote > strong {
    font-size: 24px;
  }
  .profile {
    font-size: 10px;
  }
  .chart-figure figcaption {
    font-size: 8px;
  }
  .position-summary {
    padding: 5px 6px;
    font-size: 9px;
  }
  .trade-actions .button {
    min-height: 34px;
  }
  .feedback {
    font-size: 10px;
    min-height: 26px;
  }
  .holdings-panel table {
    font-size: 10px;
  }
  .holdings-panel th {
    font-size: 8px;
  }
  .holdings-panel .stock-select {
    font-size: 10px;
  }
  .pager button {
    height: 30px;
    min-width: 40px;
  }
  .pager {
    min-height: 34px;
  }
}
@media (max-height: 700px) {
  .profile {
    display: none;
  }
  .news-intro {
    display: none;
  }
  .trade-panel {
    gap: 4px;
  }
  .portfolio-figure {
    flex-basis: 44px;
    min-height: 24px;
  }
  .order-hint {
    min-height: 24px;
  }
  .feedback {
    min-height: 24px;
  }
}
@media (max-height: 540px) and (min-width: 600px) {
  .app-shell {
    grid-template-rows: auto 37px 45px 32px 28px minmax(0, 1fr);
    gap: 4px;
    padding: 4px;
  }
  .run-bar #objective,
  .brand .eyebrow,
  .stat-box .sub-value {
    display: none;
  }
  .stat-box > strong {
    font-size: 17px;
  }
  .run-bar {
    padding: 3px 8px 6px;
  }
  .clock > span:first-child {
    font-size: 22px;
  }
  .event-banner {
    font-size: 10px;
  }
  .view-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }
  .view-tabs button {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 5px;
  }
  .view-tabs button[aria-pressed="true"] {
    background: #294458;
  }
  .market-panel .panel-header,
  .market-toolbar label {
    display: none;
  }
  .layout {
    display: block;
  }
  .layout > [data-panel] {
    display: none;
    height: 100%;
  }
  .layout[data-view="market"] > [data-panel="market"],
  .layout[data-view="holdings"] > [data-panel="holdings"],
  .layout[data-view="news"] > [data-panel="news"] {
    display: flex;
  }
  .layout[data-view="trade"] > .trade-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 24px 30px minmax(0, 1fr) 24px;
    gap: 3px 14px;
    max-width: none;
  }
  .trade-panel .panel-header {
    grid-column: 1;
    grid-row: 1;
  }
  .trade-panel .panel-header .eyebrow {
    display: none;
  }
  .trade-panel .quote {
    grid-column: 1;
    grid-row: 2;
  }
  .trade-panel .chart-figure {
    grid-column: 1;
    grid-row: 3;
  }
  .trade-panel .position-summary {
    grid-column: 1;
    grid-row: 4;
    padding: 3px 8px;
  }
  .trade-panel #orderForm {
    grid-column: 2;
    grid-row: 1/4;
    gap: 3px 6px;
    align-content: start;
  }
  .trade-panel .feedback {
    grid-column: 2;
    grid-row: 4;
    font-size: 9px;
  }
  .trade-panel .quote > strong {
    font-size: 22px;
  }
  .trade-panel .order-hint {
    min-height: 0;
    font-size: 9px;
  }
  .presets button {
    height: 25px;
  }
  .trade-actions .button {
    min-height: 28px;
    padding: 3px;
  }
  .quantity-heading label,
  .quantity-heading .muted {
    font-size: 9px;
  }
  #quantity {
    height: 27px;
  }
  .panel {
    padding: 6px;
  }
  .news-list h3 {
    font-size: 13px;
  }
  .portfolio-figure {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.brand-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.real-result {
  display: block;
  width: 100%;
  padding: 10px;
  margin: 5px 0;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-soft);
  color: var(--text);
}
#realSearchStatus {
  margin-top: 12px;
}
#realStocksDialog .dialog-content {
  display: flex;
  flex-direction: column;
  height: min(760px, calc(90dvh - 2px));
  gap: 12px;
}
#realStocksDialog .dialog-content > :not(#realSearchResults) {
  flex-shrink: 0;
  margin: 0;
}
#realSearchForm .dialog-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 8px;
}
#realSearch {
  min-width: 0;
}
#realSearchResults {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 3px;
  scrollbar-gutter: stable;
}
.real-result.quote-unavailable {
  border-color: var(--amber);
}
@media (max-height: 450px) {
  #realStocksDialog .dialog-content {
    padding: 12px 18px;
    gap: 6px;
  }
  #realStocksDialog h2 {
    font-size: 19px;
  }
  #realSearchStatus {
    max-height: 54px;
    overflow-y: auto;
  }
}
#refreshQuoteButton {
  min-height: 26px;
  padding: 3px 8px;
  align-self: flex-start;
}
#browseRealButton {
  font-size: 10px;
}
.quote-status {
  font-size: 10px;
  line-height: 1.25;
  color: var(--amber);
  flex-shrink: 0;
}
.save-slot {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 8px;
  margin: 12px 0;
}
.save-slot h3 {
  margin-bottom: 6px;
}
.save-slot .dialog-actions {
  margin-top: 8px;
}
#saveMessage {
  min-height: 18px;
}
/* Consistent spacing for account controls, local slots, and the dialog footer. */
#savesDialog .dialog-content {
  display: grid;
  gap: 14px;
}
#savesDialog .dialog-content p,
#savesDialog .dialog-content h2,
#savesDialog .save-slot h3 {
  margin: 0;
}
#savesDialog .save-slot {
  display: grid;
  gap: 12px;
  padding: 16px;
  margin: 0;
}
#cloudAuthForm,
#cloudVerifyForm,
#cloudSignedIn {
  display: grid;
  gap: 8px;
  min-width: 0;
}
#savesDialog form label {
  margin: 0;
}
#savesDialog form input {
  width: 100%;
  min-width: 0;
}
#savesDialog form button {
  margin-top: 4px;
}
#savesDialog .dialog-actions {
  margin: 0;
  gap: 8px;
}
#savesDialog .save-slot > button,
#savesDialog form button,
#closeSaves {
  justify-self: start;
}
#saveMessage:empty {
  display: none;
}
@media (max-width: 600px) {
  #savesDialog .dialog-content {
    gap: 12px;
  }
  #savesDialog .save-slot {
    padding: 14px;
  }
}
@media (max-width: 600px) {
  .brand > div {
    display: none;
  }
  .brand-logo {
    width: 28px;
    height: 28px;
  }
  #savesButton {
    padding-left: 5px;
    padding-right: 5px;
  }
}
@media (min-width: 601px) and (max-width: 1099px) {
  .brand > div {
    display: none;
  }
  .header-actions {
    gap: 6px;
  }
  .header-actions .button {
    padding-inline: 8px;
    font-size: 11px;
  }
}
@media (max-width: 420px) {
  .topbar > .brand {
    display: none;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
}
.header-actions { flex-wrap:wrap; }
#learningGuideLink,#instructorLink { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; white-space:nowrap; }
@media(max-width:600px) { #learningGuideLink,#instructorLink { font-size:10px; padding:4px 6px; min-height:28px; } }
