/* 2NK Video Studio — ชุดดีไซน์ (โทนสว่าง น้ำเงิน 2NK + ไล่สีสำหรับของ "สร้างสรรค์") */
:root {
  --bg: #f4f3ef; --bg2: #ecebe5; --card: #ffffff; --ink: #161b2b; --ink2: #475069; --muted: #8a90a2; --line: #e3e1da; --line2: #d4d1c8;
  --navy: #1f2a44; --navy2: #2e3d63; --soft: #eef1f7; --soft2: #e2e7f2;
  --accent: #ff6b5c; --violet: #7a5cff; --grad: linear-gradient(120deg, #7a5cff 0%, #ff6b8b 55%, #ffb057 100%);
  --ok: #23885a; --okbg: #e6f5ec; --warn: #b7790c; --warnbg: #fff6e2; --bad: #c0392b; --badbg: #fdecea;
  --r: 18px; --r2: 12px;
  --shadow: 0 1px 2px rgba(22, 27, 43, .05), 0 8px 28px rgba(22, 27, 43, .06);
  --shadow2: 0 2px 6px rgba(22, 27, 43, .08), 0 18px 48px rgba(22, 27, 43, .12);
  font-family: 'Anuphan', system-ui, sans-serif; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); min-height: 100vh; font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--navy2); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }
label:focus-within { outline: 3px solid rgba(122, 92, 255, .35); outline-offset: 2px; }
svg.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid rgba(122, 92, 255, .35); outline-offset: 2px; border-radius: 8px; }

/* ---------- แถบบน ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 22px; padding: 10px 28px; background: rgba(244, 243, 239, .86); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 10px; font-size: 17px; white-space: nowrap; }
.mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--navy); color: #fff; box-shadow: 0 4px 12px rgba(31, 42, 68, .25); position: relative; overflow: hidden; }
.mark::after { content: ''; position: absolute; inset: 0; background: var(--grad); opacity: .35; mix-blend-mode: screen; }
.mark svg { width: 15px; height: 15px; fill: #fff; stroke: none; position: relative; z-index: 1; }
.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a { display: flex; align-items: center; gap: 7px; text-decoration: none; padding: 8px 14px; border-radius: 999px; color: var(--ink2); font-weight: 500; font-size: 15px; transition: background .15s; }
.top nav a:hover { background: var(--bg2); }
.top nav a.on { background: var(--card); color: var(--navy); box-shadow: var(--shadow); font-weight: 600; }
.me { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink2); margin-left: auto; }
.quota-chip { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.quota-chip b { color: var(--navy); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--soft2); color: var(--navy); font-weight: 700; font-size: 14px; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--ink2); }
.icon-btn:hover { background: var(--bg2); color: var(--ink); }
.bottom-nav { display: none; }

main { max-width: 1180px; margin: 0 auto; padding: 32px 24px 96px; }
.loading { color: var(--muted); padding: 80px; text-align: center; }
.skel { background: linear-gradient(90deg, var(--bg2) 0%, #f7f6f2 50%, var(--bg2) 100%); background-size: 200% 100%; animation: skel 1.2s infinite; border-radius: var(--r); }
@keyframes skel { to { background-position: -200% 0; } }
h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.01em; margin-bottom: 6px; }
h2 { font-size: 19px; line-height: 1.3; margin-bottom: 4px; }
h3 { font-size: 16px; margin-bottom: 8px; }
.sub { color: var(--ink2); margin-bottom: 24px; }
.muted { color: var(--muted); font-size: 14px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { margin: 0; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--ink2); text-decoration: none; font-size: 14px; margin-bottom: 10px; }
.crumb:hover { color: var(--ink); }

/* ---------- พื้นฐาน ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 16px; }
label.f { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; }
.hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=text], input[type=email], input[type=number], input[type=url], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--r2); background: #fff; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 84px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--line2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(122, 92, 255, .12); }
.field-icon { position: relative; }
.field-icon svg.i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.field-icon input { padding-left: 40px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--r2); border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); transition: transform .08s, box-shadow .15s, border-color .15s, background .15s; white-space: nowrap; }
.btn:hover { border-color: var(--navy); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 6px 16px rgba(31, 42, 68, .22); }
.btn.primary:hover { background: var(--navy2); }
.btn.magic { background: var(--grad); color: #fff; border: 0; box-shadow: 0 10px 26px rgba(122, 92, 255, .32); }
.btn.magic:hover { filter: brightness(1.06); }
.btn.big { padding: 15px 26px; font-size: 17px; border-radius: 14px; width: 100%; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); background: var(--badbg); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink2); }
.btn.ghost:hover { background: var(--bg2); }
.btn.sm { padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.banner { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: var(--r2); margin-bottom: 16px; font-size: 15px; }
.banner svg.i { margin-top: 3px; }
.banner.warn { background: var(--warnbg); color: #7a5300; }
.banner.bad { background: var(--badbg); color: #8a2a20; }
.banner.ok { background: var(--okbg); color: #1f6040; }
.banner.info { background: var(--soft); color: var(--navy2); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--ink2); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.done { background: var(--okbg); color: var(--ok); }
.badge.running, .badge.queued { background: var(--soft2); color: var(--navy2); }
.badge.running::before { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .2; } }
.badge.review { background: var(--warnbg); color: var(--warn); }
.badge.error, .badge.paused-font { background: var(--badbg); color: var(--bad); }
.badge.cancelled { background: #efefef; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--bg2); color: var(--ink2); }

/* ---------- หน้าสร้างวิดีโอ ---------- */
.create { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; align-items: start; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; }
.step + .step { margin-top: 18px; }
.step-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.step-num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--navy); color: #fff; font-weight: 700; flex: none; }
.step.done .step-num { background: var(--ok); }
.step-head p { color: var(--muted); font-size: 14px; }
.seg { display: inline-flex; padding: 4px; background: var(--bg2); border-radius: 12px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--ink2); display: inline-flex; align-items: center; gap: 7px; font-size: 14px; }
.seg button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.drop { border: 2px dashed var(--line2); border-radius: var(--r); padding: 30px 20px; text-align: center; color: var(--ink2); cursor: pointer; background: #fbfaf7; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--violet); background: #f6f3ff; }
.drop .big-ic { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 14px; display: grid; place-items: center; background: var(--soft2); color: var(--navy); }
.drop .big-ic svg.i { width: 26px; height: 26px; }
.drop b { color: var(--navy); }
.file-pill { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r2); background: #fbfaf7; }
.file-pill .fi { width: 40px; height: 40px; border-radius: 10px; background: var(--soft2); color: var(--navy); display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 700; }
.file-pill .grow { flex: 1; min-width: 0; }
.file-pill b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.how { font-size: 13px; color: var(--ink2); background: var(--soft); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.versions { display: flex; flex-wrap: wrap; gap: 8px; }
.ver { display: inline-flex; align-items: center; gap: 8px; padding: 7px 8px 7px 14px; border-radius: 999px; background: var(--soft); color: var(--navy); font-weight: 600; font-size: 14px; border: 1.5px solid var(--soft2); }
.ver button { border: 0; background: rgba(31, 42, 68, .08); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: var(--navy); }
.ver button:hover { background: var(--badbg); color: var(--bad); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.preset { border: 1.5px dashed var(--line2); background: none; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; color: var(--ink2); }
.preset:hover { border-color: var(--violet); color: var(--violet); }
.add-ver { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.add-ver select { width: auto; flex: 1; min-width: 130px; }
.sub-row { display: flex; flex-wrap: wrap; gap: 16px 24px; margin-top: 18px; align-items: flex-end; }
#rseg, #gseg, #srcseg, #resseg { flex-wrap: nowrap; }
@media (max-width: 420px) { .seg { flex-wrap: wrap; } }

.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.choice { border: 1.5px solid var(--line); border-radius: 14px; padding: 0; cursor: pointer; background: #fff; text-align: left; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .1s; position: relative; }
.choice:hover { border-color: var(--line2); transform: translateY(-1px); }
.choice.on { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31, 42, 68, .12); }
.choice.on::after { content: ''; position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%; background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 13px no-repeat; }
.choice .ch-b { padding: 11px 13px 13px; }
.choice b { display: block; font-size: 15px; }
.choice span { font-size: 13px; color: var(--muted); line-height: 1.4; display: block; }
.thumb { height: 70px; position: relative; overflow: hidden; }
.mode-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mode-cards .thumb { height: 104px; }
.mode-cards .choice.creative.on { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(122, 92, 255, .18); }
.mode-cards .choice.creative.on::after { background-color: var(--violet); }
/* ภาพตัวอย่างเล็กๆ ของแต่ละแบบ (วาดด้วย CSS) */
.th-plain { background: #f7f5f0; }
.th-plain i { position: absolute; bottom: 14px; width: 14px; border-radius: 3px 3px 0 0; background: #b9c2d6; }
.th-plain i:nth-child(1) { left: 22%; height: 30px; } .th-plain i:nth-child(2) { left: 36%; height: 46px; background: var(--navy); } .th-plain i:nth-child(3) { left: 50%; height: 38px; }
.th-plain em { position: absolute; left: 14px; top: 12px; width: 40%; height: 8px; border-radius: 4px; background: #d7dbe6; }
.th-creative { background: radial-gradient(circle at 20% 30%, #ffe1ec 0, transparent 45%), radial-gradient(circle at 80% 70%, #e6defe 0, transparent 50%), #fbf8ff; }
.th-creative i { position: absolute; border-radius: 50%; }
.th-creative i:nth-child(1) { width: 26px; height: 26px; left: 12%; top: 18%; background: linear-gradient(135deg, #ff9db5, #ff6b8b); animation: float 4s ease-in-out infinite; }
.th-creative i:nth-child(2) { width: 34px; height: 34px; right: 14%; top: 28%; border: 6px solid #b9a6ff; animation: float 5s ease-in-out infinite reverse; }
.th-creative i:nth-child(3) { width: 14px; height: 30px; border-radius: 8px; left: 46%; bottom: 14px; background: linear-gradient(#ffb057, #ff8a5c); transform: rotate(25deg); }
.th-creative em { position: absolute; left: 30%; bottom: 14px; width: 14px; height: 52px; border-radius: 3px 3px 0 0; background: var(--grad); }
@keyframes float { 50% { transform: translateY(-7px) rotate(8deg); } }
.th-style { display: flex; align-items: flex-end; gap: 5px; padding: 12px 14px; }
.th-style i { flex: 1; border-radius: 4px 4px 0 0; }
.kit-logo { height: 30px; max-width: 120px; object-fit: contain; display: block; margin-bottom: 6px; }
.swatches { display: flex; gap: 4px; margin-top: 8px; }
.swatches i { width: 18px; height: 18px; border-radius: 6px; border: 1px solid rgba(0,0,0,.06); }

.suggest { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.suggest button { border: 1px solid var(--line); background: #fbfaf7; border-radius: 999px; padding: 5px 11px; font-size: 13px; cursor: pointer; color: var(--ink2); }
.suggest button:hover { border-color: var(--violet); color: var(--violet); }
.switch { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; cursor: pointer; border-top: 1px solid var(--line); }
.switch:first-of-type { border-top: 0; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line2); position: relative; flex: none; cursor: pointer; transition: background .2s; margin-top: 1px; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked { background: var(--navy); }
.switch input:checked::after { transform: translateX(16px); }
.switch b { display: block; font-weight: 600; font-size: 15px; }
.switch span { color: var(--muted); font-size: 13px; }
.range { display: flex; gap: 14px; align-items: center; }
.range input[type=range] { flex: 1; accent-color: var(--navy); }
details.adv { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
details.adv summary { cursor: pointer; font-weight: 600; color: var(--navy2); list-style: none; display: flex; align-items: center; gap: 8px; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary svg.i { transition: transform .2s; }
details.adv[open] summary svg.i { transform: rotate(90deg); }

.side { position: sticky; top: 84px; }
.side .card { padding: 20px; }
.sum { list-style: none; padding: 0; margin: 12px 0 16px; }
.sum li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sum li:last-child { border: 0; }
.sum li svg.i { color: var(--muted); margin-top: 2px; }
.sum li span { color: var(--muted); width: 74px; flex: none; }
.sum li b { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.sum li b.miss { color: var(--warn); font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.stats div { background: var(--bg); border-radius: 10px; padding: 9px 8px; text-align: center; }
.stats b { display: block; font-size: 18px; color: var(--navy); line-height: 1.2; }
.stats span { font-size: 12px; color: var(--muted); }
.side .note { font-size: 13px; color: var(--muted); text-align: center; margin-top: 10px; }

.file-btn { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1.5px dashed var(--line2); border-radius: var(--r2); cursor: pointer; background: #fbfaf7; min-width: 0; }
.file-btn:hover { border-color: var(--violet); }
.file-btn .fb-l { font-weight: 600; color: var(--navy); white-space: nowrap; }
.file-btn .fb-n { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-btn.has { border-style: solid; border-color: var(--ok); background: var(--okbg); }
.file-btn.has .fb-n { color: var(--ok); font-weight: 600; }

/* ---------- หน้ากำลังทำ ---------- */
.progress-wrap { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 26px; align-items: center; }
.ring { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 14; }
.ring .bg { stroke: var(--soft2); }
.ring .fg { stroke: url(#rg); stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .val b { font-size: 50px; font-weight: 700; color: var(--navy); line-height: 1; }
.ring .val span { font-size: 13px; color: var(--muted); }
.timeline-steps { list-style: none; padding: 0; }
.timeline-steps li { display: flex; gap: 14px; align-items: center; padding: 9px 0; color: var(--muted); position: relative; }
.timeline-steps li .dotc { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); flex: none; z-index: 1; }
.timeline-steps li:not(:last-child)::before { content: ''; position: absolute; left: 14px; top: 38px; bottom: -8px; width: 2px; background: var(--line); }
.timeline-steps li.done { color: var(--ink2); }
.timeline-steps li.done .dotc { background: var(--okbg); color: var(--ok); }
.timeline-steps li.on { color: var(--ink); font-weight: 600; }
.timeline-steps li.on .dotc { background: var(--navy); color: #fff; box-shadow: 0 0 0 6px rgba(31, 42, 68, .1); }
.timeline-steps li.on .dotc svg.i { animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.msg-now { font-size: 18px; font-weight: 600; margin-bottom: 4px; }

/* ---------- หน้าตรวจบท ---------- */
.review-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.scene-nav { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; padding: 10px; }
.scene-nav a { display: flex; gap: 10px; align-items: center; padding: 7px; border-radius: 10px; text-decoration: none; color: var(--ink2); font-size: 13px; }
.scene-nav a:hover, .scene-nav a.on { background: var(--soft); color: var(--ink); }
.scene-nav img, .scene-nav .ph { width: 64px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--bg2); flex: none; }
.scene-nav .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene-nav .fl { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; }
.flags { list-style: none; padding: 0; display: grid; gap: 8px; }
.flags li { display: flex; gap: 10px; padding: 10px 12px; background: var(--warnbg); border-radius: 10px; font-size: 14px; cursor: pointer; color: #6e4b00; }
.flags li:hover { outline: 2px solid #f1d9a6; }
.flags li b { white-space: nowrap; }
.scene { padding: 20px; scroll-margin-top: 90px; }
.scene + .scene { margin-top: 16px; }
.scene-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; }
.scene img.shot, .scene .noimg { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.scene .noimg { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.scene-meta { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.line { margin-bottom: 12px; }
.line .lang { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; margin-bottom: 4px; display: flex; justify-content: space-between; }
.line textarea { min-height: 58px; }
.line textarea.flag { border-color: #e9c46a; background: #fffbf0; }
.line details summary { cursor: pointer; font-size: 13px; color: var(--navy2); margin: 4px 0; }
.sticky-bar { position: sticky; bottom: 14px; margin-top: 20px; padding: 14px 18px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow2); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; z-index: 10; }

/* ---------- หน้าวิดีโอเสร็จ ---------- */
.player video { width: 100%; max-height: 72vh; border-radius: var(--r); background: #000; aspect-ratio: 16 / 9; display: block; box-shadow: var(--shadow2); }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.dl { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); background: #fff; transition: border-color .15s, transform .1s; }
.dl:hover { border-color: var(--navy); transform: translateY(-1px); }
.dl .fi { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--navy); flex: none; }
.dl.main .fi { background: var(--navy); color: #fff; }
.dl b { display: block; font-size: 15px; }
.dl span { font-size: 13px; color: var(--muted); }
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.act-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.act-head .fi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.share-list .row { padding: 10px 0; border-top: 1px solid var(--line); }
.file { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; }
.files { display: flex; flex-direction: column; gap: 8px; }

/* ---------- คลังวิดีโอ ---------- */
.lib-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.lib-tools .field-icon { flex: 1; min-width: 200px; max-width: 360px; }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.vid { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .12s, box-shadow .15s; display: flex; flex-direction: column; }
.vid:hover { transform: translateY(-2px); box-shadow: var(--shadow2); }
.vid .th { aspect-ratio: 16 / 9; background: var(--bg2) center / cover no-repeat; position: relative; display: grid; place-items: center; color: var(--muted); }
.vid .th .badge { position: absolute; top: 10px; left: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.1); }
.vid .th .play { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; color: var(--navy); opacity: 0; transition: opacity .15s; }
.vid:hover .th .play { opacity: 1; }
.vid .b { padding: 13px 15px 15px; }
.vid .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vid .m { font-size: 13px; color: var(--muted); margin-top: 3px; }
.mini-bar { height: 5px; border-radius: 99px; background: var(--soft2); overflow: hidden; margin-top: 10px; }
.mini-bar i { display: block; height: 100%; background: var(--navy); border-radius: 99px; }
.empty { text-align: center; padding: 60px 20px; }
.empty .big-ic { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 20px; display: grid; place-items: center; background: var(--soft2); color: var(--navy); }
.empty .big-ic svg.i { width: 34px; height: 34px; }

/* ---------- เข้าสู่ระบบ ---------- */
.login-wrap { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; max-width: 1040px; margin: 0 auto; background: #fff; border-radius: 26px; overflow: hidden; box-shadow: var(--shadow2); }
.login-art { background: var(--navy); color: #fff; padding: 48px; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; }
.login-art::before { content: ''; position: absolute; width: 420px; height: 420px; right: -120px; top: -120px; border-radius: 50%; background: var(--grad); opacity: .55; filter: blur(30px); }
.login-art::after { content: ''; position: absolute; width: 220px; height: 220px; left: -60px; bottom: -60px; border-radius: 50%; border: 36px solid rgba(255,255,255,.08); }
.login-art > * { position: relative; z-index: 1; }
.login-art h1 { font-size: 38px; color: #fff; margin: 18px 0 12px; }
.login-art p { color: rgba(255,255,255,.78); }
.feat { list-style: none; padding: 0; display: grid; gap: 12px; margin-top: 30px; }
.feat li { display: flex; gap: 12px; align-items: center; color: rgba(255,255,255,.9); }
.feat li i { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.12); display: grid; place-items: center; flex: none; }
.login-form { padding: 48px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { font-size: 24px; margin-bottom: 6px; }

/* ---------- แอดมิน ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; padding: 5px; background: var(--bg2); border-radius: 14px; width: fit-content; max-width: 100%; }
.tabs button { border: 0; background: none; border-radius: 10px; padding: 8px 15px; cursor: pointer; font-weight: 600; color: var(--ink2); }
.tabs button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; color: var(--muted); font-weight: 600; font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }
.big-num { font-size: 32px; font-weight: 700; color: var(--navy); line-height: 1.15; margin: 4px 0; }
.gauge { height: 10px; border-radius: 999px; background: var(--soft2); overflow: hidden; }
.gauge i { display: block; height: 100%; background: var(--navy); border-radius: 999px; transition: width .6s ease; }
.check { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.on { background: var(--ok); } .dot.off { background: var(--bad); }
.color-in { width: 44px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
code { background: var(--bg2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }

/* ---------- วิธีใช้ ---------- */
.help-step { display: flex; gap: 16px; }
.help-step .step-num { width: 40px; height: 40px; border-radius: 12px; font-size: 18px; }
.help-step p + p { margin-top: 8px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: calc(100vw - 32px); display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow2); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--bad); }

/* ---------- จอเล็ก ---------- */
@media (max-width: 1020px) {
  .create { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 25; }
  .side .card { border-radius: 18px 18px 0 0; padding: 12px 16px; box-shadow: 0 -8px 24px rgba(0,0,0,.08); }
  .side h2, .side .sum, .side .stats, .side .note { display: none; }
  .side .mob-sum { display: block !important; font-size: 13px; color: var(--muted); margin-bottom: 8px; text-align: center; }
  .create-main { padding-bottom: 130px; }
  .actions { grid-template-columns: 1fr; }
  .review-layout { grid-template-columns: 1fr; }
  .scene-nav { display: none; }
  .progress-wrap { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; border-radius: 20px; }
  .login-art { padding: 32px; }
  .login-art .feat { display: none; }
  .login-form { padding: 32px; }
}
@media (max-width: 760px) {
  .top { padding: 10px 16px; gap: 10px; }
  .top nav { display: none; }
  .quota-chip { display: none; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11px; color: var(--muted); text-decoration: none; border-radius: 10px; }
  .bottom-nav a.on { color: var(--navy); font-weight: 600; }
  .bottom-nav a svg.i { width: 22px; height: 22px; }
  main { padding: 22px 16px 150px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .scene-grid { grid-template-columns: 1fr; }
  .mode-cards { grid-template-columns: 1fr; }
  #styles, #kits { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .choice span { font-size: 12px; }
  .brand { font-size: 15px; }
  h1 { font-size: 25px; }
  .step { padding: 18px; }
  .sticky-bar { bottom: calc(74px + env(safe-area-inset-bottom)); }
  .side { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .page-head { align-items: flex-start; }
}
.mob-sum { display: none; }
