/*
 * B-107: the page on narrow windows (research, not product code). The owner approved the
 * wireframes in ../wireframes/b107-mobil.html; the order of the work is ../B107-BAUPLAN.md.
 * Phone (S) below 768 px, tablet (M) up to 1279 px - the system's md and xl breakpoints;
 * from 1280 px the page is what entwurf.css draws. Loaded last, so it only overrides.
 */

/* overflow: clip came with Safari 16; below it the aurora would widen the page. */
.e-hero { overflow: hidden; overflow: clip; }

/* Chromium scrolls the page back about 330 px when something in the sticky header gets
   focus, because the scroll padding seems to cover it (WebKit and Firefox do not). A
   negative margin larger than the padding cancels that, at every width. WebKit does the
   same for the menu sheet, which is fixed at the top too. */
.e-nav *, .e-sheet, .e-sheet * { scroll-margin-top: -100px; }

/* The chosen brand's note, under the brand row on a phone (entwurf.js fills it). */
.e-wall__note { display: none; }

/* Phone-only parts of the header, the mockup, the builder and the footer; shown below 768 px. */
.e-menubtn, .e-nav__where, .e-foot__fb, .e-live__steps, .e-back, .e-crm__pick, .e-build__open, .e-opt__chosen { display: none; }
.e-opt__chosen { margin-inline-start: auto; font-weight: var(--sw-font-weight-medium); color: var(--sw-color-text-primary); }
.e-back {
  place-items: center; width: 40px; height: 40px; flex: none; padding: 0; margin-inline-start: -8px;
  border: 0; border-radius: var(--sw-radius-full); background: none; cursor: pointer;
  color: var(--sw-color-text-primary); font-size: 20px;
}
[dir="rtl"] .e-back .sw-icon { transform: scaleX(-1); }
.e-menubtn {
  align-items: center; gap: 6px; height: 44px; padding: 0 14px; flex: none;
  border: 0; border-radius: var(--sw-radius-full); cursor: pointer;
  background: var(--e-quiet-track); color: var(--sw-color-text-primary);
  font: inherit; font-size: 14px; font-weight: var(--sw-font-weight-semibold);
}
.e-nav__where { min-width: 0; font-size: 15px; font-weight: var(--sw-font-weight-semibold); white-space: nowrap; }

/* A tab row that scrolls sideways fades out where more tabs wait (entwurf.js measures). */
.e-outputs [role="tablist"][data-fade="right"] { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.e-outputs [role="tablist"][data-fade="left"] { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
.e-outputs [role="tablist"][data-fade="both"] { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }

/* Below 72rem the chain stacks (entwurf.css); the result then needs no height of its own
   to centre the button in, which left an empty field above it. */
@media (max-width: 72rem) {
  .e-chain__result { grid-template-rows: auto auto; min-block-size: 0; padding-block: var(--sw-space-2); }
  .e-chain__button-slot { grid-row: 1; }
  .e-chain__result-note { grid-row: 2; }
}

/*
 * The menu sheet (wireframe N-A): a modal <dialog> from the top. Its head repeats the
 * header, with ✕ Schließen where ☰ Menü was; below it the anchors, then language,
 * colour scheme and motion, then feedback. Taller than the window, it scrolls in itself.
 */
.e-sheet {
  position: fixed; inset: 0 0 auto; width: 100%; max-width: none; height: auto;
  max-height: 100vh; max-height: 100dvh; margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--sw-color-text-primary); overflow: visible;
}
.e-sheet::backdrop { background: rgb(0 0 0 / 0.42); }
.e-sheet__in {
  box-sizing: border-box; max-height: 100vh; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 16px 16px; border-radius: 0 0 20px 20px;
  background: var(--sw-color-surface-page);
  box-shadow: 0 18px 40px -16px rgb(0 0 0 / 0.35);
}
.e-sheet__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; height: 56px; background: inherit; }
.e-sheet__head .e-menubtn { display: inline-flex; margin-inline-start: auto; }
.e-sheet__head .e-nav__where { display: block; }
.e-sheet__mark { --m: 24px; --g: calc(var(--m) * 0.105573); --c: calc((var(--m) - var(--g)) / 2); display: flex; flex: none; }
.e-sheet__nav { display: flex; flex-direction: column; gap: 2px; padding-block: 8px; border-block: 1px solid var(--e-line); }
.e-sheet__nav a {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 12px;
  color: var(--sw-color-text-primary); text-decoration: none; font-size: 16px; font-weight: var(--sw-font-weight-medium);
}
.e-sheet__nav a[aria-current="true"] { background: var(--e-quiet-track); font-weight: var(--sw-font-weight-semibold); }
.e-sheet__set { display: grid; gap: 8px; padding-block: 12px; border-block-end: 1px solid var(--e-line); }
/* One row per setting: the name on the left, the switch on the right. */
.e-sheet .e-opt { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.e-sheet .e-opt .e-qseg--wide { width: auto; flex: 0 1 200px; }
.e-sheet .e-qseg button, .e-sheet .e-qseg a { flex: 1 1 0; height: 40px; padding: 0 8px; font-size: 14px; }
.e-sheet__fb {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin-block-start: 8px; padding: 0 12px;
  border: 0; border-radius: 12px; background: none; cursor: pointer;
  color: var(--sw-color-text-primary); font: inherit; font-size: 16px; text-align: start;
}
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-e-motion="still"]) .e-sheet[open] .e-sheet__in { animation: e-sheet-down 0.24s var(--sw-motion-easing-decelerate); }
}
@keyframes e-sheet-down { from { transform: translateY(-24px); opacity: 0; } }

@media (max-width: 767.98px) {
  /* The desktop draft fixes the page at 1200 px. Phones lose that now; tablets keep it
     until step 8 of the plan gives them their layout. */
  body { min-width: 0; }
  .e-wrap, .e-nav__in { width: calc(100% - 32px); }
  .e-section__head--row { flex-direction: column; align-items: flex-start; gap: 16px; }
  /* Hero and closing: the two buttons stack at full width. */
  .e-cta { flex-direction: column; align-items: stretch; }
  /* The headline stays two lines (B-117): headline.js draws only word pairs that fit the
     width, and at 84 px none does. 36 px at 320 px leaves 72 and 53 pairs per line in
     German; rem plus vw follows zoom, and 54 px over 36 px keeps D-160's ratio of 1.5. */
  .e-hero { padding-block: 40px; }
  .e-h1 { margin-top: 18px; font-size: calc(clamp(2.25rem, 1.25rem + 5vw, 3.375rem) * var(--e-head-scale, 1)); }
  /* "Legible" draws in Atkinson Hyperlegible Next (B-104), wider than Inter: at 36 px the
     two lines break into three or four in all three engines, at 28 px they stay two. */
  :root[data-e-font="legible"] .e-h1 { --e-head-scale: 0.78; }

  /*
   * The configurator (wireframe K-A): never docked on a phone. Open, it is a sheet from
   * the bottom, about half the window, without dimming the page, which stays light and
   * scrollable above it. "Alle Optionen" makes it nearly full height; the list scrolls
   * inside. In the builder a button opens it. "Breite" does nothing on a phone.
   */
  .e-nav .e-iconbtn { width: 44px; height: 44px; }
  .e-build__open { display: inline-flex; width: 100%; justify-content: center; }
  /* On the desktop the page keeps 336 px free for the floating panel; the sheet needs none. */
  :root[data-config-open] { --e-gutter: 0px; }
  .e-config[data-mode="float"], .e-config[data-mode="hidden"] {
    inset: auto 0 0; width: 100%; max-height: 56vh; max-height: 56dvh;
    padding-block-end: env(safe-area-inset-bottom, 0px);
    border-width: 1px 0 0; border-radius: 20px 20px 0 0;
    box-shadow: 0 -12px 32px -12px rgb(0 0 0 / 0.28);
  }
  .e-config[data-mode="hidden"] { transform: translateY(24px); }
  .e-config[data-more] { max-height: 88vh; max-height: 88dvh; }
  .e-config .e-opt--layout { display: none; }
  .e-config__body { gap: 14px; padding: 12px 16px; }
  .e-opt__chosen { display: inline; }
  .e-config__foot { padding: 10px 16px 12px; }
  /* Five skins in one row: name and level, the note and the tick stay on the desktop. */
  .e-skinlist { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .e-skinbtn { grid-template-columns: minmax(0, 1fr); justify-items: center; row-gap: 2px; padding: 6px 2px; text-align: center; }
  .e-skinbtn span { font-size: 13px; }
  .e-skinbtn em { grid-row: auto; grid-column: auto; }
  .e-skinbtn small, .e-skinbtn .sw-icon { display: none; }

  /* Header (wireframe N-A): logo, then ☰ Menü; anchors and tools move into the sheet. */
  :root { scroll-padding-top: 68px; --e-sec-pad: 56px; }
  .e-section__head { margin-bottom: 28px; }
  /* Content heights measured at 360 to 390 px, for content-visibility (entwurf.css). */
  #vorteile { --e-sec-h: 2787px; }
  #templates { --e-sec-h: 887px; }
  #barrierefreiheit { --e-sec-h: 2987px; }
  #grundlagen { --e-sec-h: 5457px; }
  .e-close { --e-sec-h: 236px; }
  .e-nav { height: 56px; }
  .e-nav__in { gap: 8px; }
  .e-logo { min-width: 0; }
  .e-nav__links, .e-nav__tools > :not(.e-menubtn, [data-config-toggle]) { display: none; }
  /* With the links gone nothing else fills the row: the two buttons hold the end edge, and
     the logo's cuts and the section name beside the mark no longer move them (B-174). */
  .e-nav__tools { margin-inline-start: auto; }
  .e-menubtn { display: inline-flex; }
  /* Below the hero the section in view stands beside the mark, in place of the word. */
  .e-nav[data-where] .e-logo__word { display: none; }
  .e-nav[data-where] > .e-nav__in > .e-nav__where { display: block; }
  /* Measured, not by language (entwurf.js): first the word mark shortens, then ☰ loses its word. */
  .e-nav[data-tight] .e-logo__word span { display: none; }
  .e-nav[data-tight="2"] .e-nav__tools .e-menubtn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

  /* Feedback: no tab on the edge; menu and footer open the panel above the bottom edge. */
  .e-fb__tab { display: none; }
  .e-fb__panel { position: fixed; inset: auto 16px calc(16px + env(safe-area-inset-bottom, 0px)); width: auto; }
  /* "Feedback geben" is a tertiary button like the three legal ones (build.mjs). The list
     gives its items to the footer row, so the four stand two by two under the copyright. */
  .e-foot__fb { display: inline-flex; }
  .e-foot__in { justify-content: flex-start; column-gap: 4px; }
  .e-foot__in > span:first-child { flex-basis: 100%; }
  .e-foot__legal { display: contents; }

  /*
   * The mockup (wireframe M-A): a fixed frame as tall as a phone screen, without the
   * browser bar and without scrolling inside, so a swipe always scrolls the page and a
   * scene change never moves it. All seven scene chips stay visible in rows. Below the
   * frame the live example's name and ‹ › (the page's data-step buttons).
   */
  .e-show { width: calc(100% - 32px); margin-top: 32px; }
  .e-seg--scenes { width: auto; margin: 0 0 12px; }
  .e-seg--scenes .sw-tabs__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0; background: none; }
  .e-seg--scenes .e-seg__ind { display: none; }
  .e-seg--scenes .sw-tabs__tab { min-block-size: 36px; padding-inline: 12px; background: var(--e-quiet-track); }
  .e-seg--scenes .sw-tabs__tab .sw-icon { display: none; }
  .e-seg--scenes .sw-tabs__tab[data-selected] { background: var(--e-quiet-on); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 0 0 1px rgb(0 0 0 / 0.03); }
  .e-frame { padding: 0; border-radius: 24px; }
  .e-frame__dots { display: none; }
  .e-frame__app { height: 480px; border-radius: 24px; }
  /* The screen goes on below the frame: a soft end instead of a hard cut. */
  .e-frame__app::after {
    content: ""; position: absolute; z-index: 2; inset: auto 0 0; height: 28px; pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--sw-color-surface-page));
  }
  .e-frame__scene { overflow: hidden; }
  .e-under { flex-wrap: wrap; gap: 8px 12px; margin-top: 14px; }
  .e-live { display: none; }
  .e-live__now { flex: 1; min-width: 0; }
  .e-live__steps { display: flex; gap: 8px; }

  /* The scenes, one phone screen each. What does not fit the frame is left out. */
  .e-frame .e-scene { padding: 14px; }
  .e-back { display: grid; }
  .e-frame .e-app__title { font-size: 17px; }
  /* Dashboard: no sidebar; greeting, search and bell; tabs and month; four figures in two
     rows; revenue and channels. Table and week chart lie below the frame and are left out. */
  .e-dash__side, .e-dash__collapse, .e-dash__grid--b { display: none; }
  .e-dash__main { padding: 14px; gap: 12px; overflow: hidden; }
  .e-dash__head { align-items: flex-start; gap: 8px; }
  .e-dash__head .e-row .sw-button:not([data-icon-only]) { display: none; }
  .e-dash__bar { flex-wrap: wrap; }
  .e-dash__bar .e-refresh, .e-dash__bar .e-row > e-island:last-child { display: none; }
  .e-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .e-kpi { padding: 12px; }
  .e-kpi .sw-stat__value { font-size: 20px; }
  .e-kpi .sw-stat__trend { position: static; justify-self: start; align-self: start; }
  .e-dash__grid { grid-template-columns: minmax(0, 1fr); }
  /* Mail: the list fills the screen; a message opens in its place, ← goes back. */
  .e-app > .e-app__side:not(.e-chat__side), .e-mail__read { display: none; }
  .e-mail__list { width: auto; flex: 1; padding: 14px; border: 0; overflow: hidden; }
  .e-app[data-view="read"] .e-mail__list { display: none; }
  .e-app[data-view="read"] .e-mail__read { display: flex; padding: 14px; overflow: hidden; }
  /* A read message is white to the frame's edges; the list keeps its grey (owner, B-154). The
     sender keeps its line: beside it only "More" stays, as in the chat, and star and bin wait
     in that menu. */
  .e-frame .e-scene.e-app[data-view="read"] { padding: 0; }
  .e-mail__head > div:not(.e-row) { flex: 1; min-width: 0; }
  .e-mail__read .e-mail__head .e-row .sw-button:not(:last-child) { display: none; }
  /* Chat: the conversation fills the screen; ← shows the conversations. */
  .e-chat__side { display: none; }
  .e-chat__main > .e-mail__head { padding: 8px 14px; }
  .e-chat__main .e-stack, .e-chat__main > .e-mail__head .e-row .sw-button:last-child { display: none; }
  .e-chat__msgs { padding: 14px; overflow: hidden; }
  .e-chat__input { padding: 10px 14px 12px; }
  .e-chat__send--text { display: none; }
  .e-app[data-view="list"] .e-chat__side { display: flex; flex: 1; width: auto; border: 0; }
  .e-app[data-view="list"] .e-chat__main { display: none; }
  /* Finance: balance and bookings; "Überweisen" opens the transfer in their place. The
     bookings drop the purpose column. */
  .e-fin { grid-template-columns: minmax(0, 1fr); }
  .e-fin__transfer, .e-fin__book :is(th, td):nth-child(2) { display: none; }
  .e-fin[data-view="transfer"] .e-fin__col { display: none; }
  .e-fin[data-view="transfer"] .e-fin__transfer { display: block; }
  .e-fin__transfer .e-card__head .e-back { order: -1; }
  .e-fin__stat .sw-stat__value { font-size: 28px; }
  .e-fin__row .e-spark { display: none; }
  /* The three account actions share one row, without their icons. */
  .e-fin__balance .e-row e-island { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: 100%; }
  .e-fin__balance .e-row .sw-button { min-inline-size: 0; padding-inline: 4px; font-size: 12px; }
  .e-fin__balance .e-row .sw-button__icon { display: none; }
  /* CRM: one column at a time, chosen above the board. Above it the search as an icon,
     the team filter and "Chance" as a plus (B-155). */
  .e-crm .e-app__bar .e-row { display: flex; align-items: center; gap: 4px; inline-size: 100%; }
  .e-crm__search { display: none; }
  .e-crm__new { margin-inline-start: auto; aspect-ratio: 1; min-inline-size: 0; padding-inline: 0; }
  .e-crm__new .sw-button__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  /*
   * B-153 to B-155: the sidebar of dashboard and mail and the CRM's search lie over the
   * scene, inside the frame, the rest dimmed with the system's scrim (entwurf.js opens and
   * closes them). Their buttons stand before the greeting, the search and the team filter.
   */
  .e-overlay-open { display: inline-flex; flex: none; }
  .e-dash__title .e-overlay-open { margin-block-start: -4px; margin-inline-start: -8px; }
  .e-mail__search { display: flex; align-items: center; gap: 4px; }
  .e-mail__search .sw-field { flex: 1; min-inline-size: 0; }
  .e-frame :is(.e-dash, .e-mail, .e-crm) { position: relative; }
  :root[data-e-overlay="e-dash-side"] .e-frame .e-dash .e-dash__side,
  :root[data-e-overlay="e-mail-side"] .e-frame .e-mail #e-mail-side {
    display: flex; position: absolute; z-index: 4; inset-block: 0; inset-inline-start: 0; inline-size: 78%;
    padding: 14px 12px; overflow: auto; border-inline-end: 0; box-shadow: var(--sw-skin-shadow-overlay);
  }
  :root[data-e-overlay="e-crm-search"] .e-frame .e-crm__search {
    display: flex; align-items: center; gap: 8px; position: absolute; z-index: 4; inset-inline: 0; inset-block-start: 0;
    padding: 14px; background: var(--sw-color-surface-raised); box-shadow: var(--sw-skin-shadow-overlay);
  }
  .e-crm__search .sw-field { flex: 1; min-inline-size: 0; }
  .e-crm__search .e-overlay-close { display: inline-flex; flex: none; }
  :root[data-e-overlay="e-dash-side"] .e-frame .e-dash::after,
  :root[data-e-overlay="e-mail-side"] .e-frame .e-mail::after,
  :root[data-e-overlay="e-crm-search"] .e-frame .e-crm::after {
    content: ""; position: absolute; z-index: 3; inset: 0; background: var(--sw-color-scrim); opacity: var(--sw-scrim-opacity);
  }
  @media (prefers-reduced-motion: no-preference) {
    :root:not([data-e-motion="still"])[data-e-overlay="e-dash-side"] .e-frame .e-dash .e-dash__side,
    :root:not([data-e-motion="still"])[data-e-overlay="e-mail-side"] .e-frame .e-mail #e-mail-side { animation: e-overlay-in var(--sw-motion-duration-fast) var(--sw-motion-easing-decelerate); }
    :root:not([data-e-motion="still"])[dir="rtl"][data-e-overlay="e-dash-side"] .e-frame .e-dash .e-dash__side,
    :root:not([data-e-motion="still"])[dir="rtl"][data-e-overlay="e-mail-side"] .e-frame .e-mail #e-mail-side { animation-name: e-overlay-in-rtl; }
  }
  .e-crm__pick { display: flex; margin-block: 10px; }
  .e-crm__pick button { padding-inline: 4px; font-size: 12px; }
  .e-crm__cols { grid-template-columns: minmax(0, 1fr); }
  .e-crm__col { display: none; }
  .e-crm:not([data-col]) .e-crm__col:nth-child(1), .e-crm[data-col="0"] .e-crm__col:nth-child(1),
  .e-crm[data-col="1"] .e-crm__col:nth-child(2), .e-crm[data-col="2"] .e-crm__col:nth-child(3),
  .e-crm[data-col="3"] .e-crm__col:nth-child(4) { display: flex; }
  /* Components: "Konto anlegen" and "Benachrichtigungen", the rest is left out. */
  .e-comps { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .e-comps__search, .e-comps > .e-col:nth-child(2) > :not(:first-child), .e-comps > .e-col:nth-child(3) { display: none; }
  /* Icons: search and groups, then five icons a row. */
  .e-icons { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .e-icons__groups .sw-toggle-group { display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .e-icons__groups .sw-toggle-button { flex: none; width: auto; }

  /* The clouds follow the width instead of 720 px, so a phone has less to paint. */
  .e-aurora .e-blob { width: 150vw; height: 150vw; margin: -75vw 0 0 -75vw; }

  /* Section headings: smaller, and long German words break at a syllable, not anywhere. */
  .e-h2 { font-size: calc(30px * var(--e-head-scale, 1)); -webkit-hyphens: auto; hyphens: auto; }

  /* One column where the desktop has three or four; the ten promises go in two. A wide card
     would open a second column, and the desktop bleed would touch the edge of the screen. */
  .e-lines--2, .e-lines--3, .e-lines--4, .e-gallery__grid, .e-gallery__grid--pat { grid-template-columns: minmax(0, 1fr); }
  .e-lines--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .e-base--wide { grid-column: auto; }
  /* Every white box stands the same 4 px over the side lines (owner, B-158): the grids, the wall,
     the builder, the token chain and the token file. The desktop's 16 px would reach the edge of
     the screen, none would put a box inside the lines. */
  #vorteile .e-lines, #grundlagen .e-lines, #barrierefreiheit .e-lines, #varianten .e-wall, .e-build__box, .e-chain, .e-outputs { margin-inline: -4px; }
  /* Rounded corners only where the stacked grid has its corners. */
  .e-lines > * { border-radius: 0 !important; }
  .e-lines > :first-child { border-start-start-radius: calc(var(--R) - 1px) !important; border-start-end-radius: calc(var(--R) - 1px) !important; }
  .e-lines > :last-child { border-end-start-radius: calc(var(--R) - 1px) !important; border-end-end-radius: calc(var(--R) - 1px) !important; }
  .e-lines--5 > :first-child { border-start-end-radius: 0 !important; }
  .e-lines--5 > :nth-child(2) { border-start-end-radius: calc(var(--R) - 1px) !important; }
  .e-lines--5 > :last-child { border-end-start-radius: 0 !important; }
  .e-lines--5 > :nth-last-child(2) { border-end-start-radius: calc(var(--R) - 1px) !important; }

  .e-aa { flex-wrap: wrap; gap: 12px 20px; }
  /* Keyboard and screen reader probes: the switch goes under the heading. */
  .e-demo__head { flex-wrap: wrap; justify-content: flex-start; gap: 8px 16px; }
  /* "131,7" at 68 px filled the box edge to edge at 320 px. */
  .e-aa__big, .e-speed__num { font-size: 56px; }
  /* Two promises a row: less side padding, so "Kontrastmodus" fits whole at 320 px. */
  .e-promises .e-promise.sw-button { padding-inline: 14px; }
  /* The probes' stage: 16 px, so "Konto / Karten / Depot" fits at 320 px without scrolling. */
  .e-demo__stage { padding: 16px; }
  /* The hero badge needs two lines below about 380 px: as tall as they are, and even. */
  .e-badge { height: auto; min-height: 32px; padding-block: 6px; border-radius: 18px; line-height: 1.35; text-wrap: balance; }

  /* The builder stacks: preview first, then the button that opens the configurator. The
     desktop places the slot with .e-build__box > .e-build__slot; the same weight here. */
  .e-build, .e-build__box { grid-template-columns: minmax(0, 1fr); }
  .e-build__box > .e-build__stage, .e-build__box > .e-build__slot, .e-build__slot { grid-column: 1; grid-row: auto; }
  .e-build__stage { min-height: 0; }
  .e-build__preview { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  /* "Betrag" and "Ausführung" share a row while each keeps 7.5 rem; narrower, the date goes
     under the amount instead of losing its year (320 px, B-107 review). */
  .e-build__form .sw-inline { flex-wrap: wrap; }
  .e-build__form .sw-inline > .sw-field { flex: 1 1 7.5rem; }

  .e-chain__input-label, .e-chain__hint, .e-chain__choices, .e-chain__input-details { max-inline-size: 100%; }
  /* An explicit track: after a window narrows, WebKit keeps the old 376 px of an auto track
     whose items are limited only by a percentage. */
  .e-chain__input { grid-template-columns: minmax(0, 1fr); }

  /* The band (wireframe, section 5): the eight cards that keep their layout this narrow
     (data-phone, build.mjs), each nearly the screen wide, the next one peeking in. All
     cards as tall as the tallest instead of the desktop's fixed 470 px. */
  .e-slide:not([data-phone]) { display: none; }
  .e-slider { -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent); }
  .e-slider__track { gap: 12px; }
  .e-slide { width: min(380px, 100vw - 48px); }
  /* Nothing overflows a stage as tall as its content, so the desktop's fade at the foot
     would only veil the last button. */
  .e-slide__stage { height: auto; flex: 1; min-height: 360px; padding: 18px; -webkit-mask-image: none; mask-image: none; }

  /* The five formats of the token file scroll as a band (wireframe, section 8). */
  .e-outputs [role="tablist"] { overflow-x: auto; scrollbar-width: none; }

  /* The wall: five brands in one row without their notes, five skins in two columns. */
  .e-wall { border-radius: var(--R); overflow: hidden; }
  .e-wall__row { grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); }
  .e-wall__row > * { border-radius: 0 !important; }
  /* The last skin spans its row and closes the wall: its corners follow the wall's, or its square
     corners cover the outline there (B-158). */
  .e-wall__row:last-child > :last-child { border-end-start-radius: calc(var(--R) - 1px) !important; border-end-end-radius: calc(var(--R) - 1px) !important; }
  .e-wall__label { grid-column: 1 / -1; }
  .e-wall__row--brand .e-tile { padding: 10px 4px 12px; gap: 8px; align-items: center; text-align: center; }
  .e-wall__row--brand .e-tile__preview { align-self: stretch; }
  .e-wall__row--brand .e-tile__ramp { flex-direction: column; height: 56px; width: 100%; }
  .e-wall__row--brand .e-tile__note { display: none; }
  .e-wall__row--brand .e-tile__name { font-size: 11px; justify-content: center; }
  .e-wall__row--brand .e-tile__check { top: 6px; inset-inline: auto 4px; }
  /* The ring closer to the edge: 6 px in left "Graphit" no room at 320 px. */
  .e-wall__row--brand .e-tile::after { inset: 2px; border-radius: 12px; }
  .e-wall__note { display: block; grid-column: 1 / -1; margin: 0; padding: 10px 14px; background: var(--sw-color-surface-raised); font-size: 13px; color: var(--e-muted); }
  .e-wall__row--skin { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .e-wall__row--skin .e-tile:last-child { grid-column: 1 / -1; }
  /* The label is a row of its own here; the tiles below share their tracks (entwurf.css). */
  .e-wall__row--skin > .e-wall__label { grid-row: auto; }
  /* Half a phone is too narrow for two buttons; the primary one shows the skin. */
  .e-wall__row--skin .e-tile__demo > :nth-child(2) { display: none; }
}

/* A phone on its side: the configurator comes from the side, half the window wide. Up to
   1279 px, since a large phone on its side is 812 to 932 px wide: as a tablet the panel
   kept 159 px for its options under the header (B-107 review). */
@media (max-width: 1279.98px) and (max-height: 479.98px) {
  .e-config[data-mode="float"], .e-config[data-mode="hidden"], .e-config[data-more] {
    inset-block: 0; inset-inline: auto 0; width: 50%; max-height: none;
    border-width: 0; border-inline-start-width: 1px; border-radius: 0;
    border-start-start-radius: 20px; border-end-start-radius: 20px;
  }
  .e-config[data-mode="hidden"] { transform: translateX(24px); }
  [dir="rtl"] .e-config[data-mode="hidden"] { transform: translateX(-24px); }
  /* Window high, the panel lies over the header, which covered its title, "Zurücksetzen" and ✕. */
  .e-config[data-mode="float"], .e-config[data-mode="hidden"] { z-index: calc(var(--sw-z-sticky) + 1); }
  /* The header scrolls away there instead of taking a fifth of the height. */
  .e-nav { position: relative; }
}

/* Below 360 px the 25 dots keep 24 px, the target size the page promises, with smaller gaps. */
@media (max-width: 359.98px) {
  .e-matrix { gap: 4px; }
}

/* Under a finger the band never drifts (entwurf.js), so it needs no pause button. */
@media (hover: none) {
  .e-slider__nav button:nth-of-type(3) { display: none; }
}

/*
 * Tablet (M, 768 to 1279 px; wireframes, round 3). The fixed 1200 px goes. The header
 * shows the logo mark, the anchors, the configurator and ☰ for a panel under it; grids
 * take two columns; the mockup keeps a fixed frame without scrolling inside, its
 * sidebars become icon rails; the configurator floats over the page on the right
 * without pushing it aside, and in the builder it sits under the example below 1024 px.
 */
@media (min-width: 768px) and (max-width: 1279.98px) {
  body { min-width: 0; }
  :root { --e-sec-pad: 88px; }
  /* Content heights measured between 768 and 1279 px, for content-visibility (entwurf.css). */
  #vorteile { --e-sec-h: 1445px; }
  #templates { --e-sec-h: 803px; }
  #barrierefreiheit { --e-sec-h: 1825px; }
  #grundlagen { --e-sec-h: 3420px; }
  .e-close { --e-sec-h: 177px; }
  :root[data-config-open] { --e-gutter: 0px; }
  .e-wrap, .e-show { width: calc(100% - 64px); }
  .e-nav__in { width: calc(100% - 48px); gap: 16px; }
  .e-logo { min-width: 0; }
  .e-logo__word { display: none; }
  .e-nav__links { margin-inline: auto; }
  .e-nav__tools { margin-inline-start: 0; }
  .e-nav__tools > :not(.e-menubtn, [data-config-toggle]) { display: none; }
  .e-menubtn { display: inline-flex; height: 40px; }
  /* Measured (entwurf.js): when the anchors do not fit, they move into the panel. */
  .e-nav[data-tight="3"] .e-nav__links { display: none; }
  .e-nav[data-tight="3"] .e-nav__tools { margin-inline-start: auto; }
  /* The menu: a panel under the header on the right, without dimming; a tap beside it closes it. */
  .e-sheet { inset: 64px 16px auto auto; width: 300px; max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); }
  .e-sheet::backdrop { background: transparent; }
  .e-sheet__in { max-height: inherit; padding-block-start: 8px; border-radius: 16px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 18px 44px -18px rgb(0 0 0 / 0.3); }
  .e-sheet__head { display: none; }
  .e-nav:not([data-tight="3"]) ~ .e-sheet .e-sheet__nav { display: none; }
  .e-sheet__set { border-block-start: 0; }

  .e-h1 { font-size: calc(clamp(3.5rem, 1.5rem + 4.4vw, 5.25rem) * var(--e-head-scale, 1)); }
  .e-h2 { font-size: calc(38px * var(--e-head-scale, 1)); }

  /* Two columns everywhere: the ten promises in three left one alone beside an empty field. */
  .e-lines--3, .e-lines--4, .e-lines--5, .e-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .e-lines > * { border-radius: 0 !important; }
  .e-lines > :first-child { border-start-start-radius: calc(var(--R) - 1px) !important; }
  .e-lines > :nth-child(2) { border-start-end-radius: calc(var(--R) - 1px) !important; }
  .e-lines > :last-child { border-end-end-radius: calc(var(--R) - 1px) !important; }
  .e-lines > :nth-last-child(2):nth-child(odd) { border-end-start-radius: calc(var(--R) - 1px) !important; }
  /* A wide first card spans both columns and has both upper corners; the one after it none. */
  .e-lines > .e-base--wide:first-child { border-start-end-radius: calc(var(--R) - 1px) !important; }
  .e-lines > .e-base--wide:first-child + * { border-start-end-radius: 0 !important; }
  .e-lines > .e-base--wide:first-child ~ :nth-last-child(2):nth-child(even) { border-end-start-radius: calc(var(--R) - 1px) !important; }

  /* Feedback: content runs to the edge here, so the tab on the edge covered it. As on a
     phone, the menu panel and the footer open the panel above the bottom edge. */
  .e-fb__tab { display: none; }
  .e-fb__panel { position: fixed; inset: auto 24px calc(24px + env(safe-area-inset-bottom, 0px)) auto; }
  /* "Feedback geben", a button like the legal ones, right after them at the end of the row. */
  .e-foot__fb { display: inline-flex; }
  .e-foot__in { column-gap: 4px; }
  .e-foot__in > span:first-child { margin-inline-end: auto; }

  /* Keyboard and screen reader probes in two columns: the heading keeps its line, the
     buttons and the switch go under it in both, so the two columns start level. */
  .e-demo__head { flex-wrap: wrap; justify-content: flex-start; gap: 8px 16px; }
  .e-demo__head > h3 { flex: 1 0 100%; }

  /* The token file's five formats scroll as a band, as on a phone. */
  .e-outputs [role="tablist"] { overflow-x: auto; scrollbar-width: none; }

  /* The mockup: no scrolling inside a frame a finger may swipe; a soft end below. */
  .e-frame__scene { overflow: hidden; }
  .e-frame__app::after {
    content: ""; position: absolute; z-index: 2; inset: auto 0 0; height: 32px; pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--sw-color-surface-page));
  }
  .e-seg--scenes { width: auto; }
  .e-seg--scenes .sw-tabs__list { display: flex; flex-wrap: wrap; justify-content: center; }
  .e-under { flex-wrap: wrap; }
  .e-live__now { min-width: 0; }
  /* Sidebars as icon rails: the icons stay, the words are still read out. */
  .e-dash__side, .e-app > .e-app__side:not(.e-chat__side) { width: 60px; padding-inline: 8px; }
  .e-dash__side .sw-nav-list__label, .e-app__side:not(.e-chat__side) .sw-nav-list__label, .e-dash__name,
  .e-app__side:not(.e-chat__side) .sw-button__label, .e-app__brand { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .e-dash__side .sw-nav-list__item :is(.sw-badge, .e-status), .e-app__side .sw-nav-list__item .sw-badge, .e-app__side .sw-nav-list__section-title { display: none; }
  .e-dash__me { padding: 6px; justify-content: center; }
  .e-dash__collapse { display: none; }

  /* The builder: the configurator floats 300 px wide over the page. */
  .e-config { width: 300px; }
}

/* 768 to 1023 px: the scenes in their tablet layout, the live examples as name and arrows. */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .e-under { flex-wrap: wrap; }
  /* The scene chips in one row: without icons, and without the sliding pill should they wrap. */
  .e-seg--scenes .sw-tabs__tab .sw-icon, .e-seg--scenes .e-seg__ind { display: none; }
  .e-seg--scenes .sw-tabs__tab[data-selected] { background: var(--e-quiet-on); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 0 0 1px rgb(0 0 0 / 0.03); }
  .e-crm__colhead small { display: none; }
  /* A skin tile is too narrow for two buttons here too. */
  .e-wall__row .e-tile__demo > :nth-child(2) { display: none; }
  .e-live { display: none; }
  .e-live__steps { display: flex; gap: 8px; }
  .e-dash__main { padding: 16px; }
  .e-dash__head .e-row .sw-button:not([data-icon-only]) { display: none; }
  .e-dash__bar .e-refresh, .e-dash__bar .e-row > e-island:last-child { display: none; }
  .e-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .e-kpi { padding: 12px; }
  .e-kpi .sw-stat__value { font-size: 20px; }
  .e-kpi .sw-stat__trend { position: static; justify-self: start; align-self: start; }
  /* Chart over the full width, channels and week chart side by side; the table is left out. */
  .e-dash__panel[data-panel="overview"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .e-dash__panel[data-panel="overview"] > .e-kpis, .e-dash__chart { grid-column: 1 / -1; }
  .e-dash__panel[data-panel="overview"] > .e-dash__grid { display: contents; }
  .e-dash__table { display: none; }
  .e-mail__list { width: 42%; }
  .e-mail__read { padding: 16px 18px; }
  .e-chat__side { width: 36%; }
  .e-fin { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .e-fin__col { display: contents; }
  .e-fin__balance { grid-column: 1 / -1; }
  .e-fin__book :is(th, td):nth-child(2) { display: none; }
  .e-comps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .e-comps > .e-col:nth-child(3) { display: none; }
  .e-icons { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  /* The configurator under the example, its options in two columns. */
  .e-build, .e-build__box { grid-template-columns: minmax(0, 1fr); }
  .e-build__box > .e-build__stage, .e-build__box > .e-build__slot { grid-column: 1; grid-row: auto; }
  .e-build__stage { min-height: 0; }
  .e-config[data-mode="dock"] { position: static; width: 100%; max-height: none; }
  .e-config[data-mode="dock"] .e-config__more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
  .e-config[data-mode="dock"] .e-config__more[hidden] { display: none; }
}

/* The phone's sidebars slide in from the start edge (B-153, B-154). */
@keyframes e-overlay-in { from { transform: translateX(-100%); } }
@keyframes e-overlay-in-rtl { from { transform: translateX(100%); } }
