/* AutoReel: the mockup's look (IBM Plex Sans Thai, ink #15161A on #F4F5F7, white cards, orange #FF5B22 accent) */
@font-face { font-family: 'IBM Plex Sans Thai'; src: url(/static/fonts/IBMPlexSansThai-Regular.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Thai'; src: url(/static/fonts/IBMPlexSansThai-SemiBold.ttf) format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Thai'; src: url(/static/fonts/IBMPlexSansThai-Bold.ttf) format('truetype'); font-weight: 700; font-display: swap; }
:root {
  --ink: #15161A; --ink2: #4B4F5A; --ink3: #5B5F6B; --bg: #F4F5F7; --card: #FFFFFF; --line: #E3E5EA; --line2: #C9CCD3;
  --accent: #FF5B22; --warm: #FFF0E9; --warm2: #FFE4D6; --warmink: #9A3412; --link: #C2410C;
  --ok: #15803D; --okbg: #ECFDF3; --bad: #B42318; --badbg: #FEF3F2; --r: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 'IBM Plex Sans Thai', system-ui, sans-serif; }
a { color: var(--ink); } a:hover { color: var(--link); }
h1 { font-size: 26px; line-height: 1.3; margin: 0 0 6px; font-weight: 700; }
h2 { font-size: 19px; line-height: 1.35; margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 16px; margin: 0 0 8px; font-weight: 600; }
p { margin: 0 0 10px; }
.muted { color: var(--ink2); } .small { font-size: 14px; } .tiny { font-size: 13px; color: var(--ink3); }

header.top { background: var(--card); border-bottom: 1px solid var(--line); }
header.top .in { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
nav.main { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
nav.main a { text-decoration: none; padding: 7px 12px; border-radius: 999px; color: var(--ink2); font-size: 15px; font-weight: 500; }
nav.main a.on { background: var(--ink); color: #fff; font-weight: 600; }
.who { display: flex; align-items: center; gap: 10px; }
.pill { font-size: 13px; color: var(--ink2); padding: 5px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.pill b { color: var(--ink); }
.avatar { width: 34px; height: 34px; border-radius: 999px; background: var(--warm2); color: var(--warmink); display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 14px; text-decoration: none; }

main { max-width: 1080px; margin: 0 auto; padding: 28px 16px 56px; }
main.narrow { max-width: 520px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.row > .grow { flex: 1 1 340px; min-width: 0; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }

.btn { font: inherit; font-size: 15px; font-weight: 700; min-height: 46px; padding: 0 20px; border-radius: 12px; border: none;
  background: var(--ink); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; }
.btn:hover { color: #fff; background: #2A2C33; }
.btn.light { background: var(--card); color: var(--ink); border: 1px solid var(--line2); font-weight: 600; }
.btn.light:hover { background: var(--bg); color: var(--ink); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.block { width: 100%; }
button.link { font: inherit; background: none; border: none; color: var(--ink2); text-decoration: underline; cursor: pointer; padding: 0; }

.f { display: block; font-weight: 600; font-size: 15px; margin: 0 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  font: inherit; width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 12px; background: #fff; color: var(--ink); }
textarea { min-height: 90px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid var(--warm2); outline-offset: 1px; border-color: var(--ink); }
.field { margin-bottom: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--ink); }
.alert { border-radius: 12px; padding: 12px 14px; font-size: 15px; margin-bottom: 16px; }
.alert.bad { background: var(--badbg); color: var(--bad); border: 1px solid #FECDCA; }
.alert.ok { background: var(--okbg); color: var(--ok); border: 1px solid #ABEFC6; }
.alert.warm { background: var(--warm); color: var(--warmink); border: 1px solid var(--warm2); }

.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.choice { position: relative; display: block; border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: #fff; }
.choice input { position: absolute; opacity: 0; }
.choice b { display: block; font-size: 15px; }
.choice span { font-size: 13px; color: var(--ink3); }
.choice:has(input:checked) { border: 2px solid var(--ink); padding: 11px 13px; background: var(--bg); }
.choice:has(input:focus-visible) { outline: 3px solid var(--warm2); }

.chip { display: inline-block; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--ink2); white-space: nowrap; }
.chip.done { background: var(--okbg); color: var(--ok); border-color: #ABEFC6; }
.chip.running, .chip.queued { background: var(--warm); color: var(--warmink); border-color: var(--warm2); }
.chip.failed { background: var(--badbg); color: var(--bad); border-color: #FECDCA; }

.reels { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.reel { text-decoration: none; display: flex; flex-direction: column; gap: 8px; }
.reel .thumb { aspect-ratio: 9 / 16; border-radius: 12px; background: #DADDE3 center / cover no-repeat; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--ink3); font-size: 13px; overflow: hidden; }
.reel .t { font-weight: 600; font-size: 15px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.drop { border: 2px dashed var(--line2); border-radius: 14px; padding: 18px; background: #fff; text-align: center; }
.drop.has { border-style: solid; text-align: left; }
.drop .pick { margin-top: 10px; }
.file { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--line); text-align: left; }
.file:first-child { border-top: none; }
.file .n { flex: 1 1 160px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 15px; }
.bar { flex: 1 1 100%; height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.file.ok .bar i { background: var(--ok); }
.file .st { font-size: 13px; color: var(--ink3); }
.file.err .st { color: var(--bad); }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 7px 0; color: var(--ink3); font-size: 15px; }
.steps li .d { width: 22px; height: 22px; border-radius: 999px; border: 2px solid var(--line2); flex: none; display: inline-flex; align-items: center; justify-content: center; }
.steps li.done { color: var(--ink); } .steps li.done .d { background: var(--ink); border-color: var(--ink); }
.steps li.done .d::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.steps li.now { color: var(--ink); font-weight: 700; } .steps li.now .d { border-color: var(--accent); border-top-color: transparent; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .steps li.now .d { animation: none; border-top-color: var(--accent); } }

.phone { width: 100%; max-width: 320px; aspect-ratio: 9 / 16; border-radius: 22px; border: 6px solid var(--ink); background: #000; overflow: hidden; }
.phone video { width: 100%; height: 100%; display: block; background: #000; }
.stars { display: flex; gap: 6px; flex-wrap: wrap; }
.stars label { cursor: pointer; }
.stars input { position: absolute; opacity: 0; }
.stars span { display: inline-flex; min-width: 44px; height: 40px; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--line2); font-weight: 700; }
.stars input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.stars input:focus-visible + span { outline: 3px solid var(--warm2); }

.tips ol { margin: 8px 0 0; padding-left: 22px; } .tips li { margin-bottom: 6px; }
.sample { border-radius: 12px; background: #3A3D46; padding: 18px 16px; color: #fff; min-height: 120px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.sample .m { font-size: 22px; line-height: 1.35; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.sample .k { font-size: 40px; line-height: 1.25; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.sample .num { font-size: 56px; line-height: 1; }
.swatch { display: flex; gap: 10px; align-items: center; }
.swatch input[type=color] { width: 54px; height: 46px; border: 1px solid var(--line2); border-radius: 12px; padding: 4px; background: #fff; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink3); font-weight: 600; white-space: nowrap; }
.scroll { overflow-x: auto; }
footer.foot { max-width: 1080px; margin: 0 auto; padding: 0 16px 40px; font-size: 13px; color: var(--ink3); display: flex; gap: 16px; flex-wrap: wrap; }
footer.foot a { color: var(--ink3); }
.legal h2 { margin-top: 24px; } .legal li { margin-bottom: 6px; }
@media (max-width: 640px) { h1 { font-size: 22px; } .card { padding: 16px; } nav.main { order: 3; flex-basis: 100%; } }

/* sales page and free-trial prompts */
.hero { align-items: center; gap: 28px; margin-bottom: 8px; }
.hero-side { display: flex; justify-content: center; }
h1.big { font-size: 34px; line-height: 1.25; margin: 4px 0 6px; }
.lead { font-size: 17px; }
.section { margin-top: 40px; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.features .card { padding: 16px 18px; }
.price-card { align-items: center; gap: 24px; border: 2px solid var(--ink); }
.price-box { flex: 0 1 260px; display: flex; flex-direction: column; gap: 10px; }
.price { font-size: 40px; font-weight: 700; line-height: 1.1; }
.price span { font-size: 18px; font-weight: 600; color: var(--ink2); }
.checks { list-style: none; padding: 0; margin: 6px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.checks li { padding-left: 26px; position: relative; font-size: 15px; }
.checks li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 10px; height: 6px; border: 2px solid var(--ok); border-top: 0; border-right: 0; transform: rotate(-45deg); }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; color: var(--ink2); font-size: 15px; }
.upsell { border: 2px solid var(--ink); background: var(--warm); }
.upsell h2 { margin-bottom: 6px; }
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; z-index: 50; background: var(--card);
  border: 1px solid var(--line2); border-radius: 14px; padding: 14px 16px; box-shadow: 0 8px 24px rgba(21, 22, 26, .12); font-size: 14px; }
.consent .row { gap: 8px; margin-top: 8px; }
@media (max-width: 640px) { h1.big { font-size: 26px; } .price { font-size: 34px; } }

/* the install helper on /pack */
.chatlog { display: flex; flex-direction: column; gap: 10px; max-height: 480px; overflow-y: auto; margin-bottom: 14px; }
.chatlog:empty { display: none; }
.msg { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 14px; border-radius: 14px; font-size: 15px; max-width: 88%; }
.msg.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.wait { color: var(--ink3); }
