/* The cover editor of cover.js, drawn as LINE's own profile decoration editor (mailbox/deco-editor-compare.md):
   the bot's profile over the whole screen, its cover the background, its picture and name in the middle; Cancel,
   Remove all and Save on top; "Edit profile cover" and the five tools at the foot; each tool a sheet from the
   bottom with the preview still seen above it. The editor's chrome is dark whatever the panel's look, night or day,
   as LINE's is (D29); its counter sheet is white as LINE's. LINE's green is its one colour of choice. */
.cv{--cv-green:#06c755;--cv-sheet:#1f1f1f;--cv-cell:#2c2c2c;--cv-dim:#ffffffa6;--cv-foot:calc(56px + var(--sb));
position:fixed;inset:0;z-index:30;margin:0 auto;max-width:560px;overflow:hidden;background:#262626;color:#fff;
color-scheme:dark;font:15px/1.4 var(--sans);-webkit-user-select:none;user-select:none;touch-action:manipulation}
.cv :focus-visible{outline:2px solid var(--cv-green);outline-offset:2px}
.cv svg{width:24px;height:24px;stroke-width:1.6}
.cv button{color:inherit}
/* the screen it opens in fades rather than slides: a moving parent would carry the fixed editor with it */
.screen.in:has(.cv),.screen.back:has(.cv){animation:cv-in .28s ease-out backwards}
.screen.gone:has(.cv){animation:cv-out .2s ease-in both}
body:has(.screen:not(.gone) .cv){overflow:hidden}
@keyframes cv-in{from{opacity:0}}
@keyframes cv-out{to{opacity:0}}

/* waiting for it, or no bot */
.cv-wait,.cv-empty{display:grid;place-items:center;align-content:center;gap:14px;padding:24px}
.cv-empty{position:absolute;inset:0}
.cv .note{background:#ffffff12;border-color:#ffffff1a;color:#e6e6e6;box-shadow:none}
.cv .act{background:var(--cv-green);color:#fff;border-radius:10px;padding:11px 22px;font-weight:700}

/* the profile: cover, effect, the pieces, picture and name */
.cv-canvas{position:absolute;inset:0;touch-action:none}
.cv-cover{position:absolute;inset:0;background:#2b2b2b}
.cv-cover::after{content:"";position:absolute;inset:0;pointer-events:none;
background:linear-gradient(180deg,#0000008c,transparent 22%,transparent 62%,#000000a6)}
.cv-cover-img{width:100%;height:100%;object-fit:cover;display:block}
.cv-effect{position:absolute;inset:0;pointer-events:none;z-index:1}
.cv-effect-img{width:100%;height:100%;object-fit:cover;opacity:.6;mix-blend-mode:screen;
animation:cv-drift 6s ease-in-out infinite alternate}
@keyframes cv-drift{to{transform:translateY(-12px) scale(1.04)}}
.cv-face{position:absolute;left:0;right:0;top:41%;z-index:1;display:flex;flex-direction:column;align-items:center;gap:10px;
padding:0 24px;pointer-events:none}
.cv-pic{position:relative;width:104px;height:104px;border-radius:50%;overflow:hidden;background:#3a3a3a;display:grid;
place-items:center;box-shadow:0 6px 22px -8px #000c}
.cv-pic-img{width:100%;height:100%;object-fit:cover;display:block}
.cv-pic-letter{font-size:42px;font-weight:700;color:#fff}
.cv-name{max-width:100%;font-size:22px;font-weight:600;text-shadow:0 1px 8px #0009;white-space:nowrap;overflow:hidden;
text-overflow:ellipsis}
.cv-layer{position:absolute;inset:0;z-index:2}

/* a piece on the cover: where it is (left, top, its turn and size set by cover.js), its box when chosen */
.cv-item{position:absolute;width:24%;touch-action:none;cursor:grab;display:flex;flex-direction:column;align-items:center}
.cv-k-text{width:44%}
.cv-k-counter,.cv-k-frame,.cv-k-photo-frame{width:32%}
.cv-k-link{width:16%}
.cv-k-theme{width:30%}
.cv-item-img{display:block;width:100%;height:auto;pointer-events:none;filter:drop-shadow(0 3px 8px #0006)}
.cv-item.on{outline:1.5px solid #ffffffe6;outline-offset:6px}
.cv-title{font-size:13px;font-weight:700;text-shadow:0 1px 6px #000a;white-space:nowrap;margin-bottom:2px}
.cv-words{display:block;width:100%;font-size:22px;font-weight:800;line-height:1.2;text-shadow:0 2px 8px #0009;
overflow-wrap:anywhere;white-space:pre-wrap}
.cv-photo{position:absolute;bottom:8%;font-size:10.5px;font-weight:700;padding:2px 8px;border-radius:99px;background:#000a}
.cv-h{position:absolute;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;z-index:1}
.cv-h svg{width:15px;height:15px;stroke-width:2.4}
.cv-x{top:-21px;left:-21px;background:#333;color:#fff;box-shadow:0 0 0 1px #ffffff40}
.cv-pen{top:-21px;right:-21px;background:#fff;color:#111!important}
.cv-turn{bottom:-21px;right:-21px;background:#fff;color:#111!important;touch-action:none}

/* the top: Cancel, Remove all, Save; Save and Remove all grey until they mean something */
.cv-top{position:absolute;left:0;right:0;top:0;z-index:5;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;
gap:8px;padding:calc(12px + var(--st)) 16px 12px;pointer-events:none}
.cv-top>*{pointer-events:auto}
.cv-word{justify-self:start;font-size:16px;padding:8px 2px;min-height:40px}
.cv-save{justify-self:end}
.cv-word:disabled,.cv-pill:disabled{opacity:1;color:#ffffff59}
.cv-pill{justify-self:center;font-size:13.5px;padding:6px 16px;border-radius:99px;border:1px solid #ffffffb3;white-space:nowrap}
.cv-pill:disabled{border-color:#ffffff40}
.cv-round{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:#0000004d}
.cv-viewing .cv-top{display:flex}

/* the foot: "Edit profile cover" over the five tools; the chosen tool green, as LINE's */
.cv-foot{position:absolute;left:0;right:0;bottom:0;z-index:6;display:flex;flex-direction:column;align-items:center;gap:14px;
padding:0 12px calc(8px + var(--sb))}
.cv-cover-pill{display:inline-flex;align-items:center;gap:7px;font-size:13.5px;padding:9px 16px;border-radius:99px;
background:#3a3a3acc;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.cv-cover-pill svg{width:17px;height:17px}
.cv-sheeted .cv-cover-pill{display:none}
.cv-tools{display:flex;justify-content:center;gap:clamp(10px,4vw,26px);width:100%}
.cv-tool{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;transition:color .2s}
.cv-tool.on{color:var(--cv-green)}
.cv-sheeted .cv-foot{background:var(--cv-sheet);min-height:var(--cv-foot)}
.cv-acts{display:flex;justify-content:center;width:100%;padding-bottom:10px}
.cv-decorate{display:flex;flex-direction:column;align-items:center;gap:6px;font-size:13px;min-width:88px}
.cv-decorate svg{width:28px;height:28px}

/* a tool's sheet: from the bottom over the lower part, the profile still seen above it */
.cv-sheet{position:absolute;left:0;right:0;bottom:var(--cv-foot);z-index:4;height:44%;display:flex;flex-direction:column;
background:var(--cv-sheet);border-radius:18px 18px 0 0;box-shadow:0 -10px 30px -12px #000c;
transform:translateY(calc(100% + var(--cv-foot)));transition:transform .32s cubic-bezier(.22,1,.36,1),visibility 0s .32s;
visibility:hidden}
.cv-sheet.on{transform:none;visibility:visible;transition:transform .32s cubic-bezier(.22,1,.36,1)}
.cv-grab{flex:none;display:grid;place-items:center;height:22px;width:100%}
.cv-grab::before{content:"";width:40px;height:5px;border-radius:3px;background:#ffffff59}
.cv-sheet>.note{margin:16px}
.cv-tabs{flex:none;display:flex;overflow-x:auto;scrollbar-width:none;border-bottom:1px solid #ffffff1a}
.cv-tabs::-webkit-scrollbar{display:none}
.cv-tab{flex:1 0 auto;min-width:64px;min-height:44px;display:grid;place-items:center;padding:6px 14px;font-size:14.5px;
color:var(--cv-dim)!important;border-bottom:2px solid transparent;text-align:center;white-space:nowrap}
.cv-tab[aria-selected=true]{color:#fff!important;font-weight:700;border-bottom-color:#fff}
.cv-tab-img{width:30px;height:30px;object-fit:contain;display:block}
.cv-list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:12px 12px 18px}
.cv-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.cv-cell{position:relative;aspect-ratio:1;display:grid;place-items:center;border-radius:10px;overflow:hidden;min-width:0}
.cv-cell:disabled{opacity:.38}
.cv-cell-img{max-width:100%;max-height:100%;object-fit:contain;display:block}
.cv-cell[aria-pressed=true]{box-shadow:inset 0 0 0 2.5px var(--cv-green)}
.cv-g-theme{grid-template-columns:repeat(3,minmax(0,1fr))}
.cv-g-theme .cv-cell{aspect-ratio:3/4;background:var(--cv-cell)}
.cv-g-theme .cv-cell-img{width:100%;height:100%;max-width:none;max-height:none;object-fit:cover}
.cv-g-text{grid-template-columns:repeat(2,minmax(0,1fr))}
.cv-g-text .cv-cell{aspect-ratio:2/1;background:var(--cv-cell);padding:8px}
.cv-g-widget .cv-cell{padding:4px}
.cv-g-effect .cv-cell{background:var(--cv-cell);padding:10px}
.cv-none svg{width:30px;height:30px;color:#ffffffb3}

/* the word at the foot, for a moment */
.cv-told{position:absolute;left:50%;bottom:calc(var(--cv-foot) + 64px);z-index:7;max-width:86%;transform:translate(-50%,8px);
padding:9px 16px;border-radius:99px;background:#000000d9;font-size:14px;text-align:center;opacity:0;pointer-events:none;
transition:opacity .25s,transform .25s}
.cv-told.on{opacity:1;transform:translate(-50%,0)}
.cv-sheeted .cv-told{bottom:calc(var(--cv-foot) + 46%)}

/* over the editor: a dialog, the counter's sheet, the text editor */
.cv-veil{position:absolute;inset:0;z-index:10;display:none;flex-direction:column;background:#000000a6}
.cv-veil.on{display:flex}
.cv-veil.cv-full{background:#000}
.cv-dlg{margin:auto;width:min(300px,86%);padding:22px 18px 16px;border-radius:14px;background:#2b2b2b;text-align:center;
animation:cv-in .2s ease-out}
.cv-dlg p{font-size:15.5px;line-height:1.45}
.cv-dlg-acts{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:20px}
.cv-dlg-acts button{min-height:44px;border-radius:8px;font-weight:700;text-align:center}
.cv-dlg-no{background:#fff;color:#111!important}
.cv-dlg-yes{background:var(--cv-green);color:#fff}

.cv-cs{position:relative;margin-top:auto;width:100%;max-height:92%;overflow-y:auto;padding:24px 20px calc(18px + var(--sb));
border-radius:16px 16px 0 0;background:#fff;color:#111;color-scheme:light;-webkit-user-select:text;user-select:text;
animation:cv-up .3s cubic-bezier(.22,1,.36,1)}
@keyframes cv-up{from{transform:translateY(100%)}}
.cv-cs h2{display:block;font-size:21px;font-weight:700;text-align:center;color:#111;margin:0;text-transform:none;letter-spacing:0}
.cv-cs h2::after{display:none}
.cv-cs-x{position:absolute;top:14px;right:14px;width:40px;height:40px;display:grid;place-items:center;color:#111!important}
.cv-cs-help{margin:8px 6px 18px;font-size:14px;color:#8c8c8c;text-align:center}
.cv-cs-field{display:flex;align-items:center;gap:10px;margin-top:10px;padding:12px 14px;border-radius:8px;background:#f2f2f2}
.cv-cs-field svg{width:19px;height:19px;color:#8c8c8c}
.cv-cs-field input{flex:1;min-width:0;font-size:16px;color:#111;background:none}
.cv-cs-field input::placeholder{color:#9a9a9a}
/* the date's own picker opened by a tap anywhere on its line; LINE's calendar icon alone is seen */
.cv-cs-field:has(.cv-cs-day){position:relative}
.cv-cs-day{text-align:left}
.cv-cs-day::-webkit-calendar-picker-indicator{position:absolute;inset:0;width:auto;height:auto;opacity:0;cursor:pointer}
.cv-cs-count{display:block;text-align:right;font-size:12px;color:#9a9a9a;margin-top:4px}
.cv-cs-tick{display:flex;align-items:flex-start;gap:14px;width:100%;margin-top:14px;padding-top:16px;
border-top:1px solid #ececec;color:#111!important}
.cv-cs-dot{flex:none;width:24px;height:24px;margin-top:2px;border-radius:50%;border:2px solid #c4c4c4;display:grid;
place-items:center}
.cv-cs-tick[aria-checked=true] .cv-cs-dot{border-color:var(--cv-green);background:var(--cv-green);box-shadow:inset 0 0 0 4px #fff}
.cv-cs-say b{display:block;font-size:15.5px;font-weight:700}
.cv-cs-say small{display:block;margin-top:3px;font-size:13px;color:#8c8c8c}
.cv-cs-done{display:block;width:100%;margin-top:20px;min-height:50px;border-radius:8px;background:var(--cv-green);
color:#fff!important;font-size:16px;font-weight:700;text-align:center}

.cv-te{flex:1;display:flex;flex-direction:column;min-height:0;padding:0 0 calc(12px + var(--sb))}
.cv-te-top{display:flex;justify-content:space-between;padding:calc(12px + var(--st)) 16px 8px}
.cv-te-mid{flex:1;display:grid;place-items:center;padding:16px}
.cv-te-words{width:100%;min-height:3em;resize:none;border:0;outline:0;background:none;color:#fff;
font:800 30px/1.25 var(--sans);text-align:center;-webkit-user-select:text;user-select:text}
.cv-te-foot{display:flex;flex-direction:column;gap:14px;padding:0 12px}
.cv-te-colours{display:flex;gap:10px;overflow-x:auto;scrollbar-width:none;padding:6px 4px}
.cv-te-colours::-webkit-scrollbar{display:none}
.cv-te-dot{flex:none;width:32px;height:32px;border-radius:50%;border:2px solid #fff;display:grid;place-items:center}
.cv-te-dot[aria-pressed=true]{box-shadow:0 0 0 3px #000,0 0 0 5px #fff}
.cv-te-plain{background:#333}
.cv-te-plain svg{width:14px;height:14px}
.cv-te-bar{display:flex;justify-content:center;gap:28px}
.cv-te-wheel,.cv-te-align{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:#ffffff1f}
.cv-te-wheel{background:conic-gradient(#ff3b3b,#ffc400,#9bd431,#16a8a8,#2f80ed,#8e5cf7,#ff4f8b,#ff3b3b)}
.cv-te-wheel svg{color:transparent}

/* day: the editor stays dark as LINE's does whatever the phone's look (D29); only its focus ring is the day's */
[data-theme=day] .cv :focus-visible{outline-color:var(--cv-green)}

@media (prefers-reduced-motion:reduce){
.cv-effect-img,.cv-sheet,.cv-told,.cv-cs,.cv-dlg,.screen:has(.cv){animation:none;transition:none}}
