/* ClipCart — same calm, bright look as devisefriday.com */
:root {
  --text: #1d1d1f; --muted: #6e6e73; --gray: #f5f5f7; --line: #e5e5ea;
  --accent: #4f46e5; --accent-hover: #4338ca; --ok: #067647; --warn: #b54708; --bad: #c01048;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--gray); color: var(--text); font: 15px/1.55 "IBM Plex Sans Thai", -apple-system, "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }

.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 12px 24px; background: rgb(255 255 255 / 0.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.home { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; }
.home:hover { background: var(--gray); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.08rem; }
.brand em { padding: 1px 8px; border-radius: 999px; background: #fef3c7; color: var(--warn); font-style: normal; font-size: 0.7rem; }
.tabs { margin-left: auto; display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--gray); }
.tabs button { border: 0; background: none; padding: 6px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / 0.08); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.72rem; }

.make { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; max-width: 1180px; margin: 0 auto; padding: 24px; align-items: start; }
.steps { display: grid; gap: 16px; min-width: 0; }
.card { background: #fff; border-radius: 20px; padding: 22px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.card h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 1.15rem; }
.n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 0.85rem; }
label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 0.92rem; }
label span, .photos-label span, small { font-weight: 400; color: var(--muted); font-size: 0.82rem; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 9px 12px; border: 1px solid #d2d2d7; border-radius: 12px; background: #fff; font-weight: 400; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row > label { margin-bottom: 14px; }

.photos-label { font-weight: 600; font-size: 0.92rem; margin-bottom: 8px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.photo, .add-photo { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgb(0 0 0 / 0.55); color: #fff; cursor: pointer; line-height: 1; }
.add-photo { margin: 0; display: grid; place-content: center; text-align: center; gap: 0; border: 1.5px dashed #c7c7cc; color: var(--muted); font-weight: 500; font-size: 0.8rem; cursor: pointer; }
.add-photo span { font-size: 1.6rem; line-height: 1; }
.add-photo:hover { border-color: var(--accent); color: var(--accent); }

button { cursor: pointer; }
.primary { border: 0; border-radius: 999px; padding: 10px 20px; background: var(--accent); color: #fff; font-weight: 600; }
.primary:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.55; cursor: progress; }
.line-actions button, .studio-actions button:not(.primary), .q-actions button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 500; }
.line-actions button:hover, .studio-actions button:not(.primary):hover, .q-actions button:hover { border-color: var(--accent); color: var(--accent); }
.note { margin: 8px 0 0; color: var(--muted); font-size: 0.84rem; min-height: 0; }
.note:empty { display: none; }
.note.bad { color: var(--bad); }
#ai-script { margin-bottom: 4px; }
#ai-script + .note { margin-bottom: 14px; }
#hook { margin-bottom: 0; }
label:has(#hook) { margin-top: 14px; }

.lines-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 0.92rem; }
.lines-head select { width: auto; margin: 0; padding: 5px 10px; font-size: 0.85rem; }
.lines { list-style: none; margin: 8px 0 10px; padding: 0; display: grid; gap: 8px; counter-reset: line; }
.lines li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; counter-increment: line; }
.lines li::before { content: counter(line); color: var(--muted); font-size: 0.8rem; text-align: right; }
.lines li:first-child::before { content: "★"; color: var(--accent); }
.lines textarea { margin: 0; min-height: 0; resize: none; padding: 7px 10px; }
.line-tools { display: flex; gap: 4px; align-items: center; }
.line-tools button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0; font-size: 0.95rem; }
.line-tools button:hover { border-color: var(--accent); }
.line-tools button.rec { background: #fee4e2; border-color: var(--bad); }
.badge { min-width: 44px; font-size: 0.72rem; text-align: center; padding: 2px 6px; border-radius: 999px; background: var(--gray); color: var(--muted); }
.badge.ai { background: #eef2ff; color: var(--accent); }
.badge.mic { background: #e3f6ea; color: var(--ok); }
.line-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.studio { position: sticky; top: 80px; display: grid; gap: 10px; justify-items: center; }
.phone { width: 100%; max-width: 330px; aspect-ratio: 9 / 16; border-radius: 28px; overflow: hidden; background: #111; box-shadow: 0 20px 50px rgb(0 0 0 / 0.18); border: 6px solid #1d1d1f; }
.phone canvas { width: 100%; height: 100%; display: block; }
.length { margin: 0; color: var(--muted); font-size: 0.85rem; }
.studio-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.progress { width: 100%; max-width: 330px; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width 0.2s linear; }
#render-note { text-align: center; max-width: 330px; }

.queue { max-width: 860px; margin: 0 auto; padding: 24px; display: grid; gap: 16px; }
.how summary { list-style: none; cursor: pointer; }
.how summary::-webkit-details-marker { display: none; }
.how summary h2 { margin: 0; }
.how summary h2::after { content: "▾"; margin-left: auto; color: var(--muted); font-size: 0.9rem; }
.how[open] summary { margin-bottom: 12px; }
.how ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.queue-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.queue-head h2 { margin: 0; }
.slots { margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--muted); }
.slots input { width: 190px; margin: 0; padding: 6px 10px; }
.queue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.q { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; }
.q.posted { opacity: 0.55; }
.q-when { text-align: center; padding: 8px 4px; border-radius: 12px; background: #eef2ff; color: var(--accent); font-weight: 700; line-height: 1.3; }
.q-when small { display: block; color: var(--accent); font-weight: 500; }
.q.posted .q-when { background: #e3f6ea; color: var(--ok); }
.q h3 { margin: 0 0 2px; font-size: 1rem; }
.q p { margin: 0 0 8px; color: var(--muted); font-size: 0.86rem; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.q-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.q-actions button { padding: 5px 12px; font-size: 0.84rem; }
.q-actions .done { border-color: var(--ok); color: var(--ok); }
.q-actions .del { margin-left: auto; border-color: transparent; color: var(--muted); }
.empty { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 12px 0 8px; color: var(--muted); }
.empty img { width: 200px; height: auto; animation: bob 5s ease-in-out infinite; }
.empty strong { color: var(--text); font-size: 1.1rem; }
.empty p { margin: 0 0 10px; }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* Render finished */
.done { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 360px; padding: 12px 14px; border-radius: 18px; background: #fff; box-shadow: 0 6px 24px rgb(0 0 0 / 0.08); animation: pop 0.35s ease-out; }
.done img { width: 96px; height: auto; flex: none; }
.done strong { font-size: 1.05rem; }
.done p { margin: 2px 0 8px; color: var(--muted); font-size: 0.84rem; }
.done-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.done-actions button { padding: 6px 14px; font-size: 0.86rem; }
.done-actions button:not(.primary) { border: 1px solid var(--line); background: #fff; border-radius: 999px; font-weight: 500; }
@keyframes pop { from { transform: scale(0.92); opacity: 0; } }

/* End-card themes */
.themes-label { font-weight: 600; font-size: 0.92rem; margin-bottom: 8px; }
.themes { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.swatch { display: grid; justify-items: center; gap: 4px; border: 0; background: none; padding: 0; font-size: 0.78rem; color: var(--muted); }
.swatch i { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; font-style: normal; font-weight: 700; font-size: 0.8rem; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.08); }
.swatch b { display: block; width: 26px; height: 9px; margin-top: 3px; border-radius: 999px; }
.swatch[aria-checked="true"] { color: var(--text); font-weight: 600; }
.swatch[aria-checked="true"] i { outline: 3px solid var(--accent); outline-offset: 2px; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; max-width: 1180px; margin: 0 auto; padding: 8px 24px 28px; color: var(--muted); font-size: 0.8rem; }
.foot a { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10; padding: 10px 18px; border-radius: 999px; background: #1d1d1f; color: #fff; font-size: 0.9rem; box-shadow: 0 10px 30px rgb(0 0 0 / 0.2); }

@media (max-width: 860px) {
  .bar { padding: 10px 14px; gap: 10px; }
  .brand em { display: none; }
  .make { grid-template-columns: 1fr; padding: 14px; }
  .studio { position: static; order: 2; }
  .queue { padding: 14px; }
  .row { grid-template-columns: 1fr; gap: 0; }
  .card { padding: 18px; }
  .q { grid-template-columns: 1fr; }
  .q-when { text-align: left; padding: 6px 12px; }
  .q-when small { display: inline; margin-left: 6px; }
}
