:root {
  --bg: #0b0c10;
  --card: #12141b;
  --text: #e8eaf0;
  --muted: #a7adbd;
  --line: rgba(255, 255, 255, 0.08);
  --focus: rgba(255, 255, 255, 0.16);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(1200px 700px at 20% -10%, rgba(255,255,255,0.06), transparent),
              radial-gradient(900px 500px at 85% 0%, rgba(255,255,255,0.05), transparent),
              var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
.container { width: min(980px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  background: rgba(11, 12, 16, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  font-weight: 750;
  letter-spacing: 0.2px;
}

.nav a {
  color: var(--muted);
  margin-left: 14px;
}
.nav a:hover { color: var(--text); }

.hero { padding: 26px 0 10px; }
h1 { font-size: clamp(28px, 3.2vw, 42px); margin: 0 0 10px; }
.lead { color: var(--muted); margin: 0; line-height: 1.5; }

.card {
  margin: 18px 0;
  padding: 18px;
  background: rgba(18, 20, 27, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.label { color: var(--muted); font-size: 14px; }

.segmented {
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
}

.seg {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 650;
}
.seg:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.seg.active { background: rgba(255,255,255,0.08); color: var(--text); }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .mode { flex-direction: column; align-items: flex-start; }
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

.field input[type="number"] {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  outline: none;
}
.field input[type="number"]:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.06);
}

.field.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 28px;
}
.field.checkbox input { transform: scale(1.15); }

.hint { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; }

.actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}
button:hover { background: rgba(255,255,255,0.06); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.primary { background: rgba(255,255,255,0.10); }
.primary:hover { background: rgba(255,255,255,0.14); }

.secondary { color: var(--text); }

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.big { font-size: 18px; margin: 10px 0 10px; }
.breakdown ul { margin: 8px 0 0; padding-left: 18px; }
.breakdown li { margin: 6px 0; color: var(--text); }
.muted { color: var(--muted); }
.hidden { display: none; }

details {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
summary { cursor: pointer; font-weight: 700; }
.details-body { margin-top: 10px; color: var(--muted); line-height: 1.55; }

.disclaimer {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.footer { padding: 18px 0 26px; text-align: center; }
