/* desk-panels.js: the preview request, change request, charge and subscription panels, Today's
   Pitch test and Calls & deposits cards, and the slim review-mode controls window. Builds on
   desk.css (d-card, d-dl, d-glassbox, d-line, d-btn, d-chip, d-field, d-notes, d-money). */

/* ---------- detail panels ---------- */
.d-pn__sect { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.d-pn__sect > .d-seg { align-self: flex-start; }
.d-pn__quote { margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--d-card); font: 400 15px/1.5 var(--body); color: var(--ink-900); overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 6px; }
.d-pn__qtitle { margin: 0; font-weight: 600; }
.d-pn__qbody { margin: 0; color: var(--ink-600); white-space: pre-wrap; }
.d-pn__acts { gap: 8px; }
.d-pn__plain { color: inherit; text-decoration: none; }
.d-pn__plain:hover { color: var(--rust-600); }
.d-pn__k { color: var(--ink-600); flex: none; }
.d-pn__v { min-width: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.d-pn__lost { max-width: 420px; }

/* preview progress: Not started / Building / Built */
.d-pn__prog { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 12px 16px; border-radius: 14px; background: var(--d-box); min-height: 52px; }
.d-pn__host { color: var(--ink-600); text-decoration: none; overflow-wrap: anywhere; }
.d-pn__host:hover { color: var(--rust-600); }
.d-pn__pick { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.d-pn__sel { flex: 1; min-width: 0; max-width: 420px; height: 32px; }
.d-pn__more summary { cursor: pointer; font: 600 12.5px var(--d-chrome); color: var(--rust-600); list-style: none; }
.d-pn__more summary::-webkit-details-marker { display: none; }
.d-pn__more summary::before { content: "+ "; }
.d-pn__more[open] summary::before { content: "- "; }
.d-pn__create { margin-top: 10px; }
.d-pn__name { flex: 1 1 180px; min-width: 0; height: 32px; }
.d-pn__addr { display: inline-flex; align-items: center; gap: 4px; }
.d-pn__slug { width: 150px; height: 32px; font-family: var(--mono); font-size: 13px; }

/* refund (charge panel) */
.d-pn__refund { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-radius: 14px; background: var(--d-box); }
.d-pn__refund .d-meta { margin: 0; }

/* one-line Today cards (nothing logged, nothing booked) */
.d-pn__oneline { display: flex; flex-direction: column; gap: 12px; padding: 12px 18px; border-radius: 14px; background: var(--d-card); font-size: 14px; }
.d-pn__onerow { margin: 0; line-height: 1.6; color: var(--ink-600); }
.d-pn__onerow strong { color: var(--ink-900); }

/* deposit form errors */
.d-pn__ferr { font-size: 12px; color: var(--rust-ink); }

/* ---------- Pitch test ---------- */
.d-pt__bar { height: 6px; border-radius: 999px; background: var(--d-tint); overflow: hidden; }
.d-pt__fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--rust-600); }

/* ---------- Calls & deposits ---------- */
.d-dc__list, .d-dc__minis, .d-dc__deps { display: flex; flex-direction: column; gap: 8px; }
.d-dc__minis[hidden] { display: none; }
.d-dc__sub { margin-top: 6px; }
.d-dc__off { text-decoration: none; }
.d-dc__off:hover { color: var(--rust-600); }
.d-dc__call { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--d-box); }
.d-dc__call p, .d-dc__body p { margin: 0; }
.d-dc__who { min-width: 0; font-size: 14px; }
.d-dc__wrote { font-size: 13.5px; color: var(--ink-600); white-space: pre-wrap; overflow-wrap: anywhere; }
.d-dc__notes { background: rgba(31, 26, 22, .05); font-size: 13.5px; }
.d-dc__files { display: flex; flex-direction: column; gap: 4px; }
.d-dc__file { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 10px; border-radius: 8px; background: rgba(31, 26, 22, .04); color: var(--ink-900); text-decoration: none; font-size: 13.5px; }
.d-dc__file:hover { background: rgba(194, 70, 31, .08); color: var(--rust-600); }
.d-dc__fname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-dc__mini { border-radius: 12px; background: var(--d-box); }
.d-dc__sum { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 14px; cursor: pointer; list-style: none; min-width: 0; }
.d-dc__sum::-webkit-details-marker { display: none; }
.d-dc__sum .d-dc__who { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-dc__note { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-dc__mini[open] .d-dc__sum { border-bottom: 1px solid var(--line); }
.d-dc__body { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px 12px; }
.d-dc__x { width: 26px; height: 26px; flex: none; border: 0; border-radius: 50%; background: transparent; cursor: pointer; font: 400 17px/1 var(--d-chrome); color: var(--ink-500); display: inline-flex; align-items: center; justify-content: center; }
.d-dc__x:hover { background: var(--d-tint); color: var(--ink-900); }
.d-dc__dep { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.d-dc__deps > .d-dc__dep:first-child { border-top: 0; }
.d-dc__depwho { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.d-dc__form { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--d-box); }
.d-dc__form[hidden] { display: none; }
.d-dc__form .d-meta { margin: 0; }
.d-dc__pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

/* ---------- review mode: the slim controls window (about 260px wide) ---------- */
body.is-desk.is-review { background: var(--sand-100); }
.d-rvm { min-height: 100vh; box-sizing: border-box; padding: 18px 14px 92px; display: flex; flex-direction: column; gap: 14px; font: 400 13px/1.45 var(--d-chrome); color: var(--ink-900); }
.d-rvm.is-loading { opacity: .55; pointer-events: none; }
.d-rvm__empty { margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--d-card); font-size: 14px; color: var(--ink-600); }
.d-rvm__head { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.d-rvm__count { margin: 0; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-600); }
.d-rvm__track { --d-rvm-at: 0%; position: relative; display: block; height: 4px; border-radius: 999px; background: var(--d-tint); overflow: hidden; }
.d-rvm__track::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--d-rvm-at); border-radius: inherit; background: var(--rust-600); }
.d-rvm__name { margin: 4px 0 0; font: 400 28px/.95 var(--display); text-transform: uppercase; overflow-wrap: anywhere; text-wrap: balance; }
.d-rvm__host { font: 500 11.5px var(--mono); color: var(--ink-600); text-decoration: none; overflow-wrap: anywhere; }
.d-rvm__host:hover { color: var(--rust-600); }
.d-rvm__open { width: 100%; height: 42px; }
.d-rvm__open[hidden] { display: none; }
.d-rvm__parts { display: flex; flex-direction: column; gap: 8px; }
.d-rvm__part { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 14px; background: var(--d-card); }
.d-rvm__view { display: flex; align-items: center; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; text-align: left; font: 600 13.5px var(--d-chrome); color: var(--ink-900); }
.d-rvm__view:hover, .d-rvm__view:focus-visible { background: var(--d-tint); outline: 0; }
.d-rvm__view.is-on { background: var(--ink-900); color: var(--sand-50); }
.d-rvm__pf, .d-rvm__all, .d-rvm__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.d-rvm__btn { height: 40px; border: 0; border-radius: 999px; background: var(--d-tint); cursor: pointer; font: 600 13.5px var(--d-chrome); color: var(--ink-900); }
.d-rvm__btn:hover { background: rgba(31, 26, 22, .12); }
.d-rvm__btn.is-pass { background: var(--sage-600); color: var(--sand-50); }
.d-rvm__btn.is-fail { background: var(--rust-600); color: var(--sand-50); }
.d-rvm__said { margin: 0 4px 2px; font-size: 12.5px; line-height: 1.4; color: var(--rust-ink); overflow-wrap: anywhere; }
.d-rvm__all .d-btn, .d-rvm__nav .d-btn { width: 100%; height: 40px; padding: 0 8px; }
.d-rvm__note { width: 100%; box-sizing: border-box; resize: vertical; padding: 10px 12px; border: 0; border-radius: 14px; background: var(--d-box); box-shadow: inset 0 0 0 1.5px var(--rust-600); font: 400 14px/1.45 var(--body); outline: 0; }
.d-rvm__note[hidden], .d-rvm__hint[hidden] { display: none; }
.d-rvm__hint { margin: -8px 2px 0; font-size: 11.5px; color: var(--ink-500); }
.d-rvm__nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 10px 14px 12px; background: var(--sand-100); border-top: 1px solid var(--line); }
body.is-review .d-toast { top: 12px; right: 10px; width: auto; max-width: calc(100vw - 20px); }
