/* One decision at a time, with the account details kept close to their purpose. */
#page-content {
  min-width: 0;
}

#journey-view {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 760px;
  min-height: 100svh;
  margin-inline: auto;
  padding-block: 56px 136px;
  text-align: center;
  overflow-wrap: anywhere;
}

#journey-view > section {
  width: 100%;
  min-width: 0;
}

#journey-view h1 {
  max-width: 740px;
  margin: 0 auto 28px;
  font-size: clamp(38px, 4.7vw, 62px);
  line-height: 1.12;
  letter-spacing: -.045em;
  color: var(--fg);
  text-wrap: balance;
}

#journey-view h2 {
  margin-bottom: 18px;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.18;
}

#journey-view h3 {
  margin-bottom: 16px;
  font-size: 26px;
  line-height: 1.3;
}

#journey-view p {
  text-wrap: pretty;
}

#journey-view .j-intro h1 {
  font-size: clamp(48px, 5.7vw, 78px);
  margin-bottom: 34px;
  line-height: 1.08;
  font-style: normal;
}

#journey-view .j-intro h1 em {
  font-style: italic;
  font-weight: 400;
}

#journey-view .child-name-0 {
  color: var(--liah);
}

#journey-view .child-name-1 {
  color: var(--milan);
}

.j-intro > .j-help {
  max-width: 590px;
  margin-bottom: 30px;
  color: var(--fg);
  font-size: 17px;
  line-height: 1.75;
}

.j-intro > p:has(> .j-link) {
  margin-block: 6px;
}

.j-intro .j-link[href="#history"] {
  font-size: 17px;
  font-weight: 600;
  margin-top: 8px;
}

.j-people,
.j-education {
  margin: 20px auto;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.j-education bdi {
  font-weight: 600;
}

.j-intro > .j-footnote {
  margin-top: 28px;
}

.j-question {
  max-width: 680px;
  margin-inline: auto;
}

.j-owner {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 22px;
}

.j-help {
  max-width: 570px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.j-choices {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 11px;
  max-width: 450px;
  margin: 34px auto 0;
}

.j-choices button {
  min-width: 0;
  min-height: 56px;
  padding: 15px 22px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font-size: 16px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.j-choices button:hover {
  border-color: var(--fg);
  background: var(--surface);
}

.j-choices button[aria-pressed="true"] {
  border-color: var(--fg);
  background: var(--surface);
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--fg);
}

.j-answer {
  max-width: 420px;
  margin: 35px auto 10px;
}

.j-answer input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 82px;
  padding: 13px 16px;
  border: 0;
  border-bottom: 1px solid var(--fg);
  border-radius: 0;
  background: transparent;
  font-size: clamp(34px, 4.8vw, 60px);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: -.045em;
  text-align: center;
  appearance: textfield;
}

.j-answer input::-webkit-inner-spin-button,
.j-answer input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.j-answer input::placeholder {
  color: var(--muted);
  opacity: 1;
  font-size: 24px;
  letter-spacing: 0;
}

.j-answer input[type="month"] {
  min-height: 66px;
  padding-inline: 10px;
  font-size: 25px;
  letter-spacing: -.02em;
}

.j-answer input[type="text"] {
  font-family: var(--serif);
  font-size: 38px;
  letter-spacing: -.02em;
}

.j-unit {
  margin: 16px auto 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.j-cadence,
.j-setting {
  display: grid;
  gap: 10px;
  max-width: 420px;
  margin: 28px auto 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.j-cadence select,
.j-setting select {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
}

.j-link,
#copy-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font: 14px/1.6 var(--sans);
  text-align: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  overflow-wrap: anywhere;
}

.j-link:hover,
#copy-close:hover {
  color: var(--accent);
}

.j-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 28px;
  min-width: 0;
  margin: 23px auto 10px;
}

.j-error {
  max-width: 570px;
  min-height: 0;
  margin: 18px auto 0;
  color: var(--warning);
  font-size: 14px;
  line-height: 1.6;
}

.j-error:empty {
  margin: 0;
}

.j-question > .j-link {
  margin-top: 18px;
}

.j-errors {
  padding-inline-start: 22px;
  text-align: start;
  color: var(--warning);
  font-size: 15px;
  line-height: 1.75;
}

.j-child-summary {
  min-width: 0;
  margin: 42px auto 0;
  padding-block: 30px 10px;
  border-top: 1px solid var(--line);
}

.j-child-summary + .j-child-summary {
  margin-top: 36px;
}

.j-amounts,
.j-example-value {
  max-width: 640px;
  margin: 18px auto;
  font: 26px/1.5 var(--serif);
  letter-spacing: -.02em;
  color: var(--fg);
}

.j-result-note,
.j-footnote {
  max-width: 600px;
  margin: 12px auto;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}

.j-state {
  max-width: 600px;
  margin: 24px auto 16px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--fg);
}

.j-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  max-width: 670px;
  margin: 24px auto 22px;
  padding-block: 20px;
  border-block: 1px solid var(--line);
}

.j-comparison > div {
  min-width: 0;
  padding-inline: 18px;
  container-type: inline-size;
}

.j-comparison > div + div {
  border-inline-start: 1px solid var(--line);
}

.j-comparison dt {
  min-width: 0;
  margin-bottom: 13px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.j-comparison dd {
  min-width: 0;
  margin: 0;
  font: clamp(20px, 4vw, 43px)/1.3 var(--sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

@supports (font-size: 1cqi) {
  .j-comparison dd {
    font-size: clamp(16px, 17cqi, 43px);
  }
}

.j-delta {
  margin: 18px auto;
  max-width: 600px;
  font: 24px/1.45 var(--serif);
  letter-spacing: -.015em;
}

.j-disclosure {
  margin: 27px auto 0;
  max-width: 710px;
  border-block: 1px solid var(--line);
  text-align: start;
}

.j-disclosure + .j-disclosure {
  margin-top: 0;
  border-top: 0;
}

.j-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  padding-block: 16px;
  list-style: none;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.5;
}

.j-disclosure > summary::-webkit-details-marker {
  display: none;
}

.j-disclosure > summary::after {
  content: '+';
  flex-shrink: 0;
  font: 25px/1 var(--sans);
}

.j-disclosure[open] > summary::after {
  content: '−';
}

.j-disclosure[open] {
  padding-bottom: 24px;
}

.j-disclosure[open] > summary {
  margin-bottom: 12px;
}

.j-disclosure .j-help,
.j-disclosure .j-footnote {
  max-width: none;
  margin-inline: 0;
  margin-bottom: 15px;
}

.j-disclosure > section + section {
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.j-disclosure .j-setting {
  margin-inline: 0;
}

.j-next-action {
  max-width: 620px;
  margin: 25px auto 0;
  padding: 24px 27px;
  background: var(--surface);
  text-align: start;
}

#journey-view .j-next-action h3 {
  margin-bottom: 13px;
  font: 13px/1.5 var(--sans);
  color: var(--muted);
  letter-spacing: 0;
}

.j-next-action .j-help {
  margin: 0;
  color: var(--fg);
  font-size: 18px;
  line-height: 1.7;
}

.j-actions-list {
  display: grid;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  line-height: 1.75;
}

.j-actions-list li + li {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.j-outside {
  max-width: 620px;
  margin: 32px auto 0;
  text-align: start;
}

.j-outside .j-help,
.j-outside .j-footnote {
  margin-inline: 0;
  margin-bottom: 16px;
}

.j-table {
  max-width: 100%;
  max-height: 430px;
  margin-top: 20px;
  overflow: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.j-table table {
  width: 100%;
  min-width: 590px;
  font-variant-numeric: tabular-nums;
}

.j-table caption {
  padding: 14px 0;
  text-align: start;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.j-table th,
.j-table td {
  padding: 13px 12px;
}

.j-sources {
  margin: 26px auto 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.j-sources a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  padding-block: 8px;
  text-underline-offset: 3px;
}

.j-guide .glossary {
  margin: 0;
}

.j-guide .glossary > div:last-child {
  margin-bottom: 0;
}

.sidebar .page-menu a,
.sidebar .quiet-button,
.sidebar .theme-picker button,
.sidebar .reading-picker select {
  min-height: 44px;
}

.sidebar .page-menu a {
  display: flex;
  align-items: center;
}

.page-arrows {
  min-height: 87px;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
}

.page-arrows button {
  max-width: 48%;
  min-height: 44px;
  min-width: 0;
}

.page-arrows .arrow-label {
  overflow-wrap: anywhere;
  text-align: start;
}

#copy-dialog {
  width: min(720px, calc(100% - 32px));
  padding: 30px;
}

#copy-dialog h2 {
  margin: 0 0 22px;
  font-size: 30px;
}

#copy-text {
  display: block;
  width: 100%;
  min-height: 280px;
  height: min(52svh, 520px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--fg);
  font: 15px/1.7 var(--sans);
  resize: vertical;
}

#copy-text:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

#copy-close {
  margin-top: 16px;
}

#print-plan {
  display: none;
}

html[dir="rtl"] #journey-view h1,
html[dir="rtl"] #journey-view h2,
html[dir="rtl"] #journey-view h3 {
  line-height: 1.6;
  letter-spacing: 0;
}

html[dir="rtl"] #journey-view .j-intro h1 em {
  font-style: normal;
}

html[dir="rtl"] .j-amounts,
html[dir="rtl"] .j-delta,
html[dir="rtl"] .j-example-value,
html[dir="rtl"] .j-comparison dd,
html[dir="rtl"] .j-answer input {
  letter-spacing: 0;
}

html[dir="rtl"] .j-answer input[type="number"],
html[dir="rtl"] .j-answer input[type="month"] {
  font-family: Arial, Helvetica, sans-serif;
}

@media (max-width: 1100px) {
  #journey-view {
    padding-block: 44px 130px;
  }

  .sidebar .page-menu {
    gap: 7px;
  }
}

@media (max-width: 740px) {
  #journey-view {
    padding-block: 35px 124px;
  }

  #journey-view h1 {
    margin-bottom: 23px;
    font-size: clamp(31px, 4.8vw, 43px);
    line-height: 1.16;
    letter-spacing: -.035em;
  }

  #journey-view .j-intro h1 {
    margin-bottom: 28px;
    font-size: clamp(35px, 5.6vw, 49px);
    line-height: 1.12;
  }

  #journey-view h2 {
    font-size: 30px;
  }

  #journey-view h3 {
    font-size: 23px;
  }

  .j-help,
  .j-intro > .j-help {
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.75;
  }

  .j-owner {
    margin-bottom: 18px;
    font-size: 12px;
  }

  .j-people,
  .j-education {
    font-size: 13px;
  }

  .j-choices {
    gap: 10px;
    margin-top: 26px;
  }

  .j-choices button {
    min-height: 53px;
    padding: 13px 12px;
    font-size: 14px;
  }

  .j-answer {
    margin-top: 25px;
  }

  .j-answer input {
    min-height: 72px;
    padding-inline: 5px;
    font-size: 40px;
  }

  .j-answer input[type="month"] {
    min-height: 56px;
    padding-inline: 0;
    font-size: 19px;
  }

  .j-answer input[type="text"] {
    font-size: 30px;
  }

  .j-answer input::placeholder {
    font-size: 20px;
  }

  .j-link,
  .j-error {
    font-size: 13px;
  }

  .j-cadence,
  .j-setting {
    margin-top: 24px;
    font-size: 12px;
  }

  .j-child-summary {
    margin-top: 32px;
    padding-top: 24px;
  }

  .j-child-summary + .j-child-summary {
    margin-top: 29px;
  }

  .j-amounts,
  .j-example-value {
    font-size: 23px;
    line-height: 1.45;
  }

  .j-result-note,
  .j-footnote,
  .j-unit {
    font-size: 12px;
  }

  .j-state {
    margin-top: 20px;
    font-size: 14px;
  }

  .j-comparison {
    padding-block: 16px;
  }

  .j-comparison > div {
    padding-inline: 8px;
  }

  .j-comparison dt {
    font-size: 12px;
    margin-bottom: 12px;
  }

  .j-delta {
    font-size: 22px;
  }

  .j-disclosure {
    margin-top: 23px;
  }

  .j-disclosure > summary {
    min-height: 54px;
    font-size: 13px;
    gap: 12px;
    padding-block: 14px;
  }

  .j-next-action {
    margin-top: 21px;
    padding: 20px 16px;
  }

  .j-next-action .j-help {
    font-size: 16px;
  }

  .j-actions-list {
    font-size: 14px;
    gap: 18px;
  }

  .j-links {
    flex-direction: column;
    gap: 3px;
    align-items: center;
  }

  .j-outside {
    margin-top: 27px;
  }

  .j-sources {
    font-size: 11px;
  }

  .sidebar .page-menu {
    margin-block: 22px;
    gap: 3px;
  }

  .sidebar .theme-picker {
    gap: 0;
  }

  .page-arrows {
    min-height: 83px;
    padding-top: 13px;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .page-arrows button {
    gap: 7px;
  }

  #copy-dialog {
    padding: 23px;
  }

  #copy-dialog h2 {
    font-size: 25px;
  }

  #copy-text {
    padding: 12px;
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  #journey-view {
    padding-block: 30px 125px;
  }

  #journey-view h1 {
    font-size: 31px;
  }

  #journey-view .j-intro h1 {
    font-size: 35px;
  }

  .sidebar .page-menu a {
    font-size: 12px;
  }

  .j-comparison > div {
    padding-inline: 5px;
  }

  .j-comparison dd {
    letter-spacing: -.025em;
  }

  .j-next-action {
    padding-inline: 13px;
  }

  .page-arrows .arrow-label {
    max-width: 70px;
  }
}

@media (max-height: 650px) {
  #journey-view {
    justify-content: flex-start;
  }

  .sidebar .page-menu {
    flex: 0 0 auto;
    margin-block: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .j-view,
  .j-choices button {
    scroll-behavior: auto;
    transition: none;
  }
}

@media print {
  @page {
    margin: 18mm;
  }

  body > :not(#print-plan) {
    display: none !important;
  }

  html,
  body {
    background: white !important;
    color: black !important;
    font-size: 11pt;
  }

  #print-plan {
    display: block !important;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    color: black;
    background: white;
    overflow-wrap: anywhere;
  }

  #print-plan p {
    margin: 0 0 9pt;
    font: 11pt/1.5 var(--sans);
    orphans: 3;
    widows: 3;
  }

  #print-plan p:first-child {
    font: 23pt/1.3 var(--serif);
    margin-bottom: 20pt;
  }
}
