@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/*
 * TGM Portal Typography Standard
 *
 * Central visual contract for the Portal / Database UI Engine.
 * - Primary typeface: Inter (Lato/system fallback)
 * - Smallest operator-visible text: 13px
 * - Deliberately compact scale: 13px base, 15px section, 17px subheading.
 * - Page and modal headings remain larger according to hierarchy.
 *
 * Imported by database-formula-editor.css. The floor declarations intentionally use
 * !important so legacy component rules at 8/9/10/11/12px cannot undercut the
 * accessibility/readability minimum while larger headings keep their own hierarchy.
 */
:root{
  --tgm-font-family:var(--font,'Inter','Lato',ui-sans-serif,system-ui,sans-serif);
  --tgm-font-size-min:13px;
  --tgm-font-size-body:var(--type-body,13px);
  --tgm-font-size-ui:var(--type-control,13px);
  --tgm-font-size-section:var(--type-section,15px);
  --tgm-font-size-subheading:var(--type-subheading,17px);
}

html,body,
button,input,select,textarea,dialog{
  font-family:var(--tgm-font-family)!important;
  font-size:var(--tgm-font-size-min)!important;
}

/* Semantic small copy must never render below the 13px UI baseline. */
small{
  font-size:var(--tgm-font-size-min)!important;
}

/* Guard legacy inline presentation fragments generated by older UI modules. */
[style*="font-size:8px"],[style*="font-size: 8px"],
[style*="font-size:9px"],[style*="font-size: 9px"],
[style*="font-size:10px"],[style*="font-size: 10px"],
[style*="font-size:11px"],[style*="font-size: 11px"],
[style*="font-size:12px"],[style*="font-size: 12px"]{
  font-size:var(--tgm-font-size-min)!important;
}

/* Portal shell / navigation / dashboard metadata. */
.brand span,
.section,
.crumb,
.status,
.eyebrow,
.card span,
.panel-head span,
.tag,
.pill,
.row-action,
.welcome-meta span,
.home-metric small,
.home-metric p,
.panel-kicker,
.quiet-badge,
.live-label,
.home-note,
.drawer-kicker,
.layout-save-status,
.company-status,
.subtle,
.lead,
.master-tile small,
.module small,
.home-empty p,
.placeholder p{
  font-size:var(--tgm-font-size-min)!important;
}

/* Shared Database UI Engine: query bar, filter/sort, schema and property dialogs. */
.nt-tool-btn,
.nt-rule-chip,
.nt-rule-kind,
.nt-pop-body label,
.nt-property-form>label,
.nt-shared-mark,
.nt-modal-kicker,
.nt-property-head p,
.nt-type-option strong,
.nt-type-option small,
.nt-property-form small,
.nt-settings-type label,
.nt-settings-cell label,
.nt-settings-hint,
.nt-property-footer [data-message],
.nt-relation-target-label,
.nt-relation-limit legend,
.nt-relation-combobox input[type="search"],
.nt-relation-target-options button,
.nt-relation-target-empty,
.nt-relation-limit-option strong,
.nt-relation-limit-option small,
.nt-tag,
.nt-inline-editor,
.nt-pop-head small,
.nt-sort-priority,
.nt-rule-priority,
.nt-sort-row select,
.nt-add-sort,
.nt-sort-empty,
.nt-filter-row select,
.nt-filter-row input,
.nt-filter-no-value,
.nt-column-filter-values,
.nt-column-filter-row,
.nt-property-config-title,
.nt-property-config-section>label{
  font-size:var(--tgm-font-size-min)!important;
}

/* Formula Builder / Formula Editor metadata and controls. */
.nt-formula-result,
.nt-formula-expr,
.nt-formula-list-head,
.nt-formula-chip,
.nt-formula-status,
.v3-formula-readout{
  font-size:var(--tgm-font-size-min)!important;
}

/* Table View is the typography floor reference. Keep every data presentation aligned. */
.dbw-grid-cell,
.dbw-grid-cell .nt-tag,
.dbw-grid-cell .pill,
.dbw-grid-cell input,
.dbw-grid-cell select,
.dbw-grid-cell textarea{
  font-size:var(--tgm-font-size-min)!important;
}

/* Form controls and helper UI use the same 13px base. */
.drawer-form input,
.drawer-form select,
.drawer-form textarea,
.drawer-form button,
.v3-popover input,
.v3-popover select,
.v3-popover textarea,
.v3-popover button{
  font-size:var(--tgm-font-size-min)!important;
}
