:root {
  --bg0: #0f1720;
  --bg1: #162032;
  --bg2: #1e2d42;
  --ink: #e8eef6;
  --muted: #9aa8b8;
  --accent: #3d8bfd;
  --accent-2: #2bb673;
  --warn: #e6a23c;
  --danger: #e35d6a;
  --line: rgba(255, 255, 255, 0.08);
  --radius: 14px;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 139, 253, 0.22), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(43, 182, 115, 0.12), transparent 55%),
    linear-gradient(160deg, var(--bg0), var(--bg1) 45%, #121a26);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.25rem;
}

.tagline {
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 42rem;
}

.panel {
  background: rgba(22, 32, 50, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  backdrop-filter: blur(8px);
}

.grid {
  display: grid;
  gap: 1rem;
}
.grid-2 { grid-template-columns: 1.1fr 1.6fr; }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
  align-items: center;
}
.nav .spacer { flex: 1; }

label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }
input, textarea, select, button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--ink);
  padding: 0.65rem 0.8rem;
  width: 100%;
}
textarea { min-height: 140px; resize: vertical; }
button, .btn {
  width: auto;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #2563c7);
  border: none;
  color: white;
  font-weight: 600;
  padding: 0.65rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
button.secondary, .btn.secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
button.danger { background: var(--danger); }

.field { margin-bottom: 0.9rem; }

.msg-list { list-style: none; padding: 0; margin: 0; }
.msg-list li {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.msg-list li:hover { background: rgba(255,255,255,0.03); }
.msg-list .subject { font-weight: 600; }
.msg-list .meta { color: var(--muted); font-size: 0.85rem; }

.folder-list button {
  width: 100%;
  margin-bottom: 0.4rem;
  justify-content: flex-start;
  background: transparent;
  border: 1px solid transparent;
}
.folder-list button.active {
  border-color: var(--accent);
  background: rgba(61, 139, 253, 0.12);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(61,139,253,0.15);
  color: #b9d4ff;
  font-size: 0.75rem;
}
.badge.warn { background: rgba(230,162,60,0.18); color: #ffd39a; }
.badge.ok { background: rgba(43,182,115,0.18); color: #9aefc4; }

.meter {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.notice {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  background: rgba(61,139,253,0.08);
  margin: 1rem 0;
  border-radius: 0 10px 10px 0;
}

.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
}

.footer-note {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Режим «на весь экран»: раскладка на весь viewport + Fullscreen API */
html.is-fullscreen,
html.is-fullscreen body {
  height: 100%;
  overflow: hidden;
}
html.is-fullscreen .shell {
  max-width: none;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
html.is-fullscreen #siteFooter {
  display: none;
}
html.is-fullscreen #appPanel {
  flex: 1 1 auto;
  min-height: 0;
  display: grid !important;
  height: 100%;
}
html.is-fullscreen #appPanel.grid-2 {
  grid-template-rows: 1fr;
  align-items: stretch;
}
html.is-fullscreen #appPanel > .panel,
html.is-fullscreen #appPanel > aside.panel,
html.is-fullscreen #appPanel > main.panel {
  min-height: 0;
  overflow: auto;
  height: 100%;
}
html.is-fullscreen #msgList {
  max-height: none;
  flex: 1;
  overflow: auto;
}
html.is-fullscreen .btn-fullscreen[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(61, 139, 253, 0.18);
}

.hint, .hint-list .hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.35rem 0 0.75rem;
  line-height: 1.45;
}
.hint-list { margin-bottom: 0.75rem; }
.guide-steps { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.guide-steps li { margin-bottom: 0.55rem; line-height: 1.45; }
.mono {
  white-space: pre-wrap;
  font-size: 0.8rem;
  background: rgba(0,0,0,0.2);
  padding: 0.75rem;
  border-radius: 10px;
  overflow: auto;
}
code.wrap { white-space: pre-wrap; word-break: break-all; }
#dnsTable td { vertical-align: top; }
