:root {
  --bg-body: #0c0c0c;
  --bg-card: #161616;
  --bg-elevated: #1c1c1c;
  --bg-input: #1a1a1a;
  --bg-input-focus: #1e1e1e;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-default: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.2);
  --border-focus: #a3f7bf;

  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --text-on-accent: #0c0c0c;

  --mint: #a3f7bf;
  --mint-hover: #8aeea8;
  --mint-dim: rgba(163, 247, 191, 0.1);
  --mint-glow: rgba(163, 247, 191, 0.15);

  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.12);
  --yellow: #fbbf24;

  --accent-primary: #a3f7bf;
  --accent-success: #22c55e;
  --accent-warning: #fbbf24;
  --accent-danger: #f87171;
  
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 100px;

  --pulse-glow-0: rgba(163, 247, 191, 0.6);
  --pulse-glow-70: rgba(163, 247, 191, 0);

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-elevated: 0 4px 16px rgba(0, 0, 0, 0.5);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Display', 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-sans-ar: 'Segoe UI', 'Noto Sans Arabic', 'Cairo', 'Tajawal', 'Almarai', -apple-system, BlinkMacSystemFont, Tahoma, Arial, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Cascadia Mono', 'Segoe UI Mono', 'Liberation Mono', Menlo, Monaco, Consolas, monospace;

  --bg-primary: var(--bg-body);
  --bg-card-inner: var(--bg-elevated);
  --text-main: var(--text-primary);
  --accent-mint: var(--mint);
  --accent-mint-text: var(--text-on-accent);
  --accent-green: var(--mint);
  --accent-green-dark: var(--mint-hover);
  --accent-glow: var(--mint-glow);
  --border-color: var(--border-default);
  --border-hover: var(--border-strong);
  --border-active: var(--border-focus);
  --status-match: var(--mint);
  --status-mismatch: var(--red);
}

[data-theme="light"] {
  --bg-body: #f5f5f5;
  --bg-card: #ffffff;
  --bg-elevated: #f0f0f0;
  --bg-input: #f7f7f7;
  --bg-input-focus: #ffffff;

  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-default: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.18);
  --border-focus: #15803d;

  --text-primary: #111111;
  --text-secondary: #555555;
  --text-muted: #999999;
  --text-on-accent: #ffffff;

  --mint: #15803d;
  --mint-hover: #116b33;
  --mint-dim: rgba(21, 128, 61, 0.08);
  --mint-glow: rgba(21, 128, 61, 0.12);

  --red: #dc2626;
  --red-dim: rgba(220, 38, 38, 0.08);
  --yellow: #d97706;

  --accent-primary: #15803d;
  --accent-success: #16a34a;
  --accent-warning: #d97706;
  --accent-danger: #dc2626;
  
  --pulse-glow-0: rgba(21, 128, 61, 0.6);
  --pulse-glow-70: rgba(21, 128, 61, 0);

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-elevated: 0 2px 8px rgba(0, 0, 0, 0.08);

  --bg-primary: var(--bg-body);
  --bg-card-inner: var(--bg-elevated);
  --text-main: var(--text-primary);
  --accent-mint: var(--mint);
  --accent-mint-text: var(--text-on-accent);
  --accent-green: var(--mint);
  --accent-green-dark: var(--mint-hover);
  --accent-glow: var(--mint-glow);
  --border-color: var(--border-default);
  --border-hover: var(--border-strong);
  --border-active: var(--border-focus);
  --status-match: var(--mint);
  --status-mismatch: var(--red);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

[dir="rtl"] {
  font-family: var(--font-sans-ar);
  letter-spacing: 0;
}

[dir="ltr"] .hero-title,
[dir="ltr"] .info-card-title,
[dir="ltr"] .dropzone-title,
[dir="ltr"] .results-title {
  letter-spacing: -0.02em;
}

[dir="rtl"] .hero-title,
[dir="rtl"] .info-card-title,
[dir="rtl"] .dropzone-title,
[dir="rtl"] .results-title {
  letter-spacing: 0;
  line-height: 1.4;
}

.ambient-glow, .bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-glow::before, .bg-glow-sphere-1 {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(163, 247, 191, 0.05) 0%, transparent 65%);
}

.ambient-glow::after, .bg-glow-sphere-2 {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(163, 247, 191, 0.03) 0%, transparent 65%);
}

[data-theme="light"] .ambient-glow::before,
[data-theme="light"] .bg-glow-sphere-1 {
  background: radial-gradient(circle, rgba(21, 128, 61, 0.04) 0%, transparent 65%);
}

[data-theme="light"] .ambient-glow::after,
[data-theme="light"] .bg-glow-sphere-2 {
  background: radial-gradient(circle, rgba(21, 128, 61, 0.02) 0%, transparent 65%);
}

.app-header, .navbar {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: contain;
  background: #ffffff;
  padding: 2px;
  display: block;
  flex-shrink: 0;
  border: 1px solid var(--border-default);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

[data-theme="light"] .brand-logo-img {
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.brand:hover .brand-logo-img {
  transform: scale(1.06);
  box-shadow: 0 0 14px var(--mint-glow);
}

.mobile-drawer-header .brand-logo-img {
  width: 30px;
  height: 30px;
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--mint-dim);
  color: var(--mint);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(163, 247, 191, 0.2);
  box-shadow: 0 0 16px var(--mint-glow);
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
}

[data-theme="light"] .brand-logo-icon {
  border-color: rgba(21, 128, 61, 0.2);
}

.brand:hover .brand-logo-icon {
  transform: scale(1.04);
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-title-accent {
  color: var(--mint);
}

.capsule-nav, .nav-links {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-pill-item, .nav-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
  white-space: nowrap;
  text-decoration: none;
}

.nav-pill-item:hover:not(.active), .nav-link:hover:not(.active) {
  color: var(--text-secondary);
}

.nav-pill-item.active, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
  box-shadow: none;
}

.header-controls, .nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.local-status-pill, .security-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: var(--mint-dim);
  border: 1px solid rgba(163, 247, 191, 0.2);
  color: var(--mint);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  user-select: none;
  white-space: nowrap;
}

[data-theme="light"] .local-status-pill,
[data-theme="light"] .security-badge {
  border-color: rgba(21, 128, 61, 0.2);
}

.status-pulse-dot, .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  animation: pulse 2.5s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 var(--pulse-glow-0);
  }
  70% {
    box-shadow: 0 0 0 7px var(--pulse-glow-70);
  }
  100% {
    box-shadow: 0 0 0 0 var(--pulse-glow-70);
  }
}

.lang-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-select {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 6px 28px 6px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: all 0.15s var(--ease);
}

[dir="rtl"] .lang-select {
  padding: 6px 12px 6px 28px;
}

.lang-select:hover, .lang-select:focus {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.lang-select-arrow {
  position: absolute;
  right: 10px;
  pointer-events: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

[dir="rtl"] .lang-select-arrow {
  right: auto;
  left: 10px;
}

.theme-toggle-btn, .btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  flex-shrink: 0;
}

.theme-toggle-btn:hover, .btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s var(--ease);
}

.mobile-menu-btn:hover {
  border-color: var(--border-strong);
}

.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9998;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mobile-menu-backdrop.active {
  display: block;
  opacity: 1;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: 100vw;
  background: var(--bg-body);
  z-index: 9999;
  display: none;
  flex-direction: column;
  padding: 18px 18px 32px 18px;
  gap: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.mobile-drawer.active {
  display: flex;
  animation: mobileMenuFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mobileMenuFadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.mobile-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s var(--ease);
  flex-shrink: 0;
}

.mobile-drawer-close:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.mobile-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.mobile-nav-section-title {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 4px;
}

.mobile-settings-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-lang-wrapper {
  width: 100%;
}

.mobile-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 13.5px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.btn-mobile-setting {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  box-sizing: border-box;
}

.btn-mobile-setting:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.mobile-links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  box-sizing: border-box;
}

.mobile-nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.mobile-nav-item.active {
  background: var(--mint-dim);
  color: var(--mint);
  border-color: rgba(163, 247, 191, 0.25);
}

[data-theme="light"] .mobile-nav-item.active {
  border-color: rgba(21, 128, 61, 0.25);
}

.mobile-nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-tabs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mobile-tab-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  box-sizing: border-box;
}

.mobile-tab-pill:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.mobile-tab-pill.active {
  background: var(--mint);
  color: var(--text-on-accent);
  border-color: var(--mint);
  box-shadow: 0 2px 8px var(--mint-glow);
  font-weight: 700;
}

.main-wrapper {
  max-width: 680px;
  margin: 12px auto 48px;
  width: 100%;
  padding: 0 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  box-sizing: border-box;
}

.hero-section {
  text-align: center;
  margin-bottom: 28px;
  width: 100%;
  box-sizing: border-box;
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  color: var(--text-primary);
  line-height: 1.3;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
}

.tool-card, .app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  position: relative;
  box-sizing: border-box;
}

.card-tabs-nav, .tab-container {
  display: flex;
  gap: 4px;
  background: var(--bg-elevated);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 28px;
  width: 100%;
  box-sizing: border-box;
}

.card-tab-btn, .tab-btn {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
}

.card-tab-btn:hover:not(.active), .tab-btn:hover:not(.active) {
  color: var(--text-secondary);
}

.card-tab-btn.active, .tab-btn.active {
  background: var(--mint);
  color: var(--text-on-accent);
  box-shadow: 0 2px 8px var(--mint-glow);
  font-weight: 600;
}

.tab-content {
  display: none;
  width: 100%;
  box-sizing: border-box;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease-in;
}

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

.dropzone, .drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-elevated);
  transition: all 0.25s var(--ease);
  outline: none;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 20px;
}

.dropzone:hover, .dropzone.drag-over, .drop-zone:hover, .drop-zone.dragover {
  border-color: var(--mint);
  background: var(--mint-dim);
}

.dropzone-icon-badge, .drop-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mint);
  background: var(--mint-dim);
  border: 1px solid rgba(163, 247, 191, 0.15);
}

[data-theme="light"] .dropzone-icon-badge,
[data-theme="light"] .drop-icon {
  border-color: rgba(21, 128, 61, 0.15);
}

.dropzone-title, .drop-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.dropzone-sub, .drop-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.file-input-hidden {
  display: none;
}

.dropzone-actions {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-folder, .btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  max-width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

.btn-folder > *, .btn-outline > * {
  pointer-events: none;
}

.btn-folder:hover, .btn-outline:hover:not(:disabled) {
  background: var(--bg-input);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.form-group {
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.algo-pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.algo-pill {
  cursor: pointer;
  user-select: none;
  position: relative;
  min-width: 0;
}

.algo-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.algo-pill-content {
  display: block;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  padding: 8px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  transition: all 0.15s var(--ease);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.algo-pill input:checked + .algo-pill-content {
  background: var(--mint-dim);
  border-color: var(--mint);
  color: var(--mint);
  box-shadow: 0 0 10px var(--mint-glow);
}

.algo-pill:hover .algo-pill-content {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.form-input, .form-textarea, .form-input-file, .input-field, .textarea-field {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
  box-sizing: border-box;
}

.form-input:focus, .form-textarea:focus, .input-field:focus, .textarea-field:focus {
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--mint-dim);
}

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

.form-textarea, .textarea-field {
  min-height: 130px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.5;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.progress-container, .progress-card {
  margin-top: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-sizing: border-box;
}

.progress-container {
  display: none;
}

.progress-container.active {
  display: block;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  gap: 8px;
}

#progress-filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 12px;
}

[data-theme="light"] .progress-bar-bg {
  background: rgba(0, 0, 0, 0.06);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--mint), var(--mint-hover));
  border-radius: var(--radius-pill);
  transition: width 0.2s linear;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.status-result-badge, .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
}

.status-result-badge.match, .status-badge.match {
  background: var(--mint-dim);
  border-color: rgba(163, 247, 191, 0.25);
  color: var(--mint);
}

[data-theme="light"] .status-result-badge.match,
[data-theme="light"] .status-badge.match {
  border-color: rgba(21, 128, 61, 0.25);
}

.status-result-badge.mismatch, .status-badge.mismatch {
  background: var(--red-dim);
  border-color: rgba(248, 113, 113, 0.25);
  color: var(--red);
}

.spin {
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.results-section {
  max-width: 680px;
  width: 100%;
  margin: 24px auto 0 auto;
  box-sizing: border-box;
}

.results-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  box-sizing: border-box;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.results-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.results-title {
  font-size: 15px;
  font-weight: 700;
}

.results-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
}

.btn-tool:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-input);
}

.btn-tool.btn-danger {
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.3);
}

.btn-tool.btn-danger:hover {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--red);
}

.empty-state {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.hash-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.hash-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-all;
}

.file-size {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

.hash-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hash-row {
  display: grid;
  grid-template-columns: 74px 1fr 32px;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  box-sizing: border-box;
}

.hash-type {
  font-size: 11px;
  font-weight: 700;
  color: var(--mint);
  background: var(--mint-dim);
  padding: 3px 6px;
  border-radius: 4px;
  text-align: center;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.hash-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  word-break: break-all;
  overflow-wrap: anywhere;
  user-select: all;
  line-height: 1.4;
  min-width: 0;
}

.copy-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  flex-shrink: 0;
}

.copy-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.copy-btn.copied {
  background: var(--mint-dim);
  border-color: var(--mint);
  color: var(--mint);
}

.btn-primary {
  width: 100%;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  background: var(--mint);
  color: var(--text-on-accent);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.15s var(--ease);
  box-shadow: 0 2px 8px var(--mint-glow);
  box-sizing: border-box;
}

.btn-primary:hover:not(:disabled) {
  background: var(--mint-hover);
  box-shadow: 0 4px 16px var(--mint-glow);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.btn-row {
  display: flex;
  gap: 12px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--mint);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.82rem;
  transition: opacity 0.15s;
}

.btn-link:hover {
  opacity: 0.8;
}

.faq-section {
  max-width: 680px;
  width: 100%;
  margin: 36px auto 0 auto;
  box-sizing: border-box;
}

.faq-section-title, .faq-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  text-align: left;
}

[dir="rtl"] .faq-section-title,
[dir="rtl"] .faq-title {
  text-align: right;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: border-color 0.2s var(--ease);
  box-sizing: border-box;
}

.faq-item:hover {
  border-color: var(--border-strong);
}

.faq-item.active, .faq-item[open] {
  border-color: rgba(163, 247, 191, 0.25);
}

[data-theme="light"] .faq-item.active,
[data-theme="light"] .faq-item[open] {
  border-color: rgba(21, 128, 61, 0.25);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
  gap: 14px;
  box-sizing: border-box;
  transition: background 0.15s var(--ease);
}

.faq-question:hover {
  background: var(--bg-elevated);
}

.faq-q-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.faq-icon-box, .faq-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  background: var(--mint-dim);
  color: var(--mint);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.faq-q-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: break-word;
}

.faq-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s var(--ease);
  flex-shrink: 0;
}

.faq-item.active .faq-chevron,
.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
  color: var(--mint);
}

.faq-answer {
  display: none;
  padding: 0 20px 18px 70px;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary);
  box-sizing: border-box;
  animation: faqFade 0.25s var(--ease);
}

[dir="rtl"] .faq-answer {
  padding: 0 70px 18px 20px;
}

.faq-item.active .faq-answer,
.faq-item[open] .faq-answer {
  display: block;
}

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

.app-footer, .footer {
  max-width: 880px;
  margin: 48px auto 0 auto;
  width: 100%;
  padding: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  box-sizing: border-box;
}

.footer-left {
  color: var(--text-muted);
}

.footer-right, .footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.15s;
  padding: 0;
  text-decoration: none;
}

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

.history-modal {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: min(90vw, 360px);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-elevated);
  z-index: 900;
  display: none;
  flex-direction: column;
  gap: 10px;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

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

.history-modal.active {
  display: flex;
}

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

.history-modal-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  background: var(--mint-dim);
  color: var(--mint);
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.history-modal-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.history-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.history-modal-actions .btn {
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: all 0.15s var(--ease);
  box-sizing: border-box;
}

.btn:hover {
  background: var(--bg-input);
  border-color: var(--border-strong);
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

.info-cards-list, .page-section {
  max-width: 680px;
  width: 100%;
  margin: 12px auto 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

.info-card, .section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
  box-sizing: border-box;
}

.info-card:hover, .section-card:hover {
  border-color: var(--border-strong);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.info-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  background: var(--mint-dim);
  color: var(--mint);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.info-card-title, .section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.info-card-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.info-card-desc strong {
  color: var(--text-primary);
  font-weight: 700;
}

.info-card-desc p + p {
  margin-top: 10px;
}

.info-card-list {
  margin-top: 10px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

[dir="rtl"] .info-card-list {
  padding-left: 0;
  padding-right: 20px;
}

.nav-pill-item, .mobile-nav-item, .footer-link {
  text-decoration: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .app-header, .navbar {
    padding: 14px 16px;
  }

  .main-wrapper, .page-section, .info-cards-list {
    padding: 0 16px;
  }

  .hero-section {
    margin-top: 16px;
    margin-bottom: 20px;
  }

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

  .hero-subtitle {
    font-size: 0.88rem;
  }

  .tool-card, .app-card, .section-card, .info-card {
    padding: 20px;
    border-radius: var(--radius-md);
  }

  .card-tabs-nav, .tab-container {
    margin-bottom: 20px;
  }

  .card-tab-btn, .tab-btn {
    padding: 9px 8px;
    font-size: 0.78rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .dropzone, .drop-zone {
    padding: 28px 16px;
  }

  .dropzone-icon-badge, .drop-icon {
    width: 44px;
    height: 44px;
  }

  .btn-primary {
    padding: 12px 18px;
    font-size: 0.9rem;
  }

  .btn-row {
    flex-direction: column;
    gap: 10px;
  }

  .progress-stats {
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.72rem;
  }

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

  .app-footer, .footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 20px 16px;
    margin-top: 36px;
  }

  .footer-right, .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .card-tabs-nav {
    grid-template-columns: repeat(2, 1fr);
    display: grid;
    gap: 6px;
    padding: 6px;
  }

  .card-tab-btn {
    padding: 10px 8px;
    font-size: 13px;
    justify-content: center;
  }

  .dropzone {
    padding: 24px 12px;
  }

  .algo-pill-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .results-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .btn-tool {
    padding: 5px 8px;
    font-size: 11.5px;
  }

  .hash-row {
    grid-template-columns: 60px 1fr 30px;
    gap: 6px;
    padding: 6px 8px;
  }

  .hash-value {
    font-size: 11px;
  }

  .faq-answer {
    padding: 0 16px 14px 16px !important;
  }
}

@media (max-width: 360px) {
  .algo-pill-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tool-card, .app-card {
    padding: 14px;
  }

  .mobile-links-grid,
  .mobile-tabs-grid {
    grid-template-columns: 1fr;
  }
}