/* ===== ระบบจองคิว — ธีมบัตรคิวหลากสี ===== */
:root {
  --ink: #1c1a3b;
  --ink-2: #5d5b7c;
  --bg: #f2f3fb;
  --surface: #ffffff;
  --line: #e2e3f0;
  --brand: #2a36e8;
  --brand-deep: #1b23a8;
  --brand-soft: #e8eaff;
  --ok: #0b7a4b;
  --ok-soft: #dff6ea;
  --warn: #8a5a00;
  --warn-soft: #fff3d1;
  --err: #c2262e;
  --err-soft: #fde8e9;
  --radius: 16px;
  --shadow: 0 1px 0 rgba(28, 26, 59, .04), 0 8px 24px -12px rgba(28, 26, 59, .18);
  --head: 'Bai Jamjuree', 'Anuphan', 'Noto Sans Thai', system-ui, sans-serif;
  --body: 'Anuphan', 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* สีเริ่มต้นของบัตร (ใช้เมื่อไม่ได้ระบุ c1–c6) */
  --c: var(--brand); --c-soft: var(--brand-soft); --c-ink: var(--brand-deep); --c-on: #fff;
}
/* สีกระดาษบัตรคิวแต่ละม้วน */
.c1 { --c: #ef6a00; --c-soft: #ffeedd; --c-ink: #9a4300; --c-on: #fff; }
.c2 { --c: #e0387a; --c-soft: #ffe6f0; --c-ink: #9c1750; --c-on: #fff; }
.c3 { --c: #0d9c63; --c-soft: #dff7ec; --c-ink: #086541; --c-on: #fff; }
.c4 { --c: #1487d4; --c-soft: #e0f1fd; --c-ink: #0a5a90; --c-on: #fff; }
.c5 { --c: #7447f5; --c-soft: #eee8ff; --c-ink: #4a22bd; --c-on: #fff; }
.c6 { --c: #f4b400; --c-soft: #fff5d2; --c-ink: #765500; --c-on: #3a2a00; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #e9eaf5; padding: 1px 6px; border-radius: 5px; font-size: .9em; }
h1, h2, h3 { font-family: var(--head); line-height: 1.3; margin: 0 0 .5rem; font-weight: 700; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 18px; }
.container { max-width: 880px; margin: 0 auto; padding: 0 18px; }
.container.wide { max-width: 1200px; }
.container.narrow { max-width: 460px; }
.page-narrow main { padding-top: 8vh; }
.main { padding-bottom: 24px; }

.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.strong { font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ===== แถบบน (หน้าผู้ใช้) ===== */
.top { background: var(--surface); border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  flex: none; width: 38px; height: 38px; border-radius: 10px 10px 10px 3px;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-family: var(--head); font-weight: 700; font-size: 1.15rem;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-family: var(--head); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--ink-2); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-nav { display: flex; align-items: center; gap: 6px; flex: none; }
.top-link { color: var(--ink-2); font-size: .88rem; padding: 6px 8px; }
.me { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; font-size: .9rem; }
.me:hover { text-decoration: none; background: #dcdfff; }
.me img, .me-initial { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.me-initial { display: grid; place-items: center; background: var(--brand); color: #fff; }
.foot { color: var(--ink-2); font-size: .85rem; padding: 28px 18px 36px; text-align: center; }
.back { display: inline-block; font-size: .92rem; margin-bottom: 10px; color: var(--ink-2); }

/* ===== ปุ่ม ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.3;
  padding: 10px 18px; border-radius: 12px; border: 1.5px solid #cfd1e6;
  background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f4f5fc; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn.light { background: #fff; border-color: #fff; color: var(--brand-deep); white-space: normal; text-align: left; }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.sm { padding: 6px 12px; font-size: .86rem; border-radius: 9px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(28, 26, 59, .06); }
.btn.block { width: 100%; padding: 14px; font-size: 1.02rem; }
.danger-text { color: var(--err) !important; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; }

/* ===== การ์ดและฟอร์ม ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card-title { font-size: 1.1rem; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.section-title { font-size: 1.05rem; margin: 24px 0 12px; }

.form label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 14px; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea,
.search-inline input, .sm-select {
  display: block; width: 100%; margin-top: 5px;
  font: inherit; font-weight: 400; color: var(--ink);
  padding: 11px 13px; border: 1.5px solid #cfd1e6; border-radius: 11px; background: #fff;
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus, .search-inline input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft);
}
.form label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; flex-wrap: wrap; }
.form label.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.checks { display: grid; gap: 4px; }
.hint { display: block; font-weight: 400; color: var(--ink-2); font-size: .85rem; margin-top: 4px; }
.inline-num { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.form .inline-num input { width: 70px !important; display: inline-block !important; margin: 0 !important; padding: 4px 8px !important; }
.row2, .row3, .row4 { display: grid; gap: 0 16px; }
@media (min-width: 640px) {
  .row2 { grid-template-columns: 1fr 1fr; }
  .row3 { grid-template-columns: repeat(3, 1fr); }
  .row4 { grid-template-columns: repeat(4, 1fr); align-items: end; }
}
.prefix-input { display: flex; align-items: stretch; margin-top: 5px; }
.prefix-input span { background: #eceef8; border: 1.5px solid #cfd1e6; border-right: 0; border-radius: 11px 0 0 11px; padding: 10px; font-size: .78rem; color: var(--ink-2); max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; font-weight: 400; }
.form .prefix-input input { margin-top: 0 !important; border-radius: 0 11px 11px 0 !important; }
.form.inline, .search-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form.inline label { flex: 1; min-width: 200px; margin: 0; }
.search-inline input { width: auto; flex: 1; min-width: 220px; margin: 0; padding: 7px 10px; }
.sm-select { display: inline-block; width: auto; padding: 4px 8px; font-size: .85rem; margin: 0; border-radius: 8px; }

.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; background: #e9eaf5; color: var(--ink); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.err { background: var(--err-soft); color: var(--err); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.msg { padding: 11px 14px; border-radius: 11px; margin-bottom: 14px; font-size: .95rem; }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.err { background: var(--err-soft); color: var(--err); }
.empty { text-align: center; color: var(--ink-2); padding: 32px 16px; background: var(--surface); border: 1.5px dashed #cfd1e6; border-radius: var(--radius); }
.empty.small { padding: 16px; }
ul.plain { padding-left: 20px; }

.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 11px; border-radius: 99px; background: #e9eaf5; color: var(--ink-2); white-space: nowrap; }
.badge.open { background: var(--ok-soft); color: var(--ok); }
.badge.upcoming { background: #eee8ff; color: #4a22bd; }
.badge.not_yet { background: var(--warn-soft); color: var(--warn); }
.badge.closed { background: #e9eaf5; color: var(--ink-2); }
.badge.draft { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px #c3c5dc; }

.meter { height: 8px; background: #e6e7f3; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.meter.thin { height: 5px; }
.meter span { display: block; height: 100%; background: var(--c); border-radius: 99px; transition: width .4s; }
.meter-text { font-size: .8rem; color: var(--ink-2); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ===== หน้าแรก ===== */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px;
  background: var(--brand); color: #fff; border-radius: 24px; padding: 34px 32px; margin-bottom: 30px;
}
.hero h1 { font-size: clamp(1.7rem, 4.4vw, 2.5rem); margin-bottom: 8px; }
.hero p { max-width: 32em; color: #dfe2ff; margin-bottom: 0; font-size: 1.05rem; }
.hero .btn { margin-top: 18px; }
.hero-art { display: flex; gap: 0; padding-right: 8px; }
.ht {
  width: 78px; height: 104px; border-radius: 12px; display: grid; place-items: center;
  background: var(--c); color: var(--c-on); font-family: var(--head); font-weight: 700; font-size: 2rem;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 40, .5); position: relative;
}
.ht::after { content: ''; position: absolute; left: 10px; right: 10px; top: 26px; border-top: 2px dashed rgba(255, 255, 255, .55); }
.ht.c6::after { border-top-color: rgba(58, 42, 0, .35); }
.ht:nth-child(1) { transform: rotate(-9deg) translateY(8px); }
.ht:nth-child(2) { transform: rotate(4deg) translate(-14px, -8px); z-index: 1; }
.ht:nth-child(3) { transform: rotate(13deg) translate(-26px, 10px); }

.block { margin-bottom: 32px; }
.block-title { font-size: 1.3rem; margin-bottom: 4px; }
.block-title.quiet { font-size: 1.05rem; color: var(--ink-2); }
.block-sub { color: var(--ink-2); margin-bottom: 14px; }
.block-title + .tk-grid, .block-title + .past-list { margin-top: 14px; }

/* บัตรกิจกรรม: หางบัตรสี + ตัวบัตร คั่นด้วยรอยปรุ */
.tk-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.tk {
  position: relative; display: grid; grid-template-columns: 92px 1fr;
  background: var(--surface); border-radius: 18px; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.tk:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 1px 0 rgba(28, 26, 59, .04), 0 16px 30px -14px rgba(28, 26, 59, .3); }
.tk::before, .tk::after { content: ''; position: absolute; left: 83px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); z-index: 1; }
.tk::before { top: -9px; }
.tk::after { bottom: -9px; }
.tk-stub {
  background: var(--c); color: var(--c-on); border-radius: 18px 0 0 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 6px; text-align: center;
  font-family: var(--head);
}
.tk-day { font-size: 2.3rem; font-weight: 700; line-height: 1; }
.tk-mon { font-size: .9rem; font-weight: 600; margin-top: 2px; }
.tk-to { font-family: var(--body); font-size: .72rem; margin-top: 4px; opacity: .92; }
.tk-wait { font-size: 1.02rem; font-weight: 700; line-height: 1.25; }
.tk-body { padding: 16px 18px 16px 20px; border-left: 2px dashed var(--line); min-width: 0; }
.tk-body h3 { margin: 8px 0 4px; font-size: 1.08rem; }
.tk-loc { color: var(--ink-2); font-size: .9rem; margin: 0; }
.tk-note { color: var(--ink-2); font-size: .86rem; margin: 6px 0 0; }
.tk.is-upcoming .tk-stub, .tk.is-not_yet .tk-stub { background: var(--c-soft); color: var(--c-ink); }

.past-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); }
.past-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.past-list li:last-child { border-bottom: 0; }
.past-list li span:last-child { color: var(--ink-2); font-size: .88rem; white-space: nowrap; }

/* ===== หน้ากิจกรรม ===== */
.ev-head { background: var(--c-soft); border-radius: 22px; padding: 24px 26px; margin-bottom: 18px; border-left: 10px solid var(--c); }
.ev-head h1 { margin: 10px 0 6px; font-size: clamp(1.4rem, 3.6vw, 1.9rem); }
.ev-head p { margin: 0; color: var(--c-ink); }
.ev-loc { font-weight: 600; }
.ev-when { font-size: .9rem; margin-top: 4px !important; }
.desc { background: var(--surface); border: 1px solid var(--line); padding: 16px 20px; border-radius: var(--radius); margin-bottom: 20px; }

.soon { text-align: center; background: var(--surface); border-radius: 22px; padding: 44px 24px; box-shadow: var(--shadow); }
.soon h2 { font-size: 1.5rem; }
.soon p { max-width: 30em; margin: 0 auto 10px; color: var(--ink-2); }
.soon-plan { display: inline-block; background: var(--c-soft); color: var(--c-ink) !important; font-weight: 600; padding: 8px 18px; border-radius: 99px; margin: 6px auto 14px !important; }
.soon .btn { margin-top: 12px; }
.soon-clock { width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%; background: var(--c-soft); border: 5px solid var(--c); position: relative; }
.soon-clock i, .soon-clock::after { content: ''; position: absolute; left: 50%; bottom: 50%; width: 5px; margin-left: -2.5px; border-radius: 3px; background: var(--c); transform-origin: 50% 100%; }
.soon-clock i { height: 22px; animation: tick 6s linear infinite; }
.soon-clock::after { height: 15px; transform: rotate(120deg); }
@keyframes tick { to { transform: rotate(360deg); } }

.mine-strip { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 2px solid var(--c); border-radius: var(--radius); padding: 12px 18px; margin-bottom: 14px; }
.mine-q { display: flex; flex-direction: column; align-items: center; padding-right: 16px; border-right: 2px dashed var(--line); font-family: var(--head); }
.mine-q small { font-family: var(--body); color: var(--ink-2); font-size: .75rem; white-space: nowrap; }
.mine-q strong { font-size: 2rem; line-height: 1.1; color: var(--c-ink); }
.mine-info { flex: 1 1 190px; display: flex; flex-direction: column; min-width: 0; font-size: .9rem; color: var(--ink-2); }
.mine-info strong { color: var(--ink); font-size: 1rem; }

.tabs { display: flex; gap: 4px; background: #e3e5f3; padding: 5px; border-radius: 14px; margin-bottom: 22px; }
.tab { flex: 1; font: inherit; font-weight: 600; border: 0; background: transparent; padding: 10px 6px; border-radius: 10px; cursor: pointer; color: var(--ink-2); }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px -2px rgba(28, 26, 59, .25); }
.panel { display: none; }
.panel.active { display: block; }

.step { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin: 26px 0 14px; }
.step:first-child { margin-top: 0; }
.step span { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: .95rem; }

.rounds { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.round { position: relative; display: block; cursor: pointer; }
.round input { position: absolute; opacity: 0; pointer-events: none; }
.round-body { height: 100%; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 16px; transition: border-color .15s, background .15s; }
.round:hover .round-body { border-color: var(--c); }
.round input:checked + .round-body { border-color: var(--c); background: var(--c-soft); box-shadow: 0 0 0 3px var(--c-soft); }
.round input:focus-visible + .round-body { outline: 3px solid var(--brand); outline-offset: 2px; }
.round.disabled { cursor: not-allowed; }
.round.disabled .round-body { opacity: .55; background: #eceef6; border-color: var(--line); }
.round-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: .9rem; }
.round-left { font-size: .78rem; font-weight: 600; color: var(--ok); background: var(--ok-soft); padding: 1px 9px; border-radius: 99px; white-space: nowrap; }
.round.disabled .round-left { color: var(--err); background: var(--err-soft); }
.round-time { font-family: var(--head); font-size: 1.02rem; font-weight: 700; margin-top: 8px; white-space: nowrap; }
.round-date { font-size: .88rem; color: var(--ink-2); }
.round-loc { font-size: .82rem; color: var(--ink-2); }

.signin-hint { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--brand-soft); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; }
.signin-hint p { margin: 2px 0 0; font-size: .88rem; color: var(--ink-2); }
.signed-as { font-size: .9rem; color: var(--ink-2); }
.g-signin { min-height: 44px; display: flex; align-items: center; }
.g-fallback { font-size: .85rem; color: var(--warn); background: var(--warn-soft); padding: 8px 12px; border-radius: 10px; }

.narrow-page .main { max-width: 480px; }
.signin-card { background: var(--surface); border-radius: 22px; padding: 30px 26px; box-shadow: var(--shadow); margin-top: 3vh; }
.signin-card .g-signin { margin: 18px 0; }
.signin-why { padding-left: 20px; margin: 0 0 16px; }
.signin-why li { margin-bottom: 4px; }

/* ===== อินโฟกราฟิกและสถานะคิว ===== */
.info-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px 20px; margin-bottom: 22px; border-top: 6px solid var(--c); }
.info-card h2 { font-size: 1.12rem; margin-bottom: 12px; }
.info-view { position: relative; display: grid; gap: 12px; }
.info-view a { display: block; }
.info-view img, .ticket-info-img img { display: block; width: 100%; height: auto; border-radius: 12px; background: #eceef6; }
.info-view.collapsed { max-height: 380px; overflow: hidden; }
.info-view.collapsed::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 110px; background: linear-gradient(rgba(255, 255, 255, 0), #fff); pointer-events: none; }
.info-toggle { margin-top: 12px; }
.ticket + .info-card { max-width: 440px; margin: 20px auto 0; }
.ticket-info-img { display: grid; gap: 10px; padding: 0 20px 22px; }

.st { display: inline-block; font-size: .8rem; font-weight: 600; padding: 2px 11px; border-radius: 99px; background: #e9eaf5; color: var(--ink-2); }
.st-wait { background: var(--brand-soft); color: var(--brand-deep); }
.st-today { background: var(--warn-soft); color: var(--warn); }
.st-done { background: var(--ok-soft); color: var(--ok); }
.st-missed { background: var(--err-soft); color: var(--err); }
.ticket-status { padding: 0 22px 16px; }
.ticket-status small { display: block; color: var(--ink-2); margin-top: 4px; font-size: .86rem; }
.steps3 { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0 0; padding: 0; font-size: .78rem; color: var(--ink-2); }
.steps3 li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; line-height: 1.3; }
.steps3 li::before { content: ''; position: absolute; top: 12px; right: 50%; width: 100%; height: 3px; background: #dfe0ee; }
.steps3 li:first-child::before { display: none; }
.steps3 span { position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; background: #dfe0ee; color: var(--ink-2); display: grid; place-items: center; font-family: var(--head); font-weight: 700; font-size: .82rem; }
.steps3 li.on { color: var(--ink); font-weight: 600; }
.steps3 li.on span, .steps3 li.on::before { background: var(--ok); color: #fff; }
.steps3 li.on.warn span, .steps3 li.on.warn::before { background: var(--err); }
a.mine-strip { color: var(--ink); }
a.mine-strip:hover { text-decoration: none; box-shadow: var(--shadow); }
.mine-info .st { align-self: flex-start; margin-bottom: 3px; }

.img-list { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.img-item { width: 150px; }
.img-item img { display: block; width: 150px; height: 190px; object-fit: cover; object-position: top; border-radius: 10px; border: 1px solid var(--line); background: #eceef6; }
.form .img-item label.check { margin: 6px 0 0; font-size: .86rem; }

/* ===== บาร์โค้ดบนบัตรคิว ===== */
.ticket-code { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 20px 18px; }
.ticket-code .qr svg { display: block; width: 168px; height: 168px; }
.ticket-code .bar { display: block; max-width: 100%; height: auto; background: #fff; }
.ticket-code .code-text { font-family: var(--head); font-weight: 700; font-size: 1.15rem; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.ticket-code .code-tip { color: var(--ink-2); font-size: .82rem; margin: 0; max-width: 300px; }
.ticket-ok.st-done { background: var(--ok-soft); color: var(--ok); }
.ticket-ok.st-wait { background: var(--brand-soft); color: var(--brand-deep); }
.ticket-ok.st-today { background: var(--warn-soft); color: var(--warn); }
.ticket-ok.st-missed { background: var(--err-soft); color: var(--err); }
#mine-ticket { margin-top: 4px; }
.seg-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.form .seg-pick label { margin: 0; font-weight: 500; }
.seg-pick input { position: absolute; opacity: 0; pointer-events: none; }
.seg-pick span { display: inline-block; padding: 8px 14px; border-radius: 99px; border: 1.5px solid #cfd1e6; background: #fff; cursor: pointer; font-size: .92rem; }
.seg-pick input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg-pick input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ===== หน้าสแกนยืนยันคิว ===== */
.scan-grid { display: grid; gap: 20px; margin-bottom: 20px; align-items: start; }
@media (min-width: 900px) { .scan-grid { grid-template-columns: 1fr 1fr; } }
.scan-grid > .card { margin-bottom: 0; }
.form input.scan-input { font-family: var(--head); font-size: 1.6rem !important; letter-spacing: .12em; padding: 14px 16px !important; }
.cam { width: 100%; max-height: 320px; border-radius: 12px; background: #000; margin-top: 12px; object-fit: cover; }
.scan-count { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 20px; text-align: center; border-top: 5px solid var(--ok); }
.scan-count span { display: block; color: var(--ink-2); font-size: .85rem; }
.scan-count strong { font-family: var(--head); font-size: 2rem; line-height: 1.1; }
.scan-result { border-radius: 20px; padding: 24px; min-height: 260px; box-shadow: var(--shadow); background: var(--surface); border: 3px solid var(--line); text-align: center; }
.scan-result.idle { display: grid; place-items: center; color: var(--ink-2); border-style: dashed; }
.scan-result.ok { background: var(--ok-soft); border-color: var(--ok); }
.scan-result.warn { background: var(--warn-soft); border-color: #e0a800; }
.scan-result.err { background: var(--err-soft); border-color: var(--err); }
.sr-title { font-family: var(--head); font-weight: 700; font-size: 1.6rem; }
.scan-result.ok .sr-title { color: var(--ok); }
.scan-result.warn .sr-title { color: var(--warn); }
.scan-result.err .sr-title { color: var(--err); }
.sr-q { display: flex; flex-direction: column; align-items: center; margin: 6px 0; }
.sr-q small { color: var(--ink-2); }
.sr-q strong { font-family: var(--head); font-size: 4rem; line-height: 1; }
.sr-name { font-size: 1.25rem; font-weight: 600; }
.sr-name span { color: var(--ink-2); font-weight: 400; }
.sr-meta { color: var(--ink-2); font-size: .92rem; margin-top: 4px; }
.sr-msg { margin: 12px 0 8px; font-weight: 600; }
.scan-result .actions { justify-content: center; }
.scan-log { list-style: none; margin: 0; padding: 0; }
.scan-log li { display: grid; grid-template-columns: 80px 130px 1fr; gap: 10px; padding: 8px 4px; border-bottom: 1px solid #eeeff7; font-size: .92rem; }
.scan-log li span:first-child { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.scan-log li.ok strong { color: var(--ok); }
.scan-log li.warn strong { color: var(--warn); }
.scan-log li.err strong { color: var(--err); }
@media (max-width: 640px) { .scan-log li { grid-template-columns: 70px 1fr; } .scan-log li span:last-child { grid-column: 1 / -1; } }

/* แถบรอบที่กำลังรับ */
.now-banner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: 20px; padding: 18px 24px; margin-bottom: 20px; }
.now-banner.all { background: #4a4870; }
.now-banner.special { box-shadow: 0 0 0 5px #f4b400; }
.now-label { display: block; color: #c3c4de; font-size: .9rem; }
.now-banner strong#now-round { display: block; font-family: var(--head); font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.2; }
.now-meta { display: block; color: #dfe0f2; font-size: .95rem; }
.now-special { display: inline-block; margin-top: 6px; background: #f4b400; color: #3a2a00; font-weight: 600; font-size: .85rem; padding: 2px 12px; border-radius: 99px; }
.now-banner .scan-count { color: var(--ink); }
.form label.special-toggle { margin: 4px 0 0; font-weight: 500; background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: 10px; }
.sr-round { font-family: var(--head); font-weight: 700; font-size: 1.15rem; margin-top: 4px; }
.sr-choose { list-style: none; margin: 8px 0; padding: 0; text-align: left; }
.sr-choose li { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; }
.sr-choose span { color: var(--ink-2); font-size: .88rem; }

/* ===== โปสเตอร์ QR จองคิว ===== */
.poster-page { background: #e9eaf5; }
.poster-bar { display: flex; gap: 8px; justify-content: center; padding: 14px; }
.poster { width: 100%; max-width: 720px; margin: 0 auto 30px; background: #fff; border-radius: 24px; padding: 44px 48px; text-align: center; border-top: 22px solid var(--c); box-shadow: var(--shadow); }
.poster-org { color: var(--ink-2); margin: 0 0 6px; }
.poster h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); margin-bottom: 4px; }
.poster-loc { color: var(--c-ink); font-weight: 600; margin: 0; }
.poster-qr { width: 300px; max-width: 80%; margin: 26px auto 10px; padding: 12px; border: 4px solid var(--c); border-radius: 20px; }
.poster-qr svg { display: block; width: 100%; height: auto; }
.poster-call { font-family: var(--head); font-weight: 700; font-size: 1.5rem; margin: 6px 0 2px; }
.poster-url { color: var(--ink-2); font-size: .9rem; word-break: break-all; }
.poster-steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0; margin: 26px 0 18px; text-align: left; }
.poster-steps li { counter-increment: s; background: var(--c-soft); border-radius: 14px; padding: 14px; font-size: .92rem; }
.poster-steps li::before { content: counter(s); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--c); color: var(--c-on); font-family: var(--head); font-weight: 700; margin-bottom: 8px; }
.poster-steps strong { display: block; }
.poster-note { font-weight: 600; color: var(--err); margin: 0; }
@media (max-width: 640px) { .poster { padding: 28px 20px; } .poster-steps { grid-template-columns: 1fr; } }
@media print {
  .poster-page { background: #fff; }
  .poster { box-shadow: none; max-width: none; border-radius: 0; padding: 20mm 16mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ticket-code { break-inside: avoid; }
}

/* ===== บัตรคิว ===== */
.ticket {
  position: relative; background: var(--surface); border-radius: 20px; text-align: center;
  max-width: 440px; margin: 0 auto; box-shadow: var(--shadow); overflow: hidden;
  border-top: 12px solid var(--c);
}
.ticket.printing { animation: print-out .7s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes print-out { from { clip-path: inset(0 0 100% 0); transform: translateY(-18px); } to { clip-path: inset(0 0 0 0); transform: none; } }
.ticket-ok { display: inline-block; background: var(--ok-soft); color: var(--ok); font-weight: 600; border-radius: 99px; padding: 4px 16px; margin-top: 20px; }
.ticket-event { font-family: var(--head); font-weight: 700; padding: 16px 22px 0; }
.ticket-q { display: flex; flex-direction: column; align-items: center; padding: 10px 16px 18px; position: relative; }
.ticket-q small { color: var(--ink-2); }
.ticket-q strong { font-family: var(--head); font-size: 5rem; line-height: 1.05; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.ticket-info { text-align: left; margin: 0; padding: 14px 24px 6px; border-top: 2px dashed var(--line); position: relative; }
.ticket-info::before, .ticket-info::after { content: ''; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); }
.ticket-info::before { left: -10px; }
.ticket-info::after { right: -10px; }
.ticket-info div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid #eeeff7; }
.ticket-info div:last-child { border-bottom: 0; }
.ticket-info dt { color: var(--ink-2); white-space: nowrap; }
.ticket-info dd { margin: 0; text-align: right; font-weight: 600; }
.ticket-tip { color: var(--ink-2); font-size: .88rem; margin: 6px 20px 0; }
.ticket-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 16px 20px 22px; }
.my-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-bottom: 20px; }
.my-grid .ticket { max-width: none; margin: 0; width: 100%; }
.my-grid .ticket-q strong { font-size: 4rem; }

.result { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 10px; }
.result-q { display: flex; flex-direction: column; align-items: center; min-width: 60px; padding-right: 14px; border-right: 2px dashed var(--line); font-family: var(--head); }
.result-q small { font-family: var(--body); color: var(--ink-2); font-size: .75rem; }
.result-q strong { font-size: 1.7rem; color: var(--c-ink); line-height: 1.1; }

/* ===== หน้าผู้ดูแล ===== */
.topbar { background: var(--ink); color: #fff; margin-bottom: 24px; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.topbar .brand { color: #fff; font-family: var(--head); font-weight: 700; }
.admin-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.admin-nav a { padding: 6px 12px; border-radius: 9px; color: #c3c4de; font-size: .92rem; }
.admin-nav a:hover { background: rgba(255, 255, 255, .1); text-decoration: none; color: #fff; }
.admin-nav a.on { background: #fff; color: var(--ink); font-weight: 600; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 2px 0 0; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 20px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); border-top: 5px solid var(--c); }
.stat span { display: block; color: var(--ink-2); font-size: .85rem; }
.stat strong { font-family: var(--head); font-size: 1.9rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.grid2 { display: grid; gap: 20px; margin-bottom: 20px; align-items: start; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.grid2 > .card { margin-bottom: 0; }

.seg { display: flex; background: #e9eaf5; border-radius: 10px; padding: 3px; }
.seg a { padding: 4px 12px; border-radius: 8px; color: var(--ink-2); font-size: .88rem; }
.seg a.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px -1px rgba(28, 26, 59, .25); }
.seg a:hover { text-decoration: none; }

.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: .8rem; padding: 8px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid #eeeff7; vertical-align: middle; }
.table tbody tr:hover { background: #fafaff; }
.table th.num, .table td.num { text-align: right; }
.table td.row-actions { text-align: right; }
.row-actions .btn, .row-actions form { margin-left: 4px; }
.events-table td:first-child { min-width: 250px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 8px; }

.rounds-table td { padding: 6px; }
.rounds-table input { margin: 0 !important; padding: 7px 8px !important; font-size: .9rem !important; min-width: 90px; }
.rounds-table input[name="r_label[]"] { min-width: 110px; }
.rounds-table input[type=date] { min-width: 140px; }
.rounds-table .w-num { width: 90px; min-width: 70px; }
.rounds-table .idx { color: var(--ink-2); width: 28px; }
.generator { background: var(--bg); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.no-rounds { background: #eee8ff; color: #4a22bd; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 20px 0 16px; display: flex; gap: 8px; z-index: 5; }
.danger-zone { border-color: #f3c4c7; }
.steps-list { padding-left: 22px; margin: 0 0 14px; }
.steps-list li { margin-bottom: 6px; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 18px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; padding-bottom: 20px; }
.bar-fill { width: 100%; max-width: 28px; background: var(--brand); border-radius: 6px 6px 0 0; min-height: 2px; }
.bar:last-child .bar-fill { background: #ef6a00; }
.bar-val { font-size: .7rem; color: var(--ink-2); }
.bar-label { position: absolute; bottom: 0; font-size: .7rem; color: var(--ink-2); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid #eeeff7; }
.list li:last-child { border-bottom: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.round-summary { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.rs { display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--ink); font-size: .9rem; }
.rs:hover { border-color: var(--brand); text-decoration: none; }
.rs.on { border-color: var(--brand); background: var(--brand-soft); }
.rs.past { opacity: .65; }
.rs strong, .rs small { display: block; }
.rs small { color: var(--ink-2); }
.rs span { font-size: .8rem; color: var(--ink-2); }

.print-only { display: none; }

@media (max-width: 640px) {
  h1 { font-size: 1.4rem; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .hero { grid-template-columns: 1fr; padding: 26px 22px; border-radius: 20px; }
  .hero-art { display: none; }
  .tk-grid { grid-template-columns: 1fr; }
  .top-link { display: none; }
  .brand-text small { display: none; }
  .ev-head { padding: 18px 18px; border-left-width: 8px; }
  .ticket-q strong { font-size: 4.2rem; }
  .mine-strip { flex-wrap: wrap; }
  .mine-strip > .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ticket.printing, .soon-clock i { animation: none; }
  .tk, .meter span { transition: none; }
}

@media print {
  body { background: #fff; font-size: 12pt; }
  .no-print, .top, .topbar, .foot, .tabs, .back { display: none !important; }
  .print-only { display: block; }
  th.print-only, td.print-only { display: table-cell; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .table td, .table th { border-bottom: 1px solid #999; padding: 6px; }
  .sign-col { width: 30%; }
  .ticket { border: 2px solid #000; box-shadow: none; }
  .stats { display: none; }
}


/* =====================================================================
   รุ่น 6: หน้าตาใหม่ (ทับค่าเดิมด้านบน)
   ===================================================================== */
:root {
  --ink: #12113a;
  --ink-2: #5a5877;
  --bg: #f4f5fb;
  --line: #e4e5f1;
  --brand: #3436e8;
  --brand-deep: #1f20a8;
  --brand-soft: #ebebff;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(18, 17, 58, .05), 0 12px 32px -18px rgba(18, 17, 58, .28);
}
body { background: var(--bg); }
.wrap { max-width: 1040px; }

/* แถบบนแบบโปร่งแสง ติดด้านบนเวลาเลื่อน */
.top { position: sticky; top: 0; z-index: 30; margin-bottom: 26px; background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid rgba(18, 17, 58, .07); }
.top-in { min-height: 68px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px 12px 12px 4px; box-shadow: 0 6px 16px -6px rgba(52, 54, 232, .7); }
.brand-text strong { font-size: 1.08rem; }

/* ปุ่ม */
.btn { border-radius: 999px; padding: 10px 20px; transition: background .15s, box-shadow .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn.primary { box-shadow: 0 8px 20px -10px rgba(52, 54, 232, .9); }
.btn.block { border-radius: 16px; padding: 15px; font-size: 1.05rem; }
.btn.sm { border-radius: 999px; }

/* ช่องกรอก */
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea { border-radius: 14px; border-color: #d6d7ea; background: #fbfbfe; padding: 12px 14px; }
.form input:focus, .form select:focus, .form textarea:focus { background: #fff; }
.card { border-radius: var(--radius); border-color: transparent; }

/* หน้าแรก */
.hero { background: var(--ink); border-radius: 28px; padding: 40px 36px; margin-bottom: 34px; isolation: isolate; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(255, 255, 255, .09) 1.2px, transparent 1.3px); background-size: 18px 18px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); mask-image: linear-gradient(90deg, transparent, #000 60%); }
.hero::after { content: ''; position: absolute; z-index: -1; width: 420px; height: 420px; right: -120px; top: -160px; border-radius: 50%; background: var(--brand); opacity: .55; filter: blur(70px); }
.hero-org { color: #b9baf5; font-weight: 600; margin-bottom: 6px; }
.hero h1 { font-size: clamp(2rem, 5.4vw, 3.1rem); letter-spacing: -.01em; margin-bottom: 10px; }
.hero p { color: #d3d4f3; }
.hero-stats { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; padding: 0; }
.hero-stats li { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; padding: 10px 16px; min-width: 120px; }
.hero-stats strong { display: block; font-family: var(--head); font-size: 1.6rem; line-height: 1.15; color: #fff; }
.hero-stats span { font-size: .82rem; color: #c3c4ef; }
.tk { border-radius: 20px; }
.tk-stub { border-radius: 20px 0 0 20px; }
.block-title { font-size: 1.4rem; }

/* หัวกิจกรรม */
.ev-head { background: var(--surface); border-left: 0; border-top: 8px solid var(--c); border-radius: 24px; padding: 24px 26px; box-shadow: var(--shadow); }
.ev-head h1 { font-size: clamp(1.45rem, 3.8vw, 2.05rem); margin: 10px 0 14px; }
.ev-meta { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; padding: 0; }
.ev-meta li { background: var(--c-soft); border-radius: 14px; padding: 10px 14px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.ev-meta li.wide { grid-column: 1 / -1; }
.ev-meta span { display: block; font-size: .78rem; font-weight: 500; color: var(--c-ink); }
.ev-head .ev-when { color: var(--ink-2); margin-top: 12px !important; }
.desc { border-radius: 18px; border-color: transparent; box-shadow: var(--shadow); }

/* แท็บ */
.tabs { background: #e6e7f4; border-radius: 999px; padding: 5px; }
.tab { border-radius: 999px; }
.tab.active { box-shadow: 0 4px 12px -6px rgba(18, 17, 58, .35); }

/* ขั้นตอน */
.step { font-size: 1.2rem; margin: 30px 0 14px; }
.step span { background: var(--brand); box-shadow: 0 6px 14px -6px rgba(52, 54, 232, .8); }

/* ปุ่มเลือกวัน: ทุกวันขนาดเท่ากัน */
.day-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.day-chip { font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 10px 12px; border-radius: 20px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, background .15s, transform .15s; }
.day-chip:hover { border-color: var(--c); transform: translateY(-2px); }
.day-chip .dc-dow { font-size: .88rem; color: var(--ink-2); font-weight: 600; }
.day-chip .dc-num { font-family: var(--head); font-size: 2.3rem; font-weight: 700; line-height: 1.05; }
.day-chip .dc-mon { font-family: var(--head); font-weight: 600; font-size: .95rem; }
.day-chip .dc-left { margin-top: 6px; font-size: .78rem; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); }
.day-chip.full .dc-left { background: #ececf4; color: var(--ink-2); }
.day-chip.active { background: var(--c); border-color: var(--c); color: var(--c-on); }
.day-chip.active .dc-dow { color: inherit; opacity: .85; }
.day-chip.active .dc-left { background: rgba(255, 255, 255, .92); color: var(--c-ink); }
.day-chip:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

/* รอบในแต่ละวัน */
.rounds-wrap .day-group { margin-bottom: 18px; }
.rounds-wrap .day-title { font-size: 1.02rem; margin: 0 0 10px; color: var(--ink); }
.rounds-wrap.js-days .day-group { display: none; }
.rounds-wrap.js-days .day-group.active { display: block; }
.rounds-wrap.js-days .day-title { color: var(--c-ink); }
.rounds { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.round-body { border-radius: 18px; padding: 16px 18px; }
.round-time { font-size: 1.25rem; margin: 8px 0 2px; }
.round input:checked + .round-body { box-shadow: 0 0 0 4px var(--c-soft), 0 10px 24px -14px rgba(18, 17, 58, .4); }

/* แถบรอบที่เลือก (ติดด้านล่างจอมือถือ) */
.pick-bar { position: sticky; bottom: 12px; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 14px 12px 20px; border-radius: 20px; background: var(--ink); color: #fff; box-shadow: 0 18px 36px -16px rgba(18, 17, 58, .7); }
.pick-bar small { display: block; color: #b9baf5; font-size: .78rem; }
.pick-bar strong { font-size: .95rem; }
@media (min-width: 900px) { .pick-bar { display: none !important; } }

/* หลังบ้าน */
.topbar .brand-role { font-family: var(--body); font-weight: 500; color: #a9aad6; font-size: .8rem; margin-left: 6px; }
.dt-pair { display: grid; grid-template-columns: 1fr 96px; gap: 6px 8px; align-content: start; margin-bottom: 14px; }
.dt-pair .dt-label { grid-column: 1 / -1; font-weight: 600; font-size: .92rem; }
.form .dt-pair input { margin-top: 0 !important; }
.dt-pair .th-date { grid-column: 1 / -1; }
.th-date { display: block; color: var(--brand-deep); font-size: .78rem; font-weight: 600; margin-top: 3px; min-height: 1em; }
.form input.t24 { font-family: var(--head); font-weight: 600; letter-spacing: .04em; text-align: center; }
.form input.t24.bad { border-color: var(--err) !important; background: var(--err-soft) !important; }
.rounds-table input.t24 { min-width: 80px; width: 88px; }

@media (max-width: 640px) {
  .hero { padding: 30px 22px; border-radius: 24px; }
  .hero-stats li { min-width: 0; flex: 1 1 40%; }
  .day-strip { grid-template-columns: repeat(2, 1fr); }
  .ev-head { padding: 20px 18px; }
  .rounds { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) { .rounds { grid-template-columns: 1fr; } }
