/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --bg:           #181818;
  --bg-2:         #252525;
  --bg-3:         #2e2e2e;
  --bg-4:         #383838;
  --border-dark:  #2e2e2e;
  --border-dark2: #3a3a3a;

  --editor-bg:    #fff;
  --code-bg:      #f6f6f6;
  --border-light: #e0e0e0;
  --border-light2:#c8c8c8;

  --txt-1:  #fff;
  --txt-2:  #b0b0b0;
  --txt-3:  #666;
  --txt-4:  #333;
  --txt-5:  #111;

  --accent:       #3ecfff;
  --accent-hover: #1abfef;
  --accent-dim:   rgba(62,207,255,.12);
  --accent-muted: rgba(62,207,255,.25);

  --success: #3ecf8e;
  --danger:  #ff4d4f;
  --info:    #3ecfff;

  --radius-s: 3px;
  --radius-m: 7px;
  --radius-l: 18px;
  --radius-pill: 999px;

  --t: 0.15s ease;

  --section-gap: 16px;

  --header-h:   52px;
  --toolbar1-h: 72px;
  --toolbar2-h: 40px;
  --cleaner-h:  102px;

  --max-w: 1200px;
  --side-pad: 24px;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--txt-1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  -webkit-font-smoothing: antialiased;
}

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

/* ============================================================
   SECTION — base standalone block
   ============================================================ */
.section {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
}

.section--header {
  padding: 8px var(--side-pad);
  position: sticky;
  top: 0;
  z-index: 200;
  background: #1a1a1a00;
  transition: transform 0.3s ease;
}

.section--header--hidden {
  transform: translateY(-110%);
}

.section--header .site-header {
  background: var(--bg-2);
  border-radius: var(--radius-l);
  overflow: hidden;
  height: auto;
}

.section--header .site-header__inner {
  height: var(--header-h);
  padding: 0 24px;
}

.section--editor {
  padding: 0 var(--side-pad);
  background: transparent;
}

.section--editor .app-shell {
  background: var(--bg-2);
  border-radius: var(--radius-l);
  overflow: hidden;
}

.section--card {
  padding: 0 var(--side-pad);
}

.section--footer {
  padding: 0 var(--side-pad);
  background: transparent;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  height: var(--header-h);
  flex-shrink: 0;
}

.site-header__inner {
  height: 100%;
  padding: 0 var(--side-pad);
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: var(--max-w);
  margin: 0 auto;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo__mark {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: var(--radius-s);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: #000;
  letter-spacing: -1px;
  line-height: 1;
}

.logo__name {
  font-size: 17px;
  font-weight: 700;
  color: var(--txt-1);
  letter-spacing: -0.4px;
}

.logo__tld { color: var(--accent); }

.logo img { height: 24px; width: auto; display: block; }
.logo:hover .logo__name { color: var(--accent); }
.logo:hover { text-decoration: none; }

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.site-nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--txt-2);
  padding: 5px 10px;
  border-radius: var(--radius-s);
  transition: background var(--t), color var(--t);
}

.site-nav a:hover { background: transparent; color: var(--txt-1); text-decoration: none; }

/* Social */
.social-links { margin-left: auto; display: flex; gap: 2px; }

.social-btn {
  color: var(--txt-3);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-s);
  transition: background var(--t), color var(--t);
}

.social-btn:hover { background: var(--bg-3); color: var(--txt-1); text-decoration: none; }

/* Mobile burger */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
  background: none;
  border: none;
}

.burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--txt-2);
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t);
}

/* Mobile nav overlay */
.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--bg-2);
  border-top: 1px solid var(--border-dark);
  z-index: 199;
  flex-direction: column;
  padding: 16px;
  gap: 4px;
}

.mobile-nav.is-open { display: flex; }

.mobile-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--txt-2);
  padding: 12px 16px;
  border-radius: var(--radius-m);
  transition: background var(--t), color var(--t);
}

.mobile-nav a:hover { background: var(--bg-3); color: var(--txt-1); text-decoration: none; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
}

/* ============================================================
   TOOLBARS
   ============================================================ */
.toolbar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 14px;
  user-select: none;
  flex-shrink: 0;
}

.toolbar--top    { min-height: var(--toolbar1-h); }
.toolbar--format {
  height: var(--cleaner-h);
  background: var(--bg-3);
  border-bottom: 1px solid var(--border-dark);
}

.toolbar__group { display: flex; align-items: center; gap: 4px; }
.drop-zone { margin-right: 8px; }
.btn--open-mobile { display: none !important; }
.toolbar__group--right { margin-left: auto; }

.toolbar__separator {
  width: 1px;
  height: 20px;
  background: var(--border-dark2);
  margin: 0 2px;
  flex-shrink: 0;
  display: inline-block;
}

/* Drop zone */
.drop-zone {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 52px;
  min-width: 280px;
  border: 1.5px dashed var(--border-dark2);
  border-radius: var(--radius-l);
  cursor: pointer;
  transition: border-color var(--t), background var(--t), color var(--t);
  color: var(--txt-3);
  outline: none;
  user-select: none;
}

.drop-zone:hover,
.drop-zone:focus-visible {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--txt-2);
}

.drop-zone--active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--txt-1);
}

.drop-zone__icon {
  flex-shrink: 0;
  opacity: .6;
  transition: opacity var(--t);
}

.drop-zone:hover .drop-zone__icon,
.drop-zone--active .drop-zone__icon { opacity: 1; }

.drop-zone__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

.drop-zone__primary {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--txt-2);
}

.drop-zone__primary b {
  color: var(--txt-1);
  font-weight: 600;
}

.drop-zone__secondary {
  font-size: 11px;
  color: var(--txt-3);
}

.drop-zone__link {
  color: var(--accent);
}

/* File operation buttons */
.btn--toolbar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  background: var(--bg-3);
  border: 1px solid var(--border-dark2);
  border-radius: var(--radius-s);
  color: var(--txt-2);
  font-weight: 500;
  font-size: 12.5px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
  white-space: nowrap;
}

.btn--toolbar:hover { background: var(--bg-4); color: var(--txt-1); border-color: #555; }
.btn--toolbar svg { flex-shrink: 0; opacity: .7; }
.btn--toolbar:hover svg { opacity: 1; }

/* Format buttons */
.fmt-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  color: var(--txt-2);
  font-size: 16px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: background var(--t), color var(--t), border-color var(--t);
  flex-shrink: 0;
}

.fmt-btn--text { font-weight: 700; font-size: 14px; min-width: 22px; }

.fmt-btn:hover { background: var(--bg-4); color: var(--txt-1); }

.fmt-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.fmt-btn:disabled { opacity: .3; cursor: default; }

/* Tab switcher */
.tab-switcher {
  display: none;
  background: var(--bg-3);
  border: 1px solid var(--border-dark2);
  border-radius: var(--radius-s);
  overflow: hidden;
  flex-shrink: 0;
}

.tab-btn {
  height: 26px;
  padding: 0 14px;
  background: transparent;
  border: none;
  color: var(--txt-3);
  font-weight: 500;
  font-size: 12px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}

.tab-btn--active { background: var(--accent); color: #000; }
.tab-btn:not(.tab-btn--active):hover { background: var(--bg-4); color: var(--txt-1); }

/* Stats */
.stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--txt-3);
  white-space: nowrap;
}

.stats strong { color: var(--txt-2); font-weight: 600; }
.stats__sep   { color: var(--border-dark2); }

/* ============================================================
   EDITOR SPLIT PANE
   ============================================================ */
.editor-container {
  display: flex;
  height: 650px;
  overflow: hidden;
}

.editor-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 140px;
  position: relative;
}

.editor-pane--wysiwyg {
  width: 50%;
  background: var(--bg-3);
}

.editor-pane--html {
  flex: 1;
  background: var(--code-bg);
  border-left: 1px solid var(--border-light);
}

.editor-pane--html {
  flex: 1;
  background: var(--bg-3);
  border-left: 1px solid var(--border-light);
}

/* Pane header */
.pane-header {
  height: 38px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #666;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.pane-header__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  font-family: inherit;
  color: #3ecfff;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.pane-actions { display: flex; gap: 4px; }

.pane-action {
  height: 26px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid #818181;
  border-radius: 10px;
  color: #ffffff;
  font-weight: 400;
  font-size: 14px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
  white-space: nowrap;
}

.pane-action:hover { background: #e4e4e4; color: #333; border-color: #aaa; }

/* Editor content */
.editor-content {
  flex: 1;
  padding: 20px 20px;
  overflow-y: auto;
  outline: none;
  font-size: 15px;
  line-height: 1.8;
  font-family: inherit;
  color: var(--txt-5);
  caret-color: #000;
  background: var(--editor-bg);
}

.editor-content:empty::before {
  content: attr(data-placeholder);
  color: #bbb;
  pointer-events: none;
  display: block;
}

.editor-content p { margin-bottom: .85em; min-height: 1.2em; }
.editor-content p:last-child { margin-bottom: 0; }
.editor-content h1 { font-size: 2em; font-weight: 700; margin: .75em 0 .4em; line-height: 1.2; }
.editor-content h2 { font-size: 1.5em; font-weight: 600; margin: .75em 0 .4em; line-height: 1.3; }
.editor-content h3 { font-size: 1.2em; font-weight: 600; margin: .6em 0 .35em; }
.editor-content ul, .editor-content ol { padding-left: 2em; margin-bottom: .85em; }
.editor-content li { margin-bottom: .25em; }
.editor-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 16px;
  margin: .75em 0;
  color: #666;
  font-style: italic;
}
.editor-content a { color: var(--accent); text-decoration: underline; }
.editor-content img { max-width: 100%; height: auto; }
.editor-content table { border-collapse: collapse; width: 100%; margin-bottom: 1em; }
.editor-content th, .editor-content td { border: 1px solid #e0e0e0; padding: 7px 12px; }
.editor-content th { background: #f8f8f8; font-weight: 600; }
.editor-content code { background: #f0f0f0; padding: 1px 5px; border-radius: 3px; font-size: .88em; font-family: Consolas, monospace; }
.editor-content ::selection { background: rgba(62,207,255,.18); }

/* HTML textarea */
.html-source {
  flex: 1;
  width: 100%;
  padding: 20px;
  background: var(--code-bg);
  border: none;
  resize: none;
  outline: none;
  font: 15px/1.65 'Cascadia Code', 'Fira Code', Consolas, 'Courier New', monospace;
  color: #2a2a2a;
  tab-size: 2;
}

.html-source::placeholder { color: #bbb; }

/* Resize handle */
.resizer {
  width: 4px;
  background: var(--border-light);
  cursor: ew-resize;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t);
  position: relative;
  z-index: 10;
}

.resizer:hover, .resizer.is-dragging { background: var(--accent); }

.resizer__grip {
  width: 2px;
  height: 24px;
  border-radius: 2px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,.2) 0px, rgba(0,0,0,.2) 2px,
    transparent 2px, transparent 5px
  );
}

/* Drop overlay */
.drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(62,207,255,.07);
  border: 2px dashed var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: none;
}

.drop-overlay[hidden] { display: none; }

.drop-overlay__message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: #000;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 28px 48px;
  border-radius: var(--radius-m);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  font-family: inherit;
  letter-spacing: -.2px;
}

/* ============================================================
   CLEANER PANEL — inside right pane, 70/30 layout
   ============================================================ */
.cleaner-panel {
  background: var(--bg-3);
  border-bottom: 1px solid var(--border-dark);
  height: var(--cleaner-h);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.cleaner-panel__options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 0 10px;
}

.clean-opt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  font-family: inherit;
  color: var(--txt-2);
  cursor: pointer;
  padding: 4px 7px;
  border-radius: var(--radius-s);
  transition: background var(--t), color var(--t);
  white-space: nowrap;
}

.clean-opt:hover { background: var(--bg-4); color: var(--txt-1); }

.clean-opt input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  cursor: pointer;
}

.btn--clean {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  padding: 0 24px;
  background: var(--accent);
  border: none;
  border-radius: 0;
  color: #000;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--t), box-shadow var(--t);
  letter-spacing: .02em;
  position: relative;
  overflow: hidden;
}

.btn--clean::before {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 55%;
  height: 100%;
  background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,.45) 50%, transparent 100%);
  transition: left .5s ease;
  pointer-events: none;
}

.btn--clean:hover { background: var(--accent-hover); box-shadow: 0 0 18px rgba(62,207,255,.45); }
.btn--clean:hover::before { left: 130%; }
.btn--clean:active { background: #15a8d4; }


/* ============================================================
   SECTION CARD — rounded standalone block
   ============================================================ */
.section-card {
  background: var(--bg-2);
  border-radius: var(--radius-l);
  overflow: hidden;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px;
}

.section-card__header {
  margin-bottom: 48px;
}

/* ============================================================
   SECTION TYPOGRAPHY
   ============================================================ */
.section-eyebrow {
  font-weight: 600;
  font-size: 11px;
  line-height: 1;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 700;
  color: var(--txt-1);
  letter-spacing: -.6px;
  line-height: 1.15;
}

/* ============================================================
   FEATURES
   ============================================================ */
.features-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.feature-item {
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0 18px;
  align-items: start;
}

.feature-item__icon {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.feature-item__icon img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.feature-item__body h3 {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
  font-family: inherit;
  color: var(--txt-1);
  margin-bottom: 8px;
}

.feature-item__body p {
  font-size: 14px;
  line-height: 1.65;
  font-family: inherit;
  color: var(--txt-2);
}

/* ============================================================
   FAQ
   ============================================================ */
.faq-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 64px;
  align-items: start;
}

.faq-layout__sidebar {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.faq-layout__sidebar .section-eyebrow { color: var(--txt-3); }

.faq-layout__hint {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--txt-3);
}

.faq-list {
  display: flex;
  flex-direction: column;
}

.faq-item {
  border-bottom: 1px solid var(--border-dark);
}

.faq-item:last-child { border-bottom: none; }

.faq-item__question {
  width: 100%;
  padding: 22px 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--txt-1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  user-select: none;
  background: none;
  border: none;
  text-align: left;
}

.faq-item__question::after {
  content: '+';
  font-size: 30px;
  font-weight: 200;
  color: var(--txt-3);
  flex-shrink: 0;
  transition: transform 0.35s ease, color var(--t);
  line-height: 1;
}

.faq-item.is-open .faq-item__question { color: var(--txt-1); }
.faq-item.is-open .faq-item__question::after { transform: rotate(45deg); color: var(--txt-1); }

.faq-item__answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.is-open > .faq-item__answer {
  grid-template-rows: 1fr;
}

.faq-item__answer__inner {
  overflow: hidden;
  min-height: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--txt-2);
  padding-bottom: 0;
  transition: padding-bottom 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.is-open .faq-item__answer__inner {
  padding-bottom: 22px;
}

.faq-item__answer p + p { margin-top: 10px; }

.faq-item__answer code {
  background: var(--bg-3);
  color: var(--txt-1);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12.5px;
  font-family: Consolas, monospace;
}

/* ============================================================
   FOOTER
   ============================================================ */
.section--footer .site-footer {
  background: var(--bg-2);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  overflow: hidden;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer__copy { font-size: 13px; color: var(--txt-2); }
.site-footer__note { font-size: 12px; color: var(--txt-3); }
.site-footer__nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.site-footer__dev { font-size: 12px; color: var(--txt-3); }
.site-footer__link { font-size: 12px; color: var(--txt-3); text-decoration: none; transition: color var(--t); }
.site-footer__link:hover { color: var(--txt-1); }

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: var(--radius-m);
  font-weight: 500;
  font-size: 13px;
  line-height: 1;
  font-family: inherit;
  color: #000;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  opacity: 0;
  transform: translateY(6px);
  animation: toast-in .2s ease forwards;
  pointer-events: auto;
}

.toast--success { background: var(--success); }
.toast--error   { background: var(--danger); color: #fff; }
.toast--info    { background: var(--info); }
.toast.is-leaving { animation: toast-out .2s ease forwards; }

@keyframes toast-in  { to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ============================================================
   LOADING
   ============================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  backdrop-filter: blur(3px);
}

.loading-overlay[hidden] { display: none; }

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--txt-1);
  font-weight: 500;
  font-size: 13px;
  line-height: 1;
  font-family: inherit;
}

.loading-spinner__ring {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255,255,255,.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

/* ============================================================
   SCROLLBARS
   ============================================================ */
.editor-content::-webkit-scrollbar,
.html-source::-webkit-scrollbar { width: 5px; }

.editor-content::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 3px; }
.html-source::-webkit-scrollbar-thumb    { background: #ccc; border-radius: 3px; }

/* ============================================================
   RESPONSIVE ≤ 1024px
   ============================================================ */
@media (max-width: 1024px) {
  .faq-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .faq-layout__sidebar { position: static; }
}

/* ============================================================
   RESPONSIVE ≤ 860px
   ============================================================ */
@media (max-width: 860px) {
  :root {
    --side-pad: 16px;
  }

  .features-list {
    grid-template-columns: 1fr;
  }

  .section-card {
    padding: 40px 28px;
  }
}

/* ============================================================
   RESPONSIVE ≤ 768px  (MOBILE)
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --header-h:   48px;
    --toolbar1-h: 44px;
  }

  body { background: var(--bg); }

  /* Hide desktop nav, show burger */
  .site-nav { display: none !important; }
  .social-links { display: none !important; }
  .burger { display: flex !important; }

  /* Remove all borders on mobile */
  .toolbar,
  .toolbar--format,
  .toolbar--top,
  .cleaner-panel,
  .pane-header,
  .section--header,
  .editor-pane--html,
  .mobile-nav,
  .btn--toolbar,
  .clean-opt,
  .fmt-btn {
    border: none !important;
    border-bottom: none !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
  }

  /* Section backgrounds match body */
  .section--header { padding: 6px 10px; }
  .section--header .site-header { background: var(--bg-2); border-radius: var(--radius-l); }
  .section--editor .app-shell { background: var(--bg-2); border-radius: var(--radius-l); }

  /* Format toolbar — wraps naturally, fully visible */
  .toolbar--format {
    height: auto;
    flex-wrap: wrap;
    padding: 6px 8px;
  }

  .toolbar__separator { display: none; }

  /* Hide tab switcher — both panes visible */
  .tab-switcher { display: none; }

  /* Stacked panels — equal height via grid */
  .editor-container {
    height: 800px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }

  .editor-pane {
    width: 100% !important;
    overflow: hidden;
    border: none !important;
  }

  .editor-pane--html,
  .editor-pane--wysiwyg {
    border: none !important;
    border-left: none !important;
  }

  .editor-pane[aria-hidden="true"] { display: flex; }

  .editor-content { padding: 18px 16px; font-size: 14px; }

  /* Cleaner panel — wraps naturally like format toolbar */
  .cleaner-panel {
    height: auto;
    display: flex;
    flex-wrap: wrap;
    padding: 6px 8px;
  }

  .cleaner-panel__options {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0;
    width: 100%;
  }

  .btn--clean {
    width: 100%;
    height: 34px;
    padding: 0 16px;
    margin: 8px 0;
  }

  /* Stats: show only chars */
  .stats__sep,
  .stats .stats__item:last-child { display: none; }

  /* Top toolbar adjustments */
  .toolbar--top { min-height: var(--toolbar1-h); gap: 6px; padding: 14px 10px; }
  .drop-zone { display: none; }
  .btn--open-mobile { display: inline-flex !important; }

  /* Sections */
  .section--header { padding: 6px 10px; }
  .section--editor { padding: 0 10px; }
  .section--card { padding: 0 10px; }
  .section--footer { padding: 12px 10px; }
  .section-card { padding: 28px 20px; }
  .section-card__header { margin-bottom: 24px; }
  .feature-item { grid-template-columns: 56px 1fr; padding: 20px 0; gap: 0 14px; }
  .feature-item__icon { width: 56px; height: 56px; }
  .feature-item__icon img { width: 48px; height: 48px; }
  .faq-item__question { font-size: 16px; padding: 18px 0; }
  .section--footer .site-footer { flex-direction: column; align-items: center; text-align: center; border-radius: var(--radius-l) var(--radius-l) 0 0; }
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: modalFadeIn .2s ease;
}
.modal-overlay[hidden] { display: none; }

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg-3);
  border-radius: 16px;
  padding: 28px 32px;
  min-width: 340px;
  max-width: 440px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  animation: modalSlideIn .2s ease;
}
@keyframes modalSlideIn {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal__text {
  font-size: .95rem;
  color: var(--txt-1);
  margin-bottom: 20px;
  line-height: 1.5;
}

.modal__input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-4);
  border: none;
  border-radius: 10px;
  color: var(--txt-1);
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  margin-bottom: 20px;
}
.modal__input:focus {
  box-shadow: 0 0 0 2px var(--accent);
}

.modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn--modal-cancel {
  padding: 8px 20px;
  background: var(--bg-4);
  border: none;
  border-radius: 10px;
  color: var(--txt-2);
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s;
}
.btn--modal-cancel:hover { background: var(--bg-4); color: var(--txt-1); }

.btn--modal-ok {
  padding: 8px 20px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #000;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.btn--modal-ok:hover { opacity: .85; }

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .section--header, .toolbar, .cleaner-panel,
  .pane-header, .section--card, .section--footer,
  .editor-pane--html { display: none; }
  .editor-container { height: auto; }
  .editor-content { padding: 0; overflow: visible; }
}
