/* ==========================================================================
   IELTS Writing Sentence Workout Studio Stylesheet
   Designed with Taste Skill: Ultra-Clean, High Information Density, Focused
   ========================================================================== */

:root {
  --sw-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sw-mono: 'JetBrains Mono', monospace;

  /* Light Theme */
  --sw-bg: #f8fafc;
  --sw-surface: #ffffff;
  --sw-surface-alt: #f1f5f9;
  --sw-border: #e2e8f0;
  --sw-border-hover: #cbd5e1;
  --sw-text: #0f172a;
  --sw-text-muted: #64748b;
  --sw-text-subtle: #94a3b8;

  --sw-primary: #3b82f6;
  --sw-primary-hover: #2563eb;
  --sw-primary-light: #eff6ff;

  --sw-band65-bg: #fefce8;
  --sw-band65-border: #fef08a;
  --sw-band65-text: #854d0e;

  --sw-band70-bg: #f0fdfa;
  --sw-band70-border: #99f6e4;
  --sw-band70-text: #0f766e;

  --sw-band80-bg: #f0fdf4;
  --sw-band80-border: #bbf7d0;
  --sw-band80-text: #166534;

  --sw-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --sw-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --sw-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

html.dark, html[data-theme='dark'] {
  --sw-bg: #0b0f19;
  --sw-surface: #131b2e;
  --sw-surface-alt: #1e293b;
  --sw-border: #26334d;
  --sw-border-hover: #334155;
  --sw-text: #f8fafc;
  --sw-text-muted: #94a3b8;
  --sw-text-subtle: #64748b;

  --sw-primary: #60a5fa;
  --sw-primary-hover: #3b82f6;
  --sw-primary-light: rgba(59, 130, 246, 0.12);

  --sw-band65-bg: rgba(234, 179, 8, 0.08);
  --sw-band65-border: rgba(234, 179, 8, 0.25);
  --sw-band65-text: #facc15;

  --sw-band70-bg: rgba(20, 184, 166, 0.09);
  --sw-band70-border: rgba(45, 212, 191, 0.28);
  --sw-band70-text: #2dd4bf;

  --sw-band80-bg: rgba(16, 185, 129, 0.08);
  --sw-band80-border: rgba(52, 211, 153, 0.25);
  --sw-band80-text: #34d399;
}

body {
  font-family: var(--sw-font);
  background-color: var(--sw-bg);
  color: var(--sw-text);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--sw-mono);
}

/* Layout Container */
.sw-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

/* Navbar */
.sw-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.75rem;
  background-color: var(--sw-surface);
  border-bottom: 1px solid var(--sw-border);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
}

.sw-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--sw-text);
  text-decoration: none;
}

.sw-nav-brand i {
  color: var(--sw-primary);
  font-size: 1.2rem;
}

.sw-nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sw-nav-link {
  font-size: 0.875rem;
  color: var(--sw-text-muted);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

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

.sw-theme-btn {
  background: var(--sw-surface-alt);
  border: 1px solid var(--sw-border);
  color: var(--sw-text);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sw-theme-btn:hover {
  border-color: var(--sw-border-hover);
  background: var(--sw-border);
}

/* Hero */
.sw-hero {
  text-align: center;
  margin: 1.5rem 0 2rem;
}

.sw-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: var(--sw-primary-light);
  color: var(--sw-primary);
  margin-bottom: 0.85rem;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.sw-hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
  line-height: 1.2;
}

.sw-hero-title span {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sw-hero-desc {
  font-size: 1rem;
  color: var(--sw-text-muted);
  max-width: 760px;
  margin: 0 auto 1.5rem;
  line-height: 1.55;
}

/* Mode Switcher Tabs */
.sw-tabs-wrapper {
  display: inline-flex;
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: 12px;
  padding: 0.3rem;
  gap: 0.3rem;
  margin-top: 0.5rem;
  box-shadow: var(--sw-shadow-sm);
}

.sw-tab-btn {
  background: transparent;
  border: none;
  color: var(--sw-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

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

.sw-tab-btn.active {
  background: var(--sw-primary);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.sw-tab-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ==========================================================================
   Two-Tier Tab Bar: Main Parts (Tier 1) & Sub-Unit Tabs (Tier 2)
   Modeled on task 1 common paraphrases layout
   ========================================================================== */
.sw-two-tier-card {
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--sw-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.sw-tier1-section {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--sw-border);
}

.sw-tier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.15rem 0.35rem;
}

.sw-tier-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sw-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--sw-mono);
}

.sw-tier-label i {
  color: var(--sw-primary);
  font-size: 0.82rem;
}

.sw-tier-counter {
  font-size: 0.72rem;
  font-family: var(--sw-mono);
  font-weight: 700;
  color: var(--sw-primary);
  background: var(--sw-primary-light);
  padding: 0.18rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.sw-tier1-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.25rem;
}

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

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

.sw-tier1-btn {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  text-align: left;
  border: 1px solid var(--sw-border);
  background: var(--sw-surface-alt);
  color: var(--sw-text);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 64px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.sw-tier1-btn:hover {
  background: var(--sw-primary-light);
  border-color: var(--sw-primary);
  color: var(--sw-primary);
  transform: translateY(-1px);
}

.sw-tier1-btn.active {
  background: var(--sw-primary);
  border-color: var(--sw-primary);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.sw-tier1-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.sw-tier1-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  background: rgba(59, 130, 246, 0.12);
  color: var(--sw-primary);
  transition: all 0.2s ease;
}

.sw-tier1-btn.active .sw-tier1-icon {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.sw-tier1-badge {
  font-size: 0.68rem;
  font-family: var(--sw-mono);
  font-weight: 700;
  padding: 0.1rem 0.38rem;
  border-radius: 4px;
  background: var(--sw-surface);
  color: var(--sw-text-muted);
  border: 1px solid var(--sw-border);
}

.sw-tier1-btn.active .sw-tier1-badge {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  border-color: transparent;
}

.sw-tier1-title {
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Tier 2: Sub-Units Bar */
.sw-tier2-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sw-subtab-scroll-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.sw-subtab-scroll-btn {
  width: 28px;
  height: 32px;
  border-radius: 8px;
  background: var(--sw-surface-alt);
  border: 1px solid var(--sw-border);
  color: var(--sw-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  user-select: none;
}

.sw-subtab-scroll-btn:hover {
  background: var(--sw-primary-light);
  color: var(--sw-primary);
  border-color: var(--sw-primary);
}

.sw-tier2-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0.1rem 0.45rem;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  flex: 1;
}

.sw-tier2-row.is-dragging {
  cursor: grabbing;
}

.sw-tier2-row::-webkit-scrollbar {
  display: none;
}

.sw-subtab-btn {
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--sw-border);
  background: var(--sw-surface);
  color: var(--sw-text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.18s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

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

.sw-subtab-btn.active {
  background: var(--sw-primary);
  color: #ffffff;
  border-color: var(--sw-primary);
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.32);
}

.sw-subtab-num {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-family: var(--sw-mono);
  font-weight: 700;
  background: var(--sw-surface-alt);
  color: var(--sw-text);
  transition: all 0.2s ease;
}

.sw-subtab-btn.active .sw-subtab-num {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.sw-subtab-count {
  font-size: 0.68rem;
  font-family: var(--sw-mono);
  opacity: 0.85;
}

/* ==========================================================================
   Interactive Slider Navigation Bar (Modeled on task 1 common paraphrases)
   ========================================================================== */
.sw-slider-card {
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--sw-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sw-slider-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-bottom: 1px solid var(--sw-border);
  padding-bottom: 0.65rem;
}

@media (min-width: 640px) {
  .sw-slider-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.sw-slider-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sw-slider-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--sw-primary-light);
  color: var(--sw-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sw-slider-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sw-slider-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sw-text);
  font-family: var(--sw-mono);
}

.sw-slider-badge {
  font-size: 0.68rem;
  font-family: var(--sw-mono);
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 9999px;
  background: var(--sw-primary-light);
  color: var(--sw-primary);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.sw-slider-desc {
  font-size: 0.72rem;
  color: var(--sw-text-muted);
  margin-top: 0.1rem;
}

.sw-slider-active-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sw-mono);
  font-size: 0.76rem;
  flex-shrink: 0;
}

.sw-slider-active-label {
  color: var(--sw-text-subtle);
  font-size: 0.7rem;
}

.sw-slider-active-val {
  font-weight: 700;
  color: var(--sw-primary);
  background: var(--sw-primary-light);
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Slider Track & Range Input */
.sw-slider-track-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sw-slider-input {
  width: 100%;
  height: 8px;
  background: var(--sw-surface-alt);
  border: 1px solid var(--sw-border);
  border-radius: 8px;
  appearance: none;
  cursor: pointer;
  outline: none;
  accent-color: var(--sw-primary);
  transition: all 0.15s ease;
}

.sw-slider-input:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Step labels beneath slider */
.sw-slider-steps-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.15rem;
  font-size: 0.68rem;
  font-family: var(--sw-mono);
  color: var(--sw-text-subtle);
  user-select: none;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.sw-slider-steps-row::-webkit-scrollbar {
  display: none;
}

.sw-step-label {
  cursor: pointer;
  padding: 0.15rem 0.25rem;
  border-radius: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sw-step-label:hover {
  color: var(--sw-primary);
  background: var(--sw-primary-light);
}

.sw-step-label.active {
  color: var(--sw-primary);
  font-weight: 800;
  transform: scale(1.15);
}

/* Toolbar Controls */
.sw-toolbar-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.sw-random-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.1rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  border: 1px solid var(--sw-border);
  background: var(--sw-surface-alt);
  color: var(--sw-text);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.sw-random-btn:hover {
  background: var(--sw-primary-light);
  border-color: var(--sw-primary);
  color: var(--sw-primary);
}

/* Controls Card */
.sw-controls-card {
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--sw-shadow-sm);
}

.sw-search-bar {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.sw-search-icon {
  position: absolute;
  left: 1rem;
  color: var(--sw-text-subtle);
  font-size: 0.95rem;
  pointer-events: none;
}

.sw-search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 2.6rem;
  background: var(--sw-surface-alt);
  border: 1px solid var(--sw-border);
  border-radius: 10px;
  font-size: 0.92rem;
  color: var(--sw-text);
  outline: none;
  transition: all 0.2s ease;
}

.sw-search-input:focus {
  border-color: var(--sw-primary);
  background: var(--sw-surface);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.sw-search-clear {
  position: absolute;
  right: 0.85rem;
  background: transparent;
  border: none;
  color: var(--sw-text-subtle);
  cursor: pointer;
  padding: 0.25rem;
}

.sw-search-clear:hover {
  color: var(--sw-text);
}

/* Unit Filter Pills Carousel */
.sw-filter-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.sw-filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sw-text-muted);
  white-space: nowrap;
  padding-top: 0.35rem;
}

.sw-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sw-pill {
  background: var(--sw-surface-alt);
  border: 1px solid var(--sw-border);
  color: var(--sw-text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.sw-pill:hover {
  border-color: var(--sw-border-hover);
  color: var(--sw-text);
  background: var(--sw-surface);
}

.sw-pill.active {
  background: var(--sw-primary-light);
  border-color: var(--sw-primary);
  color: var(--sw-primary);
  font-weight: 700;
}

/* ==========================================================================
   Tier 3: Content-Level Sub Tabs & Focus Switcher (Better Single-Drill Focus)
   ========================================================================== */
.sw-content-switcher-card {
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: 1rem;
  padding: 0.9rem 1.15rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--sw-shadow-sm);
  transition: all 0.2s ease;
}

.sw-content-switcher-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--sw-border);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.sw-content-switcher-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sw-content-switcher-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background-color: var(--sw-primary-light);
  color: var(--sw-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.sw-content-switcher-meta {
  display: flex;
  flex-direction: column;
}

.sw-content-switcher-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sw-text);
  font-family: var(--sw-mono);
}

.sw-content-switcher-sub {
  font-size: 0.72rem;
  color: var(--sw-text-muted);
}

.sw-content-mode-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sw-mode-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--sw-border);
  background-color: var(--sw-surface-alt);
  color: var(--sw-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sw-mode-toggle-btn:hover {
  background-color: var(--sw-primary-light);
  color: var(--sw-primary);
  border-color: rgba(59, 130, 246, 0.3);
}

.sw-mode-toggle-btn.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(6, 182, 212, 0.15));
  color: var(--sw-primary);
  border-color: var(--sw-primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.sw-content-tabs-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.2rem 0;
  scroll-behavior: smooth;
  width: 100%;
}

.sw-content-tabs-row::-webkit-scrollbar {
  display: none;
}

.sw-content-tabs-row.is-dragging {
  cursor: grabbing !important;
  cursor: -webkit-grabbing !important;
  user-select: none;
  scroll-behavior: auto;
}

.sw-content-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--sw-border);
  background-color: var(--sw-surface-alt);
  color: var(--sw-text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  flex-shrink: 0;
}

.sw-content-tab-btn:hover {
  background-color: var(--sw-primary-light);
  color: var(--sw-primary);
  border-color: rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
}

.sw-content-tab-btn.active {
  background-color: var(--sw-primary);
  color: #ffffff;
  border-color: var(--sw-primary);
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
  font-weight: 700;
}

.sw-content-tab-btn.all-btn.active {
  background-color: #0ea5e9;
  border-color: #0ea5e9;
  color: #ffffff;
}

.sw-content-tab-num {
  font-family: var(--sw-mono);
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.85;
}

.sw-content-tab-btn.active .sw-content-tab-num {
  color: #ffffff;
  opacity: 1;
}

/* Focus Navigation Bar (Prev / Next bottom controls) */
.sw-focus-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 0.85rem 1.25rem;
  background-color: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: 1rem;
  box-shadow: var(--sw-shadow-sm);
  flex-wrap: wrap;
}

.sw-focus-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--sw-border);
  background-color: var(--sw-surface-alt);
  color: var(--sw-text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sw-focus-nav-btn:hover:not(:disabled) {
  background-color: var(--sw-primary-light);
  color: var(--sw-primary);
  border-color: var(--sw-primary);
  transform: translateY(-1px);
}

.sw-focus-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.sw-focus-nav-center {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

/* Drills List */
.sw-drills-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Drill Card */
.sw-card {
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--sw-shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.sw-card:hover {
  box-shadow: var(--sw-shadow-md);
  border-color: var(--sw-border-hover);
}

/* Card Header */
.sw-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--sw-border);
}

.sw-card-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sw-unit-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--sw-surface-alt);
  color: var(--sw-primary);
  border: 1px solid var(--sw-border);
}

.sw-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--sw-text);
}

.sw-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sw-btn-star {
  background: transparent;
  border: 1px solid var(--sw-border);
  color: var(--sw-text-subtle);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sw-btn-star:hover {
  color: #f59e0b;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.sw-btn-star.bookmarked {
  color: #f59e0b;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

/* Prompt Box */
.sw-prompt-box {
  background: var(--sw-surface-alt);
  border: 1px solid var(--sw-border);
  border-left: 4px solid var(--sw-primary);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.sw-prompt-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sw-primary);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sw-prompt-text {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--sw-text);
  line-height: 1.5;
  margin: 0;
}

/* Constraint & Scaffolding */
.sw-scaffolding-box {
  background: rgba(59, 130, 246, 0.04);
  border: 1px dashed rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sw-constraint-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--sw-text);
}

.sw-constraint-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--sw-primary);
  color: #ffffff;
}

.sw-grammar-link-row {
  display: flex;
  align-items: center;
  margin-top: 0.25rem;
}

.sw-grammar-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--sw-primary);
  text-decoration: none;
  background: var(--sw-surface);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  transition: all 0.15s ease;
  font-weight: 500;
  width: fit-content;
}

.sw-grammar-link:hover {
  background: var(--sw-primary-light);
  border-color: var(--sw-primary);
  color: var(--sw-primary-hover);
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.15);
}

.sw-grammar-link strong {
  font-weight: 600;
}

/* User Translation Input Area */
.sw-input-area {
  margin-bottom: 1rem;
}

.sw-textarea {
  width: 100%;
  min-height: 72px;
  padding: 0.85rem 1rem;
  background: var(--sw-surface-alt);
  border: 1px solid var(--sw-border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: var(--sw-font);
  color: var(--sw-text);
  line-height: 1.5;
  box-sizing: border-box;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sw-textarea:focus {
  border-color: var(--sw-primary);
  background: var(--sw-surface);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Input Bar & Actions */
.sw-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sw-counters {
  font-size: 0.76rem;
  font-family: var(--sw-mono);
  color: var(--sw-text-muted);
}

.sw-btn-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sw-btn {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

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

.sw-btn-secondary:hover {
  background: var(--sw-border);
}

.sw-btn-primary {
  background: var(--sw-primary);
  color: #ffffff;
}

.sw-btn-primary:hover {
  background: var(--sw-primary-hover);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Revealed Solution Box */
.sw-solution-panel {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--sw-border);
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.sw-solution-panel.open {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.sw-models-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .sw-models-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.sw-model-box {
  border-radius: 12px;
  padding: 1rem 1.15rem;
  border: 1px solid;
  position: relative;
}

.sw-model-band65 {
  background: var(--sw-band65-bg);
  border-color: var(--sw-band65-border);
}

.sw-model-band80 {
  background: var(--sw-band80-bg);
  border-color: var(--sw-band80-border);
}

.sw-model-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.sw-model-band65 .sw-model-badge {
  background: rgba(234, 179, 8, 0.15);
  color: var(--sw-band65-text);
  border: 1px solid var(--sw-band65-border);
}

.sw-model-band80 .sw-model-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--sw-band80-text);
  border: 1px solid var(--sw-band80-border);
}

.sw-model-text {
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--sw-text);
  margin: 0 0 0.5rem;
}


/* Diagnostic Explanation Box */
.sw-analysis-box {
  background: var(--sw-surface-alt);
  border: 1px solid var(--sw-border);
  border-radius: 10px;
  padding: 0.95rem 1.15rem;
  font-size: 0.86rem;
  color: var(--sw-text-muted);
  line-height: 1.55;
}

.sw-analysis-box strong {
  color: var(--sw-text);
}

/* Toast */
.sw-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1e293b;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: var(--sw-shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.25s ease;
  z-index: 999;
}

.sw-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 640px) {
  .sw-navbar {
    padding: 0.75rem 1rem;
  }
  .sw-hero-title {
    font-size: 1.75rem;
  }
  .sw-filter-row {
    flex-direction: column;
    gap: 0.4rem;
  }
}

/* ==========================================================================
   Input Prerequisite & Shake Animation
   ========================================================================== */
@keyframes swShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.sw-textarea.shake-error {
  animation: swShake 0.45s ease-in-out;
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25) !important;
}

.sw-prereq-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--sw-text-muted);
  transition: all 0.2s ease;
}

.sw-prereq-hint.warn {
  color: #d97706;
  font-weight: 600;
}

/* ==========================================================================
   AI Quota Pills & Status
   ========================================================================== */
.sw-quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--sw-border);
  background: var(--sw-surface-alt);
  color: var(--sw-text);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sw-quota-pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--sw-shadow-sm);
}

.sw-quota-pill.unlimited {
  background: rgba(147, 51, 234, 0.08);
  border-color: rgba(168, 85, 247, 0.3);
  color: #9333ea;
}

html.dark .sw-quota-pill.unlimited {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.35);
  color: #c084fc;
}

.sw-quota-pill.normal {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.28);
  color: #059669;
}

html.dark .sw-quota-pill.normal {
  color: #34d399;
}

.sw-quota-pill.low {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
  color: #d97706;
}

.sw-quota-pill.out {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

/* ==========================================================================
   AI Action Buttons
   ========================================================================== */
.sw-btn-ai {
  background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
  color: #ffffff !important;
  border: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.52rem 0.95rem;
  border-radius: 8px;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
}

.sw-btn-ai:hover {
  background: linear-gradient(135deg, #047857 0%, #0f766e 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.35);
}

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

.sw-btn-ai:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.sw-btn-ai.loading i {
  animation: fa-spin 1s infinite linear;
}

/* ==========================================================================
   Band 7.0 Model Card
   ========================================================================== */
.sw-model-band70 {
  background: var(--sw-band70-bg);
  border: 1px solid var(--sw-band70-border);
}

.sw-model-band70 .sw-model-badge {
  color: var(--sw-band70-text);
  font-weight: 700;
}

/* ==========================================================================
   AI Result Diagnostic Panel
   ========================================================================== */
.sw-ai-panel {
  display: none;
  margin-top: 1rem;
  border-radius: 12px;
  background: var(--sw-surface-alt);
  border: 1px solid var(--sw-border);
  padding: 1.15rem;
  animation: swFadeIn 0.3s ease-out;
}

.sw-ai-panel.open {
  display: block;
}

@keyframes swFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.sw-ai-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--sw-border);
}

.sw-ai-header-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.sw-band-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--sw-mono);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  letter-spacing: -0.01em;
}

.sw-band-badge.band-high {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.sw-band-badge.band-mid {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.sw-band-badge.band-low {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.sw-constraint-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
}

.sw-constraint-tag.pass {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

html.dark .sw-constraint-tag.pass {
  color: #34d399;
}

.sw-constraint-tag.fail {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.sw-engine-tag {
  font-size: 0.72rem;
  color: var(--sw-text-muted);
  font-family: var(--sw-mono);
}

.sw-ai-feedback-box {
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--sw-text);
  margin-bottom: 0.85rem;
}

.sw-ai-feedback-box strong {
  color: var(--sw-text);
}

.sw-ai-upgrade-box {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
}

.sw-ai-upgrade-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--sw-primary);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sw-ai-upgrade-text {
  font-family: var(--sw-mono);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--sw-text);
  margin: 0;
  line-height: 1.5;
}

/* Skeleton loader for AI inference */
.sw-ai-skeleton {
  padding: 1rem 0;
}

.sw-skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, var(--sw-border) 25%, var(--sw-surface-alt) 50%, var(--sw-border) 75%);
  background-size: 200% 100%;
  animation: swSkeletonShimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 0.65rem;
}

@keyframes swSkeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   Modals: AI Key Settings & Daily Quota
   ========================================================================== */
.sw-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sw-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.sw-modal-card {
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sw-modal-overlay.open .sw-modal-card {
  transform: scale(1);
}

.sw-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--sw-border);
}

.sw-modal-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--sw-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.sw-modal-close {
  background: transparent;
  border: none;
  color: var(--sw-text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.15s ease;
}

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

.sw-modal-body {
  padding: 1.5rem;
}

.sw-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--sw-border);
  background: var(--sw-surface-alt);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.sw-form-group {
  margin-bottom: 1.25rem;
}

.sw-form-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--sw-text);
  margin-bottom: 0.4rem;
}

.sw-form-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--sw-border);
  background: var(--sw-surface);
  color: var(--sw-text);
  font-family: var(--sw-mono);
  font-size: 0.86rem;
  transition: all 0.15s ease;
}

.sw-form-input:focus {
  outline: none;
  border-color: var(--sw-primary);
  box-shadow: 0 0 0 3px var(--sw-primary-light);
}

.sw-form-help {
  font-size: 0.77rem;
  color: var(--sw-text-muted);
  margin-top: 0.35rem;
  line-height: 1.45;
}

.sw-form-help a {
  color: var(--sw-primary);
  text-decoration: underline;
}

.sw-tabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--sw-border);
  padding-bottom: 0.5rem;
}

.sw-tab-btn {
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--sw-text-muted);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

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

.sw-tab-btn.active {
  color: var(--sw-primary);
  background: var(--sw-primary-light);
}

/* ==========================================================================
   Syntactic Structure Highlighting & Constraint Formatters (Sentence Workout)
   ========================================================================== */

/* Constraint Code / Pill Format */
.sw-constraint-code {
  display: inline-block;
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.28);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--sw-mono);
  font-size: 0.85em;
  font-weight: 600;
  margin: 0 1px;
}

html.dark .sw-constraint-code,
html[data-theme='dark'] .sw-constraint-code {
  background: rgba(99, 102, 241, 0.24);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.42);
}

/* Band 6.5 Model Structure Highlight (Amber/Honey solid) */
.sw-hl-band65 {
  display: inline;
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  border-bottom: 2px solid #f59e0b;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  cursor: help;
  transition: all 0.15s ease;
}

html.dark .sw-hl-band65,
html[data-theme='dark'] .sw-hl-band65 {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
  border-bottom-color: #f59e0b;
}

.sw-hl-band65:hover {
  background: rgba(245, 158, 11, 0.24);
}

/* Band 7.0 Academic Model Structure Highlight (Cyan/Blue solid) */
.sw-hl-band70 {
  display: inline;
  background: rgba(14, 165, 233, 0.15);
  color: #0369a1;
  border-bottom: 2px solid #0ea5e9;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  cursor: help;
  transition: all 0.15s ease;
}

html.dark .sw-hl-band70,
html[data-theme='dark'] .sw-hl-band70 {
  background: rgba(14, 165, 233, 0.22);
  color: #7dd3fc;
  border-bottom-color: #38bdf8;
}

.sw-hl-band70:hover {
  background: rgba(14, 165, 233, 0.25);
}

/* Band 8.0+ Academic Polish Structure Highlight (Emerald/Mint solid + glow) */
.sw-hl-band80 {
  display: inline;
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
  border-bottom: 2px solid #10b981;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.12);
  cursor: help;
  transition: all 0.15s ease;
}

html.dark .sw-hl-band80,
html[data-theme='dark'] .sw-hl-band80 {
  background: rgba(16, 185, 129, 0.24);
  color: #6ee7b7;
  border-bottom-color: #34d399;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.2);
}

.sw-hl-band80:hover {
  background: rgba(16, 185, 129, 0.26);
}

/* Toolbar & Sub-Header Highlight Toggle Button */
.sw-action-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--sw-border);
  background: var(--sw-surface);
  color: var(--sw-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

.sw-action-toggle-btn.active {
  background: rgba(245, 158, 11, 0.14);
  border-color: #f59e0b;
  color: #b45309;
}

html.dark .sw-action-toggle-btn.active,
html[data-theme='dark'] .sw-action-toggle-btn.active {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
  color: #fcd34d;
}

/* Disabled Highlight Mode Overrides (When toggled OFF by student) */
.sw-hl-disabled .sw-hl-band65,
.sw-hl-disabled .sw-hl-band70,
.sw-hl-disabled .sw-hl-band80 {
  background: transparent !important;
  color: inherit !important;
  border: none !important;
  box-shadow: none !important;
  font-weight: inherit !important;
  padding: 0 !important;
  cursor: inherit !important;
}

.sw-hl-disabled .sw-constraint-code {
  background: transparent !important;
  border: none !important;
  color: inherit !important;
  padding: 0 !important;
  font-weight: inherit !important;
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Architecture (< 768px & < 480px)
   ========================================================================== */

@media (max-width: 768px) {
  /* Container & Spacing */
  .sw-container {
    padding: 1rem 0.75rem 5rem;
  }

  /* Navbar */
  .sw-navbar {
    padding: 0.65rem 0.85rem;
  }

  .sw-brand-text {
    font-size: 0.95rem;
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sw-nav-links {
    gap: 0.35rem;
  }

  .sw-nav-link {
    padding: 0.45rem 0.55rem;
    font-size: 0.8rem;
  }

  .sw-nav-link-text {
    display: none;
  }

  .sw-quota-pill {
    padding: 0.25rem 0.55rem;
    font-size: 0.74rem;
    gap: 0.3rem;
  }

  /* Hero Banner */
  .sw-hero {
    padding: 1.5rem 0.5rem 1rem;
  }

  .sw-hero-title {
    font-size: 1.65rem;
    line-height: 1.25;
    margin-bottom: 0.6rem;
  }

  .sw-hero-desc {
    font-size: 0.88rem;
    line-height: 1.55;
    margin-bottom: 1.25rem;
  }

  .sw-hero-badge {
    font-size: 0.68rem;
    padding: 0.25rem 0.65rem;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
  }

  /* Two-Tier Card */
  .sw-two-tier-card {
    padding: 0.85rem 0.75rem;
    border-radius: 14px;
    margin-bottom: 1rem;
  }

  .sw-tier-header {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .sw-tier-label {
    font-size: 0.7rem;
  }

  /* Slider Card */
  .sw-slider-card {
    padding: 0.85rem 0.75rem;
    border-radius: 14px;
    margin-bottom: 1rem;
  }

  .sw-slider-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .sw-slider-title-row {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .sw-slider-title {
    font-size: 0.82rem;
  }

  .sw-slider-active-preview {
    width: 100%;
    justify-content: space-between;
    background: var(--sw-surface-alt);
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--sw-border);
  }

  .sw-slider-active-val {
    max-width: 65%;
  }

  .sw-slider-steps-row {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
    gap: 0.3rem;
  }

  .sw-slider-steps-row::-webkit-scrollbar {
    display: none;
  }

  .sw-slider-step-btn {
    min-width: 24px;
    height: 24px;
    font-size: 0.65rem;
    flex-shrink: 0;
  }

  /* Hide Desktop Chevron Buttons on Touch Devices */
  .sw-subtab-scroll-btn {
    display: none !important;
  }

  .sw-tier2-row,
  .sw-content-tabs-row {
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  /* Toolbar Row */
  .sw-controls-card {
    padding: 0.85rem 0.75rem;
    border-radius: 14px;
    margin-bottom: 1rem;
  }

  .sw-toolbar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .sw-search-bar {
    width: 100%;
    margin-bottom: 0;
  }

  .sw-action-toggle-btn,
  .sw-random-btn {
    flex: 1;
    justify-content: center;
    padding: 0.5rem 0.65rem;
    font-size: 0.78rem;
  }

  /* Content Switcher Card */
  .sw-content-switcher-card {
    padding: 0.85rem 0.75rem;
    border-radius: 14px;
    margin-bottom: 1rem;
  }

  .sw-content-switcher-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .sw-content-mode-actions {
    display: flex;
    width: 100%;
    gap: 0.45rem;
  }

  .sw-mode-toggle-btn {
    flex: 1;
    justify-content: center;
    text-align: center;
    font-size: 0.72rem;
    padding: 0.45rem 0.4rem;
    white-space: nowrap;
  }

  /* Drill Card & Action Buttons */
  .sw-card {
    padding: 1rem 0.85rem;
    border-radius: 14px;
  }

  .sw-card-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.65rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .sw-card-title {
    font-size: 0.96rem;
  }

  .sw-prompt-box {
    padding: 0.75rem 0.85rem;
  }

  .sw-prompt-text {
    font-size: 0.92rem;
  }

  .sw-scaffolding-box {
    padding: 0.65rem 0.75rem;
  }

  .sw-textarea {
    min-height: 64px;
    padding: 0.65rem 0.75rem;
    font-size: 0.88rem;
  }

  .sw-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .sw-counters {
    text-align: center;
    font-size: 0.72rem;
  }

  .sw-btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    width: 100%;
  }

  .sw-btn,
  .sw-btn-ai {
    justify-content: center;
    padding: 0.5rem 0.65rem;
    font-size: 0.78rem;
    width: 100%;
  }

  /* AI Result Diagnostic Panel */
  .sw-ai-panel {
    padding: 0.85rem;
  }

  .sw-ai-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .sw-band-badge {
    font-size: 0.78rem;
    padding: 0.2rem 0.5rem;
  }

  /* Focus Navigation Bar (Bottom) */
  .sw-focus-nav-bar {
    position: sticky;
    bottom: 0.75rem;
    z-index: 35;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    margin-top: 1rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  }

  .sw-focus-nav-btn {
    flex: 1;
    justify-content: center;
    padding: 0.45rem 0.65rem;
    font-size: 0.75rem;
  }

  .sw-focus-nav-center {
    font-size: 0.72rem;
  }

  /* Modals */
  .sw-modal-card {
    max-height: 85vh;
    border-radius: 14px;
    margin: 0.5rem;
  }

  .sw-modal-header {
    padding: 0.85rem 1rem;
  }

  .sw-modal-body {
    padding: 1rem;
  }

  .sw-modal-footer {
    padding: 0.85rem 1rem;
    flex-direction: column;
    gap: 0.4rem;
  }

  .sw-modal-footer .sw-btn-primary,
  .sw-modal-footer .sw-btn-secondary {
    width: 100%;
  }

  /* Toast Notification */
  .sw-toast {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    justify-content: center;
    padding: 0.55rem 0.85rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .sw-brand-text {
    max-width: 125px;
    font-size: 0.88rem;
  }

  .sw-hero-title {
    font-size: 1.45rem;
  }

  .sw-tier1-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
  }

  .sw-tier1-btn {
    padding: 0.5rem 0.6rem;
    min-height: 52px;
  }

  .sw-tier1-title {
    font-size: 0.7rem;
  }

  .sw-focus-nav-bar {
    flex-wrap: nowrap;
    gap: 0.4rem;
  }

  #prevWorkoutDrillLabel,
  #nextWorkoutDrillLabel {
    display: inline;
    font-size: 0.72rem;
  }
}

