/* ifm.lu – single stylesheet, no external fonts or scripts */

/* Atkinson Hyperlegible Next (Braille Institute, free licence, no alteration), self-hosted */
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-hyperlegible-next/AtkinsonHyperlegibleNext-Regular.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-hyperlegible-next/AtkinsonHyperlegibleNext-RegularItalic.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/atkinson-hyperlegible-next/AtkinsonHyperlegibleNext-Medium.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/atkinson-hyperlegible-next/AtkinsonHyperlegibleNext-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/atkinson-hyperlegible-next/AtkinsonHyperlegibleNext-Bold.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: italic; font-weight: 700; font-display: swap; src: url("../fonts/atkinson-hyperlegible-next/AtkinsonHyperlegibleNext-BoldItalic.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/atkinson-hyperlegible-next/AtkinsonHyperlegibleNext-ExtraBold.woff2") format("woff2"); }

:root {
  /* Dark is the default theme */
  --bg: #0f1115;
  --bg-alt: #151820;
  --surface: #1a1e27;
  --text: #e8eaee;
  --muted: #9aa1ad;
  --line: #2a2f3a;
  --accent: #6aa9ff;
  --accent-soft: #1b2a40;
  --on-accent: #0b1220;
  --radius: 14px;
  --wrap: 72rem;
  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

/* Light theme, when the visitor chooses it (data-theme on <html>) */
:root[data-theme="light"] {
  --bg: #fbfbfa;
  --bg-alt: #f1f2f0;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5a606b;
  --line: #dfe1e4;
  --accent: #0b5cad;
  --accent-soft: #e3eefa;
  --on-accent: #ffffff;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* hidden must win over display rules such as .btn */

html { scroll-behavior: smooth; scroll-padding-top: 5rem; scrollbar-gutter: stable; } /* same horizontal position with and without a scrollbar */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 3px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 650; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 48rem) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--surface); padding: .5rem 1rem; border-radius: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 750; font-size: 1.25rem; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.brand b { color: var(--accent); font-weight: inherit; }
/* Flex centring uses the line box, which reserves room for descenders "ifm.lu" lacks; lift the mark onto the centre of the visible glyphs */
.mark { transform: translateY(-.1em); width: 1.15rem; height: 1.15rem; border-radius: 4px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--text))); }
.site-header nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.site-header nav a:hover { color: var(--text); }
.header-end { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
/* Bootstrap Icons (MIT), stored locally; drawn as masks so they take the current text colour */
.theme-toggle .icon { display: block; width: 1.1rem; height: 1.1rem; background-color: currentColor; mask: center / contain no-repeat; -webkit-mask: center / contain no-repeat; }
.theme-toggle .to-dark { mask-image: url("../img/icons/bootstrap/moon.svg"); -webkit-mask-image: url("../img/icons/bootstrap/moon.svg"); }
.theme-toggle .to-light { mask-image: url("../img/icons/bootstrap/sun.svg"); -webkit-mask-image: url("../img/icons/bootstrap/sun.svg"); }
.theme-toggle .to-light { display: none; }
.is-dark .theme-toggle .to-dark { display: none; }
.is-dark .theme-toggle .to-light { display: block; }
.theme-toggle[hidden] { display: none; }
@media (max-width: 40rem) {
  .bar { padding-top: .6rem; padding-bottom: .5rem; row-gap: .4rem; }
  .header-end { display: contents; }
  .theme-toggle { order: 2; }
  .site-header nav { order: 3; width: 100%; gap: 1rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .site-header nav a { font-size: .9rem; white-space: nowrap; }
}

/* Hero */
.hero { padding: clamp(4rem, 10vw, 8rem) 0 clamp(3rem, 7vw, 5rem); }
.hero h1 { max-width: 22ch; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 1rem; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 44rem; margin: 0 0 2rem; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 0; }

.btn {
  display: inline-block; padding: .75rem 1.25rem; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 600;
  border: 1px solid var(--accent); transition: transform .15s ease, opacity .15s ease;
  overflow-wrap: anywhere;
}
.btn:hover { transform: translateY(-1px); opacity: .92; }
.btn.ghost { background: transparent; color: var(--accent); }

.notice-band { background: var(--accent-soft); border-block: 1px solid var(--line); }
.notice-band p { margin: 0; padding: 1rem 0; font-size: .95rem; }

/* Sections */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section.alt { background: var(--bg-alt); }
.intro { color: var(--muted); max-width: 44rem; margin: 0 0 2.5rem; }
.sub { margin-top: 3.5rem; }

.split { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 56rem) { .split { grid-template-columns: 3fr 2fr; gap: 4rem; } }
.split p { margin: 0 0 1rem; }
blockquote {
  margin: 0; padding: 1.75rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  font-size: 1.2rem; line-height: 1.5; font-weight: 500;
}
blockquote p { margin: 0; }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.card p { margin: 0; color: var(--muted); font-size: 1rem; }

/* Trace chain */
.chain { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); counter-reset: step; }
.chain li {
  position: relative; counter-increment: step;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1.2rem; font-size: .95rem; color: var(--muted);
}
.chain li span { display: block; color: var(--text); font-weight: 650; margin-bottom: .25rem; }
.chain li::before { content: counter(step, decimal-leading-zero); display: block; font-size: .8rem; font-weight: 700; color: var(--accent); margin-bottom: .5rem; }

.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
/* Terms */
.terms { margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.terms div { border-top: 2px solid var(--accent); padding-top: .75rem; }
.terms dt { font-weight: 700; margin-bottom: .25rem; }
.terms dd { margin: 0; color: var(--muted); font-size: .98rem; }

.tags li { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .4rem .9rem; font-size: .95rem; }

/* Roadmap */
.roadmap { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr)); counter-reset: phase; }
.roadmap li { counter-increment: phase; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.roadmap li::before { content: "Phase " counter(phase); display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .6rem; }
.roadmap li.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.roadmap li.current::before { content: "Phase " counter(phase) " · in progress"; color: var(--accent); }
.roadmap p { margin: 0; color: var(--muted); font-size: 1rem; }

/* Contact */
.contact { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 56rem) { .contact { grid-template-columns: 2fr 1fr; } .contact .btn { justify-self: end; } }
.contact p { color: var(--muted); max-width: 40rem; margin: 0; }

/* Text pages */
.prose { max-width: 46rem; padding-top: 4rem; padding-bottom: 5rem; }
.prose h2 { font-size: 1.35rem; margin-top: 2.5rem; }
.prose p, .prose ul { margin: 0 0 1rem; }
.prose address { font-style: normal; margin: 0 0 1rem; }
.prose h3 { margin: 1.75rem 0 .4rem; font-size: 1.05rem; }
.prose h4 { margin: 1.5rem 0 .35rem; font-size: 1rem; font-weight: 600; color: var(--muted); }
.prose .license { color: var(--muted); font-size: .9rem; }
.prose section + section { margin-top: 3.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* Portal (signed-in area) */
.portal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.portal-bar a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.portal-bar a:hover, .portal-bar a[aria-current="page"] { color: var(--text); }
.portal-bar .portal-signout { margin-left: auto; color: var(--accent); }
.portal-bar .portal-session { margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.portal-bar .portal-session::before {
  content: ""; width: .95rem; height: .95rem; background: currentColor;
  -webkit-mask: url("../img/icons/bootstrap/clock.svg") no-repeat center / contain; mask: url("../img/icons/bootstrap/clock.svg") no-repeat center / contain;
}
.portal-bar .portal-session.ending { color: #f07178; }
.portal-bar .portal-session + .portal-signout { margin-left: 0; }
.dialog h2.session::before {
  content: ""; flex: none; width: 1.3rem; height: 1.3rem; background: var(--accent);
  -webkit-mask: url("../img/icons/bootstrap/clock.svg") no-repeat center / contain; mask: url("../img/icons/bootstrap/clock.svg") no-repeat center / contain;
}
.dialog-actions a.btn { text-decoration: none; }
.setup-step { margin: 1.5rem 0; padding: 1.25rem 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.setup-step h3 { margin-top: 0; }
.totp-secret { font-size: 1.05rem; letter-spacing: .05em; word-break: break-all; }
/* Black on white with a quiet zone, also in dark mode; the canvas stays visible because the CSP blocks data: images */
.totp-qr { display: inline-block; padding: 12px; background: #fff; border-radius: 8px; line-height: 0; margin: 0 0 1rem; }
.totp-qr canvas { display: block !important; }
.totp-qr img { display: none !important; }
.portal-body { padding-top: 2.5rem; }
.notice-inline { background: var(--accent-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; font-size: .95rem; }
.news { list-style: none; margin: 0 0 2rem; padding: 0; }
.news li { padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.news li:last-child { border-bottom: 0; }
.news h2 { font-size: 1.15rem; margin: .25rem 0 .5rem; }
.news-meta { color: var(--muted); font-size: .9rem; margin: 0 !important; }
.heading-note { font-size: .5em; font-weight: 400; color: var(--muted); white-space: nowrap; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0 0 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.pager ol { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.pager li { margin: 0; }
.pager li a, .pager li span { display: inline-block; min-width: 2.25rem; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); text-align: center; text-decoration: none; }
.pager li span[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
.pager-step { text-decoration: none; }
.portal-body.wide { max-width: var(--wrap); }
.tenant-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; margin: 1rem 0 0; padding: .6rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: .95rem; }
.tenant-banner.foreign { border-color: var(--accent); background: var(--accent-soft); }
.tenant-switch { display: inline-flex; align-items: center; gap: .5rem; margin-left: auto; }
.tenant-switch label { color: var(--muted); font-size: .9rem; }
.tenant-switch select { font: inherit; font-size: .9rem; color: var(--text); background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px; padding: .3rem .6rem; }
.tenant-banner.foreign .tenant-switch { margin-left: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.5rem; margin: 0 0 2rem; padding: 1.25rem 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.form { display: grid; gap: 1rem; max-width: 34rem; margin: 0 0 1.5rem; }
.form.inline { max-width: none; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 48rem) { .form.inline { grid-template-columns: 2fr 1fr auto; } }
.field { display: grid; gap: .35rem; }
.field label { font-size: .9rem; color: var(--muted); }
.field input, .field select, .table select {
  font: inherit; color: var(--text); background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: 10px; padding: .55rem .75rem; min-width: 0; box-sizing: border-box; height: 2.75rem;
}
.field input:focus, .field select:focus, .table select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field input[readonly] { background: transparent; border-style: dashed; }
.field input[type="checkbox"], .field input[type="radio"] { width: 1rem; height: 1rem; padding: 0; flex: none; accent-color: var(--accent); }
.field textarea { font: inherit; color: var(--text); background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .75rem; box-sizing: border-box; resize: vertical; min-height: 4.5rem; }
.field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field input:disabled, .field select:disabled, .field textarea:disabled { opacity: .45; cursor: not-allowed; }
.form .btn { justify-self: start; border: 0; cursor: pointer; font: inherit; }
.btn.small { padding: .35rem .8rem; font-size: .85rem; border: 1px solid var(--accent); cursor: pointer; font-family: inherit; }
.btn.danger { background: transparent; color: #f07178; border-color: #f07178; }
.table { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: .95rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .85rem; border-bottom: 1px solid var(--line); padding: .5rem .5rem .5rem 0; }
.table td { border-bottom: 1px solid var(--line); padding: .6rem .5rem .6rem 0; vertical-align: middle; overflow-wrap: anywhere; }
.table .row-actions { white-space: nowrap; text-align: right; }
.table .row-actions .btn + .btn { margin-left: .4rem; }
@media (max-width: 40rem) { .table thead { display: none; } .table tr { display: grid; padding: .5rem 0; border-bottom: 1px solid var(--line); } .table td { border: 0; padding: .15rem 0; } .table .row-actions { text-align: left; } }
/* Messages: panel with a Bootstrap icon in the message colour (mask, so it follows the theme) */
.status {
  --tone: var(--muted);
  display: flex; gap: .65rem; align-items: flex-start; margin: .5rem 0 1rem !important; padding: .75rem 1rem;
  font-size: .95rem; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--tone); border-radius: 10px;
}
.status::before {
  content: ""; flex: none; width: 1.1rem; height: 1.1rem; margin-top: .15rem; background: var(--tone);
  -webkit-mask: var(--icon) no-repeat center / contain; mask: var(--icon) no-repeat center / contain;
}
.status.info { --tone: var(--accent); --icon: url("../img/icons/bootstrap/info-circle.svg"); }
.status.ok { --tone: #7fd99a; --icon: url("../img/icons/bootstrap/check-circle.svg"); }
.status.error { --tone: #f07178; --icon: url("../img/icons/bootstrap/x-circle.svg"); }
.status.warn { --tone: #e0b252; --icon: url("../img/icons/bootstrap/exclamation-triangle.svg"); }
.btn.danger.solid { background: #f07178; color: #1a0b0d; }

/* Confirmation dialog */
.dialog {
  width: min(30rem, calc(100vw - 2rem)); padding: 1.5rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 20px 60px rgb(0 0 0 / .45);
}
.dialog::backdrop { background: rgb(8 10 14 / .6); backdrop-filter: blur(2px); }
.dialog h2 { display: flex; align-items: center; gap: .6rem; margin: 0 0 .75rem; font-size: 1.3rem; }
.dialog h2.warning::before {
  content: ""; flex: none; width: 1.3rem; height: 1.3rem; background: #f07178;
  -webkit-mask: url("../img/icons/bootstrap/exclamation-triangle.svg") no-repeat center / contain;
  mask: url("../img/icons/bootstrap/exclamation-triangle.svg") no-repeat center / contain;
}
.dialog p { margin: 0 0 .75rem; color: var(--muted); overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.dialog-actions .btn { cursor: pointer; font: inherit; font-weight: 600; }
.dialog-actions .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.meta { color: var(--muted); font-size: .9rem; }
.roles { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.25rem; margin: 0 0 1.5rem; font-size: .95rem; }
.roles dt { font-weight: 600; }
.roles dd { margin: 0; color: var(--muted); }
@media (max-width: 40rem) { .roles { grid-template-columns: 1fr; gap: .15rem; } .roles dd { margin-bottom: .6rem; } }
:root[data-theme="light"] .status.ok { --tone: #1d7a3c; }
:root[data-theme="light"] .status.error { --tone: #b3261e; }
:root[data-theme="light"] .status.warn { --tone: #8a5a00; }
:root[data-theme="light"] .btn.danger { color: #b3261e; border-color: #b3261e; }
:root[data-theme="light"] .btn.danger.solid { background: #b3261e; color: #ffffff; }
:root[data-theme="light"] .dialog h2.warning::before { background: #b3261e; }
:root[data-theme="light"] .portal-bar .portal-session.ending { color: #b3261e; }
:root[data-theme="light"] .dialog { box-shadow: 0 20px 60px rgb(20 24 32 / .18); }
:root[data-theme="light"] .dialog::backdrop { background: rgb(20 24 32 / .35); }
.lang-note { color: var(--muted); font-size: .95rem; margin: 0 0 .25rem !important; }
.lang-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 1.25rem 0 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; padding-top: 1.5rem; padding-bottom: 1.5rem; }
.foot p { margin: 0; }
.foot nav { display: flex; gap: 1.25rem; }
.foot a { color: var(--muted); }

/* Back to top: fixed at the bottom right on every page; without JavaScript always shown, with it after scrolling */
.to-top {
  position: fixed; right: clamp(12px, 2vw, 28px); bottom: clamp(12px, 2vw, 28px); z-index: 20;
  width: 2.75rem; height: 2.75rem; border-radius: 999px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 20px rgb(0 0 0 / .35);
  transition: opacity .2s ease, transform .2s ease, border-color .15s ease;
}
.to-top::before {
  content: ""; width: 1.15rem; height: 1.15rem; background: var(--accent);
  -webkit-mask: url("../img/icons/bootstrap/arrow-up.svg") no-repeat center / contain;
  mask: url("../img/icons/bootstrap/arrow-up.svg") no-repeat center / contain;
}
.to-top:hover, .to-top:focus-visible { border-color: var(--accent); outline: none; }
.to-top:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.to-top.is-js:not(.is-visible) { opacity: 0; transform: translateY(.5rem); pointer-events: none; visibility: hidden; }
:root[data-theme="light"] .to-top { box-shadow: 0 6px 20px rgb(20 24 32 / .15); }
@media print { .to-top { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .to-top { transition: none; }
}

/* Portal library (generated by scripts/build_portal_library.py) */
.nowrap { white-space: nowrap; }
.badge { display: inline-block; padding: .1rem .55rem; border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; color: var(--muted); background: var(--surface); }
.badge.status-draft { color: #e0b252; border-color: currentColor; }
.badge.status-approved { color: #7fd99a; border-color: currentColor; }
.open-point { color: #e0b252; font-weight: 700; }
a.setting { color: inherit; text-decoration: underline dotted var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 3px; padding: 0 .15rem; }
a.setting:hover, a.setting:focus-visible { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.settings-table td:first-child { min-width: 18rem; }
.field-check { display: flex; align-items: center; gap: .45rem; }
.field-check input { width: auto; margin: 0; }
.library-filter .field-check { align-self: end; padding-bottom: .55rem; }
.scope-form { max-width: 52rem; }
.scope-dimension { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem .8rem; margin: 0 0 .9rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .35rem .9rem; }
.scope-dimension legend { font-weight: 600; padding: 0 .3rem; }
.scope-facts { margin-bottom: 1rem; }
.scoped-section.out-of-scope { opacity: .55; border-left: 3px solid var(--line); padding-left: .8rem; }
.scope-note { font-size: .85rem; color: var(--muted); font-style: italic; margin: -.3rem 0 .6rem; }
a.setting.decided { text-decoration-style: solid; background: color-mix(in srgb, #7fd99a 22%, transparent); }
a.setting.proposed { outline: 1px dashed #e0b252; outline-offset: 1px; }
.badge.proposed { border-color: #e0b252; color: #e0b252; }
.badge.rejected { border-color: #f07178; color: #f07178; }
:root[data-theme="light"] .badge.rejected { color: #b3261e; border-color: #b3261e; }
.setting-actions { display: inline-flex; gap: .7rem; font-size: .85rem; }
.setting-dialog { max-width: 40rem; width: 100%; }
.setting-dialog .field { margin-bottom: .7rem; }
.setting-dialog textarea, .setting-dialog select, .setting-dialog input:not([type="checkbox"]):not([type="radio"]) { width: 100%; }
.setting-dialog .field-check { align-items: flex-start; }
.setting-dialog .field-check input[type="checkbox"] { margin-top: .2rem; }
.setting-history { padding-left: 1.2rem; }
.setting-history li { margin: .3rem 0; }
:root[data-theme="light"] .badge.status-draft, :root[data-theme="light"] .open-point { color: #8a5a00; }
:root[data-theme="light"] .badge.status-approved { color: #1d7a3c; }
.library-tiles { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .6rem; }
.library-tiles .tile { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding: .7rem .9rem; font: inherit; font-size: .95rem; color: var(--text); text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.library-tiles .tile:hover, .library-tiles .tile:focus-visible { border-color: var(--accent); outline: none; }
.library-tiles .tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.library-tiles .tile b { color: var(--accent); }
.library-summary { color: var(--muted); font-size: .95rem; }
@media (min-width: 48rem) { .form.inline.library-filter { grid-template-columns: 2fr 1fr 1fr; } }
.library-table td { vertical-align: top; }
.controls-table tr.is-target td { background: var(--accent-soft); }
.library-doc { padding: 2.5rem 0 5rem; }
.library-head h1 { margin: .25rem 0 .75rem; line-height: 1.25; }
.library-head .eyebrow a { color: inherit; text-decoration: none; }
.library-badges { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 1rem; }
.library-grid { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 64rem) { .library-grid { grid-template-columns: 13rem minmax(0, 1fr) 16rem; align-items: start; } .library-toc, .library-side { position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow-y: auto; scrollbar-width: thin; } }
@media (min-width: 100rem) { .library-grid { grid-template-columns: 16rem minmax(0, 1fr) 20rem; gap: 3rem; } }
.library-label { margin: 1.25rem 0 .4rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.library-toc ol { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.library-toc li { margin: .3rem 0; }
.library-toc li.toc-3 { padding-left: .9rem; font-size: .85rem; }
.library-toc a { color: var(--muted); text-decoration: none; }
.library-toc a:hover { color: var(--text); }
.library-body { min-width: 0; }
.library-body h2 { font-size: 1.3rem; margin-top: 2.25rem; scroll-margin-top: 5rem; }
.library-body h3 { font-size: 1.05rem; margin: 1.75rem 0 .4rem; scroll-margin-top: 5rem; }
.library-body table { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: .9rem; }
@media (max-width: 48rem) { .library-body table { display: block; overflow-x: auto; } }
.library-body th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: .45rem .6rem .45rem 0; }
.library-body td { border-bottom: 1px solid var(--line); padding: .5rem .6rem .5rem 0; vertical-align: top; overflow-wrap: anywhere; }
.library-body code { font-size: .9em; }
.library-facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; font-size: .9rem; }
.library-facts dt { color: var(--muted); }
.library-facts dd { margin: 0; overflow-wrap: anywhere; }
.library-links, .library-sources { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.library-links li, .library-sources li { margin: .3rem 0; overflow-wrap: anywhere; }
.library-sources li { display: flex; justify-content: space-between; gap: .75rem; }
.library-table a, .library-links a { white-space: nowrap; }

/* Library pages use the full screen width; running text keeps a readable line length, tables use the whole column */
.wrap.wrap-wide { max-width: 150rem; padding: 0 clamp(16px, 2.5vw, 48px); }
.wrap-wide .portal-body.wide { max-width: none; }
.wrap-wide .portal-body.wide > .lead, .wrap-wide .portal-body.wide > .status { max-width: 60rem; }
.library-body > p, .library-body > ul, .library-body > ol, .library-body > blockquote { max-width: 62rem; }
.library-head .status { max-width: 62rem; }

/* Library phase 2: tabs, sources, coverage, search */
.library-tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1.5rem; border-bottom: 1px solid var(--line); }
.library-tabs a { padding: .5rem .9rem; color: var(--muted); text-decoration: none; font-size: .95rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.library-tabs a:hover { color: var(--text); }
.library-tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.portal-body .library-tabs { margin-top: -.5rem; }
.coverage { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0 0 1rem; }
.coverage div { padding: .6rem .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-width: 6.5rem; }
.coverage dt { color: var(--muted); font-size: .8rem; }
.coverage dd { margin: .15rem 0 0; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.library-table meter, .coverage meter { width: 6rem; height: .7rem; }
.link-button { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.library-source-line { margin: 0 0 1rem; }
.library-originals { list-style: none; margin: -.5rem 0 1rem; padding: 0; }
.library-originals li { margin: .2rem 0; }
.library-originals .label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-right: .3rem; }
.library-intro { margin: 0 0 1.5rem; max-width: 62rem; padding: .75rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.library-intro summary { cursor: pointer; color: var(--muted); }
.library-intro .library-body { padding-top: .5rem; }
.req-table tr.req-section th { padding-top: 1.25rem; color: var(--text); font-size: .95rem; border-bottom: 1px solid var(--line); }
.req-table tr.req-section.level-1 th { font-size: 1.05rem; }
.req-table tr.is-target td { background: var(--accent-soft); }
.req-table .planned { color: var(--muted); border-bottom: 1px dashed currentColor; }
.badge.req-covered { color: #7fd99a; border-color: currentColor; }
.badge.req-planned { color: #e0b252; border-color: currentColor; }
.badge.req-open { color: #f07178; border-color: currentColor; }
/* Yearly review (review.js): red when overdue, amber when due within 60 days */
.badge.review-overdue { color: #f07178; border-color: currentColor; font-weight: 600; }
.badge.review-due { color: #e0b252; border-color: currentColor; }
:root[data-theme="light"] .badge.review-overdue { color: #b3261e; }
:root[data-theme="light"] .badge.review-due { color: #8a5a00; }
.review-list { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.review-list li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.review-list .badge { margin-left: .35rem; }
:root[data-theme="light"] .badge.req-covered { color: #1d7a3c; }
:root[data-theme="light"] .badge.req-planned { color: #8a5a00; }
:root[data-theme="light"] .badge.req-open { color: #b3261e; }
.library-sources li a { overflow-wrap: anywhere; }
@media (min-width: 48rem) { .form.inline.library-search-form { grid-template-columns: 3fr 1fr; } }
.search-group h2 { font-size: 1.1rem; margin: 2rem 0 .5rem; }
.search-results { list-style: none; margin: 0; padding: 0; }
.search-results li { display: grid; grid-template-columns: minmax(9rem, max-content) 1fr; gap: .1rem 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.search-results li .meta { grid-column: 2; font-size: .85rem; }
.search-results li a { white-space: nowrap; }

/* PDF export through the browser's print dialog (assets/js/portal/library-print.js) */
.print-button { margin-left: auto; }
.print-only { display: none; }
@page { size: A4; margin: 16mm 15mm 18mm; }
@page {
  @bottom-left { content: "ifm.lu portal – uncontrolled copy"; font: 7.5pt sans-serif; color: #555; }
  @bottom-right { content: counter(page) " / " counter(pages); font: 7.5pt sans-serif; color: #555; }
}
@media print {
  :root, :root[data-theme="light"] {
    --bg: #fff; --bg-alt: #fff; --surface: #fff; --text: #111; --muted: #444; --line: #bbb;
    --accent: #0b4f94; --accent-soft: #eef3f9;
  }
  html, body { background: #fff !important; color: #111; font-size: 9.5pt; line-height: 1.45; }
  .site-header, .site-footer, .skip, .portal-bar, .library-tabs, .library-toc, .library-side, .print-button,
  .library-filter, [data-library-count], [data-doc-note], .library-intro, .eyebrow, .to-top, .tenant-banner, .library-originals { display: none !important; }
  .wrap, .wrap.wrap-wide { max-width: none; padding: 0; }
  .library-doc { padding: 0; }
  .library-grid { display: block; }
  .library-head h1 { font-size: 18pt; margin: 0 0 .3rem; }
  .library-badges .badge { border-color: #999; color: #111; }
  .status { border: 1px solid #999; border-left-width: 3pt; padding: .4rem .6rem; }
  .status::before { display: none; }
  .print-only { display: block; }
  /* Cover page of a document: all document data, print note and copyright; the text starts on page 2 */
  .print-cover { min-height: 228mm; display: flex; flex-direction: column; break-after: page; }
  .print-cover .cover-brand { font-size: 12pt; font-weight: 700; margin: 0 0 8mm; }
  .print-cover .cover-brand b { color: var(--accent); font-weight: inherit; }
  .print-cover .cover-type { margin: 0 0 3mm; color: #444; font-size: 10pt; text-transform: uppercase; letter-spacing: .06em; }
  .print-cover .cover-title { font-size: 22pt; line-height: 1.2; margin: 0 0 3mm; }
  .print-cover .cover-id { margin: 0 0 8mm; font-size: 11pt; }
  .cover-facts { display: grid; grid-template-columns: 34mm 1fr; gap: 1.4mm 6mm; margin: 0 0 6mm; font-size: 9pt; }
  .cover-facts dt { color: #444; }
  .cover-facts dd { margin: 0; overflow-wrap: anywhere; }
  .cover-note { margin: auto 0 3mm; padding-top: 3mm; border-top: 1px solid #bbb; font-size: 8.5pt; break-inside: avoid; break-after: avoid; }
  .cover-copyright { margin: 0; font-size: 7.5pt; color: #444; break-inside: avoid; }
  /* new page before the planned controls, the change log and the annex */
  .library-body :is(h2, h3):is([id$="planned-controls"], [id^="planned-controls"], #change-log) { break-before: page; }
  .print-annex { break-before: page; font-size: 9pt; }
  .print-annex h2 { font-size: 13pt; break-after: avoid; }
  .print-annex li { break-inside: avoid; }
  .has-cover > .library-head { display: none !important; }
  .library-body > p, .library-body > ul, .library-body > ol { max-width: none; }
  .library-body h2 { font-size: 13pt; margin-top: 1.2rem; break-after: avoid; }
  .library-body h3 { font-size: 11pt; break-after: avoid; }
  .library-body table, .library-table { font-size: 8pt; display: table; overflow: visible; }
  .library-body tr, .library-table tr { break-inside: avoid; }
  .library-body thead, .library-table thead { display: table-header-group; }
  .library-body th, .library-body td, .library-table th, .library-table td { border-bottom: 1px solid #ccc; padding: 2pt 4pt 2pt 0; }
  .library-table tr[hidden] { display: none; }
  a { color: #111; text-decoration: none; }
  .open-point { color: #8a5a00; }
  .coverage div { border: 1px solid #999; }
  meter { display: none; }
}
