/* DevUtils — shared stylesheet
   Design goals: fast, clean, no login, privacy-first. Sub-second interactions. */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --success: #059669;
  --error: #dc2626;
  --error-soft: #fef2f2;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.1);
  --maxw: 960px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.25rem 3rem; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}
.brand .logo {
  width: 28px; height: 28px;
  background: var(--primary);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}
.site-header nav { display: flex; gap: 1.25rem; }
.site-header nav a { color: var(--text-muted); text-decoration: none; font-size: 0.925rem; }
.site-header nav a:hover { color: var(--primary); }

/* ---------- Hero (homepage) ---------- */
.hero { text-align: center; padding: 3rem 0 2.5rem; }
.hero h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); letter-spacing: -0.02em; margin-bottom: 0.75rem; }
.hero p { color: var(--text-muted); max-width: 34rem; margin: 0 auto; font-size: 1.05rem; }
.hero .badges { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1.25rem; flex-wrap: wrap; }
.badge {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

/* ---------- Tool card grid (homepage) ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.tool-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.tool-card .icon { font-size: 1.5rem; line-height: 1; }
.tool-card h2 { font-size: 1.05rem; font-weight: 700; }
.tool-card p { font-size: 0.875rem; color: var(--text-muted); }
.tool-card .tag {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--success);
}
.tool-card .tag.soon { color: var(--text-muted); }

/* ---------- Page (tool) layout ---------- */
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -0.01em; margin-bottom: 0.4rem; }
.page-head p { color: var(--text-muted); max-width: 40rem; }
.breadcrumbs { font-size: 0.825rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); }

/* ---------- Tool workspace ---------- */
.workspace {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; align-items: center; }
.toolbar .spacer { flex: 1; }
.toolbar .meta { font-size: 0.8rem; color: var(--text-muted); font-family: var(--mono); }

.pane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 720px) { .pane { grid-template-columns: 1fr; } }
.pane label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
textarea {
  width: 100%;
  min-height: 300px;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text);
  background: #fdfdfd;
  resize: vertical;
  transition: border-color 0.15s;
}
textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.925rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn:active { transform: translateY(1px); }

/* ---------- Status / errors ---------- */
.status {
  margin-top: 0.85rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.875rem;
  display: none;
}
.status.ok { display: block; background: #ecfdf5; color: var(--success); }
.status.err { display: block; background: var(--error-soft); color: var(--error); font-family: var(--mono); font-size: 0.8rem; }

/* ---------- Content sections (How to use / FAQ / About) ---------- */
.doc-section { margin-top: 2.75rem; }
.doc-section h2 { font-size: 1.2rem; margin-bottom: 0.75rem; }
.doc-section ol, .doc-section ul { padding-left: 1.4rem; color: var(--text); }
.doc-section li { margin-bottom: 0.4rem; }
.doc-section p { margin-bottom: 0.75rem; color: var(--text-muted); }

.faq-item { border-bottom: 1px solid var(--border); padding: 0.85rem 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { font-size: 0.975rem; font-weight: 600; margin-bottom: 0.35rem; }
.faq-item p { font-size: 0.9rem; color: var(--text-muted); }

/* ---------- Related tools ---------- */
.related { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.related a {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
}
.related a:hover { border-color: var(--primary); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 2rem;
}
.site-footer .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.site-footer .inner a { color: var(--text-muted); text-decoration: none; }
.site-footer .inner a:hover { color: var(--primary); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--text);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.875rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Single input tools (timestamp etc.) ---------- */
.field-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.field-row input[type="text"], .field-row input[type="number"], .field-row select {
  flex: 1;
  min-width: 200px;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--text);
  background: #fdfdfd;
}
.field-row input:focus, .field-row select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12); }
.result-box {
  margin-top: 1rem;
  background: #fdfdfd;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-family: var(--mono);
  font-size: 0.95rem;
}
.result-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.result-row:last-child { border-bottom: none; }
.result-row .k { color: var(--text-muted); font-size: 0.85rem; }
.result-row .v { font-weight: 600; word-break: break-all; text-align: right; }
.now-clock { font-family: var(--mono); font-size: 1.4rem; font-weight: 700; color: var(--primary); }
