/* picker.css – the font dropdown: a compact, classic select. The collapsed field shows the chosen font in its own face;
   the list shows every font in its own face too (like the font menu in Illustrator). The popup is position:fixed (placed by JS)
   so it is never clipped by the scrolling side panel. */

.fp { position: relative; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.fp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.fp-label { font-size: var(--field-label-size); font-weight: var(--label-weight); letter-spacing: var(--field-label-ls); text-transform: var(--field-label-case); color: var(--text); }
.fp-badge {
  font-family: var(--ui-font); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2);
  padding: 2px 9px; border: 1px solid var(--border); border-radius: var(--radius-chip); background: var(--surface); box-shadow: var(--shadow-chip);
}
:root[data-skin="modern"] .fp-badge { text-transform: none; letter-spacing: 0; font-size: 11px; background: var(--accent-soft); border-color: transparent; color: var(--accent); }

.fp-trigger {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: max(42px, var(--ctrl-h)); padding: 0 12px; text-align: left;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius);
  transition: border-color .12s, box-shadow .12s;
}
.fp-trigger:hover { border-color: var(--text); }
.fp.is-open .fp-trigger { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
:root[data-skin="modern"] .fp.is-open .fp-trigger { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fp-trigger:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.fp-name { flex: 1; min-width: 0; font-size: 17px; line-height: 1.25; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-sub { font-family: var(--ui-font); font-size: 11.5px; line-height: 1.35; color: var(--text-3); font-weight: 500; }
.fp-status { flex: none; display: inline-flex; align-items: center; color: var(--text-3); }
.fp-status:empty { display: none; }
.fp-err { display: inline-flex; color: var(--danger); }
.fp-chev { flex: none; color: var(--text); transition: transform .15s; }
.fp.is-open .fp-chev { transform: rotate(180deg); }
.fp-notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border: 1px solid var(--danger); border-radius: var(--radius);
  background: var(--danger-soft); color: var(--danger); font-size: 12px; font-weight: 600;
}
.fp-notice-text { flex: 1 1 140px; min-width: 0; }

/* ----- popup ----- */
.fp-popup {
  position: fixed; z-index: 70; left: 0; top: 0; width: 380px; max-height: 520px; display: flex; flex-direction: column; container-type: inline-size;
  background: var(--surface); color: var(--text); border: 1px solid var(--text); border-radius: var(--radius); box-shadow: var(--shadow-2); overflow: hidden;
  animation: tp-in .14s ease;
}
:root[data-skin="modern"] .fp-popup { border-color: var(--border-strong); border-radius: var(--radius-l); }
.fp-cats { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.fp-chip {
  flex: none; padding: 4px 11px; min-height: 28px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.fp-chip:hover { background: var(--surface-3); color: var(--text); }
.fp-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fp-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; position: relative; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.fp-list:focus { outline: none; }
.fp-group-head {
  position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 6px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); font-family: var(--ui-font); font-size: 10px; font-weight: 700; letter-spacing: var(--section-label-ls);
  text-transform: var(--section-label-case); color: var(--text-3);
}
:root[data-skin="modern"] .fp-group-head { font-size: 11px; }
.fp-count { font-weight: 600; font-variant-numeric: tabular-nums; }
.fp-opt {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 12px; min-height: 40px; padding: 0 14px; cursor: pointer;
  border-bottom: 1px solid var(--hairline);
}
.fp-opt-name { padding: 6px 0; font-size: 17px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-opt-sample { font-size: 16px; line-height: 1.25; color: var(--text-2); white-space: nowrap; }
.fp-check { color: var(--accent); opacity: 0; }
.fp-opt.is-active { background: var(--surface-3); }
.fp-opt.is-selected { box-shadow: inset 3px 0 0 var(--accent); }
.fp-opt.is-selected .fp-check { opacity: 1; }
.fp-hint { flex: none; padding: 7px 14px; border-top: 1px solid var(--border); background: var(--surface-2); color: var(--text-3); font-size: 11px; text-align: center; }
.fp-empty { padding: 28px 16px; text-align: center; color: var(--text-3); }

@container (max-width: 310px) { .fp-opt-sample { display: none; } .fp-opt { grid-template-columns: minmax(0, 1fr) 16px; } }
@media (max-width: 640px) {
  .fp-hint { display: none; }
  .fp-opt { min-height: 44px; }
}
