:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #ebe8e2;
  --text: #1d1f1e;
  --muted: #66696a;
  --line: #dcd8d0;
  --accent: #2f6f5e;
  --accent-soft: #dcebe5;
  --ok: #2e8b57;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121514;
    --surface: #1a1e1d;
    --surface-2: #232827;
    --text: #e8ebe9;
    --muted: #949b98;
    --line: #2c3230;
    --accent: #6cc3a6;
    --accent-soft: #1f3530;
    --ok: #5fd08f;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --bg: #121514;
  --surface: #1a1e1d;
  --surface-2: #232827;
  --text: #e8ebe9;
  --muted: #949b98;
  --line: #2c3230;
  --accent: #6cc3a6;
  --accent-soft: #1f3530;
  --ok: #5fd08f;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

header { padding: 56px 0 32px; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--accent); color: var(--bg);
  display: grid; place-items: center;
  font-weight: 800; font-size: 24px;
}
h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.tagline { margin: 4px 0 0; color: var(--muted); }
.toolbar { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.search {
  flex: 1 1 260px; min-width: 0;
  padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit;
}
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.theme-btn {
  padding: 0 14px; height: 46px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; cursor: pointer;
}

section { margin: 28px 0 40px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.count { font-size: 13px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

.card {
  position: relative;
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: inherit; text-decoration: none;
  transition: border-color .15s, transform .15s;
}
a.card:hover, a.card:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; }
.icon {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--accent);
}
.icon img { width: 28px; height: 28px; object-fit: contain; }
.icon svg { width: 24px; height: 24px; }
.body { min-width: 0; flex: 1; }
.name { font-weight: 650; margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.desc { margin: 2px 0 6px; color: var(--muted); font-size: 14px; }
.host { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--accent); overflow-wrap: anywhere; }
.badge {
  font-size: 11px; font-weight: 600; letter-spacing: .03em;
  padding: 2px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}

/* lignes copiables (DNS, NTP) */
.rows { display: grid; gap: 6px; margin-top: 8px; }
.row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 10px; border-radius: 8px; background: var(--surface-2);
}
.row .lbl { font-size: 11px; font-weight: 700; color: var(--muted); min-width: 34px; }
.row code { flex: 1; min-width: 0; font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.copy {
  flex: 0 0 auto; border: 0; cursor: pointer; font: inherit; font-size: 12px;
  padding: 4px 9px; border-radius: 6px; background: var(--surface); color: var(--text);
}
.copy:hover { color: var(--accent); }
.copy.done { color: var(--ok); }

.wide { grid-column: 1 / -1; }

/* schéma NTP */
.ntp-tree { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.stratum { font-size: 12px; color: var(--muted); margin: 0 0 8px; }

.empty { display: none; color: var(--muted); padding: 24px 0; }
.hidden { display: none !important; }

footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14px; }

@media (max-width: 520px) {
  header { padding-top: 32px; }
  h1 { font-size: 24px; }
}
