/* =====================================================================
   public — หน้าสาธารณะ QR (โทนเขียวหัวเป็ด + ทองแดง ใช้ token ของ core app.css)
   ===================================================================== */
.pub-body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; color: var(--text); }
.pub-wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.pub-main { flex: 1; padding-bottom: 48px; }

/* top strip */
.pub-strip { background: #0b4450; color: rgba(255, 255, 255, .82); font-size: 12.5px; }
.pub-strip .pub-wrap { display: flex; justify-content: space-between; align-items: center; height: 34px; gap: 12px; }
.pub-strip i { opacity: .5; margin: 0 4px; font-style: normal; }
.pub-strip a { color: rgba(255, 255, 255, .72); font-weight: 600; }
.pub-strip a.on { color: var(--gold); }
.pub-strip-r { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }

/* nav */
.pub-nav { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); box-shadow: 0 6px 24px -18px rgba(11, 68, 80, .5); }
.pub-nav .pub-wrap { display: flex; align-items: center; gap: 20px; min-height: 74px; }
.pub-brand { display: flex; align-items: center; gap: 12px; color: inherit; min-width: 0; }
.pub-brand img { width: 50px; height: 50px; object-fit: contain; flex-shrink: 0; }
.pub-brand b { display: block; font-size: 16px; color: #0b4450; line-height: 1.3; }
.pub-brand small { display: block; font-size: 12px; color: var(--muted); }
.pub-brand.light b { color: #fff; } .pub-brand.light small { color: rgba(255, 255, 255, .7); }
.pub-links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.pub-links > a { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: #334155; white-space: nowrap; }
.pub-links > a:hover { background: var(--brand-soft); color: var(--brand); }
.pub-links > a.active { color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 -2px 0 var(--gold); }
.pub-links-end { display: inline-flex; gap: 8px; margin-left: 10px; }
.pub-burger { display: none; margin-left: auto; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; font-size: 22px; color: var(--brand); }

/* hero */
.pub-hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(1200px 400px at 85% -20%, rgba(196, 122, 53, .35), transparent 60%), linear-gradient(135deg, #0b4450 0%, var(--brand) 55%, var(--brand-2) 100%); }
.pub-hero::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px); background-size: 20px 20px; mask-image: linear-gradient(90deg, transparent 30%, #000); }
.pub-hero .pub-wrap { position: relative; padding-top: 56px; padding-bottom: 86px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 36px; align-items: center; }
.pub-hero .kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); font-size: 13px; font-weight: 600; }
.pub-hero .kicker i { color: var(--gold); }
.pub-hero h1 { color: #fff; font-size: 38px; line-height: 1.25; letter-spacing: -.02em; margin: 16px 0 12px; font-weight: 750; }
.pub-hero p { color: rgba(255, 255, 255, .86); font-size: 16px; line-height: 1.7; max-width: 640px; margin: 0; }
.pub-search { display: flex; gap: 8px; margin-top: 26px; padding: 7px; border-radius: 18px; background: #fff; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .5); max-width: 640px; }
.pub-search .input { border: 0; box-shadow: none; height: 46px; font-size: 15px; }
.pub-search select { border: 0; background-color: var(--surface-2); height: 46px; border-radius: 12px; max-width: 170px; }
.pub-search .btn { height: 46px; padding: 0 22px; }
.pub-hero-card { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); border-radius: 22px; padding: 20px; backdrop-filter: blur(6px); }
.pub-hero-card h3 { color: #fff; font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.pub-hero-card h3 i { color: var(--gold); }
.pub-hero-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed rgba(255, 255, 255, .2); color: #fff; }
.pub-hero-item:last-child { border-bottom: 0; }
.pub-hero-item:hover { color: #fff; }
.pub-hero-item .t { font-size: 13.5px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pub-hero-item .m { font-size: 12px; color: rgba(255, 255, 255, .7); margin-top: 2px; }
.pub-hero-item .d { flex-shrink: 0; width: 46px; text-align: center; border-radius: 12px; background: rgba(255, 255, 255, .14); padding: 6px 0; font-family: var(--font-num); line-height: 1.1; }
.pub-hero-item .d b { display: block; font-size: 18px; }
.pub-hero-item .d span { font-size: 11px; color: rgba(255, 255, 255, .75); }

/* counters overlapping hero */
.pub-counters { position: relative; margin-top: -52px; z-index: 2; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.pub-counter { background: #fff; border-radius: 18px; padding: 18px; border: 1px solid var(--line); box-shadow: var(--sh-lg); display: flex; gap: 12px; align-items: center; min-width: 0; }
.pub-counter .ci { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--tone-soft); color: var(--tone); flex-shrink: 0; }
.pub-counter .cv { font-family: var(--font-num); font-size: 24px; font-weight: 800; color: #0b4450; line-height: 1.1; white-space: nowrap; }
.pub-counter .cv small { font-size: 12px; font-weight: 600; color: var(--muted); font-family: var(--font); margin-left: 3px; }
.pub-counter .cl { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* notice */
.pub-notice { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 16px; background: var(--tone-soft); border: 1px solid color-mix(in srgb, var(--tone) 25%, transparent); color: var(--tone-ink); font-weight: 600; margin-top: 22px; }
.pub-notice i { font-size: 22px; color: var(--tone); flex-shrink: 0; }
.pub-notice a { margin-left: auto; white-space: nowrap; }

/* sections */
.pub-section { margin-top: 40px; }
.pub-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.pub-section-head h2 { font-size: 22px; color: #0b4450; margin: 0; display: flex; align-items: center; gap: 10px; }
.pub-section-head h2::before { content: ''; width: 6px; height: 26px; border-radius: 4px; background: linear-gradient(var(--gold), #e8a86f); }
.pub-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.pub-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pub-grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }

/* announcement card */
.pub-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-sm); color: inherit; transition: transform .2s var(--ease), box-shadow .2s var(--ease); position: relative; overflow: hidden; }
.pub-card::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--brand), var(--gold)); }
.pub-card:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); color: inherit; }
.pub-card .pc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.pub-card .pc-title { font-weight: 650; color: #0b4450; line-height: 1.45; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pub-card .pc-dept { font-size: 12.5px; color: var(--muted); }
.pub-card .pc-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; }
.pub-card .pc-kv span { display: block; color: var(--muted); }
.pub-card .pc-kv b { font-family: var(--font-num); font-size: 14px; color: #123c45; }
.pub-count { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--violet-soft); color: var(--violet-ink); font-size: 12px; font-weight: 700; white-space: nowrap; }
.pub-count.is-soon { background: var(--amber-soft); color: var(--amber-ink); }
.pub-count.is-past { background: var(--slate-soft); color: var(--slate-ink); }
.pub-count b { font-family: var(--font-num); font-weight: 700; }

/* page head */
.pub-head { background: linear-gradient(135deg, #0b4450, var(--brand)); color: #fff; padding: 22px 0 30px; position: relative; overflow: hidden; }
.pub-head::after { content: ''; position: absolute; right: -80px; top: -120px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(196, 122, 53, .35), transparent 65%); }
.pub-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: rgba(255, 255, 255, .7); position: relative; z-index: 1; }
.pub-crumbs a { color: rgba(255, 255, 255, .85); }
.pub-crumbs i { font-size: 10px; }
.pub-head-row { display: flex; align-items: center; gap: 16px; margin-top: 14px; position: relative; z-index: 1; }
.pub-head-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 30px; background: rgba(255, 255, 255, .14); color: var(--gold); flex-shrink: 0; }
.pub-head h1 { color: #fff; font-size: 26px; margin: 0; line-height: 1.3; }
.pub-head p { color: rgba(255, 255, 255, .82); margin: 4px 0 0; font-size: 14px; }
.pub-body-wrap { margin-top: 24px; }

/* tables in public */
.pub-body .table td.primary { white-space: normal; }
.pub-title-cell { font-weight: 600; color: #123c45; line-height: 1.45; max-width: 520px; white-space: normal; }
.pub-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 500; white-space: normal; }
.pub-winner { display: flex; align-items: center; gap: 8px; }
.pub-winner i { color: var(--gold); font-size: 18px; }

/* detail */
.pub-detail-head { display: flex; gap: 18px; align-items: flex-start; }
.pub-detail-head .ico { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); flex-shrink: 0; }
.pub-detail-head h2 { margin: 0; color: #0b4450; font-size: 20px; line-height: 1.4; }
.pub-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.pub-meta span { display: inline-flex; align-items: center; gap: 5px; }
.pub-steps { margin-top: 22px; }
.pub-winner-box { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 18px; background: linear-gradient(135deg, var(--gold-soft), #fff); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); }
.pub-winner-box .trophy { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; color: #fff; background: linear-gradient(135deg, #e8a86f, #c47a35); flex-shrink: 0; box-shadow: 0 10px 20px -10px #c47a35; }
.pub-winner-box b { display: block; font-size: 17px; color: #0b4450; }
.pub-winner-box .amt { margin-left: auto; text-align: right; font-family: var(--font-num); font-size: 22px; font-weight: 800; color: var(--gold-ink); white-space: nowrap; }
.pub-winner-box .amt small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); font-family: var(--font); }
.pub-qa { display: flex; flex-direction: column; gap: 10px; }
.pub-qa > div { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; }
.pub-qa .q { font-weight: 600; display: flex; gap: 8px; } .pub-qa .q i { color: var(--amber); }
.pub-qa .a { display: flex; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--text-2); } .pub-qa .a i { color: var(--emerald); }

/* sor kor ror 1 */
.pub-sk1 th { white-space: normal !important; font-size: 12px; vertical-align: bottom; }
.pub-sk1 td { font-size: 13px; vertical-align: top; }
.pub-sk1 .bidders { margin: 0; padding-left: 16px; }

/* complaint */
.pub-steps-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pub-steps-mini > div { border-radius: 16px; background: #fff; border: 1px solid var(--line); padding: 16px; }
.pub-steps-mini b { display: flex; align-items: center; gap: 8px; color: #0b4450; }
.pub-steps-mini b span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-family: var(--font-num); font-size: 13px; }
.pub-steps-mini p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.pub-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.pub-done { text-align: center; padding: 36px 20px; }
.pub-done .ring-ok { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; font-size: 44px; color: #fff; background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 16px 30px -14px #059669; }
.pub-code { display: inline-flex; gap: 10px; align-items: center; padding: 10px 18px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--line-2); font-family: var(--font-num); font-size: 20px; font-weight: 800; letter-spacing: .06em; color: #0b4450; }

/* quick links */
.pub-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pub-quick a { display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); color: inherit; box-shadow: var(--sh-xs); transition: .2s; }
.pub-quick a:hover { border-color: var(--brand); box-shadow: var(--sh); color: inherit; }
.pub-quick .qi { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; background: var(--tone-soft); color: var(--tone); flex-shrink: 0; }
.pub-quick b { display: block; font-size: 14px; color: #0b4450; } .pub-quick span { font-size: 12px; color: var(--muted); }

/* footer */
.pub-foot { background: #072f38; color: rgba(255, 255, 255, .75); padding-top: 40px; margin-top: auto; }
.pub-foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 26px; padding-bottom: 28px; }
.pub-foot h4 { color: #fff; font-size: 14px; margin: 0 0 12px; position: relative; padding-bottom: 8px; }
.pub-foot h4::after { content: ''; position: absolute; left: 0; bottom: 0; width: 28px; height: 3px; border-radius: 3px; background: var(--gold); }
.pub-foot a, .pub-foot span { display: block; color: rgba(255, 255, 255, .72); font-size: 13px; padding: 3px 0; }
.pub-foot a:hover { color: var(--gold); }
.pub-foot p { font-size: 13px; margin: 10px 0 0; }
.pub-copy { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 16px; padding-bottom: 20px; font-size: 12px; }
.pub-copy span { display: inline; padding: 0; }

@media (max-width: 1100px) {
  .pub-counters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pub-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pub-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pub-foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .pub-burger { display: grid; place-items: center; }
  .pub-links { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px 16px; box-shadow: var(--sh-lg); }
  .pub-menu-open .pub-links { display: flex; }
  .pub-links-end { margin: 8px 0 0; flex-wrap: wrap; }
  .pub-hero .pub-wrap { grid-template-columns: 1fr; padding-top: 34px; }
  .pub-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pub-wrap { padding: 0 16px; }
  .pub-brand img { width: 40px; height: 40px; }
  .pub-brand b { font-size: 14px; }
  .pub-hero h1 { font-size: 26px; }
  .pub-hero p { font-size: 14px; }
  .pub-search { flex-wrap: wrap; }
  .pub-search select { max-width: none; flex: 1; }
  .pub-counters { grid-template-columns: 1fr 1fr; margin-top: -40px; gap: 10px; }
  .pub-counter { padding: 14px; } .pub-counter .ci { width: 40px; height: 40px; font-size: 20px; } .pub-counter .cv { font-size: 19px; }
  .pub-grid-3, .pub-quick, .pub-steps-mini { grid-template-columns: 1fr; }
  .pub-head h1 { font-size: 21px; }
  .pub-detail-head { flex-direction: column; }
  .pub-winner-box { flex-wrap: wrap; } .pub-winner-box .amt { margin-left: 0; text-align: left; }
  .pub-foot-grid { grid-template-columns: 1fr; }
  .pub-notice { flex-wrap: wrap; } .pub-notice a { margin-left: 0; }
}
@media print {
  .pub-strip, .pub-nav, .pub-foot, .pub-head, .no-print { display: none !important; }
  .pub-body { background: #fff; }
}
.pub-steps { overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
@media (max-width: 640px) { .pub-steps .step { min-width: 78px; font-size: 11px; } .pub-steps .step b { font-size: 11.5px; } }

/* ===== GovAsset public QR additions ===== */
.mono { font-family: var(--font-num); letter-spacing: .01em; }
.pub-links > a.btn { margin-left: 6px; }
.pub-links { display: flex !important; position: static !important; flex-direction: row !important; padding: 0 !important; box-shadow: none !important; border: 0 !important; background: transparent !important; }
@media (max-width: 640px) { .pub-links > a span { display: none; } .pub-links > a { padding: 9px 10px; } .pub-brand small { display: none; } }
.pub-scan { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 22px; padding: 7px; border-radius: 18px; background: #fff; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .5); max-width: 620px; }
.pub-scan .input { border: 0; box-shadow: none; height: 48px; font-size: 15px; }
.pub-scan .btn { height: 48px; }
.pub-scan-btn { margin-top: 12px; display: inline-flex; gap: 8px; align-items: center; height: 52px; padding: 0 22px; border-radius: 16px; background: var(--gold); color: #fff; font-weight: 700; font-size: 16px; border: 0; cursor: pointer; box-shadow: 0 12px 30px -12px rgba(196, 122, 53, .8); }
.pub-scan-btn i { font-size: 22px; }
.pub-asset { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.pub-asset-img { aspect-ratio: 1; border-radius: 20px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font-size: 72px; color: var(--tone); border: 1px solid var(--line); }
.pub-asset-img img { width: 100%; height: 100%; object-fit: cover; }
.pub-asset h2 { margin: 0; color: #0b4450; font-size: 21px; line-height: 1.4; }
.pub-asset .no { font-family: var(--font-num); font-weight: 700; color: var(--muted); font-size: 14px; letter-spacing: .02em; }
.pub-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.pub-fact { padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.pub-fact span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pub-fact b { display: block; font-size: 14px; color: #123c45; margin-top: 2px; overflow-wrap: anywhere; }
.pub-state { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--tone-soft); color: var(--tone-ink); font-weight: 700; font-size: 14px; }
.pub-state i { font-size: 18px; color: var(--tone); }
.pub-cats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pub-photo-pick { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; border-radius: 16px; border: 2px dashed var(--line-2); background: var(--surface-2); color: var(--muted); cursor: pointer; font-weight: 600; }
.pub-photo-pick i { font-size: 28px; color: var(--gold); }
.pub-photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pub-thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.pub-thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.pub-done h2 { color: #0b4450; margin: 0 0 6px; }
.pub-track-tl .tl-item { padding-bottom: 16px; }
.pub-room-list .list-item { padding: 12px 16px; }
.pub-steps-mini b span { background: var(--brand); }
@media (max-width: 760px) {
  .pub-asset { grid-template-columns: 1fr; }
  .pub-asset-img { max-width: 220px; margin: 0 auto; width: 100%; }
  .pub-facts { grid-template-columns: 1fr 1fr; }
  .pub-scan { grid-template-columns: 1fr; }
}
