/* ==========================================================================
   Editor AI Guard - Visual Identity & Design System
   Academic Oxford Navy & Crisp Editorial Light Theme
   Single-Line Navigation, Responsive Popovers, High-Contrast WCAG AAA
   ========================================================================== */

/* Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@500;600;700;800;900&family=Outfit:wght@500;600;700;800&family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Noto+Sans+SC:wght@500;600;700&family=Noto+Sans+JP:wght@500;600;700&display=swap');

/* ==========================================================================
   Theme: Light Mode (DEFAULT - Academic Oxford Navy & Crisp White)
   ========================================================================== */
:root, [data-theme="light"] {
  --color-scheme: light;

  /* High Contrast Backgrounds */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-subtle: #f8fafc;
  --bg-card: #ffffff;
  
  /* Borders */
  --border-subtle: #e2e8f0;
  --border-prominent: #cbd5e1;
  --border-brand: #93c5fd;

  /* Typography */
  --text-main: #0f172a;       /* Deep slate for high contrast */
  --text-secondary: #334155;  /* Secondary slate */
  --text-muted: #64748b;      /* Slate muted */
  --text-inverse: #ffffff;

  /* Academic Brand Colors */
  --brand-primary: #1d4ed8;   /* Deep Academic Blue */
  --brand-secondary: #0f2b48; /* Oxford Navy */
  --brand-accent: #0284c7;    /* Scholarly Cyan */
  --brand-gradient: linear-gradient(135deg, #1e40af 0%, #1d4ed8 60%, #0284c7 100%);
  --brand-glow: 0 4px 18px rgba(29, 78, 216, 0.18);

  /* Academic State Colors */
  --color-safe: #059669;
  --color-safe-bg: #ecfdf5;
  --color-safe-border: #10b981;
  --color-safe-text: #065f46;

  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #f59e0b;
  --color-warning-text: #92400e;

  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #ef4444;
  --color-danger-text: #991b1b;

  /* UI Tokens */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 12px 30px -4px rgba(15, 23, 42, 0.1), 0 0 0 1px var(--border-subtle);

  /* Typography */
  --font-current: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-latin: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-arabic: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-numbers: 'Outfit', sans-serif;
}

/* ==========================================================================
   Theme: Dark Mode
   ========================================================================== */
[data-theme="dark"] {
  --color-scheme: dark;

  --bg-app: #090e17;
  --bg-surface: #111a28;
  --bg-surface-elevated: #1a2638;
  --bg-surface-subtle: #142032;
  --bg-card: #111a28;

  --border-subtle: #24344d;
  --border-prominent: #334866;
  --border-brand: #3b82f6;

  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #889bb4;
  --text-inverse: #090e17;

  --brand-primary: #3b82f6;
  --brand-secondary: #1d4ed8;
  --brand-accent: #38bdf8;
  --brand-gradient: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #0284c7 100%);
  --brand-glow: 0 4px 20px rgba(37, 99, 235, 0.3);

  --color-safe: #10b981;
  --color-safe-bg: rgba(16, 185, 129, 0.16);
  --color-safe-border: #059669;
  --color-safe-text: #6ee7b7;

  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.16);
  --color-warning-border: #d97706;
  --color-warning-text: #fcd34d;

  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.18);
  --color-danger-border: #dc2626;
  --color-danger-text: #fca5a5;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-subtle);
}

/* Language Typography */
[data-lang="ar"] {
  --font-current: var(--font-arabic);
}
[data-lang="en"], [data-lang="es"], [data-lang="fr"], [data-lang="de"], [data-lang="tr"], [data-lang="pt"] {
  --font-current: var(--font-latin);
}
[data-lang="zh"] {
  --font-current: 'Noto Sans SC', system-ui, sans-serif;
}
[data-lang="ja"] {
  --font-current: 'Noto Sans JP', system-ui, sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-current);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: radial-gradient(circle at 50% 0%, rgba(29, 78, 216, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Custom Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 var(--bg-surface-elevated);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-surface-elevated);
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-primary);
}

/* Top Banner */
.top-banner {
  background: #0f2b48;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  font-size: 0.85rem;
  position: relative;
  z-index: 50;
}

.top-banner.hidden {
  display: none;
}

.banner-content {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.badge-sparkle {
  background: #1d4ed8;
  color: #ffffff;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.74rem;
}

.banner-text {
  color: #e2e8f0;
  font-weight: 500;
}

.btn-upgrade-banner {
  background: #ffffff;
  color: #0f2b48;
  border: none;
  font-family: inherit;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.78rem;
  transition: all 0.2s;
}

.btn-upgrade-banner:hover {
  background: #e2e8f0;
}

.banner-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  margin-inline-start: auto;
}

/* ==========================================================================
   Header: STRICT SINGLE-LINE NAVIGATION
   ========================================================================== */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap; /* Strictly single line */
  white-space: nowrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: var(--brand-glow);
}

.brand-title {
  font-family: var(--font-numbers);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.brand-highlight {
  color: var(--brand-primary);
}

/* Single-Line Mode Navigation Tabs */
.nav-modes {
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 3px;
  flex-shrink: 0;
  white-space: nowrap;
}

.mode-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.83rem;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mode-tab:hover {
  color: var(--text-main);
}

.mode-tab.active {
  background: var(--bg-surface);
  color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

/* Header Action Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-theme-toggle {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-theme-toggle:hover {
  color: var(--text-main);
  border-color: var(--border-prominent);
}

/* ==========================================================================
   Custom Div Dropdown System & SVG Flags
   ========================================================================== */
.custom-dropdown-wrap {
  position: relative;
  user-select: none;
}

.dropdown-trigger {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 11px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s;
  white-space: nowrap;
}

.dropdown-trigger:hover, .custom-dropdown-wrap.open .dropdown-trigger {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.12);
}

.flag-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 14px;
  flex-shrink: 0;
}

.flag-icon-wrap svg, .option-flag-svg svg {
  border-radius: 2px;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
}

.dropdown-arrow {
  transition: transform 0.2s ease;
  opacity: 0.6;
}

.custom-dropdown-wrap.open .dropdown-arrow {
  transform: rotate(180deg);
}

/* Popover - Base styles */
.dropdown-popover {
  position: absolute;
  top: calc(100% + 6px);
  background: var(--bg-surface);
  border: 1px solid var(--border-prominent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 3px;
  z-index: 100;
  text-align: start;
}

/* Left Toolbar Dropdowns (e.g. Sample Texts) - Align to Start edge so they expand inwards towards center */
.toolbar-left .dropdown-popover,
#samplesDropdownWrap .dropdown-popover {
  inset-inline-start: 0 !important;
  inset-inline-end: auto !important;
  left: 0 !important;
  right: auto !important;
  min-width: 330px;
  max-width: 420px;
}

[dir="rtl"] .toolbar-left .dropdown-popover,
[dir="rtl"] #samplesDropdownWrap .dropdown-popover {
  inset-inline-start: 0 !important;
  inset-inline-end: auto !important;
  right: 0 !important;
  left: auto !important;
}

/* Right Toolbar & Header Dropdowns (e.g. Tone, Language) - Align to End edge so they expand inwards */
.header-actions .dropdown-popover,
.toolbar-right .dropdown-popover,
#langDropdownWrap .dropdown-popover,
#toneDropdownWrap .dropdown-popover {
  inset-inline-start: auto !important;
  inset-inline-end: 0 !important;
  right: 0 !important;
  left: auto !important;
}

[dir="rtl"] .header-actions .dropdown-popover,
[dir="rtl"] .toolbar-right .dropdown-popover,
[dir="rtl"] #langDropdownWrap .dropdown-popover,
[dir="rtl"] #toneDropdownWrap .dropdown-popover {
  inset-inline-start: auto !important;
  inset-inline-end: 0 !important;
  left: 0 !important;
  right: auto !important;
}

.dropdown-popover-wide {
  min-width: 330px;
}

.custom-dropdown-wrap.open .dropdown-popover {
  display: flex;
  animation: dropAnim 0.15s ease forwards;
}

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

.dropdown-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: start;
  white-space: normal;
  line-height: 1.45;
  word-break: normal;
}

.dropdown-option:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
}

.dropdown-option.selected {
  background: rgba(29, 78, 216, 0.08);
  color: var(--brand-primary);
  font-weight: 700;
}

.option-left {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: start;
}

.option-flag-svg {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* Sample Texts Dropdown Items */
.sample-option-item {
  padding: 9px 12px;
  cursor: pointer;
}

.sample-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: start;
}

.sample-item-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sample-item-text {
  flex: 1;
  text-align: start;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
}

/* User Status Pill */
.user-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  padding: 5px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-dot.free { background: var(--color-warning); }
.status-dot.pro { background: var(--color-safe); }

.btn-primary-gradient {
  background: var(--brand-gradient);
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--brand-glow);
  transition: all 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-primary-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(29, 78, 216, 0.35);
}

/* ==========================================================================
   Main Workbench Section
   ========================================================================== */
.app-main {
  flex: 1;
  padding: 20px 24px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.main-layout-container {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}

.workbench-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  min-height: 640px;
  overflow: visible; /* Crucial: ensures toolbar dropdowns are never clipped */
  position: relative;
}

/* Editor Toolbar */
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 25;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.toolbar-btn:hover {
  color: var(--text-main);
  border-color: var(--border-prominent);
}

/* Viewports */
.editor-viewport {
  flex: 1;
  position: relative;
  min-height: 480px;
  display: flex;
}

.editor-pane {
  flex: 1;
  display: none;
  flex-direction: column;
  width: 100%;
}

.editor-pane.active {
  display: flex;
}

.studio-textarea {
  flex: 1;
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.9;
  padding: 24px;
  resize: none;
}

.studio-textarea::placeholder {
  color: var(--text-muted);
}

/* Heatmap View */
.heatmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-weight: 600;
}

.color-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.color-dot.danger { background: var(--color-danger); }
.color-dot.warning { background: var(--color-warning); }
.color-dot.safe { background: var(--color-safe); }

.btn-ghost-sm {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-ghost-sm:hover {
  color: var(--text-main);
  border-color: var(--border-prominent);
}

.heatmap-content {
  padding: 22px;
  font-size: 1.06rem;
  line-height: 2.15;
  overflow-y: auto;
  max-height: 480px;
  color: var(--text-main);
}

.sentence-chip {
  display: inline;
  padding: 2px 6px;
  margin: 0 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.sentence-chip:hover {
  filter: brightness(0.96);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.sentence-chip.danger {
  background-color: var(--color-danger-bg);
  border-bottom: 2px solid var(--color-danger);
  color: var(--color-danger-text);
  font-weight: 600;
}

.sentence-chip.warning {
  background-color: var(--color-warning-bg);
  border-bottom: 2px solid var(--color-warning);
  color: var(--color-warning-text);
  font-weight: 600;
}

.sentence-chip.safe {
  background-color: var(--color-safe-bg);
  border-bottom: 2px solid var(--color-safe);
  color: var(--color-safe-text);
  font-weight: 600;
}

/* Comparison View */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  height: 100%;
}

.comparison-col {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.comparison-col:first-child {
  border-inline-end: 1px solid var(--border-subtle);
  background: var(--bg-surface-subtle);
}

.comparison-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tag-badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.tag-badge.original {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  border: 1px solid var(--color-danger-border);
}

.tag-badge.humanized {
  background: var(--color-safe-bg);
  color: var(--color-safe-text);
  border: 1px solid var(--color-safe-border);
}

.sub-score {
  font-family: var(--font-numbers);
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-muted);
}

.sub-score.safe {
  color: var(--color-safe);
}

.comparison-body {
  font-size: 1.02rem;
  line-height: 1.95;
  color: var(--text-main);
}

/* Editor Footer */
.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-surface-subtle);
  border-top: 1px solid var(--border-subtle);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  gap: 14px;
  flex-wrap: wrap;
}

.stats-counters {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-badge {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.stat-badge strong {
  font-family: var(--font-numbers);
  color: var(--text-main);
  font-size: 0.94rem;
}

.stat-limit {
  font-size: 0.76rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.action-buttons-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--brand-primary);
  background: rgba(29, 78, 216, 0.04);
}

.btn-primary-action {
  background: var(--brand-gradient);
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 9px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--brand-glow);
  transition: all 0.2s;
}

.btn-primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(29, 78, 216, 0.35);
}

.btn-primary-action:disabled, .btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   Sidebar: Metrics & AdSense Cards
   ========================================================================== */
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.metric-info-tooltip {
  cursor: pointer;
  opacity: 0.7;
  font-size: 0.85rem;
}

/* Radial Gauge */
.gauge-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
}

.radial-gauge-container {
  position: relative;
  width: 135px;
  height: 135px;
}

.radial-gauge {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: var(--bg-surface-elevated);
  stroke-width: 10;
}

.gauge-fill {
  fill: none;
  stroke: var(--color-warning);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 314.16;
  stroke-dashoffset: 314.16;
  transition: stroke-dashoffset 0.8s ease-out, stroke 0.4s ease;
}

.gauge-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gauge-value {
  font-family: var(--font-numbers);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
}

.gauge-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.score-summary-text {
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-top: 10px;
  padding: 0 8px;
  line-height: 1.5;
  font-weight: 500;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.metric-tile {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.metric-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.metric-num {
  font-family: var(--font-numbers);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
}

.metric-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Academic Coaching Guidance Box */
.coaching-box {
  background: rgba(29, 78, 216, 0.05);
  border: 1px solid rgba(29, 78, 216, 0.18);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 0.82rem;
}

.coaching-icon {
  font-size: 1.2rem;
}

.coaching-message strong {
  display: block;
  color: var(--brand-primary);
  margin-bottom: 2px;
}

.coaching-message p {
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.45;
}

/* Export Certificate */
.btn-certificate {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 9px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-certificate:not(:disabled):hover {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

.btn-certificate:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* AdSense Compliant Unit */
.ad-card {
  border: 1px dashed var(--border-prominent);
  background: var(--bg-surface-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ad-card.hidden {
  display: none !important;
}

.ad-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ad-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.ad-remove-link {
  background: none;
  border: none;
  color: var(--brand-primary);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.ad-banner-mock {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.ad-icon {
  font-size: 1.7rem;
  display: block;
  margin-bottom: 5px;
}

.ad-content-inner h4 {
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 5px;
}

.ad-content-inner p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.btn-ad-cta {
  background: var(--brand-primary);
  color: #fff;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.ad-disclaimer {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   Sentence Action Popup
   ========================================================================== */
.sentence-action-popup {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--bg-surface);
  border: 1px solid var(--border-brand);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  width: 90%;
  max-width: 620px;
  padding: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s;
}

.sentence-action-popup.open {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 6px;
}

.popup-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-close-popup {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
}

.popup-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.popup-original {
  font-size: 0.85rem;
  color: var(--color-danger-text);
  background: var(--color-danger-bg);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-inline-start: 3px solid var(--color-danger);
  font-weight: 500;
}

.popup-suggestion {
  font-size: 0.92rem;
  color: var(--color-safe-text);
  background: var(--color-safe-bg);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-inline-start: 3px solid var(--color-safe);
  min-height: 44px;
  font-weight: 600;
}

.popup-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-apply-fix {
  background: var(--color-safe);
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.84rem;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-retry-fix {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.35);
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 30px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

[dir="rtl"] .modal-close {
  right: auto;
  left: 18px;
}

.modal-header {
  text-align: center;
  margin-bottom: 22px;
}

.modal-icon-badge {
  font-size: 2.2rem;
  margin-bottom: 5px;
}

.modal-header h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 5px;
}

.modal-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.modal-plans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

.plan-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.plan-card.featured {
  border-color: var(--brand-primary);
  background: rgba(29, 78, 216, 0.04);
}

.popular-ribbon {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.plan-price {
  margin: 8px 0 12px;
  display: flex;
  align-items: baseline;
}

.plan-price .currency {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.plan-price .amount {
  font-family: var(--font-numbers);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
}

.plan-price .period {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-inline-start: 5px;
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  flex: 1;
}

.btn-checkout {
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-checkout-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.modal-quick-login {
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  text-align: center;
}

.modal-quick-login h4 {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.magic-login-form {
  display: flex;
  gap: 8px;
  max-width: 440px;
  margin: 0 auto;
}

.login-input {
  flex: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.86rem;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  outline: none;
}

.login-input:focus {
  border-color: var(--brand-primary);
}

.btn-login-submit {
  background: var(--color-safe);
  color: #fff;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.83rem;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.login-feedback {
  font-size: 0.8rem;
  margin-top: 6px;
  min-height: 18px;
}

/* User Guide Steps */
.guide-steps-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 18px 0;
}

.guide-step-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--font-numbers);
  flex-shrink: 0;
}

.step-info h4 {
  font-size: 0.94rem;
  color: var(--text-main);
  margin-bottom: 3px;
}

.step-info p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Policy Tabs */
.policy-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.policy-tab-btn {
  background: none;
  border: none;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.policy-tab-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--brand-primary);
  font-weight: 700;
}

.policy-content-body {
  font-size: 0.86rem;
  line-height: 1.8;
  color: var(--text-secondary);
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

.policy-content-body h3 {
  color: var(--text-main);
  font-size: 1rem;
  margin: 14px 0 6px;
}

.policy-content-body p, .policy-content-body ul {
  margin-bottom: 10px;
}

.policy-content-body ul {
  padding-inline-start: 18px;
}

/* Footer */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 20px 24px;
  margin-top: auto;
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-link-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.2s;
  text-decoration: none;
}

.footer-link-btn:hover {
  color: var(--brand-primary);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[dir="rtl"] .toast-container {
  right: auto;
  left: 20px;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastSlide 0.25s ease;
  font-weight: 500;
}

.toast.success { border-inline-start: 4px solid var(--color-safe); }
.toast.info { border-inline-start: 4px solid var(--brand-primary); }
.toast.warning { border-inline-start: 4px solid var(--color-warning); }

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

/* ==========================================================================
   Comprehensive Responsive System (Tablets, Phablets & Mobile of All Sizes)
   ========================================================================== */

/* Touch Device Optimization */
@media (hover: none) and (pointer: coarse) {
  .dropdown-trigger, .toolbar-btn, .mode-tab, .btn-primary-action, .btn-secondary, .footer-link-btn {
    min-height: 38px;
  }
}

/* 1. Tablets (iPad Pro portrait, iPad Air, Surface, 1024px & down) */
@media (max-width: 1024px) {
  .app-main {
    padding: 16px 18px;
  }

  .main-layout-container {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .sidebar-section {
    order: 2;
  }

  .workbench-section {
    min-height: 520px;
  }

  .header-container {
    padding: 8px 16px;
    gap: 10px;
  }

  .mode-tab {
    padding: 6px 11px;
    font-size: 0.81rem;
  }

  .banner-content {
    text-align: center;
    gap: 8px;
  }
}

/* 2. Medium Tablets & iPad Portrait (820px & down) */
@media (max-width: 820px) {
  .brand-title {
    font-size: 1.12rem;
  }

  .user-status-pill {
    padding: 4px 8px;
    font-size: 0.74rem;
  }

  .mode-tab {
    padding: 5px 9px;
    font-size: 0.78rem;
    gap: 4px;
  }

  .btn-primary-gradient {
    padding: 6px 11px;
    font-size: 0.78rem;
  }

  .modal-plans-grid {
    grid-template-columns: 1fr;
  }
}

/* 3. Small Tablets & Phablets (768px & down) - Smart Two-Row Header */
@media (max-width: 768px) {
  .header-container {
    flex-wrap: wrap;
    padding: 8px 14px;
    gap: 8px;
  }

  .brand-group {
    order: 1;
  }

  .header-actions {
    order: 2;
    margin-inline-start: auto;
    gap: 6px;
  }

  /* Mode tabs become full-width segmented tab bar under logo & actions */
  .nav-modes {
    order: 3;
    width: 100%;
    justify-content: space-between;
    margin-top: 4px;
  }

  .mode-tab {
    flex: 1;
    justify-content: center;
    padding: 7px 10px;
    font-size: 0.82rem;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .comparison-col:first-child {
    border-inline-end: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .modal-dialog {
    padding: 22px 18px;
    max-width: 95vw;
    max-height: 90vh;
  }

  .policy-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .policy-tab-btn {
    flex-shrink: 0;
  }
}

/* 4. Mobile Phones (580px & down) */
@media (max-width: 580px) {
  .app-main {
    padding: 10px 8px;
  }

  .top-banner {
    padding: 6px 10px;
    font-size: 0.76rem;
  }

  .banner-content {
    gap: 8px;
    justify-content: space-between;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
  }

  .logo-icon svg {
    width: 18px;
    height: 18px;
  }

  /* Hide status text to conserve header space on small screens */
  .user-status-pill {
    display: none;
  }

  .btn-theme-toggle {
    width: 32px;
    height: 32px;
  }

  .dropdown-trigger {
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  .btn-upgrade-banner {
    padding: 2px 8px;
    font-size: 0.72rem;
  }

  /* Editor Toolbar: Two rows for easy thumb tapping */
  .editor-toolbar {
    padding: 8px 10px;
    gap: 8px;
  }

  .toolbar-left {
    width: 100%;
    display: flex;
    gap: 6px;
  }

  .toolbar-left .toolbar-btn, 
  .toolbar-left .custom-dropdown-wrap {
    flex: 1;
    min-width: 0;
  }

  .toolbar-btn {
    padding: 6px 6px;
    font-size: 0.76rem;
    justify-content: center;
    gap: 4px;
    width: 100%;
  }

  .toolbar-right {
    width: 100%;
    display: flex;
  }

  #toneDropdownWrap {
    width: 100%;
  }

  #toneDropdownWrap .dropdown-trigger {
    width: 100%;
    justify-content: space-between;
  }

  /* Popovers on Mobile: Fit screen width safely with no overflow */
  .toolbar-left .dropdown-popover,
  #samplesDropdownWrap .dropdown-popover {
    min-width: 270px;
    max-width: calc(100vw - 20px) !important;
    left: 0 !important;
    right: auto !important;
  }

  [dir="rtl"] .toolbar-left .dropdown-popover,
  [dir="rtl"] #samplesDropdownWrap .dropdown-popover {
    right: 0 !important;
    left: auto !important;
  }

  .header-actions .dropdown-popover,
  #langDropdownWrap .dropdown-popover {
    min-width: 220px;
    max-width: calc(100vw - 20px) !important;
  }

  .toolbar-right .dropdown-popover,
  #toneDropdownWrap .dropdown-popover {
    min-width: 260px;
    max-width: calc(100vw - 20px) !important;
    width: 100%;
  }

  /* Textarea & Viewport */
  .studio-textarea {
    padding: 14px 10px;
    font-size: 1rem;
    min-height: 240px;
  }

  .editor-viewport {
    min-height: 280px;
  }

  .workbench-section {
    min-height: auto;
  }

  /* Editor Footer: Mobile stacked controls */
  .editor-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }

  .stats-counters {
    justify-content: space-between;
    width: 100%;
    font-size: 0.78rem;
  }

  .footer-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .btn-primary-action {
    width: 100%;
    justify-content: center;
    padding: 11px 16px;
    font-size: 0.9rem;
  }

  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  /* Sidebar Cards */
  .sidebar-card {
    padding: 14px 12px;
  }

  .radial-gauge-container {
    width: 120px;
    height: 120px;
  }

  .gauge-value {
    font-size: 1.6rem;
  }

  .metrics-grid {
    gap: 8px;
  }

  .metric-tile {
    padding: 8px 10px;
  }

  .metric-num {
    font-size: 1.15rem;
  }

  .coaching-box {
    padding: 10px;
    font-size: 0.8rem;
  }

  #btnExportCert {
    width: 100%;
    justify-content: center;
    font-size: 0.82rem;
    padding: 9px 12px;
  }

  /* Sentence Remediation Popup */
  .sentence-action-popup {
    width: calc(100vw - 16px);
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    padding: 14px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 250;
  }

  .sentence-action-popup.open {
    transform: translateX(-50%) translateY(0);
  }

  .popup-footer {
    flex-direction: column;
    gap: 6px;
  }

  .btn-apply-fix, .btn-retry-fix {
    width: 100%;
    justify-content: center;
    padding: 9px;
  }

  /* Toast Notifications */
  .toast-container {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  [dir="rtl"] .toast-container {
    left: 10px;
    right: 10px;
  }

  .toast {
    width: 100%;
    justify-content: center;
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  /* Site Footer */
  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .footer-links {
    justify-content: center;
    gap: 12px;
  }
}

/* 5. Compact Mobile Phones (360px & down, e.g. iPhone SE 1st gen, Galaxy Fold cover) */
@media (max-width: 360px) {
  .brand-title {
    font-size: 0.95rem;
  }

  .mode-tab {
    font-size: 0.74rem;
    padding: 6px 4px;
    gap: 3px;
  }

  .mode-tab svg {
    width: 13px;
    height: 13px;
  }

  .toolbar-btn {
    font-size: 0.72rem;
    padding: 5px 4px;
  }

  .toolbar-btn svg {
    width: 12px;
    height: 12px;
  }

  .toolbar-left .dropdown-popover,
  #samplesDropdownWrap .dropdown-popover {
    min-width: 250px;
    max-width: calc(100vw - 16px) !important;
  }
}
