/* =====================================================================
   VIBE X TOWN — Whitelist
   ธีมเดียวกับสคริปต์ recall_character (shape: rounded · vignette · darkGradient)
   หลักการ: ไม่ใช้เส้นขอบ — แยกชั้นด้วยพื้นไล่สี, มุมมน 1rem/.5rem,
            หัวข้อไล่สีบนตัวอักษร, ตอบสนองด้วย opacity .8→1 และ scale .95
   สี:  primary #cde6ff · mix #677380 · dark #1e2026 · onPrimary #1e2026 · alert #ff0044
   ฟอนต์: อังกฤษ Satoshi · ไทย Anuphan
   ===================================================================== */

:root {
  --font-sans: 'Satoshi', 'Anuphan', system-ui, -apple-system, sans-serif;
  --font-mono: var(--font-sans);

  --w-light: 500;
  --w-regular: 600;
  --w-medium: 700;
  --w-bold: 800;

  --radius: 16px;      /* การ์ด/แผง = 1rem */
  --radius-sm: 8px;    /* ปุ่ม/ช่องกรอก = .5rem */
  --radius-xs: 5px;    /* แถวในลิสต์ = .25rem */

  --maxw: 1080px;
  --maxw-nav: min(2800px, 98vw);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 0.2s;
  --t-mid: 0.3s;
  --t-slow: 0.4s;
  --letter: 0.01em;
}

/* ---------- ธีมมืด (ค่าเริ่มต้น) ---------- */
:root,
[data-theme='dark'] {
  /* บอกเบราว์เซอร์ว่าหน้านี้ธีมมืด รายการ dropdown ของ select
     กับแถบเลื่อนจะได้เป็นสีเข้มตาม ไม่ขึ้นพื้นขาวโพลน */
  color-scheme: dark;
  --bg: #1E2026;
  --bg-elev: #24272E;

  /* ชั้นพื้นผิว — ไล่สีขึ้นบน แบบ dark-gradient / light-gradient ในสคริปต์ */
  --panel: linear-gradient(to top, rgba(205, 230, 255, 0.055), rgba(205, 230, 255, 0.022)), linear-gradient(to top, rgba(26, 28, 34, 0.86), rgba(26, 28, 34, 0.68));
  --panel-solid: #23262D;
  --panel-2: linear-gradient(to top, rgba(205, 230, 255, 0.04), rgba(205, 230, 255, 0.015)), linear-gradient(to top, rgba(26, 28, 34, 0.5), rgba(26, 28, 34, 0.34));
  --field: linear-gradient(to top, rgba(205, 230, 255, 0.10), rgba(205, 230, 255, 0.045));
  --hover: rgba(205, 230, 255, 0.09);
  --sunken: rgba(18, 20, 24, 0.55);

  --border: rgba(205, 230, 255, 0.07);       /* ใช้เฉพาะเส้นคั่นบาง ๆ */
  --border-strong: rgba(205, 230, 255, 0.16);

  --nav-bg: rgba(24, 26, 31, 0.82);
  --text: #CDE6FF;
  --text-dim: rgba(205, 230, 255, 0.62);
  --text-mute: rgba(205, 230, 255, 0.42);

  --accent: #CDE6FF;
  --accent-2: #E7F3FF;
  --accent-mix: #677380;
  --accent-dark: #677380;
  --accent-ink: #1E2026;
  --accent-soft: rgba(205, 230, 255, 0.12);
  --accent-grad: linear-gradient(to top, #CDE6FF, #677380);

  --glow: rgba(205, 230, 255, 0.22);
  --danger: #FF0044;
  --danger-grad: linear-gradient(to top, #FF0044, rgba(255, 0, 68, 0.7));
  --success: #63D9A5;
  --warn: #E9B95C;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
  --vignette: radial-gradient(128% 108% at 50% 42%, transparent 52%, rgba(10, 12, 15, 0.55) 100%);
}

/* ---------- ธีมสว่าง ---------- */
[data-theme='light'] {
  --bg: #EDF1F6;
  --bg-elev: #FFFFFF;
  color-scheme: light;

  --panel: linear-gradient(to top, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78));
  --panel-solid: #FFFFFF;
  --panel-2: linear-gradient(to top, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.62));
  --field: linear-gradient(to top, rgba(75, 90, 106, 0.10), rgba(75, 90, 106, 0.04));
  --hover: rgba(75, 90, 106, 0.09);
  --sunken: rgba(75, 90, 106, 0.07);

  --border: rgba(75, 90, 106, 0.12);
  --border-strong: rgba(75, 90, 106, 0.24);

  --nav-bg: rgba(255, 255, 255, 0.84);
  --text: #1E2026;
  --text-dim: rgba(30, 32, 38, 0.64);
  --text-mute: rgba(30, 32, 38, 0.44);

  --accent: #4C5A69;
  --accent-2: #35424F;
  --accent-mix: #677380;
  --accent-dark: #35424F;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(76, 90, 105, 0.10);
  --accent-grad: linear-gradient(to top, #677380, #35424F);

  --glow: rgba(76, 90, 105, 0.18);
  --danger: #D4003A;
  --danger-grad: linear-gradient(to top, #D4003A, rgba(212, 0, 58, 0.78));
  --success: #157A50;
  --warn: #96650A;
  --shadow: 0 20px 44px -28px rgba(30, 40, 56, 0.35);
  --vignette: radial-gradient(128% 108% at 50% 42%, transparent 58%, rgba(120, 134, 150, 0.18) 100%);
}

* { box-sizing: border-box; letter-spacing: var(--letter); }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: var(--w-light);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* =====================================================================
   ฉากหลัง — ภาพหัวจาง + darkGradient + vignette (ตาม effects ในคอนฟิก)
   ===================================================================== */
html::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 470px; z-index: -4; pointer-events: none;
  background-image: url('../img/header-vibex.webp');
  background-size: cover; background-position: 50% 26%; background-repeat: no-repeat;
  opacity: .3; filter: saturate(.66) brightness(.96);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 30%, rgba(0,0,0,.3) 62%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 30%, rgba(0,0,0,.3) 62%, transparent 100%);
}
html::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 470px; z-index: -3; pointer-events: none;
  background: linear-gradient(180deg, rgba(30,32,38,.72) 0%, rgba(30,32,38,.16) 26%, rgba(30,32,38,.38) 62%, rgba(30,32,38,.72) 100%);
}
/* vignette */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: var(--vignette);
}
html[data-theme='light']::before { opacity: .16; filter: saturate(.5) brightness(1.16); }
html[data-theme='light']::after {
  background: linear-gradient(180deg, rgba(237,241,246,.66) 0%, rgba(237,241,246,.22) 32%, rgba(237,241,246,.6) 100%);
}
@media (max-width: 820px) {
  html::before { height: 430px; background-position: 64% 26%; }
  html::after { height: 430px; }
}

a { color: var(--accent); text-decoration: none; transition: opacity var(--t-fast) var(--ease-soft); }
a:hover { text-decoration: none; opacity: .75; }

h1, h2, h3, h4 { line-height: 1.32; margin: 0 0 .5em; font-weight: var(--w-bold); }

/* หัวข้อไล่สีบนตัวอักษร — เหมือน .character-form-title */
.grad, .hero .grad, .stat.accent .n {
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.section { padding: 30px 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.muted { color: var(--text-dim); }
.center { text-align: center; }

/* ---------- ป้ายกำกับเล็ก (แบบ .character-form-label) ---------- */
.hud {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: var(--w-regular);
  color: var(--text); opacity: .5; letter-spacing: .06em;
}
/* (ไม่มีจุดนำหน้าป้ายแล้ว) */

/* =====================================================================
   แถบบน — โปร่ง ไม่มีเส้นขอบ
   ===================================================================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.nav-inner { max-width: var(--maxw-nav); margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 18px; }

.brand { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: var(--w-bold); line-height: 1.15; }
.brand .logo { width: 40px; height: 40px; display: grid; place-items: center; flex: none; }
.brand .logo img {
  width: 40px; height: 40px; object-fit: contain; display: block;
  transition: transform var(--t-slow) var(--ease-soft);
}
.brand:hover .logo img { transform: scale(1.06); }
.brand .bx-a {
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.brand .bx-b { color: var(--text); opacity: .7; font-weight: var(--w-light); margin-left: 2px; }
.brand small { display: block; margin-top: 1px; font-size: 10px; font-weight: var(--w-light); color: var(--text); opacity: .42; letter-spacing: .14em; }

.nav-links { display: flex; align-items: center; gap: 3px; margin-left: auto; }
.nav-tools { display: flex; align-items: center; gap: 8px; flex: none; margin-left: 12px; }
.nav-links a {
  position: relative; color: var(--text); opacity: .5;
  display: inline-flex; align-items: center; height: 36px;
  font-weight: var(--w-regular); font-size: 14px; line-height: 1;
  padding: 0 15px; border-radius: var(--radius-sm);
  transition: opacity var(--t-fast) var(--ease-soft), background var(--t-fast) var(--ease-soft);
}
.nav-links a:hover { opacity: 1; background: var(--hover); }
.nav-links a.active { opacity: 1; font-weight: var(--w-bold); background: var(--accent-soft); }

.avatar { width: 22px; height: 22px; border-radius: 50%; flex: none; display: block; object-fit: cover; }
.nav-acct { position: relative; }
.nav-user {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-sans); font-weight: var(--w-regular); font-size: 14px; color: var(--text);
  padding: 7px 13px 7px 8px; border: 0; background: var(--field);
  border-radius: 100vh; max-width: 230px; cursor: pointer; opacity: .85;
  transition: opacity var(--t-fast) var(--ease-soft), scale var(--t-fast) var(--ease-soft);
}
.nav-user:hover, .nav-acct.open .nav-user { opacity: 1; }
.nav-user:active { scale: .96; }
.nav-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nav-user .caret { flex: none; color: var(--accent); opacity: .7; transition: transform var(--t-fast) var(--ease); }
.nav-acct.open .caret { transform: rotate(180deg); }

.acct-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  min-width: 224px; padding: 12px;
  background: var(--panel-solid); border-radius: 12px; box-shadow: var(--shadow);
  display: none; animation: slideIn .3s var(--ease-soft);
}
.nav-acct.open .acct-menu { display: flex; flex-direction: column; gap: 4px; }
.acct-menu form { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--border); }
.acct-menu a, .acct-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  font-family: var(--font-sans); font-size: 14px; font-weight: var(--w-light); text-align: left;
  color: var(--text); opacity: .62; background: transparent; border: 0; cursor: pointer;
  padding: 9px 11px; border-radius: var(--radius-xs);
  transition: opacity var(--t-fast) var(--ease-soft), background var(--t-fast) var(--ease-soft);
}
.acct-menu a:hover, .acct-menu button:hover { opacity: 1; background: var(--hover); }
.acct-menu a.active { opacity: 1; background: var(--accent-soft); font-weight: var(--w-regular); }
.acct-menu button.danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.acct-menu svg { flex: none; color: var(--accent); opacity: .85; }

.theme-toggle {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; background: var(--field); color: var(--accent);
  border-radius: 50%; cursor: pointer; opacity: .8;
  transition: opacity var(--t-fast) var(--ease-soft), scale var(--t-fast) var(--ease-soft);
}
.theme-toggle:hover { opacity: 1; }
.theme-toggle:active { scale: .9; }
.theme-toggle .ico-sun { display: none; }
[data-theme='light'] .theme-toggle .ico-sun { display: block; }
[data-theme='light'] .theme-toggle .ico-moon { display: none; }

/* =====================================================================
   แผง — พื้นไล่สี ไม่มีเส้นขอบ
   ===================================================================== */
.panel {
  position: relative;
  padding: 26px;
  background: var(--panel);
  border-radius: var(--radius);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.panel.glow { background: var(--panel); }
.bracket::before, .bracket::after { content: none; }

.card-grid { display: grid; gap: 10px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* =====================================================================
   ปุ่ม — opacity .8 → 1, กดแล้วย่อ .95
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-sans); font-weight: var(--w-regular); font-size: 13.5px;
  line-height: 1; height: 36px; padding: 0 18px; cursor: pointer; border: 0;
  border-radius: var(--radius-sm); text-decoration: none;
  background: var(--field); color: var(--text); opacity: .8;
  transition: opacity var(--t-fast) var(--ease-soft), scale var(--t-fast) var(--ease-soft), background var(--t-fast) var(--ease-soft);
}
.btn:hover { opacity: 1; text-decoration: none; }
.btn:active { scale: .95; }
.btn-primary { background: var(--accent-grad); color: var(--accent-ink); font-weight: var(--w-medium); }
.btn-ghost { background: var(--field); color: var(--text); }
.btn-danger { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.btn-success { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.btn-lg { height: 36px; padding: 0 22px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .4; cursor: not-allowed; scale: 1; }
.discord-btn { background: #5865F2; color: #fff; }

/* =====================================================================
   ป้ายสถานะ / ชิป — ทรงแคปซูล ไม่มีขอบ
   ===================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 8px; line-height: 1.9;
  font-size: 12.5px; font-weight: var(--w-regular);
  padding: 3px 14px; border-radius: 100vh; border: 0;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-pending { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.badge-approved { color: var(--success); background: color-mix(in srgb, var(--success) 15%, transparent); }
.badge-rejected { color: var(--danger); background: color-mix(in srgb, var(--danger) 16%, transparent); }
.badge-info { color: var(--accent); background: var(--accent-soft); }

.pill {
  display: inline-flex; align-items: center; line-height: 1.9;
  font-size: 12.5px; font-weight: var(--w-light); color: var(--text); opacity: .62;
  background: var(--field); border-radius: 100vh; padding: 3px 14px; border: 0;
}

/* =====================================================================
   หัวหน้าเว็บ
   ===================================================================== */
.hero { padding: 56px 0 28px; text-align: center; }
.hero .hud { justify-content: center; }
.hero h1 { font-size: clamp(30px, 5vw, 50px); margin-bottom: 12px; font-weight: var(--w-bold); text-wrap: balance; }
.hero p { color: var(--text); opacity: .6; font-size: 15px; max-width: 600px; margin: 0 auto; }

/* =====================================================================
   หน้าข้อตกลง
   ===================================================================== */
.tos-warning {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px; margin-bottom: 22px; border-radius: 12px; border: 0;
  background: color-mix(in srgb, var(--danger) 11%, transparent);
}
.tos-warning .ico { color: var(--danger); flex: none; line-height: 0; margin-top: 3px; }
.tos-warning strong { font-weight: var(--w-medium); }

.tos-section { display: flex; gap: 16px; padding: 18px 0; }
.tos-section + .tos-section { box-shadow: inset 0 1px 0 var(--border); }
.tos-section:first-child { padding-top: 0; }
.tos-section h3 { font-size: 16px; margin: 0 0 8px; font-weight: var(--w-medium); }
.tos-section ul { margin: 0; padding-left: 18px; color: var(--text); opacity: .62; list-style: none; }
.tos-section li { margin: 6px 0; position: relative; }
.tos-section li::before {
  content: ''; position: absolute; left: -16px; top: .78em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .7;
}
.tos-no {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-grad); color: var(--accent-ink); font-weight: var(--w-bold); font-size: 13.5px;
}
.agree-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-top: 26px; padding-top: 22px; box-shadow: inset 0 1px 0 var(--border);
}

/* =====================================================================
   บัตรประจำตัวพลเมือง (หน้าสถานะของฉัน)
   ===================================================================== */
.idcard {
  position: relative; overflow: hidden;
  border-radius: var(--radius); margin-bottom: 16px;
  background: var(--panel);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
/* ลายน้ำโลโก้จาง ๆ มุมขวา */
.idcard::before {
  content: ''; position: absolute; right: -34px; top: 50%; translate: 0 -50%;
  width: 260px; height: 260px; pointer-events: none; opacity: .05;
  background: url('../img/logo.png') center / contain no-repeat;
}
/* แสงกวาดผ่านหน้าบัตรตอนเปิดหน้า */
.idcard::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 38%, rgba(205, 230, 255, .10) 50%, transparent 62%);
  background-size: 220% 100%;
  animation: sheen 2.4s var(--ease-soft) .4s 1 both;
}
@keyframes sheen { from { background-position: -140% 0; } to { background-position: 240% 0; } }

.idcard-top {
  display: flex; align-items: center; gap: 12px; padding: 13px 22px;
  background: linear-gradient(90deg, rgba(205, 230, 255, .13), rgba(205, 230, 255, .03) 55%, transparent);
}
[data-theme='light'] .idcard-top { background: linear-gradient(90deg, rgba(75, 90, 106, .12), rgba(75, 90, 106, .03) 55%, transparent); }
.idcard-top img { width: 26px; height: 26px; object-fit: contain; flex: none; }
.idcard-org { font-size: 14px; font-weight: var(--w-bold); line-height: 1.2; }
.idcard-kind { font-size: 10px; letter-spacing: .18em; color: var(--text); opacity: .45; }
.idcard-top .badge { margin-left: auto; }

.idcard-body { display: flex; gap: 22px; padding: 22px; align-items: flex-start; flex-wrap: wrap; }

.idcard-photo { flex: none; width: 128px; text-align: center; }
.idcard-photo img {
  width: 128px; height: 128px; object-fit: cover; display: block;
  border-radius: 14px; background: var(--sunken);
}
.idcard-rank {
  display: block; margin-top: 9px; font-size: 11.5px; font-weight: var(--w-regular);
  padding: 4px 0; border-radius: 100vh; color: var(--accent-ink); background: var(--accent-grad);
}
.idcard-rank.plain { background: var(--field); color: var(--text); opacity: .7; }

.idcard-info { flex: 1 1 300px; min-width: 260px; }
.idcard-welcome { font-size: 12.5px; color: var(--text); opacity: .55; }
.idcard-name { font-size: 26px; font-weight: var(--w-bold); line-height: 1.25; margin: 2px 0 0; }
.idcard-user { font-size: 13px; color: var(--text); opacity: .5; }

.idcard-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; margin-top: 16px;
}
.idcard-field { background: var(--sunken); border-radius: var(--radius-sm); padding: 9px 13px; }
.idcard-field .k { display: block; font-size: 10px; letter-spacing: .14em; color: var(--text); opacity: .42; }
.idcard-field .v { display: block; font-size: 14.5px; font-weight: var(--w-medium); margin-top: 1px; font-variant-numeric: tabular-nums; }

.idcard-foot {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 12px 22px; margin-top: 2px;
  box-shadow: inset 0 1px 0 var(--border);
  font-size: 12.5px; color: var(--text); opacity: .5;
}
.idcard-foot b { font-weight: var(--w-medium); font-variant-numeric: tabular-nums; opacity: 1; }
.idcard-copy { cursor: pointer; transition: opacity var(--t-fast) var(--ease-soft); }
.idcard-copy:hover { opacity: 1; }

@media (max-width: 620px) {
  .idcard-body { gap: 16px; padding: 18px; }
  .idcard-photo { width: 96px; margin: 0 auto; }
  .idcard-photo img { width: 96px; height: 96px; }
  .idcard-grid { grid-template-columns: 1fr 1fr; }
  .idcard-name { font-size: 22px; }
}

/* =====================================================================
   หน้าสถานะผู้เล่น
   ===================================================================== */
.stat { text-align: center; padding: 22px 16px; }
.stat .n { font-size: 32px; font-weight: var(--w-bold); line-height: 1.15; }
.stat .l { font-size: 12px; color: var(--text); opacity: .5; margin-top: 3px; }
.statlink { text-decoration: none; color: inherit; cursor: pointer; opacity: .78;
  transition: opacity var(--t-fast) var(--ease-soft), scale var(--t-fast) var(--ease-soft); }
.statlink:hover { opacity: 1; text-decoration: none; }
.statlink:active { scale: .97; }
.statlink.on { opacity: 1; background: var(--field); }
.statlink.on .l { opacity: .75; }

.ring {
  --p: 0;
  position: relative; width: 136px; height: 136px; flex: none;
  display: grid; place-items: center; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(205,230,255,.10) 0);
}
.ring::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--bg); }
.ring .val { position: relative; z-index: 1; font-size: 29px; font-weight: var(--w-bold); line-height: 1; }
.ring .cap { position: relative; z-index: 1; font-size: 11px; color: var(--text); opacity: .5; }

/* =====================================================================
   หน้าสอบ
   ===================================================================== */
.exam-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.timer {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 20px; font-weight: var(--w-bold);
  color: var(--accent-ink); background: var(--accent-grad);
  padding: 8px 20px; border-radius: 100vh; opacity: .9;
}
.timer.danger { background: var(--danger-grad); color: #fff; opacity: 1; }

.q { padding: 22px 24px; }
.q + .q { margin-top: 10px; }
.q .q-no { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: var(--w-regular); color: var(--text); opacity: .45; margin-bottom: 7px; }
.q .q-text { font-size: 16px; font-weight: var(--w-medium); margin-bottom: 14px; line-height: 1.55; }
.q-flash { background: color-mix(in srgb, var(--danger) 12%, transparent); }

.opt { display: block; cursor: pointer; margin-top: 6px; }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt .box {
  display: flex; align-items: center; gap: 13px;
  padding: 9px 14px; border-radius: var(--radius-sm); border: 0;
  background: var(--sunken); font-weight: var(--w-light); line-height: 1.5;
  transition: background var(--t-fast) var(--ease-soft);
}
.opt:hover .box { background: var(--hover); }
.opt .dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  background: rgba(205, 230, 255, .14); display: grid; place-items: center;
  transition: background var(--t-fast) var(--ease-soft);
}
.opt .dot::after {
  content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-grad);
  transform: scale(0); transition: transform var(--t-fast) var(--ease);
}
.opt input:checked + .box { background: var(--accent-soft); }
.opt input:checked + .box .dot { background: rgba(205, 230, 255, .22); }
.opt input:checked + .box .dot::after { transform: scale(1); }
.opt input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }

/* =====================================================================
   ช่องกรอก — พื้นไล่สี ไม่มีขอบ
   ===================================================================== */
textarea, input[type='text'], input[type='url'], input[type='number'], select {
  width: 100%; font-family: var(--font-sans); font-size: 14.5px; font-weight: var(--w-light);
  color: var(--text); background: var(--field); border: 0; border-radius: var(--radius-sm);
  padding: 13px 16px; transition: background var(--t-fast) var(--ease-soft), box-shadow var(--t-fast) var(--ease-soft);
}
textarea:focus, input[type='text']:focus, input[type='url']:focus,
input[type='number']:focus, select:focus {
  outline: none; background: var(--hover); box-shadow: inset 0 0 0 1px var(--border-strong);
}
textarea { min-height: 108px; resize: vertical; line-height: 1.65; }
/* รายการที่กางออกมาของ select — ถ้าไม่สั่งไว้ Chrome บน Windows จะขึ้นพื้นขาว
   ตัดกับธีมมืดของเว็บจนแสบตา */
select option, select optgroup {
  background: var(--panel-solid);
  color: var(--text);
}
select option:checked { background: var(--hover); }
textarea::placeholder, input::placeholder { color: var(--text); opacity: .4; }
label.field { display: block; font-weight: var(--w-light); margin-bottom: 8px; font-size: 12.5px; color: var(--text); opacity: .5; }

/* =====================================================================
   ตาราง → ลิสต์การ์ด (เหมือนแถวตัวละครในสคริปต์)
   ===================================================================== */
.table-wrap { overflow-x: auto; border: 0; background: none; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: 14px; }
table.data th {
  text-align: left; padding: 2px 18px 6px;
  font-size: 11.5px; font-weight: var(--w-light); color: var(--text); opacity: .42;
  white-space: nowrap; border: 0;
}
table.data td { padding: 15px 18px; border: 0; background: var(--panel); transition: background var(--t-fast) var(--ease-soft); }
table.data td:first-child { border-radius: 12px 0 0 12px; }
table.data td:last-child { border-radius: 0 12px 12px 0; }
table.data tr:hover td { background: var(--hover); }
.user-cell { display: flex; align-items: center; gap: 12px; }
.user-cell .avatar { width: 36px; height: 36px; }

/* =====================================================================
   หน้าตรวจใบสมัคร
   ===================================================================== */
.ans { padding: 16px 18px; border: 0; background: var(--panel-2); border-radius: 12px; }
.ans + .ans { margin-top: 9px; }
.ans .q-text { font-weight: var(--w-medium); margin-bottom: 9px; }
.ans .opt-line { display: flex; align-items: center; gap: 9px; padding: 5px 0; color: var(--text); opacity: .62; font-size: 14px; }
.ans .opt-line.correct { color: var(--success); opacity: 1; font-weight: var(--w-regular); }
.ans .opt-line.picked-wrong { color: var(--danger); opacity: 1; font-weight: var(--w-regular); }
.ans .free { white-space: pre-wrap; padding: 13px 16px; background: var(--sunken); border: 0; border-radius: var(--radius-sm); }

/* =====================================================================
   จัดการข้อสอบ
   ===================================================================== */
.qform { padding: 24px 26px; }
.qform-inline { background: var(--field); }
.qform-inline h3 {
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.qcard { padding: 18px 20px; }
.qcard + .qcard { margin-top: 9px; }
.opt-row { display: flex; align-items: center; gap: 11px; }
.opt-row input[type='radio'] { accent-color: var(--accent); flex: none; width: 17px; height: 17px; }
.edit-bar { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.edit-bar span { color: var(--text); opacity: .55; font-size: 13px; }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; padding: 5px; background: var(--sunken); border-radius: 100vh; width: fit-content; }
.tabs a {
  padding: 9px 20px; font-weight: var(--w-regular); font-size: 14px;
  color: var(--text); opacity: .5; border-radius: 100vh;
  transition: opacity var(--t-fast) var(--ease-soft), background var(--t-fast) var(--ease-soft);
}
.tabs a:hover { opacity: 1; text-decoration: none; }
.tabs a.active { opacity: 1; font-weight: var(--w-medium); color: var(--accent-ink); background: var(--accent-grad); }
.tabs a.active::before, .tabs a.active::after { content: none; }

/* =====================================================================
   หน้ากฎ
   ===================================================================== */
.rule-cat { background: var(--panel); border-radius: var(--radius); overflow: hidden; border: 0; transition: background var(--t-fast) var(--ease-soft); }
.rule-cat + .rule-cat { margin-top: 9px; }
.rule-head {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px 20px; cursor: pointer; background: transparent; border: 0;
  font-family: var(--font-sans); font-size: 15px; font-weight: var(--w-regular); color: var(--text);
  text-align: left; transition: background var(--t-fast) var(--ease-soft);
}
.rule-head:hover { background: var(--hover); }
.rule-no {
  flex: none; min-width: 30px; height: 30px; display: grid; place-items: center; padding: 0 9px;
  border-radius: 100vh; background: var(--accent-grad); color: var(--accent-ink);
  font-size: 13px; font-weight: var(--w-bold);
}
.rule-title { flex: 1 1 auto; min-width: 0; }
.rule-chevron { flex: none; color: var(--accent); opacity: .7; transition: transform var(--t-slow) var(--ease); }
.rule-cat.open .rule-chevron { transform: rotate(180deg); }
.rule-body { display: none; padding: 0 20px 18px 64px; }
.rule-cat.open .rule-body { display: block; animation: slideIn .34s var(--ease-soft); }
.rule-body ul { margin: 0; padding-left: 18px; color: var(--text); opacity: .62; list-style: none; }
.rule-body li { margin: 6px 0; position: relative; }
.rule-body li::before { content: ''; position: absolute; left: -16px; top: .78em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .7; }

/* =====================================================================
   แจ้งเตือน
   ===================================================================== */
.flash {
  display: flex; align-items: center; gap: 12px;
  max-width: min(var(--maxw), calc(100% - 36px)); margin: 16px auto 0; padding: 14px 18px;
  border: 0; background: var(--panel-solid); border-radius: 12px; box-shadow: var(--shadow);
  animation: slideIn .38s var(--ease-soft) both;
  transition: opacity var(--t-fast) var(--ease-soft), transform var(--t-fast) var(--ease-soft);
}
.flash.hide { opacity: 0; transform: translateY(-1vh); }
.flash-ico { flex: none; line-height: 0; }
.flash-msg { flex: 1 1 auto; font-weight: var(--w-light); font-size: 14.5px; }
.flash-x {
  flex: none; background: none; border: 0; cursor: pointer; color: var(--text);
  opacity: .4; font-size: 18px; line-height: 1; padding: 3px 6px; border-radius: 50%;
  font-family: var(--font-sans);
  transition: opacity var(--t-fast) var(--ease-soft), background var(--t-fast) var(--ease-soft);
}
.flash-x:hover { opacity: 1; background: var(--hover); }
.flash-success .flash-ico { color: var(--success); }
.flash-error .flash-ico { color: var(--danger); }
.flash-warn .flash-ico { color: var(--warn); }
.flash-info .flash-ico { color: var(--accent); }

/* =====================================================================
   กล่องยืนยัน — .confirmation-modal
   ===================================================================== */
.ui-modal {
  position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(14, 16, 20, .62);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  animation: fadeIn .3s ease both;
}
.ui-modal-card {
  width: min(400px, 100%); padding: 26px; text-align: center;
  background: var(--panel-solid); border-radius: var(--radius); box-shadow: var(--shadow);
  animation: slideIn .34s var(--ease-soft) both;
}
.ui-modal-ico { color: var(--warn); line-height: 0; margin-bottom: 10px; }
.ui-modal-msg { font-size: 15px; font-weight: var(--w-light); line-height: 1.65; }
.ui-modal-actions { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
.ui-modal-actions .btn { flex: 1 1 0; }

/* =====================================================================
   ตัวแก้ข้อตกลงในหน้าเว็บ
   ===================================================================== */
.ted-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 200;
  background: var(--accent-grad); color: var(--accent-ink); border: none; border-radius: 100vh;
  padding: 14px 26px; font-family: var(--font-sans); font-weight: var(--w-regular); font-size: 14.5px;
  cursor: pointer; opacity: .85; box-shadow: var(--shadow);
  transition: opacity var(--t-fast) var(--ease-soft), scale var(--t-fast) var(--ease-soft);
}
.ted-fab:hover { opacity: 1; }
.ted-fab:active { scale: .95; }
.ted-bar {
  position: sticky; top: 74px; z-index: 60;
  display: flex; gap: 9px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 16px; border: 0;
  background: var(--panel-solid); border-radius: 12px; box-shadow: var(--shadow);
}
.ted-bar .ttl { font-weight: var(--w-medium); margin-right: auto; }
.ted-bar .btn, .ted-actions .btn { padding: 9px 18px; font-size: 13.5px; }
.ted-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ted-card { padding: 18px 20px; border: 0; background: var(--panel-2); border-radius: 12px; }
.ted-card h3 { margin-top: 0; font-size: 16px; }
.ted-sec { border: 0; padding: 15px 17px; background: var(--panel-2); border-radius: 12px; }
.ted-sec + .ted-sec { margin-top: 9px; }
.ted-seclist { display: flex; flex-direction: column; gap: 9px; }
.ted-sechead { display: flex; align-items: center; gap: 11px; }
.ted-sechead .ted-no {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-grad); color: var(--accent-ink); font-weight: var(--w-bold); font-size: 13px;
}
.ted-sechead .ted-title { flex: 1 1 auto; min-width: 0; }
.ted-sechead input { width: 100%; }
.ted-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 11px; }
.ted-row { display: flex; align-items: flex-start; gap: 9px; }
.ted-row textarea, .ted-field textarea { min-height: 62px; }
.ted-field { margin-top: 12px; }
.ted-field label { display: block; font-weight: var(--w-light); margin-bottom: 7px; font-size: 12.5px; color: var(--text); opacity: .5; }
.ted-grip { flex: none; cursor: grab; color: var(--text); opacity: .4; padding: 8px 5px; border-radius: var(--radius-xs); background: none; border: 0; font-family: var(--font-sans); }
.ted-grip:hover { opacity: 1; background: var(--hover); }
.ted-grip:active { cursor: grabbing; }
.ted-mini {
  flex: none; padding: 8px 13px; font-size: 12.5px; font-weight: var(--w-light);
  color: var(--text); background: var(--field); border: 0; border-radius: var(--radius-xs);
  cursor: pointer; font-family: var(--font-sans); opacity: .8;
  transition: opacity var(--t-fast) var(--ease-soft), background var(--t-fast) var(--ease-soft), color var(--t-fast) var(--ease-soft);
}
.ted-mini:hover { opacity: 1; }
.ted-mini.wide { width: 100%; text-align: center; }
.ted-mini.del:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.ted-hint { color: var(--text); opacity: .42; font-size: 12.5px; margin-top: 7px; }
.ted-bk { display: none; }
.ted-modal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(14,16,20,.62); }
.ted-toast {
  position: fixed; left: 50%; bottom: 26px; translate: -50% 0; z-index: 410;
  padding: 12px 24px; border-radius: 100vh; font-weight: var(--w-regular); font-size: 14px;
  background: var(--accent-grad); color: var(--accent-ink); box-shadow: var(--shadow);
  animation: slideIn .3s var(--ease-soft);
}
.ted-dragging { opacity: .5; }
body.ted-dragon { user-select: none; }

/* =====================================================================
   ฟอร์มตั้งค่าเว็บ
   ===================================================================== */
.setform .set-grid { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.setform .set-hint { display: block; margin-top: 7px; font-size: 12.5px; color: var(--text); opacity: .42; line-height: 1.55; }
.setform .set-check {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border: 0; background: var(--sunken); border-radius: var(--radius-sm);
  cursor: pointer; transition: background var(--t-fast) var(--ease-soft);
}
.setform .set-check:hover { background: var(--hover); }
.setform .set-check input { margin-top: 4px; flex: none; accent-color: var(--accent); width: 17px; height: 17px; }
.setform .set-check b { display: block; font-size: 14.5px; font-weight: var(--w-regular); }
@media (max-width: 720px) { .setform .set-grid { grid-template-columns: 1fr; } }

/* =====================================================================
   หน้าลงทะเบียนชื่อตัวละคร — /register
   ===================================================================== */
.reg-preview {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 20px; padding: 15px 18px;
  background: var(--sunken); border-radius: var(--radius-sm);
}
.reg-preview-k { font-size: 12.5px; color: var(--text); opacity: .45; }
.reg-preview-v {
  margin-left: auto; font-size: 17px; font-weight: var(--w-bold);
  letter-spacing: .2px; color: var(--accent);
}
.reg-preview.empty .reg-preview-v { color: var(--text); opacity: .3; font-weight: var(--w-light); }
/* ช่องที่กรอกผิด — ขอบแดง (ช่องกรอกของเว็บนี้ไม่มี border ใช้ box-shadow แทน) */
input.is-bad, input.is-bad:focus { box-shadow: inset 0 0 0 1.5px var(--danger); }
.reg-rules > b { display: block; font-size: 14px; margin-bottom: 9px; }
.reg-rules ul { margin: 0; padding-left: 20px; }
.reg-rules li {
  color: var(--text); opacity: .6; font-size: 13.5px; line-height: 1.85;
  font-weight: var(--w-light);
}
.reg-rules code {
  padding: 1px 6px; border-radius: 5px; background: var(--sunken);
  font-family: var(--font-mono); font-size: 12.5px; opacity: 1;
}
@media (max-width: 560px) {
  .reg-preview-v { margin-left: 0; width: 100%; }
}

/* =====================================================================
   หน้า "ยืนยันให้เพื่อน" — /vouch
   ---------------------------------------------------------------------
   ยึดภาษาภาพเดียวกับทั้งเว็บ : ไม่ใช้เส้นขอบ แยกชั้นด้วยพื้นไล่สี
   มุมมน 1rem/.5rem หัวข้อไล่สีบนตัวอักษร และแถบเน้นสีฟ้าอ่อนของแบรนด์
   ===================================================================== */
.vx-wrap { max-width: 733px; margin: 0 auto; }   /* พอดีเป๊ะกับความยาวข้อความที่ยาวที่สุด — บรรทัดเดียวจบ */

/* ---------- หัวเรื่อง ---------- */
.vx-hero { text-align: center; margin-bottom: 26px; }
.vx-kicker {
  display: inline-block; font-size: 11px; font-weight: var(--w-regular);
  letter-spacing: .18em; color: var(--text); opacity: .42;
}
.vx-title {
  font-size: 30px; margin: 8px 0 0; line-height: 1.25;
  letter-spacing: -0.01em;
}
.vx-sub {
  margin: 10px 0 0; font-size: 14.5px; line-height: 1.85;
  color: var(--text); opacity: .55; font-weight: var(--w-light);
}

/* ---------- แถบขั้นตอน 3 ขั้น ---------- */
.vx-steps {
  list-style: none; margin: 0 0 20px; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.vx-steps li {
  position: relative; padding: 15px 16px 16px;
  background: var(--panel-2); border-radius: var(--radius-sm);
  display: flex; flex-direction: column; gap: 7px;
}
/* เส้นเชื่อมระหว่างขั้น */
.vx-steps li + li::before {
  content: ''; position: absolute; left: -10px; top: 50%;
  width: 10px; height: 1px; background: var(--border-strong);
}
.vx-step-no {
  font-size: 12px; font-weight: var(--w-bold); letter-spacing: .08em;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.vx-step-tx {
  font-size: 12.5px; line-height: 1.7;
  color: var(--text); opacity: .55; font-weight: var(--w-light);
}
.vx-step-tx b { opacity: 1; font-weight: var(--w-regular); }
@media (max-width: 620px) {
  .vx-steps { grid-template-columns: 1fr; }
  .vx-steps li + li::before { left: 50%; top: -10px; width: 1px; height: 10px; }
}

/* ---------- การ์ดฟอร์มหลัก ---------- */
.vx-card { padding: 26px 26px 24px; }
.vx-card > * + * { margin-top: 18px; }

/* ช่องแรกในการ์ดไม่ต้องเว้นบน ที่เหลือเว้นเท่ากันหมดตามกฎ .vx-card > * + * */
.vx-card > .vx-field:first-of-type { margin-top: 0; }
.vx-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: var(--w-light);
  color: var(--text); opacity: .55; margin-bottom: 10px;
}
/* ป้าย "ไม่บังคับ" ต่อท้ายชื่อช่อง */
.vx-label-opt {
  padding: 2px 7px; border-radius: 100px;
  background: var(--field); font-size: 11px; opacity: .8;
}
.vx-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-grad); flex: none;
}

/* ช่องกรอกใหญ่ มีไอคอนนำหน้า */
.vx-input { position: relative; }
.vx-input-ico {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--text); opacity: .32; pointer-events: none; line-height: 0;
}
.vx-input input[type='text'] {
  /* ตั้งความสูงเป็นตัวเลขตายตัว ไม่ให้ความสูงมาจาก padding + ฟอนต์
     เพราะฟอนต์ไทยกับอังกฤษกล่องข้อความสูงไม่เท่ากัน ช่องจะได้เท่ากันทุกเครื่อง */
  height: 40px; padding: 0 16px 0 42px;
  font-family: var(--font-mono); font-size: 14.5px; letter-spacing: .6px;
}
.vx-input-ico { left: 15px; }

/* ช่องกรอกข้อความธรรมดาในการ์ดเดียวกัน — ใช้ฟอนต์ปกติ ไม่ใช่ฟอนต์ตัวเลข
   แต่สูงเท่ากันเป๊ะ เพื่อให้ทุกช่องในฟอร์มเรียงสวยเป็นแถวเดียวกัน */
.vx-input input[type='text'].vx-in-text {
  font-family: var(--font-sans); font-size: 14px; letter-spacing: 0;
}
/* ช่องที่ไม่มีไอคอนนำหน้า — สูงเท่ากับช่องที่มีไอคอน (40px) เป๊ะ */
.vx-card input[type='text'].vx-in-mono {
  height: 40px; padding: 0 16px;
  font-family: var(--font-mono); font-size: 14.5px; letter-spacing: .6px;
}
.vx-card input[type='text'].vx-in {
  height: 40px; padding: 0 16px; font-size: 14px;
}
.vx-card select.vx-in-sel {
  height: 40px; padding: 0 14px; font-size: 14px;
}

/* ลิงก์เล็กใต้คำโปรยหัวเรื่อง */
.vx-hero-link {
  display: inline-block; margin-top: 14px;
  font-size: 13px; font-weight: var(--w-light);
  color: var(--accent); opacity: .85;
}
.vx-hero-link:hover { opacity: 1; }

/* ---------- กล่องข้อมูลในการ์ด ----------
   ใช้ภาษาภาพเดียวกับกล่อง "คุณยังยืนยันให้เพื่อนไม่ได้"
   คือไอคอนอยู่ในวงกลมสีฟ้าจาง ๆ ไม่มีแถบสีด้านข้าง มุมมนแบบการ์ด */
.vx-box {
  padding: 18px 20px 19px;
  background: var(--sunken);
  border-radius: var(--radius);
}
.vx-box-head {
  display: flex; align-items: center; gap: 11px;
  font-size: 14px; font-weight: var(--w-bold); margin-bottom: 13px;
}
.vx-box-ico {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  color: var(--accent); background: var(--accent-soft);
  line-height: 0;
}

/* ขั้นตอนหา Discord ID */
.vx-how { list-style: none; margin: 0; padding: 0; }
.vx-how li {
  display: flex; gap: 11px; align-items: flex-start;
  font-size: 13px; line-height: 1.8;
  color: var(--text); opacity: .58; font-weight: var(--w-light);
}
.vx-how li + li { margin-top: 8px; }
.vx-how li b { opacity: 1; font-weight: var(--w-regular); }
.vx-how-no {
  flex: none; width: 21px; height: 21px; margin-top: 3px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: var(--w-bold); opacity: 1;
}
.vx-note {
  margin: 14px 0 0; padding-top: 13px;
  box-shadow: inset 0 1px 0 var(--border);
  font-size: 12.5px; line-height: 1.75;
  color: var(--text); opacity: .42; font-weight: var(--w-light);
}

/* ข้อควรรู้ก่อนกดยืนยัน — ใช้จุดนำหน้าสีฟ้าแทนจุดมาตรฐานของเบราว์เซอร์ */
.vx-rules { list-style: none; margin: 0; padding: 0; }
.vx-rules li {
  position: relative; padding-left: 18px;
  font-size: 13px; line-height: 1.9;
  color: var(--text); opacity: .58; font-weight: var(--w-light);
}
.vx-rules li + li { margin-top: 4px; }
.vx-rules li::before {
  content: ''; position: absolute; left: 3px; top: 11px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); opacity: .55;
}
.vx-rules b { opacity: 1; font-weight: var(--w-regular); }
.warn-text { color: var(--warn); }
/* กันไม่ให้คำในวงเล็บถูกตัดกลางคำเวลาบรรทัดไม่พอ — ถ้าไม่พอจริงจะยกทั้งวงเล็บลงบรรทัดใหม่ */
.nw { white-space: nowrap; }   /* สีเหลืองเหมือน "กรอกได้ครั้งเดียว" ในหน้าลงทะเบียน */

/* ---------- โควตา ---------- */
.vx-quota {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; background: var(--panel-2);
  border-radius: var(--radius-sm);
}
.vx-quota-tx { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.vx-quota-tx .muted { font-size: 12.5px; }
.vx-pips { display: flex; gap: 7px; }
.vx-pip {
  width: 26px; height: 6px; border-radius: 100px;
  background: var(--field);
}
.vx-pip.on { background: var(--accent-grad); }

/* ---------- ปุ่มท้ายฟอร์ม ---------- */
.vx-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-top: 22px;
}
@media (max-width: 560px) {
  .vx-actions { flex-direction: column-reverse; align-items: stretch; }
  .vx-actions .btn { width: 100%; justify-content: center; }
}

/* ---------- กล่องแจ้งว่ายังใช้ไม่ได้ ----------
   จัดกึ่งกลาง ใช้โทนฟ้าของแบรนด์ ไม่ใช้สีเตือน
   เพราะไม่ใช่ความผิดพลาด แค่ยังไม่ได้รับสิทธิ์เท่านั้น */
.vx-locked {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 42px 30px 34px;
}
.vx-locked-badge {
  display: grid; place-items: center;
  width: 62px; height: 62px; border-radius: 50%;
  color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 8px var(--accent-soft);
  margin-bottom: 20px;
}
.vx-locked-title {
  margin: 0; font-size: 19px; line-height: 1.5;
}
.vx-locked-reason {
  margin: 10px auto 0; max-width: 460px;
  font-size: 14px; line-height: 1.85;
  color: var(--text); opacity: .5; font-weight: var(--w-light);
  white-space: pre-line;   /* ให้ \n ในข้อความขึ้นบรรทัดใหม่จริง */
}
.vx-locked-foot {
  display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: center; margin-top: 24px;
}
@media (max-width: 480px) {
  .vx-locked { padding: 34px 20px 28px; }
  .vx-locked-foot { flex-direction: column; align-self: stretch; }
  .vx-locked-foot .btn { width: 100%; justify-content: center; }
}

/* ---------- รายชื่อเพื่อนที่ยืนยันไว้ ---------- */
.vx-list-title {
  display: flex; align-items: center; gap: 10px;
  margin: 30px 0 12px; font-size: 16px;
}
.vx-count {
  display: grid; place-items: center; min-width: 22px; height: 22px;
  padding: 0 7px; border-radius: 100px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: var(--w-bold);
}
.vx-list { display: flex; flex-direction: column; gap: 9px; }
.vx-item {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 16px; background: var(--panel);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.vx-avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 15px; font-weight: var(--w-bold);
}
.vx-item.is-void { opacity: .45; }
.vx-item-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vx-item-main > b { font-size: 14.5px; line-height: 1.4; }
/* บรรทัดรองใต้ชื่อ (ใช้กับ "ความผิด" ในรายการประกาศล่าสุด) */
.vx-item-sub {
  font-size: 12.5px; line-height: 1.6; font-weight: var(--w-light);
  color: var(--text); opacity: .48;
}
.vx-item-id {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .3px;
  color: var(--text); opacity: .4; cursor: pointer;
}
.vx-item-meta { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.vx-item-date { font-size: 12.5px; color: var(--text); opacity: .42; }
@media (max-width: 560px) {
  .vx-item-meta { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* =====================================================================
   ระบบประกาศความผิด — /penalty
   ===================================================================== */
.pen-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 4px; }
.pen-type {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 16px 10px; border: none; cursor: pointer;
  background: var(--sunken); border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: box-shadow .16s ease, background .16s ease, transform .16s ease;
  font-family: inherit;
}
.pen-type:hover { transform: translateY(-1px); }
.pen-type-dot { font-size: 21px; line-height: 1; }
.pen-type-label {
  font-size: 13.5px; font-weight: var(--w-regular);
  color: var(--text); opacity: .6;
}
.pen-type.on .pen-type-label { opacity: 1; font-weight: var(--w-bold); }
.pen-type.on.pen-yellow { box-shadow: inset 0 0 0 1.5px #f5c518; }
.pen-type.on.pen-red    { box-shadow: inset 0 0 0 1.5px var(--danger); }
.pen-type.on.pen-warn   { box-shadow: inset 0 0 0 1.5px var(--warn); }
.pen-type.on.pen-fine   { box-shadow: inset 0 0 0 1.5px var(--success); }
@media (max-width: 560px) {
  .pen-types { grid-template-columns: repeat(2, 1fr); }
}

/* กล่องผลตรวจ Discord ID ใต้ช่องกรอก */
.pen-lookup {
  margin-top: 9px; padding: 11px 14px; border-radius: 10px;
  background: var(--sunken); font-size: 13px; line-height: 1.75;
}
.pen-look-ok { color: var(--success); font-weight: var(--w-regular); }
.pen-look-bad { color: var(--danger); }
.pen-look-clean { color: var(--text); opacity: .45; }
.pen-look-warn { color: var(--warn); margin-top: 3px; }
.pen-look-item { color: var(--text); opacity: .5; font-size: 12.5px; padding-left: 4px; }

.pen-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 18px; }
.pen-grid > div[hidden] { display: none; }
/* โทษบางประเภทไม่มีช่องพวกนี้เลย ถ้าไม่ซ่อนตัวกริดด้วย จะเหลือช่องว่างค้างในฟอร์ม */
.pen-grid:not(:has(> div:not([hidden]))) { display: none; }
@media (max-width: 560px) { .pen-grid { grid-template-columns: 1fr; } }

.pen-money { position: relative; }
.pen-money input { padding-right: 52px; }
.pen-money-unit {
  position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
  color: var(--text); opacity: .4; font-size: 14px; pointer-events: none;
}
.pen-datetime { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.pen-hint { margin-top: 6px; font-size: 12px; color: var(--text); opacity: .42; }
.pen-row[hidden] { display: none; }
/* ช่องติ๊ก "นับรวมใบเหลืองเก่า" — ทำเป็นกล่องกดได้ทั้งแถบ ให้เข้าชุดกับกล่องอื่นในการ์ด */
.pen-check {
  display: flex; align-items: center; gap: 11px; cursor: pointer;
  padding: 13px 18px; background: var(--sunken); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: var(--w-light); line-height: 1.6;
}
.pen-check input { width: auto; margin: 0; flex: none; accent-color: var(--accent); }
.pen-check .muted { font-size: 12.5px; }

.pen-preview {
  padding: 13px 16px; border-radius: 10px; background: var(--field);
  font-size: 14px; line-height: 1.9; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.pen-preview.is-waiting { opacity: .4; font-style: italic; }

.pen-badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 4px 10px; border-radius: 100px; font-size: 12px;
  font-weight: var(--w-bold); background: var(--panel-2);
}
.pen-badge.pen-yellow { color: #f5c518; }
.pen-badge.pen-red    { color: var(--danger); }
.pen-badge.pen-warn   { color: var(--warn); }
.pen-badge.pen-fine   { color: var(--success); }

.pen-actions { display: flex; align-items: center; gap: 8px; }
.pen-resolve-inline { display: flex; align-items: center; gap: 7px; }
.pen-resolve-inline select { max-width: 160px; font-size: 12.5px; padding: 7px 10px; }
/* แถวปุ่มเปลี่ยน/ย้อนสถานะ ของใบที่เคลียร์ไปแล้ว */
.pen-restate { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; align-items: flex-start; }
.pen-restate-btn { padding: 6px 11px; font-size: 12px; }

/* ---------- หัวใบในหน้าแก้ไขประกาศ ---------- */
.pen-owner { padding: 20px 22px 18px; margin-bottom: 16px; }
.pen-edit-head { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.pen-edit-head .vx-avatar { width: 32px; height: 32px; font-size: 13.5px; }
/* คำอธิบายนำในการ์ด — โทนเดียวกับคำโปรยใต้หัวเรื่อง */
.vx-lead {
  margin: 0; font-size: 13px; line-height: 1.85;
  color: var(--text); opacity: .5; font-weight: var(--w-light);
}
.pen-resolved-box {
  padding: 13px 16px; border-radius: 10px; background: var(--sunken);
  box-shadow: inset 2px 0 0 var(--success); font-size: 14px;
}
.pen-resolved-box .muted { font-size: 12.5px; margin-top: 3px; }


/* =====================================================================
   หน้าประวัติการลงโทษ — รายการแบบการ์ด
   ---------------------------------------------------------------------
   เลิกใช้ตาราง เพราะแต่ละใบมีข้อมูลไม่เท่ากัน (บางใบมีค่าปรับ บางใบมีระงับ)
   ยัดลงตารางแล้วช่องจะยาวสั้นไม่เท่ากันจนอ่านยาก
   แยกเป็นการ์ดใบละอัน มีแถบสีซ้ายบอกประเภทโทษ เหมือนการ์ดใน Discord
   ===================================================================== */
.ph-wrap { max-width: 880px; margin: 0 auto; }

.ph-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.ph-head .vx-title { font-size: 25px; margin: 3px 0 0; }
.ph-sub { margin: 5px 0 0; font-size: 12.5px; color: var(--text); opacity: .45; font-weight: var(--w-light); }

/* ---------- ตัวเลขรวม (กดเพื่อกรองได้) ---------- */
.ph-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.ph-stat {
  display: grid; gap: 2px; justify-items: center; text-align: center;
  padding: 11px 10px; border-radius: var(--radius-sm);
  background: var(--panel); text-decoration: none; color: inherit;
  box-shadow: inset 0 0 0 1px var(--border);
  transition: background var(--t-fast) var(--ease-soft), scale var(--t-fast) var(--ease-soft);
}
.ph-stat:hover { background: var(--hover); scale: 1.015; }
.ph-stat .n { font-size: 21px; font-weight: var(--w-bold); line-height: 1.1; }
.ph-stat .l { font-size: 10.5px; color: var(--text); opacity: .5; }

/* ---------- ตัวกรอง ---------- */
.ph-filters { display: grid; gap: 9px; padding: 12px 14px; margin-bottom: 10px; border-radius: var(--radius-sm); }
.ph-search { display: flex; gap: 10px; align-items: center; }
/* ไอคอนแว่นขยายยึดกับตัวช่องกรอก ไม่ใช่กับทั้งฟอร์ม
   ไม่งั้นพอจอแคบแล้วปุ่มตกลงบรรทัดใหม่ ไอคอนจะลอยไปอยู่กลางฟอร์ม */
.ph-search-field { position: relative; flex: 1 1 auto; min-width: 0; }
.ph-search-field input { width: 100%; padding: 8px 13px 8px 36px; font-size: 12.5px; }
.ph-search-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text); opacity: .38; display: grid; pointer-events: none;
}
.ph-search .btn { flex: none; padding: 8px 17px; font-size: 12.5px; }

.ph-chiprow { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.ph-chiplabel {
  font-size: 10px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--text); opacity: .32; margin-right: 2px; min-width: 58px;
}
.ph-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 100vh; text-decoration: none;
  font-size: 11.5px; font-weight: var(--w-light);
  color: var(--text); opacity: .55; background: var(--panel-2);
  transition: opacity var(--t-fast) var(--ease-soft), background var(--t-fast) var(--ease-soft);
}
.ph-chip:hover { opacity: .9; background: var(--hover); }
.ph-chip.on {
  opacity: 1; font-weight: var(--w-medium);
  color: var(--accent-ink); background: var(--accent-grad);
}
/* จุดสีนำหน้าชิปประเภทโทษ */
.ph-chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ph-chip.ph-yellow i { background: #f5c518; }
.ph-chip.ph-red    i { background: var(--danger); }
.ph-chip.ph-warn   i { background: var(--warn); }
.ph-chip.ph-fine   i { background: var(--success); }
.ph-chip.on i { background: var(--accent-ink); }

.ph-count {
  font-size: 11.5px; color: var(--text); opacity: .42;
  margin: 0 4px 8px; display: flex; align-items: center; gap: 11px;
}
.ph-count b { opacity: 1; font-weight: var(--w-medium); }
.ph-clear { color: var(--accent); text-decoration: none; opacity: .85; }
.ph-clear:hover { text-decoration: underline; }

/* ---------- การ์ดแต่ละใบ ---------- */
/* คุมให้กะทัดรัด เพราะทีมงานต้องไล่อ่านทีละหลายสิบใบ
   ใบหนึ่งควรจบในสายตาเดียว ไม่ใช่ต้องเลื่อนจอทีละใบ */
.ph-list { display: grid; gap: 8px; }
.ph-card {
  position: relative; padding: 11px 14px 11px 16px; overflow: hidden;
  border-radius: var(--radius-sm);
}
/* แถบสีซ้าย บอกประเภทโทษ ให้ตรงกับการ์ดใน Discord */
.ph-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--text); opacity: .5;
}
.ph-card.ph-yellow::before { background: #f5c518; opacity: 1; }
.ph-card.ph-red::before    { background: var(--danger); opacity: 1; }
.ph-card.ph-warn::before   { background: var(--warn); opacity: 1; }
.ph-card.ph-fine::before   { background: var(--success); opacity: 1; }
.ph-card.is-void { opacity: .42; }
.ph-card.is-void::before { background: var(--text); opacity: .3; }

.ph-card-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ph-card-top .pen-badge { padding: 3px 8px; font-size: 11px; }
.ph-card-top .badge { padding: 3px 9px; font-size: 10.5px; }
.ph-no {
  font-size: 10.5px; color: var(--text); opacity: .3;
  font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.ph-open {
  font-size: 10.5px; font-weight: var(--w-medium); color: var(--warn);
  padding: 3px 9px; border-radius: 100vh; background: var(--panel-2);
}
/* ใบที่บอทอัปเกรดไปเป็นโทษขั้นถัดไป — ใช้สีกลาง ๆ ไม่ใช่สีเขียวแบบ "เคลียร์แล้ว"
   เพราะเรื่องยังไม่จบ แค่ย้ายไปอยู่ใบใหม่ */
.ph-badge-auto {
  color: var(--accent); background: var(--accent-soft);
}
/* ป้ายบอกว่าใบนี้บอทออกให้เอง โดยอัปเกรดมาจากใบไหน */
.ph-auto-src {
  font-size: 10.5px; font-weight: var(--w-light);
  color: var(--text); opacity: .45;
}
.ph-when {
  margin-left: auto; text-align: right; font-size: 10.5px;
  color: var(--text); opacity: .34; line-height: 1.45;
}
.ph-when i { display: block; font-style: normal; opacity: .82; }

/* ชื่อ + ไอดี บรรทัดเดียว
   ชื่อกับไอดีตัวอักษรคนละขนาด ถ้าจัดกึ่งกลางแนวตั้งไอดีจะดูลอยสูงกว่าชื่อ
   เลยจับสองตัวนี้มาเรียงตามเส้นฐาน (baseline) เดียวกันแทน
   ส่วนวงกลมตัวอักษรแรก ยังจัดกึ่งกลางเหมือนเดิม */
.ph-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.ph-who-tx {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  min-width: 0; row-gap: 2px;
}
.ph-avatar {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: var(--w-bold);
  color: var(--accent-ink); background: var(--accent-grad);
}
.ph-who b { font-size: 13.5px; font-weight: var(--w-medium); line-height: 1.3; }
.ph-id {
  font-size: 10.5px; color: var(--text); opacity: .32; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.ph-id:hover { opacity: .65; }

.ph-offense { margin: 7px 0 0; font-size: 12.5px; line-height: 1.6; }
/* หมายเหตุต่อท้ายความผิดในบรรทัดเดียวกัน ไม่กินบรรทัดใหม่ถ้าไม่จำเป็น */
.ph-offense .ph-note { margin-left: 7px; }
.ph-note {
  font-size: 11.5px; line-height: 1.6;
  color: var(--text); opacity: .38; font-weight: var(--w-light);
}
p.ph-note { margin: 4px 0 0; }

/* ตัวเลขสำคัญ เป็นป้ายบรรทัดเดียว ไม่ซ้อนบน-ล่าง */
.ph-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ph-fact {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 4px 10px; border-radius: 100vh; background: var(--sunken);
  font-size: 12px; line-height: 1.5; white-space: nowrap;
}
.ph-fact i {
  font-style: normal; font-size: 10px;
  color: var(--text); opacity: .36;
}
.ph-fact b { font-weight: var(--w-medium); font-variant-numeric: tabular-nums; }
.ph-fact.ph-bad b { color: var(--danger); }
.ph-fact.ph-ok b { color: var(--success); }

/* ---------- แถวปุ่มท้ายการ์ด ---------- */
.ph-bar {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 9px;
  box-shadow: inset 0 1px 0 var(--border);
}
.ph-bar-left, .ph-bar-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ph-bar-right { margin-left: auto; }
.ph-bar form { display: flex; align-items: center; gap: 6px; }
/* บังคับให้ช่องเลือกกับปุ่มทุกตัวสูงเท่ากันเป๊ะ
   ตั้งความสูงเป็นตัวเลขตายตัว ไม่ปล่อยให้ความสูงมาจาก padding + ฟอนต์
   เพราะฟอนต์ไทยกับอังกฤษกล่องข้อความสูงไม่เท่ากัน
   ปล่อยไว้แบบเดิมช่องเลือกจะสูงกว่าปุ่มบนบางเครื่อง เตี้ยกว่าบนบางเครื่อง */
.ph-bar select,
.ph-bar .btn { height: 30px; font-size: 11.5px; }
.ph-bar select {
  width: auto; min-width: 158px;   /* พอให้ "พ้นกำหนดระงับแล้ว" ซึ่งยาวสุด ไม่โดนตัด */
  padding: 0 9px; line-height: 30px;
}
/* ช่องเลือกสถานะเป็นตัวสั่งงาน ไม่ใช่ช่องกรอกเฉย ๆ
   ทำให้ดูกดได้ และมีปฏิกิริยาตอนชี้ */
.ph-setstate select { cursor: pointer; }
.ph-setstate select:hover { background: var(--hover); }
.ph-bar .btn { padding: 0 12px; }

/* ---------- ไม่พบรายการ ---------- */
.ph-empty {
  display: grid; justify-items: center; gap: 10px;
  padding: 40px 24px; text-align: center; border-radius: var(--radius-sm);
}
.ph-empty-ico {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sunken); color: var(--text); opacity: .4;
}
.ph-empty b { font-size: 13.5px; font-weight: var(--w-medium); }

@media (max-width: 720px) {
  .ph-stats { grid-template-columns: 1fr 1fr; }
  .ph-when { margin-left: 0; width: 100%; text-align: left; }
  .ph-when i { display: inline; margin-left: 6px; }
  .ph-bar-right { margin-left: 0; width: 100%; }
  .ph-bar .btn, .ph-bar form { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 520px) {
  .ph-head .vx-title { font-size: 22px; }
  .ph-search { flex-wrap: wrap; }
  .ph-search-field { flex: 1 0 100%; }
  .ph-search .btn { flex: 1 1 auto; }
  .ph-chiplabel { min-width: 100%; margin-bottom: -2px; }
  .ph-card { padding: 11px 12px 11px 14px; }
  .ph-bar select { min-width: 0; flex: 1 1 auto; }
}

/* ---------- แถวรายการ + ปุ่มท้ายฟอร์ม (ใช้ร่วมหลายหน้า) ---------- */
.vch-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-top: 22px;
}
@media (max-width: 560px) {
  .vch-actions { flex-direction: column-reverse; align-items: stretch; }
  .vch-actions .btn { width: 100%; justify-content: center; }
}
.vch-list-title { margin: 30px 0 12px; font-size: 16px; }
.vch-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 16px; background: var(--panel-2); border-radius: 12px;
}
.vch-row + .vch-row { margin-top: 9px; }
.vch-row.is-void { opacity: .45; }
.vch-who { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.vch-who > b { font-size: 14.5px; line-height: 1.4; }
.vch-id {
  color: var(--text); opacity: .42; font-size: 12px;
  font-family: var(--font-mono); letter-spacing: .3px;
}
.vch-meta { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.vch-date { color: var(--text); opacity: .45; font-size: 12.5px; }
@media (max-width: 560px) {
  .vch-row { gap: 8px; }
  .vch-meta { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* ---------- ช่องค้นหาในแถบเครื่องมือ ----------
   ให้สูงเท่ากับปุ่มที่วางอยู่ข้าง ๆ แถวจะได้ดูเป็นชุดเดียวกัน */
.toolbar-search,
input[type='text'].toolbar-search,
select.toolbar-search {
  padding: 10px 14px; font-size: 13.5px;
}

/* ---------- Footer ---------- */
.footer { margin-top: 44px; padding: 24px 0; box-shadow: inset 0 1px 0 var(--border); }
.footer .container { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.footer .hud { opacity: .4; }
.footer span { color: var(--text); opacity: .45; font-size: 13.5px; }

/* ---------- Utilities ---------- */
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.big { font-size: 19px; font-weight: var(--w-bold); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; } .mt-3 { margin-top: 30px; }
.mb-0 { margin-bottom: 0; }
.divider { height: 1px; background: var(--border); margin: 22px 0; border: none; }

/* ---------- Scrollbar — thumb ไล่สี ขอบมน ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(205, 230, 255, .22) transparent; }
::-webkit-scrollbar { width: 13px; height: 13px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(205, 230, 255, .22); background-clip: content-box; border: 4px solid transparent; border-radius: 100vh; }
::-webkit-scrollbar-thumb:hover { background: rgba(205, 230, 255, .38); background-clip: content-box; }
[data-theme='light'] * { scrollbar-color: rgba(75, 90, 106, .28) transparent; }
[data-theme='light'] ::-webkit-scrollbar-thumb { background: rgba(75, 90, 106, .28); background-clip: content-box; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* =====================================================================
   การเคลื่อนไหว — เลื่อนขึ้น 1vh + จาง (slide/fade ของสคริปต์)
   ===================================================================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(1vh); } to { opacity: 1; transform: translateY(0); } }
@keyframes levitate { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

main > .hero > * { animation: slideIn .4s ease both; }
main > .hero > *:nth-child(2) { animation-delay: .06s; }
main > .hero > *:nth-child(3) { animation-delay: .12s; }
main .panel, main .table-wrap, main .rule-cat, main form.panel { animation: slideIn .4s ease both; }
main .panel .panel { animation: none; }
main .card-grid > *:nth-child(2) { animation-delay: .05s; }
main .card-grid > *:nth-child(3) { animation-delay: .1s; }
main .card-grid > *:nth-child(4) { animation-delay: .15s; }
main .q:nth-of-type(2) { animation-delay: .05s; }
main .q:nth-of-type(3) { animation-delay: .1s; }
main .q:nth-of-type(4) { animation-delay: .15s; }
main .q:nth-of-type(n+5) { animation-delay: .2s; }

/* เปลี่ยนหน้า (Chrome/Edge) */
@view-transition { navigation: auto; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-1vh); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(1vh); } }
::view-transition-old(root) { animation: vt-out .26s ease both; }
::view-transition-new(root) { animation: vt-in .4s ease both; }

.ring { animation: levitate 5.5s var(--ease-soft) infinite; }
.timer.danger { animation: fadeIn .4s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- จอเล็ก ---------- */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .nav-inner { padding: 10px 16px; gap: 10px; flex-wrap: nowrap; }
  .nav-links { gap: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { padding: 8px 12px; font-size: 13.5px; white-space: nowrap; }
  .nav-links a.hide-sm { display: none; }
  .brand { font-size: 16px; gap: 9px; white-space: nowrap; }
  .brand .logo, .brand .logo img { width: 34px; height: 34px; }
  .brand small { display: none; }
  .nav-user-name { display: none; }
  .nav-user { padding: 7px 9px; }
  .nav-tools { margin-left: 8px; gap: 6px; }
  .theme-toggle { width: 34px; height: 34px; }
}
@media (max-width: 560px) { .brand > span:not(.logo) { display: none; } }
@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .panel { padding: 20px 18px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding: 36px 0 18px; }
  .tos-section { gap: 12px; }
  .rule-body { padding-left: 20px; }
  .agree-bar { flex-direction: column; align-items: stretch; }
  .agree-bar .btn { width: 100%; }
  .tabs { width: 100%; }
  .tabs a { flex: 1 1 0; text-align: center; }
}
