/* dig53 Zone Viewer */
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/instrument-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/instrument-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/instrument-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/instrument-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2'); }

:root {
  --paper: #EEF3F1;
  --surface: #FFFFFF;
  --ink: #15263D;
  --ink-2: #2B3D55;
  --muted: #5B6B7C;
  --line: #CAD5D0;
  --line-soft: #DFE7E3;
  --ok: #13855B;
  --ok-bg: #E2F3EB;
  --on: #C0392B;
  --on-bg: #FBE7E4;
  --warn: #A66A0D;
  --warn-bg: #FBF0DC;
  --term: #15263D;
  --term-text: #E4ECF2;
  --term-dim: #8FA3B8;
  --term-green: #3DD39A;
  --sans: 'Instrument Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --radius: 6px;
  --radius-lg: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
}
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ok); }
:focus-visible { outline: 2px solid var(--ok); outline-offset: 2px; }
code, kbd, .mono { font-family: var(--mono); font-size: 0.92em; }
h1, h2, h3 { line-height: 1.15; margin: 0; }

/* ---------- Barra superiore ---------- */
.topbar { display: flex; align-items: center; gap: 24px; padding: 18px 32px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 36px; height: 36px; display: block; }
.brand b { font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.brand span { color: var(--muted); font-weight: 500; font-size: 15px; margin-left: 4px; }
.topbar nav { margin-left: auto; display: flex; gap: 22px; align-items: center; font-size: 15px; }
.topbar nav a { text-decoration: none; color: var(--ink-2); }
.topbar nav a:hover { color: var(--ok); }
.topbar nav a.btn, .topbar nav a.btn:hover { color: #fff; }

/* ---------- Pulsanti e campi ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--sans); padding: 12px 18px; border-radius: var(--radius);
  border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--ink-2); color: #fff; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn.small { padding: 8px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=url], select, textarea {
  font: 400 15px/1.3 var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 11px; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(21, 38, 61, .12); }
label { font-size: 14px; color: var(--muted); }

/* ---------- Stati ---------- */
.pill { display: inline-block; font: 600 12.5px/1 var(--sans); padding: 5px 9px; border-radius: 99px; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.on { background: var(--on-bg); color: var(--on); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.err, .pill.muted { background: #E9EEF1; color: var(--muted); }
.st-ok { color: var(--ok); font-weight: 600; }
.st-bad { color: var(--on); font-weight: 600; }
.st-warn { color: var(--warn); font-weight: 600; }
.st-muted { color: var(--muted); }

/* =========================================================
   Pagina di presentazione
   ========================================================= */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center;
  max-width: 1180px; margin: 0 auto; padding: 56px 32px 72px;
}
.hero h1 { font-size: clamp(36px, 4.4vw, 56px); font-weight: 600; letter-spacing: -0.012em; line-height: 1.1; max-width: 13em; }
.hero p.lead { font-size: 19px; color: var(--ink-2); max-width: 32em; margin: 22px 0 30px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* il riquadro "dig" */
.dig {
  background: var(--term); color: var(--term-text); border-radius: var(--radius-lg);
  font: 400 14px/1.6 var(--mono); padding: 22px 24px 24px; min-height: 360px;
}
.dig form { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #2E4560; padding-bottom: 14px; margin-bottom: 14px; }
.dig .prompt { color: var(--term-green); user-select: none; }
.dig input {
  flex: 1; background: transparent; border: 0; color: #fff; font: 500 16px/1.4 var(--mono); padding: 6px 0; box-shadow: none;
}
.dig input:focus { box-shadow: none; }
.dig input::placeholder { color: var(--term-dim); }
.dig button {
  font: 600 13px/1 var(--sans); background: var(--term-green); color: var(--term); border: 0; border-radius: var(--radius);
  padding: 9px 13px; cursor: pointer;
}
.dig button:disabled { opacity: .6; }
.dig .out { white-space: pre-wrap; overflow-wrap: anywhere; }
.hero > * { min-width: 0; }
.dig .row { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; padding: 3px 0; }
.dig .k { color: var(--term-dim); }
.dig .v-ok { color: var(--term-green); font-weight: 700; }
.dig .v-on { color: #FF8A7A; font-weight: 700; }
.dig .v-warn { color: #F2C06B; }
.dig .note { color: var(--term-dim); margin-top: 14px; }
.dig .note a { color: var(--term-text); }
.dig .via { color: var(--term-dim); font-size: 12.5px; margin-top: 18px; }

.band { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; border-top: 1px solid var(--line); padding: 44px 0 56px; }
.facts h2 { font-size: 20px; font-weight: 650; margin-bottom: 10px; letter-spacing: -0.01em; }
.facts p { margin: 0; color: var(--ink-2); max-width: 30em; }

.steps { border-top: 1px solid var(--line); padding: 44px 0 64px; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 40px; }
.steps h2 { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; max-width: 11em; }
.steps ol { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.steps li::before { content: counter(s); font: 600 15px/1 var(--mono); color: var(--ok); padding-top: 4px; }
.steps li b { display: block; font-weight: 650; margin-bottom: 2px; }
.steps li span { color: var(--ink-2); }

.privacy { border-top: 1px solid var(--line); padding: 36px 0 56px; }
.privacy h2 { font-size: 20px; font-weight: 650; margin-bottom: 10px; }
.privacy p { margin: 0; color: var(--ink-2); max-width: 46em; }

footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer.site .band { display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap; padding-top: 22px; padding-bottom: 28px; }
footer.site p { margin: 0; max-width: 60em; }

/* =========================================================
   Applicazione
   ========================================================= */
body.app { font-size: 15px; }
.app .topbar { padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.servers { margin-left: auto; display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; }
.server { display: grid; gap: 4px; }
.server .pair { display: flex; gap: 6px; }
.server select { width: 190px; }
.server input { width: 260px; }
.server input[hidden] { display: none; }

.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - 70px); }
.side { border-right: 1px solid var(--line); background: #F6F9F8; padding: 18px 18px 24px; display: flex; flex-direction: column; gap: 22px; }
.side h2 { font-size: 15px; font-weight: 650; margin-bottom: 8px; }
.side .field { display: grid; gap: 5px; margin-bottom: 10px; }
.side .hint { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.drop {
  display: block;
  border: 1.5px dashed var(--line); border-radius: var(--radius-lg); padding: 18px 14px; text-align: center; color: var(--muted);
  font-size: 14px; background: var(--surface); cursor: pointer;
}
.drop.over { border-color: var(--ok); background: var(--ok-bg); color: var(--ink); }
.zones { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.zones button {
  width: 100%; text-align: left; background: transparent; border: 0; border-radius: var(--radius); padding: 9px 10px; cursor: pointer;
  font: inherit; color: var(--ink); display: grid; gap: 3px;
}
.zones button:hover { background: #E8EFEC; }
.zones button[aria-current="true"] { background: var(--surface); box-shadow: inset 3px 0 0 var(--ink); }
.zones .zn { font-weight: 650; }
.zones .zs { font-size: 12.5px; color: var(--muted); }
.zones .zd { font-size: 12.5px; font-weight: 600; }
.zones .zd.ok { color: var(--ok); } .zones .zd.on { color: var(--on); } .zones .zd.err { color: var(--muted); }

.main { padding: 20px 24px 28px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.empty { max-width: 44em; padding: 40px 0; color: var(--ink-2); }
.empty h1 { font-size: 26px; font-weight: 650; margin-bottom: 10px; letter-spacing: -0.01em; }

.zonehead { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.zonehead h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.01em; }
.zonehead .meta { color: var(--muted); font-size: 14px; }

.panels { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; }
.panel h2 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.panel .verdict { margin: 0 0 8px; }
.panel ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.panel ul li { margin: 2px 0; }
.mail { display: grid; grid-template-columns: 4.5em 1fr; gap: 6px 12px; font-size: 14px; }
.mail dt { font-weight: 650; }
.mail dd { margin: 0; overflow-wrap: anywhere; display: flex; gap: 8px; align-items: baseline; }
.mail dd::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--line); transform: translateY(-1px); }
.mail dd.st-ok::before { background: var(--ok); } .mail dd.st-bad::before { background: var(--on); } .mail dd.st-warn::before { background: var(--warn); }
.mail dd.st-ok, .mail dd.st-bad, .mail dd.st-warn { color: var(--ink); font-weight: 400; }
.notes { margin: 0; padding: 10px 14px; background: var(--warn-bg); color: #6B4508; border-radius: var(--radius); font-size: 14px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input[type=text] { width: 220px; }
.toolbar .count { margin-left: auto; color: var(--muted); font-size: 14px; }

.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: auto; max-height: 62vh; }
table.recs { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.recs th { position: sticky; top: 0; background: #F6F9F8; text-align: left; font-weight: 650; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.recs td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.recs tr:hover td { background: #F7FAF9; }
.recs tr[aria-selected="true"] td { background: #EAF2EE; }
.recs td.data, .recs td.res { font-family: var(--mono); font-size: 12.5px; max-width: 360px; overflow-wrap: anywhere; }
.recs td.type { font-weight: 650; }
.recs td.ttl { white-space: nowrap; }
.recs .colB[hidden] { display: none; }

.detail { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 18px; font-size: 14px; }
.detail pre { font: 12.5px/1.55 var(--mono); background: #F6F9F8; border-radius: var(--radius); padding: 10px 12px; overflow: auto; margin: 8px 0 0; white-space: pre-wrap; }
.status { font-size: 14px; color: var(--muted); min-height: 1.4em; }
.error { color: var(--on); }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 28px; }
  .facts, .steps { grid-template-columns: 1fr; gap: 26px; }
  .layout { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .panels { grid-template-columns: 1fr; }
  .servers { margin-left: 0; }
  .app .topbar { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .topbar { padding: 14px 18px; }
  .topbar nav { gap: 14px; }
  .topbar nav a:not(.btn), .brand span { display: none; }
  .server, .server .pair { width: 100%; }
  .server select { width: 46%; flex: none; }
  .server input { flex: 1; }
  .hero, .band { padding-left: 18px; padding-right: 18px; }
  .dig { padding: 16px; font-size: 13px; }
  .dig .row { grid-template-columns: 6em 1fr; }
  .server input { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.flush { margin: 0; }
.mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }

/* Logo dig53.net */
.brand img.logo { width: auto; height: 64px; }
.app .brand img.logo { height: 48px; }
@media (max-width: 560px) { .brand img.logo { height: 40px; } .app .brand img.logo { height: 34px; } }
