/* Chapters & co. — สีจากโลโก้: ชมพูอ่อน #FDDCDE, ไวน์ #69010D, แดงดาว #CA0920 */
:root {
  --blush: #fddcde;
  --blush-2: #fbe9ea;
  --paper: #fffaf9;
  --card: #ffffff;
  --wine: #69010d;
  --wine-2: #8a1424;
  --red: #ca0920;
  --gold: #b48a3c;
  --ink: #2a1215;
  --muted: #7d6266;
  --line: #f0d6d9;
  --line-2: #e7c3c7;
  --ok: #2e7d4f;
  --warn: #b26a00;
  --bad: #b3261e;
  --r: 14px;
  --r-sm: 10px;
  --font: 'IBM Plex Sans Thai', 'Sarabun', system-ui, sans-serif;
  --serif: 'Trirong', 'Noto Serif Thai', Georgia, serif;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.55; font-size: 15px; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.25; margin: 0 0 .4em; font-weight: 600; color: var(--wine); }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; }
p { margin: 0 0 .8em; }
a { color: var(--wine); }
img { max-width: 100%; display: block; }
code { background: var(--blush-2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.container.section { padding: 32px 16px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- ปุ่ม ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--wine); background: var(--wine); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--wine-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost, .btn-outline { background: transparent; color: var(--wine); border-color: var(--line-2); }
.btn-ghost:hover, .btn-outline:hover { background: var(--blush-2); }
.btn-soft { background: var(--blush); color: var(--wine); border-color: var(--blush); }
.btn-soft:hover { background: #f9cfd3; }
.btn-line { background: #06c755; border-color: #06c755; }
.btn-line:hover { background: #05b04b; }
.btn-danger { background: var(--bad); border-color: var(--bad); }
.btn-ok { background: var(--ok); border-color: var(--ok); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .88rem; border-radius: 10px; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--wine); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
/* ปุ่มสีจากเวอร์ชันก่อน (ใช้ในหลังบ้าน) */
.btn-pink, .btn-sky, .btn-lime { background: var(--wine); border-color: var(--wine); color: #fff; }

/* ---------- การ์ด / ฟอร์ม ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: .9rem; }
input[type=text], input[type=tel], input[type=number], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px rgba(105, 1, 13, .12); }
input[type=file] { font-size: .9rem; max-width: 100%; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.err { font-size: .82rem; color: var(--bad); margin-top: 4px; }

.alert { padding: 12px 14px; border-radius: 12px; margin: 12px 0; border: 1px solid; font-size: .92rem; }
.alert-ok { background: #edf7f0; border-color: #c7e5d1; color: #1e5e39; }
.alert-err { background: #fdeceb; border-color: #f3c6c2; color: #8c1d16; }
.alert-info { background: var(--blush-2); border-color: var(--line-2); color: var(--wine); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.badge-gray { background: #f1ecec; color: #5e5153; }
.badge-blue { background: #e9eef7; color: #2b4a7a; }
.badge-amber { background: #fbf0dc; color: #7d5200; }
.badge-violet { background: #f1eaf6; color: #5d3a7a; }
.badge-green { background: #e6f3ea; color: #1e5e39; }
.badge-pink { background: var(--blush); color: var(--wine); }
.badge-red { background: #fdeceb; color: #8c1d16; }

/* ---------- เปลือกแอป (หน้าลูกค้า) ---------- */
body.app-body { background: var(--blush); }
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--paper); position: relative;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 20px); }
@media (min-width: 520px) { .app { box-shadow: 0 0 0 1px var(--line-2), 0 20px 60px rgba(105, 1, 13, .12); } }

.topbar { position: sticky; top: 0; z-index: 40; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px;
  background: rgba(255, 250, 249, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.topbar .brand img.mark { height: 30px; width: auto; }
.topbar .brand img.word { height: 24px; width: auto; }
.topbar .back { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -8px; border-radius: 10px; color: var(--wine); }
.topbar .title { font-family: var(--serif); font-weight: 600; color: var(--wine); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--wine); background: none; border: 0; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--blush-2); }
.icon-btn svg, .tabbar svg { width: 24px; height: 24px; }
.dot-count { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff;
  font-size: .7rem; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.dot-count:empty, .dot-count[data-n="0"] { display: none; }

.tabbar { position: fixed; z-index: 50; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--muted); text-decoration: none; padding: 6px 0; position: relative; }
.tabbar a.active { color: var(--wine); font-weight: 600; }
.tabbar a.create span.ring { width: 48px; height: 48px; margin-top: -22px; border-radius: 16px; background: var(--wine); color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(105, 1, 13, .3); }
.tabbar a.create { color: var(--wine); font-weight: 600; }
.tabbar .dot-count { top: 2px; right: calc(50% - 22px); }

.page { padding: 16px; }
.page-head { padding: 18px 16px 4px; }
.page-head h1 { margin: 0; }
.sec { padding: 22px 16px 4px; }
.sec-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.sec-head h2 { margin: 0; }
.sec-head a { margin-left: auto; font-size: .88rem; font-weight: 600; text-decoration: none; }

/* แถบเลื่อนแนวนอน */
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: 42%; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 2px 16px 10px; margin: 0 -16px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; }
.hscroll.wide { grid-auto-columns: 70%; }

/* ---------- หน้าแรก ---------- */
.hero { padding: 26px 16px 18px; background: var(--blush); border-bottom: 1px solid var(--line-2); }
.hero h1 { font-size: 1.85rem; line-height: 1.2; margin-bottom: 10px; }
.hero p { color: #5b3a3f; margin-bottom: 16px; }
.hero .row .btn { flex: 1; }
.hero-strip { margin-top: 18px; }
.hero-strip .mockup { background: rgba(255, 255, 255, .7); border-radius: 12px; }

.occasion { display: grid; grid-template-columns: 1fr 88px; gap: 12px; align-items: center; padding: 12px 12px 12px 14px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: inherit; margin-bottom: 10px; }
.occasion b { font-family: var(--serif); color: var(--wine); font-size: 1.05rem; display: block; }
.occasion span { font-size: .85rem; color: var(--muted); }
.occasion .mockup { background: var(--blush-2); border-radius: 10px; }

.pcard { display: block; text-decoration: none; color: inherit; }
.pcard .mockup { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.pcard b { display: block; font-size: .9rem; margin-top: 6px; line-height: 1.3; }
.pcard .price { color: var(--wine); font-weight: 600; font-size: .9rem; }

.spec { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.spec li { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.spec li:last-child { border-bottom: 0; }
.spec svg { width: 22px; height: 22px; color: var(--wine); margin-top: 2px; }
.spec b { display: block; }
.spec span { font-size: .85rem; color: var(--muted); }

.list { border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.list-row { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.list-row:last-child { border-bottom: 0; }
.list-row .meta { font-size: .82rem; color: var(--muted); }

.foot { padding: 28px 16px 8px; color: var(--muted); font-size: .85rem; }
.foot img { height: 54px; width: auto; margin-bottom: 10px; }
.foot a { color: var(--wine); }

/* ---------- ภาพจำลองสินค้า ---------- */
.mockup svg { width: 100%; height: auto; display: block; }
.mockup img { width: 100%; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; }
.swatch.active { box-shadow: 0 0 0 2px var(--wine); }
.preview-box { background: var(--blush-2); border-radius: 12px; padding: 6px; }

/* ---------- ตัวออกแบบ (เต็มจอ) ---------- */
body.editor-body { background: var(--blush); overflow: hidden; }
.ed { position: fixed; inset: 0; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; background: #f6eeee; }
.ed-top { flex: none; height: 54px; display: flex; align-items: center; gap: 4px; padding: 0 8px; background: #fff; border-bottom: 1px solid var(--line); }
.ed-top .title { flex: 1; min-width: 0; background: none; border: 0; text-align: left; font: inherit; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.ed-top .title b { display: block; font-family: var(--serif); color: var(--wine); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-top .title small { color: var(--muted); font-size: .75rem; }
.ed-top .btn { min-height: 38px; }
.ed-stage { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; padding: 12px; }
.stage { position: relative; background-color: #e9e1e1;
  background-image: linear-gradient(45deg, #f2ebeb 25%, transparent 25%), linear-gradient(-45deg, #f2ebeb 25%, transparent 25%),
  linear-gradient(45deg, transparent 75%, #f2ebeb 75%), linear-gradient(-45deg, transparent 75%, #f2ebeb 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; box-shadow: 0 4px 18px rgba(42, 18, 21, .12); }
.stage-mask { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.stage-mask::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 9999px rgba(42, 18, 21, .38); border: 1.5px dashed rgba(255, 255, 255, .9); }
.stage-mask.wrap::after { border-radius: 0; box-shadow: none; border: 0; left: var(--side, 30%); right: var(--side, 30%);
  border-left: 1.5px dashed rgba(202, 9, 32, .75); border-right: 1.5px dashed rgba(202, 9, 32, .75); }
.stage-note { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: .75rem; color: var(--muted); pointer-events: none; }
.float-acts { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.float-acts button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--wine); display: grid; place-items: center; cursor: pointer; }
.float-acts button:disabled { opacity: .35; }
.float-acts svg { width: 20px; height: 20px; }

.sheet { flex: none; background: #fff; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; max-height: 46vh; display: flex; flex-direction: column;
  box-shadow: 0 -6px 20px rgba(42, 18, 21, .06); }
.sheet[hidden] { display: none; }
.sheet-head { flex: none; display: flex; align-items: center; padding: 6px 8px 0 16px; }
.sheet-head b { font-family: var(--serif); color: var(--wine); }
.sheet-body { overflow-y: auto; padding: 8px 16px 16px; -webkit-overflow-scrolling: touch; }
.pane { display: none; }
.pane.active { display: block; }

.toolbar { flex: none; display: grid; grid-template-columns: repeat(6, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.toolbar button { background: none; border: 0; padding: 8px 0 7px; display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; font-size: .7rem; color: var(--muted); cursor: pointer; }
.toolbar button svg { width: 22px; height: 22px; }
.toolbar button.active { color: var(--wine); font-weight: 600; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; font: inherit; font-size: .85rem; cursor: pointer; color: var(--ink); }
.chip.active { background: var(--wine); border-color: var(--wine); color: #fff; }

.tpl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tpl { border: 1px solid var(--line); border-radius: 12px; padding: 0; cursor: pointer; overflow: hidden; background: #fff; text-align: left; font: inherit; }
.tpl .sw { height: 64px; display: grid; place-items: center; font-family: var(--serif); font-size: 1rem; padding: 0 8px; text-align: center; line-height: 1.2; }
.tpl .nm { display: block; padding: 6px 10px; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); }

.tool-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tool-grid button { aspect-ratio: 1; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 9px; cursor: pointer; display: grid; place-items: center; }
.tool-grid button:active { background: var(--blush-2); }
.tool-grid svg { width: 100%; height: 100%; }

.upload-drop { display: grid; place-items: center; gap: 4px; padding: 18px; border: 1.5px dashed var(--line-2); border-radius: 14px; background: var(--paper); text-align: center; cursor: pointer; }
.upload-drop svg { width: 28px; height: 28px; color: var(--wine); }
.upload-drop b { color: var(--wine); }
.upload-drop input { display: none; }

.font-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.font-row::-webkit-scrollbar { display: none; }
.font-row button { flex: none; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 1rem; cursor: pointer; }
.font-row button.active { border-color: var(--wine); box-shadow: inset 0 0 0 1px var(--wine); }

.prop-row { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 10px; margin: 10px 0; }
.prop-row > label { margin: 0; font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=color] { width: 100%; height: 40px; border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--wine); }
.palette { display: flex; flex-wrap: wrap; gap: 7px; }
.palette button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; }
.act-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.act-grid button { min-height: 52px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font: inherit; font-size: .74rem; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; }
.act-grid button svg { width: 18px; height: 18px; color: var(--wine); }
.act-grid button.on { background: var(--blush); border-color: var(--line-2); }
.act-grid button.danger { color: var(--bad); }
.act-grid button.danger svg { color: var(--bad); }

.qty { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; width: max-content; background: #fff; }
.qty button { background: none; border: 0; width: 42px; height: 42px; cursor: pointer; font-size: 1.2rem; color: var(--wine); }
.qty input { width: 52px; border: 0; text-align: center; padding: 0; border-radius: 0; min-height: 42px; }
.qty input:focus { box-shadow: none; }

.product-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.product-list a { text-decoration: none; color: inherit; font-size: .78rem; text-align: center; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: #fff; }
.product-list a.active { border-color: var(--wine); box-shadow: inset 0 0 0 1px var(--wine); }
.product-list .mockup { background: var(--blush-2); border-radius: 8px; margin-bottom: 4px; }

.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px;
  z-index: 100; display: flex; gap: 12px; align-items: center; font-size: .9rem; width: max-content; max-width: calc(100% - 32px); }
.toast a { color: var(--blush); font-weight: 600; }
.toast[hidden] { display: none !important; }

/* ---------- ตะกร้า / ชำระเงิน ---------- */
.cart-line { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line .mockup { background: var(--blush-2); border-radius: 10px; }
.summary-row { display: flex; justify-content: space-between; gap: 10px; margin: 6px 0; }
.summary-row.total { font-family: var(--serif); font-size: 1.2rem; color: var(--wine); border-top: 1px solid var(--line); padding-top: 10px; font-weight: 600; }
.choice { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; cursor: pointer; margin: 8px 0; font-weight: 400; background: #fff; }
.choice:has(input:checked) { border-color: var(--wine); box-shadow: inset 0 0 0 1px var(--wine); }
.choice:has(input:disabled) { opacity: .5; }
.choice input { margin-top: 4px; accent-color: var(--wine); width: 18px; height: 18px; }
.choice b { display: block; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.seg label { margin: 0; font-weight: 400; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: grid; place-items: center; min-height: 42px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-size: .85rem; text-align: center; padding: 0 4px; cursor: pointer; }
.seg input:checked + span { background: var(--wine); color: #fff; border-color: var(--wine); }
.sticky-cta { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b)); background: linear-gradient(transparent, var(--paper) 30%); padding: 18px 16px 12px; margin: 0 -16px; }

/* ---------- ติดตาม ---------- */
.search-box { display: flex; gap: 8px; }
.search-box input { flex: 1; }
.progress { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; margin: 16px 0 4px; }
.progress .pstep { text-align: center; font-size: .66rem; color: var(--muted); position: relative; line-height: 1.25; }
.progress .dot { width: 26px; height: 26px; margin: 0 auto 5px; border-radius: 50%; background: #f1e6e7; display: grid; place-items: center; font-size: .75rem; position: relative; z-index: 1; }
.progress .pstep::before { content: ''; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: #f1e6e7; }
.progress .pstep:first-child::before { display: none; }
.progress .done .dot { background: var(--wine); color: #fff; }
.progress .done::before, .progress .current::before { background: var(--wine); }
.progress .current .dot { background: #fff; color: var(--wine); box-shadow: inset 0 0 0 2px var(--wine); font-weight: 700; }
.progress .current { color: var(--wine); font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--line-2); }
.timeline li:first-child::before { border-color: var(--wine); background: var(--wine); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline time { display: block; font-size: .78rem; color: var(--muted); }
.qr-box { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.code-big { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; color: var(--wine); letter-spacing: .5px; }

/* ---------- ไอเดีย ---------- */
.idea .mockup { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.idea b { display: block; font-size: .85rem; margin-top: 6px; line-height: 1.3; }
.like-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--wine); font: inherit; font-weight: 600; cursor: pointer; }
.like-btn svg { width: 18px; height: 18px; }
.like-btn.liked { background: var(--wine); color: #fff; border-color: var(--wine); }

/* ---------- ตาราง (หลังบ้าน) ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); padding: 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; font-size: .85rem; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: #fffafa; }
.round-table { width: 100%; border-collapse: collapse; }

@media print {
  .no-print, .tabbar, .topbar { display: none !important; }
  body { background: #fff; }
}
.choice > span > span { display: block; }
.list-row > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.finish-top { display: grid; grid-template-columns: 46% 1fr; gap: 14px; align-items: center; }
.hscroll { scroll-padding-inline: 16px; }
body.editor-body .toast { bottom: auto; top: 64px; }
.btn svg { width: 18px; height: 18px; flex: none; }
