* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #eef2ff;
  --text: #172033;
  --muted: #657083;
  --line: #dfe5f2;
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --accent: #f97316;
  --success: #059669;
  --shadow: 0 18px 45px rgba(31, 41, 55, 0.12);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

.tool-shell {
  min-height: 100vh;
}

.site-header {
  background: #141827;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #fff;
  color: #141827;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.78);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.hero {
  background: linear-gradient(180deg, #141827 0%, #293157 100%);
  color: #fff;
}

.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 42px 20px 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #fbbf24;
  font-size: 14px;
  font-weight: 800;
}

.hero h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy {
  margin: 16px 0 0;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
  line-height: 1.8;
}

.tool-wrap {
  max-width: 1180px;
  margin: -16px auto 0;
  padding: 0 20px 48px;
}

.tool-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.workspace,
.composer,
.seo-section,
.related-tools {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.workspace {
  overflow: hidden;
}

.tool-tabs {
  display: flex;
  gap: 6px;
  padding: 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #f9fbff;
}

.tool-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.tool-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.search-row {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.search-input,
.draft-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.search-input {
  height: 44px;
  padding: 0 14px;
}

.clear-search {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.item-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 10px;
}

.copy-card {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.copy-card:hover {
  transform: translateY(-1px);
  border-color: #a5b4fc;
  background: #fbfcff;
}

.copy-value {
  font-size: 24px;
  line-height: 1.3;
  word-break: break-word;
}

.copy-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.no-results {
  grid-column: 1 / -1;
  padding: 30px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.composer {
  position: sticky;
  top: 14px;
  padding: 16px;
}

.composer h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.draft-input {
  min-height: 120px;
  resize: vertical;
  padding: 12px;
  line-height: 1.7;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.primary-btn,
.secondary-btn {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
}

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

.secondary-btn {
  background: #fff;
  color: var(--muted);
  border-color: var(--line);
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.recent-chip {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 9px;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  background: #111827;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.seo-section,
.related-tools {
  max-width: 1180px;
  margin: 22px auto 0;
  padding: 24px;
  box-shadow: none;
}

.seo-section h2,
.related-tools h2 {
  margin: 0 0 12px;
  font-size: 1.45rem;
}

.seo-section h3 {
  margin: 22px 0 8px;
  font-size: 1.05rem;
}

.seo-section p,
.seo-section li {
  color: #3f4a5f;
  line-height: 1.85;
}

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

.seo-card,
.related-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.seo-card strong,
.related-card strong {
  display: block;
  margin-bottom: 6px;
}

.related-card {
  text-decoration: none;
}

.related-card:hover {
  border-color: #a5b4fc;
}

.site-footer {
  max-width: 1180px;
  margin: 30px auto 0;
  padding: 24px 20px 36px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer a {
  color: var(--primary-dark);
  font-weight: 700;
}

@media (max-width: 880px) {
  .site-header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .tool-app {
    grid-template-columns: 1fr;
  }

  .composer {
    position: static;
  }

  .seo-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero-inner {
    padding-top: 30px;
  }

  .tool-wrap {
    padding-left: 12px;
    padding-right: 12px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

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

  .copy-value {
    font-size: 21px;
  }
}
