@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&family=Playfair+Display:wght@600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #faf8f5;
  --card: #fff;
  --card-border: #eee9e2;
  --text: #2c2825;
  --text-mid: #5a5550;
  --text-light: #6b6560;
  --text-muted: #8a8480;
  --text-faint: #a09888;
  --text-ghost: #b5afa6;
  --accent: #b08d6e;
  --surface: #f9f7f4;
  --surface-hover: #f0ede8;
  --input-border: #e0dbd4;
  --divider: #e8e4dd;
  --dark: #2c2825;
  --green: #4a7c6f;
  --font-body: 'DM Sans', sans-serif;
  --font-display: 'Playfair Display', serif;
  --font-mono: 'Space Mono', monospace;
}

body {
  min-height: 100vh;
  background: var(--bg);
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Header ─── */
.site-header {
  border-bottom: 1px solid var(--divider);
  background: var(--bg);
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.logo {
  text-decoration: none;
  display: block;
}
.logo h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-display);
  letter-spacing: -0.5px;
  margin: 0;
}
.logo h1 span.accent { color: var(--accent); }
.logo h1 span.tld { font-size: 16px; color: var(--text-ghost); font-family: var(--font-body); font-weight: 400; }
.logo p { font-size: 13px; color: var(--text-faint); margin: 2px 0 0; }

/* ─── Ad Banner ─── */
.ad-banner-wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }
.ad-banner {
  width: 728px;
  max-width: 100%;
  height: 90px;
  margin: 8px auto;
  background: linear-gradient(135deg, #f0ede8 0%, #e8e4dd 100%);
  border: 1px dashed #c4bfb6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 13px;
  letter-spacing: 1px;
}

/* ─── Main ─── */
.main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 24px 60px;
}

/* ─── Footer ─── */
.site-footer {
  border-top: 1px solid var(--divider);
  margin-top: 40px;
}
.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
  text-align: center;
}
.footer-inner p { font-size: 13px; color: var(--text-ghost); }

/* ─── Homepage Grid ─── */
.category-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}
.tool-card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  border: 1px solid var(--card-border);
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.02);
  text-decoration: none;
  display: block;
  color: inherit;
}
.tool-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}
.tool-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.tool-icon {
  width: 36px;
  height: 36px;
  background: var(--surface);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-light);
  font-family: var(--font-mono);
  font-weight: 700;
  flex-shrink: 0;
}
.tool-card h3 { font-size: 16px; font-weight: 600; }
.tool-card p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ─── Tool Page ─── */
.back-link {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 0;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.back-link:hover { color: var(--text-mid); }
.tool-container {
  background: var(--card);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
  border: 1px solid var(--card-border);
}
.tool-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.tool-header .tool-icon { width: 44px; height: 44px; font-size: 20px; border-radius: 10px; }
.tool-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-display);
}
.tool-desc {
  color: var(--text-light);
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.6;
}

/* ─── Form Elements ─── */
input[type="text"], input[type="number"], textarea, select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--input-border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  outline: none;
  font-family: var(--font-body);
  transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 100px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* ─── Buttons ─── */
.btn {
  padding: 10px 22px;
  border-radius: 8px;
  border: none;
  background: var(--dark);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.85; }
.btn-alt { background: var(--text-mid); }
.pill {
  padding: 7px 16px;
  border-radius: 20px;
  border: none;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  transition: all 0.2s;
  background: var(--surface);
  color: var(--text-mid);
}
.pill.active { background: var(--dark); color: #fff; }

/* ─── Result Display ─── */
.result-box {
  margin-top: 24px;
  padding: 20px;
  background: var(--surface);
  border-radius: 10px;
  text-align: center;
}
.result-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-mono);
}
.result-unit { margin-left: 8px; color: var(--text-muted); font-size: 16px; }
.row-result {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  gap: 12px;
}
.row-result:hover { background: var(--surface-hover); }
.row-label { font-size: 12px; color: var(--text-faint); font-weight: 600; flex-shrink: 0; }
.row-value { font-family: var(--font-mono); font-size: 13px; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; }
.row-copy { font-size: 11px; color: var(--text-ghost); flex-shrink: 0; min-width: 40px; text-align: right; }
.row-copy.copied { color: var(--green); }

/* ─── Stat Grid ─── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.stat-box {
  background: var(--surface);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}
.stat-box .val { font-size: 22px; font-weight: 600; color: var(--text); font-family: var(--font-mono); }
.stat-box .lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ─── Username Grid ─── */
.username-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.username-chip {
  background: var(--surface);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}
.username-chip:hover { background: var(--surface-hover); }
.username-chip .cp { font-size: 10px; color: var(--text-ghost); }
.username-chip .cp.copied { color: var(--green); }

/* ─── Checkbox ─── */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-mid);
}
.checkbox-box {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1.5px solid #d0cbc4;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  font-size: 13px;
  color: #fff;
  line-height: 1;
}
.checkbox-box.checked { background: var(--dark); border: none; }

/* ─── Strength Bar ─── */
.strength-bar { flex: 1; height: 6px; background: var(--divider); border-radius: 3px; overflow: hidden; }
.strength-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }

/* ─── Swatch Bar ─── */
.swatch-bar { display: flex; gap: 4px; border-radius: 10px; overflow: hidden; }
.swatch { flex: 1; height: 44px; cursor: pointer; position: relative; transition: transform 0.15s; }

/* ─── Code Block ─── */
.code-block {
  background: #1e1e1e;
  color: #d4d0c8;
  border-radius: 10px;
  padding: 20px;
  margin-top: 16px;
  overflow: auto;
  max-height: 300px;
  font-size: 13px;
  font-family: var(--font-mono);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ─── Flex/Grid helpers ─── */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.gap-16 { gap: 16px; }
.grid-rows { display: grid; gap: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.w-full { width: 100%; }
.mono { font-family: var(--font-mono); }
.text-sm { font-size: 12px; }
.text-ghost { color: var(--text-ghost); }
.text-green { color: var(--green); }
.break-all { word-break: break-all; }

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .header-inner { padding: 16px; }
  .main-content { padding: 16px 16px 40px; }
  .tool-container { padding: 20px 16px; }
  .tool-grid { grid-template-columns: 1fr; }
  .ad-banner { height: 60px; font-size: 11px; }
}
