/*
 * WEB-INT-DETAILS: clickable tiles of "Funktioniert mit" and their detail popovers (templates/landing/_works_with.php,
 * loaded only by the full section on /funktionen/integrations). Tokens from app.css; tiles keep the white field of
 * site.css in both themes (logos may not be recoloured), the popover follows the theme.
 * Phone (below 640 px): the popover is a bottom sheet with 44 px close target. Browsers without popover support never
 * show the panels (display: none until :popover-open), the tiles then stay as before.
 */

/* Tile as button: same look as the plain tile, plus hover, focus and the small "i" */
.ww-cell { display: flex; }
.ww-btn { position: relative; width: 100%; padding: 14px 14px 10px; font: inherit; color: inherit; cursor: pointer; transition: border-color var(--t), box-shadow var(--t), transform var(--t); }
.ww-btn:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(19, 35, 63, .12); transform: translateY(-1px); }
.ww-btn:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 2px; }
.ww-i { position: absolute; top: 4px; right: 4px; width: 15px; height: 15px; border: 1.5px solid #8a94a3; border-radius: 50%; color: #55606f; font: 600 10px/12px var(--font-sans); text-align: center; }
.ww-btn:hover .ww-i, .ww-btn:focus-visible .ww-i { border-color: #a8761a; color: #8a5f12; }
@media (prefers-reduced-motion: reduce) { .ww-btn { transition: none; } .ww-btn:hover { transform: none; } }

/* Popover */
.ww-pop { display: none; position: fixed; inset: 0; margin: auto; width: min(640px, calc(100vw - 32px)); height: fit-content; max-height: calc(100dvh - 48px); padding: 0; overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); text-align: left; }
.ww-pop:popover-open { display: block; }
.ww-pop::backdrop { background: rgba(12, 24, 48, .55); }
.ww-pop-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; gap: 14px; padding: 20px 24px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ww-pop-group { display: inline-block; margin-bottom: 6px; padding: 2px 8px; border: 1px solid var(--info-line); border-radius: 999px; background: var(--info-bg); color: var(--info-ink); font: 600 .72rem var(--font-sans); letter-spacing: .03em; text-transform: uppercase; }
.ww-pop-h { margin: 0; font: 400 1.5rem/1.2 var(--font-display); color: var(--ink); text-wrap: balance; }
.ww-pop-sub { margin: 4px 0 0; font-size: .92rem; color: var(--ink-soft); }
.ww-pop-x { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; margin-left: auto; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.ww-pop-x:hover { background: var(--inset); }
.ww-pop-x:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 2px; }
.ww-pop-x .icon { width: 18px; height: 18px; }
.ww-pop-body { padding: 16px 24px 22px; }
.ww-pop-lead { margin: 0 0 14px; font-size: 1.05rem; max-width: 62ch; }
.ww-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius); background: var(--inset); font-size: .88rem; font-weight: 500; }
.ww-flow span:not(.sr-only) { padding: 3px 9px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ww-flow i { font-style: normal; font-weight: 600; color: var(--accent); }
.ww-facts { display: grid; grid-template-columns: 10rem minmax(0, 1fr); margin: 0; }
.ww-facts dt, .ww-facts dd { margin: 0; padding: 9px 0; border-top: 1px solid var(--line); }
.ww-facts dt { padding-right: 12px; font-size: .9rem; font-weight: 600; color: var(--ink-soft); }
.ww-facts dd { font-size: .95rem; overflow-wrap: anywhere; }
.ww-facts ul { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }
:root[data-theme="dark"] .ww-flow i { color: var(--accent-bright); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ww-flow i { color: var(--accent-bright); } }

/* Phone: bottom sheet, rows stacked */
@media (max-width: 640px) {
  .ww-btn { padding: 12px 10px 8px; }
  .ww-pop { inset: auto 0 0 0; width: 100%; max-width: none; max-height: 88dvh; margin: 0; border-radius: 14px 14px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .ww-pop-head { padding: 16px 16px 12px; }
  .ww-pop-h { font-size: 1.3rem; }
  .ww-pop-x { width: 44px; height: 44px; }
  .ww-pop-body { padding: 14px 16px 20px; }
  .ww-facts { grid-template-columns: minmax(0, 1fr); }
  .ww-facts dd { padding-top: 0; border-top: 0; }
}

/* WEB-INT-PAGES: link from a popover to the detail page of a directly connected tool */
.ww-pop-foot { padding: 14px 24px 20px; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .ww-pop-foot { padding: 12px 16px 18px; } .ww-pop-foot .btn { width: 100%; justify-content: center; min-height: 44px; } }

/* WEB-INT-PAGES: detail pages /de/integrationen/<slug> (templates/landing/integration/_page.php) */
.ip-steps { list-style: none; counter-reset: ip; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 18px 0 0; padding: 0; }
.ip-steps li { counter-increment: ip; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.ip-steps li::before { content: counter(ip); display: inline-grid; place-items: center; width: 30px; height: 30px; margin-bottom: 10px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-ink); font: 700 .9rem var(--font-sans); }
.ip-steps b { display: block; margin-bottom: 4px; color: var(--ink); }
.ip-steps p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.ip-table tbody th { width: 22%; }
.ip-more { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.ip-more a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; }
.ip-more a:hover { border-color: var(--accent); }
.ip-more a:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 2px; }
.ip-mark { margin: 24px 0 0; color: var(--ink-faint); max-width: 90ch; }
@media (max-width: 640px) { .ip-steps { grid-template-columns: minmax(0, 1fr); } .ip-more a { width: 100%; } }

/* Page "Open-Source-Konnektoren" (templates/landing/integration/open-source-connectors.php): table of tools, a card per tool on phones */
.oss-dots { margin: 0 0 12px; padding-left: 20px; }
.oss-dots li { margin-bottom: 6px; }
.oss-quote { margin: auto 0 0; padding-top: 12px; border-top: 1px solid var(--line); width: 100%; color: var(--ink); font-weight: 500; }
.oss-quote small { display: block; margin-bottom: 2px; color: var(--ink-faint); font-weight: 400; }
.oss-table-wrap { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.oss-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.oss-table th, .oss-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.oss-table thead th { border-top: 0; color: var(--ink-soft); font-size: .85rem; font-weight: 600; }
.oss-table tbody th[scope="row"] { width: 21%; font-weight: 400; }
.oss-table td:nth-child(2) { width: 31%; }
.oss-table td:nth-child(3) { width: 9%; }
.oss-group th { background: var(--bg-soft, var(--line)); color: var(--ink); font-weight: 600; }
.oss-tool { display: block; color: var(--ink); font-weight: 600; }
.oss-lic { display: block; color: var(--ink-faint); font-size: .82rem; }
.oss-way { white-space: nowrap; color: var(--ink-soft); }
.oss-way-phone { display: none; font-size: .82rem; }
.oss-state { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 4px; }
.oss-chip { display: inline-block; padding: 2px 9px; border: 1px solid transparent; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.oss-chip-ok { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
.oss-chip-beta { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.oss-chip-prep { background: var(--info-bg); color: var(--info-ink); border-color: var(--info-line); }
.oss-lab { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); font-size: .82rem; }
.oss-lab .icon { width: 14px; height: 14px; }
.oss-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 18px; }
.oss-three h3 { margin-top: 0; }
.oss-more { margin: 8px 0 0; }
.oss-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; color: var(--ink); font-size: .9rem; font-weight: 600; }
.oss-flow .icon { width: 16px; height: 16px; color: var(--accent-dark); }
.oss-for { margin: 0 0 8px; color: var(--ink-soft); font-size: .92rem; }
.oss-rw { margin-top: 20px; }
.oss-rw strong { display: block; margin-bottom: 2px; }
@media (max-width: 900px) {
  .oss-three { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .oss-table, .oss-table tbody, .oss-table tr, .oss-table th, .oss-table td { display: block; width: auto !important; }
  .oss-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .oss-table th, .oss-table td { padding: 2px 14px; border-top: 0; }
  .oss-table tbody tr:not(.oss-group) { padding: 10px 0; border-top: 1px solid var(--line); }
  .oss-group th { padding: 8px 14px; }
  .oss-table td::before { content: attr(data-label); display: block; color: var(--ink-faint); font-size: .78rem; }
  .oss-table td:nth-child(3) { display: none; }   /* the route moves next to the status chip (.oss-way-phone) */
  .oss-way-phone { display: inline; }
  .oss-tool { display: inline; margin-right: 8px; }
  .oss-lic { display: inline; }
}

/* Page "Automatisierung" (templates/landing/integration/automation.php) */
.au-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; margin: 28px 0 36px; padding: 0; list-style: none; }
.au-flow li { position: relative; min-width: 0; }
.au-flow li:not(:last-child)::after { content: ""; position: absolute; top: 18px; left: 48px; right: -20px; height: 2px; background: var(--line); }
.au-num { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-bottom: 12px; border-radius: 50%; background: var(--accent-dark); color: #fff; font-weight: 600; }
.au-flow h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 1.05rem; }
.au-flow p { margin: 0; color: var(--ink-soft); }
.au-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 18px; }
.au-grid h3 { margin: 10px 0 6px; }
.au-grid p { margin: 0 0 12px; }
.au-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 0; padding: 0; list-style: none; }
.au-tools li { padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); font-size: .85rem; }
.au-beta { color: var(--warn-ink); font-size: .78rem; font-weight: 600; }
.au-grid .lp-box { display: flex; flex-direction: column; }
.au-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 24px 0 28px; }
.au-stats div { display: flex; flex-direction: column; }
.au-stats dd { order: -1; margin: 0; color: #e0a93b; font-size: 2.6rem; font-weight: 600; line-height: 1.1; }
.au-stats dt { color: #f7f3ea; }
.au-band-note { max-width: 70ch; margin: 20px 0 0; color: #f7f3ea; }
.au-tiers { font-size: .95rem; }
.au-tiers tbody th[scope="row"] { width: 22%; }
.au-tiers td:nth-child(2), .au-tiers td:nth-child(3) { width: 39%; }
.au-tiers .lp-tag { margin-left: 4px; }
.au-fill { max-width: 70ch; margin: 16px 0 0; }
#ki .oss-table-wrap { margin-top: 24px; }
@media (max-width: 860px) {
  .au-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .au-flow li::after { display: none; }
  .au-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .au-flow { grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 20px 0 24px; }
  .au-flow li { padding-left: 48px; }
  .au-num { position: absolute; left: 0; top: 0; margin: 0; }
  .au-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .au-stats { gap: 10px; }
  .au-stats dd { font-size: 2rem; }
  .au-stats dt { font-size: .85rem; }
}

/* Page "KI in Complass" (templates/landing/integration/ai-assistance.php) */
.ai-open { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px; margin-top: 28px; }
.ai-open h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 6px; font-family: var(--font-display); font-size: 1.4rem; font-weight: 400; }
.ai-open p { margin: 0; color: var(--ink-soft); }
@media (max-width: 860px) { .ai-open { grid-template-columns: minmax(0, 1fr); gap: 28px; } }

/* Page "Meles" (templates/landing/integration/meles.php, plan 2.37 W1): figure in the head, "Was Meles nicht tut" as a quiet list,
   website and portal side by side as two equal boxes (DESIGN-GUIDELINES: blocks side by side are built the same way) */
.ml-figure { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto; }
.ml-h3 { margin: 40px 0 10px; font-family: var(--font-display); font-size: 1.4rem; font-weight: 400; }
.ml-not { margin: 0; padding-left: 22px; display: grid; gap: 6px; max-width: 70ch; color: var(--ink-soft); }
.ml-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 28px; }
.ml-col { display: flex; flex-direction: column; gap: 10px; padding: 26px 26px 22px; }
.ml-col h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; }
.ml-col-kicker { margin: 0; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.ml-facts { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-soft); }
.ml-claim { display: flex; align-items: center; gap: 8px; margin: auto 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink); }
.ml-claim svg { flex: none; width: 20px; height: 20px; }
.ml-col-link { margin: auto 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .ml-split { grid-template-columns: minmax(0, 1fr); } .ml-figure { max-width: 220px; } }
