:root {
  --bg: #f6f9fc; --card: #ffffff; --text: #0f1c2e; --muted: #64748b;
  --accent: #2563eb; --accent-dark: #1d4ed8; --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15,28,46,0.06), 0 8px 24px rgba(15,28,46,0.05);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans KR", "Noto Sans JP", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.65; -webkit-font-smoothing: antialiased; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hero {
  background-image: url("hero-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  padding: 80px 20px 120px;
  position: relative;
  overflow: hidden;
  min-height: 320px;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(10, 25, 60, 0.82) 0%,
    rgba(20, 45, 110, 0.72) 50%,
    rgba(30, 70, 160, 0.62) 100%
  );
  z-index: 0;
  pointer-events: none;
}

.hero-inner { max-width: 720px; margin: 0 auto; position: relative; z-index: 1; }
.hero h1 { font-size: 1.7rem; margin: 0 0 8px; font-weight: 700; letter-spacing: -0.01em; }
.hero p { margin: 0; opacity: 0.9; font-size: 0.98rem; max-width: 540px; }

.lang-switch { position: absolute; top: 16px; right: 16px; z-index: 2; }
.lang-switch select { appearance: none; -webkit-appearance: none; background-color: rgba(255,255,255,0.15); background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; border: 1px solid rgba(255,255,255,0.3); color: #fff; padding: 7px 32px 7px 12px; border-radius: 8px; font-size: 0.85rem; font-family: inherit; cursor: pointer; transition: background-color 0.15s; }
.lang-switch select:hover { background-color: rgba(255,255,255,0.28); }
.lang-switch select option { color: #0f1c2e; background: #fff; }

.wrap { max-width: 720px; margin: -52px auto 0; padding: 0 20px 64px; position: relative; z-index: 1; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 22px; box-shadow: var(--shadow); }
label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 6px; }
input, select { width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px; font-size: 1rem; margin-bottom: 18px; background: #fff; color: var(--text); transition: border-color 0.15s, box-shadow 0.15s; font-family: inherit; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.row { display: flex; gap: 14px; }
.row > div { flex: 1; }
button.calc { width: 100%; padding: 15px; background: var(--accent); color: #fff; border: none; border-radius: 9px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.15s, transform 0.1s; font-family: inherit; }
button.calc:hover { background: var(--accent-dark); }
button.calc:active { transform: scale(0.99); }
#result { margin-top: 24px; border-radius: 14px; padding: 24px; display: none; animation: fadeIn 0.35s ease; border: 2px solid transparent; transition: background 0.3s, border-color 0.3s, color 0.3s; }
#result.show { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.result-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.result-left { flex: 1; min-width: 180px; }
.result-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; opacity: 0.75; margin-bottom: 2px; }
.egfr-num { font-size: 3.2rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 6px; }
.egfr-unit { font-size: 0.95rem; font-weight: 500; opacity: 0.7; }
.stage-badge { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 110px; padding: 14px 18px; border-radius: 12px; background: rgba(255,255,255,0.65); border: 2px solid currentColor; font-weight: 800; font-size: 1.5rem; line-height: 1.1; }
.stage-badge small { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.7; margin-bottom: 2px; }
.result-meaning { margin-top: 16px; font-size: 1rem; font-weight: 600; line-height: 1.5; }
.result-note { margin-top: 10px; font-size: 0.85rem; opacity: 0.8; line-height: 1.55; }
.result-disclaimer { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,0.08); font-size: 0.8rem; opacity: 0.7; }
.stage-g1 { background: #ecfdf5; border-color: #10b981; color: #065f46; }
.stage-g2 { background: #f0fdfa; border-color: #14b8a6; color: #115e59; }
.stage-g3a { background: #fefce8; border-color: #eab308; color: #713f12; }
.stage-g3b { background: #fff7ed; border-color: #f97316; color: #7c2d12; }
.stage-g4 { background: #fef2f2; border-color: #ef4444; color: #7f1d1d; }
.stage-g5 { background: #fef2f2; border-color: #b91c1c; color: #450a0a; }
.stage-g5 .stage-badge { background: #b91c1c; color: #fff; border-color: #7f1d1d; }
h2 { font-size: 1.25rem; margin: 36px 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 1rem; margin: 22px 0 6px; }
p { margin: 0 0 14px; }
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86rem; background: #f8fafc; padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 14px 0; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { background: #f8fafc; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tr:last-child td { border-bottom: none; }
.disclaimer { font-size: 0.85rem; color: var(--muted); border-left: 3px solid #cbd5e1; padding: 4px 0 4px 14px; margin-top: 18px; }
.footer { text-align: center; font-size: 0.8rem; color: var(--muted); padding: 24px 20px 48px; }
@media (max-width: 560px) {
  .hero { padding: 40px 16px 72px; }
  .hero h1 { font-size: 1.35rem; }
  .lang-switch { position: static; display: flex; justify-content: center; margin-bottom: 16px; }
  .wrap { padding: 0 14px 48px; }
  .card { padding: 20px; }
  .row { flex-direction: column; gap: 0; }
  .egfr-num { font-size: 2.4rem; }
  .stage-badge { min-width: 90px; font-size: 1.25rem; padding: 10px 14px; }
}

/* ---------- Content additions ---------- */
ul, ol {
  margin: 0 0 16px;
  padding-left: 22px;
}
li {
  margin-bottom: 8px;
  line-height: 1.65;
}

.note-box {
  background: #eff6ff;
  border-left: 4px solid #2563eb;
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 20px 0;
}

@media (max-width: 640px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Toolara site navigation */
.site-header { position: relative; z-index: 10; background: rgba(255,255,255,0.96); border-bottom: 1px solid var(--border, #e2e8f0); }
.site-header-inner { max-width: 1120px; min-height: 68px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-brand { min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--text, #0f1c2e); text-decoration: none; font-weight: 700; }
.site-brand-mark { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 10px; background: var(--accent, #2563eb); color: #fff; font-size: 0.72rem; font-weight: 800; }
.site-brand-name { font-size: 0.95rem; line-height: 1.25; }
.site-nav { display: flex; align-items: center; gap: 10px; }
.site-nav-link { padding: 8px 12px; border: 1px solid var(--border, #e2e8f0); border-radius: 8px; background: #fff; color: var(--accent-dark, var(--accent, #1d4ed8)); text-decoration: none; white-space: nowrap; font-size: 0.875rem; font-weight: 650; transition: background 0.15s, border-color 0.15s; }
.site-nav-link:hover { background: var(--bg, #f8fafc); border-color: var(--accent, #2563eb); }
.site-nav select { appearance: none; -webkit-appearance: none; width: auto; min-width: 120px; height: 38px; margin: 0; padding: 8px 34px 8px 12px; border: 1px solid var(--border, #e2e8f0); border-radius: 8px; background-color: #fff; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 11px center; background-size: 14px; color: var(--text, #0f1c2e); font-family: inherit; font-size: 0.875rem; line-height: 1.2; cursor: pointer; box-shadow: 0 1px 2px rgba(15, 28, 46, 0.06); transition: border-color 0.15s, box-shadow 0.15s; }
.site-nav select:hover { border-color: var(--accent, #2563eb); }
.site-nav select:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }
.site-nav select option { color: #0f1c2e; background: #fff; }
@media (max-width: 560px) {
  .site-header-inner { min-height: 0; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .site-brand { flex: 1 1 100%; }
  .site-nav { width: 100%; justify-content: space-between; gap: 8px; }
  .site-nav select { min-width: 118px; }
}

.site-footer { margin-top: 64px !important; padding: 48px 24px 22px !important; background: #0b0d12 !important; border-top: 1px solid rgba(255,255,255,0.08) !important; color: #a6adbb !important; text-align: left !important; font-size: 0.88rem !important; line-height: 1.6; }
.site-footer-inner { max-width: 1160px; margin: 0 auto; }
.site-footer-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(280px,1.15fr) minmax(220px,0.9fr); gap: 48px; }
.site-footer-column { min-width: 0; }
.site-footer-wordmark { display: inline-flex; align-items: baseline; color: #f8fafc !important; font-size: 1.42rem; font-weight: 850; line-height: 1.15; text-decoration: none; }
.site-footer-wordmark .tld { color: var(--accent, #3b82f6); }
.site-footer-site-name { margin: 18px 0 0 !important; color: #f8fafc; font-size: 0.96rem; font-weight: 700; }
.site-footer-heading { margin: 0 0 16px !important; color: #f8fafc; font-size: 0.95rem; font-weight: 650; }
.site-footer-description { max-width: 420px; margin: 8px 0 0 !important; color: #98a1af; }
.site-footer-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 18px; }
.site-footer-contact { margin: 0 !important; color: #b9c0cb; overflow-wrap: anywhere; }
.site-footer a { color: #b9c0cb !important; text-decoration: none; }
.site-footer a:hover { color: #fff !important; text-decoration: underline; }
.site-footer-bottom { margin-top: 38px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.1); color: #747d8a; font-size: 0.73rem; line-height: 1.5; }
.site-footer-bottom p { margin: 0; }
@media (max-width: 960px) { .site-footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 34px; } .site-footer-column:first-child { grid-column: 1 / -1; } }
@media (max-width: 760px) { .site-footer { padding: 36px 20px 20px !important; } .site-footer-grid { grid-template-columns: 1fr; gap: 28px; } .site-footer-column:first-child { grid-column: auto; } .site-footer-links { gap: 10px 14px; } .site-footer-bottom { margin-top: 28px; } }
