/* ClipMaker UI. Token names match the YS demo site (styles.css); these are only defaults. */
:where(:root) {
  --bg: #0a0a0a; --bg-2: #111; --surface: #141414; --surface-2: #1a1a1a;
  --text: #fff; --text-2: rgba(255, 255, 255, .78); --muted: rgba(255, 255, 255, .6);
  --border: rgba(255, 255, 255, .08); --line: rgba(255, 255, 255, .22);
  --accent: #ffc000; --accent-ink: #0a0a0a; --accent-soft: rgba(255, 192, 0, .12);
  --green: #30d158; --red: #ff6b6b; --blue: #0a84ff;
  --radius-sm: 10px; --radius: 16px; --radius-lg: 20px;
  --font-head: "Prompt", "Noto Sans Thai", system-ui, sans-serif;
  --font-body: "Noto Sans Thai", "Prompt", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.6 var(--font-body); }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
p { margin: 0; }
.cm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cm-skip { position: absolute; left: .5rem; top: -4rem; background: var(--accent); color: var(--accent-ink); padding: .6rem 1rem; border-radius: var(--radius-sm); z-index: 100; }
.cm-skip:focus { top: .5rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.cm-app { max-width: 720px; margin: 0 auto; padding: 0 1rem calc(1rem + env(safe-area-inset-bottom)); }
.cm-header { padding: 1.25rem 0 .5rem; }
.cm-h1 { font: 700 1.5rem/1.3 var(--font-head); margin: 0; }
.cm-sub { color: var(--muted); font-size: .9rem; margin-top: .25rem; }
.cm-h2 { font: 600 1.25rem/1.4 var(--font-head); margin: 1rem 0 .25rem; }
.cm-h3 { font: 600 1rem/1.4 var(--font-head); margin: 0 0 .5rem; display: flex; align-items: center; gap: .5rem; }
.cm-lede { color: var(--text-2); margin-bottom: 1rem; }
.cm-hint { color: var(--muted); font-size: .85rem; }
.cm-note { color: var(--text-2); }
.cm-empty { color: var(--muted); padding: 1rem; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
.cm-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* stepper */
.cm-stepper { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; }
.cm-st { width: 100%; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; background: transparent; border: 0; border-radius: var(--radius-sm); color: var(--muted); cursor: pointer; padding: .3rem .1rem; }
.cm-st:disabled { cursor: default; opacity: .55; }
.cm-st-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); font: 600 .85rem var(--font-head); }
.cm-st-n .cm-ic { width: 16px; height: 16px; }
.cm-st-t { font-size: .75rem; line-height: 1.2; }
.cm-st.is-current { color: var(--text); }
.cm-st.is-current .cm-st-n { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.cm-st.is-done .cm-st-n { border-color: var(--green); color: var(--green); }
.cm-st:not(:disabled):hover .cm-st-n { border-color: var(--accent); }

/* cards + fields */
.cm-main { padding-bottom: 7rem; }
.cm-block { margin-top: 1rem; }
.cm-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 0 0 .75rem; min-width: 0; }
.cm-field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .85rem; }
.cm-lab { font-weight: 500; font-size: .95rem; }
.cm-input { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .65rem .8rem; min-height: 44px; font-size: 1rem; }
.cm-input::placeholder { color: var(--muted); }
.cm-ta { resize: vertical; min-height: 64px; }
.cm-count { font-size: .8rem; color: var(--muted); align-self: flex-end; }
.cm-count.is-over, .cm-counter.is-over { color: var(--red); font-weight: 600; }
.cm-counter { color: var(--text-2); margin-bottom: .75rem; font-weight: 500; }
.cm-tag { font: 500 .75rem var(--font-body); color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: .1rem .6rem; }
.cm-needs { border-color: rgba(255, 192, 0, .35); }
.cm-needs-t { color: var(--accent); }
fieldset { min-inline-size: 0; }

/* buttons */
.cm-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .55rem 1.2rem; border-radius: 999px; border: 1px solid transparent; font: 600 .95rem var(--font-head); cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s, transform .15s; }
.cm-btn:disabled { opacity: .45; cursor: not-allowed; }
.cm-btn:active:not(:disabled) { transform: scale(.98); }
.cm-btn-primary { background: var(--accent); color: var(--accent-ink); }
.cm-btn-primary:hover:not(:disabled) { background: #ffcf3d; }
.cm-btn-accent { background: var(--accent-soft); color: var(--accent); border-color: rgba(255, 192, 0, .45); }
.cm-btn-accent:hover:not(:disabled) { background: rgba(255, 192, 0, .2); }
.cm-btn-accent.is-rec { background: var(--red); color: #1a0000; border-color: var(--red); }
.cm-btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.cm-btn-ghost:hover:not(:disabled) { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .04); }
.cm-btn-sm { min-height: 44px; padding: .4rem .9rem; font-size: .88rem; }
.cm-back { margin-top: .75rem; }
.cm-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .75rem; align-items: center; }

/* choice cards (real radios) */
.cm-choices { border: 0; padding: 0; margin: 1rem 0 0; display: grid; gap: .6rem; }
.cm-choices legend { padding: 0; margin-bottom: .5rem; }
.cm-choice { display: block; position: relative; cursor: pointer; }
.cm-choice-in { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cm-choice-body { display: flex; align-items: center; justify-content: space-between; gap: .75rem; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; min-height: 56px; transition: border-color .15s, background-color .15s; }
.cm-choice-text { display: flex; flex-direction: column; gap: .15rem; }
.cm-choice-body .cm-ic { opacity: 0; color: var(--accent); }
.cm-choice-in:checked + .cm-choice-body { border-color: var(--accent); background: var(--accent-soft); }
.cm-choice-in:checked + .cm-choice-body .cm-ic { opacity: 1; }
.cm-choice-in:focus-visible + .cm-choice-body { outline: 3px solid var(--accent); outline-offset: 2px; }
.cm-choice:hover .cm-choice-body { border-color: var(--line); }
.cm-choice.is-disabled { cursor: not-allowed; opacity: .5; }
.cm-choice.is-disabled .cm-choice-in { cursor: not-allowed; }

/* custom dropdown */
.cm-lb { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .85rem; position: relative; }
.cm-lb-btn { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; min-height: 44px; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .8rem; cursor: pointer; }
.cm-lb-btn:hover { border-color: rgba(255, 255, 255, .45); }
.cm-lb-btn[aria-expanded="true"] .cm-ic { transform: rotate(180deg); }
.cm-lb-panel { position: fixed; z-index: 60; margin: 0; padding: .35rem; list-style: none; overflow-y: auto; overscroll-behavior: contain; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0, 0, 0, .6); outline: none; }
.cm-lb-panel:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.cm-lb-opt { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 44px; padding: .5rem .7rem; border-radius: var(--radius-sm); cursor: pointer; }
.cm-lb-opt .cm-ic { opacity: 0; color: var(--accent); }
.cm-lb-opt[aria-selected="true"] .cm-ic { opacity: 1; }
.cm-lb-opt[aria-selected="true"] { color: var(--accent); }
.cm-lb-opt.is-active { background: rgba(255, 255, 255, .09); }

/* shot table -> stacked cards on phones */
.cm-tablewrap { overflow-x: auto; }
.cm-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cm-table th, .cm-table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.cm-table th { color: var(--muted); font-weight: 500; font-size: .8rem; }
@media (max-width: 639px) {
  .cm-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .cm-table, .cm-table tbody, .cm-table tr, .cm-table td { display: block; width: 100%; }
  .cm-table tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .8rem; margin-bottom: .6rem; }
  .cm-table td { border: 0; padding: .25rem 0; overflow-wrap: anywhere; }
  .cm-table td::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--muted); }
}

/* uploads */
.cm-file-in { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.cm-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: .25rem; text-align: center; padding: 1.25rem 1rem; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background-color .15s; }
.cm-drop:hover, .cm-drop.is-over, .cm-drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.cm-drop:has(:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.cm-drop .cm-ic { width: 28px; height: 28px; color: var(--accent); }
.cm-preview { margin-top: .75rem; display: flex; gap: .75rem; align-items: center; }
.cm-preview:empty { display: none; }
.cm-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); }
.cm-thumb-ph { display: grid; place-items: center; color: var(--muted); }
.cm-preview-meta { display: flex; flex-direction: column; gap: .4rem; min-width: 0; align-items: flex-start; overflow-wrap: anywhere; font-size: .9rem; }
.cm-check { display: flex; gap: .65rem; align-items: flex-start; margin-top: .75rem; font-size: .92rem; color: var(--text-2); }
.cm-check label { padding-top: .5rem; }
.cm-check-in { width: 24px; height: 24px; margin: .35rem 0 0; accent-color: var(--accent); flex: none; }
.cm-headline { color: var(--text-2); margin-bottom: .75rem; overflow-wrap: anywhere; }
.is-bad { color: var(--red); }
.cm-scene .cm-hint[role="status"]:empty { display: none; }

/* voice */
.cm-rec { display: flex; align-items: center; gap: 1rem; margin-top: .75rem; }
.cm-timer { font: 600 1.1rem var(--font-head); font-variant-numeric: tabular-nums; }
.cm-audio { width: 100%; margin-top: .75rem; }
.cm-read ol { margin: .5rem 0 0; padding-left: 1.25rem; color: var(--text-2); }
.cm-read summary, .cm-rep summary { cursor: pointer; min-height: 32px; font-weight: 500; }
.cm-consent { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .8rem; }

/* editor summary */
.cm-summary { list-style: none; padding: 0; margin: 0 0 .75rem; }
.cm-sum { display: flex; justify-content: space-between; gap: .75rem; align-items: center; }
.cm-sum p { overflow-wrap: anywhere; }
.cm-pill { font-size: .78rem; padding: .2rem .7rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.cm-pill.is-on { color: var(--green); border-color: rgba(48, 209, 88, .5); }
.cm-cost { background: var(--surface); border: 1px solid rgba(255, 192, 0, .35); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1rem; }
.cm-cost strong { color: var(--accent); font-family: var(--font-head); }
.cm-issues { margin: .5rem 0 0; padding-left: 1.2rem; color: var(--red); }

/* gate bar */
.cm-gate { position: sticky; bottom: 0; z-index: 20; margin: 1rem -1rem 0; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -8px 16px -8px rgba(0, 0, 0, .7); display: flex; flex-direction: column; gap: .5rem; }
.cm-gate-btn { width: 100%; min-height: 52px; font-size: 1.05rem; }
.cm-why { list-style: none; margin: 0; padding: 0; font-size: .85rem; color: var(--text-2); }
.cm-why:empty { display: none; }
.cm-why li::before { content: "• "; color: var(--accent); }

/* errors + states */
.cm-err, .cm-warn { display: flex; gap: .75rem; align-items: flex-start; border-radius: var(--radius); padding: .85rem 1rem; }
.cm-err { background: rgba(255, 107, 107, .1); border: 1px solid rgba(255, 107, 107, .5); color: #ffd0d0; }
.cm-err .cm-ic { color: var(--red); margin-top: .15rem; }
.cm-err-body { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; min-width: 0; overflow-wrap: anywhere; }
.cm-warn { background: var(--accent-soft); border: 1px solid rgba(255, 192, 0, .45); margin-bottom: .75rem; }
.cm-warn .cm-ic { color: var(--accent); margin-top: .2rem; }
.cm-skel-list { display: grid; gap: .6rem; }
.cm-skel { height: 56px; border-radius: var(--radius); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 200% 100%; }
.cm-skel-line { display: inline-block; height: 1.2rem; width: 60%; vertical-align: middle; }
@media (prefers-reduced-motion: no-preference) {
  .cm-skel { animation: cm-shimmer 1.4s linear infinite; }
  .cm-bar-fill { animation: cm-bar 1.6s ease-in-out infinite; }
}
@keyframes cm-shimmer { to { background-position: -200% 0; } }
@keyframes cm-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.cm-progress { text-align: center; padding: 1.5rem 0; }
.cm-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 1rem; }
.cm-bar-fill { display: block; width: 40%; height: 100%; background: var(--accent); border-radius: 999px; }

/* result */
.cm-video { width: 100%; background: #000; border-radius: var(--radius); object-fit: contain; display: block; margin: .5rem auto 0; max-height: 70vh; }
.cm-video-916 { aspect-ratio: 9 / 16; max-width: min(100%, 15rem); }
.cm-video-45 { aspect-ratio: 4 / 5; max-width: min(100%, 18rem); }
.cm-ok { display: flex; gap: .5rem; align-items: center; color: var(--green); font-weight: 600; }
.cm-dl { justify-content: center; }
.cm-rep { margin-top: 1rem; }
.cm-report { overflow-wrap: anywhere; font: .85rem/1.6 var(--font-body); color: var(--text-2); margin: .5rem 0 0; }
.cm-md-h { font-family: var(--font-head); color: var(--text); margin: .75rem 0 .25rem; font-size: 1rem; }
.cm-md-ul { margin: .25rem 0; padding-left: 1.2rem; }
.cm-md-p { margin: .25rem 0; }
.cm-fix-list { list-style: none; padding: 0; margin: .75rem 0; }
.cm-fix { display: flex; justify-content: space-between; gap: .75rem; align-items: center; flex-wrap: wrap; }
.cm-fix-main { display: flex; flex-direction: column; min-width: 0; }
.cm-fix-word { font: 600 1.2rem var(--font-head); overflow-wrap: anywhere; }
.cm-fix-act { display: flex; gap: .5rem; }

@media (min-width: 640px) {
  .cm-st { flex-direction: row; gap: .5rem; justify-content: center; }
  .cm-st-t { font-size: .85rem; }
  .cm-gate { margin: 1rem 0 0; border-radius: var(--radius) var(--radius) 0 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* start from photos: sortable list (reorder the real <li>; handle = pointer drag or Space + arrows) */
.cm-photopanel .cm-drop { margin-top: .5rem; }
.cm-photo-lede { margin-bottom: .5rem; }
.cm-photos { list-style: none; margin: .75rem 0 0; padding: 0 0 .5rem; display: grid; gap: .6rem; }
.cm-photo { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .75rem .5rem; scroll-margin: 1rem 0 calc(var(--gate-h, 9rem) + 1rem); }
.cm-photo-head { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: .6rem; align-items: center; margin-bottom: .5rem; }
.cm-photo-meta { display: flex; flex-direction: column; gap: .15rem; min-width: 0; overflow-wrap: anywhere; align-items: flex-start; }
.cm-photo-n { font: 600 .95rem var(--font-head); }
.cm-photo .cm-thumb { width: 56px; height: 56px; }
.cm-photo .cm-field { margin-bottom: .25rem; }
.cm-handle { width: 44px; height: 44px; display: grid; place-items: center; background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; opacity: .85; }
.cm-handle:is(:hover, :focus-visible) { opacity: 1; background: rgba(255, 255, 255, .1); }
.cm-handle[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.cm-photo:has(.cm-handle:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.cm-photo.is-grabbed { transform: scale(1.02); box-shadow: 0 10px 28px rgba(0, 0, 0, .55); border-color: var(--accent); }
.cm-photo.is-dragging { position: relative; z-index: 5; transform: scale(1.02); box-shadow: 0 14px 34px rgba(0, 0, 0, .6); border-color: var(--accent); }
.cm-photo.is-drop-before::before, .cm-photo.is-drop-after::after { content: ""; position: absolute; left: 0; right: 0; height: 4px; border-radius: 4px; background: var(--accent); }
.cm-photo.is-drop-before::before { top: -.4rem; }
.cm-photo.is-drop-after::after { bottom: -.4rem; }
.cm-keyhint { display: none; font-size: .78rem; color: var(--muted); }
.cm-photo:has(.cm-handle:focus-visible) .cm-keyhint { display: block; }
.cm-dragging, .cm-dragging * { cursor: grabbing !important; }
@media (prefers-reduced-motion: no-preference) { .cm-photo { transition: transform .15s, box-shadow .15s, border-color .15s; } }
@media (forced-colors: active) { .cm-photo.is-drop-before::before, .cm-photo.is-drop-after::after { background: Highlight; } }

/* step 1: the photo disclosure */
.cm-photo-sum { cursor: pointer; min-height: 44px; list-style: none; margin: 0; }
.cm-photo-sum::-webkit-details-marker { display: none; }
.cm-photo-sum::after { content: ""; margin-inline-start: auto; width: .55rem; height: .55rem; border: solid currentColor; border-width: 0 2px 2px 0; rotate: 45deg; transition: rotate .15s; }
.cm-photopanel[open] > .cm-photo-sum::after { rotate: -135deg; }
.cm-photopanel[open] > .cm-photo-sum { margin-bottom: .5rem; }
.cm-check > div { min-width: 0; }
.cm-check > div > .cm-hint { display: block; }

/* confirm dialog */
.cm-dialog { width: min(92vw, 420px); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: 0 24px 60px rgba(0, 0, 0, .7); }
.cm-dialog::backdrop { background: rgba(0, 0, 0, .65); }
.cm-dialog .cm-actions { justify-content: flex-end; }

/* step 4: platforms */
.cm-plats { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .25rem; }
.cm-plat, .cm-trim { display: flex; gap: .65rem; align-items: flex-start; }
.cm-plat { padding: .35rem 0; }
.cm-plat label { display: inline-flex; gap: .5rem; align-items: center; flex-wrap: wrap; min-height: 44px; padding-top: .15rem; }
.cm-plat > div { min-width: 0; }
.cm-plat .cm-hint { margin-top: -.5rem; }
.cm-trim { border-top: 1px solid var(--border); margin-top: .5rem; padding-top: .25rem; }
.cm-skipped li + li { margin-top: .35rem; }
.cm-plat .cm-hint, .cm-trim .cm-hint, .cm-skipped { text-wrap: pretty; }
.cm-skipped { margin: .5rem 0 0; padding-left: 1.2rem; color: var(--text-2); font-size: .88rem; }
.is-bad { color: var(--red); }

/* step 5: one card per platform output */
.cm-vers { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.cm-outs { display: grid; gap: .75rem; margin-top: .75rem; }
.cm-out { display: flex; flex-direction: column; margin: 0; }
.cm-out-h { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.cm-out-h .cm-h3 { margin: 0; }
.cm-out-h .cm-h3 { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
html { scroll-padding-bottom: calc(var(--gate-h, 9rem) + 1rem); }
.cm-prows { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .25rem; }
.cm-prow { border-top: 1px solid var(--border); padding: .5rem 0 .25rem; }
.cm-prow-main { display: flex; align-items: center; gap: .25rem .75rem; flex-wrap: wrap; }
.cm-prow-main strong { min-width: 6.5rem; }
.cm-prow-act { display: flex; gap: .5rem; margin-left: auto; flex-wrap: wrap; }
.cm-share-status:empty { display: none; }
.cm-share-status { margin-top: .35rem; }
.cm-app.is-wide { max-width: 1040px; }
@media (min-width: 900px) { .cm-outs { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.cm-postcard { margin-top: .75rem; }
.cm-feedto { border: 0; padding: 0; margin: .15rem 0 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; }
.cm-feedto label { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; }
.cm-feedto input { width: 22px; height: 22px; accent-color: var(--accent); }
.cm-header > nav.cm-hint a { color: var(--accent); display: inline-flex; align-items: center; min-height: 44px; }

/* H1: script gate assist + skippable questions */
.cm-why-soft { color: var(--muted); }
.cm-why-soft:empty { display: none; }
.cm-why-soft li::before { content: "ℹ " / ""; color: var(--muted); }
.cm-assist-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.cm-assist { min-height: 48px; flex: 1 1 14rem; }
.cm-assist[hidden] { display: none; }
.cm-assist[aria-busy="true"] { opacity: .7; cursor: progress; }
.cm-assist-st { margin: 0; }
.cm-need-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: stretch; }
.cm-need-row .cm-input { flex: 1 1 14rem; min-width: 0; }
.cm-need-skip { flex: 0 0 auto; }
.cm-need-skip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.cm-need.is-skipped .cm-input { opacity: .55; }
/* P8: save to Drive -> ตรวจแล้ว ผ่าน -> เข้าคิวอัปโหลด (results page) */
.cm-flow { margin-top: .75rem; }
.cm-flow-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.cm-flow-i { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: .75rem; padding: .75rem 0; border-top: 1px solid var(--border); }
.cm-flow-i:first-child { border-top: 0; }
.cm-flow-n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); font: 600 .9rem var(--font-head); color: var(--text-2); }
.cm-flow-i.is-done .cm-flow-n { background: var(--green); border-color: var(--green); color: #04210d; }
.cm-flow-n .cm-ic { width: 18px; height: 18px; }
.cm-flow-b { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; min-width: 0; }
.cm-flow-b .cm-hint { overflow-wrap: anywhere; }
.cm-flow-link { color: var(--accent); text-underline-offset: 3px; }
.cm-qdlg { width: min(32rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem); padding: 0; overscroll-behavior: contain; }
.cm-qdlg::backdrop { background: rgba(0, 0, 0, .7); overflow: hidden; overscroll-behavior: contain; }
.cm-qdlg .cm-dform { padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.cm-qdlg .cm-dform .cm-h2 { margin: 0 0 .25rem; }
.cm-fs { border: 0; padding: 0; margin: 0 0 .25rem; }
.cm-dt { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; }
textarea.cm-input { resize: vertical; line-height: 1.6; }
@media (prefers-reduced-motion: no-preference) { .cm-qdlg[open] { animation: cm-pop .2s ease-out; } }
.cm-qdlg .cm-dform > .cm-qdlg-actions { position: sticky; bottom: 0; z-index: 1; margin: .25rem -1.25rem -1.25rem; padding: .75rem 1.25rem calc(.75rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); justify-content: flex-end; }
.cm-qdlg .cm-dform > [role="alert"] { scroll-margin-bottom: 5rem; }
@keyframes cm-pop { from { opacity: 0; transform: translateY(8px); } }
