/* หน้ารับบรีฟ 3 เฟส /business/brief (ใช้ร่วมกับ market.css) */
.bf {
    --bf-teal: #0f3d3e;
    --bf-teal-2: #1a5c5d;
    --bf-amber: #f2a93b;
    --bf-tint: #eaf3f1;
    --bf-ok: #1f7a4d;
    --bf-warn: #b4570a;
    padding-bottom: 96px;
}
.bf [hidden] { display: none !important; }
.bf .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.bf button { font-family: inherit; }

/* ───── หัวหน้า ───── */
.bf-hero {
    padding: 40px 0 76px;
    color: #fff;
    background:
        radial-gradient(700px 320px at 88% 0%, rgba(242, 169, 59, 0.3), transparent 60%),
        linear-gradient(140deg, var(--night) 0%, #123b3c 100%);
}
.bf-hero h1 { margin: 10px 0 8px; font-size: clamp(1.6rem, 4.2vw, 2.5rem); }
.bf-hero h1 em { font-style: normal; color: var(--bf-amber); }
.bf-hero p { max-width: 640px; color: rgba(255, 255, 255, 0.82); }
.bf-mode {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 16px; padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 999px;
    background: rgba(255, 255, 255, 0.08); font-size: 0.88rem;
}
.bf-mode b { color: var(--bf-amber); font-family: var(--font-head); }

/* ───── ตัวชี้ความคืบหน้า ───── */
.bf-wrap { margin-top: -44px; position: relative; }
.bf-steps {
    display: grid; grid-template-columns: repeat(4, 1fr);
    margin: 0 0 18px; padding: 18px 12px 14px; list-style: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.bf-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 0.82rem; color: var(--muted); }
.bf-step::before {
    content: ''; position: absolute; top: 17px; right: 50%; width: 100%; height: 4px;
    background: var(--line); border-radius: 4px; z-index: 0;
}
.bf-step:first-child::before { display: none; }
.bf-step.is-done::before, .bf-step.is-current::before { background: var(--bf-teal); }
.bf-dot {
    position: relative; z-index: 1; display: grid; place-items: center;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--surface); border: 3px solid var(--line);
    font: 600 0.95rem var(--font-head); color: var(--muted);
    transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.bf-step.is-done .bf-dot { background: var(--bf-teal); border-color: var(--bf-teal); color: #fff; }
.bf-step.is-current .bf-dot { border-color: var(--bf-teal); color: var(--bf-teal); box-shadow: 0 0 0 6px rgba(15, 61, 62, 0.12); }
.bf-step b { display: block; font: 600 0.92rem var(--font-head); color: var(--ink); }
.bf-step small { display: block; line-height: 1.3; }
.bf-step:not(.is-done):not(.is-current) b { color: var(--muted); }
.bf-step button { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bf-step button:focus-visible { outline: 3px solid var(--bf-amber); outline-offset: 4px; border-radius: 10px; }

/* ───── โครง 2 คอลัมน์ ───── */
.bf-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.bf-main { min-width: 0; }
.bf-side { position: sticky; top: 16px; }

/* ───── แบนเนอร์แม่แบบ / ร้านเดิม / ต่อจากเดิม ───── */
.bf-banner {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
    margin-bottom: 16px; padding: 14px 18px;
    border-radius: var(--radius-sm); background: var(--bf-tint); border: 1px solid #cfe2dd;
}
.bf-banner strong { font-family: var(--font-head); color: var(--bf-teal); }
.bf-banner p { flex: 1 1 260px; margin: 0; font-size: 0.92rem; color: #2f4f4d; }
.bf-banner .bf-link { margin-left: auto; }
.bf-tplplay {
    display: grid; place-items: center; width: 40px; height: 40px; flex: none;
    border: 0; border-radius: 50%; background: var(--bf-teal); color: #fff; cursor: pointer; font-size: 0.9rem;
}
.bf-tplplay:hover { background: var(--bf-teal-2); }
.bf-link { background: none; border: 0; padding: 0; color: var(--bf-teal); text-decoration: underline; cursor: pointer; font-size: 0.88rem; }

/* ───── การ์ดเปิดเฟส ───── */
.bf-intro {
    display: flex; gap: 16px; align-items: center;
    margin-bottom: 14px; padding: 18px 20px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.bf-intro .num {
    display: grid; place-items: center; flex: none; width: 54px; height: 54px;
    border-radius: 16px; background: var(--bf-teal); color: var(--bf-amber);
    font: 700 1.5rem var(--font-head);
}
.bf-intro h2 { font-size: 1.3rem; }
.bf-intro p { margin-top: 2px; color: var(--muted); font-size: 0.93rem; }
.bf-intro .meta { margin-left: auto; text-align: right; font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.bf-intro .meta b { display: block; font: 600 1rem var(--font-head); color: var(--bf-teal); }
.bf-bar { height: 8px; margin: 0 0 16px; border-radius: 8px; background: var(--line); overflow: hidden; }
.bf-bar i { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--bf-teal), var(--bf-amber)); transition: width 0.35s ease; }

/* ───── การ์ดคำถาม ───── */
.bf-q {
    margin-bottom: 14px; padding: 20px 20px 22px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.bf-q.is-done { border-color: #bcd8cf; }
.bf-q.is-error { border-color: #d9482b; box-shadow: 0 0 0 3px rgba(217, 72, 43, 0.12); }
.bf-q-head { display: flex; gap: 12px; align-items: flex-start; }
.bf-q-n {
    display: grid; place-items: center; flex: none; width: 28px; height: 28px; margin-top: 2px;
    border-radius: 50%; background: var(--bf-tint); color: var(--bf-teal);
    font: 600 0.82rem var(--font-head);
}
.bf-q.is-done .bf-q-n { background: var(--bf-teal); color: #fff; }
.bf-q h3 { font-size: 1.08rem; line-height: 1.35; }
.bf-q h3 small { margin-left: 6px; font: 400 0.8rem var(--font-body); color: var(--muted); }
.bf-q h3 .req { color: #d9482b; }
.bf-q-hint { margin-top: 2px; font-size: 0.88rem; color: var(--muted); }
.bf-q-body { margin-top: 14px; }
.bf-err { margin-top: 10px; font-size: 0.88rem; color: #b32a12; font-weight: 500; }

.bf-rec {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    margin-top: 12px; padding: 10px 14px; border-radius: 12px;
    background: #fff7e6; border: 1px dashed #efc875; font-size: 0.87rem; color: #6a4a09;
}
.bf-rec .bf-link { color: #8a5a00; font-weight: 600; }

/* ตัวเลือก (ชิป) */
.bf-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bf-opts.wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.bf-opts.tight { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.bf-opt {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    padding: 12px 14px; text-align: left; cursor: pointer;
    background: var(--surface); color: var(--ink);
    border: 1.5px solid var(--line); border-radius: 14px;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.bf-opt:hover { border-color: var(--bf-teal-2); transform: translateY(-1px); }
.bf-opt:focus-visible { outline: 3px solid var(--bf-amber); outline-offset: 2px; }
.bf-opt .e { font-size: 1.5rem; line-height: 1.2; }
.bf-opt .t { font: 600 0.95rem/1.3 var(--font-head); }
.bf-opt .d { font-size: 0.8rem; line-height: 1.4; color: var(--muted); }
.bf-opt .tag {
    position: absolute; top: 8px; right: 8px; padding: 1px 8px; border-radius: 999px;
    background: #fff1d1; color: #7a5200; font-size: 0.68rem; font-weight: 600;
}
.bf-opt[aria-pressed="true"] { border-color: var(--bf-teal); background: var(--bf-tint); box-shadow: inset 0 0 0 1px var(--bf-teal); }
.bf-opt[aria-pressed="true"]::after {
    content: '✓'; position: absolute; right: 8px; bottom: 8px;
    display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
    background: var(--bf-teal); color: #fff; font-size: 0.72rem; font-weight: 700;
}
.bf-opt[aria-pressed="true"] .tag { display: none; }
.bf-opt.sm { flex-direction: row; align-items: center; gap: 8px; padding: 9px 12px; }
.bf-opt.sm .t { font-weight: 500; font-size: 0.9rem; }
.bf-opt[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.bf-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bf-suggest .lbl { width: 100%; font-size: 0.8rem; color: var(--muted); }
.bf-pill {
    padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--surface); cursor: pointer; font-size: 0.84rem; color: var(--ink);
}
.bf-pill:hover { border-color: var(--bf-teal); background: var(--bf-tint); }
.bf-pill[aria-pressed="true"] { background: var(--bf-teal); border-color: var(--bf-teal); color: #fff; }

/* ช่องกรอก */
.bf-field { display: block; margin-top: 10px; font-size: 0.9rem; color: var(--muted); }
.bf-field:first-child { margin-top: 0; }
.bf input[type="text"], .bf input[type="date"], .bf select, .bf textarea {
    width: 100%; margin-top: 6px; padding: 12px 14px;
    border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
    font: inherit; color: var(--ink);
}
.bf input:focus, .bf select:focus, .bf textarea:focus { outline: none; border-color: var(--bf-teal); box-shadow: 0 0 0 3px rgba(15, 61, 62, 0.14); }
.bf textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.bf-count { margin-top: 4px; font-size: 0.78rem; color: var(--muted); text-align: right; }
.bf-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bf-note { margin-top: 8px; font-size: 0.84rem; color: var(--muted); }
.bf-note.warn { color: var(--bf-warn); }
.bf-comps { display: flex; flex-wrap: wrap; gap: 8px; }
.bf-comps .bf-pill { cursor: default; background: var(--bf-tint); border-color: #cfe2dd; }
.bf-comps .bf-pill:hover { background: var(--bf-tint); border-color: #cfe2dd; }

/* ───── แถบปุ่มล่าง (ติดล่างจอ) ───── */
.bf-bottom {
    position: sticky; bottom: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    margin: 18px -4px 0; padding: 12px 16px;
    background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px);
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 -6px 24px -10px rgba(23, 19, 31, 0.25);
}
.bf-bottom .grow { flex: 1; font-size: 0.88rem; color: var(--muted); }
.bf-bottom .grow b { color: var(--bf-teal); font-family: var(--font-head); }
.bf .btn-teal { background: var(--bf-teal); color: #fff; }
.bf .btn-teal:hover { background: var(--bf-teal-2); }
.bf .btn[disabled] { opacity: 0.6; cursor: wait; }

/* ───── จอพัก: สรุปผลของเฟส ───── */
.bf-break { animation: bf-in 0.4s ease both; }
@keyframes bf-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.bf-celebrate {
    display: flex; gap: 18px; align-items: center;
    padding: 24px; margin-bottom: 14px; color: #fff;
    border-radius: var(--radius);
    background: radial-gradient(500px 200px at 90% 0%, rgba(242, 169, 59, 0.3), transparent 60%), linear-gradient(140deg, var(--bf-teal), #17575a);
}
.bf-check {
    display: grid; place-items: center; flex: none; width: 58px; height: 58px;
    border-radius: 50%; background: var(--bf-amber); color: var(--bf-teal);
    font-size: 1.9rem; font-weight: 700; animation: bf-pop 0.5s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes bf-pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.bf-celebrate h2 { font-size: 1.4rem; }
.bf-celebrate p { margin-top: 2px; color: rgba(255, 255, 255, 0.82); font-size: 0.95rem; }

.bf-card { margin-bottom: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.bf-card > h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 1.02rem; }
.bf-card > h3 small { font: 400 0.8rem var(--font-body); color: var(--muted); }
.bf-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.bf-tile { padding: 12px 14px; border-radius: 14px; background: var(--bf-tint); }
.bf-tile small { display: block; font-size: 0.75rem; color: var(--muted); }
.bf-tile b { display: block; margin-top: 2px; font: 600 0.95rem/1.35 var(--font-head); color: var(--bf-teal); }
.bf-tile.off { background: #f6f2ea; }
.bf-tile.off b { color: var(--muted); font-weight: 400; }
.bf-dir { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 18px; margin: 0; }
.bf-dir div { padding-left: 12px; border-left: 3px solid var(--bf-amber); }
.bf-dir dt { font-size: 0.76rem; color: var(--muted); }
.bf-dir dd { margin: 0; font-weight: 500; }
.bf-why { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #fff7e6; font-size: 0.88rem; color: #6a4a09; }

.bf-shopcard { padding: 20px 22px; border-radius: var(--radius); color: #fff; background: linear-gradient(140deg, var(--night), #123b3c); }
.bf-shopcard .name { font: 700 clamp(1.5rem, 4vw, 2rem) var(--font-head); }
.bf-shopcard .pron, .bf-shopcard .area { color: rgba(255, 255, 255, 0.78); font-size: 0.92rem; }
.bf-shopcard .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bf-shopcard .tags span { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-size: 0.85rem; }
.bf-shopcard q { display: block; margin-top: 12px; color: var(--bf-amber); font-style: italic; }
.bf-hook {
    padding: 18px 22px; border-radius: 14px; background: #fffaf0;
    background-image: repeating-linear-gradient(transparent 0 31px, rgba(15, 61, 62, 0.12) 31px 32px);
    font-size: 1.08rem; line-height: 32px;
}
.bf-hook em { font-style: normal; font-weight: 700; background: linear-gradient(transparent 55%, rgba(242, 169, 59, 0.55) 55%); }
.bf-checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.bf-checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.93rem; }
.bf-checks .ic { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; font-size: 0.75rem; font-weight: 700; }
.bf-checks .ok .ic { background: #dff3e8; color: var(--bf-ok); }
.bf-checks .warn .ic { background: #ffe9d2; color: var(--bf-warn); }
.bf-checks small { display: block; color: var(--muted); font-size: 0.82rem; }

.bf-sheet h4 { margin: 14px 0 6px; font: 600 0.9rem var(--font-head); color: var(--bf-teal); display: flex; align-items: center; gap: 8px; }
.bf-sheet h4:first-child { margin-top: 0; }
.bf-sheet dl { margin: 0; display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 0.92rem; }
.bf-sheet dt { color: var(--muted); }
.bf-sheet dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.bf-sheet dd.is-blank { color: #b3aebc; }
.bf-missing { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.bf-meter { display: flex; align-items: center; gap: 16px; }
.bf-ring { --p: 0; position: relative; flex: none; width: 76px; height: 76px; border-radius: 50%; background: conic-gradient(var(--bf-teal) calc(var(--p) * 1%), var(--line) 0); }
.bf-ring::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface); }
.bf-ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 1.05rem var(--font-head); color: var(--bf-teal); }

.bf-next { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: s; }
.bf-next li { position: relative; padding-left: 40px; counter-increment: s; font-size: 0.92rem; }
.bf-next li::before {
    content: counter(s); position: absolute; left: 0; top: 0; display: grid; place-items: center;
    width: 28px; height: 28px; border-radius: 50%; background: var(--bf-tint); color: var(--bf-teal); font: 600 0.82rem var(--font-head);
}
.bf-next b { display: block; font-family: var(--font-head); }
.bf-next span { color: var(--muted); }

/* ───── แถบสรุปด้านข้าง ───── */
.bf-live { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.bf-live h3 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 1rem; }
.bf-live ul { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 0.86rem; }
.bf-live li { display: grid; grid-template-columns: 74px 1fr; gap: 8px; }
.bf-live li span { color: var(--muted); }
.bf-live li b { font-weight: 500; overflow-wrap: anywhere; }
.bf-live li.is-blank b { color: #b3aebc; font-weight: 400; }
.bf-live .tip { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 0.8rem; color: var(--muted); }

/* ───── ส่งแล้ว ───── */
.bf-done { text-align: center; padding: 36px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.bf-done .bf-check { margin: 0 auto 14px; width: 72px; height: 72px; font-size: 2.3rem; }
.bf-done h2 { font-size: 1.6rem; }
.bf-done code { padding: 2px 10px; border-radius: 8px; background: var(--bf-tint); color: var(--bf-teal); font-size: 1.05rem; letter-spacing: 0.08em; }
.bf-done .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

.bf-msg { margin-top: 12px; padding: 12px 16px; border-radius: 12px; background: #fde8e4; color: #8b1f15; font-size: 0.92rem; }

@media (max-width: 960px) {
    .bf-layout { grid-template-columns: 1fr; }
    .bf-side { display: none; }
}
@media (max-width: 640px) {
    .bf-hero { padding: 28px 0 64px; }
    .bf-steps { padding: 14px 4px 12px; }
    .bf-step small { display: none; }
    .bf-dot { width: 34px; height: 34px; }
    .bf-step::before { top: 15px; }
    .bf-intro { flex-wrap: wrap; padding: 16px; }
    .bf-intro .meta { margin-left: 0; width: 100%; text-align: left; }
    .bf-intro .meta b { display: inline; margin-right: 6px; }
    .bf-q { padding: 16px 14px 18px; }
    .bf-opts, .bf-opts.wide { grid-template-columns: 1fr 1fr; }
    .bf-opts.wide { grid-template-columns: 1fr; }
    .bf-row2 { grid-template-columns: 1fr; }
    .bf-sheet dl { grid-template-columns: 1fr; gap: 0; }
    .bf-sheet dt { margin-top: 8px; font-size: 0.78rem; }
    .bf-celebrate { flex-direction: column; align-items: flex-start; }
    .bf-bottom { margin-inline: -8px; padding: 10px 12px; gap: 8px; }
    .bf-bottom .grow { display: none; }
    .bf-bottom .btn { flex: 1; padding-inline: 0.8rem; }
}
@media (prefers-reduced-motion: reduce) {
    .bf *, .bf *::before, .bf *::after { animation: none !important; transition: none !important; }
}

/* ปุ่มเพลงพื้นหลังของเว็บลอยอยู่มุมซ้ายล่าง เว้นที่ให้แถบปุ่มไม่โดนบัง */
@media (max-width: 1340px) {
    .bf-bottom { padding-left: 84px; }
}
