:root{
  --bg:#f4f7fb;
  --surface:#ffffff;
  --surface-2:#f8fafc;
  --text:#1f2937;
  --muted:#64748b;
  --brand:#2563eb;
  --brand-2:#0ea5e9;
  --border:#e2e8f0;
  --admin:#dc2626;
  --user:#16a34a;
  --radius:14px;
  --shadow:0 8px 24px rgba(15,23,42,.06);
}

*{box-sizing:border-box}

body{
  margin:0;
  padding:0;
  background:linear-gradient(180deg,#eef6ff 0,#f8fafc 220px,#f8fafc 100%);
  color:var(--text);
  font:14px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Tahoma,Arial,sans-serif;
  text-align:left;
}

form,fieldset,div{margin:0;padding:0;border:0}
img{vertical-align:middle;max-width:100%}

a{color:var(--brand);text-decoration:none;transition:.2s}
a:hover{color:#1d4ed8}

/* Шапка и подвал */
.header,.footer{
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  color:#fff;
  padding:14px 18px;
  border:0;
  box-shadow:0 2px 12px rgba(37,99,235,.18);
}
.header{
  position:sticky;
  top:0;
  z-index:10;
}
.footer{
  margin-top:18px;
  font-size:12px;
}

/* Верхняя и нижняя панели / формы */
.top,.bottom{
  background:rgba(255,255,255,.92);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:14px;
  margin:12px;
  box-shadow:var(--shadow);
}

/* Сообщения: вместо строк — карточки */
.a,.b{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:14px 16px;
  margin:10px 12px;
  box-shadow:0 4px 16px rgba(15,23,42,.04);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.b{background:var(--surface-2)}
.a:hover,.b:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 28px rgba(15,23,42,.08);
  border-color:#cbd5e1;
}

/* Ссылки в сообщениях */
.a a,.b a{color:#1d4ed8}
.admin a{color:var(--admin);font-weight:600}
.user a{color:var(--user);font-weight:600}

/* Ответ администратора */
.answer{
  margin:10px 0 0;
  padding:10px 12px;
  border-left:4px solid var(--admin);
  background:#fff5f5;
  border-radius:0 10px 10px 0;
  color:#475569;
}

/* Цветовые акценты */
.red{color:var(--admin)}
.green{color:var(--user)}
.blue{color:var(--brand)}
.aa{color:#0f766e;border-bottom:1px dotted #94a3b8}
.ab{color:#a21caf}

/* Поля и кнопки */
.text,.texta,.submit{
  border:1px solid var(--border);
  border-radius:10px;
  padding:9px 11px;
  color:var(--text);
  outline:none;
  transition:.2s;
}
.text{background:#fff}
.texta{background:#f8fafc}

input.text,input.texta,select,input[type="text"],input[type="email"],textarea{
  width:100%;
  max-width:100%;
  font:inherit;
}
textarea{min-height:96px;resize:vertical}

input:focus,select:focus,textarea:focus,.text:focus,.texta:focus{
  border-color:#93c5fd;
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
}

.submit{
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  border:0;
  color:#fff;
  padding:9px 16px;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
  box-shadow:0 6px 16px rgba(37,99,235,.22);
}
.submit:hover{filter:brightness(1.05);transform:translateY(-1px)}
.submit:active{transform:translateY(0)}

/* Кнопки/чипы .sfon */
.sfon a{
  display:inline-block;
  padding:5px 10px;
  margin:3px;
  border-radius:999px;
  color:#0369a1;
  background:#e0f2fe;
  border:1px solid #bae6fd;
  font-size:12px;
}
.sfon a:hover{
  color:#075985;
  background:#f0f9ff;
  border-color:#7dd3fc;
}

/* Мобильная адаптация */
@media (max-width:640px){
  .top,.bottom,.a,.b{
    margin-left:8px;
    margin-right:8px;
    padding:12px;
    border-radius:12px;
  }
  .header,.footer{padding:12px}
  input,select,textarea{font-size:16px} /* чтобы iOS не зумил поля */
}