/* =====================================================================
   CarFe' Studio — back office
   Layout: ไฟสตูดิโอ (sidebar มืด + เพดานไฟ LED หกเหลี่ยม) · พื้นที่ทำงานสว่าง สะอาด
   Signature: เพดานไฟหกเหลี่ยม · ป้ายทะเบียนจริง · ปุ่มเงาแบบสีเคลือบ
   ===================================================================== */
:root {
  /* studio (มืด) */
  --studio: #0A0E13;
  --studio-2: #121821;
  --studio-3: #1B2430;
  --studio-ink: #E8EEF3;
  --studio-muted: #8593A3;
  --led: #D6F5FF;
  --led-glow: rgba(110, 214, 255, .45);
  /* canvas (สว่าง) */
  --canvas: #ECEFF3;
  --surface: #FFFFFF;
  --surface-2: #F6F8FA;
  --ink: #0D131A;
  --ink-2: #2B3743;
  --muted: #677585;
  --line: #E1E6EC;
  --line-2: #CDD5DE;
  /* accent: ฟ้าเคลือบเซรามิค */
  --accent: #0789B0;
  --accent-ink: #FFFFFF;
  --accent-soft: #E2F4FA;
  /* semantic */
  --ok: #17895A; --ok-soft: #E3F5EC;
  --warn: #B86A00; --warn-soft: #FFF2DC;
  --bad: #CC3B3B; --bad-soft: #FDE8E8;
  --violet: #6D4BC9; --violet-soft: #EFEAFD;
  --sky: #2E6BD9; --sky-soft: #E7EFFD;
  /* type */
  --f-display: "Bai Jamjuree", "Anuphan", system-ui, sans-serif;
  --f-body: "Anuphan", "Noto Sans Thai", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  /* shape */
  --r-sm: 8px; --r: 14px; --r-lg: 20px;
  --shadow: 0 1px 2px rgba(13, 19, 26, .05), 0 10px 30px -14px rgba(13, 19, 26, .18);
  --shadow-lg: 0 2px 4px rgba(13, 19, 26, .06), 0 24px 60px -24px rgba(13, 19, 26, .35);
  --side: 268px;
  --hex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50V16L28 0l28 16v34L28 66v34' fill='none' stroke='%23D6F5FF' stroke-width='1.6'/%3E%3Cpath d='M28 0v34L0 50v34l28 16 28-16V50L28 34' fill='none' stroke='%23D6F5FF' stroke-width='1.6'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 15px/1.6 var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.2; margin: 0; text-wrap: pretty; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 600; }
h3 { font-size: .98rem; font-weight: 600; }
p { margin: 0; }
img { max-width: 100%; }
code, .mono { font-family: var(--f-mono); font-size: .86em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.ico { width: 18px; height: 18px; flex: none; }

/* =====================================================================
   SHELL — sidebar สตูดิโอ
   ===================================================================== */
body.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.studio {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--studio); color: var(--studio-ink); overflow: hidden; z-index: 40;
}
.ceiling { position: relative; padding: 26px 20px 22px; isolation: isolate; }
.ceiling::before, .login-stage::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--hex) 0 0 / 42px 75px;
  opacity: .5;
  -webkit-mask-image: radial-gradient(120% 90% at 30% 0%, #000 0%, rgba(0,0,0,.35) 45%, transparent 75%);
          mask-image: radial-gradient(120% 90% at 30% 0%, #000 0%, rgba(0,0,0,.35) 45%, transparent 75%);
}
.ceiling::after, .login-stage::after {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: radial-gradient(80% 70% at 30% 0%, rgba(110, 214, 255, .26), transparent 70%);
}
.brand { display: grid; gap: 2px; color: #fff; text-decoration: none; }
.brand b { font: 700 1.3rem/1.1 var(--f-display); letter-spacing: .01em; }
.brand span { font-size: .78rem; color: var(--studio-muted); letter-spacing: .08em; }

.cta-led {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 16px 14px;
  padding: 11px 14px; border-radius: 12px; text-decoration: none; font-weight: 600;
  background: var(--led); color: var(--studio);
  box-shadow: 0 0 0 1px rgba(214, 245, 255, .6), 0 8px 28px -6px var(--led-glow);
  transition: transform .15s, box-shadow .15s;
}
.cta-led:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px #fff, 0 12px 34px -6px var(--led-glow); }

.nav { display: grid; gap: 2px; padding: 4px 12px; overflow-y: auto; flex: 1; align-content: start; }
.nav .group { font: 600 .8rem var(--f-body); letter-spacing: .02em; color: #7C8B99; padding: 18px 10px 6px; border-top: 1px solid rgba(214, 245, 255, .07); margin-top: 6px; }
.nav .group:first-child { border-top: 0; margin-top: 0; padding-top: 6px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: #B4C0CC; text-decoration: none; font-size: .94rem; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(214, 245, 255, .05); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(214, 245, 255, .12), rgba(214, 245, 255, .03)); color: #fff; }
.nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--led); box-shadow: 0 0 12px 2px var(--led-glow);
}
.nav a.active .ico { color: var(--led); }

.me { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid rgba(214, 245, 255, .08); }
.me div { display: grid; line-height: 1.3; min-width: 0; flex: 1; }
.me b { font-weight: 600; font-size: .9rem; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me small { color: var(--studio-muted); font-size: .76rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0;
  background: transparent; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: rgba(214, 245, 255, .08); }

.mobilebar { display: none; }
.content { padding: 30px clamp(16px, 3vw, 40px) 80px; min-width: 0; display: grid; gap: 22px; align-content: start; max-width: 1480px; width: 100%; }

@media (max-width: 960px) {
  body.app { grid-template-columns: minmax(0, 1fr); }
  .studio { position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px); transform: translateX(-102%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-lg); }
  body.nav-open .studio { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(5, 8, 11, .5); z-index: 30; }
  .mobilebar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20;
    padding: 10px 14px; background: var(--studio); color: #fff;
  }
  .mobilebar .brand b { font-size: 1.05rem; }
  .content { padding: 18px 14px 80px; }
}

/* =====================================================================
   PAGE PRIMITIVES
   ===================================================================== */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; justify-content: space-between; }
.page-head > div:first-child { display: grid; gap: 4px; }
.page-head .sub { color: var(--muted); font-size: .92rem; }
.eyebrow { font: 600 .8rem var(--f-body); letter-spacing: .01em; color: var(--accent); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px;
  display: grid; gap: 14px; align-content: start; min-width: 0; box-shadow: var(--shadow);
}
.card > h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.grid-2 { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); align-items: start; }
.grid-wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); }
.grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stack { display: grid; gap: 12px; min-width: 0; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; font-size: .93rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.empty { color: var(--muted); padding: 26px; text-align: center; border: 1.5px dashed var(--line-2); border-radius: var(--r); background: var(--surface-2); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.stage-title { font: 500 .74rem var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
details > summary { cursor: pointer; }

/* ---------- flash ---------- */
.flashes { display: grid; gap: 8px; }
.flash { display: block; padding: 12px 16px; border-radius: 12px; font-size: .93rem; border: 1px solid transparent; }
.flash-success { background: var(--ok-soft); color: #0F6B45; border-color: #BFE6D2; }
.flash-error { background: var(--bad-soft); color: #A72E2E; border-color: #F5C6C6; }
.flash-info { background: var(--accent-soft); color: #075F7A; border-color: #BFE5F1; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; max-width: min(92vw, 540px); box-shadow: var(--shadow-lg); animation: toast-in .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; min-height: 40px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font: 500 .94rem/1.2 var(--f-body);
  text-decoration: none; cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s, transform .1s;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
/* ปุ่มหลัก = สีดำเคลือบเงา มีแสงไฟวิ่งผ่านตอน hover */
.btn-primary {
  color: #fff; border-color: #000;
  background: linear-gradient(180deg, #33404E 0%, #141B23 48%, #05080B 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 16px -8px rgba(5, 8, 11, .7);
}
.btn-primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(214, 245, 255, .35), transparent);
  transform: skewX(-20deg); transition: left .6s cubic-bezier(.2, .8, .2, 1);
}
.btn-primary:hover { border-color: #000; }
.btn-primary:hover::after { left: 120%; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { border-color: #0F6B45; background: #127A4E; }
.btn-warn { background: var(--warn-soft); border-color: #F0CE93; color: var(--warn); }
.btn-danger { background: var(--surface); border-color: #F0B9B9; color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); background: var(--bad-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); border-color: transparent; }
.btn-led { background: var(--led); color: var(--studio); border-color: var(--led); box-shadow: 0 8px 24px -8px var(--led-glow); font-weight: 600; }
.btn-led:hover { border-color: #fff; }
.btn-glass { background: rgba(214, 245, 255, .07); border-color: rgba(214, 245, 255, .18); color: #E8F7FC; }
.btn-glass:hover { border-color: rgba(214, 245, 255, .5); }
.btn-sm { padding: 5px 11px; min-height: 32px; font-size: .85rem; border-radius: 9px; }
.btn-lg { padding: 13px 20px; min-height: 52px; font-size: 1.02rem; border-radius: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; }
.fields { display: grid; gap: 14px 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > span, .field > legend { font-size: .84rem; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: .8rem; color: var(--muted); font-weight: 400; }
.field.wide { grid-column: 1 / -1; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px; min-height: 42px; border: 1px solid var(--line-2); border-radius: 11px;
  background: var(--surface-2); color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 84px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #B5C0CC; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px rgba(7, 137, 176, .14); }
.check { display: flex; gap: 10px; align-items: center; font-size: .94rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.checks { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.searchbar { display: flex; gap: 10px; flex-wrap: wrap; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.searchbar input, .searchbar select { flex: 1 1 200px; width: auto; }

/* choice tiles (เลือกบริการ) */
.choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.choice:hover { border-color: var(--line-2); }
.choice:has(input:checked) { border-color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ink); }
.choice .row { flex-wrap: nowrap; }
.choice .price { font: 600 1rem var(--f-display); font-variant-numeric: tabular-nums; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.card .table-wrap { box-shadow: none; }
table.tbl { border-collapse: collapse; width: 100%; font-size: .93rem; }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.tbl th { font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: #FAFBFC; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tfoot td { font-weight: 600; background: var(--surface-2); }
.tbl a.rowlink { font-weight: 600; text-decoration: none; color: var(--ink); }
.tbl a.rowlink:hover { color: var(--accent); }
.tbl .num { text-align: right; }

/* ---------- pills / status ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; padding: 2px 10px; border-radius: 99px; white-space: nowrap; line-height: 1.7; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.plain::before { display: none; }
.st-waiting { background: #F0F2F5; color: #4F5D6B; border-color: #DDE2E8; }
.st-inspecting { background: var(--sky-soft); color: var(--sky); border-color: #CADAF8; }
.st-in_progress { background: var(--accent-soft); color: var(--accent); border-color: #BCE3F0; }
.st-qc { background: var(--violet-soft); color: var(--violet); border-color: #D9CEF7; }
.st-awaiting_payment, .st-unpaid, .st-partial { background: var(--warn-soft); color: var(--warn); border-color: #F3D9A8; }
.st-ready, .st-paid, .st-done { background: var(--ok-soft); color: var(--ok); border-color: #BFE6D2; }
.st-delivered { background: var(--ink); color: #fff; border-color: var(--ink); }
.st-cancelled, .st-void, .st-skipped { background: var(--bad-soft); color: var(--bad); border-color: #F5C6C6; }
.pill-req { background: var(--warn-soft); color: var(--warn); border-color: #F3D9A8; }
.pill-ok { background: var(--ok-soft); color: var(--ok); border-color: #BFE6D2; }

/* =====================================================================
   SIGNATURE: ป้ายทะเบียน
   ===================================================================== */
.plate {
  display: inline-grid; justify-items: center; align-content: center; gap: 0;
  min-width: 96px; padding: 4px 12px 3px; border-radius: 7px;
  background: linear-gradient(180deg, #FFFFFF, #F1F3F5); color: #111;
  border: 2px solid #111; box-shadow: inset 0 0 0 1.5px #fff, 0 1px 0 rgba(0, 0, 0, .1);
  line-height: 1.05; white-space: nowrap;
}
.plate b { font: 700 1.05rem/1.1 var(--f-display); letter-spacing: .02em; }
.plate small { font: 500 .62rem/1.2 var(--f-body); color: #333; margin-top: 1px; }
.plate-lg { min-width: 168px; padding: 8px 20px 6px; border-radius: 10px; border-width: 3px; }
.plate-lg b { font-size: 1.85rem; }
.plate-lg small { font-size: .82rem; }
.plate-sm { min-width: 0; padding: 1px 8px; border-width: 1.5px; border-radius: 5px; }
.plate-sm b { font-size: .88rem; }

/* angle diagram */
.angle { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--studio); flex: none; }
.angle svg { width: 36px; height: 36px; }
.angle .a-car { fill: none; stroke: #6E7E8E; stroke-width: 1.6; }
.angle .a-glass { fill: #3A4A5A; }
.angle .a-ray { stroke: var(--led); stroke-width: 1.4; stroke-dasharray: 2 2; }
.angle .a-cam { fill: var(--led); filter: drop-shadow(0 0 3px var(--led-glow)); }
.angle-generic { color: var(--led); }
.angle-generic .ico { width: 20px; height: 20px; }

/* ring */
.ring { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring .r-track { fill: none; stroke: var(--line); stroke-width: 3.5; }
.ring .r-val { fill: none; stroke: var(--warn); stroke-width: 3.5; stroke-linecap: round; transition: stroke-dashoffset .5s; }
.ring.is-full .r-val { stroke: var(--ok); }
.ring span { font: 600 .66rem var(--f-mono); color: var(--ink-2); letter-spacing: -.03em; }

/* avatar */
.avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font: 600 .78rem var(--f-body); color: #fff; background: hsl(var(--h, 200) 45% 42%); border: 2px solid var(--surface); flex: none; }
.avatars { display: flex; }
.avatars .avatar + .avatar { margin-left: -8px; }
.avatar.lg { width: 36px; height: 36px; font-size: .95rem; border-color: var(--studio-3); }

/* =====================================================================
   BOARD
   ===================================================================== */
.pulse-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.pulse { display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .88rem; color: var(--muted); }
.pulse b { font: 700 1.25rem var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.pulse.is-alert b { color: var(--warn); }

.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(262px, 1fr); gap: 14px; overflow-x: auto; padding: 2px 2px 14px; align-items: start; scroll-snap-type: x proximity; }
.lane { display: grid; gap: 10px; align-content: start; scroll-snap-align: start; min-height: 140px; }
.lane-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.lane-head h3 { display: flex; align-items: center; gap: 8px; font: 600 .9rem var(--f-body); color: var(--ink-2); }
.lane-head h3 i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #8593A3); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, #8593A3) 18%, transparent); }
.lane-head .count { font: 600 .78rem var(--f-mono); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 0 9px; }
.lane-body { display: grid; gap: 10px; padding: 8px; border-radius: 16px; background: rgba(255, 255, 255, .45); border: 1px dashed var(--line-2); min-height: 100px; align-content: start; }
.lane-empty { color: var(--muted); font-size: .82rem; text-align: center; padding: 22px 0; }
.lane[data-s="waiting"] { --c: #7A8796; }
.lane[data-s="inspecting"] { --c: var(--sky); }
.lane[data-s="in_progress"] { --c: var(--accent); }
.lane[data-s="qc"] { --c: var(--violet); }
.lane[data-s="awaiting_payment"] { --c: var(--warn); }
.lane[data-s="ready"] { --c: var(--ok); }

.jcard {
  display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.jcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.jcard-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.jcard .car { font-weight: 600; font-size: .95rem; line-height: 1.35; }
.jcard .car small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.jcard .svc { display: flex; flex-wrap: wrap; gap: 5px; }
.jcard .svc span { font-size: .75rem; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.jcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.time { display: inline-flex; align-items: center; gap: 5px; }
.time .ico { width: 14px; height: 14px; }
.jcard.is-late { border-color: #F3D9A8; box-shadow: 0 0 0 3px rgba(184, 106, 0, .12), var(--shadow); }
.jcard.is-late .time { color: var(--warn); font-weight: 600; }
.jcard .amount { font: 700 1rem var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }

/* =====================================================================
   JOB HERO (โซนสตูดิโอบนหน้าใบงาน)
   ===================================================================== */
.hero {
  position: relative; isolation: isolate; overflow: hidden; border-radius: var(--r-lg);
  background: var(--studio); color: var(--studio-ink); padding: 26px 26px 20px; display: grid; gap: 20px; box-shadow: var(--shadow-lg);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hex) 0 0 / 42px 75px; opacity: .22;
  -webkit-mask-image: radial-gradient(70% 120% at 100% 0%, #000, transparent 70%); mask-image: radial-gradient(70% 120% at 100% 0%, #000, transparent 70%);
}
.hero::after { content: ""; position: absolute; inset: 0; z-index: -2; background: radial-gradient(60% 90% at 100% 0%, rgba(110, 214, 255, .18), transparent 70%); }
.hero-top { display: flex; flex-wrap: wrap; gap: 18px 26px; align-items: center; justify-content: space-between; }
.hero-id { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(1.4rem, 2.6vw, 2.1rem); }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--studio-muted); font-size: .9rem; margin-top: 4px; }
.hero .meta a { color: var(--led); text-decoration: none; }
.hero .meta .mono { color: #C7D3DE; }
.hero .actions .btn:not(.btn-led):not(.btn-danger) { background: rgba(214, 245, 255, .07); border-color: rgba(214, 245, 255, .18); color: #E8F7FC; }
.hero .actions .btn:not(.btn-led):not(.btn-danger):hover { border-color: rgba(214, 245, 255, .5); }
.hero .btn-danger { background: transparent; border-color: rgba(255, 140, 140, .35); color: #FFB4B4; }

/* pipeline: ลำดับสถานะจริงของงาน */
.pipeline { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; padding-top: 4px; }
.pipeline li { list-style: none; position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; font-size: .78rem; color: #6E7E8E; }
.pipeline li::before { content: ""; position: absolute; top: 7px; left: -50%; right: 50%; height: 2px; background: #26313D; }
.pipeline li:first-child::before { display: none; }
.pipeline li i { position: relative; width: 16px; height: 16px; border-radius: 50%; background: var(--studio); border: 2px solid #33414F; z-index: 1; }
.pipeline li.done { color: #AFC0CE; }
.pipeline li.done::before, .pipeline li.now::before { background: linear-gradient(90deg, rgba(214, 245, 255, .5), var(--led)); }
.pipeline li.done i { background: var(--led); border-color: var(--led); }
.pipeline li.now { color: #fff; font-weight: 600; }
.pipeline li.now i { background: var(--led); border-color: #fff; box-shadow: 0 0 0 5px rgba(214, 245, 255, .14), 0 0 16px 3px var(--led-glow); animation: led 2.4s ease-in-out infinite; }
@keyframes led { 50% { box-shadow: 0 0 0 8px rgba(214, 245, 255, .06), 0 0 22px 5px var(--led-glow); } }
.pipeline.is-cancelled li { opacity: .35; }
@media (max-width: 640px) {
  .pipeline li span { display: none; }
  .pipeline li.now span { display: block; position: absolute; top: 22px; white-space: nowrap; }
  .pipeline { padding-bottom: 18px; }
}

/* =====================================================================
   STEPS + SHOT LIST (timeline)
   ===================================================================== */
.timeline { display: grid; gap: 0; }
.stage-block { display: grid; gap: 12px; padding-bottom: 8px; }
.step { position: relative; display: grid; gap: 12px; padding: 16px 18px 16px 52px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.step::before { content: ""; position: absolute; left: 24px; top: 18px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); }
.step.is-in_progress::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.step.is-done::before { border-color: var(--ok); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 9px no-repeat; }
.step.is-skipped { opacity: .55; }
.step-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.step-title { font: 600 1rem var(--f-display); }
.step-info { font-size: .86rem; color: var(--muted); white-space: pre-line; padding-left: 10px; border-left: 2px solid var(--line); }
.shots { display: grid; gap: 10px; }
.shot { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.shot > .angle { grid-row: span 2; }
.shot:not(:has(> .angle)) { grid-template-columns: minmax(0, 1fr); }
.shot-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; }
.shot-label { font-weight: 600; font-size: .93rem; }
.shot-label code { color: var(--accent); background: none; margin-right: 4px; }
.shot-guide { font-size: .82rem; color: var(--muted); }
.shot .thumbs { grid-column: 1 / -1; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { position: relative; width: 104px; height: 104px; border-radius: 12px; overflow: hidden; background: #D9E0E6; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.thumb:hover img { transform: scale(1.05); }
.thumb .vid { position: absolute; left: 6px; bottom: 6px; background: rgba(10, 14, 19, .75); color: #fff; font-size: .7rem; padding: 1px 7px; border-radius: 6px; }
.thumb .del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(10, 14, 19, .7); color: #fff; cursor: pointer; font-size: 15px; line-height: 26px; padding: 0; opacity: 0; transition: opacity .15s; }
.thumb:hover .del, .thumb .del:focus-visible { opacity: 1; }
@media (hover: none) { .thumb .del { opacity: 1; } }
.upload-btn { position: relative; width: 104px; height: 104px; border-radius: 12px; border: 1.5px dashed #9FB0C0; display: grid; place-items: center; align-content: center; gap: 4px; text-align: center; font-size: .78rem; font-weight: 600; color: var(--ink-2); cursor: pointer; background: var(--surface); padding: 8px; line-height: 1.3; transition: border-color .15s, background .15s, color .15s; }
.upload-btn .ico { width: 22px; height: 22px; color: var(--accent); }
.upload-btn:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.upload-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-btn.busy { color: var(--muted); cursor: progress; border-style: solid; background: linear-gradient(90deg, var(--surface), var(--accent-soft), var(--surface)) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.missing-list { margin: 6px 0 0; padding-left: 1.2em; font-size: .9rem; }

/* ---------- signature ---------- */
.sigpad { border: 1.5px dashed var(--line-2); border-radius: 12px; background: #fff; touch-action: none; width: 100%; height: 170px; display: block; }

/* ---------- stats ---------- */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 4px; box-shadow: var(--shadow); }
.stat .v { font: 700 1.7rem var(--f-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .k { font-size: .84rem; color: var(--muted); }

/* ---------- pager ---------- */
.pager { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pager a, .pager span { padding: 5px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-size: .88rem; color: var(--ink-2); }
.pager .cur { background: var(--ink); color: #fff; border-color: var(--ink); }

/* =====================================================================
   LOGIN — เพดานไฟเต็มจอ
   ===================================================================== */
.login-stage { position: relative; isolation: isolate; min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; background: var(--studio); overflow: hidden; }
.login-stage::before { opacity: .8; -webkit-mask-image: radial-gradient(90% 70% at 50% 0%, #000 0%, rgba(0,0,0,.4) 45%, transparent 80%); mask-image: radial-gradient(90% 70% at 50% 0%, #000 0%, rgba(0,0,0,.4) 45%, transparent 80%); }
.login-stage::after { background: radial-gradient(70% 55% at 50% 0%, rgba(110, 214, 255, .4), transparent 70%), radial-gradient(60% 30% at 50% 100%, rgba(110, 214, 255, .08), transparent 70%); }
.auth-card {
  width: min(100%, 420px); display: grid; gap: 18px; padding: 28px;
  border-radius: 22px; background: rgba(18, 24, 33, .72); border: 1px solid rgba(214, 245, 255, .14);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--studio-ink);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
  animation: rise .6s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.auth-card .brand b { font-size: 1.6rem; }
.auth-card .field > span { color: #AFC0CE; }
.auth-card input, .auth-card select { background: rgba(10, 14, 19, .6); border-color: rgba(214, 245, 255, .16); color: #fff; }
.auth-card input:focus, .auth-card select:focus { background: rgba(10, 14, 19, .8); border-color: var(--led); box-shadow: 0 0 0 4px rgba(214, 245, 255, .12); }
.auth-card .flash-error { background: rgba(204, 59, 59, .16); border-color: rgba(255, 140, 140, .35); color: #FFC4C4; }
.auth-card .flash-success { background: rgba(23, 137, 90, .18); border-color: rgba(120, 220, 170, .35); color: #BDF0D6; }
.auth-card .empty { background: transparent; border-color: rgba(214, 245, 255, .2); color: var(--studio-muted); }
.auth-card .muted { color: var(--studio-muted); }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(10, 14, 19, .6); border: 1px solid rgba(214, 245, 255, .1); }
.tabs a { flex: 1; text-align: center; padding: 8px; border-radius: 9px; text-decoration: none; color: var(--studio-muted); font-weight: 500; }
.tabs a.on { background: rgba(214, 245, 255, .12); color: #fff; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pinpad button { font: 600 1.4rem var(--f-display); padding: 14px 0; border-radius: 14px; border: 1px solid rgba(214, 245, 255, .14); background: rgba(214, 245, 255, .05); color: #fff; cursor: pointer; transition: background .12s; }
.pinpad button:active { background: rgba(214, 245, 255, .18); }
.pinpad button[type=submit] { background: var(--led); color: var(--studio); border-color: var(--led); box-shadow: 0 8px 24px -8px var(--led-glow); }
.pin-dots { display: flex; justify-content: center; gap: 12px; min-height: 18px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(214, 245, 255, .5); transition: background .12s, box-shadow .12s; }
.pin-dots i.on { background: var(--led); border-color: var(--led); box-shadow: 0 0 10px var(--led-glow); }
.error-card { color: var(--studio-ink); }
.error-card .btn:not(.btn-led) { background: rgba(214, 245, 255, .07); border-color: rgba(214, 245, 255, .18); color: #E8F7FC; }

/* =====================================================================
   TECH (มือถือ)
   ===================================================================== */
body.tech { background: var(--canvas); }
.techbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--studio); color: #fff; isolation: isolate; overflow: hidden; }
.techbar::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hex) 0 0 / 34px 61px; opacity: .25; -webkit-mask-image: linear-gradient(90deg, #000, transparent 70%); mask-image: linear-gradient(90deg, #000, transparent 70%); }
.techbar .brand b { font-size: 1.05rem; }
.techbar .spacer { flex: 1; }
.techbar a.link { color: var(--led); font-size: .85rem; text-decoration: none; }
body.tech .content { max-width: 720px; margin: 0 auto; padding: 16px 14px 110px; }
.jobtile { display: grid; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.jobtile.mine { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink), var(--shadow); }
.jobtile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tech-hero { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 12px; justify-items: start; padding: 20px; border-radius: 18px; background: var(--studio); color: var(--studio-ink); }
.tech-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hex) 0 0 / 34px 61px; opacity: .22; -webkit-mask-image: radial-gradient(90% 120% at 100% 0%, #000, transparent 70%); mask-image: radial-gradient(90% 120% at 100% 0%, #000, transparent 70%); }
.tech-hero p { color: var(--studio-muted); }
.tech-hero a { color: var(--led); text-decoration: none; font-size: .88rem; }
.sticky-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, transparent, var(--canvas) 35%); display: flex; justify-content: center; }
.sticky-actions form { width: min(100%, 692px); }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(5, 8, 11, .94); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.lightbox img, .lightbox video { max-width: 100%; max-height: 88vh; border-radius: 12px; }
.lightbox button { position: absolute; top: 14px; right: 14px; background: var(--led); color: var(--studio); border: 0; border-radius: 99px; padding: 7px 16px; font: 600 .9rem var(--f-body); cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* เลยเวลานัดบนแถบสตูดิโอ */
.hero .time.is-late { color: #FFC56B; font-weight: 600; }
.shot > .angle { width: 54px; height: 54px; border-radius: 12px; }
.shot > .angle svg { width: 50px; height: 50px; }

/* =====================================================================
   เฟส 2 — การจอง
   ===================================================================== */
.st-pending { background: var(--warn-soft); color: var(--warn); border-color: #F3D9A8; }
.st-confirmed { background: var(--accent-soft); color: var(--accent); border-color: #BCE3F0; }
.st-checked_in { background: var(--sky-soft); color: var(--sky); border-color: #CADAF8; }
.st-completed { background: var(--ok-soft); color: var(--ok); border-color: #BFE6D2; }
.st-no_show { background: var(--bad-soft); color: var(--bad); border-color: #F5C6C6; }

/* ---------- นัดวันนี้บนกระดานงาน ---------- */
.upcoming { display: grid; gap: 10px; }
.upcoming h3 { display: flex; align-items: center; gap: 8px; font: 600 .9rem var(--f-body); color: var(--ink-2); }
.upcoming h3 .count { font: 600 .78rem var(--f-mono); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 0 9px; }
.upcoming-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 300px); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.up-card { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.up-card.is-late { border-color: #F3D9A8; box-shadow: 0 0 0 3px rgba(184, 106, 0, .12), var(--shadow); }
.up-card > span { white-space: normal; overflow-wrap: anywhere; }
.up-time { font: 700 1.3rem var(--f-display); font-variant-numeric: tabular-nums; }

/* ---------- ปฏิทินคิว ---------- */
.cal-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.cal { display: grid; grid-template-columns: 58px repeat(var(--cols), minmax(170px, 1fr)); min-width: calc(58px + var(--cols) * 170px); }
.cal-corner, .cal-head { position: sticky; top: 0; z-index: 3; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-head { display: grid; padding: 10px 12px; border-left: 1px solid var(--line); line-height: 1.3; }
.cal-head small { color: var(--muted); font-size: .76rem; }
.cal-times { position: relative; }
.cal-times span { position: absolute; right: 8px; transform: translateY(-50%); font: 500 .72rem var(--f-mono); color: var(--muted); }
.cal-times span:first-child { transform: none; }
.cal-col { position: relative; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(180deg, var(--line) 0 1px, transparent 1px var(--hour)); }
.cal-block { position: absolute; left: 6px; right: 6px; display: grid; align-content: start; gap: 1px; padding: 6px 9px; border-radius: 10px; overflow: hidden;
  font-size: .78rem; line-height: 1.35; text-decoration: none; color: var(--ink); border: 1px solid; border-left-width: 4px; box-shadow: 0 2px 8px -4px rgba(13, 19, 26, .25); transition: transform .12s, box-shadow .12s; }
.cal-block:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); z-index: 2; }
.cal-block b { font: 700 .92rem var(--f-display); }
.cal-block small { color: var(--muted); }
.cal-block .cal-time { font: 500 .7rem var(--f-mono); color: var(--muted); }
.cal-block.st-confirmed { background: #F2FAFD; border-color: #BCE3F0; border-left-color: var(--accent); }
.cal-block.st-pending { background: #FFF8EC; border-color: #F3D9A8; border-left-color: var(--warn); }
.cal-block.st-checked_in { background: #F3F7FE; border-color: #CADAF8; border-left-color: var(--sky); }
.cal-block.st-completed { background: #F2FAF6; border-color: #BFE6D2; border-left-color: var(--ok); opacity: .75; }
.cal-closed { position: absolute; left: 0; right: 0; display: grid; place-items: center; font-size: .78rem; color: var(--muted);
  background: repeating-linear-gradient(135deg, #EEF1F4 0 8px, #F7F9FB 8px 16px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 2; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }

/* ---------- บริการ & ราคา ---------- */
.svc-row .rowlink { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.svc-row .rowlink:hover { color: var(--accent); text-decoration-color: currentColor; }
.price-link { color: inherit; text-decoration: none; padding: 2px 4px; border-radius: 6px; }
.price-link:hover { background: var(--accent-soft); color: var(--accent); }
.svc-row:hover { background: #F7FBFD; }
#prices { scroll-margin-top: 80px; }
.svc-row td:first-child { min-width: 200px; }
.svc-row td:nth-last-child(4) { min-width: 110px; }

/* ---------- ปฏิทินคิวรายเดือน ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.seg a { padding: 7px 16px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; }
.seg a:hover { color: var(--ink); }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(13, 19, 26, .08), 0 0 0 1px var(--line); }
.mc-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mc-tabs a { display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 4px; padding: 12px 16px; border-radius: var(--r); text-decoration: none; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.mc-tabs a span { font-weight: 600; }
.mc-tabs a b { font: 700 1.35rem var(--f-display); font-variant-numeric: tabular-nums; color: var(--ink); }
.mc-tabs a small { color: var(--muted); font-size: .8rem; }
.mc-tabs a:hover { border-color: var(--line-2); transform: translateY(-1px); }
.mc-tabs a.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.mc-tabs a.on b { color: var(--accent); }
.mc-stats { display: grid; gap: 12px; grid-template-columns: repeat(4, 1fr); }
.mc-stats .stat { padding: 12px 16px; }
.mc-stats .stat .v { font-size: 1.35rem; }
.mc { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.mc-wd { background: var(--surface-2); padding: 8px 10px; font: 600 .78rem var(--f-body); color: var(--muted); text-align: center; }
.mc-wd.sun { color: var(--bad); }
.mc-wd.sat { color: var(--violet); }
.mc-pad { background: var(--surface-2); }
.mc-day { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 118px; padding: 8px 8px 14px; background: var(--surface); text-decoration: none; color: var(--ink); transition: background .12s; }
.mc-day:hover { background: #F7FBFD; }
.mc-day:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.mc-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.mc-num { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; font: 600 .9rem var(--f-display); font-variant-numeric: tabular-nums; }
.mc-day.is-today .mc-num { background: var(--accent); color: #fff; }
.mc-count { font: 700 .95rem var(--f-display); color: var(--accent); font-variant-numeric: tabular-nums; }
.mc-count small { font: 500 .72rem var(--f-body); color: var(--muted); }
.mc-list { display: grid; gap: 2px; }
.mc-item { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .74rem; line-height: 1.5; padding: 0 6px; border-radius: 5px; border-left: 3px solid currentColor; }
.mc-item time { font: 500 .7rem var(--f-mono); opacity: .8; }
.mc-item.st-confirmed { background: var(--accent-soft); color: #075F7A; }
.mc-item.st-pending { background: var(--warn-soft); color: #8A5000; }
.mc-item.st-checked_in { background: var(--sky-soft); color: var(--sky); }
.mc-item.st-completed { background: var(--ok-soft); color: var(--ok); }
.mc-more { font-size: .74rem; color: var(--muted); padding-left: 6px; }
.mc-off { font-size: .74rem; color: var(--muted); }
.mc-day.is-closed { background: repeating-linear-gradient(135deg, #F3F5F7 0 8px, #FAFBFC 8px 16px); }
.mc-day.is-past { background: #FAFBFC; }
.mc-day.is-past .mc-num, .mc-day.is-past .mc-list { opacity: .55; }
.mc-load { position: absolute; left: 8px; right: 8px; bottom: 6px; height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.mc-load i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.mc-load.lv-busy i { background: var(--warn); }
.mc-load.lv-full i { background: var(--bad); }
.mc-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: .82rem; color: var(--muted); }
.mc-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.mc-legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; border: 0; padding: 0; }
.mc-legend .dot.st-confirmed { background: var(--accent); }
.mc-legend .dot.st-pending { background: var(--warn); }
.mc-legend .dot.st-checked_in { background: var(--sky); }
.mc-legend .dot.st-completed { background: var(--ok); }
.mc-legend-bar .mc-load { position: static; flex: none; width: 40px; }
.mc-tabs .short { display: none; }
.mc-legend .t-busy { color: var(--warn); }
.mc-legend .t-full { color: var(--bad); }
@media (max-width: 960px) {
  .mc-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .mc-tabs { grid-template-columns: repeat(2, 1fr); }
  .mc-tabs a { padding: 10px 12px; }
  .mc-tabs .full { display: none; }
  .mc-tabs .short { display: inline; }
  .mc-day { min-height: 64px; padding: 4px 3px 12px; align-items: center; }
  .mc-top { flex-direction: column; gap: 2px; }
  .mc-count small, .mc-list, .mc-off { display: none; }
  .mc-load { left: 4px; right: 4px; bottom: 4px; height: 3px; }
  .mc-wd { padding: 6px 2px; }
}

/* ---------- หน้าลูกค้า (เว็บ + LIFF) ---------- */
body.public { background: var(--canvas); }
.pub-head { position: relative; isolation: isolate; overflow: hidden; background: var(--studio); color: #fff; }
.pub-head::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hex) 0 0 / 34px 61px; opacity: .4;
  -webkit-mask-image: radial-gradient(90% 140% at 50% 0%, #000, transparent 75%); mask-image: radial-gradient(90% 140% at 50% 0%, #000, transparent 75%); }
.pub-head::after { content: ""; position: absolute; inset: 0; z-index: -2; background: radial-gradient(70% 120% at 50% 0%, rgba(110, 214, 255, .25), transparent 70%); }
.pub-head-in { max-width: 680px; margin: 0 auto; padding: 16px; }
.pub-main { max-width: 680px; margin: 0 auto; padding: 18px 14px 140px; display: grid; gap: 16px; }
.pub-foot { max-width: 680px; margin: 0 auto; padding: 0 16px 120px; display: grid; gap: 2px; color: var(--muted); font-size: .84rem; text-align: center; }
.pub-hero { display: grid; gap: 6px; padding: 6px 2px; }
.pub-hero h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); }
.pub-hero p { color: var(--muted); }

.bk { display: grid; gap: 16px; }
.bk-sec h2 { display: flex; align-items: center; gap: 10px; justify-content: flex-start; }
.bk-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--studio); color: var(--led); font: 700 .85rem var(--f-display); box-shadow: 0 0 0 3px rgba(214, 245, 255, .9), 0 0 12px var(--led-glow); }
.bk-size { font-size: .85rem; color: var(--accent); font-weight: 500; }
.bk-svc b { font-weight: 600; }
.bk-svc small { font-size: .82rem; }
.bk-svc.is-off { opacity: .45; cursor: not-allowed; }
.size-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.size-chip { position: relative; display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); cursor: pointer; background: var(--surface); }
.size-chip input { position: absolute; opacity: 0; }
.size-chip b { font: 700 1.05rem var(--f-display); }
.size-chip small { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.size-chip:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface-2); }
.size-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.date-chips { display: grid; grid-auto-flow: column; grid-auto-columns: 74px; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; }
.date-chip { display: grid; justify-items: center; gap: 0; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; scroll-snap-align: start; font: inherit; color: var(--ink); transition: border-color .15s, background .15s; }
.date-chip small { font-size: .74rem; color: var(--muted); }
.date-chip b { font: 700 1.5rem/1.2 var(--f-display); }
.date-chip:hover { border-color: var(--ink-2); }
.date-chip.on { background: var(--studio); border-color: var(--studio); color: #fff; box-shadow: 0 8px 20px -10px rgba(5, 8, 11, .8), 0 0 0 3px rgba(214, 245, 255, .8); }
.date-chip.on small { color: var(--led); }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slots > p { grid-column: 1 / -1; }
.slot { display: grid; justify-items: center; gap: 0; padding: 9px 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, background .15s; }
.slot b { font: 700 1.1rem var(--f-display); font-variant-numeric: tabular-nums; }
.slot small { font-size: .7rem; color: var(--muted); }
.slot:hover { border-color: var(--ink-2); }
.slot.on { background: var(--led); border-color: var(--studio); box-shadow: inset 0 0 0 1px var(--studio), 0 6px 18px -8px var(--led-glow); }

.bk-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, transparent, rgba(10, 14, 19, .2) 30%); }
.bk-bar-in { max-width: 680px; margin: 0 auto; display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 10px 10px 18px; border-radius: 18px; background: rgba(10, 14, 19, .94); color: #fff; box-shadow: var(--shadow-lg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
body.app .bk-bar { left: var(--side); }
@media (max-width: 960px) { body.app .bk-bar { left: 0; } }
.bk-sum { display: grid; min-width: 0; }
.bk-sum b { font: 700 1.35rem var(--f-display); font-variant-numeric: tabular-nums; }
.bk-sum span { font-size: .8rem; color: #AFC0CE; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-bar .btn-led[disabled] { opacity: .35; box-shadow: none; }
.bk-bar .btn { flex: none; white-space: nowrap; }
@media (max-width: 420px) { .bk-bar .btn-lg { padding: 12px 14px; font-size: .95rem; } }

/* ใบนัดของลูกค้า */
.pub-ticket { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 14px; justify-items: start; padding: 22px; border-radius: var(--r-lg); background: var(--studio); color: var(--studio-ink); box-shadow: var(--shadow-lg); }
.pub-ticket::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hex) 0 0 / 34px 61px; opacity: .25; -webkit-mask-image: radial-gradient(90% 100% at 100% 0%, #000, transparent 70%); mask-image: radial-gradient(90% 100% at 100% 0%, #000, transparent 70%); }
.ticket-when { display: grid; }
.ticket-when small { color: var(--led); font-size: .95rem; }
.ticket-when b { font: 700 2.6rem/1.05 var(--f-display); color: #fff; }
.pub-ticket .kv dt { color: var(--studio-muted); }
.pub-ticket .kv dd { color: #fff; }
.pub-ticket.st-cancelled .ticket-when b { text-decoration: line-through; opacity: .6; }

pre.outbox { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--studio); color: #B9E8F5; font: 12px/1.5 var(--f-mono); white-space: pre-wrap; word-break: break-all; }

/* =====================================================================
   เฟส 3 — ฟิล์ม · โปรโมชั่น · แพ็กเกจ
   ===================================================================== */
.pub-head-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.pub-nav { display: flex; gap: 4px; }
.pub-nav a { padding: 6px 12px; border-radius: 99px; color: #B4C0CC; text-decoration: none; font-size: .9rem; }
.pub-nav a:hover { color: #fff; }
.pub-nav a[aria-current="page"] { background: rgba(214, 245, 255, .12); color: #fff; box-shadow: inset 0 0 0 1px rgba(214, 245, 255, .25); }

/* segmented control */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.seg button { flex: 1; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; font: 600 .95rem var(--f-body); color: var(--muted); cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--studio); color: #fff; box-shadow: 0 0 0 2px rgba(214, 245, 255, .7); }
.seg-sm button { padding: 6px 10px; font-size: .84rem; }
.add-tabs { display: grid; gap: 12px; margin-top: 10px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font: 500 .88rem var(--f-body); color: var(--ink-2); cursor: pointer; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* film cards */
.film-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.film-card { display: grid; gap: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.film-card.is-rec { border-color: var(--studio); box-shadow: 0 0 0 1px var(--studio), 0 0 0 4px rgba(214, 245, 255, .9), var(--shadow-lg); }
.film-top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; }
.tier { font: 600 .7rem var(--f-mono); letter-spacing: .16em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.tier-premium { background: #EEF6F9; color: var(--accent); border-color: #BCE3F0; }
.tier-flagship { background: var(--studio); color: var(--led); border-color: var(--studio); }
.film-name { font: 700 1.35rem/1.15 var(--f-display); }
.shades { display: flex; flex-wrap: wrap; gap: 6px; }
.shade { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 6px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font: 500 .82rem var(--f-body); cursor: pointer; color: var(--ink-2); }
.shade i { width: 18px; height: 18px; border-radius: 50%; background: rgba(13, 19, 26, var(--d, .5)); box-shadow: inset 0 0 0 1px rgba(13, 19, 26, .25); }
.shade[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); }
.specs { display: grid; gap: 7px; }
.specs .spec { display: grid; grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr) 3.4em; gap: 10px; align-items: center; font-size: .82rem; color: var(--ink-2); }
.specs .spec i { font-style: normal; color: var(--muted); cursor: help; }
.spec-bar { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.spec-bar b { display: block; height: 100%; border-radius: 99px; background: #9FB0C0; }
.spec-key { font-weight: 600; color: var(--ink); }
.spec-key .spec-bar { height: 10px; }
.spec-key .spec-bar b { background: linear-gradient(90deg, var(--accent), #35C2E5); box-shadow: 0 0 10px rgba(53, 194, 229, .5); }
.specs .v { text-align: right; font: 600 .82rem var(--f-mono); font-variant-numeric: tabular-nums; }
.film-hl { margin: 0; padding-left: 1.1em; font-size: .86rem; color: var(--ink-2); display: grid; gap: 2px; }
.film-media { display: grid; grid-auto-flow: column; grid-auto-columns: 92px; gap: 8px; overflow-x: auto; }
.film-media img { width: 92px; height: 68px; object-fit: cover; border-radius: 10px; display: block; }
.film-price { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.film-price > div { display: grid; }
.film-price b { font: 700 1.6rem/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.film-pos { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 6px; }
.pos-btn { display: grid; justify-items: center; gap: 0; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, background .15s; }
.pos-btn span { font-size: .78rem; color: var(--muted); }
.pos-btn b { font: 700 .95rem var(--f-display); font-variant-numeric: tabular-nums; }
.pos-btn:hover { border-color: var(--ink-2); }
.pos-btn[aria-pressed="true"] { background: var(--led); border-color: var(--studio); box-shadow: inset 0 0 0 1px var(--studio), 0 6px 16px -8px var(--led-glow); }
.pos-btn.is-ask { cursor: default; border-style: dashed; background: transparent; }
.pos-btn.is-ask small { font-size: .72rem; color: var(--muted); }
.pos-btn.is-ask:hover { border-color: var(--line-2); }
.pos-btn[aria-pressed="true"] span { color: var(--studio); }

/* bottom sheets */
.sheet { position: fixed; inset: 0; z-index: 60; display: grid; align-items: end; justify-items: center; background: rgba(5, 8, 11, .55); padding: 12px; animation: fade .15s; }
.sheet[hidden] { display: none; }
.sheet-card { width: min(100%, 560px); max-height: 88vh; overflow: auto; display: grid; gap: 14px; padding: 20px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-lg); animation: rise .25s cubic-bezier(.2, .8, .2, 1); }
.sheet-wide { width: min(100%, 860px); }
.sheet .icon-btn { color: var(--ink); }
.sheet .icon-btn:hover { background: var(--surface-2); }
.cmp-table th:first-child { color: var(--muted); font-weight: 500; white-space: nowrap; position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.cmp-table td { min-width: 120px; }
.cmp-table thead th { font-size: .86rem; color: var(--ink); background: var(--surface); }
.cmp-table td.best { color: var(--ok); font-weight: 700; background: var(--ok-soft); }

/* booking: quote + promos */
.quote-banner { border-color: var(--studio); box-shadow: 0 0 0 1px var(--studio), var(--shadow); }
.promo-strip { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--studio); color: #E8F7FC; text-decoration: none; font-size: .86rem; }
.promo-strip b { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 5px; background: var(--led); color: var(--studio); font-size: .72rem; }
.promo-strip em { font-style: normal; color: var(--led); margin-left: auto; }
.bk-sum s { font: 500 .85rem var(--f-body); color: #8593A3; margin-left: 6px; }
.bk-promo { color: var(--led) !important; }

/* public promotions */
.promo-card { position: relative; display: grid; gap: 10px; justify-items: start; padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.promo-card h2 { font-size: 1.35rem; }
.promo-tag { padding: 3px 10px; border-radius: 6px; background: var(--studio); color: var(--led); font: 700 .8rem var(--f-display); letter-spacing: .06em; }
.promo-terms { margin: 0; padding-left: 1.1em; font-size: .88rem; color: var(--ink-2); }
.size-prices { display: flex; flex-wrap: wrap; gap: 8px; }
.size-prices span { display: grid; justify-items: center; min-width: 74px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.size-prices small { color: var(--muted); font-size: .72rem; }
.size-prices b { font: 700 1rem var(--f-display); }

/* job: promotions box */
.promo-box { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2); }

/* admin tables with inputs */
.shade-table input, .shade-table select, .price-matrix input { min-height: 34px; padding: 5px 8px; font-size: .86rem; min-width: 70px; }
.price-matrix th { white-space: nowrap; }

/* =====================================================================
   PHASE 4 · สต็อก + รายงาน
   ===================================================================== */
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plain-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.plain-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.plain-list .num { margin-left: auto; }

/* ระดับสต็อก: ok / low / out */
.pill.lv-low { background: var(--warn-soft); color: var(--warn); border-color: #F3D9A8; }
.pill.lv-out { background: var(--bad-soft); color: var(--bad); border-color: #F5C6C6; }
.pill.lv-ok { background: var(--ok-soft); color: var(--ok); border-color: #BFE6D2; }
.lv-text-low { color: var(--warn); }
.lv-text-out { color: var(--bad); }
.stat.lv-stat-low { border-color: #F3D9A8; background: linear-gradient(180deg, var(--warn-soft), var(--surface) 70%); }
.stat.lv-stat-out { border-color: #F5C6C6; background: linear-gradient(180deg, var(--bad-soft), var(--surface) 70%); }
.stat small { font: 500 .9rem var(--f-body); color: var(--muted); letter-spacing: 0; }
.stat-link { text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.stat-link:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.stat-link.is-on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow); }
.stat.is-warn .v { color: var(--warn); }
.stat.is-bad .v { color: var(--bad); }

/* เกจระดับน้ำยา: แท่งเติม + ขีดจุดสั่งซื้อ */
.qty-cell { display: grid; gap: 5px; min-width: 170px; }
.gauge { position: relative; display: block; height: 8px; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.gauge i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, #5FC9EA, var(--accent)); }
.gauge b { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--ink-2); opacity: .55; }
.gauge.lv-low i { background: linear-gradient(90deg, #F5B342, var(--warn)); }
.gauge.lv-out i { background: var(--bad); }
.stock-tbl td { vertical-align: top; }
.w-gauge { min-width: 190px; }

/* คาดการณ์ของไม่พอ */
.forecast { border-color: #F5C6C6; background: linear-gradient(180deg, var(--bad-soft), var(--surface) 120px); }
.forecast h2 span { display: inline-flex; gap: 8px; align-items: center; color: var(--bad); }
.forecast-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.forecast-list li { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }

/* ม้วนฟิล์ม: วงม้วนที่เหลือ */
.roll-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.roll { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.roll.is-closed { opacity: .55; }
.roll-core { width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--accent) var(--left), var(--line) 0); display: grid; place-items: center; }
.roll-core::after { content: ""; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--line-2); }
.roll-core i { display: none; }
.roll .inline { margin-top: 6px; display: inline-block; }

.mv-receive, .mv-return { color: var(--ok); }
.mv-job_use, .mv-sale { color: var(--accent); }
.mv-waste { color: var(--bad); }
.mv-adjust { color: var(--violet); }

.po-draft { background: #F0F2F5; color: #4F5D6B; }
.po-ordered { background: var(--sky-soft); color: var(--sky); border-color: #CADAF8; }
.po-partial { background: var(--warn-soft); color: var(--warn); border-color: #F3D9A8; }
.po-received { background: var(--ok-soft); color: var(--ok); border-color: #BFE6D2; }
.po-cancelled { background: var(--bad-soft); color: var(--bad); border-color: #F5C6C6; }
.po-text { margin: 0 0 12px; padding: 14px; border-radius: 12px; background: var(--studio); color: var(--studio-ink); font: 400 .88rem/1.7 var(--f-body); white-space: pre-wrap; word-break: break-word; }

.bom-tbl select { min-width: 220px; }
.roll-use { padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2); }
.profit-kv { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.profit-kv dd { text-align: right; font-variant-numeric: tabular-nums; }

/* แถบเตือนบนกระดานงาน */
.stock-alert { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r); background: var(--studio); color: var(--studio-ink); text-decoration: none; box-shadow: var(--shadow); border: 1px solid rgba(255, 141, 141, .35); }
.stock-alert .ico { color: #FF9C9C; flex: none; }
.stock-alert b { color: #fff; }
.stock-alert .go { margin-left: auto; color: var(--led); white-space: nowrap; }

/* รายงาน */
.report-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); }
.report-tabs a { padding: 9px 14px; margin-bottom: -1px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.report-tabs a:hover { color: var(--ink); }
.report-tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.period-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.period-bar .chip { text-decoration: none; }
.period-bar input[type="date"] { width: auto; flex: 1 1 130px; min-width: 0; }
.period-bar > .row { flex-wrap: nowrap; min-width: 0; max-width: 100%; }
@media (max-width: 640px) { .period-bar > .row { flex-wrap: wrap; } .period-bar input[type="date"] { flex: 1 1 140px; } }
.period-label { font: 600 .95rem var(--f-display); }

.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.kpi { display: grid; gap: 4px; align-content: start; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.kpi .k { font-size: .84rem; color: var(--muted); }
.kpi .v { font: 700 1.8rem/1.1 var(--f-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .v small { font: 500 .9rem var(--f-body); color: var(--muted); }
.kpi .s { font-size: .8rem; color: var(--muted); }
.kpi-hero { background: var(--studio); border-color: var(--studio); color: var(--studio-ink); }
.kpi-hero .k, .kpi-hero .s { color: var(--studio-muted); }
.kpi-hero .v { color: #fff; text-shadow: 0 0 22px var(--led-glow); }

/* SIGNATURE: กราฟยอดขายเป็นแท่งไฟ LED แบบเพดานสตูดิโอ */
.chart-studio { background: var(--studio) var(--hex); background-size: 28px 50px; border-color: var(--studio); color: var(--studio-ink); position: relative; overflow: hidden; }
.chart-studio::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 14, 19, .82), rgba(10, 14, 19, .96)); pointer-events: none; }
.chart-studio > * { position: relative; }
.chart-studio h2 .small { color: var(--studio-muted); font-weight: 500; }
.chart-empty { color: var(--studio-muted); padding: 40px 0; text-align: center; }
.led-chart { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 64px)); justify-content: space-evenly; gap: clamp(2px, .5vw, 6px); align-items: end; height: 220px; padding-top: 8px; }
.led-col { display: grid; grid-template-rows: 1fr auto; gap: 6px; height: 100%; min-width: 0; }
.led-col i { align-self: end; width: 100%; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, #F2FCFF, var(--led) 30%, #6ED6FF); box-shadow: 0 0 14px var(--led-glow), 0 0 2px #fff inset; opacity: .88; transition: opacity .15s; transform-origin: bottom; animation: led-rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.led-col:hover i { opacity: 1; box-shadow: 0 0 22px rgba(160, 230, 255, .8); }
.led-col.is-today i { background: linear-gradient(180deg, #fff, #FFE9A8); box-shadow: 0 0 18px rgba(255, 220, 130, .6); }
.led-col span { font: 500 .68rem var(--f-mono); color: var(--studio-muted); text-align: center; white-space: nowrap; overflow: hidden; height: 1.2em; }
@keyframes led-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .led-col i { animation: none; } }

.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: .9rem; }
.hbar .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .b { height: 10px; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.hbar .b i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #5FC9EA, var(--accent)); }
.hbar.util .b i { background: linear-gradient(90deg, #9C87E6, var(--violet)); }
.rank { margin: 0; padding-left: 1.4em; display: grid; gap: 7px; }
.rank li { padding-left: 4px; }
.rank li span:first-child { margin-right: 6px; }
.rank li b { float: right; }
@media (max-width: 640px) {
  .led-chart { height: 160px; }
  .hbar { grid-template-columns: 1fr auto; }
  .hbar .b { grid-column: 1 / -1; grid-row: 2; }
}

/* =====================================================================
   PHASE 5 · คลังคอนเทนต์ + แกลเลอรี + รับประกัน + รีวิว
   ===================================================================== */

/* SIGNATURE: สไลด์เทียบก่อน-หลัง มุมเดียวกัน */
.ba { position: relative; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r); background: var(--studio); box-shadow: var(--shadow); touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--led); box-shadow: 0 0 12px var(--led-glow), 0 0 2px #fff; pointer-events: none; }
.ba-handle::after { content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--studio); color: var(--led); font: 700 .9rem var(--f-mono); letter-spacing: .1em; border: 2px solid var(--led); box-shadow: 0 0 18px var(--led-glow); }
.ba-tag { position: absolute; top: 10px; padding: 2px 10px; border-radius: 99px; font: 600 .74rem var(--f-mono); letter-spacing: .08em; background: rgba(10, 14, 19, .72); color: #fff; backdrop-filter: blur(4px); pointer-events: none; }
.ba-b { left: 10px; }
.ba-a { right: 10px; background: var(--led); color: var(--studio); }
.ba-range { position: absolute; inset: auto 0 0 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.ba-range:focus-visible + * { outline: none; }
.ba:has(.ba-range:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.ba figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 8px; background: linear-gradient(transparent, rgba(10, 14, 19, .8)); color: #fff; font-size: .84rem; pointer-events: none; }
.ba-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

/* คลังคอนเทนต์ */
.content-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.content-card { display: grid; grid-template-rows: auto 1fr; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s, border-color .15s; }
.content-card:hover { transform: translateY(-2px); border-color: var(--ink-2); }
.content-card.is-blocked { opacity: .6; }
.cc-img { position: relative; aspect-ratio: 4 / 3; background: var(--studio) var(--hex); background-size: 28px 50px; }
.cc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-img .pill { position: absolute; left: 8px; top: 8px; }
.cc-body { display: grid; gap: 4px; padding: 12px 14px; }
.cc-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.cc-meta .ico { width: 14px; height: 14px; vertical-align: -2px; }
.cc-st { margin-left: auto; font-weight: 600; }
.cs-ready, .cs-none { color: var(--warn); }
.cs-exported { color: var(--sky); }
.cs-published { color: var(--ok); }

.media-wall { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.mw-item { display: grid; gap: 6px; align-content: start; scroll-margin-top: 80px; }
.mw-item img, .mw-item video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--studio); display: block; }
.mw-cap { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.role-before { color: var(--sky); }
.role-after { color: var(--ok); }
.role-highlight { color: var(--violet); }
.pick-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.pick { position: relative; display: grid; gap: 4px; padding: 6px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); cursor: pointer; }
.pick:has(> input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pick > input[type="checkbox"] { position: absolute; top: 10px; left: 10px; width: 20px; height: 20px; }
.pick img, .pick-video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: grid; place-items: center; background: var(--studio); color: var(--led); }
.pick.needs-blur::after { content: "ต้องเบลอ"; position: absolute; top: 10px; right: 10px; padding: 0 6px; border-radius: 6px; background: var(--warn); color: #fff; font-size: .7rem; font-weight: 600; }
.pick-cover { font-size: .78rem; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.blur-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.blur-row img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }
.blur-row > span { flex: 1 1 120px; }
.blur-row input[type="file"] { flex: 1 1 200px; font-size: .8rem; min-height: 0; padding: 4px; }
#caption-text { font: 400 .92rem/1.7 var(--f-body); }

/* ดาว */
.stars-static { color: #F5B342; letter-spacing: .08em; }
.stars-static span { color: var(--line-2); }
.stars { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; border: 0; padding: 0; margin: 0; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 2.4rem; line-height: 1; color: var(--line-2); cursor: pointer; transition: color .1s, transform .1s; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #F5B342; }
.stars input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.stars label:active { transform: scale(.9); }
.review-card { scroll-margin-top: 20px; }
.review-row.is-low { border-color: #F5C6C6; }
.rr-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.quote { margin: 0; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; }
.quote p { margin: 0; }
.rating-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.rating-line b { font: 700 1.6rem var(--f-display); }

/* หน้าติดตามงานของลูกค้า */
.track-head { justify-items: stretch; }
.track-head > .plate { justify-self: start; }
a.chip { text-decoration: none; }
.track-car { font-size: 1.4rem; color: #fff; }
.track-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.track-steps li { display: grid; gap: 6px; justify-items: center; text-align: center; font-size: .66rem; color: var(--studio-muted); }
.track-steps i { width: 100%; height: 4px; border-radius: 4px; background: rgba(214, 245, 255, .15); }
.track-steps li.done i { background: var(--led); opacity: .6; }
.track-steps li.now i { background: var(--led); box-shadow: 0 0 10px var(--led-glow); }
.track-steps li.now { color: #fff; font-weight: 600; }
.track-now { color: #fff; font-weight: 500; }
.pub-media { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); }
.pub-media img, .pub-media video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; display: block; background: var(--studio); }
.w-mini { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.w-mini > span:nth-child(2) { display: grid; }
.w-mini .ico { color: var(--accent); width: 26px; height: 26px; }
.st-w-active .pill, .pill.w-st-active { background: var(--ok-soft); color: var(--ok); border-color: #BFE6D2; }
.st-w-claimed .pill, .pill.w-st-claimed { background: var(--violet-soft); color: var(--violet); border-color: #D9CEF7; }
.st-w-void .pill, .pill.w-st-void { background: var(--bad-soft); color: var(--bad); border-color: #F5C6C6; }
.st-w-expired { opacity: .7; }

/* SIGNATURE: บัตรรับประกันแบบใบรับรอง */
.w-card { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 14px; padding: 24px 22px 20px; border-radius: 22px; background: linear-gradient(160deg, #121821, var(--studio) 60%); color: var(--studio-ink); box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(214, 245, 255, .14); }
.w-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hex) 0 0 / 30px 54px; opacity: .22; -webkit-mask-image: linear-gradient(200deg, #000, transparent 65%); mask-image: linear-gradient(200deg, #000, transparent 65%); }
.w-card::after { content: ""; position: absolute; inset: auto -40% -60% auto; z-index: -1; width: 80%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(var(--led-glow), transparent 70%); opacity: .5; }
.w-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.w-shop { display: inline-flex; gap: 8px; align-items: center; font: 700 1rem var(--f-display); color: #fff; }
.w-shop .ico { color: var(--led); }
.w-no { color: var(--led); }
.w-eyebrow { font: 500 .72rem var(--f-mono); letter-spacing: .16em; color: var(--studio-muted); }
.w-title { font-size: clamp(1.4rem, 5.5vw, 1.9rem); color: #fff; line-height: 1.25; }
.w-car { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.w-span { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.w-span div { display: grid; padding: 10px 12px; border-radius: 12px; background: rgba(214, 245, 255, .06); border: 1px solid rgba(214, 245, 255, .1); }
.w-span small { color: var(--studio-muted); font-size: .74rem; }
.w-span b { color: #fff; font-family: var(--f-display); }
.w-meter { height: 6px; border-radius: 6px; background: rgba(214, 245, 255, .12); overflow: hidden; }
.w-meter i { display: block; height: 100%; background: linear-gradient(90deg, #6ED6FF, var(--led)); box-shadow: 0 0 10px var(--led-glow); }
.w-state { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.w-state b { color: #fff; }
.w-stamp { padding: 4px 12px; border-radius: 8px; border: 2px solid var(--led); color: var(--led); font: 700 .86rem var(--f-display); letter-spacing: .06em; transform: rotate(-3deg); }
.st-w-expired .w-stamp, .st-w-void .w-stamp { border-color: #FF9C9C; color: #FF9C9C; }
.st-w-expired .w-meter i, .st-w-void .w-meter i { background: #6B7785; box-shadow: none; }
.w-foot { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding-top: 14px; border-top: 1px dashed rgba(214, 245, 255, .2); color: var(--studio-muted); }
.w-foot b { color: var(--studio-ink); }
.w-qr { width: 92px; height: 92px; padding: 6px; border-radius: 10px; background: #fff; }
.w-qr canvas, .w-qr img { width: 100% !important; height: 100% !important; }
@media print {
  body.public .pub-head, body.public .pub-foot, .no-print { display: none !important; }
  .w-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; box-shadow: none; }
}

/* แกลเลอรีสาธารณะ */
.g-card { display: grid; gap: 0; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.g-card .ba { border-radius: 0; box-shadow: none; }
.g-cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.g-body { display: grid; gap: 6px; padding: 14px 16px 16px; }
.g-body h2 { font-size: 1.15rem; }
.g-body h2 a { color: inherit; text-decoration: none; }
.g-review { font-size: .9rem; }
.pub-nav { overflow-x: auto; scrollbar-width: none; max-width: 100%; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 24px; }
.pub-nav::-webkit-scrollbar { display: none; }
.pub-nav a { white-space: nowrap; }

/* ติดตามลูกค้า */
.fu-row { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.fu-row.is-due { border-left: 4px solid var(--warn); }
.fu-main { display: flex; gap: 12px; align-items: flex-start; }
.fu-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fu-act form.row input { min-height: 34px; padding: 5px 10px; font-size: .86rem; }

/* =====================================================================
   บัตรสมาชิก + มัดจำการจอง
   ===================================================================== */
.pill.cr-active { background: var(--ok-soft); color: var(--ok); border-color: #BFE6D2; }
.pill.cr-pending { background: var(--warn-soft); color: var(--warn); border-color: #F3D9A8; }
.pill.cr-expired, .pill.cr-cancelled { background: var(--bad-soft); color: var(--bad); border-color: #F5C6C6; }

/* บัตรสมาชิก: การ์ดแบบบัตรจริง จุดตราประทับตามจำนวนครั้ง */
.member-card { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 8px; align-content: start; padding: 22px; border-radius: 20px; color: var(--studio-ink); background: linear-gradient(145deg, #16202B, var(--studio) 70%); box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(214, 245, 255, .14); }
.member-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hex) 0 0 / 30px 54px; opacity: .18; -webkit-mask-image: linear-gradient(120deg, #000, transparent 60%); mask-image: linear-gradient(120deg, #000, transparent 60%); }
.member-card .kv dt { color: var(--studio-muted); }
.member-card .kv dd, .member-card .kv a { color: #fff; }
.mc-type { font: 500 .74rem var(--f-mono); letter-spacing: .16em; color: var(--led); }
.mc-left { font: 700 2.4rem/1 var(--f-display); color: #fff; text-shadow: 0 0 22px var(--led-glow); }
.mc-of { font-size: .84rem; color: var(--studio-muted); }
.mc-dots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin: 6px 0 4px; max-width: 320px; }
.mc-dots i { aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--led); box-shadow: 0 0 8px var(--led-glow); }
.mc-dots i.used { border-color: rgba(214, 245, 255, .2); box-shadow: none; background: rgba(214, 245, 255, .08); }
.member-card.cr-expired, .member-card.cr-cancelled { filter: grayscale(.8); opacity: .8; }

.credit-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.credit-chip { display: grid; gap: 2px; min-width: 180px; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: var(--studio-ink); background: var(--studio); box-shadow: var(--shadow); }
.credit-chip b { font: 700 1.3rem var(--f-display); color: #fff; }
.credit-chip .muted { color: var(--studio-muted); }
.credit-chip:not(.cr-active) { opacity: .55; }
.credit-use { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.credit-use select { min-height: 32px; padding: 4px 8px; font-size: .84rem; width: auto; }
.credit-use .ico { width: 14px; height: 14px; }
.plan-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.plan-row.is-off { opacity: .55; }
.plan-row .num { display: grid; justify-items: end; gap: 2px; }
.seg-opt { flex: 1; display: flex; gap: 6px; justify-content: center; align-items: center; padding: 6px 10px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: .86rem; color: var(--muted); }
.seg-opt:has(input:checked) { background: var(--studio); color: #fff; }
.seg-opt input { accent-color: var(--led); }

/* มัดจำ */
.deposit-card { scroll-margin-top: 20px; }
.deposit-card.dep-slip_uploaded { border-color: #F3D9A8; box-shadow: 0 0 0 1px #F3D9A8, var(--shadow); }
.pill.dep-pill-awaiting, .pill.dep-pill-slip_uploaded { background: var(--warn-soft); color: var(--warn); border-color: #F3D9A8; }
.pill.dep-pill-paid, .pill.dep-pill-applied, .pill.dep-pill-credited { background: var(--ok-soft); color: var(--ok); border-color: #BFE6D2; }
.pill.dep-pill-refunded, .pill.dep-pill-forfeited { background: var(--violet-soft); color: var(--violet); border-color: #D9CEF7; }
.slip-thumb { display: inline-grid; gap: 4px; justify-items: start; text-decoration: none; color: var(--muted); }
.slip-thumb img { max-width: 220px; max-height: 300px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.settle { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--warn-soft); border: 1px solid #F3D9A8; }
.deposit-pub { border-color: var(--studio); box-shadow: 0 0 0 1px var(--studio), var(--shadow); scroll-margin-top: 20px; }
.qr-box { display: grid; justify-items: center; gap: 8px; padding: 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.slip-alert { border-color: rgba(245, 179, 66, .5); }
.slip-alert .ico { color: #F5B342; }
.plan-card .promo-tag { background: var(--led); color: var(--studio); }

/* ---------- เช็กสถานะรถ / ประวัติการแก้ไข / บัญชีของฉัน ---------- */
.tr-mini .ico { color: var(--muted); }
.tr-mini.is-live { border-color: var(--accent); box-shadow: var(--shadow), inset 3px 0 0 var(--accent); }
.tr-mini.is-live .ico { color: var(--accent); }
.tr-mini.is-live .pill { background: var(--accent-soft, var(--surface)); color: var(--accent); }
.auth-alt { justify-self: center; color: var(--studio-muted); font-size: .9rem; text-align: center; }
a.auth-alt:hover { color: #fff; }
.auth-note { margin: 0; color: var(--studio-muted); font-size: .92rem; }
.auth-note b { color: #fff; }
.auth-card .flash-info { background: rgba(110, 214, 255, .12); border-color: rgba(110, 214, 255, .3); color: #CDEFFC; }
.auth-card .btn-lg { justify-content: center; }
.link-code { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft); border: 1px dashed var(--accent); }
.link-code b { font-size: 1.25rem; letter-spacing: .02em; color: #075F7A; }
.me-link { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 0; color: inherit; text-decoration: none; border-radius: 10px; }
.me-link:hover b { text-decoration: underline; }
.audit-filter .fields { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.audit-list { display: grid; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.audit-row { display: grid; grid-template-columns: 84px 1fr 150px; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: start; }
.audit-row:first-child { border-top: 0; }
.audit-row.is-warn { background: var(--bad-soft); }
.au-when { display: grid; line-height: 1.25; }
.au-when b { font: 600 1rem var(--f-mono, monospace); }
.au-when span { font-size: .78rem; color: var(--muted); }
.au-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.au-hist { display: inline-flex; color: var(--muted); }
.au-hist .ico { width: 16px; height: 16px; }
.au-hist:hover { color: var(--accent); }
.au-diff { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 8px 0 0; font-size: .86rem; }
.au-diff dt { color: var(--muted); }
.au-diff dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.au-diff del { color: var(--bad); text-decoration-thickness: 1px; }
.au-diff ins { color: var(--ok); text-decoration: none; font-weight: 600; }
.au-who { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: .86rem; justify-content: flex-end; text-align: right; }
.au-who small { flex-basis: 100%; }
@media (max-width: 720px) {
  .audit-row { grid-template-columns: 1fr; gap: 6px; }
  .au-when { display: flex; gap: 8px; align-items: baseline; }
  .au-who { justify-content: flex-start; text-align: left; }
  .au-who small { flex-basis: auto; }
}
.rm-preview { display: block; width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--line); margin-bottom: 12px; }

/* ---------- กล่อง "ตอนนี้ต้องทำอะไร" ของใบงาน ---------- */
.guide { position: relative; display: grid; gap: 12px; margin: 0 0 18px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow), inset 4px 0 0 var(--accent); }
.guide.is-done { box-shadow: var(--shadow), inset 4px 0 0 var(--ok); }
.guide h2 { font-size: 1.3rem; }
.guide-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.guide-dots { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.guide-dots li { width: 22px; height: 6px; border-radius: 3px; background: var(--line-2); }
.guide-dots li.done { background: var(--ok); }
.guide-dots li.now { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.guide-step { font: 600 .78rem var(--f-mono); letter-spacing: .06em; color: var(--accent); }
.guide-who { display: inline-flex; gap: 6px; align-items: center; font-size: .86rem; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; }
.guide-who .ico { width: 15px; height: 15px; }
.guide-todo { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.guide-todo li { display: flex; gap: 10px; align-items: flex-start; font-size: .98rem; }
.guide-todo .tick { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px; border: 2px solid var(--line-2); background: var(--surface); }
.guide-todo .tick .ico { width: 14px; height: 14px; stroke-width: 3; }
.guide-todo li.is-done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.guide-todo li.is-done > span:not(.tick) { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.guide-todo li.is-optional .tick { border-style: dashed; }
.guide-todo li.is-optional { color: var(--muted); }
.guide-todo a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.guide-todo a:hover { text-decoration-color: var(--accent); }
.guide-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: var(--r-sm); font-size: .92rem; }
.guide-note .ico { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.guide-note.is-block { background: var(--warn-soft); color: #7A4600; }
.guide-note.is-wait { background: var(--sky-soft); color: #1D4C9E; }
.guide-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.guide-actions .btn.is-blocked { opacity: .55; }
.guide-actions.sticky-actions { gap: 8px; }
.guide-actions.sticky-actions > form:first-child, .guide-actions.sticky-actions > a:first-child { width: min(100%, 692px); }
.guide-actions.sticky-actions > form:first-child .btn, .guide-actions.sticky-actions > a:first-child { width: 100%; justify-content: center; }
.guide-then { margin: 0; font-size: .9rem; color: var(--muted); }
.guide-then span { font: 600 .72rem var(--f-mono); letter-spacing: .12em; color: var(--accent); margin-right: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- ฟอร์มแบบเลือก (ลดการพิมพ์) ---------- */
.brand-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 8px; }
.brand-chip { font: 500 .9rem var(--f-body); padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 38px; }
.brand-chip:hover { border-color: var(--accent); }
.brand-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.brand-chip-more { font-size: .8rem; color: var(--muted); margin-left: 4px; }
.color-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.color-field legend { padding: 0; margin-bottom: 6px; font-size: .86rem; font-weight: 500; color: var(--ink-2); }
.color-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.color-chip { position: relative; display: inline-flex; gap: 7px; align-items: center; padding: 6px 12px 6px 7px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: .9rem; min-height: 38px; }
.color-chip input { position: absolute; opacity: 0; pointer-events: none; }
.color-chip i { width: 22px; height: 22px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(13, 19, 26, .18); }
.color-chip i.sw-other { background: conic-gradient(#B8312F, #E5B72F, #3D7A4F, #5AA9E6, #1F3B73, #B8312F); }
.color-chip:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); font-weight: 600; }
.color-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.color-field input[type=text] { margin-top: 8px; }
.note-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.note-chip { font: 500 .85rem var(--f-body); padding: 6px 11px; border-radius: 99px; border: 1px dashed var(--line-2); background: var(--surface-2); color: var(--ink-2); cursor: pointer; }
.note-chip:hover { border-color: var(--accent); color: var(--accent); }
.remember-note { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 0 0 10px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--ok-soft); color: #0F5E3D; font-size: .88rem; }
.remember-note button { border: 0; background: none; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.bk-todo { font-size: .82rem; color: var(--muted); }
.bk-sum .bk-todo b, .bk-todo b { font: 600 .82rem var(--f-body); color: #F5B85C; }
.link-btn { justify-self: start; align-self: end; border: 0; background: none; padding: 4px 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: 500 .86rem var(--f-body); }

/* ---------- แถบ "← กลับ" + "วิธีใช้หน้านี้" บนสุดของทุกหน้า ---------- */
.backbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: -6px 0 16px; }
.backbar-back, .backbar-help { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 16px 7px 10px; border-radius: 99px; font-size: .92rem; text-decoration: none; transition: border-color .15s, color .15s, background .15s; }
.backbar-back { background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2); box-shadow: 0 1px 2px rgba(13, 19, 26, .06); }
.backbar-back .ico { width: 20px; height: 20px; color: var(--accent); }
.backbar-back b { margin-left: 5px; color: var(--ink); font-weight: 600; }
.backbar-back:hover { border-color: var(--accent); }
.backbar-help { background: var(--accent-soft); border: 1px solid #BFE5F1; color: #075F7A; font-weight: 600; }
.backbar-help .ico { width: 18px; height: 18px; }
.backbar-help:hover { background: #D3EEF7; }
body.tech .backbar { margin: 0 0 12px; }

/* ---------- คู่มือ: diagram + ถ้าเจอแบบนี้ ---------- */
.dgm-scroll { overflow-x: auto; margin: 10px -4px 0; padding: 4px; -webkit-overflow-scrolling: touch; }
.dgm-scroll svg.dgm { display: block; min-width: 1040px; width: 100%; height: auto; }
svg.dgm { max-width: 100%; height: auto; }
.hp-more { margin: 26px 0; }
.hp-more h2 { margin: 0 0 10px; }
.hp-faq { display: grid; gap: 8px; margin: 0; }
.hp-faq div { padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.hp-faq dt { font-weight: 600; }
.hp-faq dt::before { content: "ถ้า "; color: var(--warn); }
.hp-faq dd { margin: 4px 0 0; color: var(--ink-2); font-size: .92rem; }
.hp-faq dd::before { content: "→ "; color: var(--accent); font-weight: 700; }

/* ---------- คู่มือ: หน้าแรก ---------- */
.hb-search { display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 0 0 18px; padding: 4px 6px 4px 16px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line-2); box-shadow: var(--shadow); }
.hb-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.hb-search .ico { width: 20px; height: 20px; color: var(--muted); flex: none; }
.hb-search input { border: 0; background: transparent; box-shadow: none; padding: 10px 4px; font-size: 1rem; }
.hb-search input:focus { outline: none; box-shadow: none; }
.hb-empty { color: var(--muted); }
.hb-resume { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; margin: 0 0 22px; padding: 16px 18px; border-radius: var(--r); text-decoration: none; color: #fff; background: linear-gradient(120deg, #0A0E13, #13303D); box-shadow: var(--shadow-lg); }
.hb-resume > span:nth-child(2), .hb-resume > span:first-child:not(.hb-hero-ico) { display: grid; gap: 2px; }
.hb-resume small { color: #9FD8EC; font-size: .82rem; }
.hb-resume b { font: 600 1.12rem var(--f-display); }
.hb-resume span span { color: #B9C4CF; font-size: .88rem; }
.hb-resume .hb-hero-ico { background: rgba(214, 245, 255, .12); color: var(--led); }
.hb-go { display: inline-flex; gap: 6px; align-items: center; padding: 9px 16px; border-radius: 99px; background: var(--led); color: var(--ink); font-weight: 700; white-space: nowrap; }
.hb-go .ico { width: 16px; height: 16px; }
.hb-resume:hover .hb-go { background: #fff; }
.hb-mine { margin-bottom: 26px; }
.hb-mine h2, .hb-all-h { margin: 0 0 12px; }
.hb-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.hb-card { display: grid; gap: 4px; align-content: start; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.hb-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.hb-card-ico, .hb-cat-ico, .hb-hero-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.hb-card-ico { margin-bottom: 4px; }
.hb-card b { font: 600 1.06rem var(--f-display); }
.hb-card > span:not(.hb-card-ico) { font-size: .9rem; color: var(--ink-2); }
.hb-card small { display: inline-flex; gap: 4px; align-items: center; margin-top: 6px; font-size: .8rem; color: var(--accent); font-weight: 600; }
.hb-card small .ico { width: 14px; height: 14px; }
.hb-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.hb-cat { border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 20px; }
.hb-cat:target { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.hb-cat header { display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.hb-cat h3 { margin: 0; font: 600 1.1rem var(--f-display); }
.hb-cat header span { font-size: .86rem; color: var(--muted); }
.hb-cat ul { list-style: none; margin: 0; padding: 6px; }
.hb-cat li a { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.hb-cat li a:hover { background: var(--accent-soft); }
.hb-row-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); color: var(--ink-2); }
.hb-row-ico .ico { width: 18px; height: 18px; }
.hb-row-t { display: grid; gap: 1px; }
.hb-row-t b { font-weight: 600; }
.hb-row-t span { font-size: .84rem; color: var(--muted); }
.hb-row-ok { color: var(--ok); }
.hb-row-ok .ico, .hb-row-go .ico { width: 18px; height: 18px; }
.hb-row-go { color: var(--muted); }
.hb-cat li a:hover .hb-row-go { color: var(--accent); }

/* ---------- คู่มือ: หัวเรื่อง ---------- */
.hb-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px 18px; align-items: start; margin: 0 0 18px; padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.hb-hero-ico { width: 52px; height: 52px; border-radius: 14px; }
.hb-hero-ico .ico { width: 26px; height: 26px; }
.hb-hero-main { display: grid; gap: 6px; }
.hb-hero h1 { margin: 0; }
.hb-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: .88rem; color: var(--ink-2); }
.hb-meta li { display: inline-flex; gap: 6px; align-items: center; }
.hb-meta .ico { width: 16px; height: 16px; color: var(--muted); }
.hb-goal { display: grid; gap: 2px; margin: 6px 0 0; padding: 10px 14px; border-radius: var(--r-sm); background: var(--ok-soft); color: #0F5C3C; font-size: .95rem; max-width: 70ch; }
.hb-goal b { font-size: .8rem; color: var(--ok); }
.hb-open { display: grid; gap: 2px; justify-items: start; text-align: left; max-width: 240px; white-space: normal; }
.hb-open small { font-weight: 400; font-size: .76rem; opacity: .75; }
.hb-progress { display: grid; gap: 4px; min-width: 200px; padding: 12px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.hb-progress b { font: 700 1.7rem var(--f-display); }
.hb-progress b small { font-size: .95rem; color: var(--muted); }
.hb-progress span { font-size: .84rem; color: var(--muted); }
.hb-progress i { display: block; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.hb-progress em { display: block; height: 100%; background: var(--ok); border-radius: inherit; }

.hb-toc { margin: 0 0 22px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.hb-toc b { display: block; margin-bottom: 8px; font-size: .9rem; }
.hb-toc ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hb-toc a { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: .86rem; color: var(--ink-2); text-decoration: none; }
.hb-toc a:hover { border-color: var(--accent); color: var(--accent); }
.hb-toc a span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font: 600 .74rem var(--f-mono); }

/* ---------- คู่มือ: ขั้นตอน (เส้นเวลา) ---------- */
.hb-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.hb-step { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; padding-bottom: 26px; scroll-margin-top: 16px; }
.hb-step::before { content: ""; position: absolute; left: 21px; top: 44px; bottom: 0; width: 2px; background: var(--line-2); }
.hb-step:last-child::before { display: none; }
.hb-num { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 1.1rem var(--f-display); box-shadow: 0 0 0 5px var(--canvas); }
.hb-step:target .hb-num { background: var(--accent); }
.hb-body { display: grid; gap: 12px; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.hb-body h2 { display: grid; gap: 2px; margin: 0; font-size: 1.2rem; }
.hb-body h2 small { font: 600 .74rem var(--f-mono); letter-spacing: .08em; color: var(--accent); }
.hb-text { margin: 0; color: var(--ink-2); max-width: 75ch; }

.hb-where { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.hb-where > div { display: grid; gap: 8px; justify-items: start; }
.hb-where p { margin: 0; color: var(--ink-2); }
.hb-where-k { font-size: .8rem; color: var(--muted); }
.hb-path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: .95rem; }
.hb-path .ico { width: 16px; height: 16px; vertical-align: -3px; }
.hb-path i { font-style: normal; color: var(--muted); }
.hb-path b { display: inline-flex; gap: 4px; align-items: center; color: var(--accent); }
.hb-navimg { width: 230px; height: auto; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); }

.hb-fig { margin: 0; display: grid; gap: 12px; }
.hb-fig.is-side { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
.hb-fig.is-phone { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
.hb-fig.is-small .hb-img { max-width: 260px; }
.hb-img { position: relative; display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); cursor: zoom-in; }
.hb-img img { display: block; width: 100%; height: auto; }
.hb-zoom { position: absolute; right: 8px; bottom: 8px; display: inline-flex; gap: 4px; align-items: center; padding: 4px 10px; border-radius: 99px; background: rgba(10, 14, 19, .72); color: #fff; font-size: .76rem; opacity: 0; transition: opacity .15s; }
.hb-zoom .ico { width: 14px; height: 14px; }
.hb-img:hover .hb-zoom, .hb-img:focus .hb-zoom { opacity: 1; }
.hb-fig figcaption { min-width: 0; }
.hb-legend-h { margin: 0 0 8px; font-size: .8rem; color: var(--muted); }
.hb-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 10px 20px; }
.hb-fig.is-side .hb-legend, .hb-fig.is-phone .hb-legend { grid-template-columns: minmax(0, 1fr); }
.hb-legend li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; }
.hb-legend li div { display: grid; gap: 1px; }
.hb-legend b { font-weight: 600; }
.hb-legend span { font-size: .9rem; color: var(--ink-2); }
.hb-legend em { font-style: normal; font-size: .82rem; color: var(--muted); }
.hb-mk { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #E0453A; color: #fff; font: 700 .82rem var(--f-mono); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(13, 19, 26, .3); }

.hb-list3 { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hb-list3 li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); }
.hb-list3 .ico { width: 20px; height: 20px; color: var(--ok); }
.hb-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 10px; }
.hb-types > div { display: grid; gap: 3px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); border-top: 3px solid var(--accent); }
.hb-types b { font: 600 1.02rem var(--f-display); }
.hb-types small { color: var(--muted); font-size: .82rem; }
.hb-table { margin: 0; }
.hb-table td { vertical-align: top; font-size: .92rem; }
.hb-exs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.hb-ex { padding: 12px 14px; border-radius: var(--r-sm); border: 1px dashed var(--line-2); background: var(--surface); }
.hb-ex h3 { display: flex; gap: 6px; align-items: center; margin: 0 0 6px; font: 600 .95rem var(--f-display); }
.hb-ex h3 .ico { width: 16px; height: 16px; color: var(--ok); }
.hb-ex dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 0; }
.hb-ex dt { color: var(--muted); font-size: .86rem; }
.hb-ex dd { margin: 0; font-size: .9rem; font-weight: 500; }
.hb-tip { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 14px; border-radius: var(--r-sm); background: var(--accent-soft); color: #075F7A; font-size: .92rem; border: 1px solid #BFE5F1; }
.hb-tip .ico { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.hb-tip.is-warn { background: var(--warn-soft); color: #7A4600; border-color: #F3D9A8; }
.hb-dgm { overflow-x: auto; }
.hb-dgm > svg.dgm { max-width: 420px; }

.hb-check { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 0 60px; padding: 14px 16px; border-radius: var(--r); background: var(--ok-soft); border: 1px solid #BFE6D2; color: #0F5C3C; }
.hb-check > .ico { flex: none; width: 24px; height: 24px; color: var(--ok); }
.hb-check div { display: grid; gap: 2px; }
.hb-faq { margin-left: 60px; }
.hb-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 30px 0 10px; }
.hb-pager a { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.hb-pager a:hover { border-color: var(--accent); }
.hb-pager a.is-next { text-align: right; background: var(--ink); color: #fff; border-color: var(--ink); }
.hb-pager small { display: inline-flex; gap: 4px; align-items: center; font-size: .8rem; color: var(--muted); }
.hb-pager a.is-next small { justify-content: flex-end; color: #B9C4CF; }
.hb-pager small .ico { width: 14px; height: 14px; }
.hb-pager b { font: 600 1.02rem var(--f-display); }

/* ---------- คู่มือ: ตั้งร้านครั้งแรก ---------- */
.hb-group { margin: 0 0 22px; }
.hb-group h2 { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin: 0 0 10px; }
.hb-group h2 small { font: 500 .85rem var(--f-body); color: var(--muted); }
.hb-slist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hb-slist a { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .15s; }
.hb-slist a:hover { border-color: var(--accent); }
.hb-sn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); font: 700 .95rem var(--f-mono); color: var(--ink-2); }
.hb-sn .ico { width: 20px; height: 20px; }
.hb-slist .st-ok .hb-sn { background: var(--ok-soft); color: var(--ok); }
.hb-slist .st-todo .hb-sn, .hb-slist .st-sample .hb-sn { background: var(--ink); color: #fff; }
.hb-sbody { display: grid; gap: 3px; justify-items: start; }
.hb-sbody > b { font: 600 1.05rem var(--f-display); }
.hb-sbody > span:not(.hb-st) { font-size: .88rem; color: var(--ink-2); }
.hb-slist .hb-go { background: var(--surface-2); color: var(--ink-2); font-weight: 600; }
.hb-slist .st-todo .hb-go, .hb-slist .st-sample .hb-go { background: var(--ink); color: #fff; }
.hb-st { display: inline-flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; font-size: .82rem; }
.hb-st .ico { width: 16px; height: 16px; }
.hb-st b { font-weight: 700; }
.hb-st span { color: var(--muted); }
.hb-st.st-ok { color: var(--ok); }
.hb-st.st-sample { color: #8A5000; }
.hb-st.st-todo { color: var(--bad); }
.hb-st.st-optional { color: var(--muted); }
.hb-note { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: .9rem; }
.hb-note .ico { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--accent); }

@media (max-width: 900px) {
  .hb-fig.is-side { grid-template-columns: minmax(0, 1fr); }
  .hb-hero { grid-template-columns: auto minmax(0, 1fr); }
  .hb-hero .hb-open, .hb-hero .hb-progress { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 640px) {
  .backbar { margin-top: 0; }
  .backbar-back b { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .backbar-help { padding-right: 12px; font-size: .84rem; }
  .hb-hero { padding: 14px; grid-template-columns: minmax(0, 1fr); }
  .hb-hero-ico { display: none; }
  .hb-resume { grid-template-columns: minmax(0, 1fr); }
  .hb-resume .hb-hero-ico { display: none; }
  .hb-resume .hb-go { justify-self: start; }
  .hb-step { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
  .hb-step::before { left: 16px; top: 34px; }
  .hb-num { width: 34px; height: 34px; font-size: .95rem; }
  .hb-body { padding: 12px; }
  .hb-where { grid-template-columns: minmax(0, 1fr); }
  .hb-navimg { width: 200px; }
  .hb-fig.is-phone { grid-template-columns: minmax(0, 1fr); }
  .hb-fig.is-phone .hb-img { max-width: 260px; }
  .hb-zoom { opacity: 1; }
  .hb-check, .hb-faq { margin-left: 0; }
  .hb-pager { grid-template-columns: minmax(0, 1fr); }
  .hb-cat li a { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .hb-row-ok { display: none; }
  .hb-slist a { grid-template-columns: 34px minmax(0, 1fr); }
  .hb-slist .hb-go { grid-column: 2; justify-self: start; }
}

/* ---------- เงิน & บัญชี ---------- */
.exp-form .card h2 .n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .8rem; margin-right: 6px; vertical-align: 2px; }
.exp-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-bottom: 14px; }
.exp-cat { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 600; font-size: .9rem; line-height: 1.3; }
.exp-cat input { position: absolute; opacity: 0; pointer-events: none; }
.exp-cat small { font-weight: 500; font-size: .74rem; color: var(--muted); }
.exp-cat:hover { border-color: var(--ink-2); }
.exp-cat:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.exp-cat:has(input:checked) small { color: rgba(255, 255, 255, .7); }
.exp-cat:has(input:focus-visible) { outline: 2px solid var(--studio); outline-offset: 2px; }
.exp-cat[data-kind]:not([data-kind="opex"]) { border-style: dashed; }
.exp-form details.card > summary, details.card > summary { cursor: pointer; list-style: none; }
.exp-form .seg { flex-wrap: wrap; }
.exp-amount { font: 700 2rem var(--f-display); font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.exp-receipt { max-width: 100%; max-height: 420px; border-radius: 10px; border: 1px solid var(--line); }
.pill.exp-paid { background: var(--ok-soft); color: var(--ok); }
.pill.exp-due { background: var(--warn-soft); color: var(--warn); }
.pill.exp-void { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.bad { color: var(--bad); }
.due-card h2 { color: var(--warn); }
.due-list { display: grid; gap: 2px; }
.due-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.due-row:last-child { border-bottom: 0; }
.due-pay { display: flex; gap: 6px; align-items: center; }
.due-pay select { min-height: 32px; padding: 4px 8px; font-size: .84rem; width: auto; }
@media (max-width: 720px) { .due-row { grid-template-columns: 1fr auto; } .due-pay { grid-column: 1 / -1; } }

.fin-hero { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.fin-net { display: grid; gap: 4px; padding: 18px 20px; border-radius: 16px; background: var(--ink); color: #fff; }
.fin-net .k { font-size: .85rem; opacity: .75; }
.fin-net .v { font: 700 2.2rem var(--f-display); font-variant-numeric: tabular-nums; color: #7CE0B0; }
.fin-net.neg .v { color: #FF9C9C; }
.fin-net .s { font-size: .82rem; opacity: .75; }
.stat .v.neg, .fin-tbl .neg td { color: var(--bad); }
@media (max-width: 900px) { .fin-hero { grid-template-columns: 1fr 1fr; } .fin-net { grid-column: 1 / -1; } }
.fin-tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.fin-tbl td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.fin-tbl td.num { text-align: right; white-space: nowrap; padding-left: 12px; }
.fin-tbl tr.sub td { color: var(--ink-2); font-size: .92rem; padding-left: 10px; }
.fin-tbl tr.sub td.num { padding-left: 12px; }
.fin-tbl tr.tot td { font-weight: 700; border-bottom-color: var(--ink-2); }
.fin-tbl tr.grand td { font: 700 1.15rem var(--f-display); border-bottom: 0; padding-top: 12px; }
.fin-tbl tr.grand.neg td { color: var(--bad); }
.fin-tbl label.inline input { margin-left: 6px; }
.fin-vat { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .9rem; }
.fin-trend { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 220px; padding-top: 8px; }
.fin-mo { display: grid; grid-template-rows: 1fr auto auto; height: 100%; gap: 4px; text-decoration: none; color: var(--ink-2); border-radius: 8px; padding: 4px 2px; text-align: center; }
.fin-mo:hover, .fin-mo.on { background: var(--surface-2); }
.fin-mo .bars { display: flex; gap: 3px; align-items: flex-end; justify-content: center; height: 100%; }
.fin-mo .bars i { display: block; width: 38%; max-width: 18px; min-height: 2px; border-radius: 4px 4px 0 0; }
.fin-mo .bars i.rev, .dot.rev { background: var(--accent); }
.fin-mo .bars i.cost, .dot.cost { background: #E9A23B; }
.fin-mo .net { font: 700 .78rem var(--f-display); color: var(--ok); font-variant-numeric: tabular-nums; }
.fin-mo .net.neg { color: var(--bad); }
.fin-mo .lbl { font-size: .72rem; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin: 0 2px 0 8px; }
.fin-line { justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.fin-line .num { margin-left: auto; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .fin-trend { gap: 2px; height: 180px; } .fin-mo .net { font-size: .66rem; } }

.pay-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.pay-card header { display: flex; justify-content: space-between; align-items: start; gap: 8px; margin-bottom: 8px; }
.pay-card header h2 { margin: 0; }
.pay-card.is-paid { background: var(--surface-2); }

.exp-form .card h2 { justify-content: flex-start; gap: 4px; }
.due-card h2 { justify-content: flex-start; gap: 8px; }

/* ---------- จองเป็นรอบ / ฝากเบอร์ให้โทรกลับ ---------- */
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 99px; background: #E9A23B; color: #1B1200; font: 700 .72rem var(--f-body); font-style: normal; text-align: center; }
.seg .nav-badge { margin-left: 6px; }
.pub-call { display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; }
.pub-call .ico { width: 16px; height: 16px; }
.bk-grp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bk-grp .ico { width: 16px; height: 16px; }
.bk-grp small { font-weight: 500; }
.bk-cb { border-style: dashed; }
.bk-callback { border-color: var(--accent); background: var(--accent-soft); }
.bk-callback h2 { display: flex; align-items: center; gap: 8px; }
.bk-req[hidden] { display: none; }
.bk-req { font-style: normal; color: var(--bad); }

.mode-switch { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 5px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font: 600 .82rem var(--f-body); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.mode-switch i { width: 30px; height: 18px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .15s; }
.mode-switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.mode-switch.is-instant i { background: var(--ok); }
.mode-switch.is-instant i::after { transform: translateX(12px); }
.mode-switch.is-callback { background: var(--warn-soft); border-color: #F0CE93; color: var(--warn); }
.mode-switch:hover { border-color: var(--ink-2); }

.cb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-top: 14px; }
.cb-card header { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.cb-card h2 { margin: 0 0 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cb-tel { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font: 600 .85rem var(--f-body); text-decoration: none; }
.cb-tel .ico { width: 14px; height: 14px; }
.cb-items { margin: 10px 0; padding-left: 1.2em; display: grid; gap: 2px; }
.cb-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.cb-actions input[type="text"] { flex: 1 1 100%; min-height: 36px; }
.cb-new { border-left: 4px solid #E9A23B; }
.cb-contacted { border-left: 4px solid var(--accent); }
.cb-booked, .cb-closed { opacity: .75; }
.cb-pill-new { background: var(--warn-soft); color: var(--warn); }
.cb-pill-contacted { background: var(--accent-soft); color: var(--accent); }
.cb-pill-booked { background: var(--ok-soft); color: var(--ok); }
.cb-pill-closed { background: var(--surface-2); color: var(--muted); }

/* ---------- แท็บเลือกประเภทการจอง ---------- */
.bk-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.bk-tabs button { display: grid; gap: 2px; justify-items: start; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface); font: inherit; color: var(--ink-2); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.bk-tabs button .ico { width: 20px; height: 20px; color: var(--muted); margin-bottom: 2px; }
.bk-tabs button b { font: 700 1rem var(--f-display); color: var(--ink); line-height: 1.25; }
.bk-tabs button small { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.bk-tabs button:hover { border-color: var(--ink-2); }
.bk-tabs button[aria-selected="true"] { border-color: var(--studio); background: var(--led); box-shadow: inset 0 0 0 1px var(--studio), 0 6px 16px -8px var(--led-glow); }
.bk-tabs button[aria-selected="true"] .ico { color: var(--studio); }
.bk-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 420px) { .bk-tabs { gap: 8px; } .bk-tabs button { padding: 10px 11px; } .bk-tabs button b { font-size: .92rem; } }
.bk-panel { border: 0; margin: 0; padding: 0; min-width: 0; }
.bk-panel[hidden] { display: none; }
.bk-hint { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: .88rem; }
.bk-hint .ico { width: 16px; height: 16px; flex: none; }
.bk-svc input[type="radio"] { accent-color: var(--studio); width: 18px; height: 18px; }

/* ---------- ช่องงาน (หน้าตั้งค่าเวลาเปิด): แถวพับบรรทัดได้ ปุ่มบันทึกไม่ล้นจอ ---------- */
.res-list { display: grid; gap: 10px; margin-bottom: 10px; }
.res-row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.res-row .res-name { flex: 2 1 180px; }
.res-row .res-type { flex: 1 1 150px; }
.res-row .res-order { flex: 0 0 84px; }
.res-row .res-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; min-height: 40px; }
.res-row .res-save { margin-left: auto; }
@media (max-width: 560px) { .res-row .res-save { width: 100%; margin-left: 0; } }

/* ---------- อัปผลงานเป็นชุด (portfolio/batch) ---------- */
.pfb-progress{margin-top:12px}
.pfb-progress>div{height:8px;border-radius:99px;background:var(--line);overflow:hidden}
.pfb-progress>div>span{display:block;height:100%;width:0;background:var(--accent,#0a84ff);transition:width .15s}
.pfb-bar{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin:14px 0;position:sticky;top:0;z-index:5}
.pfb-card{margin-bottom:14px}
.pfb-card.is-saved{opacity:.75}
.pfb-head{display:flex;justify-content:space-between;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
.pfb-strip{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.pfb-thumb{margin:0;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--surface);position:relative}
.pfb-thumb img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover}
.pfb-thumb figcaption{position:absolute;top:6px;left:6px;display:flex;gap:4px;flex-wrap:wrap}
.pfb-cover,.pfb-blurred{font-size:.72rem;font-weight:600;padding:2px 8px;border-radius:99px;background:rgba(0,0,0,.72);color:#fff}
.pfb-blurred{background:#1f8a4c}
.pfb-tools{display:grid;gap:4px;padding:6px}
.pfb-tools .btn,.pfb-tools select{width:100%;font-size:.8rem}
.pfb-fields{display:grid;gap:10px;margin-top:12px}
.pfb-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px}
.pfb-svc{display:flex;flex-wrap:wrap;gap:6px 16px}
.pfb-foot{display:grid;gap:10px;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
.pfb-dialog{border:0;padding:0;border-radius:16px;max-width:min(96vw,1100px);width:100%;background:var(--surface,#fff);color:inherit}
.pfb-dialog::backdrop{background:rgba(0,0,0,.6)}
.pfb-dialog-in{padding:14px}
.pfb-canvas-wrap{max-height:70vh;overflow:auto;border-radius:10px;background:#111}
#pfb-canvas{display:block;width:100%;height:auto;cursor:crosshair}

/* ---------- หน้า "ผลงาน & รีวิว" (สไลด์ · การ์ดบริการ · ตัวกรอง) ---------- */
.pf-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: none; }
.pf-track::-webkit-scrollbar { display: none; }
.pf-slide, .pf-tile { position: relative; display: block; border-radius: var(--r-lg); overflow: hidden; background: var(--studio-2); text-decoration: none; color: #fff; }
.pf-slide { flex: 0 0 86%; max-width: 560px; aspect-ratio: 4 / 3; scroll-snap-align: start; }
.pf-slide img, .pf-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pf-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 12px; display: grid; gap: 2px; background: linear-gradient(transparent, rgba(5, 10, 16, .82)); }
.pf-cap b { font-weight: 600; line-height: 1.25; }
.pf-cap small { color: rgba(255, 255, 255, .8); }
.pf-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pf-tile { aspect-ratio: 4 / 3; min-height: 120px; }
@media (min-width: 720px) { .pf-tiles { grid-template-columns: repeat(3, 1fr); } }
.pf-result-h { margin-top: 4px; }
.pf-result-h a { margin-left: 8px; }

/* ถ่ายรูปรถให้ระบบกรอกให้ */
.vscan { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px; margin-bottom: 14px; border: 1.5px dashed var(--accent); border-radius: var(--r); background: var(--accent-soft); }
.vscan-btn { background: var(--surface); border-color: var(--accent); color: var(--ink); font-weight: 600; }
.vscan-btn .ico { width: 18px; height: 18px; }
.vscan-status { flex-basis: 100%; margin: 0; font-weight: 600; }
