/* ==========================================================================
   Godlike 2.0 — Expert Blueprint Portal
   onboarding.css — สไตล์ทั้งหมดของ portal (ไม่พึ่ง styles.css ของ funnel)

   portal อยู่คนละ subdomain กับหน้าขาย (portal.consultingthai.com) จึงต้อง
   ยืนได้ด้วยตัวเอง ส่วน BASE ด้านล่างคือ token และ component ที่ยกมาจาก
   ดีไซน์ซิสเต็ม "Light Editorial Premium" ของ styles.css แบบค่าตรงกันทุกตัว

   ถ้าแก้สี/ฟอนต์ในหน้าขาย อย่าลืมแก้บล็อก :root ตรงนี้ให้ตรงกันด้วย
   ========================================================================== */

/* ===================== BASE — ยกมาจาก styles.css ======================= */
:root {
  --bg: #FAF8F4; --bg-alt: #F2EEE7; --surface: #FFFFFF; --ink: #14110E;
  --accent: #1A6B54; --accent-2: #13513F; --cta-alt: #B8862F;
  --danger: #9B2C2C; --highlight: #B8862F;
  --brass: #B8862F; --brass-soft: rgba(184, 134, 47, .26);
  --muted: #6B6258; --hairline: rgba(20, 17, 14, .12); --hairline-2: rgba(20, 17, 14, .07);
  --shadow: 0 18px 50px -28px rgba(20, 17, 14, .35);
  --shadow-sm: 0 8px 26px -18px rgba(20, 17, 14, .30);
  --font-thai: 'Noto Sans Thai', 'IBM Plex Sans Thai', sans-serif;
  --font-latin: 'Fraunces', 'Noto Serif Thai', Georgia, serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.7, 0, .84, 0);
  --maxw: 880px; --maxw-wide: 1140px; --r: 16px;
}

* { box-sizing: border-box }
html { scroll-behavior: smooth; overflow-x: clip }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-thai); font-size: 18px; line-height: 1.75;
  font-weight: 400; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { max-width: 100%; display: block }
a { color: inherit; text-decoration: none }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px }
.container.wide { max-width: var(--maxw-wide) }
.center { text-align: center }

.eyebrow {
  display: inline-block; font-family: var(--font-thai); font-weight: 600;
  font-size: .82rem; letter-spacing: 0; text-transform: uppercase;
  color: var(--brass); margin: 0 0 18px;
}

.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-family: var(--font-thai); font-weight: 700; font-size: 1.05rem;
  padding: 16px 34px; line-height: 1.3; text-align: center; white-space: nowrap;
  max-width: 100%; box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background .18s var(--ease-out);
}
.btn:hover { background: var(--accent-2); transform: translateY(-2px); box-shadow: 0 16px 34px -18px rgba(26, 107, 84, .7) }
.btn:active { transform: translateY(1px); transition-duration: .08s }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--brass) }
.btn.big { font-size: 1.18rem; padding: 20px 46px }
.btn.small { padding: 11px 22px; font-size: .95rem }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--hairline); box-shadow: none }
.btn.ghost:hover { background: var(--bg-alt); transform: none; box-shadow: none }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none }

.progress { height: 5px; background: var(--hairline-2); border-radius: 99px; overflow: hidden }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .35s ease }

.opt {
  display: block; width: 100%; text-align: left; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 12px; padding: 16px 20px; margin: 10px 0;
  font-family: var(--font-thai); font-size: 1.05rem; color: var(--ink); cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.opt:hover { border-color: var(--accent); background: #fbfcfb }
.opt.selected { border-color: var(--accent); background: rgba(26, 107, 84, .07); box-shadow: inset 3px 0 0 var(--accent) }
/* ช่องติ๊กของตัวเลือกแบบเลือกหลายข้อ — selector ต้องเป็น .ob-opts
   ให้ตรงกับที่ onboarding-app.js เรนเดอร์ (ไม่ใช่ .opts แบบในหน้าขาย) */
.ob-opts.multi .opt { padding-left: 52px; position: relative }
.ob-opts.multi .opt::before {
  content: ""; position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border: 1.5px solid var(--hairline); border-radius: 6px;
  background: var(--surface); transition: background .15s, border-color .15s;
}
.ob-opts.multi .opt.selected::before { background: var(--accent); border-color: var(--accent) }
.ob-opts.multi .opt.selected::after {
  content: ""; position: absolute; left: 22.5px; top: 50%; transform: translateY(-50%);
  width: 11px; height: 11px; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9.55 17.05 4.5 12l1.4-1.4 3.65 3.6 8.15-8.15 1.4 1.4z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9.55 17.05 4.5 12l1.4-1.4 3.65 3.6 8.15-8.15 1.4 1.4z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.field { margin: 16px 0 }
.field label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 6px; font-weight: 600 }
.field input, .field textarea {
  width: 100%; font-family: var(--font-thai); font-size: 1.05rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 14px 16px;
}
.field textarea { min-height: 120px; resize: vertical }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26, 107, 84, .12);
}
.err { display: none; color: var(--danger); font-size: .85rem; margin-top: 6px }

@keyframes fade { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

footer { border-top: 1px solid var(--hairline); padding: 34px 0; color: var(--muted); font-size: .9rem }
footer .container { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; justify-content: center; text-align: center }
footer a { color: var(--muted); border-bottom: 1px solid var(--hairline) }
footer a:hover { color: var(--ink) }

/* ===================== PORTAL ========================================== */

.ob { min-height: 100vh; display: flex; flex-direction: column; }
.ob .ob-main { flex: 1 0 auto; }
.ob [hidden] { display: none !important; }

/* ---------- Top bar ------------------------------------------------------ */
.ob-topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250, 248, 244, .92);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--hairline-2);
}
.ob-topbar-in {
  max-width: var(--maxw-wide); margin: 0 auto; padding: 12px 22px;
  display: flex; align-items: center; gap: 16px;
}
.ob-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-latin); font-weight: 600; font-size: 1.02rem;
  color: var(--ink); text-decoration: none; flex: 0 0 auto;
}
.ob-logo-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #F5F1E6; display: grid; place-items: center;
  font-family: Georgia, serif; font-weight: 700; font-size: .95rem;
}
.ob-logo small { display: block; font-family: var(--font-thai); font-weight: 400; font-size: .7rem; color: var(--muted); }
.ob-topbar-spacer { flex: 1 1 auto; }
.ob-topbar-meta {
  display: flex; align-items: center; gap: 14px; flex: 0 0 auto;
  font-size: .85rem; color: var(--muted); white-space: nowrap;
}
.ob-topbar-meta > span { white-space: nowrap; }
.ob-link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--font-thai); font-size: .85rem; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px;
}
.ob-link-btn:hover { color: var(--accent); }

/* ---------- Save indicator ---------------------------------------------- */
.ob-save {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .82rem; color: var(--muted);
  padding: 5px 12px; border-radius: 999px;
  background: rgba(26, 107, 84, .06); border: 1px solid transparent;
  transition: opacity .25s ease;
}
.ob-save::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex: 0 0 auto;
}
.ob-save.is-saving::before { background: var(--brass); animation: ob-blink 1s ease infinite; }
.ob-save.is-error { background: rgba(155, 44, 44, .08); color: var(--danger); }
.ob-save.is-error::before { background: var(--danger); }
@keyframes ob-blink { 50% { opacity: .25 } }

/* ---------- Panels / cards ---------------------------------------------- */
.ob-panel {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r); padding: 30px; box-shadow: var(--shadow-sm);
}
.ob-panel + .ob-panel { margin-top: 22px; }
.ob-panel h2 { font-family: var(--font-latin); font-weight: 600; font-size: 1.32rem; line-height: 1.3; margin-bottom: 4px; }
.ob-panel-sub { color: var(--muted); font-size: .92rem; margin-bottom: 20px; }

.ob-narrow { max-width: 620px; margin: 0 auto; }

/* ---------- Login -------------------------------------------------------- */
.ob-login { max-width: 460px; margin: 0 auto; }
.ob-login .ob-panel { padding: 34px; }
.ob-code-input input {
  font-family: var(--font-latin); font-size: 1.7rem; font-weight: 600;
  letter-spacing: .34em; text-align: center; text-transform: uppercase;
  padding: 16px 12px 16px 22px;
}
.ob-login-err {
  display: none; margin-top: 14px; padding: 12px 16px; border-radius: 12px;
  background: rgba(155, 44, 44, .07); border: 1px solid rgba(155, 44, 44, .22);
  color: var(--danger); font-size: .9rem;
}
.ob-login-err.show { display: block; }

/* ---------- Status card -------------------------------------------------- */
.ob-status {
  display: flex; gap: 26px; align-items: center; flex-wrap: wrap;
}
.ob-status-body { flex: 1 1 300px; min-width: 0; }
.ob-status-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-thai); font-weight: 700; font-size: .78rem;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 12px;
  background: rgba(26, 107, 84, .10); border: 1px solid rgba(26, 107, 84, .25); color: var(--accent-2);
}
.ob-status-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ob-status-chip.tone-muted { background: rgba(20, 17, 14, .05); border-color: var(--hairline); color: var(--muted); }
.ob-status-chip.tone-brass { background: rgba(184, 134, 47, .12); border-color: rgba(184, 134, 47, .35); color: #8a651f; }
.ob-status-chip.tone-danger { background: rgba(155, 44, 44, .08); border-color: rgba(155, 44, 44, .25); color: var(--danger); }
.ob-status-chip.tone-accent2 { background: rgba(19, 81, 63, .12); border-color: rgba(19, 81, 63, .3); color: var(--accent-2); }
.ob-status h2 { font-size: 1.5rem; margin-bottom: 6px; }
.ob-status p { color: var(--muted); font-size: .96rem; line-height: 1.65; }

/* progress ring */
.ob-ring { position: relative; width: 116px; height: 116px; flex: 0 0 auto; }
.ob-ring svg { transform: rotate(-90deg); display: block; }
.ob-ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ob-ring .track { stroke: var(--hairline-2); }
.ob-ring .bar { stroke: var(--accent); transition: stroke-dasharray .6s var(--ease-out); }
.ob-ring b {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-latin); font-weight: 600; font-size: 1.5rem;
}

/* ---------- Section checklist ------------------------------------------- */
.ob-sections { display: grid; gap: 10px; }
.ob-sec {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 15px 18px; cursor: pointer; font-family: var(--font-thai); font-size: 1rem;
  color: var(--ink); transition: border-color .18s ease, background .18s ease;
}
.ob-sec:hover { border-color: var(--accent); background: #fbfcfb; }
.ob-sec-num {
  width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-latin); font-weight: 600;
  font-size: .9rem; background: rgba(20, 17, 14, .05); color: var(--muted);
}
.ob-sec.is-partial .ob-sec-num { background: rgba(184, 134, 47, .16); color: #8a651f; }
.ob-sec.is-done .ob-sec-num { background: var(--accent); color: #fff; }
.ob-sec-txt { flex: 1 1 auto; min-width: 0; }
.ob-sec-txt b { display: block; font-weight: 600; }
.ob-sec-txt span { display: block; font-size: .82rem; color: var(--muted); }
.ob-sec-state { font-size: .82rem; color: var(--muted); flex: 0 0 auto; }
.ob-sec.is-done .ob-sec-state { color: var(--accent); }

/* ---------- Clarification panel ------------------------------------------ */
.ob-clarify { border-color: rgba(155, 44, 44, .28); background: linear-gradient(180deg, rgba(155, 44, 44, .04), var(--surface)); }
.ob-clarify ul { list-style: none; display: grid; gap: 10px; }
.ob-clarify li {
  display: flex; gap: 11px; align-items: flex-start;
  font-size: .96rem; line-height: 1.6;
}
.ob-clarify li::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; margin-top: 8px;
  background: var(--danger); flex: 0 0 auto;
}

/* ---------- Form shell --------------------------------------------------- */
.ob-form-head { margin-bottom: 22px; }
.ob-form-head .ob-step-label {
  font-family: var(--font-thai); font-weight: 700; font-size: .78rem;
  text-transform: uppercase; color: var(--brass); margin-bottom: 8px;
}
.ob-form-head h2 { font-family: var(--font-latin); font-weight: 600; font-size: clamp(1.5rem, 3.4vw, 2rem); line-height: 1.25; }
.ob-form-head .ob-sub-en { font-family: var(--font-latin); font-style: italic; color: var(--muted); font-size: .95rem; margin-top: 2px; }
.ob-form-head .ob-intro { color: var(--muted); font-size: .96rem; line-height: 1.65; margin-top: 12px; max-width: 62ch; }

.ob-progress-wrap { margin-bottom: 26px; }
.ob-progress-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-size: .82rem; color: var(--muted); margin-top: 9px;
}

/* chapter chips */
.ob-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; margin-bottom: 8px; scrollbar-width: thin; }
.ob-chip {
  flex: 0 0 auto; border: 1px solid var(--hairline); background: var(--surface);
  border-radius: 999px; padding: 7px 15px; font-family: var(--font-thai); font-size: .85rem;
  color: var(--muted); cursor: pointer; white-space: nowrap; transition: all .18s ease;
}
.ob-chip:hover { border-color: var(--accent); color: var(--ink); }
.ob-chip.is-current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.ob-chip.is-done { border-color: rgba(26, 107, 84, .3); color: var(--accent); }
.ob-chip[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Locked (ส่งข้อมูลแล้ว) --------------------------------------- */
.ob-lock-note {
  border: 1px solid rgba(184, 134, 47, .35); background: rgba(184, 134, 47, .08);
  border-radius: 12px; padding: 14px 17px; margin-bottom: 8px;
  font-size: .92rem; line-height: 1.6; color: #7a5a1b;
}
.ob-q.is-locked { opacity: .72; }
.ob-q.is-locked .opt, .ob-q.is-locked .ob-tag, .ob-q.is-locked .ob-rate,
.ob-q.is-locked .ob-rep-add, .ob-q.is-locked .ob-rep-del { cursor: not-allowed; }
.ob-q.is-locked input:disabled, .ob-q.is-locked textarea:disabled {
  background: var(--bg-alt); color: var(--ink); -webkit-text-fill-color: var(--ink); opacity: 1;
}

/* ---------- Question blocks ---------------------------------------------- */
.ob-q { padding: 26px 0; border-top: 1px solid var(--hairline-2); }
.ob-q:first-child { border-top: 0; padding-top: 6px; }
.ob-q-label {
  font-family: var(--font-latin); font-weight: 600; font-size: 1.18rem;
  line-height: 1.4; margin-bottom: 6px;
}
.ob-q-label .ob-opt-tag {
  font-family: var(--font-thai); font-weight: 400; font-size: .74rem;
  color: var(--muted); background: rgba(20, 17, 14, .05);
  padding: 3px 9px; border-radius: 999px; margin-left: 8px; vertical-align: middle;
}
.ob-q-help { color: var(--muted); font-size: .9rem; line-height: 1.6; margin-bottom: 14px; }
.ob-q.has-error .ob-q-label { color: var(--danger); }
.ob-q .err.show { display: block; }

/* option lists (reuse .opt from styles.css, add compact variants) */
.ob-opts { display: grid; gap: 9px; }
.ob-opts.inline { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ob-opts .opt { margin: 0; }
.ob-opts.inline .opt { padding: 12px 16px; font-size: .95rem; }

/* multi-detail rows */
.ob-md-row { display: grid; gap: 9px; }
.ob-md-detail {
  display: none; padding: 0 0 4px 18px; margin: -2px 0 4px;
  border-left: 2px solid rgba(26, 107, 84, .25);
}
.ob-md-detail.show { display: block; }
.ob-md-detail input { max-width: 260px; }
.ob-md-detail label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 5px; }

/* rating 1–10 */
.ob-rating { display: flex; gap: 7px; flex-wrap: wrap; }
.ob-rate {
  width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--hairline);
  background: var(--surface); font-family: var(--font-latin); font-weight: 600; font-size: 1rem;
  color: var(--ink); cursor: pointer; transition: all .15s ease;
}
.ob-rate:hover { border-color: var(--accent); }
.ob-rate.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.ob-rating-scale { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-top: 8px; max-width: 540px; }

/* tags */
.ob-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-tag {
  border: 1px solid var(--hairline); background: var(--surface); border-radius: 999px;
  padding: 9px 17px; font-family: var(--font-thai); font-size: .93rem; color: var(--ink);
  cursor: pointer; transition: all .15s ease;
}
.ob-tag:hover { border-color: var(--brass); }
.ob-tag.selected { background: rgba(184, 134, 47, .14); border-color: var(--brass); color: #8a651f; font-weight: 600; }
.ob-count { font-size: .8rem; color: var(--muted); margin-top: 10px; }
.ob-count.is-max { color: var(--brass); font-weight: 600; }

/* repeater */
.ob-rep { display: grid; gap: 16px; }
.ob-rep-item {
  border: 1px solid var(--hairline); border-radius: 14px; padding: 22px;
  background: linear-gradient(180deg, var(--surface), rgba(242, 238, 231, .4));
  position: relative;
}
.ob-rep-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--hairline-2);
}
.ob-rep-title { font-family: var(--font-latin); font-weight: 600; font-size: 1rem; color: var(--accent-2); }
.ob-rep-del {
  background: none; border: 0; cursor: pointer; font-family: var(--font-thai);
  font-size: .82rem; color: var(--muted); padding: 4px 8px; border-radius: 8px;
}
.ob-rep-del:hover { color: var(--danger); background: rgba(155, 44, 44, .06); }
.ob-rep-item .field { margin: 14px 0 0; }
.ob-rep-item .field label { font-weight: 600; color: var(--ink); font-size: .88rem; }
.ob-rep-item .ob-opts { margin-top: 8px; }
.ob-rep-sub { margin: 14px 0 0; }
.ob-rep-sub > label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 8px; }
.ob-rep-add {
  border: 1px dashed rgba(26, 107, 84, .4); background: rgba(26, 107, 84, .04);
  border-radius: 12px; padding: 14px; width: 100%; cursor: pointer;
  font-family: var(--font-thai); font-weight: 600; font-size: .95rem; color: var(--accent);
  transition: all .15s ease;
}
.ob-rep-add:hover { background: rgba(26, 107, 84, .08); border-style: solid; }
.ob-rep-add[disabled] { opacity: .4; cursor: not-allowed; }

/* matrix */
.ob-matrix-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ob-matrix { border-collapse: collapse; width: 100%; min-width: 460px; font-size: .92rem; }
.ob-matrix th, .ob-matrix td { border: 1px solid var(--hairline-2); padding: 10px 12px; text-align: center; }
.ob-matrix th:first-child, .ob-matrix td:first-child { text-align: left; font-weight: 600; background: var(--bg-alt); }
.ob-matrix thead th { background: var(--bg-alt); font-weight: 600; font-size: .85rem; white-space: nowrap; }
.ob-matrix input { width: 19px; height: 19px; accent-color: var(--accent); cursor: pointer; }

/* availability grid */
.ob-avail-wrap { overflow-x: auto; }
.ob-avail { border-collapse: collapse; width: 100%; min-width: 460px; font-size: .9rem; }
.ob-avail th, .ob-avail td { border: 1px solid var(--hairline-2); padding: 9px 8px; text-align: center; }
.ob-avail th:first-child, .ob-avail td:first-child { text-align: left; font-weight: 600; background: var(--bg-alt); white-space: nowrap; }
.ob-avail thead th { background: var(--bg-alt); font-size: .82rem; }
.ob-avail td label { display: block; cursor: pointer; padding: 3px; }
.ob-avail input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* dates */
.ob-dates { display: grid; gap: 10px; }
.ob-date-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ob-date-row input[type=date] {
  font-family: var(--font-thai); font-size: .98rem; padding: 11px 14px;
  border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface); color: var(--ink);
}
.ob-date-row input[type=text] { flex: 1 1 160px; min-width: 140px; }
.ob-date-row span { color: var(--muted); font-size: .9rem; }

/* checkbox group */
.ob-checks { display: grid; gap: 11px; }
.ob-check {
  display: flex; gap: 13px; align-items: flex-start; cursor: pointer;
  padding: 14px 16px; border: 1px solid var(--hairline); border-radius: 12px;
  background: var(--surface); font-size: .95rem; line-height: 1.6;
  transition: all .15s ease;
}
.ob-check:hover { border-color: var(--accent); }
.ob-check.checked { border-color: var(--accent); background: rgba(26, 107, 84, .05); }
.ob-check input { margin-top: 4px; width: 19px; height: 19px; accent-color: var(--accent); flex: 0 0 auto; }

/* upload */
.ob-upload-zone {
  border: 1px dashed rgba(26, 107, 84, .38); border-radius: 14px;
  padding: 26px 20px; text-align: center; background: rgba(26, 107, 84, .03);
  transition: all .18s ease;
}
.ob-upload-zone.is-drag { background: rgba(26, 107, 84, .09); border-style: solid; }
.ob-upload-zone p { color: var(--muted); font-size: .85rem; margin-top: 9px; }
.ob-files { display: grid; gap: 9px; margin-top: 14px; }
.ob-file {
  display: flex; align-items: center; gap: 12px; padding: 12px 15px;
  border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface); font-size: .92rem;
}
.ob-file-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-file-name a { color: var(--ink); text-decoration: none; }
.ob-file-name a:hover { color: var(--accent); text-decoration: underline; }
.ob-file-size { color: var(--muted); font-size: .82rem; flex: 0 0 auto; }
.ob-file-del { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: .85rem; padding: 4px 6px; }
.ob-file-del:hover { color: var(--danger); }
.ob-file.is-pending { opacity: .6; }
.ob-link-add { display: flex; gap: 9px; margin-top: 14px; flex-wrap: wrap; }
.ob-link-add input { flex: 1 1 240px; }

/* profile card */
.ob-profile {
  border: 1px solid rgba(26, 107, 84, .22); border-radius: 14px; padding: 20px 22px;
  background: rgba(26, 107, 84, .04);
}
.ob-profile dl { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 10px 18px; font-size: .96rem; }
.ob-profile dt { color: var(--muted); font-size: .88rem; }
.ob-profile dd { font-weight: 600; word-break: break-word; }
.ob-profile-actions { margin-top: 16px; }

/* nav */
.ob-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--hairline-2); }
.ob-nav-left { display: flex; gap: 10px; align-items: center; }
.ob-nav .btn { flex-direction: row; }

/* ---------- Review ------------------------------------------------------- */
.ob-review-sec { border-top: 1px solid var(--hairline-2); padding: 20px 0; }
.ob-review-sec:first-of-type { border-top: 0; }
.ob-review-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.ob-review-head h3 { font-family: var(--font-latin); font-weight: 600; font-size: 1.1rem; }
.ob-review-list { display: grid; gap: 12px; }
.ob-review-item { font-size: .95rem; line-height: 1.6; }
.ob-review-item dt { color: var(--muted); font-size: .86rem; margin-bottom: 2px; }
.ob-review-item dd { white-space: pre-wrap; word-break: break-word; }
.ob-review-item dd.is-empty { color: var(--muted); font-style: italic; }
.ob-review-sub { margin-left: 14px; padding-left: 14px; border-left: 2px solid var(--hairline-2); }
.ob-highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.ob-highlight {
  border: 1px solid var(--hairline); border-radius: 12px; padding: 15px 17px;
  background: linear-gradient(180deg, rgba(26, 107, 84, .05), var(--surface));
}
.ob-highlight dt { font-size: .8rem; color: var(--muted); margin-bottom: 5px; }
.ob-highlight dd { font-weight: 600; font-size: .98rem; line-height: 1.5; }
.ob-missing { list-style: none; display: grid; gap: 7px; font-size: .92rem; color: var(--muted); }
.ob-missing li::before { content: "•"; color: var(--brass); margin-right: 8px; }

/* ---------- Modal -------------------------------------------------------- */
.ob-modal {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(20, 17, 14, .45); padding: 22px;
}
.ob-modal-box {
  background: var(--surface); border-radius: var(--r); padding: 30px;
  max-width: 460px; width: 100%; box-shadow: var(--shadow);
  animation: fade .25s var(--ease-out);
}
.ob-modal-box h3 { font-family: var(--font-latin); font-weight: 600; font-size: 1.28rem; margin-bottom: 8px; }
.ob-modal-box p { color: var(--muted); font-size: .95rem; line-height: 1.65; }
.ob-modal-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.ob-modal-actions .btn { flex: 1 1 140px; flex-direction: row; }
.ob-modal-box.wide { max-width: 620px; max-height: 88vh; overflow-y: auto; }

/* ---------- Done --------------------------------------------------------- */
.ob-done-steps { list-style: none; counter-reset: d; display: grid; gap: 14px; margin-top: 8px; }
.ob-done-steps li { counter-increment: d; display: flex; gap: 14px; align-items: flex-start; font-size: .98rem; line-height: 1.6; }
.ob-done-steps li::before {
  content: counter(d); flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(26, 107, 84, .1); color: var(--accent-2); display: grid; place-items: center;
  font-family: var(--font-latin); font-weight: 600; font-size: .85rem;
}
.ob-uses { list-style: none; display: grid; gap: 9px; margin: 10px 0 0; }
.ob-uses li { display: flex; gap: 11px; align-items: flex-start; font-size: .96rem; line-height: 1.6; color: var(--muted); }
.ob-uses li::before {
  content: ""; flex: 0 0 auto; width: 17px; height: 17px; margin-top: 4px;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5' stroke='%23000' stroke-width='3' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5' stroke='%23000' stroke-width='3' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ---------- Admin -------------------------------------------------------- */
.ob-table-wrap { overflow-x: auto; }
.ob-table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 760px; }
.ob-table th, .ob-table td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--hairline-2); vertical-align: middle; }
.ob-table th { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; white-space: nowrap; }
.ob-table tbody tr:hover { background: rgba(26, 107, 84, .03); }
.ob-table td .btn { flex-direction: row; }
.ob-mini {
  padding: 7px 14px; font-size: .84rem; border-radius: 999px; border: 1px solid var(--hairline);
  background: var(--surface); font-family: var(--font-thai); color: var(--ink); cursor: pointer;
}
.ob-mini:hover { border-color: var(--accent); color: var(--accent); }
.ob-mini + .ob-mini { margin-left: 6px; }
.ob-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.ob-toolbar .field { margin: 0; flex: 1 1 220px; }
.ob-bar { height: 6px; background: var(--hairline-2); border-radius: 99px; width: 74px; overflow: hidden; display: inline-block; vertical-align: middle; }
.ob-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.ob-tagchip {
  display: inline-block; font-size: .76rem; padding: 3px 10px; border-radius: 999px;
  background: rgba(184, 134, 47, .13); color: #8a651f; margin: 2px 4px 2px 0;
}
.ob-note {
  border-left: 3px solid var(--brass); padding: 11px 14px; background: var(--bg-alt);
  border-radius: 0 10px 10px 0; font-size: .93rem; line-height: 1.6; margin-bottom: 10px;
}
.ob-note time { display: block; font-size: .76rem; color: var(--muted); margin-top: 5px; }
.ob-copy-box {
  background: var(--bg-alt); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 15px 17px; font-family: ui-monospace, Menlo, monospace; font-size: .88rem;
  word-break: break-all; margin: 10px 0;
}
.ob-flag {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; border-radius: 10px;
  background: rgba(155, 44, 44, .06); border: 1px solid rgba(155, 44, 44, .2);
  color: var(--danger); font-size: .9rem; line-height: 1.55; margin-bottom: 9px;
}

/* ---------- Responsive --------------------------------------------------- */
@media (max-width: 820px) {
  body { font-size: 17px; }
  .ob-panel { padding: 24px 20px; }
  .ob-login .ob-panel { padding: 26px 20px; }
  .ob-status { gap: 18px; }
  .ob-ring { width: 92px; height: 92px; }
  .ob-ring b { font-size: 1.25rem; }
  .ob-nav { display: grid; grid-template-columns: 1fr; }
  .ob-nav .btn { width: 100%; }
  .ob-nav-left { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .ob-topbar-meta { gap: 10px; font-size: .8rem; }
  .ob-profile dl { grid-template-columns: 1fr; gap: 3px 0; }
  .ob-profile dd { margin-bottom: 10px; }
  .ob-rep-item { padding: 18px 16px; }
  .ob-q-label { font-size: 1.08rem; }
}
@media (max-width: 700px) {
  /* บนมือถือเหลือแค่ตัวบ่งชี้การบันทึก + ปุ่มออก ชื่อลูกค้าไปอยู่บนการ์ดสถานะแทน */
  .ob-topbar-in { gap: 10px; }
  .ob-logo > span:not(.ob-logo-mark) { display: none; }
  #obWho { display: none; }
  .ob-topbar-meta { gap: 10px; }
  .ob-save { padding: 5px 10px; font-size: .76rem; }
  .ob-save.is-error { font-size: 0; padding: 5px 9px; }
  .ob-save.is-error::before { width: 8px; height: 8px; }
}
@media (max-width: 520px) {
  .container { padding: 0 18px; }
  .ob-topbar-in { padding: 10px 16px; gap: 10px; }
  .ob-logo small { display: none; }
  .ob-opts.inline { grid-template-columns: 1fr; }
  .ob-rate { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ob-save.is-saving::before { animation: none; }
  .ob-ring .bar, .ob-sec, .ob-chip, .ob-tag, .ob-rate,
  .btn, .opt, .progress i { transition: none; }
  .ob-modal-box, .ob-q { animation: none; }
}

/* ---------- Print (Brief / คำตอบ) ---------------------------------------- */
@media print {
  .ob-topbar, .ob-nav, .ob-chips, .no-print, footer { display: none !important; }
  .ob { background: #fff; }
  .ob-panel { box-shadow: none; border: 0; padding: 0; page-break-inside: avoid; }
  .ob-review-sec { page-break-inside: avoid; }
  body { font-size: 11pt; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #666; }
  .ob-print-only { display: block !important; }
}
.ob-print-only { display: none; }
