:root {
  color-scheme: light;
  --ink: #15181d;
  --muted: #66717f;
  --line: #d9e0e6;
  --surface: #ffffff;
  --panel: #f7f8fa;
  --field: #eef2f5;
  --green: #08785f;
  --green-soft: #dbeee8;
  --red: #9c2e35;
  --red-soft: #f5dedf;
  --blue: #235f9b;
  --shadow: 0 20px 60px rgba(19, 31, 45, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(8, 120, 95, 0.12), transparent 32rem),
    linear-gradient(180deg, #eef2f5 0%, #fbfcfd 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

.phone-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom));
}

.app-header,
.result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-header {
  padding: 10px 2px 18px;
}

.reset-button {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.reset-button:hover,
.reset-button:focus {
  border-color: rgba(156, 46, 53, 0.28);
  color: var(--red);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: none;
  font-size: 2.15rem;
  line-height: 1.05;
  white-space: nowrap;
}

h2 {
  font-size: 1.22rem;
  line-height: 1.14;
}

.action-chip {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 0.76rem;
  font-weight: 850;
}

.trial-banner,
.quote-panel,
.result-panel,
.pay-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.trial-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 14px;
}

.trial-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.trial-copy span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.trial-copy strong {
  font-size: 1rem;
}

.trial-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.trial-price {
  color: #42505e;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.15;
  text-align: right;
}

.pay-link {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid rgba(35, 95, 155, 0.22);
  border-radius: 999px;
  padding: 0 12px;
  background: #eef5fb;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
  cursor: pointer;
}

.quote-panel {
  display: grid;
  gap: 15px;
  padding: 16px;
}

.form-block {
  display: grid;
  gap: 14px;
}

.choice-block {
  padding-bottom: 15px;
  border-bottom: 1px solid #e8edf2;
}

.section-title h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.18;
}

.field {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.field span,
legend {
  color: #27313d;
  font-size: 0.86rem;
  font-weight: 850;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-label em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 7px;
  background: #e9edf2;
  color: #566372;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.required-field .field-label em {
  background: #fff0d8;
  color: #85520b;
}

.required-field input,
.required-field select {
  border-color: #cbd7e1;
  background: #ffffff;
  box-shadow: inset 4px 0 0 #235f9b;
}

.voice-chain-panel {
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid #dce7ef;
  border-radius: 8px;
  padding: 10px;
  background: #f7fbfc;
}

.voice-chain-panel[hidden] {
  display: none;
}

.voice-button {
  display: grid;
  place-items: center;
  min-height: 50px;
  border: 1px solid rgba(35, 95, 155, 0.22);
  border-radius: 8px;
  background: #eef5fb;
  color: var(--blue);
  cursor: pointer;
}

.voice-button span {
  width: 18px;
  height: 24px;
  overflow: hidden;
  font-size: 0;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: currentColor;
  box-shadow: inset 0 -8px 0 #eef5fb;
}

.voice-button span::after {
  content: "";
  display: block;
  width: 12px;
  height: 8px;
  margin: 18px auto 0;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  border-radius: 0 0 8px 8px;
}

.voice-button.is-listening {
  background: var(--green-soft);
  color: var(--green);
}

.help-text {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.35;
}

.help-text.chain-guidance {
  font-size: 0.66rem;
  font-weight: 400;
}

.help-text strong {
  color: #27313d;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.side-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.help-hover {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef5fb;
  color: var(--blue);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: help;
}

.chain-paste-example {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: min(340px, calc(100vw - 48px));
  max-height: min(420px, calc(100vh - 160px));
  overflow: auto;
  display: none;
  border: 1px solid rgba(35, 95, 155, 0.22);
  border-radius: 8px;
  padding: 9px 10px;
  background: #f5f9fc;
  color: #17212d;
  box-shadow: 0 8px 20px rgba(24, 39, 54, 0.08);
  text-align: left;
  text-transform: none;
}

.help-hover:hover .chain-paste-example,
.help-hover:focus .chain-paste-example,
.help-hover:focus-within .chain-paste-example {
  display: grid;
  gap: 6px;
}

.chain-paste-example strong {
  color: var(--blue);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.chain-paste-example code {
  white-space: pre-wrap;
  color: #17212d;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.25;
}

.chain-paste-example .help-columns {
  color: #7d8792;
  font-weight: 700;
}

.chain-paste-example .help-note {
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 800;
}

.chain-date-status {
  display: block;
  border-radius: 8px;
  padding: 9px 10px;
  background: #eef5fb;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.35;
}

.chain-upload-checklist {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chain-upload-checklist li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #e8edf2;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
}

.chain-upload-checklist li::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
}

.chain-upload-checklist .is-present {
  border-color: rgba(41, 117, 82, 0.26);
  background: #f3faf6;
  color: var(--green);
}

.chain-upload-checklist .is-missing {
  border-color: rgba(156, 46, 53, 0.28);
  background: #fff7f7;
  color: var(--red);
}

.chain-upload-checklist .is-optional {
  border-color: #e8edf2;
  background: #f6f7f8;
  color: var(--muted);
}

.chain-upload-checklist span {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
}

.chain-upload-checklist small {
  color: inherit;
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.25;
  opacity: 0.82;
}

.chain-upload-checklist em {
  flex: 0 0 auto;
  max-width: 56%;
  font-style: normal;
  text-transform: uppercase;
  font-size: 0.62rem;
  letter-spacing: 0;
  text-align: right;
}

.review-checklist {
  margin-top: 12px;
}

.chain-upload-summary {
  display: grid;
  gap: 10px;
  border-top: 1px solid #e8edf2;
  padding-top: 14px;
}

.chain-derived-lines {
  display: grid;
  gap: 7px;
  margin: 0;
}

.chain-derived-lines div {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid #e8edf2;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.chain-derived-lines dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.chain-derived-lines dd {
  margin: 0;
  color: #27313d;
  font-size: 0.86rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.chain-derived-lines .date-horizon-lines {
  white-space: pre-line;
  line-height: 1.35;
}

.ready-message {
  margin: 0;
  border-radius: 8px;
  padding: 10px;
  background: #fff7ed;
  color: #8a4b0f;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
}

.ready-message.is-ready {
  background: var(--green-soft);
  color: var(--green);
}

input,
select,
textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: var(--field);
  color: var(--ink);
  outline: 0;
}

textarea {
  min-height: 74px;
  padding: 12px 13px;
  resize: vertical;
}

input {
  font-size: 1.18rem;
  font-weight: 850;
}

.derived-field input[readonly] {
  background: #f4f7f5;
  color: #27313d;
  cursor: default;
}

.derived-field input[readonly]::placeholder {
  color: var(--muted);
  font-weight: 700;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35, 95, 155, 0.14);
}

input.field-error,
select.field-error,
textarea.field-error {
  border-color: var(--red);
  background: #fff7f7;
  box-shadow: inset 4px 0 0 var(--red), 0 0 0 3px rgba(156, 46, 53, 0.14);
}

.manual-market-data {
  display: grid;
  gap: 13px;
}

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

.vol-context-grid input {
  min-height: 44px;
  font-size: 0.92rem;
  font-weight: 650;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.segmented label {
  position: relative;
}

.segmented input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.segmented span {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--muted);
}

.segmented input:checked + span {
  border-color: rgba(8, 120, 95, 0.26);
  background: var(--green-soft);
  color: var(--green);
}

.segmented label:last-child input:checked + span {
  border-color: rgba(156, 46, 53, 0.22);
  background: var(--red-soft);
  color: var(--red);
}

#reviewButton {
  display: grid;
  place-items: center;
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

#reviewButton.is-ready {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(41, 117, 82, 0.16), 0 10px 24px rgba(41, 117, 82, 0.18);
}

#reviewButton:disabled {
  cursor: wait;
  background: #7b8591;
}

.result-panel,
.pay-panel {
  margin-top: 14px;
  padding: 16px;
}

.pay-panel {
  display: grid;
  gap: 13px;
  background: #fbfaf7;
}

.pay-panel[hidden] {
  display: none;
}

.pay-panel p:not(.eyebrow):not(.data-note) {
  color: #2b3642;
  font-size: 0.94rem;
  line-height: 1.42;
}

#checkoutButton {
  display: grid;
  place-items: center;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.action-chip {
  background: var(--green-soft);
  color: var(--green);
}

.action-chip[data-action="sell"] {
  background: #fff0d8;
  color: #85520b;
}

.action-chip[data-action="hold"] {
  background: #e9edf2;
  color: #566372;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 15px 0;
}

.metric-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 9px;
  background: var(--panel);
}

.metric-grid span,
dt,
.data-note {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.metric-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.recommendation {
  display: grid;
  gap: 14px;
}

.recommendation p {
  color: #2b3642;
  font-size: 0.96rem;
  line-height: 1.45;
}

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

dl div {
  border-top: 1px solid #e8edf2;
  padding-top: 10px;
}

dt {
  margin-bottom: 4px;
  text-transform: uppercase;
}

dd {
  margin: 0;
  color: #27313d;
  font-size: 0.9rem;
  line-height: 1.42;
}

.catalyst-panel {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  border-top: 1px solid #e8edf2;
  padding-top: 13px;
}

.strategy-panel,
.execution-panel,
.volatility-panel {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  border-top: 1px solid #e8edf2;
  padding-top: 13px;
}

.strategy-lines dd,
.execution-lines dd,
.volatility-lines dd {
  font-weight: 650;
}

.section-title h3 {
  margin: 0;
  font-size: 1rem;
}

.event-risk-list {
  display: grid;
  gap: 10px;
}

.event-section {
  display: grid;
  gap: 8px;
}

.event-section header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.event-section h4 {
  margin: 0;
  color: #27313d;
  font-size: 0.82rem;
}

.event-section header span,
.empty-note {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-align: right;
}

.event-section ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-section li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #e8edf2;
  border-radius: 8px;
  padding: 9px;
  background: var(--panel);
}

.event-section li div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.event-section li strong {
  color: #27313d;
  font-size: 0.8rem;
}

.event-section li span,
.event-section li em,
.muted-row {
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  line-height: 1.25;
}

.event-section li em {
  flex: 0 0 auto;
  font-weight: 850;
}

.event-section li.ranked-event em {
  color: var(--red);
}

.event-section .muted-row {
  display: block;
}

.data-note {
  margin-top: 14px;
  line-height: 1.4;
}

@media (min-width: 760px) {
  .phone-shell {
    padding-top: 34px;
  }
}
