/* ============ locked calls + call details (handover locked-calls) ============
   The lock tag + signal tag beside a room's or a call's name (.clw), the lock card / sheet
   (.cl-card), call details (.cd-panel) and the little stat labels (.cd-mini). The tags and the
   room-code sticky are fixed-colour things (mint, amber, rose, sticky yellow) in every theme;
   the card and panel paper follow the roles. */

/* --- the tags --- */
.clw { position: relative; display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.cl-tag, .cd-tag {
    display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px 0 8px; box-sizing: border-box;
    border: 2px solid var(--gray-900); font: inherit; font-family: var(--font-hand); font-size: 15px; line-height: 1;
    cursor: pointer; white-space: nowrap; transition: transform .12s;
}
.cl-tag { border-radius: 14px 12px 15px 11px; background: var(--green-100); color: var(--green-900); rotate: -2deg; }
.cd-tag { gap: 6px; border-radius: 12px 15px 11px 14px; background: var(--cream); color: var(--gray-900); rotate: 1.5deg; }
.cl-tag:hover, .cd-tag:hover { transform: translateY(-1px); }
.cl-tag:focus-visible, .cd-tag:focus-visible { outline: 3px solid var(--blue-700); outline-offset: 2px; }
.cl-tag.on { box-shadow: 2px 3px 0 var(--gray-900); }
.cd-tag.on { box-shadow: 2px 3px 0 var(--gray-900); background: var(--blue-50); }
.cl-tag.locking { background: var(--cream); color: var(--gray-700); border-style: dashed; }
.cl-tag.trouble { background: var(--orange-100); color: var(--orange-700); }
.cl-tag.cant { background: var(--red-100); color: var(--red-800); }
.clw.big .cl-tag, .clw.big .cd-tag { height: 44px; min-width: 44px; justify-content: center; font-size: 17px; padding: 0 12px; }
.cl-spin { animation: cl-spin 1s linear infinite; }
@keyframes cl-spin { to { rotate: 360deg; } }

.cd-bars { display: flex; align-items: flex-end; gap: 2px; height: 15px; flex-shrink: 0; }
.cd-bars i { display: block; width: 4px; border-radius: 1.5px; background: var(--sand); }
.cd-bars i:nth-child(1) { height: 5px; } .cd-bars i:nth-child(2) { height: 8px; }
.cd-bars i:nth-child(3) { height: 11px; } .cd-bars i:nth-child(4) { height: 15px; }
.cd-bars.q4 i, .cd-bars.q3 i:nth-child(-n+3) { background: var(--green-500); }
.cd-bars.q2 i:nth-child(-n+2) { background: var(--amber-600); }
.cd-bars.q1 i:nth-child(1) { background: var(--red-700); }
.cd-num { font-variant-numeric: tabular-nums; }

/* the card / panel hangs under the tags (over them in a call's strip) */
.clw-catch { position: fixed; inset: 0; z-index: 60; cursor: default; }
.clw-pop { position: absolute; left: -12px; top: calc(100% + 14px); z-index: 61; text-align: left; white-space: normal; }
.clw.up .clw-pop { top: auto; bottom: calc(100% + 14px); }
/* phone: the sheet and its scrim share one stacking context, raised over the call's bar */
.clw-pop:has(> .psheet) { position: static; z-index: auto; }
.call-phone-top:has(.clw .psheet) { z-index: 30; }

/* --- the lock card / sheet --- */
.cl-card:not(.psheet), .cd-panel:not(.psheet) { position: relative; }
.cl-card {
    box-sizing: border-box; background: var(--paper); color: var(--ink);
    border: 2.5px solid var(--line); font-family: var(--font-hand); font-size: 16px; line-height: 1.3;
}
.cl-pop { width: 400px; max-width: calc(100vw - 32px); padding: 16px 18px 14px; border-radius: 15px 225px 15px 255px / 255px 15px 225px 15px; box-shadow: var(--shadow-hard-lg); rotate: -.4deg; }
.cl-sheet.psheet { padding: 0 18px 22px; }
.cl-card .cl-x { position: absolute; right: 8px; top: 8px; }
.cl-sheet .cl-x { top: 30px; }
.cl-head { display: flex; align-items: center; gap: 12px; padding-right: 40px; }
.cl-headt { min-width: 0; }
.cl-badge {
    width: 52px; height: 52px; flex-shrink: 0; display: grid; place-items: center;
    border: 2.5px solid var(--gray-900); border-radius: 48% 52% 46% 54%; background: var(--green-200); color: var(--green-900); rotate: -6deg;
}
.cl-badge.locking { background: var(--cream); border-style: dashed; color: var(--gray-700); }
.cl-badge.trouble { background: var(--orange-100); color: var(--orange-700); }
.cl-badge.cant { background: var(--red-100); color: var(--red-800); }
.cl-title { margin: 0; font-family: var(--font-marker); font-weight: 700; font-size: 30px; line-height: 1.05; }
.cl-hi { padding: 0 .2em; border-radius: .6em .2em; -webkit-text-stroke: .035em currentColor; paint-order: stroke fill; color: var(--gray-900);
    background: linear-gradient(104deg, transparent .9%, var(--green-200) 2.4%, var(--green-200) 97%, transparent 98.5%); }
.cl-hi.trouble { background: linear-gradient(104deg, transparent .9%, var(--orange-100) 2.4%, var(--orange-100) 97%, transparent 98.5%); }
.cl-hi.cant { background: linear-gradient(104deg, transparent .9%, var(--red-100) 2.4%, var(--red-100) 97%, transparent 98.5%); }
.cl-hi.locking { background: none; color: inherit; }
.cl-sub { font-size: 14.5px; color: var(--ink-soft); margin-top: 2px; }
.cl-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.cl-lbl { font-family: var(--font-marker); font-weight: 700; font-size: 21px; margin: 0 0 2px; }
.cl-li { display: flex; gap: 6px; align-items: flex-start; font-size: 14.5px; margin: 0 0 3px; }
.cl-li svg { margin-top: 2px; flex-shrink: 0; }
.cl-yes { color: var(--success-text); }
.cl-no { color: var(--warning-text); }
.cl-warn { margin-top: 12px; padding: 10px 12px; border: 2.5px dashed var(--orange-600); border-radius: 12px 9px 13px 8px;
    background: color-mix(in srgb, var(--orange-100) 40%, var(--paper)); font-size: 14.5px; }
.cl-warn.cl-wait { border-color: var(--gray-500); background: color-mix(in srgb, var(--bone) 50%, var(--paper)); }
.cl-stop { margin-top: 12px; padding: 10px 12px; border: 2.5px dashed var(--red-700); border-radius: 12px 9px 13px 8px;
    background: color-mix(in srgb, var(--red-100) 30%, var(--paper)); font-size: 14.5px; }

/* the room code: a sticky, so it's paper-coloured in every theme */
.cl-code { position: relative; margin-top: 14px; padding: 12px 14px 10px; background: var(--yellow-200); color: var(--gray-900);
    border: 2px solid var(--gray-900); border-radius: 6px 12px 8px 10px; rotate: .5deg; }
.cl-code::before { content: ""; position: absolute; top: -11px; left: 50%; width: 70px; height: 20px; translate: -50% 0; rotate: -3deg;
    background: color-mix(in srgb, var(--blue-100) 90%, transparent);
    border-left: 2px dashed color-mix(in srgb, var(--black) 12%, transparent); border-right: 2px dashed color-mix(in srgb, var(--black) 12%, transparent); }
.cl-codelbl { font-size: 19px; color: var(--yellow-800); }
.cl-words { display: flex; flex-wrap: wrap; gap: 2px 8px; font-family: var(--font-marker); font-weight: 700; font-size: 27px; line-height: 1; }
.cl-words span + span::before { content: "·"; margin-right: 8px; color: var(--yellow-700); }
.cl-digits { font-size: 15px; letter-spacing: .08em; color: var(--gray-700); margin-top: 4px; }
.cl-how { font-size: 14px; color: var(--gray-700); margin-top: 6px; }
.cl-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cl-code .cl-sm { color: var(--gray-600); }

.cl-btn {
    font: inherit; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px;
    padding: 2px 14px; box-sizing: border-box; border: 2.5px solid var(--gray-900); border-radius: var(--wobble-1);
    background: var(--cream); color: var(--gray-900); cursor: pointer; box-shadow: 2px 2px 0 var(--gray-900); text-decoration: none; white-space: nowrap;
}
.cl-btn:hover { transform: translate(-1px, -1px); color: var(--gray-900); }
.cl-btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); box-shadow: none; border-style: dashed; }
.cl-btn.primary { background: var(--blue-700); color: var(--white); }
.cl-btn.primary:hover { color: var(--white); }
.cl-sheet .cl-btn { min-height: 48px; }

.cl-ppl { margin-top: 12px; }
.cl-n { font-family: var(--font-hand); font-weight: 400; }
.cl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-p { display: inline-flex; align-items: center; gap: 6px; height: 34px; max-width: 100%; padding: 0 9px 0 3px; box-sizing: border-box;
    border: 2px solid var(--gray-900); border-radius: 16px 13px 17px 12px; background: var(--green-100); color: var(--gray-900); font-size: 15px; white-space: nowrap; }
.cl-p.ok { background: color-mix(in srgb, var(--green-100) 45%, var(--white)); }
.cl-p.bad { background: var(--orange-100); color: var(--orange-700); border-color: var(--orange-600); }
.cl-p.wait { background: var(--gray-100); border-style: dashed; color: var(--gray-700); }
.cl-p svg { color: var(--green-700); flex-shrink: 0; }
.cl-p .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cl-pst { font-size: 13px; }
.cl-av, .cd-av { display: grid; place-items: center; flex-shrink: 0; box-sizing: border-box; overflow: hidden; border: 2px solid var(--gray-900);
    color: var(--white); font-family: var(--font-marker); font-weight: 700; line-height: 1; }
.cl-av .face-img, .cd-av .face-img { width: 100%; height: 100%; object-fit: cover; }
.cl-av { width: 24px; height: 24px; border-radius: 50%; font-size: 16px; }
.cl-more { font-size: 14px; color: var(--ink-soft); padding-top: 6px; }
.cl-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px;
    border-top: 2px dashed color-mix(in srgb, var(--line) 18%, transparent); }
.cl-foot-cant { border-top: none; padding-top: 0; }
.cl-link { color: var(--link-ink); text-underline-offset: 3px; text-decoration: underline; text-decoration-thickness: 2px;
    font: inherit; font-size: 15px; background: none; border: none; padding: 0; cursor: pointer; }
.cl-sm { font-size: 13.5px; color: var(--ink-soft); }

/* "can't lock calls here", shown instead of joining */
.cl-cant-mid { position: fixed; z-index: 111; left: 50%; top: 50%; translate: -50% -50%; }

/* --- call details --- */
.cd-panel {
    box-sizing: border-box; font-family: var(--font-hand); font-size: 16px; line-height: 1.3;
    --cd-paper: var(--paper);
    background-color: var(--cd-paper); color: var(--ink); border: 2.5px solid var(--line);
    background-image: linear-gradient(color-mix(in srgb, var(--blue-500) 9%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--blue-500) 9%, transparent) 1px, transparent 1px);
    background-size: 16px 16px;
}
.cd-pop { width: 460px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 140px); overflow: auto; padding: 14px 16px;
    border-radius: 10px 14px 12px 16px / 14px 10px 16px 12px; box-shadow: var(--shadow-hard-lg); rotate: .4deg; }
.clw.up .cd-pop, .clw.up .cl-pop { max-height: calc(100dvh - 320px); overflow: auto; }
.cd-sheet.psheet { padding: 0 16px 20px; }
.cd-head { display: flex; align-items: center; gap: 8px; }
.cd-title { margin: 0; flex: 1; min-width: 0; font-family: var(--font-marker); font-weight: 700; font-size: 30px; line-height: 1.05; }
.cd-btn {
    font: inherit; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px;
    padding: 2px 12px; box-sizing: border-box; border: 2.5px solid var(--gray-900); border-radius: var(--wobble-1);
    background: var(--cream); color: var(--gray-900); cursor: pointer; box-shadow: 2px 2px 0 var(--gray-900); white-space: nowrap;
}
.cd-btn:hover { transform: translate(-1px, -1px); }
.cd-btn-sm { min-height: 34px; font-size: 14px; }
.cd-tabs { display: flex; gap: 4px; margin: 8px 0 0; border-bottom: 2.5px solid var(--line); }
.cd-tab { flex: 1; min-width: 0; min-height: 40px; padding: 2px 6px 4px; box-sizing: border-box; border: 2.5px solid var(--line); border-bottom: none;
    border-radius: 12px 14px 0 0; background: color-mix(in srgb, var(--bone) 60%, var(--paper)); color: var(--ink-soft);
    font-family: var(--font-marker); font-weight: 700; font-size: 21px; cursor: pointer; margin-bottom: -2.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-tab.on { background: var(--cd-paper); color: var(--ink); min-height: 44px; }
.cd-sheet .cd-tab { min-height: 46px; }
.cd-body { padding-top: 10px; }
.cd-graph { position: relative; height: 96px; margin: 2px 0 6px; border: 2px solid var(--gray-900); border-radius: 8px 10px 7px 9px;
    background: var(--cream); color: var(--gray-900); overflow: hidden; }
.cd-graph svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cd-mid { stroke: color-mix(in srgb, var(--gray-900) 12%, transparent); stroke-width: 1; stroke-dasharray: 4 4; fill: none; }
.cd-area { fill: color-mix(in srgb, var(--green-500) 14%, transparent); stroke: none; }
.cd-line { fill: none; stroke: var(--green-500); stroke-width: 2.2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.cd-graph .lbl { position: absolute; left: 8px; top: 4px; font-size: 13px; color: var(--gray-700); }
.cd-graph .now { position: absolute; right: 8px; top: 2px; font-family: var(--font-marker); font-weight: 700; font-size: 26px; line-height: 1; }
.cd-rows { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 12px; }
.cd-k { font-size: 14.5px; color: var(--ink-soft); padding: 5px 0; border-bottom: 1.5px dashed color-mix(in srgb, var(--line) 14%, transparent); }
.cd-v { font-size: 15.5px; padding: 5px 0; text-align: right; border-bottom: 1.5px dashed color-mix(in srgb, var(--line) 14%, transparent); overflow-wrap: anywhere; }
.cd-v small { display: block; font-size: 12.5px; color: var(--ink-soft); }
.cd-sec { font-family: var(--font-marker); font-weight: 700; font-size: 21px; margin: 12px 0 2px; }
.cd-good { color: var(--success-text); } .cd-meh { color: var(--warning-text); } .cd-bad { color: var(--danger-text); }
.cd-graph .cd-good { color: var(--green-700); } .cd-graph .cd-meh { color: var(--orange-700); } .cd-graph .cd-bad { color: var(--red-800); }
.cd-p { border-bottom: 2px dashed color-mix(in srgb, var(--line) 14%, transparent); }
.cd-prow { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 4px 0; border: none; background: none;
    font: inherit; color: inherit; cursor: pointer; text-align: left; }
.cd-av { width: 30px; height: 30px; border-radius: 8px 10px 7px 9px; font-size: 19px; }
.cd-prow .n { flex: 1; min-width: 0; line-height: 1.15; }
.cd-prow .n small { display: block; font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-chev { transition: rotate .15s; color: var(--ink-soft); }
.cd-p.open .cd-chev { rotate: 180deg; }
.cd-pmore { padding: 0 0 8px 40px; }
.cd-note { font-size: 14px; color: var(--ink-soft); margin: 6px 0 0; }
.cd-lead { margin: 0 0 4px; }
.cd-flush { margin: 0; }
.cd-scr { padding: 10px 12px; margin-bottom: 10px; background: var(--paper); border: 2px solid var(--line); border-radius: 8px 12px 9px 11px; }
.cd-scr .t { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 4px; }
.cd-scr .t i { width: 9px; height: 9px; border-radius: 50%; background: var(--red-600); flex-shrink: 0; }
.cd-code { font-family: var(--font-marker); font-weight: 700; font-size: 24px; line-height: 1; }
.cd-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.cd-foot .sm { font-size: 13px; color: var(--ink-soft); flex: 1; min-width: 0; }

/* little labels clipped to a polaroid or a stream sheet */
.cd-mini { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 6px 8px 6px 7px;
    background: var(--gray-900); color: var(--gray-100); font-family: var(--font-hand); font-size: 12px; line-height: 1; white-space: nowrap;
    font-variant-numeric: tabular-nums; pointer-events: none; }
.polaroid .cd-mini, .voice-mini .cd-mini { position: absolute; left: 50%; top: calc(100% + 4px); translate: -50% 0; z-index: 2; }
.voice-sheet .cd-mini { position: absolute; left: 8px; top: -24px; z-index: 2; }
/* a crowded room: labels only on people talking, the rest on hover */
.polaroid:is(.s1, .s2, .s3):not(.talk):not(:hover) .cd-mini { display: none; }

@media (prefers-reduced-motion: reduce) { .cl-spin { animation: none; } .cl-tag, .cd-tag { transition: none; } .cd-chev { transition: none; } }
.calm .cl-spin { animation: none; }

/* settings › voice & video: "locked calls & call details" */
.set-lock .set-lkrow { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 6px 0 10px;
    border-bottom: 2px dashed color-mix(in srgb, var(--line) 12%, transparent); }
.set-lkbadge { width: 46px; height: 46px; flex-shrink: 0; display: grid; place-items: center; border: 2.5px solid var(--gray-900);
    border-radius: 48% 52% 46% 54%; background: var(--green-200); color: var(--green-900); rotate: -6deg; }
.set-lktext { flex: 1; min-width: 0; }
.set-lkh { font-size: 17px; }
.set-lksub { font-size: 14.5px; color: var(--ink-soft); line-height: 1.3; margin-top: 2px; }
.set-lkhow { flex-shrink: 0; }
@media (max-width: 640px) { .set-lock .set-lkrow { flex-wrap: wrap; } .set-lkhow { margin-left: 60px; } }

/* a voice room's crumbs: the board page has no search box, so the title takes its column too
   and the tags stay on the name's line; while a card is open the crumbs sit over the board */
.app-top:has(.crumbs .clw) > .app-title { grid-column: 1 / -1; }
.crumbs:has(.clw-pop) { position: relative; z-index: 100; }
.crumbs .clw a.cl-link { display: inline; min-height: 0; padding: 0; border: none; border-radius: 0; color: var(--link-ink); text-decoration: underline; background: none; }
.crumbs .clw a.cl-btn { border: 2.5px solid var(--gray-900); }
