/* ==========================================================================
   Nocturne — Fonty (P4): project fonts page, the font upload drop zone
   (_font_uploader), and the "Písma v manuálech" box (F8 — the manual's own
   Fonty tab is gone).
   Values from prototype app.css § "Fonty projektu". The upload strip reuses
   the gallery's `.gal-drop` (gallery.css).
   ========================================================================== */

.fn-nav { gap: 10px 14px; }
.fn-sample { flex: 1 1 280px; min-width: 200px; height: 40px; }
.fn-size { display: flex; align-items: center; gap: 10px; margin: 0; padding: 0 6px; }
.fn-size input { width: 140px; accent-color: var(--lav); }
.fn-size b { min-width: 44px; font-size: 12px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* Upload queue rows (built by font_uploader_controller.js) */
.fn-ups { display: flex; flex-direction: column; gap: 8px; }
.fn-ups:empty { display: none; }
.fn-uploader { display: flex; flex-direction: column; gap: 10px; }
.fn-uploader .gallery-upload-item { padding: 10px 14px !important; border-radius: 14px !important; background: var(--surface); border: 1px solid var(--line) !important; font-size: 13px; }

.fn-missing ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.fn-missing.alert:has(> .i) { align-items: flex-start; }

/* Family cards */
.fn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(520px, 100%), 1fr)); gap: 16px; align-items: start; }
.fn-grid:empty { display: none; }
.fn-fam { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.fn-fam.gu-transit { opacity: .45; }
.fn-fam-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fn-fam-t { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fn-fam-t h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fn-fam-meta { display: flex; align-items: center; gap: 8px; }
.fn-dot { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15), 0 0 0 1px var(--line-2); }
.fn-grip { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; margin-top: 4px; color: var(--subtle); cursor: grab; }
.fn-grip:hover { color: var(--text-2); }

/* Weight axis 100–900 (upright filled, italic = slanted mark) */
.fn-fam .weight-axis { display: flex; gap: 3px; }
.fn-fam .weight-axis__cell { flex: 1 1 0; height: 20px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--subtle); font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fn-fam .weight-axis__cell--upright { background: var(--lav-deep); border-color: var(--lav-line); color: var(--lav-ink); }
.fn-fam .weight-axis__cell--italic::after { background: var(--lav); }

/* Cuts */
.fn-cuts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fn-cut { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); min-width: 0; }
.fn-cut.gu-transit { opacity: .45; }
.fn-cut.gu-mirror { padding: 10px 14px; border-radius: 14px; background: var(--surface-2); box-shadow: var(--shadow-3); }
.fn-cut-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fn-cut .fn-prev { margin: 0; font-size: 28px; line-height: 1.2; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fn-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.fn-meta b { font-weight: 600; color: var(--text-2); margin-right: 2px; }
.fn-meta .font-wire { color: var(--subtle); font-size: 11px; }
.fn-tag { height: 20px; padding: 0 7px; display: inline-flex; align-items: center; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.fn-use { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 600; }
.fn-use .i { width: 12px; height: 12px; }
.fn-use.none { background: transparent; color: var(--subtle); padding: 0 2px; font-weight: 500; }
.fn-cut-a { display: flex; align-items: center; gap: 2px; flex: none; }
.fn-css { color: var(--muted); }
.fn-del { color: var(--subtle); }
.fn-del:hover { color: var(--rose-ink) !important; background: var(--rose-deep) !important; }

/* "Písma v manuálech" (F8): per brand manual its fonts as rows — role pill,
   sample colour, the cuts as toggle chips (manual-font-faces-toggle saves on
   change), drag order (dragula → sort_manual_fonts). */
.fn-man { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.fn-man-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--subtle); }
.fn-man-n { font-size: 15px; font-weight: 600; color: var(--text); text-decoration: none; }
.fn-man-n:hover { color: var(--lav-ink); }
.fn-man-h .btn { margin-left: auto; }
.fn-man-empty { margin: 0; }
.fn-mrows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fn-mrow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.fn-mrow.gu-transit { opacity: .45; }
.fn-mrow.gu-mirror { box-shadow: var(--shadow-3); }
.fn-mrow .fn-grip { margin-top: 0; }
.fn-mrow-t { flex: 0 1 300px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.fn-mrow-t b { font-size: 18px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 100%; }
.fn-mrow-c { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.fn-mrow-c .fn-dot { width: 14px; height: 14px; }
.fn-mcuts { flex: 1 1 280px; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.fn-mcut { margin: 0; }
.fn-mcut > .i { display: none; }
.fn-mcut:has(input:checked) { background: var(--a-deep); border-color: var(--a-line); color: var(--a-ink); }
.fn-mcut:has(input:checked) > .i { display: inline-block; }
.fn-mcut:has(input:focus-visible) { outline: 2px solid var(--lav-ink); outline-offset: 2px; }
.fn-mcut:has(input:disabled) { cursor: default; }
.fn-mcut:has(input:disabled):not(:has(input:checked)) { opacity: .55; }
.fn-mrow > .dropdown { margin-left: auto; }
.fn-mrow-warn { order: 4; flex-basis: 100%; margin: 0; display: flex; align-items: center; gap: 6px; color: var(--pch-ink); }

@media (max-width: 900px) { .fn-size input { width: 100px; } }
@media (max-width: 560px) {
    .fn-nav .btn { flex: 1; }
    .fn-sample { flex-basis: 100%; }
    .fn-size { width: 100%; padding: 0 4px; }
    .fn-size input { flex: 1; width: auto; }
    .fn-fam { padding: 16px; }
    .fn-fam-t h2 { font-size: 22px; }
    .fn-css { display: none; }
}
@media (max-width: 700px) {
    .fn-mrow-t { flex: 1 1 0; }
    .fn-mcuts { order: 3; flex-basis: 100%; }
}
