:root {
  color-scheme: light;
  --bg: #f7f8fc;
  --bg-soft: #eef2ff;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --surface-muted: #f1f5f9;
  --text: #101828;
  --text-soft: #475467;
  --text-muted: #667085;
  --border: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(15, 23, 42, 0.2);
  --brand: #7c3aed;
  --brand-2: #06b6d4;
  --brand-3: #f59e0b;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.1);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --container: 1500px;
  --header-h: 116px;
  --convert-sticky-top-lg: 130px;
  --convert-sticky-top-md: 126px;
  --convert-sticky-top-sm: 124px;
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg: #080b16;
  --bg-soft: #111827;
  --surface: rgba(15, 23, 42, 0.78);
  --surface-strong: #111827;
  --surface-muted: rgba(30, 41, 59, 0.92);
  --text: #f8fafc;
  --text-soft: #cbd5e1;
  --text-muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.2);
  --border-strong: rgba(226, 232, 240, 0.3);
  --brand: #a78bfa;
  --brand-2: #22d3ee;
  --brand-3: #fbbf24;
  --success: #22c55e;
  --danger: #f87171;
  --warning: #fbbf24;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.18), transparent 34vw),
    radial-gradient(circle at top right, rgba(6, 182, 212, 0.14), transparent 32vw),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  overflow-y: auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.38;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.1) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, #000, transparent 86%);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--brand);
}

img {
  max-width: 100%;
  display: block;
}

.fa-solid,
.fa-regular,
.fa-brands {
  width: 1em;
  min-width: 1em;
  text-align: center;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--surface-muted) 82%, transparent);
}

::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-muted) 48%, transparent);
  border-radius: 999px;
}

.container,
.container-sm,
.container-md,
.container-lg,
.container-xl,
.container-xxl {
  width: min(calc(100% - 32px), var(--container));
  max-width: var(--container) !important;
  padding-left: 0;
  padding-right: 0;
}

@media (min-width: 1700px) {
  :root {
    --container: 1640px;
  }
}

.preloader-hidden {
  visibility: hidden;
}

.preloader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  color: var(--text);
  background: var(--bg);
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.preloader.opacity-0 {
  opacity: 0;
  visibility: hidden;
}

.preloader-logo {
  width: clamp(84px, 10vw, 150px);
  filter: drop-shadow(0 20px 40px rgba(124, 58, 237, 0.25));
  animation: pulse-logo 1.8s ease-in-out infinite;
}

.preloader-text {
  font-size: clamp(28px, 5vw, 68px);
  font-weight: 800;
  letter-spacing: -0.05em;
}

@keyframes pulse-logo {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }

  50% {
    transform: scale(1.05) rotate(-8deg);
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(22px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.topbar__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar__links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.site-nav {
  min-height: 74px;
  padding: 12px 0;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text) !important;
}

.site-brand__mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  padding: 6px;
  background: linear-gradient(145deg, var(--brand), var(--brand-2));
  border-radius: 18px;
  box-shadow: 0 18px 34px rgba(124, 58, 237, 0.22);
}

.site-brand__text {
  display: grid;
  line-height: 1.05;
}

.site-brand__text strong {
  font-size: 1.18rem;
  letter-spacing: -0.04em;
}

.site-brand__text small {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-nav__menu {
  align-items: center;
  gap: 4px;
}

.site-nav__menu .nav-link {
  color: var(--text-soft);
  font-weight: 750;
  padding: 10px 14px !important;
  border-radius: 999px;
}

.site-nav__menu .nav-link:hover,
.site-nav__menu .nav-link.active {
  color: var(--text) !important;
  background: color-mix(in srgb, var(--brand) 14%, transparent);
}

.site-nav__tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 14px;
}

.theme-toggle,
.site-nav__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: none;
}

.site-nav__toggle {
  width: 46px;
  padding: 0;
}

.theme-toggle:hover,
.site-nav__toggle:hover {
  border-color: var(--border-strong);
  background: color-mix(in srgb, var(--brand) 14%, var(--surface-muted));
}

.site-search {
  position: relative;
  width: min(260px, 100%);
  margin-left: 14px;
}

.site-search i {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--text-muted);
  transform: translateY(-50%);
}

.site-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px 10px 40px;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
}

.site-search input:focus {
  border-color: color-mix(in srgb, var(--brand) 58%, var(--border));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent);
}

.site-main {
  min-height: 62vh;
}

.profile-hero,
.page-hero {
  position: relative;
  padding: clamp(70px, 9vw, 130px) 0 clamp(58px, 8vw, 104px);
  overflow: hidden;
}

.profile-hero__glow,
.hero-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(20px);
  opacity: 0.26;
  pointer-events: none;
}

.profile-hero__glow--one {
  top: 14%;
  left: 4%;
  width: 260px;
  height: 260px;
  background: var(--brand);
}

.profile-hero__glow--two {
  right: 8%;
  bottom: 12%;
  width: 320px;
  height: 320px;
  background: var(--brand-2);
}

.profile-hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.72fr);
  gap: clamp(28px, 5vw, 86px);
  align-items: center;
}

.profile-hero__copy h1,
.page-hero h1 {
  max-width: 850px;
  margin: 18px 0 10px;
  font-size: clamp(48px, 8vw, 118px);
  line-height: 0.9;
  font-weight: 900;
  letter-spacing: -0.085em;
}

.profile-hero__tagline {
  margin: 0 0 22px;
  font-size: clamp(24px, 3.5vw, 54px);
  font-weight: 850;
  color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2), var(--brand-3));
  background-clip: text;
  -webkit-background-clip: text;
}

.profile-hero__lead,
.page-hero p {
  max-width: 760px;
  color: var(--text-soft);
  font-size: clamp(1.05rem, 1.4vw, 1.3rem);
}

.profile-hero__actions,
.hero-actions,
.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  border-radius: 999px;
  font-weight: 800;
}

.btn-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 20px;
  color: #fff !important;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: 0;
  box-shadow: 0 16px 34px color-mix(in srgb, var(--brand) 26%, transparent);
}

.btn-brand:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
}

.btn-ghost-brand,
.btn-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 18px;
  color: var(--text) !important;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.btn-ghost-brand:hover,
.btn-tool:hover {
  color: var(--text) !important;
  border-color: color-mix(in srgb, var(--brand) 46%, var(--border));
  background: color-mix(in srgb, var(--brand) 12%, var(--surface-muted));
}

.btn-danger {
  color: #fff !important;
  background: var(--danger);
  border-color: var(--danger);
}

.btn-success {
  color: #fff !important;
  background: var(--success);
  border-color: var(--success);
}

.btn-warning {
  color: #111827 !important;
  background: var(--warning);
  border-color: var(--warning);
}

.profile-hero__stats,
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 680px;
  margin-top: 34px;
}

.profile-hero__stats div,
.hero-metrics div,
.counter-grid div {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.profile-hero__stats strong,
.hero-metrics strong,
.counter-grid strong {
  display: block;
  color: var(--text);
  font-size: clamp(1.08rem, 1.4vw, 1.3rem);
  line-height: 1.2;
}

.profile-hero__stats span,
.hero-metrics span,
.counter-grid span {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.profile-card,
.hero-panel {
  position: relative;
  padding: clamp(22px, 3vw, 36px);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-strong) 94%, transparent), color-mix(in srgb, var(--brand) 12%, var(--surface))),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(24px);
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: 18px 18px auto auto;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand-2) 42%, transparent), transparent 70%);
  border-radius: 999px;
}

.profile-card__media {
  position: relative;
  display: grid;
  width: clamp(150px, 14vw, 220px);
  height: clamp(150px, 14vw, 220px);
  place-items: center;
  margin: 0 auto 28px;
  padding: 18px;
  background: linear-gradient(145deg, var(--brand), var(--brand-2));
  border-radius: 42px;
  box-shadow: 0 28px 70px color-mix(in srgb, var(--brand) 28%, transparent);
}

.profile-card__body {
  position: relative;
  text-align: center;
}

.profile-card__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  padding: 7px 12px;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 22%, transparent);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
}

.profile-card__body h2 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 3vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.065em;
}

.profile-card__body p {
  color: var(--text-soft);
}

.profile-card__stack,
.hero-panel__stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.profile-card__stack span,
.hero-panel__stack span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: var(--text-soft);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 750;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-block {
  padding: clamp(54px, 7vw, 100px) 0;
}

.section-block--soft {
  background: color-mix(in srgb, var(--surface-muted) 42%, transparent);
  border-block: 1px solid var(--border);
}

.section-head {
  margin-bottom: clamp(24px, 4vw, 44px);
}

.section-head--split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.52fr);
  gap: 24px;
  align-items: end;
}

.section-head--center {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-head h2,
.tool-shell__aside h2 {
  margin: 8px 0 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: -0.075em;
}

.section-head p,
.tool-shell__aside p,
.about-panel p,
.tool-card p {
  color: var(--text-soft);
}

.about-grid,
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.about-panel,
.feature-card,
.tool-card,
.tool-panel,
.tool-shell__aside,
.media-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
}

.about-panel {
  min-height: 260px;
  padding: clamp(22px, 2.2vw, 34px);
}

.about-panel--large {
  grid-column: span 2;
}

.panel-number {
  display: inline-flex;
  margin-bottom: 24px;
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 900;
}

.about-panel h3,
.feature-card h3,
.tool-card h3,
.tool-group h3,
.image-board__title h3 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

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

.tool-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  padding: 24px;
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.tool-card:hover {
  color: var(--text);
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 44%, var(--border));
}

.tool-card__media,
.feature-card__icon,
.drop-zone__icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius: 22px;
  font-size: 1.5rem;
}

.tool-card span {
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.tool-shell--compact {
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
}

.tool-shell__aside,
.tool-panel {
  padding: clamp(20px, 2.4vw, 34px);
}

.tool-shell__aside {
  position: static;
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.counter-grid--stacked {
  grid-template-columns: 1fr;
}

.shortcut-card,
.support-note {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding: 16px;
  color: var(--text-soft);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.shortcut-card strong {
  color: var(--text);
}

.form-label,
.field-block label {
  color: var(--text);
  font-weight: 850;
}

.app-textarea,
.app-select,
.app-input,
.site-search input {
  color: var(--text) !important;
  background-color: var(--surface-muted) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
}

.app-textarea {
  min-height: 220px;
  padding: 18px;
  resize: vertical;
}

.app-textarea--large {
  min-height: 340px;
}

.app-textarea:focus,
.app-select:focus,
.app-input:focus {
  border-color: color-mix(in srgb, var(--brand) 58%, var(--border)) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent) !important;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.action-grid--wide {
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}

.tool-group {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.tool-group__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.tool-group__head span,
.image-board__title span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.tool-group--footer {
  padding-top: 18px;
}

.editor-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.editor-toolbar__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.convert-status,
.media-status {
  display: inline-flex;
  min-height: 20px;
  margin-left: 8px;
  color: var(--success);
  font-size: 0.88rem;
  font-weight: 800;
}

.page-hero--tool {
  padding-bottom: clamp(38px, 6vw, 72px);
}

.page-hero__content {
  max-width: 920px;
}

.page-hero h1 {
  font-size: clamp(44px, 7vw, 90px);
}

.media-shell {
  padding: clamp(20px, 2.4vw, 34px);
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: clamp(28px, 4vw, 52px);
  text-align: center;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--brand) 10%, transparent), color-mix(in srgb, var(--brand-2) 9%, transparent)),
    var(--surface-muted);
  border: 2px dashed color-mix(in srgb, var(--brand) 34%, var(--border));
  border-radius: var(--radius-xl);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.drop-zone.is-dragging {
  border-color: var(--brand-2);
  background: color-mix(in srgb, var(--brand-2) 16%, var(--surface-muted));
  transform: scale(0.995);
}

.drop-zone h2 {
  margin: 14px 0 6px;
  font-weight: 900;
  letter-spacing: -0.045em;
}

.drop-zone p {
  max-width: 680px;
  color: var(--text-soft);
}

.preset-strip,
.option-row,
.choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preset-strip {
  margin-top: 18px;
}

.preset-chip,
.option-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 13px;
  color: var(--text-soft);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 800;
}

.preset-chip:hover,
.option-pill:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
}

.media-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.media-controls--advanced {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.field-block {
  display: grid;
  gap: 8px;
}

.form-range {
  min-height: 46px;
}

.app-color {
  width: 100%;
  min-height: 46px;
  padding: 6px;
  background: var(--surface-muted);
  border-color: var(--border);
  border-radius: var(--radius-md);
}

.option-row {
  margin-top: 16px;
}

.sort-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
  padding: 18px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.sort-panel span {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 900;
}

.choice-list label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-weight: 750;
}

.support-note {
  display: flex;
  align-items: center;
  gap: 10px;
}

.image-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.image-board section {
  min-width: 0;
}

.image-board__title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.image-card-list {
  display: grid;
  gap: 12px;
}

.image-file-card {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 116px;
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.img-preview,
.output-slot {
  width: 96px;
  height: 92px;
  object-fit: cover;
  background: color-mix(in srgb, var(--surface-strong) 76%, transparent);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.output-slot {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.output-slot .img-preview {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.output-slot--error {
  color: var(--danger);
  font-size: 1.8rem;
}

.image-file-card__info {
  min-width: 0;
}

.image-file-card__info strong,
.image-file-card__info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-file-card__info strong {
  color: var(--text);
  font-weight: 900;
}

.image-file-card__info span {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.image-file-card__remove,
.image-file-card__download {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.image-file-card__download {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: 0;
}

.image-file-card--error {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--border));
}

.empty-state {
  padding: 22px;
  color: var(--text-muted);
  text-align: center;
  background: var(--surface-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.site-footer {
  margin-top: clamp(40px, 6vw, 86px);
  padding: 42px 0 28px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(22px);
}

.site-footer__grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-footer__brand img {
  padding: 8px;
  background: linear-gradient(145deg, var(--brand), var(--brand-2));
  border-radius: 18px;
}

.site-footer__brand strong,
.site-footer__brand span {
  display: block;
}

.site-footer__brand strong {
  font-weight: 900;
}

.site-footer__brand span,
.site-footer__bottom,
.site-footer__links a {
  color: var(--text-muted);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer__links a {
  padding: 8px 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 800;
}

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
}

.site-footer__bottom p {
  margin: 0;
}

.flex-center,
.d-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1199px) {
  .profile-hero__grid,
  .tool-shell,
  .tool-shell--compact {
    grid-template-columns: 1fr;
  }

  .tool-shell__aside {
    position: static;
  }

  .media-controls--advanced {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  :root {
    --header-h: 84px;
    --convert-sticky-top-lg: 98px;
    --convert-sticky-top-md: 94px;
    --convert-sticky-top-sm: 92px;
  }

  .topbar {
    display: none;
  }

  .site-nav__tools {
    margin-left: auto;
  }

  .navbar-collapse {
    margin-top: 14px;
    padding: 16px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
  }

  .site-search {
    width: 100%;
    margin-left: 0;
  }

  .section-head--split,
  .about-grid,
  .tool-grid,
  .image-board,
  .sort-panel {
    grid-template-columns: 1fr;
  }

  .about-panel--large {
    grid-column: auto;
  }

  .profile-hero__stats,
  .counter-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .container,
  .container-sm,
  .container-md,
  .container-lg,
  .container-xl,
  .container-xxl {
    width: min(calc(100% - 22px), var(--container));
  }

  .site-brand__text,
  .theme-toggle span {
    display: none;
  }

  .profile-hero,
  .page-hero {
    padding-top: 46px;
  }

  .profile-hero__copy h1,
  .page-hero h1 {
    letter-spacing: -0.065em;
  }

  .profile-hero__actions,
  .media-actions,
  .editor-toolbar,
  .tool-group__head,
  .site-footer__grid,
  .site-footer__bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-card,
  .image-file-card {
    grid-template-columns: 1fr;
  }

  .img-preview,
  .output-slot {
    width: 100%;
    height: 190px;
  }

  .media-controls,
  .media-controls--advanced {
    grid-template-columns: 1fr;
  }

  .preloader {
    flex-direction: column;
    gap: 12px;
  }
}

/* Motion utility pack: opt-in classes only, transform/opacity based to keep Lighthouse stable. */
:root {
  --motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-time: 0.62s;
}

.wrapper {
  position: relative;
  z-index: 2;
}

body.ts-motion-page::before {
  animation: ts-grid-drift 32s linear infinite;
  will-change: background-position;
}

.site-header {
  transition: background 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-color: color-mix(in srgb, var(--brand) 22%, var(--border));
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.08);
}

.ts-motion-brand .site-brand__mark {
  transition: transform 0.28s var(--motion-ease), box-shadow 0.28s ease;
}

.ts-motion-brand:hover .site-brand__mark {
  transform: translateY(-2px) rotate(-3deg) scale(1.03);
  box-shadow: 0 20px 42px rgba(124, 58, 237, 0.28);
}

.ts-motion-button,
.ts-motion-lift,
.ts-motion-sheen,
.profile-card__stack span,
.hero-panel__stack span,
.app-textarea,
.app-select,
.app-input,
.site-search input,
.app-color {
  transition:
    color 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s var(--motion-ease),
    filter 0.22s ease;
}

.ts-motion-button:hover,
.ts-motion-lift:hover {
  transform: translateY(-2px);
}

.ts-motion-lift:hover {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--border));
  box-shadow: 0 24px 64px color-mix(in srgb, var(--brand) 12%, transparent), var(--shadow-soft);
}

.ts-motion-lift--high:hover {
  transform: translateY(-5px);
}

.ts-motion-sheen {
  position: relative;
  overflow: hidden;
}

.ts-motion-sheen::after {
  content: "";
  position: absolute;
  inset: -40% -80%;
  background: linear-gradient(115deg, transparent 36%, rgba(255, 255, 255, 0.52), transparent 64%);
  transform: translateX(-68%) rotate(8deg);
  transition: transform 0.72s var(--motion-ease);
  pointer-events: none;
}

.ts-motion-sheen:hover::after,
.ts-motion-sheen:focus-visible::after,
.ts-motion-sheen-parent:hover .ts-motion-sheen::after {
  transform: translateX(68%) rotate(8deg);
}

.ts-motion-spark {
  position: relative;
  overflow: hidden;
}

.ts-motion-spark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(circle at var(--spark-x, 50%) var(--spark-y, 0%), color-mix(in srgb, var(--brand) 18%, transparent), transparent 34%);
  transition: opacity 0.28s ease;
  pointer-events: none;
}

.ts-motion-spark:hover::after,
.ts-motion-spark.is-tilting::after {
  opacity: 1;
}

.ts-motion-orb--one {
  animation: ts-orb-float-one 13s ease-in-out infinite alternate;
}

.ts-motion-orb--two {
  animation: ts-orb-float-two 16s ease-in-out infinite alternate;
}

.ts-motion-gradient {
  background-size: 220% auto;
  animation: ts-gradient-run 7s ease-in-out infinite alternate;
}

.ts-motion-float {
  animation: ts-float-soft 5.8s ease-in-out infinite;
}

.ts-motion-pulse {
  animation: ts-status-pulse 1.8s ease-in-out infinite;
}

.ts-motion-ready .ts-motion-intro > * {
  animation: ts-fade-up var(--motion-time) var(--motion-ease) both;
}

.ts-motion-ready .ts-motion-intro > :nth-child(2) {
  animation-delay: 0.07s;
}

.ts-motion-ready .ts-motion-intro > :nth-child(3) {
  animation-delay: 0.14s;
}

.ts-motion-ready .ts-motion-intro > :nth-child(4) {
  animation-delay: 0.2s;
}

.ts-motion-ready .ts-motion-intro > :nth-child(5) {
  animation-delay: 0.27s;
}

.ts-motion-ready .ts-motion-intro > :nth-child(6) {
  animation-delay: 0.34s;
}

.ts-motion-ready .ts-motion-reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  filter: blur(8px);
  transition:
    opacity var(--motion-time) var(--motion-ease),
    transform var(--motion-time) var(--motion-ease),
    filter var(--motion-time) var(--motion-ease);
  will-change: opacity, transform, filter;
}

.ts-motion-ready .ts-motion-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
  will-change: auto;
}

.ts-motion-tilt {
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transform: perspective(1100px) rotateX(0deg) rotateY(0deg) translate3d(0, 0, 0);
}

.ts-motion-tilt.is-tilting {
  transition-property: color, background, border-color, box-shadow, filter;
  will-change: transform;
}

.ts-cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
  width: 360px;
  height: 360px;
  opacity: 0;
  contain: layout paint style;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand, #7c3aed) 48%, transparent), transparent 68%);
  border-radius: 999px;
  pointer-events: none;
  transform: translate3d(calc(50vw - 180px), calc(50vh - 180px), 0);
  transition: opacity 0.22s ease;
  will-change: transform, opacity;
}

.ts-cursor-glow.is-active {
  opacity: 0.14;
}

.drop-zone.ts-motion-lift:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand-2) 64%, var(--border));
  box-shadow: 0 24px 60px color-mix(in srgb, var(--brand-2) 11%, transparent);
}

.app-textarea:focus,
.app-select:focus,
.app-input:focus,
.site-search input:focus {
  transform: translateY(-1px);
}

.profile-card__stack span:hover,
.hero-panel__stack span:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--border));
  background: color-mix(in srgb, var(--brand) 12%, var(--surface-muted));
}

@keyframes ts-grid-drift {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 56px 56px, 56px 56px;
  }
}

@keyframes ts-orb-float-one {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(34px, -28px, 0) scale(1.12);
  }
}

@keyframes ts-orb-float-two {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(-42px, 34px, 0) scale(1.08);
  }
}

@keyframes ts-gradient-run {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 100% 50%;
  }
}

@keyframes ts-float-soft {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  50% {
    transform: translate3d(0, -8px, 0) rotate(-1.5deg);
  }
}

@keyframes ts-status-pulse {
  0%, 100% {
    opacity: 1;
    filter: drop-shadow(0 0 0 rgba(34, 197, 94, 0));
  }

  50% {
    opacity: 0.56;
    filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.64));
  }
}

@keyframes ts-fade-up {
  from {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
    filter: blur(8px);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

@media (hover: none), (pointer: coarse) {
  .ts-cursor-glow {
    display: none;
  }

  .ts-motion-tilt.is-tilting {
    transform: none;
  }
}

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

  .ts-motion-ready .ts-motion-reveal,
  .ts-motion-ready .ts-motion-reveal.is-visible {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .ts-cursor-glow {
    display: none;
  }
}


/* Patch 16: Convert Case sticky grid overlaps case and developer actions */
.convert-case-shell {
  display: block;
  position: relative;
}

.convert-case-shell,
.convert-editor-panel,
.convert-entry-sticky-scope,
.convert-entry-grid,
.convert-sticky-counter,
.convert-sticky-editor {
  overflow: visible;
}

.convert-editor-panel {
  position: relative;
  display: grid;
  gap: 24px;
}

.convert-entry-sticky-scope {
  position: relative;
  display: grid;
  gap: 0;
  min-width: 0;
  margin-bottom: 0;
}

.convert-entry-grid {
  position: relative;
  top: auto;
  z-index: auto;
  display: grid;
  background: #0f172a;
  border-radius: 25px;
  grid-template-columns: minmax(260px, 0.32fr) minmax(0, 1fr);
  gap: clamp(16px, 1.8vw, 24px);
  align-items: stretch;
}

.convert-sticky-limit-group {
  position: relative;
  z-index: 1;
}

.convert-counter-item {
  min-width: 0;
  min-height: 86px;
  padding: 18px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.convert-counter-item strong {
  display: block;
  color: var(--text);
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.05;
  font-weight: 900;
}

.convert-counter-item span {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.25;
}

.convert-shortcut-card {
  margin-top: auto;
}

.convert-sticky-counter,
.convert-sticky-editor {
  position: relative;
  top: auto;
  z-index: auto;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--brand) 42%, transparent) transparent;
}

.convert-sticky-counter {
  align-self: stretch;
  max-height: min(680px, 74dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.convert-sticky-counter h2 {
  font-size: clamp(1.7rem, 2.15vw, 2.55rem);
}

.convert-sticky-counter p {
  margin-bottom: 0;
}

.convert-sticky-counter .counter-grid--stacked {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.convert-sticky-counter .counter-grid > div {
  min-height: 76px;
  padding: 14px 16px;
}

.convert-sticky-editor {
  z-index: 13;
  justify-content: flex-start;
  padding: clamp(18px, 2.1vw, 28px) clamp(20px, 2.4vw, 34px) 20px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 98%, transparent), color-mix(in srgb, var(--surface) 92%, transparent)),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 42px color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(18px);
}

.convert-sticky-editor .app-textarea--large {
  flex: 1 1 auto;
  min-height: clamp(220px, 32vh, 360px);
  max-height: 46dvh;
}

.convert-sticky-counter::-webkit-scrollbar,
.convert-sticky-editor::-webkit-scrollbar {
  width: 6px;
}

.convert-sticky-counter::-webkit-scrollbar-thumb,
.convert-sticky-editor::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--brand) 42%, transparent);
  border-radius: 999px;
}

@media (min-width: 1200px) {
  .convert-entry-grid {
    position: sticky;
    top: var(--convert-sticky-top-lg);
    z-index: 14;
    align-self: start;
  }
}

@media (max-width: 1199px) and (min-width: 769px) {
  .convert-entry-grid {
    position: sticky;
    top: var(--convert-sticky-top-md);
    z-index: 14;
    align-self: start;
  }
}

@media (max-width: 991px) and (min-width: 769px) {
  .convert-entry-grid {
    grid-template-columns: minmax(230px, 0.34fr) minmax(0, 1fr);
  }

  .convert-sticky-counter {
    padding: 18px;
  }

  .convert-sticky-counter h2 {
    font-size: clamp(1.55rem, 3vw, 2.1rem);
  }

  .convert-sticky-counter .counter-grid--stacked {
    gap: 8px;
  }

  .convert-sticky-counter .counter-grid > div {
    padding: 12px;
  }
}

@media (max-width: 768px) {
  .convert-editor-panel {
    gap: 18px;
  }

  .convert-entry-sticky-scope {
    margin-bottom: 0;
  }

  .convert-entry-grid {
    position: sticky;
    top: var(--convert-sticky-top-sm);
    z-index: 18;
    grid-template-columns: 1fr;
    gap: 12px;
    max-height: calc(100dvh - var(--convert-sticky-top-sm) - 12px);
    overflow-x: clip;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--brand) 42%, transparent) transparent;
  }

  .convert-entry-grid::-webkit-scrollbar {
    width: 6px;
  }

  .convert-entry-grid::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--brand) 42%, transparent);
    border-radius: 999px;
  }

  .convert-sticky-counter {
    position: relative;
    top: auto;
    z-index: auto;
    min-height: 0;
    height: auto;
    padding: 10px;
    border-radius: 20px;
    box-shadow: 0 16px 36px color-mix(in srgb, var(--bg) 70%, transparent);
  }

  .convert-sticky-editor {
    position: relative;
    top: auto;
    min-height: 0;
    height: auto;
    padding: 16px;
  }

  .convert-sticky-counter > .eyebrow,
  .convert-sticky-counter > h2,
  .convert-sticky-counter > p,
  .convert-sticky-counter .shortcut-card {
    display: none;
  }

  .convert-sticky-counter .counter-grid--stacked {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 0;
  }

  .convert-sticky-counter .counter-grid > div {
    min-height: auto;
    padding: 9px 10px;
    border-radius: 14px;
  }

  .convert-counter-item strong {
    font-size: 1.05rem;
  }

  .convert-counter-item span {
    margin-top: 2px;
    font-size: 0.72rem;
    line-height: 1.15;
  }
}

@media (max-width: 575px) {
  .convert-sticky-counter .counter-grid--stacked {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.media-workflow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.36fr);
  gap: 18px;
  align-items: stretch;
}

.media-workflow__upload,
.media-workflow__panel {
  min-width: 0;
}

.media-workflow__panel {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: clamp(18px, 2vw, 26px);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.media-panel-head h2 {
  margin: 8px 0 8px;
  font-size: clamp(1.8rem, 3vw, 3.1rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.media-panel-head p {
  margin: 0;
  color: var(--text-soft);
}

.media-primary-controls {
  display: grid;
  gap: 14px;
}

.preset-strip--compact {
  margin-top: 0;
}

.preset-strip--compact .preset-chip {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 0.84rem;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.media-actions--sticky {
  margin-top: 0;
}

.media-actions--sticky .btn {
  flex: 1 1 132px;
}

.media-advanced-panel {
  margin-top: 18px;
  padding: 0;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.media-advanced-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  font-weight: 900;
}

.media-advanced-panel summary::-webkit-details-marker {
  display: none;
}

.media-advanced-panel summary::after {
  content: '+';
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--brand);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.media-advanced-panel[open] summary::after {
  content: '−';
}

.media-advanced-panel summary span,
.media-advanced-panel summary small {
  display: block;
}

.media-advanced-panel summary small {
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.media-advanced-panel .media-controls,
.media-advanced-panel .option-row,
.media-advanced-panel .sort-panel,
.media-advanced-panel .support-note {
  margin: 0 18px 18px;
}

.media-advanced-panel .media-controls--advanced {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1199px) {
  .media-workflow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .editor-toolbar {
    display: grid;
  }

  .editor-toolbar__actions,
  .media-actions--sticky {
    display: grid;
    grid-template-columns: 1fr;
  }

  .media-workflow__panel,
  .media-advanced-panel summary {
    padding: 16px;
  }

  .media-advanced-panel .media-controls,
  .media-advanced-panel .option-row,
  .media-advanced-panel .sort-panel,
  .media-advanced-panel .support-note {
    margin-inline: 16px;
  }

  .media-advanced-panel .media-controls--advanced {
    grid-template-columns: 1fr;
  }
}

/* Patch 10: auto-hide header while scrolling down */
.site-header {
  transform: translate3d(0, 0, 0);
  transition:
    transform 0.28s var(--motion-ease, ease),
    background 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease;
  will-change: transform;
}

.site-header.is-hidden {
  transform: translate3d(0, calc(-100% - 4px), 0);
  pointer-events: none;
}

.site-header:focus-within,
.site-header:not(.is-hidden) {
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .site-header {
    transition:
      background 0.28s ease,
      border-color 0.28s ease,
      box-shadow 0.28s ease;
  }
}
