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

:root {
  --bg: #0a0f1e;
  --surface: #111827;
  --surface2: #1e2a3a;
  --border: #1f2d3d;
  --accent: #3b82f6;
  --accent2: #10b981;
  --danger: #ef4444;
  --text: #f1f5f9;
  --muted: #64748b;
  --label: #94a3b8;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* NAV */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-logo { font-size: 18px; font-weight: 700; color: var(--text); text-decoration: none; }
.nav-logo span { color: var(--accent); }
.nav-links { margin-left: auto; display: flex; gap: 20px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav-links a:hover { color: var(--text); }

/* CONTAINER */
.container { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* PAGE HEADER */
.page-header { text-align: center; padding: 56px 0 40px; }
.page-header h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 700; margin-bottom: 12px; }
.page-header p { color: var(--muted); font-size: 16px; max-width: 540px; margin: 0 auto; }

/* TOOLS GRID */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  padding-bottom: 60px;
}
.tool-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 20px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, transform .15s;
  display: block;
}
.tool-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool-item-icon { font-size: 26px; margin-bottom: 12px; }
.tool-item-title { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.tool-item-desc { color: var(--muted); font-size: 13px; line-height: 1.5; }
.tool-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; margin-top: 10px; background: #1e3a5f; color: var(--accent); }

/* CALC PAGE */
.calc-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 0 80px;
}
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 28px; }
.back-link:hover { color: var(--text); }
.calc-title { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.calc-desc { color: var(--muted); font-size: 14px; margin-bottom: 32px; }

.field { margin-bottom: 18px; }
.field label { display: block; color: var(--label); font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field select option { background: var(--surface2); }

.btn {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin: 8px 0 24px;
  transition: background .2s;
}
.btn:hover { background: #2563eb; }

/* RESULT */
.result-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: none;
}
.result-box.show { display: block; }
.result-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.result-row:last-child { border-bottom: none; }
.result-label { color: var(--label); font-size: 13px; }
.result-value { font-weight: 600; font-size: 15px; }
.result-value.green { color: var(--accent2); }
.result-value.red { color: var(--danger); }
.result-value.blue { color: var(--accent); }
.result-main { text-align: center; padding: 20px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.result-main .label { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.result-main .value { font-size: 32px; font-weight: 700; color: var(--accent2); }

/* TIPS */
.tips { margin-top: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.tips h3 { font-size: 14px; color: var(--label); margin-bottom: 12px; }
.tips ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tips li { font-size: 13px; color: var(--muted); padding-left: 16px; position: relative; }
.tips li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }

/* DISCLAIMER */
.disclaimer { margin-top: 20px; font-size: 12px; color: var(--muted); background: #1a1204; border: 1px solid #2d1f00; border-radius: 8px; padding: 12px 14px; }

/* AFFILIATE */
.affiliate { margin-top: 32px; background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 20px; text-align: center; }
.affiliate p { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.affiliate-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.affiliate-btn { padding: 8px 18px; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 600; background: var(--border); color: var(--text); transition: background .2s; }
.affiliate-btn:hover { background: var(--accent); }

/* FOOTER */
footer { border-top: 1px solid var(--border); padding: 24px 20px; text-align: center; color: var(--muted); font-size: 12px; }

@media (max-width: 600px) {
  .calc-wrap { padding: 24px 0 60px; }
  .calc-title { font-size: 22px; }
}
