/* =====================================================================
   รอบ 44: เริ่มต้นใช้งาน (/getting-started) + การ์ดในแดชบอร์ด
   ใช้ตัวแปรสีของธีม (--brand ...) เพื่อให้เปลี่ยนตามสีร้านและโหมดมืดได้
   ===================================================================== */
@media screen {
  /* ---------- โครงหน้า ---------- */
  .ob-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; width: 100%; max-width: 1180px; margin: 0 auto; }
  .ob-side, .ob-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  .ob-help-btn { display: inline-flex; align-items: center; gap: 6px; }

  /* ---------- ความคืบหน้า ---------- */
  .ob-hero {
    position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 16px;
    margin: 0; padding: 18px; overflow: hidden;
    background: linear-gradient(140deg, var(--brand-soft), var(--brand-tint) 55%, var(--surface));
    border: 1px solid rgba(var(--brand-rgb), .18);
  }
  .ob-hero.is-done { background: linear-gradient(140deg, var(--ok-soft), var(--surface)); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
  .ob-hero-text h2 { margin: 0 0 4px; font-size: 1.15rem; line-height: 1.35; }
  .ob-hero-text p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
  .ob-ring { position: relative; width: 84px; height: 84px; flex: none; }
  .ob-ring svg, .ob-dash-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
  .ob-ring-track { fill: none; stroke: rgba(var(--brand-rgb), .16); stroke-width: 7; }
  .ob-ring-fill { fill: none; stroke: var(--brand); stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
  .ob-hero.is-done .ob-ring-fill { stroke: var(--ok); }
  .ob-hero.is-done .ob-ring-track { stroke: color-mix(in srgb, var(--ok) 18%, transparent); }
  .ob-ring-num { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 26px; font-variant-numeric: tabular-nums; }
  .ob-ring-num strong { font-size: 1.55rem; line-height: 1; }
  .ob-ring-num small { color: var(--muted); font-weight: 600; font-size: .9rem; }
  .ob-bar { grid-column: 1 / -1; height: 8px; margin-top: 10px; border-radius: 999px; background: rgba(var(--brand-rgb), .14); overflow: hidden; }
  .ob-bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .5s ease; }
  .ob-hero.is-done .ob-bar { background: color-mix(in srgb, var(--ok) 16%, transparent); }
  .ob-hero.is-done .ob-bar span { background: var(--ok); }
  .ob-hero-meta { grid-column: 1 / -1; display: flex; justify-content: space-between; margin: 2px 0 0; color: var(--muted); font-size: .82rem; font-weight: 600; }
  .ob-hero-acts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
  .ob-hero-acts .btn { flex: 1 1 0; text-align: center; }
  .ob-show-dash { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px dashed rgba(var(--brand-rgb), .22); font-size: .85rem; color: var(--muted); cursor: pointer; }
  .ob-show-dash input { width: 18px; height: 18px; accent-color: var(--brand); }

  /* ---------- ข้อมูลตัวอย่าง ---------- */
  .ob-demo { margin: 0; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
  .ob-demo-head { display: flex; align-items: flex-start; gap: 12px; }
  .ob-demo-head h2 { margin: 0; font-size: 1rem; }
  .ob-demo-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
  .ob-demo-ico.warn { background: var(--warn-soft); color: #9A5B00; }
  .ob-demo p { margin: 0; font-size: .9rem; line-height: 1.5; }
  .ob-demo.is-loaded { background: var(--warn-soft); border: 1px solid color-mix(in srgb, #D08A00 35%, transparent); }
  .ob-demo.is-loaded .ob-demo-ico.warn { background: var(--surface); }
  .ob-demo-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); }
  .ob-demo-branch { margin: 0; }
  .ob-demo-branch select { width: 100%; }

  /* ---------- กลุ่มขั้นตอน ---------- */
  .ob-group { display: flex; flex-direction: column; gap: 10px; }
  .ob-group-title { margin: 4px 2px 0; font-size: .85rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
  .ob-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

  /* ---------- การ์ดหนึ่งขั้น ---------- */
  .ob-step {
    display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow); border: 1px solid transparent; min-width: 0;
    transition: border-color .15s, box-shadow .15s;
  }
  .ob-step.is-next { border-color: rgba(var(--brand-rgb), .45); box-shadow: 0 0 0 3px var(--brand-tint), var(--shadow); }
  .ob-step-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--brand-soft); color: var(--brand); }
  .ob-step.is-next .ob-step-ico { background: var(--brand); color: var(--brand-ink); }
  .ob-step.is-done .ob-step-ico { background: var(--ok); color: #fff; }
  .ob-step.is-skipped .ob-step-ico { background: var(--chip); color: var(--muted); }
  .ob-step-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
  .ob-step-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .ob-step-title { font-size: 1rem; line-height: 1.35; }
  .ob-step.is-done .ob-step-title, .ob-step.is-skipped .ob-step-title { color: var(--muted); }
  .ob-step-why { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.45; }
  .ob-step-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
  .ob-step-acts .btn { white-space: nowrap; }
  .ob-step-tools { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
  .ob-step-help, .ob-step-skip {
    display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border: 0; border-radius: 9px;
    background: none; color: var(--muted); font: inherit; font-size: .84rem; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  }
  .ob-step-help:hover, .ob-step-skip:hover:not(:disabled) { background: var(--chip); color: var(--ink); }
  .ob-step-help { color: var(--brand); }
  .ob-step-skip:disabled { opacity: .5; cursor: default; }

  .ob-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
  .ob-badge.done { background: var(--ok-soft); color: var(--ok); }
  .ob-badge.skipped { background: var(--chip); color: var(--muted); }
  .ob-badge.todo { background: var(--chip); color: var(--muted); }
  .ob-badge.next { background: var(--brand-soft); color: var(--brand-strong); }

  /* ---------- แจ้งผล ---------- */
  .ob-toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1200; display: flex; align-items: center; gap: 10px;
    width: max-content; max-width: min(calc(100vw - 32px), 520px); padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--ink); color: var(--surface);
    box-shadow: var(--shadow-lg); font-size: .9rem; line-height: 1.45; animation: ob-toast-in .18s ease-out;
  }
  .ob-toast > svg { flex: none; color: var(--brand); }
  .ob-toast-x { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: inherit; opacity: .7; cursor: pointer; }
  .ob-toast-x:hover { opacity: 1; }
  @keyframes ob-toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

  /* ---------- การ์ดในแดชบอร์ด ---------- */
  .ob-dash {
    flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; border-radius: var(--radius);
    background: linear-gradient(110deg, var(--brand-soft), var(--brand-tint) 60%, var(--surface));
    border: 1px solid rgba(var(--brand-rgb), .22); min-width: 0;
  }
  .ob-dash-prog { display: flex; align-items: center; gap: 10px; flex: none; color: inherit; text-decoration: none; min-width: 0; }
  .ob-dash-ring { width: 42px; height: 42px; flex: none; }
  .ob-dash-ring .ob-ring-track, .ob-dash-ring .ob-ring-fill { stroke-width: 8; }
  .ob-dash-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
  .ob-dash-title strong { font-size: .98rem; white-space: nowrap; }
  .ob-dash-title small { color: var(--muted); font-size: .78rem; }
  .ob-dash-next { flex: 1 1 auto; display: flex; gap: 8px; min-width: 0; }
  .ob-dash-step {
    flex: 1 1 0; display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 320px; min-height: 40px; padding: 0 10px 0 6px;
    border-radius: 11px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: .88rem; font-weight: 600;
    box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s;
  }
  .ob-dash-step:hover { box-shadow: 0 0 0 2px rgba(var(--brand-rgb), .35); }
  .ob-dash-step-ico { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
  .ob-dash-step-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ob-dash-step-go { flex: none; color: var(--muted); }
  .ob-dash-all { flex: none; white-space: nowrap; background: var(--surface); }
  .ob-dash-x { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; }
  .ob-dash-x:hover { background: var(--surface); color: var(--ink); }

  .ob-dash-demo {
    flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px;
    background: var(--warn-soft); color: #7A4A00; font-size: .88rem; font-weight: 600; min-width: 0;
    border: 1px solid color-mix(in srgb, #D08A00 30%, transparent);
  }
  .ob-dash-demo > svg { flex: none; }
  .ob-dash-demo > span { flex: 1 1 auto; min-width: 0; }
  .ob-dash-demo a { flex: none; color: inherit; text-decoration: underline; white-space: nowrap; }

  /* โหมดมืด: สีเหลืองเตือนให้อ่านง่ายบนพื้นมืด */
  html[data-theme="dark"] .ob-dash-demo, html[data-theme="dark"] .ob-demo.is-loaded { color: #F3C76B; border-color: rgba(243,199,107,.3); }
  html[data-theme="dark"] .ob-demo-ico.warn { color: #F3C76B; }
  html[data-theme="dark"] .ob-toast > svg { color: var(--brand-strong); }
  html[data-theme="dark"] .ob-step.is-done .ob-step-ico { color: var(--surface); }
}

/* ---------- จอคอม: ซ้าย = ความคืบหน้า (ติดบน) | ขวา = ขั้นตอน ---------- */
@media screen and (min-width: 1025px) {
  .ob-layout { grid-template-columns: 340px minmax(0, 1fr); align-items: start; gap: 20px; }
  .ob-side { position: sticky; top: 0; }
  .ob-step { padding: 16px 18px; }
}

/* ---------- แท็บเล็ต/มือถือ ---------- */
@media screen and (max-width: 1024px) {
  .ob-dash { flex-wrap: wrap; }
  .ob-dash-prog { flex: 1 1 auto; }
  .ob-dash-next { order: 3; flex: 1 1 100%; }
  .ob-dash-step { max-width: none; }
}
@media screen and (max-width: 760px) {
  .ob-hero { padding: 16px; }
  .ob-ring { width: 72px; height: 72px; }
  .ob-ring-num { padding-top: 22px; }
  .ob-ring-num strong { font-size: 1.35rem; }
  .ob-step { gap: 12px; padding: 13px 14px; }
  .ob-step-ico { width: 38px; height: 38px; border-radius: 12px; }
  .ob-step-acts .btn.primary { flex: 1 1 auto; text-align: center; }
  .ob-step-tools { margin-left: 0; width: 100%; justify-content: space-between; }
  .ob-step-help, .ob-step-skip { padding: 0 6px; }
  .ob-dash { gap: 10px; padding: 10px; }
  .ob-dash-next { flex-direction: column; gap: 6px; }
  .ob-dash-all { order: 2; }
  .ob-dash-x { order: 2; }
  .ob-dash-demo { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 4px 10px; }
  .ob-dash-demo > svg { margin-top: 2px; }
  .ob-dash-demo a { grid-column: 2; justify-self: start; }
  .ob-toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}
