/* Preview site for the Trade Market design system. Layout: sticky settings bar, page list on the left,
   one page at a time on the right. The site wears the system's own tokens; specimens sit in flat panels. */
html { scroll-padding-top: 80px; }
body { margin: 0; background: var(--tm-color-bg); color: var(--tm-color-text); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--tm-color-panel); }
.pv { min-height: 100vh; }
.pv-bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--tm-color-panel); border-bottom: 1px solid var(--tm-color-divider); }
.pv-bar__in { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.pv-brand { display: grid; text-decoration: none; color: inherit; margin-right: auto; }
.pv-brand__sub { font-size: 12px; color: var(--tm-color-text-secondary); line-height: 16px; }
.pv-controls { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.pv-ctl { display: flex; align-items: center; gap: 8px; }
.pv-ctl__label { font-size: 12px; color: var(--tm-color-text-secondary); font-weight: 500; }
.pv-ctl .tm-seg { --_seg-h: 26px; padding: 2px; border-radius: 8px; }
.pv-ctl .tm-seg button { font-size: 12.5px; padding: 0 10px; border-radius: 6px; }
@media (max-width: 760px) {
  .pv-controls { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .pv-ctl { flex: none; }
  .pv-ctl__label { display: none; }
}

.pv-layout { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 1480px; margin: 0 auto; }
@media (min-width: 1000px) { .pv-layout { grid-template-columns: 236px minmax(0, 1fr); } }
.pv-nav { padding-block: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border-bottom: 1px solid var(--tm-color-divider); }
.pv-nav select { display: block; }
.pv-nav__list { display: none; }
@media (min-width: 1000px) {
  .pv-nav { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 58px); align-self: start; max-height: calc(100vh - 58px); overflow-y: auto; border-bottom: 0; border-right: 1px solid var(--tm-color-divider); padding: 16px 12px 40px max(16px, env(safe-area-inset-left, 0px)); scrollbar-width: thin; }
  .pv-nav .tm-select { display: none; }
  .pv-nav__list { display: block; }
}
.pv-nav__group { font-size: 12px; font-weight: 500; color: var(--tm-color-text-secondary); padding: 14px 10px 4px; }
.pv-nav__group:first-child { padding-top: 0; }
.pv-nav a { display: flex; justify-content: space-between; gap: 8px; padding: 5px 10px; border-radius: 6px; color: var(--tm-color-text-secondary); text-decoration: none; font-size: 13.5px; line-height: 1.35; }
.pv-nav a:hover { color: var(--tm-color-text); background: var(--tm-color-hover); }
.pv-nav a[aria-current="page"] { color: var(--tm-color-primary-text); background: var(--tm-color-primary-tint); font-weight: 500; }

.pv-main { min-width: 0; padding-block: 28px 96px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); outline: none; }
@media (min-width: 1000px) { .pv-main { padding-left: 40px; padding-right: max(40px, env(safe-area-inset-right, 0px)); } }
.pv-head { max-width: 76ch; display: grid; gap: 8px; margin-bottom: 28px; }
.pv-head__kicker { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--tm-color-text-secondary); }
.pv-head h1 { margin: 0; font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
.pv-head p { margin: 0; color: var(--tm-color-text-secondary); font-size: 15px; line-height: 1.6; }
.pv-head code, .pv-prose code, .pv-note code { font-family: var(--tm-font-family-mono); font-size: 0.86em; color: var(--tm-color-text); background: var(--tm-color-hover); padding: 1px 5px; border-radius: 4px; }
.pv-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--tm-color-divider-strong); color: var(--tm-color-text-secondary); }
.pv-tag--p1 { background: var(--tm-color-primary-tint); color: var(--tm-color-primary-text); border-color: transparent; }

.pv-sec { margin-top: 36px; display: grid; gap: 12px; }
.pv-sec:first-of-type { margin-top: 0; }
.pv-sec > h2 { margin: 0; font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; }
.pv-sec > p, .pv-prose p { margin: 0; color: var(--tm-color-text-secondary); max-width: 76ch; line-height: 1.6; font-size: 14.5px; }
.pv-prose { display: grid; gap: 10px; max-width: 76ch; }
.pv-prose ul { margin: 0; padding-left: 18px; color: var(--tm-color-text-secondary); line-height: 1.6; font-size: 14.5px; display: grid; gap: 4px; }
.pv-prose b, .pv-sec > p b { color: var(--tm-color-text); font-weight: 600; }
.pv-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); align-items: stretch; }
.pv-grid > .pv-spec { margin-bottom: 16px; }
.pv-grid--wide { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.pv-spec { display: grid; gap: 8px; min-width: 0; grid-template-rows: auto 1fr; align-content: start; }
/* Cards side by side end level: in a grid, each card's label, box and note share rows with its neighbours. */
.pv-grid > .pv-spec { grid-row: span 3; grid-template-rows: subgrid; row-gap: 8px; }
.pv-grid > .pv-spec > .pv-note { align-self: start; }
.pv-spec__label { font-size: 13px; font-weight: 500; color: var(--tm-color-text-secondary); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.pv-spec__label code { font-family: var(--tm-font-family-mono); font-size: 11.5px; color: var(--tm-color-text-faint); font-weight: 400; }
.pv-demo { position: relative; background: var(--tm-color-panel); border: 1px solid var(--tm-color-divider); border-radius: 6px; padding: 20px; min-width: 0; }
.pv-demo--flush { padding: 0; overflow: hidden; }
.pv-demo--bg { background: var(--tm-color-bg); }
.pv-demo--scroll { overflow-x: auto; }
.pv-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.pv-col { display: grid; gap: 16px; }
.pv-note { font-size: 13px; color: var(--tm-color-text-secondary); line-height: 1.55; max-width: 80ch; margin: 0; }
.pv-out { font-size: 13px; color: var(--tm-color-text-secondary); min-height: 20px; }
.pv-narrow { max-width: 400px; }

/* State matrix (buttons) */
.pv-matrix { border-collapse: collapse; width: 100%; min-width: 640px; }
.pv-matrix th { font-size: 12px; font-weight: 500; color: var(--tm-color-text-secondary); text-align: left; padding: 0 12px 10px 0; }
.pv-matrix td { padding: 6px 12px 6px 0; vertical-align: middle; }

/* Colour */
.pv-roles { width: 100%; border-collapse: collapse; min-width: 720px; }
.pv-roles th, .pv-roles td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--tm-color-divider); vertical-align: middle; font-size: 13.5px; }
.pv-roles thead th { font-size: 12px; color: var(--tm-color-text-secondary); font-weight: 500; border-bottom-color: var(--tm-color-divider-strong); }
.pv-roles td:first-child { font-family: var(--tm-font-family-mono); font-size: 12.5px; white-space: nowrap; }
.pv-demo--flush .pv-roles :is(th, td):first-child { padding-left: 16px; }
.pv-demo--flush .pv-roles :is(th, td):last-child { padding-right: 16px; }
.pv-demo--flush .pv-roles tbody tr:last-child td { border-bottom: 0; }
.pv-roles td.desc { color: var(--tm-color-text-secondary); font-size: 13px; }
.pv-sw { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.pv-sw i { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--tm-color-divider-strong); flex: none; background-clip: padding-box; }
.pv-sw i.alpha { background-image: linear-gradient(var(--_c), var(--_c)), conic-gradient(var(--_k1) 25%, var(--_k2) 0 50%, var(--_k1) 0 75%, var(--_k2) 0); background-size: auto, 8px 8px; }
.pv-sw span { font-family: var(--tm-font-family-mono); font-size: 12px; }
.pv-sw small { display: block; font-size: 11px; color: var(--tm-color-text-secondary); font-family: var(--tm-font-ui); }
.pv-aa { font-size: 11.5px; font-weight: 600; color: var(--tm-color-text-secondary); }
.pv-themes { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); }
.pv-budget { display: flex; height: 12px; border-radius: 6px; overflow: hidden; border: 1px solid var(--tm-color-divider); }
.pv-budget i { display: block; }

/* Type */
.pv-type td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--tm-color-divider); vertical-align: baseline; }
.pv-type td.meta { font-size: 12px; color: var(--tm-color-text-secondary); white-space: nowrap; font-family: var(--tm-font-family-mono); }
.pv-type td.desc { font-size: 13px; color: var(--tm-color-text-secondary); }
.pv-compare { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.pv-glyphs { font-size: 22px; letter-spacing: 0.06em; }

/* Spacing, radius */
.pv-space { display: grid; gap: 6px; }
.pv-space div { display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 12px; font-size: 12px; color: var(--tm-color-text-secondary); font-family: var(--tm-font-family-mono); }
.pv-space i { display: block; height: 12px; background: var(--tm-color-primary-tint); border-left: 2px solid var(--tm-color-primary-text); }
.pv-radius { display: flex; flex-wrap: wrap; gap: 16px; }
.pv-radius div { display: grid; gap: 6px; justify-items: center; font-size: 12px; color: var(--tm-color-text-secondary); }
.pv-radius i { width: 72px; height: 56px; border: 1px solid var(--tm-color-divider-strong); background: var(--tm-color-raised); }

/* Icons */
.pv-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 1px; background: var(--tm-color-divider); border: 1px solid var(--tm-color-divider); border-radius: 6px; overflow: hidden; }
.pv-icons div { display: grid; justify-items: center; gap: 8px; padding: 16px 8px 12px; background: var(--tm-color-panel); font-size: 11.5px; color: var(--tm-color-text-secondary); text-align: center; }
.pv-icons span { display: flex; gap: 12px; align-items: center; color: var(--tm-color-text); }

/* Shell frames */
.pv-phones { display: flex; gap: 24px; overflow-x: auto; padding: 4px 2px 12px; align-items: flex-start; }
.pv-phones .tm-phone { flex: none; }
.pv-frame { overflow: auto; border: 1px solid var(--tm-color-divider-strong); border-radius: 8px; max-height: 920px; }
/* Shell pages: the shell renders at a real screen size and scales down to fit the page. */
.pv-size { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.pv-size__label { font-size: 13px; font-weight: 500; }
.pv-size__info { font-size: 12px; color: var(--tm-color-text-secondary); }
.pv-frame--stage { overflow: hidden; max-height: none; }
.pv-stage { transform-origin: 0 0; overflow: hidden; }
.pv-stage__scroll { height: 100%; overflow: auto; }
.pv-stage .tm-pro { height: 100%; }
.pv-phones .tm-phone { width: var(--pv-phone-w, 390px); }
.pv-tablewrap { overflow-x: auto; }

/* Overview cards */
.pv-index { display: grid; gap: 1px; background: var(--tm-color-divider); border: 1px solid var(--tm-color-divider); border-radius: 6px; overflow: hidden; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.pv-index a { display: grid; gap: 4px; padding: 14px 16px; background: var(--tm-color-panel); text-decoration: none; color: inherit; }
.pv-index a:hover { background: color-mix(in srgb, var(--tm-color-panel) 92%, var(--tm-color-text)); }
.pv-index b { font-weight: 600; font-size: 14px; }
.pv-index span { font-size: 12.5px; color: var(--tm-color-text-secondary); line-height: 1.45; }
.pv-decisions { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--tm-color-divider); max-width: 90ch; }
.pv-decisions li { padding: 12px 0; border-bottom: 1px solid var(--tm-color-divider); display: grid; gap: 4px; font-size: 14px; line-height: 1.5; }
.pv-decisions li b { font-weight: 600; }
.pv-decisions li span { color: var(--tm-color-text-secondary); font-size: 13.5px; }
.pv-check { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

.pv-tune__values { font-size: 12px; color: var(--tm-color-text-secondary); font-variant-numeric: tabular-nums; }

/* Corner radius lab */
.pv-lab { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 1100px) { .pv-lab { grid-template-columns: minmax(0, 1fr); } }
.pv-lab__controls { position: sticky; z-index: 5; display: grid; gap: 14px; padding: 18px; border: 1px solid var(--tm-color-divider); border-radius: 14px; background: color-mix(in srgb, var(--tm-color-panel) 88%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 12px 32px -18px rgb(0 0 0 / 0.6); }
.pv-lab__row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 4px 10px; align-items: center; font-size: 13px; color: var(--tm-color-text-secondary); }
.pv-lab__row input { grid-column: 1 / -1; grid-row: 2; width: 100%; accent-color: var(--tm-color-primary); }
.pv-lab__row b { grid-column: 2; grid-row: 1; text-align: right; color: var(--tm-color-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.pv-lab__foot { display: grid; gap: 10px; padding-top: 6px; border-top: 1px solid var(--tm-color-divider); }
.pv-lab__foot .tm-btn { justify-self: start; }
.pv-lab__val { margin-left: 8px; font-size: 13px; font-weight: 500; color: var(--tm-color-text-secondary); font-variant-numeric: tabular-nums; }
.pv-lab__body .pv-sec:first-child { margin-top: 0; }
.pv-ctl .lk-bubble { border-radius: 6px; }

/* Screen sizes page */
.pv-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; max-width: 80ch; font-size: 14px; line-height: 1.55; }
.pv-list b { font-weight: 600; }
.pv-ruler { position: relative; margin: 4px 0 20px; padding-bottom: 78px; }
.pv-ruler__bands { position: relative; height: 44px; border-radius: 8px; overflow: hidden; background: var(--tm-color-panel); border: 1px solid var(--tm-color-divider); }
.pv-ruler__band { position: absolute; top: 0; bottom: 0; display: grid; align-content: center; gap: 0; padding: 0 8px; border-left: 1px solid var(--tm-color-divider-strong); font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; }
.pv-ruler__band:first-child { border-left: 0; }
.pv-ruler__band span { color: var(--tm-color-text-secondary); font-variant-numeric: tabular-nums; }
.pv-ruler__band:nth-child(even) { background: var(--tm-color-hover); }
.pv-ruler__ticks { position: absolute; left: 0; right: 0; top: 44px; height: 78px; }
.pv-ruler__tick { position: absolute; top: 0; transform: translateX(-50%); display: grid; justify-items: center; font-size: 11px; line-height: 14px; color: var(--tm-color-text-secondary); text-align: center; white-space: nowrap; }
.pv-ruler__tick i { width: 1px; height: 8px; background: var(--tm-color-text-secondary); }
.pv-ruler__tick:first-child { transform: none; justify-items: start; text-align: left; }
.pv-ruler__tick:last-child { transform: translateX(-100%); justify-items: end; text-align: right; }
.pv-ruler__tick:nth-child(even) i { height: 36px; }
@media (max-width: 760px) { .pv-ruler__tick:nth-child(even) span { display: none; } }
.pv-arrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 20px; }
.pv-arr { display: grid; gap: 8px; align-content: start; }
.pv-arr__title { font-size: 13px; font-weight: 600; }
.pv-arr__grid { display: grid; gap: 2px; height: 122px; padding: 2px; border-radius: 6px; background: var(--tm-color-divider); }
.pv-arr__grid > div { display: grid; place-items: center; min-width: 0; overflow: hidden; padding: 0 2px; background: var(--tm-color-panel); font-size: 11px; line-height: 13px; color: var(--tm-color-text-secondary); text-align: center; }
.pv-arr__grid > [style*="ticket"] { color: var(--tm-color-text); }

/* Way back to the design direction (the site's home page) */
.pv-up { display: inline-flex; align-items: center; gap: 4px; align-self: center; margin-left: 4px; padding: 5px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--tm-color-text-secondary); text-decoration: none; background: color-mix(in srgb, var(--tm-color-text) 7%, transparent); }
.pv-up::before { content: "\2039"; font-size: 14px; line-height: 1; }
.pv-up:hover { color: var(--tm-color-text); background: color-mix(in srgb, var(--tm-color-text) 12%, transparent); }
.pv-wip { display: inline-flex; align-items: center; height: 16px; padding: 0 5px; margin-left: 4px; border-radius: 4px; background: var(--tm-color-warning-tint); color: var(--tm-color-warning); font-size: 10.5px; font-weight: 600; vertical-align: 1px; }

/* Open a shell on its own */
.pv-open-row { margin-top: 6px; }
.pv-open-row .tm-btn { text-decoration: none; }
.pv-solo body, .pv-solo .pv { min-height: 100vh; }
.pv-solo .pv-bar, .pv-solo .pv-nav, .pv-solo .pv-head, .pv-solo .pv-size, .pv-solo .pv-sec > h2, .pv-solo .pv-sec > p { display: none !important; }
.pv-solo .pv-layout { display: block; max-width: none; }
.pv-solo .pv-main { padding: 0 !important; }
.pv-solo [data-stage] { border: 0; border-radius: 0; }
.pv-solo--fit [data-stage] { height: 100vh !important; }
.pv-solo--fit .pv-stage { width: 100vw !important; height: 100vh !important; transform: none !important; }
.pv-solo .pv-phones { min-height: 100vh; justify-content: safe center; align-items: safe center; padding: 24px; box-sizing: border-box; overflow: auto; }
.pv-solo .pv-phones .tm-phone { max-height: none; }
.pv-solo-ctl { position: fixed; right: 16px; bottom: 40px; z-index: 50; display: grid; justify-items: end; gap: 8px; }
.pv-solo-ctl__toggle { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--tm-color-divider-strong); border-radius: 999px; background: color-mix(in srgb, var(--tm-color-raised) 88%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: var(--tm-color-text); font: 500 12.5px/1 var(--tm-font-ui); cursor: pointer; box-shadow: 0 10px 28px -14px rgb(0 0 0 / 0.6); }
.pv-solo-ctl__panel { order: -1; display: grid; gap: 10px; max-width: min(760px, calc(100vw - 32px)); padding: 12px 14px; border-radius: 14px; border: 1px solid var(--tm-color-divider-strong); background: color-mix(in srgb, var(--tm-color-raised) 90%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 14px 36px -14px rgb(0 0 0 / 0.6); }
.pv-solo-ctl__panel[hidden] { display: none; }
.pv-solo-ctl .pv-ctl { flex-wrap: wrap; }
.pv-solo .pv-solo-ctl .pv-ctl__label { display: inline; min-width: 84px; }
.pv-solo-ctl__back { justify-self: start; font-size: 12.5px; color: var(--tm-color-primary-text); }
.pv-size__sep { width: 1px; height: 20px; background: var(--tm-color-divider-strong); margin: 0 4px; }
.pv-size .pv-ctl__label { display: inline; }
.pv-rules { margin: 0; padding-left: 20px; display: grid; gap: 10px; max-width: 76ch; color: var(--tm-color-text-secondary); line-height: 1.6; }
.pv-rules b { color: var(--tm-color-text); font-weight: 600; }
.pv-dd-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* No transitions while the page loads (settings and translations are applied then). */
.pv-loading *, .pv-loading *::before, .pv-loading *::after { transition: none !important; }

/* Principles: the laws a page applies, named under its title (documentation only, never in product screens) */
.pv-laws { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; line-height: 1.3; }
.pv-laws > span { color: var(--tm-color-text-secondary); margin-right: 4px; }
.pv-laws a, .pv-lawrow__pages a { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--tm-color-divider); background: var(--tm-color-panel); color: var(--tm-color-text); text-decoration: none; }
.pv-laws a:hover, .pv-lawrow__pages a:hover { border-color: var(--tm-color-border-control, var(--tm-color-divider-strong)); color: var(--tm-color-primary-text); }
.pv-lawlist { display: grid; border-top: 1px solid var(--tm-color-divider); max-width: 1000px; }
.pv-lawrow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 28px; padding: 14px 0; border-bottom: 1px solid var(--tm-color-divider); align-items: start; }
@media (min-width: 900px) { .pv-lawrow { grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); } }
.pv-lawrow__name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; }
.pv-lawrow__name > a { font-weight: 600; font-size: 14.5px; color: var(--tm-color-text); text-decoration: none; }
.pv-lawrow__name > a:hover { color: var(--tm-color-primary-text); }
.pv-lawrow__pages { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; line-height: 1.3; }
