/* Draft page (/draft) and Progress page (/progress), on top of app.css (Misso sky window). */
.draft-page, .prog-page { position: relative; z-index: 2; width: min(860px, 100%); margin: 22px auto 0; display: grid; gap: 14px; }
.dp-loading { text-align: center; color: var(--muted); padding: 60px 0; }
.dp-back { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.dp-head { display: flex; gap: 10px; align-items: center; }
.dp-title { flex: 1; min-width: 0; border: 0; background: transparent; font: 400 clamp(32px, 5vw, 46px)/1.05 var(--serif); color: var(--ink); padding: 4px 0; border-bottom: 2px dashed transparent; }
.dp-title:focus { outline: none; border-bottom-color: var(--accent); }
.dp-del { border: 0; background: rgba(255,255,255,.7); border-radius: 999px; padding: 8px 14px; font-weight: 600; color: #B3261E; cursor: pointer; }
.dp-formats { display: flex; flex-wrap: wrap; gap: 8px; }
.dp-formats button { display: inline-flex; align-items: center; gap: 7px; border: 2px solid transparent; background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }
.dp-formats button[aria-checked="true"] { border-color: var(--ink); background: var(--accent-soft); }
.dp-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dp-steps a { display: flex; align-items: center; gap: 7px; padding: 9px 10px; border-radius: 14px; background: rgba(255,255,255,.6); color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.dp-steps i { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #E3EAF2; font-style: normal; font-size: 12px; }
.dp-steps .done a { color: var(--ink); } .dp-steps .done i { background: var(--accent); }
.dp-steps .now a { background: #fff; color: var(--ink); box-shadow: var(--shadow); } .dp-steps .now i { background: var(--ink); color: #fff; }
.dp-card { background: #fff; border-radius: 26px; padding: 20px 22px; box-shadow: var(--shadow); scroll-margin-top: 20px; }
.dp-card h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 400 28px/1 var(--serif); }
.dp-card h2 i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); font: 700 13px var(--sans); font-style: normal; }
.dp-label { margin: 0 0 2px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.dp-hook { margin: 0 0 10px; font: 400 24px/1.15 var(--serif); }
.dp-tpl { background: var(--accent-soft); border: 1px dashed rgba(120,160,40,.7); border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; }
.dp-tpl span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #4D6B12; }
.dp-tpl p { margin: 4px 0 0; font: 400 20px/1.2 var(--serif); } .dp-tpl mark { background: none; color: #B3261E; font-weight: 600; }
.dp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dp-grid label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dp-grid input, .dp-grid select, .dp-row input, .dp-row textarea, .dp-post input { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid #DCE4EC; background: #F7F9FC; font: 500 14px var(--sans); color: var(--ink); }
.dp-row textarea { resize: vertical; font-weight: 400; line-height: 1.4; }
.dp-muted { color: var(--muted); margin: 0 0 12px; }
.dp-rows { display: grid; gap: 10px; }
.dp-row { display: grid; grid-template-columns: 78px 1fr; gap: 8px; align-items: start; }
.dp-row > div { display: grid; gap: 6px; }
.dp-row .vis { font-size: 13px; color: var(--muted); }
.dp-row.slide { grid-template-columns: 34px 1fr; }
.dp-row .n { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; }
.dp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dp-lock { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #F7F9FC; border-radius: 14px; padding: 12px 14px; }
.dp-progress { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.dp-progress .bar { flex: 1; height: 8px; border-radius: 999px; background: #EEF3F8; overflow: hidden; } .dp-progress .bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s; }
.dp-shots { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dp-shots li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); }
.dp-shots li.done { background: var(--accent-soft); border-color: rgba(180,224,74,.6); }
.dp-shots li.done p:not(.when) { text-decoration: line-through; text-decoration-color: rgba(14,15,16,.3); }
.dp-shots p { margin: 0; } .dp-shots .when { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 2px; } .dp-shots .ost { margin-top: 4px; font: 400 17px/1.2 var(--serif); }
.chk input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chk span { display: block; width: 24px; height: 24px; border-radius: 8px; border: 2px solid #C9D3DE; background: #fff; cursor: pointer; }
.chk input:checked + span { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%230E0F10' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: var(--ink); }
.chk input:focus-visible + span { outline: 2.5px solid var(--blue); outline-offset: 2px; }
.dp-post { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.dp-posted { font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.dp-wait { display: flex; align-items: center; gap: 6px; color: var(--muted); padding: 12px 0 0; }
.dp-wait i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: dpdot 1s infinite ease-in-out; }
.dp-wait i:nth-child(2) { animation-delay: .15s; } .dp-wait i:nth-child(3) { animation-delay: .3s; } .dp-wait span { margin-left: 6px; }
@keyframes dpdot { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* badge celebration */
.celebrate { position: relative; text-align: center; overflow: hidden; }
.badge-big { width: 110px; height: 110px; margin: 6px auto 8px; display: grid; place-items: center; clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); background: linear-gradient(135deg, #D4F27E, #8FC23A); animation: pop .6s cubic-bezier(.2,1.4,.4,1) both; }
.badge-big span { font: 700 40px/1 var(--sans); }
@keyframes pop { from { transform: scale(.3) rotate(-20deg); opacity: 0; } }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -10px; width: 8px; height: 14px; border-radius: 2px; background: var(--accent); animation: fall 1.6s ease-in forwards; }
.confetti i:nth-child(3n) { background: #8FBCE6; } .confetti i:nth-child(4n) { background: #F2A65A; }
.confetti i:nth-child(1) { left: 5%; } .confetti i:nth-child(2) { left: 12%; animation-delay: .1s; } .confetti i:nth-child(3) { left: 19%; animation-delay: .25s; } .confetti i:nth-child(4) { left: 26%; animation-delay: .05s; }
.confetti i:nth-child(5) { left: 33%; animation-delay: .3s; } .confetti i:nth-child(6) { left: 40%; animation-delay: .15s; } .confetti i:nth-child(7) { left: 47%; } .confetti i:nth-child(8) { left: 54%; animation-delay: .2s; }
.confetti i:nth-child(9) { left: 61%; animation-delay: .35s; } .confetti i:nth-child(10) { left: 68%; animation-delay: .1s; } .confetti i:nth-child(11) { left: 75%; animation-delay: .25s; } .confetti i:nth-child(12) { left: 82%; }
.confetti i:nth-child(13) { left: 89%; animation-delay: .3s; } .confetti i:nth-child(14) { left: 95%; animation-delay: .05s; } .confetti i:nth-child(15) { left: 30%; animation-delay: .45s; } .confetti i:nth-child(16) { left: 70%; animation-delay: .5s; } .confetti i:nth-child(17) { left: 50%; animation-delay: .4s; }
@keyframes fall { to { transform: translateY(520px) rotate(540deg); opacity: 0; } }

/* Progress page */
.prog-page h1 { margin: 0; font: 400 clamp(40px, 7vw, 60px)/1 var(--serif); }
.pg-top { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.pg-card { background: #fff; border-radius: 26px; padding: 18px; box-shadow: var(--shadow); text-align: center; }
.pg-card .big { font: 400 54px/1 var(--serif); }
.pg-card .lbl { color: var(--muted); font-weight: 600; margin-top: 4px; }
.pg-flame { font-size: 46px; line-height: 1; filter: saturate(1.2); }
.pg-flame.off { filter: grayscale(1); opacity: .5; }
.pg-days { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.pg-days span { display: grid; justify-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); }
.pg-days i { width: 22px; height: 22px; border-radius: 50%; background: #E9EEF3; font-style: normal; display: grid; place-items: center; font-size: 11px; color: #fff; }
.pg-days i.on { background: #F2A65A; }
.pg-ring { width: 120px; height: 120px; margin: 0 auto; position: relative; display: grid; place-items: center; }
.pg-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.pg-ring circle { fill: none; stroke-width: 12; } .pg-ring .bg { stroke: #EEF3F8; } .pg-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .8s; }
.pg-ring b { font: 400 36px/1 var(--serif); }
.pg-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pg-stats div { background: rgba(255,255,255,.8); border-radius: 18px; padding: 12px; text-align: center; }
.pg-stats b { display: block; font: 400 30px/1 var(--serif); } .pg-stats span { font-size: 12px; color: var(--muted); }
.pg-group { background: #fff; border-radius: 26px; padding: 18px 20px; box-shadow: var(--shadow); }
.pg-group h2 { margin: 0 0 12px; font: 400 26px/1 var(--serif); }
.pg-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px 10px; }
.pg-badge { text-align: center; }
.pg-badge .hex { width: 84px; height: 84px; margin: 0 auto 6px; display: grid; place-items: center; clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); background: #E3E8EE; font: 800 28px/1 var(--sans); color: #fff; }
.pg-badge.on .hex { background: linear-gradient(135deg, #D4F27E, #6FA82A); color: var(--ink); box-shadow: 0 10px 20px -10px rgba(60,100,20,.6); }
.pg-badge:not(.on) .hex span { filter: grayscale(1); opacity: .55; }
.pg-badge b { display: block; font-size: 14px; } .pg-badge small { color: var(--muted); font-size: 12px; }
@media (max-width: 640px) {
  .dp-grid, .pg-top { grid-template-columns: 1fr; } .dp-steps { grid-template-columns: repeat(2, 1fr); } .dp-post { grid-template-columns: 1fr; }
  .pg-stats { grid-template-columns: repeat(2, 1fr); } .dp-row { grid-template-columns: 1fr; }
}

/* ---------- visual drafts ---------- */
.pill.small { padding: 6px 12px; font-size: 13px; }
/* phone preview */
.dp-preview { display: grid; grid-template-columns: 230px 1fr; gap: 20px; align-items: start; margin-bottom: 12px; }
.phone { position: relative; aspect-ratio: 9 / 16; border-radius: 30px; background: #0E0F10; padding: 8px; box-shadow: 0 20px 40px -18px rgba(20,30,45,.5); overflow: hidden; }
.ph-bg { position: absolute; inset: 8px; border-radius: 24px; background: #F2F5F8 center / cover no-repeat; transition: background-image .3s; }
.ph-bg::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, transparent 45%, rgba(14,15,16,.55)); }
.ph-cap { position: absolute; left: 18px; right: 18px; bottom: 44px; color: #fff; font: 700 17px/1.25 var(--sans); text-shadow: 0 2px 10px rgba(0,0,0,.5); text-align: center; }
.ph-bar { position: absolute; left: 18px; right: 18px; top: 18px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.35); } .ph-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); }
.ph-time { position: absolute; right: 18px; top: 28px; color: #fff; font: 600 11px var(--sans); }
.dp-beats { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.dp-beats button { width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 10px; font: 400 13px/1.3 var(--sans); cursor: pointer; }
.dp-beats button b { display: inline-block; min-width: 54px; margin-right: 6px; font-weight: 700; }
.dp-beats button.on { border-color: var(--ink); background: var(--accent-soft); }
.dp-edit { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.dp-edit summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
/* storyboard shot cards with sketches */
.dp-shotgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.dp-shotgrid li { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; display: grid; }
.dp-shotgrid li.done { border-color: rgba(180,224,74,.8); box-shadow: 0 0 0 2px rgba(180,224,74,.45); }
.sk { position: relative; aspect-ratio: 4 / 5; background: #F2F5F8; display: grid; place-items: center; }
.sk.sq { aspect-ratio: 4 / 5; }
.sk img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sk.busy::after { content: "Drawing…"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.75); font-weight: 700; }
.sk-empty { color: var(--muted); font-size: 13px; }
.sk-n { position: absolute; left: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font: 700 12px var(--sans); }
.sk-redo { position: absolute; right: 8px; top: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); cursor: pointer; font-size: 15px; }
.sh-body { padding: 10px 12px 12px; display: grid; gap: 4px; }
.sh-body p { margin: 0; font-size: 13.5px; } .sh-body .when { font-size: 12px; font-weight: 700; color: var(--muted); } .sh-body .ost { font: 400 16px/1.2 var(--serif); }
.sh-acts { display: flex; align-items: center; gap: 8px; margin-top: 6px; } .sh-acts .pill { margin-left: auto; }
/* carousel: live 4:5 slides, swipeable */
.dp-slides { display: grid; grid-auto-flow: column; grid-auto-columns: min(300px, 78%); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; }
.slide45 { scroll-snap-align: start; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; position: relative; background: #fff; box-shadow: 0 10px 24px -14px rgba(20,30,45,.45); }
.slide45 .s-in { position: absolute; inset: 0; padding: 26px 22px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.slide45 h3 { margin: 0; font: 400 30px/1.05 var(--serif); color: var(--ink); }
.slide45 p { margin: 0; font: 400 15px/1.4 var(--sans); color: #2B3138; }
.slide45 .s-n { position: absolute; top: 14px; right: 16px; font: 700 11px var(--sans); color: var(--muted); }
.slide45 .s-kick { position: absolute; bottom: 52px; right: 22px; font: 700 12px var(--sans); color: var(--ink); background: var(--accent); padding: 5px 10px; border-radius: 999px; }
.slide45 .s-brand { position: absolute; left: 22px; bottom: 18px; display: flex; align-items: center; gap: 6px; font: 600 12px var(--sans); color: var(--ink); }
.slide45.hook { background: linear-gradient(180deg, #A9D2F5, #D8EBFB 70%, #C9E7A6); } .slide45.hook h3 { font-size: 38px; }
.slide45.cta { background: var(--accent); } .slide45.cta h3 { font-size: 34px; }
/* post kit */
.kit { display: grid; gap: 12px; }
.kit pre { margin: 0; white-space: pre-wrap; font: 400 15px/1.5 var(--sans); background: #F7F9FC; border-radius: 14px; padding: 12px 14px; }
.kit .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .kit .tags span { background: #DCEBFA; border-radius: 999px; padding: 4px 10px; font: 600 12.5px var(--sans); }
.kit-pin { background: #F7F9FC; border-radius: 14px; padding: 12px 14px; } .kit-pin p { margin: 0 0 8px; }
.covers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cover { position: relative; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: linear-gradient(160deg, #A9D2F5, #EEF8D6) center / cover no-repeat; display: flex; align-items: flex-end; padding: 12px; }
.cover span { background: #fff; color: var(--ink); font: 400 20px/1.05 var(--serif); padding: 6px 9px; border-radius: 10px; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
/* teleprompter + recording */
.prompter { position: fixed; inset: 0; z-index: 80; background: #000; color: #fff; display: grid; grid-template-rows: auto 1fr auto; }
.prompter[hidden] { display: none; }
.prompter video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.pr-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.15) 40%, rgba(0,0,0,.55)); }
.pr-top, .pr-text, .pr-bar { position: relative; z-index: 2; }
.pr-top { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 16px 8px; font: 600 14px var(--sans); }
.pr-x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 16px; cursor: pointer; }
.pr-rec { margin-left: auto; color: #FF5A5A; font-weight: 800; animation: blink 1s infinite; } @keyframes blink { 50% { opacity: .3; } }
.pr-text { overflow-y: auto; padding: 20vh 7vw 40vh; font: 700 clamp(26px, 6vw, 44px)/1.3 var(--sans); text-align: center; scrollbar-width: none; }
.pr-text p { margin: 0 0 .8em; } .pr-text.mirror { transform: scaleX(-1); }
.pr-bar { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); background: rgba(0,0,0,.45); }
.pr-bar button { min-width: 44px; height: 44px; border-radius: 999px; border: 0; background: rgba(255,255,255,.18); color: #fff; font: 700 18px var(--sans); cursor: pointer; padding: 0 12px; }
.pr-bar .pr-go { background: #FF4D4D; padding: 0 22px; font-size: 16px; }
.pr-bar label { display: flex; align-items: center; gap: 6px; font: 600 12px var(--sans); }
@media (max-width: 640px) {
  .dp-preview { grid-template-columns: 1fr; } .phone { width: min(260px, 80%); margin: 0 auto; }
  .covers { grid-template-columns: repeat(3, 1fr); gap: 6px; } .cover span { font-size: 15px; }
  .pr-bar label { display: none; }
}
