/* ═══════════════════════════════════════════════
   Notes Generator — Lesson Plans & Study Notes
   Premium SaaS · ng-* namespace
   ═══════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
.ng-wrap {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --ng-primary: #6366f1;
  --ng-primary-hover: #4f46e5;
  --ng-primary-soft: rgba(99,102,241,0.08);
  --ng-primary-glow: rgba(99,102,241,0.15);
  --ng-success: #22c55e;
  --ng-success-bg: rgba(34,197,94,0.06);
  --ng-success-border: rgba(34,197,94,0.2);
  --ng-warning: #f59e0b;
  --ng-danger: #ef4444;
  --ng-bg: #f8fafc;
  --ng-card: #ffffff;
  --ng-border: #e5e7eb;
  --ng-border-focus: #c7d2fe;
  --ng-text: #0f172a;
  --ng-text-2: #475569;
  --ng-text-3: #94a3b8;
  --ng-r: 14px;
  --ng-r-sm: 10px;
  --ng-r-xs: 6px;
  --ng-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 18px rgba(0,0,0,0.04);
  --ng-shadow-lg: 0 4px 24px rgba(0,0,0,0.08);
  --ng-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ng-ease: cubic-bezier(0.4,0,0.2,1);
  --ng-chat-w: 380px;

  font-family: var(--ng-font);
  color: var(--ng-text);
  max-width: 100%;
  min-height: 80vh;
}

*, *::before, *::after { box-sizing: border-box; }

/* ─── Utilities ─── */
.ng-hidden { display: none !important; }
.ng-required { color: var(--ng-danger); }

/* ─── Screen Container ─── */
.ng-screen { animation: ngFadeIn 0.35s var(--ng-ease); }
@keyframes ngFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Hero Section ─── */
.ng-hero {
  text-align: center;
  padding: 48px 24px 32px;
}
.ng-hero-icon {
  width: 48px; height: 48px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--ng-primary), #8b5cf6);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.ng-hero-icon svg { width: 24px; height: 24px; }
.ng-hero-title {
  font-size: 28px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--ng-text); margin: 0 0 10px;
}
.ng-hero-subtitle {
  font-size: 15px; color: var(--ng-text-2); max-width: 560px; margin: 0 auto; line-height: 1.6;
}

/* ─── Mode Grid (Welcome) ─── */
.ng-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px 32px;
}
.ng-card {
  background: var(--ng-card);
  border: 1px solid var(--ng-border);
  border-radius: var(--ng-r);
  padding: 28px 24px;
  transition: all 200ms var(--ng-ease);
}
.ng-card-hover:hover {
  border-color: var(--ng-border-focus);
  box-shadow: var(--ng-shadow);
  transform: translateY(-2px);
}
.ng-mode-card { cursor: pointer; text-align: left; }
.ng-mode-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.ng-mode-icon svg { width: 20px; height: 20px; }
.ng-mode-title { font-size: 17px; font-weight: 700; margin: 0 0 8px; }
.ng-mode-desc { font-size: 13px; color: var(--ng-text-2); line-height: 1.6; margin: 0 0 14px; }
.ng-mode-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ng-tag {
  font-size: 11px; font-weight: 600; color: var(--ng-text-3);
  background: var(--ng-bg); padding: 3px 8px; border-radius: 4px;
}

/* ─── Topbar ─── */
.ng-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  background: var(--ng-card);
  border-bottom: 1px solid var(--ng-border);
  position: sticky; top: 0; z-index: 100;
}
.ng-topbar-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: none; border: 1px solid var(--ng-border);
  border-radius: var(--ng-r-sm);
  font-size: 13px; font-weight: 500; color: var(--ng-text-2);
  cursor: pointer; transition: all 150ms var(--ng-ease);
  font-family: var(--ng-font);
}
.ng-topbar-btn:hover { background: var(--ng-bg); border-color: var(--ng-border-focus); color: var(--ng-text); }
.ng-topbar-btn svg { width: 14px; height: 14px; }
.ng-topbar-title { font-size: 14px; font-weight: 600; color: var(--ng-text); }
.ng-topbar-actions { display: flex; gap: 8px; }

/* ─── Form Container ─── */
.ng-form-container {
  display: flex; justify-content: center; padding: 32px 24px;
}
.ng-form-card {
  background: var(--ng-card);
  border: 1px solid var(--ng-border);
  border-radius: var(--ng-r);
  box-shadow: var(--ng-shadow);
  padding: 36px 32px;
  width: 100%; max-width: 640px;
}
.ng-form-title { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.ng-form-subtitle { font-size: 14px; color: var(--ng-text-2); margin: 0 0 28px; }

/* ─── Form Fields ─── */
.ng-field { margin-bottom: 20px; }
.ng-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ng-label { display: block; font-size: 13px; font-weight: 600; color: var(--ng-text); margin-bottom: 6px; }
.ng-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--ng-border);
  border-radius: var(--ng-r-sm);
  font-size: 14px;
  font-family: var(--ng-font);
  color: var(--ng-text);
  background: var(--ng-card);
  transition: border-color 150ms var(--ng-ease), box-shadow 150ms var(--ng-ease);
  outline: none;
}
.ng-input:focus { border-color: var(--ng-primary); box-shadow: 0 0 0 3px var(--ng-primary-glow); }
.ng-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.ng-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ─── Note Type Grid ─── */
.ng-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ng-type-option input { display: none; }
.ng-type-card {
  padding: 14px 16px;
  border: 2px solid var(--ng-border);
  border-radius: var(--ng-r-sm);
  cursor: pointer;
  transition: all 150ms var(--ng-ease);
}
.ng-type-card:hover { border-color: var(--ng-border-focus); }
.ng-type-option input:checked + .ng-type-card {
  border-color: var(--ng-primary);
  background: var(--ng-primary-soft);
}
.ng-type-name { font-size: 13px; font-weight: 700; color: var(--ng-text); margin-bottom: 4px; }
.ng-type-desc { font-size: 11px; color: var(--ng-text-2); line-height: 1.4; }

/* ─── Buttons ─── */
.ng-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  border: none; border-radius: var(--ng-r-sm);
  font-size: 14px; font-weight: 600;
  font-family: var(--ng-font);
  cursor: pointer; transition: all 200ms var(--ng-ease);
  white-space: nowrap;
}
.ng-btn svg { flex-shrink: 0; }
.ng-btn-primary {
  background: var(--ng-primary); color: #fff;
}
.ng-btn-primary:hover { background: var(--ng-primary-hover); box-shadow: 0 2px 12px rgba(99,102,241,0.3); }
.ng-btn-outline {
  background: none; border: 1px solid var(--ng-border); color: var(--ng-text-2);
}
.ng-btn-outline:hover { background: var(--ng-bg); border-color: var(--ng-border-focus); color: var(--ng-text); }
.ng-btn-ghost {
  background: none; color: var(--ng-text-2); padding: 8px 14px;
}
.ng-btn-ghost:hover { background: var(--ng-bg); color: var(--ng-text); }
.ng-btn-sm { padding: 7px 14px; font-size: 13px; }
.ng-btn-lg { padding: 12px 28px; font-size: 15px; }
.ng-btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.ng-full-width { width: 100%; }

/* ─── Spinner ─── */
.ng-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ngSpin 0.6s linear infinite;
}
@keyframes ngSpin { to { transform: rotate(360deg); } }

/* ─── Result Layout ─── */
.ng-result-layout {
  display: flex;
  height: calc(100vh - 50px);
  overflow: hidden;
}
.ng-result-content {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column;
}
.ng-result-meta {
  padding: 16px 28px;
  border-bottom: 1px solid var(--ng-border);
  background: var(--ng-card);
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.ng-meta-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--ng-primary-soft);
  color: var(--ng-primary);
}
.ng-meta-tag-success {
  background: var(--ng-success-bg);
  color: var(--ng-success);
}
.ng-meta-tag-warning {
  background: rgba(245,158,11,0.08);
  color: var(--ng-warning);
}
.ng-result-body {
  flex: 1;
  padding: 28px;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ng-text);
}
.ng-result-body h1 { font-size: 24px; font-weight: 800; margin: 0 0 16px; color: var(--ng-text); }
.ng-result-body h2 { font-size: 20px; font-weight: 700; margin: 28px 0 12px; color: var(--ng-text); padding-bottom: 8px; border-bottom: 1px solid var(--ng-border); }
.ng-result-body h3 { font-size: 16px; font-weight: 600; margin: 20px 0 10px; color: var(--ng-text); }
.ng-result-body p { margin: 0 0 14px; }
.ng-result-body ul, .ng-result-body ol { margin: 0 0 14px; padding-left: 24px; }
.ng-result-body li { margin-bottom: 4px; }
.ng-result-body table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13px; }
.ng-result-body th, .ng-result-body td { border: 1px solid var(--ng-border); padding: 8px 12px; text-align: left; }
.ng-result-body th { background: var(--ng-bg); font-weight: 600; }
.ng-result-body strong { font-weight: 700; }
.ng-result-body em { font-style: italic; }
.ng-result-body blockquote {
  border-left: 3px solid var(--ng-primary);
  padding: 8px 16px;
  margin: 12px 0;
  background: var(--ng-primary-soft);
  border-radius: 0 var(--ng-r-xs) var(--ng-r-xs) 0;
  font-style: italic;
  color: var(--ng-text-2);
}

/* ─── Chat Panel ─── */
.ng-chat-panel {
  width: var(--ng-chat-w);
  min-width: var(--ng-chat-w);
  background: var(--ng-card);
  border-left: 1px solid var(--ng-border);
  display: flex; flex-direction: column;
}
.ng-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ng-border);
}
.ng-chat-header-info { display: flex; align-items: center; gap: 12px; }
.ng-chat-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ng-primary), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.ng-chat-name { font-size: 14px; font-weight: 700; }
.ng-chat-status { font-size: 11px; color: var(--ng-text-3); }
.ng-chat-close {
  background: none; border: none; cursor: pointer;
  color: var(--ng-text-3); padding: 4px; border-radius: 6px;
  transition: all 150ms var(--ng-ease);
}
.ng-chat-close:hover { background: var(--ng-bg); color: var(--ng-text); }

.ng-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.ng-chat-welcome {
  text-align: center; padding: 32px 16px;
}
.ng-chat-welcome-icon {
  width: 44px; height: 44px; margin: 0 auto 10px;
  border-radius: 12px;
  background: var(--ng-primary-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--ng-primary);
}
.ng-chat-welcome h4 { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.ng-chat-welcome p { font-size: 13px; color: var(--ng-text-2); margin: 0 0 16px; line-height: 1.5; }
.ng-chat-suggestions { display: flex; flex-direction: column; gap: 6px; }
.ng-chat-suggestion {
  display: block; width: 100%;
  padding: 10px 14px;
  background: var(--ng-bg);
  border: 1px solid var(--ng-border);
  border-radius: var(--ng-r-sm);
  font-size: 12px; color: var(--ng-text-2);
  cursor: pointer; text-align: left;
  font-family: var(--ng-font);
  transition: all 150ms var(--ng-ease);
}
.ng-chat-suggestion:hover { border-color: var(--ng-primary); color: var(--ng-primary); background: var(--ng-primary-soft); }

.ng-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px; line-height: 1.6;
  word-wrap: break-word;
}
.ng-chat-msg-user {
  align-self: flex-end;
  background: var(--ng-primary); color: #fff;
  border-bottom-right-radius: 4px;
}
.ng-chat-msg-assistant {
  align-self: flex-start;
  background: var(--ng-bg); border: 1px solid var(--ng-border);
  border-bottom-left-radius: 4px;
}
.ng-chat-msg-assistant p { margin: 0 0 8px; }
.ng-chat-msg-assistant p:last-child { margin-bottom: 0; }
.ng-chat-msg-assistant strong { font-weight: 700; }
.ng-chat-msg-assistant ul, .ng-chat-msg-assistant ol { margin: 4px 0 8px; padding-left: 18px; }

.ng-chat-typing {
  align-self: flex-start;
  display: flex; gap: 4px; padding: 12px 16px;
  background: var(--ng-bg); border: 1px solid var(--ng-border);
  border-radius: 14px; border-bottom-left-radius: 4px;
}
.ng-chat-typing-dot {
  width: 6px; height: 6px;
  background: var(--ng-text-3);
  border-radius: 50%;
  animation: ngBounce 1.4s infinite;
}
.ng-chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ng-chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes ngBounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }

.ng-chat-input-area {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--ng-border);
}
.ng-chat-input-wrap {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--ng-bg);
  border: 1px solid var(--ng-border);
  border-radius: 12px;
  padding: 4px 4px 4px 14px;
  transition: border-color 150ms var(--ng-ease);
}
.ng-chat-input-wrap:focus-within { border-color: var(--ng-primary); }
.ng-chat-input {
  flex: 1;
  border: none; background: none; outline: none;
  font-size: 13px; font-family: var(--ng-font);
  resize: none; max-height: 100px;
  padding: 8px 0;
  color: var(--ng-text);
}
.ng-chat-send {
  width: 34px; height: 34px; flex-shrink: 0;
  border: none; border-radius: 8px;
  background: var(--ng-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 150ms var(--ng-ease);
}
.ng-chat-send:hover { background: var(--ng-primary-hover); }

/* ─── Saved Items ─── */
.ng-saved-container { padding: 24px; max-width: 1000px; margin: 0 auto; }
.ng-saved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.ng-saved-card {
  background: var(--ng-card);
  border: 1px solid var(--ng-border);
  border-radius: var(--ng-r);
  padding: 20px;
  transition: all 200ms var(--ng-ease);
  position: relative;
}
.ng-saved-card:hover { border-color: var(--ng-border-focus); box-shadow: var(--ng-shadow); }
.ng-saved-type {
  display: inline-block;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 10px;
}
.ng-saved-type-lesson { background: var(--ng-primary-soft); color: var(--ng-primary); }
.ng-saved-type-note { background: var(--ng-success-bg); color: var(--ng-success); }
.ng-saved-card-title { font-size: 15px; font-weight: 700; margin: 0 0 6px; color: var(--ng-text); }
.ng-saved-card-meta { font-size: 12px; color: var(--ng-text-3); margin-bottom: 12px; }
.ng-saved-card-actions { display: flex; gap: 8px; }
.ng-saved-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--ng-text-3);
}
.ng-saved-empty h3 { font-size: 16px; font-weight: 600; color: var(--ng-text-2); margin: 0 0 6px; }
.ng-saved-empty p { font-size: 13px; margin: 0; }

/* ─── Toast ─── */
.ng-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  background: var(--ng-text); color: #fff;
  border-radius: var(--ng-r-sm);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--ng-shadow-lg);
  opacity: 0; pointer-events: none;
  transition: all 300ms var(--ng-ease);
  z-index: 10000;
}
.ng-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.ng-toast-success { background: #16a34a; }
.ng-toast-error { background: #dc2626; }

/* ─── Loading skeleton ─── */
.ng-skeleton {
  background: linear-gradient(90deg, var(--ng-bg) 25%, #e5e7eb 50%, var(--ng-bg) 75%);
  background-size: 200% 100%;
  animation: ngShimmer 1.5s infinite;
  border-radius: var(--ng-r-sm);
}
@keyframes ngShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── Exam: Question Type Checkboxes ─── */
.ng-check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.ng-check-option input {
  display: none;
  position: absolute;
}
.ng-check-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 16px;
  border: 2px solid var(--ng-border);
  border-radius: var(--ng-r-sm);
  cursor: pointer;
  transition: all 150ms var(--ng-ease);
  height: 100%;
}
.ng-check-card:hover { border-color: var(--ng-border-focus); }
.ng-check-option input:checked + .ng-check-card {
  border-color: var(--ng-primary);
  background: var(--ng-primary-soft);
}
.ng-check-box {
  width: 16px; height: 16px; flex-shrink: 0;
  margin-top: 2px;
  border: 2px solid var(--ng-text-3);
  border-radius: 4px;
  background: var(--ng-card);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 150ms var(--ng-ease);
}
.ng-check-option input:checked ~ .ng-check-card .ng-check-box {
  border-color: var(--ng-primary);
  background: var(--ng-primary);
  position: relative;
}
.ng-check-option input:checked ~ .ng-check-card .ng-check-box::after {
  content: "";
  width: 6px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}
.ng-check-text { display: flex; flex-direction: column; min-width: 0; }
.ng-check-name { font-size: 13px; font-weight: 700; color: var(--ng-text); margin-bottom: 4px; }
.ng-check-desc { font-size: 11px; color: var(--ng-text-2); line-height: 1.4; }

/* ─── Exam: Answers Panel ─── */
.ng-answers-panel {
  border-top: 1px solid var(--ng-border);
  background: var(--ng-bg);
  display: flex; flex-direction: column;
}
.ng-answers-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: var(--ng-card);
  border-bottom: 1px solid var(--ng-border);
  position: sticky; top: 0;
}
.ng-answers-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--ng-success);
  background: var(--ng-success-bg);
  border: 1px solid var(--ng-success-border);
  padding: 5px 12px;
  border-radius: 20px;
}
.ng-answers-badge svg { width: 14px; height: 14px; }
.ng-answers-body {
  flex: 1;
  padding: 28px;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ng-text);
}
.ng-answers-body h1 { font-size: 24px; font-weight: 800; margin: 0 0 16px; color: var(--ng-text); }
.ng-answers-body h2 { font-size: 20px; font-weight: 700; margin: 28px 0 12px; color: var(--ng-text); padding-bottom: 8px; border-bottom: 1px solid var(--ng-border); }
.ng-answers-body h3 { font-size: 16px; font-weight: 600; margin: 20px 0 10px; color: var(--ng-text); }
.ng-answers-body p { margin: 0 0 14px; }
.ng-answers-body ul, .ng-answers-body ol { margin: 0 0 14px; padding-left: 24px; }
.ng-answers-body li { margin-bottom: 4px; }
.ng-answers-body blockquote {
  border-left: 3px solid var(--ng-success);
  padding: 8px 16px;
  margin: 12px 0;
  background: var(--ng-success-bg);
  border-radius: 0 var(--ng-r-xs) var(--ng-r-xs) 0;
  color: var(--ng-text-2);
}
.ng-answers-body strong { color: var(--ng-text); font-weight: 700; }

/* ─── Exam: Active Toggle ─── */
.ng-btn.ng-active {
  border-color: var(--ng-primary);
  color: var(--ng-primary);
  background: var(--ng-primary-soft);
}

/* ─── Exam paper result typography ─── */
.ng-result-body .ng-exam-paper-table { margin: 16px 0; }
.ng-saved-type-exam { background: rgba(245,158,11,0.12); color: #d97706; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .ng-chat-panel { position: fixed; right: 0; top: 50px; bottom: 0; z-index: 200; box-shadow: var(--ng-shadow-lg); }
}
@media (max-width: 768px) {
  .ng-result-layout { flex-direction: column; }
  .ng-chat-panel { width: 100%; min-width: 100%; }
  .ng-mode-grid { grid-template-columns: 1fr; }
  .ng-hero-title { font-size: 22px; }
  .ng-form-row { grid-template-columns: 1fr; }
  .ng-type-grid { grid-template-columns: 1fr; }
  .ng-check-grid { grid-template-columns: 1fr; }
  .ng-form-card { padding: 24px 20px; }
  .ng-saved-grid { grid-template-columns: 1fr; }
  .ng-topbar-actions .ng-topbar-btn span:not(.ng-spinner) { display: none; }
}

/* ─── Print ─── */
@media print {
  .ng-topbar, .ng-chat-panel,
  .ng-result-meta { display: none !important; }
  .ng-result-layout { display: block !important; }
  .ng-result-content { width: 100% !important; }
  .ng-result-body { max-width: 100%; }
}

/* ─── BRIS Lesson Plan template ─── */
.ng-result-body .bris-plan {
  font-family: Arial, Inter, Helvetica, sans-serif;
  color: #1a1a1a;
  line-height: 1.55;
  background: #fff;
}
.ng-result-body .bris-title {
  text-align: center;
  font-size: 24px;
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ng-result-body .bris-subtitle {
  text-align: center;
  font-style: italic;
  font-size: 14px;
  margin: 0 0 20px;
  color: #333;
}
.ng-result-body .bris-section {
  font-size: 16px;
  font-weight: 700;
  margin: 22px 0 8px;
  padding: 6px 10px;
  background: #eaf2fa;
  border: 1px solid #c7ddf2;
  border-radius: 4px;
}
.ng-result-body .bris-sub { font-size: 14px; font-weight: 700; margin: 16px 0 2px; }
.ng-result-body .bris-instr { font-size: 13px; font-style: italic; margin: 0 0 6px; color: #333; }
.ng-result-body .bris-note { font-size: 12px; color: #555; margin: 2px 0; }
.ng-result-body .bris-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 12px;
  background: #fff;
}
.ng-result-body .bris-table th,
.ng-result-body .bris-table td {
  border: 1px solid #333;
  padding: 6px 9px;
  vertical-align: top;
  text-align: left;
  font-size: 13px;
}
.ng-result-body .bris-table th { background: #eaf2fa; }
.ng-result-body .bris-info .bris-label { background: #f5f9fd; width: 16%; font-weight: 700; }
.ng-result-body .bris-info .bris-field { width: 34%; min-height: 22px; }
.ng-result-body .bris-delivery th.bris-stage,
.ng-result-body .bris-delivery td.bris-stage { width: 18%; font-weight: 700; }
.ng-result-body .bris-delivery td.bris-cell { width: 35%; }
.ng-result-body .bris-delivery td.bris-time { width: 12%; text-align: center; white-space: nowrap; }
.ng-result-body .bris-pair .bris-half { width: 50%; }
.ng-result-body .bris-list { margin: 4px 0 4px 20px; padding-left: 8px; }
.ng-result-body .bris-list li { margin-bottom: 4px; }
.ng-result-body .bris-lines {
  min-height: 18px;
  border-bottom: 1px solid #bbb;
  margin: 2px 0 8px;
  white-space: pre-wrap;
}
.ng-result-body[contenteditable="true"] { outline: 1px dashed var(--ng-border, #d1d5db); padding: 12px; border-radius: 8px; }
.ng-result-body[contenteditable="true"]:focus { outline-color: var(--ng-primary, #4f46e5); }
@media (max-width: 768px) {
  .ng-result-body .bris-delivery th.bris-stage,
  .ng-result-body .bris-delivery td.bris-stage { width: auto; }
  .ng-result-body .bris-delivery td.bris-cell { width: auto; }
}
