/* Language Studios — The Language Page / EduWonderLab
   Google-Grade Interactive Discourse & Syntax Studio */

.lang-studios-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 5rem;
  color: var(--ink, #0f172a);
}

.ls-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 2.25rem 2.5rem;
  background:
    radial-gradient(1000px 400px at 95% -10%, rgb(46 74 148 / 12%), transparent 70%),
    radial-gradient(800px 350px at 5% 110%, rgb(138 58 92 / 10%), transparent 70%),
    linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgb(226 232 240 / 90%);
  border-radius: var(--r-xl, 28px);
  box-shadow:
    0 1px 2px rgb(15 23 42 / 4%),
    0 8px 24px -8px rgb(15 23 42 / 6%),
    inset 0 1px 0 rgb(255 255 255 / 90%);
  position: relative;
  overflow: hidden;
}

.ls-header::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--reading, #2e4a94), var(--speaking, #8a3a5c), var(--writing, #9a4a26));
}

.ls-title-wrap {
  flex: 1 1 36rem;
}

.ls-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand, #1d2b58);
  margin-bottom: 0.6rem;
}

.ls-title-wrap h1 {
  font-family: var(--font-display, "Fraunces", Georgia, serif);
  font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);
  font-weight: 650;
  line-height: 1.15;
  color: var(--mi-900, #121c3f);
  margin: 0 0 0.85rem;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.ls-lead {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-2, #334155);
  max-width: 68ch;
  margin: 0;
  text-wrap: pretty;
}

.ls-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.15rem;
  background: rgb(255 255 255 / 95%);
  border: 1px solid rgb(46 74 148 / 30%);
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--brand, #1d2b58);
  box-shadow: 0 4px 14px -3px rgb(29 43 88 / 12%), inset 0 1px 0 #fff;
  flex: none;
  white-space: nowrap;
}

.ls-badge .ico {
  color: var(--reading, #2e4a94);
  width: 1.25rem;
  height: 1.25rem;
}

/* ── Navigation Tabs ─────────────────────────────────────────────────── */
.ls-nav-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: var(--surface-2, #f1f5f9);
  padding: 0.45rem;
  border-radius: var(--radius, 16px);
  border: 1px solid rgb(226 232 240 / 80%);
}

.ls-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2, #334155);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: var(--radius-sm, 10px);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.2, 0, 0, 1);
  text-align: center;
  line-height: 1.25;
}

.ls-tab-btn .ico {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--ink-3, #64748b);
  transition: color 0.18s ease;
  flex: none;
}

.ls-tab-btn:hover {
  background: rgb(255 255 255 / 75%);
  color: var(--brand, #1d2b58);
}

.ls-tab-btn:hover .ico {
  color: var(--brand, #1d2b58);
}

.ls-tab-btn.active {
  background: #ffffff;
  color: var(--brand, #1d2b58);
  border-color: rgb(203 213 225 / 80%);
  box-shadow: 0 2px 8px -2px rgb(15 23 42 / 10%), 0 1px 2px rgb(15 23 42 / 6%);
}

.ls-tab-btn.active .ico {
  color: var(--brand, #1d2b58);
}

/* ── Panel Stages ────────────────────────────────────────────────────── */
.ls-panel-section {
  background: #ffffff;
  border: 1px solid rgb(226 232 240 / 85%);
  border-radius: var(--r-xl, 24px);
  padding: clamp(1.5rem, 3vw, 2.75rem);
  box-shadow:
    0 1px 3px rgb(15 23 42 / 4%),
    0 12px 32px -12px rgb(15 23 42 / 6%),
    inset 0 1px 0 rgb(255 255 255 / 90%);
  position: relative;
}

.mlb-panel { display: grid; gap: 1rem; }
.mlb-panel .ls-section-banner { margin-bottom: 0; }
.mlb-panel h2, .mlb-panel h3 { color: var(--mi-900, #121c3f); }
.mlb-model, .mlb-separate, .mlb-scaffold, .mlb-original, .mlb-transfer-model, .mlb-transfer-success {
  border: 1px solid #cbd5e1; border-radius: 14px; padding: 1rem 1.15rem; background: #f8fafc;
}
.mlb-model { overflow-x: auto; }
.mlb-model > p { margin: .8rem 0 0; }
.mlb-ratio-table { width: 100%; border-collapse: collapse; min-width: 290px; text-align: center; }
.mlb-ratio-table caption { padding: 0 0 .6rem; font-weight: 800; text-align: left; }
.mlb-ratio-table th, .mlb-ratio-table td { border: 1px solid #cbd5e1; padding: .6rem; }
.mlb-ratio-table th { background: #e8f3f5; }
.mlb-separate { border-left: 5px solid #075568; background: #eff8f7; }
.mlb-separate p { margin: .35rem 0 0; }
.mlb-support, .mlb-panel form { display: grid; gap: .55rem; }
.mlb-support { max-width: 38rem; font-weight: 700; }
.mlb-panel select, .mlb-panel textarea, .mlb-panel input { font: inherit; color: #17324d; width: 100%; border: 1px solid #64748b; border-radius: 9px; padding: .75rem; background: #fff; }
.mlb-panel select { min-height: 44px; }
.mlb-panel textarea { min-height: 7rem; resize: vertical; }
.mlb-panel button, .mlb-panel .btn { min-height: 44px; }
.mlb-panel :focus-visible { outline: 3px solid #0b7285; outline-offset: 2px; }
.mlb-word-bank { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .45rem; }
.mlb-word-bank span { padding: .25rem .6rem; border: 1px solid #94a3b8; border-radius: 999px; background: #fff; font-weight: 700; }
.mlb-scaffold p { margin: .6rem 0 0; }
.mlb-feedback { padding: .8rem 1rem; border-left: 4px solid #075568; background: #eff8f7; }
.mlb-evidence { display: flex; flex-wrap: wrap; gap: .5rem 1rem; list-style: none; padding: 0; }
.mlb-evidence li { padding: .35rem .55rem; border: 1px solid #cbd5e1; border-radius: 8px; }
.mlb-evidence .is-present { background: #eaf6ee; border-color: #5b9b6c; }
.mlb-evidence .is-next { background: #fff8e5; border-color: #bd963e; }
.mlb-original { border-left: 4px solid #64748b; }
.mlb-transfer-model { display: flex; flex-wrap: wrap; gap: .5rem 2rem; }
.mlb-transfer-model p { margin: 0; }
.mlb-comparison { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.mlb-comparison article { min-width: 0; border: 1px solid #cbd5e1; border-radius: 12px; padding: .9rem; overflow-wrap: anywhere; }
.mlb-comparison article h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.mlb-caution { color: #334155; border-top: 1px solid #cbd5e1; padding-top: .75rem; }
@media (max-width: 600px) {
  .mlb-comparison { grid-template-columns: 1fr; }
  .mlb-evidence { display: grid; }
  .mlb-transfer-model { display: grid; gap: .4rem; }
}

.ls-section-banner {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--surface-2, #f1f5f9);
}

.ls-section-banner h3 {
  font-family: var(--font-display, "Fraunces", Georgia, serif);
  font-size: clamp(1.4rem, 1.2rem + 0.6vw, 1.85rem);
  font-weight: 650;
  color: var(--mi-900, #121c3f);
  margin: 0 0 0.5rem;
  letter-spacing: -0.015em;
}

.ls-section-banner p {
  color: var(--ink-2, #334155);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 72ch;
  margin: 0;
}

/* --- Studio 1: WIDA Discourse Slider --- */
.wida-slider-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f0f7ff 100%);
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius, 16px);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 2%);
}

.wida-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.wida-domain-tabs {
  display: inline-flex;
  gap: 0.45rem;
  background: var(--surface-2, #f1f5f9);
  padding: 0.35rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
}

.wida-domain-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink-2, #334155);
  cursor: pointer;
  transition: all 0.18s ease;
}

.wida-domain-btn .ico {
  width: 1.05rem;
  height: 1.05rem;
}

.wida-domain-btn:hover {
  background: #ffffff;
  color: var(--brand, #1d2b58);
}

.wida-domain-btn.active {
  background: #ffffff;
  color: var(--brand, #1d2b58);
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgb(0 0 0 / 8%);
}

.wida-range-wrap {
  margin: 1.5rem 0;
}

.wida-range-slider {
  width: 100%;
  accent-color: var(--brand, #1d2b58);
  cursor: pointer;
  height: 8px;
  border-radius: 9999px;
}

.wida-level-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink-3, #64748b);
  margin-top: 0.5rem;
}

.wida-output-display {
  background: #ffffff;
  border: 1.5px solid #93c5fd;
  border-radius: var(--radius, 16px);
  padding: 2rem;
  box-shadow: 0 6px 20px -4px rgb(37 99 235 / 10%);
}

.wida-level-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.85rem;
  background: #dbeafe;
  color: #1e40af;
}

.wida-passage-text {
  font-size: 1.25rem;
  font-family: var(--font-display, "Fraunces", Georgia, serif);
  line-height: 1.65;
  color: var(--ink, #0f172a);
  margin-bottom: 1.5rem;
}

.wida-linguistic-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 1.25rem;
}

.wida-breakdown-cell strong {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-3, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
  font-weight: 800;
}

.wida-breakdown-cell p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-2, #334155);
  font-weight: 600;
  line-height: 1.45;
}

/* --- Studio 2: Dynamic Syntax Clause Slicer --- */
.syntax-slicer-workbench {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius, 16px);
  padding: 2rem;
  margin-bottom: 2rem;
}

.clause-drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  padding: 2rem 1.5rem;
  background: var(--surface-2, #f8fafc);
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius, 14px);
  min-height: 100px;
  margin-bottom: 1.75rem;
}

.clause-block {
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-sm, 10px);
  font-size: 1.0625rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 8px -2px rgb(0 0 0 / 8%);
  user-select: none;
  transition: transform 0.15s ease;
}

.clause-block:hover {
  transform: translateY(-2px);
}

.clause-independent {
  background: #e0f2fe;
  border: 2px solid #38bdf8;
  color: #0369a1;
}

.clause-dependent {
  background: #fef3c7;
  border: 2px solid #facc15;
  color: #854d0e;
}

.clause-comma {
  background: #ffe4e6;
  border: 2px solid #fda4af;
  color: #be123c;
  font-size: 1.75rem;
  font-family: var(--font-display, "Fraunces", Georgia, serif);
  padding: 0.25rem 0.85rem;
  line-height: 1;
}

.syntax-swap-btn {
  background: var(--brand, #1d2b58);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 2px 6px rgb(29 43 88 / 25%);
}

.syntax-swap-btn .ico {
  width: 1.1rem;
  height: 1.1rem;
}

.syntax-swap-btn:hover {
  background: var(--brand-deep, #080e25);
  transform: translateY(-1px);
}

.comma-rule-explainer {
  background: #eff6ff;
  border-left: 4px solid var(--reading, #2e4a94);
  padding: 1.15rem 1.5rem;
  border-radius: var(--radius-sm, 10px);
  font-size: 0.9375rem;
  color: #1e3a8a;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.comma-rule-explainer .ico {
  width: 1.35rem;
  height: 1.35rem;
  color: var(--reading, #2e4a94);
  flex: none;
}

/* --- Studio 3: Concentric Morphology & Cognate Wheel --- */
.morph-wheel-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
}

.wheel-rotators-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rotator-group {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm, 12px);
  padding: 1.15rem;
}

.rotator-group label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3, #64748b);
  margin-bottom: 0.5rem;
}

.rotator-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink, #0f172a);
  background: var(--surface, #ffffff);
}

.morph-card-result {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1.5px solid #6ee7b7;
  border-radius: var(--radius, 16px);
  padding: 2.25rem 2rem;
  text-align: center;
  box-shadow: 0 6px 18px -4px rgb(5 150 105 / 12%);
}

.assembled-word {
  font-family: var(--font-display, "Fraunces", Georgia, serif);
  font-size: 2.5rem;
  font-weight: 750;
  color: #065f46;
  margin-bottom: 0.4rem;
}

.assembled-pos {
  display: inline-block;
  background: #d1fae5;
  color: #047857;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 1.15rem;
}

.assembled-meaning {
  font-size: 1.0625rem;
  color: #064e3b;
  margin-bottom: 1.35rem;
  line-height: 1.5;
}

.cognate-highlight-pill {
  background: #ffffff;
  border: 1.5px solid #a7f3d0;
  border-radius: 9999px;
  padding: 0.5rem 1.15rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #047857;
  box-shadow: 0 1px 3px rgb(0 0 0 / 4%);
}

.cognate-highlight-pill .ico {
  color: #059669;
}

/* --- Studio 4: Cohesion & Logic Balancer --- */
.cohesion-balancer-stage {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius, 16px);
  padding: 2rem;
  margin-bottom: 2rem;
}

.connector-bank-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.connector-tag-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 9999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink-2, #334155);
  cursor: pointer;
  transition: all 0.15s ease;
}

.connector-tag-btn:hover {
  border-color: var(--brand, #1d2b58);
  color: var(--brand, #1d2b58);
  background: #eff6ff;
}

.connector-tag-btn.active {
  background: var(--brand, #1d2b58);
  color: #ffffff;
  border-color: var(--brand, #1d2b58);
  box-shadow: 0 2px 6px rgb(29 43 88 / 25%);
}

.passage-repair-box {
  background: var(--surface-2, #f8fafc);
  border: 1.5px solid #93c5fd;
  border-radius: var(--radius-sm, 12px);
  padding: 1.75rem;
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--ink, #0f172a);
}

.slot-marker {
  display: inline-block;
  padding: 0.15rem 0.75rem;
  background: #fef3c7;
  border: 2px dashed #f59e0b;
  border-radius: 8px;
  font-weight: 800;
  color: #92400e;
}

/* --- Studio 5: Spot the Syntax Glitch --- */
.glitch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.glitch-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius, 14px);
  padding: 1.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgb(0 0 0 / 4%);
}

.glitch-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 16px -2px rgb(0 0 0 / 6%);
}

.glitch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.glitch-category-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  text-transform: uppercase;
  background: #fee2e2;
  color: #991b1b;
}

.glitch-sentence-box {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink, #0f172a);
  background: var(--surface-2, #f8fafc);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm, 10px);
  padding: 1.15rem;
  margin-bottom: 1.15rem;
}

.glitch-word-target {
  cursor: pointer;
  border-bottom: 2.5px dashed #ef4444;
  padding: 0 0.2rem;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: background 0.15s ease;
}

.glitch-word-target .ico {
  width: 0.95rem;
  height: 0.95rem;
  color: #ef4444;
}

.glitch-word-target:hover {
  background: #fee2e2;
}

.glitch-solution {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: var(--radius-sm, 10px);
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  color: #065f46;
}

.glitch-solution .ico {
  width: 1.1rem;
  height: 1.1rem;
  color: #059669;
  vertical-align: -0.15em;
}

@media (max-width: 860px) {
  .ls-header {
    flex-direction: column;
    padding: 1.5rem;
  }
  .ls-nav-tabs {
    grid-template-columns: 1fr;
  }
  .wida-controls-row {
    flex-direction: column;
    align-items: stretch;
  }
}
