:root {
  --bg-main: #0b0f14;
  --bg-elevated: #131a22;
  --bg-card: #1a2430;
  --panel-border: #2b3b4f;
  --text-primary: #e2e8f2;
  --text-muted: #9fb0c6;
  --accent: #00d2ff;
  --accent-soft: rgba(0, 210, 255, 0.16);
  --success: #34d399;
  --danger: #ff6b6b;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

html[data-theme='light'] {
  --bg-main: #f4f7fb;
  --bg-elevated: #ffffff;
  --bg-card: #edf2f9;
  --panel-border: #d7e1ee;
  --text-primary: #132136;
  --text-muted: #53627a;
  --accent: #008ae6;
  --accent-soft: rgba(0, 138, 230, 0.14);
  --success: #14824f;
  --danger: #d84545;
  --shadow: 0 16px 38px rgba(35, 58, 92, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  scrollbar-color: #2f5f82 #0b111a;
  scrollbar-width: thin;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background:
    radial-gradient(circle at 10% 5%, rgba(0, 210, 255, 0.11), transparent 30%),
    radial-gradient(circle at 90% 0%, rgba(59, 130, 246, 0.1), transparent 24%),
    var(--bg-main);
  color: var(--text-primary);
  line-height: 1.55;
}

.site-grid {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.left-rail {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  z-index: 30;
  padding: 1.4rem 1rem;
  border-right: 1px solid var(--panel-border);
  background: linear-gradient(178deg, rgba(19, 26, 34, 0.96), rgba(11, 15, 20, 0.96));
  backdrop-filter: blur(8px);
  overflow-y: auto;
}

html[data-theme='light'] .left-rail {
  background: linear-gradient(178deg, rgba(255, 255, 255, 0.97), rgba(244, 247, 251, 0.97));
}

.brand-mark {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 0.68rem 0.78rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 60px;
}

.brand-emblem {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
}

.brand-emblem svg {
  width: 100%;
  height: 100%;
}

.brand-emblem rect {
  fill: #0b0f14;
  stroke: var(--panel-border);
}

.brand-emblem path {
  fill: none;
  stroke: #00d2ff;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-emblem path:last-child {
  stroke: #d8e7f8;
  stroke-width: 2.4;
}

.brand-text > span {
  color: #00d2ff;
}

.rail-nav {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rail-nav a {
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.62rem 0.72rem;
  transition: 0.18s ease;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.rail-nav a:hover,
.rail-nav a:focus-visible,
.rail-nav a.is-active {
  border-color: var(--panel-border);
  background: var(--accent-soft);
  color: var(--text-primary);
}

.workspace {
  grid-column: 2;
  min-width: 0;
  padding: 1.2rem clamp(1rem, 2vw, 2.25rem) 2rem;
}

.workspace-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0;
  background: linear-gradient(to bottom, var(--bg-main) 74%, transparent);
}

.breadcrumbs {
  margin: 0 0 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--bg-elevated);
  padding: 0.6rem 0.84rem;
}

.breadcrumbs ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.breadcrumbs li + li::before {
  content: '/';
  margin-right: 0.4rem;
  color: color-mix(in oklab, var(--text-muted) 65%, white);
}

.breadcrumbs a {
  color: var(--text-primary);
  text-decoration: none;
}

.tool-hero-intro h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.tool-hero-intro p {
  margin: 0.72rem 0 0;
  color: var(--text-muted);
}

.left-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--bg-card);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  min-width: 48px;
  min-height: 48px;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
}

.page-kicker {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.theme-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.theme-switch {
  width: 58px;
  height: 32px;
  border-radius: 100px;
  border: 1px solid var(--panel-border);
  background: var(--bg-card);
  display: inline-flex;
  align-items: center;
  padding: 3px;
  cursor: pointer;
  min-width: 64px;
  min-height: 48px;
}

.switch-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.23s ease;
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.1);
}

html[data-theme='light'] .switch-thumb {
  transform: translateX(26px);
}

.panel-box {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  padding: 1.1rem;
}

.panel-box + .panel-box {
  margin-top: 1rem;
}

.panel-head h1,
.panel-head h2 {
  margin: 0;
  font-size: clamp(1.2rem, 1.7vw, 1.65rem);
}

.panel-head p {
  margin: 0.44rem 0 0;
  color: var(--text-muted);
}

.tab-controls {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tool-panels {
  min-height: 440px;
}

.tab-btn {
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  background: var(--bg-card);
  color: var(--text-muted);
  font: inherit;
  padding: 0.58rem 0.82rem;
  cursor: pointer;
  transition: 0.2s ease;
  min-height: 48px;
}

.tab-btn:hover,
.tab-btn.is-active {
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tool-pane {
  display: none;
  margin-top: 1rem;
}

.tool-pane.is-active {
  display: block;
}

.tool-blurb {
  margin: 0;
  color: var(--text-muted);
}

.dynamic-insight {
  margin-top: 1rem;
  border: 1px solid color-mix(in oklab, var(--accent) 35%, var(--panel-border));
  border-radius: 12px;
  background: color-mix(in oklab, var(--accent-soft) 28%, var(--bg-card));
  padding: 0.8rem;
  color: var(--text-primary);
  font-size: 0.92rem;
}

.unit-grid {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-row {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: color-mix(in oklab, var(--bg-card) 88%, transparent);
  padding: 0.75rem;
}

.field-row label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
}

.input-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.input-line input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--bg-main);
  color: var(--text-primary);
  padding: 0.52rem 0.62rem;
  font: inherit;
}

.input-line input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.input-line input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.16);
}

.copy-btn {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.2px;
  padding: 0.44rem 0.52rem;
  cursor: pointer;
  white-space: nowrap;
  min-height: 48px;
  min-width: 48px;
}

.copy-btn:hover,
.copy-btn.is-copied {
  color: var(--text-primary);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.field-hint {
  display: none;
  margin-top: 0.36rem;
  color: var(--danger);
  font-size: 0.76rem;
}

.input-line input.is-invalid + .copy-btn + .field-hint,
.input-line input.is-invalid + .field-hint {
  display: block;
}

.seo-article {
  color: var(--text-primary);
}

.seo-article h2,
.seo-article h3 {
  margin-top: 1.25rem;
  margin-bottom: 0.45rem;
}

.seo-article p {
  margin: 0.68rem 0;
}

.seo-article a {
  color: var(--accent);
  text-decoration: none;
}

.seo-article a:hover,
.seo-article a:focus-visible {
  text-decoration: underline;
}

.seo-article ul {
  margin: 0.55rem 0;
  padding-left: 1.15rem;
  color: var(--text-muted);
}

.seo-article li + li {
  margin-top: 0.36rem;
}

.code-sample {
  margin: 0.78rem 0;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: #0b111a;
  overflow-x: auto;
}

.code-sample code {
  display: block;
  padding: 0.9rem;
  color: #bfe9ff;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.84rem;
  line-height: 1.45;
}

html[data-theme='light'] .code-sample {
  background: #e7edf7;
}

html[data-theme='light'] .code-sample code {
  color: #194d80;
}

.faq-wrap {
  margin-top: 1.35rem;
  border-top: 1px solid var(--panel-border);
  padding-top: 1rem;
}

.faq-item {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 0.85rem;
}

.faq-item + .faq-item {
  margin-top: 0.62rem;
}

.faq-item h3 {
  margin: 0;
  font-size: 1rem;
}

.faq-item p {
  margin: 0.52rem 0 0;
  color: var(--text-muted);
}

.tool-usage-guide h2 {
  margin: 0;
  font-size: 1.12rem;
}

.tool-usage-guide ol {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
}

.tool-usage-guide li + li {
  margin-top: 0.38rem;
}

.tech-author-bio {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.bio-avatar {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-primary);
  background: linear-gradient(145deg, rgba(0, 210, 255, 0.22), rgba(59, 130, 246, 0.16));
}

.bio-content h2 {
  margin: 0;
  font-size: 1.05rem;
}

.bio-content p {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
}

.legal-content h2,
.legal-content h3,
.about-content h2,
.contact-content h2 {
  margin-top: 1.2rem;
  margin-bottom: 0.42rem;
}

.legal-content p,
.about-content p,
.contact-content p {
  margin: 0.68rem 0;
}

.legal-content ul,
.about-content ul {
  margin: 0.56rem 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
}

.contact-form {
  margin-top: 1rem;
  display: grid;
  gap: 0.85rem;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.form-field label {
  font-weight: 600;
}

.form-field input,
.form-field textarea {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 0.6rem 0.68rem;
  font: inherit;
}

.form-field textarea {
  resize: vertical;
  min-height: 140px;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.send-btn {
  width: fit-content;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--text-primary);
  font: inherit;
  font-weight: 600;
  padding: 0.62rem 0.98rem;
  cursor: pointer;
  min-height: 48px;
}

.send-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.contact-success {
  margin-top: 0.9rem;
  border-color: color-mix(in oklab, var(--success) 45%, var(--panel-border));
  background: color-mix(in oklab, var(--success) 18%, var(--bg-elevated));
  color: color-mix(in oklab, var(--success) 82%, white);
  font-weight: 600;
}

.primary-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
  padding: 0.64rem 1rem;
  min-height: 48px;
}

.workspace-foot {
  margin-top: 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: var(--bg-elevated);
  padding: 0.9rem 1rem;
  color: var(--text-muted);
}

.workspace-foot p {
  margin: 0;
}

.social-row {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.52rem;
}

.social-link {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-card);
  transition: 0.18s ease;
}

.social-link:hover,
.social-link:focus-visible {
  color: var(--text-primary);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.social-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.cookie-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  width: min(350px, calc(100vw - 2rem));
  border: 1px solid #1f4158;
  border-radius: 12px;
  background: #0d141e;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.45);
  color: #d5e2f2;
  padding: 0.9rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

html[data-theme='light'] .cookie-toast {
  background: #ebf1fa;
  border-color: #c5d4e7;
  color: #20344c;
}

.cookie-toast.is-hidden {
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
}

.toast-head {
  display: flex;
  align-items: center;
  gap: 0.44rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.78);
}

.cookie-toast p {
  margin: 0.5rem 0 0.7rem;
  font-size: 0.9rem;
}

.toast-btn {
  border: 1px solid #2f6d95;
  border-radius: 8px;
  background: rgba(0, 210, 255, 0.16);
  color: #9de9ff;
  font: inherit;
  padding: 0.42rem 0.62rem;
  cursor: pointer;
  min-height: 48px;
}

html[data-theme='light'] .toast-btn {
  border-color: #6f9ac3;
  color: #1f5f93;
  background: rgba(31, 95, 147, 0.12);
}

.nav-backdrop {
  display: none;
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: #0b111a;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #27547a, #1b2f45);
  border-radius: 999px;
  border: 2px solid #0b111a;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #00d2ff, #2f76bf);
}

@media (max-width: 1040px) {
  .tool-panels {
    min-height: 620px;
  }

  .unit-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

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

  .workspace {
    grid-column: 1;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .left-rail {
    transform: translateX(-106%);
    transition: transform 0.24s ease;
    width: min(285px, 84vw);
  }

  body.nav-open .left-rail {
    transform: translateX(0);
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 25;
    border: 0;
    background: rgba(6, 10, 15, 0.62);
  }

  body.nav-open .nav-backdrop {
    display: block;
  }
}

@media (max-width: 640px) {
  .breadcrumbs ol {
    font-size: 0.84rem;
  }

  .tool-panels {
    min-height: 660px;
  }

  .tab-controls {
    flex-direction: column;
  }

  .tab-btn {
    text-align: left;
    width: 100%;
  }

  .theme-toggle-wrap {
    font-size: 0.82rem;
    gap: 0.52rem;
  }

  .theme-switch {
    width: 54px;
    height: 28px;
  }

  html[data-theme='light'] .switch-thumb {
    transform: translateX(24px);
  }

  .tech-author-bio {
    flex-direction: column;
    align-items: flex-start;
  }
}
