/* QuickUtils — shared styles */
:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --border: #e4e7ec;
  --text: #1a1f2c;
  --muted: #5b6478;
  --primary: #2f6df6;
  --primary-hover: #1f54d4;
  --accent: #0aa66f;
  --danger: #d64545;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.05);
  --max-width: 980px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --surface: #161a23;
    --border: #262c3a;
    --text: #e7eaf0;
    --muted: #93a0b8;
    --primary: #5b8dff;
    --primary-hover: #7ba2ff;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

img, svg { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--primary); }

.nav { display: flex; gap: 22px; align-items: center; }
.nav a { color: var(--muted); font-size: 0.95rem; }
.nav a:hover { color: var(--text); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  padding: 60px 0 40px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}
.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
}

/* ---------- Tool grid ---------- */
.category {
  margin: 36px 0 12px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.tool-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.tool-card:hover {
  text-decoration: none;
  border-color: var(--primary);
  transform: translateY(-2px);
}
.tool-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--text);
}
.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.tool-card .icon {
  font-size: 1.4rem;
  margin-bottom: 8px;
  display: inline-block;
}

/* ---------- Tool page ---------- */
.tool-page main { padding: 28px 0 60px; }
.tool-page h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.tool-page .lede {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 1.05rem;
}
.breadcrumbs {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 18px;
}
.breadcrumbs a { color: var(--muted); }

.tool-card-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

label { display: block; font-weight: 600; font-size: 0.93rem; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.field-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

input[type="number"],
input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}
textarea { font-family: var(--font-mono); font-size: 0.92rem; min-height: 180px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.15);
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  font-size: 1rem;
  font-weight: 600;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease;
}
.btn:hover { background: var(--primary-hover); }
.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.secondary:hover { background: var(--surface); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Result panel */
.result {
  margin-top: 18px;
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.result .big {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.result .label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}
.result-item {
  padding: 12px;
  background: var(--surface);
  border-radius: 8px;
}

/* SEO content */
.content-section { margin-top: 40px; }
.content-section h2 {
  font-size: 1.45rem;
  margin: 28px 0 10px;
  letter-spacing: -0.01em;
}
.content-section h3 {
  font-size: 1.1rem;
  margin: 20px 0 6px;
}
.content-section p, .content-section li { color: var(--text); }

details {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--surface);
}
details summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: " +"; color: var(--muted); }
details[open] summary::after { content: " −"; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  margin: 12px 0;
}
table th, table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
table th { background: var(--surface); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer .inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}
.site-footer a { color: var(--muted); }

/* Utility */
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.error {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: 6px;
}
.success { color: var(--accent); }

/* Ad slot placeholder (reserved for future AdSense) */
.ad-slot {
  display: none; /* hidden until AdSense is added */
  margin: 24px 0;
  min-height: 90px;
  border: 1px dashed var(--border);
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
  border-radius: 8px;
}
