/* ============================================
   Semantic design tokens (single source of truth)
   ============================================ */
:root {
  --klar-blue: #2a2859;
  --klar-muted: #595959;            /* AA contrast on white (was #666) */
  --klar-border: #d9d9d9;
  --klar-surface: #f5f5f5;
  /* Score / severity — one definition reused by pills, charts, diff, help */
  --klar-score-bad: #c62828;
  --klar-score-mid: #d35400;
  --klar-score-good: #2e7d32;
  --klar-focus: #6a3bd6;            /* visible focus ring */
  --klar-radius: 0;               /* one corner radius for all content cards */
}

/* The `hidden` attribute must always win. Class rules like `.loading-wrap
   { display: flex }` otherwise tie with the UA `[hidden] { display: none }` on
   specificity and, being declared later, override it — leaving "hidden" panels
   visible (e.g. the loading state showing before a check is run). */
[hidden] { display: none !important; }

/* ============================================
   Shared layout utilities (replace inline-style sprawl)
   ============================================ */
.page__subtitle {                   /* the grey lead line under every H1 */
  font-size: 1rem;
  color: var(--klar-muted);
  margin: 0.25rem 0 0;
}
.filter-bar {                       /* the analyselogg filter row */
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.prewrap { white-space: pre-wrap; }
/* Inline Punkt icon sized to the surrounding text, coloured by currentColor. */
.pkt-ico {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  flex: none;
}
.pkt-alert--info {
  background-color: #eef1fb;
  border-color: var(--klar-blue);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* ============================================
   Accessibility: skip link + global focus ring
   ============================================ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--klar-blue);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 6px 0;
}
.skip-link:focus {
  left: 0;
}
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.range-pill:focus-visible,
.stats-side__link:focus-visible,
.type-tip:focus-visible {
  outline: 3px solid var(--klar-focus);
  outline-offset: 2px;
  border-radius: 2px;
}
/* On the dark nav bar, a light ring reads better */
nav.site-nav a:focus-visible,
nav.site-nav button:focus-visible {
  outline-color: #fff;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--pkt-color-brand-dark-blue-1000);
  z-index: 100;
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.site-nav__brand,
.site-nav__brand:link,
.site-nav__brand:visited,
.site-nav__brand:hover,
.site-nav__brand:active {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff !important;
  text-decoration: none;
}

.site-nav__logo {
  height: 1.75rem;
  filter: brightness(0) invert(1);
}

.site-nav__title {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  padding-left: 0.85rem;
  margin-left: 0.35rem;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  line-height: 1;
}

.site-nav__subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  line-height: 1;
}

.site-nav__subtitle-img {
  height: 2rem;
  width: auto;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav__links li {
  display: flex;
  align-items: center;
}
.site-nav__logout-form {
  display: flex;
  align-items: center;
  margin: 0;
  white-space: nowrap;
}

nav.site-nav .site-nav__link,
nav.site-nav .site-nav__link:link,
nav.site-nav .site-nav__link:visited,
nav.site-nav .site-nav__link:hover,
nav.site-nav .site-nav__link:focus,
nav.site-nav .site-nav__link:active {
  color: #fff !important;
  text-decoration: none;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}

nav.site-nav .site-nav__link:hover {
  border-bottom-color: var(--pkt-color-brand-blue-1000);
}

nav.site-nav .site-nav__link.active {
  border-bottom-color: var(--pkt-color-brand-green-1000);
}

/* Hamburger toggle — hidden on wide screens, shown when the nav collapses. */
.site-nav__toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 0;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}

@media (max-width: 60rem) {
  .site-nav__inner { flex-wrap: wrap; }
  .site-nav__toggle { display: block; }
  .site-nav__links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    margin-top: 0.75rem;
  }
  .site-nav__links.open { display: flex; }
  .site-nav__links li { width: 100%; }
  nav.site-nav .site-nav__link {
    display: block;
    width: 100%;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }
  nav.site-nav .site-nav__link.active {
    border-bottom-color: var(--pkt-color-brand-green-1000);
  }
}

.hero-section {
  background-color: var(--pkt-color-brand-dark-blue-1000);
  padding: 8rem 0 4rem;
}

.login-card {
  max-width: 28rem;
  margin: 0 auto;
  background: #fff;
  padding: 2.5rem;
  border: 1px solid var(--pkt-color-brand-neutrals-100);
}

/* Login page: value-proposition pitch beside the sign-in card. */
.login-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 56rem) {
  .login-layout { grid-template-columns: 1fr; gap: 2rem; }
}
.pitch__lead { font-size: 1.2rem; line-height: 1.6; color: #333; max-width: 36rem; }
.pitch__list { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: 1rem; }
.pitch__list li { display: flex; gap: 0.65rem; align-items: flex-start;
  font-size: 1.05rem; line-height: 1.5; }
.pitch__check { flex: none; width: 1.5rem; height: 1.5rem; margin-top: 0.1rem;
  color: var(--klar-score-good); }

.step-card {
  background-color: #fff;
  border: 1px solid var(--pkt-color-brand-neutrals-100);
  border-radius: 0;
  padding: 1.5rem;
  height: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
}

.pkt-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--pkt-color-brand-dark-blue-1000);
  border-radius: 0;
  font-family: inherit;
  font-size: 1rem;
  background-color: #fff;
  box-sizing: border-box;
}

.pkt-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--pkt-color-brand-purple-1000);
}

.pkt-alert {
  padding: 1.25rem 1.5rem;
  border-left: 4px solid;
  border-radius: 0;
  background-color: #fff;
}

.pkt-alert p {
  margin: 0;
}

.pkt-alert--error {
  background-color: var(--pkt-color-brand-red-100);
  border-color: var(--pkt-color-brand-red-1000);
}

.pkt-alert--warning {
  background-color: #fbf3e2;
  border-color: #c8860d;
}

/* First-run setup checklist on the empty dashboard. */
.first-run { max-width: 40rem; }
.checklist {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  counter-reset: step;
}
.checklist li {
  counter-increment: step;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--klar-border, #d9d9d9);
}
.checklist li::before {
  content: counter(step);
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--klar-blue, #2a2859);
  color: #fff;
}
.checklist li.done::before {
  content: "✓";
  background: var(--klar-score-good, #2e7d32);
}
.checklist__done { color: var(--klar-score-good, #2e7d32); font-size: 0.85rem; }

/* Danger button — reserved for irreversible, destructive actions. */
.pkt-btn--danger,
.pkt-btn--danger:link,
.pkt-btn--danger:visited {
  background-color: #fff;
  color: var(--klar-score-bad, #b3261e) !important;
  border: 2px solid var(--klar-score-bad, #b3261e);
}
.pkt-btn--danger:hover {
  background-color: var(--klar-score-bad, #b3261e);
  color: #fff !important;
}

/* Breadcrumb on second-level pages (detail + forms). */
.crumbs {
  font-size: 0.9rem;
  color: #595959;
  margin: 0 0 0.5rem;
}
.crumbs a { color: var(--klar-blue, #2a2859); }

/* Tekstverktøy loading panel — spinner + escalating status + rotating tip. */
.loading-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: #eef1fb;
  border-radius: var(--klar-radius);
}
.loading-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;        /* fill the row so the bar width is stable … */
  min-width: 0;   /* … and a long tip can't stretch it wider */
}
.loading-status { font-weight: 600; color: var(--klar-blue); }
/* Reserve height so wrapping from one to two lines doesn't shift the layout. */
.loading-tip { font-size: 0.9rem; color: var(--klar-muted); min-height: 2.6em; }
.progress {
  display: block;
  width: 100%;
  height: 6px;
  background: rgba(42, 40, 89, 0.15);
  border-radius: 2px;
  overflow: hidden;
  margin: 0.15rem 0;
}
.progress__bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--klar-blue);
  border-radius: 2px;
}
.spinner {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  border: 3px solid rgba(42, 40, 89, 0.2);
  border-top-color: var(--klar-blue);
  border-radius: 50%;
  animation: klar-spin 0.8s linear infinite;
}
@keyframes klar-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* Single-analysis print: drop the chrome, keep the content on paper. */
@media print {
  .site-nav, .site-footer, .flash-bar, .crumbs, .no-print { display: none !important; }
  main { padding: 0; }
  .form-card, .kpi-card { box-shadow: none; border-color: #999; break-inside: avoid; }
  a[href]::after { content: ""; }
  body { background: #fff; }
}

.site-footer {
  margin-top: auto;
}

.pkt-section--grey {
  background-color: var(--pkt-color-brand-neutrals-100);
}

/* ============================================
   Admin nav extras
   ============================================ */
.site-nav__logout {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: #fff !important;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.site-nav__logout:hover {
  border-bottom-color: var(--pkt-color-brand-blue-1000);
}
nav.site-nav .site-nav__user {
  color: goldenrod;
  font-size: 0.85rem;
  white-space: nowrap;
}
.site-nav__title { color: #fff !important; }

/* ============================================
   Page heading
   ============================================ */
.page {
  padding: 7rem 0 4rem;
}
.page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

/* ============================================
   Data table
   ============================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--pkt-color-brand-neutrals-100);
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--pkt-color-brand-neutrals-100);
  font-size: 0.95rem;
  vertical-align: middle;
}
.data-table th {
  background: var(--pkt-color-brand-neutrals-100);
  font-weight: 600;
}
.data-table tr:last-child td {
  border-bottom: none;
}
/* Sortable column headers: a header-styled link + a direction caret. The link
   reloads with ?sort=&dir= so sorting spans ALL rows, not just the loaded page. */
.th-sort {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;   /* keep "Etter omskriving" on one line */
}
.th-sort:hover { text-decoration: underline; }
.th-sort::after { content: " ⇅"; color: var(--klar-muted); font-size: 0.85em; }
.data-table th[aria-sort="ascending"] .th-sort::after { content: " ↑"; color: var(--klar-blue); }
.data-table th[aria-sort="descending"] .th-sort::after { content: " ↓"; color: var(--klar-blue); }
.data-table a {
  color: var(--pkt-color-brand-dark-blue-1000);
}

/* ============================================
   Badges / pills
   ============================================ */
.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 2px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge--admin {
  background: var(--pkt-color-brand-dark-blue-1000);
  color: #fff;
}
.badge--user {
  background: var(--pkt-color-brand-neutrals-100);
  color: var(--pkt-color-brand-dark-blue-1000);
}
.badge--off {
  background: var(--pkt-color-brand-red-100);
  color: var(--pkt-color-brand-red-1000);
}

/* ============================================
   Form card
   ============================================ */
.form-card {
  max-width: 34rem;
  background: #fff;
  border: 1px solid var(--pkt-color-brand-neutrals-100);
  border-radius: var(--klar-radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.form-card--full { max-width: none; }
.pkt-input--select {
  appearance: auto;
}

/* ============================================
   Dashboard KPIs + charts
   ============================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.kpi-card {
  background: #fff;
  border: 1px solid var(--klar-border);
  border-radius: var(--klar-radius);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
/* The hero KPI spans the full row so it always reads as the headline. */
.kpi-grid .kpi-card--hero { grid-column: 1 / -1; }
.kpi-card__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--pkt-color-brand-dark-blue-1000);
  line-height: 1.1;
}
.kpi-card__label {
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.25rem;
}
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.chart-card {
  background: #fff;
  border: 1px solid var(--pkt-color-brand-neutrals-100);
  border-radius: 0;
  padding: 1.25rem;
}
.chart-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--pkt-color-brand-dark-blue-1000);
}
.chart-card canvas {
  max-height: 260px;
}
.chart-table {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}
.chart-table summary {
  cursor: pointer;
  color: var(--klar-blue);
  font-weight: 600;
}
.chart-table table {
  margin-top: 0.5rem;
}
.empty-state {
  background: #fff;
  border: 1px dashed var(--pkt-color-brand-neutrals-100);
  border-radius: 0;
  padding: 2rem;
  text-align: center;
  color: #555;
}
.score-pill {
  display: inline-block;
  min-width: 2.2rem;
  text-align: center;
  padding: 0.1rem 0.5rem;
  border-radius: 2px;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  background: var(--klar-score-mid);
}
.score-pill--bad { background: var(--klar-score-bad); }
.score-pill--mid { background: var(--klar-score-mid); }
.score-pill--good { background: var(--klar-score-good); }

/* ============================================
   Statistics: left sub-menu + main area
   ============================================ */
.stats-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 2rem;
  align-items: start;
}
.stats-side {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: sticky;
  top: 6rem;
}
.stats-side__link,
.stats-side__link:visited {
  padding: 0.6rem 0.9rem;
  border-radius: 0;
  color: var(--pkt-color-brand-dark-blue-1000);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
}
.stats-side__link:hover {
  background: var(--pkt-color-brand-neutrals-100);
}
.stats-side__link.active {
  background: var(--pkt-color-brand-neutrals-100);
  border-left-color: var(--pkt-color-brand-green-1000);
}
@media (max-width: 56rem) {
  .stats-layout { grid-template-columns: 1fr; }
  .stats-side { position: static; flex-direction: row; flex-wrap: wrap; }
}

/* ============================================
   Min skriveprofil
   ============================================ */
.profile-about {
  max-width: 46rem;
  margin: 0 0 1.5rem;
}
.profile-about__title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.profile-about p + p { margin-top: 0.6rem; }

.profile-gen {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 1.5rem;
}
.profile-gen label { font-weight: 600; }

/* Shown when the writer has too few analyses to build a profile yet. */
.callout {
  max-width: 46rem;
  background: #fbf3e2;
  border-left: 4px solid #c8860d;
  padding: 1rem 1.25rem;
  margin: 0 0 1.5rem;
}

.profile-meta {
  color: var(--klar-muted);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

/* The generated profile, shown in a read-only field with a copy button. */
.profile-output {
  max-width: 46rem;
  border: 1px solid var(--pkt-color-brand-neutrals-100);
  border-radius: var(--klar-radius);
  background: #fff;
  overflow: hidden;
}
.profile-output__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.75rem;
  background: var(--klar-surface);
  border-bottom: 1px solid var(--pkt-color-brand-neutrals-100);
}
.profile-output__hint {
  font-size: 0.85rem;
  color: var(--klar-muted);
}
.profile-output__copy {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.profile-output__copy.is-copied {
  background: var(--klar-score-good);
  border-color: var(--klar-score-good);
  color: #fff;
}
.profile-output__field {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  margin: 0;
  padding: 1rem 1.25rem;
  min-height: 22rem;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--pkt-color-brand-dark-blue-1000);
  background: #fff;
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.profile-status {
  font-size: 0.85rem;
  color: var(--klar-muted);
}

/* ============================================
   Help / introduction page
   ============================================ */
.help { max-width: 56rem; }
.help h2 {
  font-size: 1.6rem;
  color: var(--pkt-color-brand-dark-blue-1000);
  margin: 2.5rem 0 0.5rem;
}
.help h3 { font-size: 1.1rem; margin: 1.25rem 0 0.4rem; color: var(--pkt-color-brand-dark-blue-1000); }
.help p { font-size: 1.05rem; line-height: 1.7; margin: 0 0 1rem; max-width: 42rem; }
.help .lead { font-size: 1.2rem; color: #333; }
.help figure { margin: 1.25rem 0 1.5rem; }
.help figcaption { font-size: 0.9rem; color: #666; margin-top: 0.5rem; }

.help-toc {
  background: var(--pkt-color-brand-neutrals-100);
  border-radius: 0;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
}
.help-toc ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.help-toc li { margin-bottom: 0.3rem; }

.principle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}
.principle {
  background: #fff;
  border: 1px solid var(--pkt-color-brand-neutrals-100);
  border-left: 4px solid var(--pkt-color-brand-blue-1000);
  border-radius: 0;
  padding: 1rem 1.25rem;
}
.principle__n {
  font-weight: 700;
  color: var(--pkt-color-brand-blue-1000);
  font-size: 0.85rem;
}
.principle h3 { margin: 0.25rem 0 0.35rem; font-size: 1.05rem; }
.principle p { font-size: 0.95rem; margin: 0; }

.steps { list-style: none; margin: 1rem 0 1.5rem; padding: 0; counter-reset: step; }
.steps li {
  position: relative;
  padding: 0.6rem 0 0.6rem 3rem;
  font-size: 1.05rem;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0.4rem;
  width: 2rem; height: 2rem;
  background: var(--pkt-color-brand-green-1000);
  color: var(--pkt-color-brand-dark-blue-1000);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}
.compare__box { border-radius: 0; padding: 1rem 1.25rem; font-size: 1rem; line-height: 1.6; }
.compare__box--before { background: #fdecea; border: 1px solid #f3c6c0; }
.compare__box--after { background: #eef7ee; border: 1px solid #c6e3c6; }
.compare__tag { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.compare__box--before .compare__tag { color: #c62828; }
.compare__box--after .compare__tag { color: #2e7d32; }
@media (max-width: 40rem) { .compare { grid-template-columns: 1fr; } }

.sev-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.sev-dot { width: 0.9rem; height: 0.9rem; border-radius: 50%; flex-shrink: 0; }

/* Help: detailed principles, examples, keyboard shortcuts */
.principle-block {
  border-left: 4px solid var(--pkt-color-brand-blue-1000);
  background: #fff;
  border: 1px solid var(--pkt-color-brand-neutrals-100);
  border-left-width: 4px;
  border-radius: 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.principle-block h3 { margin: 0 0 0.35rem; }
.principle-block p { margin: 0 0 0.5rem; font-size: 1rem; }
.example {
  border-left: 3px solid var(--pkt-color-brand-green-1000);
  background: #f4faf4;
  padding: 0.55rem 0.9rem;
  border-radius: 0 4px 4px 0;
  font-size: 0.95rem;
  line-height: 1.6;
}
.example .ba { color: #9a4a0a; font-weight: 700; }
.example b { color: #1b5e20; }

.kbd {
  display: inline-block;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  background: #fff;
  border: 1px solid #bbb;
  border-bottom-width: 2px;
  border-radius: 0;
  padding: 0.1rem 0.45rem;
  color: #2a2859;
}
.shortcut-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.shortcut-row .os { min-width: 7rem; color: #555; font-size: 0.95rem; }

/* ============================================
   Flash messages + success alerts
   ============================================ */
.pkt-alert--success {
  background-color: #e9f8f0;
  border-color: #2e7d32;
  color: #1b5e20;
}
.flash-bar {
  padding-top: 6.5rem;
  margin-bottom: -5.5rem;
}

/* ============================================
   Scrollable tables (small screens / projectors)
   ============================================ */
.table-scroll {
  overflow-x: auto;
}

/* ============================================
   Word-level diff (usage detail)
   ============================================ */
.diff-view {
  font-size: 0.95rem;
  line-height: 1.8;
  white-space: pre-wrap;
  padding: 1rem;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 0;
}
.diff-view del {
  background: #fed7aa;
  color: #6b2a0f;
  text-decoration: line-through;
  text-decoration-color: #000000;
  border-radius: 0;
  padding: 0 2px;
}
.diff-view ins {
  background: #d1fae5;
  color: #065f46;
  text-decoration: none;
  border-radius: 0;
  padding: 0 2px;
}

/* ============================================
   Inline type tooltip (usage detail)
   ============================================ */
.type-tip {
  position: relative;
  cursor: help;
  border-bottom: 1px dashed var(--pkt-color-brand-dark-blue-1000);
}
.type-tip__box {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 10;
  width: 280px;
  padding: 0.75rem;
  margin-top: 0.35rem;
  background: #fff;
  border: 1px solid var(--pkt-color-brand-neutrals-100);
  border-radius: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--pkt-color-brand-dark-blue-1000);
  font-weight: 400;
}
.type-tip__box a {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
}
.type-tip:hover .type-tip__box,
.type-tip:focus-within .type-tip__box {
  display: block;
}

/* ============================================
   Period pills + headline KPI
   ============================================ */
.range-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.range-pill {
  padding: 0.35rem 0.9rem;
  border-radius: 2px;
  border: 1px solid var(--pkt-color-brand-neutrals-100);
  background: #fff;
  color: var(--pkt-color-brand-dark-blue-1000);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}
.range-pill.active,
.range-pill.active:visited,
.range-pill.active:hover {
  background: var(--pkt-color-brand-dark-blue-1000);
  /* !important is required: Punkt's reset sets visited links to
     `color: inherit` at specificity (0,4,1), which otherwise wins here and
     renders the active pill's label in the dark inherited body color. */
  color: #fff !important;
  border-color: var(--pkt-color-brand-dark-blue-1000);
}
.kpi-card--hero {
  border-left: 4px solid var(--pkt-color-brand-green-1000);
}
.kpi-delta {
  font-size: 1rem;
  font-weight: 700;
  vertical-align: middle;
  padding: 0.1rem 0.5rem;
  border-radius: 2px;
}
.kpi-delta.up { background: #e9f8f0; color: #1b5e20; }
.kpi-delta.down { background: #fdecea; color: #c62828; }

/* Skill files shown as formatted Markdown (Skills tab). */
.skill-doc { max-width: 48rem; }
.skill-doc table { border-collapse: collapse; margin: 0 0 1rem; font-size: 0.95rem; }
.skill-doc th, .skill-doc td { border: 1px solid #d9d9d9; padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
.skill-doc code { font-size: 0.9em; background: #f3f3f3; padding: 0 0.25em; border-radius: 3px; }
.skill-doc pre { background: #f7f7f7; padding: 0.75rem 1rem; overflow-x: auto; border-radius: 6px; }
.skill-doc pre code { background: none; padding: 0; }
.skill-doc a { overflow-wrap: anywhere; }
.skill-doc ul, .skill-doc ol { margin: 0 0 1rem; padding-left: 1.4rem; }

/* The front matter of a skill file, shown above its text. */
.skill-meta { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; font-size: 0.92rem;
              color: #444; background: #f7f7f7; border-radius: 6px; padding: 0.8rem 1rem; margin: 0 0 1.25rem; }
.skill-meta dt { font-weight: 600; color: var(--pkt-color-brand-dark-blue-1000); }
.skill-meta dd { margin: 0; overflow-wrap: anywhere; }
.skill-doc h1 { font-size: 1.6rem; margin: 0 0 0.75rem; }

/* One skill in the Skills tab: its folder name between two lines, its files below, subfolders labelled. */
.skill-group { border-top: 1px solid #c9c9c9; border-bottom: 1px solid #c9c9c9; padding: 0.6rem 0 0.8rem; margin-bottom: 1rem; }
.skill-group__label { font-size: 0.95rem; color: #555; margin: 0 0 0.4rem; overflow-wrap: anywhere; }
.skill-group__sub { font-size: 0.95rem; color: #555; margin: 0.8rem 0 0.3rem; }
.skill-group__files { margin: 0 0 0 0.3rem; padding-left: 1.6rem; }
.skill-group__files li { margin: 0; }

/* The Skills tab has a wider file menu than the statistics and help pages. */
.skills-layout { grid-template-columns: 280px 1fr; }
