:root {
  --bg: #f1f8f3;
  --surface: #ffffff;
  --line: #d2e4da;
  --text: #163129;
  --muted: #5f746b;
  --accent: #0f8a63;
  --accent-soft: #e2f6eb;
  --danger: #a33b2f;
  --theme-header: #082f28;
  --theme-header-soft: #0d5c49;
  --theme-accent: #0f8a63;
  --theme-accent-strong: #0b6d53;
  --theme-accent-soft: #e2f6eb;
  --theme-bg: #f1f8f3;
  --theme-bg-soft: #e2f4e8;
  --theme-bg-glow: rgba(15, 138, 99, 0.14);
  --theme-shadow: rgba(8, 63, 46, 0.18);
  --theme-action-shadow: rgba(189, 242, 102, 0.24);
  --theme-logo-filter: none;
  --theme-contrast: #ffffff;
  --theme-action: #c6f36a;
  --theme-action-text: #0d2c24;
  --shadow: 0 12px 28px rgba(30, 42, 62, 0.08);
}

body[data-theme="carmine"] {
  --accent: #a30f24;
  --accent-soft: #fde8ec;
  --danger: #7f1d1d;
  --theme-header: #7a1020;
  --theme-header-soft: #a30f24;
  --theme-accent: #a30f24;
  --theme-accent-strong: #7a1020;
  --theme-accent-soft: #fde8ec;
  --theme-bg: #fff6f8;
  --theme-bg-soft: #fde8ec;
  --theme-bg-glow: rgba(163, 15, 36, 0.12);
  --theme-shadow: rgba(163, 15, 36, 0.2);
  --theme-action-shadow: rgba(163, 15, 36, 0.22);
  --theme-logo-filter: hue-rotate(128deg) saturate(1.45) brightness(0.86);
  --theme-action: #f4c430;
  --theme-action-text: #3b0a12;
}

body[data-theme="blue"] {
  --accent: #2563eb;
  --accent-soft: #e7efff;
  --danger: #b91c1c;
  --theme-header: #163b73;
  --theme-header-soft: #2563eb;
  --theme-accent: #2563eb;
  --theme-accent-strong: #1d4ed8;
  --theme-accent-soft: #e7efff;
  --theme-bg: #f4f8ff;
  --theme-bg-soft: #e7efff;
  --theme-bg-glow: rgba(37, 99, 235, 0.12);
  --theme-shadow: rgba(37, 99, 235, 0.2);
  --theme-action-shadow: rgba(37, 99, 235, 0.22);
  --theme-logo-filter: hue-rotate(36deg) saturate(1.45) brightness(1.02);
  --theme-action: #7dd3fc;
  --theme-action-text: #0f2544;
}

body[data-theme="maroon"] {
  --accent: #7f1d1d;
  --accent-soft: #f7e6e6;
  --danger: #991b1b;
  --theme-header: #4a1014;
  --theme-header-soft: #7f1d1d;
  --theme-accent: #7f1d1d;
  --theme-accent-strong: #5f1518;
  --theme-accent-soft: #f7e6e6;
  --theme-bg: #fbf4f4;
  --theme-bg-soft: #f7e6e6;
  --theme-bg-glow: rgba(127, 29, 29, 0.12);
  --theme-shadow: rgba(127, 29, 29, 0.2);
  --theme-action-shadow: rgba(127, 29, 29, 0.22);
  --theme-logo-filter: hue-rotate(132deg) saturate(1.35) brightness(0.72);
  --theme-action: #f2c94c;
  --theme-action-text: #3d0c10;
}

body[data-theme="green"] {
  --accent: #15803d;
  --accent-soft: #e8f7ee;
  --danger: #b91c1c;
  --theme-header: #14532d;
  --theme-header-soft: #15803d;
  --theme-accent: #15803d;
  --theme-accent-strong: #166534;
  --theme-accent-soft: #e8f7ee;
  --theme-bg: #f3fbf6;
  --theme-bg-soft: #e8f7ee;
  --theme-bg-glow: rgba(21, 128, 61, 0.12);
  --theme-shadow: rgba(21, 128, 61, 0.2);
  --theme-action-shadow: rgba(21, 128, 61, 0.2);
  --theme-logo-filter: hue-rotate(0deg) saturate(1.12) brightness(0.96);
  --theme-action: #bbf7d0;
  --theme-action-text: #0f3d22;
}

body[data-theme] {
  --bg: var(--theme-bg);
}

@font-face {
  font-family: "TH Sarabun New";
  src: url("fonts/THSarabunNew.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TH Sarabun New";
  src: url("fonts/THSarabunNew-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Kanit", "Noto Sans Thai", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

body,
body *,
button,
input,
select,
textarea {
  font-family: "Kanit", "Noto Sans Thai", "Segoe UI", sans-serif !important;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 32px;
  background: linear-gradient(135deg, var(--theme-header), var(--theme-header-soft) 68%, #0a4238);
  color: #fff;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.app-logo {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.18));
}

.brand-text {
  min-width: 0;
}

.app-name {
  margin: 0;
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.app-tagline {
  margin: 4px 0 0;
  color: #d7eeeb;
  font-size: 14px;
  font-weight: 500;
}

.app-unit {
  margin: 2px 0 0;
  color: #b6d9d5;
  font-size: 12px;
  font-weight: 500;
}

.sector-meta {
  display: none;
}

.header-search {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: auto;
  flex: 0 0 auto;
}

.header-search input {
  width: 100%;
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.global-header-actions {
  flex-wrap: wrap;
}

.login-app-header {
  position: relative;
  z-index: 1;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
}

.logout-button {
  border-color: rgba(255, 255, 255, 0.28);
  background: var(--theme-action);
  color: var(--theme-action-text);
}

.logout-button:hover,
.logout-button:focus-visible {
  background: color-mix(in srgb, var(--theme-action) 80%, #ffffff);
  color: var(--theme-action-text);
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(198, 243, 106, 0.22), transparent 32%),
    linear-gradient(135deg, var(--theme-header), var(--theme-header-soft) 54%, var(--theme-bg) 54%);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-page .login-shell {
  min-height: calc(100vh - 108px);
}

.login-card {
  display: grid;
  gap: 18px;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.login-card.member-dashboard-card {
  width: min(1180px, 100%);
  grid-template-columns: minmax(300px, 0.88fr) minmax(420px, 1.12fr);
  align-items: start;
  gap: 24px;
}

.login-card.member-dashboard-card > .app-logo,
.login-card.member-dashboard-card > .app-logo + div {
  grid-column: 1;
}

.login-card.member-dashboard-card > .login-message,
.login-card.member-dashboard-card > .login-back {
  grid-column: 1 / -1;
}

.login-card.member-dashboard-card #memberPanel {
  grid-column: 1;
}

.login-card.member-dashboard-card #memberPlanPanel {
  grid-column: 2;
  grid-row: 1 / span 4;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.login-card .app-name {
  color: var(--text);
}

.login-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.login-form button:disabled {
  opacity: 0.7;
  cursor: progress;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.google-auth-slot {
  min-height: 42px;
}

.google-auth-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.google-auth-note.error {
  color: var(--danger);
}

.pdpa-consent {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(11, 148, 112, 0.24);
  border-radius: 6px;
  background: rgba(223, 247, 240, 0.64);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.pdpa-consent input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.login-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.login-message.error {
  color: var(--danger);
}

.login-back {
  color: var(--accent);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.login-back.icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.login-back.icon-only svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.login-back.icon-only:hover,
.login-back.icon-only:focus-visible {
  background: #cfe9e6;
}

.stats-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: var(--theme-action);
  color: var(--theme-action-text);
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
  cursor: pointer;
}

button.stats-link {
  appearance: none;
}

.pixel-agent-toggle span {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.stats-link svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.stats-link:hover,
.stats-link:focus-visible {
  background: color-mix(in srgb, var(--theme-action) 80%, #ffffff);
}

.member-identity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  min-height: 40px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  text-decoration: none;
}

.member-identity img {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.35);
}

.member-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.member-avatar-large {
  width: 84px;
  height: 84px;
  border-radius: 999px;
  object-fit: cover;
  margin: 0 auto;
  border: 2px solid var(--line);
}

.member-action-icons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 6px 0 10px;
}

.member-plan-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.member-plan-list {
  display: grid;
  gap: 10px;
}

.member-plan-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  text-align: left;
}

.member-plan-card h4 {
  margin: 0;
  color: #12343b;
  font-size: 15px;
}

.member-plan-card p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.member-plan-progress,
.admin-plan-progress {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
}

.member-plan-progress span,
.admin-plan-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a, #126b73);
}

.member-plan-foot {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.member-plan-foot b {
  color: #126b73;
  font-size: 14px;
}

.member-plan-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.member-plan-actions .detail-open,
.member-plan-actions .icon-button {
  width: 42px;
  min-height: 42px;
}

.member-plan-actions .detail-open {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 8px 18px var(--theme-shadow);
}

.member-plan-actions .detail-open svg {
  width: 24px;
  height: 24px;
  stroke-width: 3;
}

.member-plan-actions .detail-open:hover,
.member-plan-actions .detail-open:focus-visible {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 12px 26px var(--theme-shadow);
}

.member-plan-delete {
  border-color: rgba(163, 59, 47, 0.24);
  background: #fff7f5;
}

.member-plan-delete:hover,
.member-plan-delete:focus-visible {
  background: #fee2e2;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-notify-root {
  position: fixed;
  z-index: 3000;
  top: 18px;
  right: 18px;
  display: grid;
  gap: 12px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.app-notify-toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(18, 52, 59, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
  animation: notifyIn 0.22s ease-out;
}

.app-notify-toast.closing,
.app-confirm-overlay.closing {
  animation: notifyOut 0.18s ease-in forwards;
}

.app-notify-toast.success {
  border-left: 6px solid #16a34a;
}

.app-notify-toast.error {
  border-left: 6px solid #dc2626;
}

.app-notify-toast.warning {
  border-left: 6px solid #f59e0b;
}

.app-notify-toast.info {
  border-left: 6px solid #126b73;
}

.app-notify-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #e3f4f2;
  color: #126b73;
}

.app-notify-toast.success .app-notify-icon,
.app-confirm-card.success .app-notify-icon {
  background: #dcfce7;
  color: #16a34a;
}

.app-notify-toast.error .app-notify-icon,
.app-confirm-card.error .app-notify-icon {
  background: #fee2e2;
  color: #dc2626;
}

.app-notify-toast.warning .app-notify-icon,
.app-confirm-card.warning .app-notify-icon {
  background: #fef3c7;
  color: #b45309;
}

.app-notify-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-notify-copy {
  display: grid;
  gap: 2px;
}

.app-notify-copy b {
  color: #12343b;
  font-size: 15px;
}

.app-notify-copy small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.app-notify-close {
  width: 32px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.app-confirm-overlay {
  position: fixed;
  z-index: 3100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(5px);
  animation: notifyIn 0.18s ease-out;
}

.app-confirm-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  width: min(480px, 100%);
  padding: 22px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.3);
}

.app-confirm-copy h2 {
  margin: 0 0 4px;
  color: #12343b;
  font-size: 20px;
}

.app-confirm-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.app-confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.app-confirm-actions button {
  width: auto;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 800;
}

.app-confirm-cancel {
  border: 1px solid var(--line);
  background: #fff;
  color: #334155;
}

.app-confirm-ok {
  border: 1px solid var(--theme-accent);
  background: var(--theme-accent);
  color: #fff;
}

@keyframes notifyIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes notifyOut {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

.impersonation-banner {
  position: sticky;
  top: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 18px;
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
  color: #fffaf0;
  font-weight: 700;
  box-shadow: 0 12px 22px rgba(217, 119, 6, 0.28);
  font-family: "Kanit", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.impersonation-banner .impersonation-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.impersonation-banner .impersonation-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.impersonation-banner .impersonation-message {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.impersonation-banner .impersonation-stop {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  min-height: 30px;
  padding: 5px 14px;
  background: #ffffff;
  color: #b45309;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
  font-family: inherit;
}

.impersonation-banner .impersonation-stop:hover {
  background: #fff7ed;
}

.impersonation-banner .impersonation-stop:disabled {
  opacity: 0.7;
  cursor: progress;
}

@media print {
  .impersonation-banner {
    display: none !important;
  }
}

.eyebrow {
  margin: 0 0 4px;
  color: #b6d9d5;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  font-weight: 700;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.status {
  min-width: 160px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  text-align: center;
  color: #e5f4f2;
}

.status.error {
  color: #ffd9d4;
  border-color: rgba(255, 217, 212, 0.55);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(246, 247, 249, 0.88);
  backdrop-filter: blur(6px);
}

.loading-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(420px, 100%);
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.loading-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  border: 4px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: loading-spin 0.8s linear infinite;
}

.loading-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.loading-message {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

body:not(.app-loading) .loading-overlay {
  display: none;
}

body.app-loading {
  overflow: hidden;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.layout {
  padding: 20px 32px 72px;
}

.course-detail-page .layout {
  padding-right: 88px;
}

.course-detail-page .detail-page {
  width: 100%;
}

.page-tabs {
  position: fixed;
  top: 50%;
  right: 16px;
  z-index: 18;
  display: grid;
  gap: 12px;
  width: 54px;
  transform: translateY(-50%);
}

.page-tabs::before {
  content: "";
  position: absolute;
  top: 26px;
  bottom: 26px;
  left: 26px;
  width: 3px;
  border-radius: 999px;
  background: #d8e2e7;
}

.page-tabs::after {
  content: "";
  position: absolute;
  top: 26px;
  left: 26px;
  width: 3px;
  height: var(--course-progress, 0%);
  max-height: calc(100% - 52px);
  border-radius: 999px;
  background: #16a34a;
}

.page-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  width: 54px;
  padding: 0;
  border: 2px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  box-shadow: var(--shadow);
  font: inherit;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.page-tab svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.page-tab-step {
  position: absolute;
  top: -7px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.page-tab-label {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  width: max-content;
  max-width: 270px;
  padding: 8px 12px;
  border: 1px solid #b9d8dc;
  border-radius: 8px;
  background: #ffffff;
  color: #173f46;
  box-shadow: 0 8px 24px rgba(15, 68, 76, 0.16);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(8px, -50%);
  transition: opacity 160ms ease, transform 160ms ease;
}

.page-tab-label::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -6px;
  width: 10px;
  height: 10px;
  border-top: 1px solid #b9d8dc;
  border-right: 1px solid #b9d8dc;
  background: #ffffff;
  transform: translateY(-50%) rotate(45deg);
}

.page-tab:hover .page-tab-label,
.page-tab:focus-visible .page-tab-label {
  opacity: 1;
  transform: translate(0, -50%);
}

.page-tab.active .page-tab-label {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.page-tab.active .page-tab-label::after {
  border-color: var(--accent);
  background: var(--accent);
}

.course-current-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  padding: 6px 10px;
  border: 1px solid #b9d8dc;
  border-radius: 999px;
  background: #edfafa;
  color: #0f6972;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.page-tab:hover,
.page-tab:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateX(-2px);
}

.page-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.page-tab.active .page-tab-step {
  background: #f5c542;
  color: #183236;
}

.page-tab.completed {
  border-color: #16a34a;
  background: #16a34a;
  color: #ffffff;
}

.page-tab.completed .page-tab-step {
  background: #dcfce7;
  color: #166534;
}

.page-home-tab {
  border-color: #f5c542;
  background: #f5c542;
  color: #183236;
}

.page-home-tab:hover,
.page-home-tab:focus-visible {
  background: #ffe08a;
  color: #183236;
}

.page-home-tab.completed {
  border-color: #16a34a;
  background: #16a34a;
  color: #ffffff;
}

.document-page {
  display: none;
}

.document-card {
  min-height: calc(100vh - 190px);
  padding: clamp(28px, 5vw, 72px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.compact-document {
  min-height: auto;
  box-shadow: none;
}

.document-kicker {
  margin-bottom: 8px;
  color: var(--accent);
  font-weight: 800;
}

.document-card h1 {
  margin-bottom: 28px;
  color: #12343b;
  font-size: clamp(32px, 5vw, 56px);
}

.lesson-cover {
  display: grid;
  min-height: calc(100vh - 260px);
  padding: 34px;
  background: #ffffff;
  color: #000000;
  font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
}

.print-document-root {
  display: none;
}

.lesson-cover-inner {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  justify-items: center;
  min-height: 980px;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 80px 54px 48px;
  background: #ffffff;
  font-size: 20pt;
  line-height: 1.35;
  text-align: center;
}

.lesson-cover-logo {
  width: 132px;
  height: 132px;
  object-fit: contain;
  margin-bottom: 34px;
}

.lesson-cover-generated-page {
  display: grid;
  min-height: calc(100vh - 260px);
  padding: 0;
  background: #ffffff;
  break-after: page;
  page-break-after: always;
}

.lesson-cover-generated-page img {
  width: 100%;
  height: 100%;
  min-height: 980px;
  object-fit: cover;
}

.lesson-cover h2,
.lesson-cover p {
  margin: 0;
  color: #000000;
  font-weight: 400;
}

.lesson-cover h2 {
  margin-bottom: 14px;
  font-size: 26pt;
  font-weight: 700;
  line-height: 1.2;
}

.lesson-cover-main,
.lesson-cover-course,
.lesson-cover-teacher {
  width: 100%;
}

.lesson-cover-main {
  margin-bottom: 48px;
}

.lesson-cover-course {
  margin-bottom: 120px;
}

.lesson-cover-course p,
.lesson-cover-teacher p,
.lesson-cover-main p {
  font-size: 20pt;
}

.lesson-cover-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
  width: 100%;
  padding-top: 6px;
  border-top: 0;
  font-size: 20pt;
  text-align: left;
}

.lesson-cover-footer > div:last-child {
  text-align: right;
}

.document-meta {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 12px 20px;
  max-width: 820px;
  margin: 0;
}

.document-meta dt {
  color: var(--muted);
  font-weight: 800;
}

.document-meta dd {
  margin: 0;
  font-size: 18px;
}

.cover-ai-panel {
  display: grid;
  gap: 16px;
  max-width: 920px;
  margin: 0 0 30px;
  padding: 20px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.74), #ffffff);
}

.cover-ai-panel h3 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 22px;
}

.cover-ai-panel p {
  margin: 0;
  color: var(--muted);
}

.cover-ai-button {
  justify-self: start;
}

.cover-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.cover-ai-actions .cover-ai-button {
  max-width: min(420px, 100%);
}

.cover-ai-button-secondary {
  background: linear-gradient(100deg, #0f766e, #2563eb);
}

.cover-ai-preview {
  display: grid;
  gap: 10px;
  width: min(360px, 100%);
  margin: 0;
  cursor: pointer;
}

.cover-ai-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(18, 36, 43, 0.18);
  transition: box-shadow 0.18s, transform 0.18s;
}

.cover-ai-preview:hover img,
.cover-ai-preview:focus-visible img {
  transform: scale(1.015);
  box-shadow: 0 26px 60px rgba(18, 36, 43, 0.26);
}

.cover-ai-preview figcaption,
.google-cover-help {
  color: var(--muted);
  font-size: 14px;
}

.google-cover-help a {
  display: inline-block;
  margin-left: 8px;
  color: var(--accent);
  font-weight: 800;
}

.external-cover-modal-card {
  width: min(980px, 100%);
}

.external-cover-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 20px 0;
}

.external-cover-grid label,
.external-cover-prompt-wrap,
.external-cover-upload {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.external-cover-prompt-wrap,
.external-cover-upload,
.external-cover-actions,
.external-cover-modal-card .admin-modal-actions {
  margin: 16px 20px 0;
}

.external-cover-prompt {
  min-height: 320px;
  resize: vertical;
  font-family: "TH Sarabun New", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.external-cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.secondary-action,
.external-cover-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.external-cover-upload input {
  padding: 12px;
  border: 1px dashed #9cc8c5;
  border-radius: 8px;
  background: #f8fffd;
}

.external-cover-modal-card #externalCoverStatus {
  margin: 12px 20px 0;
}

.external-cover-modal-card #externalCoverStatus.error {
  color: var(--danger);
  font-weight: 900;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.ai-analysis-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: #fbfcfd;
}

.ai-analysis-hero h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

.ai-analysis-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.ai-analysis-hero strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 82px;
  padding: 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 24px;
}

.lesson-bulk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.lesson-bulk-analyze-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 86px;
  height: 86px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.38), transparent 34%),
    linear-gradient(135deg, #0f766e, #16a34a 55%, #f5c542);
  box-shadow: 0 20px 42px rgba(18, 107, 115, 0.24), 0 0 0 8px rgba(22, 163, 74, 0.1);
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.lesson-bulk-analyze-button:hover,
.lesson-bulk-analyze-button:focus-visible {
  filter: saturate(1.08);
  transform: translateY(-2px);
  box-shadow: 0 26px 52px rgba(18, 107, 115, 0.3), 0 0 0 10px rgba(22, 163, 74, 0.14);
}

.lesson-bulk-analyze-button:disabled {
  cursor: wait;
  opacity: 0.78;
  transform: none;
}

.lesson-bulk-analyze-button svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.lesson-bulk-analyze-button span {
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

.lesson-bulk-analyze-button.is-loading svg {
  animation: aiPulse 1.1s ease-in-out infinite;
}

.ai-submit-wrap {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.ai-submit-button {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  width: auto;
  min-width: min(100%, 360px);
  min-height: 88px;
  padding: 12px 24px 12px 14px;
  border: 0;
  border-radius: 999px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.42), transparent 36%),
    linear-gradient(135deg, #0f766e, #16a34a 54%, #f5c542);
  color: #fff;
  box-shadow: 0 22px 44px rgba(18, 107, 115, 0.26), 0 0 0 8px rgba(22, 163, 74, 0.1);
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.ai-submit-button:hover,
.ai-submit-button:focus-visible {
  filter: saturate(1.08);
  transform: translateY(-2px);
  box-shadow: 0 28px 54px rgba(18, 107, 115, 0.32), 0 0 0 10px rgba(22, 163, 74, 0.14);
}

.ai-submit-button:disabled {
  cursor: wait;
  filter: grayscale(0.1) saturate(0.9);
  opacity: 0.88;
  transform: none;
}

.ai-submit-orb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.32);
}

.ai-submit-orb svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.ai-submit-button.is-loading .ai-submit-orb {
  animation: aiPulse 1.1s ease-in-out infinite;
}

.ai-submit-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

.ai-submit-copy b {
  color: #fff;
  font-size: 22px;
  line-height: 1.15;
}

.ai-submit-copy small {
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 700;
}

@keyframes aiPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.analysis-grid article {
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  background: #fbfcfd;
}

.analysis-grid article:nth-child(2) {
  border-top-color: #b5522d;
}

.analysis-grid article:nth-child(3) {
  border-top-color: #2f6fb5;
}

.analysis-grid h2 {
  margin-bottom: 10px;
}

.analysis-grid article.ready p {
  color: var(--accent);
  font-weight: 800;
}

.analysis-grid article.missing {
  border-top-color: var(--danger);
  background: #fff8f7;
}

.analysis-grid article.missing p {
  color: var(--danger);
  font-weight: 800;
}

.analysis-prompt {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--text);
  font: inherit;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.behavior-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.learning-behavior-table-screen {
  width: 100%;
  min-width: 980px;
  margin-bottom: 1.5rem;
  border-collapse: collapse;
  background: #ffffff;
  table-layout: fixed;
}

.learning-behavior-table-screen th,
.learning-behavior-table-screen td {
  padding: 0.7rem 0.75rem;
  border: 1px solid #000000;
  font-size: 0.95rem;
  line-height: 1.45;
  vertical-align: top;
}

.learning-behavior-table-screen th {
  background: #f3f4f6;
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
}

.learning-behavior-table-screen .behavior-domain-head {
  background: #f3f4f6;
}

.learning-behavior-table-screen .behavior-level-col,
.learning-behavior-table-screen .behavior-code-col,
.learning-behavior-table-screen .behavior-hours-col,
.learning-behavior-table-screen .behavior-percent-col {
  text-align: center;
  vertical-align: middle;
}

.learning-behavior-table-screen .behavior-unit-name-col {
  width: 38%;
}

.learning-behavior-table-screen .behavior-hours-col {
  width: 10%;
}

.learning-behavior-table-screen .behavior-percent-col {
  width: 12%;
}

.learning-behavior-table-screen tfoot td {
  background: #ffffff;
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
}

.learning-behavior-condition-table {
  width: 100%;
  min-width: 980px;
  margin-top: 0.5rem;
  border-collapse: collapse;
  background: #ffffff;
  table-layout: fixed;
}

.behavior-condition-heading {
  min-width: 980px;
  margin: 1.5rem 0 0.5rem;
  color: #111827;
  font-weight: 800;
  text-align: center;
}

.behavior-condition-block {
  break-inside: avoid;
  page-break-inside: avoid;
}

.learning-behavior-condition-table th,
.learning-behavior-condition-table td {
  padding: 0.65rem 0.9rem;
  border: 1px solid #000000;
  background: #ffffff;
  color: #111827;
  font-size: 0.95rem;
  line-height: 1.55;
  vertical-align: top;
}

.learning-behavior-condition-table th {
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
}

.learning-behavior-condition-table .behavior-condition-title {
  background: #d9d9d9;
}

.learning-behavior-condition-table p {
  margin: 0 0 0.45rem;
}

.learning-behavior-condition-table p:last-child {
  margin-bottom: 0;
}

.competency-source-block {
  margin-top: 1.25rem;
}

.competency-source-block h4 {
  margin: 0 0 0.75rem;
  color: var(--deep);
  font-size: 1rem;
  font-weight: 900;
}

.competency-link-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.competency-link-table-screen {
  width: 100%;
  min-width: 1080px;
  margin-bottom: 1.5rem;
  border-collapse: collapse;
  background: #ffffff;
  table-layout: fixed;
}

.competency-link-table-screen th,
.competency-link-table-screen td {
  padding: 0.7rem 0.8rem;
  border: 1px solid #000000;
  color: #111827;
  font-size: 0.94rem;
  line-height: 1.45;
  vertical-align: top;
}

.competency-link-table-screen th {
  background: #f3f4f6;
  font-weight: 900;
  text-align: center;
  vertical-align: middle;
}

.competency-link-table-screen p {
  margin: 0 0 0.45rem;
}

.competency-link-table-screen p:last-child {
  margin-bottom: 0;
}

.competency-link-table-screen .competency-duty-col {
  width: 20%;
}

.competency-link-table-screen .competency-task-col {
  width: 22%;
}

.competency-link-table-screen .competency-standard-col {
  width: 25%;
}

.competency-link-table-screen .competency-knowledge-col,
.competency-link-table-screen .competency-skill-col {
  width: 16.5%;
}

.lesson-unit-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 14px;
  margin: 14px 0 18px;
}

.lesson-unit-tab {
  flex: 0 0 220px;
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 12px 14px;
  border: 1px solid #d7e2ea;
  border-radius: 8px;
  background: #ffffff;
  color: #12343b;
  text-align: left;
  cursor: pointer;
}

.lesson-unit-tab.active {
  border-color: #0f7a80;
  box-shadow: 0 0 0 2px rgba(15, 122, 128, 0.14);
}

.lesson-unit-tab span {
  color: #0f7a80;
  font-weight: 800;
  font-size: 0.86rem;
}

.lesson-unit-tab b {
  font-size: 0.98rem;
  line-height: 1.35;
}

.lesson-unit-tab small {
  color: #64748b;
  font-weight: 700;
}

.lesson-plan-unit-panel {
  border: 1px solid #dbe5ed;
  border-radius: 8px;
  padding: 18px;
  background: #fbfdfe;
}

.post-teaching-panel {
  background: #f8fafc;
  padding: 20px;
}

.post-teaching-print-stack {
  display: none;
}

.post-teaching-document {
  position: relative;
  width: min(1120px, 100%);
  max-width: none;
  min-height: 1320px;
  margin: 0 auto;
  padding: 38px 44px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 16px 38px rgba(15, 68, 76, 0.08);
}

.post-teaching-document-actions {
  position: absolute;
  top: 28px;
  right: 34px;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(420px, 40%);
  padding: 20px 18px;
  border: 1px solid rgba(15, 138, 99, 0.16);
  border-radius: 24px;
  background:
    radial-gradient(circle at 72% 18%, rgba(198, 243, 106, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(240, 253, 250, 0.82));
  box-shadow: 0 22px 52px rgba(15, 68, 76, 0.13);
  backdrop-filter: blur(8px);
}

.post-teaching-ai-button {
  flex-direction: row;
  justify-content: flex-start;
  gap: 18px;
  width: min(360px, 100%);
  height: auto;
  min-height: 88px;
  padding: 10px 22px 10px 12px;
  border: 0;
  border-radius: 999px;
  background:
    radial-gradient(circle at 10% 28%, rgba(255, 255, 255, 0.22), transparent 30%),
    linear-gradient(135deg, #41a085, #3c9478 52%, #33866d);
  box-shadow: 0 22px 44px rgba(15, 68, 76, 0.22), 0 10px 22px rgba(15, 138, 99, 0.16);
  text-align: left;
}

.post-teaching-ai-button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.post-teaching-ai-button svg {
  width: 34px;
  height: 34px;
  stroke-width: 1.8;
}

.post-teaching-ai-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 3px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.post-teaching-ai-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.post-teaching-ai-title,
.post-teaching-ai-copy small {
  display: block;
  overflow: hidden;
  max-width: 100%;
  color: #ffffff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-teaching-ai-title {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.12;
}

.post-teaching-ai-copy small {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  opacity: 0.94;
}

.post-teaching-ai-button.is-loading {
  background:
    radial-gradient(circle at 10% 28%, rgba(255, 255, 255, 0.28), transparent 30%),
    linear-gradient(135deg, #0f8a63, #3c9478 52%, #0f766e);
  box-shadow: 0 26px 52px rgba(15, 68, 76, 0.28), 0 0 0 8px rgba(15, 138, 99, 0.1);
}

.post-teaching-analyze-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(250px, 100%);
  min-height: 54px;
  margin: 0;
  padding: 11px 16px 11px 14px;
  border: 1px solid #bfe4dc;
  border-radius: 28px;
  background: rgba(240, 253, 250, 0.96);
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 12px 28px rgba(15, 68, 76, 0.12);
}

.post-teaching-analyze-status::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 16%, transparent);
}

.post-teaching-analyze-status.is-active {
  border-color: rgba(15, 138, 99, 0.28);
  background: linear-gradient(180deg, #ecfdf5, #dff8ee);
  color: #057a5e;
}

.post-teaching-analyze-status.is-processing {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
}

.post-teaching-analyze-status.is-processing::before {
  animation: aiPulse 1.05s ease-in-out infinite;
}

.post-teaching-analyze-status.is-success {
  border-color: rgba(22, 163, 74, 0.3);
  background: linear-gradient(180deg, #f0fdf4, #dcfce7);
  color: #15803d;
}

.post-teaching-analyze-status.is-error {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff7f7, #fef2f2);
  color: #b91c1c;
}

.post-teaching-analyze-status.is-locked {
  border-color: #d7dee8;
  background: #f8fafc;
  color: #64748b;
}

.post-teaching-document h2 {
  margin: 0 0 22px;
  text-align: center;
  font-size: 1.34rem;
  color: #111827;
}

.post-teaching-meta {
  display: grid;
  gap: 10px;
  font-size: 1rem;
}

.post-teaching-meta p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: flex-end;
  margin: 0;
}

.post-teaching-inline {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
  white-space: nowrap;
}

.post-teaching-fill {
  display: inline-block;
  min-width: 180px;
  max-width: 100%;
  padding: 0 6px 2px;
  border-bottom: 1px dotted #111827;
  line-height: 1.45;
}

.post-teaching-fill--short {
  min-width: 115px;
}

.post-teaching-fill--long {
  min-width: min(420px, 100%);
}

.post-teaching-major-row {
  flex-wrap: nowrap !important;
}

.post-teaching-major-row .post-teaching-inline:last-child {
  flex: 1 1 auto;
}

.post-teaching-major-row .post-teaching-fill--long {
  width: 100%;
  min-width: 0;
}

.post-teaching-unit-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 20px 0 16px;
  padding: 13px 16px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  font-size: 0.94rem;
}

.post-teaching-unit-summary strong {
  color: #0f766e;
}

.post-teaching-lock-note {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border: 1px solid #cfe7ff;
  border-radius: 8px;
  background: #eff6ff;
}

.post-teaching-lock-note {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
}

.post-teaching-section {
  margin-top: 18px;
}

.post-teaching-section h4 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 1.02rem;
}

.post-teaching-lines {
  display: grid;
  gap: 13px;
}

.post-teaching-lines span {
  display: block;
  height: 22px;
  border-bottom: 1px dotted #111827;
}

.post-teaching-ai-text {
  min-height: 120px;
  margin: 0;
  padding: 4px 0 0;
  color: #111827;
  line-height: 1.9;
  text-align: justify;
  border-bottom: 1px dotted #111827;
  white-space: pre-wrap;
}

.post-teaching-signatures {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 24px 54px;
  margin-top: 34px;
  text-align: center;
  font-size: 0.88rem;
}

.post-teaching-signatures div > span {
  display: block;
  height: 18px;
  margin-bottom: 6px;
  border-bottom: 1px dotted #111827;
}

.post-teaching-signatures p {
  margin: 3px 0;
}

@media (max-width: 760px) {
  .post-teaching-panel {
    padding: 12px;
  }

  .post-teaching-document {
    min-height: 0;
    padding: 24px 18px;
  }

  .post-teaching-document-actions {
    position: static;
    width: 100%;
    margin-bottom: 16px;
    text-align: center;
  }

  .post-teaching-ai-button {
    width: min(360px, 100%);
  }

  .post-teaching-meta p {
    display: grid;
    gap: 8px;
  }

  .post-teaching-inline {
    display: grid;
    gap: 3px;
  }

  .post-teaching-fill,
  .post-teaching-fill--short,
  .post-teaching-fill--long {
    min-width: 0;
    width: 100%;
  }

  .post-teaching-signatures {
    grid-template-columns: 1fr;
  }
}

.post-teaching-ai-card {
  display: flex;
  flex-direction: column;
  width: min(1120px, calc(100vw - 18px));
  max-height: min(940px, calc(100vh - 18px));
  overflow: hidden;
}

.post-teaching-ai-card .admin-modal-head {
  align-items: flex-start;
}

.modal-close-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: #0f513f;
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.post-teaching-ai-body {
  flex: 1 1 auto;
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
}

.post-teaching-ai-actions {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 14px 18px 18px;
  border-top: 1px solid #dbe5ed;
  background: #ffffff;
  box-shadow: 0 -10px 26px rgba(15, 23, 42, 0.1);
}

.post-teaching-ai-actions button {
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 900;
  white-space: normal;
}

.post-teaching-ai-submit {
  min-width: 270px !important;
  border: 2px solid #087a55;
  background: #0f8a63;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 138, 99, 0.26);
}

.post-teaching-ai-submit:hover,
.post-teaching-ai-submit:focus-visible {
  background: #087a55;
  outline: 3px solid rgba(15, 138, 99, 0.2);
}

.post-teaching-ai-outcome {
  padding: 14px 16px;
  border: 1px solid #bfe4dc;
  border-radius: 8px;
  background: #f0fdfa;
}

.post-teaching-ai-outcome h3,
.post-teaching-ai-grid h3 {
  margin: 0 0 10px;
  color: #0f766e;
  font-size: 1.05rem;
}

.post-teaching-ai-outcome p {
  margin: 4px 0;
  line-height: 1.55;
}

.post-teaching-ai-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.post-teaching-ai-grid > section {
  min-width: 0;
  padding: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
}

.post-teaching-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.post-teaching-form-row label,
.post-teaching-full-label {
  display: grid;
  gap: 5px;
  color: #334155;
  font-weight: 700;
}

.post-teaching-form-row input,
.post-teaching-choice-group input,
.post-teaching-full-label textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.post-teaching-choice-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 9px 14px;
  margin-bottom: 12px;
  align-items: center;
}

.post-teaching-choice-group strong,
.post-teaching-choice-group input {
  grid-column: 1 / -1;
}

.post-teaching-choice {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: #1f2937;
  line-height: 1.3;
}

.post-teaching-choice input {
  grid-column: auto;
  width: 20px;
  height: 20px;
  margin: 0;
}

.post-teaching-choice span {
  min-width: 0;
}

.post-teaching-behavior-table-wrap {
  overflow: hidden;
  margin-bottom: 12px;
}

.post-teaching-behavior-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.86rem;
}

.post-teaching-behavior-table th,
.post-teaching-behavior-table td {
  border: 1px solid #cbd5e1;
  padding: 7px 5px;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: normal;
}

.post-teaching-behavior-table th:first-child,
.post-teaching-behavior-table td:first-child {
  width: 32%;
  text-align: left;
  word-break: break-word;
}

@media (max-width: 1180px) {
  .post-teaching-ai-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .post-teaching-ai-actions {
    display: grid;
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .post-teaching-ai-actions button,
  .post-teaching-ai-submit {
    width: 100%;
    min-width: 0 !important;
  }

  .post-teaching-form-row {
    grid-template-columns: 1fr;
  }

  .post-teaching-choice-group {
    grid-template-columns: 1fr;
  }

  .post-teaching-behavior-table-wrap {
    overflow: hidden;
  }

  .post-teaching-behavior-table {
    min-width: 0;
    font-size: 0.76rem;
  }

  .post-teaching-behavior-table th,
  .post-teaching-behavior-table td {
    padding: 6px 3px;
  }
}

.lesson-plan-unit-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.lesson-plan-unit-head h3 {
  margin: 0 0 4px;
}

.lesson-plan-analyze-button {
  max-width: 360px;
}

.lesson-plan-edit-button {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  align-self: center;
  border: 0;
  border-radius: 999px;
  background: #0f7a80;
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 122, 128, 0.22);
  cursor: pointer;
}

.lesson-plan-edit-button:hover,
.lesson-plan-edit-button:focus-visible {
  transform: translateY(-1px);
  background: #0c6f75;
}

.lesson-plan-edit-button:disabled {
  opacity: 0.62;
  cursor: wait;
  transform: none;
}

.lesson-plan-edit-button svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lesson-editor-card {
  display: flex;
  flex-direction: column;
  width: min(1220px, 100%);
  max-height: min(880px, calc(100vh - 36px));
  overflow: hidden;
}

.lesson-editor-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  padding: 18px;
  overflow: auto;
  overflow-x: hidden;
  background: #f8fafc;
}

.lesson-editor-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid #dbe5ed;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.lesson-editor-toolbar button,
.lesson-editor-toolbar select {
  width: auto !important;
  min-width: 42px;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #111827;
  font-weight: 800;
}

.lesson-editor-toolbar select {
  min-width: 118px;
}

.lesson-editor-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px !important;
  padding: 0;
  font-size: 0;
}

.lesson-editor-toolbar button::before {
  color: currentColor;
  font-size: 17px;
  line-height: 1;
}

.lesson-editor-toolbar button[data-editor-command="bold"]::before {
  content: "B";
  font-weight: 900;
}

.lesson-editor-toolbar button[data-editor-command="italic"]::before {
  content: "I";
  font-style: italic;
  font-weight: 900;
}

.lesson-editor-toolbar button[data-editor-command="underline"]::before {
  content: "U";
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lesson-editor-toolbar button[data-editor-command="insertOrderedList"]::before {
  content: "1.";
  font-weight: 900;
}

.lesson-editor-toolbar button[data-editor-command="insertUnorderedList"]::before {
  content: "•";
  font-size: 24px;
}

.lesson-editor-toolbar button[data-editor-command="justifyLeft"]::before {
  content: "☰";
  transform: translateX(-3px);
}

.lesson-editor-toolbar button[data-editor-command="justifyCenter"]::before {
  content: "☰";
}

.lesson-editor-toolbar button[data-editor-command="justifyRight"]::before {
  content: "☰";
  transform: translateX(3px);
}

.lesson-editor-toolbar button[data-editor-command="justifyFull"]::before {
  content: "≡";
  font-size: 22px;
}

.lesson-editor-toolbar button[data-editor-command="undo"]::before {
  content: "↶";
  font-size: 22px;
}

.lesson-editor-toolbar button[data-editor-command="redo"]::before {
  content: "↷";
  font-size: 22px;
}

.lesson-editor-toolbar button[data-editor-command="removeFormat"]::before {
  content: "Tx";
  font-size: 14px;
  text-decoration: line-through;
}

.lesson-editor-toolbar button[data-editor-command="outdent"]::before {
  content: "⇤";
  font-size: 20px;
}

.lesson-editor-toolbar button[data-editor-command="indent"]::before {
  content: "⇥";
  font-size: 20px;
}

.lesson-editor-toolbar button[data-editor-command="createLink"]::before {
  content: "⌁";
  font-size: 22px;
}

.lesson-editor-toolbar button[data-editor-command="unlink"]::before {
  content: "⌁";
  color: #b91c1c;
  font-size: 22px;
  text-decoration: line-through;
}

.lesson-editor-toolbar button[data-editor-command="insertHorizontalRule"]::before {
  content: "—";
  font-size: 24px;
}

.lesson-editor-toolbar button:hover,
.lesson-editor-toolbar button:focus-visible,
.lesson-editor-toolbar select:focus-visible {
  border-color: #0f7a80;
  background: #ecfeff;
  outline: 2px solid rgba(15, 122, 128, 0.14);
}

.lesson-editor-color {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-height: 38px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 0;
  font-weight: 800;
}

.lesson-editor-color::before {
  content: "A";
  font-size: 17px;
  font-weight: 900;
}

.lesson-editor-color + .lesson-editor-color::before {
  content: "▰";
}

.lesson-editor-color input {
  width: 28px;
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
}

.lesson-editor-workspace {
  padding: 16px;
  border: 1px solid #dbe5ed;
  border-radius: 8px;
  background: #eef6f8;
}

.lesson-wysiwyg-editor {
  box-sizing: border-box;
  min-height: 520px;
  max-height: 58vh;
  overflow: auto;
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 34px 42px;
  border: 1px solid #dbe5ed;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  line-height: 1.72;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.lesson-wysiwyg-editor:focus {
  border-color: #0f7a80;
  outline: 3px solid rgba(15, 122, 128, 0.12);
}

.lesson-editor-body > .admin-modal-actions {
  position: sticky;
  bottom: -18px;
  z-index: 3;
  margin: 0 -18px -18px;
  padding: 14px 18px 18px;
  border-top: 1px solid #dbe5ed;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.1);
}

.lesson-editor-save-button {
  min-width: 230px !important;
  min-height: 48px;
  padding: 11px 24px;
  border: 2px solid #087a55;
  border-radius: 10px;
  background: #0f8a63;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(15, 138, 99, 0.26);
}

.lesson-editor-save-button:hover,
.lesson-editor-save-button:focus-visible {
  background: #087a55;
  outline: 3px solid rgba(15, 138, 99, 0.2);
}

.lesson-plan-document {
  background: #ffffff;
  border: 1px solid #dbe5ed;
  border-radius: 8px;
  padding: 22px;
  color: #111827;
}

.knowledge-progress {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #cfe7e3;
  border-radius: 8px;
  background: #f0fdfa;
}

.knowledge-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #0f766e;
  font-weight: 800;
}

.knowledge-progress-track {
  height: 10px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}

.knowledge-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a, #0f766e);
}

.knowledge-quiz-list {
  display: grid;
  gap: 12px;
  margin-left: 2.25rem;
}

.knowledge-quiz-item p {
  margin: 3px 0;
}

.knowledge-quiz-question {
  font-weight: 500;
}

.knowledge-quiz-question span {
  font-weight: 400;
}

.knowledge-quiz-options {
  padding-left: 1.5rem;
}

.final-exam-workspace .ai-analysis-hero {
  border-left-color: var(--theme-primary, #0f7a80);
}

.final-exam-document {
  display: grid;
  gap: 18px;
}

.final-exam-print-stack {
  break-before: page;
  page-break-before: always;
}

.final-exam-heading {
  border-bottom: 0;
  padding-bottom: 0;
}

.final-exam-summary {
  margin: 0 0 16px;
  text-align: center;
}

.final-exam-unit {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.final-exam-unit h3 {
  margin: 0;
  color: var(--theme-primary-strong, #0f766e);
  font-size: 1.05rem;
}

.final-exam-question {
  break-inside: avoid;
  page-break-inside: avoid;
  padding: 10px 0;
}

.final-exam-question p {
  margin: 4px 0;
}

.final-exam-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 18px;
  padding-left: 1.35rem;
}

.final-exam-answer-key {
  break-before: page;
  page-break-before: always;
  border-top: 2px solid #111827;
  padding-top: 18px;
}

.final-exam-answer-key .table-wrap {
  max-height: none;
  min-height: 0;
  overflow: visible;
}

.final-exam-answer-key h3 {
  margin: 0 0 12px;
  text-align: center;
  color: #111827;
}

.final-exam-answer-key table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.final-exam-answer-key tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

.final-exam-answer-key th,
.final-exam-answer-key td {
  border: 1px solid #cbd5e1;
  padding: 8px;
  vertical-align: top;
}

.final-exam-answer-key th {
  background: #f1f5f9;
  color: #111827;
}

.final-exam-print-document {
  max-width: none;
}

.lesson-plan-document-heading {
  text-align: center;
  margin-bottom: 18px;
}

.lesson-plan-document-heading h2 {
  margin: 0 0 8px;
  color: #111827;
}

.lesson-plan-document-heading p {
  margin: 2px 0;
}

.lesson-plan-heading-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.lesson-plan-heading-table td {
  border: 1px solid #cbd5e1;
  padding: 8px 10px;
  vertical-align: middle;
  text-align: left;
}

.lesson-plan-heading-logo {
  width: 88px;
  text-align: center !important;
}

.lesson-plan-heading-logo img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.lesson-plan-heading-title {
  text-align: center !important;
  font-size: 1.15rem;
  font-weight: 800;
}

.lesson-plan-heading-side {
  width: 18%;
  white-space: nowrap;
}

.lesson-plan-heading-hours div + div {
  margin-top: 2px;
}

.lesson-plan-heading-topic {
  text-align: left;
}

.lesson-plan-topic {
  border-top: 1px solid #e2e8f0;
  padding-top: 14px;
  margin-top: 14px;
}

.lesson-plan-topic h4 {
  margin: 0 0 8px;
  color: #0f766e;
}

.lesson-plan-topic ul,
.lesson-plan-topic ol {
  margin: 0 0 0 1.25rem;
  padding: 0;
}

.lesson-plan-topic li {
  margin: 4px 0;
}

.lesson-plan-topic ol {
  list-style: none;
  counter-reset: lesson-item;
}

.lesson-plan-topic ol li {
  counter-increment: lesson-item;
  position: relative;
}

.lesson-plan-topic ol li::before {
  content: counter(lesson-item) ". ";
}

.lesson-plan-topic ol:has(> li:only-child) li {
  counter-increment: none;
}

.lesson-plan-topic ol:has(> li:only-child) li::before {
  content: "- ";
}

.lesson-plan-topic .lesson-single-item-list {
  list-style: none;
}

.lesson-plan-topic .lesson-single-item-list li::before {
  content: "- ";
}

.lesson-plan-plain-list p {
  margin: 4px 0;
}

.lesson-plan-topic--unitCompetencies .lesson-plan-plain-list {
  padding-left: 2.25rem;
}

.lesson-plan-topic--unitCompetencies .lesson-plan-plain-list p {
  font-weight: 400;
}

.lesson-plan-standard-occupations {
  margin: 4px 0 8px;
}

.lesson-plan-standard-occupations p {
  margin: 2px 0;
  font-weight: 500;
}

.lesson-plan-subtopic {
  margin-left: 0;
  padding-left: 2.25rem;
}

.lesson-plan-narrative {
  margin: 0;
  line-height: 1.72;
  text-align: justify;
  text-indent: 2em;
}

.lesson-plan-narrative--limited {
  display: -webkit-box;
  max-height: calc(1.72em * var(--lesson-line-limit, 8));
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--lesson-line-limit, 8);
}

.lesson-plan-subtopic h5 {
  margin: 10px 0 6px;
  color: #334155;
}

.ai-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.ai-options-panel {
  margin-top: 12px;
  padding: 18px;
  border: 1px solid #d4ece8;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(240, 253, 250, 0.9), rgba(255, 255, 255, 0.96)),
    #ffffff;
  box-shadow: 0 18px 38px rgba(15, 118, 110, 0.08);
}

.ai-option-grid-modern {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.ai-option-card {
  position: relative;
  padding: 14px;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.ai-option-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, #0f7a80, #18a058, #c9c12d);
}

.ai-option-grid label {
  display: grid;
  gap: 6px;
}

.ai-option-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.ai-option-grid select,
.ai-option-grid input {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  font: inherit;
}

.ai-option-card select:focus,
.ai-option-card input:focus {
  outline: 3px solid rgba(15, 122, 128, 0.16);
  border-color: #0f7a80;
  background: #ffffff;
}

.ai-option-note {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.ai-option-note.error {
  color: var(--danger);
  font-weight: 800;
}

.pa-criteria-preview {
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid #cde7e2;
  border-left: 6px solid var(--teal);
  border-radius: 8px;
  background: #f3fbf9;
  color: var(--text);
  line-height: 1.85;
}

.pa-criteria-preview strong {
  color: var(--teal-dark);
}

.pa-criteria-preview span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.ai-result-header--actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ai-result-header--actions h3 {
  flex: 1 1 auto;
  margin: 0;
}

.ai-units-edit-button {
  width: 50px;
  height: 50px;
  flex-basis: 50px;
}

.behavior-edit-button {
  width: 50px;
  height: 50px;
  flex-basis: 50px;
}

.unit-editor-card {
  width: min(1180px, calc(100vw - 48px));
  max-height: calc(100vh - 56px);
}

.unit-editor-body {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #f8fafc;
}

.unit-editor-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.unit-editor-toolbar p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.unit-editor-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.unit-editor-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.behavior-editor-table {
  min-width: 1120px;
}

.behavior-editor-table input {
  min-width: 82px;
}

.member-access-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--theme-bg-glow);
  border-radius: 999px;
  background: var(--theme-accent-soft);
  color: var(--theme-accent-strong);
  font-weight: 900;
}

.unit-editor-table th,
.unit-editor-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 10px;
  vertical-align: top;
}

.unit-editor-table th {
  background: #eef8f6;
  color: var(--teal-dark);
  font-weight: 900;
  text-align: left;
}

.unit-editor-table textarea,
.unit-editor-table input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #ffffff;
}

.unit-editor-table textarea {
  min-height: 74px;
  resize: vertical;
}

.unit-editor-remove {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff5f5;
  color: #b91c1c;
  cursor: pointer;
}

.unit-editor-remove svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-plan-actions,
#learningPlanStatus {
  display: none !important;
}

.ai-plan-actions {
  width: 100%;
}

.ai-plan-actions select {
  order: 1;
  flex: 1 1 420px;
  min-height: 44px;
}

.ai-plan-actions button {
  order: 2;
  flex: 0 0 auto;
}

.ai-pc-inline {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ai-pc-inline strong {
  color: var(--accent);
}

.app-credit {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 20;
  max-width: min(920px, calc(100vw - 32px));
  padding: 8px 14px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toolbar .field {
  flex: 1 1 180px;
  min-width: 180px;
}

.toolbar .search-box {
  flex: 2 1 360px;
  min-width: 280px;
}

#sectorField {
  flex: 1.25 1 300px;
  min-width: 260px;
}

#qualificationOrgField {
  flex: 1.4 1 320px;
  min-width: 260px;
}

#sortDirection {
  flex: 0 0 52px;
  width: 52px;
}

#resetFilters {
  flex: 0 0 auto;
  width: auto;
  min-width: 136px;
  white-space: nowrap;
}

.course-search {
  display: grid;
  grid-template-columns:
    minmax(130px, 0.7fr)
    minmax(180px, 0.9fr)
    minmax(190px, 1fr)
    minmax(210px, 1fr)
    minmax(210px, 1fr)
    minmax(220px, 1.1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
button {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

input,
select {
  padding: 8px 10px;
}

button {
  cursor: pointer;
  padding: 8px 12px;
  font-weight: 700;
}

button:hover,
tr.data-row:hover {
  background: var(--accent-soft);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  min-height: 40px;
  flex: 0 0 auto;
  padding: 0;
  font-size: 20px;
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.icon-button.danger {
  color: var(--danger);
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stats article {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stats span {
  display: block;
  color: var(--accent);
  font-size: 26px;
  font-weight: 800;
}

.stats p {
  margin-bottom: 0;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  width: auto;
  min-width: 120px;
  border-color: var(--line);
}

.tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.table-panel,
.detail-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head > div {
  min-width: 0;
}

.panel-head .print-button {
  flex: 0 0 auto;
  align-self: flex-start;
}

.detail-head-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  max-width: min(100%, 560px);
}

.detail-linked-action {
  display: inline-flex;
  min-width: 0;
}

.detail-head-actions .detail-open:not(.icon-only) {
  width: auto;
  max-width: none;
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  box-shadow: 0 10px 22px var(--theme-shadow);
}

.detail-head-actions .detail-open:not(.icon-only) span {
  display: inline-block;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

.detail-head-actions .detail-open:not(.icon-only) svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.6;
}

.detail-head-actions .detail-open:not(.icon-only):hover,
.detail-head-actions .detail-open:not(.icon-only):focus-visible {
  border-color: var(--theme-accent-strong);
  background: var(--theme-accent-strong);
  color: #ffffff;
  box-shadow: 0 14px 28px var(--theme-shadow);
}

#resultCount {
  color: var(--muted);
  white-space: nowrap;
}

.detail-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.detail-open svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.detail-open.icon-only {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
}

.detail-open-logo {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.print-button {
  width: auto;
  min-height: 34px;
}

.detail-open:hover,
.detail-open:focus-visible {
  background: #0d575f;
}

#createWordButton,
#saveCoursePlanButton,
#createPdfButton {
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  border: 2px solid var(--theme-accent);
  background: var(--theme-accent);
  color: #ffffff;
  box-shadow: 0 12px 26px var(--theme-shadow);
}

#createWordButton svg,
#saveCoursePlanButton svg,
#createPdfButton svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
}

#createWordButton:hover,
#createWordButton:focus-visible,
#saveCoursePlanButton:hover,
#saveCoursePlanButton:focus-visible,
#createPdfButton:hover,
#createPdfButton:focus-visible {
  border-color: var(--theme-accent-strong);
  background: var(--theme-accent-strong);
  color: #ffffff;
  transform: translateY(-1px);
}

#deleteLearningPlanButton {
  border-color: #dc2626;
  background: #dc2626;
}

#deleteLearningPlanButton:hover,
#deleteLearningPlanButton:focus-visible {
  background: #b91c1c;
}

/* AI result action buttons */
.ai-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.ai-result-header h3 {
  margin: 0;
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
}

.ai-result-header .auto-save-badge {
  font-size: 1rem;
  color: #10b981;
  font-weight: 500;
}

.ai-result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.25;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.ai-action-btn:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ai-action-btn:active {
  transform: translateY(1px);
}

.ai-action-btn--json {
  background: var(--accent);
}

.ai-action-btn--json:hover {
  background: #0d575f;
}

.ai-action-btn--print {
  background: #475569;
}

.ai-action-btn--print:hover {
  background: #334155;
}

.ai-result-divider {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px dashed var(--line);
}

.ai-result-note {
  margin-bottom: 2rem;
  background: var(--accent-soft);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 0.95rem;
  text-align: center;
  color: var(--muted);
}

.table-wrap {
  max-height: calc(100vh - 340px);
  min-height: 420px;
  overflow: auto;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.pagination button {
  width: auto;
  min-width: 96px;
  min-height: 36px;
  border-color: var(--accent);
  color: var(--accent);
}

.pagination button:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: #f2f4f7;
  color: var(--muted);
}

.pagination span {
  min-width: 120px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

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

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef2f5;
  color: #344052;
  font-size: 13px;
  white-space: nowrap;
}

td {
  max-width: 420px;
}

.data-row {
  cursor: pointer;
}

.muted {
  color: var(--muted);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--theme-accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.link-pill {
  width: auto;
  border-color: transparent;
  text-align: left;
}

.link-pill:hover,
.link-pill:focus-visible,
.link-item:hover,
.link-item:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--theme-accent-strong);
}

.detail-panel {
  width: min(860px, calc(100vw - 40px));
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
}

.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

body.detail-modal-open {
  overflow: hidden;
}

.detail-overlay .detail-panel {
  position: relative;
  align-self: center;
  border-color: rgba(9, 132, 99, 0.22);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.28);
}

.detail-overlay .panel-head {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(0, auto) 42px;
  align-items: start;
  column-gap: 10px;
  row-gap: 8px;
}

.detail-overlay .panel-head h2 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-overlay .detail-head-actions {
  align-items: flex-start;
}

.detail-close {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
  font-size: 24px;
  line-height: 1;
  justify-self: end;
}

.detail-action-row {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 14px;
}

.linked-course-button {
  width: auto;
  min-width: 180px;
  min-height: 42px;
  border-color: var(--theme-accent-strong);
  background: var(--theme-accent);
  box-shadow: 0 10px 22px var(--theme-shadow);
}

.linked-course-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(4px);
}

.linked-course-modal {
  width: min(1100px, calc(100vw - 40px));
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.linked-course-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.linked-course-head p {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.linked-course-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.linked-course-close {
  width: 42px;
  min-height: 42px;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
}

.linked-course-body {
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding: 18px 20px 22px;
}

.linked-course-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.linked-course-summary span,
.linked-course-major-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--theme-accent-strong);
  font-size: 13px;
  font-weight: 600;
}

.linked-course-major-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.linked-course-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.linked-course-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.linked-course-table th,
.linked-course-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.linked-course-table th {
  position: sticky;
  top: 0;
  background: #eef2f5;
  color: #344052;
}

.detail-content {
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding: 16px;
}

.detail-page .detail-page-panel {
  position: static;
  width: 100%;
  max-width: none;
  max-height: none;
}

.detail-page .detail-content {
  max-height: none;
}

.detail-page h1 {
  font-size: 24px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-page {
  background:
    linear-gradient(135deg, rgba(18, 107, 115, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(245, 197, 66, 0.1), transparent 32%);
}

.admin-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
}

.admin-sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.admin-sidebar h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.admin-nav {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  text-align: left;
  border-color: var(--line);
  background: #fff;
}

.admin-nav.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.admin-nav span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-nav b,
.admin-nav small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-nav small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.admin-nav.active small {
  color: rgba(255, 255, 255, 0.78);
}

.admin-nav-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
}

.admin-nav.active .admin-nav-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.admin-main {
  min-width: 0;
}

.admin-members-main .admin-grid {
  grid-template-columns: minmax(0, 1fr);
}

.admin-members-main .table-panel {
  min-height: calc(100vh - 260px);
  display: flex;
  flex-direction: column;
}

.admin-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-plan-grid {
  align-items: stretch;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.admin-plan-grid .stat-card {
  min-height: 118px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(15, 68, 76, 0.12);
}

.admin-plan-grid .stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 42%),
    radial-gradient(circle at 92% 24%, rgba(255, 255, 255, 0.2), transparent 28%);
  pointer-events: none;
}

.admin-plan-grid .stat-card::after {
  right: -26px;
  bottom: -34px;
  width: 118px;
  height: 118px;
}

.admin-plan-grid .stat-card span {
  font-size: 34px;
  line-height: 1;
}

.admin-plan-grid .stat-card p {
  max-width: 18rem;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.admin-plan-grid .table-panel {
  margin-top: 4px;
}

.admin-dashboard-sector-panel,
.admin-dashboard-career-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 280px);
}

.admin-dashboard-sector-panel .admin-table,
.admin-dashboard-career-panel .admin-list {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow: auto;
}

.admin-dashboard-major-panel,
.admin-dashboard-cert-panel {
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

.admin-dashboard-major-panel .admin-list,
.admin-dashboard-cert-panel .admin-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 520px;
  overflow: auto;
}

.admin-dashboard-career-panel .admin-list,
.admin-dashboard-major-panel .admin-list,
.admin-dashboard-cert-panel .admin-list {
  overflow: hidden;
}

.stat-card {
  position: relative;
  overflow: hidden;
  border: 0;
  color: #fff;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -24px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.stat-card span,
.stat-card p {
  position: relative;
  z-index: 1;
  color: #fff;
}

.stat-card.usage {
  background: linear-gradient(135deg, #126b73, #2da6a0);
}

.stat-card.today {
  background: linear-gradient(135deg, #6f4bb2, #9b72d9);
}

.stat-card.courses {
  background: linear-gradient(135deg, #1f6feb, #4aa3ff);
}

.stat-card.occupations {
  background: linear-gradient(135deg, #c55a11, #f59f3a);
}

.stat-card.uoc {
  background: linear-gradient(135deg, #247a45, #4fbd75);
}

.admin-wide {
  grid-column: 1 / -1;
}

.admin-table {
  max-height: 420px;
  min-height: 0;
}

.admin-plan-table {
  max-height: none;
}

.admin-members-main .admin-table {
  flex: 1 1 auto;
  max-height: calc(100vh - 250px);
}

.admin-member-search {
  flex: 1 1 460px;
  max-width: 760px;
  margin-left: auto;
}

.admin-member-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.admin-member-search input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #d5e0e8;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.03);
}

.admin-member-search input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(18, 107, 115, 0.16);
}

.member-action-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-plan-cover-cell {
  display: grid;
  gap: 8px;
  min-width: 112px;
}

.admin-plan-cover-thumb,
.admin-plan-cover-empty {
  width: 108px;
  height: 148px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: linear-gradient(180deg, #f8fbfd, #edf7fb);
}

.admin-plan-cover-thumb {
  display: block;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.admin-plan-cover-empty {
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.admin-plan-approval-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.admin-plan-approval-badge.pending {
  background: #fff7db;
  color: #9a6700;
}

.admin-plan-approval-badge.approved {
  background: #dcfce7;
  color: #166534;
}

.admin-plan-approval-meta {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 36, 43, 0.48);
  backdrop-filter: blur(4px);
}

.admin-modal-card {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(18, 36, 43, 0.24);
}

.admin-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcfd, #ffffff);
}

.admin-modal-head h2,
.modal-eyebrow {
  margin: 0;
}

.modal-eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.admin-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 20px;
}

.admin-edit-form label {
  margin-bottom: 0;
}

.admin-edit-form label span {
  display: block;
  margin-bottom: 6px;
}

.admin-form-wide,
.admin-form-message,
.admin-modal-actions {
  grid-column: 1 / -1;
}

.admin-form-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.admin-form-message.error {
  color: var(--danger);
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.admin-modal-actions button {
  width: auto;
  min-width: 110px;
}

.primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.admin-filter-toggle {
  width: auto;
  min-width: 132px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 58%, #fff);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, #fff);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: none;
}

.admin-filter-toggle:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, #fff);
}

.admin-filter-toggle.active {
  background: var(--accent);
  color: #fff;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}

.admin-pagination button {
  width: auto;
  min-width: 104px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 48%, #fff);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-weight: 500;
  box-shadow: none;
}

.admin-pagination button:hover:not(:disabled) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, #fff);
}

.admin-pagination button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  border-color: var(--line);
  background: var(--soft);
}

.admin-pagination span {
  min-width: 92px;
  text-align: center;
  color: var(--muted);
  font-weight: 500;
}

.admin-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.admin-meter {
  display: grid;
  gap: 6px;
}

.admin-meter-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
}

.admin-meter-head span {
  min-width: 0;
}

.admin-meter-head b {
  color: var(--accent);
  white-space: nowrap;
}

.admin-meter-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f5;
}

.admin-meter-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.admin-meter:nth-child(5n + 1) .admin-meter-track span {
  background: #126b73;
}

.admin-meter:nth-child(5n + 2) .admin-meter-track span {
  background: #6f4bb2;
}

.admin-meter:nth-child(5n + 3) .admin-meter-track span {
  background: #1f6feb;
}

.admin-meter:nth-child(5n + 4) .admin-meter-track span {
  background: #c55a11;
}

.admin-meter:nth-child(5n + 5) .admin-meter-track span {
  background: #247a45;
}

.admin-page .table-panel:nth-child(5n + 1) {
  border-top: 4px solid #126b73;
}

.admin-page .table-panel:nth-child(5n + 2) {
  border-top: 4px solid #6f4bb2;
}

.admin-page .table-panel:nth-child(5n + 3) {
  border-top: 4px solid #1f6feb;
}

.admin-page .table-panel:nth-child(5n + 4) {
  border-top: 4px solid #c55a11;
}

.admin-page .table-panel:nth-child(5n + 5) {
  border-top: 4px solid #247a45;
}

.public-stats-page {
  min-height: 100vh;
}

.public-stats-shell {
  padding-bottom: 72px;
}

.public-stats-grid {
  align-items: stretch;
}

.public-sector-panel,
.public-career-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 280px);
}

.public-major-panel,
.public-cert-panel {
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

.public-table,
.public-career-panel .admin-list,
.public-major-panel .admin-list,
.public-cert-panel .admin-list {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow: auto;
}

.public-stats-page .admin-pagination {
  flex: 0 0 auto;
}

.stats-link.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.empty {
  color: var(--muted);
}

.detail-block {
  margin-bottom: 20px;
}

.detail-block h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--accent);
}

.detail-block p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 1.4rem;
}

.detail-list li {
  line-height: 1.65;
  padding-left: 4px;
}

.code-list,
.pc-groups {
  display: grid;
  gap: 8px;
}

.code-list.compact {
  gap: 6px;
}

.uoc-disclosure {
  display: grid;
  min-width: 0;
}

.uoc-disclosure-toggle {
  grid-template-columns: minmax(86px, 130px) minmax(0, 1fr) 18px;
  align-items: center;
}

.uoc-disclosure-icon {
  width: 9px;
  height: 9px;
  justify-self: center;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.uoc-disclosure-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: #f2fbf8;
}

.uoc-disclosure-toggle[aria-expanded="true"] .uoc-disclosure-icon {
  transform: rotate(225deg) translate(-2px, -2px);
}

.uoc-subdetails {
  display: grid;
  gap: 14px;
  padding: 14px 12px 16px;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fff;
}

.uoc-subdetails[hidden] {
  display: none;
}

.uoc-subdetails .detail-block {
  margin: 0;
}

.uoc-subdetail-summary .detail-grid {
  margin: 0;
}

.uoc-subdetail-actions {
  display: flex;
  justify-content: flex-end;
}

.code-item {
  display: grid;
  grid-template-columns: minmax(86px, 130px) minmax(0, 1fr);
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

button.code-item,
a.code-item {
  width: 100%;
  min-height: 0;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  font-weight: 400;
  text-decoration: none;
}

.code-item b {
  color: #334155;
  font-weight: 800;
}

.code-item span {
  min-width: 0;
}

.pc-group {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.pc-group-title {
  padding: 7px 10px;
  background: #eef2f5;
  color: #344052;
  font-weight: 800;
}

.pc-group .code-item {
  border-width: 1px 0 0;
  border-radius: 0;
  background: #fff;
}

.pc-group.focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 107, 115, 0.16);
}

.standard-card-list {
  display: grid;
  gap: 12px;
}

.standard-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.standard-card-head {
  display: grid;
  grid-template-columns: minmax(72px, 110px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.standard-card-head > b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #0d575f;
  font-weight: 800;
}

.standard-card h4,
.standard-card h5 {
  margin: 0;
  color: var(--text);
}

.standard-card h4 {
  font-size: 16px;
}

.standard-card h5 {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 13px;
}

.standard-card p {
  margin-bottom: 0;
}

.standard-sublist {
  display: grid;
  gap: 6px;
}

.standard-eoc-item {
  align-items: start;
}

.eoc-pc-list {
  display: grid;
  grid-column: 2;
  gap: 5px;
  margin-top: 4px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}

.eoc-pc-list strong {
  color: var(--accent);
  font-size: 13px;
}

.eoc-pc-list p {
  display: grid;
  grid-template-columns: minmax(88px, 120px) minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.45;
}

.eoc-pc-list b {
  color: #475569;
}

.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 12px;
  margin-bottom: 14px;
}

.kv dt {
  color: var(--muted);
  font-weight: 700;
}

.kv dd {
  margin: 0;
}

.source-link {
  color: var(--accent);
  word-break: break-all;
}

@media (max-width: 1100px) {
  .ai-option-grid-modern {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .login-card.member-dashboard-card {
    width: min(720px, 100%);
    grid-template-columns: 1fr;
  }

  .login-card.member-dashboard-card #memberPanel,
  .login-card.member-dashboard-card #memberPlanPanel {
    grid-column: 1;
  }

  .login-card.member-dashboard-card #memberPlanPanel {
    grid-row: auto;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }

  .toolbar,
  .course-search,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-sidebar h2 {
    grid-column: 1 / -1;
  }

  .admin-member-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    margin-left: 0;
  }

  .detail-panel {
    position: static;
    max-height: none;
  }

  .detail-content,
  .table-wrap {
    max-height: none;
  }

  .detail-overlay .detail-panel {
    position: relative;
    width: min(100%, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
  }

  .detail-overlay .detail-content {
    max-height: calc(100vh - 118px);
    overflow: auto;
  }
}

@media (max-width: 640px) {
  .detail-overlay .panel-head {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .detail-overlay .detail-head-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: stretch;
    max-width: none;
  }

  .detail-overlay .detail-head-actions .detail-open:not(.icon-only),
  .detail-overlay .detail-linked-action {
    width: 100%;
    max-width: none;
  }

  .detail-overlay .detail-head-actions .detail-open:not(.icon-only),
  .detail-overlay .detail-head-actions .detail-open:not(.icon-only) span {
    white-space: normal;
  }

  .app-header,
  .layout,
  .app-credit {
    padding-left: 16px;
    padding-right: 16px;
  }

  .admin-plan-grid {
    grid-template-columns: 1fr;
  }

  .course-detail-page .layout {
    padding-bottom: 270px;
  }

  .page-tabs {
    top: auto;
    right: 12px;
    bottom: 142px;
    left: 12px;
    display: flex;
    gap: 8px;
    width: auto;
    padding: 10px;
    overflow-x: auto;
    border: 1px solid #cfe0e3;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 32px rgba(15, 68, 76, 0.18);
    transform: none;
    scrollbar-width: thin;
  }

  .page-tabs::before,
  .page-tabs::after {
    display: none;
  }

  .page-tab {
    flex: 0 0 104px;
    flex-direction: column;
    gap: 5px;
    min-height: 72px;
    width: 104px;
    padding: 8px 6px;
    border-radius: 10px;
  }

  .page-tab svg {
    width: 21px;
    height: 21px;
  }

  .page-tab-label,
  .page-tab:hover .page-tab-label,
  .page-tab:focus-visible .page-tab-label,
  .page-tab.active .page-tab-label {
    position: static;
    width: 100%;
    max-width: none;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: currentColor;
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    opacity: 1;
    transform: none;
  }

  .page-tab-label::after {
    display: none;
  }

  .document-card {
    min-height: calc(100vh - 250px);
    padding: 24px;
  }

  .document-meta,
  .analysis-grid,
  .ai-option-grid {
    grid-template-columns: 1fr;
  }

  .ai-analysis-hero {
    grid-template-columns: 1fr;
  }

  .ai-analysis-hero strong {
    min-width: 68px;
    min-height: 68px;
    font-size: 20px;
  }

  .lesson-bulk-actions {
    justify-content: flex-start;
  }

  .lesson-bulk-analyze-button {
    width: 72px;
    height: 72px;
  }

  .lesson-plan-unit-head {
    flex-wrap: wrap;
  }

  .lesson-plan-edit-button {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  .lesson-editor-modal {
    padding: 10px;
  }

  .lesson-editor-body {
    padding: 12px;
  }

  .lesson-wysiwyg-editor {
    min-height: 420px;
    padding: 16px;
  }

  .ai-submit-button {
    width: 100%;
    min-width: 0;
    min-height: 78px;
    padding-right: 18px;
  }

  .ai-submit-orb {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
  }

  .ai-submit-copy b {
    font-size: 19px;
  }

  .app-credit {
    white-space: normal;
  }

  .app-header {
    display: block;
  }

  .detail-actions {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .brand-block {
    align-items: flex-start;
  }

  .app-logo {
    width: 58px;
    height: 58px;
  }

  .header-search {
    width: auto;
    justify-content: flex-start;
    margin-top: 14px;
  }

  .header-search input {
    min-width: 0;
  }

  .app-name {
    font-size: 20px;
  }

  .status {
    margin-top: 14px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .tabs {
    overflow-x: auto;
  }

  .admin-sidebar {
    grid-template-columns: 1fr;
  }

  .admin-edit-form {
    grid-template-columns: 1fr;
  }

  .admin-modal {
    padding: 12px;
  }

  .admin-modal-actions {
    display: grid;
  }

  .admin-modal-actions button {
    width: 100%;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 25mm 25mm 25mm 35mm;
  }

  @page lesson-cover {
    size: A4 portrait;
    margin: 0;
  }

  @page course-description {
    size: A4 portrait;
    margin: 25mm 25mm 25mm 35mm;
  }

  @page occupational-standard {
    size: A4 portrait;
    margin: 25mm 25mm 25mm 35mm;
  }

  @page analysis-print {
    size: A4 portrait;
    margin: 25mm 25mm 25mm 35mm;
  }

  @page behavior-print {
    size: A4 portrait;
    margin: 25mm 25mm 25mm 35mm;
  }

  @page competency-link-print {
    size: A4 portrait;
    margin: 25mm 25mm 25mm 35mm;
  }

  @page lesson-plan-print {
    size: A4 portrait;
    margin: 25mm 25mm 25mm 35mm;
  }

  body,
  body *,
  button,
  input,
  select,
  textarea {
    font-family: "TH Sarabun New", "Sarabun", "Noto Sans Thai", sans-serif !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .app-header,
  .loading-overlay,
  .page-tabs,
  .app-credit,
  .detail-actions,
  .print-button {
    display: none !important;
  }

  .layout,
  .course-detail-page .layout {
    padding: 0;
  }

  .detail-panel,
  .detail-page-panel,
  .document-card,
  .compact-document {
    border: 0;
    box-shadow: none;
  }

  .detail-content,
  .detail-page-panel {
    max-height: none;
    overflow: visible;
  }

  .panel-head {
    padding: 0 0 10px;
  }

  .printing-cover-page {
    background: #ffffff;
  }

  .printing-cover-page,
  .printing-description-page,
  .printing-standards-page,
  .printing-analysis-page,
  .printing-competency-page {
    width: 210mm;
    height: 297mm;
    overflow: hidden;
  }

  .printing-analysis-page {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    overflow: visible;
  }

  .printing-behavior-page {
    width: auto;
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .printing-competency-page {
    width: auto;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .printing-lesson-plan-page {
    width: auto;
    height: auto;
    min-height: auto;
    overflow: visible;
    background: #ffffff;
  }

  .printing-cover-page .layout,
  .printing-cover-page.course-detail-page .layout,
  .printing-description-page .layout,
  .printing-description-page.course-detail-page .layout,
  .printing-standards-page .layout,
  .printing-standards-page.course-detail-page .layout,
  .printing-analysis-page .layout,
  .printing-analysis-page.course-detail-page .layout,
  .printing-behavior-page .layout,
  .printing-behavior-page.course-detail-page .layout,
  .printing-competency-page .layout,
  .printing-competency-page.course-detail-page .layout,
  .printing-lesson-plan-page .layout,
  .printing-lesson-plan-page.course-detail-page .layout,
  .printing-full-document .layout,
  .printing-full-document.course-detail-page .layout {
    display: none !important;
  }

  .printing-cover-page .panel-head {
    display: none !important;
  }

  .printing-cover-page .detail-page-panel {
    display: none !important;
  }

  .printing-cover-page .print-document-root,
  .printing-description-page .print-document-root,
  .printing-standards-page .print-document-root,
  .printing-analysis-page .print-document-root,
  .printing-behavior-page .print-document-root,
  .printing-competency-page .print-document-root,
  .printing-lesson-plan-page .print-document-root,
  .printing-full-document .print-document-root {
    display: block;
    overflow: hidden;
    break-after: avoid;
    break-inside: avoid;
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  .printing-full-document .print-document-root {
    overflow: visible;
    width: auto;
    min-height: 0;
    break-after: auto !important;
    break-inside: auto !important;
    page-break-after: auto !important;
    page-break-inside: auto !important;
  }

  .printing-cover-page .print-document-root {
    width: 210mm;
    min-height: 297mm;
    height: auto;
    overflow: visible;
  }

  .printing-description-page .print-document-root {
    width: 150mm;
    min-height: 247mm;
    height: auto;
  }

  .printing-standards-page .print-document-root {
    width: 150mm;
    min-height: 247mm;
    height: auto;
    overflow: visible;
    break-inside: auto;
    page-break-inside: auto;
  }

  .printing-analysis-page .print-document-root {
    width: 150mm;
    min-height: 247mm;
    height: auto;
    overflow: visible;
    break-inside: auto;
    page-break-inside: auto;
  }

  .printing-behavior-page .print-document-root {
    width: 150mm;
    min-height: 247mm;
    height: auto;
    overflow: visible;
    break-inside: auto;
    page-break-inside: auto;
  }

  .printing-competency-page .print-document-root {
    width: 100%;
    max-width: none;
    min-height: 247mm;
    height: auto;
    overflow: visible;
    break-inside: auto;
    page-break-inside: auto;
  }

  .printing-lesson-plan-page .print-document-root {
    width: 150mm;
    min-height: 247mm;
    height: auto;
    overflow: visible;
    break-inside: auto;
    page-break-inside: auto;
  }

  .printing-cover-page .layout,
  .printing-cover-page.course-detail-page .layout,
  .printing-cover-page .detail-content {
    padding: 0;
  }

  .printing-cover-page .lesson-cover {
    page: lesson-cover;
    display: block;
    width: 210mm;
    height: auto;
    min-height: 297mm;
    overflow: hidden;
    padding: 0;
    background: #ffffff;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    break-after: avoid;
    break-inside: avoid;
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  .printing-cover-page .lesson-cover-generated-page {
    page: lesson-cover;
    display: block;
    width: 210mm;
    height: 297mm;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    background: #ffffff;
    break-after: page;
    break-inside: avoid;
    page-break-after: always;
    page-break-inside: avoid;
  }

  .printing-cover-page .lesson-cover-generated-page img {
    display: block;
    width: 210mm;
    height: 297mm;
    min-height: 0;
    object-fit: cover;
  }

  .printing-cover-page .lesson-cover-inner {
    position: relative;
    display: block;
    width: 160mm;
    max-width: 160mm;
    height: 247mm;
    min-height: 0;
    margin: 25mm auto;
    padding: 0;
    font-size: 20pt;
    line-height: 1.3;
  }

  .printing-cover-page .lesson-cover-logo {
    display: block;
    width: 36mm;
    height: 36mm;
    margin: 0 auto 18mm;
  }

  .printing-cover-page .lesson-cover h2 {
    margin: 0 0 4mm;
    font-size: 26pt;
    font-weight: 700;
    line-height: 1.18;
  }

  .printing-cover-page .lesson-cover p {
    margin: 0;
    font-size: 20pt;
    font-weight: 400;
    line-height: 1.32;
  }

  .printing-cover-page .lesson-cover-main {
    margin-bottom: 18mm;
  }

  .printing-cover-page .lesson-cover-course {
    margin-bottom: 16mm;
  }

  .printing-cover-page .lesson-cover-teacher {
    margin-bottom: 0;
  }

  .printing-cover-page .lesson-cover-footer {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 0;
    width: auto;
    padding-top: 0;
    border-top: 0;
    font-size: 20pt;
    text-align: left;
  }

  .printing-cover-page .lesson-cover-footer p {
    white-space: nowrap;
  }

  .printing-cover-page .lesson-cover-footer > div:last-child {
    text-align: right;
  }

  .printing-description-page {
    width: 210mm;
    min-height: 297mm;
    height: auto;
    background: #ffffff;
  }

  .printing-description-page .course-description-print {
    page: course-description;
    width: 150mm;
    min-height: 247mm;
    padding: 0;
    background: #ffffff;
    color: #000000;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 16pt;
    font-weight: 400;
    line-height: 1.18;
    letter-spacing: 0;
  }

  .printing-description-page .course-description-heading {
    margin-bottom: 9mm;
    text-align: center;
  }

  .printing-description-page .course-description-heading p {
    margin: 0 0 1.2mm;
    font-size: 18pt;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0;
  }

  .printing-description-page .course-description-meta {
    margin-bottom: 6mm;
    text-align: center;
  }

  .printing-description-page .course-description-meta p {
    margin: 0 0 1.3mm;
    font-size: 16pt;
    line-height: 1.14;
    letter-spacing: 0;
  }

  .printing-description-page .course-description-section {
    margin: 0 0 4mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .printing-description-page .course-description-section h3 {
    margin: 0 0 1.4mm;
    color: #000000;
    font-size: 16pt;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0;
  }

  .printing-description-page .course-description-section p,
  .printing-description-page .course-description-section li {
    margin: 0;
    font-size: 16pt;
    line-height: 1.22;
    letter-spacing: 0;
  }

  .printing-description-page .course-description-section p {
    text-align: justify;
    text-indent: 14mm;
  }

  .printing-description-page .course-description-section ol {
    margin: 0 0 0 14mm;
    padding: 0;
  }

  .printing-description-page .course-description-section li {
    padding-left: 1mm;
  }

  .printing-description-page .course-description-note {
    margin-top: 8mm;
    padding-top: 4mm;
    border-top: 0.35mm solid #000000;
  }

  .printing-description-page .course-description-note p {
    margin: 0;
    font-size: 14pt;
    line-height: 1.16;
    text-align: center;
    letter-spacing: 0;
  }

  .printing-standards-page {
    width: 210mm;
    min-height: 297mm;
    height: auto;
    background: #ffffff;
  }

  .printing-standards-page,
  .printing-analysis-page {
    --print-table-grid-border: 1px solid #000000;
  }

  .printing-analysis-page {
    width: 210mm;
    min-height: 297mm;
    height: auto;
    background: #ffffff;
  }

  .printing-standards-page .occupational-standard-print {
    page: occupational-standard;
    width: 150mm;
    min-height: 0;
    padding: 0;
    background: #ffffff;
    color: #000000;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 16pt;
    line-height: 1.12;
    letter-spacing: 0;
    break-after: page;
    page-break-after: always;
  }

  .printing-standards-page .occupational-standard-print:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .printing-standards-page .occupational-standard-heading {
    margin-bottom: 3mm;
    text-align: center;
    break-after: avoid;
    page-break-after: avoid;
  }

  .printing-standards-page .occupational-standard-heading h2,
  .printing-standards-page .occupational-standard-heading p {
    margin: 0 0 0.4mm;
    color: #000000;
    font-size: 16pt;
    line-height: 1.05;
    letter-spacing: 0;
  }

  .printing-standards-page .occupational-standard-heading h2 {
    font-weight: 700;
  }

  .printing-standards-page .occupational-standard-heading p {
    font-weight: 400;
  }

  .printing-standards-page .occupational-standard-table {
    width: 100%;
    break-before: avoid;
    page-break-before: avoid;
    border-collapse: collapse;
    border-spacing: 0;
    border: 0;
    table-layout: fixed;
    font-family: inherit;
    font-size: 14pt;
    line-height: 1.08;
    page-break-inside: auto;
  }

  .printing-standards-page .occupational-standard-table th,
  .printing-standards-page .occupational-standard-table td {
    position: static;
    padding: 0.8mm 0.9mm;
    border: var(--print-table-grid-border);
    background: #ffffff;
    color: #000000;
    font-size: 14pt;
    font-weight: 400;
    line-height: 1.08;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
  }

  .printing-standards-page .occupational-standard-table th {
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
    overflow-wrap: normal;
    word-break: keep-all;
  }

  .printing-standards-page .occupational-standard-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .printing-standards-page .occupational-standard-table td p {
    margin: 0 0 0.6mm;
    font-size: 14pt;
    line-height: 1.08;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .printing-standards-page .occupational-standard-table td p:last-child {
    margin-bottom: 0;
  }

  .printing-standards-page .occupational-standard-table .uoc-code {
    width: 11.6%;
    text-align: center;
  }

  .printing-standards-page .occupational-standard-table .uoc-name {
    width: 17.1%;
  }

  .printing-standards-page .occupational-standard-table .eoc-code {
    width: 11.6%;
    text-align: center;
  }

  .printing-standards-page .occupational-standard-table .eoc-name {
    width: 23.5%;
  }

  .printing-standards-page .occupational-standard-table .pc-list {
    width: 22.9%;
  }

  .printing-standards-page .occupational-standard-table .assessment-list {
    width: 13.4%;
  }

  .printing-analysis-page .course-description-print {
    page: analysis-print;
    width: 150mm;
    min-height: 247mm;
    padding: 0;
    background: #ffffff;
    color: #000000;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 14pt;
    line-height: 1.08;
  }

  .printing-analysis-page .course-description-heading {
    margin-bottom: 5mm;
    text-align: center;
  }

  .printing-analysis-page .course-description-heading h2 {
    margin: 0 0 2.5mm;
    font-size: 18pt;
    font-weight: 700;
    line-height: 1.08;
  }

  .printing-analysis-page .course-description-heading p,
  .printing-analysis-page .course-description-meta p {
    margin: 0 0 1.2mm;
    font-size: 14pt;
    line-height: 1.08;
  }

  .printing-analysis-page .course-description-meta {
    margin-bottom: 3mm;
    text-align: center;
  }

  .printing-analysis-page .analysis-settings-print {
    display: block;
    margin: 0 0 4mm;
    font-size: 14pt;
    line-height: 1.08;
    text-align: center;
  }

  .printing-analysis-page .analysis-settings-print p {
    margin: 0;
    font-size: 14pt;
    line-height: 1.08;
    white-space: nowrap;
  }

  .printing-analysis-page .analysis-table-print {
    width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 8mm !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-top: var(--print-table-grid-border) !important;
    border-left: var(--print-table-grid-border) !important;
    table-layout: fixed;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 14pt !important;
  }

  .printing-analysis-page .analysis-table-print th,
  .printing-analysis-page .analysis-table-print td {
    border-top: 0 !important;
    border-right: var(--print-table-grid-border) !important;
    border-bottom: var(--print-table-grid-border) !important;
    border-left: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 14pt !important;
    line-height: 1.04 !important;
    padding: 0.9mm 1mm !important;
    word-break: break-word;
  }

  .printing-analysis-page .analysis-table-print th {
    font-weight: 700 !important;
    text-align: center !important;
    vertical-align: middle !important;
  }

  .printing-analysis-page .analysis-table-print td {
    vertical-align: top !important;
  }

  .printing-analysis-page .analysis-table-print .unit-number-col {
    width: 12%;
    text-align: center !important;
  }

  .printing-analysis-page .analysis-table-print .unit-name-col {
    width: 66%;
  }

  .printing-analysis-page .analysis-table-print .time-group-col {
    width: 22%;
    text-align: center !important;
  }

  .printing-analysis-page .analysis-table-print .time-col {
    width: 7.33%;
    text-align: center !important;
  }

  .printing-analysis-page .analysis-table-print tfoot td {
    font-weight: 700 !important;
    text-align: center !important;
    vertical-align: middle !important;
  }

  .printing-analysis-page .analysis-table-print .total-label {
    text-align: center !important;
  }

  .printing-analysis-page .analysis-print-note {
    margin-top: 4mm;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 14pt;
    line-height: 1.08;
  }

  .printing-analysis-page .analysis-print-note p {
    margin: 0 0 1mm;
    font-size: 14pt;
    line-height: 1.08;
  }

  /* ── Behavior Print (Tab 5) ─────────────────────── */

  .printing-behavior-page .learning-behavior-print-document {
    page: behavior-print;
    width: 100%;
    min-height: auto;
    padding: 0;
    box-sizing: border-box;
    background: #ffffff;
    color: #000000;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 16pt;
    line-height: 1.12;
  }

  .printing-behavior-page {
    --print-table-grid-border: 1px solid #000000;
  }

  .printing-behavior-page .course-description-heading {
    margin-bottom: 8mm;
    text-align: center;
    transform: none;
  }

  .printing-behavior-page .course-description-heading h2 {
    margin: 0 0 4mm;
    font-size: 20pt;
    font-weight: 700;
    line-height: 1.12;
  }

  .printing-behavior-page .course-description-heading p {
    margin: 0 0 2mm;
    font-size: 16pt;
    line-height: 1.12;
  }

  .printing-behavior-page .learning-behavior-table-print {
    width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 6mm !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-top: var(--print-table-grid-border) !important;
    border-left: var(--print-table-grid-border) !important;
    table-layout: fixed;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    transform: none;
  }

  .printing-behavior-page .learning-behavior-table-print th,
  .printing-behavior-page .learning-behavior-table-print td {
    border-top: 0 !important;
    border-right: var(--print-table-grid-border) !important;
    border-bottom: var(--print-table-grid-border) !important;
    border-left: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif !important;
    font-size: 14pt !important;
    line-height: 1.06 !important;
    padding: 0.9mm 1mm !important;
    word-break: break-word;
  }

  .printing-behavior-page .learning-behavior-table-print th {
    font-weight: 700 !important;
    text-align: center !important;
    vertical-align: middle !important;
    background: #f3f4f6 !important;
  }

  .printing-behavior-page .learning-behavior-table-print td {
    vertical-align: top !important;
  }

  .printing-behavior-page .learning-behavior-table-print .behavior-domain-head {
    background: #f3f4f6 !important;
  }

  .printing-behavior-page .learning-behavior-table-print .behavior-application-head {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .printing-behavior-page .learning-behavior-table-print .behavior-unit-name-col {
    width: 37%;
  }

  .printing-behavior-page .learning-behavior-table-print .behavior-level-col,
  .printing-behavior-page .learning-behavior-table-print .behavior-code-col {
    text-align: center !important;
    vertical-align: middle !important;
  }

  .printing-behavior-page .learning-behavior-table-print .behavior-knowledge-col,
  .printing-behavior-page .learning-behavior-table-print .behavior-skill-col {
    width: 10%;
  }

  .printing-behavior-page .learning-behavior-table-print .behavior-affective-col {
    width: 8%;
  }

  .printing-behavior-page .learning-behavior-table-print .behavior-application-col {
    width: 11%;
  }

  .printing-behavior-page .learning-behavior-table-print .behavior-hours-col {
    width: 11%;
    text-align: center !important;
    vertical-align: middle !important;
  }

  .printing-behavior-page .learning-behavior-table-print .behavior-percent-col {
    width: 13%;
    text-align: center !important;
    vertical-align: middle !important;
  }

  .printing-behavior-page .learning-behavior-table-print tfoot td {
    font-weight: 700 !important;
    text-align: center !important;
    vertical-align: middle !important;
  }

  .printing-behavior-page .learning-behavior-table-print .total-label {
    text-align: center !important;
  }

  .printing-behavior-page .learning-behavior-condition-table {
    width: 100% !important;
    min-width: 0 !important;
    margin-top: 1mm !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-top: var(--print-table-grid-border) !important;
    border-left: var(--print-table-grid-border) !important;
    table-layout: fixed;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    transform: none;
  }

  .printing-behavior-page .behavior-condition-block {
    break-before: page;
    page-break-before: always;
    break-inside: avoid;
    page-break-inside: avoid;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 14pt;
  }

  .printing-behavior-page .behavior-condition-heading {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 4mm 0 1mm;
    font-size: 14pt;
    font-weight: 700;
    text-align: right;
    transform: none;
  }

  .printing-behavior-page .learning-behavior-condition-table th,
  .printing-behavior-page .learning-behavior-condition-table td {
    border-top: 0 !important;
    border-right: var(--print-table-grid-border) !important;
    border-bottom: var(--print-table-grid-border) !important;
    border-left: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif !important;
    font-size: 14pt !important;
    line-height: 1.08 !important;
    padding: 0.9mm 1.2mm !important;
    vertical-align: top !important;
  }

  .printing-behavior-page .learning-behavior-condition-table th {
    font-weight: 700 !important;
    text-align: center !important;
    vertical-align: middle !important;
  }

  .printing-behavior-page .learning-behavior-condition-table .behavior-condition-title {
    background: #d9d9d9 !important;
  }

  .printing-behavior-page .learning-behavior-condition-table p {
    margin: 0 0 1mm;
    font-size: 14pt !important;
    line-height: 1.08 !important;
  }

  /* Competency Link Print (Tab 6) */

  .printing-competency-page {
    --print-table-grid-border: 1.2px solid #000000;
    background: #ffffff;
  }

  .printing-competency-page .competency-link-print-document {
    page: competency-link-print;
    width: 100%;
    max-width: none;
    min-height: 0;
    padding: 0;
    box-sizing: border-box;
    background: #ffffff;
    color: #000000;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 14pt;
    line-height: 1.08;
  }

  .printing-competency-page .competency-link-print-pages {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }

  .printing-competency-page .competency-link-print-sheet {
    page: competency-link-print;
    width: 100%;
    max-width: none;
    min-height: 0;
    height: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: visible;
    break-after: auto;
    page-break-after: auto;
  }

  .printing-competency-page .competency-link-print-sheet + .competency-link-print-sheet {
    break-before: page;
    page-break-before: always;
  }

  .printing-competency-page .competency-link-print-table-wrap {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    flex: 0 0 auto;
    min-height: 0;
    display: block;
  }

  .printing-competency-page .competency-link-heading {
    margin-bottom: 4mm;
    text-align: center;
  }

  .printing-competency-page .competency-link-heading h2 {
    margin: 0 0 2mm;
    color: #000000;
    font-size: 18pt;
    font-weight: 700;
    line-height: 1.08;
  }

  .printing-competency-page .competency-link-heading p {
    margin: 0 0 1mm;
    color: #000000;
    font-size: 14pt;
    font-weight: 700;
    line-height: 1.08;
  }

  .printing-competency-page .competency-link-table-print {
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-top: var(--print-table-grid-border) !important;
    border-left: var(--print-table-grid-border) !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    table-layout: fixed;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
  }

  .printing-competency-page .competency-link-table-print thead {
    display: table-header-group !important;
  }

  .printing-competency-page .competency-link-table-print tbody {
    display: table-row-group !important;
    height: auto;
  }

  .printing-competency-page .competency-link-table-print tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .printing-competency-page .competency-link-table-print th,
  .printing-competency-page .competency-link-table-print td {
    border: 0 !important;
    border-right: var(--print-table-grid-border) !important;
    border-bottom: var(--print-table-grid-border) !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif !important;
    font-size: 14pt !important;
    line-height: 1.05 !important;
    padding: 0.9mm 1.1mm !important;
    vertical-align: top !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .printing-competency-page .competency-link-table-print .competency-print-blank-row td {
    display: none;
    height: 8mm;
    padding: 0 !important;
    line-height: 1 !important;
  }

  .printing-competency-page .competency-link-table-print .competency-print-blank-row:last-child td {
    display: none;
    padding: 0 !important;
    line-height: 1 !important;
  }

  .printing-competency-page .competency-link-table-print th {
    font-weight: 700 !important;
    text-align: center !important;
    vertical-align: middle !important;
  }

  .printing-competency-page .competency-link-table-print p {
    margin: 0 0 0.8mm;
    font-size: 14pt !important;
    line-height: 1.05 !important;
  }

  .printing-competency-page .competency-link-table-print p:last-child {
    margin-bottom: 0;
  }

  .printing-competency-page .competency-link-table-print .competency-duty-col {
    width: 20%;
  }

  .printing-competency-page .competency-link-table-print .competency-duty-col-blank {
    color: transparent !important;
  }

  .printing-competency-page .competency-link-table-print .competency-task-col {
    width: 22%;
  }

  .printing-competency-page .competency-link-table-print .competency-standard-col {
    width: 24%;
  }

  .printing-competency-page .competency-link-table-print .competency-knowledge-col,
  .printing-competency-page .competency-link-table-print .competency-skill-col {
    width: 17%;
  }

  .printing-competency-page .competency-link-print-note {
    margin-top: 2mm;
    color: #000000;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 13pt;
    line-height: 1.08;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .printing-competency-page .competency-link-print-note p {
    margin: 0 0 0.9mm;
    font-size: 13pt;
    line-height: 1.08;
  }

  .printing-lesson-plan-page .lesson-plan-print-stack {
    width: 100%;
  }

  .printing-lesson-plan-page .lesson-plan-print-document {
    page: lesson-plan-print;
    width: 100%;
    min-height: 247mm;
    box-sizing: border-box;
    color: #000000;
    background: #ffffff;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 16pt;
    line-height: 1.12;
    break-after: page;
    page-break-after: always;
  }

  .printing-lesson-plan-page .lesson-plan-print-document:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .printing-lesson-plan-page .lesson-plan-document-heading {
    margin-bottom: 7mm;
    text-align: center;
    break-after: avoid;
    page-break-after: avoid;
  }

  .printing-lesson-plan-page .worksheet-print-opening,
  .printing-full-document .worksheet-print-opening {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .printing-lesson-plan-page .lesson-plan-heading-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }

  .printing-lesson-plan-page .lesson-plan-heading-table td {
    border: 0.2mm solid #000000;
    padding: 1.2mm 1.6mm;
    color: #000000;
    font-size: 14pt;
    line-height: 1.02;
  }

  .printing-lesson-plan-page .lesson-plan-heading-logo {
    width: 15%;
    text-align: center !important;
  }

  .printing-lesson-plan-page .lesson-plan-heading-logo img {
    width: 18mm;
    height: 18mm;
  }

  .printing-lesson-plan-page .lesson-plan-heading-title {
    font-size: 18pt;
    font-weight: 700;
    text-align: center !important;
  }

  .printing-lesson-plan-page .lesson-plan-heading-side {
    width: 17%;
    white-space: nowrap;
    text-align: left !important;
    vertical-align: top;
  }

  .printing-lesson-plan-page .lesson-plan-heading-meta,
  .printing-lesson-plan-page .lesson-plan-heading-topic {
    text-align: left !important;
  }

  .printing-lesson-plan-page .lesson-plan-heading-meta {
    font-size: 15pt;
    line-height: 1.04;
  }

  .printing-lesson-plan-page .lesson-plan-heading-side div {
    white-space: nowrap;
  }

  .printing-lesson-plan-page .lesson-plan-heading-hours {
    white-space: normal;
  }

  .printing-lesson-plan-page .lesson-plan-heading-hours div {
    white-space: normal;
  }

  .printing-lesson-plan-page .lesson-plan-heading-hours div + div {
    margin-top: 0.8mm;
  }

  .printing-lesson-plan-page .lesson-plan-topic {
    margin: 0 0 4mm;
    padding: 0;
    border: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .printing-lesson-plan-page .worksheet-topic.worksheet-worksteps,
  .printing-lesson-plan-page .worksheet-topic,
  .printing-lesson-plan-page .worksheet-topic.worksheet-evaluation,
  .printing-full-document .worksheet-topic,
  .printing-full-document .worksheet-topic.worksheet-worksteps,
  .printing-full-document .worksheet-topic.worksheet-evaluation {
    break-inside: auto;
    page-break-inside: auto;
  }

  .printing-lesson-plan-page .lesson-plan-topic h4 {
    margin: 0 0 1.5mm;
    color: #000000;
    font-size: 17pt;
    font-weight: 700;
  }

  .printing-lesson-plan-page .lesson-plan-topic ul,
  .printing-lesson-plan-page .lesson-plan-topic ol {
    margin: 0 0 0 7mm;
    padding: 0;
  }

  .printing-lesson-plan-page .lesson-plan-topic li {
    margin: 0 0 0.8mm;
    color: #000000;
    font-size: 16pt;
    line-height: 1.12;
  }

  .printing-lesson-plan-page .lesson-plan-topic ol {
    list-style: none;
    counter-reset: lesson-item;
  }

  .printing-lesson-plan-page .lesson-plan-topic ol li {
    counter-increment: lesson-item;
    position: relative;
  }

  .printing-lesson-plan-page .lesson-plan-topic ol li::before {
    content: counter(lesson-item) ". ";
  }

  .printing-lesson-plan-page .lesson-plan-topic ol:has(> li:only-child) li {
    counter-increment: none;
  }

  .printing-lesson-plan-page .lesson-plan-topic ol:has(> li:only-child) li::before {
    content: "- ";
  }

  .printing-lesson-plan-page .lesson-plan-topic .lesson-single-item-list {
    list-style: none;
  }

  .printing-lesson-plan-page .lesson-plan-topic .lesson-single-item-list li::before {
    content: "- ";
  }

  .printing-lesson-plan-page .lesson-plan-plain-list p {
    margin: 0 0 0.8mm;
    color: #000000;
    font-size: 16pt;
    line-height: 1.12;
  }

  .printing-lesson-plan-page .lesson-plan-topic--unitCompetencies .lesson-plan-plain-list {
    padding-left: 12mm;
  }

  .printing-lesson-plan-page .lesson-plan-standard-occupations {
    margin: 0 0 1.2mm;
  }

  .printing-lesson-plan-page .lesson-plan-standard-occupations p {
    margin: 0 0 0.6mm;
    color: #000000;
    font-size: 16pt;
    font-weight: 500;
    line-height: 1.12;
  }

  .printing-lesson-plan-page .lesson-plan-subtopic {
    margin-left: 0;
    padding-left: 12mm;
  }

  .printing-lesson-plan-page .lesson-plan-narrative {
    margin: 0 0 1mm;
    color: #000000;
    font-size: 16pt;
    line-height: 1.16;
    text-align: justify;
    text-indent: 10mm;
  }

  .printing-lesson-plan-page .lesson-plan-narrative--limited {
    max-height: calc(1.16em * var(--lesson-line-limit, 8));
    overflow: hidden;
  }

  .printing-lesson-plan-page .lesson-plan-subtopic h5 {
    margin: 2mm 0 1mm;
    color: #000000;
    font-size: 16pt;
    font-weight: 700;
  }

  .printing-lesson-plan-page .final-exam-print-stack {
    width: 100%;
    break-before: page;
    page-break-before: always;
  }

  .printing-lesson-plan-page .final-exam-print-document {
    min-height: 247mm;
    padding: 0;
    font-family: "TH Sarabun New", "Sarabun", "Noto Sans Thai", sans-serif !important;
    font-size: 16pt;
    line-height: 1.18;
  }

  .printing-lesson-plan-page .final-exam-heading {
    margin: 0 0 4mm;
    padding: 0;
    border-bottom: 0;
    text-align: initial;
    break-after: avoid;
    page-break-after: avoid;
  }

  .printing-lesson-plan-page .final-exam-summary {
    margin: 0 0 5mm;
    color: #000000;
    font-size: 15pt;
    line-height: 1.08;
    text-align: center;
  }

  .printing-lesson-plan-page .final-exam-heading h2 {
    margin: 0 0 2mm;
    color: #000000;
    font-size: 24pt;
    font-weight: 700;
    line-height: 1.08;
  }

  .printing-lesson-plan-page .final-exam-heading p {
    margin: 0 0 0.8mm;
    color: #000000;
    font-size: 16pt;
    line-height: 1.08;
  }

  .printing-lesson-plan-page .final-exam-document {
    display: block;
    gap: 0;
  }

  .printing-lesson-plan-page .final-exam-unit {
    display: block;
    margin: 0;
    padding: 0;
  }

  .printing-lesson-plan-page .final-exam-question {
    margin: 0 0 8mm;
    padding: 0;
    color: #000000;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .printing-lesson-plan-page .final-exam-question > p {
    margin: 0 0 2mm;
    color: #000000;
    font-size: 17pt;
    font-weight: 700;
    line-height: 1.16;
  }

  .printing-lesson-plan-page .final-exam-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5mm 10mm;
    margin: 0;
    padding: 0 0 0 8mm;
  }

  .printing-lesson-plan-page .final-exam-options p {
    margin: 0;
    color: #000000;
    font-size: 16pt;
    line-height: 1.14;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .printing-lesson-plan-page .final-exam-answer-key {
    margin: 0;
    padding: 0;
    border-top: 0;
    break-before: page;
    page-break-before: always;
  }

  .printing-lesson-plan-page .final-exam-answer-key h3 {
    margin: 0 0 5mm;
    color: #000000;
    font-size: 21pt;
    font-weight: 700;
    line-height: 1.12;
    text-align: center;
  }

  .printing-lesson-plan-page .final-exam-answer-key .table-wrap {
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .printing-lesson-plan-page .final-exam-answer-key table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13.5pt;
    line-height: 1.06;
  }

  .printing-lesson-plan-page .final-exam-answer-key th,
  .printing-lesson-plan-page .final-exam-answer-key td {
    padding: 1.3mm 1.5mm;
    border: 0.2mm solid #000000;
    color: #000000;
    font-size: 13.5pt;
    line-height: 1.06;
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .printing-lesson-plan-page .final-exam-answer-key th {
    background: #f2f2f2 !important;
    font-weight: 700;
    text-align: center;
  }

  .printing-lesson-plan-page .final-exam-answer-key th:nth-child(1),
  .printing-lesson-plan-page .final-exam-answer-key td:nth-child(1) {
    width: 8%;
    text-align: center;
  }

  .printing-lesson-plan-page .final-exam-answer-key th:nth-child(2),
  .printing-lesson-plan-page .final-exam-answer-key td:nth-child(2) {
    width: 8%;
    text-align: center;
  }

  .printing-lesson-plan-page .final-exam-answer-key th:nth-child(3),
  .printing-lesson-plan-page .final-exam-answer-key td:nth-child(3) {
    width: 35%;
  }

  .printing-lesson-plan-page .final-exam-answer-key th:nth-child(4),
  .printing-lesson-plan-page .final-exam-answer-key td:nth-child(4) {
    width: 14%;
    text-align: center;
  }

  .printing-lesson-plan-page .final-exam-answer-key th:nth-child(5),
  .printing-lesson-plan-page .final-exam-answer-key td:nth-child(5) {
    width: 35%;
  }

  .printing-lesson-plan-page .worksheet-print-stack,
  .printing-full-document .worksheet-print-stack,
  .printing-lesson-plan-page .post-teaching-print-stack,
  .printing-full-document .post-teaching-print-stack {
    display: block;
    width: 100%;
  }

  .printing-lesson-plan-page .worksheet-print-stack > .worksheet-document,
  .printing-full-document .worksheet-print-stack > .worksheet-document {
    break-before: page;
    page-break-before: always;
  }

  .printing-lesson-plan-page .worksheet-print-stack > .worksheet-document:first-child,
  .printing-full-document .worksheet-print-stack > .worksheet-document:first-child {
    break-before: auto;
    page-break-before: auto;
  }

  .printing-lesson-plan-page .lesson-plan-unit-print-stack > .lesson-plan-print-document,
  .printing-full-document .lesson-plan-unit-print-stack > .lesson-plan-print-document,
  .printing-lesson-plan-page .knowledge-sheet-print-stack > .knowledge-sheet-document,
  .printing-full-document .knowledge-sheet-print-stack > .knowledge-sheet-document,
  .printing-lesson-plan-page .post-teaching-print-stack > .post-teaching-document,
  .printing-full-document .post-teaching-print-stack > .post-teaching-document {
    break-before: page;
    page-break-before: always;
  }

  .printing-lesson-plan-page .lesson-plan-unit-print-stack > .lesson-plan-print-document:first-child,
  .printing-full-document .lesson-plan-unit-print-stack > .lesson-plan-print-document:first-child,
  .printing-lesson-plan-page .knowledge-sheet-print-stack > .knowledge-sheet-document:first-child,
  .printing-full-document .knowledge-sheet-print-stack > .knowledge-sheet-document:first-child,
  .printing-lesson-plan-page .post-teaching-print-stack > .post-teaching-document:first-child,
  .printing-full-document .post-teaching-print-stack > .post-teaching-document:first-child {
    break-before: auto;
    page-break-before: auto;
  }

  .printing-lesson-plan-page .worksheet-document .table-wrap,
  .printing-full-document .worksheet-document .table-wrap {
    overflow: visible !important;
    max-width: none !important;
    width: 100% !important;
  }

  .printing-lesson-plan-page .worksheet-document .worksheet-step-table,
  .printing-lesson-plan-page .worksheet-document .worksheet-evaluation-table,
  .printing-full-document .worksheet-document .worksheet-step-table,
  .printing-full-document .worksheet-document .worksheet-evaluation-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    border-top: 0.2mm solid #000000;
    border-left: 0.2mm solid #000000;
    margin-top: 1mm;
  }

  .printing-lesson-plan-page .worksheet-document .worksheet-step-table thead,
  .printing-lesson-plan-page .worksheet-document .worksheet-evaluation-table thead,
  .printing-full-document .worksheet-document .worksheet-step-table thead,
  .printing-full-document .worksheet-document .worksheet-evaluation-table thead {
    display: table-header-group;
  }

  .printing-lesson-plan-page .worksheet-document .worksheet-step-table tr,
  .printing-lesson-plan-page .worksheet-document .worksheet-evaluation-table tr,
  .printing-full-document .worksheet-document .worksheet-step-table tr,
  .printing-full-document .worksheet-document .worksheet-evaluation-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .printing-lesson-plan-page .worksheet-document .worksheet-step-table th,
  .printing-lesson-plan-page .worksheet-document .worksheet-step-table td,
  .printing-lesson-plan-page .worksheet-document .worksheet-evaluation-table th,
  .printing-lesson-plan-page .worksheet-document .worksheet-evaluation-table td,
  .printing-full-document .worksheet-document .worksheet-step-table th,
  .printing-full-document .worksheet-document .worksheet-step-table td,
  .printing-full-document .worksheet-document .worksheet-evaluation-table th,
  .printing-full-document .worksheet-document .worksheet-evaluation-table td {
    border-right: 0.2mm solid #000000;
    border-bottom: 0.2mm solid #000000;
    padding: 1.1mm 1.4mm;
    color: #000000;
    font-size: 14pt;
    line-height: 1.05;
    vertical-align: top;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .printing-lesson-plan-page .worksheet-document .worksheet-step-table th,
  .printing-lesson-plan-page .worksheet-document .worksheet-evaluation-table th,
  .printing-full-document .worksheet-document .worksheet-step-table th,
  .printing-full-document .worksheet-document .worksheet-evaluation-table th {
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
    background: #ffffff !important;
  }

  .printing-lesson-plan-page .worksheet-document .worksheet-step-table th:nth-child(1),
  .printing-lesson-plan-page .worksheet-document .worksheet-step-table td:nth-child(1),
  .printing-full-document .worksheet-document .worksheet-step-table th:nth-child(1),
  .printing-full-document .worksheet-document .worksheet-step-table td:nth-child(1) {
    width: 8%;
    text-align: center;
    vertical-align: top;
  }

  .printing-lesson-plan-page .worksheet-document .worksheet-step-table th:nth-child(2),
  .printing-lesson-plan-page .worksheet-document .worksheet-step-table td:nth-child(2),
  .printing-full-document .worksheet-document .worksheet-step-table th:nth-child(2),
  .printing-full-document .worksheet-document .worksheet-step-table td:nth-child(2) {
    width: 17%;
  }

  .printing-lesson-plan-page .worksheet-document .worksheet-step-table th:nth-child(3),
  .printing-lesson-plan-page .worksheet-document .worksheet-step-table td:nth-child(3),
  .printing-full-document .worksheet-document .worksheet-step-table th:nth-child(3),
  .printing-full-document .worksheet-document .worksheet-step-table td:nth-child(3) {
    width: 43%;
  }

  .printing-lesson-plan-page .worksheet-document .worksheet-step-table th:nth-child(4),
  .printing-lesson-plan-page .worksheet-document .worksheet-step-table td:nth-child(4),
  .printing-full-document .worksheet-document .worksheet-step-table th:nth-child(4),
  .printing-full-document .worksheet-document .worksheet-step-table td:nth-child(4) {
    width: 32%;
  }

  .printing-lesson-plan-page .worksheet-document .worksheet-step-table td p,
  .printing-lesson-plan-page .worksheet-document .worksheet-evaluation-table td p,
  .printing-full-document .worksheet-document .worksheet-step-table td p,
  .printing-full-document .worksheet-document .worksheet-evaluation-table td p {
    margin: 0 0 0.7mm;
    font-size: 14pt;
    line-height: 1.05;
  }

  .printing-lesson-plan-page .worksheet-document .worksheet-step-table td p:last-child,
  .printing-lesson-plan-page .worksheet-document .worksheet-evaluation-table td p:last-child,
  .printing-full-document .worksheet-document .worksheet-step-table td p:last-child,
  .printing-full-document .worksheet-document .worksheet-evaluation-table td p:last-child {
    margin-bottom: 0;
  }

  .printing-lesson-plan-page .worksheet-document .worksheet-tool-item::before,
  .printing-full-document .worksheet-document .worksheet-tool-item::before {
    content: "- ";
  }

  .printing-lesson-plan-page .worksheet-document .worksheet-evaluation-table-block + .worksheet-evaluation-table-block,
  .printing-full-document .worksheet-document .worksheet-evaluation-table-block + .worksheet-evaluation-table-block {
    margin-top: 3mm;
  }

  .printing-lesson-plan-page .worksheet-document .worksheet-topic h5,
  .printing-full-document .worksheet-document .worksheet-topic h5 {
    margin: 1.4mm 0 0.8mm;
    font-size: 15pt;
    font-weight: 700;
    color: #000000;
  }

  /* ── Full Document Print ─────────────────────────── */

  @page full-doc-cover {
    size: A4 portrait;
    margin: 0;
  }

  @page full-doc-unnumbered {
    size: A4 portrait;
    margin: 25mm 25mm 25mm 35mm;
  }

  /* Cover */
  .printing-full-document .lesson-cover {
    page: lesson-cover;
    display: block;
    width: 210mm;
    height: 297mm;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
    background: #ffffff;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    break-after: page;
    break-inside: avoid;
    page-break-after: always;
    page-break-inside: avoid;
  }

  .printing-full-document .lesson-cover-generated-page {
    page: lesson-cover;
    display: block;
    width: 210mm;
    height: 297mm;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
    background: #ffffff;
    break-after: page;
    break-inside: avoid;
    page-break-after: always;
    page-break-inside: avoid;
  }

  .printing-full-document .lesson-cover-generated-page img {
    display: block;
    width: 210mm;
    height: 297mm;
    max-height: 297mm;
    min-height: 297mm;
    object-fit: cover;
    object-position: center center;
  }

  .printing-full-document .lesson-cover-inner {
    position: relative;
    display: block;
    width: 160mm;
    max-width: 160mm;
    height: 246mm;
    min-height: 0;
    margin: 25mm auto 0;
    padding: 0;
    font-size: 20pt;
    line-height: 1.3;
  }

  .printing-full-document .lesson-cover-logo {
    display: block;
    width: 36mm;
    height: 36mm;
    margin: 0 auto 18mm;
  }

  .printing-full-document .lesson-cover h2 {
    margin: 0 0 4mm;
    font-size: 26pt;
    font-weight: 700;
    line-height: 1.18;
  }

  .printing-full-document .lesson-cover p {
    margin: 0;
    font-size: 20pt;
    font-weight: 400;
    line-height: 1.32;
  }

  .printing-full-document .lesson-cover-main { margin-bottom: 18mm; }
  .printing-full-document .lesson-cover-course { margin-bottom: 16mm; }
  .printing-full-document .lesson-cover-teacher { margin-bottom: 0; }

  .printing-full-document .lesson-cover-footer {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 0;
    width: auto;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    font-size: 20pt;
    text-align: left;
  }

  .printing-full-document .lesson-cover-footer p { white-space: nowrap; }
  .printing-full-document .lesson-cover-footer > div:last-child { text-align: right; }

  /* คำนำ / สารบัญ */
  .printing-full-document .full-doc-intro-page,
  .printing-full-document .full-doc-toc-page {
    page: full-doc-unnumbered;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    width: 100%;
    min-height: 247mm;
    display: block;
    box-sizing: border-box;
    padding: 0;
    font-size: 16pt;
    line-height: 1.18;
    color: #000;
    break-before: auto;
    break-after: page;
    page-break-after: always;
    page-break-inside: avoid;
  }

  .printing-full-document .full-doc-page-header h1 {
    text-align: center;
    font-size: 22pt;
    font-weight: 700;
    margin: 0 0 16mm;
    color: #000;
  }

  .printing-full-document .full-doc-intro-page .full-doc-page-header h1 {
    margin-bottom: 20mm;
  }

  .printing-full-document .full-doc-toc-page .full-doc-page-header h1 {
    margin-bottom: 14mm;
  }

  .printing-full-document .full-doc-intro-body p {
    margin: 0 0 1.5mm;
    text-align: justify;
    text-indent: 2.5em;
    line-height: 1.18;
  }

  .printing-full-document .full-doc-intro-signature {
    margin-top: 10mm;
    padding-top: 0;
    text-align: center;
    display: block;
    padding-left: 92mm;
  }

  .printing-full-document .full-doc-intro-signature p {
    margin: 0;
    line-height: 1.18;
  }

  .printing-full-document .full-doc-toc-list {
    width: 100%;
    max-width: none;
    margin: 0;
    font-size: 16pt;
    line-height: 1.2;
  }

  .printing-full-document .full-doc-toc-page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 16mm;
    margin: 0 0 3mm;
    font-size: 16pt;
    font-weight: 700;
  }

  .printing-full-document .full-doc-toc-page-head span {
    grid-column: 2;
    text-align: center;
  }

  .printing-full-document .full-doc-toc-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 16mm;
    gap: 4mm;
    align-items: baseline;
    padding: 0;
    border-bottom: 0;
    color: #000000;
    text-decoration: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .printing-full-document .full-doc-toc-label {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .printing-full-document .full-doc-toc-sub .full-doc-toc-label {
    padding-left: 10mm;
    font-size: 16pt;
  }

  .printing-full-document .full-doc-toc-page-no {
    text-align: center;
    color: #000000;
    font-size: 16pt;
    white-space: nowrap;
  }

  /* Section page breaks */
  .printing-full-document .course-description-print:not(.analysis-print-document),
  .printing-full-document .occupational-standard-print,
  .printing-full-document .analysis-print-document,
  .printing-full-document .learning-behavior-print-document,
  .printing-full-document .competency-link-print-document,
  .printing-full-document .lesson-plan-print-stack,
  .printing-full-document .knowledge-sheet-print-stack,
  .printing-full-document .post-teaching-print-stack,
  .printing-full-document .final-exam-print-stack {
    break-before: auto;
    page-break-before: auto;
    break-after: page;
    page-break-after: always;
  }

  .printing-full-document .knowledge-sheet-print-stack {
    break-after: auto;
    page-break-after: auto;
  }

  .printing-lesson-plan-page .post-teaching-document,
  .printing-full-document .post-teaching-document {
    page: lesson-plan-print;
    width: 100%;
    height: 247mm;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    color: #000000;
    box-shadow: none;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 15.5pt;
    line-height: 1.08;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    break-after: page;
    page-break-after: always;
  }

  .printing-lesson-plan-page .post-teaching-document-actions,
  .printing-full-document .post-teaching-document-actions {
    display: none !important;
  }

  .printing-lesson-plan-page .post-teaching-document h2,
  .printing-full-document .post-teaching-document h2 {
    margin: 0 0 5mm;
    color: #000000;
    font-size: 19pt;
    font-weight: 700;
    line-height: 1.05;
    text-align: center;
  }

  .printing-lesson-plan-page .post-teaching-meta,
  .printing-full-document .post-teaching-meta {
    display: grid;
    width: 150mm;
    gap: 1.25mm;
    margin: 0 auto 4mm;
    color: #000000;
    font-size: 15.5pt;
    line-height: 1.06;
  }

  .printing-lesson-plan-page .post-teaching-meta p,
  .printing-full-document .post-teaching-meta p {
    display: grid;
    gap: 1mm 2.5mm;
    margin: 0;
    color: #000000;
    align-items: flex-end;
  }

  .printing-lesson-plan-page .post-teaching-meta p:nth-child(1),
  .printing-full-document .post-teaching-meta p:nth-child(1) {
    grid-template-columns: 34mm 74mm 37mm;
  }

  .printing-lesson-plan-page .post-teaching-meta p:nth-child(2),
  .printing-full-document .post-teaching-meta p:nth-child(2) {
    grid-template-columns: 29mm 39mm 43mm 24mm auto;
  }

  .printing-lesson-plan-page .post-teaching-meta p:nth-child(3),
  .printing-full-document .post-teaching-meta p:nth-child(3) {
    grid-template-columns: 28mm 27mm 90mm;
  }

  .printing-lesson-plan-page .post-teaching-meta p:nth-child(4),
  .printing-full-document .post-teaching-meta p:nth-child(4) {
    grid-template-columns: 45mm auto 30mm auto 30mm auto;
  }

  .printing-lesson-plan-page .post-teaching-meta p > span:not(.post-teaching-inline),
  .printing-full-document .post-teaching-meta p > span:not(.post-teaching-inline) {
    white-space: nowrap;
  }

  .printing-lesson-plan-page .post-teaching-inline,
  .printing-full-document .post-teaching-inline {
    display: inline-flex;
    width: 100%;
    gap: 1.1mm;
    color: #000000;
    white-space: nowrap;
  }

  .printing-lesson-plan-page .post-teaching-fill,
  .printing-lesson-plan-page .post-teaching-fill--short,
  .printing-lesson-plan-page .post-teaching-fill--long,
  .printing-full-document .post-teaching-fill,
  .printing-full-document .post-teaching-fill--short,
  .printing-full-document .post-teaching-fill--long {
    display: inline-block;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 0.8mm;
    color: #000000;
    border-bottom: 0.2mm dotted #000000;
    line-height: 1;
  }

  .printing-lesson-plan-page .post-teaching-fill--center,
  .printing-full-document .post-teaching-fill--center {
    text-align: center;
  }

  .printing-lesson-plan-page .post-teaching-fill--long,
  .printing-full-document .post-teaching-fill--long {
    min-width: 0;
  }

  .printing-lesson-plan-page .post-teaching-unit-summary,
  .printing-full-document .post-teaching-unit-summary {
    display: none !important;
    grid-template-columns: 43mm 48mm 1fr;
    align-items: center;
    width: 150mm;
    margin: 4mm auto 5mm;
    padding: 2mm 3.5mm;
    border: 0.2mm solid #000000;
    border-radius: 0;
    background: #ffffff;
    color: #000000;
    font-size: 15.5pt;
    line-height: 1.08;
  }

  .printing-lesson-plan-page .post-teaching-unit-summary strong,
  .printing-full-document .post-teaching-unit-summary strong {
    color: #000000;
    font-weight: 700;
  }

  .printing-lesson-plan-page .post-teaching-section,
  .printing-full-document .post-teaching-section {
    width: 150mm;
    margin: 0 auto 2.8mm;
    color: #000000;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .printing-lesson-plan-page .post-teaching-section h4,
  .printing-full-document .post-teaching-section h4 {
    margin: 0 0 1mm;
    color: #000000;
    font-size: 15.5pt;
    font-weight: 700;
    line-height: 1.05;
  }

  .printing-lesson-plan-page .post-teaching-ai-text,
  .printing-full-document .post-teaching-ai-text {
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    color: #000000;
    font-size: 15pt;
    line-height: 1.12;
    text-align: justify;
    text-indent: 10mm;
    white-space: normal;
  }

  .printing-lesson-plan-page .post-teaching-lock-note,
  .printing-full-document .post-teaching-lock-note {
    display: none !important;
  }

  .printing-lesson-plan-page .post-teaching-signatures,
  .printing-full-document .post-teaching-signatures {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 150mm;
    gap: 2.2mm 16mm;
    margin: auto auto 0;
    color: #000000;
    font-size: 15pt;
    line-height: 1.02;
    text-align: center;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .printing-lesson-plan-page .post-teaching-signatures div > span,
  .printing-full-document .post-teaching-signatures div > span {
    display: none;
  }

  .printing-lesson-plan-page .post-teaching-signatures p,
  .printing-full-document .post-teaching-signatures p {
    margin: 0.25mm 0;
  }

  .printing-lesson-plan-page .post-teaching-lines,
  .printing-full-document .post-teaching-lines {
    gap: 3mm;
  }

  /* Description */
  .printing-full-document .course-description-print:not(.analysis-print-document) {
    page: course-description;
    width: 100%;
    min-height: 0;
    padding: 0;
    box-sizing: border-box;
    background: #ffffff;
    color: #000000;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 16pt;
    font-weight: 400;
    line-height: 1.18;
    letter-spacing: 0;
  }

  .printing-full-document .course-description-print:not(.analysis-print-document) .course-description-heading {
    margin-bottom: 9mm;
    text-align: center;
  }

  .printing-full-document .course-description-print:not(.analysis-print-document) .course-description-heading p {
    margin: 0 0 1.2mm;
    font-size: 18pt;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0;
  }

  .printing-full-document .course-description-print:not(.analysis-print-document) .course-description-meta {
    margin-bottom: 6mm;
    text-align: center;
  }

  .printing-full-document .course-description-print:not(.analysis-print-document) .course-description-meta p {
    margin: 0 0 1.3mm;
    font-size: 16pt;
    line-height: 1.14;
    letter-spacing: 0;
  }

  .printing-full-document .course-description-print:not(.analysis-print-document) .course-description-section {
    margin: 0 0 4mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .printing-full-document .course-description-print:not(.analysis-print-document) .course-description-section h3 {
    margin: 0 0 1.4mm;
    color: #000000;
    font-size: 16pt;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0;
  }

  .printing-full-document .course-description-print:not(.analysis-print-document) .course-description-section p,
  .printing-full-document .course-description-print:not(.analysis-print-document) .course-description-section li {
    margin: 0;
    font-size: 16pt;
    line-height: 1.22;
    letter-spacing: 0;
  }

  .printing-full-document .course-description-print:not(.analysis-print-document) .course-description-section p {
    text-align: justify;
    text-indent: 14mm;
  }

  .printing-full-document .course-description-print:not(.analysis-print-document) .course-description-section ol {
    margin: 0 0 0 14mm;
    padding: 0;
  }

  .printing-full-document .course-description-print:not(.analysis-print-document) .course-description-section li {
    padding-left: 1mm;
  }

  .printing-full-document .course-description-print:not(.analysis-print-document) .course-description-note {
    margin-top: 8mm;
    padding-top: 4mm;
    border-top: 0.35mm solid #000000;
  }

  .printing-full-document .course-description-print:not(.analysis-print-document) .course-description-note p {
    margin: 0;
    font-size: 14pt;
    line-height: 1.16;
    text-align: center;
    letter-spacing: 0;
  }

  /* Standards */
  .printing-full-document .occupational-standard-print {
    page: occupational-standard;
    width: 100%;
    min-height: 0;
    padding: 0;
    box-sizing: border-box;
    background: #ffffff;
    color: #000000;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 16pt;
    line-height: 1.18;
    letter-spacing: 0;
    --print-table-grid-border: 1px solid #000000;
    break-after: page;
    page-break-after: always;
  }

  .printing-full-document .occupational-standard-print:last-of-type {
    break-after: auto;
    page-break-after: auto;
  }

  .printing-full-document .occupational-standard-heading {
    margin-bottom: 3mm;
    text-align: center;
    break-after: avoid;
    page-break-after: avoid;
  }

  .printing-full-document .occupational-standard-heading h2,
  .printing-full-document .occupational-standard-heading p {
    margin: 0 0 0.4mm;
    color: #000000;
    font-size: 16pt;
    line-height: 1.05;
    letter-spacing: 0;
  }

  .printing-full-document .occupational-standard-heading h2 { font-weight: 700; }
  .printing-full-document .occupational-standard-heading p { font-weight: 400; }

  .printing-full-document .occupational-standard-table {
    width: 100%;
    break-before: avoid;
    page-break-before: avoid;
    border-collapse: collapse;
    border-spacing: 0;
    border: 0;
    table-layout: fixed;
    font-family: inherit;
    font-size: 13pt;
    line-height: 1.03;
    page-break-inside: auto;
  }

  .printing-full-document .occupational-standard-table th,
  .printing-full-document .occupational-standard-table td {
    position: static;
    padding: 0.6mm 0.9mm;
    border: var(--print-table-grid-border);
    background: #ffffff;
    color: #000000;
    font-size: 13pt;
    font-weight: 400;
    line-height: 1.03;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
  }

  .printing-full-document .occupational-standard-table th {
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
    overflow-wrap: normal;
    word-break: keep-all;
  }

  .printing-full-document .occupational-standard-table tr { break-inside: avoid; page-break-inside: avoid; }

  .printing-full-document .occupational-standard-table td p {
    margin: 0 0 0.6mm;
    font-size: 13pt;
    line-height: 1.03;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .printing-full-document .occupational-standard-table td p:last-child { margin-bottom: 0; }
  .printing-full-document .occupational-standard-table .uoc-code { width: 11.6%; text-align: center; }
  .printing-full-document .occupational-standard-table .uoc-name { width: 17.1%; }
  .printing-full-document .occupational-standard-table .eoc-code { width: 11.6%; text-align: center; }
  .printing-full-document .occupational-standard-table .eoc-name { width: 23.5%; }
  .printing-full-document .occupational-standard-table .pc-list { width: 22.9%; }
  .printing-full-document .occupational-standard-table .assessment-list { width: 13.4%; }

  /* Analysis */
  .printing-full-document .analysis-print-document {
    page: analysis-print;
    width: 100%;
    min-height: 0;
    padding: 0;
    box-sizing: border-box;
    background: #ffffff;
    color: #000000;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 14pt;
    line-height: 1.08;
    --print-table-grid-border: 1px solid #000000;
  }

  .printing-full-document .analysis-print-document .course-description-heading {
    margin-bottom: 5mm;
    text-align: center;
  }

  .printing-full-document .analysis-print-document .course-description-heading h2 {
    margin: 0 0 2.5mm;
    font-size: 18pt;
    font-weight: 700;
    line-height: 1.08;
  }

  .printing-full-document .analysis-print-document .course-description-heading p,
  .printing-full-document .analysis-print-document .course-description-meta p {
    margin: 0 0 1.2mm;
    font-size: 14pt;
    line-height: 1.08;
  }

  .printing-full-document .analysis-print-document .course-description-meta {
    margin-bottom: 3mm;
    text-align: center;
  }

  .printing-full-document .analysis-settings-print {
    display: block;
    margin: 0 0 4mm;
    font-size: 14pt;
    line-height: 1.08;
    text-align: center;
  }

  .printing-full-document .analysis-settings-print p {
    margin: 0;
    font-size: 14pt;
    line-height: 1.08;
    white-space: nowrap;
  }

  .printing-full-document .analysis-table-print {
    width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 8mm !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-top: var(--print-table-grid-border) !important;
    border-left: var(--print-table-grid-border) !important;
    table-layout: fixed;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 14pt !important;
  }

  .printing-full-document .analysis-table-print th,
  .printing-full-document .analysis-table-print td {
    border-top: 0 !important;
    border-right: var(--print-table-grid-border) !important;
    border-bottom: var(--print-table-grid-border) !important;
    border-left: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 14pt !important;
    line-height: 1.04 !important;
    padding: 0.9mm 1mm !important;
    word-break: break-word;
  }

  .printing-full-document .analysis-table-print th { font-weight: 700 !important; text-align: center !important; vertical-align: middle !important; }
  .printing-full-document .analysis-table-print td { vertical-align: top !important; }
  .printing-full-document .analysis-table-print .unit-number-col { width: 12%; text-align: center !important; }
  .printing-full-document .analysis-table-print .unit-name-col { width: 66%; }
  .printing-full-document .analysis-table-print .time-group-col { width: 22%; text-align: center !important; }
  .printing-full-document .analysis-table-print .time-col { width: 7.33%; text-align: center !important; }
  .printing-full-document .analysis-table-print tfoot td { font-weight: 700 !important; text-align: center !important; vertical-align: middle !important; }
  .printing-full-document .analysis-table-print .total-label { text-align: center !important; }

  .printing-full-document .analysis-print-note {
    margin-top: 4mm;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 14pt;
    line-height: 1.08;
  }

  .printing-full-document .analysis-print-note p { margin: 0 0 1mm; font-size: 14pt; line-height: 1.08; }

  /* Behavior */
  .printing-full-document .learning-behavior-print-document {
    page: behavior-print;
    width: 100%;
    min-height: auto;
    padding: 0;
    box-sizing: border-box;
    background: #ffffff;
    color: #000000;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 16pt;
    line-height: 1.12;
    --print-table-grid-border: 1px solid #000000;
  }

  .printing-full-document .learning-behavior-print-document .course-description-heading {
    margin-bottom: 8mm;
    text-align: center;
    transform: none;
  }

  .printing-full-document .learning-behavior-print-document .course-description-heading h2 {
    margin: 0 0 4mm;
    font-size: 20pt;
    font-weight: 700;
    line-height: 1.12;
  }

  .printing-full-document .learning-behavior-print-document .course-description-heading p {
    margin: 0 0 2mm;
    font-size: 16pt;
    line-height: 1.12;
  }

  .printing-full-document .learning-behavior-table-print {
    width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 6mm !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-top: var(--print-table-grid-border) !important;
    border-left: var(--print-table-grid-border) !important;
    table-layout: fixed;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    transform: none;
  }

  .printing-full-document .learning-behavior-table-print th,
  .printing-full-document .learning-behavior-table-print td {
    border-top: 0 !important;
    border-right: var(--print-table-grid-border) !important;
    border-bottom: var(--print-table-grid-border) !important;
    border-left: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif !important;
    font-size: 14pt !important;
    line-height: 1.06 !important;
    padding: 0.9mm 1mm !important;
    word-break: break-word;
  }

  .printing-full-document .learning-behavior-table-print th { font-weight: 700 !important; text-align: center !important; vertical-align: middle !important; background: #f3f4f6 !important; }
  .printing-full-document .learning-behavior-table-print td { vertical-align: top !important; }
  .printing-full-document .learning-behavior-table-print .behavior-domain-head { background: #f3f4f6 !important; }
  .printing-full-document .learning-behavior-table-print .behavior-application-head { white-space: normal; overflow-wrap: anywhere; word-break: normal; }
  .printing-full-document .learning-behavior-table-print .behavior-unit-name-col { width: 37%; }
  .printing-full-document .learning-behavior-table-print .behavior-level-col,
  .printing-full-document .learning-behavior-table-print .behavior-code-col { text-align: center !important; vertical-align: middle !important; }
  .printing-full-document .learning-behavior-table-print .behavior-knowledge-col,
  .printing-full-document .learning-behavior-table-print .behavior-skill-col { width: 10%; }
  .printing-full-document .learning-behavior-table-print .behavior-affective-col { width: 8%; }
  .printing-full-document .learning-behavior-table-print .behavior-application-col { width: 11%; }
  .printing-full-document .learning-behavior-table-print .behavior-hours-col { width: 11%; text-align: center !important; vertical-align: middle !important; }
  .printing-full-document .learning-behavior-table-print .behavior-percent-col { width: 13%; text-align: center !important; vertical-align: middle !important; }
  .printing-full-document .learning-behavior-table-print tfoot td { font-weight: 700 !important; text-align: center !important; vertical-align: middle !important; }
  .printing-full-document .learning-behavior-table-print .total-label { text-align: center !important; }

  .printing-full-document .learning-behavior-condition-table {
    width: 100% !important;
    min-width: 0 !important;
    margin-top: 1mm !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-top: var(--print-table-grid-border) !important;
    border-left: var(--print-table-grid-border) !important;
    table-layout: fixed;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    transform: none;
  }

  .printing-full-document .behavior-condition-block {
    break-before: page;
    page-break-before: always;
    break-inside: avoid;
    page-break-inside: avoid;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 14pt;
  }

  .printing-full-document .behavior-condition-heading {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 4mm 0 1mm;
    font-size: 14pt;
    font-weight: 700;
    text-align: right;
    transform: none;
  }

  .printing-full-document .learning-behavior-condition-table th,
  .printing-full-document .learning-behavior-condition-table td {
    border-top: 0 !important;
    border-right: var(--print-table-grid-border) !important;
    border-bottom: var(--print-table-grid-border) !important;
    border-left: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif !important;
    font-size: 14pt !important;
    line-height: 1.08 !important;
    padding: 0.9mm 1.2mm !important;
    vertical-align: top !important;
  }

  .printing-full-document .learning-behavior-condition-table th { font-weight: 700 !important; text-align: center !important; vertical-align: middle !important; }
  .printing-full-document .learning-behavior-condition-table .behavior-condition-title { background: #d9d9d9 !important; }
  .printing-full-document .learning-behavior-condition-table p { margin: 0 0 1mm; font-size: 14pt !important; line-height: 1.08 !important; }

  /* Competency */
  .printing-full-document .competency-link-print-document {
    page: competency-link-print;
    width: 100%;
    min-height: 247mm;
    padding: 0;
    box-sizing: border-box;
    background: #ffffff;
    color: #000000;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 14pt;
    line-height: 1.08;
    --print-table-grid-border: 1.2px solid #000000;
  }

  .printing-full-document .competency-link-print-pages { width: 100%; }

  .printing-full-document .competency-link-print-sheet {
    page: competency-link-print;
    width: 100%;
    min-height: 0;
    height: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: visible;
    break-after: auto;
    page-break-after: auto;
  }

  .printing-full-document .competency-link-print-sheet + .competency-link-print-sheet {
    break-before: page;
    page-break-before: always;
  }

  .printing-full-document .competency-link-print-table-wrap { flex: 0 0 auto; min-height: 0; display: block; }

  .printing-full-document .competency-link-heading { margin-bottom: 4mm; text-align: center; }

  .printing-full-document .competency-link-heading h2 {
    margin: 0 0 2mm;
    color: #000000;
    font-size: 18pt;
    font-weight: 700;
    line-height: 1.08;
  }

  .printing-full-document .competency-link-heading p {
    margin: 0 0 1mm;
    color: #000000;
    font-size: 14pt;
    font-weight: 700;
    line-height: 1.08;
  }

  .printing-full-document .competency-link-table-print {
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-top: var(--print-table-grid-border) !important;
    border-left: var(--print-table-grid-border) !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    table-layout: fixed;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
  }

  .printing-full-document .competency-link-table-print thead { display: table-header-group !important; }
  .printing-full-document .competency-link-table-print tbody { display: table-row-group !important; height: auto; }
  .printing-full-document .competency-link-table-print tr { break-inside: avoid; page-break-inside: avoid; }

  .printing-full-document .competency-link-table-print th,
  .printing-full-document .competency-link-table-print td {
    border: 0 !important;
    border-right: var(--print-table-grid-border) !important;
    border-bottom: var(--print-table-grid-border) !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif !important;
    font-size: 14pt !important;
    line-height: 1.05 !important;
    padding: 0.9mm 1.1mm !important;
    vertical-align: top !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .printing-full-document .competency-link-table-print .competency-print-blank-row td { display: none; height: 8mm; padding: 0 !important; line-height: 1 !important; }
  .printing-full-document .competency-link-table-print .competency-print-blank-row:last-child td { display: none; padding: 0 !important; line-height: 1 !important; }
  .printing-full-document .competency-link-table-print th { font-weight: 700 !important; text-align: center !important; vertical-align: middle !important; }
  .printing-full-document .competency-link-table-print p { margin: 0 0 0.8mm; font-size: 14pt !important; line-height: 1.05 !important; }
  .printing-full-document .competency-link-table-print p:last-child { margin-bottom: 0; }
  .printing-full-document .competency-link-table-print .competency-duty-col { width: 20%; }
  .printing-full-document .competency-link-table-print .competency-duty-col-blank { color: transparent !important; }
  .printing-full-document .competency-link-table-print .competency-task-col { width: 22%; }
  .printing-full-document .competency-link-table-print .competency-standard-col { width: 24%; }
  .printing-full-document .competency-link-table-print .competency-knowledge-col,
  .printing-full-document .competency-link-table-print .competency-skill-col { width: 17%; }

  .printing-full-document .competency-link-print-note {
    margin-top: 2mm;
    color: #000000;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 13pt;
    line-height: 1.08;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .printing-full-document .competency-link-print-note p { margin: 0 0 0.9mm; font-size: 13pt; line-height: 1.08; }

  /* Lesson Plans */
  .printing-full-document .lesson-plan-print-stack { width: 100%; }

  .printing-full-document .lesson-plan-print-document {
    page: lesson-plan-print;
    width: 100%;
    min-height: 0;
    box-sizing: border-box;
    color: #000000;
    background: #ffffff;
    font-family: "TH Sarabun New", "Noto Sans Thai", sans-serif;
    font-size: 16pt;
    line-height: 1.12;
    break-after: page;
    page-break-after: always;
  }

  .printing-full-document .lesson-plan-print-document:last-child { break-after: auto; page-break-after: auto; }
  .printing-full-document .lesson-plan-document-heading { margin-bottom: 7mm; text-align: center; }

  .printing-full-document .lesson-plan-heading-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }

  .printing-full-document .lesson-plan-heading-table td {
    border: 0.2mm solid #000000;
    padding: 1.2mm 1.6mm;
    color: #000000;
    font-size: 14pt;
    line-height: 1.02;
  }

  .printing-full-document .lesson-plan-heading-logo {
    width: 15%;
    text-align: center !important;
  }

  .printing-full-document .lesson-plan-heading-logo img {
    width: 18mm;
    height: 18mm;
  }

  .printing-full-document .lesson-plan-heading-title {
    font-size: 18pt;
    font-weight: 700;
    text-align: center !important;
  }

  .printing-full-document .lesson-plan-heading-side {
    width: 17%;
    white-space: nowrap;
    text-align: left !important;
    vertical-align: top;
  }

  .printing-full-document .lesson-plan-heading-meta,
  .printing-full-document .lesson-plan-heading-topic {
    text-align: left !important;
  }

  .printing-full-document .lesson-plan-heading-meta {
    font-size: 15pt;
    line-height: 1.04;
  }

  .printing-full-document .lesson-plan-document-heading {
    break-after: avoid;
    page-break-after: avoid;
  }

  .printing-full-document .lesson-plan-heading-side div {
    white-space: nowrap;
  }

  .printing-full-document .lesson-plan-heading-hours {
    white-space: normal;
  }

  .printing-full-document .lesson-plan-heading-hours div {
    white-space: normal;
  }

  .printing-full-document .lesson-plan-heading-hours div + div {
    margin-top: 0.8mm;
  }

  .printing-full-document .lesson-plan-topic {
    margin: 0 0 4mm;
    padding: 0;
    border: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .printing-full-document .lesson-plan-topic h4 { margin: 0 0 1.5mm; color: #000000; font-size: 17pt; font-weight: 700; }

  .printing-full-document .lesson-plan-topic ul,
  .printing-full-document .lesson-plan-topic ol { margin: 0 0 0 7mm; padding: 0; }

  .printing-full-document .lesson-plan-topic li { margin: 0 0 0.8mm; color: #000000; font-size: 16pt; line-height: 1.12; }

  .printing-full-document .lesson-plan-topic ol { list-style: none; counter-reset: lesson-item; }
  .printing-full-document .lesson-plan-topic ol li { counter-increment: lesson-item; position: relative; }
  .printing-full-document .lesson-plan-topic ol li::before { content: counter(lesson-item) ". "; }
  .printing-full-document .lesson-plan-topic ol:has(> li:only-child) li { counter-increment: none; }
  .printing-full-document .lesson-plan-topic ol:has(> li:only-child) li::before { content: "- "; }
  .printing-full-document .lesson-plan-topic .lesson-single-item-list { list-style: none; }
  .printing-full-document .lesson-plan-topic .lesson-single-item-list li::before { content: "- "; }

  .printing-full-document .lesson-plan-plain-list p { margin: 0 0 0.8mm; color: #000000; font-size: 16pt; line-height: 1.12; }
  .printing-full-document .lesson-plan-topic--unitCompetencies .lesson-plan-plain-list { padding-left: 12mm; }
  .printing-full-document .lesson-plan-standard-occupations { margin: 0 0 1.2mm; }
  .printing-full-document .lesson-plan-standard-occupations p { margin: 0 0 0.6mm; color: #000000; font-size: 16pt; font-weight: 500; line-height: 1.12; }
  .printing-full-document .lesson-plan-subtopic { margin-left: 0; padding-left: 12mm; }

  .printing-full-document .lesson-plan-narrative {
    margin: 0 0 1mm;
    color: #000000;
    font-size: 16pt;
    line-height: 1.16;
    text-align: justify;
    text-indent: 10mm;
  }

  .printing-full-document .lesson-plan-narrative--limited {
    max-height: calc(1.16em * var(--lesson-line-limit, 8));
    overflow: hidden;
  }

  .printing-full-document .lesson-plan-subtopic h5 { margin: 2mm 0 1mm; color: #000000; font-size: 16pt; font-weight: 700; }

  .printing-full-document .final-exam-print-stack {
    width: 100%;
    break-before: page;
    page-break-before: always;
  }

  .printing-full-document .final-exam-print-document {
    min-height: 0;
    padding: 0;
    font-family: "TH Sarabun New", "Sarabun", "Noto Sans Thai", sans-serif !important;
    font-size: 16pt;
    line-height: 1.18;
  }

  .printing-full-document .final-exam-heading {
    margin: 0 0 4mm;
    padding: 0;
    border-bottom: 0;
    text-align: initial;
    break-after: avoid;
    page-break-after: avoid;
  }

  .printing-full-document .final-exam-summary {
    margin: 0 0 5mm;
    color: #000000;
    font-size: 15pt;
    line-height: 1.08;
    text-align: center;
  }

  .printing-full-document .final-exam-heading h2 {
    margin: 0 0 2mm;
    color: #000000;
    font-size: 24pt;
    font-weight: 700;
    line-height: 1.08;
  }

  .printing-full-document .final-exam-heading p {
    margin: 0 0 0.8mm;
    color: #000000;
    font-size: 16pt;
    line-height: 1.08;
  }

  .printing-full-document .final-exam-document,
  .printing-full-document .final-exam-unit {
    display: block;
    gap: 0;
    margin: 0;
    padding: 0;
  }

  .printing-full-document .final-exam-question {
    margin: 0 0 8mm;
    padding: 0;
    color: #000000;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .printing-full-document .final-exam-question > p {
    margin: 0 0 2mm;
    color: #000000;
    font-size: 17pt;
    font-weight: 700;
    line-height: 1.16;
  }

  .printing-full-document .final-exam-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5mm 10mm;
    margin: 0;
    padding: 0 0 0 8mm;
  }

  .printing-full-document .final-exam-options p {
    margin: 0;
    color: #000000;
    font-size: 16pt;
    line-height: 1.14;
  }

  .printing-full-document .final-exam-answer-key {
    margin: 0;
    padding: 0;
    border-top: 0;
    break-before: page;
    page-break-before: always;
  }

  .printing-full-document .final-exam-answer-key h3 {
    margin: 0 0 5mm;
    color: #000000;
    font-size: 21pt;
    font-weight: 700;
    line-height: 1.12;
    text-align: center;
  }

  .printing-full-document .final-exam-answer-key .table-wrap {
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .printing-full-document .final-exam-answer-key table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13.5pt;
    line-height: 1.06;
  }

  .printing-full-document .final-exam-answer-key th,
  .printing-full-document .final-exam-answer-key td {
    padding: 1.3mm 1.5mm;
    border: 0.2mm solid #000000;
    color: #000000;
    font-size: 13.5pt;
    line-height: 1.06;
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .printing-full-document .final-exam-answer-key th {
    background: #f2f2f2 !important;
    font-weight: 700;
    text-align: center;
  }

  .printing-full-document .final-exam-answer-key th:nth-child(1),
  .printing-full-document .final-exam-answer-key td:nth-child(1) { width: 8%; text-align: center; }
  .printing-full-document .final-exam-answer-key th:nth-child(2),
  .printing-full-document .final-exam-answer-key td:nth-child(2) { width: 8%; text-align: center; }
  .printing-full-document .final-exam-answer-key th:nth-child(3),
  .printing-full-document .final-exam-answer-key td:nth-child(3) { width: 35%; }
  .printing-full-document .final-exam-answer-key th:nth-child(4),
  .printing-full-document .final-exam-answer-key td:nth-child(4) { width: 14%; text-align: center; }
  .printing-full-document .final-exam-answer-key th:nth-child(5),
  .printing-full-document .final-exam-answer-key td:nth-child(5) { width: 35%; }
}

/* Home */
.home-page {
  min-height: 100vh;
  background:
    linear-gradient(rgba(126, 151, 196, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 151, 196, 0.12) 1px, transparent 1px),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.92), rgba(243, 247, 255, 0.72) 42%, rgba(233, 242, 252, 0.96) 100%),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto;
}

.home-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 12px 48px;
  background: linear-gradient(135deg, rgba(8, 47, 40, 0.96), rgba(13, 92, 73, 0.92) 68%, rgba(10, 66, 56, 0.96));
  color: #ffffff;
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 36px rgba(8, 47, 40, 0.22);
}

.home-brand,
.home-nav,
.home-nav-link,
.home-nav-icon {
  display: flex;
  align-items: center;
}

.home-brand {
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.home-brand img {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.home-brand span {
  display: grid;
  min-width: 0;
}

.home-brand strong {
  overflow: hidden;
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-brand small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-nav {
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.home-nav-link,
.home-nav-icon {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.home-nav-link {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.08);
}

.home-nav-link.primary {
  border-color: var(--theme-action);
  background: linear-gradient(135deg, #e4ffb7, var(--theme-action));
  color: var(--theme-action-text);
}

.home-nav-icon {
  justify-content: center;
  width: 40px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
}

.home-nav-link:hover,
.home-nav-link:focus-visible,
.home-nav-icon:hover,
.home-nav-icon:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.46);
  box-shadow: 0 10px 20px rgba(5, 15, 35, 0.18);
}

.home-nav-icon svg,
.home-search svg,
.home-result-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.home-shell {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.home-hero {
  display: block;
  padding: 12px 0 0;
}

.home-hero-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(169, 185, 214, 0.62);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 70px rgba(39, 55, 93, 0.12);
}

.home-hero-panel {
  display: grid;
  align-content: start;
  gap: 20px;
  min-height: 358px;
  padding: 34px 32px 86px;
  background:
    linear-gradient(90deg, rgba(3, 39, 28, 0.86) 0%, rgba(6, 95, 70, 0.72) 34%, rgba(8, 117, 89, 0.4) 62%, rgba(6, 95, 70, 0.22) 100%),
    radial-gradient(circle at top left, rgba(6, 95, 70, 0.36), transparent 24%),
    url("home-hero-ai-bg.png");
  background-position: center, top left, center;
  background-size: auto, auto, cover;
  background-repeat: no-repeat, no-repeat, no-repeat;
  box-shadow: 0 28px 70px rgba(15, 118, 110, 0.2);
}

.home-hero-copy {
  max-width: 760px;
}

.home-eyebrow {
  margin: 0 0 6px;
  color: #d8ff5f;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-hero-panel .home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #f3ffab;
}

.home-hero-panel .home-eyebrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #c7f464;
  box-shadow: 0 0 0 6px rgba(199, 244, 100, 0.14);
}

.home-hero h1 {
  margin: 0;
  max-width: 12.8em;
  color: #ffffff;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.04;
  letter-spacing: 0;
}

.home-hero p:not(.home-eyebrow) {
  max-width: 640px;
  margin: 12px 0 0;
  color: rgba(243, 248, 255, 0.88);
  font-size: 17px;
  font-weight: 700;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.home-hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid #ccd7ea;
  border-radius: 999px;
  background: #ffffff;
  color: #15213b;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(45, 62, 95, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-hero-link.primary {
  border-color: #ffffff;
  background: #ffffff;
  color: #0f7a5c;
}

.home-hero-link:hover,
.home-hero-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 30px rgba(45, 62, 95, 0.12);
}

.home-search-band {
  position: relative;
  z-index: 2;
  margin-top: -48px;
  padding: 0 0 8px;
}

.home-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 78px;
  padding: 12px;
  border: 1px solid #cfe2ef;
  border-radius: 20px;
  background: rgba(245, 253, 249, 0.94);
  box-shadow: 0 18px 42px rgba(39, 52, 73, 0.1);
}

.home-search-dock {
  backdrop-filter: blur(10px);
}

.home-search-field,
.home-search-select-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  border: 1px solid #cfe0eb;
  border-radius: 14px;
  background: #ffffff;
}

.home-search-field {
  gap: 10px;
  padding: 0 16px;
}

.home-search-select-wrap {
  padding: 0 14px;
}

.home-search svg {
  flex: 0 0 auto;
  color: #6b7f92;
}

.home-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #1d2430;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
}

.home-search-select-wrap select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1d2430;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
}

.home-search input::placeholder {
  color: #8b95a5;
}

.home-search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 26px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f766e, #1ea896);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.home-section {
  margin-top: 24px;
}

.home-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.home-section-head h2 {
  margin: 0;
  color: #15213b;
  font-size: 30px;
  line-height: 1.2;
}

.home-section-lead {
  margin: 8px 0 0;
  max-width: 720px;
  color: #64748b;
  font-size: 15px;
  font-weight: 700;
}

.home-count {
  flex: 0 0 auto;
  color: #0f766e;
  font-weight: 900;
}

.home-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

.home-plan-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(202, 214, 233, 0.92);
  border-radius: 28px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 18px 42px rgba(33, 43, 61, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-plan-card:hover,
.home-plan-card:focus-visible {
  border-color: #87a6d8;
  box-shadow: 0 24px 48px rgba(33, 43, 61, 0.14);
  transform: translateY(-4px);
}

.home-plan-cover {
  aspect-ratio: 16 / 10;
  background: #edf2f7;
}

.home-plan-cover > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-cover-fallback {
  display: grid;
  place-items: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(32, 104, 247, 0.18), rgba(16, 185, 129, 0.18)),
    linear-gradient(180deg, #f8fbff, #ffffff);
  color: #12343b;
  text-align: center;
}

.home-cover-fallback img {
  width: 64px;
  height: 64px;
}

.home-plan-body {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 14px 16px 16px;
}

.home-plan-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-plan-tag,
.home-plan-level {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.home-plan-tag {
  background: #e8fff5;
  color: #0f766e;
}

.home-plan-level {
  background: #eef4ff;
  color: #1d4ed8;
}

.home-plan-body h3 {
  display: -webkit-box;
  min-height: 2.9em;
  margin: 0;
  overflow: hidden;
  color: #17223b;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-plan-body p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.home-plan-teacher,
.home-plan-college {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.home-plan-teacher {
  color: #334155;
  -webkit-line-clamp: 1;
}

.home-plan-college {
  min-height: 2.8em;
  -webkit-line-clamp: 2;
}

.home-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  padding-top: 10px;
  border-top: 1px solid #edf2f7;
}

.home-card-foot strong {
  flex: 0 0 auto;
  color: #0f766e;
}

.home-result-list {
  display: grid;
  gap: 12px;
}

.home-result-item {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 14px 16px;
  border: 1px solid rgba(202, 214, 233, 0.92);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(39, 52, 73, 0.06);
}

.home-result-type {
  width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8fff5;
  color: #0f766e;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.home-result-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.home-result-main strong,
.home-result-main small,
.home-result-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-result-main strong {
  color: #17223b;
  font-size: 16px;
}

.home-result-main small,
.home-result-main span {
  color: #657084;
  font-size: 13px;
  font-weight: 700;
}

.home-result-item svg {
  color: #0f766e;
}

.home-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  color: #657084;
  font-weight: 800;
  text-align: center;
}

.home-loading .home-plan-grid,
.home-loading .home-result-list {
  opacity: 0.62;
}

.theme-switcher {
  display: inline-grid;
  grid-template-columns: auto minmax(118px, auto);
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.theme-switcher select {
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--theme-accent-strong);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.theme-settings-form {
  margin-top: 10px;
}

.theme-settings-form .admin-modal-actions {
  grid-column: 1 / -1;
}

body[data-theme] .home-topbar {
  background: var(--theme-header);
}

body[data-theme] .app-logo,
body[data-theme] .loading-logo,
body[data-theme] .detail-open-logo,
body[data-theme] .lesson-cover-logo,
body[data-theme] .home-brand img,
body[data-theme] .home-cover-fallback img {
  filter: var(--theme-logo-filter) drop-shadow(0 8px 16px var(--theme-shadow));
}

body[data-theme].login-page {
  background:
    radial-gradient(circle at 20% 10%, var(--theme-bg-glow), transparent 32%),
    linear-gradient(135deg, var(--theme-bg-soft), var(--theme-bg) 58%, #ffffff 58%);
}

body[data-theme].home-page {
  background:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(180deg, var(--theme-bg-soft) 0, var(--theme-bg) 300px),
    var(--theme-bg);
  background-size: 28px 28px, 28px 28px, auto;
}

body[data-theme].admin-page {
  background:
    linear-gradient(135deg, var(--theme-bg-glow), transparent 34%),
    linear-gradient(315deg, rgba(255, 255, 255, 0.72), transparent 32%),
    var(--theme-bg);
}

body[data-theme].lesson-reader-page {
  background: var(--theme-bg);
}

body[data-theme] .home-cover-fallback {
  background:
    linear-gradient(135deg, var(--theme-bg-glow), rgba(255, 255, 255, 0.62)),
    var(--theme-bg);
  color: var(--theme-accent-strong);
}

body[data-theme] .home-hero-panel {
  border-color: color-mix(in srgb, var(--theme-accent) 22%, #d9e4f0);
}

body[data-theme] .home-plan-card,
body[data-theme] .home-result-item,
body[data-theme] .home-empty {
  border-color: color-mix(in srgb, var(--theme-accent) 22%, #d9e4f0);
  background: color-mix(in srgb, #ffffff 88%, var(--theme-bg-soft));
}

body[data-theme] .home-nav-link.primary,
body[data-theme] .stats-link.home-link,
body[data-theme] .page-home-tab {
  background: var(--theme-action);
  border-color: var(--theme-action);
  color: var(--theme-action-text);
}

body[data-theme] .stats-link,
body[data-theme] .login-back.icon-only,
body[data-theme] .icon-button:not(.danger),
body[data-theme] .detail-open.icon-only:not(.print-button),
body[data-theme] .member-plan-actions .detail-open,
body[data-theme] .lesson-plan-edit-button {
  border-color: var(--theme-accent);
  background: var(--theme-accent-soft);
  color: var(--theme-accent-strong);
  box-shadow: 0 8px 18px var(--theme-shadow);
}

body[data-theme] .stats-link:hover,
body[data-theme] .stats-link:focus-visible,
body[data-theme] .login-back.icon-only:hover,
body[data-theme] .login-back.icon-only:focus-visible,
body[data-theme] .icon-button:not(.danger):hover,
body[data-theme] .icon-button:not(.danger):focus-visible,
body[data-theme] .detail-open.icon-only:not(.print-button):hover,
body[data-theme] .detail-open.icon-only:not(.print-button):focus-visible,
body[data-theme] .member-plan-actions .detail-open:hover,
body[data-theme] .member-plan-actions .detail-open:focus-visible,
body[data-theme] .lesson-plan-edit-button:hover,
body[data-theme] .lesson-plan-edit-button:focus-visible {
  border-color: var(--theme-accent);
  background: var(--theme-accent);
  color: var(--theme-contrast);
  box-shadow: 0 12px 24px var(--theme-shadow);
}

body[data-theme] .home-search button,
body[data-theme] .login-form button,
body[data-theme] .primary-action,
body[data-theme] .admin-nav.active,
body[data-theme] .tab.active,
body[data-theme] .detail-open:not(.icon-only),
body[data-theme] .ai-submit-button,
body[data-theme] .lesson-bulk-analyze-button {
  background: var(--theme-accent);
  border-color: var(--theme-accent);
  color: var(--theme-contrast);
  box-shadow: 0 10px 22px var(--theme-shadow);
}

body[data-theme] .home-eyebrow,
body[data-theme] .home-count,
body[data-theme] .home-card-foot strong,
body[data-theme] .home-result-type,
body[data-theme] .home-result-item svg,
body[data-theme] .admin-nav-icon,
body[data-theme] .admin-meter-head b,
body[data-theme] .member-plan-foot b,
body[data-theme] .detail-open,
body[data-theme] .login-back,
body[data-theme] .form-link {
  color: var(--theme-accent);
}

body[data-theme] .home-result-type {
  background: var(--theme-accent-soft);
}

body[data-theme] .home-plan-tag {
  background: color-mix(in srgb, var(--theme-accent-soft) 90%, #ffffff);
  color: var(--theme-accent-strong);
}

body[data-theme] .home-plan-level {
  background: color-mix(in srgb, var(--theme-action) 16%, #ffffff);
  color: var(--theme-action);
}

body[data-theme] .home-plan-card:hover,
body[data-theme] .home-plan-card:focus-visible,
body[data-theme] .tab.active,
body[data-theme] .detail-open,
body[data-theme] .admin-nav.active {
  border-color: var(--theme-accent);
}

body[data-theme] .page-tab.completed,
body[data-theme] .page-tabs::after {
  border-color: var(--theme-accent);
  background: var(--theme-accent);
}

body[data-theme] .page-tab {
  border-color: var(--theme-accent-soft);
  background: #ffffff;
  color: var(--theme-accent-strong);
}

body[data-theme] .page-tab.active,
body[data-theme] .page-tab.completed {
  color: var(--theme-contrast);
}

body[data-theme] .page-tab.completed .page-tab-step,
body[data-theme] .page-tab.active .page-tab-step {
  background: var(--theme-action);
  color: var(--theme-action-text);
}

body[data-theme] .detail-head-actions .detail-open:not(.icon-only) {
  border-color: var(--theme-accent);
  background: var(--theme-accent);
  color: var(--theme-contrast);
}

body[data-theme] #createWordButton,
body[data-theme] #saveCoursePlanButton,
body[data-theme] #createPdfButton {
  border-color: var(--theme-accent);
  background: var(--theme-accent);
  color: var(--theme-contrast);
}

body[data-theme] .detail-head-actions .detail-open:not(.icon-only):hover,
body[data-theme] .detail-head-actions .detail-open:not(.icon-only):focus-visible {
  border-color: var(--theme-accent-strong);
  background: var(--theme-accent-strong);
  color: var(--theme-contrast);
}

body[data-theme] #createWordButton:hover,
body[data-theme] #createWordButton:focus-visible,
body[data-theme] #saveCoursePlanButton:hover,
body[data-theme] #saveCoursePlanButton:focus-visible,
body[data-theme] #createPdfButton:hover,
body[data-theme] #createPdfButton:focus-visible {
  border-color: var(--theme-accent-strong);
  background: var(--theme-accent-strong);
  color: var(--theme-contrast);
}

body[data-theme] .admin-meter-track span,
body[data-theme] .member-plan-progress span,
body[data-theme] .admin-plan-progress span {
  background: var(--theme-accent);
}

.lesson-reader-page {
  min-height: 100vh;
  background: #eef2f6;
}

.lesson-reader-print {
  font: inherit;
  cursor: pointer;
}

.lesson-reader-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.lesson-reader-document {
  display: grid;
  gap: 18px;
}

.lesson-reader-sheet {
  overflow: hidden;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(30, 42, 62, 0.12);
}

.lesson-reader-cover {
  aspect-ratio: 0.707 / 1;
  max-height: 1120px;
  background: #ffffff;
}

.lesson-reader-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lesson-reader-meta,
.lesson-reader-section {
  padding: 24px 30px;
}

.lesson-reader-meta {
  border-top: 1px solid #e2e8f0;
}

.lesson-reader-meta h1 {
  margin: 0 0 16px;
  color: #111827;
  font-size: 30px;
  line-height: 1.24;
}

.lesson-reader-meta dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.lesson-reader-meta div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.lesson-reader-meta dt {
  color: #657084;
  font-size: 12px;
  font-weight: 900;
}

.lesson-reader-meta dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  color: #172033;
  font-weight: 800;
}

.lesson-reader-section {
  border-top: 1px solid #e2e8f0;
}

.lesson-reader-section h2 {
  margin: 0 0 12px;
  color: #12343b;
  font-size: 22px;
}

.lesson-reader-section ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 24px;
}

.lesson-reader-section li {
  color: #1f2937;
  font-weight: 700;
}

.lesson-reader-section li span,
.lesson-reader-section li p {
  display: block;
  margin: 3px 0 0;
  color: #657084;
  font-size: 14px;
  font-weight: 700;
}

@media print {
  .lesson-reader-page {
    background: #ffffff !important;
  }

  .lesson-reader-topbar {
    display: none !important;
  }

  .lesson-reader-shell {
    width: 100%;
    padding: 0;
  }

  .lesson-reader-sheet {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .lesson-reader-cover {
    page: lesson-cover;
    width: 100%;
    height: 297mm;
    max-height: none;
    page-break-after: always;
    break-after: page;
  }

  .lesson-reader-meta,
  .lesson-reader-section {
    padding: 18mm 20mm;
    border-top: 0;
    page-break-inside: avoid;
    break-inside: avoid;
  }
}

@media (max-width: 840px) {
  .home-topbar {
    position: static;
    flex-wrap: wrap;
    padding: 12px 18px;
  }

  .home-brand {
    width: 100%;
  }

  .home-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .home-shell {
    width: min(100% - 28px, 1240px);
    padding-top: 18px;
  }

  .home-hero-panel {
    min-height: 0;
    padding: 26px 20px 74px;
  }

  .home-hero h1 {
    font-size: 34px;
  }

  .home-search-band {
    margin-top: -36px;
  }

  .home-search {
    grid-template-columns: 1fr;
    border-radius: 20px;
  }

  .home-search-field,
  .home-search-select-wrap {
    width: 100%;
  }

  .home-search-submit {
    width: 100%;
  }

  .home-result-item {
    grid-template-columns: 1fr auto;
  }

  .home-result-type {
    grid-column: 1 / -1;
    width: fit-content;
  }
}

@media screen {
  body:not(.printing-full-document),
  body:not(.printing-full-document) button,
  body:not(.printing-full-document) input,
  body:not(.printing-full-document) select,
  body:not(.printing-full-document) textarea {
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  body:not(.printing-full-document) :is(
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    strong,
    b,
    th,
    label,
    .app-name,
    .section-title,
    .panel-title,
    .detail-title,
    .detail-open,
    .stats-link,
    .page-tab,
    .page-tab-step,
    .member-identity,
    .member-name,
    .auth-divider,
    .login-form button,
    .tab-button,
    .course-tab,
    .metric-label,
    .stat-label,
    .home-brand strong,
    .home-brand small,
    .home-nav-link,
    .home-eyebrow,
    .home-hero h1,
    .home-hero p,
    .home-search button,
    .home-shortcuts a,
    .home-section-head h2,
    .home-count,
    .home-plan-body h3,
    .home-plan-body p,
    .home-card-foot,
    .home-result-type,
    .home-result-main strong,
    .home-result-main small,
    .home-result-main span,
    .home-empty,
    .ai-submit-button,
    .lesson-bulk-analyze-button,
    .cover-ai-button,
    .final-exam-generate-button
  ) {
    font-weight: 500 !important;
  }

  body:not(.printing-full-document) :is(
    .stat-number,
    .metric-value,
    .progress-count,
    .ai-count-orb,
    .final-exam-count,
    .lesson-bulk-analyze-button span
  ) {
    font-weight: 600 !important;
  }

  body:not(.printing-full-document) :is(
    .app-name,
    .home-hero h1,
    .home-section-head h2,
    .home-plan-body h3,
    .panel-head h2,
    .detail-content h3,
    .table-panel th,
    .stats article span
  ) {
    font-weight: 600 !important;
  }
}

@media print {
  body,
  body *,
  * {
    font-family: "TH Sarabun New", "Sarabun", "Noto Sans Thai", sans-serif !important;
  }
}

.worksheet-step-table th,
.worksheet-step-table td,
.worksheet-evaluation-table th,
.worksheet-evaluation-table td {
  vertical-align: top;
}

.worksheet-step-table td p,
.worksheet-evaluation-table td p {
  margin: 0 0 4px;
}

.worksheet-evaluation-table-block + .worksheet-evaluation-table-block {
  margin-top: 18px;
}

.worksheet-topic h5 {
  margin-bottom: 8px;
}
