* { box-sizing: border-box; }
body {
  margin: 0;
  background: #f4f6f8;
  color: #18202a;
  font-family: Inter, Arial, sans-serif;
}
.container { max-width: 1500px; margin: 0 auto; padding: 28px; }
header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 20px;
}
h1 { margin: 0 0 6px; font-size: 28px; }
header p { margin: 0; color: #687381; }
.badge { background: #e9edf2; padding: 7px 10px; border-radius: 8px; font-size: 12px; }
.panel {
  background: #fff; border: 1px solid #e0e5ea; border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04); padding: 20px;
}
.form-panel { margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: 1fr 180px; gap: 16px; margin-bottom: 16px; }
label { display: block; }
label span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
input, textarea {
  width: 100%; border: 1px solid #cfd6de; border-radius: 8px;
  padding: 11px 12px; font: inherit; background: #fff;
}
textarea { min-height: 190px; resize: vertical; font-family: ui-monospace, monospace; }
input:focus, textarea:focus { outline: 2px solid #c9dcff; border-color: #6b9cff; }
.actions { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
button {
  border: 0; border-radius: 8px; padding: 11px 16px; font-weight: 700; cursor: pointer;
}
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: #1667d9; color: white; }
.primary:hover:not(:disabled) { background: #1358b8; }
.secondary { background: #e9edf2; color: #24303d; }
.secondary:hover:not(:disabled) { background: #d5dce3; }
#message { margin-top: 12px; min-height: 20px; color: #687381; font-size: 13px; }
.summary {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px;
}
.summary > div {
  background: white; border: 1px solid #e0e5ea; border-radius: 10px; padding: 14px;
}
.summary b { display: block; font-size: 25px; }
.summary span { color: #687381; font-size: 12px; }
.summary .ok b { color: #198754; }
.summary .warn b { color: #c27a00; }
.summary .bad b { color: #c0392b; }
.summary .info b { color: #1667d9; }
.hidden { display: none; }
.table-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
h2 { margin: 0 0 15px; font-size: 18px; }
#generated { font-size: 12px; color: #687381; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; background: #f5f7f9; padding: 10px;
  border-bottom: 1px solid #dfe4e8; white-space: nowrap;
}
td { padding: 10px; border-bottom: 1px solid #edf0f2; white-space: nowrap; }
tr:hover td { background: #fafbfc; }
.domain { font-weight: 700; }
.pill {
  display: inline-block; padding: 4px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.pill.ok { background: #e6f5ec; color: #147a3f; }
.pill.warn { background: #fff3d6; color: #966100; }
.pill.bad { background: #fde8e6; color: #a5281c; }
.pill.info { background: #e5efff; color: #175bb4; }
.pill.gray { background: #edf0f2; color: #59636d; }
.empty { text-align: center; color: #7b8794; padding: 35px; }

/* ===== НОВЫЕ СТИЛИ ДЛЯ ВЕРТИКАЛЬНОГО СПИСКА DNS-СЕРВЕРОВ ===== */
.dns-servers-cell {
  min-width: 180px;
  max-width: 280px;
  vertical-align: middle;
}

.dns-servers-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px 0;
}

.dns-server-item {
  display: block;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  background: #f5f7f9;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.4;
  border-left: 2px solid #c9dcff;
}

.dns-server-item:first-child {
  border-left-color: #1667d9;
}

.dns-server-item:last-child {
  border-left-color: #6b9cff;
}

/* Подсказка при наведении на ячейку */
.dns-servers-cell .dns-servers-list {
  cursor: default;
}

/* ===== АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ ===== */
@media (max-width: 900px) {
  .summary { grid-template-columns: repeat(3, 1fr); }
  .grid { grid-template-columns: 1fr; }
}

@media (max-width: 1200px) {
  .table-wrap { overflow-x: auto; }
  table { font-size: 12px; }
  th, td { padding: 6px 8px; white-space: nowrap; }
  .dns-servers-cell {
    min-width: 140px;
    max-width: 200px;
  }
  .dns-server-item {
    font-size: 10px;
    padding: 1px 4px;
  }
}

@media (max-width: 768px) {
  .container { padding: 15px; }
  .panel { padding: 15px; }
  .dns-servers-cell {
    min-width: 120px;
    max-width: 160px;
  }
  .dns-server-item {
    font-size: 9px;
    padding: 1px 3px;
    white-space: normal;
    word-break: break-all;
  }
  .dns-servers-list {
    gap: 2px;
  }
}

@media (max-width: 480px) {
  .summary { grid-template-columns: repeat(2, 1fr); }
  header { flex-direction: column; align-items: stretch; }
  .badge { align-self: flex-start; margin-top: 8px; }
  .dns-servers-cell {
    min-width: 100px;
    max-width: 130px;
  }
  .dns-server-item {
    font-size: 8px;
    padding: 1px 2px;
  }
}
.brand { display:flex; gap:12px; align-items:center; }
.logo-mark { width:44px; height:44px; border-radius:12px; display:grid; place-items:center; background:linear-gradient(135deg,#1667d9,#5d9cff); color:#fff; font-size:27px; font-weight:800; box-shadow:0 5px 14px rgba(22,103,217,.22); }
.options { margin-top:13px; }
.check { display:flex; align-items:center; gap:8px; font-weight:500; }
.check input { width:auto; }
.check span { margin:0; font-weight:600; }
.check small { color:#7b8794; font-weight:400; }
.progress-box { margin-top:16px; }
.progress-label { display:flex; justify-content:space-between; font-size:12px; color:#687381; margin-bottom:6px; }
.progress { height:9px; background:#e7ebef; border-radius:999px; overflow:hidden; }
#progressBar { height:100%; width:0; background:linear-gradient(90deg,#1667d9,#5d9cff); border-radius:999px; transition:width .2s ease; }

/* Registry / DNS details */
.option-grid { display:grid; grid-template-columns:repeat(2,minmax(280px,1fr)); gap:10px 18px; }
.info-details { position:relative; min-width:130px; }
.info-details summary { list-style:none; cursor:pointer; }
.info-details summary::-webkit-details-marker { display:none; }
.details-body {
  position:absolute; z-index:20; top:28px; left:0; min-width:260px; max-width:420px;
  max-height:320px; overflow:auto; padding:10px 12px; background:#fff;
  border:1px solid #dbe1e7; border-radius:8px; box-shadow:0 8px 25px rgba(0,0,0,.12);
  white-space:normal; line-height:1.45; font-size:11px;
}
.details-body > div { margin-bottom:4px; }
.details-body > div:last-child { margin-bottom:0; }
.muted { color:#7b8794; }
@media (max-width: 768px) { .option-grid { grid-template-columns:1fr; } .details-body { position:fixed; left:15px; right:15px; top:20%; max-width:none; } }

/* ===== Theme switcher ===== */
:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --text: #18202a;
  --muted: #687381;
  --panel: #ffffff;
  --border: #e0e5ea;
  --input: #ffffff;
  --input-border: #cfd6de;
  --table-head: #f5f7f9;
  --row-border: #edf0f2;
  --hover: #fafbfc;
  --secondary: #e9edf2;
  --secondary-hover: #d5dce3;
  --pill-gray: #edf0f2;
  --pill-gray-text: #59636d;
  --details: #ffffff;
  --shadow: rgba(0,0,0,.12);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1318;
  --text: #e8edf3;
  --muted: #9aa6b2;
  --panel: #171d24;
  --border: #2a333d;
  --input: #11171d;
  --input-border: #394551;
  --table-head: #1c242d;
  --row-border: #28313a;
  --hover: #1b232c;
  --secondary: #27313b;
  --secondary-hover: #34414d;
  --pill-gray: #29323b;
  --pill-gray-text: #b6c0ca;
  --details: #1a222b;
  --shadow: rgba(0,0,0,.38);
}

html, body { min-height: 100%; }
body { background: var(--bg); color: var(--text); transition: background .2s ease, color .2s ease; }
.container { max-width: 2400px; }
.panel, .summary > div { background: var(--panel); border-color: var(--border); }
header p, #message, #generated, .summary span, .progress-label { color: var(--muted); }
.badge, .secondary { background: var(--secondary); color: var(--text); }
.secondary:hover:not(:disabled) { background: var(--secondary-hover); }
input, textarea { background: var(--input); color: var(--text); border-color: var(--input-border); }
input::placeholder, textarea::placeholder { color: var(--muted); }
th { background: var(--table-head); border-color: var(--border); }
td { border-color: var(--row-border); }
tr:hover td { background: var(--hover); }
.pill.gray { background: var(--pill-gray); color: var(--pill-gray-text); }
.dns-server-item { background: var(--table-head); border-left-color: #40505f; }
.details-body { background: var(--details); border-color: var(--border); box-shadow: 0 8px 25px var(--shadow); }
.muted, .check small { color: var(--muted); }
.progress { background: var(--secondary); }

.header-actions { display:flex; align-items:center; gap:10px; }
.theme-toggle {
  display:inline-flex; align-items:center; gap:7px; padding:7px 10px;
  background:var(--secondary); color:var(--text); border:1px solid var(--border);
  border-radius:8px; font-size:12px; font-weight:700;
}
.theme-toggle:hover { background:var(--secondary-hover); }
.theme-toggle span:first-child { font-size:15px; line-height:1; }

/* ===== Full-width results / no horizontal scrollbar on desktop ===== */
.results-panel { width:100%; }
.table-wrap { overflow-x: hidden; width:100%; }
table { width:100%; table-layout:fixed; }
th, td { white-space:normal; overflow-wrap:anywhere; word-break:break-word; vertical-align:middle; }
th { font-size:12px; }
td { font-size:12px; }
.domain { overflow-wrap:anywhere; }
.pill { white-space:nowrap; }
.dns-servers-cell { min-width:0; max-width:none; }
.dns-server-item { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.info-details { min-width:0; }
.info-details summary { overflow-wrap:anywhere; }
.details-body { max-width:min(420px, 90vw); }

/* Column proportions for the 15-column result table */
#resultsTable th:nth-child(1), #resultsTable td:nth-child(1) { width:9%; }
#resultsTable th:nth-child(2), #resultsTable td:nth-child(2) { width:6.5%; }
#resultsTable th:nth-child(3), #resultsTable td:nth-child(3) { width:5.5%; }
#resultsTable th:nth-child(4), #resultsTable td:nth-child(4) { width:8%; }
#resultsTable th:nth-child(5), #resultsTable td:nth-child(5) { width:4.5%; }
#resultsTable th:nth-child(6), #resultsTable td:nth-child(6) { width:6.5%; }
#resultsTable th:nth-child(7), #resultsTable td:nth-child(7) { width:7%; }
#resultsTable th:nth-child(8), #resultsTable td:nth-child(8) { width:7%; }
#resultsTable th:nth-child(9), #resultsTable td:nth-child(9) { width:8%; }
#resultsTable th:nth-child(10), #resultsTable td:nth-child(10) { width:6.5%; }
#resultsTable th:nth-child(11), #resultsTable td:nth-child(11) { width:5%; }
#resultsTable th:nth-child(12), #resultsTable td:nth-child(12) { width:5%; }
#resultsTable th:nth-child(13), #resultsTable td:nth-child(13) { width:5%; }
#resultsTable th:nth-child(14), #resultsTable td:nth-child(14) { width:5%; }
#resultsTable th:nth-child(15), #resultsTable td:nth-child(15) { width:6.5%; }

@media (max-width: 1200px) {
  .table-wrap { overflow-x:auto; }
  table { table-layout:auto; min-width:1250px; }
  th, td { white-space:nowrap; overflow-wrap:normal; word-break:normal; }
}

@media (max-width: 700px) {
  .header-actions { width:100%; justify-content:space-between; }
  .theme-toggle { margin-left:auto; }
}
