/*
 * Curs valutar, shared components: flags, bank circle, badge, segment switch, bank rows and list, freshness banner,
 * breadcrumbs, currency pill and picker, BNM chart, sortable column headers.
 * Markup: site/src/components/*.ts (README.md there). Spec: docs/web-spec.md 2, 4.3, 4.4, 4.8, 4.9 and
 * docs/app-spec.md 2, 3. Colours only as token variables from base.css, never raw values.
 */

/* ======================================================================================================== */
/* Flag, bank circle, badge                                                                                 */
/* ======================================================================================================== */

/* Round flag (flag.ts): the body is clipped to the circle here instead of an SVG clipPath. */
.c-flag {
  flex-shrink: 0;
  border-radius: 50%;
  clip-path: circle(50%);
}

.c-flag__muted {
  fill: var(--surface-muted);
}

.c-flag__letter {
  fill: var(--on-surface-muted);
  font-family: var(--font);
  font-size: 10.4px;
  font-weight: 700;
}

/* Bank circle 42 with the first letter (app-spec 3 «Ряд банка»). */
.c-avatar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--on-surface-muted);
  font-size: 17px;
  line-height: 22px;
  font-weight: 700;
}

.c-avatar--muted {
  color: var(--text-secondary);
}

/* On a surface-muted row (W05 current bank) the circle takes the sheet colour. */
.c-avatar--on-muted {
  background: var(--sheet);
}

/* «Cel mai bun»: accent, on-accent 12/700, radius 10, padding 2 and 8. */
.c-badge {
  display: inline-block;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.c-icon {
  flex-shrink: 0;
}

/* ======================================================================================================== */
/* Segment switch (segment.ts): track 36, radius 18, padding 2; items 32 with a 44 hit area                 */
/* ======================================================================================================== */

/* Colours can be set from outside with --seg-track, --seg-selected, --seg-selected-ink, --seg-shadow. */
.c-seg {
  display: inline-flex;
  flex-shrink: 0;
  height: 36px;
  padding: 2px;
  border-radius: 18px;
  background: var(--seg-track, var(--surface-muted));
}

.c-seg__item {
  display: flex;
  align-items: center;
  height: 44px;
  margin: -6px 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.c-seg__in {
  display: block;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 32px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color var(--transition), color var(--transition);
}

/* Spec 4.8: an item that is not selected turns ink on hover and press. */
.c-seg__item:hover > .c-seg__in,
.c-seg__item:active > .c-seg__in {
  color: var(--ink);
}

.c-seg__item[aria-pressed='true'] > .c-seg__in,
.c-seg__item[aria-current] > .c-seg__in {
  background: var(--seg-selected, var(--segment-selected));
  box-shadow: var(--seg-shadow, var(--shadow-segment));
  color: var(--seg-selected-ink, var(--ink));
  font-weight: 700;
}

.c-seg__item[aria-pressed='true'] {
  cursor: default;
}

/* The focus ring goes around the item, not the 44 hit area. */
.c-seg__item:focus-visible {
  outline: none;
}

.c-seg__item:focus-visible > .c-seg__in {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
}

.c-seg--compact .c-seg__in {
  padding: 0 10px;
}

/* On cobalt (W03, W04, W05): hero-control track, white selected item with cobalt text. */
.c-seg--hero {
  --seg-track: var(--hero-control);
  --seg-selected: var(--on-hero);
  --seg-selected-ink: var(--surface-hero);
  --seg-shadow: none;
  --focus-color: var(--focus-ring-hero);
}

.c-seg--hero .c-seg__in,
.c-seg--hero .c-seg__item:hover > .c-seg__in,
.c-seg--hero .c-seg__item:active > .c-seg__in {
  color: var(--on-hero);
}

.c-seg--hero .c-seg__item:not([aria-pressed='true']):not([aria-current]):hover > .c-seg__in {
  background: var(--hero-control-hover);
}

.c-seg--hero .c-seg__item[aria-pressed='true'] > .c-seg__in,
.c-seg--hero .c-seg__item[aria-current] > .c-seg__in {
  color: var(--seg-selected-ink);
}

/* ======================================================================================================== */
/* Sheet (W01: radius 32, 1 px border, padding 24 24 8; W08: no border in dark)                             */
/* ======================================================================================================== */

.c-sheet {
  padding: 24px 24px 8px;
  border: 1px solid var(--sheet-border);
  border-radius: var(--radius-card);
  background: var(--sheet);
}

/*
 * Below 768 (W02): the app's sheet, edge to edge: radius 32 on top only, no border, the sheet shadow, padding 8 16.
 * Pair it with .bleed-mobile from base.css; the 48 px overlap with the cobalt block belongs to the page.
 */
@media (max-width: 767px) {
  .c-sheet {
    padding: 8px 16px;
    border: 0;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    box-shadow: var(--shadow-sheet);
  }
}

/* ======================================================================================================== */
/* Bank list header: row A and row B (bank-list.ts)                                                         */
/* ======================================================================================================== */

.c-lh__a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
}

.c-lh__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.c-lh__title {
  font-size: 22px;
  line-height: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.c-lh__stamp {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Level 3: the old stamp in on-warn (E07). */
.c-lh__stamp--old {
  color: var(--on-warn);
}

/* Row B: one line centred in 44, two lines take 36; the whole row is a link to /bnm. */
.c-lh__b {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
  margin: 0 -12px;
  padding: 0 12px;
  border-radius: 16px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
  text-decoration: none;
  transition: background-color var(--transition);
}

a.c-lh__b:hover {
  background: var(--row-hover);
}

a.c-lh__b:active {
  background: var(--line);
}

.c-lh__b1 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.c-lh__bnm {
  min-width: 0;
  overflow: hidden;
  font-weight: 400;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.c-lh__sum {
  flex-shrink: 0;
  font-weight: 500;
}

.c-lh__note {
  font-weight: 400;
}

/* ======================================================================================================== */
/* Bank row (bank-row.ts): 64 best, 60 regular; circle 42, gap 12; padding 0 12 with a -12 margin           */
/* ======================================================================================================== */

.c-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  margin: 0 -12px;
  padding: 0 12px;
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color var(--transition);
}

.c-row--best {
  height: 64px;
}

a.c-row:hover {
  background: var(--row-hover);
}

a.c-row:active {
  background: var(--line);
}

/* W05: the bank of the page, not a link. */
.c-row--current {
  background: var(--surface-muted);
}

/* Container for the badge rule: 100cqw is the text width (588 on the desktop sheet, 304 on a 390 phone). */
.c-row__text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  container-type: inline-size;
}

.c-row--single .c-row__text {
  gap: 0;
}

.c-row__l1 {
  display: flex;
  align-items: center;
  min-width: 0;
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
}

.c-row--best .c-row__l1 {
  font-weight: 700;
}

.c-row__name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.c-row__sum,
.c-row__stamp {
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 10px;
  white-space: nowrap;
}

.c-row--best .c-row__sum {
  color: var(--accent-text);
}

/* Level 3 (E07): sums and rates without emphasis. */
.c-row--old .c-row__sum {
  color: var(--text-secondary);
}

.c-row__stamp {
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
}

.c-row__l2 {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
  font-weight: 400;
}

.c-row__rates {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* The rate the sum uses: ink 13/600. */
.c-row__used {
  color: var(--ink);
  font-weight: 600;
}

/* «Fără curs de azi» and banks without the pair: the whole row text-secondary (E06). */
.c-row--stale,
.c-row--missing {
  color: var(--text-secondary);
}

/*
 * Badge placement, app rule (app-spec 3): next to the name when name + 8 + badge + 10 + sum fit the text width
 * (--w1), else at the end of the second line when rates + 6 + badge fit (--w2), else no badge.
 * The row prints the badge in both places; max-width 0 hides the one that does not apply.
 * Default (no container query units, or --w1 missing): next to the name.
 */
.c-row__b1,
.c-row__b2 {
  display: flex;
  flex: 0 0 auto;
  overflow: hidden;
}

.c-row__b1 > .c-badge {
  margin-left: 8px;
}

.c-row__b2 {
  max-width: 0;
  margin-left: auto;
}

.c-row__b2 > .c-badge {
  margin-left: 6px;
}

@supports (width: 1cqw) {
  .c-row__b1 {
    max-width: clamp(0px, (100cqw - var(--w1, 0px) + 0.5px) * 1000, 400px);
  }

  .c-row__b2 {
    max-width: min(
      clamp(0px, (var(--w1, 0px) - 100cqw - 0.5px) * 1000, 400px),
      clamp(0px, (100cqw - var(--w2, 0px) + 0.5px) * 1000, 400px)
    );
  }
}

/* «6 bănci fără curs UAH» folds into one line that opens into the rows. */
.c-fold__sum {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  margin: 0 -12px;
  padding: 0 12px;
  border-radius: 16px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  list-style: none;
  transition: background-color var(--transition);
}

.c-fold__sum::-webkit-details-marker {
  display: none;
}

.c-fold__sum:hover {
  background: var(--row-hover);
}

.c-fold__chev {
  transition: transform var(--transition);
}

.c-fold[open] .c-fold__chev {
  transform: rotate(180deg);
}

/* «Fără curs de azi» 13/700 and «Nu intră în clasament.» 13/400 (E06), 48 high. */
.c-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 48px;
}

.c-group__title {
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}

.c-group__sub {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
}

/* «Nicio bancă nu afișează curs pentru TRY.» instead of rows. */
.c-list__empty {
  padding: 16px 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
}

/* End notes, 13/400, 12 apart (W01). */
.c-list__note {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
}

/* ======================================================================================================== */
/* Freshness (freshness.ts, spec 4.9)                                                                       */
/* ======================================================================================================== */

/* Levels 2 and 3: strip 64, radius 14, warn-surface. */
.c-fresh {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 64px;
  padding: 8px 14px;
  border-radius: 14px;
  background: var(--warn-surface);
  color: var(--on-warn);
}

.c-fresh__title {
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
}

.c-fresh__line {
  font-size: 13px;
  line-height: 18px;
}

/* Level 4: the message and «Reîncearcă» instead of the rows. */
.c-load {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 0 16px;
  text-align: center;
}

.c-load__text {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
}

/* ======================================================================================================== */
/* Breadcrumbs (breadcrumbs.ts): «Curs valutar › EUR», 13/500                                               */
/* ======================================================================================================== */

.c-crumbs {
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
}

.c-crumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.c-crumbs__item {
  display: inline-flex;
  align-items: center;
}

.c-crumbs__sep {
  margin: 0 0.3em;
}

.c-crumbs--hero {
  color: var(--on-hero-label);
  --focus-color: var(--focus-ring-hero);
}

.c-crumbs--sheet {
  color: var(--text-secondary);
}

/* The text is 18 high; the hit area grows to 44 (spec 4.8). */
.c-crumbs__link {
  position: relative;
  color: inherit;
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.c-crumbs__link::after {
  content: '';
  position: absolute;
  inset: -13px -4px;
}

.c-crumbs__link:hover {
  text-decoration-line: underline;
}

.c-crumbs--hero .c-crumbs__link:hover {
  color: var(--on-hero);
}

.c-crumbs--sheet .c-crumbs__link:hover {
  color: var(--accent-text-pressed);
}

/* ======================================================================================================== */
/* Currency pill (currency-picker.ts): 44, radius 22, padding 0 12 0 6, flag 30, code 17/700, chevron 14    */
/* ======================================================================================================== */

.c-pill {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px 0 6px;
  border: 0;
  border-radius: 22px;
  font-size: 17px;
  line-height: 22px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--transition);
}

.c-pill--hero {
  background: var(--hero-control);
  color: var(--on-hero);
  --focus-color: var(--focus-ring-hero);
}

.c-pill--hero:hover {
  background: var(--hero-control-hover);
}

.c-pill--hero:active,
.c-pill--hero[aria-expanded='true'] {
  background: var(--hero-control-pressed);
}

.c-pill--sheet {
  background: var(--surface-muted);
  color: var(--ink);
}

.c-pill--sheet:hover,
.c-pill--sheet[aria-expanded='true'] {
  background: var(--surface-muted-hover);
}

/* ======================================================================================================== */
/* Currency picker (client/components/currency-picker.ts, E09): popover 360 from 768, modal sheet below     */
/* ======================================================================================================== */

.c-picker {
  padding: 0;
  border: 0;
  background: var(--sheet);
  color: var(--ink);
}

/* Title and search stay in place; only the list scrolls. */
.c-picker[open] {
  display: flex;
  flex-direction: column;
}

.c-picker--popover {
  position: fixed;
  z-index: 50;
  inset: auto;
  width: min(360px, calc(100vw - 32px));
  max-height: 520px;
  margin: 0;
  padding: 8px 16px 0;
  border-radius: 24px;
  box-shadow: 0 10px 30px var(--shadow-nav);
}

/* E09: the sheet starts 92 below the top, radius 32 on top, handle 36 x 5. */
.c-picker--sheet {
  width: 100%;
  max-width: 100%;
  height: calc(100% - 92px);
  max-height: calc(100% - 92px);
  margin: auto 0 0;
  padding: 0 16px;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  transform: translateY(100%);
  transition:
    transform 220ms cubic-bezier(0.32, 0, 0.67, 0),
    overlay 220ms allow-discrete,
    display 220ms allow-discrete;
}

.c-picker--sheet[open] {
  transform: none;
  transition:
    transform 320ms cubic-bezier(0.33, 1, 0.68, 1),
    overlay 320ms allow-discrete,
    display 320ms allow-discrete;
}

@starting-style {
  .c-picker--sheet[open] {
    transform: translateY(100%);
  }
}

.c-picker--sheet::backdrop {
  background: var(--scrim);
}

html.c-picker-open {
  overflow: hidden;
}

/* The list scrolls; it spans the full width so the rows' -12 px margins and focus rings are not cut. */
.c-picker__list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 -16px;
  padding: 0 16px 8px;
  overflow: auto;
  overscroll-behavior: contain;
}

.c-picker--sheet .c-picker__list {
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.c-picker__head,
.c-picker__search,
.c-picker__handle {
  flex-shrink: 0;
}

.c-picker__handle {
  display: none;
  width: 36px;
  height: 5px;
  margin: 8px auto;
  border-radius: 3px;
  background: var(--grabber);
}

.c-picker--sheet .c-picker__handle {
  display: block;
}

.c-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 44px;
}

.c-picker__title {
  min-width: 0;
  overflow: hidden;
  font-size: 17px;
  line-height: 22px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.c-picker__done {
  flex-shrink: 0;
  height: 48px;
  margin-right: -12px;
  padding: 0 12px;
  border-radius: 24px;
  color: var(--accent-text);
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
  transition: color var(--transition);
}

.c-picker__done:hover,
.c-picker__done:active {
  color: var(--accent-text-pressed);
}

.c-picker__search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  margin-top: 4px;
  padding: 0 14px;
  border-radius: 22px;
  background: var(--surface-muted);
  color: var(--text-secondary);
  cursor: text;
}

.c-picker__search:focus-within {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
}

.c-picker__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  outline: none;
  appearance: none;
}

.c-picker__input::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}

.c-picker__sec {
  display: flex;
  align-items: center;
  height: 24px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}

/* E09: «La bănci» 5 below the search, 22 high; «Doar curs oficial BNM» right after the rows, 24 high. */
.c-picker__group:first-child > .c-picker__sec {
  align-items: flex-start;
  height: 22px;
  margin-top: 5px;
}

.c-picker__group--all {
  padding-top: 5px;
}

.c-picker__opt {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  margin: 0 -12px;
  padding: 0 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: background-color var(--transition);
}

.c-picker__opt:hover {
  background: var(--row-hover);
}

/* The keyboard row (aria-activedescendant): focus stays in the search field, so the row shows the ring. */
.c-picker__opt.is-active {
  background: var(--row-hover);
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.c-picker__txt {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.c-picker__code {
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
}

.c-picker__name {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.c-picker__tag {
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  white-space: nowrap;
}

.c-picker__check {
  color: var(--accent-text);
}

.c-picker__empty {
  padding: 32px 0 16px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  text-align: center;
}

/* ======================================================================================================== */
/* BNM chart (chart.ts): 690 x 180, line 2, end dot 8, labels 13/500; on white or on the cobalt panel       */
/* ======================================================================================================== */

.c-chart__frame {
  position: relative;
}

.c-chart__plot {
  border-radius: 8px;
  touch-action: pan-y;
}

.c-chart__svg {
  display: block;
  width: 100%;
  max-width: none;
  height: 180px;
  overflow: visible;
  font-family: var(--font);
  transition: opacity var(--transition);
}

.c-chart__line {
  stroke: var(--chart-line);
}

.c-chart__end {
  fill: var(--chart-line);
}

.c-chart__val,
.c-chart__date {
  fill: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

/* Hover: vertical line, point, tooltip (W03). */
.c-chart__vline {
  stroke: var(--grabber);
}

.c-chart__dot {
  fill: var(--sheet);
  stroke: var(--chart-line);
}

.c-chart__tip {
  fill: var(--tooltip-bg);
}

.c-chart__tiptext {
  fill: var(--tooltip-text);
  font-size: 13px;
  font-weight: 600;
}

/* Cobalt panel (W04): white line and dot, labels in on-hero-note and on-hero-label. */
.c-chart--hero {
  --focus-color: var(--focus-ring-hero);
}

.c-chart--hero .c-chart__line {
  stroke: var(--on-hero);
}

.c-chart--hero .c-chart__end {
  fill: var(--on-hero);
}

.c-chart--hero .c-chart__val {
  fill: var(--on-hero-note);
}

.c-chart--hero .c-chart__date {
  fill: var(--on-hero-label);
}

.c-chart--hero .c-chart__vline {
  stroke: var(--hero-divider);
}

.c-chart--hero .c-chart__dot {
  fill: var(--surface-hero);
  stroke: var(--on-hero);
}

/* Loading, error and «no data» messages sit over the plot. */
.c-chart__msg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
}

.c-chart__msg > * {
  pointer-events: auto;
}

.c-chart__msgtext {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
}

.c-chart__retry {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  color: var(--accent-text);
  font-size: 14px;
  line-height: 18px;
  font-weight: 700;
}

.c-chart--hero .c-chart__msgtext {
  color: var(--on-hero-note);
}

.c-chart--hero .c-chart__retry {
  color: var(--on-hero);
}

.c-chart.is-loading .c-chart__svg,
.c-chart__frame:has(.c-chart__msg:not([hidden])) .c-chart__svg {
  opacity: 0.3;
}

.c-chart__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 16px;
}

.c-chart--hero .c-chart__bar {
  margin-top: 12px;
}

/* ======================================================================================================== */
/* Sortable column header (sortable.ts, spec 4.8): 13/700 text-secondary, sorted column ink with an arrow   */
/* ======================================================================================================== */

.c-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: color var(--transition);
}

.c-sort:hover {
  color: var(--ink);
}

.c-sort:hover .c-sort__label {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.c-sort__asc,
.c-sort__desc {
  display: none;
}

[aria-sort='ascending'] .c-sort,
[aria-sort='descending'] .c-sort {
  color: var(--ink);
}

[aria-sort='ascending'] .c-sort__asc,
[aria-sort='descending'] .c-sort__desc {
  display: block;
}

/* ======================================================================================================== */
/* Reduced motion                                                                                           */
/* ======================================================================================================== */

@media (prefers-reduced-motion: reduce) {
  .c-picker--sheet,
  .c-picker--sheet[open] {
    transition: none;
  }
}
