/* Data Cleaner — Design System */

:root {
  --primary: #1f5a3f;
  --primary-dark: #163f2c;
  --primary-light: #2d7a56;
  --secondary: #dae8e0;
  --accent: #22c55e;
  --accent-hover: #16a34a;
  --bg: #f5faf7;
  --bg-alt: #fafffc;
  --surface: #ffffff;
  --text: #1a2e24;
  --text-muted: #5a7266;
  --border: #c8ddd2;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #0284c7;
  --shadow: 0 4px 20px rgba(31, 90, 63, 0.08);
  --shadow-lg: 0 12px 40px rgba(31, 90, 63, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --header-h: 64px;
  --transition: 0.25s ease;
}

[data-theme="dark"] {
  --primary: #3d9b6c;
  --primary-dark: #2d7a56;
  --primary-light: #4db87f;
  --secondary: #1e3329;
  --accent: #22c55e;
  --bg: #0f1a14;
  --bg-alt: #142019;
  --surface: #1a2a21;
  --text: #e8f5ee;
  --text-muted: #9bb5a6;
  --border: #2d4538;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(34, 197, 94, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(31, 90, 63, 0.1), transparent),
    var(--bg);
  min-height: 100vh;
  overflow-x: clip;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img { max-width: 100%; height: auto; }

.container {
  width: min(1200px, 100% - 2rem);
  margin-inline: auto;
}
.container-wide {
  width: min(1480px, 100% - 2rem);
  margin-inline: auto;
}

/* Stable 3-column shell — side slots keep width even when empty */
.layout-with-ads {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 160px;
  gap: 1.25rem;
  align-items: start;
}
.side-slot {
  min-width: 0;
  width: 100%;
}
.side-slot.is-empty {
  visibility: hidden;
  pointer-events: none;
}
@media (max-width: 1100px) {
  .layout-with-ads {
    grid-template-columns: 1fr;
  }
  .side-slot {
    display: none;
  }
}

.tool-grid-roomy {
  gap: 1.75rem;
}
.tool-grid-roomy .tool-panel {
  padding: 1.75rem;
}
.tool-grid-roomy #inputData {
  min-height: 320px;
}
.options-grid-3 {
  grid-template-columns: 1fr 1fr;
}
@media (min-width: 1100px) {
  .options-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.file-upload-btn {
  cursor: pointer;
  margin: 0;
}
.upload-hint {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-grid.footer-grid-4 {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 2rem 2.25rem;
  align-items: start;
}
.footer-col {
  min-width: 0;
}
.footer-col-title {
  color: #fff;
  display: block;
  margin: 0 0 1rem;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  line-height: 1.3;
  min-height: 1.3em;
}
.footer-about-text {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #c8e6d5;
  max-width: 28ch;
}
.footer-about-social {
  margin-top: 0.25rem;
}
.footer-follow-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  margin-bottom: 0.55rem;
}
.footer-about .social-links {
  margin-top: 0;
}
.site-logo-img {
  height: 36px;
  width: auto;
  display: block;
  border-radius: 8px;
}
.admin-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.footer-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.footer-nav li {
  margin: 0;
  line-height: 1.4;
}
.footer-nav a {
  font-size: 0.9rem;
  display: inline-block;
}
.footer-social {
  margin: 2rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.social-icon-link {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #a7f3d0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.social-icon-link svg {
  width: 18px;
  height: 18px;
  display: block;
}
.social-icon-link:hover {
  background: rgba(255,255,255,0.22);
  color: #fff !important;
  transform: translateY(-2px);
}
.footer-tag {
  opacity: 0.85;
  max-width: 50%;
  text-align: right;
}
@media (max-width: 900px) {
  .footer-grid.footer-grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 700px) {
  .footer-grid.footer-grid-4 {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .footer-about-text { max-width: none; }
  .footer-tag { max-width: 100%; text-align: left; }
}

/* Ads — size follows content; header/footer centered */
.ad-banner-wrap {
  margin: 0.75rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.ad-banner-wrap:empty {
  display: none;
  margin: 0;
}
.ad-slot {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  min-height: 0;
  min-width: 0;
  position: static;
}
.ad-slot.ad-slot--filled {
  background: var(--secondary);
  border: 1px dashed var(--border);
  padding: 0.5rem;
  width: fit-content;
  height: fit-content;
}
.ad-slot.ad-header,
.ad-slot.ad-footer,
.ad-slot.ad-inline {
  margin-inline: auto;
}
.ad-item {
  display: block;
  line-height: 0;
  width: fit-content;
  max-width: 100%;
}
.ad-item img,
.ad-item iframe,
.ad-item > * {
  max-width: 100%;
  height: auto;
  display: block;
}
.ad-dummy {
  display: inline-block;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--primary);
  background: color-mix(in srgb, var(--secondary) 80%, white);
  border-radius: 6px;
  white-space: normal;
}
.ad-inline {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.25rem auto;
  width: 100%;
}
.ad-inline.ad-slot,
.ad-inline .ad-slot {
  width: fit-content;
  height: fit-content;
}
/* Side ads scroll with page — never sticky/fixed */
.side-slot,
.ad-left-sidebar,
.ad-right-sidebar {
  position: static !important;
}
.ad-left-sidebar .ad-slot,
.ad-right-sidebar .ad-slot {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}
.ad-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 26, 20, 0.55);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.ad-popup-overlay[hidden] {
  display: none !important;
}
.ad-popup-dialog {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: min(520px, 100%);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.ad-popup-close {
  position: absolute;
  top: 0.4rem;
  right: 0.55rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
}
.ad-popup-close:hover { color: var(--text); }
.ad-popup-body .ad-slot {
  background: transparent;
  border: none;
  padding: 0;
}

/* Floating ad — fixed corner, dismissible */
.ad-floating-wrap {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9500;
  max-width: min(320px, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.75rem;
  padding-top: 1.75rem;
}
.ad-floating-wrap[hidden] { display: none !important; }
.ad-floating-wrap .ad-slot {
  background: transparent;
  border: none;
  padding: 0;
  width: fit-content;
  max-width: 100%;
}
.ad-float-close {
  position: absolute;
  top: 0.2rem;
  right: 0.35rem;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
}
.ad-float-close:hover { color: var(--text); }

/* Sticky ad — fixed to bottom of viewport while scrolling */
.ad-sticky-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(31, 90, 63, 0.08);
}
.ad-sticky-wrap[hidden] { display: none !important; }
.ad-sticky-wrap .ad-slot {
  background: transparent;
  border: none;
  padding: 0;
  width: fit-content;
  margin: 0 auto;
}
.ad-sticky-close {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: var(--secondary);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}
.ad-sticky-close:hover { color: var(--text); }
body.has-sticky-ad {
  padding-bottom: 4.5rem;
}
body.has-sticky-ad .ad-floating-wrap {
  bottom: 5.25rem;
}

.btn-main-home {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}
.btn-main-home:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
@media (max-width: 700px) {
  .btn-main-home { padding: 0.35rem 0.65rem; font-size: 0.72rem; }
  .ad-floating-wrap { display: none !important; }
  .ad-sticky-wrap { padding: 0.4rem 2.25rem 0.4rem 0.5rem; }
  .ad-sticky-wrap .ad-dummy { font-size: 0.75rem; padding: 0.35rem 0.75rem; }
  .admin-menu-label { display: none; }
}

.admin-menu {
  position: relative;
}
.admin-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem 0.3rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.admin-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.admin-caret { font-size: 0.7rem; opacity: 0.7; }
.admin-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.35rem;
  z-index: 200;
}
.admin-dropdown a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
}
.admin-dropdown a:hover {
  background: var(--secondary);
  color: var(--primary);
}
@media (max-width: 700px) {
  .admin-menu-label { display: none; }
}

.blog-article .content-body {
  font-size: 1.05rem;
  line-height: 1.75;
}
.blog-article .content-body h2 {
  margin-top: 1.5rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.logo:hover { color: var(--primary-light); }
.logo-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center;
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-main a {
  display: block;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-main a:hover, .nav-main a.active {
  background: var(--secondary);
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-switcher select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 2rem 0.4rem 0.85rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a7266' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
}

.theme-toggle {
  width: 42px; height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  display: grid; place-items: center;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.theme-toggle:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.theme-toggle svg {
  width: 20px; height: 20px;
  position: absolute;
  transition: opacity 0.3s, transform 0.3s;
}
.theme-toggle .icon-sun { opacity: 0; transform: rotate(-90deg) scale(0.5); color: #f59e0b; }
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); color: var(--primary); }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.5); }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--text); border-radius: 2px;
}

.site-main { padding: 2rem 0 3rem; min-height: calc(100vh - var(--header-h) - 200px); }

.hero-tool {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeUp 0.5s ease both;
}
.hero-tool h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-tool p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 auto;
  max-width: 560px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 900px) {
  .tool-grid { grid-template-columns: 1fr; }
}

.tool-panel h2, .tool-panel h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 14px rgba(31, 90, 63, 0.3);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--secondary);
  color: var(--primary);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--border);
  color: var(--primary-dark);
}
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover:not(:disabled) { background: var(--accent-hover); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--secondary); color: var(--text); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

textarea, input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-alt);
  transition: border-color var(--transition), box-shadow var(--transition);
}
textarea:focus, input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
  outline: none;
}
textarea.mono, .mono {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.5;
}
#inputData {
  min-height: 280px;
  resize: vertical;
}

.live-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.live-stats strong { color: var(--primary); font-weight: 700; }

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
@media (max-width: 600px) {
  .options-grid { grid-template-columns: 1fr; }
}

.check-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: var(--bg-alt);
}
.check-option:hover { border-color: var(--accent); background: var(--secondary); }
.check-option input {
  width: 18px; height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.check-option .opt-label { font-weight: 600; font-size: 0.88rem; display: block; }
.check-option .opt-desc { font-size: 0.75rem; color: var(--text-muted); }

.sample-menu {
  position: relative;
  display: inline-block;
}
.sample-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.35rem;
}
.sample-menu.open .sample-dropdown { display: block; animation: fadeUp 0.2s ease; }
.sample-dropdown button {
  display: block; width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border: none; background: none;
  font-family: inherit; font-size: 0.88rem;
  color: var(--text); cursor: pointer;
  border-radius: 6px;
}
.sample-dropdown button:hover { background: var(--secondary); }

.stats-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (max-width: 700px) {
  .stats-dashboard { grid-template-columns: 1fr 1fr; }
}
.stat-card {
  background: linear-gradient(145deg, var(--secondary), var(--bg-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  animation: fadeUp 0.4s ease both;
}
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }
.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.view-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.view-tabs .btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.results-area {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  max-height: 360px;
  overflow-y: auto;
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.results-table thead th {
  position: sticky;
  top: 0;
  background: var(--primary);
  color: #fff;
  text-align: left;
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  font-size: 0.8rem;
  z-index: 1;
}
.results-table td {
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid var(--border);
  word-break: break-all;
}
.results-table tr:hover td { background: var(--secondary); }
.results-table .idx {
  width: 48px;
  color: var(--text-muted);
  font-weight: 600;
}

.results-list {
  list-style: none;
  margin: 0; padding: 0.5rem 0;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.results-list li {
  padding: 0.4rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 0.75rem;
}
.results-list .num {
  color: var(--text-muted);
  min-width: 2rem;
  font-weight: 600;
}

.comparison-view {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.comparison-view.visible { display: grid; }
@media (max-width: 700px) {
  .comparison-view.visible { grid-template-columns: 1fr; }
}
.comparison-pane {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.comparison-pane h4 {
  margin: 0;
  padding: 0.6rem 0.85rem;
  background: var(--secondary);
  font-size: 0.85rem;
}
.comparison-pane pre {
  margin: 0;
  padding: 0.85rem;
  max-height: 240px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}
.empty-state svg { opacity: 0.4; margin-bottom: 0.75rem; }

.progress-bar {
  height: 3px;
  background: var(--secondary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
  display: none;
}
.progress-bar.active { display: block; }
.progress-bar .bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  animation: progress 1.2s ease infinite;
}
@keyframes progress {
  0% { width: 0%; margin-left: 0; }
  50% { width: 60%; margin-left: 20%; }
  100% { width: 0%; margin-left: 100%; }
}

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 360px;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
}
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.success { border-left-color: var(--accent); }

.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
[data-theme="dark"] .alert-success { background: #14532d; color: #bbf7d0; border-color: #166534; }
[data-theme="dark"] .alert-error { background: #7f1d1d; color: #fecaca; border-color: #991b1b; }
[data-theme="dark"] .alert-warning { background: #78350f; color: #fde68a; border-color: #92400e; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--secondary);
  color: var(--primary);
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }

.page-content { max-width: 800px; margin: 0 auto; }
.page-content h1 { font-size: 2rem; font-weight: 800; margin-bottom: 1rem; }
.page-content h2 { font-size: 1.35rem; margin-top: 1.5rem; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.blog-card h3 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.blog-card h3 a { color: var(--text); }
.blog-card h3 a:hover { color: var(--primary); }
.blog-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.contact-form label { display: block; margin: 0.75rem 0 0.35rem; font-weight: 600; font-size: 0.9rem; }
.contact-form textarea { min-height: 140px; }

.site-footer {
  background: var(--primary-dark);
  color: #c8e6d5;
  padding: 2.5rem 0 1.5rem;
  margin-top: auto;
}
.site-footer a { color: #a7f3d0; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  margin-bottom: 2rem;
}
.footer-brand { font-weight: 800; font-size: 1.2rem; color: #fff; margin-bottom: 0.5rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1rem;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-main {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem;
    box-shadow: var(--shadow);
    z-index: 100;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .nav-main.open { display: flex; }
  .nav-main a { padding: 0.75rem 1rem; }
  .header-inner { position: relative; }
  .lang-switcher select { max-width: 7.5rem; font-size: 0.8rem; }
}

.card-heading {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  line-height: 1.35;
}
.card-heading a { color: inherit; }
.card-heading a:hover { color: var(--primary); }

.content-body img {
  height: auto;
  border-radius: var(--radius-sm);
}

.text-muted { color: var(--text-muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

.kbd {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.75rem;
  background: var(--secondary);
}
