/* ===========================================================
   Films: the short self-playing illustrations on features.html
   (films.js). Each is one frame, 640×420 like the home page's
   journey film (.bridge-movie in styles.css), that plays while on
   screen, holds, and plays again. Without JS, under reduced motion
   or with the accessibility menu's motion off, the frame shows the
   finished picture once (films.js adds .is-done; the .no-js rule
   below covers a script that never arrived).
   Scenes are driven by classes films.js adds to the .film root:
     chat    is-in on each message, is-typing (Orli's dots), is-writing
             (the patient's box), is-picked (the time taken)
     remind  is-b1 (visit done) is-b2 (months pass) is-b3 (email)
             is-b4 (tap) is-b5 (widget) is-b6 (slot) is-b7 (booked)
     stats   is-s1 / is-s2 / is-s3 pick the screen; is-b1 (tiles count)
             is-b2 (day bars) is-b3 (deltas, average) is-b4 (donut)
             is-b5 (treatment bars) is-b6 (hour bars) is-b7 (attendance)
     call    is-ringing, is-on, is-talking, is-caller, is-booked, is-texted
     outage  is-b1 (down) is-b2 (booking queued) is-b3 (patient told)
             is-b4 (back up) is-b5 (written)
   =========================================================== */
.film {
  position: relative; width: min(640px, 100%); min-height: 420px; margin-inline: auto;
  font-size: 1rem; color: var(--ink);
  -webkit-user-select: none; user-select: none;
}
/* A clear layer over the picture: the film's words cannot be selected. */
.film::after { content: ""; position: absolute; inset: 0; z-index: 5; }
.film-frame {
  position: relative; display: flex; flex-direction: column; min-height: 420px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.film-bar { display: flex; align-items: center; gap: 10px; padding: 11px 16px; background: var(--cream-2); border-bottom: 1px solid var(--line); }
.film-bar img { width: 28px; height: 28px; border-radius: 50%; }
.film-bar b { font-size: .92rem; }
.film-bar small { display: block; font-size: .72rem; color: var(--ink-soft); min-height: 1em; }
.film-bar .film-dots { display: flex; gap: 6px; }
.film-bar .film-dots span { width: 9px; height: 9px; border-radius: 50%; background: #c9c2b2; }
.film-bar i { margin-inline-start: auto; font-style: normal; font-size: .74rem; color: var(--ink-soft); direction: ltr; }
/* Shared beats: a thing that arrives, and a tap ring that blooms once. */
.film .f-in { opacity: 0; transform: translateY(10px); transition: opacity .4s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
.film .f-in.is-in { opacity: 1; transform: none; }
.f-tap { position: absolute; inset: -3px; border-radius: inherit; border: 2px solid var(--teal); opacity: 0; pointer-events: none; }
.is-tapping > .f-tap { animation: f-tap .9s cubic-bezier(0, 0, .2, 1) forwards; }
@keyframes f-tap { 0% { transform: scale(.94); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }
.f-check { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: color-mix(in srgb, var(--teal) 12%, transparent); color: var(--teal); margin: 0 auto 10px; }
.f-check svg { width: 24px; height: 24px; }
.f-check::after { content: ""; position: absolute; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--teal); opacity: 0; }
.is-in > .f-check::after { animation: f-tap 1s cubic-bezier(0, 0, .2, 1) .3s forwards; }

/* ---------- chat ---------- */
.film-chat .film-frame { max-width: 420px; margin-inline: auto; }
.film-chat .film-bar { padding: 12px 16px; background: var(--surface); }
.film-chat .film-bar img { width: 36px; height: 36px; }
.film-chat .film-bar small::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-inline-end: 5px; border-radius: 50%; background: var(--teal); vertical-align: 1px; }
.fc-body {
  flex: none; display: flex; flex-direction: column; gap: 9px;
  padding: 16px 16px 10px; height: 300px; overflow: hidden;
  font-size: .92rem; line-height: 1.45;
}
/* The thread rests on the foot of the box until it is long enough to scroll
   (films.js scrolls it down as each line arrives). */
.fc-body::before { content: ""; flex: 1 0 0; }
.fc-msg { max-width: 88%; padding: 9px 13px; border-radius: 14px; }
/* As the admin draws a conversation: the patient on the right, Orli on the left. */
.fc-msg.bot { background: var(--cream-2); border-start-end-radius: 4px; align-self: flex-end; transform-origin: left bottom; }
.fc-msg.me { background: var(--teal-deep); color: #fff; border-start-start-radius: 4px; align-self: flex-start; transform-origin: right bottom; }
/* Messages not yet said take no room, so the thread grows as it is written. */
.fc-msg:not(.is-in) { display: none; }
.film-chat:not(.is-done) .fc-msg.is-in, .film-chat:not(.is-done).is-typing .fc-typing { animation: fc-in .4s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes fc-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }
.fc-cardlet { margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: .86rem; }
.fc-cardlet b { display: block; }
.fc-cardlet small { color: var(--ink-soft); }
/* The booking itself: a tick beside the visit, arriving just after the line. */
.fc-msg[data-booked] .fc-cardlet { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; background: color-mix(in srgb, var(--teal) 8%, var(--surface)); border-color: color-mix(in srgb, var(--teal) 40%, var(--line)); }
.fc-msg[data-booked] .fc-cardlet::before { content: ""; grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; background: var(--teal) no-repeat center / 15px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E"); }
.film-chat:not(.is-done) .fc-msg[data-booked].is-in .fc-cardlet { animation: fc-in .5s cubic-bezier(.2, .7, .2, 1) .45s both; }
.fc-slots { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.fc-slots span { position: relative; border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: .84rem; font-weight: 600; background: var(--surface); font-variant-numeric: tabular-nums; transition: background .25s ease, color .25s ease, border-color .25s ease; }
.film-chat:not(.is-done) .fc-msg.is-in .fc-slots span { animation: fc-in .35s cubic-bezier(.2, .7, .2, 1) both; }
.fc-slots span:nth-child(1) { animation-delay: .25s; } .fc-slots span:nth-child(2) { animation-delay: .35s; }
.fc-slots span:nth-child(3) { animation-delay: .45s; } .fc-slots span:nth-child(4) { animation-delay: .55s; }
.film-chat.is-picked .fc-slots [data-pick] { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.fc-typing { display: none; align-self: flex-end; gap: 4px; padding: 10px 14px; background: var(--cream-2); border-radius: 14px; border-start-end-radius: 4px; transform-origin: left bottom; }
.film-chat.is-typing .fc-typing { display: flex; }
.fc-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); opacity: .4; animation: fc-dot 1.1s ease-in-out infinite; }
.fc-typing span:nth-child(2) { animation-delay: .18s; } .fc-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes fc-dot { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.fc-input { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.fc-input span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; color: var(--ink-soft); font-size: .86rem; transition: border-color .2s ease, color .2s ease; }
/* While the patient writes: the box lights, a caret blinks, the button wakes. */
.film-chat.is-writing .fc-input span { color: var(--ink); border-color: var(--teal); }
.film-chat.is-writing .fc-input span::after { content: ""; display: inline-block; width: 1.5px; height: 1.05em; margin-inline-start: 2px; vertical-align: -.15em; background: var(--teal-deep); animation: fc-caret 1s steps(1) infinite; }
@keyframes fc-caret { 50% { opacity: 0; } }
.fc-input i { position: relative; width: 34px; height: 34px; border-radius: 50%; background: var(--teal-deep); flex: none; opacity: .4; transition: opacity .25s ease; }
.film-chat.is-writing .fc-input i { opacity: 1; }
.fc-input i::after { content: ""; display: block; width: 100%; height: 100%; background: no-repeat center / 16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E"); transform: scaleX(-1); }

/* ---------- reminder ---------- */
.film-remind .film-frame { padding: 18px; gap: 14px; }
.fr-visit { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--cream); }
.fr-visit .fr-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--teal) 12%, transparent); color: var(--teal-deep); flex: none; }
.fr-visit .fr-ico svg { width: 20px; height: 20px; }
.fr-visit b { display: block; font-size: .95rem; }
.fr-visit small { color: var(--ink-soft); font-size: .8rem; }
.fr-done { margin-inline-start: auto; font-size: .76rem; font-weight: 700; color: var(--teal-deep); background: color-mix(in srgb, var(--teal) 12%, transparent); border-radius: 999px; padding: 3px 10px; opacity: 0; transition: opacity .3s ease; }
.film-remind.is-b1 .fr-done { opacity: 1; }
/* The months between the visit and the invitation: a rail that fills. */
.fr-rail { position: relative; margin: 6px 4px 0; padding-top: 22px; }
.fr-rail-line { height: 4px; border-radius: 2px; background: var(--cream-2); overflow: hidden; }
.fr-rail-fill { height: 100%; width: 0; background: var(--teal); transition: width 2.2s cubic-bezier(.3, .1, .3, 1); }
.film-remind.is-b2 .fr-rail-fill { width: 100%; }
.fr-rail-labels { display: flex; justify-content: space-between; font-size: .74rem; color: var(--ink-soft); margin-top: 8px; font-variant-numeric: tabular-nums; }
.fr-rail-labels b { color: var(--ink); }
.fr-rail-pin {
  position: absolute; top: -2px; inset-inline-end: 0; transform: translateX(50%);
  font-size: .72rem; font-weight: 700; color: var(--teal-deep); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px;
  opacity: 0; transition: opacity .3s ease .4s;
}
html[dir="rtl"] .fr-rail-pin { transform: translateX(-50%); }
.film-remind.is-b2 .fr-rail-pin { opacity: 1; transition-delay: 2s; }
/* The invitation, as the clinic's own email. */
.fr-mail { position: relative; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.fr-mail-top { display: flex; gap: 8px; align-items: baseline; padding: 9px 14px; background: var(--cream); border-bottom: 1px solid var(--line); font-size: .76rem; color: var(--ink-soft); }
.fr-mail-top b { color: var(--ink); font-size: .84rem; }
.fr-mail-body { padding: 14px 16px 16px; font-size: .9rem; line-height: 1.5; }
.fr-mail-body p { margin: 0 0 10px; }
.fr-mail-body em { color: var(--teal-deep); font-weight: 600; }
.fr-btn { position: relative; display: inline-block; background: var(--teal-deep); color: #fff; border-radius: 999px; padding: 8px 18px; font-weight: 600; font-size: .88rem; }
.film-remind.is-b4 .fr-btn { animation: bridge-press .5s ease; }
.film-remind.is-b4 .fr-btn .f-tap { animation: f-tap .9s cubic-bezier(0, 0, .2, 1) forwards; }
/* The booking panel rises over the email, the treatment already chosen. */
.fr-widget {
  position: absolute; inset-inline: 18px; bottom: 18px; z-index: 3;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 18px; padding: 14px 16px;
  opacity: 0; transform: translateY(14px) scale(.98); transition: opacity .3s ease, transform .4s cubic-bezier(.2, .8, .2, 1);
}
.film-remind.is-b5 .fr-widget { opacity: 1; transform: none; }
.fr-widget .bw-title { font-size: 1rem; }
.fr-widget .fr-pre { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--teal-deep); font-weight: 600; background: color-mix(in srgb, var(--teal) 10%, transparent); border-radius: 999px; padding: 2px 10px; margin: 4px 0 8px; }
.fr-widget .bw-slots { grid-template-columns: repeat(3, 1fr); }
.fr-widget .bw-slots span { transition: background .25s ease, color .25s ease, border-color .25s ease; }
.film-remind.is-b6 .fr-widget .bw-slots [data-pick] { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.fr-widget .fr-pick { transition: opacity .3s ease; }
.fr-widget .fr-booked {
  position: absolute; inset: 14px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: #fff; opacity: 0; transform: translateY(6px); transition: opacity .4s ease .15s, transform .4s ease .15s;
}
.fr-booked .f-check { position: relative; }
.fr-booked b { font-size: 1.1rem; }
.fr-booked small { color: var(--ink-soft); font-size: .84rem; }
.film-remind.is-b7 .fr-widget .fr-pick { opacity: 0; }
.film-remind.is-b7 .fr-widget .fr-booked { opacity: 1; transform: none; }
.film-remind.is-b7 .fr-widget .fr-booked .f-check::after { animation: f-tap 1s cubic-bezier(0, 0, .2, 1) .4s forwards; }
.fr-shade { position: absolute; inset: 0; z-index: 2; background: rgba(20, 40, 36, .18); opacity: 0; transition: opacity .4s ease; border-radius: 18px; }
.film-remind.is-b5 .fr-shade { opacity: 1; }

/* ---------- analytics ---------- */
.film-stats .film-frame { padding: 16px 18px 18px; gap: 12px; }
.fs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fs-head b { font-size: 1rem; }
.fs-pills { display: flex; gap: 5px; }
.fs-pills span { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: .74rem; background: var(--cream); }
.fs-pills span.on { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.fs-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fs-tile { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--cream); min-width: 0; }
.fs-tile .l { font-size: .72rem; font-weight: 600; color: var(--ink-soft); }
.fs-tile .v { font-size: 1.6rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.fs-tile .d { font-size: .72rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .4s ease; min-height: 1.2em; }
.film-stats.is-b3 .fs-tile .d { opacity: 1; }
.fs-chart { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 8px; background: var(--surface); display: flex; flex-direction: column; min-height: 150px; }
.fs-chart h5 { margin: 0 0 6px; font-size: .8rem; font-weight: 700; }
.fs-bars { flex: 1; display: grid; grid-template-columns: repeat(14, 1fr); align-items: end; gap: 5px; min-height: 100px; padding-bottom: 4px; border-bottom: 1px solid var(--line); position: relative; }
.fs-bars i { display: block; height: var(--h); border-radius: 3px 3px 0 0; background: var(--teal); transform: scaleY(0); transform-origin: bottom; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.film-stats.is-b2 .fs-scene[data-s="1"] .fs-bars i { transform: none; }
.fs-avg { position: absolute; inset-inline: 0; bottom: 48%; border-top: 2px dashed var(--ink); opacity: 0; transition: opacity .4s ease; }
.film-stats.is-b3 .fs-avg { opacity: .7; }
.fs-legend { display: flex; gap: 14px; font-size: .7rem; color: var(--ink-soft); margin-top: 6px; }
.fs-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--teal); margin-inline-end: 4px; vertical-align: -1px; }
.fs-legend i.avg { height: 0; width: 12px; border-top: 2px dashed var(--ink); vertical-align: 2px; background: none; }
/* Three screens of the dashboard in one frame; films.js fades between them.
   The screens share one grid cell, so the stage is as tall as the tallest
   screen and no card is squeezed until its last row spills out. */
.fs-stage { position: relative; flex: 1; min-height: 330px; display: grid; }
.fs-scene { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 12px; opacity: 0; transition: opacity .5s ease; pointer-events: none; }
.film-stats.is-s1 .fs-scene[data-s="1"], .film-stats.is-s2 .fs-scene[data-s="2"], .film-stats.is-s3 .fs-scene[data-s="3"] { opacity: 1; }
.fs-scene--two .fs-chart { flex: 1 0 auto; }
.fs-chart--thin, .fs-chart--donut { flex: 0 0 auto; min-height: 0; }
/* Where the bookings came from: a donut whose slices draw clockwise. */
.fs-donut-wrap { display: flex; align-items: center; gap: 18px; }
.fs-donut { width: 104px; height: 104px; flex: none; transform: rotate(-90deg); }
.fs-ring { fill: none; stroke: var(--cream-2); stroke-width: 18; }
.fs-slice { fill: none; stroke: var(--c); stroke-width: 18; stroke-dasharray: 0 276.5; stroke-dashoffset: var(--off); transition: stroke-dasharray .9s cubic-bezier(.2, .7, .2, 1); }
.film-stats.is-b4 .fs-slice { stroke-dasharray: var(--len) 276.5; }
.film-stats.is-b4 .fs-slice:nth-of-type(3) { transition-delay: .5s; }
.film-stats.is-b4 .fs-slice:nth-of-type(4) { transition-delay: .8s; }
.fs-donut text { transform: rotate(90deg); transform-origin: 60px 60px; text-anchor: middle; fill: var(--ink); font-family: var(--sans); }
.fs-donut-n { font-size: 20px; font-weight: 700; }
.fs-donut-l { font-size: 9px; fill: var(--ink-soft); }
.fs-keys { display: grid; gap: 6px; font-size: .78rem; min-width: 0; flex: 1; max-width: 220px; }
.fs-keys div { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.fs-keys i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.fs-keys b { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.fs-keys--row { display: flex; gap: 14px; margin-top: 8px; }
.fs-keys--row b { margin-inline-start: 4px; }
/* What was booked: horizontal bars that grow from the label. */
.fs-hbars { display: grid; gap: 8px; font-size: .78rem; margin-top: 4px; }
.fs-hbars div { display: grid; grid-template-columns: 6.5em 1fr 2em; align-items: center; gap: 8px; }
.fs-hbars i { display: block; height: 10px; width: 0; border-radius: 0 4px 4px 0; background: var(--teal); transition: width .7s cubic-bezier(.2, .7, .2, 1); }
.film-stats.is-b5 .fs-hbars i { width: var(--w); }
.fs-hbars b { text-align: end; font-variant-numeric: tabular-nums; color: var(--ink-soft); font-weight: 500; }
/* When patients book: two-hour buckets, the evening peak called out. */
.fs-bars--hours { grid-template-columns: repeat(12, 1fr); min-height: 120px; }
.fs-bars--hours i.peak { background: var(--teal-deep); }
.film-stats.is-b6 .fs-bars--hours i { transform: none; }
.fs-call { position: absolute; top: 0; inset-inline-start: 0; font-size: .72rem; font-weight: 600; color: var(--teal-deep); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; opacity: 0; transition: opacity .4s ease .9s; }
.film-stats.is-b6 .fs-call { opacity: 1; }
.fs-axis { display: flex; justify-content: space-between; font-size: .66rem; color: var(--ink-soft); margin-top: 4px; font-variant-numeric: tabular-nums; direction: ltr; }
/* Who showed up: one bar, three parts. */
.fs-stack { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--cream-2); gap: 2px; }
.fs-stack span { flex: 0 0 0%; transition: flex-basis .8s cubic-bezier(.2, .7, .2, 1); }
.film-stats.is-b7 .fs-stack span { flex-basis: var(--p); }
.film-stats.is-b7 .fs-stack span:nth-child(2) { transition-delay: .5s; }
.film-stats.is-b7 .fs-stack span:nth-child(3) { transition-delay: .7s; }

/* ---------- outage ---------- */
.film-outage .film-frame { padding: 16px 18px; gap: 10px; }
.fo-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fo-head b { font-size: 1rem; }
.fo-status { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 3px 11px; font-size: .78rem; font-weight: 600; border: 1px solid rgba(15, 138, 134, .4); background: rgba(15, 138, 134, .08); color: var(--teal-deep); transition: background .3s ease, color .3s ease, border-color .3s ease; }
.fo-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(15, 138, 134, .5); animation: fo-beam 1.8s ease-out infinite; }
@keyframes fo-beam { 0% { box-shadow: 0 0 0 0 rgba(15, 138, 134, .5); } 100% { box-shadow: 0 0 0 8px rgba(15, 138, 134, 0); } }
.fo-status .up, .fo-status .down { display: inline; }
.fo-status .down { display: none; }
.film-outage.is-down .fo-status { border-color: #e3b1a6; background: #fbe6e1; color: #8a3b2c; }
.film-outage.is-down .fo-status::before { background: #c9412a; animation: none; }
.film-outage.is-down .fo-status .up { display: none; } .film-outage.is-down .fo-status .down { display: inline; }
.fo-note { font-size: .76rem; color: var(--ink-soft); min-height: 1.2em; opacity: 0; transition: opacity .3s ease; }
.film-outage.is-down .fo-note { opacity: 1; }
.fo-cal { display: grid; grid-template-columns: 52px 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; font-size: .82rem; }
.fo-cal > div { border-bottom: 1px solid var(--cream-2); min-height: 46px; display: flex; align-items: center; padding: 4px 8px; }
.fo-cal > div:nth-last-child(-n+2) { border-bottom: 0; }
.fo-cal .t { color: var(--ink-soft); justify-content: center; background: var(--cream); font-variant-numeric: tabular-nums; }
.fo-ev { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; background: var(--cream-2); border-inline-start: 3px solid var(--line); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fo-ev.new { opacity: 0; transform: scale(.6, .8); transform-origin: right center; transition: opacity .3s ease, transform .5s cubic-bezier(.34, 1.56, .64, 1), background .4s ease, border-color .4s ease; background: #fff3c4; border-inline-start-color: #c9982f; outline: 1px dashed #c9982f; }
.film-outage.is-b2 .fo-ev.new { opacity: 1; transform: none; }
.fo-ev .mark { font-size: .8rem; color: #8a6a0f; }
.fo-ev .ok { display: none; color: var(--teal-deep); }
.film-outage.is-b5 .fo-ev.new { background: color-mix(in srgb, var(--teal) 16%, var(--surface)); border-inline-start-color: var(--teal-deep); outline: 0; animation: bridge-pop-flash 1.1s ease-out both; }
.film-outage.is-b5 .fo-ev .mark { display: none; } .film-outage.is-b5 .fo-ev .ok { display: inline; }
.fo-toast {
  position: absolute; inset-inline: 18px; bottom: 16px; display: flex; align-items: center; gap: 10px;
  background: var(--dark); color: #f6f3ec; border-radius: 12px; padding: 10px 14px; font-size: .84rem; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .4s cubic-bezier(.2, .7, .2, 1);
}
.fo-toast svg { width: 16px; height: 16px; flex: none; color: var(--teal-bright); }
.film-outage.is-b3:not(.is-b4) .fo-toast { opacity: 1; transform: none; }
.fo-toast.late { display: none; }
.film-outage.is-b5 .fo-toast.late { display: flex; opacity: 1; transform: none; }
.film-outage.is-b5 .fo-toast.early { display: none; }

/* ---------- call ---------- */
.film-call .film-frame { max-width: 300px; margin-inline: auto; align-items: center; padding: 30px 20px 22px; border-radius: 38px; text-align: center; }
.fp-status { display: grid; min-height: 1.4em; font-size: .86rem; font-weight: 600; color: var(--teal-deep); }
.fp-status span { grid-area: 1 / 1; opacity: 0; transition: opacity .3s ease; }
.fp-status .fp-s1, .film-call.is-on .fp-status .fp-s2, .film-call.is-booked .fp-status .fp-s3 { opacity: 1; }
.film-call.is-on .fp-status .fp-s1, .film-call.is-booked .fp-status .fp-s2 { opacity: 0; }
.fp-avatar { position: relative; display: grid; place-items: center; width: 116px; height: 116px; margin: 36px auto 12px; border-radius: 50%; background: var(--cream-2); }
.fp-avatar img { width: 70px; height: 70px; border-radius: 50%; }
.fp-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--teal); opacity: 0; }
.film-call.is-ringing .fp-ring { animation: fp-ring 1.4s ease-out infinite; }
.film-call.is-ringing .fp-ring + .fp-ring { animation-delay: .7s; }
@keyframes fp-ring { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }
.fp-time { min-height: 1.5em; font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-soft); opacity: 0; transition: opacity .3s ease; }
.film-call.is-on .fp-time { opacity: 1; }
.fp-stage { display: grid; flex: 1; width: 100%; margin-top: 10px; }
.fp-talk, .fp-done { grid-area: 1 / 1; }
.fp-talk { opacity: 0; transition: opacity .3s ease; }
.film-call.is-on .fp-talk { opacity: 1; }
.film-call.is-booked .fp-talk { opacity: 0; }
.fp-wave { display: flex; align-items: center; justify-content: center; gap: 5px; height: 44px; }
.fp-wave i { width: 5px; height: 100%; border-radius: 2px; background: var(--teal); transform: scaleY(.2); transition: background .2s ease; }
.film-call.is-caller .fp-wave i { background: var(--ink-soft); }
.film-call.is-talking .fp-wave i { animation: fp-wave .7s ease-in-out infinite alternate; }
/* Each bar on its own clock, so they rise and fall apart like a sound meter. */
.film-call.is-talking .fp-wave i:nth-child(1) { animation-duration: 0.74s; animation-delay: -0.1s; }
.film-call.is-talking .fp-wave i:nth-child(2) { animation-duration: 0.52s; animation-delay: -0.42s; }
.film-call.is-talking .fp-wave i:nth-child(3) { animation-duration: 0.91s; animation-delay: -0.2s; }
.film-call.is-talking .fp-wave i:nth-child(4) { animation-duration: 0.63s; animation-delay: -0.66s; }
.film-call.is-talking .fp-wave i:nth-child(5) { animation-duration: 0.48s; animation-delay: -0.33s; }
.film-call.is-talking .fp-wave i:nth-child(6) { animation-duration: 0.83s; animation-delay: -0.05s; }
.film-call.is-talking .fp-wave i:nth-child(7) { animation-duration: 0.57s; animation-delay: -0.51s; }
.film-call.is-talking .fp-wave i:nth-child(8) { animation-duration: 0.96s; animation-delay: -0.28s; }
.film-call.is-talking .fp-wave i:nth-child(9) { animation-duration: 0.69s; animation-delay: -0.6s; }
@keyframes fp-wave { 0% { transform: scaleY(.2); } 30% { transform: scaleY(.85); } 55% { transform: scaleY(.4); } 80% { transform: scaleY(1); } 100% { transform: scaleY(.3); } }
.fp-lines { position: relative; min-height: 104px; margin-top: 12px; }
.fp-line { position: absolute; inset: 0; margin: 0; font-size: 1rem; line-height: 1.45; opacity: 0; transform: translateY(6px); transition: opacity .3s ease, transform .3s ease; }
.fp-line b { display: block; margin-bottom: 3px; font-size: .8rem; color: var(--teal-deep); }
.fp-line.me b { color: var(--ink-soft); }
.fp-line.is-in { opacity: 1; transform: none; }
.fp-done { opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .4s ease; }
.film-call.is-booked .fp-done { opacity: 1; transform: none; }
.fp-done b { display: block; font-size: 1.15rem; }
.fp-done small { display: block; font-size: .92rem; color: var(--ink-soft); }
.fp-sms { position: absolute; top: 12px; inset-inline: 10px; z-index: 2; padding: 8px 12px; font-size: .8rem; line-height: 1.35; text-align: start; background: var(--cream-2); border: 1px solid var(--line); border-radius: 14px; opacity: 0; transform: translateY(-10px); transition: opacity .4s ease, transform .4s ease; }
.fp-sms b { display: block; }
.film-call.is-texted .fp-sms { opacity: 1; transform: none; }
/* The call played aloud (films.js): a pill at the foot of the phone,
   above the film's clear layer so it can be pressed. The frame keeps room
   for it under the words. */
.film-call .film-frame { padding-bottom: 84px; }
.fp-listen { position: absolute; bottom: 22px; left: 50%; translate: -50% 0; z-index: 6; display: flex; align-items: center; gap: 10px; padding-block: 8px; padding-inline: 8px 20px; border: 0; border-radius: 999px; background: var(--teal-deep); color: #fff; font: inherit; text-align: start; cursor: pointer; transition: scale .4s ease; white-space: nowrap; }
.fp-listen:hover { scale: 1.05; }
@media (hover: none) { .fp-listen:hover { scale: none; } }
.fp-listen:focus-visible { outline: 2px solid var(--teal-deep); outline-offset: 3px; }
.fp-listen svg { flex: none; width: 30px; height: 30px; padding: 7px; border-radius: 50%; background: color-mix(in srgb, #fff 18%, transparent); }
.fp-listen span { font-size: .92rem; font-weight: 600; line-height: 1.2; }
.fp-listen .fp-ic-pause, .film-call.is-listening .fp-ic-play { display: none; }
.film-call.is-listening .fp-ic-pause { display: block; }
@media (prefers-reduced-motion: reduce) {
  .fp-status span, .fp-time, .fp-talk, .fp-line, .fp-done, .fp-sms, .fp-wave i { transition: none; }
  .fp-ring, .fp-wave i { animation: none !important; }
}
html:not(.js) .fp-done, html:not(.js) .fp-sms, html:not(.js) .fp-status .fp-s3 { opacity: 1; transform: none; }
html:not(.js) .fp-status .fp-s1 { opacity: 0; }

/* No motion: every film rests on its finished frame (films.js adds .is-done
   with the final classes). Bars and rails have no travel to make. */
@media (prefers-reduced-motion: reduce) {
  .film .f-in, .fc-slots span, .fr-done, .fr-rail-fill, .fr-rail-pin, .fr-widget, .fr-widget .fr-pick, .fr-widget .fr-booked, .fr-shade,
  .fs-tile .d, .fs-bars i, .fs-avg, .fs-scene, .fs-slice, .fs-hbars i, .fs-call, .fs-stack span, .fo-status, .fo-note, .fo-ev.new, .fo-toast { transition: none; }
  .fc-typing span, .fc-input span::after, .fo-status::before, .is-tapping > .f-tap, .is-in > .f-check::after, .film-remind.is-b4 .fr-btn, .film-remind.is-b4 .fr-btn .f-tap,
  .film-remind.is-b7 .fr-widget .fr-booked .f-check::after, .film-outage.is-b5 .fo-ev.new { animation: none; }
}
/* Without films.js nothing adds the scene classes; show the full
   conversation and the finished tiles rather than an empty frame. */
html:not(.js) .fc-msg { display: block; }
html:not(.js) .fs-bars i { transform: none; }
html:not(.js) .fs-tile .d, html:not(.js) .fs-avg, html:not(.js) .fs-scene[data-s="1"] { opacity: 1; }
html:not(.js) .fr-done, html:not(.js) .fr-rail-pin { opacity: 1; }
html:not(.js) .fr-rail-fill { width: 100%; }

@media (max-width: 640px) {
  .film, .film-frame { min-height: 380px; }
  .fs-tiles { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .fs-tile .v { font-size: 1.3rem; }
  .fs-scene[data-s="1"] .fs-bars { grid-template-columns: repeat(10, 1fr); }
  .fs-scene[data-s="1"] .fs-bars i:nth-child(n+11) { display: none; }
  .fs-chart--donut .fs-donut { width: 90px; height: 90px; }
  .fs-stage { min-height: 360px; }
  .fr-mail-body { font-size: .86rem; }
}
