/* Tharsol Connect (phase 4): small additions for the TMS portal's screens inside Connect. Not in the portal. */

/* The host page's boot splash (Components/Tickets/TicketsHost.razor) shows until the app draws something after it. */
#app > .tms-preboot:not(:last-child) {
    display: none;
}

/* The Connect rail tiles added to the portal's rail (Connect's apps, Home for clients) are plain links like
   RailAppLink, opened in this tab. */
.tms-rail a.tms-rail-connect {
    text-decoration: none;
}

/* Tharsol Connect phase 5: the shared rail (Layout/ConnectRail.cs). The MAIL section's caption under its separator,
   12px tall, pulled 4px up (RailMetrics.Caption = 12 - 4 + the rail's 2px gap), drawn the same on Connect's rail. */
.tms-rail-cap {
    flex: none;
    height: 12px;
    margin-top: -4px;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: .1em;
    line-height: 12px;
    text-transform: uppercase;
    color: var(--tms-rail-text);
    opacity: .8;
}

/* Connect's pages in a folded group's list are plain links like the tiles. */
.tms-rail-fly a.tms-rail-connect:hover {
    text-decoration: none;
}

/* A phone draws the rail as a bottom bar: no captions there. */
@media (max-width: 720px) {
    .tms-rail-cap {
        display: none;
    }
}

/* Tharsol Connect phase 6: the one bell (Components/ConnectBell.razor) and the one search (ConnectSearchPalette.razor). */
.connect-bell-count {
    position: absolute;
    top: 1px;
    right: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--tms-danger);
    color: var(--tms-on-danger, #fff);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-sizing: border-box;
    box-shadow: 0 0 0 2px var(--tms-surface);
}

.connect-bell-menu {
    width: min(400px, calc(100vw - 32px));
}

    .connect-bell-menu .tms-bell-list {
        max-height: min(520px, calc(100vh - 120px));
    }

.connect-bell-all {
    font-size: 12px;
    font-weight: 600;
    color: var(--tms-accent-ink-2, var(--tms-accent));
}

.connect-bell-item {
    padding: 0;
    align-items: stretch;
}

.connect-bell-open {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 6px 11px 14px;
    text-align: left;
}

.connect-bell-sub {
    font-size: 12px;
    color: var(--tms-text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.connect-bell-icon, .connect-search-icon {
    --c: var(--tms-accent);
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: var(--tms-r);
    display: grid;
    place-items: center;
    font-size: 15px;
    border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
    background: color-mix(in srgb, var(--c) 12%, transparent);
    color: var(--c);
}

    .connect-bell-icon.k-ticket, .connect-search-icon.k-tickets { --c: #D2611C; }
    .connect-bell-icon.k-chat, .connect-search-icon.k-chat { --c: #7A5AC8; }
    .connect-bell-icon.k-calendar { --c: #1E8E4E; }
    .connect-bell-icon.k-signin { --c: var(--tms-danger); }
    .connect-search-icon.k-people { --c: #1595A5; }

.connect-bell-read {
    flex: none;
    width: 28px;
    margin: 10px 8px 0 0;
    height: 28px;
    border-radius: var(--tms-r);
    color: var(--tms-text-3);
    opacity: 0;
}

.connect-bell-item:hover .connect-bell-read, .connect-bell-read:focus-visible {
    opacity: 1;
}

.connect-bell-read:hover {
    background: var(--tms-surface-3, var(--tms-surface-2));
    color: var(--tms-text);
}

.connect-search-scrim {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgb(8 14 26 / .45);
}

.connect-search {
    position: fixed;
    z-index: 901;
    top: 12vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(640px, calc(100vw - 24px));
    max-height: 72vh;
    display: flex;
    flex-direction: column;
    background: var(--tms-surface);
    border: 1px solid var(--tms-border-strong);
    border-radius: var(--tms-r-lg);
    box-shadow: var(--tms-shadow-3);
    overflow: hidden;
}

.connect-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: 52px;
    border-bottom: 1px solid var(--tms-border);
    color: var(--tms-text-3);
    font-size: 17px;
}

    .connect-search-box input {
        flex: 1;
        min-width: 0;
        border: 0;
        outline: none;
        background: transparent;
        color: var(--tms-text);
        font-size: 15px;
    }

    .connect-search-box kbd {
        font-family: var(--tms-font-mono);
        font-size: 10.5px;
        border: 1px solid var(--tms-border);
        border-radius: 3px;
        padding: 2px 5px;
    }

.connect-search-results {
    overflow-y: auto;
    padding: 6px 0 10px;
}

.connect-search-hint, .connect-search-note {
    margin: 0;
    padding: 8px 16px;
    color: var(--tms-text-3);
    font-size: 13px;
}

.connect-search-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 4px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--tms-text-3);
}

    .connect-search-h a {
        text-transform: none;
        letter-spacing: 0;
        font-size: 12.5px;
        font-weight: 600;
    }

.connect-search-hit {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: var(--tms-text);
    text-decoration: none;
}

    .connect-search-hit:hover, .connect-search-hit.is-sel {
        background: var(--tms-surface-2);
        text-decoration: none;
    }

.connect-search-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

    .connect-search-text .t, .connect-search-text .d {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .connect-search-text .t {
        font-size: 13.5px;
    }

    .connect-search-text .d {
        font-size: 12px;
        color: var(--tms-text-3);
    }

/* Tharsol Connect: the ticket's Emails section (ticket mail threads). */
.connect-tmail {
    margin: 0 0 14px;
    padding: 0;
    overflow: hidden;
}

.connect-tmail-h {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    color: var(--tms-text);
    font: inherit;
    cursor: pointer;
    text-align: left;
}

    .connect-tmail-h:hover {
        background: var(--tms-surface-2);
    }

    .connect-tmail-h .tms-pill {
        font-size: 11.5px;
    }

    .connect-tmail.is-open .connect-tmail-h > svg:last-child {
        transform: rotate(180deg);
    }

.connect-tmail-hint {
    font-size: 12.5px;
}

.connect-tmail-b {
    padding: 4px 14px 14px;
    border-top: 1px solid var(--tms-border);
}

.connect-tmail-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

    .connect-tmail-list li {
        padding: 10px 0;
        border-bottom: 1px solid var(--tms-border);
        display: flex;
        flex-direction: column;
        gap: 3px;
        min-width: 0;
    }

        .connect-tmail-list li:last-child {
            border-bottom: 0;
        }

        .connect-tmail-list li.is-gone {
            opacity: .65;
        }

.connect-tmail-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.connect-tmail-from {
    font-size: 13.5px;
}

.connect-tmail-kind {
    font-size: 11.5px;
    color: var(--tms-text-3);
}

.connect-tmail-date {
    font-size: 12px;
}

.connect-tmail-subj {
    font-size: 13.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.connect-tmail-snip {
    font-size: 12.5px;
    color: var(--tms-text-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.connect-tmail-acts {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

/* ---- Tharsol Connect: "Get the Android app" (clients) -------------------------------------------------------------
   Components/ConnectAppRibbon, ConnectAppChip, ConnectAppPanel. Tinted: tint fill, saturated text, 1px border. */
.capp-glyph { width: 18px; height: 18px; flex: none; }

.capp-ribbon {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 14px; padding: 10px 10px 10px 14px;
  background: var(--tms-ok-tint); color: var(--tms-ok);
  border: 1px solid var(--tms-ok-line); border-radius: var(--tms-r-lg, 12px);
}
.capp-ic {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--tms-surface); border: 1px solid var(--tms-ok-line);
}
.capp-ic .capp-glyph { width: 20px; height: 20px; }
.capp-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.capp-text b { font-weight: 650; font-size: 14px; letter-spacing: -.01em; }
.capp-text small { font-size: 12.5px; color: var(--tms-text-2); }
.capp-acts { display: flex; align-items: center; gap: 8px; flex: none; }

.capp-link {
  background: none; border: 0; padding: 6px 4px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--tms-ok);
  text-decoration: underline; text-underline-offset: 3px;
}
.capp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; text-decoration: none;
  font-size: 13px; font-weight: 650;
  background: var(--tms-surface); color: var(--tms-ok); border: 1px solid var(--tms-ok-line);
}
.capp-btn:hover, .capp-btn:focus-visible { background: var(--tms-ok-tint); outline: none; box-shadow: 0 0 0 2px var(--tms-ok-line); }
.capp-x {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  background: none; border: 0; cursor: pointer; color: var(--tms-ok);
}
.capp-x:hover, .capp-x:focus-visible { background: var(--tms-surface); outline: none; }

/* "Update your app": the same ribbon, slimmer, tinted amber. */
.capp-ribbon.capp-update {
  padding: 6px 8px 6px 12px; gap: 10px;
  background: var(--tms-warn-tint); color: var(--tms-warn); border-color: var(--tms-warn-line);
}
.capp-update .capp-ic { width: 28px; height: 28px; border-color: var(--tms-warn-line); }
.capp-update .capp-ic .capp-glyph { width: 16px; height: 16px; }
.capp-update .capp-text b { font-size: 13.5px; }
.capp-update .capp-link, .capp-update .capp-x { color: var(--tms-warn); }

/* On the Support chat page the ribbon is the grid's first row, across every column. */
.tms-chat > .capp-ribbon { grid-column: 1 / -1; margin: 0; }
.tms-chat:has(> .capp-ribbon) { grid-template-rows: auto minmax(0, 1fr); }

/* The header chip, in place of the closed ribbon. */
.capp-chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 650;
  background: var(--tms-ok-tint); color: var(--tms-ok); border: 1px solid var(--tms-ok-line);
}
.capp-chip .capp-glyph { width: 16px; height: 16px; }
.capp-chip:hover, .capp-chip:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--tms-ok-line); }

/* The "Scan with phone" panel (inside TmsModal). */
.capp-panel { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.capp-qr {
  display: grid; place-items: center; width: 216px; height: 216px;
  background: #fff; border: 1px solid var(--tms-border); border-radius: 12px;
}
.capp-qr img { width: 200px; height: 200px; image-rendering: pixelated; }
.capp-qr-err { margin: 0; padding: 12px; text-align: center; font-size: 13px; color: var(--tms-danger); }
.capp-steps { align-self: stretch; margin: 0; padding-left: 22px; font-size: 14px; color: var(--tms-text-2); }
.capp-steps li { margin: 4px 0; }
.capp-steps b { color: var(--tms-text); font-weight: 650; }
.capp-meta { margin: 0; align-self: stretch; font-size: 12px; color: var(--tms-text-3); }

@media (max-width: 720px) {
  .capp-ribbon { flex-wrap: wrap; gap: 8px 10px; padding: 10px 8px 10px 12px; border-radius: 10px; }
  .capp-text small { display: none; }
  .capp-acts { order: 3; flex: 1 0 100%; justify-content: flex-end; }
  .tms-chat > .capp-ribbon { border-radius: 0; border-left: 0; border-right: 0; }
  .capp-chip { padding: 0 9px; }
  .capp-chip span { display: none; }
}

/* Tharsol Connect: the ticket page's "Share" (Components/ConnectTicketShare.razor): link, chat, email. */
.tc-share {
    position: relative;
    display: inline-flex;
}

.tc-share-pop {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(340px, 92vw);
    padding: 12px;
    border: 1px solid var(--tms-border);
    border-radius: 10px;
    background: var(--tms-surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    font-size: 13px;
}

.tc-share-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tc-share-top b {
    font-weight: 650;
}

.tc-share-link {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* The link box and "Copy link" share one height (the input is 40px and a small button 29px by default). */
.tc-share-link .tms-input,
.tc-share-link .tms-btn {
    height: 34px;
}

.tc-share-link .tms-input {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
}

.tc-share-link .tms-btn {
    flex: none;
}

/* The condensed header clips its contents while hidden (height 0); once shown, Share's and Add to release's
   popovers must be able to hang below it. */
.tms-t-stuck.is-shown {
    overflow: visible;
}

.tc-share-h {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: var(--tms-text-2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.tc-share-list {
    display: flex;
    flex-direction: column;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--tms-border);
    border-radius: 8px;
}

.tc-share-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.tc-share-opt + .tc-share-opt {
    border-top: 1px solid var(--tms-border);
}

.tc-share-opt:hover,
.tc-share-opt:focus-visible {
    background: var(--tms-hover, rgba(127, 127, 127, .12));
}

.tc-share-opt span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tc-share-opt small,
.tc-share-sub {
    color: var(--tms-text-2);
    font-size: 12px;
}

.tc-share-picked {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--tms-border);
    border-radius: 8px;
}

.tc-share-picked b {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tc-share-x {
    border: 0;
    background: none;
    color: var(--tms-text-2);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.tc-share-row {
    display: flex;
    justify-content: flex-end;
}

/* Tharsol Connect (release trains): the ticket page's "Add to release" picker (Components/ConnectReleaseAdd.razor). */
.tc-rel {
    position: relative;
    display: inline-flex;
}

.tc-rel-pop {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(300px, 90vw);
    padding: 10px;
    border: 1px solid var(--tms-border);
    border-radius: 10px;
    background: var(--tms-surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    font-size: 13px;
}

.tc-rel-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.tc-rel-sub {
    color: var(--tms-text-2);
    font-size: 12px;
}
