/* The installed app (2026-11-01, MVP). Everything here hangs under html.tt-app, which base.html.twig sets when the page runs
   installed from the home screen (display-mode standalone) or, to try it in a browser tab, after ?app=1. In a normal browser
   nothing changes. The ticket page on a phone: templates/tickets/_app_bar.html.twig and public/assets/js/tickets-app.js. */

.tk-app-only { display: none; }
.tt-remember { display: none !important; } /* the login panel styles every label */

.tt-app .tt-remember { display: flex !important; align-items: center; gap: .55rem; margin: -.75rem 0 1.25rem; font-size: .9rem; cursor: pointer; }
.tt-app .tt-remember input { width: 1.1rem; height: 1.1rem; accent-color: var(--vz-primary, #ee5b27); }
.tt-app .footer { display: none; }

@media (max-width: 767.98px) {
    /* ---------- ticket page: thread first, the rest behind chips and a bar ---------- */
    .tt-app .tk-topbar { margin-bottom: .6rem; }
    .tt-app .tk-show-body { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
    .tt-app .tk-head { padding: .8rem .9rem .7rem; margin-bottom: .7rem; }
    .tt-app .tk-head-meta { margin-bottom: .55rem; padding-bottom: 0; border-bottom: 0; }
    .tt-app .tt-toasts { bottom: calc(4.6rem + env(safe-area-inset-bottom)); }

    .tt-app .tk-app-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
    .tt-app .tk-app-chip { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; height: 2.2rem; padding: 0 .75rem; border: 1px solid var(--vz-border-color); border-radius: 999px; background: var(--vz-card-bg, #fff); color: var(--vz-body-color); font-size: .85rem; font-weight: 500; }
    .tt-app .tk-app-chip .tk-chip { margin: 0; }
    .tt-app .tk-app-chip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* sheets: the toolbar (Meer) and the rail (summary, location, category, customer) slide up from the bottom */
    .tt-app .tk-actions,
    .tt-app .tk-show-rail { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050; margin: 0; background: var(--vz-body-bg); border-radius: 1.1rem 1.1rem 0 0; box-shadow: 0 -.5rem 2rem rgba(0, 0, 0, .18); transform: translateY(105%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
    .tt-app body.tk-sheet-more .tk-actions,
    .tt-app body.tk-sheet-klant .tk-show-rail { transform: none; visibility: visible; transition: transform .22s ease; }
    .tt-app .tk-actions { display: flex; flex-direction: column; align-items: stretch; gap: .6rem; padding: .75rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
    .tt-app .tk-actions > * { width: 100%; }
    .tt-app .tk-actions .tk-bar-gap { display: none; }
    .tt-app .tk-actions .tk-pill { width: 100%; height: 2.75rem; justify-content: flex-start; font-size: .95rem; }
    .tt-app .tk-actions .tk-seg { width: 100%; }
    .tt-app .tk-actions .tk-seg > form, .tt-app .tk-actions .tk-seg > .dropdown { flex: 1 1 0; }
    .tt-app .tk-actions .tk-seg .tk-pill { justify-content: center; }
    .tt-app .tk-actions .tk-pill-text { max-width: none; flex: 1 1 auto; text-align: left; }
    .tt-app .tk-actions .tk-pill-icon::after { content: "Als spam markeren"; font-size: .9rem; }
    .tt-app .tk-show-rail { max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; padding: .75rem .75rem calc(1rem + env(safe-area-inset-bottom)); }
    .tt-app .tk-app-sheethead { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 0 0 .5rem; font-size: 1rem; }
    .tt-app .tk-app-x { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 2.25rem; height: 2.25rem; border: 0; border-radius: 999px; background: var(--vz-light); color: var(--vz-body-color); font-size: 1.2rem; }
    .tt-app .tk-app-backdrop { display: block; position: fixed; inset: 0; z-index: 1045; background: rgba(0, 0, 0, .35); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s linear .2s; }
    .tt-app body.tk-sheet-more .tk-app-backdrop,
    .tt-app body.tk-sheet-klant .tk-app-backdrop { opacity: 1; visibility: visible; transition: opacity .2s ease; }

    /* the bar at the bottom */
    .tt-app .tk-app-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; gap: .3rem; padding: .4rem .5rem calc(.4rem + env(safe-area-inset-bottom)); background: var(--vz-card-bg, #fff); border-top: 1px solid var(--vz-border-color); box-shadow: 0 -.25rem 1rem rgba(0, 0, 0, .06); }
    .tt-app .tk-app-bar > * { flex: 1 1 0; display: flex; min-width: 0; margin: 0; }
    .tt-app .tk-app-bar > .is-main { flex-grow: 1.35; }
    .tt-app .tk-app-btn { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; height: 3.1rem; padding: 0 .25rem; border: 0; border-radius: .8rem; background: transparent; color: var(--vz-body-color); font-size: .72rem; font-weight: 600; }
    .tt-app .tk-app-btn i { font-size: 1.3rem; line-height: 1; }
    .tt-app .tk-app-btn:active { background: var(--vz-light); }
    .tt-app .tk-app-btn.is-main { background: var(--vz-primary); color: #fff; }
    .tt-app .tk-app-btn.is-main:active { filter: brightness(.92); }
    .tt-app .tk-app-dot { position: absolute; top: .45rem; left: calc(50% + .55rem); width: .55rem; height: .55rem; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--vz-primary); }

    /* The editor: hidden until Antwoorden or Notitie, then a full screen sheet sized to what the keyboard leaves
       (tickets-app.js sets --tk-vv-*). One column of three parts: the top row (back, Antwoord | Notitie, tools), the editor
       that takes all the room that is left and scrolls inside itself, and the bottom row (Bijlage ... Versturen). Nothing is
       sticky or fixed inside it, so when the keyboard opens the editor shrinks and the rows stay where they are
       (2026-11-14; before, a sticky send bar slid over the text). */
    .tt-app .tk-reply { display: none; }
    .tt-app body.tk-composing { overflow: hidden; }
    .tt-app body.tk-composing .tk-reply { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; top: var(--tk-vv-top, 0px); height: var(--tk-vv-h, 100%); z-index: 1060; margin: 0; border: 0; border-radius: 0; box-shadow: none; overflow: hidden; background: var(--vz-card-bg, #fff); }
    .tt-app body.tk-composing .tk-ed-top { flex: none; padding: .5rem .6rem; padding-top: max(.5rem, env(safe-area-inset-top)); }
    .tt-app body.tk-composing .tk-ed-panes { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
    .tt-app body.tk-composing .tk-ed-panes > .tab-pane { display: none; }
    .tt-app body.tk-composing .tk-ed-panes > .tab-pane.active { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; padding: .5rem .6rem 0; border-radius: 0; }
    .tt-app body.tk-composing #tk-reply-form,
    .tt-app body.tk-composing #tk-note-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
    .tt-app body.tk-composing .tk-ai-ready,
    .tt-app body.tk-composing .tk-ai-notes,
    .tt-app body.tk-composing .tk-reply-head,
    .tt-app body.tk-composing .tk-files,
    .tt-app body.tk-composing .tk-ai-error { flex: none; }
    .tt-app body.tk-composing .tk-quill-wrap { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 5rem; }
    .tt-app body.tk-composing .tk-quill-wrap .ql-toolbar { flex: none; }
    .tt-app body.tk-composing .tk-quill-wrap .ql-container { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
    .tt-app body.tk-composing .tk-quill .ql-editor { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; font-size: 1rem; }
    .tt-app body.tk-composing .tk-ed-foot { flex: none; margin: .5rem -.6rem 0; padding: .5rem .6rem calc(.5rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--vz-border-color); background: var(--vz-card-bg, #fff); }
    .tt-app body.tk-composing .tk-forward { flex: none; max-height: 40%; overflow-y: auto; margin: .5rem 0; }
    .tt-app body.tk-composing .tk-ed-seg .nav-link { height: 2.1rem; padding: 0 .9rem; }
    /* the AI draft block on one line, its team note at most two, so the editor keeps its room above the keyboard */
    .tt-app body.tk-composing .tk-ai-ready { flex-wrap: nowrap; padding: .4rem .5rem; margin-bottom: .45rem; }
    .tt-app body.tk-composing .tk-ai-ready-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tt-app body.tk-composing .tk-ai-ready-text .text-muted { display: none; }
    .tt-app body.tk-composing .tk-ai-notes { margin-bottom: .45rem; font-size: .75rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .tt-app body.tk-composing .tk-ai-notes[hidden] { display: none; }
    .tt-app body.tk-composing .tk-reply-head { margin-bottom: .35rem; }
}
