:root {
  color-scheme: dark;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #eef3ff;
  background: #050a14;
  line-height: 1.5;
  font-synthesis: none;
  --muted: #a8b7d0;
  --line: #263854;
  --accent: #5ca1ff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 22px max(24px, calc((100vw - 1080px) / 2));
}
.brand {
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
}
.brand span {
  color: var(--accent);
}
#account {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}
main {
  max-width: 1080px;
  padding: 42px 24px 80px;
  margin: auto;
}
h1 {
  font-size: 44px;
  letter-spacing: -1.6px;
  line-height: 1.1;
  margin: 10px 0 16px;
}
h2 {
  margin: 0;
  font-size: 22px;
}
h3 {
  font-size: 16px;
}
p {
  margin: 8px 0 16px;
}
.eyebrow {
  letter-spacing: 1.6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
#subtitle,
.muted {
  color: var(--muted);
}
button,
.button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #050a14;
  padding: 12px 18px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.quiet {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin: 24px 0;
  padding-bottom: 12px;
}
nav button {
  background: transparent;
  color: var(--muted);
}
nav button[aria-current="page"] {
  color: var(--accent);
  background: #152b4b;
}
.card {
  padding: 26px;
  background: #0d192b;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 16px 0;
}
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}
.company {
  color: var(--muted);
  font-size: 14px;
}
.badge {
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
  background: #183529;
  color: var(--accent);
}
.badge.wait,
.badge.review {
  background: #382d1d;
  color: #ffc46b;
}
.badge.sell,
.badge.sell-part {
  background: #3d202c;
  color: #ffa3ad;
}
.reason {
  font-size: 18px;
  margin: 20px 0;
  max-width: 800px;
}
.explanation {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}
.explanation p {
  font-size: 14px;
  margin: 0;
}
.timestamps {
  font-size: 12px;
  color: var(--muted);
  margin: 22px 0 14px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
details {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 14px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted);
  font:
    12px/1.6 ui-monospace,
    monospace;
  max-height: 450px;
  overflow: auto;
}
#status:not(:empty) {
  background: #16263e;
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  font-size: 14px;
  margin: 18px 0;
}
.empty {
  padding: 40px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  text-align: center;
  color: var(--muted);
}
#settings {
  border-top: 1px solid var(--line);
  margin-top: 35px;
  padding-top: 24px;
}
label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin: 10px 0;
}
input,
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101f35;
  color: #eef3ff;
  padding: 12px;
  font: inherit;
}
.input-row {
  display: flex;
  gap: 10px;
}
.input-row input {
  flex: 1;
  min-width: 0;
}
footer {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--line);
}
[hidden] {
  display: none !important;
}
.remove {
  margin-top: 18px;
  font-size: 12px;
}
.warning {
  color: #ffc46b;
}
#login {
  padding: 65px 0;
}
#import-preview {
  margin: 20px 0;
}
@media (max-width: 640px) {
  header {
    padding: 16px;
    gap: 10px;
  }
  header .brand {
    font-size: 19px;
  }
  #account {
    font-size: 11px;
  }
  header button {
    padding: 8px;
  }
  main {
    padding: 28px 16px 90px;
  }
  h1 {
    font-size: 36px;
  }
  .page-head {
    align-items: flex-start;
  }
  .page-head button {
    font-size: 12px;
    padding: 10px;
    max-width: 110px;
  }
  nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
    background: #050a14;
    border-top: 1px solid var(--line);
    z-index: 2;
    justify-content: space-around;
  }
  nav button {
    font-size: 13px;
    padding: 10px;
  }
  .card {
    padding: 20px;
  }
  .reason {
    font-size: 16px;
  }
  .explanation {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .timestamps {
    gap: 5px;
    flex-direction: column;
  }
  footer {
    padding-bottom: 85px;
  }
  .badge {
    font-size: 13px;
  }
  .empty {
    padding: 28px;
  }
}

/* Palette and split layout from TradeOpsBrandViews.swift. */
body {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at top right, #3b7af538, transparent 65%),
    radial-gradient(ellipse at bottom left, #f2a64729, transparent 65%),
    linear-gradient(135deg, #050a14, #081221 60%, #000);
  background-attachment: fixed;
}
.brand span,
.eyebrow {
  color: #ffc46b;
}
.card {
  border-radius: 22px;
  box-shadow: 0 12px 24px #3b7af514;
  border-color: #5ca1ff40;
  background: linear-gradient(135deg, #14233acc, #0b1423e6);
}
.badge {
  color: #a3e5b9;
}
.label {
  color: #b2bfd5;
}
nav button {
  min-height: 44px;
}
button,
.button,
input,
select,
summary {
  min-height: 44px;
}
main {
  min-width: 0;
}
pre {
  max-width: 100%;
}
header {
  padding-top: max(18px, env(safe-area-inset-top));
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}
@media (min-width: 900px) {
  header {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 225px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 30px 20px;
    background: linear-gradient(#010307, #081221, #050a14);
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
  #account {
    margin: 0;
    order: 3;
    margin-top: auto;
    overflow-wrap: anywhere;
  }
  #settings-toggle {
    margin-top: 170px;
  }
  main {
    margin-left: 225px;
    max-width: 1305px;
    padding-left: 36px;
    padding-right: 36px;
  }
  nav {
    position: fixed;
    top: 100px;
    left: 15px;
    width: 195px;
    flex-direction: column;
    border-bottom: 0;
    margin: 0;
    z-index: 3;
  }
  nav button {
    text-align: left;
  }
  footer {
    margin-left: 225px;
  }
}
@media (max-width: 640px) {
  main {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  nav {
    background: linear-gradient(#081221, #050a14);
  }
  .input-row {
    flex-wrap: wrap;
  }
  .input-row input {
    flex-basis: 180px;
  }
  input[type="file"] {
    max-width: 100%;
  }
  .brand {
    letter-spacing: -0.3px;
  }
}

#account-switch-label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
#account-switch-label[hidden] {
  display: none;
}
#account-switch {
  min-width: 86px;
  min-height: 44px;
  width: auto;
}
@media (max-width: 640px) {
  header {
    flex-wrap: wrap;
  }
  #account {
    font-size: 11px;
  }
}

#market-banners {
  margin-bottom: 24px;
  min-width: 0;
}
.market-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
  scroll-snap-type: x proximity;
}
.market-tile {
  flex: 0 0 155px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c1525;
  scroll-snap-align: start;
}
.market-tile strong,
.market-tile small {
  display: block;
}
.market-tile small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.market-tile strong {
  font-size: 12px;
  line-height: 1.4;
}
.market-tile span {
  font-size: 12px;
}
.market-price {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.up {
  color: #7bd9ad;
}
.down {
  color: #ff9a9a;
}
#market-feed-status {
  display: block;
}
@media (min-width: 900px) {
  nav {
    top: 160px;
  }
  #settings-toggle {
    margin-top: 210px;
  }
}

#homepage-settings input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin-right: 10px;
}
#homepage-settings {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 24px;
}
@media (min-width: 900px) {
  #settings-toggle {
    margin-top: 270px;
  }
}
@media (max-width: 640px) {
  nav button {
    font-size: 12px;
    padding: 8px 5px;
  }
  nav {
    padding-left: 8px;
    padding-right: 8px;
  }
}

.portfolio-balances {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.balance-tile {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0c1525;
}
.balance-tile span,
.balance-tile strong {
  display: block;
}
.balance-tile strong {
  font-size: 23px;
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
}
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: 24px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .portfolio-balances {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .balance-tile {
    padding: 12px;
  }
  .balance-tile strong {
    font-size: 19px;
  }
}

#market-banners > details {
  font-size: 12px;
  margin-bottom: 14px;
}
#market-timestamps {
  padding-left: 18px;
  font-size: 12px;
}

.market-strip {
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.card details h3 {
  margin-top: 20px;
  font-size: 15px;
}
.card details p {
  line-height: 1.65;
}

.quote-price {
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text, #e7edf7);
  margin: 0.5rem 0;
}
.review-feedback {
  padding: 0.7rem;
  border-left: 3px solid #cda75a;
  background: rgba(205, 167, 90, 0.08);
}

#logout {
  margin-top: 24px;
}
@media (min-width: 900px) {
  header {
    padding-bottom: 96px;
  }
  #logout {
    position: fixed;
    left: 20px;
    bottom: 24px;
    width: 185px;
    margin: 0;
    z-index: 4;
    text-align: left;
  }
}

/* Cendoran landscape treatment; opaque surfaces protect financial data contrast. */
:root {
  --gold: #ffc46b;
  --panel: #0d192b;
  --line: #3c526f;
}
body {
  background: #050a14;
  isolation: isolate;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, #050a1440, #08122115),
    url('/assets/nordic-fjord.png') center center / cover no-repeat;
  opacity: .28;
}
a { color: #91beff; text-underline-offset: 4px; }
a:hover { color: #c5dcff; }
h1 { font-weight: 650; font-size: clamp(2rem, 3.5vw, 2.65rem); letter-spacing: -.035em; }
h2 { letter-spacing: -.02em; font-weight: 650; }
h3 { font-weight: 650; line-height: 1.4; }
main { padding-top: 32px; }
header { background: #081221; border-color: #5b513e; }
.brand { letter-spacing: -.03em; }
.eyebrow { line-height: 1.5; letter-spacing: .14em; }
.page-head { padding: 24px 0 20px; min-height: 180px; }
#subtitle { max-width: 650px; margin-bottom: 0; font-size: .9375rem; }
.refresh-action { flex-shrink: 0; text-align: right; }
.refresh-action small { display: block; color: var(--muted); font-size: .75rem; margin-top: 8px; max-width: 185px; }
button, .button { border: 1px solid transparent; font-size: .875rem; min-height: 44px; }
button:not(:disabled):hover, .button:hover { background: #91beff; color: #050a14; }
.quiet { background: #101f35; border-color: var(--line); color: #c8d8ed; }
.quiet:not(:disabled):hover { background: #193351; color: #eef3ff; border-color: #91beff; }
button:disabled { opacity: 1; color: #a8b7d0; background: #18263b; border-color: #3c526f; cursor: not-allowed; }
button[aria-busy="true"] { cursor: wait; }
nav button { color: #c8d8ed; border-radius: 8px; }
nav button[aria-current="page"], #settings-toggle[aria-current="page"] { color: #b8d6ff; background: #152b4b; border: 1px solid #5278a5; box-shadow: inset 3px 0 var(--accent); }
#account { line-height: 1.65; }
#account-switch-label { font-weight: 600; }
.card, .empty, #research-tools, #watchlist-tools, #portfolio-dashboard,
#settings, #daily-briefing, #skipped-ideas, #login, .connection-state {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 30px #0003;
}
.card { padding: 28px; margin: 20px 0; border-top: 2px solid #456d9c; }
.card-top h2 { font-size: 23px; }
.reason { font-size: 1.0625rem; line-height: 1.65; margin: 18px 0 24px; }
.quote-price { font-variant-numeric: tabular-nums; margin-top: 12px; font-size: 1rem; }
.badge { font-size: .8125rem; border: 1px solid #407859; border-radius: 6px; }
.badge.wait, .badge.review { border-color: #856b42; }
.badge.sell, .badge.sell-part { border-color: #a15c6b; }
.explanation { gap: 24px; padding-top: 20px; }
.explanation p { line-height: 1.65; }
.label { font-size: .6875rem; font-weight: 650; letter-spacing: .1em; }
.timestamps { font-size: .75rem; line-height: 1.65; }
summary { padding: 10px 0; font-weight: 600; color: #b8d6ff; }
details { padding-top: 6px; }
details[open] > summary { margin-bottom: 10px; }
.card details details { margin-top: 20px; }
.card-actions { border-top: 1px solid var(--line); padding-top: 18px; }
#market-banners { padding-bottom: 8px; }
#market-banners > details { background: #0d192b; border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; margin: 8px 0; }
#market-banners summary { font-size: .75rem; }
.market-tile { background: #0d192b; padding: 10px 12px; flex-basis: 172px; border-radius: 8px; }
.market-tile strong { font-weight: 550; color: #c8d8ed; }
.market-price { margin: 5px 0 2px; font-weight: 600; letter-spacing: -.02em; }
#movers-caption { font-size: .75rem; margin: 10px 0 0; font-weight: 600; }
#market { display: inline-flex; align-items: center; gap: 8px; background: #0d192b; padding: 5px 9px; border: 1px solid #856b42; border-radius: 5px; margin: 0 0 8px; font-size: .6875rem; }
#market::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
#market[data-market="open"] { color: #a3e5b9; border-color: #407859; }
#status:not(:empty) { background: #122238; border: 1px solid #456d9c; border-left: 3px solid var(--gold); border-radius: 8px; line-height: 1.7; }
#research-tools, #watchlist-tools, #portfolio-dashboard, #settings { padding: 24px; margin: 20px 0; }
#research-tools > p { font-size: .875rem; margin-top: 16px; }
#daily-briefing, #skipped-ideas { padding: 8px 20px; margin: 16px 0; }
#skipped-list { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 12px; }
.portfolio-balances { margin-top: 0; }
.balance-tile { background: #101f35; border-radius: 10px; }
.balance-tile span { font-size: .8125rem; }
.balance-tile strong { font-size: clamp(1.125rem, 2vw, 1.5rem); }
#portfolio-dashboard h2 { font-size: 1.125rem; margin: 24px 0 12px; }
.table-scroll { border: 1px solid var(--line); border-radius: 8px; }
th { font-size: .75rem; color: #c8d8ed; background: #101f35; }
td { font-variant-numeric: tabular-nums; }
#settings form { padding: 24px 0; margin: 0; border-bottom: 1px solid var(--line); }
#settings form h3 { margin-top: 0; font-size: 1.125rem; }
#settings p { max-width: 780px; font-size: .875rem; line-height: 1.7; }
#settings input:not([type="checkbox"]), #settings select { width: min(100%, 440px); }
label { color: #c8d8ed; line-height: 1.6; }
label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
input[type="checkbox"], #homepage-settings input[type="checkbox"] { width: 20px; height: 20px; min-height: 20px; flex: 0 0 20px; margin: 0; accent-color: var(--accent); }
input, select { background: #081221; border-color: #62758f; font-size: 16px; }
input::placeholder { color: #a8b7d0; }
input:user-invalid { border-color: #ff9a9a; outline: 1px solid #ff9a9a; }
.execution-control { background: var(--gold); color: #050a14; }
.execution-control:not(:disabled):hover { background: #ffda93; }
#paper-settings { border-left: 3px solid var(--gold); padding-left: 20px !important; }
#paper-settings button { margin: 4px 8px 4px 0; }
.form-feedback, .review-feedback { background: #16263e; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; padding: 12px 16px; font-size: .875rem; }
.form-feedback[data-state="error"] { background: #301e2b; border-color: #ae6675; color: #ffcad1; }
.form-feedback[data-state="success"] { border-left-color: #7bd9ad; }
.empty { padding: 36px 24px; border-style: solid; text-align: left; }
.empty h2 { font-size: 1.125rem; color: #eef3ff; }
.empty p { max-width: 640px; font-size: .9375rem; margin: 12px 0 20px; }
.empty .button { margin: 4px 8px 4px 0; }
#updated { font-size: .75rem; line-height: 1.7; background: #0d192b; border-radius: 8px; padding: 12px 16px; }
#login { max-width: 640px; padding: 38px; margin: 52px 0 150px; border-color: #856b42; }
#login p:not(.eyebrow) { color: var(--muted); margin: 20px 0 28px; }
.connection-state { padding: 24px; margin: 24px 0; }
.connection-state:empty { display: none; }
footer { background: #081221; line-height: 1.7; }
.skip-link { position: fixed; top: -100px; left: 16px; padding: 12px 18px; background: #0d192b; border: 2px solid var(--gold); border-radius: 6px; z-index: 20; }
.skip-link:focus { top: 16px; }
:focus-visible { outline: 3px solid #91beff; outline-offset: 4px; }
main:focus, #title:focus { outline: none; }
@media (min-width: 900px) {
  header { background: #081221; }
  main { max-width: 1245px; padding-right: 48px; }
}
@media (max-width: 640px) {
  .page-head { flex-wrap: wrap; gap: 18px; min-height: 0; padding: 24px 0; }
  .refresh-action { text-align: left; }
  .refresh-action small { max-width: none; }
  .page-head button { max-width: none; padding: 11px 16px; font-size: .875rem; }
  .card { padding: 20px; }
  .card-top { gap: 12px; }
  .company { overflow-wrap: anywhere; }
  .card-actions button { flex-grow: 1; }
  #research-tools, #watchlist-tools, #portfolio-dashboard, #settings { padding: 18px; }
  .balance-tile { padding: 12px 10px; }
  nav { gap: 3px; background: #081221; }
  nav button { flex: 1; padding: 10px 5px; }
  #settings-toggle { min-width: 74px; }
  #paper-settings { padding-left: 12px !important; }
  .input-row button { flex-grow: 1; }
  #login { padding: 26px; margin: 24px 0 120px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
/* Secondary copy over the landscape clears AA even over its brightest pixels. */
#subtitle, .refresh-action small, #movers-caption { color: #b6c5dc; }
.action-help { flex-basis: 100%; color: var(--muted); font-size: .75rem; margin-top: 4px; }
