:root {
  --ink: #07110f;
  --ink-soft: #0d1a17;
  --ink-raised: #12231f;
  --panel: rgba(18, 35, 31, 0.82);
  --panel-opaque: #12231f;
  --paper: #f2f0e7;
  --paper-soft: #c8ccc0;
  --muted: #849189;
  --line: rgba(235, 243, 229, 0.11);
  --line-strong: rgba(235, 243, 229, 0.19);
  --acid: #b8ff5a;
  --acid-soft: rgba(184, 255, 90, 0.14);
  --mint: #80ffd4;
  --amber: #ffbd6b;
  --red: #ff786d;
  --red-soft: rgba(255, 120, 109, 0.14);
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --body: "Avenir Next", Avenir, "Helvetica Neue", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", Menlo, monospace;
  --radius-sm: 14px;
  --radius: 22px;
  --radius-lg: 30px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% -4%, rgba(101, 203, 163, 0.13), transparent 30rem),
    radial-gradient(circle at 90% 20%, rgba(184, 255, 90, 0.05), transparent 22rem),
    var(--ink);
  color: var(--paper);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.is-sheet-open { overflow: hidden; }
[hidden] { display: none !important; }

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

button,
summary {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

svg {
  display: block;
  width: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.18;
  pointer-events: none;
}

.ambient-a {
  top: -180px;
  left: -180px;
  width: 430px;
  height: 430px;
  background: #4ed6a0;
}

.ambient-b {
  right: -160px;
  bottom: 10%;
  width: 330px;
  height: 330px;
  background: #638f32;
  opacity: 0.08;
}

.grain {
  position: fixed;
  z-index: 20;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 680px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 72px) 18px calc(var(--safe-bottom) + 112px);
}

.auth-gate {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
  background: radial-gradient(circle at 50% 38%, rgba(128, 255, 212, 0.1), transparent 20rem);
}

.auth-gate h1 {
  max-width: 18ch;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 9vw, 3.2rem);
  font-weight: 400;
  line-height: 0.98;
}

.auth-gate > p:not(.eyebrow) {
  max-width: 34rem;
  margin: 0;
  color: var(--paper-soft);
  font-size: 0.74rem;
  line-height: 1.6;
}

.auth-mark {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 1px solid rgba(184, 255, 90, 0.36);
  border-radius: 50%;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  box-shadow: inset 0 0 30px rgba(184, 255, 90, 0.06), 0 0 50px rgba(128, 255, 212, 0.06);
}

.auth-pulse { display: flex; gap: 5px; min-height: 8px; }
.auth-pulse i { width: 5px; height: 5px; border-radius: 50%; background: var(--acid); animation: auth-pulse 1.2s ease-in-out infinite; }
.auth-pulse i:nth-child(2) { animation-delay: 140ms; }
.auth-pulse i:nth-child(3) { animation-delay: 280ms; }
@keyframes auth-pulse { 0%, 75%, 100% { opacity: .22; transform: scale(.8); } 35% { opacity: 1; transform: scale(1); } }

body[data-auth-state="authenticated"] .auth-gate { display: none; }
body:not([data-auth-state="authenticated"]) #protected-shell { visibility: hidden; pointer-events: none; }
body[data-auth-state="runtime_missing"] .auth-pulse,
body[data-auth-state="proof_unavailable"] .auth-pulse,
body[data-auth-state="backend_unavailable"] .auth-pulse,
body[data-auth-state="safe_error"] .auth-pulse { display: none; }

.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 680px);
  height: calc(var(--safe-top) + 66px);
  padding: calc(var(--safe-top) + 10px) 19px 8px;
  transform: translateX(-50%);
  border-bottom: 1px solid transparent;
  background: linear-gradient(to bottom, rgba(7, 17, 15, 0.98), rgba(7, 17, 15, 0.78) 78%, transparent);
  backdrop-filter: blur(18px);
  transition: border-color 180ms ease;
}

body.is-scrolled .topbar {
  border-color: var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  color: var(--paper);
  background: transparent;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(184, 255, 90, 0.3);
  border-radius: 50%;
  color: var(--acid);
  background: rgba(184, 255, 90, 0.05);
  box-shadow: inset 0 0 24px rgba(184, 255, 90, 0.04);
}

.brand-mark svg {
  width: 31px;
  stroke-width: 1.25;
}

.brand-mark .needle {
  fill: var(--acid);
  stroke: none;
}

.brand-mark .needle-core {
  fill: var(--ink);
  stroke: none;
}

.brand-copy {
  display: grid;
  gap: 1px;
  text-align: left;
}

.brand-copy strong {
  font-family: var(--mono);
  font-size: 0.83rem;
  letter-spacing: 0.2em;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0.06em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.demo-pill,
.canonical-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--paper-soft);
  font-family: var(--mono);
  font-size: 0.59rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.demo-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
}

.icon-button,
.back-button {
  position: relative;
  display: grid;
  width: 39px;
  height: 39px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--paper-soft);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: 180ms ease;
}

.icon-button:hover,
.back-button:hover {
  border-color: var(--line-strong);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.055);
}

.icon-button svg,
.back-button svg {
  width: 18px;
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--acid);
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: screen-enter 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes screen-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.reveal {
  animation: reveal-up 650ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.reveal-1 { animation-delay: 20ms; }
.reveal-2 { animation-delay: 90ms; }
.reveal-3 { animation-delay: 160ms; }
.reveal-4 { animation-delay: 230ms; }
.reveal-5 { animation-delay: 300ms; }

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.page-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 150px;
  padding: 26px 2px 20px;
}

.eyebrow,
.field-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.61rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-intro h1,
.analysis-header h1,
.profile-hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.55rem, 11vw, 4.5rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.86;
}

.page-intro h1 em {
  color: var(--acid);
  font-weight: 400;
}

.avatar {
  position: relative;
  display: grid;
  width: 43px;
  height: 43px;
  padding: 0;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(184, 255, 90, 0.26);
  border-radius: 50%;
  color: var(--acid);
  background:
    radial-gradient(circle at 50% 30%, rgba(184, 255, 90, 0.2), transparent 45%),
    var(--ink-raised);
  font-family: var(--mono);
  font-size: 0.67rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.avatar::after {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 6px;
  height: 6px;
  border: 2px solid var(--ink-raised);
  border-radius: 50%;
  background: var(--acid);
  content: "";
}

.safety-strip {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 58px;
  gap: 11px;
  padding: 9px 12px;
  border: 1px solid rgba(128, 255, 212, 0.13);
  border-radius: var(--radius-sm);
  color: var(--paper-soft);
  text-align: left;
  background: rgba(128, 255, 212, 0.04);
  cursor: pointer;
}

.safety-icon {
  display: grid;
  width: 33px;
  height: 33px;
  flex: 0 0 33px;
  place-items: center;
  border-radius: 10px;
  color: var(--mint);
  background: rgba(128, 255, 212, 0.09);
}

.safety-icon svg { width: 17px; }

.safety-strip > span:nth-child(2) {
  display: grid;
  gap: 3px;
  flex: 1;
  font-size: 0.69rem;
}

.safety-strip b {
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 600;
}

.chevron {
  width: 17px;
  color: var(--muted);
}

.decision-card {
  position: relative;
  margin-top: 14px;
  padding: 19px;
  overflow: hidden;
  border: 1px solid rgba(184, 255, 90, 0.18);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 82% 10%, rgba(184, 255, 90, 0.13), transparent 15rem),
    linear-gradient(155deg, rgba(18, 35, 31, 0.98), rgba(10, 25, 21, 0.96));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.035);
}

.decision-card::after {
  position: absolute;
  top: -55px;
  right: -50px;
  width: 155px;
  height: 155px;
  border: 1px solid rgba(184, 255, 90, 0.09);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(184, 255, 90, 0.025), 0 0 0 52px rgba(184, 255, 90, 0.018);
  content: "";
  pointer-events: none;
}

.decision-topline,
.capital-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.59rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.canonical-chip {
  min-height: 23px;
  border-color: rgba(184, 255, 90, 0.22);
  color: var(--acid);
  background: var(--acid-soft);
}

.instrument-line {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 24px 0 7px;
}

.instrument-symbol {
  font-family: var(--mono);
  font-size: clamp(1.4rem, 7vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.06em;
}

.instrument-symbol span {
  color: var(--acid);
}

.instrument-line p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.65rem;
}

.quote-block {
  display: grid;
  gap: 3px;
  text-align: right;
}

.quote-block strong {
  font-family: var(--mono);
  font-size: 1rem;
}

.quote-block span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.15em;
}

.decision-orbit {
  position: relative;
  width: min(100%, 330px);
  height: 160px;
  margin: 0 auto;
}

.decision-orbit svg {
  position: absolute;
  inset: 10px 0 auto;
  width: 100%;
  overflow: visible;
}

.orbit-track,
.orbit-value {
  fill: none;
  stroke-width: 5;
}

.orbit-track {
  stroke: rgba(255, 255, 255, 0.07);
}

.orbit-value {
  stroke: url(#orbitGradient);
  stroke-dasharray: 289;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 10px rgba(184, 255, 90, 0.42));
  animation: draw-orbit 1.2s 500ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes draw-orbit {
  from { stroke-dashoffset: 289; }
}

.orbit-beacon {
  fill: var(--acid);
  stroke: rgba(184, 255, 90, 0.2);
  stroke-width: 9;
}

.orbit-tick {
  fill: none;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
}

.orbit-copy {
  position: absolute;
  inset: 62px 0 auto;
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.orbit-copy span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.orbit-copy strong {
  font-family: var(--display);
  font-size: 1.72rem;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.orbit-copy small {
  color: var(--acid);
  font-size: 0.63rem;
}

.decision-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 2px 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.decision-metrics div {
  display: grid;
  gap: 5px;
  padding: 13px 7px;
  text-align: center;
}

.decision-metrics div + div {
  border-left: 1px solid var(--line);
}

.decision-metrics span {
  color: var(--muted);
  font-size: 0.55rem;
}

.decision-metrics strong {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
}

.primary-button,
.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  gap: 12px;
  padding: 0 18px;
  border-radius: 15px;
  color: #13210d;
  background: var(--acid);
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 35px rgba(184, 255, 90, 0.12);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button:hover {
  background: #c7ff7c;
  box-shadow: 0 14px 40px rgba(184, 255, 90, 0.2);
}

.primary-button:active,
.secondary-button:active {
  transform: scale(0.985);
}

.primary-button svg {
  width: 18px;
  transition: transform 180ms ease;
}

.primary-button:hover svg { transform: translateX(3px); }

.card-footnote {
  margin: 10px 0 -3px;
  color: var(--muted);
  font-size: 0.57rem;
  text-align: center;
}

.section-block {
  margin-top: 36px;
}

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

.section-heading.compact {
  align-items: center;
}

.section-heading .eyebrow {
  margin-bottom: 5px;
}

.section-heading h2,
.form-section-heading h2,
.pipeline-card h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: -0.035em;
}

.text-button {
  padding: 5px 0;
  color: var(--acid);
  background: transparent;
  font-size: 0.67rem;
  cursor: pointer;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-card {
  position: relative;
  display: grid;
  min-height: 158px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  text-align: left;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: 180ms ease;
}

.action-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
}

.action-card-primary {
  border-color: rgba(184, 255, 90, 0.18);
  background: var(--acid-soft);
}

.action-card-primary::before {
  position: absolute;
  top: -60px;
  right: -50px;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(184, 255, 90, 0.13);
  border-radius: 50%;
  content: "";
}

.action-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: var(--acid);
  background: rgba(184, 255, 90, 0.09);
}

.action-icon svg { width: 18px; }

.action-card > span:nth-child(2) {
  display: grid;
  align-self: end;
  gap: 5px;
}

.action-card b {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.05;
}

.action-card small {
  color: var(--muted);
  font-size: 0.6rem;
}

.action-card > i {
  position: absolute;
  right: 14px;
  bottom: 13px;
  color: rgba(255, 255, 255, 0.18);
  font-family: var(--mono);
  font-size: 0.56rem;
  font-style: normal;
}

.muted-count {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
}

.recent-list,
.settings-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.018);
}

.recent-list button,
.settings-list button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 65px;
  gap: 12px;
  padding: 10px 13px;
  color: var(--paper);
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: background 160ms ease;
}

.recent-list button:hover,
.settings-list button:hover {
  background: rgba(255, 255, 255, 0.035);
}

.recent-list button + button,
.settings-list button + button {
  border-top: 1px solid var(--line);
}

.recent-status {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border-radius: 50%;
}

.recent-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.recent-status.good { color: var(--acid); background: var(--acid-soft); }
.recent-status.bad { color: var(--red); background: var(--red-soft); }
.recent-status.wait { color: var(--amber); background: rgba(255, 189, 107, 0.12); }

.recent-list button > span:nth-child(2),
.settings-list button > span:nth-child(2) {
  display: grid;
  flex: 1;
  gap: 3px;
}

.recent-list b,
.settings-list b {
  font-size: 0.76rem;
  font-weight: 600;
}

.recent-list small,
.settings-list small {
  color: var(--muted);
  font-size: 0.62rem;
}

.recent-time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.52rem;
}

.analysis-header {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 12px;
  min-height: 100px;
  padding: 16px 0 12px;
}

.analysis-header .eyebrow { margin-bottom: 5px; }

.analysis-header h1 {
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1;
}

.demo-notice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid rgba(255, 189, 107, 0.16);
  border-radius: var(--radius-sm);
  color: var(--amber);
  background: rgba(255, 189, 107, 0.055);
}

.demo-notice svg {
  width: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
}

.demo-notice p {
  margin: 0;
  color: #c0b39c;
  font-size: 0.66rem;
  line-height: 1.48;
}

.demo-notice strong { color: #f0d7b1; }

.scenario-switcher {
  margin-top: 24px;
}

.scenario-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.scenario-tabs button {
  min-height: 39px;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-family: var(--mono);
  font-size: 0.68rem;
  cursor: pointer;
  transition: 180ms ease;
}

.scenario-tabs button.is-active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.scenario-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 3px 0;
}

.scenario-caption span { font-size: 0.72rem; }
.scenario-caption small { color: var(--muted); font-size: 0.58rem; text-align: right; }

.trade-form {
  margin-top: 29px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.023);
}

.form-section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.form-section-heading > span {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid rgba(184, 255, 90, 0.2);
  border-radius: 50%;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.57rem;
}

.form-section-heading p {
  margin: 0 0 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-section-heading h2 { font-size: 1.2rem; }

.input-field {
  display: grid;
  gap: 7px;
}

.input-field > span:first-child {
  color: var(--muted);
  font-size: 0.6rem;
}

.input-wrap {
  display: flex;
  align-items: center;
  min-height: 49px;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.15);
  transition: border-color 160ms ease, background 160ms ease;
}

.input-wrap:focus-within {
  border-color: rgba(184, 255, 90, 0.38);
  background: rgba(184, 255, 90, 0.025);
}

.input-wrap input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--paper);
  background: transparent;
  font-family: var(--mono);
  font-size: 0.77rem;
}

.input-wrap select {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--paper);
  background: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.input-wrap i {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.55rem;
  font-style: normal;
}

.direction-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 12px 0;
}

.direction-toggle button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
  font-family: var(--mono);
  font-size: 0.61rem;
  text-transform: uppercase;
  cursor: pointer;
}

.direction-toggle button svg { width: 15px; }

.direction-toggle button.is-active {
  border-color: rgba(184, 255, 90, 0.22);
  color: var(--acid);
  background: var(--acid-soft);
}

.direction-toggle button[data-direction="BEARISH"].is-active {
  border-color: rgba(255, 120, 109, 0.22);
  color: var(--red);
  background: var(--red-soft);
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stop-field .input-wrap { border-bottom-color: rgba(255, 120, 109, 0.3); }
.target-field .input-wrap { border-bottom-color: rgba(184, 255, 90, 0.3); }

.rr-preview {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  margin-top: 12px;
  padding: 13px;
  border-radius: 13px;
  background: rgba(184, 255, 90, 0.055);
}

.rr-preview span { color: var(--paper-soft); font-size: 0.65rem; }
.rr-preview strong { color: var(--acid); font-family: var(--mono); font-size: 0.78rem; }
.rr-preview small { grid-column: 1 / -1; color: var(--muted); font-size: 0.55rem; }

.advanced-inputs,
.result-details {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

summary {
  list-style: none;
}

summary::-webkit-details-marker { display: none; }

.advanced-inputs summary,
.result-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 13px;
  color: var(--paper-soft);
  font-size: 0.65rem;
  cursor: pointer;
}

.advanced-inputs summary > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.advanced-inputs summary svg { width: 16px; }
.advanced-inputs[open] .chevron,
.result-details[open] .chevron { transform: rotate(180deg); }

.advanced-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 8px;
  padding: 2px 12px 14px;
}

.input-check {
  display: flex;
  align-items: center;
  min-height: 49px;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--paper-soft);
  font-size: 0.6rem;
  cursor: pointer;
}

.input-check input { width: 17px; height: 17px; accent-color: var(--acid); }

.analyze-button { margin-top: 14px; }
.analyze-button.is-loading { pointer-events: none; }
.analyze-button.is-loading svg { animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.analysis-result {
  display: none;
  margin-top: 19px;
}

.analysis-result.is-visible {
  display: block;
  animation: result-enter 500ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes result-enter {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

.result-hero {
  position: relative;
  padding: 25px 20px;
  overflow: hidden;
  border: 1px solid rgba(184, 255, 90, 0.2);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 92% 0%, rgba(184, 255, 90, 0.17), transparent 16rem),
    var(--ink-raised);
}

.result-hero::after {
  position: absolute;
  right: -40px;
  bottom: -80px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(184, 255, 90, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 30px rgba(184, 255, 90, 0.025);
  content: "";
}

.result-hero[data-result-state="blocked"] {
  border-color: rgba(255, 120, 109, 0.22);
  background: radial-gradient(circle at 92% 0%, rgba(255, 120, 109, 0.15), transparent 16rem), var(--ink-raised);
}

.result-hero[data-result-state="warning"] {
  border-color: rgba(255, 189, 107, 0.22);
  background: radial-gradient(circle at 92% 0%, rgba(255, 189, 107, 0.15), transparent 16rem), var(--ink-raised);
}

.result-signal {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.13em;
}

[data-result-state="blocked"] .result-signal { color: var(--red); }
[data-result-state="warning"] .result-signal { color: var(--amber); }

.result-indicator {
  display: flex;
  align-items: center;
  gap: 3px;
}

.result-indicator i {
  width: 3px;
  height: 9px;
  border-radius: 99px;
  background: currentColor;
}
.result-indicator i:nth-child(2) { height: 14px; }
.result-indicator i:nth-child(3) { height: 6px; }

.result-hero h2 {
  position: relative;
  z-index: 1;
  margin: 18px 0 8px;
  font-family: var(--display);
  font-size: 2.1rem;
  font-weight: 400;
  letter-spacing: -0.05em;
}

.result-hero p {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 0;
  color: var(--paper-soft);
  font-size: 0.7rem;
  line-height: 1.55;
}

.result-pills {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.result-pills span {
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--paper-soft);
  background: rgba(0, 0, 0, 0.12);
  font-family: var(--mono);
  font-size: 0.49rem;
  letter-spacing: 0.05em;
}

.pipeline-card {
  margin-top: 12px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.022);
}

.pipeline-progress {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.pipeline-list {
  display: grid;
}

.pipeline-step {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  min-height: 52px;
  gap: 10px;
}

.pipeline-step:not(:last-child)::after {
  position: absolute;
  bottom: -2px;
  left: 14px;
  width: 1px;
  height: 12px;
  background: var(--line-strong);
  content: "";
}

.step-marker {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  background: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.5rem;
}

.pipeline-step.completed .step-marker { border-color: rgba(184, 255, 90, 0.28); color: var(--acid); background: var(--acid-soft); }
.pipeline-step.blocked .step-marker { border-color: rgba(255, 120, 109, 0.28); color: var(--red); background: var(--red-soft); }
.pipeline-step.warning .step-marker { border-color: rgba(255, 189, 107, 0.28); color: var(--amber); background: rgba(255, 189, 107, 0.1); }

.step-copy { display: grid; gap: 2px; }
.step-copy b { font-size: 0.68rem; font-weight: 600; }
.step-copy small { color: var(--muted); font-family: var(--mono); font-size: 0.5rem; }
.step-state { color: var(--muted); font-size: 0.55rem; }
.pipeline-step.completed .step-state { color: var(--acid); }
.pipeline-step.blocked .step-state { color: var(--red); }
.pipeline-step.warning .step-state { color: var(--amber); }

.result-numbers,
.portfolio-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.result-numbers article,
.portfolio-kpis article {
  display: grid;
  min-height: 113px;
  align-content: space-between;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.022);
}

.result-numbers span,
.portfolio-kpis span { color: var(--muted); font-size: 0.59rem; }
.result-numbers strong,
.portfolio-kpis strong { font-family: var(--mono); font-size: 1.05rem; }
.result-numbers small,
.portfolio-kpis small { color: var(--muted); font-size: 0.54rem; }

.counter-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 189, 107, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 189, 107, 0.045);
}

.counter-icon {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 37px;
  place-items: center;
  border-radius: 12px;
  color: var(--amber);
  background: rgba(255, 189, 107, 0.1);
}

.counter-icon svg { width: 18px; }
.counter-card span { color: var(--amber); font-family: var(--mono); font-size: 0.51rem; letter-spacing: 0.09em; text-transform: uppercase; }
.counter-card h3 { margin: 5px 0; font-family: var(--display); font-size: 1.06rem; font-weight: 400; }
.counter-card p { margin: 0; color: var(--muted); font-size: 0.61rem; line-height: 1.5; }

.result-details { margin-top: 12px; }
.fact-table { display: grid; padding: 0 13px 12px; }
.fact-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.fact-row span { color: var(--muted); font-size: 0.57rem; }
.fact-row strong { font-family: var(--mono); font-size: 0.58rem; text-align: right; word-break: break-word; }

.secondary-button {
  margin-top: 12px;
  border: 1px solid var(--line-strong);
  color: var(--paper);
  background: transparent;
  box-shadow: none;
}
.secondary-button:hover { background: rgba(255, 255, 255, 0.04); }
.secondary-button svg { width: 17px; }

.portfolio-intro { min-height: 150px; }
.capital-card {
  padding: 20px;
  border: 1px solid rgba(184, 255, 90, 0.16);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(150deg, rgba(184, 255, 90, 0.08), transparent 48%),
    var(--ink-raised);
}
.capital-head span:last-child { color: var(--acid); }
.capital-card > strong { display: block; margin: 19px 0 17px; font-family: var(--display); font-size: 2.65rem; font-weight: 400; letter-spacing: -0.055em; }
.capacity-bar { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, 0.08); }
.capacity-bar i { display: block; width: 30%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--acid), var(--mint)); box-shadow: 0 0 12px rgba(184, 255, 90, 0.42); }
.capital-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 16px; margin-top: 13px; }
.capital-legend span { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; gap: 6px; color: var(--muted); font-size: 0.54rem; }
.capital-legend i { width: 5px; height: 5px; border-radius: 50%; }
.capital-legend i.used { background: var(--acid); }
.capital-legend i.free { background: rgba(255, 255, 255, 0.25); }
.capital-legend b { color: var(--paper-soft); font-family: var(--mono); font-weight: 500; }

.portfolio-kpis { grid-template-columns: repeat(3, 1fr); }
.portfolio-kpis article { min-width: 0; min-height: 110px; padding: 12px; }
.portfolio-kpis strong { font-size: 0.88rem; overflow-wrap: anywhere; }

.gate-list { display: grid; gap: 8px; }
.gate-list article { display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; min-height: 66px; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.02); }
.gate-number { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; font-family: var(--mono); font-size: .5rem; }
.gate-success .gate-number { color: var(--acid); background: var(--acid-soft); }
.gate-blocked .gate-number { color: var(--red); background: var(--red-soft); }
.gate-list div { display: grid; gap: 3px; }
.gate-list b { font-size: .7rem; }
.gate-list small { color: var(--muted); font-family: var(--mono); font-size: .48rem; }
.gate-list strong { font-family: var(--mono); font-size: .58rem; overflow-wrap: anywhere; text-align: right; }
.gate-success strong { color: var(--acid); }
.gate-blocked strong { color: var(--red); }

.portfolio-rule { margin-top: 25px; padding: 18px; border-left: 2px solid var(--acid); background: linear-gradient(90deg, var(--acid-soft), transparent); }
.portfolio-rule span { color: var(--acid); font-family: var(--mono); font-size: .55rem; letter-spacing: .12em; text-transform: uppercase; }
.portfolio-rule p { margin: 9px 0 0; font-family: var(--display); font-size: 1.15rem; line-height: 1.3; }
.portfolio-rule b { color: var(--acid); font-family: var(--mono); font-size: .85em; }

.profile-hero { display: grid; justify-items: center; padding: 34px 0 28px; text-align: center; }
.profile-avatar { position: relative; display: grid; width: 82px; height: 82px; margin-bottom: 18px; place-items: center; border: 1px solid rgba(184,255,90,.25); border-radius: 50%; color: var(--acid); background: radial-gradient(circle at 50% 30%, rgba(184,255,90,.22), transparent 50%), var(--ink-raised); font-family: var(--mono); font-size: 1rem; }
.profile-avatar::before { position: absolute; inset: -8px; border: 1px dashed rgba(184,255,90,.13); border-radius: 50%; content:""; animation: slow-spin 18s linear infinite; }
@keyframes slow-spin { to { transform: rotate(360deg); } }
.profile-avatar i { position: absolute; right: 5px; bottom: 6px; width: 12px; height: 12px; border: 3px solid var(--ink); border-radius: 50%; background: var(--acid); }
.profile-hero .eyebrow { margin-bottom: 9px; }
.profile-hero h1 { font-size: 2.8rem; line-height: 1; }
.profile-hero > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: .64rem; }

.mode-card { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 13px; padding: 16px; border: 1px solid rgba(184,255,90,.17); border-radius: var(--radius); background: linear-gradient(120deg, var(--acid-soft), transparent 58%), rgba(255,255,255,.02); }
.mode-orb { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid rgba(184,255,90,.25); border-radius: 50%; box-shadow: inset 0 0 0 8px rgba(184,255,90,.035); }
.mode-orb i { width: 10px; height: 10px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 18px var(--acid); }
.mode-card div:nth-child(2) { display:grid; gap:2px; }
.mode-card span { color: var(--muted); font-size:.55rem; }
.mode-card h2 { margin:0; color:var(--acid); font-family:var(--mono); font-size:.86rem; letter-spacing:.12em; }
.mode-card p { margin:0; color:var(--paper-soft); font-size:.56rem; }
.mode-card button { padding:7px 0; color:var(--acid); background:transparent; font-size:.57rem; cursor:pointer; }

.settings-list { margin-top: 12px; }
.setting-icon { display:grid; width:31px; height:31px; flex:0 0 31px; place-items:center; border:1px solid var(--line); border-radius:10px; color:var(--muted); font-family:var(--mono); font-size:.48rem; }
.settings-list .chevron { width:16px; }
.build-stamp { display:grid; gap:5px; margin:38px 0 8px; color:var(--muted); text-align:center; }
.build-stamp span { font-family:var(--mono); font-size:.55rem; letter-spacing:.16em; }
.build-stamp small { font-family:var(--mono); font-size:.47rem; }

.bottom-nav {
  position: fixed;
  z-index: 60;
  bottom: 0;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 680px);
  height: calc(var(--safe-bottom) + 78px);
  padding: 8px 14px calc(var(--safe-bottom) + 7px);
  transform: translateX(-50%);
  border-top: 1px solid var(--line);
  background: rgba(7, 17, 15, 0.92);
  backdrop-filter: blur(25px) saturate(130%);
}

.bottom-nav button {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  color: #68756e;
  background: transparent;
  font-size: 0.53rem;
  cursor: pointer;
  transition: color 160ms ease;
}

.bottom-nav button::before {
  position: absolute;
  top: -9px;
  width: 24px;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: transparent;
  content: "";
}

.bottom-nav button.is-active { color: var(--paper); }
.bottom-nav button.is-active::before { background: var(--acid); box-shadow: 0 0 12px rgba(184,255,90,.5); }
.bottom-nav button.is-active svg { color: var(--acid); }
.bottom-nav svg { width: 20px; }

.journal-preview {
  margin: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--paper-soft);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.65rem;
  line-height: 1.55;
}

.journal-panel { display: grid; gap: 10px; }
.journal-state { margin: 0; color: var(--muted); font-size: 0.65rem; }
.journal-state:empty { display: none; }
.journal-state[data-state="initial-error"],
.journal-state[data-state="page-error"] { color: var(--red); }
.journal-list { display: grid; gap: 8px; }
.journal-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--paper);
  text-align: left;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}
.journal-item > span:first-child { display: grid; min-width: 0; gap: 4px; }
.journal-item b { font-family: var(--mono); font-size: 0.68rem; }
.journal-item small { color: var(--muted); font-size: 0.56rem; overflow-wrap: anywhere; white-space: normal; }
.journal-item .journal-meta { color: var(--paper-soft); font-family: var(--mono); font-size: 0.49rem; }
.journal-status { color: var(--acid); font-family: var(--mono); font-size: 0.52rem; }

.sheet-backdrop {
  position: fixed;
  z-index: 99;
  inset: 0;
  visibility: hidden;
  background: rgba(0, 0, 0, 0.58);
  opacity: 0;
  backdrop-filter: blur(5px);
  transition: 240ms ease;
}

.sheet-backdrop.is-visible { visibility: visible; opacity: 1; }

.bottom-sheet {
  position: fixed;
  z-index: 100;
  bottom: 0;
  left: 50%;
  width: min(100%, 680px);
  max-height: min(82vh, 680px);
  padding: 25px 20px calc(var(--safe-bottom) + 22px);
  overflow-y: auto;
  transform: translate(-50%, 105%);
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 30px 30px 0 0;
  background: #13231f;
  box-shadow: 0 -30px 90px rgba(0, 0, 0, 0.45);
  transition: transform 380ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.bottom-sheet.is-visible { transform: translate(-50%, 0); }
.sheet-handle { position:absolute; top:9px; left:50%; width:38px; height:3px; transform:translateX(-50%); border-radius:99px; background:rgba(255,255,255,.15); }
.sheet-close { position:absolute; top:17px; right:18px; display:grid; width:35px; height:35px; padding:0; place-items:center; border:1px solid var(--line); border-radius:50%; color:var(--muted); background:rgba(255,255,255,.025); cursor:pointer; }
.sheet-close svg { width:15px; }
.sheet-icon { display:grid; width:45px; height:45px; margin-bottom:23px; place-items:center; border-radius:14px; color:var(--acid); background:var(--acid-soft); }
.sheet-icon svg { width:21px; }
.bottom-sheet .eyebrow { margin-bottom:7px; }
.bottom-sheet h2 { max-width:85%; margin:0; font-family:var(--display); font-size:2rem; font-weight:400; letter-spacing:-.045em; }
.sheet-content { margin:16px 0 22px; color:var(--paper-soft); font-size:.72rem; line-height:1.65; }
.sheet-content p { margin:0 0 11px; }
.sheet-content ul { display:grid; gap:9px; margin:12px 0; padding:0; list-style:none; }
.sheet-content li { position:relative; padding-left:19px; }
.sheet-content li::before { position:absolute; top:.65em; left:2px; width:5px; height:5px; border-radius:50%; background:var(--acid); content:""; }
.sheet-content code { padding:2px 5px; border-radius:5px; color:var(--acid); background:var(--acid-soft); font-family:var(--mono); font-size:.86em; }

.toast {
  position: fixed;
  z-index: 120;
  top: calc(var(--safe-top) + 72px);
  left: 50%;
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 9px;
  padding: 0 14px;
  transform: translate(-50%, -20px);
  border: 1px solid rgba(184,255,90,.2);
  border-radius: 999px;
  color: var(--paper);
  background: rgba(18,35,31,.94);
  box-shadow: 0 12px 35px rgba(0,0,0,.3);
  font-size:.65rem;
  opacity:0;
  pointer-events:none;
  transition:200ms ease;
}
.toast.is-visible { transform:translate(-50%,0); opacity:1; }
.toast svg { width:15px; color:var(--acid); }

@media (min-width: 681px) {
  body { padding: 28px 0; }
  .app-shell { min-height: calc(100vh - 56px); border: 1px solid var(--line); border-radius: 34px; background: rgba(7,17,15,.68); box-shadow: 0 40px 120px rgba(0,0,0,.42); }
  .topbar { top: 28px; border-radius: 34px 34px 0 0; }
  .bottom-nav { bottom: 28px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 0 0 34px 34px; }
  .bottom-sheet { bottom: 28px; border-radius: 30px; }
}

@media (max-width: 390px) {
  .app-shell { padding-right: 14px; padding-left: 14px; }
  .brand-copy span { display: none; }
  .page-intro h1 { font-size: 2.48rem; }
  .decision-card { padding: 16px; }
  .instrument-symbol { font-size: 1.28rem; }
  .quote-block strong { font-size: .85rem; }
  .decision-orbit { height: 150px; }
  .decision-metrics span { font-size: .49rem; }
  .decision-metrics strong { font-size: .68rem; }
  .action-card { min-height: 145px; }
  .trade-form { padding: 15px; }
  .price-grid { grid-template-columns: 1fr; }
  .scenario-caption { display:grid; }
  .scenario-caption small { text-align:left; }
  .portfolio-kpis { grid-template-columns: 1fr 1fr; }
  .portfolio-kpis article:last-child { grid-column:1 / -1; min-height:86px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* TASK 036C.2 — beginner-first, server-owned monetary result */
.guided-result {
  display: grid;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
  padding: 2px 0 28px;
}

.guided-result__lead { padding: 8px 0 2px; }
.guided-result__icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 13px;
  place-items: center;
  border-radius: 12px;
  color: var(--mint);
  background: rgba(128, 255, 212, 0.12);
  font-size: 1.15rem;
}
.guided-result--blocked .guided-result__icon,
.guided-result--error .guided-result__icon { color: #ff9b8f; background: rgba(255, 120, 109, 0.13); }
.guided-result--warning .guided-result__icon { color: #ffd56e; background: rgba(255, 213, 110, 0.13); }
.guided-result__lead .eyebrow { margin: 0 0 8px; color: var(--mint); }
.guided-result--blocked .guided-result__lead .eyebrow,
.guided-result--error .guided-result__lead .eyebrow { color: #ff9b8f; }
.guided-result--warning .guided-result__lead .eyebrow { color: #ffd56e; }
.guided-result__lead h2 {
  max-width: 17ch;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 9vw, 3.15rem);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 0.94;
}
.guided-result__summary { max-width: 48ch; margin: 12px 0 0; color: var(--paper-soft); font-size: 0.76rem; line-height: 1.55; }
.answer-strip,
.position-result,
.capital-result,
.outcome-card,
.constraint-card-ui,
.capacity-card-ui,
.unavailable-card,
.next-card-ui,
.result-disclosure {
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(18, 35, 31, 0.82);
}
.answer-strip { display: grid; gap: 8px; padding: 17px; }
.answer-strip span,
.position-result > span,
.capital-result > span,
.outcome-card > span,
.section-label,
.next-card-ui > span { color: var(--muted); font-size: 0.62rem; letter-spacing: 0.02em; }
.answer-strip b { color: var(--mint); font-size: 0.87rem; line-height: 1.35; }
.guided-result--blocked .answer-strip b,
.guided-result--error .answer-strip b { color: #ff9b8f; }
.guided-result--warning .answer-strip b { color: #ffd56e; }
.position-result { padding: 20px 17px; border-color: rgba(128, 255, 212, 0.3); background: linear-gradient(145deg, rgba(128,255,212,.09), rgba(18,35,31,.82)); }
.position-result strong { display: block; margin-top: 7px; overflow-wrap: anywhere; font-family: var(--display); font-size: clamp(2.2rem, 12vw, 4.4rem); font-weight: 400; letter-spacing: -0.055em; line-height: 1; }
.position-result p,
.capital-result p,
.capacity-note,
.unavailable-copy,
.unavailable-card p { margin: 7px 0 0; color: var(--muted); font-size: .61rem; line-height: 1.45; }
.capital-result { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: baseline; gap: 8px 14px; padding: 15px 2px 11px; border-width: 0 0 1px; border-radius: 0; background: transparent; }
.capital-result strong { min-width: 0; max-width: 100%; font-family: var(--display); font-size: clamp(1.4rem, 7vw, 2.15rem); font-weight: 400; text-align: right; }
.capital-result p { grid-column: 1 / -1; }
.outcome-section { display: grid; gap: 9px; }
.section-label { margin: 0; text-transform: uppercase; letter-spacing: .1em; }
.outcome-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.outcome-card { display: grid; min-width: 0; gap: 8px; padding: 15px; }
.outcome-card strong { min-width: 0; max-width: 100%; font-family: var(--display); font-size: clamp(1.2rem, 5.5vw, 1.65rem); font-weight: 400; line-height: 1.05; }
.outcome-card small { color: var(--paper-soft); font-size: .64rem; }
.outcome-card--stop { border-color: rgba(255,120,109,.32); }
.outcome-card--stop strong { color: #ff9b8f; }
.outcome-card--target { border-color: rgba(128,255,212,.32); }
.outcome-card--target strong { color: #9df1be; }
.constraint-card-ui,
.capacity-card-ui,
.unavailable-card,
.next-card-ui { padding: 17px; }
.constraint-card-ui { display: grid; gap: 0; border-color: rgba(255,189,107,.35); }
.constraint-card-ui > div,
.capacity-total { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.constraint-card-ui > div span,
.capacity-card-ui span { color: var(--muted); font-size: .62rem; }
.constraint-card-ui > div strong,
.capacity-card-ui strong { min-width: 0; text-align: right; }
.capacity-card-ui { display: grid; gap: 9px; }
.capacity-amounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.capacity-amounts > div { display: grid; gap: 5px; padding: 12px; border-radius: 13px; background: rgba(128,255,212,.055); }
.capacity-amounts strong { text-align: left; }
.capacity-amounts > div { min-width: 0; }

strong.exact-value,
b.exact-value {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  word-break: normal;
  white-space: normal;
}
.exact-value__assistive {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.exact-value__visual {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
  gap: .06em .19em;
  overflow: visible;
  word-break: normal;
  white-space: normal;
}
.exact-value__group { display: inline-block; max-width: 100%; white-space: nowrap; }
.position-result strong.exact-value .exact-value__visual,
.outcome-card strong.exact-value .exact-value__visual,
.capacity-amounts strong.exact-value .exact-value__visual,
.capital-card > strong.exact-value .exact-value__visual,
.portfolio-kpis strong.exact-value .exact-value__visual { justify-content: flex-start; }
.capital-legend b.exact-value .exact-value__visual { justify-content: flex-start; }
.constraint-card-ui > div strong.exact-value,
.capacity-total strong.exact-value { flex: 1 1 45%; }
.unavailable-card { border-color: rgba(255,189,107,.28); }
.unavailable-card b { color: #ffd56e; }
.result-disclosure { overflow: hidden; }
.result-disclosure summary { padding: 17px; cursor: pointer; font-size: .72rem; font-weight: 700; list-style: none; }
.result-disclosure summary::-webkit-details-marker { display: none; }
.result-disclosure summary::after { float: right; color: var(--mint); content: "+"; font-size: 1.05rem; }
.result-disclosure[open] summary::after { content: "−"; }
.disclosure-content { padding: 0 17px 12px; }
.disclosure-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.disclosure-row span { color: var(--muted); font-size: .61rem; }
.disclosure-row b { overflow-wrap: anywhere; font-size: .62rem; line-height: 1.4; text-align: right; }
.result-disclosure--technical .disclosure-row b { font-family: var(--mono); font-size: .54rem; }
.next-card-ui { display: grid; gap: 7px; margin-top: 2px; border-color: rgba(128,255,212,.24); background: rgba(128,255,212,.08); }
.next-card-ui b { font-size: 1rem; }
.next-card-ui p { margin: 0; color: var(--paper-soft); font-size: .66rem; line-height: 1.5; overflow-wrap: anywhere; }
.decision-note { margin: 4px 10px 0; color: var(--muted); font-size: .58rem; line-height: 1.5; text-align: center; }
.journal-item .journal-money { color: var(--paper-soft); overflow: visible; text-overflow: clip; white-space: normal; line-height: 1.45; }
.has-guided-result .scenario-switcher,
.has-guided-result .trade-form { display: none; }
.has-guided-result .analysis-header,
.has-guided-result .demo-notice,
.has-guided-result .bottom-nav { display: none; }
.has-guided-result .app-shell { padding-bottom: calc(var(--safe-bottom) + 96px); }
.result-action { position: fixed; z-index: 70; right: 0; bottom: 0; left: 0; width: min(100%, 680px); margin: 0 auto; padding: 12px 18px calc(var(--safe-bottom) + 12px); border-top: 1px solid var(--line); background: #07110f; }
.result-action .primary-button { margin: 0; }

.scenario-switcher { display: none; }
.trade-form { border-radius: 24px; }
.guided-progress { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; margin-bottom: 24px; }
.guided-progress span { color: var(--mint); font-family: var(--mono); font-size: .56rem; letter-spacing: .08em; text-transform: uppercase; }
.guided-progress b { font-size: .68rem; }
.guided-progress i { grid-column: 1 / -1; height: 3px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.guided-progress i::after { display: block; width: calc(var(--guided-step) * 25%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), var(--acid)); content: ""; transition: width 220ms ease; }
.guided-question { margin-bottom: 22px; }
.guided-question .eyebrow { margin: 0 0 7px; color: var(--mint); }
.guided-question h2 { margin: 0; font-family: var(--display); font-size: clamp(2rem, 8vw, 2.8rem); font-weight: 400; letter-spacing: -.05em; line-height: 1; }
.guided-question > p:last-child { margin: 9px 0 0; color: var(--paper-soft); font-size: .7rem; line-height: 1.5; }
.guided-panel[hidden] { display: none; }
.guided-key-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.guided-review { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; }
.guided-review > div { display: flex; justify-content: space-between; gap: 18px; padding: 12px 14px; border-top: 1px solid var(--line); }
.guided-review > div:first-child { border-top: 0; }
.guided-review span { color: var(--muted); font-size: .62rem; }
.guided-review strong { overflow-wrap: anywhere; font-size: .66rem; text-align: right; }
.guided-controls { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; margin-top: 18px; }
.guided-controls .secondary-button { width: auto; margin: 0; padding-inline: 18px; }
.guided-controls .primary-button { margin: 0; }
.guided-controls [hidden] + .primary-button { grid-column: 1 / -1; }

@media (max-width: 430px) {
  .guided-key-fields { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .capital-result { grid-template-columns: 1fr; }
  .capital-result strong { text-align: left; }
  .capital-result p { grid-column: 1; }
}

@media (min-width: 681px) {
  .result-action { bottom: 28px; border: 1px solid var(--line); border-top-color: var(--line-strong); border-radius: 0 0 34px 34px; }
}

@media (max-width: 390px) {
  .outcome-grid { grid-template-columns: 1fr; }
  .guided-result__lead h2 { font-size: 2.25rem; }
}
