.hidden { display: none !important; }
:root[dir="rtl"] :is(.icon-chevron-left, .icon-chevron-right) { transform: scaleX(-1); }
.main { overflow: hidden; padding: var(--padding-medium); }

.header { height: var(--height); }
.logo-mark { background-image: url("favicon.png"); }
.header-tools { height: 100%; }

.toolbar { flex: none; display: flex; flex-wrap: wrap; gap: var(--gap-small); }
.toolbar select { width: calc(var(--height) * 5); max-width: 100%; }
.sample-bar { flex: none; display: flex; align-items: center; gap: var(--gap-medium); }
.sample-input { flex: 1; min-width: 0; }
.sample-bar > input.size-slider { flex: none; width: calc(var(--height) * 5); }
.selected { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-small); }
.chip { height: calc(var(--unit) * 10); padding: 0 var(--padding-small); gap: var(--gap-extra-small); font-size: var(--font-size-small); background: var(--bg-1); }
.chip > .icon { width: var(--icon-size-extra-small); height: var(--icon-size-extra-small); }

.fonts-area { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: var(--gap-small); }
.fonts { --sample-size: calc(var(--unit) * 10); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(var(--unit) * 90)), 1fr)); gap: var(--gap-small); }
.font-card {
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: var(--gap-small);
  height: auto; padding: var(--padding-medium); text-align: start; text-transform: none; font-weight: 400; min-width: 0;
}
.font-head { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-small); min-width: 0; }
.font-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-sample { min-height: calc(var(--sample-size) * 1.5); font-size: var(--sample-size); line-height: 1.3; overflow-wrap: anywhere; overflow: hidden; max-height: calc(var(--sample-size) * 4); }
.font-sample.waiting { color: var(--fg-1); }
.font-skeleton { height: calc(var(--unit) * 40); }
.font-meta { display: flex; flex-wrap: wrap; gap: var(--gap-small) var(--gap-medium); color: var(--fg-1); font-size: var(--font-size-extra-small); }
.sentinel { flex: none; height: var(--unit); }

.filters { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--gap-small); padding: 0 var(--padding-medium); }
.filter-group-body { display: flex; flex-direction: column; gap: var(--gap-small); padding-top: var(--gap-small); }
.filter-list { display: flex; flex-direction: column; }
.filter-label { display: flex; align-items: center; gap: var(--gap-small); height: var(--height); cursor: pointer; }
.filter-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filter-count { color: var(--fg-1); font-size: var(--font-size-extra-small); font-variant-numeric: tabular-nums; }

.font-detail { display: flex; flex-direction: column; gap: var(--gap-medium); padding: var(--padding-medium); }
.shared-sheet[data-side="end"]:has(.font-detail) { width: min(calc(var(--unit) * 190), calc(var(--vw) * 100 - 2.4rem)); }
.detail-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--gap-medium); }
.badges { display: flex; flex-wrap: wrap; gap: var(--gap-small); }
.detail-section { display: flex; flex-direction: column; gap: var(--gap-small); }
.detail-title { font-size: var(--font-size-large); font-weight: 700; }
.specimen { display: flex; flex-direction: column; gap: var(--gap-extra-small); padding: var(--padding-small) 0; border-bottom: var(--border-width) solid var(--border); }
.specimen-label { color: var(--fg-1); font-size: var(--font-size-extra-small); }
.specimen-text { font-size: calc(var(--unit) * 9); line-height: 1.3; overflow-wrap: anywhere; }
.snippet-label { color: var(--fg-1); font-size: var(--font-size-extra-small); font-weight: 700; text-transform: uppercase; }
.snippet .code-block pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.snippet { display: flex; flex-direction: column; gap: var(--gap-small); }
.snippet-copy { width: calc(var(--height) * 4); }

@media (max-width: 35rem) {
  .toolbar select { flex: 1; }
  .sample-bar { flex-wrap: wrap; }
  .sample-bar > input.size-slider { flex: 1; width: auto; }
}
