/* /nastroje — free public tools (index, check, view). Tokens from base.css only; the invoice sheet is doklad.css.
   The memorable element: the drop zone drawn as a sheet with a dashed tear-off edge, and a verdict that reads like a
   stamp in the margin — problems first, what passed folded (DESIGN.md → principle 2). */

.nt-top, .nt, .content > .foot { max-width: 1120px; margin-inline: auto; }
.nt-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap;
  padding: var(--s-5) var(--s-6) 0; }
.nt-top .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; text-decoration: none; }
.nt-top .brand svg { width: 28px; height: 28px; color: var(--stamp); }
.nt-nav { display: flex; gap: var(--s-4); }
.nt-nav a { color: var(--ink-2); font-size: var(--f-13); text-decoration: none; }
.nt-nav a:hover { color: var(--stamp); text-decoration: underline; }
.nt { padding: 0 var(--s-6) var(--s-8); }

.nt-hero { padding: var(--s-7) 0 var(--s-5); max-width: 760px; }
.nt-hero h1 { font-size: var(--f-41); line-height: 48px; letter-spacing: -0.02em; }
.nt .lead { margin: var(--s-4) 0 var(--s-5); font-size: var(--f-17); line-height: 28px; color: var(--ink-2); max-width: 62ch; }

/* ── the drop zone ─────────────────────────────────────────────────────── */
.nt-drop { position: relative; display: grid; justify-items: center; gap: var(--s-1); padding: var(--s-6) var(--s-5);
  background: var(--sheet); border: 1.5px dashed var(--control); border-radius: var(--r-ctl); cursor: pointer;
  text-align: center; transition: border-color .12s, background .12s; }
.nt-drop:hover { border-color: var(--stamp); }
.nt-drop:focus-within { border-color: var(--stamp); box-shadow: var(--focus); }
.nt-drop.over { border-style: solid; border-color: var(--stamp); background: var(--stamp-wash); }
.nt-drop-ico { width: 40px; height: 40px; color: var(--stamp); margin-bottom: var(--s-2); }
.nt-drop-main { font-size: var(--f-17); font-weight: 600; }
.nt-drop-sub { color: var(--ink-2); font-size: var(--f-13); }
.nt-drop-sub u { color: var(--stamp); text-underline-offset: 3px; }
.nt-drop-file { margin-top: var(--s-2); font-weight: 550; color: var(--ink); overflow-wrap: anywhere; }
/* the real input stays in the tab order (keyboard, screen readers) but is drawn by the label */
.nt-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.nt-form-row { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-3); }
.js .nt-form-row #go { display: none; }
.nt-form #err:empty { display: none; }
.nt-privacy { display: flex; gap: var(--s-2); align-items: flex-start; margin: var(--s-3) 0 0; font-size: var(--f-13);
  color: var(--ink-2); }
.nt-privacy svg { width: 18px; height: 18px; flex: none; margin-top: 3px; color: var(--ok); }
.nt-other { margin-top: var(--s-4); font-size: var(--f-13); color: var(--ink-2); }

/* ── waiting ───────────────────────────────────────────────────────────── */
.nt-wait { display: flex; align-items: center; gap: var(--s-3); max-width: 760px; padding: var(--s-4) 0; color: var(--ink-2); }
.nt-dots { display: inline-flex; gap: 4px; }
.nt-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--stamp); animation: nt-dot 1s infinite ease-in-out; }
.nt-dots i:nth-child(2) { animation-delay: .15s; } .nt-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes nt-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nt-dots i { animation: none; opacity: .7; } }

/* ── result ────────────────────────────────────────────────────────────── */
.nt-out:empty { display: none; }
.nt-result { display: grid; gap: var(--s-5); padding-top: var(--s-4); scroll-margin-top: var(--s-5); }
.nt-verdict { display: grid; grid-template-columns: 48px 1fr; gap: var(--s-4); align-items: start; max-width: 820px;
  padding: var(--s-5); border-radius: var(--r-ctl); border-left: 4px solid currentColor; }
.nt-verdict h2 { font-size: var(--f-26); line-height: 32px; color: var(--ink); }
.nt-verdict h2:focus { outline: none; }
.nt-verdict p { margin: var(--s-2) 0 0; color: var(--ink); }
.nt-verdict-ico svg { width: 40px; height: 40px; }
.nt-verdict.nt-ok { color: var(--ok); background: var(--ok-wash); }
.nt-verdict.nt-warn { color: var(--warn); background: var(--warn-wash); }
.nt-verdict.nt-bad { color: var(--bad); background: var(--bad-wash); }
.nt-doc-line { color: var(--ink-2) !important; font-size: var(--f-13); }
.nt-file { overflow-wrap: anywhere; }
.nt-h2 { font-size: var(--f-21); line-height: 28px; margin-bottom: var(--s-3); }

.nt-report { display: grid; max-width: 820px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-ctl); }
.nt-sec { padding: var(--s-4) var(--s-5); border-top: 1px solid var(--rule); }
.nt-sec:first-child { border-top: 0; }
.nt-sec h3, .nt-sec > summary { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; font-size: var(--f-17); }
.nt-sec > summary { cursor: pointer; list-style: none; font-weight: 600; }
.nt-sec > summary::-webkit-details-marker { display: none; }
.nt-sec > summary::after { content: ""; width: 8px; height: 8px; margin-left: auto; border: solid var(--ink-2);
  border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform .12s; }
.nt-sec[open] > summary::after { transform: rotate(-135deg); }
.nt-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--ink-2); color: var(--ink-2); font-size: var(--f-13); font-weight: 650; font-variant-numeric: tabular-nums; }
.nt-sec-problem .nt-num { border-color: var(--ink); color: var(--ink); }
.nt-sec-name { min-width: 0; }
.nt-hint { margin: var(--s-1) 0 var(--s-2) 36px; font-size: var(--f-13); color: var(--ink-2); }
.nt-checks { margin-left: 36px; }
.nt-sec details.passed { margin-left: 36px; }
.nt-sec details.passed .nt-checks { margin-left: 0; }
.nt-checks li { grid-template-columns: 20px 1fr; }
.nt-checks li > div { min-width: 0; }
.nt-label { margin: 0; color: var(--ink); font-weight: 550; overflow-wrap: anywhere; }
.nt-checks li.ok .nt-label { font-weight: 400; }
.nt-rule { display: inline-block; margin-left: var(--s-2); padding: 0 6px; border-radius: 4px; font-size: 12px;
  font-weight: 500; line-height: 20px; color: var(--ink-2); background: color-mix(in srgb, var(--rule) 55%, transparent);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.nt-count { color: var(--ink-2); font-weight: 400; }
.nt-why { margin: 2px 0 0; color: var(--ink-2); font-size: var(--f-15); }
.nt-orig { margin-top: var(--s-1); font-size: var(--f-13); color: var(--ink-2); }
.nt-orig summary { cursor: pointer; width: fit-content; }
.nt-orig p { margin: var(--s-1) 0; }
.nt-orig code { display: block; padding: var(--s-1) var(--s-2); border-radius: 4px; background: var(--paper);
  font: 12px/18px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }

.nt-doc-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
  max-width: 820px; margin-top: var(--s-4); }
.nt-doc-head .nt-h2 { margin: 0; }
.nt-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.nt-actions .btn svg { width: 18px; height: 18px; }
.nt-view-head { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.nt-view-head h2 { font-size: var(--f-26); line-height: 32px; }
.nt-view-head h2:focus { outline: none; }
.nt-fold { max-width: 820px; }
.nt-fold > summary { cursor: pointer; font-weight: 600; padding: var(--s-2) 0; width: fit-content; }
.nt-fold > .muted { margin: var(--s-1) 0 var(--s-3); }
.nt-disclaimer { font-size: var(--f-13); color: var(--ink-2); max-width: 820px; }

/* ── explainer under the form ──────────────────────────────────────────── */
.nt-facts { max-width: 760px; margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--rule); }
.nt-facts h2 { margin-bottom: var(--s-3); }
.nt-facts ol, .nt-facts ul { margin: 0; padding-left: 1.3em; display: grid; gap: var(--s-2); color: var(--ink-2); }
.nt-facts b { color: var(--ink); font-weight: 600; }

/* ── index ─────────────────────────────────────────────────────────────── */
.nt-cards { list-style: none; margin: 0 0 var(--s-5); padding: 0; display: grid; gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.nt-card { display: grid; gap: var(--s-2); height: 100%; padding: var(--s-5); background: var(--sheet); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--r-ctl); text-decoration: none; }
.nt-card:hover { border-color: var(--stamp); }
.nt-card:hover .nt-card-name { color: var(--stamp); }
.nt-card-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-ctl);
  background: var(--stamp-wash); color: var(--stamp); }
.nt-card-ico svg { width: 22px; height: 22px; }
.nt-card-name { font-size: var(--f-17); font-weight: 650; }
.nt-card-text { color: var(--ink-2); font-size: var(--f-15); }

@media (max-width: 767px) {
  .nt-top { padding: var(--s-4) var(--s-4) 0; }
  .nt { padding: 0 var(--s-4) var(--s-7); }
  .nt-hero { padding: var(--s-5) 0 var(--s-4); }
  .nt-hero h1 { font-size: var(--f-33); line-height: 40px; }
  .nt-drop { padding: var(--s-5) var(--s-4); }
  .nt-verdict { grid-template-columns: 1fr; gap: var(--s-2); padding: var(--s-4); }
  .nt-verdict h2 { font-size: var(--f-21); line-height: 28px; }
  .nt-sec { padding: var(--s-3) var(--s-4); }
  .nt-hint, .nt-checks, .nt-sec details.passed { margin-left: 0; }
  .nt-rule { margin-left: 0; display: table; margin-top: 2px; }
}

@media print {
  .nt-top, .nt-hero, .nt-wait, .nt-facts, .nt-verdict, .nt-report-wrap, .nt-doc-head, .nt-actions, .nt-fold,
  .nt-view-head, .nt-disclaimer { display: none !important; }
  .nt { padding: 0 !important; max-width: none; }
  .nt-result { padding: 0; display: block; }
}

/* ── touch ─────────────────────────────────────────────────────────── */
@media (pointer: coarse) {
  .nt-nav { gap: 0 var(--s-2); }
  .nt-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-2); font-size: var(--f-15); }
  .nt-sec > summary { min-height: 48px; }
  .nt-orig summary { padding-block: 10px; }
  .nt-fold > summary { padding-block: 10px; }
}
