/* adamgatt.com.au: site styles. Follows the PLMS UI/UX blueprint.
   Every colour comes from Web Awesome tokens (or the small brand palette below),
   so light and dark modes are equals. */

/* ---------- Brand palette (public site) ---------- */
:root {
  --site-navy: #1f4e8c;
  --site-navy-deep: #14365f;
}

/* ---------- App tokens mapped to Web Awesome ---------- */
:root {
  --app-bg: var(--wa-color-surface-default);
  --app-surface: var(--wa-color-surface-lowered);
  --app-raised: var(--wa-color-surface-raised);
  --app-border: var(--wa-color-surface-border);
  --app-border-strong: var(--wa-color-neutral-border-normal);
  --app-text: var(--wa-color-text-normal);
  --app-muted: var(--wa-color-text-quiet);
  --app-accent: var(--wa-color-brand-fill-loud);
  --app-accent-soft: var(--wa-color-brand-fill-quiet);
  --app-accent-text: var(--wa-color-brand-on-quiet);
  --app-link: var(--wa-color-text-link);
  --app-radius: var(--wa-border-radius-l);
  --app-shadow: var(--wa-shadow-s);
  --header-h: 60px;
  --bottom-h: 64px;
  --pad-x: 32px;
  --pad-y: 24px;
}

.wa-dark {
  --site-navy: #3d6fb3;
}

/* Hide components until they load (no flash of unstyled controls). */
:is(wa-button, wa-input, wa-select, wa-dropdown, wa-badge, wa-callout, wa-copy-button):not(:defined) {
  visibility: hidden;
}

/* ---------- Base ---------- */
[hidden] { display: none !important; }

html {
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--app-surface);
  color: var(--app-text);
  font-family: var(--wa-font-family-body);
  font-size: 15px;
  line-height: 1.5;
}

main {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  padding: var(--pad-y) var(--pad-x) 48px;
}

main:focus { outline: none; }

a { color: var(--app-link); }

:focus-visible {
  outline: 2px solid var(--wa-color-focus);
  outline-offset: 2px;
}

h1, h2, h3 { line-height: 1.25; }

.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.muted { color: var(--app-muted); }
.nowrap { white-space: nowrap; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--wa-border-radius-m);
  background: var(--app-accent);
  color: var(--wa-color-brand-on-loud);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 10px; }

/* ---------- Header (sticky, 60px) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 var(--pad-x);
  background: var(--app-bg);
  border-bottom: 1px solid var(--app-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--app-text);
  text-decoration: none;
  min-width: 0;
}

.brand-mark { display: block; width: 36px; height: 36px; flex: none; }
.brand-svg { width: 100%; height: 100%; display: block; }
.brand-tile { fill: var(--site-navy-deep); }
.wa-dark .brand-tile { stroke: color-mix(in oklab, white 35%, transparent); stroke-width: 1; }
.brand-letters { fill: white; }

.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 1.05em; letter-spacing: -0.01em; }
.brand-full { color: var(--app-muted); font-size: 0.8em; white-space: nowrap; }

.main-nav { display: flex; gap: 4px; margin-left: 8px; }
.main-nav a {
  padding: 8px 12px;
  border-radius: var(--wa-border-radius-m);
  color: var(--app-text);
  text-decoration: none;
  font-weight: 500;
}
.main-nav a:hover { background: var(--app-surface); }
.main-nav a[aria-current="page"] {
  background: var(--app-accent-soft);
  color: var(--app-accent-text);
  font-weight: 600;
}

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-button::part(base) { min-width: 40px; padding-inline: 8px; }
.menu-label {
  margin: 6px 12px 4px;
  font-size: 0.74em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--app-muted);
}

/* ---------- Bottom bar (phones) ---------- */
.bottom-bar { display: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--app-border);
  background: var(--app-bg);
  color: var(--app-muted);
  font-size: 0.86em;
}
.footer-inner {
  padding: 20px var(--pad-x);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
}
.footer-inner p { margin: 0; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-inner a { color: var(--app-muted); }

/* ---------- Cards, pills, tiles ---------- */
.card {
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  padding: 20px;
}
.card + .card { margin-top: 20px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-head h2 {
  margin: 0;
  font-size: 1.15em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9em;
  text-decoration: none;
}

.pills { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--wa-border-radius-pill);
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--app-text);
  font-size: 0.82em;
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
}
a.pill:hover { border-color: var(--app-border-strong); }

/* Focus-area colours: tints are mixed from palette colours, so they work in both modes. */
.fa-blue   { --fa: var(--wa-color-blue-50); }
.fa-indigo { --fa: var(--wa-color-indigo-50); }
.fa-orange { --fa: var(--wa-color-orange-50); }
.fa-cyan   { --fa: var(--wa-color-cyan-50); }
.fa-green  { --fa: var(--wa-color-green-50); }
.fa-yellow { --fa: var(--wa-color-yellow-50); }
.fa-gray   { --fa: var(--wa-color-gray-50); }

.pill[class*="fa-"] {
  background: color-mix(in oklab, var(--fa) 12%, var(--app-bg));
  border-color: color-mix(in oklab, var(--fa) 35%, var(--app-bg));
  color: color-mix(in oklab, var(--fa) 75%, var(--app-text));
}

.tile {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--wa-border-radius-m);
  background: color-mix(in oklab, var(--fa, var(--wa-color-gray-50)) 14%, var(--app-bg));
  border: 1px solid color-mix(in oklab, var(--fa, var(--wa-color-gray-50)) 35%, var(--app-bg));
  color: color-mix(in oklab, var(--fa, var(--wa-color-gray-50)) 80%, var(--app-text));
  font-weight: 700;
  font-size: 1.05em;
}
.tile-s { width: 30px; height: 30px; font-size: 0.95em; }
.tile-l { width: 44px; height: 44px; font-size: 1.2em; }
.tile-xl { width: 64px; height: 64px; font-size: 1.6em; border-radius: var(--app-radius); }
.tile-xl .icon { width: 28px; height: 28px; }
.tile-img { background: transparent; border: 0; padding: 0; overflow: hidden; }
.tile-img img { width: 100%; height: 100%; object-fit: contain; display: block; }

.two-line { display: flex; flex-direction: column; min-width: 0; }
.two-line .main { font-weight: 600; color: var(--app-text); }
.two-line .muted { font-size: 0.86em; }

.status-badge { font-size: 0.72em; vertical-align: middle; }

/* ---------- Page header ---------- */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 20px;
}
.page-title {
  margin: 0;
  font-size: 1.85em;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-sub { margin: 4px 0 0; color: var(--app-muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Home ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 32px;
  align-items: center;
  padding: 24px 0 36px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--app-muted);
  font-size: 0.9em;
}
.hero-title {
  margin: 0;
  font-size: clamp(2.2em, 4vw, 3.2em);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.hero-role { margin: 6px 0 14px; font-size: 1.2em; font-weight: 600; color: var(--site-navy); }
.wa-dark .hero-role { color: var(--wa-color-blue-70); }
.hero-role a { color: inherit; }
.hero-lead { margin: 0; font-size: 1.08em; max-width: 68ch; color: var(--app-text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.profile-card { display: grid; gap: 14px; justify-items: start; }
.profile-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--app-bg);
  box-shadow: 0 0 0 1px var(--app-border);
}
.profile-name { margin: 0; font-weight: 700; font-size: 1.15em; }
.profile-role { margin: 2px 0 0; color: var(--app-muted); }

.section { margin-bottom: 28px; }
.section-head h2 { margin: 0 0 12px; font-size: 1.25em; }

.focus-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.focus-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  border-top: 3px solid color-mix(in oklab, var(--fa) 70%, var(--app-bg));
  border-radius: var(--app-radius);
  color: var(--app-text);
  text-decoration: none;
  box-shadow: var(--app-shadow);
  transition: border-color 0.15s, transform 0.15s;
}
.focus-card:hover { border-color: color-mix(in oklab, var(--fa) 50%, var(--app-bg)); transform: translateY(-1px); }
.focus-name { font-weight: 700; margin-top: 4px; }
.focus-desc { color: var(--app-muted); font-size: 0.86em; flex: 1; }
.focus-counts { font-size: 0.82em; font-weight: 600; color: color-mix(in oklab, var(--fa) 75%, var(--app-text)); }

.home-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.project-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--wa-border-radius-m);
  background: var(--app-bg);
  color: var(--app-text);
  text-decoration: none;
}
.project-card:hover { background: var(--app-surface); }
.pc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.pc-title { font-weight: 700; }
.pc-summary { color: var(--app-muted); font-size: 0.86em; flex: 1; }
.pc-meta { font-size: 0.8em; color: var(--app-muted); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 18px 22px;
  border-left: 2px solid var(--app-border);
  margin-left: 6px;
}
.timeline li:last-child { padding-bottom: 4px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--app-bg);
  border: 2px solid var(--app-border-strong);
}
.timeline li.current::before { background: var(--app-accent); border-color: var(--app-accent); }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.tl-head h3 { margin: 0; font-size: 1.05em; }
.tl-head h3 a { color: var(--app-text); }
.tl-when { color: var(--app-muted); font-size: 0.86em; white-space: nowrap; }
.tl-role { margin: 2px 0 6px; font-weight: 600; color: var(--app-muted); }
.tl-body p { margin: 0 0 8px; }
.muted-note { color: var(--app-muted); font-size: 0.9em; margin: 8px 0 0; }

.row-list { list-style: none; margin: 0; padding: 0; }
.row-list li + li { border-top: 1px solid var(--app-border); }
.row-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  text-decoration: none;
  border-radius: var(--wa-border-radius-m);
}
.row-link:hover { background: var(--app-surface); }

.award { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.award p { margin: 0; }
.award-points { margin: 0 0 12px; padding-left: 20px; color: var(--app-muted); font-size: 0.9em; }
.award-points li { margin-bottom: 2px; }
.other-degree { margin: 0 0 14px; font-size: 0.92em; }
.award-title { font-weight: 600; }
.cert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cert-list li { display: flex; align-items: center; gap: 10px; }
.cert-code {
  flex: none;
  min-width: 58px;
  text-align: center;
  padding: 2px 6px;
  border-radius: var(--wa-border-radius-s);
  background: var(--app-accent-soft);
  color: var(--app-accent-text);
  font-weight: 700;
  font-size: 0.8em;
  letter-spacing: 0.02em;
}

.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.contact-list li { display: flex; align-items: center; gap: 10px; }
.contact-list .icon { color: var(--app-muted); }

.pill-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Details strip (label/value pairs that stay aligned) ---------- */
.details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 10px 24px;
  margin: 0;
}
.details > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.details dt { color: var(--app-muted); font-size: 0.86em; }
.details dd { margin: 0; min-width: 0; }
.profile-card .details { grid-template-columns: 1fr; width: 100%; }
.contact-inline { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.contact-inline a { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; }

/* ---------- Filter bar (blueprint 7) ---------- */
.filter-bar {
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: 10px;
  margin-bottom: 16px;
}
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.quick-filters {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--app-surface);
  border-radius: var(--wa-border-radius-m);
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: thin;
}
.qf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--wa-border-radius-s);
  color: var(--app-text);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
  min-height: 32px;
  box-sizing: border-box;
}
.qf:hover { background: var(--app-bg); }
.qf[aria-current="page"] { background: var(--app-bg); box-shadow: var(--wa-shadow-s); font-weight: 700; color: var(--app-accent-text); }
.qf-count { color: var(--app-muted); font-weight: 500; font-size: 0.86em; }
.filter-tools { display: flex; gap: 8px; align-items: center; margin-left: auto; flex: 1 1 320px; justify-content: flex-end; }
.list-search { flex: 1 1 auto; min-width: 0; max-width: 340px; }
.filters-toggle { flex: none; }
.filters-panel { border-top: 1px solid var(--app-border); margin-top: 10px; padding-top: 12px; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 8px; }
.filter-field { display: grid; gap: 4px; font-size: 0.86em; color: var(--app-muted); }
.filter-field select {
  font: inherit;
  font-size: 1rem;
  padding: 8px 10px;
  border-radius: var(--wa-border-radius-m);
  border: 1px solid var(--app-border-strong);
  background: var(--app-bg);
  color: var(--app-text);
  min-height: 40px;
}

/* ---------- Tables (lean, roomy) ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
}
.list-table { width: 100%; border-collapse: collapse; }
.list-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.74em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--app-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--app-border);
  white-space: nowrap;
}
.list-table td { padding: 11px 14px; border-bottom: 1px solid var(--app-border); vertical-align: middle; }
.list-table tbody tr:last-child td { border-bottom: 0; }
.list-table tbody tr { cursor: pointer; }
.list-table tbody tr:hover td { background: var(--app-surface); }
.list-table .num { text-align: right; }
.sort-btn {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sort-btn:focus-visible { outline: 2px solid var(--wa-color-focus); outline-offset: 2px; border-radius: 2px; }
th[aria-sort="ascending"] .sort-ind::after { content: "▲"; font-size: 0.8em; }
th[aria-sort="descending"] .sort-ind::after { content: "▼"; font-size: 0.8em; }
.lead-cell { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 280px; }
.lead-cell .muted { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 70ch; }
.tech-cell { color: var(--app-muted); font-size: 0.9em; min-width: 160px; }

.empty-state {
  background: var(--app-bg);
  border: 1px dashed var(--app-border-strong);
  border-radius: var(--app-radius);
  padding: 28px;
  text-align: center;
  margin-top: 12px;
}
.empty-state p { margin: 0 0 12px; }

/* ---------- Record pages (blueprint 8) ---------- */
.record-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.record-layout.side-hidden { grid-template-columns: minmax(0, 1fr); }
.record-layout.side-hidden .side-list { display: none; }

.side-list {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 32px);
  display: flex;
  flex-direction: column;
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  overflow: hidden;
}
.side-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 14px; }
.side-title { font-weight: 700; color: var(--app-text); text-decoration: none; }
.side-title:hover { text-decoration: underline; }
.count {
  font-size: 0.8em;
  color: var(--app-muted);
  background: var(--app-surface);
  border-radius: var(--wa-border-radius-pill);
  padding: 0 8px;
}
.side-close {
  margin-left: auto;
  all: unset;
  margin-left: auto;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--wa-border-radius-m);
  color: var(--app-muted);
}
.side-close:hover { background: var(--app-surface); }
.side-close:focus-visible { outline: 2px solid var(--wa-color-focus); }
.side-search { margin: 0 12px 8px; }
.side-items { list-style: none; margin: 0; padding: 0 6px 8px; overflow-y: auto; }
.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--wa-border-radius-m);
  text-decoration: none;
}
.side-item:hover { background: var(--app-surface); }
.side-item[aria-current="page"] { background: var(--app-accent-soft); }
.side-item[aria-current="page"] .main { color: var(--app-accent-text); }
.side-item .main { font-size: 0.92em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side-empty { padding: 8px 14px; color: var(--app-muted); font-size: 0.9em; }
.side-backdrop { display: none; }

.record-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.side-toggle {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  min-height: 32px;
  box-sizing: border-box;
  border: 1px solid var(--app-border-strong);
  border-radius: var(--wa-border-radius-m);
  background: var(--app-bg);
  font-size: 0.9em;
  font-weight: 500;
}
.side-toggle:hover { background: var(--app-surface); }
.side-toggle:focus-visible { outline: 2px solid var(--wa-color-focus); outline-offset: 2px; }

.prev-next { display: flex; align-items: center; gap: 6px; }
.pn-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  min-height: 32px;
  box-sizing: border-box;
  border: 1px solid var(--app-border-strong);
  border-radius: var(--wa-border-radius-m);
  background: var(--app-bg);
  color: var(--app-text);
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 500;
}
a.pn-btn:hover { background: var(--app-surface); }
.pn-btn[aria-disabled="true"] { opacity: 0.45; }
.pn-count { color: var(--app-muted); font-size: 0.86em; padding: 0 6px; white-space: nowrap; }

.summary-card { padding: 22px; }
.summary-top { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.summary-title { flex: 1; min-width: 0; }
.summary-title .page-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.summary-lead { margin: 6px 0 0; color: var(--app-muted); font-size: 1.02em; }
.summary-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.tabs {
  margin: 20px 0 0;
  border-bottom: 1px solid var(--app-border);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none; /* still scrolls sideways on narrow screens, without a scrollbar */
}
.tabs::-webkit-scrollbar { display: none; }
.tabs [role="tablist"] { display: flex; gap: 4px; }
.tabs [role="tab"] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  color: var(--app-muted);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.tabs [role="tab"]:hover { color: var(--app-text); }
.tabs [role="tab"][aria-selected="true"] { color: var(--app-accent-text); box-shadow: inset 0 -2px 0 var(--app-accent); font-weight: 700; }
.tab-count {
  font-size: 0.78em;
  background: var(--app-surface);
  border-radius: var(--wa-border-radius-pill);
  padding: 0 7px;
  color: var(--app-muted);
  font-weight: 600;
}

.tab-panel { padding-top: 18px; }
.tab-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.tab-heading h2 { margin: 0; font-size: 1.3em; }

/* ---------- Long text ---------- */
.prose { font-size: 1.02em; line-height: 1.65; }
.prose h2 { font-size: 1.3em; margin: 1.6em 0 0.5em; }
.prose h3 { font-size: 1.1em; margin: 1.4em 0 0.4em; }
.prose :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose li { margin-bottom: 0.3em; }
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--wa-border-radius-m);
  border: 1px solid var(--app-border);
  background: white; /* screenshots are light; keep them readable in dark mode */
}
.prose figure { margin: 1.2em 0; }
.prose blockquote {
  margin: 1em 0;
  padding: 10px 16px;
  border-left: 4px solid var(--wa-color-danger-border-normal);
  background: var(--app-bg);
  border-radius: 0 var(--wa-border-radius-m) var(--wa-border-radius-m) 0;
}
.prose blockquote cite { font-style: normal; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1.2em; background: var(--app-bg); }
.prose th, .prose td { border: 1px solid var(--app-border); padding: 8px 10px; text-align: left; }
.prose th { background: var(--app-surface); font-size: 0.9em; }
.prose code { font-family: var(--wa-font-family-code); font-size: 0.9em; }
.prose :not(pre) > code { background: var(--app-bg); border: 1px solid var(--app-border); padding: 1px 5px; border-radius: 4px; }

.code-block { position: relative; margin: 0 0 1.2em; }
.code-block pre {
  margin: 0;
  padding: 14px 48px 14px 16px;
  overflow-x: auto;
  background: var(--wa-color-neutral-10);
  color: var(--wa-color-neutral-95);
  border-radius: var(--wa-border-radius-m);
  font-size: 0.88em;
  line-height: 1.55;
}
.wa-dark .code-block pre { background: var(--wa-color-neutral-05); border: 1px solid var(--app-border); }
.code-copy { position: absolute; top: 6px; right: 6px; color: var(--wa-color-neutral-80); }

.article-body { margin-top: 20px; }
.article .summary-card { margin-bottom: 0; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 16px; max-width: none; }
.gallery figure { margin: 0; background: var(--app-bg); border: 1px solid var(--app-border); border-radius: var(--app-radius); overflow: hidden; }
.gallery img { display: block; width: 100%; height: auto; border: 0; border-radius: 0; }
.gallery figcaption { padding: 10px 12px; font-size: 0.88em; color: var(--app-muted); }

.comments { margin-top: 24px; }
.comment-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.comment-list li { padding: 12px 14px; background: var(--app-surface); border-radius: var(--wa-border-radius-m); }
.comment-meta { margin: 0 0 4px; font-size: 0.9em; }
.comment-body p { margin: 0; }

.author { display: flex; align-items: center; gap: 14px; margin-top: 24px; box-sizing: border-box; }
.author-photo { border-radius: 50%; object-fit: cover; flex: none; }
.author p { margin: 0; }
.author-name { font-weight: 700; }
.author > div { flex: 1; }

.error-page { max-width: 720px; padding: 40px 0; }
.error-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .focus-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .record-layout { grid-template-columns: 260px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .hero, .home-columns { grid-template-columns: minmax(0, 1fr); }
  .hero { gap: 20px; padding-top: 8px; }
  .focus-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-top { flex-wrap: wrap; }
  .summary-actions { justify-content: flex-start; width: 100%; }
}

@media (max-width: 720px) {
  :root { --pad-x: 14px; --pad-y: 16px; }
  .main-nav, .contact-button, .brand-full { display: none; }
  main { padding-bottom: calc(var(--bottom-h) + 32px + env(safe-area-inset-bottom)); }
  .site-footer { padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }

  .bottom-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
    background: var(--app-bg);
    border-top: 1px solid var(--app-border);
  }
  .bottom-bar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--app-muted);
    text-decoration: none;
    font-size: 0.74em;
    font-weight: 500;
  }
  .bottom-bar a[aria-current="page"] { color: var(--app-accent-text); font-weight: 700; }

  /* Side list becomes a drawer */
  .record-layout, .record-layout.side-hidden { grid-template-columns: minmax(0, 1fr); }
  .side-list {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 80;
    width: min(320px, 86vw);
    max-height: none;
    border-radius: 0;
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    padding-top: env(safe-area-inset-top);
  }
  .record-layout.side-open .side-list { transform: none; display: flex; }
  .record-layout.side-hidden .side-list { display: flex; }
  .record-layout.side-open .side-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: var(--wa-color-overlay-modal);
  }
  .side-toggle-label { display: inline; }

  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-tools { flex: none; width: 100%; margin-left: 0; }
  .list-search { max-width: none; }
  .col-wide { display: none; }
  .lead-cell { min-width: 0; }
  .list-table td, .list-table th { padding-inline: 10px; }
  .page-title { font-size: 1.6em; }
  .tile-xl { width: 48px; height: 48px; font-size: 1.3em; }
  .details > div { grid-template-columns: 96px minmax(0, 1fr); }
  .profile-card .details > div { grid-template-columns: 84px minmax(0, 1fr); }
  .contact-inline { gap: 4px 10px; }
  .prev-next .pn-btn { padding: 6px 8px; }
}

@media (max-width: 480px) {
  .card { padding: 16px; }
  .focus-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-actions wa-button { flex: 1 1 100%; }
  .hero-actions wa-button::part(base) { width: 100%; }
  .pn-count { display: none; }
}

/* ---------- Print: the home page prints as a CV ---------- */
@media print {
  .site-header, .bottom-bar, .site-footer, .hero-actions, .side-list, .record-bar, .filter-bar, .skip-link, .focus-grid, .section { display: none !important; }
  body { background: white; color: black; }
  main { padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0 0 12px; break-inside: avoid; }
  .hero, .home-columns { grid-template-columns: 1fr; }
  a { color: inherit; text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Status badge beside a record title */
.summary-title .page-title .status-badge { font-size: 0.42em; font-weight: 600; letter-spacing: 0; }
