:root {
  color-scheme: dark;
  --image-tools-bg: #080d1a;
  --image-tools-surface: #111a2d;
  --image-tools-raised: #18243c;
  --image-tools-border: rgba(148, 163, 184, 0.2);
  --image-tools-text: #e8edf7;
  --image-tools-muted: #a5b2c7;
  --image-tools-accent: #8b7bff;
  --image-tools-accent-bright: #c4b5fd;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--image-tools-text);
  background:
    radial-gradient(ellipse at 12% 0%, rgba(91, 76, 209, 0.2), transparent 35rem),
    radial-gradient(ellipse at 92% 12%, rgba(18, 153, 190, 0.12), transparent 32rem),
    var(--image-tools-bg);
  font-family: Inter, "Public Sans", system-ui, sans-serif;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) :not(.material-symbols-outlined) {
  font-family: Inter, "Public Sans", system-ui, sans-serif;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-header {
  width: 100%;
  border-color: var(--image-tools-border);
  background: rgba(8, 13, 26, 0.9);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-nav-inner {
  box-sizing: border-box;
  width: min(1320px, 100%);
  max-width: 1320px;
  min-height: 72px;
  height: auto;
  margin: 0 auto;
  padding: 12px 24px;
  gap: 20px;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-nav-left {
  min-width: 0;
  gap: clamp(14px, 2vw, 32px);
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-logo {
  flex: 0 0 auto;
  gap: 10px;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-logo-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid rgba(211, 204, 255, 0.5);
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #a89aff, #7260ec 55%, #493bb5);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.35) inset, 0 5px 0 #352a91, 0 10px 24px rgba(101, 82, 220, 0.34);
  transform: perspective(100px) rotateY(-8deg) rotateX(5deg);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-logo:hover .tg-logo-icon {
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.4) inset, 0 3px 0 #352a91, 0 14px 28px rgba(101, 82, 220, 0.45);
  transform: perspective(100px) translateY(-2px) rotateY(-8deg) rotateX(5deg);
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) header .tg-logo-text,
body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) footer .tg-logo-text {
  color: #f8f9ff !important;
  font-family: Inter, "Public Sans", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 12px rgba(130, 113, 255, 0.18);
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-main-nav {
  align-items: center;
  gap: clamp(12px, 1.6vw, 22px);
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-main-nav a,
body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-mobile-nav a {
  color: #dbe4f5 !important;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 180ms ease;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-main-nav a:hover,
body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-mobile-nav a:hover {
  color: var(--image-tools-accent-bright) !important;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-nav-right {
  flex: 0 0 auto;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-search input {
  width: min(210px, 18vw);
  color: var(--image-tools-text);
  border: 1px solid var(--image-tools-border);
  background: #0d1525;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-search input::placeholder {
  color: var(--image-tools-muted);
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-menu-toggle {
  color: var(--image-tools-text);
  border: 1px solid var(--image-tools-border);
  border-radius: 10px;
  background: #17233b;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-mobile-nav {
  border-color: var(--image-tools-border);
  background: #0d1525;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-mobile-nav a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  white-space: normal;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) main :is(h1, h2, h3, h4, h5, h6) {
  color: #f3f6fc;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) main :is(p, li) {
  color: #b8c4d8;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) main :is(.bg-white, .bg-slate-50, .bg-slate-100, .bg-gray-50, .bg-gray-100) {
  color: var(--image-tools-text);
  border-color: var(--image-tools-border);
  background: linear-gradient(145deg, rgba(24, 36, 60, 0.96), rgba(13, 21, 37, 0.98)) !important;
  box-shadow: 0 2px 0 rgba(255,255,255,.05) inset, 0 8px 0 rgba(5,9,18,.48), 0 22px 44px rgba(0,0,0,.28);
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) main [class*="bg-white/"],
body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) main [class*="bg-slate-50/"],
body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) main [class*="bg-slate-100/"] {
  color: var(--image-tools-text);
  background: rgba(23, 35, 59, 0.88) !important;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) main button {
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) main button:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) main button:active:not(:disabled) {
  transform: translateY(1px);
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) footer.tg-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  background: #070b14;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-footer-brand p,
body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-footer-col ul a,
body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-footer-bottom {
  color: var(--image-tools-muted);
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-footer-col h4 {
  color: #f3f6fc;
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-footer-col ul a:hover,
body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-footer-social a:hover {
  color: var(--image-tools-accent-bright);
}

body.image-ocr-page main > .tool-header {
  position: relative;
  isolation: isolate;
  width: min(1040px, calc(100% - 40px));
  margin: 36px auto 28px;
  padding: clamp(36px, 6vw, 64px) clamp(20px, 5vw, 56px);
  overflow: hidden;
  border: 1px solid rgba(139, 123, 255, 0.28);
  border-radius: 28px;
  background: radial-gradient(ellipse at 50% 0%, rgba(116, 99, 242, 0.2), transparent 65%), linear-gradient(145deg, rgba(24, 36, 60, 0.96), rgba(13, 21, 37, 0.98));
  box-shadow: 0 2px 0 rgba(255,255,255,.05) inset, 0 8px 0 rgba(5,9,18,.48), 0 24px 48px rgba(0,0,0,.3);
}

body.image-ocr-page .tool-header h1 {
  color: #f3f6fc;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -0.045em;
  text-wrap: balance;
  text-shadow: 0 3px 24px rgba(139, 123, 255, 0.16);
}

body.image-ocr-page .tool-header .highlight {
  color: #b4a8ff;
  background: linear-gradient(100deg, #c4b5fd, #8b7bff 60%, #77d5f2);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.image-ocr-page .tool-header p {
  color: #b8c4d8;
  font-size: clamp(1rem, 2vw, 1.1rem);
  line-height: 1.75;
}

body.image-ocr-page .upload-card,
body.image-ocr-page .results-area,
body.image-ocr-page .faq-item,
body.image-ocr-page .related-card {
  color: var(--image-tools-text);
  border: 1px solid var(--image-tools-border);
  background: linear-gradient(145deg, rgba(24, 36, 60, 0.96), rgba(13, 21, 37, 0.98));
  box-shadow: 0 2px 0 rgba(255,255,255,.05) inset, 0 8px 0 rgba(5,9,18,.48), 0 22px 44px rgba(0,0,0,.28);
}

body.image-ocr-page .upload-area {
  border-color: rgba(139, 123, 255, 0.52);
  background: radial-gradient(ellipse at 50% 0%, rgba(116, 99, 242, 0.16), transparent 70%), rgba(9, 16, 30, 0.8);
}

body.image-ocr-page .upload-area:hover,
body.image-ocr-page .upload-area.dragover {
  border-color: var(--image-tools-accent-bright);
  background: radial-gradient(ellipse at 50% 0%, rgba(116, 99, 242, 0.25), transparent 70%), rgba(15, 24, 45, 0.95);
  box-shadow: 0 0 28px rgba(139, 123, 255, 0.18);
  transform: translateY(-2px);
}

body.image-ocr-page .upload-icon,
body.image-ocr-page .step-number {
  color: #fff;
  background: linear-gradient(145deg, #8b7bff, #5143b1);
  box-shadow: 0 4px 0 #352a91, 0 12px 24px rgba(101,82,220,.28);
}

body.image-ocr-page .upload-area h3,
body.image-ocr-page :is(.content-section h2, .content-section h3, .explanation-title, .faq-title, .faq-item h4, .related-title, .related-card h4, .results-header-title) {
  color: #f3f6fc;
}

body.image-ocr-page .upload-area p,
body.image-ocr-page .content-section,
body.image-ocr-page .step-content p,
body.image-ocr-page .faq-item p,
body.image-ocr-page .related-card p {
  color: #b8c4d8;
}

body.image-ocr-page .results-header {
  border-bottom-color: var(--image-tools-border);
  background: #17233b;
}

body.image-ocr-page :is(.custom-select select, .results-textarea) {
  color: var(--image-tools-text);
  border-color: var(--image-tools-border);
  background-color: #0b1324;
}

body.image-ocr-page .faq-section {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(13, 21, 37, 0.55);
}

body.image-ocr-page :is(.faq-item, .related-card) {
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

body.image-ocr-page :is(.faq-item, .related-card):hover {
  border-color: rgba(169, 154, 255, 0.58);
  box-shadow: 0 2px 0 rgba(255,255,255,.06) inset, 0 6px 0 rgba(5,9,18,.48), 0 24px 42px rgba(0,0,0,.32), 0 0 24px rgba(110,94,240,.12);
  transform: translateY(-4px);
}

body.image-ocr-page .explanation-image {
  border: 1px solid rgba(139, 123, 255, 0.28);
  background: linear-gradient(145deg, #18243c, #0d1525);
  box-shadow: 0 2px 0 rgba(255,255,255,.05) inset, 0 8px 0 rgba(5,9,18,.48), 0 22px 44px rgba(0,0,0,.28);
}

body.image-background-remover-page main,
body.image-converter-page main {
  position: relative;
  padding-top: clamp(28px, 5vw, 56px);
  padding-bottom: 72px;
}

body.image-background-remover-page main > .flex.flex-col.gap-4,
body.image-converter-page main > .mb-10 {
  position: relative;
  isolation: isolate;
  padding: clamp(32px, 5vw, 54px) clamp(20px, 5vw, 56px);
  border: 1px solid rgba(139, 123, 255, 0.28);
  border-radius: 28px;
  background: radial-gradient(ellipse at 50% 0%, rgba(116, 99, 242, 0.18), transparent 68%), linear-gradient(145deg, rgba(24, 36, 60, 0.96), rgba(13, 21, 37, 0.98));
  box-shadow: 0 2px 0 rgba(255,255,255,.05) inset, 0 8px 0 rgba(5,9,18,.48), 0 24px 48px rgba(0,0,0,.3);
  animation: image-tools-enter 560ms cubic-bezier(.2,.7,.2,1) both;
}

body.image-background-remover-page main > .flex.flex-col.gap-4 h1,
body.image-converter-page main > .mb-10 h1 {
  color: #f3f6fc !important;
  text-wrap: balance;
  text-shadow: 0 3px 24px rgba(139, 123, 255, 0.16);
}

body.image-background-remover-page main > .flex.flex-col.gap-4 p,
body.image-converter-page main > .mb-10 p {
  color: #b8c4d8 !important;
}

body.image-background-remover-page #dropZone,
body.image-converter-page #imageDropZone {
  border-color: rgba(139, 123, 255, 0.52);
  border-radius: 22px;
  background: radial-gradient(ellipse at 50% 0%, rgba(116, 99, 242, 0.16), transparent 70%), rgba(9, 16, 30, 0.8);
  box-shadow: 0 2px 0 rgba(255,255,255,.04) inset, 0 8px 0 rgba(5,9,18,.38), 0 18px 38px rgba(0,0,0,.22);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

body.image-background-remover-page #dropZone:hover,
body.image-background-remover-page #dropZone.border-primary,
body.image-converter-page #imageDropZone:hover,
body.image-converter-page #imageDropZone.border-primary {
  border-color: var(--image-tools-accent-bright);
  box-shadow: 0 2px 0 rgba(255,255,255,.05) inset, 0 8px 0 rgba(5,9,18,.38), 0 0 28px rgba(139,123,255,.18);
  transform: translateY(-2px);
}

body.image-background-remover-page main :is(.bg-white, .bg-slate-900, .bg-slate-50, .bg-slate-100, .bg-slate-800),
body.image-converter-page main :is(.bg-white, .bg-slate-900, .bg-slate-800) {
  color: var(--image-tools-text) !important;
  border-color: var(--image-tools-border) !important;
  background: linear-gradient(145deg, rgba(24, 36, 60, 0.96), rgba(13, 21, 37, 0.98)) !important;
  box-shadow: 0 2px 0 rgba(255,255,255,.04) inset, 0 8px 0 rgba(5,9,18,.38), 0 20px 40px rgba(0,0,0,.25);
}

body.image-background-remover-page main :is(.bg-slate-950, [class*="bg-white/"], [class*="bg-slate-900/"]),
body.image-converter-page main :is([class*="bg-primary/"], [class*="bg-slate-800/"]) {
  background-color: rgba(9, 16, 30, 0.8) !important;
}

body.image-background-remover-page main :is(button, .bg-primary),
body.image-converter-page main :is(button, .bg-primary) {
  border-color: rgba(196, 181, 253, 0.32);
  border-radius: 12px;
}

body.image-background-remover-page main :is(.text-slate-900, .text-slate-800, .text-slate-700, .text-gray-900, .text-gray-800, .text-black),
body.image-converter-page main :is(.text-slate-900, .text-slate-800, .text-slate-700, .text-gray-900, .text-gray-800, .text-black) {
  color: #f3f6fc !important;
}

body.image-background-remover-page main :is(.text-slate-600, .text-slate-500, .text-slate-400, .text-gray-700, .text-gray-600, .text-gray-500),
body.image-converter-page main :is(.text-slate-600, .text-slate-500, .text-slate-400, .text-gray-700, .text-gray-600, .text-gray-500) {
  color: #b8c4d8 !important;
}

body.image-background-remover-page main > .mt-24 > div,
body.image-converter-page main > .mt-20 > div > div {
  border: 1px solid transparent;
  border-radius: 18px;
  transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}

body.image-background-remover-page main > .mt-24 > div:hover,
body.image-converter-page main > .mt-20 > div > div:hover {
  border-color: var(--image-tools-border);
  background: rgba(17, 26, 45, 0.55);
  transform: translateY(-3px);
}

body.image-background-remover-page main > section[style],
body.image-converter-page main > section[style] {
  color: #b8c4d8 !important;
  border: 1px solid var(--image-tools-border);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(24, 36, 60, 0.9), rgba(13, 21, 37, 0.94));
  box-shadow: 0 2px 0 rgba(255,255,255,.04) inset, 0 8px 0 rgba(5,9,18,.38), 0 20px 40px rgba(0,0,0,.24);
}

body.image-background-remover-page main > section[style] h2,
body.image-background-remover-page main > section[style] h3,
body.image-converter-page main > section[style] h2,
body.image-converter-page main > section[style] h3 {
  color: #f3f6fc !important;
}

body.image-background-remover-page #previewImage {
  cursor: crosshair;
}

body.image-background-remover-page #resultsSection,
body.image-converter-page #queueHeader + #queueList {
  overflow: hidden;
}

body.image-converter-page .format-btn {
  min-height: 52px;
  color: #dbe4f5 !important;
  border-color: var(--image-tools-border) !important;
  background: linear-gradient(145deg, #18243c, #0d1525) !important;
}

body.image-converter-page .format-btn.border-primary {
  color: #fff !important;
  border-color: rgba(196, 181, 253, 0.65) !important;
  background: linear-gradient(145deg, #5143b1, #342a78) !important;
  box-shadow: 0 3px 0 #241c5c, 0 9px 18px rgba(101,82,220,.2);
}

body.image-converter-page #queueList > div {
  border-color: var(--image-tools-border);
}

body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) :focus-visible {
  outline: 2px solid var(--image-tools-accent-bright);
  outline-offset: 3px;
}

@keyframes image-tools-enter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-nav-inner {
    width: 100%;
  }

  body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) :is(.tg-main-nav, .tg-search) {
    display: none !important;
  }

  body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-menu-toggle {
    display: block !important;
  }
}

@media (max-width: 560px) {
  body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) .tg-nav-inner {
    min-height: 64px;
    padding: 10px 16px;
  }

  body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) header .tg-logo-text,
  body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) footer .tg-logo-text {
    font-size: 18px;
  }

  body.image-background-remover-page main > .flex.flex-col.gap-4,
  body.image-converter-page main > .mb-10 {
    padding: 32px 20px;
    border-radius: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.image-ocr-page main > .tool-header,
  body.image-ocr-page .upload-card,
  body.image-background-remover-page main > .flex.flex-col.gap-4,
  body.image-converter-page main > .mb-10 {
    animation: none;
  }

  body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page),
  body:is(.image-ocr-page, .image-background-remover-page, .image-converter-page) * {
    scroll-behavior: auto;
    transition-duration: 0.01ms;
  }
}
