/*!
 * MVN support pages: the few things these pages need that assets/css/mvn-ui.css does not
 * have yet. overwrites/header.tpl loads this file on every page, so every rule is scoped to
 * the support pages' body classes. Tokens only. Each block is meant to be folded into
 * mvn-ui.css by the integrator (its section is named in the block's comment).
 */

/* 7.15 Conversation: a message's Markdown.
   Lagom draws every blockquote as a grey card with a quote icon (theme.css "blockquote",
   "blockquote p:after"); a message quotes plainly, a line at the start side. Wide tables
   scroll inside the message, never the page. */
html.mvn-ui body.page-viewticket .mvn-msg-body blockquote {
    margin: 0;
    padding: 0;
    padding-inline-start: var(--mvn-s-4);
    border: 0;
    border-inline-start: var(--mvn-line) solid var(--mvn-rule-2);
    border-radius: 0;
    background: none;
    color: var(--mvn-ink-3);
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}
html.mvn-ui body.page-viewticket .mvn-msg-body blockquote p::after {
    content: none;
}
html.mvn-ui body.page-viewticket .mvn-msg-body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}
/* Quoted e-mail history once shown (the "•••" toggle, assets/js/mvn/tickets.js) */
html.mvn-ui body.page-viewticket .mvn-msg-body [data-mvn-quote] {
    color: var(--mvn-ink-3);
}
/* A file WHMCS no longer keeps: its name, quiet, without a link */
html.mvn-ui body.page-viewticket .mvn-msg-file.is-removed {
    color: var(--mvn-ink-3);
}

/* 7.15 Conversation: rating a reply with five stars, each a submit button of one small POST
   form (includes/view-ticket/message.tpl). The star under the pointer or the focus, and the
   ones before it, fill in the accent. */
.page-viewticket .mvn-rate {
    display: inline-flex;
    align-items: center;
    gap: var(--mvn-s-half);
}
html.mvn-ui .page-viewticket .mvn-rate button {
    display: inline-grid;
    place-items: center;
    width: var(--mvn-icon-btn);
    height: var(--mvn-icon-btn);
    padding: 0;
    border: 0;
    border-radius: var(--mvn-r-ctl);
    background: none;
    color: var(--mvn-ink-3);
    font-size: var(--mvn-t-icon-md);
    cursor: pointer;
    transition: color var(--mvn-dur) var(--mvn-ease), background-color var(--mvn-dur) var(--mvn-ease);
}
html.mvn-ui .page-viewticket .mvn-rate button:is(:hover, :focus-visible),
html.mvn-ui .page-viewticket .mvn-rate button:has(~ button:is(:hover, :focus-visible)) {
    color: var(--mvn-accent);
}
html.mvn-ui .page-viewticket .mvn-rate button:is(:hover, :focus-visible) {
    background: var(--mvn-accent-wash);
}
/* mvn-ui.css section 2 draws every icon in .app-main at weight 900 with a long selector, so
   "far" icons come out solid; the stars need the regular (outline) face, and fill on hover. */
html.mvn-ui body.lagom.page-viewticket .app-main .mvn-rate i.far[class*="fa-"]:not(.ls):not(.lm):not(.fab):not(.fa-brands):not(.fad):not(.fa-duotone) {
    font-weight: 400 !important;
}
html.mvn-ui body.lagom.page-viewticket .app-main .mvn-rate :is(button:hover, button:focus-visible, button:has(~ button:is(:hover, :focus-visible))) i.far[class*="fa-"]:not(.ls):not(.lm):not(.fab):not(.fa-brands):not(.fad):not(.fa-duotone) {
    font-weight: 900 !important;
}
.page-viewticket .mvn-rate.is-done {
    color: var(--mvn-accent);
    font-size: var(--mvn-t-icon-md);
}

/* 7.13 Forms: attaching files. The native input stays in the form; once the script is ready
   it is visually hidden (.mvn-sr) and its label reads as an action word, so the focus ring
   moves to the label. The chosen files are listed, each with "הסרה". */
:is(.page-viewticket, .page-supportticketsubmit-steptwo) .mvn-attach {
    position: relative;
    align-items: flex-start;
}
html.mvn-ui body.lagom:is(.page-viewticket, .page-supportticketsubmit-steptwo) .mvn-attach-input:focus-visible + .mvn-attach-pick {
    outline: var(--mvn-ring) solid var(--mvn-focus) !important; /* theme-rtl.css removes outlines with !important */
    outline-offset: var(--mvn-ring-gap);
    border-radius: var(--mvn-r-sm);
}
:is(.page-viewticket, .page-supportticketsubmit-steptwo) .mvn-attach-list {
    align-self: stretch;
    margin: 0;
    padding: 0;
    border: var(--mvn-hair) solid var(--mvn-rule);
    border-radius: var(--mvn-r-ctl);
    list-style: none;
}
:is(.page-viewticket, .page-supportticketsubmit-steptwo) .mvn-attach-list li {
    display: flex;
    align-items: center;
    gap: var(--mvn-s-3);
    min-height: var(--mvn-ctl-h);
    padding-inline: var(--mvn-s-3);
}
:is(.page-viewticket, .page-supportticketsubmit-steptwo) .mvn-attach-list li + li {
    border-block-start: var(--mvn-hair) solid var(--mvn-rule-soft);
}
:is(.page-viewticket, .page-supportticketsubmit-steptwo) .mvn-attach-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--mvn-ink);
    font-size: var(--mvn-t-small);
    white-space: nowrap;
    text-overflow: ellipsis;
}
:is(.page-viewticket, .page-supportticketsubmit-steptwo) .mvn-attach-size {
    color: var(--mvn-ink-3);
    font-size: var(--mvn-t-caption);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* 7.12 Alerts: WHMCS's list of errors under the alert's title */
:is(.page-viewticket, .page-supportticketsubmit-steptwo, .page-ticketfeedback) .mvn-alert-list {
    margin: var(--mvn-s-1) 0 0;
    padding-inline-start: var(--mvn-s-4);
}

/* 7.4 Framed lists: a frame that holds only its foot (CC recipients before the first one)
   draws no rule over it; the add row keeps the field and its button together. */
.page-viewticket .mvn-rows[hidden] + .mvn-frame-foot {
    border-block-start: 0;
}
html.mvn-ui .page-viewticket .mvn-cc-add .mvn-input {
    flex: 1 1 var(--mvn-search-w);
    width: auto;
    min-width: 0;
    max-width: var(--mvn-form-w);
}
html.mvn-ui .page-viewticket .mvn-cc-add > .mvn-btn {
    margin-inline-start: 0;
}
.page-viewticket .mvn-part-note.is-bad {
    color: var(--mvn-bad);
}

/* 7.4 Framed lists: a domain in a row's sub-line does not break at its hyphens */
.page-supportticketslist .mvn-row-sub bdi {
    white-space: nowrap;
}
/* 10. Phones: a row's title wraps (mvn-ui.css), up to two lines, so a long subject keeps the
   row one tap target of a readable size */
@media (max-width: 599.98px) {
    .page-supportticketslist .mvn-row-title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
}

/* 7.13 Forms: a new ticket. WHMCS reloads the department's extra fields into
   #customFieldsContainer, which sits in the form's grid: it lends its fields to the grid.
   (#autoAnswerSuggestions needs nothing: Lagom hides it until WHMCS slides it down.) */
.page-supportticketsubmit-steptwo #customFieldsContainer {
    display: contents;
}

/* 7.13 Forms: a scale of choices on one line (ticket feedback, 1 to 10) */
.page-ticketfeedback .mvn-checks.is-scale {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--mvn-s-2) var(--mvn-s-4);
}

@media (pointer: coarse) {
    html.mvn-ui .page-viewticket .mvn-rate button {
        width: var(--mvn-touch);
        height: var(--mvn-touch);
    }
    /* 7.15: the "•••" toggle of quoted history keeps its small pill and gets a 44px hit area */
    html.mvn-ui .page-viewticket .mvn-quote-toggle {
        position: relative;
    }
    html.mvn-ui .page-viewticket .mvn-quote-toggle::after {
        content: "";
        position: absolute;
        inset-block: calc(-1 * var(--mvn-s-3));
        inset-inline: calc(-1 * var(--mvn-s-1));
    }
}
@media (prefers-reduced-motion: reduce) {
    html.mvn-ui .page-viewticket .mvn-rate button {
        transition: none;
    }
}

/* 7.5 Action words: a row's main action that leaves the client area (a knowledge base article
   in a new tab). The main action is static so it can stretch over the row, so its mark is
   placed from the row: it sits at the row's padding, where the word ends. */
html.mvn-ui .page-supportticketsubmit-steptwo .mvn-row .mvn-act.is-main.is-out::before {
    inset-inline-end: var(--mvn-frame-pad);
}
