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

/* ================================================================== head and band */
.sh-head .aside time { color: var(--ink-2); }

.sh-band .stats .k { justify-content: space-between; gap: 10px; }
.sh-band .stats .k b { font-weight: 500; color: var(--ink); font-family: var(--mono); font-size: 13px; letter-spacing: .01em; }
.sh-band .stats .k .d { display: none; }
@media (min-width: 640px) { .sh-band .stats .k .d { display: inline; } }
@media (min-width: 900px) { .sh-band .stats .k { justify-content: flex-start; } }
.sh-band .stats .v { font-size: clamp(30px, 3.6vw, 48px); }
.sh-band .stats .s { white-space: nowrap; }

/* ================================================================== No. 1: what inflation takes */
/* one panel: the three inputs on the left, what they mean on the right */
.sh-infl { display: grid; grid-template-columns: minmax(0, 1fr); }
.sh-infl-f { gap: 22px; padding: 20px 18px 22px; align-content: start; }
.sh-infl-r { min-width: 0; padding: 20px 18px 18px; border-top: 1px solid var(--rule); }
@media (min-width: 640px) { .sh-infl-f, .sh-infl-r { padding: 24px 24px; } }
@media (min-width: 900px) {
  .sh-infl { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .sh-infl-f { padding: 28px 30px 30px; }
  .sh-infl-r { padding: 28px 30px 24px; border-top: 0; border-left: 1px solid var(--rule); }
}
.sh-infl-f .field-k .sub { font-weight: 400; }
.sh-ends { display: flex; justify-content: space-between; font: 12px var(--mono); color: var(--faint); }
.sh-infl-f input[type="range"] { margin-top: 2px; }
/* for comparison: what bills would have kept, under the inputs */
.sh-bridge { margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--rule); }
.sh-infl-r .sh-bridge { margin-top: 18px; }
.sh-bridge .k { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--muted); }
.sh-bridge .v { margin-top: 8px; font: 400 clamp(30px, 3vw, 38px)/1 var(--serif); letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; color: var(--ink); }
.sh-bridge .v.up { color: var(--up); }
.sh-bridge .v.down { color: var(--down); }
.sh-bridge .s { margin-top: 8px; font-size: 13px; line-height: 1.45; color: var(--muted); max-width: 34em; }

/* the figures: what inflation takes leads; on phones it has its own row */
.sh-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 18px; margin-bottom: 16px; border-bottom: 1px solid var(--rule); }
.sh-figs > div { min-width: 0; padding: 0 14px; border-left: 1px solid var(--rule); }
.sh-figs > div:nth-child(2) { padding-left: 0; border-left: 0; }
.sh-figs > .lead { grid-column: 1 / -1; padding: 0 0 16px; margin-bottom: 16px; border-left: 0; border-bottom: 1px solid var(--rule-2); }
.sh-figs .k { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-figs .v { margin-top: 8px; font: 400 clamp(28px, 3.2vw, 42px)/1 var(--serif); letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-figs .lead .v { font-size: clamp(44px, 5vw, 64px); }
.sh-figs .v.down { color: var(--down); }
.sh-figs .s { margin-top: 7px; font-size: 13px; line-height: 1.35; color: var(--muted); }
@media (min-width: 640px) {
  .sh-figs { grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr)); }
  .sh-figs > .lead { grid-column: auto; padding: 0 18px 0 0; margin: 0; border-bottom: 0; }
  .sh-figs > div:nth-child(2) { padding-left: 18px; border-left: 1px solid var(--rule); }
  .sh-figs > div { padding: 0 18px; }
  .sh-figs > div:last-child { padding-right: 0; }
  .sh-figs .lead .v { font-size: clamp(36px, 4.2vw, 54px); }
}

/* the purchasing-power chart (js/pages/shield.js powerChart): the wedge between the lines is what inflation takes */
.sh-chart { min-height: 170px; }
.sh-pchart:focus-visible { outline-offset: 4px; }
.sh-pchart .sh-wedge { fill: var(--down); opacity: .13; stroke: none; }
.sh-pchart .ch-line, .sh-pchart .sh-wedge { transition: d .5s var(--ease); }
.sh-pchart circle.ch-dot, .sh-pchart .sh-wedge-l { transition: transform .5s var(--ease), opacity .3s; }
.sh-pchart.still .ch-line, .sh-pchart.still .sh-wedge, .sh-pchart.still circle.ch-dot, .sh-pchart.still .sh-wedge-l { transition: none; }
.sh-pchart text.sh-wedge-l { font: 500 12px var(--mono); fill: var(--down); }
.sh-infl-r .ch-legend { margin-top: 8px; }
.sh-infl-r .ch-legend .sh-lg-wedge::before { height: 8px; width: 12px; background: var(--down); opacity: .35; }
.sh-infl-note { margin-top: 12px; max-width: 46em; }

/* ================================================================== No. 2: presets */
.sh-presets { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); background: var(--panel); }
@media (min-width: 640px) { .sh-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1120px) { .sh-presets { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.sh-preset { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 11px; min-width: 0; padding: 20px 18px 22px; border: 0; border-top: 1px solid var(--rule); border-radius: 0; background: transparent; color: var(--ink); text-align: left; font: inherit; transition: background-color .2s var(--ease); -webkit-tap-highlight-color: transparent; }
.sh-preset:first-child { border-top: 0; }
@media (min-width: 640px) {
  .sh-preset { border-top: 0; }
  .sh-preset:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .sh-preset:nth-child(even) { border-left: 1px solid var(--rule); }
}
@media (min-width: 1120px) {
  .sh-preset, .sh-preset:nth-child(n+3) { border-top: 0; border-left: 1px solid var(--rule); }
  .sh-preset:first-child { border-left: 0; }
}
/* the selected mix: an orange rule drawn across its top, the name in orange italic like a selected book */
.sh-preset::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--orange); transform: scaleX(0); transform-origin: left center; transition: transform .45s var(--ease); }
.sh-preset[aria-pressed="true"]::before { transform: scaleX(1); }
.sh-preset:hover { background: var(--hover); }
.sh-preset[aria-pressed="true"] { background: var(--paper-2); }
.sh-preset:focus-visible { outline-offset: -3px; }
.sh-preset .pk { font: 400 25px/1.1 var(--serif); letter-spacing: -.01em; color: var(--ink); transition: color .2s; }
.sh-preset[aria-pressed="true"] .pk { font-style: italic; color: var(--orange-ink); }
.sh-preset .alloc { height: 5px; }
.sh-preset .pw { font: 12.5px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.sh-preset .ps { font-size: 14px; line-height: 1.45; color: var(--ink-2); }

/* Custom: four linked sliders */
.sh-custom { margin-top: 26px; }
.sh-custom .panel-h h3 em { font-style: italic; }
.sh-sliders { gap: 18px 40px; }
.sh-slider .field-k b { font: 500 13px var(--mono); color: var(--ink); }
.sh-slider .field-k > span:first-child { color: var(--ink-2); font-weight: 400; }
.sh-slider .field-k .sub { font-size: 13px; color: var(--orange-ink); }
/* each slider's fill takes its leg's colour from the allocation bar (orange, ink-2, muted, light orange) */
.sh-slider:nth-child(2) input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--ink-2) 0 var(--fill, 0%), var(--rule) var(--fill, 0%) 100%); }
.sh-slider:nth-child(3) input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--muted) 0 var(--fill, 0%), var(--rule) var(--fill, 0%) 100%); }
.sh-slider:nth-child(2) input[type="range"]::-moz-range-progress { background: var(--ink-2); }
.sh-slider:nth-child(3) input[type="range"]::-moz-range-progress { background: var(--muted); }

/* the allocation bar, full width and a little taller than the catalogue's */
.sh-alloc { margin-top: 28px; }
.alloc.sh-bar { height: 14px; }
.sh-alloc .alloc-key { gap: 6px 22px; margin-top: 12px; font-size: 13.5px; }
.sh-alloc .alloc-key b { font: 500 13px var(--mono); color: var(--ink); }
.sh-alloc .alloc-key span { font-variant-numeric: tabular-nums; }
.sh-alloc .alloc-key span.off { opacity: .5; }

/* the per-leg ledger */
.sh-legs-bar { margin-top: 30px; gap: 8px 14px; border-bottom: 0; padding-bottom: 6px; }
.sh-legs-bar .sub { font-size: 13px; }
.ledger.sh-legs { min-width: 860px; }
.sh-legs .cc { min-width: 46px; }
.sh-legs .nm { font-size: 18px; }
.sh-legs td.ctx { white-space: normal; min-width: 200px; max-width: 280px; line-height: 1.4; }
.sh-legs td.ctx .tracks { display: block; font-size: 14px; color: var(--ink-2); }
.sh-legs td.ctx .cx { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }
.sh-legs td.ctx .cx.up { color: var(--up); }
.sh-legs td.ctx .cx.down { color: var(--down); }
.sh-legs td.ctx .cx[title] { cursor: help; }
.sh-legs td.num.warn { color: var(--warn); }
.sh-legs .cellbar { width: 44px; }
.sh-legs tbody tr.off td, .sh-legs tbody tr.off .tracks { color: var(--faint); }
.sh-legs tbody tr.off .nm, .sh-legs tbody tr.off .cc { color: var(--muted); }
.sh-legs tbody tr.off .cellbar, .sh-legs tbody tr.off .cx { opacity: .55; }
.sh-legs tbody td.num { transition: opacity .25s var(--ease); }
.sh-legs tbody.stale td.num:nth-child(n+5) { opacity: .55; }
.sh-legs tbody .sk { min-width: 5em; }
.sh-legs tfoot td { padding-top: 13px; padding-bottom: 13px; }
.sh-legs tfoot td.asset { font: 500 15px var(--sans); }
.sh-impact { margin-top: 18px; }

/* phones and tablets: each leg becomes a ruled card, its figures a key-value list (one pair a row, label left,
   value right, as .kv), so nothing hides off the right edge and a column of numbers reads straight down */
@media (max-width: 899px) {
  .ledger.sh-legs { min-width: 0; }
  .sh-legs thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sh-legs tbody, .sh-legs tfoot { display: block; }
  .sh-legs tbody tr, .sh-legs tfoot tr { display: grid; grid-template-columns: minmax(0, 1fr); padding: 18px 0 8px; border-bottom: 1px solid var(--rule); }
  .sh-legs tfoot tr { padding-top: 14px; border-top: 1px solid var(--ink); border-bottom: 0; }
  .sh-legs tbody tr:last-child { border-bottom: 0; }
  .sh-legs td, .sh-legs th { display: block; padding: 0 !important; border: 0 !important; white-space: normal; min-width: 0; }
  .sh-legs td.asset, .sh-legs td.ctx { max-width: none; }
  .sh-legs td.ctx { padding-left: 58px !important; margin: -2px 0 10px; }
  .sh-legs td.num { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-left: 58px; padding: 8px 0 !important; border-top: 1px solid var(--rule-2) !important; text-align: right; font-size: 14px; }
  .sh-legs td.num::before { content: attr(data-label); flex: none; font: 400 13.5px var(--sans); color: var(--muted); text-align: left; }
  .sh-legs td.num.o { color: var(--ink); }
  .sh-legs td.num.w .cellbar { display: none; }
  .sh-legs tbody td.num .sk { min-width: 6em; }
  .sh-legs tfoot td.ctx, .sh-legs tfoot td.p, .sh-legs tfoot td.w { display: none; }
  .sh-legs tfoot td.asset { margin-bottom: 4px; }
  .sh-legs tfoot td.num { margin-left: 0; }
}
/* tablets: the asset and what it tracks on the left, its figures beside them */
@media (min-width: 640px) and (max-width: 899px) {
  .sh-legs tbody tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; padding-bottom: 12px; }
  .sh-legs tbody td.asset { grid-column: 1; grid-row: 1; }
  .sh-legs tbody td.ctx { grid-column: 1; grid-row: 2 / span 4; margin-bottom: 0; }
  .sh-legs tbody td.num { grid-column: 2; margin-left: 0; }
  .sh-legs tbody td.num.w { align-self: end; border-top: 0 !important; } /* shares its row with the asset's name: sits on its last line */
  .sh-legs tfoot tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; }
  .sh-legs tfoot td.asset { grid-column: 1; grid-row: 1 / span 3; }
  .sh-legs tfoot td.num { grid-column: 2; }
}

/* ================================================================== No. 3: execute */
.sh-exec { align-items: start; }
@media (min-width: 900px) { .sh-exec { grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; } }
@media (min-width: 1120px) { .sh-exec { gap: 40px; } }
.sh-banner { margin-bottom: 16px; }
.sh-banner .banner .txlink { margin-left: 4px; }
.sh-kv > div { align-items: center; }
.sh-kv dd .sk { width: 7em; }
.sh-mini { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 12px; font-size: 13.5px; color: var(--ink-2); }
.sh-mini .alloc { width: 84px; height: 6px; flex: none; gap: 1px; }
.sh-slip { margin-top: 18px; }
.sh-slip .seg { width: 100%; }
.sh-slip .seg button { flex: 1 1 0; padding-block: 10px; }
@media (min-width: 640px) { .sh-slip .seg { width: auto; } .sh-slip .seg button { flex: none; padding: 9px 16px; } }
.sh-slip .field-k .sub { font-family: var(--mono); color: var(--ink-2); }

.sh-go { flex-direction: column; align-items: stretch; gap: 12px; padding-block: 18px 20px; }
.sh-summary { font: italic 400 19px/1.35 var(--serif); color: var(--ink-2); }
.sh-go .note { margin-top: 2px; }

/* the steps column */
.sh-steps { position: relative; }
@media (min-width: 900px) { .sh-steps { position: sticky; top: calc(var(--nav-h) + 20px); } }
.sh-steps .steps .txlink { overflow-wrap: anywhere; }
.sh-steps .panel-h .sub { font-family: var(--mono); font-size: 12.5px; }

/* the result */
.sh-result { outline: none; animation: shRise .5s var(--ease) both; }
.sh-result .panel-h h3 em { font-style: italic; }
.sh-res td .nm { font-size: 17px; }
.sh-res td.num b { font-weight: 500; color: var(--ink); }
.sh-res td.num .nm-s { margin-top: 3px; }
.sh-res-f { justify-content: space-between; gap: 12px 24px; }
.sh-txs { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.sh-hash { font-size: 12.5px; color: var(--muted); }
@media (max-width: 639px) {
  .sh-res thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sh-res tbody, .sh-res tfoot { display: block; }
  .sh-res tbody tr, .sh-res tfoot tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; padding: 14px 14px; border-bottom: 1px solid var(--rule-2); }
  .sh-res tfoot tr { border-bottom: 0; border-top: 1px solid var(--ink); }
  .sh-res td { display: block; padding: 0 !important; border: 0 !important; white-space: normal; }
  .sh-res td.asset, .sh-res td.rc { grid-column: 1 / -1; }
  .sh-res td.rc { order: 1; }
  .sh-res td.num { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; text-align: right; }
  .sh-res td.num::before { content: attr(data-label); font: 400 13px var(--sans); color: var(--muted); text-align: left; }
  .sh-res tfoot td.mn { display: none; }
  .sh-res tfoot td.asset { font: 500 15px var(--sans); }
}
@keyframes shRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ================================================================== No. 4: what you hold */
#hold .terms b { max-width: 34em; }
#hold .terms b span { font: inherit; color: inherit; }

/* the price moved between the estimate and the send: the legs that moved, then Cancel (Accept is the order button) */
.sh-move .sh-move-l { margin: 8px 0 0; padding-left: 1.1em; font-size: 13.5px; line-height: 1.5; }
.sh-move .sh-move-l li + li { margin-top: 2px; }
.sh-move .sh-move-l b { font-family: var(--mono); font-weight: 500; }
