/* Final readability layer. Loaded after app.css so legacy compact rules cannot win. */
:root {
  font-size: 16px;
}

body {
  font-size: 1rem;
  line-height: 1.5;
}

/* Never use micro-text for meaningful interface copy. */
small,
.nav-label,
.eyebrow,
.page-identity > span,
.org-card > span,
.metric small,
th {
  font-size: 0.8rem !important;
  line-height: 1.35;
}

p,
li,
dt,
dd,
label,
legend,
.status,
.payment-tag,
.role-tag {
  font-size: 0.875rem !important;
}

button,
input,
select,
textarea,
.primary-btn,
.secondary-btn {
  font-size: 0.9rem !important;
}

input,
select,
textarea,
.primary-btn,
.secondary-btn {
  min-height: 42px;
}

/* Application chrome */
.brand small,
.org-card small,
.cloud-state small,
.profile-chip small {
  font-size: 0.78rem !important;
}

.org-card strong,
.profile-chip strong,
.cloud-state span {
  font-size: 0.88rem !important;
}

.sidebar nav a,
.sidebar-foot > a,
.sidebar-foot form button {
  min-height: 42px;
  font-size: 0.9rem !important;
}

.workspace-search input,
.location-form select {
  font-size: 0.875rem !important;
}

.workspace-search kbd {
  font-size: 0.72rem !important;
}

.page-identity h1 {
  font-size: 1.55rem !important;
}

/* Cards, metrics and tables */
.welcome p,
.panel-head p,
.panel-head a,
.metric p,
.activity-list strong,
.compact-rows strong,
.stock-list strong,
.activity-list small,
.compact-rows small,
.stock-list small {
  font-size: 0.875rem !important;
}

.panel-head h3 {
  font-size: 1.1rem !important;
}

.metric strong {
  font-size: 1.55rem !important;
}

.table-wrap table,
table {
  font-size: 0.875rem !important;
  line-height: 1.45;
}

th {
  padding-top: 12px;
  padding-bottom: 12px;
}

td {
  font-size: 0.875rem !important;
  padding-top: 14px;
  padding-bottom: 14px;
}

.message,
.empty {
  font-size: 0.875rem !important;
}

/* Legacy components that previously used 7-10px copy. */
.welcome span,
.chart-summary span,
.expected-cash span,
.formula b,
.kanban-column > header,
.provider-banner strong,
.provider-banner p,
.purchase-list strong,
.purchase-list small,
.weighted-preview strong,
.weighted-preview span,
.stock-list a,
.segments b,
.profile-chip > span,
.inline-payment button,
.job-actions button,
.payment-head button {
  font-size: 0.875rem !important;
}

.expected-cash small,
.formula small,
.invite-banner small,
.compact-rows p small,
.audit-list small,
.closed-state p {
  font-size: 0.8rem !important;
}

/* Forms and filters */
.field > span,
.cash-input > span,
.setting-row strong,
.location-picker legend {
  font-size: 0.875rem !important;
}

.field small,
.cash-input small,
.setting-row small {
  font-size: 0.8rem !important;
}

.segments button,
.segments span,
.report-tabs a,
.settings-layout > nav a {
  font-size: 0.875rem !important;
}

/* Jobs and customer records */
.job-code,
.job-card > p,
.job-history-link,
.job-money small,
.customer-top p,
.customer-card footer,
.customer-stats small,
.timeline small,
.detail-list dt {
  font-size: 0.8rem !important;
}

.job-card h3,
.customer-top h3,
.customer-stats strong,
.job-money strong,
.timeline strong,
.detail-list dd {
  font-size: 0.95rem !important;
}

/* Catalog administration and point of sale */
.catalog-admin-grid small,
.catalog-admin-grid p,
.catalog-item > small,
.cart-head span,
.cart-line small,
.stock-warning small,
.payment-balance,
.held-block button {
  font-size: 0.8rem !important;
}

.catalog-admin-grid > a {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.catalog-admin-grid > a.inactive {
  opacity: 0.62;
}

.catalog-admin-grid h3,
.catalog-admin-grid > a > strong,
.catalog-item > strong,
.catalog-item > b,
.cart-empty strong,
.cart-line strong,
.cart-line > b,
.stock-warning strong,
.totals > div,
.payment-head,
.hold-btn {
  font-size: 0.875rem !important;
}

.catalog-tools input,
.catalog-tools button,
.category-tabs button,
.discount-controls select,
.discount-controls input,
.payment-row select,
.payment-row input {
  min-height: 40px;
  font-size: 0.875rem !important;
}

.cart-head h2 {
  font-size: 1.2rem !important;
}

.register-shell {
  grid-template-columns: minmax(0, 1fr) 410px;
}

.cart-line {
  grid-template-columns: minmax(110px, 1fr) 112px 82px 24px;
  gap: 10px;
  padding: 12px 0;
}

.qty input {
  min-height: 32px;
  font-size: 0.875rem !important;
}

/* Team, audit, devices and settings */
.team-list strong,
.device-list strong,
.audit-list strong,
.brand-settings strong,
.plan-card span,
.plan-card > b {
  font-size: 0.875rem !important;
}

.team-list small,
.device-list small,
.audit-list small,
.brand-settings small,
.plan-card small {
  font-size: 0.8rem !important;
}

.team-list > div,
.device-list > div {
  padding-top: 14px;
  padding-bottom: 14px;
}

.audit-list > div {
  padding: 14px 0;
}

.profit-stack small,
.profit-stack strong {
  font-size: 0.9rem !important;
}

/* Workspace search */
.search-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.search-hero > span {
  font-size: 1.35rem;
  color: var(--muted);
}

.search-hero input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.search-count {
  margin: -4px 2px 0;
  color: var(--muted);
}

.search-empty {
  padding: 45px 20px;
  text-align: center;
}

.search-empty > span {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #edf1f3;
  font-size: 1.4rem;
}

.search-empty h2 {
  margin-bottom: 5px;
}

.search-empty p {
  margin: 0;
  color: var(--muted);
}

.search-list > a {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}

.search-list > a:hover {
  background: #faf8f0;
}

.search-list p {
  margin: 0;
}

.search-list strong,
.search-list small {
  display: block;
}

.search-list b {
  font-size: 0.875rem;
  white-space: nowrap;
}

.search-list i {
  color: #9b7a28;
  font-style: normal;
}

.search-glyph {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #edf1f4;
  font-weight: 800;
}

.search-glyph.green { background: var(--green-soft); color: var(--green); }
.search-glyph.blue { background: var(--blue-soft); color: var(--blue); }
.search-glyph.gold { background: var(--gold-soft); color: #9b7418; }
.search-glyph.navy { background: #eaf0f4; color: var(--navy); }
.search-glyph.red { background: var(--red-soft); color: var(--red); }

/* Authentication and onboarding are pages too. */
.auth-story > div > p,
.auth-card > p,
.auth-note,
.form-error,
.setup-intro p,
.setup-choice strong,
.setup-choice small,
.auth-proof strong,
.auth-proof small {
  font-size: 0.875rem !important;
}

.auth-card .field > span {
  font-size: 0.875rem !important;
}

@media (max-width: 1150px) {
  .register-shell {
    grid-template-columns: minmax(0, 1fr) 380px;
  }
}

@media (max-width: 820px) {
  .register-shell {
    grid-template-columns: 1fr;
  }

  .cart-pane {
    max-height: none;
  }
}

@media (max-width: 560px) {
  :root {
    font-size: 15px;
  }

  .cart-line {
    grid-template-columns: minmax(0, 1fr) 112px;
  }

  .search-list > a {
    grid-template-columns: 38px minmax(0, 1fr) 18px;
  }

  .search-list > a > b {
    display: none;
  }
}
