/* css/pages/issue.css: the Issue a bond page (/issue), owned by its page agent. Built on css/base.css (DESIGN.md);
   colours only through the tokens in css/tokens.css. Mobile first: 640 / 900 / 1120.

   Layout: a form of numbered steps (priors' "stepl": an italic serif numeral in the margin) on the left and a live
   term sheet on the right that stays in view (sticky; js/pages/issue.js sets --ts-top so a sheet taller than the
   screen sticks by its bottom edge). On phones the sheet sits between step iv and step v, where the review begins. */

/* ------------------------------------------------------------------ page frame */
.iss-sec { padding-top: 4px; }
@media (min-width: 900px) { .iss-sec { padding-top: 8px; } }
.iss-banner:empty { display: none; }
.iss-banner { display: grid; gap: 10px; margin-bottom: 20px; }

.iss { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
/* the form and the review are panels (.panel, .panel-b), so the code background stays in the margins */
.iss-main { min-width: 0; margin: 0; padding: 0; }
.iss-main > .panel-b, .iss-review > .panel-b { padding-block: 0 4px; }
.iss-side { min-width: 0; margin: 20px 0; }
.iss-review { min-width: 0; }
@media (min-width: 900px) {
  .iss { grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "main side" "review side"; column-gap: 40px; row-gap: 24px; }
  .iss-main { grid-area: main; }
  .iss-review { grid-area: review; }
  .iss-side { grid-area: side; align-self: stretch; margin: 0; }
}
@media (min-width: 1120px) { .iss { grid-template-columns: minmax(0, 1fr) 420px; column-gap: 64px; } }

/* ------------------------------------------------------------------ the numbered steps (i. to v.) */
.stepl { position: relative; padding: 28px 0 36px; border-top: 1px solid var(--rule); }
/* inside a panel the panel's own top rule opens the first step */
.panel-b > .stepl:first-child { border-top: 0; }
.stepl > h2 { display: flex; align-items: baseline; gap: 12px; font: 400 28px/1.1 var(--serif); letter-spacing: -.012em; }
.stepl > h2 .n { flex: none; font: italic 400 24px/1 var(--serif); color: var(--orange-ink); letter-spacing: 0; }
.st-p { margin: 10px 0 22px; max-width: 36em; font: 400 17px/1.5 var(--serif); color: var(--ink-2); }
@media (min-width: 640px) {
  .stepl { padding: 32px 0 44px 84px; }
  .stepl > h2 { font-size: 32px; }
  .stepl > h2 .n { position: absolute; left: 0; top: 34px; font-size: 34px; }
  .st-p { font-size: 18px; }
}
@media (min-width: 900px) and (max-width: 1119px) { .stepl { padding-left: 64px; } }

/* fields inside a step */
.iss .fields + .fields, .iss .fields .fields { gap: 18px; }
.iss .field-k .sub { text-align: right; }
.iss .field-k .sub.over { color: var(--down); }
.iss .field-k .tag { margin-left: auto; }
.iss .input textarea { min-height: 84px; }
.iss .input.date input { min-width: 0; font-family: var(--mono); font-size: 14.5px; }
.iss .input.date { flex: 1 1 170px; max-width: 220px; }
.iss .input.mini { flex: 0 1 140px; }
.iss .input.mini input { width: 64px; }
.iss-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.iss .seg { flex: none; }
.iss .seg button { min-height: 40px; padding-inline: 13px; }
@media (min-width: 640px) { .iss .seg button { padding-inline: 15px; } }
.iss fieldset:disabled .seg button { cursor: not-allowed; opacity: .6; }
.iss .help .sub { font-size: inherit; }
.range-k { display: flex; justify-content: space-between; margin-top: -4px; font: 12px var(--mono); color: var(--faint); }

/* the symbol suggestion: a quiet inline action after the help text */
.suggest { display: inline; padding: 0; border: 0; background: none; font: 500 13px var(--mono); color: var(--orange-ink); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; cursor: pointer; }
.suggest:hover { text-decoration-color: currentColor; }

/* which of price / yield is fixed */
.anchor-note { margin-top: -6px; font-size: 13px; color: var(--muted); }
.anchor-note:empty { display: none; }
.anchor-note b { font-weight: 500; color: var(--ink-2); }
.ref-line { line-height: 1.5; }
.ref-line .tag { margin-right: 8px; }

/* a small ruled summary under a step (the money, the collateral) */
.sum { padding: 4px 14px; background: var(--panel); border: 1px solid var(--rule); border-left: 2px solid var(--ink); }
.sum-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0 6px; border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
.sum .kv > div { padding: 7px 0; font-size: 14px; }
.sum .kv dt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sum .kv .hl dt { color: var(--ink); font-weight: 500; }
.sum .kv .hl dd { font-weight: 500; }
.sum .kv dd .s { color: var(--muted); }
.sum .kv dd.down { color: var(--down); }

/* ------------------------------------------------------------------ collateral choices: tiles with a square mark */
.coll { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .coll { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.coll-opt { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; min-width: 0; padding: 12px 30px 12px 13px; background: var(--field); border: 1px solid var(--field-edge); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.coll-opt:hover { border-color: var(--ink-2); }
.coll-opt input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.coll-opt::after { content: ""; position: absolute; top: 14px; right: 12px; width: 9px; height: 9px; border: 1px solid var(--field-edge); transition: background-color .15s, border-color .15s; }
.coll-opt:has(input:checked) { border-color: var(--ink); background: var(--panel); box-shadow: inset 0 0 0 1px var(--ink), inset 3px 0 0 var(--orange); }
.coll-opt:has(input:checked)::after { background: var(--orange); border-color: var(--orange); }
.coll-opt:has(input:focus-visible) { outline: 2px solid var(--orange-ink); outline-offset: 2px; }
.coll-opt:has(input:disabled) { cursor: not-allowed; opacity: .55; }
.coll-opt .sym { font: 500 14px/1.2 var(--mono); color: var(--ink); }
.coll-opt .nm { font-size: 13px; line-height: 1.3; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coll-opt .px { font: 12.5px/1.3 var(--mono); color: var(--ink-2); }
.coll-opt.none { grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 4px 12px; }
.coll-opt.none .nm { white-space: normal; }
.unsec { margin-top: 16px; }
.coll-cfg { margin-top: 22px; display: grid; gap: 18px; }

/* ------------------------------------------------------------------ the term sheet: a printed document */
.ts { position: relative; padding: 16px 18px 14px; background: var(--panel); border: 1px solid var(--rule); border-top: 3px double var(--ink); }
@media (min-width: 640px) { .ts { padding: 20px 22px 18px; } }
@media (min-width: 900px) { .ts { position: sticky; top: var(--ts-top, calc(var(--nav-h) + 16px)); } }
.ts-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--rule); }
.ts-h h2 { margin-right: auto; font: italic 400 18px/1.2 var(--serif); color: var(--muted); }
.ts-stamp { padding: 3px 9px 4px; border: 1px solid var(--field-edge); font: italic 400 15px/1.1 var(--serif); color: var(--muted); transition: color .3s, border-color .3s; }
.ts-stamp.ok { border-color: var(--up); color: var(--up); }
.ts-title { margin-top: 14px; font: 400 30px/1.08 var(--serif); letter-spacing: -.014em; color: var(--ink); overflow-wrap: anywhere; text-wrap: balance; }
.ts-title.ph { font-style: italic; color: var(--faint); }
.ts-sub { margin-top: 6px; font: 12.5px/1.45 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.ts-sub .ph { color: var(--faint); }
.ts-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.ts-figs > div { display: grid; align-content: start; gap: 3px; min-width: 0; padding: 10px 8px 11px 12px; border-left: 1px solid var(--rule); }
.ts-figs > div:first-child { padding-left: 0; border-left: 0; }
.ts-figs > div:last-child { padding-right: 0; }
.ts-figs .k { font-size: 12.5px; color: var(--muted); }
.ts-figs .v { font: 400 25px/1.1 var(--serif); letter-spacing: -.01em; font-variant-numeric: lining-nums tabular-nums; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-figs .v.accent { color: var(--orange-ink); }
.ts-figs .u { font-size: 11.5px; line-height: 1.3; color: var(--muted); }
@media (min-width: 1120px) { .ts-figs .v { font-size: 28px; } }

.ts-sec { margin-top: 14px; }
.ts-sec h3 { display: flex; align-items: baseline; gap: 8px; padding-bottom: 5px; border-bottom: 1px solid var(--rule); font: italic 400 16px/1.2 var(--serif); color: var(--ink-2); }
.ts-sec h3 .n { color: var(--orange-ink); }
.ts-sec dl { margin: 4px 0 0; }
/* label, a dotted leader, the figure: like a printed schedule */
.ts-row { display: flex; align-items: baseline; gap: 0; padding: 3px 0; font-size: 13.5px; line-height: 1.4; }
.ts-row dt { flex: 1 1 auto; display: flex; align-items: baseline; min-width: 0; color: var(--muted); white-space: nowrap; }
.ts-row dt::after { content: ""; flex: 1 1 auto; min-width: 12px; margin: 0 8px; border-bottom: 1px dotted var(--field-edge); transform: translateY(-4px); }
.ts-row dd { flex: 0 1 auto; max-width: 64%; margin: 0; font: 12.5px/1.4 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; overflow-wrap: anywhere; }
.ts-row dd .s { color: var(--muted); }

/* the dates as a short ruled timeline */
.ts-tl { list-style: none; margin-top: 8px; }
.ts-tl li { position: relative; display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline; padding: 3px 0 4px; }
.ts-tl li::before { content: ""; grid-row: 1; width: 7px; height: 7px; border: 1px solid var(--muted); background: var(--paper); position: relative; z-index: 1; transform: translateY(-1px); }
.ts-tl li:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: 16px; bottom: -6px; width: 1px; background: var(--rule); }
.ts-tl li.on::before { background: var(--orange); border-color: var(--orange); }
.ts-tl li.end::before { border-color: var(--warn); }
.ts-tl .tl-k { font-size: 13.5px; color: var(--ink-2); }
.ts-tl .tl-d { font: 12.5px/1.4 var(--mono); color: var(--ink); text-align: right; }
.ts-tl .tl-s { grid-column: 2 / -1; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.ts-tl .tl-s:empty { display: none; }

.ts-rule { margin-top: 10px; padding: 1px 0 1px 12px; border-left: 2px solid var(--warn); font: 400 15px/1.4 var(--serif); color: var(--ink-2); }
.ts-rule > span:first-child { font-style: italic; color: var(--ink); }
.ts-memo, .ts-addr { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--rule-2); }
.ts-memo .k, .ts-addr .k { display: block; margin-bottom: 4px; font-size: 12.5px; color: var(--muted); }
.ts-memo p { font: italic 400 16px/1.45 var(--serif); color: var(--ink-2); overflow-wrap: anywhere; white-space: pre-line; }
.ts-addr a { font-size: 12.5px; color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px; }
.ts-addr a:hover { color: var(--orange-ink); }
.ts-f { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 12px; line-height: 1.45; color: var(--muted); }
/* a figure that just changed: a short warm flash (no loop) */
@keyframes tsFlash { from { background-color: var(--orange-soft); } to { background-color: transparent; } }
.ts .flash { animation: tsFlash 1.2s var(--ease) both; }

/* ------------------------------------------------------------------ review: checklist, acknowledgement, action */
.checklist { list-style: none; border-top: 1px solid var(--ink); }
.checklist li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule-2); }
.checklist li::before { content: ""; display: grid; place-items: center; width: 14px; height: 14px; margin-top: 3px; border: 1px solid var(--field-edge); font: 600 10px/1 var(--sans); color: var(--paper); }
.checklist li[data-ok="yes"]::before { content: "\2713"; background: var(--up); border-color: var(--up); }
.checklist li[data-ok="no"]::before { border-color: var(--down); background: var(--down-soft); }
.checklist li[data-ok="na"]::before { border-style: dashed; }
.checklist b { display: block; font: 500 15px/1.35 var(--sans); color: var(--ink-2); }
.checklist li[data-ok="yes"] b { color: var(--ink); }
.checklist .sub { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.45; }
.checklist li[data-ok="no"] .sub { color: var(--ink-2); }
.checklist .sub .mono { font-size: 12.5px; }
.ack { display: flex; align-items: flex-start; margin-top: 20px; line-height: 1.45; }
.ack input { flex: none; margin-top: 3px; }
.iss-review .note { margin-top: 16px; }
.iss-review .steps { margin-top: 18px; }
.iss-act { margin-top: 20px; }
.iss-err { margin-top: 12px; font-size: 14px; line-height: 1.45; color: var(--down); }
.iss-done { margin-top: 20px; }
.iss-done:focus { outline: none; }
.iss-done .panel-h h3 em { font-style: italic; color: var(--orange-ink); }
.iss-done .kv dd .addr { font-size: 12.5px; }
.iss-done .kv > div.whole { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.iss-done .kv > div.whole dd { text-align: left; }
.iss-done .panel-f .btn.primary { flex: 1 1 220px; }

/* ------------------------------------------------------------------ after the form */
.iss-after .terms b { max-width: 34em; }
