/* Fast-Fiber typography: Inter, restrained hierarchy, readable operational data.
   Keep status colors, icon fonts and terminal metrics owned by their components. */
:root {
    --ff-type-body: 1rem;            /* 16px application text */
    --ff-type-control: .9375rem;     /* 15px desktop controls */
    --ff-type-table: .875rem;        /* 14px operational tables and lists */
    --ff-type-secondary: .8125rem;   /* 13px supporting text */
    --ff-type-caption: .75rem;       /* 12px captions and metadata */
    --ff-type-section-title: 1.125rem; /* 18px */
    --ff-type-page-title: 1.5rem;    /* 24px desktop */
    --ff-type-reading: 1.125rem;     /* 18px public text-heavy content */
    --ff-type-ink-strong: #111;
    --ff-type-ink: #171717;
    --ff-type-ink-secondary: #333;
}

html { font-size: 16px; }
body {
    font-family: var(--font-family, 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif) !important;
    font-size: var(--ff-type-body) !important;
    line-height: 1.5;
    color: var(--ff-type-ink) !important;
}

body :where(p, li, dd) {
    font-size: inherit;
}
body :where(button, input, select, textarea, .btn, .form-control, .form-select) {
    font-size: var(--ff-type-control) !important;
}
body :where(td, .table, .data-table, .list-group-item) {
    font-size: var(--ff-type-table) !important;
}
body :where(small, label, .form-label, .form-text, .text-muted, .help-text, .page-subtitle) {
    font-size: var(--ff-type-secondary) !important;
}
body :where(caption, th, .caption, .eyebrow, .kicker, .metadata) {
    font-size: var(--ff-type-secondary) !important;
}

body :where(h1, h2, h3, h4, h5, h6) { font-weight:600; line-height:1.3; }
body :where(strong, b) { font-weight:600; }
body :where(.text-muted, .form-text, .help-text, .page-subtitle) { color:var(--ff-type-ink-secondary) !important; }
body :where(input, textarea)::placeholder { color:#444 !important; opacity:1; }
body :where(button, input, select, textarea, .btn):disabled { color:#555 !important; }
body :where(.btn-primary, .btn-success, .btn-danger, .btn-dark, .text-bg-primary, .text-bg-success, .text-bg-danger, .bg-primary, .bg-success, .bg-danger, .bg-dark) { color:#fff !important; }
body :where(.btn-warning, .text-bg-warning, .bg-warning) { color:#111 !important; }
body :where(.text-danger, .invalid-feedback, .alert-danger) { color:#9f1c14 !important; }
body :where(.text-success, .alert-success) { color:#067647 !important; }
body :where(.text-warning, .alert-warning) { color:#7a2e0e !important; }

body :where(.card-title, .section-title, .panel-title, .modal-title) {
    font-size: var(--ff-type-section-title) !important;
    font-weight:600;
}

/* A page title may be an h1 or, in older operational modules, an h2. */
body h1,
body :is(
    .page-header, .content-header, .report-heading, .ws-head, .accounts-heading,
    .messenger-heading, .config-page-header, .olt-page-header, .health-page-header,
    .jobs-header, .field-page-heading, .flow-page-header, .security-header,
    .sales-head, .sd-head, .ready-header, .customer-overview-header, .co-page-head,
    .bo-header, .subscriber-head, .ipl-header, .sites-head, .fa-head,
    .inquiry-heading, .monitor-heading, .logs-header, .dev-header,
    .location-page-header, .payroll-page-header, .asset-scan-header, .tkt-header,
    .jd-header, .telemetry-header
) :is(h1, h2, .page-title) {
    font-size: var(--ff-type-page-title) !important;
    font-weight:600 !important;
    line-height: 1.18 !important;
    letter-spacing: -.025em;
}

/* Marketing and informational pages use the text-heavy end of the scale. */
body :where(.hero, .page-hero, .lp-hero, .ff-hero, .section-title) > p,
body :where(.public-copy, .article-copy, .legal-copy) p {
    font-size: var(--ff-type-reading) !important;
    line-height: 1.65;
}

body :where(.hero, .page-hero, .lp-hero, .ff-hero) h1 {
    font-size: clamp(2.5rem, 4vw, 3rem) !important;
}
body :where(.lp-section-head, .ff-heading, .section-title) h2 {
    font-size: clamp(1.75rem, 3vw, 2rem) !important;
}

/* Preserve specialist rendering where font metrics are functional. */
body :where(pre, code, kbd, samp, .xterm, .xterm *, .terminal, .terminal *, .barcode, .qr-code) {
    font-size: revert !important;
}

@media (max-width: 767px) {
    :root {
        --ff-type-body: 1rem;          /* 16px mobile text */
        --ff-type-control: 1rem;       /* prevents mobile form zoom */
        --ff-type-secondary: .875rem;  /* 14px mobile supporting text */
        --ff-type-page-title: 1.375rem; /* 22px mobile */
    }
    body :where(.hero, .page-hero, .lp-hero, .ff-hero, .section-title) > p,
    body :where(.public-copy, .article-copy, .legal-copy) p {
        font-size: var(--ff-type-body) !important;
    }
    body :where(.hero, .page-hero, .lp-hero, .ff-hero) h1 {
        font-size: clamp(1.875rem, 8vw, 2.25rem) !important;
    }
    body :where(.lp-section-head, .ff-heading, .section-title) h2 {
        font-size: 1.625rem !important;
    }
}

@media print {
    html { font-size: 12pt; }
    body { font-size: 12pt !important; }
}

/* Shared workspace components: normal case, consistent weight and rhythm. */
body:is(.compact-workspace,.superadmin-shell) :is(.btn,.form-control,.form-select,.dropdown-item) {
    font-family:var(--font-family, 'Inter', system-ui, sans-serif) !important;
    font-size:var(--ff-type-control) !important;
    line-height:1.45;
    letter-spacing:normal;
}
body:is(.compact-workspace,.superadmin-shell) :is(.btn,.dropdown-item) { font-weight:500; }
body:is(.compact-workspace,.superadmin-shell) :is(label,.form-label) {
    font-size:.875rem !important;
    font-weight:500;
    letter-spacing:normal;
    text-transform:none;
}
body:is(.compact-workspace,.superadmin-shell) :is(.table,.data-table) {
    font-size:var(--ff-type-table) !important;
    font-variant-numeric:tabular-nums;
    line-height:1.5;
}
body:is(.compact-workspace,.superadmin-shell) :is(.table,.data-table) th {
    font-size:var(--ff-type-secondary) !important;
    font-weight:600;
    text-transform:none;
    letter-spacing:normal;
    line-height:1.4;
}
body:is(.compact-workspace,.superadmin-shell) :is(.modal-title,.card-title,.panel-title,.section-title) {
    font-size:var(--ff-type-section-title) !important;
    font-weight:600 !important;
    letter-spacing:-.01em;
}
/* Legacy network pages define tiny text inside otherwise normal-sized cells. */
:is(#onuInventory,#olt-page,.modal) :is(.table,.data-table) td {
    font-size:var(--ff-type-table) !important;
    line-height:1.5;
}
:is(#onuInventory,#olt-page,.modal) :is(.table,.data-table) td :is(strong,b) {
    font-size:inherit !important;
    font-weight:600;
}
:is(#onuInventory,#olt-page,.modal) :is(.table,.data-table) :is(small,.badge,.onu-state) {
    font-size:var(--ff-type-secondary) !important;
    line-height:1.4;
}
:is(#onuInventory,#olt-page,.modal) :is(.table,.data-table) code {
    font-size:var(--ff-type-secondary) !important;
}
:is(#onuInventory,#olt-page) :is(.table,.data-table) small {
    color:var(--ff-type-ink-secondary) !important;
}
:is(#onuInventory,#olt-page) :is(.onu-olt-tab,.network-context,.network-related-links a) {
    font-size:.875rem !important;
    font-weight:500;
}
:is(#onuInventory,#olt-page) :is(.onu-sync-copy strong,.olt-inventory-heading h3,.olt-console-guide strong) {
    font-size:1rem !important;
    font-weight:600;
}
@media (max-width:767px) {
    body:is(.compact-workspace,.superadmin-shell) :is(input.form-control,select.form-select,textarea.form-control) {
        font-size:1rem !important;
    }
}
