/* ==========================================================================
   Event page: timeline on the left, information panel in tabs on the right.
   Everything is scoped to .ev-page.
   ========================================================================== */
.ev-page {
    color: var(--ev-text);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ev-page .ev-small { font-size: 0.78rem; }
.ev-page .ev-warn { color: #b45309; }
/* A late task (B4 of review #6): red, as everywhere */
.ev-page .ev-late { color: #dc2626; font-weight: 600; }

/* ---- Buttons ------------------------------------------------------------ */
.ev-page .ev-btn {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 36px; padding: 6px 12px; border-radius: 8px;
    border: 1px solid var(--ev-border); background: var(--ev-bg); color: var(--ev-text);
    font-size: 0.85rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.ev-page .ev-btn:hover { background: var(--ev-soft); color: var(--ev-text); }
.ev-page .ev-btn-primary { background: var(--ev-accent); border-color: var(--ev-accent); color: #ffffff; }
.ev-page .ev-btn-primary:hover { background: #4338ca; color: #ffffff; }
.ev-page .ev-btn-whatsapp { background: #16a34a; border-color: #16a34a; color: #ffffff; }
.ev-page .ev-btn-whatsapp:hover { background: #15803d; color: #ffffff; }
/* Beside its email (C1 of review #6): outlined, its icon green, never a second filled button */
.ev-page .ev-btn-wa-outline .fa-whatsapp { color: #16a34a; }
.ev-page :is(.ev-btn, .ev-link, .ev-tab, summary):focus-visible { outline: 2px solid var(--ev-accent); outline-offset: 2px; }

/* ---- Header ------------------------------------------------------------- */
.ev-header {
    background: var(--ev-bg); border: 1px solid var(--ev-border); border-radius: 12px;
    border-top: 4px solid var(--stage-color, #6b7280);
    padding: 14px 18px; display: flex; flex-direction: column; gap: 12px;
}
.ev-header-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ev-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-width: 0; }
.ev-title h1 { margin: 0; font-size: 1.35rem; font-weight: 700; }
.ev-title h1 a { color: inherit; text-decoration: none; }
.ev-title h1 a:hover { text-decoration: underline; }
.ev-type { font-size: 0.75rem; font-weight: 700; color: var(--chip-ink, #ffffff); background: var(--chip); border-radius: 999px; padding: 3px 10px; }
.ev-meta { font-size: 0.88rem; color: var(--ev-muted); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
a.ev-meta { color: var(--ev-accent); font-weight: 600; }
.ev-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Its name and its customer's buttons on one line (P3) on a wide screen: its date, guests and venue go under its name when
   they do not fit; narrower, its buttons under it */
@media (min-width: 1000px) {
    .ev-header-top { flex-wrap: nowrap; align-items: flex-start; }
    .ev-header-top .ev-title { flex: 1 1 auto; }
    .ev-header-top .ev-header-actions { flex: 0 0 auto; flex-wrap: nowrap; }
}
/* Row 2 (P1, P2 of the header's review, 27/11/2026): its stage's menu, its follow-up, its quote in a sentence; at the right
   its action of the moment, then « ⋯ » */
.ev-standing { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ev-standing-quote { font-size: 0.88rem; color: var(--ev-muted); flex: 1 1 180px; min-width: 0; }
.ev-standing-quote strong { color: var(--ev-muted); font-weight: 600; }
.ev-standing-quote .ev-link { padding: 0; border: 0; background: none; color: var(--ev-accent); font-weight: 600; cursor: pointer; }
.ev-standing-quote .ev-link:hover { text-decoration: underline; }
.ev-standing .ev-steps-phone { margin-left: auto; flex: 0 0 auto; }
.ev-standing .ev-more { order: 10; margin-left: auto; }
/* After its action: beside it (two auto margins would split the space between them) */
.ev-standing .ev-steps-phone:not(.ev-steps-phone-only) + .ev-more { margin-left: 0; }
/* Nothing to follow (P4): no grey « Suivi », its menu opened from « ⋯ » (shown while open) */
.ev-follow-up.fu-idle:not([open]) { display: none; }
/* « ⋯ › Me rappeler de relancer… » only while it is idle (an email sent, a call noted swap its follow-up, never « ⋯ ») */
.ev-header:not(:has(#ev-follow-up.fu-idle)) .ev-more [data-action="event-page#openFollowUp"] { display: none; }
/* Its follow-up now left of its row on a computer: its menu opens to the right (a phone: still to the left, the screen's edge) */
@media (min-width: 601px) { .ev-standing .ev-follow-up .ev-dropdown-menu { left: 0; right: auto; } }
.ev-header-actions .ev-reach .fa-whatsapp { color: #16a34a; }
/* Its number read and copied on a computer (E9), « Copier » an icon on its button (P3 of the header's review, 27/11/2026);
   on a phone, « Appeler » calls it */
.ev-reach-number { font-weight: 500; }
.ev-reach-call { display: inline-flex; }
.ev-reach-call > .ev-reach { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ev-reach-copy { display: inline-flex; }
.ev-page .ev-reach-copy .ev-btn { gap: 6px; padding: 6px 10px; border-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; color: var(--ev-muted); }
.ev-page .ev-reach-copy .ev-btn:hover { color: var(--ev-text); }
/* « Copié » heard (its live region always there, out of sight) and seen once copied */
.ev-copy-said { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ev-reach-copy.is-copied .ev-copy-said { position: static; width: auto; height: auto; overflow: visible; clip: auto; color: #15803d; align-self: center; margin-left: 6px; font-size: 0.85rem; font-weight: 600; }
/* No mailbox: its Email button leads to connecting it (D2 of the header's review) */
.ev-reach-later { font-weight: 500; color: var(--ev-muted); }
.ev-reach-plug { display: none; color: var(--ev-muted); font-size: 0.8em; }
@media (max-width: 600px) {
    .ev-reach-number, .ev-reach-copy, .ev-reach-later { display: none; }
    /* « · à connecter » does not fit a third of a phone: a plug says it */
    .ev-reach-plug { display: inline; }
    .ev-reach-call > .ev-reach { border-radius: 8px; }
}
/* Back from « Appeler » (E5): « Vous avez appelé Léa : On s'est parlé · Pas joint » */
.ev-called { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--ev-accent-soft); color: var(--ev-accent-text); font-weight: 600; }
.ev-called[hidden] { display: none; }
.ev-called .ev-called-close { margin-left: auto; }
.ev-called-form { display: contents; }
/* The Client tab's phone and email, corrected there (E4) */
.ev-grid2.ev-contact-fields { margin-top: 6px; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
@media (max-width: 520px) { .ev-grid2.ev-contact-fields { grid-template-columns: minmax(0, 1fr); } }
.ev-panel .ev-change-contact { align-self: flex-start; font-size: 0.82rem; font-weight: 600; margin-top: -4px; }
.ev-panel .ev-field[hidden] { display: none; }
.ev-contact-state { grid-column: 1 / -1; font-size: 0.78rem; color: var(--ev-muted); min-height: 1em; }

/* What comes next, under the stages: its next task, its quote */
.ev-next { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.88rem; color: var(--ev-text); }
.ev-next .ev-link { padding: 0; border: 0; background: none; color: var(--ev-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ev-next .ev-muted { color: var(--ev-muted); }
/* « À faire : ☐ tâche · Devis : … »: the next task ticked where it is (next_task_controller.js) */
.ev-next-task { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; }
/* Its buttons on the next line when they do not fit (lot 75, review #8: never a name crushed into a column, never a button past the card) */
.ev-next-task > * { flex: 0 1 auto; min-width: 0; }
.ev-next-task .ev-next-task-name { text-align: left; }
.ev-check { width: 22px; height: 22px; padding: 0; border: 1px solid var(--ev-line, #d1d5db); border-radius: 5px; background: var(--ev-bg, #fff); color: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.7rem; }
.ev-check:hover, .ev-check:focus-visible { border-color: #16a34a; color: #16a34a; }
.ev-check.ev-check-error { border-color: #dc2626; }
.ev-next-task.done .ev-check { background: #dcfce7; border-color: #16a34a; color: #16a34a; }
.ev-next-task.done .ev-next-task-name { text-decoration: line-through; color: var(--ev-muted); }
.ev-next-sep { color: var(--ev-muted); }
.ev-inline-form { display: inline; margin: 0; }

/* Its action of the moment (C3), at the right of its stage's row; « Passer à : … » on a phone only (its stage's menu says it
   elsewhere); its first message within the first screen */
.ev-steps-phone { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ev-steps-phone-only { display: none; }
.ev-steps-phone form:has(.ev-next-stage) { display: none; }
/* « Jour J › » (lot 68): a phone's main button; its header's link on a computer */
.ev-steps-phone .ev-day-go { display: none; }
/* A computer, its tabs beside its thread: « Jour J › » in its header would repeat the tab right there (lot 77, review #8) */
@media (min-width: 1201px) { .ev-next-day { display: none; } }
@media (max-width: 600px) {
    .ev-steps-phone-only { display: flex; }
    .ev-steps-phone form:has(.ev-next-stage) { display: block; }
    .ev-steps-phone .ev-day-go { display: inline-flex; }
    .ev-header:has(.ev-day-go) .ev-next-day { display: none; }
}
/* « Marquer perdu… » at the end of its stage's menu (C5) */
.ev-page .ev-stage-lost { color: #b91c1c; border-top: 1px solid var(--ev-border) !important; }
.ev-steps-phone form { margin: 0; }
/* Its stage's menu on every screen (P1 of the header's review; a phone's since C1), the current one said on its line */
.ev-stage-pick { flex: 0 0 auto; }
.ev-stage-pick .ev-dropdown-menu { width: max-content; max-width: min(440px, calc(100vw - 32px)); }
.ev-stage-pick .ev-dropdown-menu .ev-muted { white-space: nowrap; }
.ev-stage-word { color: var(--ev-muted); font-weight: 600; }
.ev-stage-pick > summary strong { color: var(--ev-text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-stage-pick > summary strong::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: var(--stage-color, #6b7280); }
.ev-stage-pick .ev-dropdown-menu button:disabled { opacity: 1; font-weight: 700; cursor: default; }
.ev-page .ev-dropdown-menu a.ev-phone-only { display: none; }
@media (max-width: 600px) {
    .ev-header { padding: 12px 14px; gap: 10px; }
    .ev-steps-phone .ev-btn, .ev-standing .ev-dropdown > summary, .ev-header-actions .ev-reach { min-height: 44px; }
    .ev-header-actions { width: 100%; gap: 6px; }
    .ev-header-actions .ev-reach-call, .ev-header-actions > .ev-reach { flex: 1 1 28%; }
    .ev-header-actions .ev-reach { justify-content: center; }
    .ev-reach-call > .ev-reach { flex: 1 1 auto; }
    /* « ● Devis envoyé ▾ · À relancer · 4 j · ⋯ » on one line, its quote then its action under it, a line each (C1, C7) */
    .ev-standing { gap: 8px 6px; }
    .ev-stage-pick { flex: 1 1 0; min-width: 0; }
    .ev-stage-pick > summary { display: flex; width: 100%; min-width: 0; }
    .ev-standing .ev-more { order: 3; }
    .ev-standing-quote { order: 4; flex-basis: 100%; }
    .ev-standing .ev-steps-phone { order: 5; flex-basis: 100%; margin-left: 0; }
    .ev-standing .ev-dropdown:not(.ev-follow-up) > summary { padding: 6px 10px; }
    .ev-follow-up .fu-since, .ev-stage-word, .ev-header .ev-follow-up .fu-badge > .fa { display: none; }
    .ev-follow-up .fu-badge { min-height: 44px; padding: 6px 10px; }
    .ev-page .ev-dropdown-menu a.ev-phone-only { display: flex; }
    /* « À faire » and « Devis » a line each, never a « · » left alone at the end of one (C7) */
    .ev-next { flex-direction: column; }
    .ev-next-sep { display: none; }
}

/* Dropdowns (details/summary) */
.ev-dropdown { position: relative; }
.ev-dropdown > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    min-height: 36px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--ev-border);
    background: var(--ev-bg); font-size: 0.85rem; font-weight: 600;
}
.ev-dropdown > summary::-webkit-details-marker { display: none; }
.ev-conflicts > summary { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.ev-dropdown-menu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 240px; max-width: 360px;
    background: var(--ev-bg); border: 1px solid var(--ev-border); border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); padding: 6px; display: flex; flex-direction: column;
}
.ev-dropdown-right { left: auto; right: 0; }
.ev-dropdown-menu a, .ev-dropdown-menu button {
    display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
    padding: 8px 10px; border-radius: 6px; border: 0; background: none; color: var(--ev-text);
    font-size: 0.85rem; text-decoration: none; cursor: pointer;
}
.ev-dropdown-menu a:hover, .ev-dropdown-menu button:hover { background: var(--ev-soft); }
.ev-dropdown-menu form { margin: 0; }

/* ---- Layout --------------------------------------------------------------- */
.ev-main { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 16px; align-items: start; }
/* A computer (C10): its save line kept in sight at the screen's foot while its panel is longer than the screen (never
   a panel scrolled on its own: its menus and lists would be cut at its edge) */
@media (min-width: 1201px) {
    .ev-main > .ev-side .ev-save { position: sticky; bottom: 0; z-index: 2; }
}
@media (max-width: 1200px) { .ev-main { grid-template-columns: minmax(0, 1fr); } }
/* A phone: the panel (its customer, date, place) before the timeline */
@media (max-width: 768px) { .ev-main > .ev-side { order: -1; } }
/* A phone: the panel folded to its tabs (data-folded, event_page_controller#fold), one touch opening it (E2) */
.ev-side-fold { display: none; }
@media (max-width: 768px) {
    .ev-side[data-folded] .ev-side-body { display: none; }
    .ev-side[data-folded] .ev-tabs { border-bottom: 0; border-radius: 12px; }
    .ev-side[data-folded] .ev-tab.active { background: transparent; color: var(--ev-muted); }
    .ev-side-fold { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; min-height: 36px; }
}

/* ---- Timeline ------------------------------------------------------------- */
.ev-thread { background: var(--ev-bg); border: 1px solid var(--ev-border); border-radius: 12px; display: flex; flex-direction: column; min-width: 0; }
.ev-thread-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--ev-border-soft); }
/* One choice, « Tout le fil ▾ » (C1; a computer's too since P6 of the header's review); a phone: its conversations in « ⋯ » */
.ev-filter-pick { display: block; margin: 0; }
.ev-filter-pick .form-select { min-height: 36px; font-size: 0.85rem; font-weight: 600; width: auto; }
@media (max-width: 600px) {
    .ev-thread-bar .ev-threads { display: none; }
    .ev-thread-bar { padding: 8px 12px; }
}
/* Wherever the timeline is cut (event_page_controller.js#cut, 768 px): on the line of its filters */
.ev-thread-bar .ev-show-older { width: auto; margin: 0 0 0 auto; }
.ev-thread-status { font-size: 0.68rem; font-weight: 700; padding: 1px 7px; border-radius: 8px; background: #f3f4f6; color: #6b7280; }
.ev-thread-status.status-todo { background: #fee2e2; color: #991b1b; }
.ev-thread-status.status-waiting { background: #e0f2fe; color: #075985; }
.ev-thread-status.status-done { background: #dcfce7; color: #166534; }

/* Its last exchanges in the page's own scroll, on a computer too (C8 of review #5: never a frame of ≈ 380 px scrolled
   beside the page's): event_page_controller#cut */
.ev-thread-scroll { padding: 14px 16px; overflow: visible; max-height: none; min-height: 0; }
.ev-items > .ev-cut { display: none; }
/* « Voir l'élément précédent »: a link on one line (C1) */
.ev-show-older {
    display: block; width: 100%; min-height: 36px; margin: 0 0 6px; padding: 0; border: 0;
    background: none; color: var(--ev-accent); font-size: 0.82rem; font-weight: 600; cursor: pointer;
    text-decoration: underline; text-underline-offset: 2px;
}
.ev-older { display: block; text-align: center; font-size: 0.82rem; margin-bottom: 10px; }
.ev-notice { font-size: 0.78rem; color: var(--ev-muted); text-align: center; margin: 0 0 8px; }

/* System lines */
.ev-system { display: flex; align-items: center; gap: 10px; padding: 2px 12px; font-size: 0.82rem; color: var(--ev-muted); }
.ev-system > i { width: 16px; text-align: center; }
.ev-system-text { flex: 1; min-width: 0; }
.ev-system time { font-size: 0.75rem; }
.ev-system-text a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
/* Several changes in a row, on one line to unfold (EventTimeline::gatherHistory()); a long line of its own too (P7 of the
   header's review, 27/11/2026: « Devis … accepté (…), l'événement passe à « Confirmé », restent à faire : … » took three
   underlined lines): one line cut with « … », whole once open, its mark outside its cut text */
.ev-history > details > summary, .ev-system-fold > summary { list-style: none; cursor: pointer; border-radius: 8px; }
.ev-history > details > summary::-webkit-details-marker, .ev-system-fold > summary::-webkit-details-marker { display: none; }
.ev-history > details > summary:hover, .ev-system-fold > summary:hover { background: var(--ev-soft); }
.ev-history > details > summary .ev-system-text, .ev-system-fold > summary .ev-system-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-history > details[open] > summary .ev-system-text, .ev-system-fold[open] > summary .ev-system-text { white-space: normal; }
/* A narrow thread (a phone, the quote editor's column): two lines at most (one would keep « Devis PN-2026-003 envoyé (577… » alone);
   the event's thread only (the Messagerie's conversation is an .ev-items too) */
.ev-items[data-controller~="timeline-fold"] { container-type: inline-size; }
@container (max-width: 600px) {
    .ev-history > details:not([open]) > summary .ev-system-text, .ev-system-fold:not([open]) > summary .ev-system-text {
        white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
    }
}
.ev-fold-mark::before { content: '▸'; color: var(--ev-muted); }
details[open] > summary > .ev-fold-mark::before { content: '▾'; }
/* A quote's explanation (« L'événement passe à « Confirmé », restent à faire : … »), under its line once open */
.ev-system-full { margin: 0 12px 4px 38px; font-size: 0.82rem; color: var(--ev-muted); }
.ev-history-lines .ev-system-full { margin: 2px 12px 2px 12px; }
.ev-history-lines { list-style: none; margin: 2px 0 6px 18px; padding: 0 0 0 8px; border-left: 2px solid var(--ev-border-soft); }
/* Stage of a stage change, in its pipeline colour */
.ev-stage { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--ev-text); }
.ev-stage::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--stage); flex: none; }

/* Composer */
.ev-composer { border-top: 1px solid var(--ev-border); background: var(--ev-soft); border-radius: 0 0 12px 12px; padding: 10px 16px 14px; }
.ev-composer .activity-tabs { margin-bottom: 10px; }
.ev-composer .activity-tab-pane.active { display: flex; flex-direction: column; gap: 8px; }
.ev-composer-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.ev-composer-actions form { margin: 0; }
/* WhatsApp's export how-to, folded (C12 of review #6) */
/* « Importer la discussion » under WhatsApp's message (lot 83): a line, wrapping on a phone */
.ev-wa-import { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--ev-border, #e5e7eb); }
.ev-composer-actions .ev-muted { margin-right: auto; }
.ev-composer .email-attachments-list { list-style: none; padding: 0; margin: 4px 0 0; font-size: 0.82rem; }

/* ---- Panel ---------------------------------------------------------------- */
/* Its tabs on top, an icon and its name: Événement · Client · Devis · Tâches */
.ev-side { display: flex; flex-direction: column; background: var(--ev-bg); border: 1px solid var(--ev-border); border-radius: 12px; min-width: 0; }
.ev-tabs { display: flex; gap: 4px; padding: 6px; background: var(--ev-soft); border-bottom: 1px solid var(--ev-border); border-radius: 12px 12px 0 0; }
.ev-tab {
    position: relative; flex: 1 1 0; min-width: 0; min-height: 44px; padding: 4px 6px; border-radius: 10px; border: 0; background: transparent;
    color: var(--ev-muted); font-size: 0.82rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.ev-tab > span:not(.ev-tab-badge):not([data-refresh]) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Its count shown again after a change (data-refresh): no box of its own, its badge laid out as before */
.ev-tab > [data-refresh] { display: contents; }
.ev-tab:hover { color: var(--ev-text); background: var(--ev-bg); }
.ev-tab.active { background: var(--ev-accent-soft); color: var(--ev-accent-text); }
.ev-tab-badge {
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; flex: none;
    font-size: 0.68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
    background: var(--ev-border); color: var(--ev-text);
}
.ev-tab-badge.danger { background: #dc2626; color: #ffffff; }
/* Five tabs (lot 68: « Jour J » once won): their words only, each its own width, never one cut (« Événe… ») */
.ev-tabs:has(> .ev-tab:nth-child(5)) .ev-tab { flex: 1 1 auto; gap: 4px; padding: 4px 6px; }
.ev-tabs:has(> .ev-tab:nth-child(5)) .ev-tab > .fa { display: none; }
/* A phone: its tabs a line of words (C12), never a third row of icons under the composer's and the bottom bar's */
@media (max-width: 480px) {
    .ev-tabs { gap: 2px; padding: 4px; }
    .ev-tab { gap: 4px; font-size: 0.8rem; min-height: 40px; padding: 4px 4px; }
    .ev-tab > .fa { display: none; }
    .ev-tab-badge { min-width: 16px; height: 16px; font-size: 0.66rem; }
}
/* Folded, level with the duration's field beside it (its label's height above, its field's height) */
.ev-period > summary { display: inline-flex; align-items: center; min-height: 38px; margin-top: 22px; font-size: 0.85rem; }
.ev-period[open] > summary { display: none; }

.ev-side-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ev-side-body > form { margin: 0; }
.ev-panel { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.ev-panel[hidden] { display: none; }
.ev-panel > h2 { margin: 0; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ev-muted); font-weight: 700; }
.ev-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ev-label { font-size: 0.75rem; font-weight: 600; color: #4b5563; margin: 0; }
.ea-dark-scheme .ev-label { color: #9ca3af; }
.ev-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
/* Its organisation's own fields (lot 50): a long text the whole row, a yes / no its box left of its words, a number its unit after it */
.ev-custom { margin-top: 10px; align-items: start; }
.ev-custom .ev-custom-wide, .ev-custom .ev-custom-check { grid-column: 1 / -1; }
.ev-custom .ev-custom-check { margin: 0; }
.ev-unit-row { display: flex; align-items: center; gap: 8px; }
.ev-unit-row > .form-control { flex: 1 1 auto; min-width: 0; }
.ev-contact-own { margin: 10px 0 0; font-size: .9rem; }
.ev-contact-own dt { font-weight: 600; font-size: .75rem; color: #4b5563; margin: 6px 0 0; }
.ea-dark-scheme .ev-contact-own dt { color: #9ca3af; }
.ev-contact-own dd { margin: 0; }
.ev-unit { color: var(--bs-secondary-color, #64748b); font-size: .9rem; white-space: nowrap; }
.ev-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
/* A phone: one field a line, but the event tab's short ones side by side (date and time, period and duration,
   guests, adults and children, pizzas and budget: E2) */
@media (max-width: 520px) { .ev-grid2, .ev-grid3 { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 341px) and (max-width: 520px) {
    #ev-panel-event .ev-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #ev-panel-event .ev-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Form controls of the panel and the composer: 14 px, values in full colour,
   examples clearly lighter, as in the mockup */
.ev-page {
    --ev-input-border: #d1d5db;
    --ev-placeholder: #9ca3af;
}
.ea-dark-scheme .ev-page {
    --ev-input-border: rgba(255, 255, 255, 0.16);
    --ev-placeholder: #6b7280;
}
.ev-page :is(.ev-panel, .ev-composer) :is(.form-control, .form-select) {
    font-size: 0.875rem; line-height: 1.4; color: var(--ev-text); font-weight: 400;
    min-height: 38px; padding: 7px 10px; border: 1px solid var(--ev-input-border); border-radius: 8px;
    background-color: var(--ev-bg); box-shadow: none;
}
.ev-page :is(.ev-panel, .ev-composer) .form-select { padding-right: 32px; background-position: right 10px center; }
.ev-page :is(.ev-panel, .ev-composer) textarea.form-control { min-height: 64px; resize: vertical; }
.ev-page :is(.ev-panel, .ev-composer) :is(.form-control, .form-select)::placeholder { color: var(--ev-placeholder); opacity: 1; }
.ev-page :is(.ev-panel, .ev-composer) :is(.form-control, .form-select):focus {
    border-color: var(--ev-accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); outline: 0;
}
.ev-page .ev-panel input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.ev-page .ev-panel input[type="number"]::-webkit-inner-spin-button,
.ev-page .ev-panel input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ev-page .ev-panel input[type="time"]::-webkit-calendar-picker-indicator { opacity: 0.5; }
.ev-page .ev-panel .input-group { flex-wrap: nowrap; }
.ev-page .ev-panel .input-group-text {
    font-size: 0.875rem; padding: 0 10px; min-height: 38px; color: var(--ev-muted); background: var(--ev-soft);
    border: 1px solid var(--ev-input-border); border-right: 0; border-radius: 8px 0 0 8px;
}
.ev-page .ev-panel .input-group > .form-control { border-radius: 0 8px 8px 0; }
/* Autocomplete (contacts, type, venue): the wrapper also has .form-select, but the
   field look belongs to its .ts-control (else the chevron ends up outside the field) */
.ev-page .ev-panel .ts-wrapper.form-select { padding: 0; min-height: 0; background-color: transparent; box-shadow: none; }
.ev-page .ev-panel .ts-wrapper { border: 0; border-radius: 8px; }
.ev-page .ev-panel .ts-wrapper .ts-control {
    font-size: 0.875rem; line-height: 1.4; color: var(--ev-text); min-height: 38px; padding: 7px 10px !important;
    border: 1px solid var(--ev-input-border) !important; border-radius: 8px !important; background: var(--ev-bg); box-shadow: none;
}
.ev-page .ev-panel .ts-wrapper.focus .ts-control { border-color: var(--ev-accent) !important; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); }
.ev-page .ev-panel .ts-wrapper .ts-control input { font-size: 0.875rem; color: var(--ev-text); }
.ev-page .ev-panel .ts-wrapper .ts-control input::placeholder { color: var(--ev-placeholder); opacity: 1; }
/* Date with its clear button inside the field */
.ev-page .ev-panel .input-with-clear { position: relative; display: block; }
.ev-page .ev-panel .input-with-clear .form-control { padding-right: 30px; }
.ev-page .ev-panel .clear-input-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); padding: 4px 8px; font-size: 0.8rem; }
/* Checkboxes (not switches), as in the mockup */
.ev-panel .form-check { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; padding-left: 0; min-height: 28px; font-size: 0.85rem; color: var(--ev-text); }
.ev-panel .form-check .form-check-input {
    float: none; margin: 0; flex: none; width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--ev-input-border); cursor: pointer;
}
.ev-panel .form-check .form-check-input:checked { background-color: var(--ev-accent); border-color: var(--ev-accent); }
.ev-panel .form-check .form-check-input:focus { box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); }
.ev-panel .form-check-label { cursor: pointer; }
/* Filled field: very light green border; empty field: orange (event_page_controller#refreshFill) */
.ev-page { --ev-fill-ok: #a7d9b5; --ev-fill-missing: #f5b27a; }
.ea-dark-scheme .ev-page { --ev-fill-ok: rgba(74, 222, 128, 0.35); --ev-fill-missing: rgba(251, 146, 60, 0.6); }
.ev-page .ev-panel .ev-field.ev-filled :is(.form-control, .form-select):not(:focus),
.ev-page .ev-panel .ev-field.ev-filled .input-group-text,
.ev-page .ev-panel .ev-field.ev-filled .ts-wrapper:not(.focus) .ts-control { border-color: var(--ev-fill-ok) !important; }
.ev-page .ev-panel .ev-field.ev-missing :is(.form-control, .form-select):not(:focus),
.ev-page .ev-panel .ev-field.ev-missing .input-group-text,
.ev-page .ev-panel .ev-field.ev-missing .ts-wrapper:not(.focus) .ts-control { border-color: var(--ev-fill-missing) !important; }
/* Its customer's answer on its quote's page (F1 of review #6), what the event waits on, in sight under its header's row */
.ev-page .ev-answer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--ev-accent-soft); color: var(--ev-accent-text); font-size: 0.9rem; }
.ev-page .ev-answer .ev-inline-form { display: inline; margin: 0; }
.ev-section { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--ev-border-soft); padding-top: 12px; }
/* The event tab's groups (« Quand », « Où », « Les convives », « Pour l'équipe »: C12 of review #5) */
.ev-section-title { margin: 0; font-size: 0.85rem; font-weight: 700; color: var(--ev-text); }
/* Its day's plan (lot 64; its lines: app.css .bq-plan-*) */
.ev-plan .bq-plan-actions { margin-top: 0; }
.ev-plan-remarks { padding: 8px 12px; border-radius: 8px; background: var(--ev-accent-soft); color: var(--ev-accent-text); font-size: 0.88rem; }
/* Its day, a tab of its own (lot 68): its hour above its plan; its customer's remark answered or settled; its customer's
   « Je ne sais pas » in orange; its sheets to print; a note put on its day sheet */
.ev-plan-hour { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ev-plan-hour .form-control { width: 7.5rem; }
.ev-plan-hour > .invalid-feedback { flex-basis: 100%; margin-top: 0; }
.ev-plan-remarks-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ev-plan-settled > summary { cursor: pointer; }
.ev-unknown-said { display: none; color: #b45309; font-weight: 600; font-size: 0.8rem; }
.ev-page .ev-field.ev-unknown .ev-unknown-said { display: block; }
.ev-page .ev-panel .ev-field.ev-unknown .form-control:not(:focus) { border-color: var(--ev-fill-missing) !important; }
.ev-print-links { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-note-sheet { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 0.8rem; color: var(--ev-muted); cursor: pointer; }
.ev-note-sheet .form-check-input { margin: 0; }
.ev-composer-actions .ev-note-sheet { margin-right: auto; }
.ev-page .ev-counts { display: block; }
.ev-fill-legend { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--ev-muted); }
.ev-fill-legend[hidden] { display: none; }
.ev-fill-swatch { width: 18px; height: 12px; border: 2px solid var(--ev-fill-missing); border-radius: 4px; flex: none; }
.ev-page .ev-help { margin: -6px 0 0; }

.ev-box { border: 1px solid var(--ev-border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; }
.ev-box-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ev-box a { text-decoration: none; }
.ev-box-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* « Autre proposition », « Nouveau devis » (C8 of review #6): 12 px around, never astride a card */
.ev-page .ev-quotes-new { margin: 12px 0; }
/* Its page opened by its customer (E3 of review #6) */
.ev-page .quote-opened { display: block; color: var(--ev-muted); }
.ev-page .quote-not-opened { color: #b45309; }
.ev-box-actions form { margin: 0; }
/* A quote's next steps, its link copied or sent (Devis tab) */
.quote-actions, .quote-online-link, .quote-ready-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.quote-actions form, .quote-ready-actions form { margin: 0; }
.ev-travel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; margin-bottom: 8px; }
.ev-other-event { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.85rem; text-decoration: none; padding: 4px 0; }
.ev-chip { font-size: 0.7rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; color: var(--chip-ink, #ffffff); background: var(--chip); }
.ev-status { font-size: 0.72rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; background: #f3f4f6; color: #4b5563; }
.ev-status-success { background: #dcfce7; color: #166534; }
.ev-status-warning { background: #fef3c7; color: #92400e; }
.ev-status-danger { background: #fee2e2; color: #991b1b; }
.ev-status-secondary { background: #f3f4f6; color: #4b5563; }

/* Before any save, a quiet line; once saved (.shown), green and kept in sight above the phone's bar (C7) */
.ev-save {
    margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 16px; border-top: 1px solid var(--ev-border); background: var(--ev-bg); border-radius: 0 0 12px 12px;
}
.ev-save.shown { position: sticky; bottom: var(--bq-tabbar-h, 0px); }
.ev-save-state { font-size: 0.82rem; color: var(--ev-muted); }
/* Nothing typed in the Devis and Tâches tabs: « Chaque modification est enregistrée aussitôt. » not said there (E11),
   no empty line under them on a computer (C13 of review #5), a phone's « Replier » kept */
.ev-side:has(#ev-panel-quotes:not([hidden]), #ev-panel-tasks:not([hidden])) .ev-save:not(.shown) .ev-save-state { visibility: hidden; }
@media (min-width: 769px) {
    .ev-side:has(#ev-panel-quotes:not([hidden]), #ev-panel-tasks:not([hidden])) .ev-save:not(.shown) { display: none; }
}
.ev-save.shown .ev-save-state { font-weight: 600; color: #047857; }
.ev-save-state.dirty, .ev-save.shown .ev-save-state.dirty { color: #b45309; font-weight: 600; }
.ev-save-state.dirty::before { content: '● '; }

/* Composer: the email being written answers an email of the timeline */
.ev-page .ev-replying { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; padding: 6px 10px; border-radius: 8px; background: var(--ev-accent-soft); color: var(--ev-accent-text); font-size: 0.82rem; }
.ev-page .ev-replying[hidden] { display: none; }
.ev-page .ev-replying .ev-link { margin-left: auto; }

/* ---- Follow-up (header) ------------------------------------------------- */
.ev-follow-up > summary { padding: 0; border: 0; background: none; min-height: 0; }
.ev-follow-up .fu-badge { min-height: 36px; padding: 6px 12px; border-radius: 8px; font-size: 0.85rem; }
.ev-follow-up .fu-badge .fa, .ev-follow-up .fu-badge .fab { font-size: 0.8rem; }
.ev-page .fu-menu { min-width: 320px; max-width: 360px; gap: 2px; }
.fu-menu .fu-explain { margin: 4px 10px 8px; font-size: 0.82rem; color: var(--ev-muted); }
.fu-menu .fu-section { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--ev-border-soft); }
.fu-menu .fu-heading { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ev-muted); margin: 0; }
.fu-menu .fu-channels { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-dropdown-menu .fu-channels button, .ev-dropdown-menu .fu-plan button.fu-submit {
    width: auto; padding: 5px 10px; border: 1px solid var(--ev-border); border-radius: 8px; font-weight: 600; font-size: 0.82rem;
}
.fu-menu .fu-plan-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-dropdown-menu .fu-plan-chips .fu-chip { width: auto; min-height: 32px; padding: 4px 10px; border: 1px solid var(--ev-border); border-radius: 999px; font-size: 0.8rem; font-weight: 600; justify-content: center; }
.ev-dropdown-menu .fu-plan-chips .fu-chip[aria-pressed="true"] { background: var(--ev-accent); border-color: var(--ev-accent); color: #fff; }
.ev-dropdown-menu .fu-plan button.fu-submit { align-self: flex-start; background: var(--ev-accent); border-color: var(--ev-accent); color: #fff; }
.ev-dropdown-menu .fu-plan button.fu-submit:hover { background: #4338ca; }
/* « Autre date… »: its day, its note, « Noter la date » (C3) */
.fu-menu .fu-other > summary { list-style: none; cursor: pointer; color: var(--ev-accent); font-size: 0.82rem; font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.fu-menu .fu-other > summary::-webkit-details-marker { display: none; }
.fu-menu .fu-other-form { display: flex; flex-direction: column; gap: 6px; }
.fu-menu .fu-hint { font-size: 0.78rem; color: var(--ev-muted); }
/* Its quote's link sent again, under « renvoyer son lien ? » (lot 77, review #8) */
.fu-resend { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.ev-dropdown-menu button.fu-write, .ev-dropdown-menu a.fu-write { background: var(--ev-accent); color: #fff; font-weight: 600; justify-content: center; margin-bottom: 4px; }
.ev-dropdown-menu button.fu-write:hover, .ev-dropdown-menu a.fu-write:hover { background: #4338ca; color: #fff; }
.ev-composer .fu-choice { margin-right: auto; }

/* The composer's call (EventCallController): its block (admin/call/_call_fields.html.twig, app.css), smaller here */
.ev-composer .bq-call-choice, .ev-composer .bq-call-at { font-size: 0.92em; }
.ev-composer .bq-call-label { font-size: 0.75rem; color: #4b5563; min-width: 7.5em; }
.ea-dark-scheme .ev-composer .bq-call-label { color: #9ca3af; }
/* A phone: the composer's four tabs of the same width, never cut (E8) */
@media (max-width: 600px) {
    .ev-composer .activity-tabs { overflow: visible; }
    .ev-composer .activity-tab { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 0.75rem; justify-content: center; }
}

/* A phone: menus open as a sheet at the bottom of the screen (never off its edge), the page dimmed behind; tapping it closes */
@media (max-width: 600px) {
    .ev-dropdown[open] > summary::before {
        content: ''; position: fixed; inset: 0; z-index: 1040; background: rgba(15, 23, 42, 0.4); cursor: default;
    }
    .ev-page .ev-dropdown-menu, .ev-page .ev-dropdown-right, .ev-page .fu-menu {
        position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 1041;
        min-width: 0; max-width: none; max-height: 85vh; overflow-y: auto;
        border-radius: 14px 14px 0 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    }
    .ev-dropdown-menu a, .ev-dropdown-menu button { min-height: 44px; }
}

/* A stage change's message: "Annuler" in it (EventStageController::undo()) */
.ev-undo { margin: 0 4px 0 0; }
.ev-undo .btn { font-weight: 700; min-height: 32px; }

/* The email's files: « Joindre un fichier » (its file field hidden, focused through it: E11) */
.ev-mail-files { align-items: flex-start; }
.ev-attach { cursor: pointer; }
#ev-mail-files:focus-visible + .ev-attach { outline: 2px solid var(--ev-accent); outline-offset: 2px; }

/* The writing area folded to one line until touched (E3): its note's field one line, its label and button away */
.ev-composer:not(.open) [data-tab-pane="comment"] > .ev-label,
.ev-composer:not(.open) [data-tab-pane="comment"] > .ev-composer-actions { display: none; }
.ev-composer:not(.open) [data-tab-pane="comment"] > textarea { height: 40px; min-height: 40px; resize: none; overflow: hidden; }

/* The email's head on one grey line (C2): « De Pizza Démo <…> · ↩ Réponse à « … » (…) · Nouvel email » */
.ev-composer .ev-mail-head { margin: 0; padding: 6px 10px; border-radius: 8px; background: var(--ev-bg); border: 1px solid var(--ev-border-soft); font-size: 0.8rem; color: var(--ev-muted); line-height: 1.5; }
.ev-composer .ev-mail-head .email-inline-from { display: inline; background: none; padding: 0; margin: 0; font-size: inherit; color: inherit; }
.ev-composer .ev-mail-head .email-inline-from-value { color: var(--ev-text); }
.ev-page .ev-mail-head .ev-replying { display: inline; margin: 0; padding: 0; background: none; color: inherit; font-size: inherit; }
.ev-page .ev-mail-head .ev-replying[hidden] { display: none; }
.ev-page .ev-mail-head .ev-replying strong { color: var(--ev-text); }
.ev-page .ev-mail-head .ev-link, .ev-page .ev-mail-warning .ev-link { font-size: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
/* « Joindre un fichier » and « Joindre le devis » side by side (C2) */
.ev-mail-attach { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ev-mail-attach form { margin: 0; }
/* « Envoyer » in sight while the message is long (C2), above the phone's bar */
.ev-composer .ev-mail-send { position: sticky; bottom: var(--bq-tabbar-h, 0px); z-index: 5; background: var(--ev-soft); padding: 8px 0; border-top: 1px solid var(--ev-border); box-shadow: 0 -8px 12px -12px rgba(15, 23, 42, .35); }
/* On a phone, one row (C2): « 🔔 Relance : dans 1 semaine ▾ · Envoyer », its choice shrinking before it wraps */
@media (max-width: 767.98px) {
    .ev-composer .ev-mail-send { padding: 6px 0; }
    .ev-composer .ev-mail-send .fu-choice { flex: 1 1 0; min-width: 0; }
    .ev-composer .ev-mail-send .fu-choice select { flex: 1 1 0; min-width: 0; }
    .ev-composer .ev-mail-send .fu-label-long { display: none; }
    .ev-composer .ev-mail-send .fu-label-short { display: inline; }
    .ev-composer .ev-mail-send .fu-choice label > .fa { display: none; }
}

/* No mailbox to send from (E1 of review #5): its whole line, above « Envoyer » */
.ev-mail-nobox { flex-basis: 100%; margin: 0 0 4px; font-size: .85rem; color: #b45309; }
.ev-mail-nobox a { font-weight: 600; }

/* Its day past, what did not come back (lot 77, review #8) */
.ev-not-back { color: #b45309; }
