:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #172b4d;
  --text-soft: #44546f;
  --text-muted: #626f86;
  --line: #dcdfe4;
  --blue: #0f57e4;
  --navy: #0b1672;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow: 0 2px 8px rgba(9, 30, 66, 0.10);
  --font: "Manrope", "Segoe UI", sans-serif;
  --warm: linear-gradient(135deg, #ff8c42 0%, #f06921 50%, #d35400 100%);
  --warm-hover: linear-gradient(135deg, #ff9d5c 0%, #f2793b 50%, #e67e22 100%);
  --ok-bg: #dcfff1;
  --ok-line: #7ee2b8;
  --ok-text: #216e4e;
  --bad-bg: #ffeceb;
  --bad-line: #ff9c8f;
  --bad-text: #ae2e24;
  --off-bg: #f1f2f4;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }

.shell {
  width: min(880px, calc(100% - 32px));
  margin: 24px auto 48px;
  padding-bottom: env(safe-area-inset-bottom);
}

.page-header {
  position: relative;
  overflow: hidden;
  margin: 12px 0 16px;
  padding: 32px 24px 28px;
  border-radius: var(--radius-lg);
  background: var(--warm);
  text-align: center;
}

.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(11, 22, 114, 0.25);
}

.page-header__tag,
.page-header h1,
.page-header p { position: relative; z-index: 1; }

.page-header__tag {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  padding: 6px 14px;
  border-radius: var(--radius);
  background: var(--navy);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.page-header h1 {
  margin: 8px 0 12px;
  color: #1e3a5f;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.page-header p {
  margin: 0;
  color: #475569;
  font-size: 18px;
  font-weight: 600;
}

.responsive-tabs {
  display: flex;
  gap: 4px;
  width: 100%;
  margin-bottom: 16px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f1f2f4;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.responsive-tabs__item {
  flex: 1 0 auto;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.responsive-tabs__item:hover { background: #ffffff; color: var(--navy); }

.responsive-tabs__item--active {
  border-color: rgba(15, 87, 228, 0.28);
  background: #ffffff;
  color: var(--blue);
  box-shadow: 0 1px 2px rgba(9, 30, 66, 0.12);
}

.responsive-tabs__item:focus-visible,
.btn:focus-visible,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible,
.choice input:focus-visible {
  outline: 2px solid #f1664a;
  outline-offset: 2px;
}

.stack, .panel { display: grid; gap: 12px; }

.panel {
  margin-top: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel h2, .card strong {
  margin: 0;
  color: #1a1a1a;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card__main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.badge--ok { background: var(--ok-bg); color: var(--ok-text); border: 1px solid var(--ok-line); }
.badge--bad { background: var(--bad-bg); color: var(--bad-text); border: 1px solid var(--bad-line); }
.badge--off { background: var(--off-bg); color: var(--text-soft); border: 1px solid var(--line); }

.meta { margin: 0; color: var(--text-muted); font-size: 14px; }
.text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.reply {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #e9f2ff;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.field { display: grid; gap: 6px; }
.field span { color: var(--text-soft); font-size: 14px; font-weight: 700; }

.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--navy);
  font-size: 16px;
}

.textarea { min-height: 112px; resize: vertical; }

.select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%2712%27 viewBox=%270 0 12 12%27%3E%3Cpath fill=%27%230b1672%27 d=%27M6 9L1 4h10z%27/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px;
  cursor: pointer;
}

.input:hover, .select:hover, .textarea:hover { border-color: #d1d5db; }

.input:focus, .select:focus, .textarea:focus {
  border-color: #84a5f2;
  box-shadow: 0 0 0 3px rgba(132, 165, 242, 0.2);
  outline: none;
}

.hint { margin: 0; color: var(--text-muted); font-size: 14px; }

.choice {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  cursor: pointer;
}

.choice input { width: 20px; height: 20px; accent-color: var(--blue); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
}

.btn--primary {
  background: var(--warm);
  color: #ffffff;
  border: 1px solid rgba(186, 69, 0, 0.3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(211, 84, 0, 0.25);
}

.btn--primary:hover { background: var(--warm-hover); }

.btn--secondary {
  background: #84a5f2;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(11, 22, 114, 0.1), 0 4px 12px rgba(132, 165, 242, 0.2);
}

.btn--secondary:hover { filter: brightness(1.05); }

.alert, .empty {
  margin: 0;
  padding: 16px;
  border-radius: var(--radius-lg);
}

.alert {
  border: 1px solid var(--bad-line);
  background: var(--bad-bg);
  color: var(--bad-text);
  font-weight: 700;
}

.empty {
  border: 1px dashed var(--line);
  background: var(--surface);
  color: var(--text-soft);
}

.captcha {
  display: block;
  width: min(100%, 280px);
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

@media (max-width: 720px) {
  .shell { width: min(880px, calc(100% - 16px)); margin-top: 12px; }
  .page-header { padding: 48px 16px 20px; }
  .page-header h1 { font-size: 28px; }
  .page-header p { font-size: 16px; }
  .card__actions .btn, .panel .btn--primary { width: 100%; }
  .responsive-tabs__item { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none; }
}
