:root {
  --bg: #f4f7fb;
  --bg-deep: #eaf1f8;
  --text: #101828;
  --text-soft: #344054;
  --text-muted: #667085;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --surface-elevated: rgba(255, 255, 255, 0.92);
  --panel: #ffffff;
  --border: rgba(52, 64, 84, 0.13);
  --border-light: rgba(52, 64, 84, 0.08);
  --border-hover: rgba(25, 112, 255, 0.32);
  --accent: #0878f9;
  --accent-600: #0564d8;
  --accent-hover: #0059c7;
  --accent-soft: rgba(8, 120, 249, 0.1);
  --teal: #16b8a6;
  --shadow: 0 16px 50px rgba(24, 45, 77, 0.09), 0 2px 8px rgba(24, 45, 77, 0.04);
  --shadow-lg: 0 30px 80px rgba(24, 45, 77, 0.14), 0 8px 24px rgba(24, 45, 77, 0.06);
  --radius: 24px;
  --max-width: 1180px;
  --container-padding: clamp(18px, 4vw, 36px);
  --font-system: "Manrope", "Avenir Next", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, monospace;
  font-family: var(--font-system);
  color-scheme: light;
}

[data-theme="dark"],
.theme-dark {
  --bg: #080d16;
  --bg-deep: #0d1623;
  --text: #f4f7fb;
  --text-soft: #d0d5dd;
  --text-muted: #98a2b3;
  --surface: rgba(17, 26, 39, 0.74);
  --surface-solid: #111a27;
  --surface-elevated: rgba(23, 34, 50, 0.94);
  --panel: #151f2e;
  --border: rgba(255, 255, 255, 0.13);
  --border-light: rgba(255, 255, 255, 0.075);
  --border-hover: rgba(101, 170, 255, 0.45);
  --accent: #4ca1ff;
  --accent-600: #2385f5;
  --accent-hover: #72b5ff;
  --accent-soft: rgba(76, 161, 255, 0.14);
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 32px 90px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font-system);
  transition: background-color 0.35s ease, color 0.35s ease;
}

button,
input,
textarea,
select { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(8, 120, 249, 0.25);
  outline-offset: 3px;
}

.container { width: min(100%, var(--max-width)); margin: 0 auto; padding: 22px var(--container-padding) 34px; }

header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(32px, 5vw, 62px);
  padding: 12px 14px 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 12px 36px rgba(24, 45, 77, 0.07);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

[data-theme="dark"] header,
.theme-dark header { border-color: rgba(255, 255, 255, 0.09); background: rgba(12, 19, 30, 0.66); }

.logo { display: flex; align-items: center; min-width: 0; gap: 13px; }
.logo > div:last-child { min-width: 0; }
.brand-mark.logo-container {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(8, 120, 249, 0.17), inset 0 1px 0 white;
}
[data-theme="dark"] .brand-mark.logo-container,
.theme-dark .brand-mark.logo-container { border-color: rgba(255,255,255,.12); background: #2d3748; box-shadow: 0 9px 24px rgba(0,0,0,.3); }
.brand-mark svg { display: block; width: 28px; height: 28px; margin: 0; flex: 0 0 auto; }

h1 { margin: 0; color: var(--text); font-size: clamp(17px, 2.2vw, 21px); font-weight: 800; letter-spacing: -0.045em; line-height: 1.2; }
.sub { max-width: 610px; margin-top: 3px; overflow: hidden; color: var(--text-muted); font-size: 11px; font-weight: 500; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 11px; }
header nav { white-space: nowrap; }

.theme-toggle {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border-light);
  border-radius: 13px;
  background: var(--surface-elevated);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(24, 45, 77, 0.07);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.theme-toggle:hover { transform: translateY(-2px); border-color: var(--border-hover); }
.theme-toggle svg { width: 18px; height: 18px; stroke: currentColor; transition: opacity .25s ease, transform .35s ease; }
.theme-toggle .moon-icon { position: absolute; opacity: 0; transform: rotate(-35deg) scale(.7); }
[data-theme="dark"] .theme-toggle .sun-icon, .theme-dark .theme-toggle .sun-icon { opacity: 0; transform: rotate(45deg) scale(.7); }
[data-theme="dark"] .theme-toggle .moon-icon, .theme-dark .theme-toggle .moon-icon { opacity: 1; transform: rotate(0) scale(1); }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) 318px; align-items: start; min-width: 0; gap: 22px; }
.hero > section { min-width: 0; }
main,
form,
.mode { min-width: 0; max-width: 100%; }

.card {
  position: relative;
  padding: clamp(18px, 3vw, 28px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(145%);
  -webkit-backdrop-filter: blur(26px) saturate(145%);
  transition: border-color .25s ease, box-shadow .25s ease, background .35s ease, transform .25s ease;
}
[data-theme="dark"] .card, .theme-dark .card { border-color: rgba(255,255,255,.085); }
.hero > section > .card:first-child { box-shadow: var(--shadow-lg); }

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
  padding: 0 2px 10px;
  border-bottom: 1px solid var(--border-light);
}
.tab {
  position: relative;
  min-width: 0;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  cursor: pointer;
  transition: color .2s ease;
}
.tab:hover { color: var(--text); }
.tab[aria-pressed="true"] { color: var(--text); font-weight: 700; }
.tab[aria-pressed="true"]::after { position: absolute; right: 14%; bottom: -11px; left: 14%; height: 2px; border-radius: 2px; background: var(--accent); content: ""; }

fieldset {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--border-light);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.38);
}
[data-theme="dark"] fieldset, .theme-dark fieldset { background: rgba(255,255,255,.022); }

label { color: var(--text-soft); font-weight: 700; }
.input,
.select,
.options-content select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background-color: var(--surface-elevated);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.025);
  transition: border-color .2s ease, box-shadow .2s ease, background .25s ease;
}
.input { padding: 14px 15px; }
.select { min-height: 48px; padding: 11px 45px 11px 14px; appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-position: right 14px center; background-repeat: no-repeat; }
.input:hover, .select:hover, .options-content select:hover { border-color: var(--border-hover); }
.input:focus, .select:focus, .options-content select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder { color: #98a2b3; opacity: 1; }

.url-input { display: flex; gap: 10px; }
.url-textarea-wrapper { position: relative; width: 100%; }
.url-textarea-wrapper textarea { min-height: 112px; padding-right: 44px; resize: vertical; font-size: 14px; line-height: 1.55; }
.clear-btn { position: absolute; top: 13px; right: 12px; display: grid; width: 28px; height: 28px; padding: 0; place-items: center; border: 0; border-radius: 9px; background: var(--accent-soft); color: var(--accent); opacity: 0; pointer-events: none; cursor: pointer; transform: scale(.8); transition: opacity .2s ease, transform .2s ease, background .2s ease; }
.clear-btn.show { opacity: 1; pointer-events: auto; transform: scale(1); }
.clear-btn:hover { background: rgba(8,120,249,.18); }
.clear-btn svg { width: 14px; height: 14px; }

.options-details { margin-top: 14px !important; border-top: 1px solid var(--border-light); }
.options-details summary::-webkit-details-marker { display: none; }
.options-toggle { padding: 13px 2px 4px !important; list-style: none; font-weight: 700; }
.options-toggle:hover { color: var(--text) !important; }
.chevron-icon { flex-shrink: 0; color: var(--text-muted); transition: transform .3s cubic-bezier(.4,0,.2,1), color .2s ease; }
.options-details[open] .chevron-icon { transform: rotate(180deg); }
.options-content { padding: 3px 2px 1px; }
.options-content select { min-height: 43px; padding: 8px 10px !important; border-radius: 12px !important; }
.options-content input[type="checkbox"] { width: 17px; height: 17px; margin: 0 7px 0 1px; vertical-align: -3px; accent-color: var(--accent); }

.upload-area { position: relative; display: grid; min-height: 190px; margin-top: 0 !important; padding: 28px; place-content: center; text-align: center; border: 1.5px dashed rgba(8, 120, 249, .3); border-radius: 17px; background: var(--accent-soft); transition: border-color .2s ease, background .2s ease; }
.upload-area:hover { border-color: var(--accent); background: rgba(8,120,249,.14); }
.upload-area::before { display: grid; width: 48px; height: 48px; margin: 0 auto 13px; place-items: center; border-radius: 15px; background: var(--surface-elevated); color: var(--accent); box-shadow: 0 8px 20px rgba(8,120,249,.13); content: "\2191"; font-size: 23px; font-weight: 500; }
.upload-area input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-area label { color: var(--text); font-size: 14px; }

.button-group { justify-content: stretch; }
.btn-primary,
.btn-ghost,
.pill { border: 0; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease, color .2s ease; }
.btn-primary { min-height: 50px; padding: 12px 20px; border-radius: 15px; background: var(--accent); color: #fff; font-weight: 800; letter-spacing: -.01em; box-shadow: 0 12px 25px rgba(8, 112, 235, .24), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(8,112,235,.3), inset 0 1px 0 rgba(255,255,255,.35); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { cursor: wait; opacity: .72; transform: none; }
.btn-ghost { min-height: 50px; padding: 12px 18px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface-elevated); color: var(--text-soft); font-weight: 700; }
.btn-ghost:hover { transform: translateY(-1px); border-color: var(--border-hover); color: var(--accent); }

.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 17px 0 0 !important; }
.pill { padding: 8px 12px; border: 1px solid var(--border-light); border-radius: 999px; background: rgba(255,255,255,.4); color: var(--text-muted); font-size: 11px; font-weight: 700; }
[data-theme="dark"] .pill, .theme-dark .pill { background: rgba(255,255,255,.035); }
.pill:hover { transform: translateY(-1px); border-color: var(--border-hover); background: var(--accent-soft); color: var(--accent); }

.trust { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px !important; padding-top: 16px; border-top: 1px solid var(--border-light); }
.trust .item { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 10px; background: rgba(22,184,166,.075); color: var(--text-soft); font-size: 10px; font-weight: 700; }
.trust .item span { color: var(--teal); filter: saturate(.8); }

.sidebar { display: grid; gap: 16px; }
.sidebar .card { margin-top: 0 !important; padding: 21px; }
.sidebar .card h2 { margin: 0 0 15px !important; color: var(--text); font-size: 14px !important; font-weight: 800 !important; letter-spacing: -.02em; }
.services { display: grid; gap: 8px; }
.service { display: grid; grid-template-columns: 39px 1fr; align-items: center; gap: 12px; padding: 11px; border: 1px solid transparent; border-radius: 15px; background: rgba(255,255,255,.38); transition: transform .2s ease, border-color .2s ease, background .2s ease; }
[data-theme="dark"] .service, .theme-dark .service { background: rgba(255,255,255,.025); }
.service:hover { transform: translateX(3px); border-color: var(--border-light); background: var(--surface-elevated); }
.s-ico { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(8,120,249,.06); }
.service h3 { margin: 0; color: var(--text); font-size: 12px; font-weight: 800; line-height: 1.35; }
.service .small { margin-top: 2px; line-height: 1.4; }
.sidebar a { color: var(--accent) !important; text-underline-offset: 3px; }
.sidebar ol { margin: 0; padding-left: 22px !important; }
.sidebar li { padding-left: 3px; color: var(--text-muted); }
.sidebar li::marker { color: var(--accent); font-weight: 800; }

.seo { margin-top: 18px !important; padding: clamp(22px, 3.2vw, 30px); }
.seo h2 { max-width: 620px; margin: 0 0 13px; color: var(--text); font-size: clamp(17px, 2.2vw, 21px); font-weight: 800; letter-spacing: -.035em; line-height: 1.25; }
.seo p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.85; }
.seo em { color: var(--text-soft); font-style: normal; font-weight: 700; }

.alert { padding: 13px 15px; border: 1px solid rgba(22,184,166,.18); border-radius: 14px; background: rgba(22,184,166,.09); color: #08796e; font-size: 12px; font-weight: 650; }
[data-theme="dark"] .alert, .theme-dark .alert { color: #6ee7d8; }
.alert a { color: var(--accent) !important; text-underline-offset: 3px; }
.alert code { padding: 2px 6px; border-radius: 5px; background: var(--accent-soft); font-family: var(--font-mono); }
.share-panel { background: var(--surface-elevated) !important; }
.share-action { min-height: 40px; }

footer { margin-top: 28px; padding: 24px 0 4px; border-top: 1px solid var(--border-light); color: var(--text-muted); text-align: center; }
footer a { text-underline-offset: 4px; transition: color .2s ease; }
footer a:hover { color: var(--accent) !important; }

.muted { color: var(--text-muted); }
.small { font-size: 11px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
header { animation: rise-in .55s cubic-bezier(.2,.75,.25,1) both; }
.hero > section { animation: rise-in .65s .08s cubic-bezier(.2,.75,.25,1) both; }
.sidebar { animation: rise-in .65s .16s cubic-bezier(.2,.75,.25,1) both; }

@media (max-width: 920px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .sidebar { grid-template-columns: 1.3fr 1fr; }
  .sidebar .card { height: 100%; }
}

@media (max-width: 700px) {
  .container { padding-top: 12px; }
  header { display: block; margin-bottom: 30px; padding: 14px 52px 15px; border-radius: 22px; }
  header .logo { width: 100%; flex-direction: column; justify-content: center; gap: 8px; text-align: center; }
  header .logo > div:last-child { width: 100%; }
  header .row { position: absolute; top: 12px; right: 12px; }
  header nav { display: none; }
  .sub { display: flex; max-width: none; margin-top: 9px; overflow: visible; flex-wrap: wrap; justify-content: center; gap: 6px; text-overflow: clip; white-space: normal; }
  .sub-chip { padding: 5px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--text-soft); font-size: 9px; font-weight: 700; line-height: 1.35; }
  .sub-separator { display: none; }
  .tabs { display: grid; grid-template-columns: 1fr; gap: 7px; margin: 0 0 20px; padding: 0; overflow: visible; border: 0; }
  .tab { width: 100%; min-height: 43px; padding: 11px 14px; border-radius: 13px; background: rgba(114, 130, 154, 0.08); color: var(--text-soft); white-space: normal; }
  .tab:hover { background: var(--accent-soft); }
  .tab[aria-pressed="true"] { background: var(--accent); color: #ffffff; box-shadow: 0 8px 18px rgba(8, 120, 249, .2); }
  .tab[aria-pressed="true"]::after { display: none; }
  .sidebar { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  :root { --container-padding: 12px; --radius: 20px; }
  body { font-size: 14px; }
  .container { padding-bottom: 22px; }
  header { padding: 14px 48px 15px; }
  .brand-mark.logo-container { width: 43px; height: 43px; border-radius: 13px; }
  h1 { font-size: 16px; }
  .theme-toggle { width: 38px; height: 38px; }
  .card { padding: 15px; }
  .hero > section,
  .card,
  fieldset,
  .tabs { width: 100%; min-width: 0; max-width: 100%; }
  fieldset { padding: 14px; }
  .url-textarea-wrapper textarea { min-height: 132px; font-size: 16px; }
  .select, .options-content select { font-size: 16px; }
  .button-group { flex-direction: column; }
  .button-group button { width: 100%; min-width: 100% !important; }
  .quick { display: grid; grid-template-columns: repeat(2, 1fr); }
  .pill { white-space: normal; }
  .trust .item { flex: 1 1 auto; justify-content: center; }
  .upload-area { min-height: 175px; padding: 22px 14px; }
}

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