/* Command palette, search result page and notifications (bell panel, slide-out message, page) — o645.
   Built after the owner-approved mockup. Corners, field borders and the placeholder colour are the central
   tokens of app.css; the stronger hairline below is the only value of its own. */
:root {
    --cx-palette-hairline: rgba(28, 25, 21, 0.18);
}

/* ── Command palette: an own dialog, not an SfDialog ──────────────────── */

.cmdk-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(28, 25, 21, 0.38);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 96px 16px 16px;
}

.cmdk {
    width: 640px;
    max-width: 100%;
    max-height: min(560px, calc(100dvh - 128px));
    background: #fff;
    border-radius: var(--cx-radius-surface);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.4;
    color: var(--cx-text-primary);
}

.cmdk-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    height: 56px;
    border-bottom: 1px solid var(--cx-palette-hairline);
    flex-shrink: 0;
}

.cmdk-input-row > i {
    font-size: 17px;
    color: var(--cx-text-secondary);
}

.cmdk-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 16px;
    color: var(--cx-text-primary);
}

.cmdk-input::placeholder {
    color: var(--cx-placeholder-color);
}

.cmdk-esc {
    border: none;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 16px;
    padding: 1px 6px;
    background: rgba(28, 25, 21, 0.06);
    border-radius: var(--cx-radius-control);
    color: var(--cx-text-secondary);
    white-space: nowrap;
}

.cmdk-esc i {
    display: none;
    font-size: 12px;
}

.cmdk-list {
    overflow-y: auto;
    padding: 6px 8px 8px;
    scrollbar-width: thin;
}

.cmdk-group-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cx-text-secondary);
    padding: 12px 12px 6px;
}

.cmdk-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--cx-row-h, 40px);
    padding: 0 12px;
    border-radius: var(--cx-radius-control);
    cursor: pointer;
    position: relative;
}

.cmdk-row .ic {
    flex: none;
    width: 18px;
    text-align: center;
    font-size: 15px;
    color: var(--cx-text-secondary);
}

/* A light tint tells the three kinds apart at a glance: pages, commands, found records. */
.cmdk-row .ic.k-page { color: var(--cx-text-muted); }
.cmdk-row .ic.k-cmd { color: var(--cx-info); }
.cmdk-row .ic.k-rec { color: var(--cx-success); }

.cmdk-row .t {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.cmdk-row .m {
    flex: 1 1 0;
    min-width: 0;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--cx-text-secondary);
    font-size: 13.5px;
}

.cmdk-row .keys {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.cmdk-row .keys .kbd,
.cx-go-hint .kbd {
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 16px;
    padding: 1px 6px;
    background: rgba(28, 25, 21, 0.06);
    border-radius: var(--cx-radius-control);
    color: var(--cx-text-secondary);
}

.cmdk-row .enter {
    display: none;
    flex-shrink: 0;
    color: var(--cx-text-secondary);
    font-size: 15px;
}

/* Selected row: sand and a 3 px copper bar on the left (design standard rule 22). Never filled copper. */
.cmdk-row.sel,
.cmdk-row:hover {
    background: var(--sand);
}

.cmdk-row.sel::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--copper);
}

.cmdk-row.sel .enter {
    display: block;
}

.cmdk-row.search-all {
    margin-top: 4px;
}

.cmdk-row.search-all::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    top: -3px;
    border-top: 1px solid var(--cx-hairline);
}

.cmdk-empty {
    padding: 14px 12px 6px;
    color: var(--cx-text-secondary);
}

/* „g, then a letter“ hint, shown while the sequence waits for its second key. */
.cx-go-hint {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2500;
    display: none;
    gap: 6px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--cx-palette-hairline);
    border-radius: var(--cx-radius-surface);
    padding: 6px 10px;
    box-shadow: var(--shadow-xl);
    color: var(--cx-text-secondary);
    font-size: 13px;
}

.cx-go-hint.show {
    display: flex;
}

/* ── Filter column on sand, shared by the result page and the notifications page ── */

/* The filter column and the list of the two pages (search results, notifications). Every rule is bound to
   .cxf-page: the names .cxf and .cxf-label are also the capture fields of the review form (cx-capture-fields.css),
   and unbound these rules gave every such field a sand box and hid its label on a phone. */
.cxf-page {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    height: 100%;
    font-size: 14px;
    line-height: 1.4;
    color: var(--cx-text-primary);
}

.cxf-page .cxf {
    background: var(--sand);
    border-right: 1px solid var(--cx-palette-hairline);
    padding: 20px 0 16px;
    overflow-y: auto;
}

.cxf-page .cxf h1 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 4px;
    padding: 0 20px;
}

.cxf-page .cxf .q {
    padding: 0 20px 14px;
    color: var(--cx-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 34px;
}

.cxf-page .cxf-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 38px;
    padding: 0 20px 0 16px;
    border: none;
    border-left: 4px solid transparent;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.cxf-page .cxf-item span {
    flex: 1;
}

.cxf-page .cxf-item .n {
    flex: none;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.cxf-page .cxf-item.zero .n {
    color: var(--cx-text-muted);
    font-weight: 400;
}

.cxf-page .cxf-item:hover {
    background: rgba(28, 25, 21, 0.05);
}

.cxf-page .cxf-item.active {
    border-left-color: var(--copper);
    background: rgba(184, 96, 31, 0.18);
    color: var(--copper-dark);
    font-weight: 700;
}

.cxf-page .cxf-sep {
    height: 1px;
    background: var(--cx-palette-hairline);
    margin: 8px 20px;
}

.cxf-page .cxf-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--cx-text-secondary);
    padding: 6px 20px 4px;
}

/* A size container: its rows follow the room the list really has — the window minus navigation and filter
   column — not the width of the window (see „Notifications page, by the width of the list“). */
.cxf-page .cxf-list {
    background: #fff;
    overflow-y: auto;
    min-width: 0;
    container-type: inline-size;
    container-name: cxf-list;
}

/* ── Search result page ───────────────────────────────────────────────── */

.sr-head {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cx-text-secondary);
    padding: 18px 24px 8px;
    border-bottom: 1px solid var(--cx-palette-hairline);
    display: flex;
    gap: 8px;
}

.sr-head .n {
    font-weight: 500;
    letter-spacing: 0;
}

.sr-row {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr) 130px 120px;
    align-items: center;
    gap: 16px;
    min-height: var(--cx-row-h, 40px);
    padding: 0 24px 0 21px;
    border-bottom: 1px solid var(--cx-hairline);
    border-left: 3px solid transparent;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
}

.sr-row > * {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sr-row .t {
    font-weight: 600;
}

.sr-row .s,
.sr-row .st {
    color: var(--cx-text-secondary);
}

.sr-row .st.overdue {
    color: var(--cx-danger);
    font-weight: 600;
}

.sr-row .a {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.sr-row:hover {
    background: var(--sand);
    color: inherit;
}

.sr-row.sel {
    background: var(--sand);
    border-left-color: var(--copper);
}

.sr-none {
    padding: 28px 24px;
    color: var(--cx-text-secondary);
}

.sr-foot {
    padding: 12px 24px;
    color: var(--cx-text-secondary);
    font-size: 13px;
}

/* ── Bell: a number only where work waits (light copper, never filled); otherwise at most a quiet dot ── */

.icon-button .badge-dot.todo {
    top: 2px;
    right: 1px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: var(--cx-radius-round);
    background: var(--copper-50);
    color: var(--copper-dark);
    border: 1px solid var(--copper);
    font-size: 10px;
    font-weight: 700;
}

.icon-button .badge-dot.quiet {
    min-width: 0;
    width: 8px;
    height: 8px;
    padding: 0;
    top: 7px;
    right: 7px;
    background: var(--cx-text-muted);
    border: none;
    font-size: 0;
}

/* ── Slide-out message, top right ─────────────────────────────────────── */

.cx-notify {
    position: fixed;
    top: calc(var(--cx-maintenance-banner-h, 0px) + var(--cx-topbar-h) + 12px);
    right: 16px;
    z-index: 1900;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border: 1px solid var(--cx-palette-hairline);
    border-radius: var(--cx-radius-surface);
    box-shadow: var(--shadow-xl);
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 28px;
    gap: 12px;
    padding: 14px 8px 14px 16px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    color: var(--cx-text-primary);
    animation: cxNotifySlide 0.28s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes cxNotifySlide {
    from { transform: translateX(28px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .cx-notify { animation: none; }
}

.cx-notify:hover {
    border-color: var(--cx-field-border-color);
}

.cx-notify .ic {
    font-size: 16px;
    color: var(--cx-text-secondary);
    margin-top: 1px;
}

.cx-notify .tt {
    font-weight: 600;
}

.cx-notify .mm {
    color: var(--cx-text-secondary);
    font-size: 13px;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cx-notify .x {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: var(--cx-radius-control);
    color: var(--cx-text-secondary);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 12px;
}

.cx-notify .x:hover {
    background: var(--sand);
}

/* ── Bell panel ───────────────────────────────────────────────────────── */

.np-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1800;
}

.np {
    position: absolute;
    top: calc(var(--cx-maintenance-banner-h, 0px) + var(--cx-topbar-h) + 4px);
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - var(--cx-maintenance-banner-h, 0px) - var(--cx-topbar-h) - 24px);
    background: #fff;
    border: 1px solid var(--cx-palette-hairline);
    border-radius: var(--cx-radius-surface);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.4;
    color: var(--cx-text-primary);
}

.np-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 8px;
    flex-shrink: 0;
}

.np-head h2 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

.np-link {
    border: none;
    background: none;
    padding: 4px 0;
    font-family: inherit;
    font-size: 13px;
    color: var(--cx-text-secondary);
    cursor: pointer;
    text-decoration: none;
}

.np-link:hover {
    color: var(--cx-primary-hover);
}

.np-link.underlined {
    text-decoration: underline;
}

.np-body {
    overflow-y: auto;
    padding: 0 8px 8px;
}

.np-group {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cx-text-secondary);
    padding: 12px 8px 6px;
    display: flex;
    gap: 6px;
}

.np-group .n {
    font-weight: 500;
    letter-spacing: 0;
}

.np-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    column-gap: 10px;
    padding: 9px 8px;
    border-radius: var(--cx-radius-control);
    cursor: pointer;
    align-items: start;
}

.np-row:hover {
    background: var(--sand);
}

.np-row .ic,
.nl-row .ic {
    color: var(--cx-text-secondary);
}

.np-row .ic {
    font-size: 15px;
    margin-top: 1px;
}

.np-row .ic.urgent,
.nl-row .ic.urgent {
    color: var(--cx-danger);
}

.np-row .tt {
    font-weight: 700;
}

.np-row.read .tt {
    font-weight: 500;
}

.np-row .mm {
    color: var(--cx-text-secondary);
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.np-row .side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.np-row .tm {
    font-size: 12px;
    color: var(--cx-text-secondary);
    white-space: nowrap;
}

.np-mark {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    border-radius: var(--cx-radius-control);
    color: var(--cx-text-secondary);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 15px;
    opacity: 0;
}

.np-row:hover .np-mark,
.nl-row:hover .np-mark,
.np-mark:focus-visible {
    opacity: 1;
}

.np-mark:hover {
    background: #fff;
    color: var(--cx-text-primary);
}

.np-fold {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 36px;
    margin-top: 4px;
    padding: 0 8px;
    border: none;
    border-top: 1px solid var(--cx-hairline);
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    color: var(--cx-text-secondary);
    cursor: pointer;
    text-align: left;
}

.np-fold:hover {
    color: var(--cx-text-primary);
}

.np-fold span {
    flex: 1;
}

.np-empty {
    padding: 18px 8px 14px;
    color: var(--cx-text-secondary);
}

/* Completed protocols (Betrieb 16, Variante B): from the third of a day on, one day row that opens to the single ones.
   Laid out like a row; the stack icon in text colour, the open row on sand like a hovered one. */
.np-day {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    column-gap: 10px;
    width: 100%;
    padding: 9px 8px;
    border: none;
    background: transparent;
    border-radius: var(--cx-radius-control);
    cursor: pointer;
    align-items: start;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: var(--cx-text-primary);
}

.np-day:hover,
.np-day.open {
    background: var(--sand);
}

.np-day .ic {
    font-size: 15px;
    margin-top: 1px;
    color: var(--cx-text-primary);
}

.np-day .txt {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.np-day .tt {
    font-weight: 700;
}

.np-day.read .tt {
    font-weight: 500;
}

.np-day .mm {
    color: var(--cx-text-secondary);
    font-size: 13px;
}

.np-day .side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.np-day .tm {
    font-size: 12px;
    color: var(--cx-text-secondary);
    white-space: nowrap;
}

.np-day .chev {
    font-size: 14px;
    color: var(--cx-text-secondary);
    margin-top: 2px;
}

.np-kids {
    margin: 2px 0 4px 10px;
    padding-left: 4px;
    border-left: 2px solid var(--cx-hairline-strong);
}

.np-kids .np-row {
    padding: 7px 8px;
}

.np-kids .np-row .tt {
    font-size: 13.5px;
}

.np-more {
    display: block;
    padding: 6px 8px 4px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 13px;
    color: var(--cx-text-secondary);
    cursor: pointer;
}

.np-more:hover {
    color: var(--cx-primary-hover);
}

/* „mit Mängeln“: bold in text colour with a dot in the warning colour — red stays for what is overdue. */
.np-row .mangel,
.np-day .mangel,
.nl-row .mangel,
.cx-notify .mangel {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-weight: 600;
    color: var(--cx-text-primary);
}

.np-row .mangel::before,
.np-day .mangel::before,
.nl-row .mangel::before,
.cx-notify .mangel::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: var(--cx-radius-round);
    background: var(--cx-warning);
}

.np-foot {
    border-top: 1px solid var(--cx-palette-hairline);
    padding: 8px 16px;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
}

/* ── Notifications page ───────────────────────────────────────────────── */

.nl-bar {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 8px 24px;
    background: #fff;
    border-bottom: 1px solid var(--cx-palette-hairline);
}

.nl-bar .cnt {
    flex: 1;
    min-width: 0;
    color: var(--cx-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nl-btn {
    height: 34px;
    padding: 0 12px;
    border-radius: var(--cx-radius-control);
    border: 1px solid var(--cx-field-border-color);
    background: #fff;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--cx-text-primary);
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nl-btn:hover {
    background: var(--sand);
}

.nl-btn[disabled] {
    opacity: 0.45;
    cursor: default;
    background: #fff;
}

.nl-check {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ink);
    cursor: pointer;
    flex-shrink: 0;
}

.nl-row {
    display: grid;
    grid-template-columns: 18px 20px minmax(0, 1fr) auto 110px 132px 28px;
    column-gap: 14px;
    align-items: center;
    min-height: 56px;
    padding: 8px 20px 8px 21px;
    border-bottom: 1px solid var(--cx-hairline);
    border-left: 3px solid transparent;
    cursor: pointer;
}

.nl-row:hover {
    background: var(--sand);
}

.nl-row.unread {
    border-left-color: var(--copper);
}

.nl-row .ic {
    font-size: 16px;
}

.nl-row .txt {
    min-width: 0;
}

.nl-row .tt {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nl-row.unread .tt {
    font-weight: 700;
}

.nl-row .mm {
    color: var(--cx-text-secondary);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nl-row .kd,
.nl-row .tm {
    color: var(--cx-text-secondary);
    font-size: 13px;
    white-space: nowrap;
}

.nl-row .tm {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Completed protocols of a day as one row (Betrieb 16): the caret stands where the read mark stands, the single
   protocols open below it, indented under the text. */
.nl-day .chev {
    font-size: 14px;
    color: var(--cx-text-secondary);
    justify-self: center;
}

.nl-day.open {
    background: var(--sand);
}

.nl-kids .nl-row {
    padding-left: 53px;
}

/* ── Lasting disturbances (o708): two ways out, and „behoben“ ───────────── */

/* The button fixes it, the quiet link beside it switches the function off. Link in text colour, copper on hover.
   Both stand in one line on one baseline; where the width does not reach, the link wraps under the button —
   nothing is cut. The distances are named once here and used by every place that lays the two out. */
.np-acts {
    --np-acts-gap: 14px;
    --np-acts-wrap-gap: 6px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--np-acts-wrap-gap) var(--np-acts-gap);
    margin-top: 8px;
}

/* Bell panel: under the text and across the time column. The time keeps its place in the first line. */
.np-row .np-acts {
    grid-column: 2 / -1;
    grid-row: 2;
}

.np-row .side {
    grid-column: 3;
    grid-row: 1;
}

.np-optout {
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 13px;
    color: var(--cx-text-secondary);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.np-optout:hover {
    color: var(--cx-primary-hover);
}

/* Notifications page, wide: button and link in their own column, side by side like in the bell. */
.nl-row .np-acts {
    margin-top: 0;
    flex-wrap: nowrap;
}

.np-row .ic.done,
.nl-row .ic.done {
    color: var(--cx-success);
}

.np-done {
    font-size: 13px;
    font-weight: 600;
    color: var(--cx-success);
    margin-top: 2px;
}

.nl-row .tm.done {
    color: var(--cx-success);
    font-weight: 600;
}

.np-row .tt {
    overflow-wrap: anywhere;
}

/* The question before a function is switched off. Above the bell panel. */
.np-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(28, 25, 21, 0.38);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-size: 14px;
    line-height: 1.4;
    letter-spacing: 0;
}

.np-confirm {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid var(--cx-palette-hairline);
    border-radius: var(--cx-radius-surface);
    box-shadow: var(--shadow-xl);
    padding: 20px;
}

.np-confirm h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
}

.np-confirm p {
    margin: 0 0 8px;
    color: var(--cx-text-secondary);
}

.np-confirm .foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* Switching a function off is no to-do: the confirming button is the danger button, never copper. */
.nl-btn.danger {
    background: var(--cx-danger);
    border-color: var(--cx-danger);
    color: #fff;
    font-weight: 600;
}

.nl-btn.danger:hover {
    background: var(--ink);
    border-color: var(--ink);
}

.nl-btn.danger[disabled] {
    background: var(--cx-danger);
}

.nl-note {
    padding: 12px 24px;
    color: var(--cx-text-secondary);
    font-size: 13px;
}

/* ── Sound switch in „Mein Profil“ ────────────────────────────────────── */

.cx-sound-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
}

.cx-sound-row .txt {
    flex: 1;
    min-width: 0;
}

.cx-sound-row .lab {
    display: block;
    font-weight: 600;
}

.cx-sound-row .hint {
    color: var(--cx-text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

/* ── Narrow ───────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
    .sr-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 110px 110px; }
}

@media (max-width: 768px) {
    /* On a phone the shell gives every page a gutter; these two pages are lists to the screen edge, like the
       shell's own full-bleed pages — no box inside the page frame. */
    .erp-content:has(> .cxf-page) {
        padding: 0;
    }

    .cxf-page {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
    }

    .cxf-page .cxf {
        border-right: none;
        border-bottom: 1px solid var(--cx-palette-hairline);
        padding: 12px 0 8px;
        display: flex;
        flex-wrap: nowrap;
        gap: 0;
        overflow-x: auto;
        align-items: center;
    }

    .cxf-page .cxf h1,
    .cxf-page .cxf .q,
    .cxf-page .cxf-sep,
    .cxf-page .cxf-label {
        display: none;
    }

    .cxf-page .cxf-item {
        width: auto;
        flex: none;
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 0 12px;
        height: 40px;
    }

    .cxf-page .cxf-item.active { border-bottom-color: var(--copper); }
    .cxf-page .cxf-item.zero { display: none; }

    .sr-row {
        grid-template-columns: minmax(0, 1fr) auto;
        row-gap: 0;
        padding: 8px 16px 8px 13px;
        min-height: 52px;
    }

    .sr-row .s { grid-column: 1; grid-row: 2; font-size: 13px; }
    .sr-row .st { display: none; }
    .sr-row .a { grid-column: 2; grid-row: 1 / span 2; }
    .sr-head { padding: 16px 16px 8px; }

    .nl-bar { padding: 8px 12px; flex-wrap: wrap; }
    .np-mark { opacity: 1; }
}

/* ── Notifications page, by the width of the list ─────────────────────── */

/* The list is the window minus navigation and filter column: at 1024 px it has 700 px, at 1280 px (navigation
   open) 772 px. The row's fixed columns and the button of a disturbance together need more than that, and title
   and text — the only flexible column — shrank to nothing. So the row follows the list, not the window. */

/* Medium: button and link move under the text; the text keeps the whole flexible column. The fourth column
   stays (rows without a button fill it with their empty cell) but is empty and so 0 px wide.
   The threshold follows what the wide row needs: 766 px for the fixed columns with the widest button and the
   link beside it, plus 250 px for the longest title of a disturbance in bold. Below that the title would be cut
   to make room for the link — the link gives way, never the title. */
@container cxf-list (max-width: 1050px) {
    .nl-row .kd { grid-column: 5; grid-row: 1; }
    .nl-row .tm { grid-column: 6; grid-row: 1; }
    .nl-row .np-mark,
    .nl-row .tm + .gap,
    .nl-row .tm + .chev { grid-column: 7; grid-row: 1; }

    .nl-row .act {
        grid-column: 3 / -1;
        grid-row: 2;
        justify-self: start;
        margin-top: 6px;
        flex-wrap: wrap;
    }
}

/* Narrow — a phone, or a small window beside navigation and filter column: text over the full width, time
   beside it, button and link below. */
@container cxf-list (max-width: 768px) {
    .nl-row {
        grid-template-columns: 18px minmax(0, 1fr) auto;
        column-gap: 12px;
        padding: 10px 12px 10px 9px;
    }

    .nl-row .ic,
    .nl-row .kd,
    .nl-row .np-mark,
    .nl-row .gap,
    .nl-day .chev {
        display: none;
    }

    .nl-kids .nl-row {
        padding-left: 21px;
    }

    .nl-row .tt {
        white-space: normal;
    }

    .nl-row .tm {
        grid-column: 3;
        align-self: start;
        font-size: 12px;
    }

    /* Button and link under the text, side by side. */
    .nl-row .act {
        grid-column: 2 / -1;
        margin-top: 8px;
    }

    .nl-row .mm {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}

@media (max-width: 639.98px) {
    /* Phone: the dialog takes nearly the whole screen from the top, rows are two-line and 48 px for the thumb. */
    .cmdk-backdrop { padding: 8px; }
    .cmdk { max-height: calc(100dvh - 16px); }
    .cmdk-esc .word { display: none; }
    .cmdk-esc i { display: inline; }

    .cmdk-row {
        flex-wrap: wrap;
        row-gap: 0;
        min-height: 48px;
        padding: 6px 12px;
    }

    .cmdk-row .t { flex: 1 1 calc(100% - 30px); }
    .cmdk-row .m { flex: 1 1 100%; text-align: left; font-size: 13px; padding-left: 30px; }

    .cmdk-row .keys,
    .cmdk-row .enter,
    .cmdk-row.sel .enter {
        display: none;
    }

    .np { top: calc(var(--cx-maintenance-banner-h, 0px) + var(--cx-topbar-h) + 4px); right: 8px; left: 8px; width: auto; max-width: none; }
    .cx-notify { top: calc(var(--cx-maintenance-banner-h, 0px) + var(--cx-topbar-h) + 8px); right: 8px; left: 8px; width: auto; max-width: none; }
}

/* Touch devices without a keyboard: no key hints in the list (see cx-shell.css). */
@media (hover: none) and (pointer: coarse) {
    .cmdk-row .keys,
    .cmdk-row .enter,
    .cmdk-row.sel .enter { display: none; }
}
