*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #143452;
  --primary-dark: #0e2540;
  --accent:       #87b50d;
  --accent-dark:  #6a8e0a;
  --text:         #3b3d40;
  --text-light:   #90816e;
  --bg:           rgba(124,131,245,.08);
  --bg-card:      #ffffff;
  --bg-header:    #f8fafc;
  --border:       #dfe7eb;
  --shadow:       0 2px 12px rgba(20,52,82,.08);
  --radius:       8px;
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── header ── */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 0 1.5rem;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  color: #fff;
}
.header-logo svg { flex-shrink: 0; }
.header-logo-text { font-size: 1.1rem; font-weight: 700; letter-spacing: .01em; }
.header-logo-sub  { font-size: .75rem; opacity: .75; }

.lang-switch {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .75rem;
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
  white-space: nowrap;
}
.lang-switch:hover { background: rgba(255,255,255,.22); }

/* ── hero / search ── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #1e4d7a 100%);
  color: #fff;
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}
.hero h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 700; margin-bottom: .5rem; }
.hero p  { opacity: .8; font-size: .95rem; margin-bottom: 2rem; }

.search-box {
  display: flex;
  gap: .5rem;
  max-width: 560px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.search-box input {
  flex: 1 1 260px;
  padding: .75rem 1rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  transition: border-color .2s;
}
.search-box input:focus { border-color: var(--accent); }
.search-box button {
  padding: .75rem 1.6rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.search-box button:hover { background: var(--accent-dark); }

/* ── main container ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ── error / notice ── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.alert-error { background: #fdecea; border-left: 4px solid #cf2e2e; color: #6b1616; }
.alert-icon  { font-size: 1.2rem; }

/* ── section cards ── */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.section-card-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.section-card-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: .01em;
}
.section-card-header .icon {
  width: 28px; height: 28px;
  background: var(--primary);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.section-card-header .icon svg { color: #fff; }
.section-card-body { padding: 1.25rem; }

/* ── raw-data button ── */
.btn-raw {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .75rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.btn-raw:hover { background: var(--primary-dark); }

.raw-pre {
  background: #1e2a35;
  color: #c8d8e4;
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  overflow-y: auto;
  font-size: .78rem;
  line-height: 1.55;
  white-space: pre;
  font-family: 'Courier New', monospace;
  max-height: 600px;
}

/* ── key-value grid ── */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem 1.5rem;
}
.kv-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-light);
  margin-bottom: .2rem;
  font-weight: 600;
}
.kv-value {
  font-size: .95rem;
  color: var(--text);
  word-break: break-word;
}
.kv-value a { color: var(--primary); text-decoration: none; }
.kv-value a:hover { text-decoration: underline; }

/* ── status badges ── */
.badge-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .65rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
}
.badge-active   { background: #eaf4d0; color: #4a7a08; border: 1px solid #c0de7a; }
.badge-inactive { background: #fdecea; color: #8b1a1a; border: 1px solid #f0b0b0; }
.badge-warn     { background: #fff8e1; color: #7a5800; border: 1px solid #ffe082; }
.badge-default  { background: #eef6fa; color: var(--primary); border: 1px solid #c9dfe9; }

/* ── nameserver list ── */
.ns-list { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.ns-item {
  background: var(--bg-header);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .4rem .9rem;
  font-size: .88rem;
  font-family: 'Courier New', monospace;
  color: var(--primary);
  font-weight: 600;
}

/* ── contacts grid ── */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.contact-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.contact-role {
  background: var(--primary);
  color: #fff;
  padding: .45rem .85rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.contact-body { padding: .85rem; }
.contact-name { font-weight: 700; font-size: .95rem; margin-bottom: .45rem; }
.contact-detail {
  font-size: .83rem;
  color: var(--text-light);
  margin-bottom: .2rem;
  display: flex;
  gap: .4rem;
  align-items: flex-start;
}
.contact-detail .cd-icon { flex-shrink: 0; width: 14px; margin-top: .1rem; opacity: .6; }
.contact-detail a { color: var(--primary); text-decoration: none; }
.contact-detail a:hover { text-decoration: underline; }
.contact-url-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  background: var(--bg-header);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none !important;
  transition: background .15s, border-color .15s;
}
.contact-url-btn:hover { background: #dceef7; border-color: #a8c8dc; text-decoration: none !important; }
.contact-handle {
  display: inline-block;
  margin-top: .5rem;
  font-size: .72rem;
  background: var(--bg-header);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .15rem .5rem;
  color: var(--text-light);
  font-family: monospace;
}

/* ── secure DNS ── */
.dnssec-yes { color: #4a7a08; font-weight: 600; }
.dnssec-no  { color: var(--text-light); }

/* ── divider ── */
.divider { height: 1px; background: var(--border); margin: 1rem 0; }
.kv-status-label { margin-bottom: .5rem; }

/* ── footer ── */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.6);
  padding: 1.25rem 1.5rem;
  font-size: .8rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.site-footer a { color: rgba(255,255,255,.8); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .kv-grid { grid-template-columns: 1fr 1fr; }
  .contacts-grid { grid-template-columns: 1fr; }
  .search-box { flex-direction: column; }
  .search-box input, .search-box button { width: 100%; }
  .footer-inner { flex-direction: column; align-items: center; text-align: center; }
  .footer-nav { justify-content: center; gap: .75rem; }
}
