/* Type Ladder: one screen at every text size. Shared tokens from site.css; the page is prefixed tl-, the sample screen tls-. */
.tl { --tl: #B5179E; --tl-ink: #9A0F86; --tl-2: #1C6ED6; --tl-bad: #D92B2B; --tl-ok: #12805C; padding-bottom: 72px; }
@media (prefers-color-scheme: dark) { .tl { --tl: #EE72DC; --tl-ink: #F59BE8; --tl-2: #6AA8FF; --tl-bad: #FF6B6B; --tl-ok: #46C995; } }
.tl-head-chips { margin-top: 18px; }
.tl-noscript { padding: 14px 18px; border-radius: var(--r-m); background: var(--raised); }

.tl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px; box-shadow: var(--shadow-1); min-width: 0; }
.tl-card-title { font-size: 1.05rem; letter-spacing: -0.01em; margin: 0; }
.tl-card-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.tl-label { display: block; font: 650 .8rem/1.2 var(--sans); color: var(--muted); margin: 0 0 6px; }
.tl-fine { font-size: .84rem; line-height: 1.45; color: var(--muted); margin: 0; }
.tl-fine b { color: var(--ink); font-weight: 650; }

/* segmented buttons */
.tl-seg { display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 3px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); max-width: 100%; }
.tl-seg-wrap { flex-wrap: wrap; border-radius: 18px; }
.tl-seg button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 650 .86rem/1 var(--sans); cursor: pointer;
  transition: background .15s, color .15s; }
.tl-seg button:hover { color: var(--ink); }
.tl-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 12%), inset 0 0 0 1px var(--line); }

/* controls */
.tl-controls { display: grid; gap: 18px; }
.tl-ctl-row { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: end; }
.tl-ctl { min-width: 0; }
.tl-range-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tl-range-row output { font: 750 1.05rem/1 var(--sans); color: var(--tl-ink); }
.tl-range { width: 100%; height: 28px; margin: 6px 0 0; accent-color: var(--tl); cursor: pointer; }
.tl-ticks { position: relative; height: 18px; margin: 0 0 8px; --t: 16px; }
.tl-ticks span { position: absolute; top: 0; transform: translateX(-50%); font: 600 .7rem/1 var(--mono); color: var(--faint); white-space: nowrap; }
.tl-ticks span.def { color: var(--muted); }
.tl-ticks span.ax { color: color-mix(in srgb, var(--tl) 70%, var(--faint)); }
.tl-ticks span.on { color: var(--ink); font-weight: 800; }
.tl-clamp[hidden] { display: none; }

/* stat tiles */
.tl-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.tl-stat { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); min-width: 0; }
.tl-stat-k { font: 650 .78rem/1.2 var(--sans); color: var(--muted); }
.tl-stat-v { font: 800 1.9rem/1.1 var(--sans); letter-spacing: -0.02em; }
.tl-stat-v small { font-size: .9rem; font-weight: 700; color: var(--muted); margin-left: 2px; }
.tl-va { color: var(--tl-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.tl-x { font: 700 .9rem/1 var(--mono); color: var(--muted); }
.tl-stat-b { font-size: .84rem; color: var(--muted); }
.tl-vb { color: var(--tl-2); font-weight: 750; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .tl-stats { grid-template-columns: minmax(0, 1fr); gap: 10px; } .tl-stat-v { font-size: 1.5rem; } }

/* the stage: two phones */
.tl-stage { margin-bottom: 20px; }
.tl-stage-bar { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 14px; }
.tl-stage-bar .tl-card-title { margin-right: auto; }
.tl-only-narrow { display: none; }
.tl-phones { display: grid; grid-template-columns: repeat(2, minmax(0, 330px)); justify-content: center; gap: 28px clamp(20px, 5vw, 64px); }
.tl-phone-col { margin: 0; min-width: 0; display: grid; gap: 12px; align-content: start; }
.tl-phone-col figcaption { display: grid; gap: 2px; text-align: center; min-height: 3.2em; }
.tl-phone-col figcaption b { font-size: 1rem; }
#tl-cap-a { color: var(--tl-ink); } #tl-cap-b { color: var(--tl-2); }
.tl-phone { position: relative; width: 100%; overflow: hidden; border-radius: 30px; background: #000;
  box-shadow: 0 0 0 7px #17161C, 0 0 0 8px #3A3844, 0 24px 50px rgb(22 21 27 / 22%); }
.tl-screen { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.tl-probs { font-size: .86rem; }
.tl-probs ul { margin: 6px 0 0; padding-left: 1.1em; color: var(--muted); }
.tl-prob-count { margin: 0; font-weight: 600; }
.tl-prob-count b { font-size: 1.05rem; }
.tl-prob-count.bad b { color: var(--tl-bad); }
.tl-prob-count.ok { color: var(--tl-ok); }
.tl-stage-note { margin-top: 16px; text-align: center; max-width: 720px; margin-inline: auto; }
@media (max-width: 640px) {
  .tl-only-narrow { display: inline-flex; }
  .tl-phones { grid-template-columns: minmax(0, 320px); }
  .tl-phones[data-show="a"] #tl-col-b, .tl-phones[data-show="b"] #tl-col-a { display: none; }
}

/* switch */
.tl-switch { display: inline-flex; align-items: center; gap: 10px; font: 600 .88rem/1.2 var(--sans); cursor: pointer; }
.tl-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tl-switch-ui { width: 40px; height: 24px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.tl-switch-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 25%); transition: transform .18s var(--ease-out); }
.tl-switch input:checked + .tl-switch-ui { background: var(--tl); }
.tl-switch input:checked + .tl-switch-ui::after { transform: translateX(16px); }
.tl-switch input:focus-visible + .tl-switch-ui { outline: 3px solid var(--accent); outline-offset: 2px; }

/* chart and table */
.tl-lower { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
@media (max-width: 980px) { .tl-lower { grid-template-columns: minmax(0, 1fr); } }
.tl-legend { display: flex; gap: 14px; font: 600 .8rem/1 var(--sans); color: var(--muted); }
.tl-legend span::before { content: ""; display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--tl); vertical-align: middle; margin-right: 6px; }
.tl-legend .tl-k-b::before { border-top: 3px dashed var(--tl-2); }
.tl-chart { width: 100%; height: auto; display: block; margin-bottom: 10px; overflow: visible; }
.tlc-grid { stroke: var(--line); stroke-width: 1; }
.tlc-ax { fill: var(--faint); font: 600 11px var(--mono); }
.tlc-ax.on { fill: var(--ink); font-weight: 800; }
.tlc-axband { fill: color-mix(in srgb, var(--tl) 7%, transparent); }
.tlc-axlabel { fill: color-mix(in srgb, var(--tl) 75%, var(--muted)); font-family: var(--sans); }
.tlc-now { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 2 4; opacity: .5; }
.tlc-a, .tlc-b { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; transition: opacity .2s; }
.tlc-a { stroke: var(--tl); }
.tlc-b { stroke: var(--tl-2); stroke-dasharray: 5 5; }
.tlc-dot-a { fill: var(--tl); } .tlc-dot-b { fill: var(--tl-2); }
.tl-chart .dim { opacity: .14; }
.tl-table-wrap { overflow-x: auto; margin-bottom: 10px; }
.tl-table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.tl-table th, .tl-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tl-table th:first-child { text-align: left; }
.tl-table thead th { font: 650 .76rem/1.2 var(--sans); color: var(--muted); }
#tl-th-a { color: var(--tl-ink); } #tl-th-b { color: var(--tl-2); }
.tl-table tbody th { font-weight: 600; }
.tl-table small { color: var(--faint); font-size: .78em; }
.tl-table td.up b { color: var(--tl-bad); }
.tl-table td.down b { color: var(--tl-2); }
.tl-table tbody tr { cursor: default; outline: none; }
.tl-table tbody tr:hover, .tl-table tbody tr:focus-visible { background: var(--raised); }
.tl-table tbody tr:focus-visible { box-shadow: inset 3px 0 0 var(--accent); }

/* code */
.tl-code-card { margin-bottom: 20px; }
.tl-code-lede { margin-bottom: 12px; }
.tl-code pre { max-height: 520px; }

/* notes */
.tl-notes { margin-top: 40px; }
.tl-notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 18px; }
.tl-note { padding: 18px 20px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); }
.tl-note h3 { font-size: 1.02rem; }
.tl-note p { color: var(--muted); font-size: .94rem; margin: 0; }
.tl-note code { background: var(--raised); padding: .1em .35em; border-radius: 5px; font-size: .86em; }
.tl-src-title { font-size: 1rem; margin-top: 28px; }
.tl-sources { padding-left: 1.2em; color: var(--muted); font-size: .9rem; display: grid; gap: 6px; margin: 0; }
.tl-sources code { font-size: .86em; }

/* ------------------------------------------------------------ the sample screen (sizes in px = pt or dp) */
.tl-screen { --s-bg: #FFFFFF; --s-ink: #111114; --s-dim: #6C6C73; --s-fill: #EFEFF2; --s-line: #E2E2E6; --s-acc: #E8590C; --s-on: #FFFFFF; --s-bar: rgb(248 248 250 / 96%);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--s-bg); color: var(--s-ink); overflow: hidden; }
.tls-android { --s-acc: #6750A4; --s-fill: #F3EDF7; --s-line: #E6E0E9; --s-bar: #F3EDF7; --s-bg: #FEF7FF; --s-ink: #1D1B20; --s-dim: #49454F; }
@media (prefers-color-scheme: dark) {
  .tl-screen { --s-bg: #000000; --s-ink: #F2F2F5; --s-dim: #9A9AA2; --s-fill: #1C1C1F; --s-line: #2A2A2E; --s-acc: #FF8A3D; --s-on: #1A0D00; --s-bar: rgb(18 18 20 / 96%); }
  .tls-android { --s-acc: #D0BCFF; --s-on: #381E72; --s-fill: #2B2930; --s-line: #49454F; --s-bar: #211F26; --s-bg: #141218; --s-ink: #E6E0E9; --s-dim: #CAC4D0; }
}
.tls-ios { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; }
.tls-android { font-family: Roboto, "Google Sans", system-ui, sans-serif; }
.tl-screen * { box-sizing: border-box; }
.tls-status { display: flex; justify-content: space-between; align-items: center; height: 54px; padding: 14px 32px 0; font: 600 17px/1 -apple-system, system-ui, sans-serif; }
.tls-android .tls-status { height: 40px; padding: 8px 24px 0; font: 500 14px/1 Roboto, system-ui, sans-serif; }
.tls-bars { display: flex; gap: 3px; align-items: end; }
.tls-bars i { width: 4px; background: currentColor; border-radius: 1px; } .tls-bars i:nth-child(1) { height: 6px; } .tls-bars i:nth-child(2) { height: 9px; } .tls-bars i:nth-child(3) { height: 12px; }
.tls-body { overflow-y: auto; overflow-x: hidden; padding: 6px 16px 24px; scrollbar-width: none; }
.tls-body::-webkit-scrollbar { display: none; }
.tls-one { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tls-title { margin: 4px 0 10px; letter-spacing: -0.01em; }
.tls-ios .tls-title { font-weight: 700 !important; }
.tls-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; margin-bottom: 12px; border-radius: 10px; background: var(--s-fill); color: var(--s-dim); overflow: hidden; }
.tls-android .tls-search { height: 56px; border-radius: 28px; padding: 0 18px; }
.tls-search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.tls-chips { display: flex; gap: 8px; flex-wrap: nowrap; overflow: hidden; margin-bottom: 14px; }
.tls-chip { flex: none; display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--s-fill); white-space: nowrap; overflow: hidden; }
.tls-android .tls-chip { border-radius: 8px; background: transparent; box-shadow: inset 0 0 0 1px var(--s-line); }
.tls-chip.on { background: var(--s-acc); color: var(--s-on); box-shadow: none; }
.tls-section { margin: 0 0 4px; color: var(--s-dim); text-transform: uppercase; letter-spacing: .02em; }
.tls-android .tls-section { text-transform: none; letter-spacing: 0; color: var(--s-acc); }
.tls-list { list-style: none; margin: 0 0 16px; padding: 0; }
.tls-row { display: flex; align-items: center; gap: 12px; height: 64px; border-bottom: 1px solid var(--s-line); overflow: hidden; }
.tls-android .tls-row { height: 72px; border-bottom: 0; }
.tls-thumb { flex: none; width: var(--thumb, 44px); height: var(--thumb, 44px); border-radius: 10px; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c)); }
.tls-android .tls-thumb { border-radius: 50%; }
.tls-text { flex: 1 1 auto; min-width: 0; display: grid; }
.tls-dim { color: var(--s-dim); }
.tls-meta { flex: none; max-width: 40%; color: var(--s-dim); }
.tls-button { display: flex; align-items: center; justify-content: center; height: 50px; padding: 0 20px; border-radius: 14px; background: var(--s-acc); color: var(--s-on); overflow: hidden; }
.tls-android .tls-button { height: 40px; border-radius: 20px; }
.tls-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); height: 83px; padding: 6px 4px 30px; background: var(--s-bar); border-top: 1px solid var(--s-line); overflow: hidden; }
.tls-android .tls-tabs { height: 80px; padding: 12px 4px 16px; border-top: 0; }
.tls-tab { display: grid; justify-items: center; align-content: start; gap: 2px; min-width: 0; color: var(--s-dim); padding: 0 2px; }
.tls-tab.on { color: var(--s-acc); }
.tls-tab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tls-android .tls-tab svg { width: 24px; height: 24px; }
.tls-android .tls-tab.on svg { background: var(--s-fill); border-radius: 12px; width: 56px; padding: 0 16px; }
.tls-tab .tls-one { max-width: 100%; }

/* adaptive: wrap instead of truncating, minimum heights instead of fixed ones, rows stack at the largest sizes */
.tls-adaptive .tls-one { white-space: normal; text-overflow: clip; }
.tls-adaptive .tls-search { height: auto; min-height: 36px; padding-block: 6px; }
.tls-android.tls-adaptive .tls-search { min-height: 56px; }
.tls-adaptive .tls-chips { flex-wrap: wrap; }
.tls-adaptive .tls-chip { height: auto; min-height: 32px; padding-block: 4px; white-space: normal; }
.tls-adaptive .tls-row { height: auto; min-height: 64px; padding: 10px 0; }
.tls-adaptive .tls-row.tls-stacked { flex-direction: column; align-items: flex-start; gap: 8px; }
.tls-adaptive .tls-row.tls-stacked .tls-text { width: 100%; }
.tls-adaptive .tls-meta { max-width: none; }
.tls-adaptive .tls-button { height: auto; min-height: 50px; padding-block: 10px; text-align: center; }
.tls-android.tls-adaptive .tls-button { min-height: 40px; }
.tls-adaptive .tls-tabs { height: auto; min-height: 83px; }
.tls-android.tls-adaptive .tls-tabs { min-height: 80px; }

/* problems */
.tls-bad { outline: 2px dashed var(--tl-bad, #D92B2B); outline-offset: -1px; background-color: rgb(217 43 43 / 12%); }
.tl-nomarks .tls-bad { outline: 0; background-color: transparent; }
.tls-chip.on.tls-bad, .tls-button.tls-bad { background-color: var(--s-acc); }
@media (max-width: 560px) { .tl-ticks span:not(.key):not(.on) { display: none; } }
