:root {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-soft: #eef5ff;
  --text: #172033;
  --muted: #637083;
  --primary: #1d6fdc;
  --primary-dark: #1556ad;
  --border: #dbe5f1;
  --success: #147a52;
  --shadow: 0 12px 30px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner,
.main-layout,
.footer-inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 0;
}

.logo {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 800;
}

.main-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.main-nav a {
  border-radius: 8px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 8px 10px;
}

.main-nav a.active,
.main-nav a:hover {
  background: var(--surface-soft);
  color: var(--primary);
  text-decoration: none;
}

.main-layout {
  padding: 22px 0 40px;
}

.hero,
.tool-panel,
.related-tools,
.home-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero {
  margin-bottom: 14px;
  padding: 22px;
}

.hero h1 {
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  line-height: 1.2;
  margin: 0 0 10px;
}

.hero p {
  color: var(--muted);
  margin: 0;
}

.ad-placeholder {
  align-items: center;
  background: #e6ebf2;
  border: 1px dashed #aeb9c8;
  border-radius: 8px;
  color: #697789;
  display: flex;
  font-size: 0.9rem;
  font-weight: 700;
  justify-content: center;
  margin: 14px 0;
  min-height: 72px;
  text-align: center;
}

.tool-panel {
  padding: 16px;
}

.tool-label {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

.text-input {
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  min-height: 230px;
  padding: 14px;
  resize: vertical;
  width: 100%;
}

.text-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 111, 220, 0.14);
  outline: none;
}

.button-row,
.convert-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

button,
.tool-card {
  min-height: 44px;
}

button {
  background: var(--primary);
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  flex: 1 1 150px;
  font: inherit;
  font-weight: 800;
  padding: 11px 16px;
}

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

button.secondary {
  background: #e9eef6;
  color: var(--text);
}

button.secondary:hover {
  background: #dbe5f1;
}

.results {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  margin-top: 18px;
}

.result-card {
  background: #f9fbfe;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.result-card span {
  color: var(--muted);
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
}

.result-card strong {
  display: block;
  font-size: 1.45rem;
  margin-top: 4px;
}

.copy-status {
  color: var(--success);
  font-size: 0.95rem;
  font-weight: 700;
  min-height: 24px;
  margin-top: 8px;
}

.related-tools {
  margin-top: 18px;
  padding: 18px;
}

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

.related-list,
.tool-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tool-card {
  background: #f9fbfe;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  display: block;
  height: 100%;
  padding: 16px;
}

.tool-card:hover {
  border-color: var(--primary);
  text-decoration: none;
}

.tool-card strong {
  display: block;
  margin-bottom: 4px;
}

.tool-card span {
  color: var(--muted);
  display: block;
}

.home-section {
  margin-top: 18px;
  padding: 20px;
}

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer-inner {
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 0;
}

.footer-links {
  display: flex;
  gap: 14px;
}

@media (min-width: 700px) {
  .header-inner,
  .footer-inner {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
  }

  button {
    flex: 0 0 auto;
  }

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

@media (min-width: 960px) {
  .hero {
    padding: 34px;
  }

  .results,
  .tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .header-inner,
  .main-layout,
  .footer-inner {
    width: min(100% - 24px, 1120px);
  }

  .tool-panel,
  .hero,
  .home-section,
  .related-tools {
    padding: 14px;
  }

  .text-input {
    min-height: 210px;
  }
}
