/* ==========================================================================
   Synology Package Guide - KLAE Group
   Light, plain corporate styling. Change the brand colour in :root.
   ========================================================================== */

:root {
  color-scheme: light;

  --brand: #1c4b8c;
  --brand-dark: #153a6d;
  --brand-tint: #edf2f9;
  --brand-line: #c9d7ea;

  --ink: #1b2330;
  --ink-2: #445063;
  --ink-3: #6a7586;
  --line: #e2e6ec;
  --line-2: #cfd6df;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;

  --ok: #1d6f46;
  --ok-bg: #e7f3ec;
  --ok-line: #bfdfcc;
  --warn: #8a5200;
  --warn-bg: #fdf3e2;
  --warn-line: #f1d6a6;
  --bad: #a3271c;
  --bad-bg: #fcebe9;
  --bad-line: #f1c4be;
  --muted-bg: #eef0f3;

  --radius: 6px;
  --radius-sm: 4px;
  --font: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono: Consolas, 'SFMono-Regular', Menlo, monospace;
  --wrap: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 600;
  color: var(--ink);
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.2rem;
}

h3 {
  font-size: 1rem;
}

p {
  margin: 0 0 0.9em;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--surface);
  padding: 8px 12px;
  z-index: 100;
}

.skip-link:focus {
  left: 8px;
}

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

/* ---------- header ---------- */

.site-header {
  background: var(--surface);
  border-top: 3px solid var(--brand);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  border-radius: var(--radius-sm);
}

.brand-mark img {
  height: 36px;
  width: auto;
  display: block;
}

.brand-mark.has-logo {
  background: none;
  padding: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-company {
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.brand-title {
  font-weight: 600;
  font-size: 16px;
}

.main-nav {
  display: flex;
  gap: 4px;
}

.main-nav a {
  color: var(--ink-2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  white-space: nowrap;
}

.main-nav a:hover {
  background: var(--bg);
  text-decoration: none;
  color: var(--ink);
}

.main-nav a[aria-current='page'] {
  color: var(--brand);
  background: var(--brand-tint);
  font-weight: 600;
}

/* ---------- layout ---------- */

main {
  flex: 1;
  padding-top: 28px;
  padding-bottom: 56px;
}

/* main gets focus after each page change (for screen readers); no visible ring needed */
main:focus,
main:focus-visible {
  outline: none;
}

.loading,
.empty {
  color: var(--ink-3);
  padding: 32px 0;
}

.page-head {
  margin-bottom: 28px;
}

.page-head p {
  color: var(--ink-2);
  max-width: 720px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.section {
  margin-top: 40px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.section-head h2 {
  margin: 0;
}

.section-head p {
  margin: 0;
  color: var(--ink-3);
  font-size: 14px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.panel + .panel {
  margin-top: 16px;
}

.panel h2 {
  font-size: 1.05rem;
}

.muted {
  color: var(--ink-3);
}

.small {
  font-size: 13px;
}

/* ---------- search ---------- */

.search-form {
  display: flex;
  max-width: 640px;
  margin-top: 18px;
}

.search-form input {
  flex: 1;
  min-width: 0;
}

.search-form .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1px;
}

.search-form input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

input[type='search'],
input[type='text'],
select {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  width: 100%;
}

select {
  padding-right: 32px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236a7586' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

input:focus,
select:focus {
  border-color: var(--brand);
  outline: 2px solid var(--brand-tint);
  outline-offset: 0;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  background: var(--bg);
  text-decoration: none;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-link {
  border: 0;
  background: none;
  color: var(--brand);
  padding: 4px 0;
}

.btn-link:hover {
  background: none;
  text-decoration: underline;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ---------- stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-top: 28px;
}

.stat {
  display: block;
  padding: 16px 20px;
  color: var(--ink);
  border-left: 1px solid var(--line);
}

.stat:first-child {
  border-left: 0;
}

.stat:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.2;
}

.stat-label {
  display: block;
  color: var(--ink-3);
  font-size: 13px;
}

/* ---------- tasks ---------- */

.task-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.task-group h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 8px;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.task {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.task:first-child {
  border-top: 0;
}

.task-title {
  font-weight: 600;
  font-size: 14px;
}

.task-desc {
  color: var(--ink-3);
  font-size: 13px;
  margin: 2px 0 6px;
}

.mini-apps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 3px 8px 3px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}

.mini-app:hover {
  border-color: var(--brand-line);
  background: var(--brand-tint);
  text-decoration: none;
}

.mini-app .app-icon {
  width: 20px;
  height: 20px;
}

/* ---------- departments ---------- */

.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.dept-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  color: var(--ink);
}

.dept-card:hover {
  border-color: var(--brand-line);
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(20, 35, 60, 0.06);
}

.dept-card h3 {
  margin-bottom: 4px;
  color: var(--brand);
}

.dept-card p {
  color: var(--ink-2);
  font-size: 13px;
  margin-bottom: 8px;
}

.dept-card .count {
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- app cards ---------- */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--ink);
  min-width: 0;
}

.app-card:hover {
  border-color: var(--brand-line);
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(20, 35, 60, 0.06);
}

.app-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.app-card-name {
  font-weight: 600;
  line-height: 1.3;
}

.app-card-cat {
  font-size: 12px;
  color: var(--ink-3);
}

.app-card-summary {
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-card-summary.is-use-case {
  -webkit-line-clamp: 3;
}

.app-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.app-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
}

.app-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--brand-line);
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.tile {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.tile:hover {
  border-color: var(--brand-line);
  text-decoration: none;
}

.tile .app-icon {
  width: 32px;
  height: 32px;
}

/* ---------- badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  line-height: 1.2;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--muted-bg);
  color: var(--ink-2);
  white-space: nowrap;
}

.badge-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.badge-ok {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok);
}

.badge-warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn);
}

.badge-bad {
  background: var(--bad-bg);
  border-color: var(--bad-line);
  color: var(--bad);
}

.badge-brand {
  background: var(--brand-tint);
  border-color: var(--brand-line);
  color: var(--brand);
}

.chip {
  display: inline-block;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--brand-line);
  background: var(--brand-tint);
  color: var(--brand);
}

.chip:hover {
  text-decoration: none;
  background: #e2eaf5;
}

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

/* ---------- catalogue (all packages) ---------- */

.catalogue {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 28px;
  align-items: start;
}

.filters {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  position: sticky;
  top: 84px;
}

.filters-toggle {
  display: none;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}

.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
}

.results-count {
  font-weight: 600;
}

.results-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.catalogue > * {
  min-width: 0;
}

.results-tools select {
  width: auto;
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 14px;
}

.legend {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
}

.section-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin: 22px 0 10px;
  font-weight: 600;
}

.section-label:first-child {
  margin-top: 0;
}

/* ---------- app detail ---------- */

.breadcrumb {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--ink-3);
}

.app-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.app-header .app-icon {
  width: 80px;
  height: 80px;
  border-radius: 14px;
}

.app-header-main {
  flex: 1;
  min-width: 0;
}

.app-header h1 {
  margin-bottom: 2px;
}

.app-header .app-sub {
  color: var(--ink-3);
  font-size: 14px;
  margin-bottom: 10px;
}

.app-header .app-summary {
  color: var(--ink-2);
  margin: 0 0 12px;
}

.app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.notice {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  background: var(--surface);
  font-size: 14px;
}

.notice strong {
  display: block;
  margin-bottom: 2px;
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice-warn {
  border-color: var(--warn-line);
  border-left-color: var(--warn);
  background: var(--warn-bg);
}

.notice-bad {
  border-color: var(--bad-line);
  border-left-color: var(--bad);
  background: var(--bad-bg);
}

.notice-info {
  border-color: var(--brand-line);
  border-left-color: var(--brand);
  background: var(--brand-tint);
}

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

.detail-main .panel h2 {
  margin-bottom: 12px;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 0 0 12px 40px;
  counter-increment: step;
}

.steps li:last-child {
  padding-bottom: 0;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.use-cases,
.tips {
  margin: 0;
  padding: 0;
  list-style: none;
}

.use-cases li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.use-cases li:first-child {
  border-top: 0;
  padding-top: 0;
}

.use-cases li:last-child {
  padding-bottom: 0;
}

.use-case-dept {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
  margin-bottom: 2px;
}

.tips li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
}

.tips li:last-child {
  margin-bottom: 0;
}

.tips li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  background: var(--ink-3);
  border-radius: 1px;
}

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  font-size: 14px;
}

.facts dt {
  color: var(--ink-3);
}

.facts dd {
  margin: 0;
  min-width: 0;
}

.aside-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 600;
  margin: 0 0 10px;
}

.related-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related-list li + li {
  margin-top: 8px;
}

.related-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
}

.related-list .app-icon {
  width: 28px;
  height: 28px;
}

.related-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dep-head {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin: 14px 0 8px;
}

.dep-head:first-of-type {
  margin-top: 0;
}

.dep-state {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}

.dep-state.is-on {
  color: var(--ok);
}

/* ---------- department page ---------- */

.dept-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.dept-nav a {
  font-size: 13px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
}

.dept-nav a:hover {
  text-decoration: none;
  border-color: var(--brand-line);
}

.dept-nav a[aria-current='page'] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ---------- guide ---------- */

.guide {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 84px;
  font-size: 14px;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--line);
}

.toc a {
  display: block;
  padding: 5px 12px;
  color: var(--ink-2);
  margin-left: -2px;
  border-left: 2px solid transparent;
}

.toc a:hover {
  color: var(--brand);
  border-left-color: var(--brand);
  text-decoration: none;
}

.guide .panel {
  scroll-margin-top: 84px;
}

.legend-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.legend-table th,
.legend-table td {
  text-align: left;
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.legend-table th {
  width: 210px;
  font-weight: 400;
}

.legend-table tr:first-child th,
.legend-table tr:first-child td {
  border-top: 0;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.faq details:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 24px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: -1px;
  color: var(--ink-3);
  font-weight: 400;
  font-size: 18px;
}

.faq details[open] summary::after {
  content: '\2212';
}

.faq details > div {
  color: var(--ink-2);
  padding-top: 8px;
}

.glossary {
  margin: 0;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  font-size: 14px;
}

.glossary dt,
.glossary dd {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

.glossary dt {
  font-weight: 600;
  padding-right: 16px;
}

.glossary dt:first-of-type,
.glossary dt:first-of-type + dd {
  border-top: 0;
  padding-top: 0;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose ol,
.prose ul {
  padding-left: 20px;
  margin: 0 0 0.9em;
}

.prose li {
  margin-bottom: 4px;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--muted-bg);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-3);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.data-status::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
  background: var(--ink-3);
}

.data-status.is-live::before {
  background: var(--ok);
}

.data-status.is-fallback::before {
  background: var(--warn);
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .task-groups {
    grid-template-columns: 1fr 1fr;
  }

  .detail {
    grid-template-columns: 1fr;
  }

  .guide {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }

  .toc ol {
    display: flex;
    flex-wrap: wrap;
    border-left: 0;
    gap: 4px;
  }

  .toc a {
    border: 1px solid var(--line);
    border-radius: 999px;
    margin: 0;
    padding: 4px 10px;
    background: var(--surface);
  }
}

@media (max-width: 820px) {
  .catalogue {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .filters {
    position: static;
    display: none;
  }

  .filters.open {
    display: block;
  }

  .filters-toggle {
    display: inline-flex;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat:nth-child(3) {
    border-left: 0;
  }

  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .wrap {
    padding: 0 16px;
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-height: 0;
    padding-top: 10px;
  }

  .main-nav {
    overflow-x: auto;
    gap: 0;
    margin: 6px -16px 0;
    padding: 0 8px 8px;
  }

  .main-nav a {
    padding: 6px 8px;
  }

  .site-header {
    position: static;
  }

  h1 {
    font-size: 1.45rem;
  }

  .task-groups {
    grid-template-columns: 1fr;
  }

  .app-header {
    flex-direction: column;
    gap: 14px;
    padding: 18px;
  }

  .app-header .app-icon {
    width: 64px;
    height: 64px;
  }

  .glossary {
    grid-template-columns: 1fr;
  }

  .glossary dd {
    border-top: 0;
    padding-top: 0;
  }

  .legend-table th {
    width: auto;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- print ---------- */

@media print {
  body {
    background: #fff;
    font-size: 12px;
  }

  .site-header,
  .site-footer,
  .filters,
  .filters-toggle,
  .app-actions,
  .toc,
  .results-tools,
  .toast,
  .skip-link {
    display: none !important;
  }

  .panel,
  .app-header,
  .app-card {
    border-color: #bbb;
    break-inside: avoid;
  }

  .detail,
  .catalogue,
  .guide {
    grid-template-columns: 1fr;
  }

  a {
    color: inherit;
  }
}
