/* ============================================================================
   SkillWald Design System — "Forest Knowledge"
   Warm light theme, editorial typography, professional learning platform
   ============================================================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colors */
  --sw-bg: #FAFAF7;
  --sw-surface: #FFFFFF;
  --sw-surface-alt: #F2F0EB;
  --sw-green: #2D5F3F;
  --sw-green-dark: #1E4A2E;
  --sw-green-light: #E8F0EB;
  --sw-amber: #C4922A;
  --sw-amber-light: #FDF6E3;
  --sw-text: #1C2418;
  --sw-text-secondary: #596153;
  --sw-text-muted: #8B9485;
  --sw-border: #E0DCD2;
  --sw-error: #C53030;
  --sw-error-bg: #FFF5F5;
  --sw-success: #2D5F3F;
  --sw-success-bg: #F0F5F1;
  --sw-warning: #C4922A;
  --sw-warning-bg: #FDF6E3;

  /* Typography */
  --sw-font-display: 'Newsreader', 'Georgia', serif;
  --sw-font-body: 'Outfit', 'Segoe UI', sans-serif;
  --sw-font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --sw-radius-sm: 0.375rem;
  --sw-radius: 0.5rem;
  --sw-radius-lg: 0.75rem;
  --sw-radius-xl: 1rem;
  --sw-radius-2xl: 1.25rem;
  --sw-radius-full: 9999px;

  /* Shadows */
  --sw-shadow-sm: 0 1px 2px rgba(28, 36, 24, 0.05);
  --sw-shadow: 0 1px 3px rgba(28, 36, 24, 0.08), 0 1px 2px rgba(28, 36, 24, 0.04);
  --sw-shadow-md: 0 4px 6px -1px rgba(28, 36, 24, 0.07), 0 2px 4px -2px rgba(28, 36, 24, 0.05);
  --sw-shadow-lg: 0 10px 15px -3px rgba(28, 36, 24, 0.06), 0 4px 6px -4px rgba(28, 36, 24, 0.04);

  color-scheme: light;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--sw-font-body);
  color: var(--sw-text);
  background-color: var(--sw-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--sw-green);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--sw-green-dark);
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--sw-font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--sw-text);
  letter-spacing: -0.01em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.125rem; }

@media (min-width: 640px) {
  h1 { font-size: 2.75rem; }
  h2 { font-size: 2rem; }
}

.sw-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sw-text-muted);
}

.sw-muted {
  color: var(--sw-text-secondary);
}

/* --- Layout --- */
.sw-container {
  width: 100%;
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .sw-container { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
  .sw-container { padding-left: 2rem; padding-right: 2rem; }
}

.sw-page {
  flex: 1;
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.sw-sidebar {
  width: 16rem;
  flex-shrink: 0;
}

/* --- Navigation --- */
.sw-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sw-border);
}

.sw-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.sw-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.sw-nav-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--sw-radius);
  background: var(--sw-green);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 800;
  font-family: var(--sw-font-display);
}

.sw-nav-brand-text {
  font-family: var(--sw-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--sw-text);
}

.sw-nav-brand-text span {
  color: var(--sw-green);
}

.sw-nav-links {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .sw-nav-links { display: flex; }
}

.sw-nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sw-text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.sw-nav-link:hover {
  color: var(--sw-text);
}

.sw-nav-mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--sw-radius);
  border: 1px solid var(--sw-border);
  background: transparent;
  color: var(--sw-text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.sw-nav-mobile-toggle:hover {
  background: var(--sw-surface-alt);
  color: var(--sw-text);
}

@media (min-width: 768px) {
  .sw-nav-mobile-toggle { display: none; }
}

.sw-nav-mobile {
  display: none;
  padding-bottom: 1rem;
}

.sw-nav-mobile.active {
  display: block;
}

.sw-nav-mobile-panel {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-xl);
}

.sw-nav-mobile-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--sw-radius);
  font-size: 0.875rem;
  color: var(--sw-text-secondary);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.sw-nav-mobile-link:hover {
  background: var(--sw-surface-alt);
  color: var(--sw-text);
}

/* --- Cards --- */
.sw-card {
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-xl);
  box-shadow: var(--sw-shadow);
  padding: 1.5rem;
}

.sw-card-accent {
  background: var(--sw-surface);
  border: 2px solid var(--sw-green);
  border-radius: var(--sw-radius-xl);
  box-shadow: var(--sw-shadow-md);
  padding: 1.5rem;
  position: relative;
}

.sw-card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sw-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--sw-shadow-lg);
}

/* --- Buttons --- */
.sw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--sw-font-body);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--sw-radius-lg);
  padding: 0.625rem 1.25rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  line-height: 1.5;
}

.sw-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--sw-font-body);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--sw-radius-lg);
  padding: 0.625rem 1.25rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.5;
  background: var(--sw-green);
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(45, 95, 63, 0.2);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.sw-btn-primary:hover {
  background: var(--sw-green-dark);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(45, 95, 63, 0.25);
}

.sw-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--sw-font-body);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--sw-radius-lg);
  padding: 0.625rem 1.25rem;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.5;
  background: var(--sw-surface);
  color: var(--sw-green);
  border: 1px solid var(--sw-border);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sw-btn-secondary:hover {
  background: var(--sw-green-light);
  border-color: var(--sw-green);
  color: var(--sw-green-dark);
}

.sw-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--sw-font-body);
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: var(--sw-radius-lg);
  padding: 0.625rem 1.25rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.5;
  background: transparent;
  color: var(--sw-text-secondary);
  transition: background 0.15s ease, color 0.15s ease;
}

.sw-btn-ghost:hover {
  background: var(--sw-surface-alt);
  color: var(--sw-text);
}

.sw-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--sw-font-body);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--sw-radius-lg);
  padding: 0.625rem 1.25rem;
  border: 1px solid rgba(197, 48, 48, 0.3);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.5;
  background: var(--sw-error-bg);
  color: var(--sw-error);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sw-btn-danger:hover {
  background: #FEE;
  border-color: var(--sw-error);
}

.sw-btn-w-full {
  width: 100%;
}

/* --- Badges --- */
.sw-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--sw-radius-full);
  line-height: 1.5;
}

.sw-badge-pro {
  background: var(--sw-amber-light);
  color: var(--sw-amber);
  border: 1px solid rgba(196, 146, 42, 0.3);
}

.sw-badge-free {
  background: var(--sw-surface-alt);
  color: var(--sw-text-muted);
  border: 1px solid var(--sw-border);
}

.sw-badge-success {
  background: var(--sw-success-bg);
  color: var(--sw-success);
  border: 1px solid rgba(45, 95, 63, 0.2);
}

.sw-badge-warning {
  background: var(--sw-warning-bg);
  color: var(--sw-warning);
  border: 1px solid rgba(196, 146, 42, 0.2);
}

.sw-badge-error {
  background: var(--sw-error-bg);
  color: var(--sw-error);
  border: 1px solid rgba(197, 48, 48, 0.2);
}

/* --- Forms --- */
.sw-input, .sw-textarea, .sw-select {
  font-family: var(--sw-font-body);
  font-size: 0.9375rem;
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-lg);
  background: var(--sw-surface);
  color: var(--sw-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.sw-input::placeholder, .sw-textarea::placeholder {
  color: var(--sw-text-muted);
}

.sw-input:focus, .sw-textarea:focus, .sw-select:focus {
  border-color: var(--sw-green);
  box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

.sw-textarea {
  resize: vertical;
  min-height: 120px;
}

.sw-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238B9485' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sw-text);
  margin-bottom: 0.375rem;
}

/* Checkbox / Radio in exercise forms */
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--sw-green);
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

/* --- Progress --- */
.sw-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sw-progress-track {
  flex: 1;
  height: 0.5rem;
  background: var(--sw-surface-alt);
  border-radius: var(--sw-radius-full);
  overflow: hidden;
  border: 1px solid var(--sw-border);
}

.sw-progress-fill {
  height: 100%;
  border-radius: var(--sw-radius-full);
  background: var(--sw-green);
  transition: width 0.3s ease;
}

.sw-progress-label {
  width: 2.5rem;
  flex-shrink: 0;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sw-text-secondary);
}

/* --- Feedback --- */
.sw-feedback {
  border-radius: var(--sw-radius-xl);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.sw-feedback-success {
  background: var(--sw-success-bg);
  border: 1px solid rgba(45, 95, 63, 0.2);
}

.sw-feedback-warning {
  background: var(--sw-warning-bg);
  border: 1px solid rgba(196, 146, 42, 0.2);
}

.sw-feedback-error {
  background: var(--sw-error-bg);
  border: 1px solid rgba(197, 48, 48, 0.2);
}

.sw-feedback-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.sw-feedback-title {
  font-family: var(--sw-font-display);
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 0.375rem;
}

.sw-feedback-success .sw-feedback-title { color: var(--sw-success); }
.sw-feedback-warning .sw-feedback-title { color: var(--sw-warning); }
.sw-feedback-error .sw-feedback-title { color: var(--sw-error); }

.sw-feedback-success .sw-feedback-icon { color: var(--sw-success); }
.sw-feedback-warning .sw-feedback-icon { color: var(--sw-warning); }
.sw-feedback-error .sw-feedback-icon { color: var(--sw-error); }

/* --- Chat (AI Simulation) --- */
.sw-chat {
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-xl);
  overflow: hidden;
}

.sw-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--sw-surface-alt);
  border-bottom: 1px solid var(--sw-border);
}

.sw-chat-messages {
  padding: 1rem;
  overflow-y: auto;
  max-height: 500px;
  min-height: 300px;
}

.sw-chat-input {
  padding: 1rem;
  border-top: 1px solid var(--sw-border);
}

.sw-chat-user {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.sw-chat-user-bubble {
  max-width: 80%;
  background: var(--sw-green);
  color: #fff;
  border-radius: var(--sw-radius-xl) var(--sw-radius-xl) var(--sw-radius-sm) var(--sw-radius-xl);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.sw-chat-ai {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.sw-chat-ai-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: var(--sw-radius-full);
  background: var(--sw-green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sw-chat-ai-avatar svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--sw-green);
}

.sw-chat-ai-bubble {
  max-width: 80%;
  background: var(--sw-surface-alt);
  color: var(--sw-text);
  border-radius: var(--sw-radius-xl) var(--sw-radius-xl) var(--sw-radius-xl) var(--sw-radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* --- Prose (Markdown content) --- */
.sw-prose {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--sw-text);
}

.sw-prose h1, .sw-prose h2, .sw-prose h3, .sw-prose h4 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.sw-prose h1 { font-size: 1.75rem; }
.sw-prose h2 { font-size: 1.5rem; }
.sw-prose h3 { font-size: 1.25rem; }

.sw-prose p {
  margin-bottom: 1rem;
  color: var(--sw-text-secondary);
}

.sw-prose a {
  color: var(--sw-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sw-prose a:hover {
  color: var(--sw-green-dark);
}

.sw-prose strong {
  color: var(--sw-text);
  font-weight: 600;
}

.sw-prose code {
  font-family: var(--sw-font-mono);
  font-size: 0.875em;
  padding: 0.125em 0.375em;
  border-radius: var(--sw-radius-sm);
  background: var(--sw-surface-alt);
  color: var(--sw-green-dark);
}

.sw-prose pre {
  font-family: var(--sw-font-mono);
  font-size: 0.875rem;
  padding: 1rem 1.25rem;
  border-radius: var(--sw-radius-lg);
  background: #1C2418;
  color: #E8F0EB;
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--sw-border);
}

.sw-prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.sw-prose ul, .sw-prose ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.sw-prose li {
  margin-bottom: 0.375rem;
  color: var(--sw-text-secondary);
}

.sw-prose blockquote {
  border-left: 3px solid var(--sw-green);
  padding-left: 1rem;
  margin-bottom: 1rem;
  color: var(--sw-text-secondary);
  font-style: italic;
}

.sw-prose img {
  border-radius: var(--sw-radius-lg);
  margin-bottom: 1rem;
}

.sw-prose hr {
  border: none;
  border-top: 1px solid var(--sw-border);
  margin: 2rem 0;
}

/* --- Kicker (label above headings) --- */
.sw-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sw-green);
  margin-bottom: 0.75rem;
}

/* --- Chip --- */
.sw-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: var(--sw-radius-full);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--sw-border);
  background: var(--sw-surface);
  color: var(--sw-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.sw-chip:hover {
  border-color: var(--sw-green);
  transform: translateY(-1px);
  box-shadow: var(--sw-shadow-sm);
}

/* --- Section animation --- */
.sw-section {
  animation: fadeUp 0.5s ease-out both;
}

@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* --- Grid helpers --- */
.sw-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .sw-grid-2 { grid-template-columns: repeat(2, 1fr); }
}

.sw-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .sw-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .sw-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.sw-grid-4 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .sw-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .sw-grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* --- Flex helpers --- */
.sw-flex-center {
  display: flex;
  align-items: center;
}

.sw-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sw-gap-1 { gap: 0.25rem; }
.sw-gap-2 { gap: 0.5rem; }
.sw-gap-3 { gap: 0.75rem; }
.sw-gap-4 { gap: 1rem; }
.sw-gap-6 { gap: 1.5rem; }

/* --- Spacing helpers --- */
.sw-mt-2 { margin-top: 0.5rem; }
.sw-mt-4 { margin-top: 1rem; }
.sw-mt-6 { margin-top: 1.5rem; }
.sw-mt-8 { margin-top: 2rem; }
.sw-mb-2 { margin-bottom: 0.5rem; }
.sw-mb-4 { margin-bottom: 1rem; }
.sw-mb-6 { margin-bottom: 1.5rem; }
.sw-mb-8 { margin-bottom: 2rem; }

/* --- Text helpers --- */
.sw-text-center { text-align: center; }
.sw-text-sm { font-size: 0.875rem; }
.sw-text-xs { font-size: 0.75rem; }
.sw-text-lg { font-size: 1.125rem; }
.sw-text-xl { font-size: 1.25rem; }
.sw-font-semibold { font-weight: 600; }
.sw-font-bold { font-weight: 700; }
.sw-font-medium { font-weight: 500; }

/* --- Utility colors --- */
.sw-text-green { color: var(--sw-green); }
.sw-text-amber { color: var(--sw-amber); }
.sw-text-error { color: var(--sw-error); }
.sw-text-success { color: var(--sw-success); }
.sw-text-muted-color { color: var(--sw-text-muted); }

/* --- Footer --- */
.sw-footer {
  margin-top: auto;
  background: var(--sw-surface);
  border-top: 1px solid var(--sw-border);
  padding: 2.5rem 0;
}

.sw-footer-link {
  font-size: 0.875rem;
  color: var(--sw-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.sw-footer-link:hover {
  color: var(--sw-text);
}

/* --- Details / Accordion --- */
details summary {
  list-style: none;
  cursor: pointer;
}

details summary::-webkit-details-marker {
  display: none;
}

details[open] .sw-chevron {
  transform: rotate(180deg);
}

.sw-chevron {
  transition: transform 0.2s ease;
}

/* --- Breadcrumbs --- */
.sw-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--sw-text-muted);
  margin-bottom: 1.5rem;
}

.sw-breadcrumbs a {
  color: var(--sw-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.sw-breadcrumbs a:hover {
  color: var(--sw-text);
}

.sw-breadcrumbs-sep {
  color: var(--sw-border);
}

/* --- Divider --- */
.sw-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.sw-divider::before, .sw-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--sw-border);
}

.sw-divider-text {
  font-size: 0.875rem;
  color: var(--sw-text-muted);
}

/* --- Alert / Banner --- */
.sw-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--sw-radius-lg);
  font-size: 0.875rem;
}

.sw-alert-error {
  background: var(--sw-error-bg);
  border: 1px solid rgba(197, 48, 48, 0.2);
  color: var(--sw-error);
}

.sw-alert-success {
  background: var(--sw-success-bg);
  border: 1px solid rgba(45, 95, 63, 0.2);
  color: var(--sw-success);
}

.sw-alert-warning {
  background: var(--sw-warning-bg);
  border: 1px solid rgba(196, 146, 42, 0.2);
  color: var(--sw-warning);
}

/* --- Paywall Banner --- */
.sw-paywall {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--sw-amber-light);
  border: 1px solid rgba(196, 146, 42, 0.25);
  border-radius: var(--sw-radius-xl);
}

.sw-paywall-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--sw-radius-full);
  background: rgba(196, 146, 42, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sw-paywall-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--sw-amber);
}

/* --- Table --- */
.sw-table {
  width: 100%;
  border-collapse: collapse;
}

.sw-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sw-text-muted);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--sw-border);
}

.sw-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--sw-border);
  font-size: 0.875rem;
}

.sw-table tr:last-child td {
  border-bottom: none;
}

/* --- Icon container --- */
.sw-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--sw-radius-lg);
  background: var(--sw-green-light);
  flex-shrink: 0;
}

.sw-icon-box svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--sw-green);
}

.sw-icon-box-lg {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--sw-radius-xl);
}

.sw-icon-box-lg svg {
  width: 2rem;
  height: 2rem;
}

/* --- Exercise specific --- */
.sw-exercise-option {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-lg);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sw-exercise-option:hover {
  border-color: var(--sw-green);
  background: var(--sw-green-light);
}

.sw-fill-blank {
  display: inline-block;
  width: 10rem;
  border: none;
  border-bottom: 2px solid var(--sw-border);
  background: transparent;
  color: var(--sw-green);
  padding: 0.25rem 0.5rem;
  text-align: center;
  font-family: var(--sw-font-body);
  font-size: inherit;
  margin: 0 0.25rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.sw-fill-blank:focus {
  border-color: var(--sw-green);
}

.sw-dnd-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-lg);
  cursor: grab;
  user-select: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sw-dnd-item:active {
  cursor: grabbing;
}

.sw-dnd-item:hover {
  border-color: var(--sw-green);
  box-shadow: var(--sw-shadow-sm);
}

/* --- Landing page specifics --- */
.sw-hero-section {
  background: linear-gradient(180deg, var(--sw-green-light) 0%, var(--sw-bg) 100%);
  border-radius: var(--sw-radius-2xl);
  padding: 3rem 1.5rem;
}

@media (min-width: 640px) {
  .sw-hero-section { padding: 4rem 2.5rem; }
}

@media (min-width: 1024px) {
  .sw-hero-section { padding: 5rem 3rem; }
}

.sw-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .sw-hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 3rem; }
}

.sw-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--sw-radius-xl);
  background: var(--sw-green-light);
  color: var(--sw-green);
  font-family: var(--sw-font-display);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 auto 1rem;
}

.sw-step-connector {
  display: none;
  position: absolute;
  left: 12%;
  right: 12%;
  top: 2rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sw-border), transparent);
}

@media (min-width: 768px) {
  .sw-step-connector { display: block; }
}

/* Risk card color variants */
.sw-risk-green {
  border-top: 3px solid var(--sw-green);
}

.sw-risk-amber {
  border-top: 3px solid var(--sw-amber);
}

.sw-risk-red {
  border-top: 3px solid var(--sw-error);
}

.sw-risk-dot-green { background: var(--sw-green); }
.sw-risk-dot-amber { background: var(--sw-amber); }
.sw-risk-dot-red { background: var(--sw-error); }

/* Pro plan card highlight */
.sw-plan-popular {
  border: 2px solid var(--sw-green);
  position: relative;
}

.sw-plan-popular-tag {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sw-green);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.75rem;
  border-radius: var(--sw-radius-full);
  white-space: nowrap;
}

/* CTA section */
.sw-cta-section {
  background: linear-gradient(135deg, var(--sw-green-light) 0%, #F0F5F1 50%, var(--sw-amber-light) 100%);
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-2xl);
  padding: 3rem 2rem;
  text-align: center;
}

@media (min-width: 640px) {
  .sw-cta-section { padding: 4rem 3rem; }
}

/* Landing section wrapper */
.sw-landing-section {
  padding: 3rem 0;
}

@media (min-width: 768px) {
  .sw-landing-section { padding: 4rem 0; }
}

/* --- Tutor specific --- */
.sw-budget-bar {
  width: 100%;
  height: 0.625rem;
  background: var(--sw-surface-alt);
  border-radius: var(--sw-radius-full);
  overflow: hidden;
  border: 1px solid var(--sw-border);
}

.sw-budget-fill-green {
  height: 100%;
  border-radius: var(--sw-radius-full);
  background: var(--sw-green);
  transition: width 0.3s ease;
}

.sw-budget-fill-amber {
  height: 100%;
  border-radius: var(--sw-radius-full);
  background: var(--sw-amber);
  transition: width 0.3s ease;
}

.sw-budget-fill-red {
  height: 100%;
  border-radius: var(--sw-radius-full);
  background: var(--sw-error);
  transition: width 0.3s ease;
}

/* Typing indicator */
.sw-typing-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--sw-text-muted);
  border-radius: var(--sw-radius-full);
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

/* Status indicator */
.sw-status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--sw-radius-full);
}

.sw-status-dot-green { background: var(--sw-green); }
.sw-status-dot-amber { background: var(--sw-amber); animation: pulse 2s infinite; }
.sw-status-dot-red { background: var(--sw-error); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

.hidden {
  display: none !important;
}

/* --- Lang switcher --- */
.sw-lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
}

.sw-lang-active {
  color: var(--sw-green);
  font-weight: 600;
  text-transform: uppercase;
  padding: 0 0.25rem;
}

.sw-lang-link {
  color: var(--sw-text-muted);
  text-transform: uppercase;
  padding: 0 0.25rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.sw-lang-link:hover {
  color: var(--sw-text);
}

.sw-lang-sep {
  color: var(--sw-border);
}

/* --- Responsive stacking --- */
.sw-content-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .sw-content-sidebar {
    flex-direction: row;
  }
}

/* --- Misc --- */
.sw-line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sw-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-w-full { width: 100%; }
.sw-max-w-md { max-width: 28rem; }
.sw-max-w-lg { max-width: 32rem; }
.sw-max-w-xl { max-width: 36rem; }
.sw-max-w-2xl { max-width: 42rem; }
.sw-max-w-4xl { max-width: 56rem; }
.sw-max-w-5xl { max-width: 64rem; }
.sw-mx-auto { margin-left: auto; margin-right: auto; }

/* Score card classes (used by Go helpers) */
.sw-score-high { background: var(--sw-success-bg); border: 1px solid rgba(45, 95, 63, 0.2); }
.sw-score-mid { background: var(--sw-warning-bg); border: 1px solid rgba(196, 146, 42, 0.2); }
.sw-score-low { background: var(--sw-error-bg); border: 1px solid rgba(197, 48, 48, 0.2); }
.sw-score-high-text { color: var(--sw-green); }
.sw-score-mid-text { color: var(--sw-amber); }
.sw-score-low-text { color: var(--sw-error); }

/* --- Sidebar navigation --- */
.sw-sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--sw-radius-lg);
  font-size: 0.875rem;
  color: var(--sw-text-muted);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.sw-sidebar-link:hover {
  background: var(--sw-surface-alt);
  color: var(--sw-text);
}

.sw-sidebar-link-active {
  background: var(--sw-green-light);
  color: var(--sw-green);
  font-weight: 500;
}

/* --- Chat bubble variants (used by ai_chat_message.templ) --- */
.sw-chat-bubble-user {
  max-width: 80%;
  background: var(--sw-green);
  color: #fff;
  border-radius: var(--sw-radius-xl) var(--sw-radius-xl) var(--sw-radius-sm) var(--sw-radius-xl);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.sw-chat-bubble-ai {
  max-width: 80%;
  background: var(--sw-surface-alt);
  color: var(--sw-text);
  border-radius: var(--sw-radius-xl) var(--sw-radius-xl) var(--sw-radius-xl) var(--sw-radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* --- Typing indicator dots --- */
.sw-dot-bounce {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--sw-text-muted);
  border-radius: var(--sw-radius-full);
  animation: bounce 1s infinite;
}

/* --- Tutor budget card --- */
.sw-tutor-budget {
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-xl);
  padding: 1rem;
}

/* Budget progress fill color variants */
.sw-budget-ok { background: var(--sw-green); }
.sw-budget-warn { background: var(--sw-amber); }
.sw-budget-low { background: var(--sw-error); }

/* --- Tutor button --- */
.sw-tutor-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-radius: var(--sw-radius-lg);
  background: var(--sw-green-light);
  border: 1px solid rgba(45, 95, 63, 0.2);
  color: var(--sw-green);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sw-tutor-btn:hover {
  background: rgba(45, 95, 63, 0.15);
  border-color: var(--sw-green);
  color: var(--sw-green-dark);
}

/* --- Feedback (ensure padding/radius on color variants) --- */
.sw-feedback-success,
.sw-feedback-warning,
.sw-feedback-error {
  border-radius: var(--sw-radius-xl);
  padding: 1.5rem;
}
