/*!***********************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./ui/lisan/styles/lisan.css ***!
  \***********************************************************************************************************************************************************************************************************************************************************************/
@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=Tajawal:wght@400;500;700&display=swap');

/* ===========================================
   lisan — Design System
   Warm AI workspace, soft neumorphic depth
   =========================================== */

/* ⚠️ قاعدة المنصة الملزمة (أمر المالك 2026-08-31): اتجاه النص يتبع محتواه، لا لغة الواجهة.
   النص الألماني/اللاتيني يُعرض دائماً LTR محاذىً لليسار حتى داخل واجهة عربية RTL،
   والنص العربي يُعرض دائماً RTL. unicode-bidi: plaintext يجعل المتصفح يقرر الاتجاه
   من أول حرفٍ ذي دلالة في المحتوى — فينطبق تلقائياً على كل الشاشات بلا تخصيص يدوي. */
[data-locale] :where(
  p, li, td, th, h1, h2, h3, h4, h5, h6,
  .display, .mono, .muted, .label-eyebrow, .pill, .nav-item, .crumb
) {
  unicode-bidi: plaintext;
  text-align: start;
}
/* Form controls ignore unicode-bidi: plaintext in browsers — their direction must come from
   an explicit dir attribute on the element. German inputs carry dir="ltr" at the call site. */

/* ⚠️ قاعدة قاطعة للنص الألماني (أمر المالك 2026-08-31): عنصر يعرض محتوى ألمانياً يُعزل عن
   اتجاه الأب rtl ويُفرض LTR بلا استثناء — بما فيها حاويات flex التي تتراص كلماتها من اليسار.
   unicode-bidi: isolate يمنع rtl الأب من عكس ترتيب الكلمات اللاتينية داخل الحاوية. */
.ltr,
[dir="ltr"] {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: -webkit-isolate !important;
  unicode-bidi: isolate !important;
}
.ltr-flex {
  direction: ltr !important;
  justify-content: flex-start !important;
  text-align: left !important;
  unicode-bidi: -webkit-isolate !important;
  unicode-bidi: isolate !important;
}

:root {
  /* Type */
  --ff-display: "Inter", system-ui, -apple-system, sans-serif;
  --ff-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ff-arabic: "Tajawal", "Alexandria", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --ff-mono: ui-monospace, "Cascadia Code", "Fira Code", monospace;

  /* Type scale (compact, dense product feel) */
  --t-2xs: 10.5px;
  --t-xs: 11.5px;
  --t-sm: 12.5px;
  --t-md: 13.5px;
  --t-base: 14px;
  --t-lg: 16px;
  --t-xl: 19px;
  --t-2xl: 24px;
  --t-3xl: 32px;
  --t-4xl: 44px;

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;

  /* Radii */
  --r-xs: 5px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-2xl: 28px;
  --r-pill: 999px;

  /* Light theme — warm cream */
  --bg: oklch(95% 0.012 80);
  --bg-2: oklch(93% 0.014 80);
  --surface: oklch(97.5% 0.008 80);
  --surface-2: oklch(96% 0.011 80);
  --surface-sunk: oklch(91% 0.014 80);
  --ink: oklch(24% 0.012 70);
  --ink-2: oklch(42% 0.014 70);
  --ink-3: oklch(58% 0.012 70);
  --ink-4: oklch(72% 0.010 75);
  --line: oklch(87% 0.012 80);
  --line-soft: oklch(91% 0.010 80);

  /* Accents — olive primary, saffron highlight */
  --accent: oklch(54% 0.085 115);
  --accent-2: oklch(64% 0.085 115);
  --accent-soft: oklch(88% 0.040 115);
  --accent-ink: oklch(32% 0.060 115);

  --saffron: oklch(82% 0.135 85);
  --saffron-soft: oklch(92% 0.060 85);
  --saffron-ink: oklch(45% 0.090 70);

  --plum: oklch(50% 0.085 25);
  --plum-soft: oklch(91% 0.030 25);

  --blue: oklch(58% 0.090 245);
  --blue-soft: oklch(92% 0.030 245);

  --green: oklch(58% 0.090 150);
  --green-soft: oklch(91% 0.040 150);

  /* Neumorphic shadows — layered, warm */
  --hi: rgba(255, 255, 252, 0.85);
  --lo: rgba(74, 56, 22, 0.10);
  --lo-soft: rgba(74, 56, 22, 0.06);

  --shadow-raised:
    0 1px 0 var(--hi) inset,
    0 -1px 0 var(--lo-soft) inset,
    0 1px 2px rgba(74, 56, 22, 0.04),
    0 10px 28px -14px rgba(74, 56, 22, 0.18);
  --shadow-card:
    0 1px 0 var(--hi) inset,
    0 1px 2px rgba(74, 56, 22, 0.03),
    0 8px 22px -16px rgba(74, 56, 22, 0.14);
  --shadow-pressed:
    inset 0 2px 4px rgba(74, 56, 22, 0.10),
    inset 0 -1px 0 rgba(255, 255, 252, 0.4);
  --shadow-pop:
    0 1px 0 var(--hi) inset,
    0 2px 4px rgba(74, 56, 22, 0.06),
    0 24px 48px -16px rgba(74, 56, 22, 0.22);
  --shadow-pill:
    0 1px 0 var(--hi) inset,
    0 1px 1px rgba(74, 56, 22, 0.03),
    0 4px 12px -6px rgba(74, 56, 22, 0.12);

  --focus-ring: 0 0 0 3px oklch(82% 0.135 85 / 0.45);
}

[data-theme="dark"] {
  --bg: oklch(20% 0.012 70);
  --bg-2: oklch(22% 0.012 70);
  --surface: oklch(24% 0.014 70);
  --surface-2: oklch(27% 0.014 70);
  --surface-sunk: oklch(18% 0.012 70);
  --ink: oklch(94% 0.010 80);
  --ink-2: oklch(78% 0.014 80);
  --ink-3: oklch(60% 0.012 80);
  --ink-4: oklch(45% 0.010 80);
  --line: oklch(32% 0.014 70);
  --line-soft: oklch(28% 0.012 70);

  --accent: oklch(72% 0.10 115);
  --accent-2: oklch(80% 0.10 115);
  --accent-soft: oklch(32% 0.05 115);
  --accent-ink: oklch(88% 0.10 115);

  --saffron: oklch(82% 0.135 85);
  --saffron-soft: oklch(34% 0.07 85);
  --saffron-ink: oklch(88% 0.13 85);

  --plum-soft: oklch(30% 0.07 25);
  --blue-soft: oklch(28% 0.06 245);
  --green-soft: oklch(28% 0.06 150);

  --hi: rgba(255, 255, 252, 0.05);
  --lo: rgba(0, 0, 0, 0.45);
  --lo-soft: rgba(0, 0, 0, 0.3);

  --shadow-raised:
    0 1px 0 var(--hi) inset,
    0 -1px 0 rgba(0,0,0,0.3) inset,
    0 1px 2px rgba(0,0,0,0.4),
    0 10px 28px -14px rgba(0,0,0,0.6);
  --shadow-card:
    0 1px 0 var(--hi) inset,
    0 1px 2px rgba(0,0,0,0.3),
    0 8px 22px -16px rgba(0,0,0,0.5);
  --shadow-pressed:
    inset 0 2px 4px rgba(0,0,0,0.45),
    inset 0 -1px 0 var(--hi);
  --shadow-pop:
    0 1px 0 var(--hi) inset,
    0 24px 48px -16px rgba(0,0,0,0.6);
}

/* Accent hue variations */
[data-accent="saffron"] {
  --accent: oklch(72% 0.13 75);
  --accent-2: oklch(80% 0.13 75);
  --accent-soft: oklch(90% 0.055 75);
  --accent-ink: oklch(40% 0.09 65);
}
[data-accent="ochre"] {
  --accent: oklch(62% 0.115 55);
  --accent-2: oklch(70% 0.115 55);
  --accent-soft: oklch(90% 0.045 55);
  --accent-ink: oklch(36% 0.08 50);
}
[data-accent="terracotta"] {
  --accent: oklch(58% 0.110 35);
  --accent-2: oklch(66% 0.110 35);
  --accent-soft: oklch(90% 0.040 35);
  --accent-ink: oklch(34% 0.08 30);
}

.accent-settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-gap: 8px;
  gap: 8px;
}

.brand-assets-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(2, minmax(0, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.brand-asset {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink-2);
  display: grid;
  grid-gap: 6px;
  gap: 6px;
  font-size: var(--t-sm);
  transition: border-color 150ms ease, color 150ms ease;
}

.brand-asset:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.brand-asset:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.brand-asset-preview {
  min-height: 116px;
  border-radius: var(--r-sm);
  background: var(--surface-sunk);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-asset-preview img {
  display: block;
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.brand-asset-logo .brand-asset-preview img {
  width: 148px;
  height: 100px;
}

.brand-asset-preview-white { background: #fff; }
.brand-asset-preview-favicon img { width: 48px; height: 48px; }
.brand-asset small { color: var(--ink-4); }

.mascot-assets-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-2);
  font-size: var(--t-sm);
}

.mascot-assets-heading small {
  color: var(--ink-4);
  font-size: var(--t-xs);
}

.mascot-assets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.mascot-asset {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink-2);
  display: grid;
  grid-gap: 6px;
  gap: 6px;
  font-size: var(--t-sm);
  transition: border-color 150ms ease, color 150ms ease;
}

.mascot-asset:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.mascot-asset:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mascot-asset-preview {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  background: var(--surface-sunk);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.mascot-asset-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mascot-asset small {
  color: var(--ink-4);
  line-height: 1.45;
}

.accent-setting {
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  text-align: start;
}

.accent-setting[data-active="true"] {
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.accent-setting-swatch {
  width: 100%;
  height: 22px;
  border-radius: 999px;
}

/* Density */
[data-density="relaxed"] {
  --s-3: 14px;
  --s-4: 18px;
  --s-5: 24px;
  --s-6: 28px;
  --s-7: 36px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ff-sans);
  font-size: var(--t-base);
  font-feature-settings: "ss01", "cv11", "cv10";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
a { color: inherit; text-decoration: none; }

@media (max-width: 760px) {
  .translator-grid { grid-template-columns: 1fr !important; }
  .translator-grid > :first-child {
    -webkit-border-end: 0 !important;
            border-inline-end: 0 !important;
    border-bottom: 1px solid var(--line-soft);
  }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-track { background: transparent; }

/* ===========================================
   LAYOUT — App shell
   =========================================== */

.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100dvh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background:
    radial-gradient(1200px 800px at 80% -10%, oklch(96% 0.025 85) 0%, transparent 60%),
    radial-gradient(900px 600px at -10% 100%, oklch(96% 0.020 110) 0%, transparent 60%),
    var(--bg);
  transition: grid-template-columns 200ms cubic-bezier(.23, 1, .32, 1);
}

.app[data-sidebar-collapsed="true"] { grid-template-columns: 72px 1fr; }

[data-theme="dark"] .app {
  background:
    radial-gradient(1200px 800px at 80% -10%, oklch(26% 0.04 85) 0%, transparent 60%),
    radial-gradient(900px 600px at -10% 100%, oklch(26% 0.04 110) 0%, transparent 60%),
    var(--bg);
}

/* ===== Sidebar ===== */
.sidebar {
  display: flex;
  flex-direction: column;
  padding: 5px var(--s-3) var(--s-4);
  gap: 0;
  border-right: 1px solid var(--line-soft);
  overflow-y: auto;
}
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--line-soft); }

.brand {
  display: flex;
  align-items: stretch;
  gap: var(--s-2);
  padding: 0;
  min-height: 36px;
  position: relative;
}

.brand-identity {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--s-2);
  width: 100%;
}

.platform-logo-trial {
  width: 48px;
  height: 48px;
  display: block;
  border-radius: 9px;
  object-fit: cover;
  object-position: center;
  mix-blend-mode: multiply;
}

[data-theme="dark"] .platform-logo-trial {
  filter: invert(1);
  mix-blend-mode: screen;
}

.brand .mobile-close { -webkit-margin-start: auto; margin-inline-start: auto; }
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-2) 100%);
  display: grid; place-items: center;
  color: var(--bg);
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 16px;
  box-shadow: var(--shadow-pill);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(255,255,255,0.25), transparent 40%);
  pointer-events: none;
}
.brand-name {
  font-family: var(--ff-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.brand-name .ar {
  font-family: var(--ff-arabic);
  font-size: 13px;
  color: var(--ink-3);
  -webkit-margin-start: 6px;
          margin-inline-start: 6px;
  font-weight: 400;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: var(--s-2);
}
.nav-section-label {
  font-size: var(--t-2xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: var(--s-2) var(--s-3) 4px;
  font-weight: 500;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: var(--t-md);
  font-weight: 450;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item .nav-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}
.nav-item .nav-badge {
  -webkit-margin-start: auto;
          margin-inline-start: auto;
  font-size: var(--t-2xs);
  background: var(--surface-sunk);
  color: var(--ink-3);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 500;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.nav-item[data-active="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}
.nav-item[data-active="true"] .nav-icon { opacity: 1; color: var(--accent); }

.sidebar-footer {
  margin-top: auto;
  padding: var(--s-2);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.streak-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: var(--s-3);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.streak-row {
  display: flex; align-items: baseline; justify-content: space-between;
  font-family: var(--ff-display);
}
.streak-num {
  font-size: 22px; font-weight: 500;
  letter-spacing: -0.02em;
}
.streak-meta { font-size: var(--t-2xs); color: var(--ink-3); font-family: var(--ff-sans); text-transform: uppercase; letter-spacing: 0.06em; }
.streak-pips { display: flex; gap: 4px; }
.streak-pips span {
  flex: 1 1; height: 6px; border-radius: 3px;
  background: var(--surface-sunk);
}
.streak-pips span.on { background: var(--accent); }
.streak-pips span.today {
  background: var(--saffron);
  box-shadow: 0 0 0 2px var(--saffron-soft);
}

.user-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.user-pill .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--plum-soft), var(--accent-soft));
  display: grid; place-items: center;
  font-family: var(--ff-display); font-size: 12px; color: var(--accent-ink);
  font-weight: 500;
}
.user-pill .name { font-size: var(--t-md); font-weight: 500; }
.user-pill .level { font-size: var(--t-2xs); color: var(--ink-3); font-family: var(--ff-mono); }

/* ===== Main canvas ===== */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 10px var(--s-5);
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in oklch, var(--bg) 75%, transparent);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  min-height: 50px;
}
.crumb {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--t-md); color: var(--ink-3);
}
.crumb b { color: var(--ink); font-weight: 500; }
.topbar-logo-slot {
  width: 32px;
  height: 32px;
  display: block;
  position: relative;
  flex: 0 0 32px;
  isolation: isolate;
  transform: translateX(-3px);
}
.topbar-brand-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  display: block;
  border-radius: 8px;
  object-fit: contain;
  transform: translate(-50%, -50%);
  transition:
    opacity 800ms cubic-bezier(.4, 0, .2, 1),
    transform 800ms cubic-bezier(.4, 0, .2, 1);
}
.topbar-brand-logo-dark { display: none; }
[data-theme="dark"] .topbar-brand-logo-light { display: none; }
[data-theme="dark"] .topbar-brand-logo-dark { display: block; }
.topbar-brand-mascot {
  width: 60px;
  height: 60px;
  opacity: 0;
  transform: translate(calc(-50% - 1.3px), calc(-50% - 2.3px)) scale(.985);
  will-change: opacity, transform;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  border-radius: 0;
  z-index: 1;
}
.topbar-logo-slot[data-mascot-active="true"] .topbar-brand-logo:not(.topbar-brand-mascot) {
  opacity: 0;
  transform: translate(-50%, -50%) scale(.985);
  transition-duration: 460ms;
}
.topbar-logo-slot[data-mascot-active="true"] .topbar-brand-mascot {
  opacity: 1;
  transform: translate(calc(-50% - 1.3px), calc(-50% - 2.3px)) scale(1);
  transition-duration: 460ms;
}
.topbar-spacer { flex: 1 1; }
.topbar-search {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-sunk);
  width: 280px;
  color: var(--ink-3);
  font-size: var(--t-sm);
}
.topbar-search kbd {
  -webkit-margin-start: auto;
          margin-inline-start: auto;
  font-family: var(--ff-mono);
  font-size: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--ink-3);
}

.scroll {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1;
  min-width: 0;
}

/* ===========================================
   PRIMITIVES — Buttons / Cards / Pills
   =========================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 10px;
  background: color-mix(in oklch, var(--surface) 88%, var(--surface-2));
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  border: 1px solid color-mix(in oklch, var(--line) 82%, transparent);
  transition:
    transform 140ms cubic-bezier(0.23, 1, 0.32, 1),
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.sidebar-collapse {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink-3);
  cursor: pointer;
  margin: 0;
  flex: 0 0 auto;
  align-self: center;
  transition: color 150ms ease;
}

.brand .sidebar-collapse {
  width: 36px;
  height: 36px;
}

.sidebar-collapse svg {
  width: 16px;
  height: 16px;
  opacity: .7;
  transition: opacity 150ms ease;
}
.sidebar-collapse:hover { color: var(--ink); }
.sidebar-collapse:hover svg { opacity: 1; }
.sidebar-collapse:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app[data-sidebar-collapsed="true"] .sidebar {
  padding-inline: 8px;
  overflow-x: hidden;
}
.app[data-sidebar-collapsed="true"] .brand {
  padding-inline: 0;
}
.app[data-sidebar-collapsed="true"] .brand-identity {
  justify-content: center;
  gap: 0;
}
.app[data-sidebar-collapsed="true"] .nav-section-label,
.app[data-sidebar-collapsed="true"] .nav-item-label,
.app[data-sidebar-collapsed="true"] .nav-badge,
.app[data-sidebar-collapsed="true"] .streak-card,
.app[data-sidebar-collapsed="true"] .user-pill > div:last-child { display: none; }
.app[data-sidebar-collapsed="true"] .sidebar-collapse { margin: 0; }
.sidebar nav .nav-section:first-child,
.app[data-sidebar-collapsed="true"] .nav-section:first-child { padding-top: 0; }
.app[data-sidebar-collapsed="true"] .nav-item {
  justify-content: center;
  gap: 0;
  padding-inline: 0;
  min-height: 34px;
}
.app[data-sidebar-collapsed="true"] .nav-item .nav-icon { width: 16px; height: 16px; }
.app[data-sidebar-collapsed="true"] .sidebar-footer { padding-inline: 3px; }
.app[data-sidebar-collapsed="true"] .user-pill { justify-content: center; padding-inline: 0; }

@media (hover: hover) {
  .btn:hover {
    background: var(--surface-2);
    color: var(--ink);
    border-color: color-mix(in oklch, var(--accent) 38%, var(--line));
  }
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 26%, transparent);
}
.btn:active { transform: scale(0.97); }
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
}
.btn svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

.btn-primary {
  background: var(--accent);
  color: oklch(99% 0.005 80);
  border-color: transparent;
  box-shadow: none;
}

@media (hover: hover) {
  .btn-primary:hover {
    background: color-mix(in oklch, var(--accent) 88%, var(--ink));
    color: oklch(99% 0.005 80);
    border-color: transparent;
  }
}

.btn-ghost {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
  color: var(--ink-2);
}

@media (hover: hover) {
  .btn-ghost:hover {
    background: var(--surface-sunk);
    border-color: transparent;
    color: var(--ink);
  }
}

.btn-icon {
  width: 34px; height: 34px; padding: 0;
  justify-content: center;
}
.btn-sm {
  height: 30px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: var(--t-xs);
}

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--ff-sans);
  font-size: 12px;
  padding: 2.5px 8.5px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 550;
  line-height: 18px;
  border: 1px solid var(--line-soft);
}
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.pill.saffron { background: var(--saffron-soft); color: var(--saffron-ink); border-color: transparent; }
.pill.blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.pill.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.pill.plum { background: var(--plum-soft); color: var(--plum); border-color: transparent; }
.pill.mono { font-family: var(--ff-sans); font-size: 12px; font-weight: 500; padding: 2.5px 8.5px; letter-spacing: normal; }
.pill.ipa {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: normal;
  color: var(--ink-2);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  padding: 2.5px 8.5px;
  font-feature-settings: "liga" 0;
}
.pill.dot::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  -webkit-margin-end: 2px;
          margin-inline-end: 2px;
  opacity: 0.7;
}

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.card-raised { box-shadow: var(--shadow-raised); }
.card-pop { box-shadow: var(--shadow-pop); }
.card-sunk {
  background: var(--surface-sunk);
  box-shadow: var(--shadow-pressed);
  border-radius: var(--r-lg);
}

.kbd {
  font-family: var(--ff-mono);
  font-size: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--ink-3);
  line-height: 1.4;
}

.label-eyebrow {
  font-family: var(--ff-sans);
  font-size: var(--t-sm);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  color: var(--ink-2);
}

.display { font-family: var(--ff-display); font-weight: 500; letter-spacing: -0.02em; }
.ar { font-family: var(--ff-arabic); }
.mono { font-family: var(--ff-mono); }

.h-divider { height: 1px; background: var(--line-soft); margin: var(--s-3) 0; }

/* ===========================================
   View-specific styles imported in their files via inline styles
   General page padding
   =========================================== */
.view { padding: var(--s-5) var(--s-6); }
.view-narrow { max-width: 1200px; margin: 0 auto; }
.view-row { display: flex; gap: var(--s-5); }


/* Animations */
@keyframes pulse-ai {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}
.shimmer {
  background: linear-gradient(90deg, var(--surface-sunk) 0%, var(--surface-2) 50%, var(--surface-sunk) 100%);
  background-size: 400px 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--r-sm);
}

@keyframes wave {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

@keyframes laser-glow-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

@keyframes neural-dot-pulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1.2); opacity: 1; filter: drop-shadow(0 0 6px var(--accent)); }
}

/* small utility */
.row { display: flex; align-items: center; gap: var(--s-2); }
.col { display: flex; flex-direction: column; gap: var(--s-2); }
.spacer { flex: 1 1; }
.muted { color: var(--ink-3); }
.faint { color: var(--ink-4); }
.tnum { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

/* Hide scrollbars in some places */
.no-scrollbar::-webkit-scrollbar,
[role="tablist"]::-webkit-scrollbar { display: none !important; }
.no-scrollbar,
[role="tablist"] { scrollbar-width: none !important; -ms-overflow-style: none !important; }



/* Tutor view — collapse right grammar rail on narrow viewports */
@media (max-width: 1180px) {
  .tutor-grid { grid-template-columns: 200px minmax(0,1fr) !important; }
  .tutor-right-rail { display: none !important; }
}

/**
 * ⚠️ **الجوّال: العمود الأيسر يصير شريطاً أفقياً لا يختفي ولا يتكدّس.**
 *
 * عطل مقيس بجهاز حقيقي (لقطة المالك 2026-07-28): الشبكة الثلاثية تنهار عمودياً بالجوّال،
 * فتحتلّ «أوضاع المعلّم» و«الجلسات الأخيرة» **نصف الشاشة** وتُحشر المحادثة بينهما — وهي
 * الشيء الوحيد الذي جاء المستخدم لأجله.
 *
 * والحلّ ليس إخفاء العمود (تضيع الأوضاع) بل **قلب اتجاهه**: صفٌّ أفقي قابل للتمرير أعلى
 * الشاشة، فالأوضاع تبقى متاحة بارتفاع سطرٍ واحد، والمحادثة تأخذ الباقي كاملاً.
 */
@media (max-width: 900px) {
  .tutor-grid {
    grid-template-columns: minmax(0,1fr) !important;
    grid-template-rows: auto minmax(0,1fr) !important;
  }
  /* العمود الأيسر ⇒ شريط أفقي */
  .tutor-grid > div:first-child {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 10px 12px !important;
    -webkit-border-end: none !important;
            border-inline-end: none !important;
    border-bottom: 1px solid var(--line-soft);
    scrollbar-width: none;
  }
  .tutor-grid > div:first-child::-webkit-scrollbar { display: none; }
  /* أزرار الأوضاع تصير شرائح أفقية لا تنكمش */
  .tutor-grid > div:first-child > div:first-of-type {
    flex-direction: row !important;
    gap: 8px;
  }
  .tutor-grid > div:first-child > div:first-of-type > button {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 7px 12px !important;
  }
  /* الوصف الثانوي والفاصل و«الجلسات الأخيرة» تُخفى بالجوّال — لا مساحة لها ولا حاجة */
  .tutor-grid > div:first-child > div:first-of-type > button > div:last-child,
  .tutor-grid > div:first-child > .label-eyebrow,
  .tutor-grid > div:first-child > .h-divider,
  .tutor-grid > div:first-child > div:last-child { display: none !important; }
}

/* ===========================================
   LIVE PLATFORM ADAPTATION
   =========================================== */

.mobile-menu,
.mobile-close,
.mobile-bottom-nav,
.mobile-menu-scrim {
  display: none;
}

.topbar-notifications {
  position: relative;
}

.notification-mark {
  position: absolute;
  inset-block-start: 6px;
  inset-inline-end: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--saffron-ink);
}

.view,
.view-narrow,
.view-wide,
.card,
.card-sunk,
.card-pop {
  min-width: 0;
}

.view img,
.view svg {
  max-width: 100%;
}

.view table {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 1080px) {
  .topbar-search {
    width: min(230px, 24vw);
  }

  .topbar-xp {
    display: none;
  }
}

@media (max-width: 760px) {
  .brand-assets-grid {
    grid-template-columns: 1fr;
  }

  .mascot-assets-grid {
    grid-template-columns: 1fr;
  }

  .mascot-assets-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .accent-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .translator-toolbar {
    flex-wrap: wrap;
  }

  .translator-toolbar .spacer {
    display: none;
  }

  .tone-control {
    width: 100%;
    padding: 6px 4px 0;
    border-top: 1px solid var(--line-soft);
    justify-content: center;
  }

  .tone-control > div {
    min-width: 0;
    flex: 1 1;
    max-width: 320px;
    margin-inline: auto;
  }

  .tone-control > div > span {
    flex: 1 1;
    justify-content: center;
    white-space: nowrap;
    padding-inline: 5px !important;
  }

  .translator-modern-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .translator-modern-head h1 { font-size: 24px; }
  .translator-modern-head .btn { width: 100%; justify-content: center; }

  .translator-modern-actions,
  .result-actions {
    display: flex;
    flex-wrap: wrap;
  }

  .translator-modern-actions > span { display: none; }
  .translator-modern-actions .btn-primary { -webkit-margin-start: auto; margin-inline-start: auto; }
  .translator-modern-german { font-size: 21px; }
  .translator-modern-tabs { gap: 14px; overflow-x: auto; }
  .translator-modern-tabs button { flex: 0 0 auto; white-space: nowrap; }
  .translator-modern-tokens > div { width: 50%; min-width: 0; }

  body {
    font-size: 14px;
  }

  .app {
    display: block;
    min-height: 100dvh;
    height: 100dvh;
    padding-bottom: 64px;
  }

  .main {
    min-height: calc(100dvh - 64px);
    height: calc(100dvh - 64px);
  }

  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 40;
    width: min(88vw, 320px);
    background: var(--bg);
    -webkit-border-end: 1px solid var(--line-soft);
            border-inline-end: 1px solid var(--line-soft);
    -webkit-border-start: 0;
            border-inline-start: 0;
    box-shadow: var(--shadow-pop);
    transform: translateX(-110%);
    transition: transform 180ms cubic-bezier(.2,.8,.2,1);
  }

  [dir="rtl"] .sidebar {
    --drawer-sign: -1;
    -webkit-border-start: 1px solid var(--line-soft);
            border-inline-start: 1px solid var(--line-soft);
    -webkit-border-end: 0;
            border-inline-end: 0;
  }

  .sidebar[data-open="true"] {
    transform: translateX(0);
  }

  [dir="rtl"] .sidebar {
    transform: translateX(110%);
  }

  [dir="rtl"] .sidebar[data-open="true"] {
    transform: translateX(0);
  }

  .mobile-menu-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    border: 0;
    background: color-mix(in oklch, var(--ink) 30%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .mobile-menu-scrim[data-open="true"] {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu,
  .mobile-close {
    display: inline-grid;
  }

  .mobile-close {
    -webkit-margin-start: auto;
            margin-inline-start: auto;
  }

  .topbar {
    min-height: 58px;
    padding: 8px 12px;
    gap: 8px;
    position: -webkit-sticky;
    position: sticky;
    inset-block-start: 0;
    z-index: 20;
  }

  .crumb > span:not(.topbar-logo-slot),
  .crumb > svg,
  .topbar-search,
  .topbar-notifications {
    display: none;
  }

  .crumb {
    min-width: 0;
  }

  .crumb b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .scroll {
    overscroll-behavior: contain;
  }

  .view {
    width: 100%;
    max-width: none !important;
    padding: 18px 14px 28px !important;
  }

  .view [style*="grid-template-columns"],
  .view [style*="gridTemplateColumns"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .view [style*="display: flex"],
  .view [style*="display:flex"],
  .view-row,
  .row {
    min-width: 0;
  }

  .view-row {
    flex-direction: column;
  }

  .view table {
    display: grid;
    grid-gap: 8px;
    gap: 8px;
  }

  .view thead {
    display: none;
  }

  .view tbody {
    display: grid;
    grid-gap: 8px;
    gap: 8px;
  }

  .view tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-gap: 6px 10px;
    gap: 6px 10px;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: var(--r-md);
    background: var(--surface);
  }

  .view td {
    min-width: 0;
    padding: 2px 0 !important;
    border: 0 !important;
    overflow-wrap: anywhere;
  }

  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 30;
    height: 64px;
    padding: 6px max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-soft);
    background: color-mix(in oklch, var(--bg) 92%, transparent);
    -webkit-backdrop-filter: blur(14px);
            backdrop-filter: blur(14px);
  }

  .mobile-bottom-nav a {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--ink-3);
    font-size: 9px;
    text-align: center;
  }

  .mobile-bottom-nav a span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-bottom-nav a[data-active="true"] {
    color: var(--accent-ink);
  }
}

.translation-facts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.translation-facts-slot {
  min-width: 0;
}

.translator-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.translator-pane-source textarea,
.translator-output {
  flex: 1 0 auto;
  min-height: 110px;
}

.translator-pane-actions {
  flex: 0 0 auto;
}

.translator-keyboard {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.translator-keyboard-switcher {
  justify-content: center;
  gap: 6px;
  margin-bottom: 3px;
}

.translator-keyboard-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.translator-key {
  min-width: 36px;
  justify-content: center;
}

.translator-key-space {
  width: min(280px, 45%);
  justify-content: center;
}

.translation-fact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.translation-fact strong {
  color: var(--ink);
  font-family: var(--ff-display);
  font-weight: 600;
}

.engine-badge {
  display: inline-grid;
  overflow: hidden;
  vertical-align: middle;
}

.engine-badge-value {
  grid-area: 1 / 1;
  color: var(--accent);
  animation: engine-slide-down 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.engine-badge-llm,
.engine-badge-guided {
  animation-name: engine-slide-up;
}

@keyframes engine-slide-up {
  from { opacity: 0; transform: translateY(70%); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes engine-slide-down {
  from { opacity: 0; transform: translateY(-70%); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .engine-badge-value {
    animation: none;
  }
}

@media (max-width: 760px) {
  .translator-keyboard-trigger,
  .translator-keyboard {
    display: none;
  }

  .translation-facts {
    display: flex;
  }

  .result-actions .btn {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: calc(50% - 6px);
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .view tr {
    grid-template-columns: minmax(0, 1fr);
  }

  .btn {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .app[data-sidebar-collapsed="true"] { grid-template-columns: 1fr; }
  .app[data-sidebar-collapsed="true"] .sidebar {
    width: min(88vw, 320px);
    padding: 5px var(--s-3) var(--s-4);
    overflow-y: auto;
  }
  .app[data-sidebar-collapsed="true"] .brand {
    padding: 0 0 var(--s-2);
  }
  .app[data-sidebar-collapsed="true"] .nav-section-label,
  .app[data-sidebar-collapsed="true"] .nav-item-label,
  .app[data-sidebar-collapsed="true"] .nav-badge,
  .app[data-sidebar-collapsed="true"] .streak-card,
  .app[data-sidebar-collapsed="true"] .user-pill > div:last-child { display: initial; }
  .app[data-sidebar-collapsed="true"] .nav-section:first-child { padding-top: var(--s-2); }
  .app[data-sidebar-collapsed="true"] .nav-item {
    justify-content: flex-start;
    gap: 10px;
    padding: 7px 10px;
  }
  .app[data-sidebar-collapsed="true"] .nav-item .nav-icon { width: 16px; height: 16px; }
  .app[data-sidebar-collapsed="true"] .sidebar-footer { padding: var(--s-2); }
  .app[data-sidebar-collapsed="true"] .user-pill { justify-content: flex-start; padding: 6px 8px; }
  .sidebar-collapse { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .topbar-logo-slot .topbar-brand-logo {
    transition-duration: 800ms !important;
  }

  .topbar-logo-slot[data-mascot-active="true"] .topbar-brand-logo {
    transition-duration: 460ms !important;
  }
}

