/* ============================================================
   sc-type-v2 (2026-10-29) - ServerCrate portal type system.
   Loads LAST on every page that loads portal.css (customer pages
   and /core). Faces and the three tokens live in portal.css:
     --font     Instrument Sans (UI, body, buttons)
     --display  Instrument Sans Display (same files, 87.5% width)
     --mono     Martian Mono (instrumentation: numbers, IDs, code)
   Weights are used on purpose: 450 body, 550 controls and labels,
   650 display. Rules are prefixed ":root body" so they outrank the
   older layers (sc-brand, sc-ui-v2, polish) without !important.
   ============================================================ */

:root{
  --fw-body:450;
  --fw-mid:550;
  --fw-strong:650;
  --ls-display:-.012em;
  --ls-label:.09em;
  --fs-label:11.5px;
}

/* ---------- base ---------- */
:root body{
  font-weight:var(--fw-body);
  font-kerning:normal;
  word-spacing:.02em;   /* Instrument Sans sets a narrow word space; this opens "2 devices · 2 servers" slightly */
}
/* element defaults use :where() so any component class still wins */
:where(b,strong){font-weight:var(--fw-strong)}
:where(.form-input,input[type=text],input[type=email],input[type=password],input[type=search],input[type=tel],input[type=url],textarea,select){
  font-weight:var(--fw-body);
}

/* ---------- display: headings, page titles, modal titles ---------- */
:root body :is(h1,h2,h3,.page-title,.auth-title,.sc-greet__title,.sc-modal__title,.modal-box h3,.sc-profile-name,
  .empty h3,.p404-title,.sc-brand-pitch,.adm-topbar-title,.sc-done-title,.card.sc-hero h2){
  font-family:var(--display);
  font-weight:var(--fw-strong);
  letter-spacing:var(--ls-display);
  font-feature-settings:"kern" 1;
}
:root body :is(h1,.page-title,.sc-greet__title,.p404-title,.sc-brand-pitch){letter-spacing:-.018em;line-height:1.08}
:root body :is(.page-title,.sc-greet__title),
:root body .portal-layout :is(.page-title,.sc-greet__title){font-size:clamp(1.75rem,1.35rem + 1vw,2.2rem)!important}
:root body .auth-title{font-size:1.55rem;letter-spacing:-.016em}
:root body .sc-brand-pitch{font-weight:600;font-size:3.25rem;letter-spacing:-.014em;line-height:1.06}
:root body .modal-box h3{font-size:1.15rem}

/* card + panel titles: UI face, firm but quieter than display */
:root body :is(.card-title,.panel-title,.adm-panel-title,.sc-action__title,.data-row-title,.sc-step__title,.sc-pref-row__title){
  font-weight:var(--fw-strong);
  letter-spacing:-.012em;
}
:root body :is(.page-subtitle,.auth-subtitle,.sc-greet__sub,.card-sub){letter-spacing:-.004em}

/* ---------- micro-labels: condensed mono caps (the ledger voice) ---------- */
:root body :is(.sc-greet__hello,.sc-eyebrow,.scv-eyebrow,.sc-section__title,.sidebar .nav-section,.nav-section,
  .sc-vital__head > span:first-child,.stat-label,.data-grid-label,.info-tile-label,.sc-label,.sc-field-label,.sc-token__label,
  .sc-stat__head,.sc-sec-label,.sc-tier-ribbon__name,.metric-label,.adm-nav-section,.adm-logo-sub,.sc-br-label,.sc-br-sec-h,
  .sc-onboard__title,.pm-label,.sc-brand-mark){
  font-family:var(--mono);
  font-stretch:80%;
  font-weight:500;
  font-size:var(--fs-label);
  letter-spacing:var(--ls-label);
  text-transform:uppercase;
  line-height:1.4;
}
:root body .sc-section__title{font-size:12px}
:root body .sidebar .nav-section{letter-spacing:.14em}
:root body .sc-brand-mark{font-size:11.5px;letter-spacing:.24em}

/* table headers: same voice, slightly quieter */
:root body :is(table thead th,.adm-table thead th,.invoice-table thead th){
  font-family:var(--mono);
  font-stretch:75%;
  font-weight:500;
  font-size:var(--fs-label);
  letter-spacing:.1em;
  text-transform:uppercase;
}

/* chips, badges, status pills: mono caps, compact */
:root body :is(.badge,.sc-status,.sc-tk-status,.srv-status,.sc-pref-lock){
  font-family:var(--mono);
  font-stretch:75%;
  font-weight:600;
  letter-spacing:.08em;
}

/* form labels stay sentence case in the UI face */
:root body :is(.form-label,.sc-field > span:first-child){font-weight:var(--fw-mid);letter-spacing:.005em}

/* ---------- controls ---------- */
:root body :is(.btn,.adm-btn,.sc-btn){
  font-weight:var(--fw-mid);
  letter-spacing:.004em;
}
:root body :is(.btn-primary,.btn-danger,.btn-success,.btn-gold,.btn-warning){font-weight:600}
:root body :is(.nav-item,.adm-nav-item,.adm-tab,.tabs a){font-weight:500;letter-spacing:-.002em}
:root body :is(.nav-item.active,.adm-nav-item.active){font-weight:var(--fw-mid)}

/* ---------- numbers: KPIs, prices, timers, tables ---------- */
:root body :is(.sc-vital__value,.sc-stat__value,.stat-value,.metric-value,.sc-br-value,.kpi-value,.sc-hero__stat .n){
  font-family:var(--mono);
  font-weight:500;
  letter-spacing:-.035em;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
:root body :is(.stat-value,.metric-value){font-size:1.55rem}
:root body :is(.sc-vital__value,.sc-stat__value){font-size:1.5rem}
:root body .sc-br-value{font-size:1.6rem}
:root body :is(.sc-vital__unit,.sc-vital__value small,.sc-vital__value span:not(:first-child)){
  font-family:var(--mono);font-weight:450;letter-spacing:0;
}
:root body :is(td,.td-money,[class*="price"],[class*="amount"],[class*="total"],.tabular,.sc-snap__meta,.notif-item__time,
  .sc-vital__meta,.sc-vital__head > :last-child,time,[data-countdown],[class*="timer"]){
  font-variant-numeric:tabular-nums;
}

/* ---------- mono in prose: smaller, never blows out a line ---------- */
:root body :is(code,kbd,samp,pre,.mono,.td-mono,.code-block,.sc-code-chip){
  font-stretch:87.5%;
  font-variant-ligatures:none;
}
:root body :is(p,li,dd,td,label,.sc-help,.sc-help-sm,.sc-hint,.form-hint,.alert,.data-row-desc,.sc-step__hint,.sc-callout,.empty p) :is(code,kbd,samp){
  font-size:.94em;
  font-weight:450;
  letter-spacing:-.01em;
}
:root body :is(.td-mono,.kv-value.mono,.info-tile-value,.sc-snap__id){letter-spacing:-.015em}

/* ---------- responsive: keep KPI tiles inside their boxes ---------- */
@media (max-width:1180px){
  :root body :is(.sc-vital__value,.sc-stat__value){font-size:1.3rem}
}
@media (max-width:480px){
  :root body :is(.page-title,.sc-greet__title),
  :root body .portal-layout :is(.page-title,.sc-greet__title){font-size:1.65rem!important}
  :root body .sc-brand-pitch{font-size:2.2rem}
  :root body :is(.stat-value,.metric-value,.sc-br-value){font-size:1.25rem}
}
