/**
 * Portal typography — Obsidian & Champagne theme.
 * Sora (UI) + Libre Baskerville (editorial headings) + IBM Plex Mono (data).
 */

:root {
  --type-sans: "Sora", "Segoe UI", sans-serif;
  --type-serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --type-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --font-mono: var(--type-mono);
  --table-font-sans: var(--type-sans);
  --table-font-mono: var(--type-mono);

  --text: #171717;
  --mid: #3f3f3c;
  --muted: #706f6a;
  --subtle: #3f3f3c;

  --border: #ddd9d2;
  --border-strong: #bdbbb4;

  --fw-heading: 600;
  --fw-strong: 500;
  --fw-body: 400;
  --fw-light: 400;
  --ls-heading: -0.025em;
  --ls-eyebrow: 0.09em;
  --lh-body: 1.6;
  --lh-lead: 1.65;
  --lh-table: 1.35;
  --lh-table-header: 1.32;

  --page-title-size: 22px;
  --page-lead-size: 14px;
  --th-size: 10px;
  --th-secondary-size: 9px;
  --th-weight: 500;
  --th-color: #6f6a60;
  --th-secondary-color: #8a8478;
  --td-size: 13px;
  --td-color: #2a2722;
  --td-secondary-color: #5c574f;
  --table-cell-py: 7px;
  --table-cell-px: 12px;
  --eyebrow-size: 10px;
  --meta-size: 13px;
  --control-size: 14px;
}

html {
  height: -webkit-fill-available;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--type-sans);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  color: var(--text);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
  font-family: var(--type-sans);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
select,
textarea {
  font-size: var(--control-size);
}

/* ── Headings — editorial serif ── */
h1,
h2,
h3,
h4,
.page-title,
.page-head h1,
.policy-packs-page .page-head h1,
.policy-detail-view .detail-head h1,
.policy-insights-page .page-head h1,
.reco-modals .modal-card-reco-accept h3,
.gs-intro-title,
.gs-glossary-title,
.gs-panel-title,
.reco-aside-title,
.piwi-page-title {
  font-family: var(--type-serif);
  font-weight: 600;
  letter-spacing: var(--ls-heading);
  color: var(--text);
}

.piwi-page-title .piwi-brand-wi,
.piwi-empty-head h2 .piwi-brand-wi {
  color: var(--accent-deep);
}

.page-title,
.page-head h1,
.policy-packs-page .page-head h1,
.policy-insights-page .page-head h1,
.policy-detail-view .detail-head h1 {
  font-size: var(--page-title-size);
  line-height: 1.25;
}

/* ── Leads & secondary copy ── */
.page-subtitle,
.page-head-lead,
.settings-page .page-head-lead,
.policy-packs-page .page-head-lead,
.policy-detail-view .detail-head-lead,
.policy-insights-page .page-head-lead,
.muted,
.gs-intro-body,
.reco-aside-copy,
.reco-modals .modal-lead,
.auth-card .muted,
.auth-epigraph-sub,
.piwi-header-lead {
  font-weight: var(--fw-light);
  line-height: var(--lh-lead);
  color: var(--mid);
}

.policy-detail-view .page-subtitle,
.policy-detail-view .page-meta:not(.page-meta--ids) {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--mid);
}

.page-subtitle,
.page-head-lead,
.settings-page .page-head-lead,
.policy-packs-page .page-head-lead,
.policy-detail-view .detail-head-lead,
.policy-insights-page .page-head-lead {
  font-size: var(--page-lead-size);
}

/* ── Eyebrows / section labels ── */
.section-label,
.policy-detail-view .section-label,
.policy-detail-view .topics-toolbar .section-label,
.insights-kpi-label,
.insights-period-eyebrow,
.reco-modals .field label,
.admin-only-tag {
  font-family: var(--type-mono);
  font-size: var(--eyebrow-size);
  font-weight: var(--fw-strong);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
}

.insights-section-title {
  font-family: var(--type-serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: var(--ls-heading);
  text-transform: none;
  color: var(--text);
}

/* ── Tables ── */
.panel .admin-list-table,
.policy-packs-page .policy-list-table,
.policy-detail-view .decisions-table,
.policy-detail-view .pack-decisions-table,
.policy-detail-view.runtime-detail-view .runtime-decisions-table,
.policy-detail-view.runtime-detail-view .runtime-recommendations-table,
.people-import-table,
.insights-table-section table,
.policy-insights-page .insights-report-table,
table {
  font-family: var(--table-font-sans);
}

th,
.panel .admin-list-table th,
.policy-packs-page .policy-list-table th,
.policy-detail-view .decisions-table th,
.policy-detail-view .pack-decisions-table th,
.policy-detail-view.runtime-detail-view .runtime-decisions-table th,
.policy-detail-view.runtime-detail-view .runtime-recommendations-table th,
.people-import-table th,
.insights-table-section table th,
table th {
  font-family: var(--table-font-mono);
  font-size: var(--th-size);
  font-weight: var(--th-weight);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--th-color);
  background: var(--panel-soft);
  padding: var(--table-cell-py) var(--table-cell-px);
  line-height: var(--lh-table-header);
}

td,
.panel .admin-list-table td,
.policy-packs-page .policy-list-table td,
.policy-detail-view .decisions-table td,
.policy-detail-view .pack-decisions-table td,
.policy-detail-view.runtime-detail-view .runtime-decisions-table td,
.policy-detail-view.runtime-detail-view .runtime-recommendations-table td,
.people-import-table td,
.insights-table-section table td,
.policy-insights-page .insights-report-table td,
table td {
  font-family: var(--table-font-sans);
  font-size: var(--td-size);
  font-weight: var(--fw-body);
  line-height: var(--lh-table);
  color: var(--td-color);
  padding: var(--table-cell-py) var(--table-cell-px);
}

.panel .admin-list-table th:not(:first-child),
.policy-packs-page .policy-list-table th:not(:first-child),
.policy-detail-view .decisions-table th:not(:first-child),
.policy-detail-view .pack-decisions-table th:not(:first-child),
.policy-detail-view.runtime-detail-view .runtime-decisions-table th:not(:first-child),
.policy-detail-view.runtime-detail-view .runtime-recommendations-table th:not(:first-child),
.people-import-table th:not(:first-child),
.insights-table-section table th:not(:first-child),
.policy-insights-page .insights-report-table th:not(:first-child),
table th:not(:first-child) {
  font-size: var(--th-secondary-size);
  color: var(--th-secondary-color);
}

.panel .admin-list-table td:not(:first-child),
.policy-packs-page .policy-list-table td:not(:first-child),
.policy-detail-view .decisions-table td:not(:first-child),
.policy-detail-view .pack-decisions-table td:not(:first-child),
.policy-detail-view.runtime-detail-view .runtime-decisions-table td:not(:first-child),
.policy-detail-view.runtime-detail-view .runtime-recommendations-table td:not(:first-child),
.people-import-table td:not(:first-child),
.insights-table-section table td:not(:first-child),
.policy-insights-page .insights-report-table td:not(:first-child),
table td:not(:first-child) {
  color: var(--td-secondary-color);
}

table .decision-id,
table .role-badge,
table code,
.panel .admin-list-table .role-badge,
.panel .admin-list-table .key-prefix-cell,
.policy-packs-page .policy-list-table .list-page-range {
  font-family: var(--table-font-mono);
}

.person-name,
.list-policy-name,
.policy-packs-page .list-policy-cell strong {
  font-size: inherit;
  color: var(--text);
  font-weight: var(--fw-heading);
}

.policy-detail-view .decision-title {
  font-size: inherit;
  color: var(--td-color);
  font-weight: 500;
}

.policy-detail-view .decision-body {
  color: var(--td-secondary-color);
  font-weight: var(--fw-body);
}

.person-email,
.policy-packs-page .list-policy-desc,
.added-cell {
  font-weight: var(--fw-body);
}

.policy-detail-view .decision-meta,
.policy-detail-view .decision-guidance {
  font-weight: var(--fw-body);
  color: var(--muted);
}

.policy-packs-page .policy-list-table th,
.policy-packs-page .policy-list-table td,
.policy-insights-page .policy-list-table th,
.policy-insights-page .policy-list-table td,
.policy-insights-page .insights-report-table th,
.policy-insights-page .insights-report-table td,
.panel .admin-list-table th,
.panel .admin-list-table td,
.people-import-table th,
.people-import-table td,
.policy-detail-view.runtime-detail-view .runtime-decisions-table th,
.policy-detail-view.runtime-detail-view .runtime-decisions-table td,
.policy-detail-view.runtime-detail-view .runtime-recommendations-table th,
.policy-detail-view.runtime-detail-view .runtime-recommendations-table td {
  text-align: center;
  vertical-align: middle;
}

/* Foundational, project, and task list tables: primary name column is left-aligned */
.policy-packs-page .policy-list-table th:first-child,
.policy-packs-page .policy-list-table td:first-child,
.tasks-page .policy-list-table th:first-child,
.tasks-page .policy-list-table td:first-child {
  text-align: left;
  vertical-align: middle;
}

.policy-detail-view .pack-decisions-table th,
.policy-detail-view .pack-decisions-table td,
.policy-detail-view .decisions-table th,
.policy-detail-view .decisions-table td {
  text-align: left;
  vertical-align: top;
}

.panel .admin-list-table th:last-child,
.panel .admin-list-table td:last-child,
.panel .admin-list-table .col-list-actions {
  text-align: center;
}

.panel .admin-list-table .col-list-actions .actions {
  justify-content: center;
}

.policy-detail-view .pack-decisions-table .col-actions,
.policy-detail-view .panel .pack-decisions-table .col-actions {
  text-align: center;
}

.policy-detail-view .actions {
  justify-content: center;
}

.policy-detail-view .panel table:not(.pack-decisions-table):not(.pack-decisions-table--browse) th:last-child,
.policy-detail-view .panel table:not(.pack-decisions-table):not(.pack-decisions-table--browse) td:last-child,
.policy-packs-page .panel table:not(.pack-decisions-table):not(.pack-decisions-table--browse) th:last-child,
.policy-packs-page .panel table:not(.pack-decisions-table):not(.pack-decisions-table--browse) td:last-child {
  text-align: center;
}

.policy-detail-view .panel .pack-decisions-table th,
.policy-detail-view .panel .pack-decisions-table td,
.policy-detail-view .panel .pack-decisions-table--browse th,
.policy-detail-view .panel .pack-decisions-table--browse td,
.policy-detail-view .panel .pack-decisions-table td:first-child,
.policy-detail-view .panel .pack-decisions-table--browse td:only-child,
.policy-detail-view .panel .pack-decisions-table--browse td:last-child {
  text-align: left;
}

.list-meta,
.policy-packs-page .list-meta,
.policy-packs-page .col-num,
.policy-packs-page .col-updated,
.col-author {
  font-weight: var(--fw-body);
}

.decision-id,
.readonly-mark,
.policy-packs-page .tier-nav-count,
.policy-packs-page .list-page-range,
.role-badge,
code {
  font-family: var(--type-mono);
  font-weight: var(--fw-strong);
}

.nav button {
  font-weight: var(--fw-strong);
}

.nav button.active {
  font-weight: var(--fw-heading);
}

.btn,
.policy-packs-page .tier-nav-item,
.policy-detail-view.runtime-detail-view .tier-nav-item,
.field label {
  font-weight: var(--fw-strong);
}

.brand,
.brand-name {
  font-family: var(--type-sans);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-mark {
  font-family: var(--type-mono);
}

.link {
  font-weight: var(--fw-heading);
}

.list-status,
.policy-packs-page .list-status {
  font-weight: var(--fw-strong);
}

.pill,
.policy-packs-page .tier-nav-count,
.policy-detail-view.runtime-detail-view .tier-nav-count {
  font-weight: var(--fw-strong);
}

.search,
.list-search,
.toolbar-search,
.filter-select {
  font-size: var(--control-size);
  font-weight: var(--fw-body);
}

.policy-packs-page .list-policy-desc,
.policy-pack-modals .inherit-picker-meta {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.policy-detail-view .pack-decisions-table tbody td,
.policy-detail-view.runtime-detail-view .runtime-decisions-table tbody tr:not(.runtime-topic-row) td,
.policy-detail-view.runtime-detail-view .runtime-recommendations-table tbody td {
  padding: 10px 14px;
}

/* ── Tablet list tables: sticky name column, hide low-priority columns ── */
@media (max-width: 1024px) {
  .policy-packs-page .policy-list-table th:first-child,
  .policy-packs-page .policy-list-table td:first-child,
  .tasks-page .policy-list-table th:first-child,
  .tasks-page .policy-list-table td:first-child,
  .runtime-list-page .policy-list-table th:first-child,
  .runtime-list-page .policy-list-table td:first-child,
  .panel .admin-list-table th:first-child,
  .panel .admin-list-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    text-align: left;
    background: var(--panel);
    box-shadow: 2px 0 8px -4px rgba(15, 23, 42, 0.14);
  }

  .policy-packs-page .policy-list-table thead th:first-child,
  .tasks-page .policy-list-table thead th:first-child,
  .runtime-list-page .policy-list-table thead th:first-child,
  .panel .admin-list-table thead th:first-child {
    z-index: 3;
    background: var(--panel-soft);
  }

  .policy-packs-page .policy-list-table tbody tr:hover td:first-child,
  .tasks-page .policy-list-table tbody tr:hover td:first-child,
  .runtime-list-page .policy-list-table tbody tr:hover td:first-child,
  .panel .admin-list-table tbody tr:hover td:first-child {
    background: var(--panel-soft);
  }

  .policy-packs-page .policy-list-table [data-col="author"],
  .policy-packs-page .policy-list-table [data-col="updated"],
  .policy-packs-page .policy-list-table .col-author,
  .policy-packs-page .policy-list-table .col-updated,
  .tasks-page .policy-list-table [data-col="reference"],
  .tasks-page .policy-list-table [data-col="standard"],
  .tasks-page .policy-list-table [data-col="updated"],
  .runtime-list-page .policy-list-table [data-col="client"],
  .runtime-list-page .policy-list-table [data-col="kind"],
  .panel .admin-list-table [data-col="added"] {
    display: none;
  }
}
