@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+Thai:wght@400;500;600;700&display=swap');

/* ==========================================================================
   ระบบประเมินทักษะอนาคต — ระบบดีไซน์กลาง
   โครงสร้างตามแนว School Gradebook "Sky Campus" เปลี่ยนคอร์ดสีเป็นม่วง
   ให้เข้ากับพื้นหลังไล่สีรัศมีที่เจ้าของงานสั่งให้คงไว้

   หลักที่ยกมาทั้งหมด
   1. หน้าเว็บอ่านเป็น "เอกสาร" ไม่ใช่ "แผงไทล์"
   2. การ์ดขาว ขอบเส้นผม 1px ไม่มีเงา — เงาสงวนให้ของที่ลอยจริงเท่านั้น
   3. Fill-vs-Ink — สีระดับ fill ห้ามเอาไปทาตัวหนังสือ ใช้ระดับ ink แทน
   4. Data-Bar — แถบสีหนากว่า 1px ใช้ได้เมื่อแถบนั้นเข้ารหัสข้อมูลจริง
   5. Label-Above-Figure — ในการ์ดสถิติ ป้ายอยู่เหนือตัวเลขเสมอ

   ข้อยกเว้นที่ตั้งใจ — การ์ดทักษะของนักเรียนใช้อนิเมชันแบบ Product Card
   ซึ่งเคลื่อนไหวแรงกว่ากฎของ Sky Campus เพราะเป็นพื้นผิวจูงใจ ไม่ใช่ตารางข้อมูล
   ========================================================================== */

:root {
  /* ---- คอร์ดสีหลัก ---- */
  --ac:       #6633ee;   /* พื้นเท่านั้น ห้ามเป็นหมึก */
  --ac-dk:    #5324cf;   /* ปุ่มหลัก ลิงก์ ไอคอน */
  --ac-deep:  #3f1aa3;   /* hover ของปุ่ม หมึกบนหัวตาราง */
  --ac-lt:    #a78bfa;   /* ปลายสว่าง */
  --ac-wash:  #f1ecff;   /* พื้นอ่อนของชิป หัวตาราง สถานะที่เลือก */
  --ac-ink:   #341687;   /* หมึกม่วงเข้มบนพื้นขาว */

  /* ---- สีเข้ารหัสข้อมูล ตรึงไว้ ไม่ผูกกับคอร์ดหลัก ---- */
  --gold:  #FFA95A;  --gold-ink:  #8A5A05;
  --green: #16a34a;  --green-ink: #0F6B33;
  --red:   #FF5A5A;  --red-ink:   #A63A3A;
  --teal:  #0d9488;  --teal-ink:  #0B6B62;

  /* ---- พื้นผิว ---- */
  --bg-card:   #ffffff;
  --bg-soft:   #f4f1fd;
  --border-color: #e4defa;
  --text-main: #241f3d;
  --text-muted:#5b5476;
  --text-faint:#8b85a3;   /* สถานะปิดใช้งานเท่านั้น */

  /* ---- รัศมี ---- */
  --r-xs: 6px;  --r-sm: 10px; --r-md: 12px; --r-lg: 14px;
  --r-xl: 20px; --r-jumbo: 32px; --r-pill: 50px; --r-full: 9999px;

  /* ---- ระยะห่าง ฐาน 8 ---- */
  --sp-xxs: 4px;  --sp-xs: 8px;  --sp-sm: 12px; --sp-md: 16px;
  --sp-lg: 20px;  --sp-xl: 24px; --sp-xxl: 32px; --sp-section: 40px;

  /* ---- เงา สงวนให้ของที่ลอยจริง ---- */
  --shadow:    0 1px 2px rgba(52, 22, 135, .05), 0 6px 20px rgba(52, 22, 135, .06);
  --shadow-lg: 0 10px 40px rgba(52, 22, 135, .18);

  --ease: cubic-bezier(.16, 1, .3, 1);

  font-family: Inter, 'Noto Sans Thai', system-ui, sans-serif;
  font-feature-settings: 'cv05', 'ss01';
  color: var(--text-main);
  line-height: 1.6;
  letter-spacing: -.006em;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  background: #fff;
  background: radial-gradient(125% 125% at 50% 10%, #fff 40%, #63e 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

/* --------------------------------------------------------------------------
   ตัวอักษร — ลำดับชั้นมาจากขนาดกับน้ำหนัก ไม่ใช่จากการสลับฟอนต์
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, legend, .table-title {
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.018em;
  margin: 0 0 var(--sp-sm);
  text-wrap: balance;
  color: var(--text-main);
}
h1 { font-size: clamp(1.5rem, 2.8vw, 2rem); }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }
h3 { font-size: 1.08rem; letter-spacing: -.014em; }

p { max-width: 70ch; margin: 0 0 var(--sp-md); }
p:last-child { margin-bottom: 0; }
small { font-size: .875rem; }

/* ป้ายกำกับ — ตัวเล็กต้องผ่าน AA 4.5 จึงใช้ text-muted ไม่ใช่ faint */
.label, .plate-label, legend, th, .stat-label, .field .hint {
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-muted);
}

.figure, .stat-val {
  font-size: 2.35rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}

.muted { color: var(--text-muted); }
.tabular, td.num, .badge, table { font-variant-numeric: tabular-nums; }

a { color: var(--ac-dk); text-underline-offset: 3px; }
a:hover { color: var(--ac-deep); }

/* --------------------------------------------------------------------------
   Chrome — แถบบนสูง 62px พื้นขาว ขอบล่างเส้นผม
   -------------------------------------------------------------------------- */

.topbar, header, .header {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  flex-wrap: wrap;
  min-height: 62px;
  padding: var(--sp-sm) max(20px, calc((100vw - 1200px) / 2));
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}
.topbar a, header a, .header a { color: var(--ac-dk); text-decoration: none; }

.brand { display: flex; align-items: center; gap: var(--sp-sm); }
.brand img, .header img, .header .logo { height: 36px; width: auto; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 1rem; color: var(--text-main); letter-spacing: -.014em; line-height: 1.25; }
.brand-sub { font-size: .74rem; color: var(--text-muted); font-weight: 500; }
.header h2 { font-size: 1rem; margin: 0; }
.header h3 { font-size: .76rem; margin: 0; color: var(--text-muted); font-weight: 500; }

/* เมนูหลัก — ชุดเดียวใช้ทุกหน้า ทุกบทบาท */
.topnav, nav, .header .nav, .nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-xxs);
  flex-wrap: wrap;
}
.topnav a, nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: 9px 13px;
  border-radius: var(--r-sm);
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.topnav a:hover, nav a:hover { background: var(--ac-wash); color: var(--ac-ink); }
.topnav a.is-active, nav a[aria-current='page'] { background: var(--ac-dk); color: #fff; }
.topnav a.is-active:hover, nav a[aria-current='page']:hover { background: var(--ac-deep); color: #fff; }

/* ชิปแสดงตัวตนผู้ใช้ — ต้องกำหนดหมึกชัดทุกสถานะ */
.who {
  display: inline-flex; align-items: center; gap: var(--sp-xs);
  padding: 7px 13px; border-radius: var(--r-pill);
  background: var(--ac-wash); color: var(--ac-ink);
  font-size: .84rem; font-weight: 600;
}
.who .who-role { color: var(--text-muted); font-weight: 500; }

main {
  max-width: 1200px;
  margin: var(--sp-xl) auto;
  padding: 0 20px var(--sp-section);
}
main.narrow { max-width: 760px; }

/* --------------------------------------------------------------------------
   ฮีโร่ — หัวกระดาษ ไม่ใช่แบนเนอร์
   ไล่เฉดสั้นเฉดเดียว ไม่มีวงกลมตกแต่ง ไม่มีเงา
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-lg);
  background: var(--ac-deep);
  background-image:
    linear-gradient(160deg, var(--ac-deep) 0%, var(--ac) 100%),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.05) 0 1px, transparent 1px 9px);
  background-blend-mode: normal, overlay;
  color: #fff;
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-bottom: var(--sp-lg);
  overflow: hidden;
  /* เส้นคาดฐานแทนเงา บอกว่าเป็นหัวกระดาษไม่ใช่แบนเนอร์ลอย
     ใช้ inset shadow ไม่ใช่แถบสี เพราะแถบที่ไม่ได้แทนข้อมูลคือของประดับ */
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .22);
}

/* ตราประจำหน้า วางไอคอนของบทบาทหรือของงานนั้น */
.hero-badge {
  width: 54px; height: 54px; flex: none;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: var(--r-md);
}
.hero-badge img { width: 34px; height: 34px; object-fit: contain; }
.hero-badge svg { width: 24px; height: 24px; }

.hero-body { min-width: 0; }
.hero h1 {
  color: #fff;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  line-height: 1.25;
  margin: 0 0 3px;
}
.hero p {
  color: rgba(255, 255, 255, .88);
  font-size: .92rem;
  margin: 0;
  max-width: 72ch;
}
.hero .actions { margin-top: var(--sp-sm); }
.hero .btn, .hero button {
  background: #fff; color: var(--ac-deep); border-color: #fff;
  min-height: 38px; padding: .4rem 1rem; font-size: .9rem;
}
.hero .btn:hover, .hero button:hover { background: #efe9ff; color: var(--ac-deep); border-color: #efe9ff; }
.hero .btn.ghost-on-dark {
  background: transparent; color: #fff;
  border-color: rgba(255, 255, 255, .45);
}
.hero .btn.ghost-on-dark:hover { background: rgba(255, 255, 255, .14); color: #fff; }

/* ตัวเลขสำคัญของหน้า วางชิดขวาในฮีโร่ */
.hero-figure {
  text-align: right;
  padding-left: var(--sp-lg);
  border-left: 1px solid rgba(255, 255, 255, .22);
}
.hero-figure b {
  display: block;
  font-size: 1.9rem; font-weight: 700; line-height: 1;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.hero-figure span {
  display: block; font-size: .74rem; font-weight: 600;
  color: rgba(255, 255, 255, .8); margin-top: 3px;
}

@media (max-width: 760px) {
  .hero { grid-template-columns: auto minmax(0, 1fr); padding: var(--sp-md); gap: var(--sp-sm) var(--sp-md); }
  .hero-badge { width: 44px; height: 44px; }
  .hero-badge img { width: 28px; height: 28px; }
  .hero-figure {
    grid-column: 1 / -1; text-align: left;
    padding: var(--sp-sm) 0 0; border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .22);
  }
  .hero-figure b { display: inline; font-size: 1.4rem; }
  .hero-figure span { display: inline; margin-left: var(--sp-xs); }
}

.page-head { margin-bottom: var(--sp-lg); }
.page-head p { color: var(--text-muted); margin-bottom: 0; }

/* --------------------------------------------------------------------------
   การ์ดและแผง — ขาว ขอบ 1px ไม่มีเงา
   -------------------------------------------------------------------------- */

section, .card, .panel,
.container, .containerdetail, .student-container, .profile-container,
.textarea-container, .table-container, .chart-container, .containerChart,
.feedback-section, .section, .profile, .test-info {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  box-shadow: none;
  padding: var(--sp-xl);
  margin: var(--sp-lg) auto;
  max-width: 1200px;
}
section > :last-child, .card > :last-child, .container > :last-child { margin-bottom: 0; }

/* กล่องซ้อนในกล่องอื่นไม่มีกรอบของตัวเอง */
:is(section,.card,.panel,.container,.profile,.section,.table-container,.chart-container,
    .containerChart,.feedback-section,.student-container,.profile-container,
    .textarea-container,.test-info,.containerdetail)
:is(.container,.profile,.section,.table-container,.chart-container,
    .containerChart,.feedback-section,.student-container,.profile-container,
    .textarea-container,.test-info,.containerdetail) {
  background: none; border: 0; box-shadow: none; padding: 0;
  margin: 0 0 var(--sp-md); max-width: none; border-radius: 0;
}
.container .test-info, .container .feedback-section {
  padding: var(--sp-md) 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0;
}
.container .test-info:last-child, .container .feedback-section:last-child { border-bottom: 0; }

.panel-head {
  display: flex; align-items: baseline; gap: var(--sp-md);
  flex-wrap: wrap; margin-bottom: var(--sp-md);
}
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-head .actions { margin-left: auto; }

/* --------------------------------------------------------------------------
   การ์ดสถิติ — FIGURE RAIL
   ลำดับในใบ ไอคอน → ป้าย → ตัวเลข → สถานะ ทำด้วย order ล้วน
   ขีดสีอยู่ใต้ตัวเลข ไม่ใช่ขอบซ้าย
   -------------------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xxs);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  padding: 15px 18px 19px;
  margin: 0;
  max-width: none;
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.stat-card:hover { transform: translateY(-1px); border-color: var(--card-mark, var(--ac-lt)); }
.stat-card .stat-icon { order: 1; font-size: 1.05rem; color: var(--card-mark, var(--ac-dk)); line-height: 1; }
.stat-card .stat-label { order: 2; }
.stat-card .stat-val { order: 3; position: relative; padding-bottom: 9px; margin: 0; }
/* ขีดใต้ตัวเลขยืดตอน hover — ใช้ scaleX ไม่ใช่ width
   เพราะการอนิเมต width บังคับให้เบราว์เซอร์คำนวณเลย์เอาต์ใหม่ทุกเฟรม */
.stat-card .stat-val::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: calc(100% - 36px); height: 3px; border-radius: 2px;
  background: var(--card-mark, var(--ac));
  transform: scaleX(calc(26 / max(1, 100)));
  transform-origin: left center;
  transition: transform .4s var(--ease);
}
.stat-card .stat-val::after { transform: scaleX(.18); }
.stat-card:hover .stat-val::after { transform: scaleX(1); }
.stat-card .stat-note { order: 4; font-size: .8rem; color: var(--text-muted); }

.fam-violet { --card-mark: var(--ac-dk); }
.fam-green  { --card-mark: var(--green-ink); }
.fam-gold   { --card-mark: var(--gold-ink); }
.fam-red    { --card-mark: var(--red-ink); }
.fam-teal   { --card-mark: var(--teal-ink); }

/* --------------------------------------------------------------------------
   แถบทางลัด — หนึ่งแถบคั่นด้วยเส้น แทนกล่องไอคอนหลายใบ
   -------------------------------------------------------------------------- */

.adm-nav {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--sp-lg);
}
.adm-nav a {
  position: relative;
  flex: 1 1 0; min-width: 122px;
  display: flex; align-items: center; gap: var(--sp-xs);
  padding: 13px 16px 12px;
  font-size: .84rem; font-weight: 600;
  color: var(--ac-dk);
  text-decoration: none;
  cursor: pointer;
  border-left: 1px solid var(--border-color);
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.adm-nav a:first-child { border-left: 0; }
.adm-nav a .ico { font-size: 1.05rem; color: currentColor; line-height: 1; display: inline-flex; }

/* แถบใต้บอกว่าอยู่แท็บไหน เลื่อนขึ้นมาตอนชี้ */
.adm-nav a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--ac-dk);
  transform: scaleX(0); transform-origin: center;
  transition: transform .22s var(--ease);
}
.adm-nav a:hover { background: var(--ac-wash); color: var(--ac-ink); }
.adm-nav a:hover::after { transform: scaleX(.5); }

.adm-nav a.is-active {
  background: var(--ac-wash);
  color: var(--ac-ink);
  font-weight: 700;
}
.adm-nav a.is-active::after { transform: scaleX(1); }

/* --------------------------------------------------------------------------
   ปุ่ม
   -------------------------------------------------------------------------- */

button, .btn, .action, .download-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-xs);
  font: inherit; font-weight: 600; line-height: 1.2;
  min-height: 42px;
  padding: .55rem 1.2rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--ac-dk);
  background: var(--ac-dk);
  color: #fff;
  text-decoration: none; cursor: pointer;
  box-shadow: none;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
button:hover, .btn:hover, .action:hover { background: var(--ac-deep); border-color: var(--ac-deep); color: #fff; }
button:active, .btn:active { background: var(--ac-ink); }

.secondary, .outline, .btn-light {
  background: var(--bg-card); color: var(--ac-dk); border: 2px solid var(--ac);
}
.secondary:hover, .outline:hover, .btn-light:hover { background: var(--ac-dk); color: #fff; border-color: var(--ac-dk); }

.ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.ghost:hover { background: var(--bg-soft); color: var(--text-main); border-color: transparent; }

.danger { background: var(--red-ink); border-color: var(--red-ink); }
.danger:hover { background: #8c2f2f; border-color: #8c2f2f; }

.download-btn { background: var(--green-ink); border-color: var(--green-ink); }
.download-btn:hover { background: #0b5528; border-color: #0b5528; }

.btn-sm { min-height: 34px; padding: .35rem .85rem; font-size: .86rem; }
.btn-lg { min-height: 50px; padding: .8rem 1.6rem; font-size: 1.04rem; }
.btn-block { display: flex; width: 100%; }

button:disabled, .btn:disabled, .btn[aria-disabled='true'] { cursor: not-allowed; opacity: .5; }
button:disabled:hover { background: var(--ac-dk); border-color: var(--ac-dk); }

button[aria-busy='true'], .btn[aria-busy='true'] { cursor: progress; pointer-events: none; }
button[aria-busy='true']::before, .btn[aria-busy='true']::before {
  content: ''; width: 14px; height: 14px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: fs-spin .7s linear infinite;
}
@keyframes fs-spin { to { transform: rotate(360deg); } }

.actions { display: flex; flex-wrap: wrap; gap: var(--sp-sm); align-items: center; }
.actions.end { justify-content: flex-end; }

/* --------------------------------------------------------------------------
   ฟอร์ม
   -------------------------------------------------------------------------- */

label { display: block; font-weight: 600; margin-bottom: var(--sp-xs); font-size: .92rem; }
input, textarea, select, button { font: inherit; }

input:not([type='radio']):not([type='checkbox']):not([type='range']), textarea, select {
  width: 100%;
  padding: 10px 13px;
  min-height: 42px;
  border: 1px solid #cdc5e8;
  border-radius: var(--r-sm);
  color: var(--text-main);
  background: var(--bg-card);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:not([type='range']):hover:not(:disabled), textarea:hover:not(:disabled), select:hover:not(:disabled) { border-color: var(--ac-lt); }
input:not([type='range']):focus, textarea:focus, select:focus { border-color: var(--ac-dk); box-shadow: 0 0 0 3px var(--ac-wash); outline: none; }
textarea { min-height: 108px; resize: vertical; }
input[readonly], input:not([type='range']):disabled, select:disabled, textarea:disabled {
  background: var(--bg-soft); color: var(--text-faint); cursor: not-allowed;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%235b5476' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}

.field { margin-bottom: var(--sp-lg); }
.field:last-child { margin-bottom: 0; }
.field .hint { display: block; margin-top: var(--sp-xxs); font-weight: 500; }
.req { color: var(--red-ink); margin-left: 2px; }

.field .field-error { display: block; font-size: .82rem; color: var(--red-ink); margin-top: var(--sp-xxs); font-weight: 600; }
.field.is-invalid :is(input, select, textarea) { border-color: var(--red-ink); }
.field.is-invalid :is(input, select, textarea):focus { box-shadow: 0 0 0 3px #fdecec; }

.row, .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-lg); }
.form-grid .field { margin-bottom: 0; }
.form-grid.thirds { grid-template-columns: repeat(3, 1fr); }
.form-grid + .form-grid, .form-grid + .field, .field + .form-grid { margin-top: var(--sp-lg); }

fieldset { border: 0; border-top: 1px solid var(--border-color); margin: var(--sp-xl) 0 0; padding: var(--sp-lg) 0 0; }
fieldset:first-of-type { margin-top: 0; border-top: 0; padding-top: 0; }
legend { padding: 0; margin-bottom: var(--sp-md); }

.choices, .rating { display: flex; gap: var(--sp-sm); flex-wrap: wrap; margin-top: var(--sp-xs); }
.choices label, .rating label {
  display: flex; align-items: center; gap: var(--sp-xs);
  font-weight: 500; font-size: .92rem; margin-bottom: 0;
  min-height: 46px; padding: 9px 15px;
  border: 1px solid #cdc5e8; border-radius: var(--r-sm);
  background: var(--bg-card); cursor: pointer;
  transition: background-color .18s var(--ease), border-color .18s var(--ease);
}
.choices label:hover, .rating label:hover { background: var(--ac-wash); border-color: var(--ac-lt); }
.choices input, .rating input { width: 18px; height: 18px; accent-color: var(--ac-dk); }
.choices label:has(input:checked), .rating label:has(input:checked) {
  background: var(--ac-wash); border-color: var(--ac-dk);
  box-shadow: inset 0 0 0 1px var(--ac-dk); font-weight: 600;
}

/* --------------------------------------------------------------------------
   กล่องข้อความสถานะ
   -------------------------------------------------------------------------- */

.notice {
  padding: var(--sp-md) var(--sp-lg);
  background: var(--ac-wash);
  border: 1px solid var(--ac-lt);
  border-radius: var(--r-md);
  margin: var(--sp-lg) 0;
  color: var(--text-main);
}
.notice :is(h2, h3) { margin-bottom: var(--sp-xs); font-size: 1rem; }
.notice ul { margin: var(--sp-xs) 0 0; padding-left: 20px; }
.notice li { margin-bottom: var(--sp-xxs); }
.notice a { color: inherit; }

.error   { background: #fdecec; border-color: #f0bcbc; color: var(--red-ink); }
.success { background: #e8f6ee; border-color: #a8d6bd; color: var(--green-ink); }
.warning { background: #fdf1e2; border-color: #edc795; color: var(--gold-ink); }

/* --------------------------------------------------------------------------
   ตาราง — หัวตารางพื้นอ่อน หมึกเข้ม ไม่มี zebra
   -------------------------------------------------------------------------- */

.table-wrap, .table-container { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border-color); vertical-align: top; }
th { background: var(--ac-wash); color: var(--ac-deep); white-space: nowrap; border-bottom: 1px solid var(--ac-lt); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .16s var(--ease); }
tbody tr:hover td { background: var(--bg-soft); }
td:first-child { overflow-wrap: anywhere; }
.table-title { font-size: 1.1rem; margin: 0 0 var(--sp-md); }

/* --------------------------------------------------------------------------
   การ์ดทักษะของนักเรียน
   ดัดแปลงจาก Product Card Animation — วงกลม clip-path ขยายตอน hover
   รหัสทักษะเป็นคำขนาดใหญ่จาง ๆ ด้านหลัง ไอคอนเทพลอยขึ้นตอน hover
   -------------------------------------------------------------------------- */

.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: var(--sp-lg); }

.skill-card {
  position: relative;
  height: 402px;
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-radius: var(--r-xl);
  overflow: hidden;
  padding: 0; margin: 0; max-width: none;
}
.skill-card::before {
  content: ''; position: absolute; inset: 0;
  background: var(--skill-fill, var(--ac));
  clip-path: circle(140px at 78% 18%);
  transition: clip-path .55s var(--ease);
}
.skill-card:hover::before, .skill-card:focus-within::before { clip-path: circle(320px at 78% -18%); }

.skill-card::after {
  content: attr(data-code);
  position: absolute; top: 19%; left: -5%;
  font-size: 8.4rem; font-weight: 700; font-style: italic;
  letter-spacing: -.06em; color: #fff; opacity: .5; pointer-events: none;
}

.skill-fig {
  position: absolute; top: 50%; left: 0;
  width: 100%; height: 190px; transform: translateY(-50%);
  z-index: 3; display: flex; align-items: center; justify-content: center;
  transition: top .5s var(--ease), transform .5s var(--ease);
}
.skill-card:hover .skill-fig, .skill-card:focus-within .skill-fig { top: 4%; transform: translateY(0); }
.skill-fig img { width: 168px; height: 168px; object-fit: contain; }

.skill-body {
  position: absolute; bottom: 0; left: 0; width: 100%; height: 118px;
  padding: var(--sp-md) var(--sp-lg) var(--sp-lg);
  text-align: center;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  transition: height .5s var(--ease);
  z-index: 4; overflow: hidden;
}
.skill-card:hover .skill-body, .skill-card:focus-within .skill-body { height: 236px; }

.skill-code { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; color: var(--skill-ink, var(--ac-ink)); margin-bottom: 2px; }
.skill-name { font-size: .98rem; font-weight: 700; line-height: 1.3; color: var(--text-main); margin: 0 0 var(--sp-xxs); letter-spacing: -.014em; }
.skill-meta { font-size: .8rem; color: var(--text-muted); margin: 0; }

.skill-reveal { opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s var(--ease); }
.skill-card:hover .skill-reveal, .skill-card:focus-within .skill-reveal { opacity: 1; visibility: visible; transition-delay: .28s; }

.skill-score { display: flex; align-items: baseline; justify-content: center; gap: var(--sp-xs); margin: var(--sp-xs) 0; }
.skill-score b { font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--skill-ink, var(--ac-ink)); }
.skill-score span { font-size: .82rem; color: var(--text-muted); }
.skill-level { display: inline-block; padding: 3px 11px; border-radius: var(--r-pill); background: var(--ac-wash); color: var(--skill-ink, var(--ac-ink)); font-size: .78rem; font-weight: 600; }
.skill-body .btn { margin-top: var(--sp-sm); }

.sk-kc { --skill-fill: #6633ee; --skill-ink: #341687; }
.sk-ss { --skill-fill: #0d9488; --skill-ink: #0B6B62; }
.sk-sd { --skill-fill: #2563eb; --skill-ink: #1B3F8F; }
.sk-as { --skill-fill: #d97706; --skill-ink: #8A5A05; }
.sk-ae { --skill-fill: #db2777; --skill-ink: #8F1B4E; }

.skill-card.is-todo .skill-fig img { filter: grayscale(.32); }

/* --------------------------------------------------------------------------
   ฟอร์มเข้าสู่ระบบพร้อมอนิเมชัน
   -------------------------------------------------------------------------- */

.login-wrap { max-width: 448px; margin: var(--sp-section) auto; padding: 0 20px var(--sp-section); }

.login-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-xl);
  padding: 0 0 var(--sp-xl);
  overflow: hidden;
  margin: 0; max-width: none;
  animation: fs-rise .46s var(--ease) both;
}
@keyframes fs-rise { from { opacity: 0; transform: translateY(16px); } }

/* หัวการ์ดใช้โครงเดียวกับฮีโร่ของหน้าอื่น */
.login-head {
  position: relative;
  padding: var(--sp-xl) var(--sp-xl) var(--sp-lg);
  text-align: center;
  color: #fff;
  background: var(--ac-deep);
  background-image:
    linear-gradient(160deg, var(--ac-deep) 0%, var(--ac) 100%),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.05) 0 1px, transparent 1px 9px);
  background-blend-mode: normal, overlay;
  overflow: hidden;
}
/* แสงกวาดผ่านหัวการ์ดหนึ่งครั้งตอนเปิดหน้า */
.login-head::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.22) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: fs-sweep 1.5s var(--ease) .35s both;
  pointer-events: none;
}
@keyframes fs-sweep { to { transform: translateX(120%); } }

.login-head img {
  position: relative; z-index: 1;
  width: 72px; height: 72px; object-fit: contain;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: var(--r-full); padding: 10px;
  animation: fs-pop .5s var(--ease) .12s both;
}
@keyframes fs-pop { from { opacity: 0; transform: scale(.8) rotate(-6deg); } }
.login-head h1 { position: relative; z-index: 1; color: #fff; font-size: 1.24rem; margin: var(--sp-sm) 0 3px; }
.login-head p { position: relative; z-index: 1; color: rgba(255,255,255,.86); font-size: .85rem; margin: 0; max-width: none; }

.login-card > :not(.login-head) { padding-inline: var(--sp-xl); }

/* แท็บบทบาท พร้อมตัวชี้ที่เลื่อนตาม */
.role-tabs {
  display: flex; flex-wrap: wrap; gap: 2px;
  margin: var(--sp-lg) 0;
  padding: 3px;
  background: var(--bg-soft);
  border-radius: var(--r-sm);
}
.role-tabs a {
  flex: 1 1 auto; text-align: center;
  padding: 8px 10px; border-radius: var(--r-xs);
  font-size: .84rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.role-tabs a:hover { color: var(--ac-ink); }
.role-tabs a.is-active {
  background: var(--bg-card); color: var(--ac-ink);
  box-shadow: 0 1px 3px rgba(52,22,135,.12);
}

/* ช่องกรอกป้ายลอย ทยอยปรากฏทีละช่อง */
.ffield { position: relative; margin-bottom: var(--sp-lg); animation: fs-slide .42s var(--ease) both; }
.ffield:nth-of-type(1) { animation-delay: .2s; }
.ffield:nth-of-type(2) { animation-delay: .3s; }
@keyframes fs-slide { from { opacity: 0; transform: translateY(10px); } }

.ffield input {
  width: 100%; height: 54px;
  padding: 22px 14px 7px;
  border: 1px solid #cdc5e8; border-radius: var(--r-sm);
  background: var(--bg-card);
}
.ffield label {
  position: absolute; left: 14px; top: 16px; margin: 0;
  font-size: .95rem; font-weight: 500; color: var(--text-muted);
  pointer-events: none; transform-origin: left top;
  transition: transform .2s var(--ease), color .2s var(--ease);
}
.ffield input:focus + label, .ffield input:not(:placeholder-shown) + label {
  transform: translateY(-10px) scale(.78); color: var(--ac-dk); font-weight: 600;
}
.ffield input:focus { border-color: var(--ac-dk); box-shadow: 0 0 0 3px var(--ac-wash); }
/* ขีดใต้วิ่งจากกลางออกสองข้างตอนโฟกัส */
.ffield::after {
  content: ''; position: absolute; left: 50%; right: 50%; bottom: 0; height: 2px;
  background: var(--ac-dk); border-radius: 2px;
  transition: left .3s var(--ease), right .3s var(--ease);
}
.ffield:focus-within::after { left: 0; right: 0; }

.login-card .inline-check { animation: fs-slide .42s var(--ease) .38s both; }
.login-card .actions { margin-top: var(--sp-lg); animation: fs-slide .42s var(--ease) .46s both; }
.login-card form button { position: relative; overflow: hidden; }
.login-foot { margin-top: var(--sp-lg); text-align: center; font-size: .85rem; color: var(--text-muted); animation: fs-slide .42s var(--ease) .54s both; }

@media (prefers-reduced-motion: reduce) {
  .login-card, .login-head img, .ffield, .login-card .actions,
  .login-card .inline-check, .login-foot { animation: none; }
  .login-head::after { display: none; }
}

/* --------------------------------------------------------------------------
   ส่วนประกอบอื่นและคลาสรุ่นเก่า
   -------------------------------------------------------------------------- */

.highlight, .score-level { font-weight: 700; color: var(--ac-ink); }
.detail { color: var(--text-muted); }
.sub-elements { margin: var(--sp-xs) 0 var(--sp-md); padding-left: 20px; }
.sub-elements li { margin-bottom: var(--sp-xs); }

.profile { display: flex; align-items: center; gap: var(--sp-lg); flex-wrap: wrap; }
.profile img { width: 76px; height: 76px; object-fit: contain; flex: none; }
.profile .text p { margin: 0 0 2px; color: var(--text-muted); }

.filter-input { max-width: 320px; width: auto; min-width: 200px; display: inline-block; }

.state { font-weight: 600; }
.state--sent { color: var(--green-ink); }
.state--default { color: var(--text-muted); }

.badge { display: inline-block; padding: 3px 10px; border-radius: var(--r-pill); background: var(--ac-wash); color: var(--ac-ink); font-size: .78rem; font-weight: 600; }
.badge.ok   { background: #e8f6ee; color: var(--green-ink); }
.badge.warn { background: #fdf1e2; color: var(--gold-ink); }
.badge.bad  { background: #fdecec; color: var(--red-ink); }

.questions { margin-bottom: var(--sp-lg); }
.questions > label { font-weight: 600; }
.question-text { white-space: pre-wrap; }

details { border-bottom: 1px solid var(--border-color); padding: var(--sp-md) 0; }
summary { cursor: pointer; font-weight: 600; padding: var(--sp-xs) 0; }

.toolbar {
  position: sticky; bottom: 0; background: var(--bg-card);
  padding: var(--sp-sm) var(--sp-lg); border-top: 1px solid var(--border-color);
  display: flex; justify-content: space-between; gap: var(--sp-md);
  align-items: center; flex-wrap: wrap;
}
.progress { font-weight: 700; color: var(--ac-ink); font-variant-numeric: tabular-nums; }

.dropdown { position: relative; display: inline-block; }
.dropdown-content {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--bg-card); min-width: 190px;
  border: 1px solid var(--border-color); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); z-index: 40; overflow: hidden;
}
.dropdown-content a { display: block; padding: 10px 15px; color: var(--text-main); text-decoration: none; font-weight: 500; }
.dropdown-content a:hover { background: var(--ac-wash); color: var(--ac-ink); }
.dropdown:hover .dropdown-content, .dropdown:focus-within .dropdown-content { display: block; }

.role-list { list-style: none; margin: 0; padding: 0; }
.role {
  display: grid; grid-template-columns: 64px 1fr auto;
  align-items: center; gap: var(--sp-lg);
  padding: var(--sp-lg) 0; border-bottom: 1px solid var(--border-color);
}
.role:last-of-type { border-bottom: 0; padding-bottom: 0; }
.role:first-of-type { padding-top: 0; }
.role img { width: 64px; height: 64px; object-fit: contain; }
.role-body h3 { margin-bottom: 2px; }
.role-body p { margin: 0; max-width: 52ch; color: var(--text-muted); font-size: .92rem; }
.role-actions { display: flex; gap: var(--sp-xs); }

.steps { margin: 0 0 var(--sp-lg); padding-left: 22px; }
.steps li { margin-bottom: var(--sp-xs); }
.contact-list { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-xs) var(--sp-lg); margin: 0; }
.contact-list dt { font-weight: 600; color: var(--text-muted); }
.contact-list dd { margin: 0; }

.auth-head { display: flex; align-items: center; gap: var(--sp-lg); margin-bottom: var(--sp-lg); }
.auth-head img { width: 72px; height: 72px; object-fit: contain; flex: none; }
.inline-check { display: flex; align-items: center; gap: var(--sp-xs); font-weight: 500; margin: var(--sp-sm) 0 0; cursor: pointer; width: fit-content; }
.inline-check input { width: 17px; height: 17px; accent-color: var(--ac-dk); }

.site-foot { padding: var(--sp-lg) max(20px, calc((100vw - 1200px) / 2)); color: rgba(255, 255, 255, .9); font-size: .86rem; }
.site-foot p { margin: 0; max-width: none; }

/* --------------------------------------------------------------------------
   การเข้าถึง
   -------------------------------------------------------------------------- */

:focus-visible { outline: 2px solid var(--ac-dk); outline-offset: 3px; }
.hero :focus-visible { outline-color: #fff; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--bg-card); color: var(--text-main);
  padding: var(--sp-sm) var(--sp-md); z-index: 60; border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .stat-card:hover { transform: none; }
  .skill-card { height: auto; min-height: 420px; }
  .skill-card .skill-reveal { opacity: 1; visibility: visible; }
}

/* --------------------------------------------------------------------------
   จอเล็ก
   -------------------------------------------------------------------------- */

@media (max-width: 820px) {
  .topbar, header, .header { padding: var(--sp-sm) 16px; }
  .topnav, nav, .header .nav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .topnav a, nav a { white-space: nowrap; }
  .adm-nav { overflow-x: auto; }
  .adm-nav a { flex: 0 0 auto; }
}

@media (max-width: 760px) {
  main { margin-top: var(--sp-md); padding-inline: 16px; }
  section, .card, .panel, .container, .containerdetail, .student-container,
  .profile-container, .textarea-container, .table-container, .chart-container,
  .containerChart, .feedback-section, .section, .profile, .test-info {
    padding: var(--sp-lg); margin: var(--sp-md) 0;
  }
  .hero { padding: var(--sp-lg); }
  .row, .form-grid, .form-grid.thirds { grid-template-columns: 1fr; }
  .choices, .rating { display: grid; grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .skills { grid-template-columns: 1fr; }
  th, td { padding: 10px 9px; }
  .role { grid-template-columns: 52px 1fr; gap: var(--sp-sm) var(--sp-md); }
  .role img { width: 52px; height: 52px; }
  .role-actions { grid-column: 1 / -1; }
  .role-actions .btn { flex: 1 1 0; }
  .filter-input { max-width: 100%; width: 100%; }
  .panel-head .actions { margin-left: 0; width: 100%; }
}

/* แท็บเลือกบทบาทบนหน้าเข้าสู่ระบบ */
.role-tabs {
  display: flex; flex-wrap: wrap; gap: var(--sp-xxs);
  justify-content: center;
  margin: 0 0 var(--sp-lg);
  padding: var(--sp-xxs);
  background: var(--bg-soft);
  border-radius: var(--r-sm);
}
.role-tabs a {
  flex: 1 1 auto; text-align: center;
  padding: 8px 12px; border-radius: var(--r-xs);
  font-size: .86rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.role-tabs a:hover { background: var(--ac-wash); color: var(--ac-ink); }
.role-tabs a.is-active { background: var(--bg-card); color: var(--ac-ink); box-shadow: 0 1px 2px rgba(52,22,135,.08); }

/* --------------------------------------------------------------------------
   แถบเปรียบเทียบรายด้านในหน้าผลการประเมิน
   แถบเข้ารหัสข้อมูลจริง จึงหนากว่า 1px ได้ และมีตัวเลขกำกับทุกแถบ
   -------------------------------------------------------------------------- */

.bars { list-style: none; margin: 0; padding: 0; }
.bar-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1.2fr) minmax(120px, 1.8fr) auto auto;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid var(--border-color);
}
.bar-row:last-child { border-bottom: 0; }
.bar-code { font-weight: 700; font-size: .84rem; color: var(--skill-ink, var(--ac-ink)); }
.bar-name { font-size: .92rem; overflow-wrap: anywhere; }
.bar-track {
  height: 10px; border-radius: var(--r-pill);
  background: var(--bg-soft); overflow: hidden; display: block;
}
.bar-fill {
  display: block; height: 100%; border-radius: var(--r-pill);
  background: var(--skill-fill, var(--ac));
}
.bar-val {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bar-val .score-num {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text-main);
}
.bar-val .score-max {
  font-size: .84rem;
  font-weight: 500;
  color: var(--text-muted);
}
.bar-val .bar-pct {
  display: inline-block;
  font-weight: 700;
  font-size: .86rem;
  color: var(--ac-dk);
  background: var(--ac-wash);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  margin-left: 4px;
}
.bar-raw {
  font-size: .82rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  min-width: 68px;
}

/* หัวของแต่ละด้านในหน้าผล */
.result-head {
  display: flex; align-items: center; gap: var(--sp-md);
  flex-wrap: wrap; margin-bottom: var(--sp-md);
  padding-bottom: var(--sp-md); border-bottom: 1px solid var(--border-color);
}
.result-head img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.result-head h2 { margin: 0 0 2px; }
.result-head p { margin: 0; }
.result-head .badge { margin-left: auto; font-size: .86rem; padding: 6px 14px; }

@media (max-width: 760px) {
  .bar-row {
    grid-template-columns: 38px 1fr auto;
    row-gap: var(--sp-xs);
  }
  .bar-track {
    grid-column: 1 / -1;
  }
  .bar-val {
    grid-column: 3;
    justify-content: flex-end;
  }
  .bar-raw {
    grid-column: 2 / -1;
    text-align: left;
    min-width: 0;
  }
  .result-head .badge { margin-left: 0; }
}

/* เป้าแตะบนจอสัมผัสต้องใหญ่พอ ปุ่มเล็กจึงขยายบนจอเล็ก */
@media (max-width: 760px) {
  .btn-sm { min-height: 40px; padding: .5rem 1rem; }
  .adm-nav a { min-height: 44px; }
  .topnav, nav { -webkit-overflow-scrolling: touch; }
}

/* --------------------------------------------------------------------------
   การ์ดนักเรียน สำหรับหน้าครูและโรงเรียน
   ใช้แพตเทิร์นเดียวกับการ์ดทักษะ — วงกลมขยายตอน hover
   คะแนนเฉลี่ยเป็นตัวเลขใหญ่จาง ๆ ด้านหลัง รายละเอียดเผยออกมาตอน hover
   -------------------------------------------------------------------------- */

.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-md);
}

.st-card {
  position: relative;
  height: 375px;
  background: #f4f1fd;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 18px;
  overflow: hidden;
  margin: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.st-card:hover,
.st-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.11);
}

/* วงกลมสีขยายตอน hover ตาม Product Card Animation */
.st-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--st-fill, #16a34a);
  clip-path: circle(115px at 80% 18%);
  transition: clip-path .55s ease-in-out;
  z-index: 1;
}
.st-card:hover::before,
.st-card:focus-within::before {
  clip-path: circle(290px at 80% -18%);
}

/* ตัวเลข % คะแนนเฉลี่ยจางๆ ด้านหลังรูปนักเรียน (ลายน้ำขนาดใหญ่แบบ Product Card) */
.st-card::after {
  content: attr(data-avg);
  position: absolute;
  top: 11%;
  left: -4%;
  font-size: 5.6rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -.06em;
  color: #ffffff;
  opacity: .45;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  z-index: 2;
  line-height: 1;
  transition: opacity .4s ease;
}
.st-card.is-partial::after {
  opacity: .32;
}
.st-card:hover::after,
.st-card:focus-within::after {
  opacity: .25;
}

/* ป้ายสถานะมุมซ้ายบน เช่น 'ยังไม่ครบ', 'ยังไม่เริ่มทำ' */
.st-card .st-flag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  padding: 3px 10px;
  border-radius: var(--r-pill, 999px);
  background: rgba(255, 255, 255, .94);
  color: #b45309;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .02em;
  border: 1px solid rgba(180, 83, 9, .28);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(4px);
}
.st-card .st-flag-none {
  color: var(--text-muted, #64748b);
  border-color: var(--border-color, #e2e8f0);
}

/* กล่องรูปนักเรียน (จำลองแบบ .imgBx ของ Product Card) */
.st-fig {
  position: absolute;
  top: 36%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: top .5s cubic-bezier(0.4, 0, 0.2, 1), transform .5s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0;
  padding: 0;
}
.st-fig img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .5s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08));
}
.st-card:hover .st-fig,
.st-card:focus-within .st-fig {
  top: 8px;
  transform: translate(-50%, 0);
}
.st-card:hover .st-fig img,
.st-card:focus-within .st-fig img {
  transform: scale(0.65);
}

/* ส่วนกล่องเนื้อหาการ์ดสีขาวด้านล่าง (จำลองแบบ .contentBx ของ Product Card) */
.st-body {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: var(--bg-card, #ffffff);
  border-top: 1px solid var(--border-color, #e2e8f0);
  border-radius: 0 0 18px 18px;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: height .5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5;
  overflow: hidden;
  box-sizing: border-box;
}
.st-card:hover .st-body,
.st-card:focus-within .st-body {
  height: 308px;
  overflow-y: auto;
}

.st-id {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  margin: 0 0 2px;
  color: var(--text-main, #1e293b);
  line-height: 1.3;
}

.st-meta {
  font-size: .78rem;
  color: var(--text-muted, #64748b);
  margin: 0 0 8px;
  line-height: 1.3;
}

/* คอนเทนเนอร์คลี่รายละเอียดออกมาตอน Hover (.st-reveal) */
.st-reveal {
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity .35s ease, transform .35s ease, visibility .35s ease;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.st-card:hover .st-reveal,
.st-card:focus-within .st-reveal {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: .16s;
}

/* กล่องข้อมูลนักเรียน (สไตล์ตาม media_1789180897909.png พร้อมรวมชั้น/ห้องบรรทัดเดียว) */
.st-info-list {
  margin: 0 0 8px;
  text-align: left;
  line-height: 1.4;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  padding: 6px 10px;
}
.st-info-list p {
  margin: 0 0 2px 0;
  font-size: .76rem;
  color: #475569;
  font-weight: 500;
}
.st-info-list p:last-child {
  margin-bottom: 0;
}
.st-info-list p strong {
  color: #0056b3;
  font-weight: 600;
}

/* แถบเล็กบอกคะแนนรายด้าน (KC, SS, SD, AS, AE) */
.st-mini {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin: 0 0 8px;
}
.st-mini i {
  width: 100%;
  max-width: 26px;
  height: 5px;
  border-radius: var(--r-pill, 999px);
  background: var(--bg-soft, #ebe7f5);
  position: relative;
  overflow: hidden;
  font-style: normal;
}
.st-mini i b {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--st-fill, var(--ac, #0056b3));
  border-radius: var(--r-pill, 999px);
}
.st-mini i.is-todo {
  background: repeating-linear-gradient(45deg, #f0f0f0 0 3px, #e4e4e4 3px 6px);
}

/* ปุ่มดูผลการประเมิน เด้งขึ้นมาแบบ Product Card Button */
.st-reveal .btn {
  margin-top: auto;
  min-height: 32px;
  padding: 5px 12px;
  font-size: .8rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .35s ease, transform .35s ease;
}
.st-card:hover .st-reveal .btn,
.st-card:focus-within .st-reveal .btn {
  opacity: 1;
  transform: translateY(0);
  transition-delay: .26s;
}

/* ระดับผลเข้ารหัสด้วยสี — เขียวดี ทองกลาง แดงต้องพัฒนา เทายังไม่ทำ */
.st-good { --st-fill: #16a34a; }
.st-mid  { --st-fill: #d97706; }
.st-low  { --st-fill: #c2410c; }
.st-none { --st-fill: #8b85a3; }

@media (max-width: 760px) {
  .roster { grid-template-columns: 1fr; gap: var(--sp-md); }
}

/* ==========================================================================
   ชุดปุ่มเฉพาะทาง
   ========================================================================== */

/* ---- ปุ่มลบ วงกลมที่ยืดออกเป็นแคปซูลพร้อมคำว่าลบ ---- */
.btn-del {
  width: 42px; height: 42px; min-height: 42px;
  padding: 0; border: none; border-radius: 50%;
  background: var(--text-main);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; cursor: pointer;
  box-shadow: 0 2px 8px rgba(22, 20, 32, .16);
  transition: width .3s var(--ease), border-radius .3s var(--ease), background-color .3s var(--ease);
}
.btn-del svg { width: 13px; transition: width .3s var(--ease), transform .3s var(--ease); }
.btn-del svg path { fill: #fff; }
.btn-del::before {
  content: attr(data-label);
  position: absolute; top: -20px;
  color: #fff; font-size: 2px; font-weight: 600;
  transition: font-size .3s var(--ease), transform .3s var(--ease);
}
.btn-del:hover, .btn-del:focus-visible {
  width: 116px; border-radius: var(--r-pill);
  background: var(--red-ink);
}
.btn-del:hover svg, .btn-del:focus-visible svg { width: 40px; transform: translateY(58%); }
.btn-del:hover::before, .btn-del:focus-visible::before { font-size: 13px; transform: translateY(26px); }
.btn-del:active { transform: translateY(1px); }

/* ---- ปุ่มออกจากระบบ วงกลมที่ยืดออกพร้อมข้อความ ---- */
.btn-out {
  display: inline-flex; align-items: center; justify-content: flex-start;
  width: 42px; height: 42px; min-height: 42px;
  padding: 0; border: none; border-radius: 50%;
  background: var(--red-ink);
  position: relative; overflow: hidden; cursor: pointer;
  box-shadow: 0 2px 8px rgba(166, 58, 58, .26);
  transition: width .3s var(--ease), border-radius .3s var(--ease);
  text-decoration: none;
}
.btn-out .sign {
  width: 100%; display: flex; align-items: center; justify-content: center;
  transition: width .3s var(--ease), padding-left .3s var(--ease);
}
.btn-out .sign svg { width: 16px; }
.btn-out .sign svg path { fill: #fff; }
.btn-out .text {
  position: absolute; right: 0; width: 0; opacity: 0;
  color: #fff; font-size: .92rem; font-weight: 600; white-space: nowrap;
  transition: width .3s var(--ease), opacity .3s var(--ease), padding-right .3s var(--ease);
}
.btn-out:hover, .btn-out:focus-visible { width: 146px; border-radius: var(--r-pill); }

/* กฎของเมนูบนแถบบนมีน้ำหนักมากกว่า จึงต้องเขียนทับให้ชัด */
.topnav a.btn-out, nav a.btn-out {
  width: 42px; padding: 0; border-radius: 50%;
  background: var(--red-ink); color: #fff;
  gap: 0; font-weight: 600;
}
.topnav a.btn-out:hover, nav a.btn-out:hover,
.topnav a.btn-out:focus-visible, nav a.btn-out:focus-visible {
  width: 146px; border-radius: var(--r-pill);
  background: #8c2f2f; color: #fff;
}
.btn-out:hover .sign, .btn-out:focus-visible .sign { width: 26%; padding-left: 16px; }
.btn-out:hover .text, .btn-out:focus-visible .text { opacity: 1; width: 74%; padding-right: 12px; }
.btn-out:active { transform: translate(1px, 1px); }

/* ---- ปุ่มหลักแบบสามชั้น ใช้กับการกระทำหลักหนึ่งเดียวของหน้า ---- */
.btn-push {
  position: relative; border: none; background: transparent;
  padding: 0; outline-offset: 4px; cursor: pointer;
  font: inherit; min-height: 0; box-shadow: none;
}
.btn-push .shadow {
  position: absolute; inset: 0;
  background: rgba(52, 22, 135, .22);
  border-radius: var(--r-sm);
  transform: translateY(2px);
  transition: transform .6s cubic-bezier(.3, .7, .4, 1);
}
.btn-push .edge {
  position: absolute; inset: 0; border-radius: var(--r-sm);
  background: linear-gradient(to left,
    var(--ac-ink) 0%, var(--ac-deep) 8%, var(--ac-deep) 92%, var(--ac-ink) 100%);
}
.btn-push .front {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: var(--sp-xs);
  padding: 11px 24px;
  font-size: 1rem; font-weight: 600; color: #fff;
  background: var(--ac-dk);
  border-radius: var(--r-sm);
  transform: translateY(-4px);
  transition: transform .6s cubic-bezier(.3, .7, .4, 1), background-color .18s var(--ease);
}
.btn-push:hover .shadow { transform: translateY(4px); transition: transform .25s cubic-bezier(.3, .7, .4, 1.5); }
.btn-push:hover .front  { transform: translateY(-6px); background: var(--ac); transition: transform .25s cubic-bezier(.3, .7, .4, 1.5), background-color .18s var(--ease); }
.btn-push:active .shadow { transform: translateY(1px); transition: transform 34ms; }
.btn-push:active .front  { transform: translateY(-2px); transition: transform 34ms; }
.btn-push .front span { user-select: none; }
.btn-push[disabled] { cursor: not-allowed; opacity: .5; }

/* ใช้กับ <a> ได้ด้วย */
a.btn-push { display: inline-block; text-decoration: none; }
a.btn-push .front { text-decoration: none; }

/* แบบรอง พื้นขาวขอบม่วง ใช้คู่กับปุ่มหลักในแถวเดียวกัน */
.btn-push.is-ghost .edge {
  background: linear-gradient(to left, #bfb0ee 0%, var(--violet-line, #d9cdfb) 8%, var(--violet-line, #d9cdfb) 92%, #bfb0ee 100%);
}
.btn-push.is-ghost .front { background: var(--bg-card); color: var(--ac-dk); }
.btn-push.is-ghost:hover .front { background: var(--ac-wash); color: var(--ac-ink); }
.btn-push.is-ghost .shadow { background: rgba(52, 22, 135, .14); }

.btn-push.is-sm .front { padding: 7px 16px; font-size: .9rem; }
.btn-push.is-danger .edge { background: linear-gradient(to left, #6b1a16 0%, #8c2f2f 8%, #8c2f2f 92%, #6b1a16 100%); }
.btn-push.is-danger .front { background: var(--red-ink); }
.btn-push.is-danger:hover .front { background: #b8433c; }

@media (prefers-reduced-motion: reduce) {
  .btn-del, .btn-del svg, .btn-del::before,
  .btn-out, .btn-out .sign, .btn-out .text,
  .btn-push .shadow, .btn-push .front { transition: none; }
}

/* แถวปุ่มลบในตาราง เว้นระยะจากฟอร์มแก้ไขด้านบน */
.del-row { margin-top: var(--sp-md); padding-top: var(--sp-sm); border-top: 1px solid var(--border-color); }

/* --------------------------------------------------------------------------
   หน้าจัดการแบบประเมิน
   -------------------------------------------------------------------------- */

/* รายการชุดประเมิน */
.set-list { list-style: none; margin: 0; padding: 0; }
.set-row {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center; gap: var(--sp-md);
  padding: var(--sp-md) 0; border-bottom: 1px solid var(--border-color);
}
.set-row:last-child { border-bottom: 0; }
.set-row img { width: 52px; height: 52px; object-fit: contain; }
.set-code {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--ac-wash, #eef2ff);
  color: var(--skill-ink, #4338ca);
  border: 1px solid rgba(99, 102, 241, 0.2);
  margin-bottom: 4px;
}
.set-main h3 { margin: 1px 0 2px; }
.set-main p { margin: 0; font-size: .86rem; }
.set-warn { color: var(--red-ink) !important; font-weight: 600; margin-top: 3px !important; }
.set-side { display: flex; align-items: center; gap: var(--sp-sm); }

/* รายการคำถาม */
.q-add { background: var(--bg-soft); border-radius: var(--r-md); padding: var(--sp-md); margin-bottom: var(--sp-lg); }
.q-add-grid { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: var(--sp-md); align-items: end; }
.q-add-grid .field { margin-bottom: 0; }
.q-add-btn { display: flex; align-items: flex-end; }

.q-list { list-style: none; margin: 0; padding: 0; counter-reset: q; }
.q-item {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center; gap: var(--sp-sm);
  padding: var(--sp-xs) 0; border-bottom: 1px solid var(--border-color);
}
.q-item:last-child { border-bottom: 0; }
.q-no {
  font-size: .8rem; font-weight: 700; color: var(--text-muted);
  font-variant-numeric: tabular-nums; text-align: right;
}

.q-edit { display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; gap: var(--sp-xs); align-items: center; }
.q-edit .q-num { min-height: 38px; padding: 6px 8px; text-align: center; }
.q-edit .q-text { min-height: 38px; padding: 6px 10px; }
.q-static { margin: 0; padding: 8px 0; }
.q-del { display: flex; align-items: center; }

/* แผนภาพความครอบคลุมของเกณฑ์ */
.cov {
  position: relative; height: 26px; border-radius: var(--r-pill);
  background: repeating-linear-gradient(45deg, var(--bg-soft) 0 5px, #ece7fa 5px 10px);
  overflow: hidden;
}
.cov-band {
  position: absolute; top: 0; bottom: 0;
  background: var(--ac);
  border-right: 2px solid var(--bg-card);
}
.cov-band:nth-child(4n+2) { background: var(--ac-dk); }
.cov-band:nth-child(4n+3) { background: var(--ac-lt); }
.cov-band:nth-child(4n+4) { background: var(--ac-deep); }
.cov-scale {
  display: flex; justify-content: space-between;
  font-size: .76rem; font-weight: 600; color: var(--text-muted);
  margin-top: var(--sp-xxs); font-variant-numeric: tabular-nums;
}

/* เกณฑ์แต่ละช่วงแบบยุบได้ */
.band { border-bottom: 1px solid var(--border-color); padding: var(--sp-sm) 0; }
.band summary { display: flex; align-items: center; gap: var(--sp-sm); flex-wrap: wrap; }
.band summary strong { font-variant-numeric: tabular-nums; min-width: 74px; }
.band-sum { font-size: .84rem; }
.band form { margin-top: var(--sp-md); }

/* มาตรวัดคำตอบแบบดูก่อนบันทึก */
.scale-preview { display: flex; flex-wrap: wrap; gap: var(--sp-xs); margin-bottom: var(--sp-lg); }
.scale-chip {
  display: inline-flex; align-items: center; gap: var(--sp-xs);
  padding: 7px 13px; border-radius: var(--r-pill);
  background: var(--ac-wash); color: var(--ac-ink);
  font-size: .86rem; font-weight: 500;
}
.scale-chip b {
  display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--ac-dk); color: #fff;
  font-size: .78rem; font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
  .set-row { grid-template-columns: 44px minmax(0, 1fr); }
  .set-row img { width: 44px; height: 44px; }
  .set-side { grid-column: 1 / -1; }
  .q-add-grid { grid-template-columns: 1fr; }
  .q-item { grid-template-columns: 1fr; }
  .q-no { text-align: left; }
  .q-edit { grid-template-columns: 64px minmax(0, 1fr); }
  .q-edit .btn-push { grid-column: 1 / -1; }
}

/* ปุ่มสามชั้นแบบเต็มความกว้าง */
.btn-push.is-block { display: block; width: 100%; }
.btn-push.is-block .front { width: 100%; }

/* ปุ่มสามชั้นในแถวเดียวกันต้องเรียงชิดฐานเดียวกัน */
.actions .btn-push { vertical-align: bottom; }
.role-actions .btn-push { flex: 1 1 0; }
.role-actions .btn-push .front { width: 100%; }

/* ข้อความในปุ่มห้ามตัดคำ */
.btn-push .front span, .btn, button { white-space: nowrap; }
.role-actions { min-width: 236px; gap: var(--sp-xs); }
@media (max-width: 760px) { .role-actions { min-width: 0; } }

/* ==========================================================================
   ส่วนรายงานคำบรรยายและการแปลผล (Narrative Reports & Interpretation)
   ========================================================================== */

.interp-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
  margin-bottom: var(--sp-xl);
}

.interp-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-lg);
  box-shadow: var(--shadow);
}

.result-head {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  flex-wrap: wrap;
  padding-bottom: var(--sp-md);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--sp-md);
}

.result-head img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.result-title {
  flex: 1 1 240px;
  min-width: 0;
}

.result-title h2 {
  margin: 2px 0 4px;
  font-size: 1.25rem;
}

.result-title p {
  margin: 0;
  font-size: 0.88rem;
}

.result-badge {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--r-pill);
}

.analysis-box {
  background: var(--ac-wash);
  border-left: 4px solid var(--ac-dk);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  padding: var(--sp-sm) var(--sp-md);
  margin: var(--sp-md) 0;
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--text-main);
}

.analysis-box p {
  margin: 0;
  max-width: none;
}

.detail-block {
  margin-top: var(--sp-md);
  padding: var(--sp-sm) 0;
}

.detail-block h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: var(--sp-xs);
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}

.sub-elements {
  list-style: none;
  padding: 0;
  margin: var(--sp-xs) 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sub-elements li {
  position: relative;
  padding-left: 20px;
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.55;
}

.sub-elements li::before {
  content: "•";
  position: absolute;
  left: 6px;
  top: -1px;
  color: var(--ac-dk);
  font-size: 1.2rem;
  line-height: 1;
}

.suggestion-block {
  background: #f8faf9;
  border: 1px solid #d1fae5;
  border-radius: var(--r-sm);
  padding: var(--sp-md);
  margin-top: var(--sp-md);
}

.suggestion-block h3 {
  color: var(--green-ink);
}

/* ==========================================================================
   ฟอร์มเพิ่มผู้ใช้ (Admin Users Panel)
   ========================================================================== */

.add-user-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.add-user-summary {
  padding: var(--sp-md) var(--sp-lg);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--ac-wash) 0%, #ffffff 100%);
  color: var(--ac-ink);
  user-select: none;
  transition: background-color 0.2s ease;
}

.add-user-summary:hover {
  background: var(--ac-wash);
}

.add-user-body {
  padding: var(--sp-lg);
  border-top: 1px solid var(--border-color);
  background: #ffffff;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-md);
  margin-bottom: var(--sp-md);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
  padding-top: var(--sp-sm);
  border-top: 1px dashed var(--border-color);
}

/* ==========================================================================
   กฎสำหรับการพิมพ์และส่งออก PDF (@media print)
   ========================================================================== */

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .topbar,
  header,
  .header,
  .topnav,
  nav,
  .adm-nav,
  .page-nav-bar,
  .actions,
  .btn,
  button,
  .no-print,
  .add-user-panel,
  form.actions {
    display: none !important;
  }

  main {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .hero {
    background: #f4f4f4 !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
    page-break-after: avoid;
  }

  .hero h1, .hero p, .hero span {
    color: #000 !important;
  }

  .interp-section {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 20px !important;
  }

  .analysis-box {
    background: #f9f9f9 !important;
    border-left: 4px solid #333 !important;
  }

  .suggestion-block {
    background: #fafafa !important;
    border: 1px solid #ccc !important;
  }

  .table-wrap {
    overflow: visible !important;
  }

  table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  th, td {
    border: 1px solid #ddd !important;
    padding: 6px 8px !important;
  }
}

/* --------------------------------------------------------------------------
   Custom Popup Modal (Card Style from user design)
   -------------------------------------------------------------------------- */
.popup-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.popup-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.popup-modal-card {
  width: 320px;
  max-width: 92vw;
  min-height: 220px;
  background-color: rgb(255, 255, 255);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 28px;
  gap: 13px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.28), 0 0 1px rgba(0, 0, 0, 0.12);
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.popup-modal-overlay.active .popup-modal-card {
  transform: scale(1);
}

.popup-card-svg {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.cookieHeading {
  font-size: 1.2em;
  font-weight: 800;
  color: rgb(26, 26, 26);
  margin: 0;
  text-align: center;
  font-family: inherit;
}

.cookieDescription {
  text-align: center;
  font-size: 0.78em;
  font-weight: 600;
  color: rgb(99, 99, 99);
  margin: 0;
  line-height: 1.5;
  font-family: inherit;
}

.cookieDescription a {
  color: rgb(59, 130, 246);
}

.cookieDescription a:hover {
  text-decoration: underline;
}

.buttonContainer {
  display: flex;
  gap: 16px;
  flex-direction: row;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
}

.acceptButton {
  min-width: 85px;
  height: 32px;
  padding: 0 16px;
  background-color: #7b57ff;
  border: none;
  color: rgb(241, 241, 241);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 20px;
  box-shadow: 0 4px 6px -1px #977ef3, 0 2px 4px -1px #977ef3;
  transition: all .25s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.acceptButton:hover {
  background-color: #9173ff;
  box-shadow: 0 10px 15px -3px #977ef3, 0 4px 6px -2px #977ef3;
  transform: translateY(-1px);
}

.acceptButton.btn-danger {
  background-color: #ef4444;
  box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.4), 0 2px 4px -1px rgba(239, 68, 68, 0.3);
}
.acceptButton.btn-danger:hover {
  background-color: #dc2626;
  box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.45);
}

.acceptButton.btn-success {
  background-color: #10b981;
  box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.4), 0 2px 4px -1px rgba(16, 185, 129, 0.3);
}
.acceptButton.btn-success:hover {
  background-color: #059669;
  box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.45);
}

.declineButton {
  min-width: 85px;
  height: 32px;
  padding: 0 16px;
  background-color: #dadada;
  color: rgb(46, 46, 46);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 20px;
  box-shadow: 0 4px 6px -1px #bebdbd, 0 2px 4px -1px #bebdbd;
  transition: all .25s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.declineButton:hover {
  background-color: #ebebeb;
  box-shadow: 0 10px 15px -3px #bebdbd, 0 4px 6px -2px #bebdbd;
  transform: translateY(-1px);
}



/* --------------------------------------------------------------------------
   ตัวเลือกและอัปโหลดไอคอนชุดประเมิน
   -------------------------------------------------------------------------- */
.icon-picker-component {
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--r-md, 12px);
  padding: 16px;
  margin-top: 6px;
}
.icon-picker-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 640px) {
  .icon-picker-layout { grid-template-columns: 1fr; }
}
.icon-picker-current {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #ffffff;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.icon-preview-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.icon-preview-box {
  width: 72px;
  height: 72px;
  background: #f1f5f9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #cbd5e1;
  padding: 6px;
  box-sizing: border-box;
}
.icon-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.icon-picker-gallery {
  display: flex;
  flex-direction: column;
}
.icon-grid-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
  padding: 6px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
}
.icon-thumb-btn {
  width: 48px;
  height: 48px;
  padding: 4px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  box-sizing: border-box;
}
.icon-thumb-btn img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  pointer-events: none;
}
.icon-thumb-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.06);
}
.icon-thumb-btn.is-selected {
  border-color: #6366f1;
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  transform: scale(1.05);
}

/* ==========================================================================
   Scale Builder (ตัวเลือกคำตอบแบบเพิ่ม/แก้ไข/ลบ ทีละข้อ)
   ========================================================================== */
.scale-builder {
  background: var(--bg-soft, #f8f7fc);
  border: 1px solid var(--border-color, #e2ddf0);
  border-radius: var(--r-md, 12px);
  padding: 18px 20px;
  margin-top: var(--sp-md, 16px);
  margin-bottom: var(--sp-md, 16px);
}

.scale-builder-head {
  display: grid;
  grid-template-columns: 56px 130px minmax(0, 1fr) 76px;
  gap: 12px;
  padding: 6px 12px 10px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  border-bottom: 1px solid var(--border-color, #e2ddf0);
  margin-bottom: 12px;
}

.scale-builder-head.no-action {
  grid-template-columns: 56px 130px minmax(0, 1fr);
}

.scale-builder-head .col-center {
  text-align: center;
}

.scale-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scale-item-row {
  display: grid;
  grid-template-columns: 56px 130px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2ddf0);
  border-radius: var(--r-sm, 8px);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.scale-item-row.no-action {
  grid-template-columns: 56px 130px minmax(0, 1fr);
}

.scale-item-row:hover {
  border-color: var(--ac-lt, #a5b4fc);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.scale-row-num {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ac-dk, #4f46e5);
  background: var(--ac-wash, #eef2ff);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 6px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.scale-input-score {
  min-height: 40px !important;
  text-align: center !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  color: var(--ac-deep, #1e1b4b) !important;
}

.scale-input-label {
  min-height: 40px !important;
  font-size: 0.95rem !important;
}

.scale-row-action {
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-del-scale {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: var(--r-sm, 8px);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.18s var(--ease);
  width: 100%;
}

.btn-del-scale:hover:not(:disabled) {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  transform: translateY(-1px);
}

.btn-del-scale:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
}

.scale-builder-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color, #e2ddf0);
}

.btn-add-scale {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  color: var(--ac-dk, #4f46e5);
  border: 1.5px dashed var(--ac-lt, #818cf8);
  border-radius: var(--r-sm, 8px);
  padding: 9px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.btn-add-scale:hover:not(:disabled) {
  background: var(--ac-wash, #eef2ff);
  border-color: var(--ac-dk, #4f46e5);
  transform: translateY(-1px);
}

.btn-add-scale:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-style: solid;
  border-color: var(--border-color, #e2e8f0);
  color: var(--text-muted, #94a3b8);
}

.scale-count-info {
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
}

input.is-invalid {
  border-color: #dc2626 !important;
  background-color: #fef2f2 !important;
}
input.is-invalid:focus {
  box-shadow: 0 0 0 3px #fee2e2 !important;
}

@media (max-width: 640px) {
  .scale-builder-head {
    display: none;
  }
  .scale-item-row {
    grid-template-columns: 40px 90px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px 10px;
  }
  .btn-del-scale {
    padding: 0 8px;
    width: auto;
  }
  .btn-del-scale span {
    display: none;
  }
}
