/* Linknor Hilfe – Gestaltung nach dem Relaunch-Entwurf „Protokoll“:
   ruhige Lesespalte, Mono für Metadaten, eine Akzentfarbe (der orange Punkt). */
:root {
  --paper: #fbfcfd;
  --paper-2: #eef2f7;
  --ink: #0c1f3a;
  --ink-2: #4b5b73;
  --line: #d6dde7;
  --signal: #ea7a12;
  --signal-text: #b45607;
  --device: #18233a;
  --mark: #fde7cf;
  --ipad: #2f6feb;
  --logo-ring: transparent;
  --show-light: block;
  --show-dark: none;
  --font-display: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wrap: 84rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --top: 4rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #07142a; --paper-2: #0d1d38; --ink: #e8edf5; --ink-2: #9dabc1; --line: #213452;
    --signal: #f28a2a; --signal-text: #f6a457; --device: #2a3b5a; --mark: #4a2c10; --ipad: #7aa5ff; --logo-ring: rgba(232, 237, 245, .16);
    --show-light: none; --show-dark: block; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #07142a; --paper-2: #0d1d38; --ink: #e8edf5; --ink-2: #9dabc1; --line: #213452;
  --signal: #f28a2a; --signal-text: #f6a457; --device: #2a3b5a; --mark: #4a2c10; --ipad: #7aa5ff; --logo-ring: rgba(232, 237, 245, .16);
  --show-light: none; --show-dark: block; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 1rem); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
p { margin: 0; }
.mono { font-family: var(--font-mono); font-size: 0.8125rem; }
.muted { color: var(--ink-2); }
.l { display: var(--show-light); }
.d { display: var(--show-dark); }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 99; background: var(--ink); color: var(--paper); padding: .5rem .8rem; border-radius: .4rem; }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }

/* Kopf ------------------------------------------------------------ */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top .wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); display: flex; align-items: center; gap: 1rem; height: var(--top); }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; white-space: nowrap; }
.brand img { width: 1.9rem; height: 1.9rem; border-radius: .45rem; box-shadow: 0 0 0 1px var(--logo-ring); }
.brand .mono { font-weight: 500; color: var(--ink-2); font-size: .8125rem; padding-left: .55rem; border-left: 1px solid var(--line); }
.brand a { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; }
.brand a.mono:hover, .brand a.mono[aria-current] { color: var(--ink); }
.brand a:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 3px; border-radius: .3rem; }
.tools { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.search { position: relative; flex: 1 1 22rem; max-width: 30rem; margin-left: 1.5rem; }
.search input { width: 100%; font: inherit; font-size: .9375rem; color: var(--ink); background: var(--paper-2); border: 1px solid var(--line); border-radius: .6rem; padding: .55rem .8rem .55rem 2.2rem; }
.search input::placeholder { color: var(--ink-2); }
.search svg { position: absolute; left: .7rem; top: 50%; width: 1rem; height: 1rem; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.search input:not(:placeholder-shown) ~ kbd { display: none; }
.search kbd { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: .75rem; color: var(--ink-2); border: 1px solid var(--line); border-radius: .3rem; padding: 0 .35rem; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + .4rem); max-height: min(70vh, 34rem); overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: .75rem; box-shadow: 0 18px 40px -16px rgba(0,0,0,.35); padding: .35rem; display: none; }
.results.is-open { display: block; }
.results a { display: block; padding: .6rem .7rem; border-radius: .5rem; text-decoration: none; }
.results a[aria-selected="true"], .results a:hover { background: var(--paper-2); }
.results .r-path, .results .r-title, .results .r-snip { display: block; }
.results .r-path { font-family: var(--font-mono); font-size: .75rem; color: var(--ink-2); }
.results .r-title { font-weight: 600; }
.results .r-snip { font-size: .875rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.results .r-empty { padding: .8rem; color: var(--ink-2); font-size: .9375rem; }
.lang { position: relative; }
.lang summary { list-style: none; cursor: pointer; font-family: var(--font-mono); font-size: .8125rem; padding: .4rem .6rem; border: 1px solid var(--line); border-radius: .5rem; }
.lang summary::-webkit-details-marker { display: none; }
.lang ul { position: absolute; right: 0; top: calc(100% + .4rem); margin: 0; padding: .35rem; list-style: none; background: var(--paper); border: 1px solid var(--line); border-radius: .6rem; min-width: 10rem; box-shadow: 0 12px 30px -12px rgba(0,0,0,.25); }
.lang li a { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem .6rem; border-radius: .4rem; text-decoration: none; font-size: .9rem; }
.lang li a:hover, .lang li a[aria-current] { background: var(--paper-2); }
.lang li a span { font-family: var(--font-mono); font-size: .75rem; color: var(--ink-2); }
.icon-btn { width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border: 1px solid var(--line); border-radius: .5rem; background: transparent; color: var(--ink); cursor: pointer; flex: none; }
.icon-btn svg { width: 1.05rem; height: 1.05rem; }
.menu-btn { display: none; }

/* Gerüst ---------------------------------------------------------- */
.layout { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); display: grid; grid-template-columns: 15.5rem minmax(0, 1fr) 13rem; gap: clamp(1.5rem, 3vw, 3rem); }
.side { position: sticky; top: var(--top); align-self: start; max-height: calc(100vh - var(--top)); overflow: auto; padding-block: 2rem 3rem; }
.side h4 { margin: 1.4rem 0 .5rem; font-family: var(--font-mono); font-size: .75rem; font-weight: 500; color: var(--ink-2); text-transform: none; }
.side h4:first-child { margin-top: 0; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: flex; align-items: center; gap: .55rem; padding: .32rem .5rem .32rem 0; text-decoration: none; font-size: .9375rem; color: var(--ink-2); border-radius: .35rem; }
.side li a::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; flex: none; border: 1.5px solid var(--line); }
.side li a:hover { color: var(--ink); }
.side li a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.side li a[aria-current="page"]::before { background: var(--signal); border-color: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 20%, transparent); }
.side .home-link { display: inline-flex; margin-bottom: 1.2rem; font-family: var(--font-mono); font-size: .8125rem; color: var(--ink-2); text-decoration: none; }
.side .home-link:hover { color: var(--ink); }
main { padding-block: 2.25rem 5rem; min-width: 0; }
.toc { position: sticky; top: var(--top); align-self: start; padding-block: 2.25rem; max-height: calc(100vh - var(--top)); overflow: auto; }
.toc h4 { margin: 0 0 .6rem; font-family: var(--font-mono); font-size: .75rem; font-weight: 500; color: var(--ink-2); }
.toc ol { list-style: none; margin: 0; padding: 0 0 0 .8rem; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: .22rem 0; text-decoration: none; font-size: .875rem; color: var(--ink-2); }
.toc li a:hover, .toc li a.is-active { color: var(--ink); }
.toc li a.is-active { font-weight: 600; }

/* Seite ------------------------------------------------------------ */
.crumb { display: flex; align-items: center; gap: .6rem; color: var(--ink-2); margin-bottom: 1rem; }
.crumb .dot, .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--signal); flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 18%, transparent); }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.02; letter-spacing: -.03em; font-weight: 700; }
.page-head .lead { margin-top: 1rem; font-size: clamp(1.1rem, 1.5vw, 1.25rem); color: var(--ink-2); max-width: 44rem; }
.sec { padding-top: 2.5rem; margin-top: 2.5rem; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--top) + 1rem); }
.sec:first-of-type { border-top: 2px solid var(--ink); }
.sec h2 { display: flex; align-items: baseline; gap: .6rem; font-size: clamp(1.45rem, 2.4vw, 1.85rem); line-height: 1.15; letter-spacing: -.02em; font-weight: 650; }
.sec h2 .anchor { font-family: var(--font-mono); font-size: .8125rem; font-weight: 400; color: var(--ink-2); text-decoration: none; opacity: 0; transition: opacity .15s; }
.sec:hover h2 .anchor, .sec h2 .anchor:focus { opacity: 1; }
.sec.is-target { animation: flash 2.2s ease-out 1; }
@keyframes flash { 0% { background: color-mix(in srgb, var(--signal) 14%, transparent); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .sec.is-target { animation: none; } }
.body { margin-top: 1rem; max-width: 44rem; }
.body p + p { margin-top: .8rem; }
.body p, .body li { color: var(--ink); }
.body strong { font-weight: 600; }
.steps { list-style: none; counter-reset: s; margin: 1.25rem 0 0; padding: 0; }
.steps-head { margin-top: 1.25rem; font-family: var(--font-mono); font-size: .75rem; color: var(--ink-2); }
.steps-head + .steps { margin-top: .5rem; }
.steps li { counter-increment: s; position: relative; padding: .35rem 0 .35rem 2.4rem; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: .35rem; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; font-family: var(--font-mono); font-size: .8125rem; border: 1.5px solid var(--ink); border-radius: 50%; }
.points { margin: 1rem 0 0; padding: 0; list-style: none; }
.points li { display: flex; gap: .7rem; padding: .25rem 0; }
.points li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-2); margin-top: .65em; flex: none; }
.callout { margin-top: 1.25rem; padding: .9rem 1.1rem; border-radius: .7rem; background: var(--paper-2); border-left: 3px solid var(--ink-2); max-width: 44rem; }
.callout .k { display: block; font-family: var(--font-mono); font-size: .75rem; color: var(--ink-2); margin-bottom: .2rem; }
.callout.tip { border-left-color: var(--signal); }
.callout.tip .k { color: var(--signal-text); }

/* Screenshots ----------------------------------------------------- */
.shots { margin-top: 1.75rem; display: flex; gap: clamp(1rem, 2.5vw, 1.75rem); overflow-x: auto; padding: .25rem .25rem 1rem; scroll-snap-type: x proximity; scrollbar-width: thin; }
.shot { margin: 0; flex: 0 0 auto; width: clamp(10.5rem, 22vw, 13.5rem); scroll-snap-align: start; }
.shot.crop { width: min(100%, 26rem); }
.device { position: relative; width: 100%; aspect-ratio: 1320 / 2868; border-radius: 15% / 7%; padding: 3.2%; background: var(--device); box-shadow: 0 24px 50px -30px rgba(12, 31, 58, .55); cursor: zoom-in; display: block; border: 0; }
.device .screen { display: block; position: relative; width: 100%; height: 100%; border-radius: 12.5% / 5.8%; overflow: hidden; background: var(--paper-2); }
.device .screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.crop-frame img { width: 100%; height: auto; }
.crop-frame { display: block; width: 100%; border: 1px solid var(--line); border-radius: .9rem; overflow: hidden; cursor: zoom-in; padding: 0; background: var(--paper-2); }
.shot figcaption { margin-top: .75rem; font-size: .8125rem; line-height: 1.45; color: var(--ink-2); }
.shot figcaption .lang-tag { font-family: var(--font-mono); font-size: .6875rem; border: 1px solid var(--line); border-radius: .25rem; padding: 0 .25rem; margin-right: .35rem; }
.shot.mac { width: min(100%, 40rem); }
.shot.mac.tall { width: min(100%, 22rem); }
.shots:has(> .shot.mac + .shot.mac) .shot.mac:not(.tall) { width: min(88%, 40rem); }
.mac-frame { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.mac-frame img { width: 100%; height: auto; }
.shot.ipad { width: min(100%, 44rem); }
.shot.ipad.tall { width: min(100%, 22rem); }
.shots:has(> .shot.ipad + .shot.ipad) .shot.ipad:not(.tall) { width: min(88%, 44rem); }
.device.ipad { aspect-ratio: 2752 / 2064; border-radius: 3.6% / 4.8%; padding: 1.4%; }
.device.ipad .screen { border-radius: 2.4% / 3.2%; }
.shot.ipad.tall .device.ipad { aspect-ratio: 2064 / 2752; border-radius: 4.8% / 3.6%; padding: 1.9%; }
.shot.ipad.tall .device.ipad .screen { border-radius: 3.2% / 2.4%; }
.no-shot { margin-top: 1.25rem; font-family: var(--font-mono); font-size: .8125rem; color: var(--ink-2); }

/* iPhone/iPad/Mac ------------------------------------------------- */
html:not([data-dev="mac"]) .dev-mac { display: none; }
html:not([data-dev="ipad"]) .dev-ipad { display: none; }
html[data-dev="mac"] .dev-iphone.no-mac { display: none; }
html[data-dev="ipad"] .dev-iphone.no-ipad { display: none; }
.dev-switch { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; margin-top: 1.5rem; }
.dev-switch .k { font-family: var(--font-mono); font-size: .75rem; color: var(--ink-2); margin-right: .45rem; }
.dev-switch button { display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-size: .8125rem; color: var(--ink-2); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem .2rem .55rem; cursor: pointer; }
.dev-switch button svg { width: .95rem; height: .95rem; }
.dev-switch button:hover { color: var(--ink); }
.dev-switch button[aria-pressed="true"] { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.page-head .dev-switch { margin-top: 1.25rem; }
.dev-mac .callout { margin-top: 1rem; }
.callout.mac { border-left-color: var(--ink); }
.callout.mac .k { color: var(--ink); }
.dev-ipad .callout { margin-top: 1rem; }
.callout.ipad { border-left-color: var(--ipad); }
.callout.ipad .k { color: var(--ipad); }

/* Seitenwechsel --------------------------------------------------- */
.pager { margin-top: 4rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; border-top: 2px solid var(--ink); padding-top: 1.25rem; }
.pager a { text-decoration: none; display: block; padding: .6rem 0; }
.pager a:last-child { text-align: right; }
.pager .k { display: block; font-family: var(--font-mono); font-size: .75rem; color: var(--ink-2); }
.pager .t { font-weight: 600; }
.pager a:hover .t { text-decoration: underline; text-underline-offset: 3px; }

/* Startseite ------------------------------------------------------ */
.home { max-width: var(--wrap); margin-inline: auto; padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) 5rem; }
.home h1 { font-size: clamp(2.6rem, 6.5vw, 4.8rem); line-height: .98; letter-spacing: -.035em; font-weight: 700; max-width: 16ch; }
.home .lead { margin-top: 1.25rem; font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--ink-2); max-width: 40rem; }
.home .start { margin-top: 1.5rem; display: inline-flex; gap: .6rem; align-items: center; color: var(--ink-2); }
.home .start a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.home .search { margin: 2rem 0 0; max-width: 36rem; }
.home .search input { padding-block: .8rem; font-size: 1.0625rem; }
.groups { margin-top: clamp(3rem, 6vw, 4.5rem); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(1.5rem, 4vw, 3rem); }
.group { border-top: 2px solid var(--ink); padding-block: 1.1rem 2.25rem; }
.group h2 { font-family: var(--font-mono); font-size: .8125rem; font-weight: 500; color: var(--ink-2); margin-bottom: .6rem; }
.group ul { list-style: none; margin: 0; padding: 0; }
.group li a { display: block; padding: .7rem 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.group li a b { display: block; font-weight: 600; font-size: 1.0625rem; }
.group li a span { display: block; color: var(--ink-2); font-size: .9375rem; line-height: 1.45; margin-top: .15rem; }
.group li a:hover b { text-decoration: underline; text-underline-offset: 3px; }

/* Fuß -------------------------------------------------------------- */
footer { border-top: 1px solid var(--line); }
footer .wrap { max-width: var(--wrap); margin-inline: auto; padding: 2rem var(--gutter) 2.5rem; display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; color: var(--ink-2); font-size: .9375rem; }
footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
footer a { text-decoration: none; color: var(--ink); }
footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Bildbetrachter --------------------------------------------------- */
dialog.viewer { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; }
dialog.viewer::backdrop { background: rgba(4, 10, 22, .82); }
dialog.viewer img { max-height: 92vh; max-width: 94vw; width: auto; border-radius: 1.2rem; }
dialog.viewer button { position: fixed; right: 1rem; top: 1rem; }
dialog.viewer .icon-btn { background: var(--paper); }

/* Einbettung in die App (?embed=1) -------------------------------- */
html.embed .top .lang, html.embed .side, html.embed .toc, html.embed footer, html.embed .menu-btn, html.embed .pager { display: none !important; }
html.embed .layout { grid-template-columns: minmax(0, 1fr); }
html.embed .brand .mono { display: none; }

/* Responsiv -------------------------------------------------------- */
@media (max-width: 80rem) {
  .layout { grid-template-columns: 15rem minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 56rem) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: grid; }
  .side { display: none; position: fixed; inset: var(--top) 0 0 0; max-height: none; z-index: 25; background: var(--paper); padding: 1.5rem var(--gutter) 4rem; }
  .side.is-open { display: block; }
  .top .search { margin-left: .5rem; }
  .top .search kbd { display: none; }
  .groups { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 36rem) {
  .brand .mono, .brand .txt { display: none; }
  .top .wrap { gap: .5rem; }
  .shot { width: 11rem; }
  .pager { grid-template-columns: 1fr; }
  .pager a:last-child { text-align: left; }
}
