/* ==========================================================================
   OrthoPlan Pro — voice notes (16 Nov 2026, package fix/voice, R16-03)
   --------------------------------------------------------------------------
   «ويبقى Highlighted قوي قوي كده اللي هو ده Voice Note». The one card on
   Diagnosis, Treatment Plan, Clinical Steps and in the visit form that stands
   out from the cards around it: the brand's own "chosen" tint behind it, a
   2 px brand edge, the microphone in the title and a Record button of the
   primary size (52 px). No new colour — the brand teal and its tints, the
   neutrals, and the danger hue only as the 10 px recording dot.

   The players: a 44 px round play / pause, a 4 px bar, the length and the
   date; Delete is a 44 px ghost button. The saved visit card and Files use
   the same player, without the accent.

   Every rule is scoped under .op-frontend (New look off: the 3.0 tokens) and
   again under .op-ds (the calm tokens), the design layer's own specificity
   plus one class, since op-zz-design.css loads after this file.
   ========================================================================== */

/* ---- The card ------------------------------------------------------------- */
.op-frontend .op-voice-card {
    border: 2px solid var(--op-primary);
    background: var(--op-primary-light);
    border-radius: var(--op-radius-md);
}
.op-frontend .op-voice-in-form { padding: 16px; margin: 16px 0; }
.op-frontend .op-voice-card .op-voice-mic,
.op-frontend .op-voice-head .op-ic-mic { color: var(--op-primary); }
.op-frontend .op-voice-head { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.op-frontend .op-voice-sub { margin: 0 0 12px; color: var(--op-text-muted); }

/* fix/look25 (25 Nov, M24-15): white like every section; the 2 px teal frame says it. */
.op-ds .op-card.op-voice-card,
.op-ds .op-voice-card.op-voice-in-form {
    border: 2px solid var(--ds-brand);
    background: var(--ds-surface);
    border-radius: var(--ds-r-lg);
}
.op-ds .op-voice-card.op-voice-in-form { padding: var(--ds-sp-4); margin: var(--ds-sp-4) 0; }
.op-ds .op-voice-card .op-fsec-title .op-voice-mic { width: 20px; height: 20px; vertical-align: -3px; color: var(--ds-brand); margin-inline-end: 4px; }
.op-ds .op-voice-card .op-voice-head { display: flex; align-items: center; gap: var(--ds-sp-2); margin: 0 0 var(--ds-sp-1); padding: 0; border: 0; }
.op-ds .op-voice-card .op-voice-head .op-ic-mic { width: 20px; height: 20px; color: var(--ds-brand); }
.op-ds .op-voice-card .op-voice-sub { margin: 0 0 var(--ds-sp-3); color: var(--ds-ink-2); font-size: var(--ds-fs-sm); line-height: var(--ds-lh-sm); }

/* ---- Record, the clock, Stop ---------------------------------------------- */
.op-frontend .op-voice-rec { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 4px 0 12px; }
.op-frontend .op-voice-record,
.op-frontend .op-voice-stop { min-height: 52px; padding: 0 20px; gap: 8px; }
.op-frontend .op-voice-live { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.op-frontend .op-voice-dot {
    width: 10px; height: 10px; border-radius: 50%; flex: none;
    background: var(--op-danger);
    animation: op-voice-pulse 1.2s ease-in-out infinite;
}
@keyframes op-voice-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .op-frontend .op-voice-dot { animation: none; } }
.op-frontend .op-voice-live-label { font-weight: 600; }
.op-frontend .op-voice-clock { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 3.2em; }
.op-frontend .op-voice-cap { color: var(--op-text-muted); font-variant-numeric: tabular-nums; }
.op-frontend .op-voice-msg { margin: 0 0 12px; color: var(--op-text-muted); }
.op-frontend .op-voice-msg.is-error { color: var(--op-danger-text); }
.op-frontend .op-voice-retry { min-height: 44px; margin-inline-start: 8px; }
.op-frontend .op-voice-card.is-saving .op-voice-record { opacity: .6; pointer-events: none; }

.op-ds .op-voice-card .op-voice-rec { gap: var(--ds-sp-3); margin: var(--ds-sp-1) 0 var(--ds-sp-3); }
.op-ds .op-voice-card :is(.op-voice-record, .op-voice-stop) {
    min-height: var(--ds-h-touch-primary); padding: 0 var(--ds-sp-5); gap: var(--ds-sp-2);
    font-size: var(--ds-fs-lg); line-height: var(--ds-lh-lg);
}
.op-ds .op-voice-card .op-voice-record .op-ic,
.op-ds .op-voice-card .op-voice-stop .op-ic { width: 20px; height: 20px; }
.op-ds .op-voice-card .op-voice-stop { border-color: var(--ds-brand) !important; color: var(--ds-brand-700) !important; }
.op-ds .op-voice-card .op-voice-dot { background: var(--ds-danger); }
.op-ds .op-voice-card .op-voice-live-label { font-weight: var(--ds-fw-semibold); color: var(--ds-ink); }
.op-ds .op-voice-card .op-voice-clock { font-weight: var(--ds-fw-semibold); color: var(--ds-ink); font-size: var(--ds-fs-lg); line-height: var(--ds-lh-lg); }
.op-ds .op-voice-card .op-voice-cap { color: var(--ds-ink-3); }
.op-ds .op-voice-card .op-voice-msg { margin: 0 0 var(--ds-sp-3); color: var(--ds-ink-2); font-size: var(--ds-fs-sm); line-height: var(--ds-lh-sm); }
.op-ds .op-voice-card .op-voice-msg.is-error { color: var(--ds-danger-text); }
.op-ds .op-voice-card .op-voice-retry { min-height: var(--ds-h-touch); margin-inline-start: var(--ds-sp-2); }

/* ---- The notes ------------------------------------------------------------ */
.op-frontend .op-voice-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.op-frontend .op-voice-note { display: flex; align-items: center; gap: 12px; min-width: 0; }
.op-frontend .op-voice-card .op-voice-note { padding: 8px 12px; border-radius: var(--op-radius); background: var(--op-surface); }
.op-frontend .op-voice-play {
    flex: none; width: 44px; height: 44px; border-radius: 50%; padding: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; background: var(--op-primary); color: var(--op-surface);
}
.op-frontend .op-voice-play:focus-visible { outline: 2px solid var(--op-primary-dark); outline-offset: 2px; }
.op-frontend .op-voice-play-on,
.op-frontend .op-voice-play-off { display: inline-flex; line-height: 1; }
.op-frontend .op-voice-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.op-frontend .op-voice-bar { display: block; height: 4px; border-radius: 2px; background: var(--op-border); overflow: hidden; }
.op-frontend .op-voice-bar-fill { display: block; height: 100%; width: 0; background: var(--op-primary); transition: width .2s linear; }
.op-frontend .op-voice-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; }
.op-frontend .op-voice-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.op-frontend .op-voice-when { color: var(--op-text-muted); }
.op-frontend .op-voice-draft { padding: 0 8px; border-radius: 999px; background: var(--op-bg-alt); color: var(--op-text-muted); }
.op-frontend .op-voice-delete { flex: none; min-height: 44px; gap: 6px; }
.op-frontend .op-voice-none { margin: 0; color: var(--op-text-muted); }
.op-frontend .op-voice-tpl { display: none; }
.op-frontend .op-voice-note.is-playing .op-voice-time { color: var(--op-primary); }

.op-ds .op-voice-list { gap: var(--ds-sp-2); }
.op-ds .op-voice-card .op-voice-note { padding: var(--ds-sp-2) var(--ds-sp-3); border-radius: var(--ds-r-md); background: var(--ds-surface); }
.op-ds .op-voice-play { background: var(--ds-brand); color: var(--ds-n-0); }
.op-ds .op-voice-play:hover { background: var(--ds-brand-700); }
.op-ds .op-voice-play:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }
.op-ds .op-voice-play .op-ic { width: 18px; height: 18px; vertical-align: 0; }
.op-ds .op-voice-bar { background: var(--ds-brand-100); }
.op-ds .op-voice-bar-fill { background: var(--ds-brand); }
.op-ds .op-voice-time { font-weight: var(--ds-fw-semibold); color: var(--ds-ink); font-size: var(--ds-fs-md); line-height: var(--ds-lh-md); }
.op-ds .op-voice-when { color: var(--ds-ink-3); font-size: var(--ds-fs-sm); line-height: var(--ds-lh-sm); }
.op-ds .op-voice-draft { background: var(--ds-sunken); color: var(--ds-ink-2); font-size: var(--ds-fs-xs); line-height: var(--ds-lh-xs); border-radius: var(--ds-r-full); }
.op-ds .op-voice-card .op-voice-delete { min-height: var(--ds-h-touch); }
.op-ds .op-voice-card .op-voice-delete .op-ic { width: 16px; height: 16px; }
.op-ds .op-voice-none { color: var(--ds-ink-3); font-size: var(--ds-fs-sm); line-height: var(--ds-lh-sm); }
.op-ds .op-voice-note.is-playing .op-voice-time { color: var(--ds-brand-700); }

/* ---- On a saved visit's card, and in Files: the player alone -------------- */
.op-frontend .op-voice-onvisit { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--op-border); }
.op-frontend .op-voice-onvisit-title { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-weight: 600; }
.op-frontend .op-voice-note.is-inline { display: inline-flex; gap: 8px; }
.op-ds .op-voice-onvisit { margin-top: var(--ds-sp-3); padding-top: var(--ds-sp-3); border-top: 1px solid var(--ds-line); }
.op-ds .op-voice-onvisit-title { gap: var(--ds-sp-2); color: var(--ds-ink); font-size: var(--ds-fs-md); line-height: var(--ds-lh-md); font-weight: var(--ds-fw-semibold); }
.op-ds .op-voice-onvisit-title .op-ic { color: var(--ds-icon); }
.op-ds .op-voice-note.is-inline { gap: var(--ds-sp-2); }
.op-ds .op-voice-note.is-inline .op-voice-delete { min-height: var(--ds-h-touch); }

/* ---- Review of 16 Nov: a note left waiting by an earlier visit form, and "Last time you said" ---- */
/* "Keep with this visit": a line of the note's own, under its time and date, the whole line a touch target. */
.op-frontend .op-voice-keep {
    display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0;
    cursor: pointer; color: var(--op-text);
}
.op-frontend .op-voice-keep[hidden] { display: none; }
.op-frontend .op-voice-keep-box { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--op-primary); }
.op-ds .op-voice-keep { gap: var(--ds-sp-2); min-height: var(--ds-h-touch); color: var(--ds-ink); font-size: var(--ds-fs-sm); line-height: var(--ds-lh-sm); }
.op-ds .op-voice-keep-box { accent-color: var(--ds-brand); }
/* "Last time you said": the quiet quote "Last time you wrote" is (.op-plan-strategy), its notes as players. */
.op-frontend .op-voice-lasttime[hidden] { display: none; }
.op-frontend .op-voice-lasttime .op-voice-list { margin-top: 6px; }
.op-ds .op-voice-lasttime .op-voice-list { margin-top: var(--ds-sp-2); }
.op-ds .op-voice-lasttime .op-voice-note { gap: var(--ds-sp-3); }

/* ---- The icons the set had no use for before (Lucide 0.460.0, ISC; drawn as op-zz-icons.css draws its own) ---- */
.op-ds .op-ic-play  { --op-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='6 3 20 12 6 21 6 3' /%3E%3C/svg%3E"); }
.op-ds .op-ic-pause { --op-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='14' y='4' width='4' height='16' rx='1' /%3E%3Crect x='6' y='4' width='4' height='16' rx='1' /%3E%3C/svg%3E"); }
.op-ds .op-ic-stop  { --op-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect width='14' height='14' x='5' y='5' rx='2' /%3E%3C/svg%3E"); } /* walk of 16 Nov: filled, a stop sign */
.op-ds .op-ic-trash { --op-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18' /%3E%3Cpath d='M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6' /%3E%3Cpath d='M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2' /%3E%3Cline x1='10' x2='10' y1='11' y2='17' /%3E%3Cline x1='14' x2='14' y1='11' y2='17' /%3E%3C/svg%3E"); }

/* ---- A phone: Record and Stop the width of the card ------------------------ */
@media (max-width: 600px) {
    .op-frontend .op-voice-rec,
    .op-frontend .op-voice-live { width: 100%; }
    .op-frontend .op-voice-record,
    .op-frontend .op-voice-live .op-voice-stop { flex: 1 1 100%; justify-content: center; }
    .op-frontend .op-voice-card .op-voice-note { padding: 8px; gap: 8px; }
    .op-ds .op-voice-card .op-voice-note { padding: var(--ds-sp-2); gap: var(--ds-sp-2); }
    .op-frontend .op-voice-delete { padding: 0 10px; }
}
