:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-strong: #eef3f8;
  --text: #172033;
  --muted: #5d687a;
  --line: #dce3ec;
  --primary: #2563eb;
  --primary-dark: #1748b5;
  --accent: #0f766e;
  --warn: #b45309;
  --danger: #b42318;
  --shadow: 0 20px 45px rgba(28, 42, 68, 0.11);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  background-color: #f5f8fb;
  background-image: url("assets/codekitbox-hero-light.jpg");
  background-position: center;
  background-size: cover;
  border-bottom: 1px solid #d7e0e9;
  color: var(--text);
  min-height: 500px;
  position: relative;
}

.site-header::after {
  background: rgba(255, 255, 255, 0.08);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.site-header > * {
  position: relative;
  z-index: 1;
}

.nav {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 22px 24px;
  position: relative;
}

.nav::after {
  background: rgba(23, 32, 51, 0.12);
  bottom: 0;
  content: "";
  height: 1px;
  left: 24px;
  position: absolute;
  right: 24px;
}

.brand,
.nav-links {
  align-items: center;
  display: flex;
  gap: 14px;
}

.brand {
  font-weight: 800;
}

.brand-mark {
  align-items: center;
  background: var(--primary);
  border-radius: 8px;
  color: white;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.nav-links {
  color: #465267;
  font-size: 0.95rem;
}

.site-header .nav-links {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(23, 32, 51, 0.14);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(28, 42, 68, 0.1);
  color: #263247;
  padding: 5px 6px 5px 14px;
}

.site-header .nav-links > a {
  font-weight: 750;
  padding: 6px 2px;
}

.site-header .nav-links > a:hover,
.site-header .nav-links > a:focus-visible {
  color: var(--primary);
  outline: none;
}

.language-switcher {
  align-items: center;
  background: #eef3f8;
  border: 1px solid #d4dde8;
  border-radius: 8px;
  display: flex;
  padding: 3px;
}

.language-button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #596579;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  min-height: 30px;
  min-width: 36px;
}

.language-button.is-active {
  background: var(--primary);
  color: white;
}

.hero {
  margin: 0 auto;
  max-width: 1180px;
  padding: 62px 24px 116px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.site-header .eyebrow {
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(2.25rem, 4vw, 3.8rem);
  line-height: 1.08;
  margin: 0;
  max-width: 600px;
}

.hero-copy {
  color: #4f5d72;
  font-size: 1.08rem;
  margin: 20px 0 0;
  max-width: 540px;
}

main {
  margin: -58px auto 0;
  max-width: 1180px;
  padding: 0 24px 48px;
}

.hero-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.hero-benefits span {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 6px;
  color: #31576a;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 7px 10px;
}

.hero-benefits span:first-child {
  background: #dff7f1;
  color: #08746a;
}

.tool-discovery {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
  position: relative;
  z-index: 2;
}

.tool-search {
  position: relative;
}

.tool-search label {
  display: block;
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 7px;
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap input {
  background: #f8fafc;
  min-height: 50px;
  padding-left: 44px;
}

.search-icon {
  border: 2px solid #64748b;
  border-radius: 50%;
  height: 15px;
  left: 17px;
  pointer-events: none;
  position: absolute;
  top: 16px;
  width: 15px;
  z-index: 1;
}

.search-icon::after {
  background: #64748b;
  content: "";
  height: 2px;
  position: absolute;
  right: -6px;
  top: 11px;
  transform: rotate(45deg);
  width: 7px;
}

.search-results {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 32px rgba(28, 42, 68, 0.14);
  display: grid;
  left: 0;
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: 82px;
  z-index: 5;
}

.search-results[hidden] {
  display: none;
}

.search-result {
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  font-weight: 750;
  justify-content: space-between;
  padding: 11px 12px;
  text-align: left;
}

.search-result:hover,
.search-result:focus-visible {
  background: var(--surface-strong);
  color: var(--primary);
  outline: none;
}

.search-result small {
  color: var(--muted);
  font-weight: 600;
}

.popular-heading {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

.popular-heading h2 {
  font-size: 1.45rem;
  line-height: 1.2;
  margin: 0;
}

.popular-heading a {
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 800;
}

.popular-tools {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.popular-tool {
  align-items: center;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  gap: 12px;
  min-height: 82px;
  padding: 14px;
  text-align: left;
}

.popular-tool:hover,
.popular-tool:focus-visible {
  border-color: #9eb8e8;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.09);
  outline: none;
  transform: translateY(-1px);
}

.popular-tool span:last-child,
.popular-tool strong,
.popular-tool small {
  display: block;
}

.popular-tool strong {
  font-size: 0.92rem;
}

.popular-tool small {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 2px;
}

.tool-symbol {
  align-items: center;
  border-radius: 7px;
  color: white;
  display: inline-flex;
  flex: 0 0 38px;
  font-size: 0.7rem;
  font-weight: 900;
  height: 38px;
  justify-content: center;
}

.symbol-blue { background: #2563eb; }
.symbol-green { background: #0f766e; }
.symbol-amber { background: #b45309; }
.symbol-violet { background: #7c3aed; }
.symbol-red { background: #dc2626; }
.symbol-cyan { background: #0891b2; }

.ad-slot {
  align-items: center;
  background: #f0f4f8;
  border: 1px dashed #a9b7c8;
  border-radius: 8px;
  color: #64748b;
  display: flex;
  justify-content: center;
  min-height: 92px;
  margin: 24px 0;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
}

body:not(.ads-enabled) .ad-slot {
  display: none;
}

.tools-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: 220px minmax(0, 1fr);
}

.tool-menu,
.tool-panel,
.content-band,
.faq {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-menu {
  display: grid;
  gap: 14px;
  padding: 12px;
  position: sticky;
  top: 16px;
}

.tool-menu-group {
  display: grid;
  gap: 5px;
}

.tool-menu-label {
  color: #7a8698;
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  margin: 4px 10px 2px;
  text-transform: uppercase;
}

.tool-tab {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  min-height: 42px;
  padding: 0 14px;
  text-align: left;
}

.tool-tab:hover,
.tool-tab:focus-visible,
.tool-tab.is-active {
  background: var(--surface-strong);
  color: var(--text);
  outline: none;
}

.tool-tab.is-active {
  box-shadow: inset 3px 0 0 var(--primary);
  font-weight: 800;
}

.tool-panel {
  min-height: 590px;
  overflow: hidden;
}

.tool-heading {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 26px;
}

.tool-heading h2 {
  font-size: 1.55rem;
  line-height: 1.2;
  margin: 0;
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-badge {
  border-radius: 6px;
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 800;
  margin-top: 14px;
  padding: 7px 10px;
}

.status-valid {
  background: #ecfdf3;
  color: #067647;
}

.status-expired {
  background: #fff1f1;
  color: #b42318;
}

.claim-times {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.claim-time {
  background: var(--surface-strong);
  border-radius: 6px;
  padding: 10px;
}

.claim-time strong,
.claim-time span {
  display: block;
}

.claim-time span {
  color: var(--muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.tool-body {
  padding: 26px;
}

.field-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
}

.field label,
.option-label {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
}

textarea,
input,
select {
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 44px;
  padding: 12px;
  width: 100%;
}

textarea {
  min-height: 230px;
  resize: vertical;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  outline: none;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.primary-button,
.secondary-button,
.copy-button,
.mode-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
  padding: 0 16px;
}

.primary-button {
  background: var(--primary);
  color: white;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button,
.copy-button,
.mode-button {
  background: var(--surface-strong);
  color: var(--text);
}

.mode-button.is-selected {
  background: var(--primary);
  color: white;
}

.copy-button {
  justify-self: start;
}

.result-box,
.message {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 14px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

.diff-line {
  display: block;
  margin: 0 -14px;
  padding: 2px 14px;
}

.diff-added {
  background: #ecfdf3;
  color: #067647;
}

.diff-removed {
  background: #fff1f1;
  color: #b42318;
}

.diff-same {
  color: var(--muted);
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.stat {
  background: var(--surface-strong);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  padding: 7px 10px;
}

.message {
  color: var(--muted);
}

.message.error {
  background: #fff7f7;
  border-color: #fecaca;
  color: var(--danger);
}

.result-list {
  display: grid;
  gap: 14px;
}

.small-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.content-band,
.faq,
.tool-directory {
  margin-top: 24px;
  padding: 30px;
}

.tool-directory {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-directory h2 {
  line-height: 1.2;
  margin: 0 0 18px;
}

.tool-directory-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-directory-grid a {
  background: var(--surface-strong);
  border-radius: 6px;
  color: var(--text);
  font-weight: 750;
  padding: 12px;
}

.tool-directory-grid a:hover {
  color: var(--primary);
}

.content-grid {
  display: grid;
  gap: 34px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-band h2,
.faq h2 {
  line-height: 1.2;
  margin: 0 0 10px;
}

.content-band p,
.faq p {
  color: var(--muted);
  margin: 0;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.faq details:first-of-type {
  margin-top: 12px;
}

.faq summary {
  cursor: pointer;
  font-weight: 800;
}

.site-footer {
  align-items: center;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 24px;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-end;
}

.footer-links a:hover {
  color: var(--primary);
}

@media (max-width: 820px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header .nav-links {
    max-width: 100%;
    overflow-x: auto;
  }

  .hero {
    padding-bottom: 96px;
  }

  .site-header {
    background-position: 58% center;
    min-height: 480px;
  }

  .site-header::after {
    background: rgba(255, 255, 255, 0.58);
  }

  .hero h1 {
    font-size: 2.35rem;
  }

  main {
    margin-top: -42px;
  }

  .tools-layout,
  .field-grid,
  .content-grid,
  .small-grid,
  .claim-times,
  .tool-directory-grid,
  .popular-tools {
    grid-template-columns: 1fr;
  }

  .tool-discovery {
    padding: 16px;
  }

  .popular-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-menu {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    position: static;
  }

  .tool-menu-group {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
  }

  .tool-menu-label {
    display: none;
  }

  .tool-tab {
    flex: 0 0 auto;
    min-width: 118px;
    text-align: center;
  }

  .tool-tab.is-active {
    box-shadow: inset 0 -3px 0 var(--primary);
  }

  .tool-heading {
    flex-direction: column;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .popular-tools {
    grid-template-columns: 1fr;
  }

  .popular-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}
