/* Ad Library (app.mesper.de/ad-library) — scoped to .al-scope */
.al-scope .al-container { max-width: 1180px; margin: 0 auto; }
.al-scope .al-stack { display: flex; flex-direction: column; gap: 18px; }
.al-scope .al-muted { color: var(--ink-3); font-size: 13px; }
.al-scope .al-h2 { font-size: 17px; margin: 0; display: flex; gap: 8px; align-items: baseline; }

.al-lang { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.al-lang button { border: 0; background: transparent; color: var(--ink-3); padding: 8px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.al-lang button.is-on { background: var(--accent); color: #fff; }

/* Search */
.al-search { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.al-search-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.al-segment { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; background: var(--surface-2); }
.al-segment button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--ink-3); cursor: pointer; }
.al-segment button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm); }
.al-input-wrap { flex: 1 1 320px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; background: var(--surface); color: var(--ink-4); }
.al-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.al-input-wrap input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14.5px; padding: 11px 0; color: var(--ink); min-width: 0; }
.al-filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.al-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.al-field select, .al-field input { font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; background: var(--surface); min-width: 140px; }
.al-field-inline { flex-direction: row; align-items: center; gap: 8px; }
.al-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); padding-bottom: 8px; }
.al-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.al-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 11px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 600; }
.al-chip button { border: 0; background: transparent; color: inherit; display: inline-flex; padding: 2px; border-radius: 6px; cursor: pointer; }
.al-chip button:hover { background: rgba(0,0,0,.06); }

/* Notices */
.al-notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.al-notice-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.al-notice-text { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; margin-top: 2px; }
.al-notice-info { color: var(--accent); background: var(--surface-2); }
.al-notice-warn { color: var(--st-pending); background: var(--st-pending-soft); border-color: transparent; }
.al-notice-error { color: var(--st-declined); background: var(--st-declined-soft); border-color: transparent; }

.al-empty { text-align: center; padding: 48px 20px; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.al-empty h2 { color: var(--ink); font-size: 18px; margin: 10px 0 6px; }
.al-empty p { max-width: 520px; margin: 0 auto; font-size: 14px; line-height: 1.5; }

/* Results */
.al-results-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.al-tabs { display: inline-flex; gap: 4px; border-bottom: 1px solid var(--line); }
.al-tabs button { border: 0; background: transparent; padding: 9px 12px; font-weight: 600; font-size: 14px; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.al-tabs button.is-on { color: var(--ink); border-bottom-color: var(--accent); }
.al-tabs button span { color: var(--ink-4); font-weight: 600; margin-left: 4px; }
.al-list { display: flex; flex-direction: column; gap: 10px; }
.al-more { display: flex; justify-content: center; padding-top: 4px; }

.al-ad { display: flex; gap: 18px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.al-ad-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.al-ad-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-3); }
.al-ad-meta strong { color: var(--ink); }
.al-ad-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.al-ad-text { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.al-ad-foot { display: flex; flex-wrap: wrap; gap: 6px; }
.al-ad-foot span { font-size: 11.5px; font-weight: 600; color: var(--ink-3); background: var(--paper-2); padding: 3px 8px; border-radius: 6px; }
.al-ad-side { flex: 0 0 auto; min-width: 150px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; gap: 10px; text-align: right; }
.al-ad-reach > div:last-child { font-weight: 700; font-size: 15px; color: var(--ink); }
.al-open { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.al-open:hover { text-decoration: underline; }
.al-state-on { color: var(--st-approved); font-weight: 600; }
.al-state-off { color: var(--ink-4); }
.al-link-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
.al-link-btn:hover { color: var(--accent); text-decoration: underline; }
.al-page-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; text-align: left; font: inherit; color: var(--ink-2); }
.al-page-row:hover { border-color: var(--accent); }
.al-page-row > span:first-child { flex: 1; display: flex; flex-direction: column; }
.al-page-row small { color: var(--ink-4); font-size: 12px; }

/* Profile */
.al-profile-head h1 { font-size: 28px; margin: 6px 0 4px; }
.al-profile-head a { color: var(--accent); }
.al-back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--ink-3); font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 0; }
.al-back:hover { color: var(--ink); }
.al-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.al-metric { padding: 16px 18px; border-left: 1px solid var(--line); }
.al-metric:first-child { border-left: 0; }
.al-metric-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); }
.al-metric-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--ink); margin-top: 6px; }
.al-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.al-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.al-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.al-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; min-width: 0; }
.al-panel-head { margin-bottom: 12px; }
.al-panel-head h3 { font-size: 14.5px; margin: 0; color: var(--ink); }
.al-panel-head p { font-size: 12.5px; color: var(--ink-3); margin: 4px 0 0; line-height: 1.45; }
.al-sub { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 8px; }
.al-bars { display: flex; flex-direction: column; gap: 8px; }
.al-bar-row { display: grid; grid-template-columns: minmax(70px, 40%) 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; }
.al-bar-label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-bar-track { height: 8px; background: var(--paper-2); border-radius: 4px; overflow: hidden; }
.al-bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.al-bar-value { font-weight: 700; color: var(--ink); min-width: 32px; text-align: right; }
.al-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.al-rows li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.al-rows li:first-child { border-top: 0; }
.al-row-key { flex: 0 0 auto; color: var(--ink-3); font-weight: 600; }
.al-row-text { flex: 1; min-width: 0; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-row-num { font-weight: 700; color: var(--ink); }
.al-spend-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.al-spend-grid .al-field input { min-width: 0; width: 100%; box-sizing: border-box; }
.al-spend-result { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.al-spend-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--ink); margin: 4px 0; }
.al-diag { font-size: 13px; color: var(--ink-3); }
.al-diag summary { cursor: pointer; font-weight: 600; }
.al-diag dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 10px 0 0; }
.al-diag dt { font-weight: 600; }
.al-diag dd { margin: 0; word-break: break-all; }

@media (max-width: 1000px) {
  .al-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .al-metric:nth-child(4) { border-left: 0; }
  .al-metric:nth-child(n+4) { border-top: 1px solid var(--line); }
  .al-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .al-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .al-metric { border-left: 0; border-top: 1px solid var(--line); }
  .al-metric:nth-child(-n+2) { border-top: 0; }
  .al-metric:nth-child(even) { border-left: 1px solid var(--line); }
  .al-grid, .al-grid-2, .al-grid-3, .al-spend-grid { grid-template-columns: 1fr; }
  .al-ad { flex-direction: column; }
  .al-ad-side { flex: none; flex-direction: row; align-items: center; text-align: left; }
  .al-field select, .al-field input { min-width: 0; width: 100%; box-sizing: border-box; }
  .al-filter-row { display: grid; grid-template-columns: 1fr 1fr; }
  .al-search-row > button { width: 100%; }
  .al-segment { width: 100%; }
  .al-segment button { flex: 1; }
}
