/* ===== MathMind Global Styles ===== */
:root {
  --primary: hsl(250, 84%, 60%);
  --primary-dark: hsl(250, 84%, 50%);
  --secondary: hsl(200, 80%, 55%);
  --accent: hsl(280, 70%, 60%);
  --bg: #f8f7ff;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --text: #1a1523;
  --text-muted: #6b7280;
  --border: rgba(100, 80, 200, 0.15);
  --border-strong: rgba(100, 80, 200, 0.3);
  --shadow: 0 2px 12px rgba(100, 80, 200, 0.08);
  --shadow-lg: 0 8px 32px rgba(100, 80, 200, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-width: 240px;
  --gradient-primary: linear-gradient(135deg, hsl(250, 84%, 60%), hsl(280, 70%, 60%));
  --gradient-understand: linear-gradient(135deg, hsl(200, 80%, 55%), hsl(220, 75%, 60%));
  --gradient-proof: linear-gradient(135deg, hsl(250, 84%, 60%), hsl(270, 75%, 60%));
  --gradient-extend: linear-gradient(135deg, hsl(30, 80%, 58%), hsl(20, 85%, 55%));
}

html.dark {
  --primary: hsl(250, 70%, 68%);
  --primary-dark: hsl(250, 70%, 58%);
  --secondary: hsl(200, 70%, 62%);
  --accent: hsl(280, 60%, 68%);
  --bg: #0f0d1a;
  --bg-card: #1a1728;
  --bg-sidebar: #13111f;
  --text: #f0eeff;
  --text-muted: #9d98b8;
  --border: rgba(140, 120, 255, 0.15);
  --border-strong: rgba(140, 120, 255, 0.3);
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans JP', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
  line-height: 1.7;
}

/* ===== Layout ===== */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: background 0.3s, border 0.3s;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--gradient-primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
}

.sidebar-logo-text { font-weight: 700; font-size: 17px; letter-spacing: -0.3px; }

.sidebar-nav { flex: 1; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px; font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
  text-decoration: none;
  border: none; background: none; width: 100%; text-align: left;
}

.nav-item:hover { background: var(--border); color: var(--text); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(110,80,220,0.15), rgba(150,80,220,0.1));
  color: var(--primary);
  font-weight: 600;
}
.nav-item i { width: 18px; text-align: center; font-size: 15px; }

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page { padding: 28px 32px; flex: 1; max-width: 1200px; }

/* ===== Bottom Nav (Mobile) ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 8px 0 env(safe-area-inset-bottom);
}

.bottom-nav-items {
  display: flex; justify-content: space-around; align-items: center;
}

.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px;
  cursor: pointer; border: none; background: none;
  color: var(--text-muted); font-size: 10px; font-weight: 500;
  transition: color 0.2s;
}
.bottom-nav-item i { font-size: 18px; }
.bottom-nav-item.active { color: var(--primary); }

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: background 0.3s, border 0.3s;
}

.card-sm { padding: 16px; }
.card-hover { transition: all 0.2s; cursor: pointer; }
.card-hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(110,80,220,0.35);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(110,80,220,0.45); }

.btn-secondary {
  background: var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--border-strong); }

.btn-ghost {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border); color: var(--text); }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}
.btn-danger:hover { opacity: 0.9; }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ===== Forms ===== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 6px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(110,80,220,0.15);
}

.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-primary { background: rgba(110,80,220,0.15); color: var(--primary); }
.badge-understand { background: rgba(50,150,230,0.15); color: hsl(210,70%,50%); }
.badge-proof { background: rgba(130,80,220,0.15); color: hsl(260,70%,55%); }
.badge-extend { background: rgba(240,130,50,0.15); color: hsl(30,75%,50%); }
.badge-easy { background: rgba(34,197,94,0.15); color: #16a34a; }
.badge-standard { background: rgba(59,130,246,0.15); color: #2563eb; }
.badge-hard { background: rgba(239,68,68,0.15); color: #dc2626; }
.badge-correct { background: rgba(34,197,94,0.15); color: #16a34a; }
.badge-partial { background: rgba(234,179,8,0.15); color: #ca8a04; }
.badge-incorrect { background: rgba(239,68,68,0.15); color: #dc2626; }
.badge-count {
  background: var(--gradient-primary); color: white;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}

/* ===== Purpose Cards ===== */
.purpose-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.purpose-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  opacity: 0;
  transition: opacity 0.25s;
  border-radius: calc(var(--radius) - 2px);
}
.purpose-card.understand::before { background: linear-gradient(135deg, rgba(50,150,230,0.08), rgba(80,170,255,0.05)); }
.purpose-card.proof::before { background: linear-gradient(135deg, rgba(130,80,220,0.08), rgba(160,100,250,0.05)); }
.purpose-card.extend::before { background: linear-gradient(135deg, rgba(240,130,50,0.08), rgba(255,160,60,0.05)); }

.purpose-card:hover::before, .purpose-card.selected::before { opacity: 1; }
.purpose-card.selected { border-width: 2px; }
.purpose-card.understand.selected { border-color: hsl(200,80%,55%); }
.purpose-card.proof.selected { border-color: var(--primary); }
.purpose-card.extend.selected { border-color: hsl(30,80%,58%); }

.purpose-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 12px;
}
.purpose-icon.understand { background: var(--gradient-understand); }
.purpose-icon.proof { background: var(--gradient-proof); }
.purpose-icon.extend { background: var(--gradient-extend); }

.purpose-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.purpose-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.purpose-example { font-size: 12px; color: var(--text-muted); background: var(--border); padding: 6px 10px; border-radius: 6px; }

/* ===== Problem Cards ===== */
.problem-card { border-left: 4px solid transparent; }
.problem-card.understand { border-left-color: hsl(200,80%,55%); }
.problem-card.proof { border-left-color: var(--primary); }
.problem-card.extend { border-left-color: hsl(30,80%,58%); }

.problem-card-header {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 16px;
}
.problem-card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* ===== Collapsible ===== */
.collapsible { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.collapsible-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 13px; font-weight: 600;
  background: var(--border);
  transition: background 0.2s;
  user-select: none;
}
.collapsible-header:hover { background: var(--border-strong); }
.collapsible-header .chevron { transition: transform 0.25s; font-size: 12px; }
.collapsible-header.open .chevron { transform: rotate(180deg); }
.collapsible-body { padding: 16px; display: none; }
.collapsible-body.open { display: block; }

/* ===== Slider ===== */
.slider-container { display: flex; align-items: center; gap: 14px; }
.slider {
  flex: 1; height: 6px;
  -webkit-appearance: none; appearance: none;
  background: var(--border-strong);
  border-radius: 3px; outline: none; cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--gradient-primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(110,80,220,0.4);
}
.slider-value {
  min-width: 36px; text-align: center;
  font-weight: 700; font-size: 18px;
  color: var(--primary);
}

/* ===== Progress Bar ===== */
.progress-bar-container { background: var(--border); border-radius: 6px; height: 10px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 6px;
  background: var(--gradient-primary);
  transition: width 0.5s ease;
}

/* ===== Tabs ===== */
.tabs { display: flex; gap: 4px; background: var(--border); padding: 4px; border-radius: var(--radius-sm); }
.tab {
  flex: 1; padding: 8px 16px; border-radius: 7px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; background: transparent; color: var(--text-muted);
  transition: all 0.2s;
}
.tab.active { background: var(--bg-card); color: var(--primary); box-shadow: var(--shadow); }

/* ===== Toast ===== */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  min-width: 280px;
  animation: toastIn 0.3s ease;
}
.toast.success { border-left: 4px solid #22c55e; }
.toast.error { border-left: 4px solid #ef4444; }
.toast.info { border-left: 4px solid var(--primary); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  max-width: 520px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

/* ===== KaTeX ===== */
.katex-display { overflow-x: auto; padding: 8px 0; }
.math-content { line-height: 1.8; }
.math-content .katex { font-size: 1em; }

/* ===== Streak Badge ===== */
.streak-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  border-radius: 20px;
  color: white; font-weight: 700; font-size: 14px;
  box-shadow: 0 4px 12px rgba(239,68,68,0.35);
}

/* ===== Calendar ===== */
.calendar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-day-name {
  text-align: center; font-size: 11px; font-weight: 600;
  color: var(--text-muted); padding: 4px;
}
.calendar-day {
  text-align: center; padding: 6px 2px;
  border-radius: 8px; cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  min-height: 32px; display: flex; align-items: center; justify-content: center;
}
.calendar-day:hover { background: var(--border); }
.calendar-day.today { background: var(--border); font-weight: 700; color: var(--primary); }
.calendar-day.selected { background: var(--gradient-primary); color: white; }
.calendar-day.has-norma::after {
  content: '';
  display: block; width: 5px; height: 5px;
  border-radius: 50%; background: var(--primary);
  position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
}
.calendar-day { position: relative; }
.calendar-day.completed { color: #22c55e; }
.calendar-day.has-norma { font-weight: 600; }

/* ===== Split View ===== */
.split-view { display: flex; gap: 20px; height: calc(100vh - 120px); }
.split-left {
  width: 380px; min-width: 300px;
  overflow-y: auto; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.split-right { flex: 1; overflow-y: auto; }

/* ===== Search / Filter ===== */
.search-box {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border 0.2s, box-shadow 0.2s;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(110,80,220,0.15); }
.search-box input { flex: 1; border: none; background: none; outline: none; font-size: 14px; color: var(--text); }
.search-box i { color: var(--text-muted); }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  cursor: pointer; background: var(--bg);
  color: var(--text-muted);
  transition: all 0.2s;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { border-color: var(--primary); background: rgba(110,80,220,0.1); color: var(--primary); font-weight: 600; }

/* ===== Chat ===== */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - 160px); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.chat-bubble {
  max-width: 75%;
  padding: 14px 18px;
  border-radius: 16px;
  line-height: 1.7;
  font-size: 14px;
}
.chat-bubble.user {
  background: var(--gradient-primary); color: white;
  border-bottom-right-radius: 4px; align-self: flex-end;
}
.chat-bubble.ai {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px; align-self: flex-start;
}
.chat-input-area {
  border-top: 1px solid var(--border);
  padding: 16px;
  display: flex; gap: 10px; align-items: flex-end;
}
.chat-input-area textarea {
  flex: 1; padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14px; font-family: inherit;
  resize: none; outline: none;
  transition: border 0.2s;
  min-height: 48px; max-height: 150px;
}
.chat-input-area textarea:focus { border-color: var(--primary); }

/* ===== Concept Map ===== */
.concept-relation {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.relation-type {
  padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  min-width: 80px; text-align: center;
}
.relation-implies { background: rgba(59,130,246,0.15); color: #3b82f6; }
.relation-equivalent { background: rgba(34,197,94,0.15); color: #22c55e; }
.relation-generalizes { background: rgba(168,85,247,0.15); color: #a855f7; }
.relation-uses { background: rgba(234,179,8,0.15); color: #eab308; }
.relation-opposite { background: rgba(239,68,68,0.15); color: #ef4444; }

/* ===== Loading ===== */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px; padding: 60px;
  text-align: center;
}
.loading-text { color: var(--text-muted); font-size: 14px; }

/* ===== Page Header ===== */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.page-header p { color: var(--text-muted); font-size: 14px; }

/* ===== Grid ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ===== Utilities ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-primary { color: var(--primary); }
.text-success { color: #22c55e; }
.text-warning { color: #eab308; }
.text-danger { color: #ef4444; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Score Ring ===== */
.score-ring {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
  position: relative;
}

/* ===== Tag Input ===== */
.tag-input-container {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 8px;
  transition: border 0.2s;
  min-height: 46px;
}
.tag-input-container:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(110,80,220,0.15); }
.tags-display { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 15px;
  background: rgba(110,80,220,0.1); color: var(--primary);
  font-size: 12px; font-weight: 600;
}
.tag-remove { cursor: pointer; opacity: 0.6; }
.tag-remove:hover { opacity: 1; }
.tag-input {
  border: none; background: none; outline: none;
  font-size: 14px; color: var(--text); min-width: 120px; width: 100%;
  padding: 4px;
}

/* ===== Answer Panel ===== */
.answer-panel { margin-top: 20px; }
.verdict-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-weight: 600;
}
.verdict-banner.correct { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3); }
.verdict-banner.partial { background: rgba(234,179,8,0.12); border: 1px solid rgba(234,179,8,0.3); }
.verdict-banner.incorrect { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding-bottom: 70px; }
  .bottom-nav { display: block; }
  .page { padding: 16px; }
  .split-view { flex-direction: column; height: auto; }
  .split-left { width: 100%; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

/* ===== Animations ===== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeIn 0.3s ease forwards; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.animate-pulse { animation: pulse 2s infinite; }

/* ===== Norma Item ===== */
.norma-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  transition: all 0.2s;
  cursor: pointer;
}
.norma-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.norma-item.done { opacity: 0.6; }
.norma-item.done .norma-title { text-decoration: line-through; }

/* ===== Color themes for Lists ===== */
.list-purple { border-top: 3px solid hsl(260,65%,60%); }
.list-blue { border-top: 3px solid hsl(210,70%,55%); }
.list-green { border-top: 3px solid hsl(145,60%,45%); }
.list-orange { border-top: 3px solid hsl(30,80%,55%); }

/* ===== Select Chip Group ===== */
.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 20px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; background: var(--bg);
  color: var(--text-muted);
  transition: all 0.2s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { border-color: var(--primary); background: rgba(110,80,220,0.12); color: var(--primary); font-weight: 700; }

/* ===== Checkbox ===== */
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 14px;
}
.checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer;
}

/* ===== Step Indicator ===== */
.step-indicator {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 28px;
}
.step {
  display: flex; align-items: center;
}
.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  border: 2px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: all 0.3s;
}
.step.active .step-circle { background: var(--gradient-primary); color: white; border-color: var(--primary); }
.step.done .step-circle { background: #22c55e; color: white; border-color: #22c55e; }
.step-label { font-size: 11px; color: var(--text-muted); margin-left: 6px; font-weight: 600; }
.step.active .step-label, .step.done .step-label { color: var(--text); }
.step-line { flex: 1; height: 2px; background: var(--border-strong); margin: 0 8px; }
.step.done + .step .step-line, .step.done .step-line { background: #22c55e; }
