/* Own additions to the AVERTIVE One theme (avertive-one.css, unchanged copy of theme 1.0.0). Everything the theme does not provide lives here,
   with the prefix app-; the theme classes (one-) are never redefined, only combined. Colors and sizes come from the theme tokens. See
   docs/design/avertive-one/FEEDBACK.md for what the theme lacks. */

/* Contrast: --text-3 of the theme (#6b7380 / #8a929e) misses 4.5:1 on the segment, the pill and the page background (WCAG 2.2 AA). The values
   here are the nearest ones that pass; proposed to the design team (docs/design/avertive-one/FEEDBACK.md). */
:root { --text-3: light-dark(#626a77, #98a0ac); }

[hidden] { display: none !important; }
h1, h2, h3 { font-family: inherit; }
.app-reset-h { margin: 0; }
h2.one-banner__title, h2.one-card__title, h2.one-drawer__title, h2.one-section-title { margin: 0; }
h2.one-banner__title { font-size: inherit; }
.app-grow { flex: 1; }
.app-nowrap { white-space: nowrap; }
.app-stack { display: flex; flex-direction: column; gap: 10px; }
.app-stack--lg { gap: 16px; }
.app-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.app-warn { color: var(--warn); font-weight: 500; }
.app-bad { color: var(--bad); }
.app-card-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.app-card-title .one-badge { margin-left: auto; }
.app-subhead { display: flex; align-items: center; gap: 6px; margin: 16px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.app-big { font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.app-big small { font-size: 13.5px; font-weight: 400; color: var(--text-3); letter-spacing: 0; margin-left: 4px; }
.app-note-text { margin: 0; font-size: 13px; color: var(--text-2); }
.app-link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: inherit; }
.app-link-btn:hover { text-decoration: underline; color: var(--accent-hover); }

/* Skip link: visible only on focus */
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 100; padding: 8px 12px; border-radius: var(--r-md); background: var(--inverse); color: var(--on-inverse); }
.skip-link:focus { top: 8px; text-decoration: none; color: var(--on-inverse); }
.one-main:focus, .one-page:focus, h1:focus, h2:focus { outline: none; }

/* Icons */
.app-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Frame: the side bar is a navigation; the rail only in the SaaS edition */
.one-app > .one-main { min-width: 0; }
.one-rail[inert] .one-rail__inner { visibility: hidden; }
.one-rail__tile { font-size: 12.5px; }
.app-rail__collapse { margin-top: auto; width: 32px; height: 32px; border-radius: 50%; border: 1px solid #2a2e36; background: transparent; color: #9aa1ad; display: grid; place-items: center; cursor: pointer; padding: 0; }
.app-rail__collapse:hover { color: #fff; background: #1a1d23; }
.app-rail__collapse:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.one-btn-portal[hidden] { display: none; }
.one-side__switch .app-icon { width: 14px; height: 14px; }
.one-tenant select { width: 100%; margin-top: 2px; border: 0; background: transparent; font-weight: 500; font-size: 13.5px; padding: 0; height: 24px; cursor: pointer; }
.one-nav__item .app-icon { color: var(--text-3); }
@media (max-width: 1023px) {
  .one-side:not(.is-open) { visibility: hidden; transition: left .22s ease, visibility 0s .22s; }
  .one-side.is-open { visibility: visible; transition: left .22s ease; }
}
.one-crumbs a { color: inherit; }
.one-search-trigger { font: inherit; }
.one-search-trigger .app-icon { color: var(--text-3); }
.one-user__btn { font: inherit; color: var(--text); }
.one-user__btn .app-icon { color: var(--text-3); }
.one-user__name { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
@media (max-width: 639px) { .one-user__name { display: none; } }
.one-menu .one-select select { width: 100%; }
.one-menu__name { font-weight: 600; }
.one-menu__role { font-size: 12.5px; color: var(--text-3); }
.one-menu .one-seg { display: flex; }
.one-menu .one-seg__item { flex: 1; }
.app-signout { color: var(--bad); }

/* Search window (Ctrl K): the theme styles the pieces, the list items are real options */
.one-palette__item { font: inherit; width: 100%; border: 0; background: transparent; text-align: left; color: var(--text); }
.one-palette__item .one-ellipsis { flex: 1; }
.one-palette__sub { font-size: 12.5px; color: var(--text-3); }
.one-palette__empty { padding: 24px 12px; text-align: center; color: var(--text-3); }
.one-palette__foot kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-radius: var(--r-xs); padding: 1px 5px; background: var(--surface); color: var(--text-3); }

/* Information hint: the theme styles the button and the text; here it floats under the button so that it does not push the layout */
.app-info { position: relative; display: inline-flex; vertical-align: middle; margin-left: 6px; }
.app-info .one-info { position: absolute; left: 0; top: calc(100% + 4px); z-index: 25; width: 320px; max-width: min(320px, calc(100vw - 32px)); margin: 0; background: var(--surface); color: var(--text-2); border: 1px solid var(--line); box-shadow: var(--shadow-pop); font-weight: 400; font-size: 13px; text-align: left; white-space: normal; }
.app-info .one-info.app-align-end { left: auto; right: 0; }
.app-with-info { display: inline-flex; align-items: center; }
.one-info-btn { padding: 0; line-height: 1; }
.one-info-btn:hover, .one-info-btn[aria-expanded="true"] { background: var(--accent-tint); color: var(--accent); border-color: var(--accent); }

/* Status banner: reasons as links (the theme underlines them), meta line below */
.one-banner__body { flex: 1; min-width: 0; }
.app-banner-meta { margin-top: 8px; font-size: 13px; opacity: .9; display: flex; flex-wrap: wrap; gap: 2px 20px; }
.one-banner__reasons li { list-style: none; }
ul.one-banner__reasons { margin: 4px 0 0; padding: 0; }

/* Cards and lists in cards */
.app-targets, .app-findings { display: flex; flex-direction: column; gap: 14px; }
.app-item { display: flex; gap: 10px; align-items: flex-start; }
.app-item__body { min-width: 0; flex: 1; }
.app-item__title { font-weight: 500; font-size: 13.5px; }
.app-item__sub { font-size: 12.5px; color: var(--text-3); }
.app-item__sub.is-problem { color: var(--text); }
.app-state-text { font-weight: 500; }
.app-ok-line { display: flex; align-items: center; gap: 8px; color: var(--good); font-weight: 500; margin: 0; }
.app-section-link { font-size: 13px; }
.app-jobs-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; color: var(--text-2); }
.app-jobs-line .app-count { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.one-cell-2 > a:first-child, .one-cell-2 > span:first-child { color: var(--text); }
.one-table td .one-cell-2 > a:first-child { color: var(--accent); }
.one-table .is-mono, .one-table .is-num { white-space: nowrap; }
.one-badge__text { display: inline-block; }
.one-badge__text::first-letter { text-transform: uppercase; }
.one-table .one-chev { font-size: 18px; line-height: 1; }
.one-table td.app-actions { text-align: right; white-space: nowrap; }
.one-table-wrap { position: relative; }
.app-kv-wrap .one-kv__k { white-space: normal; flex: 1 1 auto; }
.app-kv-wrap .one-kv__v { white-space: nowrap; flex: none; }
.app-table-note { font-size: 13px; color: var(--text-3); margin: 0; }
.one-table-foot { align-items: center; }

/* Forms: the theme gives the field parts, the layout of a row of fields is ours */
.app-filter { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.app-filter .one-field { min-width: 150px; flex: 0 1 190px; }
.app-filter .one-field--wide { flex: 1 1 260px; }
.app-search-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.app-search-row .one-field { flex: 1 1 320px; }
.app-search-input { height: 42px; font-size: 14px; }
.one-input[type="date"], .one-input[type="number"] { min-width: 0; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
.app-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.app-check input { margin-top: 2px; flex: none; }
.app-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.app-fieldset legend { padding: 0; }
.one-option input.one-sr:focus-visible + .one-option__text, .one-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 0; }
.one-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.one-option__text { min-width: 0; }
.app-pick-folders { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.app-selbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--sunken); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.app-selbar p { margin: 0; font-size: 13.5px; }
.one-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Segments wrap on small screens (the theme allows it) */
.app-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.app-switch-label { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; }
.app-switch-label .one-mono { color: var(--text-3); }

/* Restore wizard */
.one-steps { list-style: none; margin: 0; padding: 0; }
.app-wizard-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); align-items: start; }
.app-wizard-grid .one-card--pad { display: flex; flex-direction: column; gap: 10px; }
.app-wizard-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); position: sticky; bottom: 16px; }
.app-wizard-bar__text { flex: 1; min-width: 200px; font-size: 13.5px; color: var(--text-2); }
.one-facts > :last-child { border-right: 0; }
.one-facts__k { font-size: 12.5px; color: var(--text-3); }
.one-facts__v { font-weight: 500; overflow-wrap: anywhere; }
.app-summary { display: flex; flex-direction: column; }
.app-summary .one-kv { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.app-done { display: flex; flex-direction: column; gap: 14px; }
.app-done__title { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; }
.app-done__check { width: 22px; height: 22px; border-radius: 50%; background: var(--good); color: var(--surface); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.app-done__check--bad { background: var(--bad); }
.app-wide-card { max-width: 640px; }

/* Panels */
.app-drawer-top { display: flex; align-items: center; gap: 10px; }
.app-drawer--narrow { width: 520px; }
.one-drawer { width: 560px; }
.one-drawer.app-drawer--narrow { width: 520px; }
.one-dl__title { font-size: 13px; font-weight: 600; padding: 14px 0 6px; }

/* Settings and save bar */
.one-setting:last-child { border-bottom: 0; }
.one-setting__title { display: flex; align-items: center; }
.app-setting-state { margin: 6px 0 0; font-size: 12.5px; color: var(--text-3); }
.app-setting-control { min-width: 0; }
.app-setting-control .one-error { margin-top: 6px; font-size: 12.5px; color: var(--bad); }
.app-setting-control .one-error:empty { display: none; }
.one-setting--inline > .app-setting-control { flex: none; }
.app-tag-list { display: contents; }
.app-card--danger { border-color: var(--bad-line); }
.app-card--danger .one-card__head { border-bottom-color: var(--bad-line); }
.one-savebar { z-index: 10; }

/* Sign-in and emergency cards */
.app-center { min-height: 60vh; display: grid; place-items: center; }
.app-signin { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 14px; }
.app-signin .one-tile { align-self: flex-start; }
.app-signin .one-h1 { font-size: 22px; }
.app-signin .one-btn { align-self: stretch; }
.app-signin .one-help { margin: 0; }
.app-signin__entry { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.app-h2 { font-size: 16px; font-weight: 600; margin: 0; color: var(--text); }
.app-signin__entry .app-form .one-btn { align-self: stretch; }
.app-form { display: flex; flex-direction: column; gap: 14px; }
.app-form .one-btn { align-self: flex-start; }

/* Messages */
.app-error { padding: 12px 14px; border-radius: 8px; background: var(--bad-bg); color: var(--bad-ink); border: 1px solid var(--bad-line); font-size: 13.5px; margin: 0; }
.app-inline-error:not(:empty) { display: block; margin-top: 4px; }
.app-loading { color: var(--text-3); }
.one-note { margin: 0; }
.app-notice { padding: 12px 14px; border-radius: 8px; background: var(--accent-tint); color: var(--text); border: 1px solid var(--accent-soft); font-size: 13.5px; margin: 0; }

/* Job panel (ADR-0174 no. 2): progress of a running job without a known total, log lines */
.app-job-progress { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.app-job-progress:empty { display: none; }
.app-job-progress__text { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.app-job-progress p { margin: 0; }
.app-progress--busy { margin-top: 4px; }
.app-progress--busy .one-progress__bar { width: 35%; animation: app-busy 1.5s ease-in-out infinite; }
@keyframes app-busy { from { margin-left: -35%; } to { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .app-progress--busy .one-progress__bar { animation: none; width: 100%; opacity: .45; } }
.one-log > div { overflow-wrap: anywhere; }
.one-log .one-log__time { white-space: nowrap; }

/* Toast: the container is the live region, the toast itself the theme's */
#toast:empty { display: none; }
.one-toast { gap: 12px; }

.app-plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.app-hit-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Settings: requests, dialog, number field (ADR-0174 no. 1) */
.app-number { width: 96px; flex: none; }
.app-select { width: 160px; flex: none; }
.app-row--nowrap { flex-wrap: nowrap; }
.app-row--nowrap .one-input { min-width: 0; flex: 1; }
.app-note-row { align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 10px; background: var(--warn-bg); }
.app-note-row > span:first-child { flex: 1; min-width: 200px; }
.app-setting-control .one-help { margin: 6px 0 0; }
.app-dialog { padding: 0; }
.app-dialog__body { padding: 20px 22px 8px; display: flex; flex-direction: column; gap: 12px; }
.app-dialog__foot { padding: 14px 22px 20px; }
.app-dialog__text { margin: 0; font-size: 13.5px; line-height: 1.5; }
.app-dialog__list { list-style: disc; padding-left: 18px; font-size: 13px; color: var(--text-2); }
/* ---- Overview and frame polish (prototype Backup.dc.html, README "Übersicht") ---- */

/* Frame space is reserved from the first paint when the last page had it (theme-boot.js sets data-frame): no shift when the bars are built. */
html[data-frame] #side[hidden] { display: flex !important; }
html[data-frame] #top[hidden] { display: flex !important; }
html[data-frame] #content > .app-loading { visibility: hidden; }
@media (max-width: 1023px) { html[data-frame] #side[hidden] { visibility: hidden; } }

/* Top bar: the path gives way before the search does, the name is not cut in the middle of a word */
.one-crumbs { flex: 0 1 auto; }
.one-crumbs__parent { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.one-crumbs__current { flex: none; }
.one-user__btn { max-width: 100%; }
.one-user__name { max-width: 180px; font-weight: 500; }
.one-menu__head > div { min-width: 0; }
.one-menu__name { overflow-wrap: anywhere; }

/* Card grid: four cards in a row on wide screens, two by two below, one column on phones; cards of a row are equally high */
.app-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
@media (min-width: 1400px) { .app-overview-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 639px) { .app-overview-grid { grid-template-columns: minmax(0, 1fr); } }
.app-overview-grid > .one-card { display: flex; flex-direction: column; min-width: 0; }
.app-overview-grid > .one-card > .app-card-title { margin-bottom: 14px; min-height: 22px; }
.app-overview-grid .app-stack { gap: 12px; }
.app-overview-grid .app-stack--lg { gap: 16px; }
.app-overview-grid .app-subhead { margin: 18px 0 8px; }
.app-overview-grid .app-card-title + .app-subhead { margin-top: 0; }
.app-kv-wrap { flex-wrap: wrap; gap: 2px 8px; }
.app-kv-wrap .one-kv__v { margin-left: auto; }
.app-kv-two { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.app-overview-grid .app-big { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; margin-bottom: 8px; }
.app-overview-grid .app-big small { margin: 0; white-space: nowrap; }
.app-kv-sub { font-size: 12px; font-weight: 400; color: var(--text-3); }

/* Status banner: title and every reason in its own line */
.one-banner__body { display: flex; flex-direction: column; gap: 6px; }
.one-banner__body > * { margin: 0; }
ul.one-banner__reasons { margin: 0; }
.one-banner__reasons a:hover { text-decoration-thickness: 2px; }
.app-banner-meta { margin-top: 2px; }

/* Latest backups: head, count line and the table with its column titles */
#runs { gap: 12px; }
#runs .one-section-head { min-height: 28px; }
.app-section-link { font-weight: 500; white-space: nowrap; }
#runs .one-table td .one-cell-2 > a:first-child { color: var(--text); font-weight: 500; }
#runs .one-table td .one-cell-2 > a:first-child:hover { color: var(--accent); }
.one-cell-2 > span:not(:first-child) { color: var(--text-3); font-size: 12.5px; }
.one-table td.app-nowrap, .one-table td.is-num { color: var(--text-2); }
.one-table tr.is-clickable { transition: background-color .12s; }

/* Skeleton of the overview: the same blocks and heights as the real page, a quiet pulse (off with reduced motion) */
.app-skeleton { display: flex; flex-direction: column; gap: 24px; }
.app-skel { border-radius: var(--r-lg); background: var(--line-soft); animation: app-pulse 1.4s ease-in-out infinite; }
.app-skel--h1 { width: 160px; height: 32px; border-radius: 6px; }
.app-skel--lead { width: min(420px, 80%); height: 20px; margin-top: 8px; border-radius: 6px; }
.app-skel--banner { height: 104px; }
.app-skel--card { height: 220px; }
.app-skel--table { height: 360px; }
@keyframes app-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .app-skel { animation: none; } }

/* Items and volume are the extra columns of the table (the prototype has four): below a width where the table would scroll sideways they step
   aside, the panel of the row shows them. */
@media (max-width: 1199px) {
  #runs .one-table th:nth-child(5), #runs .one-table td:nth-child(5), #runs .one-table th:nth-child(6), #runs .one-table td:nth-child(6) { display: none; }
}
.one-setting--inline:has(.app-request) { flex-wrap: wrap; }
.one-setting--inline > .app-setting-control:has(.app-request) { flex: 1 1 100%; min-width: 0; }
.app-request { margin-top: 0; }

/* Visibility matrix of subject, sender and recipients (ADR-0167): field x role with a select per cell. The setting row stacks so that the grid has
   the full width; on a narrow screen the cells shrink and the select texts wrap. */
.one-setting:has(.app-visibility-grid) { flex-wrap: wrap; }
.one-setting > .app-setting-control:has(.app-visibility-grid) { flex: 1 1 100%; min-width: 0; }
.app-visibility-grid { max-width: 640px; }
.app-visibility-row { display: grid; grid-template-columns: minmax(90px, 1.1fr) repeat(3, minmax(0, 1fr)); gap: 8px; align-items: center; padding: 6px 0; }
.app-visibility-row + .app-visibility-row { border-top: 1px solid var(--line-soft); }
.app-visibility-head { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.app-visibility-row .app-select { width: 100%; }
@media (max-width: 639px) { .app-visibility-row { gap: 4px; } .app-visibility-head { font-size: 11.5px; } }
.app-radio { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; }
.app-scope { padding: 8px 0; }
.app-scope + .app-scope { border-top: 1px solid var(--line-soft); }

/* Sources page (ADR-0199): script block, guided steps, permission check list */
.app-script { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; white-space: pre; overflow: auto; resize: vertical; }
.app-steps { padding-left: 1.4rem; display: grid; gap: 0.6rem; }
.app-details > summary { cursor: pointer; font-weight: 600; padding: 0.4rem 0; }
.app-check-list li { display: flex; gap: 0.4rem; align-items: baseline; }
.app-check-list [data-state="missing"] .app-check-mark, .app-check-list [data-state="error"] .app-check-mark { font-weight: 700; }
.app-fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.app-check--disabled { opacity: 0.7; }
/* Page "Security recommendations" (M6 block 11): one entry per check, a line between them; the entry takes the focus after a click. */
.app-check-item { padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.app-check-item:last-child { padding-bottom: 0; border-bottom: 0; }
.app-check-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.app-check-item .app-item__title { margin: 0; }

/* Hosted consent: the permissions Microsoft asks for, grouped by purpose */
.app-perms { border: 1px solid var(--line); border-radius: var(--r-sm, 8px); padding: 10px 14px; }
.app-perms > summary { cursor: pointer; font-weight: 500; min-height: 24px; }
.app-perms__list { margin: 8px 0 0; }
.app-perms__list dt { font-weight: 600; margin-top: 10px; }
.app-perms__list dd { margin: 4px 0 0; }
