/* Free AI Cleaner */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --surface-3: #e8e8ed;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --on-accent: #ffffff;
  --green: #248a3d;
  --green-soft: rgba(52, 199, 89, 0.16);
  --del: #d70015;
  --del-soft: rgba(255, 59, 48, 0.12);
  --mark: rgba(255, 204, 0, 0.38);
  --nav-bg: rgba(251, 251, 253, 0.8);
  --switch-off: #e9e9eb;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.02), 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.03), 0 20px 60px rgba(0, 0, 0, 0.08);
  --radius: 22px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #161617;
    --surface-2: #1d1d1f;
    --surface-3: #2c2c2e;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #86868b;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);
    --accent: #2997ff;
    --accent-hover: #47a6ff;
    --accent-soft: rgba(41, 151, 255, 0.16);
    --green: #30d158;
    --green-soft: rgba(48, 209, 88, 0.18);
    --del: #ff6961;
    --del-soft: rgba(255, 69, 58, 0.2);
    --mark: rgba(255, 214, 10, 0.3);
    --nav-bg: rgba(22, 22, 23, 0.8);
    --switch-off: #39393d;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
    --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.06);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #161617;
  --surface-2: #1d1d1f;
  --surface-3: #2c2c2e;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #86868b;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #2997ff;
  --accent-hover: #47a6ff;
  --accent-soft: rgba(41, 151, 255, 0.16);
  --green: #30d158;
  --green-soft: rgba(48, 209, 88, 0.18);
  --del: #ff6961;
  --del-soft: rgba(255, 69, 58, 0.2);
  --mark: rgba(255, 214, 10, 0.3);
  --nav-bg: rgba(22, 22, 23, 0.8);
  --switch-off: #39393d;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.06);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }

:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; box-shadow: 0 0 0 1px var(--accent); }

.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;
}

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 22px; }

/* ---------- Nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 52px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; display: block; }
.nav-links { display: flex; align-items: center; gap: 26px; font-size: 14px; }
.nav-links a { color: var(--text-2); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Hero ---------- */

.hero { text-align: center; padding: 72px 0 40px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 22px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.hero h1 {
  font-size: clamp(40px, 7vw, 72px); line-height: 1.04; font-weight: 700;
  letter-spacing: -0.035em; margin: 0 0 18px;
}
.hero h1 .grad {
  background: linear-gradient(90deg, #0071e3 0%, #7b4dff 55%, #c94bff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: clamp(19px, 2.4vw, 23px); line-height: 1.4; color: var(--text-2); max-width: 680px; margin: 0 auto; letter-spacing: -0.01em; }

/* ---------- Tool ---------- */

.tool { padding-bottom: 40px; }

.workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.panel {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 14px 14px 20px; border-bottom: 1px solid var(--border); min-height: 60px; flex-wrap: wrap;
}
.panel-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.panel-title h2 { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: -0.01em; white-space: nowrap; }
.actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.badge {
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.badge.warn { background: var(--del-soft); color: var(--del); }
.badge.ok { background: var(--green-soft); color: var(--green); }

.editor {
  display: block; width: 100%; height: 440px; resize: vertical; min-height: 240px;
  border: 0; outline: none; background: transparent; padding: 18px 20px;
  font-size: 15px; line-height: 1.6; letter-spacing: -0.01em; color: var(--text);
  white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto;
}
.editor::placeholder { color: var(--text-3); }
.editor:focus-visible { box-shadow: none; outline: none; }
.view { margin: 0; font-family: var(--font); }
.view[hidden] { display: none; }

.panel-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  background: var(--surface-2); color: var(--text);
  transition: background 0.2s, transform 0.1s, color 0.2s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.97); }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn.done { background: var(--green); color: #fff; }

/* Segmented control */
.segmented {
  display: inline-flex; padding: 2px; border-radius: 9px; background: var(--surface-2);
  border: 1px solid var(--border);
}
.segmented button {
  border: 0; background: transparent; color: var(--text-2); cursor: pointer;
  font-size: 13px; font-weight: 500; padding: 4px 12px; border-radius: 7px;
  transition: background 0.2s, color 0.2s;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
:root[data-theme="dark"] .segmented button[aria-pressed="true"] { background: var(--surface-3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .segmented button[aria-pressed="true"] { background: var(--surface-3); } }

/* Diff + review views */
.diff del {
  text-decoration: line-through; text-decoration-color: var(--del);
  background: var(--del-soft); color: var(--del); border-radius: 3px;
}
.diff ins { text-decoration: none; background: var(--green-soft); color: var(--green); border-radius: 3px; }
.diff .tag {
  display: inline-block; font-family: var(--mono); font-size: 10px; font-weight: 600; line-height: 1;
  padding: 3px 4px; margin: 0 1px; border-radius: 4px; vertical-align: 2px;
  background: var(--del); color: #fff; text-decoration: none; letter-spacing: 0;
}
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.empty-note { color: var(--text-3); }

/* Summary */
.summary { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.summary strong { color: var(--text); font-weight: 600; }
.check { width: 18px; height: 18px; border-radius: 50%; background: var(--green); display: inline-grid; place-items: center; flex: none; }
.check svg { width: 11px; height: 11px; color: #fff; }

/* ---------- Options ---------- */

.options {
  margin-top: 20px; background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow); padding: 8px 0;
}
.options-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 22px 10px; flex-wrap: wrap;
}
.options-head h2 { font-size: 15px; font-weight: 600; margin: 0; }
.options-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.opt {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 22px;
  border-top: 1px solid var(--border);
}
.opt label { cursor: pointer; display: block; }
.opt-text { flex: 1; min-width: 0; }
.opt .opt-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; flex-wrap: wrap; }
.opt-desc { font-size: 13px; color: var(--text-2); line-height: 1.4; margin-top: 2px; }
.opt .count {
  font-size: 12px; font-weight: 600; color: var(--text-3); background: var(--surface-2);
  padding: 1px 8px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.opt .count.hit { color: var(--accent); background: var(--accent-soft); }
.opt select {
  margin-top: 8px; font-size: 13px; padding: 4px 8px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface-2);
}

/* iOS-style switch */
.switch { position: relative; flex: none; width: 44px; height: 26px; margin-top: 1px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--switch-off);
  transition: background 0.25s ease;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 1px rgba(0, 0, 0, 0.1);
  transition: transform 0.25s cubic-bezier(0.3, 0.7, 0.4, 1);
}
.switch input:checked + .track { background: var(--green); }
:root .switch input:checked + .track { background: #34c759; }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--accent-soft); outline-offset: 2px; }

/* Review list */
.review { margin-top: 20px; }
.review[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 22px 18px; }
.chip {
  font-size: 13px; padding: 5px 12px; border-radius: 999px; background: var(--mark); color: var(--text);
}
.chip b { font-weight: 600; margin-left: 4px; font-variant-numeric: tabular-nums; }
.review p { margin: 0; padding: 0 22px 12px; font-size: 13px; color: var(--text-2); }

/* ---------- Sections ---------- */

.section { padding: 88px 0; }
.section.alt { background: var(--surface); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(32px, 5vw, 48px); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 14px; font-weight: 700; }
.section-head p { font-size: 19px; color: var(--text-2); margin: 0; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.section.alt .feature { background: var(--bg); }
.feature .ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 18px;
  background: var(--accent-soft); color: var(--accent);
}
.feature .ico svg { width: 22px; height: 22px; }
.feature h3 { font-size: 19px; margin: 0 0 8px; letter-spacing: -0.02em; }
.feature p { font-size: 15px; color: var(--text-2); margin: 0; line-height: 1.5; }
.feature code { font-family: var(--mono); font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { text-align: center; padding: 8px 18px; }
.step .num {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center;
  font-size: 21px; font-weight: 600; background: var(--text); color: var(--bg);
}
.step h3 { font-size: 21px; margin: 0 0 8px; letter-spacing: -0.02em; }
.step p { color: var(--text-2); margin: 0; font-size: 16px; }

.privacy-band { text-align: center; }
.privacy-band .shield {
  width: 72px; height: 72px; margin: 0 auto 22px; border-radius: 20px; display: grid; place-items: center;
  background: linear-gradient(135deg, #34c759, #0a9d4a); color: #fff;
}
.privacy-band .shield svg { width: 36px; height: 36px; }

/* FAQ */
.faq { max-width: 800px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--border-strong); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative;
  font-size: 19px; font-weight: 600; letter-spacing: -0.02em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px;
  border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3);
  transform: translateY(-70%) rotate(45deg); transition: transform 0.25s;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { margin: 0 0 22px; color: var(--text-2); font-size: 17px; }

/* Disclaimer */
.fineprint { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 56px; max-width: 920px; margin: 0 auto; }
.fineprint h3 { font-size: 17px; letter-spacing: -0.01em; margin: 0 0 6px; }
.fineprint p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-2); }
@media (max-width: 700px) { .fineprint { grid-template-columns: 1fr; gap: 28px; } }

/* Footer */
.footer { padding: 36px 0 48px; font-size: 13px; color: var(--text-3); border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: center; align-items: center; text-align: center; }
.footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer a { color: var(--text-2); }

/* Theme curtain (View Transitions) */
:root { --curtain-dur: 0.9s; --curtain-ease: cubic-bezier(0.76, 0, 0.24, 1); }
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
:root[data-curtain="down"]::view-transition-old(root) { z-index: 1; }
:root[data-curtain="down"]::view-transition-new(root) { z-index: 2; animation: curtain-down var(--curtain-dur) var(--curtain-ease) both; }
:root[data-curtain="up"]::view-transition-new(root) { z-index: 1; }
:root[data-curtain="up"]::view-transition-old(root) { z-index: 2; animation: curtain-up var(--curtain-dur) var(--curtain-ease) both; }
@keyframes curtain-down { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes curtain-up { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 100% 0); } }

/* The hem: a soft shadow that rides the curtain's bottom edge. */
.curtain-hem {
  display: none; position: fixed; left: 0; right: 0; height: 36px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.12) 35%, rgba(0, 0, 0, 0));
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  view-transition-name: curtain-hem;
}
.curtain-hem.at-top { display: block; top: -36px; }
.curtain-hem.at-bottom { display: block; top: 100vh; top: 100dvh; }
::view-transition-group(curtain-hem) { animation-duration: var(--curtain-dur); animation-timing-function: var(--curtain-ease); }
::view-transition-old(curtain-hem) { display: none; }
::view-transition-new(curtain-hem) { animation: none; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 500; pointer-events: none; z-index: 100;
  transition: opacity 0.25s, transform 0.25s; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Legal pages */
.legal { max-width: 760px; margin: 0 auto; padding: 64px 22px 88px; }
.legal h1 { font-size: clamp(36px, 6vw, 52px); letter-spacing: -0.03em; line-height: 1.08; margin: 0 0 8px; }
.legal .updated { color: var(--text-3); margin: 0 0 40px; font-size: 15px; }
.legal h2 { font-size: 23px; letter-spacing: -0.02em; margin: 40px 0 10px; }
.legal p, .legal li { color: var(--text-2); }
.legal li { margin-bottom: 6px; }
.legal strong { color: var(--text); }

/* ---------- Responsive ---------- */

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

@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
  .editor { height: 300px; }
  .features, .steps { grid-template-columns: 1fr; }
  .steps { gap: 36px; }
  .nav-links a.hide-sm { display: none; }
}

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .hero { padding: 48px 0 28px; }
  .options-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .panel-head { padding: 12px 12px 12px 16px; }
  .editor { padding: 16px; font-size: 16px; }
  .panel-foot { padding: 12px 16px; }
  .opt { padding: 14px 16px; }
  .options-head, .chips, .review p { padding-left: 16px; padding-right: 16px; }
  .btn .lbl-sm-hide { display: none; }
  .nav-links { gap: 14px; }
  .faq summary { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
