:root{
  --bg:#f6f7f9;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --line-soft:#d1d5db;
  --input:#ffffff;
  --input-hover:#fafafa;
  --primary:#111827;
  --primary-press:#000000;
  --focus:#16a34a;
  --shadow:0 18px 45px rgba(15,23,42,.08);
  --radius:22px;
  --radius-sm:14px;
}

*{box-sizing:border-box}

html,body{
  margin:0;
  padding:0;
  background:var(--bg);
  color:var(--text);
  font:16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}

body{
  min-height:100vh;
}

main{
  max-width:820px;
  margin:38px auto;
  padding:0 18px;
}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:28px;
  margin:18px 0;
  box-shadow:var(--shadow);
}

.row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
  margin-bottom:18px;
}

@media (max-width:720px){
  main{
    margin:18px auto;
    padding:0 12px;
  }

  .card{
    padding:20px 16px;
    border-radius:18px;
  }

  .row{
    grid-template-columns:1fr;
    gap:14px;
    margin-bottom:16px;
  }
}

label{
  display:block;
  margin:0 0 8px 2px;
  font-size:.9rem;
  font-weight:700;
  color:#374151;
}

input,
textarea,
select{
  width:100%;
  border:1px solid var(--line);
  background:var(--input);
  color:var(--text);
  padding:13px 14px;
  border-radius:var(--radius-sm);
  font:inherit;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

input:hover,
textarea:hover,
select:hover{
  background:var(--input-hover);
  border-color:var(--line-soft);
}

input:focus,
textarea:focus,
select:focus{
  border-color:rgba(22,163,74,.65);
  box-shadow:0 0 0 4px rgba(22,163,74,.12);
}

input::placeholder,
textarea::placeholder{
  color:#9ca3af;
}

textarea{
  min-height:96px;
  resize:vertical;
}

button,
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%;
  border:none;
  border-radius:14px;
  padding:14px 16px;
  font:inherit;
  font-weight:800;
  text-decoration:none;
  cursor:pointer;
  transition:filter .15s ease, transform .06s ease, background .15s ease;
}

.btn.primary{
  margin-top:4px;
  background:var(--primary);
  color:#ffffff;
}

.btn.flat{
  margin:4px 0 18px;
  background:#eef2f7;
  color:#111827;
  border:1px solid #e5e7eb;
}

.btn.primary:hover,
.btn.flat:hover{
  filter:brightness(.98);
}

.btn.primary:active,
.btn.flat:active{
  transform:translateY(1px);
}

.status{
  min-height:22px;
  margin:12px 0 0;
  font-size:.94rem;
  color:var(--muted);
}

.status.ok{
  color:#047857;
}

.status.err{
  color:#b91c1c;
}

.trust-box{
  margin-bottom:22px;
  padding:13px 15px;
  border:1px solid #dbeafe;
  border-radius:16px;
  background:#eff6ff;
  color:#1e3a8a;
  font-size:14px;
  font-weight:700;
  line-height:1.45;
}

.sim-box{
  margin-bottom:22px;
  padding:18px;
  border:1px solid #eef2f7;
  border-radius:18px;
  background:#fafafa;
}

.field-help{
  margin-top:7px;
  color:#6b7280;
  font-size:.82rem;
  line-height:1.4;
}

.suggest-list{
  position:relative;
  z-index:10;
  list-style:none;
  margin:7px 0 0 0;
  padding:0;
  display:none;
  background:#ffffff;
  border:1px solid var(--line);
  border-radius:12px;
  max-height:220px;
  overflow-y:auto;
  box-shadow:0 14px 28px rgba(15,23,42,.12);
}

.suggest-list.show{
  display:block;
}

.suggest-list li{
  padding:11px 12px;
  cursor:pointer;
  color:#111827;
  border-bottom:1px solid #f3f4f6;
}

.suggest-list li:last-child{
  border-bottom:none;
}

.suggest-list li:hover,
.suggest-list li.active{
  background:#f3f4f6;
}

.form-block{
  margin-bottom:18px;
}

.footer{
  margin-top:18px;
  color:var(--muted);
  font-size:.88rem;
  text-align:right;
}

.sim-box{
  padding:16px;
}

.sim-box .row{
  margin-bottom:14px;
}

#r_calc{
  margin:2px 0 14px;
  padding:12px 14px;
}

#std_result{
  margin-top:4px;
}