:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #059669;
  --accent-bg: #ecfdf5;
  --warning-bg: #fef2f2;
  --warning-text: #b91c1c;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

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

.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo:hover { text-decoration: none; }
.logo-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
}

nav { display: flex; gap: 20px; font-size: 0.95rem; font-weight: 500; }
nav a { color: var(--muted); }
nav a:hover, nav a.active { color: var(--primary); text-decoration: none; }

.hero { padding: 48px 0 32px; }
.hero-center { text-align: center; max-width: 720px; margin: 0 auto; }

h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.subtitle { color: var(--muted); font-size: 1.05rem; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin: 32px 0 64px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.tool-card.live:hover { transform: translateY(-2px); border-color: var(--primary); }
.tool-card.soon { opacity: 0.72; }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 12px;
  width: fit-content;
}
.badge-live { background: var(--accent-bg); color: var(--accent); }
.badge-soon { background: #f1f5f9; color: var(--muted); }

.tool-card h2 { font-size: 1.2rem; margin-bottom: 8px; }
.tool-card p { font-size: 0.95rem; color: var(--muted); margin-bottom: 20px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-secondary { background: #f1f5f9; color: var(--text); }
.btn-secondary:hover { background: #e2e8f0; }

.calc-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 48px;
}
@media (max-width: 860px) { .calc-layout { grid-template-columns: 1fr; } }

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

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-title:first-child { margin-top: 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input, .input-wrap select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.input-wrap input:focus, .input-wrap select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.unit {
  position: absolute;
  right: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  pointer-events: none;
}
.has-unit input { padding-right: 44px; }

.results-card { position: sticky; top: 84px; }

.price-box {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  padding: 22px;
  border-radius: 10px;
  text-align: center;
  margin-bottom: 18px;
}
.price-box .label { font-size: 0.85rem; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.05em; }
.price-box .amount { font-size: 2.4rem; font-weight: 800; line-height: 1.15; margin: 6px 0; }
.price-box .sub-metrics { display: flex; justify-content: center; gap: 18px; font-size: 0.9rem; opacity: 0.95; margin-top: 8px; }

.alert-box {
  background: var(--warning-bg);
  color: var(--warning-text);
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: none;
}

.bar-container {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: #e2e8f0;
  margin: 14px 0 18px;
}
.bar-seg { height: 100%; transition: width 0.2s ease; }

.breakdown-list { list-style: none; font-size: 0.92rem; }
.breakdown-list li {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
}
.breakdown-list li:last-child { border-bottom: none; }
.breakdown-list li.total-row {
  font-weight: 700;
  border-top: 1px solid var(--border);
  border-bottom: none;
  margin-top: 6px;
  padding-top: 10px;
}

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }

.actions-row { display: flex; gap: 10px; margin-top: 18px; }
.actions-row .btn { flex: 1; font-size: 0.88rem; }

.content-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 48px;
  box-shadow: var(--shadow);
}
.content-section h2 { font-size: 1.45rem; margin: 24px 0 12px; }
.content-section h2:first-child { margin-top: 0; }
.content-section h3 { font-size: 1.1rem; margin: 18px 0 6px; }
.content-section p, .content-section li { color: var(--muted); margin-bottom: 10px; }
.content-section ul { padding-left: 20px; margin-bottom: 16px; }

.formula-box {
  background: #f1f5f9;
  border-left: 4px solid var(--primary);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
  margin: 14px 0 18px;
  color: var(--text);
}

footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--muted); }
