
:root {
  --bg: #f5f5f7;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-border: #e5e5ea;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.06);
  --text: #111827;
  --text-muted: #6b7280;
  --shadow-soft: 0 14px 30px rgba(15, 23, 42, 0.06);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
}
body.theme-dark { background:#020617; color:#e5e7eb; }
*,
*::before,
*::after {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  color: var(--text);
  background: var(--bg);
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.main-content {
  padding: 4.5rem 0 3rem;
  flex: 1;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background-color: rgba(245, 245, 247, 0.94);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}
body.theme-dark .site-header {
  background-color: rgba(15, 23, 42, 0.96);
  border-bottom-color: rgba(51, 65, 85, 0.9);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.3rem;
}
.logo {
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 0.98rem;
  text-decoration: none;
  color: var(--text);
}
.logo span {
  color: var(--accent);
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.8rem;
}
.nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav a:hover {
  background: rgba(229, 231, 235, 0.9);
  color: var(--text);
}
body.theme-dark .nav a:hover {
  background: rgba(15, 23, 42, 0.9);
}
.theme-toggle {
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.8rem;
}
body.theme-dark .theme-toggle {
  background: rgba(15, 23, 42, 0.96);
}
.theme-toggle-icon {
  font-size: 1rem;
}
.hero {
  margin-bottom: 2.2rem;
}
.hero h1 {
  font-size: clamp(1.9rem, 3.2vw, 2.3rem);
  margin: 0 0 0.75rem 0;
  letter-spacing: -0.03em;
}
.hero p {
  margin: 0;
  max-width: 40rem;
  color: var(--text-muted);
  line-height: 1.55;
  font-size: 0.97rem;
}
.card {
  background-color: var(--card);
  border-radius: 1.15rem;
  border: 1px solid var(--card-border);
  padding: 1.55rem 1.6rem;
  margin-bottom: 1.3rem;
  box-shadow: var(--shadow-soft);
}
.card h1,
.card h2 {
  margin-top: 0;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}
.card p {
  margin-top: 0.15rem;
  margin-bottom: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}
.grid-tools {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.card-link {
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.card-link:hover {
  border-color: rgba(148, 163, 184, 0.8);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}
.card-link h2 {
  font-size: 1.02rem;
}
.tag {
  display: inline-flex;
  align-items: center;
  margin-top: 0.35rem;
  padding: 0.16rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(209, 213, 219, 0.9);
  font-size: 0.73rem;
  color: var(--text-muted);
}
.tool {
  margin-top: 0.7rem;
}
.grid-2 {
  display: grid;
  gap: 1rem;
}
.grid-3 {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.align-end {
  display: flex;
  align-items: flex-end;
}
label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
textarea,
input[type="number"],
input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 0.52rem 0.6rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(209, 213, 219, 1);
  background: #f9fafb;
  color: var(--text);
  font-family: inherit;
  font-size: 0.94rem;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
body.theme-dark textarea,
body.theme-dark input[type="number"],
body.theme-dark input[type="text"],
body.theme-dark input[type="email"] {
  background: #020617;
  border-color: #1f2937;
}
textarea:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.22);
  background-color: #ffffff;
}
body.theme-dark textarea:focus,
body.theme-dark input:focus {
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
  background-color: #020617;
}
textarea {
  resize: vertical;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  margin: 0.5rem 0 0.8rem;
  color: var(--text-muted);
}
.checkbox input {
  width: auto;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.7rem;
  padding: 0.55rem 1.15rem;
  border: 1px solid transparent;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  background-color: #111827;
  color: #f9fafb;
  transition: background-color 0.12s ease, transform 0.06s ease, box-shadow 0.12s ease;
}
body.theme-dark .btn {
  background-color: #e5e7eb;
  color: #020617;
}
.btn.primary {
  background-color: #111827;
}
body.theme-dark .btn.primary {
  background-color: #e5e7eb;
  color: #020617;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}
.btn:active {
  transform: translateY(0);
  box-shadow: none;
}
.btn.full-width {
  width: 100%;
}
.result-display {
  margin-top: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.8rem;
  background-color: #f9fafb;
  border: 1px solid rgba(229, 231, 235, 1);
  font-size: 0.94rem;
  white-space: pre-line;
}
body.theme-dark .result-display {
  background-color: #020617;
  border-color: #1f2937;
}
.big-result {
  font-size: 1.6rem;
  font-weight: 600;
  text-align: center;
  padding: 1rem 1.2rem;
}
.site-footer {
  border-top: 1px solid rgba(229, 231, 235, 0.9);
  padding: 1rem 0;
  background-color: var(--bg-soft);
}
body.theme-dark .site-footer {
  border-top-color: rgba(30, 64, 85, 0.8);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: 0.8rem;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}
.footer-links a:hover {
  text-decoration: underline;
}
.faq {
  margin-top: 1.2rem;
}
.faq h3 {
  font-size: 0.98rem;
  margin-bottom: 0.35rem;
}
.faq p {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
  .nav {
    order: 3;
  }
  .main-content {
    padding-top: 3.5rem;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
}
.warning { font-size: 0.8rem; color: #b45309; margin: 0.25rem 0 0.4rem; }
body.theme-dark .warning { color: #f97316; }
:root {
  --space: 1.2rem;
  --space-lg: 2rem;
  --radius: 10px;
}
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  background: #fafafa;
  color: #111;
}
.container {
  max-width: 880px;
  margin: auto;
  padding: var(--space);
}
.card {
  background: white;
  padding: var(--space);
  border-radius: var(--radius);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  margin-bottom: var(--space-lg);
}
.btn {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius);
  font-size: 1.1rem;
  cursor: pointer;
  border: none;
}
.btn.primary {
  background: #2563eb;
  color: white;
}
textarea, input[type=number] {
  width: 100%;
  padding: 0.8rem;
  border-radius: var(--radius);
  border: 1px solid #ccc;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}
.result-display {
  margin-top: 1rem;
  padding: 1rem;
  background: #f3f4f6;
  border-radius: var(--radius);
  min-height: 2.2rem;
}
  .container {
    padding: 1rem;
  }
  .card {
    padding: 1rem;
  }
  .btn {
    width: 100%;
    margin-bottom: 0.6rem;
  }
  nav.nav a {
    padding: 0.5rem 0.6rem;
    font-size: 1rem;
  }
}
  .nav {
    overflow-x: auto;
    white-space: nowrap;
  }
  .nav a {
    font-size: 0.9rem;
    padding: 0.25rem 0.6rem;
  }
}
  .nav {
    width: 100%;
    order: 2;
    margin-top: 0.3rem;
    overflow-x: auto;
    white-space: nowrap;
  }
  .theme-toggle {
    order: 1;
    margin-left: auto;
  }
}
@media (max-width: 600px) {
  .header-inner {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
  }
  .nav {
    width: 100%;
    order: 2;
    margin-top: 0.35rem;
    overflow-x: auto;
    white-space: nowrap;
  }
  .theme-toggle {
    order: 1;
    margin-left: auto;
  }
}
body.theme-dark .result-display,
body.theme-dark .card .result-display {
  background: #020617;
  color: #f9fafb;
}
body.theme-dark textarea,
body.theme-dark input[type="number"],
body.theme-dark input[type="text"] {
  background: #020617;
  color: #e5e7eb;
  border-color: #4b5563;
}
body.theme-dark .card {
  background: #020617;
  border-color: #1f2937;
}


/* Extra dark theme text safety to avoid black-on-black */
body.theme-dark main,
body.theme-dark main * {
  color: #e5e7eb;
}
body.theme-dark .card p,
body.theme-dark .card li {
  color: #e5e7eb;
}


/* Dark theme: stronger contrast for hero text on home */
body.theme-dark .hero h1 {
  color: #f9fafb;
}
body.theme-dark .hero p {
  color: #e5e7eb;
}


/* Dark theme: ensure header / logo / nav have enough contrast */
body.theme-dark .logo {
  color: #f9fafb;
}
body.theme-dark .logo span {
  color: #60a5fa;
}
body.theme-dark .nav a {
  color: #cbd5f5;
}
