  :root {
    --bg: #faf6f1; --card: #ffffff; --ink: #2c3e54; --muted: #6b6f78;
    --line: #e8ddd2; --accent: #c4764f; --soft: #f6ece4; --good: #2f6f5e; --warn: #b4532a;
    --h0: #e9eef2; --h1: #f2d6a8; --h2: #e9a46b; --h3: #c4564a;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #141a22; --card: #1e2733; --ink: #f1ebe4; --muted: #b5b9c2;
      --line: #33404f; --accent: #e09a74; --soft: #2a2f38; --good: #6cc3a8; --warn: #f7b787;
      --h0: #2a3442; --h1: #8a6a3e; --h2: #c27a45; --h3: #e0644f;
    }
  }
  * { box-sizing: border-box; }
  body { margin: 0; background: var(--bg); color: var(--ink);
    font: 16px/1.6 "IBM Plex Sans Thai", -apple-system, "Sukhumvit Set", "Noto Sans Thai", "Thonburi", sans-serif; }
  a { color: var(--accent); }
  main { max-width: 960px; margin: 0 auto; padding: 20px 14px 64px; }
  h1 { font-size: 22px; margin: 0 0 2px; }
  .sub { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
  .flag { display: inline-block; background: var(--warn); color: #fff; font-size: 12px; padding: 1px 8px; border-radius: 99px; vertical-align: middle; }
  .tabs { display: flex; gap: 6px; margin: 12px 0 16px; flex-wrap: wrap; }
  .tabs button { flex: 1 1 160px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 12px; padding: 10px; font: inherit; cursor: pointer; }
  .tabs button.on { border: 2px solid var(--accent); font-weight: 600; }
  .tabs small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
  .view { display: none; } .view.on { display: block; }
  .btn { display: block; width: 100%; border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 600; padding: 12px; border-radius: 12px; margin-top: 12px; cursor: pointer; }
  .btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
  .btn:disabled { opacity: .45; cursor: default; }
  .small { font-size: 12px; color: var(--muted); }

  /* phone */
  .phone { max-width: 390px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 30px; padding: 18px 18px 22px; box-shadow: 0 8px 28px rgba(0,0,0,.08); min-height: 640px; position: relative; }
  .ptop { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
  .bar { height: 6px; background: var(--soft); border-radius: 99px; margin: 10px 0 14px; overflow: hidden; }
  .bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }
  .phone h2 { font-size: 21px; line-height: 1.35; margin: 4px 0 10px; }
  .opts { display: grid; gap: 8px; }
  .opts.two { grid-template-columns: 1fr 1fr; }
  .opt { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 14px; padding: 10px 12px; font: inherit; text-align: left; cursor: pointer; display: flex; gap: 10px; align-items: center; }
  .opt.on { border: 2px solid var(--accent); background: var(--soft); }
  .opt svg { flex: 0 0 auto; }
  .edu { margin-top: 12px; background: var(--soft); border-radius: 14px; padding: 10px 12px; font-size: 14px; display: none; }
  .edu.on { display: block; animation: rise .25s ease; }
  .edu b { color: var(--accent); }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
  .range { margin: 8px 0; }
  .range label { display: flex; justify-content: space-between; font-size: 14px; }
  .range input { width: 100%; accent-color: var(--accent); }
  .field { display: block; width: 100%; font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); margin-top: 6px; }
  .consent { display: flex; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 10px; align-items: flex-start; }
  .slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .slots button { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 10px; padding: 7px 0; font: inherit; font-size: 14px; cursor: pointer; }
  .slots button.on { border: 2px solid var(--accent); font-weight: 600; }
  .slots button:disabled { text-decoration: line-through; opacity: .45; }
  .meter { position: relative; height: 14px; border-radius: 99px; background: linear-gradient(90deg, #9cc7b5, #e9c98f, #c4764f); margin: 22px 4px 4px; }
  .meter .band { position: absolute; top: -5px; height: 24px; border: 2px solid var(--ink); border-radius: 99px; }
  .meter-l { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
  .need { display: flex; gap: 8px; margin: 6px 0; font-size: 15px; }
  .need span { flex: 0 0 22px; }
  .why { font-size: 13px; color: var(--muted); }
  .why summary { cursor: pointer; color: var(--accent); }
  .cant { border: 1px dashed var(--accent); border-radius: 14px; padding: 10px 12px; margin-top: 12px; font-size: 14px; }
  svg text { fill: var(--ink); font: 11px -apple-system, "Sukhumvit Set", sans-serif; }

  /* shop board */
  .board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
  @media (max-width: 760px) { .board { grid-template-columns: 1fr 1fr; } }
  .col { background: var(--soft); border-radius: 12px; padding: 8px; min-height: 200px; }
  .col h4 { margin: 0 0 6px; font-size: 13px; display: flex; justify-content: space-between; }
  .lead { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; margin-bottom: 6px; font-size: 13px; cursor: pointer; }
  .lead.new { border: 2px solid var(--accent); }
  .lead small { display: block; color: var(--muted); }
  .detail { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-top: 12px; display: none; }
  .detail.on { display: block; }
  .detail h3 { margin: 0 0 6px; }
  .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
  .row .btn { width: auto; flex: 1 1 140px; margin-top: 0; padding: 9px; font-size: 14px; }

  /* summary */
  .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
  .tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
  .tile b { display: block; font-size: 26px; line-height: 1.2; }
  .tile span { color: var(--muted); font-size: 12px; }
  .funnel div { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 14px; }
  .funnel i { display: block; height: 22px; background: var(--accent); border-radius: 6px; min-width: 4px; }
  .funnel span.n { width: 34px; text-align: right; font-weight: 600; }
  .funnel span.l { width: 120px; color: var(--muted); }
  .card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 10px 0; }
  .card h3 { margin: 0 0 4px; font-size: 17px; }
  .card p { margin: 0; }
  .bad { border-left: 4px solid var(--warn); }
  footer { margin-top: 28px; color: var(--muted); font-size: 13px; }
  footer a { color: inherit; }
