  * { font-family: 'Sarabun', sans-serif; }
  :root {
    --brand-400: #4CA68F;
    --brand-500: #3D8F78;
    --brand-700: #265F50;
    --brand-900: #1B4336;
    --gold: #C9A13B;
  }
  body {
    background:
      radial-gradient(circle at 10% 0%, rgba(76,166,143,0.14), transparent 40%),
      radial-gradient(circle at 90% 100%, rgba(201,161,59,0.08), transparent 40%),
      #F2F6F4;
    background-attachment: fixed;
    min-height: 100vh;
    color: #1e293b;
  }

  /* ---- Header (โทนเดียวกับเว็บไซต์แพทยสภา) ---- */
  .hero {
    background: linear-gradient(120deg, #4CA68F 0%, #3B8570 45%, #1B4336 100%);
    position: relative;
  }
  .hero::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
    background: linear-gradient(90deg, #C9A13B, #E3C565, #C9A13B);
  }
  .logo-ring {
    background: #fff;
    border-radius: 9999px;
    padding: 3px;
    box-shadow: 0 0 0 3px rgba(227,197,101,0.55), 0 8px 24px rgba(0,0,0,0.25);
    flex-shrink: 0;
  }
  .logo-ring img { display: block; border-radius: 9999px; }


  /* ---- Cards ---- */
  .glass {
    background: #ffffff;
    border: 1px solid #DCEBE4;
    box-shadow: 0 1px 2px rgba(27,67,54,0.04), 0 8px 24px rgba(27,67,54,0.06);
  }
  .glass-strong {
    background: #ffffff;
    border: 1px solid #DCEBE4;
    box-shadow: 0 20px 50px rgba(27,67,54,0.18);
  }
  .btn-primary {
    background: linear-gradient(135deg, #4CA68F, #2F7663);
    box-shadow: 0 4px 14px rgba(47, 118, 99, 0.28);
    transition: all .2s ease;
    color: #fff;
  }
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(47,118,99,.4); }
  .btn-light {
    background: #fff;
    color: #1B4336;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    transition: all .2s ease;
  }
  .btn-light:hover { transform: translateY(-1px); background: #FBF6E6; }
  .btn-secondary {
    background: #fff;
    border: 1px solid #ADDBC9;
    color: #265F50;
    transition: all .2s ease;
  }
  .btn-secondary:hover { background: #EEF7F3; }
  .input-field, textarea.input-field, select.input-field {
    background: #fff;
    border: 1px solid #CFE3DA;
    color: #1e293b;
    transition: all .2s ease;
  }
  .input-field::placeholder { color: #94a3b8; }
  .input-field:focus {
    outline: none;
    border-color: #4CA68F;
    box-shadow: 0 0 0 3px rgba(76,166,143,0.22);
  }
  .input-field:disabled { background: #F5F8F7; color: #94a3b8; cursor: not-allowed; }
  select.input-field option { background: #fff; color: #1e293b; }
  .input-field.input-error { border-color: #F87171; }
  .input-field.input-error:focus { box-shadow: 0 0 0 3px rgba(248,113,113,0.22); }
  .btn-danger {
    background: #fff;
    border: 1px solid #FECACA;
    color: #DC2626;
    transition: all .2s ease;
  }
  .btn-danger:hover { background: #FEF2F2; }
  table { border-collapse: separate; border-spacing: 0; }
  .toast { animation: slideIn .25s ease, fadeOut .3s ease 2.2s forwards; }
  @keyframes slideIn { from { transform: translateY(-12px); opacity:0 } to { transform: translateY(0); opacity:1 } }
  @keyframes fadeOut { to { opacity: 0; transform: translateY(-8px); } }

  .tabbar {
    background: rgba(0,0,0,0.16);
    border: 1px solid rgba(255,255,255,0.12);
  }
  .navtab {
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    transition: all .2s ease;
  }
  .navtab:hover { background: rgba(255,255,255,0.12); color: #fff; }
  .navtab.active {
    background: #fff;
    color: #1F4D41;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  }
  .navtab.active svg { color: #C9A13B; }

  /* ---- 6. สรุปความพร้อม ---- */
  .print-only { display: none; }
  .rd-check { display: inline-flex; align-items: center; justify-content: center; padding: 4px; border-radius: 10px; transition: all .15s ease; }
  .rd-check.rd-pass:hover { background: #EEF7F3; }
  .rd-check.rd-fail:hover { background: #FEF2F2; }
  .rd-box {
    width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    border: 1.5px solid #ADDBC9; border-radius: 6px; background: #fff;
    font-size: 14px; font-weight: 700; line-height: 1; color: #fff; transition: all .15s ease;
  }
  .rd-fail .rd-box { border-color: #FECACA; }
  .rd-pass.is-on .rd-box { background: #3D8F78; border-color: #3D8F78; }
  .rd-fail.is-on .rd-box { background: #DC2626; border-color: #DC2626; }
  .rd-opt {
    display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 12px;
    border: 1px solid #DCEBE4; background: #fff; font-weight: 500; font-size: .875rem;
    white-space: nowrap; transition: all .15s ease;
  }
  .rd-opt:hover { background: #F5FAF8; }
  .rd-opt.rd-pass.is-on { border-color: #4CA68F; background: #EEF7F3; color: #1F4D41; }
  .rd-opt.rd-fail.is-on { border-color: #FCA5A5; background: #FEF2F2; color: #B91C1C; }

  .tab-content { display: none; }
  .tab-content.active { display: block; animation: fadeUp .25s ease; }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: #EEF4F1; }
  ::-webkit-scrollbar-thumb { background: #ADDBC9; border-radius: 6px; }
  ::-webkit-scrollbar-thumb:hover { background: #7EC3AB; }

  /* ---- พิมพ์: เอกสาร A4 ต่อเนื่อง ไม่มีกรอบการ์ด ---- */
  @page { size: A4; margin: 20mm 18mm 20mm 25mm; }
  @media print {
    html { font-size: 12pt; }
    body { background: #fff !important; color: #000 !important; }
    .no-print { display: none !important; }
    .page-wrap { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }

    /* เรียงทุกหัวข้อต่อกัน ไม่ขึ้นหน้าใหม่ */
    .tab-content { display: block !important; animation: none !important; }
    .glass, .glass-strong, .doc-section {
      background: none !important; border: none !important; border-radius: 0 !important;
      box-shadow: none !important; padding: 0 !important; margin: 0 0 9mm !important;
    }
    .glass *, .glass-strong * { color: #000 !important; }
    .doc-section h2 { margin-bottom: 3mm !important; }
    .doc-section h2 > span.rounded-full { display: none !important; }
    h2, h3, #committeeMeta, #scheduleMeta, .doc-section > p { break-after: avoid; page-break-after: avoid; }
    .doc-section h3 { margin-top: 5mm !important; }
    /* กันสระ/วรรณยุกต์ด้านบนล้นไปท้ายหน้าก่อน เมื่อหัวข้อขึ้นหน้าใหม่ */
    .doc-section h2, .doc-section h3 { padding-top: 2mm !important; }
    tr, li, .schedule-item { break-inside: avoid; page-break-inside: avoid; }

    /* ตาราง: เส้นตารางบาง ๆ แบบเอกสาร */
    .overflow-x-auto { overflow: visible !important; border: none !important; border-radius: 0 !important; }
    .print-table { border-collapse: collapse !important; }
    .print-table th, .print-table td { border: 0.5pt solid #000 !important; background: none !important; padding: 1.5mm 2mm !important; }
    .print-table td { height: 7mm; } /* แถวว่างสูงพอให้เขียนด้วยมือ */
    .print-table th { font-weight: 700; white-space: nowrap; }
    .print-table thead tr { background: none !important; }

    /* กำหนดการ: รายการต่อกัน ไม่มีกล่อง */
    .schedule-item { border: none !important; background: none !important; padding: 0 0 3mm !important; }
    #scheduleList { margin-top: 3mm; }

    /* ช่องกรอก → ข้อความ + เส้นประให้เขียนต่อได้ */
    .doc-section .grid { display: block !important; margin-top: 4mm !important; max-width: none !important; }
    .doc-section .grid > div { display: flex; align-items: baseline; gap: 3mm; margin-bottom: 2.5mm; }
    .doc-section .grid > div > label { margin: 0 !important; white-space: nowrap; font-weight: 600; }
    .input-field, select.input-field, textarea.input-field {
      background: none !important; border: none !important; border-bottom: 0.5pt dotted #000 !important;
      border-radius: 0 !important; box-shadow: none !important; padding: 0 1mm !important;
      -webkit-appearance: none; appearance: none; opacity: 1 !important;
    }
    #c_year { width: 18mm !important; }
    .input-field::placeholder { color: transparent !important; }
    select.input-field:has(option[value=""]:checked) { color: transparent !important; }
    input[type="date"].input-field:invalid::-webkit-datetime-edit { color: transparent !important; }
    input[type="date"]::-webkit-calendar-picker-indicator { display: none; }

    /* 6. สรุปความพร้อม: ช่องติ๊ก ☐/☑ + ข้อความจากช่องกรอกแบบหลายบรรทัด (ช่องกรอกซ่อน แสดง .print-only แทน) */
    .print-only { display: block !important; }
    .rd-table { min-width: 0 !important; }
    .rd-table th { white-space: normal !important; }
    .rd-table th:nth-child(1) { width: 12mm !important; }
    .rd-table th:nth-child(3), .rd-table th:nth-child(4) { width: 15mm !important; white-space: nowrap !important; padding-left: 1mm !important; padding-right: 1mm !important; }
    .rd-table th:nth-child(5) { width: 32% !important; }
    .rd-table tbody tr { background: none !important; }
    .rd-check, .rd-opt { border: none !important; background: none !important; box-shadow: none !important; padding: 0 !important; }
    .rd-opt { gap: 2mm !important; }
    .rd-box { width: 4mm !important; height: 4mm !important; border: 0.75pt solid #000 !important; border-radius: 0 !important; background: none !important; font-size: 9pt !important; }
    .rd-overall-row, .rd-imp-body { flex-direction: row !important; align-items: baseline !important; }
    .print-fill { min-height: 6mm; border-bottom: 0.5pt dotted #000; }
    .rd-sign { width: 80mm !important; break-inside: avoid; page-break-inside: avoid; }
    .rd-sign-wrap { margin-top: 8mm !important; }
    .rd-imp-row { align-items: baseline !important; }
    .rd-imp-num { padding-top: 0 !important; }
  }
