/* The cover photo editor (views/cover-edit.js), 18 November 2026. One calm dialog in the app's hand: the clean tokens, a
   hairline, the ink pill for Save, the lilac only for the slider's fill and for focus. The two frames keep the band's own
   shapes (a computer's 1104 by 140, a phone's 358 by 96), so the crop the doctor sees is the crop the page shows. */

html.ce-open, html.ce-open body { overflow: hidden; }
.ce-root { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 24px; }
.ce-scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--cl-page, #0e0e12) 62%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .26s var(--cl-out); }
.ce { position: relative; display: flex; width: min(760px, 100%); max-height: calc(100vh - 48px); flex-direction: column; overflow: auto; border: 1px solid var(--cl-line); border-radius: 26px; background: var(--cl-surface); box-shadow: var(--cl-shadow-pop); color: var(--cl-ink); opacity: 0; transform: translateY(14px) scale(.985); transition: opacity .26s var(--cl-out), transform .5s var(--cl-spring); }
.ce-root.is-in .ce-scrim { opacity: 1; }
.ce-root.is-in .ce { opacity: 1; transform: none; }
.ce-root.is-out .ce-scrim, .ce-root.is-out .ce { opacity: 0; transition-duration: .2s; }

.ce-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 6px 28px; }
.ce-title { margin: 0; font-family: var(--cl-serif); font-size: 27px; font-weight: 400; letter-spacing: -.012em; line-height: 1.15; }
.ce-sub { max-width: 520px; margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: var(--cl-ink-3); }
.ce-x { display: grid; flex: none; width: 40px; height: 40px; place-items: center; border-radius: 50%; font-size: 18px; color: var(--cl-ink-3); cursor: pointer; transition: background-color .16s var(--cl-out), color .16s var(--cl-out); }
.ce-x:hover { background: var(--cl-hover); color: var(--cl-ink); }

.ce-body { padding: 14px 28px 4px; }
.ce-cap { margin: 0 0 8px; font-size: 13.5px; color: var(--cl-ink-4); }
.ce-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 28px; margin-top: 22px; }

/* the frames: the brand's texture until a photo is in, then the photo, drawn as the page draws it */
.ce-frame { position: relative; overflow: hidden; border-radius: 16px; background:
    radial-gradient(circle at 2px 2px, color-mix(in srgb, var(--cl-lilac) 40%, transparent) 1.1px, transparent 1.6px) 0 0 / 9px 9px,
    radial-gradient(70% 140% at 85% 0%, color-mix(in srgb, var(--cl-lilac) 32%, transparent), transparent 70%),
    linear-gradient(170deg, color-mix(in srgb, var(--cl-lilac) 20%, var(--cl-surface)), color-mix(in srgb, var(--cl-lilac) 7%, var(--cl-surface)));
  box-shadow: inset 0 0 0 1px var(--cl-line); touch-action: none; user-select: none; -webkit-user-select: none; }
.ce-frame--wide { width: 100%; aspect-ratio: 1104 / 140; }
.ce-frame--phone { width: 300px; max-width: 100%; aspect-ratio: 358 / 96; }
.ce-frame img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ce-root.has-photo .ce-frame { cursor: grab; }
.ce-root.has-photo .ce-frame.is-dragging { cursor: grabbing; }
.ce-frame:focus-visible { outline: 2px solid var(--cl-lilac); outline-offset: 3px; }
.ce-frame.is-over { box-shadow: inset 0 0 0 2px var(--cl-lilac); }
/* a thin edge shows where the photo stops being seen, once the doctor holds it */
.ce-frame::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cl-surface) 55%, transparent); opacity: 0; pointer-events: none; transition: opacity .2s var(--cl-out); }
.ce-frame.is-dragging::after { opacity: 1; }

.ce-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; }
.ce-empty p { margin: 0; font-size: 13.5px; color: var(--cl-ink-3); }
.ce-root.has-photo .ce-empty { display: none; }
.ce-empty--phone { display: none; }

/* the zoom: a minus, a track with a lilac fill and a round knob, a plus */
.ce-zoombox { flex: 1 1 240px; max-width: 340px; }
.ce-zoom { display: flex; align-items: center; gap: 10px; }
.ce-step { display: grid; flex: none; width: 38px; height: 38px; place-items: center; border: 1px solid var(--cl-line-2); border-radius: 50%; background: var(--cl-surface); font-size: 15px; color: var(--cl-ink-2); cursor: pointer; transition: border-color .16s var(--cl-out), color .16s var(--cl-out), opacity .16s var(--cl-out); }
.ce-step:hover:not(:disabled) { border-color: var(--cl-line-3); color: var(--cl-ink); }
.ce-step:disabled { opacity: .4; cursor: default; }
.ce-track { --ce-p: 0%; position: relative; flex: 1; height: 38px; cursor: pointer; touch-action: none; }
.ce-track::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 4px; translate: 0 -50%; border-radius: 99px; background: var(--cl-surface-2); box-shadow: inset 0 0 0 1px var(--cl-line); }
.ce-fill { position: absolute; top: 50%; left: 0; width: var(--ce-p); height: 4px; translate: 0 -50%; border-radius: 99px; background: var(--cl-lilac); }
.ce-knob { position: absolute; top: 50%; left: var(--ce-p); width: 20px; height: 20px; translate: -50% -50%; border-radius: 50%; background: var(--cl-surface); box-shadow: 0 1px 3px rgba(14, 14, 18, .25), 0 0 0 1px var(--cl-line-2); transition: scale .18s var(--cl-out); }
.ce-track.is-sliding .ce-knob, .ce-track:hover .ce-knob { scale: 1.12; }
.ce-track:focus-visible { outline: none; }
.ce-track:focus-visible .ce-knob { box-shadow: 0 0 0 3px color-mix(in srgb, var(--cl-lilac) 40%, transparent), 0 0 0 1px var(--cl-line-2); }
.ce-track[aria-disabled="true"] { opacity: .45; cursor: default; }

.ce-msg { margin: 16px 0 0; font-size: 14px; color: var(--cl-bad, #c0392b); }

/* the foot: the photo's own ways on the left, the decision on the right; Save is the one ink pill */
.ce-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding: 18px 24px 22px 28px; border-top: 1px solid var(--cl-line); }
.ce-left, .ce-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ce-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 17px; border: 1px solid var(--cl-line-2); border-radius: 999px; background: var(--cl-surface); font-size: 14.5px; color: var(--cl-ink); cursor: pointer; white-space: nowrap; transition: border-color .16s var(--cl-out), background-color .16s var(--cl-out), scale .12s var(--cl-out), opacity .16s var(--cl-out); }
.ce-btn > i { font-size: 16px; color: var(--cl-ink-3); }
.ce-btn:hover { border-color: var(--cl-line-3); }
.ce-btn:active { scale: .97; }
.ce-btn--quiet { border-color: transparent; background: transparent; color: var(--cl-ink-3); }
.ce-btn--quiet:hover { border-color: transparent; background: var(--cl-hover); color: var(--cl-ink); }
.ce-btn--ink { border-color: var(--cl-ink); background: var(--cl-ink); color: var(--cl-surface); }
.ce-btn--ink > i { color: var(--cl-surface); }
.ce-btn--ink:hover { background: color-mix(in srgb, var(--cl-ink) 86%, var(--cl-surface)); }
.ce-btn:disabled { opacity: .4; cursor: default; scale: none; }
.ce-root.is-busy .ce-btn[data-ce-save] { opacity: .8; }
.ce :is(.ce-btn, .ce-x, .ce-step):focus-visible { outline: 2px solid var(--cl-lilac); outline-offset: 2px; }

/* a phone: the dialog rises from the bottom as a sheet, the phone's frame takes the whole width */
@media (max-width: 640px) {
  .ce-root { padding: 0; place-items: end stretch; }
  .ce { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; transform: translateY(24px); }
  .ce-head { padding: 20px 18px 4px 20px; }
  .ce-title { font-size: 24px; }
  .ce-body { padding: 12px 20px 4px; }
  .ce-phone, .ce-frame--phone { width: 100%; }
  .ce-frame--wide .ce-empty { display: none; }
  .ce-root:not(.has-photo) .ce-empty--phone { display: flex; }
  .ce-zoombox { max-width: none; }
  .ce-foot { padding: 16px 20px calc(18px + env(safe-area-inset-bottom)); }
  .ce-left, .ce-right { width: 100%; }
  .ce-right .ce-btn { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .ce, .ce-scrim, .ce-knob { transition: opacity .12s linear !important; transform: none !important; } }
html.a11y-reduce-motion .ce, html.a11y-reduce-motion .ce-scrim { transition: opacity .12s linear !important; transform: none !important; }
