/*
 * Support desk - customer view (Views/SupportTicket/Index.cshtml) and the service desk
 * (CryolynxAdmin Views/ServiceDesk/Index.cshtml).
 *
 * A linked stylesheet rather than a per-view <style> block, following HelpCenter.css /
 * exploreCards.css, so the admin view and wwwroot/_support-harness.html share one source instead of
 * keeping three copies in sync.
 *
 * Theming is done the way the rest of the app does it: explicit body.dark-theme and
 * body:not(.dark-theme) pairs for every colour. There are no CSS custom properties in this codebase
 * and the Dore :root variables are not used by the app's own CSS.
 */

/* ---------------------------------------------------------------- layout */

.support-shell {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 991px) {
    .support-shell {
        grid-template-columns: 1fr;
    }
}

/* Desktop: both panels share one height so their tops and bottoms line up;
   the ticket list and chat scroll inside it. */
@media (min-width: 992px) {
    .support-shell {
        align-items: stretch;
        height: calc(100vh - 280px);
        min-height: 520px;
    }

    .support-shell > .support-panel {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .support-shell > .support-panel > * {
        flex-shrink: 0;
    }

    .support-shell .ticket-list,
    .support-shell .chat-scroll {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }
}

.support-panel {
    border-radius: 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

body.dark-theme .support-panel {
    background: rgba(24, 25, 27, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

body:not(.dark-theme) .support-panel {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.support-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
}

body.dark-theme .support-panel-head {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

body:not(.dark-theme) .support-panel-head {
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.support-panel-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.support-panel-sub {
    margin: 0;
    font-size: 12px;
}

body.dark-theme .support-panel-sub {
    color: #c5cad3;
}

body:not(.dark-theme) .support-panel-sub {
    color: #55585d;
}

/* ---------------------------------------------------------------- buttons */

/* Matches the primary button treatment introduced in WalletSmallAmountIndex.cshtml. */
.btn-support-primary {
    background: linear-gradient(135deg, #4E71DD 0%, #3a5bb6 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(78, 113, 221, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-support-primary:hover:not(:disabled) {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 113, 221, 0.5);
}

.btn-support-primary:disabled {
    opacity: 0.55;
    box-shadow: none;
}

.btn-support-ghost {
    background: transparent;
    border-radius: 30px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
}

body.dark-theme .btn-support-ghost {
    color: #c5cad3;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

body.dark-theme .btn-support-ghost:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}

body:not(.dark-theme) .btn-support-ghost {
    color: #55585d;
    border: 1px solid rgba(0, 0, 0, 0.18);
}

body:not(.dark-theme) .btn-support-ghost:hover {
    color: #212529;
    border-color: rgba(0, 0, 0, 0.35);
}

/* ---------------------------------------------------------------- tabs */

.support-tabs {
    display: flex;
    gap: 6px;
    padding: 12px 20px 0;
}

.support-tab {
    flex: 1;
    border: none;
    background: transparent;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

body.dark-theme .support-tab {
    color: #848e9c;
}

body.dark-theme .support-tab.active {
    background: rgba(78, 113, 221, 0.18);
    color: #7D97E8;
}

body:not(.dark-theme) .support-tab {
    color: #6c757d;
}

body:not(.dark-theme) .support-tab.active {
    background: rgba(78, 113, 221, 0.12);
    /* #4E71DD is only 3.96:1 on white; the darker tone clears AA for this small label. */
    color: #3a55b0;
}

.support-tab-count {
    display: inline-block;
    margin-left: 4px;
    opacity: 0.75;
}

/* ---------------------------------------------------------------- ticket list */

.support-search {
    padding: 12px 20px 4px;
}

.ticket-list {
    max-height: 52vh;
    overflow-y: auto;
    padding: 8px 12px 16px;
}

/* Prev / "11-20 of 34" / Next under the list (supportTicket.js renderPager). */
.ticket-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 20px 14px;
    font-size: 12px;
}

/* display:flex above would otherwise override the hidden attribute. */
.ticket-pager[hidden] {
    display: none;
}

body.dark-theme .ticket-pager {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    color: #c5cad3;
}

body:not(.dark-theme) .ticket-pager {
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    color: #55585d;
}

.ticket-pager-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.ticket-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.ticket-item:hover {
    transform: translateY(-1px);
}

body.dark-theme .ticket-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

body.dark-theme .ticket-item.active {
    background: rgba(78, 113, 221, 0.16);
    box-shadow: inset 3px 0 0 #4E71DD;
}

body:not(.dark-theme) .ticket-item:hover {
    background: rgba(0, 0, 0, 0.035);
}

body:not(.dark-theme) .ticket-item.active {
    background: rgba(78, 113, 221, 0.1);
    box-shadow: inset 3px 0 0 #4E71DD;
}

.ticket-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ticket-subject {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark-theme .ticket-subject {
    color: #fff;
}

body:not(.dark-theme) .ticket-subject {
    color: #212529;
}

.ticket-preview {
    margin: 4px 0 0;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-meta {
    margin: 6px 0 0;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark-theme .ticket-preview,
body.dark-theme .ticket-meta {
    color: #848e9c;
}

body:not(.dark-theme) .ticket-preview,
body:not(.dark-theme) .ticket-meta {
    color: #6c757d;
}

/* Derived client-side by comparing the newest message id against the highest one this device has
   opened - the ticket tables carry no read flag, so this indicator is per-device. */
.ticket-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4E71DD;
    flex-shrink: 0;
}

.ticket-item.is-unread .ticket-subject {
    font-weight: 700;
}

/* ---------------------------------------------------------------- status badge */

.status-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.status-badge.status-open {
    background: rgba(78, 113, 221, 0.16);
    color: #7D97E8;
}

.status-badge.status-closed {
    background: rgba(132, 142, 156, 0.18);
    color: #848e9c;
}

body:not(.dark-theme) .status-badge.status-open {
    background: rgba(78, 113, 221, 0.12);
    color: #3a55b0;
}

body:not(.dark-theme) .status-badge.status-closed {
    background: rgba(108, 117, 125, 0.14);
    color: #55585d;
}

/* ---------------------------------------------------------------- thread */

.thread-panel {
    display: flex;
    flex-direction: column;
    min-height: 60vh;
}

.thread-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
}

body.dark-theme .thread-head {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

body:not(.dark-theme) .thread-head {
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.thread-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    word-break: break-word;
}

.thread-sub {
    margin: 2px 0 0;
    font-size: 12px;
}

body.dark-theme .thread-title {
    color: #fff;
}

body.dark-theme .thread-sub {
    color: #848e9c;
}

body:not(.dark-theme) .thread-title {
    color: #212529;
}

body:not(.dark-theme) .thread-sub {
    color: #6c757d;
}

.chat-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    max-height: 46vh;
    padding: 18px 20px;
}

.chat-day {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    margin: 6px 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

body.dark-theme .chat-day {
    color: #848e9c;
}

body:not(.dark-theme) .chat-day {
    color: #6c757d;
}

.msg {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
    max-width: 78%;
}

/* Customer messages right, agent messages left. */
.msg.msg-out {
    margin-left: auto;
    align-items: flex-end;
}

.msg.msg-in {
    margin-right: auto;
    align-items: flex-start;
}

.msg-author {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

body.dark-theme .msg-author {
    color: #848e9c;
}

body:not(.dark-theme) .msg-author {
    color: #6c757d;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    /* Preserves the customer's line breaks without ever parsing their text as markup. */
    white-space: pre-wrap;
    word-break: break-word;
}

.msg-out .msg-bubble {
    background: linear-gradient(135deg, #4E71DD 0%, #3a5bb6 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg-in .msg-bubble {
    border-bottom-left-radius: 4px;
}

body.dark-theme .msg-in .msg-bubble {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

body:not(.dark-theme) .msg-in .msg-bubble {
    background: rgba(0, 0, 0, 0.05);
    color: #212529;
}

.msg-time {
    font-size: 10px;
    margin-top: 4px;
}

body.dark-theme .msg-time {
    color: #848e9c;
}

body:not(.dark-theme) .msg-time {
    color: #6c757d;
}

/* Optimistic bubble, until the server confirms the insert. */
.msg.is-pending {
    opacity: 0.6;
}

.msg.is-failed .msg-bubble {
    background: rgba(220, 53, 69, 0.85);
}

/* ---------------------------------------------------------------- composer */

.composer {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 14px 20px 18px;
}

body.dark-theme .composer {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

body:not(.dark-theme) .composer {
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.composer-input {
    flex: 1 1 auto;
    resize: none;
    max-height: 120px;
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
}

body.dark-theme .composer-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.dark-theme .composer-input::placeholder {
    color: #848e9c;
}

body:not(.dark-theme) .composer-input {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #212529;
}

.composer-input:focus {
    outline: none;
    border-color: #4E71DD;
    box-shadow: 0 0 0 3px rgba(78, 113, 221, 0.15);
}

.composer-send {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    color: #fff;
    background: linear-gradient(135deg, #4E71DD 0%, #3a5bb6 100%);
    box-shadow: 0 4px 15px rgba(78, 113, 221, 0.4);
    transition: transform 0.15s ease;
}

.composer-send:hover:not(:disabled) {
    transform: translateY(-2px);
}

.composer-send:disabled {
    opacity: 0.45;
    box-shadow: none;
}

/* ---------------------------------------------------------------- states */

.support-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    gap: 8px;
}

.support-empty i {
    font-size: 40px;
    opacity: 0.4;
}

.support-empty-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.support-empty-text {
    margin: 0;
    font-size: 12px;
    max-width: 280px;
}

body.dark-theme .support-empty-title {
    color: #fff;
}

body.dark-theme .support-empty,
body.dark-theme .support-empty-text {
    color: #848e9c;
}

body:not(.dark-theme) .support-empty-title {
    color: #212529;
}

body:not(.dark-theme) .support-empty,
body:not(.dark-theme) .support-empty-text {
    color: #6c757d;
}

/* Loading placeholders, so the list does not flash empty before the first fetch resolves. */
.skeleton-row {
    height: 58px;
    border-radius: 12px;
    margin-bottom: 6px;
    animation: supportPulse 1.4s ease-in-out infinite;
}

body.dark-theme .skeleton-row {
    background: rgba(255, 255, 255, 0.05);
}

body:not(.dark-theme) .skeleton-row {
    background: rgba(0, 0, 0, 0.05);
}

@keyframes supportPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* ---------------------------------------------------------------- modal */

.support-modal .modal-content {
    border-radius: 16px;
    border: none;
}

body.dark-theme .support-modal .modal-content {
    background: #1e2022;
    color: #fff;
}

body.dark-theme .support-modal .close {
    color: #fff;
    text-shadow: none;
    opacity: 0.7;
}

.support-modal .modal-header {
    border-bottom: none;
    padding: 22px 24px 4px;
}

.support-modal .modal-body {
    padding: 12px 24px 4px;
}

.support-modal .modal-footer {
    border-top: none;
    padding: 12px 24px 22px;
}

/* Hand-rolled floating label, matching WalletSmallAmountIndex.cshtml. Bootstrap here is 4.3.1,
   which has no .form-floating of its own. Requires placeholder=" " on the control. */
.support-float {
    position: relative;
    margin-bottom: 18px;
}

.support-float > .form-control {
    height: auto;
    padding: 20px 12px 8px;
    border-radius: 12px;
}

.support-float > textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.support-float > label {
    position: absolute;
    top: 0;
    left: 0;
    padding: 12px;
    margin-bottom: 0;
    font-size: 13px;
    pointer-events: none;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
}

.support-float > .form-control:focus ~ label,
.support-float > .form-control:not(:placeholder-shown) ~ label {
    opacity: 0.7;
    transform: scale(0.8) translateY(-6px) translateX(2px);
}

body.dark-theme .support-float > .form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.dark-theme .support-float > label {
    color: #848e9c;
}

body:not(.dark-theme) .support-float > .form-control {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #212529;
}

body:not(.dark-theme) .support-float > label {
    color: #6c757d;
}

.support-float > .form-control:focus {
    border-color: #4E71DD;
    box-shadow: 0 0 0 3px rgba(78, 113, 221, 0.15);
}

.support-field-error {
    display: none;
    font-size: 12px;
    color: #dc3545;
    margin-top: -12px;
    margin-bottom: 12px;
}

.support-field-error.is-visible {
    display: block;
}

/* ---------------------------------------------------------------- service desk extras */

/* Admin-only. The customer identity the service desk never used to display: TicketCore.UserId was
   returned in the JSON but nothing rendered it, so an agent could not tell who they were replying
   to. */
.ticket-customer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.customer-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #4E71DD 0%, #3a5bb6 100%);
    flex-shrink: 0;
}

.customer-name {
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark-theme .customer-name {
    color: #c5cad3;
}

body:not(.dark-theme) .customer-name {
    color: #55585d;
}

.canned-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 20px 10px;
}

.canned-reply {
    border: none;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 11px;
    cursor: pointer;
}

body.dark-theme .canned-reply {
    background: rgba(255, 255, 255, 0.07);
    color: #c5cad3;
}

body.dark-theme .canned-reply:hover {
    background: rgba(78, 113, 221, 0.25);
    color: #fff;
}

body:not(.dark-theme) .canned-reply {
    background: rgba(0, 0, 0, 0.05);
    color: #55585d;
}

body:not(.dark-theme) .canned-reply:hover {
    background: rgba(78, 113, 221, 0.15);
    color: #3a55b0;
}

/* ---------------------------------------------------------------- notification centre */

/* Customer view only (Views/SupportTicket/Index.cshtml). The class names are notif-* rather than
   notification-*: _Layout.cshtml styles .notification-item / .notification-title / .notification-
   message / .notification-time globally, in an inline block sized for the bell dropdown, and those
   rules would land on this list too. */

/* The panes are swapped by toggling the hidden attribute. The > selector is needed because
   .support-shell > .support-panel { display: flex } in the desktop media query above has the same
   specificity as .support-panel[hidden] and would otherwise keep a hidden pane on screen. */
.support-shell > .support-panel[hidden] {
    display: none;
}

.support-switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 30px;
    margin-bottom: 16px;
}

body.dark-theme .support-switch {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

body:not(.dark-theme) .support-switch {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.support-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    border-radius: 30px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.support-switch-btn i {
    font-size: 14px;
}

body.dark-theme .support-switch-btn {
    color: #848e9c;
}

body.dark-theme .support-switch-btn:hover {
    color: #fff;
}

body.dark-theme .support-switch-btn.active {
    background: linear-gradient(135deg, #4E71DD 0%, #3a5bb6 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(78, 113, 221, 0.35);
}

body:not(.dark-theme) .support-switch-btn {
    color: #6c757d;
}

body:not(.dark-theme) .support-switch-btn:hover {
    color: #212529;
}

body:not(.dark-theme) .support-switch-btn.active {
    background: linear-gradient(135deg, #4E71DD 0%, #3a5bb6 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(78, 113, 221, 0.35);
}

/* Unread count on the Notifications side of the switch. */
.support-switch-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    background: #dc3545;
    color: #fff;
}

.support-switch-badge[hidden] {
    display: none;
}

/* Mark all read is disabled once nothing is unread; .btn-support-ghost had no disabled state of
   its own, so it looked live. */
.btn-support-ghost:disabled {
    opacity: 0.45;
    cursor: default;
}

/* Same look as .support-tab, under a name supportTicket.js does not listen for. */
.notif-tab {
    flex: 1;
    border: none;
    background: transparent;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

body.dark-theme .notif-tab {
    color: #848e9c;
}

body.dark-theme .notif-tab.active {
    background: rgba(78, 113, 221, 0.18);
    color: #7D97E8;
}

body:not(.dark-theme) .notif-tab {
    color: #6c757d;
}

body:not(.dark-theme) .notif-tab.active {
    background: rgba(78, 113, 221, 0.12);
    color: #3a55b0;
}

/* ---------------------------------------------------------------- notification rows */

/* A row is a div holding two sibling buttons - open and delete - rather than one button with
   another nested inside it, which is invalid markup and would not be clickable. */
.notif-row {
    position: relative;
    border-radius: 12px;
    margin-bottom: 6px;
    transition: background 0.15s ease, transform 0.15s ease;
}

.notif-row:hover {
    transform: translateY(-1px);
}

body.dark-theme .notif-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

body.dark-theme .notif-row.active {
    background: rgba(78, 113, 221, 0.16);
    box-shadow: inset 3px 0 0 #4E71DD;
}

body:not(.dark-theme) .notif-row:hover {
    background: rgba(0, 0, 0, 0.035);
}

body:not(.dark-theme) .notif-row.active {
    background: rgba(78, 113, 221, 0.1);
    box-shadow: inset 3px 0 0 #4E71DD;
}

.notif-row-main {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    border-radius: 12px;
    /* Room on the right for the delete control. */
    padding: 12px 40px 12px 12px;
    cursor: pointer;
}

.notif-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-row-icon {
    font-size: 14px;
    flex-shrink: 0;
}

body.dark-theme .notif-row-icon {
    color: #7D97E8;
}

body:not(.dark-theme) .notif-row-icon {
    color: #3a55b0;
}

.notif-row-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark-theme .notif-row-title {
    color: #fff;
}

body:not(.dark-theme) .notif-row-title {
    color: #212529;
}

.notif-row-preview {
    margin: 4px 0 0;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif-row-time {
    margin: 6px 0 0;
    font-size: 11px;
}

body.dark-theme .notif-row-preview,
body.dark-theme .notif-row-time {
    color: #848e9c;
}

body:not(.dark-theme) .notif-row-preview,
body:not(.dark-theme) .notif-row-time {
    color: #6c757d;
}

.notif-row.is-unread .notif-row-title {
    font-weight: 700;
}

.notif-row-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    line-height: 1;
    border: none;
    border-radius: 50%;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    /* Revealed on hover so the list stays quiet, but never hidden from the keyboard. */
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.notif-row:hover .notif-row-delete,
.notif-row-delete:focus {
    opacity: 1;
}

body.dark-theme .notif-row-delete {
    color: #848e9c;
}

body.dark-theme .notif-row-delete:hover {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b76;
}

body:not(.dark-theme) .notif-row-delete {
    color: #6c757d;
}

body:not(.dark-theme) .notif-row-delete:hover {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}

/* Hover does not exist on touch, so the control stays visible where the panes stack. */
@media (max-width: 991px) {
    .notif-row-delete {
        opacity: 1;
    }
}

.notif-row.is-deleting {
    opacity: 0.4;
    pointer-events: none;
}

/* ---------------------------------------------------------------- notification reader */

.notif-reader-body {
    flex: 1 1 auto;
    overflow-y: auto;
    max-height: 46vh;
    padding: 20px;
    font-size: 13px;
    line-height: 1.7;
    /* Keeps the stored line breaks without ever parsing the text as markup. */
    white-space: pre-wrap;
    word-break: break-word;
}

body.dark-theme .notif-reader-body {
    color: #e6e8ea;
}

body:not(.dark-theme) .notif-reader-body {
    color: #212529;
}

/* The empty state is centred, so it must not inherit the body's pre-wrap alignment. */
.notif-reader-body .support-empty {
    white-space: normal;
}

.notif-reader-actions {
    padding: 14px 20px 18px;
}

body.dark-theme .notif-reader-actions {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

body:not(.dark-theme) .notif-reader-actions {
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}

/* btn-support-primary is written for <button>; as an anchor it needs these two. */
.notif-reader-actions .btn-support-primary {
    display: inline-block;
    text-decoration: none;
}

.notif-reader-actions .btn-support-primary i {
    margin-left: 6px;
    font-size: 11px;
}

@media (min-width: 992px) {
    /* The switch sits above the shell, so the shared height has that much less to work with. */
    .support-shell.has-switch {
        height: calc(100vh - 340px);
    }

    /* Same treatment .chat-scroll gets: fill the panel and scroll inside it, overriding the
       flex-shrink:0 that .support-shell > .support-panel > * applies to every child. */
    .support-shell .notif-reader-body {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }
}
