/* ==========================================================================
   silspm — public site (classic navy + gold)
   ========================================================================== */
body.site, body.blank { min-height: 100vh; display: flex; flex-direction: column; }
body.site main { flex: 1 0 auto; }
@media (max-width: 1239px) { body.site { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); } }

.top-banner { background: var(--crimson); color: #fff; text-align: center; padding: 7px 14px; font-weight: 600; font-size: .95rem; }
.top-banner .ic { margin-right: 4px; }

/* ---------- header ---------- */
.topbar { position: sticky; top: 0; z-index: 60; background: linear-gradient(180deg, var(--primary), var(--primary-deep)); color: #fff; border-bottom: 3px solid var(--accent); box-shadow: 0 4px 16px rgba(10, 16, 34, .25); }
.topbar-in { display: flex; align-items: center; gap: 16px; min-height: 62px; max-width: 1360px; }
.brand { display: flex; align-items: flex-start; gap: 10px; color: #fff; text-decoration: none; flex: 1 1 auto; min-width: 0; }
.brand img, .curtain-hint img { border-radius: 10px; object-fit: contain; flex: none; }
.brand-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.45; }
.brand-t b { display: block; font-family: var(--serif); font-size: 1.02rem; letter-spacing: .01em; line-height: 1.45; }
.brand-t small { display: block; font-size: .95rem; color: var(--accent-2); font-weight: 600; line-height: 1.4; }
.topnav { display: none; flex: 1; gap: 0; margin-left: 4px; flex-wrap: nowrap; }
.topnav a { color: rgba(255, 255, 255, .88); text-decoration: none; white-space: nowrap; padding: 8px 8px; border-radius: 8px; font-weight: 500; font-size: .92rem; position: relative; transition: background-color .15s; }
.topnav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.topnav a.is-active { color: var(--accent-2); }
.topnav a.is-active::after { content: ''; position: absolute; left: 11px; right: 11px; bottom: 2px; height: 2px; background: var(--accent-2); border-radius: 2px; }
.tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.tool { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; min-width: 40px; padding: 0 8px; border: 0; border-radius: 99px; background: transparent; color: #fff; cursor: pointer; font: inherit; font-weight: 600; text-decoration: none; }
.tool:hover { background: rgba(255, 255, 255, .14); }
.tool[aria-pressed="true"] { background: rgba(244, 162, 97, .28); color: var(--accent-2); }
.tool-txt { height: 36px; padding: 0 14px; gap: 7px; color: #F8D0B0; background: rgba(244, 162, 97, .14); border: 1px solid rgba(244, 162, 97, .62); font-size: .9rem; font-weight: 700; white-space: nowrap; }
.tool-txt:hover { color: #fff; background: rgba(244, 162, 97, .28); }
.tools .inline-form { display: inline-flex; align-items: center; }
.tool-out { height: 36px; padding: 0 12px; gap: 7px; color: rgba(255, 255, 255, .9); background: transparent; border: 1px solid rgba(255, 255, 255, .32); font-size: .9rem; font-weight: 700; white-space: nowrap; }
.tool-out:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.note { position: relative; }
.note-bell { position: relative; }
.note-bell .ic { transform-origin: 50% 2px; }
.note-bell.is-hot .ic { animation: note-ring .7s ease; }
@keyframes note-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(16deg); } 40% { transform: rotate(-14deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
.note-badge { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: #d0121a; color: #fff; font-size: .65rem; font-weight: 800; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--primary); }
.note-panel { position: fixed; z-index: 80; top: 70px; right: 12px; width: min(360px, calc(100vw - 24px)); max-height: min(70vh, 480px); display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 44px rgba(10, 16, 34, .28); overflow: hidden; }
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 8%, var(--surface)), var(--surface)); }
.note-head b { font-family: var(--serif); font-size: 1.05rem; }
.note-read { border: 0; background: none; color: var(--primary); font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer; }
.note-list { overflow: auto; }
.note-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line-2, var(--line)); }
.note-item:hover { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.note-item.is-new { background: color-mix(in srgb, #d0121a 6%, var(--surface)); }
.note-ic { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, var(--primary-2), var(--primary)); }
.note-ic-news { background: linear-gradient(160deg, #49d0b8, #0d7a70); }
.note-ic-urgent { background: linear-gradient(160deg, #f15b50, #c01818); }
.note-ic .ic { width: 1.05rem; height: 1.05rem; }
.note-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.note-copy b { font-size: .92rem; }
.note-copy span, .note-toast span span { color: var(--ink-2); font-size: .86rem; line-height: 1.35; }
.note-copy small { color: var(--ink-3); font-size: .75rem; }
.note-empty { margin: 0; padding: 22px 14px; text-align: center; color: var(--ink-3); }
.note-toast { position: fixed; z-index: 85; top: 74px; right: 14px; width: min(360px, calc(100vw - 24px)); display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--surface); color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 16px; box-shadow: 0 18px 40px rgba(10, 16, 34, .28); animation: note-in .35s cubic-bezier(.2, .8, .2, 1); }
.note-toast.is-out { opacity: 0; transform: translateY(-8px); transition: .25s ease; }
@keyframes note-in { from { opacity: 0; transform: translateY(-10px); } }
@media print { .note, .note-toast { display: none !important; } }
@media (min-width: 1240px) { .topbar-in { gap: 12px; } }
@media (max-width: 720px) {
  .topbar-in { align-items: flex-start; min-height: 0; padding-top: 8px; padding-bottom: 8px; }
  .brand { padding-top: 4px; }
  .brand-t b { font-size: .92rem; }
  .brand-t small { font-size: .82rem; }
}

/* ---------- bottom tab bar (mobile) ---------- */
.tabbar { position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(10, 16, 34, .1); }
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; font: inherit; font-size: .72rem; font-weight: 600; color: var(--ink-3); text-decoration: none; cursor: pointer; position: relative; }
.tabbar .ic { width: 1.5rem; height: 1.5rem; }
.tabbar .is-active { color: var(--primary); } :root[data-theme="dark"] .tabbar .is-active { color: var(--accent-2); }
.tabbar .is-active::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; background: var(--accent); border-radius: 0 0 4px 4px; }
@media (min-width: 1240px) { .tabbar { display: none; } }
dialog.sheet { margin: auto auto 0; max-width: 640px; width: 100%; border-radius: 20px 20px 0 0; }
@media (min-width: 700px) { dialog.sheet { margin: 8vh auto auto; border-radius: 16px; } }
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.menu-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 6px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; text-align: center; }
.menu-tile:hover { border-color: var(--accent); } .menu-tile .ic { color: var(--primary); } :root[data-theme="dark"] .menu-tile .ic { color: var(--accent-2); }
.q-results { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.q-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); background: var(--surface); }
.q-item:hover { border-color: var(--accent); } .q-item small { color: var(--ink-3); display: block; }
.q-type { flex: none; font-size: .72rem; padding: 1px 8px; border-radius: 99px; background: var(--bg-2); color: var(--ink-2); font-weight: 700; }

/* ---------- footer ---------- */
.foot { background: var(--primary-deep); color: #cfd6e6; margin-top: 40px; border-top: 3px solid var(--accent); }
.foot a { color: var(--accent-2); }
.foot-in { display: flex; justify-content: center; padding: 32px 16px 26px; }
.foot-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; max-width: 46rem; }
.foot-brand img { width: 68px; height: 68px; border-radius: 16px; object-fit: contain; flex: none; background: #fff; }
.foot-brand b { display: block; font-size: 1.2rem; line-height: 1.25; color: #fff; }
.foot-brand span { display: block; line-height: 1.3; }
.foot-brand > div > span:first-of-type { color: var(--accent-2); font-weight: 600; margin-top: 1px; }
.foot-brand .muted { color: #9aa6bf; margin-top: 1px; }
.foot-end { text-align: center; padding: 18px 16px 22px; border-top: 1px solid rgba(244, 162, 97, .22); background: linear-gradient(180deg, rgba(244, 162, 97, .07), transparent 78%); }
.credit { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.credit-kicker { display: flex; align-items: center; gap: 12px; padding-left: .32em; font-size: .68rem; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; color: var(--accent-2); }
.credit-kicker::before, .credit-kicker::after { content: ''; width: 36px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-2)); }
.credit-kicker::after { background: linear-gradient(90deg, var(--accent-2), transparent); }
.credit-name { font-family: var(--serif); font-size: 1.22rem; font-weight: 600; letter-spacing: .045em; line-height: 1.2; background: linear-gradient(180deg, #fff 10%, #F8D0B0 55%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- page head ---------- */
.page-head { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; padding: 26px 0 22px; position: relative; overflow: hidden; }
.page-head::after { content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 2px solid rgba(244, 162, 97, .35); box-shadow: 0 0 0 18px rgba(244, 162, 97, .07), 0 0 0 38px rgba(244, 162, 97, .04); }
.page-head h1 { color: #fff; margin: 0 0 4px; } .page-head p { margin: 0; color: #d6def0; max-width: 62ch; }
.page-head .crumb { font-size: 1.2rem; font-weight: 600; color: var(--accent-2); margin-bottom: 8px; }
.page-head .crumb a { color: inherit; }
.page-body { padding: 22px 0 10px; }
.sec { margin: 34px 0; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 10px; margin-bottom: 14px; }
.sec-head h2 { margin: 0; position: relative; padding-left: 14px; min-width: 0; } .sec-head h2::before { content: ''; position: absolute; left: 0; top: .2em; bottom: .2em; width: 5px; border-radius: 3px; background: linear-gradient(var(--accent-2), var(--accent)); }
.sec-head h2.with-update { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.update-badge { height: 32px; width: auto; display: block; }
.sec-head a { font-weight: 600; text-decoration: none; white-space: nowrap; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(900px 420px at 85% 10%, rgba(226, 91, 42, .28), transparent 60%), radial-gradient(700px 400px at 0% 100%, rgba(31, 78, 121, .45), transparent 60%), linear-gradient(160deg, var(--primary), var(--primary-deep) 70%); }
.hero::before { content: ''; position: absolute; inset: 0; opacity: .5; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cpath d='M28 4l6 10-6 10-6-10zM4 28l10-6 10 6-10 6zM32 28l10-6 10 6-10 6zM28 32l6 10-6 10-6-10z' fill='none' stroke='%23e8c766' stroke-opacity='.14' stroke-width='1'/%3E%3C/svg%3E"); }
.hero-rosette { position: absolute; right: -140px; top: -120px; width: 520px; height: 520px; opacity: .2; animation: spin 140s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-in { position: relative; padding: 38px 16px 34px; display: grid; gap: 22px; }
.hero .eyebrow { margin: 0; letter-spacing: .12em; font-size: .78rem; color: var(--accent-2); text-transform: uppercase; font-weight: 600; }
.hero h1 { color: #fff; margin: 0; font-size: clamp(1.7rem, 5.4vw, 3rem); text-shadow: 0 2px 12px rgba(0, 0, 0, .3); }
.hero-banner-wrap { position: relative; padding-top: 22px; }
.hero-banner { display: block; width: 100%; height: auto; object-fit: contain; object-position: center; border-radius: 12px; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .28)); }
.hero-has-banner .hero-in { padding-top: 22px; }
.hero-title-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hero h1 em { font-style: normal; color: var(--accent-2); display: inline-block; background: linear-gradient(180deg, #fff 10%, #F8D0B0 55%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero .tagline { font-family: var(--serif); font-size: clamp(1rem, 2.6vw, 1.3rem); color: #e8edf9; margin: 0; max-width: 56ch; }
.hero-meta { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; color: #d6def0; }
.hero-meta li { display: flex; gap: 6px; align-items: center; } .hero-meta .ic { color: var(--accent-2); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero .btn-outline { color: #fff; border-color: rgba(255, 255, 255, .45); } .hero .btn-outline:hover { background: rgba(255, 255, 255, .12); border-color: var(--accent-2); }
.countdown { display: flex; gap: 10px; flex-wrap: wrap; }
.cd-box { min-width: 70px; padding: 8px 10px; text-align: center; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(244, 162, 97, .35); backdrop-filter: blur(2px); }
.cd-box b { display: block; font-family: var(--serif); font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--accent-2); }
.cd-box span { font-size: .72rem; color: #cfd6e6; }
.live-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; background: rgba(179, 38, 30, .9); font-weight: 700; width: fit-content; }
.live-chip::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
@media (min-width: 900px) { .hero-in { grid-template-columns: 1.5fr 1fr; align-items: center; padding: 56px 16px 52px; } .hero-has-banner .hero-in { padding-top: 18px; } .hero-side { justify-self: end; } }

/* ---------- stats strip ---------- */
.strip { margin-top: -22px; position: relative; z-index: 2; }
.strip-in { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-l); overflow: hidden; }
.strip-it { padding: 16px 8px 14px; text-align: center; border-right: 1px solid var(--line-2); }
.strip-it:last-child { border-right: 0; }
.strip-it b { display: block; font-family: var(--serif); font-size: clamp(1.3rem, 3.6vw, 2rem); color: var(--primary); line-height: 1.1; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .strip-it b { color: var(--accent-2); }
.strip-it > span:last-child { font-size: .8rem; color: var(--ink-3); }
@media (max-width: 640px) { .strip-in { grid-template-columns: repeat(3, 1fr); } .strip-it:nth-child(3) { border-right: 0; } .strip-it:nth-child(n+4) { border-top: 1px solid var(--line-2); } }

/* ไอคอนทรงแอปมือถือบนแถบตัวเลข */
.app-ic { width: 48px; height: 48px; margin: 0 auto 8px; border-radius: 15px; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, var(--a1, var(--primary-2)), var(--a2, var(--primary))); box-shadow: 0 8px 14px rgba(14, 36, 56, .16), inset 0 1px 0 rgba(255, 255, 255, .4); }
.app-ic .ic { width: 1.4rem; height: 1.4rem; }
.app-ic-navy { --a1: #1F4E79; --a2: #16324F; }
.app-ic-gold { --a1: #F4A261; --a2: #E25B2A; color: #fff; }
.app-ic-blue { --a1: #6aaff5; --a2: #1d4f9c; }
.app-ic-teal { --a1: #49d0b8; --a2: #0d7a70; }
.app-ic-green { --a1: #5cbf86; --a2: #1b7a48; }
.app-ic-red { --a1: #f15b50; --a2: #c01818; }
.app-ic-amber { --a1: #f6c14a; --a2: #d4890b; color: #4a3000; }
@media (max-width: 640px) { .app-ic { width: 42px; height: 42px; border-radius: 13px; margin-bottom: 6px; } .app-ic .ic { width: 1.25rem; height: 1.25rem; } }
.app-ic.app-ic-sm { width: 34px; height: 34px; margin: 0; border-radius: 11px; flex: none; box-shadow: 0 7px 12px rgba(14, 36, 56, .16), inset 0 1px 0 rgba(255, 255, 255, .45); }
.app-ic.app-ic-sm .ic { width: 1.05rem; height: 1.05rem; }

/* ---------- quick tiles ---------- */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
.tiles.cert-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cert-kicker { margin: 22px 0 12px; font-size: 1.15rem; }
.cert-groups { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cert-group { display: flex; gap: 12px; align-items: center; padding: 14px 16px; text-decoration: none; color: inherit; border-top: 4px solid var(--gc, var(--primary)); }
.cert-group .gi { font-size: 1.7rem; line-height: 1; }
.cert-group b { display: block; font-family: var(--serif); line-height: 1.3; }
.cert-group small { color: var(--ink-3); }
.cert-events { display: grid; gap: 10px; }
.cert-ev { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; text-decoration: none; color: inherit; }
.cert-ev b { font-family: var(--serif); line-height: 1.35; }
.cert-ev-meta { display: flex; gap: 8px; align-items: center; }
@media (max-width: 980px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tiles, .tiles.cert-pick { grid-template-columns: 1fr; } }
.tile { display: grid; grid-template-columns: 52px 1fr; column-gap: 14px; row-gap: 2px; align-items: center; padding: 16px 18px; min-height: 104px; position: relative; overflow: hidden; }
.tile .ti { grid-row: 1 / span 2; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(145deg, var(--primary), var(--primary-2)); color: var(--accent-2); box-shadow: inset 0 0 0 1px rgba(244, 162, 97, .45); }
.tile .ti .ic { width: 1.45rem; height: 1.45rem; }
.tile b { font-family: var(--serif); font-size: 1.08rem; line-height: 1.25; align-self: end; }
.tile small { color: var(--ink-3); line-height: 1.45; align-self: start; }
.tile::after { content: ''; position: absolute; right: -24px; bottom: -24px; width: 90px; height: 90px; border-radius: 50%; background: var(--accent); opacity: .08; transition: transform .3s ease; }
.tile.is-hot { padding-right: 78px; }
.hot-badge { position: absolute; z-index: 2; pointer-events: none; display: block; height: auto; }
.tile .hot-badge { top: 8px; right: 8px; width: 64px; }
.menu-tile { position: relative; }
.menu-tile .hot-badge { top: 3px; right: 3px; width: 40px; }
.tile:hover::after { transform: scale(1.5); }

/* ---------- news ---------- */
.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-item { display: flex; gap: 14px; padding: 12px 14px; align-items: flex-start; text-decoration: none; color: inherit; }
.news-date { flex: none; width: 56px; text-align: center; border-radius: 10px; background: var(--primary); color: #fff; padding: 6px 0; line-height: 1.1; }
.news-date b { display: block; font-size: 1.4rem; font-family: var(--serif); } .news-date span { font-size: .72rem; color: var(--accent-2); }
.news-item h3 { margin: 0 0 2px; font-size: 1.02rem; } .news-item p { margin: 0; color: var(--ink-3); font-size: .9rem; }
.news-item.urgent { border-left: 4px solid var(--danger); } .news-item.pinned { border-left: 4px solid var(--accent); }
.article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.article-body { font-size: 1.04rem; line-height: 1.8; } .article-body a { word-break: break-all; }

/* ---------- result mini-cards ---------- */
.res-mini { display: flex; gap: 12px; align-items: center; padding: 12px 14px; }
.res-mini .mi { font-size: 1.7rem; flex: none; }
.res-mini b { display: block; line-height: 1.3; } .res-mini small { color: var(--ink-3); }

/* ---------- schedule ---------- */
.loc-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 0 0 12px; box-shadow: var(--shadow); }
.loc-card.is-done { opacity: .55; }
.loc-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.loc-sub { margin: 4px 0 10px; color: var(--ink-3); font-size: .92rem; }
.loc-site { display: flex; gap: 8px; align-items: flex-start; background: var(--info-bg); color: var(--info); border-radius: 12px; padding: 8px 12px; font-weight: 700; line-height: 1.35; }
.loc-site svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; }
.loc-room { margin: 8px 0 0; color: var(--ink-3); font-size: .92rem; }
.loc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.loc-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--info-bg); color: var(--info); border-radius: 999px; padding: 4px 10px; font-size: .84rem; font-weight: 600; }
.loc-chip svg { width: 15px; height: 15px; }
.loc-chip.is-time { background: var(--ok-bg); color: var(--ok); }
.venue-events { margin-bottom: 18px; }
.venue-events h2 { font-size: 1.05rem; margin: 0 0 12px; }
.sch-day { margin-bottom: 22px; }
.sch-day h3 { position: sticky; top: 62px; z-index: 3; background: var(--bg); padding: 8px 0; margin: 0; border-bottom: 2px solid var(--accent); font-size: 1.1rem; }
.sch-row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); align-items: start; }
.sch-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--primary); line-height: 1.25; } :root[data-theme="dark"] .sch-time { color: var(--accent-2); }
.sch-time small { display: block; font-weight: 500; color: var(--ink-3); }
.sch-title { font-weight: 600; } .sch-meta { font-size: .88rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.sch-row.is-now { background: linear-gradient(90deg, rgba(226, 91, 42, .14), transparent); border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.sch-board tr.sch-cat td { background: color-mix(in srgb, var(--gc, var(--primary)) 12%, var(--surface)); color: var(--ink); font-family: var(--serif); font-weight: 800; font-size: 1.02rem; border-bottom: 1px solid var(--line); border-left: 4px solid var(--gc, var(--primary)); }
.sch-board .sch-cat-n { margin-left: 8px; font-family: var(--sans, inherit); font-weight: 600; font-size: .8rem; color: var(--ink-3); }
.sch-board tr.is-now td { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.sch-place { min-width: 12rem; }
.sch-place-main { display: flex; align-items: flex-start; gap: 6px; font-weight: 700; line-height: 1.35; color: var(--ink); }
.sch-place-main .ic { width: 1rem; height: 1rem; margin-top: 2px; color: var(--primary); }
.sch-place-room { display: block; margin-top: 3px; padding-left: 22px; color: var(--ink-3); font-size: .84rem; line-height: 1.35; }
.sch-unset { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; background: var(--bg-2); color: var(--ink-3); font-size: .78rem; font-weight: 700; white-space: nowrap; }

/* ภาพรวมตารางของรายการเดียว */
.sch-sheet { max-width: 760px; margin: 0 auto 16px; overflow: hidden; border-top: 6px solid var(--gc, var(--primary)); }
.sch-sheet-head { padding: 22px 26px 4px; background: linear-gradient(180deg, color-mix(in srgb, var(--gc, var(--primary)) 16%, var(--surface)), var(--surface) 78%); }
.sch-kicker { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--primary); }
.sch-sheet h2 { margin: 10px 0 4px; font-size: clamp(1.35rem, 2.5vw, 1.9rem); line-height: 1.35; }
.sch-code { font-variant-numeric: tabular-nums; margin-right: 6px; }
.sch-level { margin: 0 0 8px; color: var(--ink-2); font-weight: 700; }
.sch-ticket { display: grid; grid-template-columns: 128px 1fr; gap: 16px; align-items: center; margin: 12px 22px 18px; padding: 14px; border-radius: 18px; background: linear-gradient(145deg, var(--primary), color-mix(in srgb, var(--gc, var(--primary)) 55%, var(--primary))); color: #fff; box-shadow: 0 14px 28px rgba(20, 32, 60, .18); }
.sch-cal { background: #fff; color: var(--primary); border-radius: 14px; text-align: center; padding: 10px 8px 12px; box-shadow: inset 0 0 0 1px rgba(244, 162, 97, .55); }
.sch-cal span { display: block; font-weight: 800; letter-spacing: .04em; }
.sch-cal b { display: block; font-family: var(--serif); font-size: 2.7rem; line-height: .95; margin: 2px 0; }
.sch-cal small { display: block; color: var(--ink-3); font-weight: 700; }
.sch-ticket-main .dow { font-weight: 800; color: var(--accent-2); font-size: 1.05rem; }
.sch-ticket-main .hours { font-family: var(--serif); font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.2; margin: 4px 0 8px; }
.sch-state { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: .82rem; font-weight: 800; }
.sch-ticket.is-live .sch-state { background: var(--accent-2); color: var(--accent-ink); }
.sch-ticket.is-open { background: var(--surface); color: var(--ink); box-shadow: none; border: 1px dashed var(--line); }
.sch-ticket.is-open .sch-cal { background: var(--bg-2); box-shadow: none; }
.sch-ticket.is-open .dow { color: var(--ink-2); }
.sch-ticket.is-open .sch-state { background: var(--bg-2); color: var(--ink-3); }
.sch-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 22px 8px; }
.sch-fact { text-align: center; border: 1px solid var(--line); border-radius: 16px; padding: 14px 10px 12px; background: var(--surface); }
.sch-fact .app-ic { width: 42px; height: 42px; border-radius: 13px; }
.sch-fact small { display: block; color: var(--ink-3); font-weight: 700; font-size: .78rem; margin-bottom: 3px; }
.sch-fact b { display: block; font-size: 1.02rem; line-height: 1.35; }
.sch-fact-sub { display: block; margin-top: 2px; color: var(--ink-3); font-size: .82rem; }
.sch-sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 22px 18px; }
.sch-nav { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sch-nav.is-single { grid-template-columns: 1fr; }
.sch-nav.is-single .sch-jump.is-next { text-align: left; }
.sch-jump { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; text-decoration: none; color: inherit; min-height: 92px; }
.sch-jump small { color: var(--ink-3); font-weight: 700; }
.sch-jump b { font-variant-numeric: tabular-nums; color: var(--primary); }
.sch-jump span { line-height: 1.35; }
.sch-jump.is-next { text-align: right; }
@media (max-width: 640px) {
  .sch-sheet-head { padding: 16px 14px 2px; }
  .sch-ticket, .sch-facts, .sch-sheet-actions { margin-left: 12px; margin-right: 12px; }
  .sch-facts, .sch-sheet-actions { padding-left: 0; padding-right: 0; }
  .sch-ticket { grid-template-columns: 96px 1fr; gap: 10px; padding: 10px; }
  .sch-cal b { font-size: 2.1rem; }
  .sch-facts { grid-template-columns: 1fr; }
  .sch-nav { grid-template-columns: 1fr; }
  .sch-jump.is-next { text-align: left; }
}

/* ---------- กรรมการตัดสิน: แยกหมวดและรายการ ---------- */
.judge-cat { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 8px 0 14px; font-family: var(--serif); font-size: 1.45rem; color: var(--primary); text-align: center; }
.judge-cat::before, .judge-cat::after { content: ''; height: 2px; width: min(120px, 18vw); border-radius: 99px; background: linear-gradient(90deg, transparent, var(--gc, var(--accent))); }
.judge-cat::after { background: linear-gradient(90deg, var(--gc, var(--accent)), transparent); }
.judge-ev { margin: 0 0 18px; overflow: hidden; }
.judge-ev-head { padding: 14px 18px 12px; border-bottom: 2px solid var(--accent); background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.judge-ev-head h3 { margin: 0; font-size: 1.12rem; line-height: 1.55; text-decoration: underline; text-decoration-color: var(--primary); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.judge-ev-head .code { font-weight: 800; margin-right: 4px; }
.judge-table { width: 100%; }
.judge-table th:nth-child(1), .judge-table td.no { width: 72px; text-align: center; }
.judge-table th:nth-child(4) { width: 24%; }
.judge-ev-head .lv { font-weight: 600; color: var(--ink-2); }
.judge-ev .table-wrap { border-radius: 0; }
.judge-table th { font-size: .92rem; }
.judge-table td { vertical-align: middle; }
.judge-table tr.is-chair td { background: color-mix(in srgb, var(--accent-2) 32%, var(--surface)); }
.judge-role { font-weight: 700; }
.judge-role.role-chair { color: #6b5200; }
.judge-role.role-secretary { color: var(--info); }
:root[data-theme="dark"] .judge-role.role-chair { color: var(--accent-2); }
@media (max-width: 640px) { .judge-cat { font-size: 1.2rem; gap: 8px; } .judge-ev-head h3 { font-size: 1.02rem; } }
@media (max-width: 640px) {
  .table-stack tr.sch-cat td { display: block; text-align: left; }
  .table-stack tr.sch-cat td::before { display: none; }
}
.sch-row.is-done { opacity: .55; }
.now-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; color: #fff; background: var(--danger); border-radius: 99px; padding: 1px 9px; }
.now-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.4s infinite; }
.sch-row.kind-ceremony .sch-title { color: var(--crimson); } :root[data-theme="dark"] .sch-row.kind-ceremony .sch-title { color: #ff9aa6; }
@media (max-width: 520px) { .sch-row { grid-template-columns: 74px 1fr; gap: 8px; } }

/* ---------- criteria / documents ---------- */
.group-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.gpill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 10px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; }
.gpill:hover { border-color: var(--gc, var(--accent)); } .gpill.is-active { background: var(--gc, var(--primary)); border-color: var(--gc, var(--primary)); color: #fff; }
.doc-item { display: flex; gap: 12px; padding: 12px 14px; align-items: center; }
.doc-ext { flex: none; width: 46px; height: 46px; border-radius: 10px; background: var(--info-bg); color: var(--info); display: grid; place-items: center; font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.rubric { width: 100%; border-collapse: collapse; font-size: .93rem; } .rubric td { padding: 6px 8px; border-bottom: 1px dashed var(--line); } .rubric td:last-child { text-align: right; font-weight: 700; width: 70px; }

/* ---------- people / schools ---------- */
.person-card { display: flex; gap: 12px; align-items: center; padding: 12px; }
.person-card .avatar { width: 54px; height: 54px; }
.school-card { display: flex; flex-direction: column; padding: 16px 16px 14px; min-height: 152px; }
.school-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.school-name { display: block; font-family: var(--serif); font-size: 1.08rem; line-height: 1.4; word-break: keep-all; overflow-wrap: normal; }
.school-name span, .school-net span { white-space: nowrap; }
.school-net { display: block; margin-top: 3px; color: var(--accent-ink); font-size: .82rem; font-weight: 700; line-height: 1.4; word-break: keep-all; overflow-wrap: normal; }
.school-stats { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.school-stat { display: flex; align-items: center; gap: 8px; min-width: 0; }
.school-stat-t b { display: block; font-family: var(--serif); font-size: 1.2rem; line-height: 1; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.school-stat-t small { display: block; margin-top: 2px; font-size: .72rem; font-weight: 700; color: var(--ink-3); }
.school-stat.is-medal .school-stat-t b { color: #8a5a00; }
:root[data-theme="dark"] .school-stat-t b { color: var(--accent-2); }
:root[data-theme="dark"] .school-stat.is-medal .school-stat-t b { color: #f3d77a; }

/* ---------- login / auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; background: radial-gradient(800px 400px at 80% 0%, rgba(226, 91, 42, .28), transparent 60%), linear-gradient(160deg, var(--primary), var(--primary-deep)); }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border-radius: 20px; padding: 28px 24px; box-shadow: var(--shadow-l); border-top: 5px solid var(--accent); }
.auth-card .logo { text-align: center; margin-bottom: 8px; } .auth-card .logo img { width: 72px; height: 72px; object-fit: contain; border-radius: 12px; }
.auth-card h1 { text-align: center; font-size: 1.35rem; margin-bottom: 2px; } .auth-card .sub { text-align: center; color: var(--ink-3); font-size: .9rem; margin-bottom: 18px; }
.pw-wrap { position: relative; } .pw-wrap .btn { position: absolute; right: 4px; top: 4px; }

/* ---------- misc ---------- */
.err-page { text-align: center; padding: 70px 16px; } .err-code { font-family: var(--serif); font-size: 5rem; font-weight: 800; color: var(--accent); line-height: 1; }
.err-debug { text-align: left; background: #111; color: #9ef; padding: 12px; border-radius: 8px; overflow: auto; }
.flash-wrap { padding-top: 14px; }
.verify-card { max-width: 560px; margin: 0 auto; }
.verify-ok { border-top: 5px solid var(--ok); } .verify-bad { border-top: 5px solid var(--danger); }
.verify-org { color: var(--ink-3); margin: 0 0 10px; }
.verify-no { font-family: var(--serif); font-size: 1.65rem; font-weight: 700; line-height: 1.25; color: var(--primary); margin: 0 0 14px; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 6px 12px; } .kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: normal; word-break: normal; text-wrap: pretty; }
.kv.kv-200 { grid-template-columns: 200px minmax(0, 1fr); } .kv.kv-240 { grid-template-columns: 240px minmax(0, 1fr); }
@media (max-width: 640px) { .kv, .kv.kv-200, .kv.kv-240 { grid-template-columns: minmax(0, 1fr); gap: 0 12px; } .kv dt { margin-top: 8px; font-size: .82rem; } .kv dt:first-child { margin-top: 0; } }
.filters { display: grid; gap: 10px; grid-template-columns: 1fr 1fr 1fr auto; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin-bottom: 18px; }
.filters.sch-filters { grid-template-columns: minmax(160px, .8fr) minmax(220px, 1.6fr) minmax(140px, .7fr) minmax(160px, .9fr); }
.filters .field { margin: 0; }
@media (max-width: 820px) { .filters { grid-template-columns: 1fr 1fr; } } @media (max-width: 520px) { .filters { grid-template-columns: 1fr; } }
.install-banner { display: none; }
@media print { .topbar, .tabbar, .foot, .top-banner, .hero-rosette, .no-print { display: none !important; } body { background: #fff; } }

/* ---------- มือถือ: ย้ายปุ่มประหยัดพลังงาน/ธีมไปในเมนู ---------- */
.show-pref { display: none; }
.menu-pref { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.menu-pref .btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #2a2100; }
@media (max-width: 560px) { .tool-pref { display: none; } .show-pref { display: flex; } }

/* ---------- รายการลงทะเบียนสาธารณะ ---------- */
.reg-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.reg-ev { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; min-height: 148px; color: inherit; text-decoration: none; }
.reg-ev-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.reg-ev b { font-family: var(--serif); font-size: 1.08rem; line-height: 1.4; }
.reg-ev-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px 12px; color: var(--ink-3); font-size: .86rem; font-weight: 600; }
.reg-ev-foot .ic { width: .95rem; height: .95rem; vertical-align: -2px; }
.reg-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.reg-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 12px); padding: 14px 10px 12px; text-align: center; box-shadow: var(--shadow); }
.reg-stats b { display: block; font-family: var(--serif); font-size: 1.55rem; line-height: 1.1; color: var(--primary); }
.reg-stats > div > span:last-child { color: var(--ink-3); font-size: .82rem; }
.reg-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.reg-roster th { background: var(--primary); color: #fff; border-bottom: 3px solid var(--accent); letter-spacing: .01em; }
.reg-roster td { vertical-align: top; }
.reg-roster .no { font-family: var(--serif); font-weight: 800; color: var(--ink-3); width: 64px; }
.reg-roster td.net { font-weight: 800; color: var(--primary); white-space: nowrap; }
.reg-roster td.grp { font-weight: 700; color: var(--primary); min-width: 14rem; }
.reg-stats.reg-stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 440px; margin-left: auto; margin-right: auto; }
.reg-roster .school { font-family: var(--serif); font-weight: 700; }
.reg-roster .who { line-height: 1.55; color: var(--ink-2); }
.reg-roster tbody tr.is-a td { background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.reg-roster tbody tr.is-b td { background: var(--surface); }
.reg-roster tbody tr:hover td { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
@media (max-width: 720px) { .reg-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) {
  .reg-roster td.net { white-space: normal; }
  .reg-roster tbody tr { border-left: 4px solid var(--primary); }
  .reg-roster tbody tr.is-b { border-left-color: var(--accent); }
}
@media (max-width: 560px) { .reg-stats { grid-template-columns: repeat(2, 1fr); } }
@media print {
  .reg-roster th { background: #16324F !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .reg-roster tbody tr.is-a td { background: #f4f6fb !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- ไทม์ไลน์กำหนดการสำคัญ (หน้าแรก) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.tl-item { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 16px 14px 14px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--line); border-radius: var(--radius, 12px); }
.tl-item .tl-dot { position: absolute; top: -11px; left: 14px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); display: grid; place-items: center; color: #fff; }
.tl-item .tl-dot .ic { width: 11px; height: 11px; }
.tl-date { font-size: .8rem; font-weight: 700; color: var(--ink-3); letter-spacing: .01em; }
.tl-title { font-family: var(--serif); font-size: 1.02rem; line-height: 1.35; color: var(--ink); }
.tl-item small { color: var(--ink-3); line-height: 1.4; }
.tl-item .chip { margin-top: 4px; }
.tl-item.is-done { border-top-color: var(--ok, #2f7d4f); } .tl-item.is-done .tl-dot { background: var(--ok, #2f7d4f); border-color: var(--ok, #2f7d4f); }
.tl-item.is-now { border-top-color: var(--accent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface) 60%); } .tl-item.is-now .tl-dot { background: var(--accent); border-color: var(--accent); }
.tl-item.is-next { border-top-color: var(--primary); } .tl-item.is-next .tl-dot { border-color: var(--primary); }
:root:not([data-eco="1"]) .tl-item.is-now .tl-dot { animation: tlpulse 2s ease-out infinite; }
@keyframes tlpulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@media (prefers-reduced-motion: reduce) { .tl-item.is-now .tl-dot { animation: none !important; } }
@media (max-width: 640px) {
  .timeline { grid-template-columns: 1fr; gap: 10px; padding-left: 12px; border-left: 3px solid var(--line); }
  .tl-item { border-top-width: 1px; border-left: 4px solid var(--line); }
  .tl-item .tl-dot { top: 14px; left: -22px; }
  .tl-item.is-done { border-top-color: var(--line); border-left-color: var(--ok, #2f7d4f); } .tl-item.is-now { border-top-color: var(--line); border-left-color: var(--accent); } .tl-item.is-next { border-top-color: var(--line); border-left-color: var(--primary); }
}

/* ---------- แถบ "มีผลการแข่งขันใหม่" (live.js) ---------- */
.live-banner { position: fixed; z-index: 80; left: 50%; top: calc(var(--topbar-h, 56px) + 10px); transform: translateX(-50%); max-width: calc(100vw - 24px); display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 8px 28px rgba(10, 16, 34, .35); border: 1px solid rgba(255, 255, 255, .18); }
.live-banner .btn { min-height: 34px; padding: 2px 14px; }
.live-x { border: 0; background: none; color: #fff; opacity: .7; cursor: pointer; font-size: 1rem; padding: 4px 6px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #3ddc84; flex: none; }
:root:not([data-eco="1"]) .live-banner { animation: livein .35s ease-out; }
:root:not([data-eco="1"]) .live-dot { animation: tlpulse 1.8s ease-out infinite; }
@keyframes livein { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 640px) { .live-banner { top: 10px; } }
