/* ============================================================
   Il Matto Debugging Guide — ivanling.com (VainOS 2.0 theme)
   Builds on /css/vainos2.css tokens: --bg, --accent, --accent-2,
   --accent-3, --warn, --glass, --glass-light, --border,
   --border-strong, --text, --text-dim, --font, --mono.
   ============================================================ */

:root {
  --ok: #6fe3a0;
  --ok-soft: rgba(111, 227, 160, 0.12);
  --warn-soft: rgba(255, 209, 102, 0.12);
  --accent-soft: rgba(77, 243, 195, 0.12);
  --hl: rgba(255, 209, 102, 0.28);
  --code-bg: rgba(6, 14, 22, 0.75);
}

html, body.ilm {
  height: auto;
  min-height: 100vh;
  overflow: auto;
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}
body.ilm {
  background: var(--bg);
  background-image:
    radial-gradient(1100px 700px at 72% 90%, rgba(77, 243, 195, 0.05), transparent 60%),
    radial-gradient(900px 650px at 18% 8%, rgba(122, 162, 255, 0.06), transparent 55%),
    radial-gradient(700px 500px at 88% 12%, rgba(182, 107, 255, 0.04), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}
.ilm ::selection { background: rgba(77, 243, 195, 0.3); }

/* scanline overlay, like the OS shell */
.ilm .scan {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.016) 0 1px, transparent 1px 3px);
}

.ilm a { color: var(--accent-2); text-decoration: none; }
.ilm a:hover { text-decoration: underline; }
.ilm code, .ilm kbd, .ilm pre { font-family: var(--mono); font-size: 0.9em; }
.ilm code {
  background: var(--glass-light); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px; color: #d9f7ee;
}
.ilm mark { background: var(--hl); color: #fff3cc; padding: 0 3px; border-radius: 3px; }
.ilm button { font-family: inherit; }

/* ---------- top bar ---------- */
.ilm .topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.ilm .topbar .in {
  max-width: 1040px; margin: 0 auto; padding: 10px 20px;
  display: flex; gap: 14px; align-items: center;
}
.ilm .brand {
  font-family: var(--mono); font-weight: 700; font-size: 13px; letter-spacing: 0.12em;
  white-space: nowrap; color: var(--text); text-decoration: none;
}
.ilm .brand:hover { text-decoration: none; }
.ilm .brand .glyph { color: var(--accent); margin-right: 8px; text-shadow: 0 0 14px rgba(77,243,195,0.6); }
.ilm .brand .dim { color: var(--text-dim); font-weight: 400; }
.ilm .topnav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.ilm .topnav::-webkit-scrollbar { display: none; }
.ilm .topnav a {
  white-space: nowrap; color: var(--text-dim); padding: 5px 11px; border-radius: 999px;
  font-size: 13px; font-family: var(--mono); letter-spacing: 0.02em; border: 1px solid transparent;
}
.ilm .topnav a:hover, .ilm .topnav a.active {
  color: var(--accent); background: var(--accent-soft); border-color: var(--border); text-decoration: none;
}
.ilm .home {
  font-family: var(--mono); font-size: 12px; color: var(--text-dim); white-space: nowrap;
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px;
}
.ilm .home:hover { color: var(--accent); border-color: var(--border-strong); text-decoration: none; }

/* ---------- layout ---------- */
.ilm main { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto; padding: 36px 20px 90px; }

.ilm .kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; color: var(--accent);
  text-transform: uppercase; margin-bottom: 12px; display: flex; align-items: center; gap: 10px;
}
.ilm .kicker::before { content: ""; width: 26px; height: 1px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.ilm h1 {
  font-size: clamp(30px, 4.6vw, 44px); line-height: 1.12; letter-spacing: -0.015em; font-weight: 800;
  margin: 0 0 12px;
  background: linear-gradient(125deg, #fff 25%, var(--accent-2) 65%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ilm .lede { color: #c2d2da; margin: 0 0 8px; max-width: 68ch; font-size: 17px; }
.ilm .meta {
  font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin: 0 0 28px;
  display: flex; flex-wrap: wrap; gap: 6px 18px;
}
.ilm .meta b { color: var(--accent-2); font-weight: 500; }

.ilm h2 {
  font-family: var(--font); font-size: 23px; line-height: 1.3; letter-spacing: -0.01em;
  color: var(--text); font-weight: 700; margin: 10px 0 6px;
}
.ilm h3 { font-size: 17px; margin: 24px 0 8px; color: var(--text); }

/* ---------- symptoms ---------- */
.ilm .search { position: relative; margin: 0 0 14px; }
.ilm .search input {
  width: 100%; padding: 13px 14px 13px 42px; font-size: 16px; font-family: var(--font);
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--glass); color: var(--text); outline: none;
  box-shadow: 0 0 0 0 rgba(77,243,195,0); transition: box-shadow 0.2s;
}
.ilm .search input::placeholder { color: var(--text-dim); }
.ilm .search input:focus { box-shadow: 0 0 0 3px rgba(77,243,195,0.18), 0 0 24px rgba(77,243,195,0.12); }
.ilm .search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--accent); }
.ilm .symgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.ilm .sym {
  display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none;
  background: var(--glass-light); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 12px 14px;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.ilm .sym:hover, .ilm .sym:focus-visible {
  transform: translateY(-2px); border-color: var(--border-strong); text-decoration: none; outline: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35), 0 0 20px rgba(77,243,195,0.08);
}
.ilm .sym .q { font-weight: 600; line-height: 1.35; font-size: 15px; }
.ilm .sym .go { font-size: 12px; font-family: var(--mono); color: var(--text-dim); }
.ilm .sym .go b { color: var(--accent); font-weight: 700; }
.ilm .empty { display: none; color: var(--text-dim); padding: 12px 2px; }

/* ---------- panels ---------- */
.ilm .panel {
  background: var(--glass); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px; margin: 28px 0; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  transition: box-shadow 0.4s, border-color 0.4s;
}
.ilm .panel::before, .ilm .panel::after {
  content: ""; position: absolute; width: 12px; height: 12px; border-color: var(--border-strong); border-style: solid; pointer-events: none;
}
.ilm .panel::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; border-top-left-radius: 14px; }
.ilm .panel::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; border-bottom-right-radius: 14px; }
.ilm .panel.flash { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(77,243,195,0.18), 0 0 40px rgba(77,243,195,0.15); }

.ilm .wizard h2 { font-size: 18px; margin: 0 0 4px; }
.ilm .wizard .wq { font-weight: 600; margin: 10px 0; }
.ilm .wizard .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ilm .btn {
  border: 1px solid var(--border-strong); background: var(--glass-light); color: var(--text);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; display: inline-block; font-family: var(--font);
  transition: border-color 0.12s, background 0.12s;
}
.ilm .btn:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.ilm .btn.primary { background: var(--accent); border-color: var(--accent); color: #04110d; font-weight: 600; }
.ilm .btn.primary:hover { background: #6ff7d0; }
.ilm .btn.small { padding: 4px 10px; font-size: 12px; font-family: var(--mono); }
.ilm .trail { margin-top: 10px; }

.ilm .tag {
  display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--border); padding: 2px 9px; border-radius: 999px;
}
.ilm .symline { color: var(--text-dim); font-style: italic; margin: 0 0 14px; }
.ilm .backtop { font-family: var(--mono); font-size: 12px; float: right; color: var(--text-dim); }
.ilm .backtop:hover { color: var(--accent); text-decoration: none; }

/* ---------- steps ---------- */
.ilm ol.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.ilm ol.steps > li { counter-increment: s; position: relative; padding: 12px 0 12px 46px; border-top: 1px dashed var(--border); }
.ilm ol.steps > li:first-child { border-top: 0; }
.ilm ol.steps > li::before {
  content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 12px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); border: 1px solid var(--border-strong); color: var(--accent);
  font-family: var(--mono); font-weight: 700; font-size: 12px; display: grid; place-items: center;
}
.ilm ol.steps > li.done::before { content: "✓"; background: var(--ok-soft); border-color: rgba(111,227,160,0.4); color: var(--ok); }
.ilm ol.steps > li.done > .body { opacity: 0.55; }
.ilm .check {
  float: right; margin-left: 10px; font-size: 12px; font-family: var(--mono); color: var(--text-dim);
  display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
}
.ilm .check input { width: 15px; height: 15px; accent-color: var(--accent); }
.ilm ul.sub { margin: 6px 0 0; padding-left: 20px; }
.ilm ul.sub li { margin: 5px 0; }

.ilm figure { margin: 12px 0; text-align: center; }
.ilm figure img {
  max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border-strong);
  cursor: zoom-in; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.ilm figure.narrow img { max-width: 340px; width: 100%; }
.ilm figcaption { font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin-top: 6px; }

.ilm .note { border-left: 3px solid var(--warn); background: var(--warn-soft); padding: 10px 14px; border-radius: 6px; margin: 12px 0; }
.ilm .tip { border-left: 3px solid var(--ok); background: var(--ok-soft); padding: 10px 14px; border-radius: 6px; margin: 12px 0; }
.ilm .ok { color: var(--ok); }
.ilm .related { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; }
.ilm .related b { display: block; margin-bottom: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--text-dim); text-transform: uppercase; }
.ilm .related a {
  display: inline-block; margin: 0 6px 6px 0; padding: 4px 11px; border: 1px solid var(--border); border-radius: 999px; color: var(--text);
}
.ilm .related a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.ilm details { border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; margin: 12px 0; background: var(--glass-light); }
.ilm details summary { cursor: pointer; font-weight: 600; color: var(--accent-2); }
.ilm details[open] summary { margin-bottom: 6px; }

.ilm .cmd {
  display: flex; align-items: stretch; margin: 8px 0; border: 1px solid var(--border-strong); border-radius: 8px;
  overflow: hidden; background: var(--code-bg);
}
.ilm .cmd pre { margin: 0; padding: 9px 14px; overflow-x: auto; flex: 1; white-space: pre; color: #d9f7ee; }
.ilm .cmd pre::before { content: "$ "; color: var(--accent); }
.ilm .cmd button {
  border: 0; border-left: 1px solid var(--border); background: transparent; color: var(--text-dim);
  cursor: pointer; padding: 0 14px; font-size: 12px; font-family: var(--mono);
}
.ilm .cmd button:hover { color: var(--accent); background: var(--accent-soft); }

.ilm .tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-top: 8px; }
.ilm .tabs button {
  border: 1px solid transparent; border-bottom: 0; background: transparent; color: var(--text-dim);
  padding: 7px 14px; cursor: pointer; border-radius: 8px 8px 0 0; font-size: 14px; font-family: var(--mono);
}
.ilm .tabs button[aria-selected="true"] { background: var(--glass-light); border-color: var(--border); color: var(--accent); margin-bottom: -1px; }
.ilm .tabpanel { padding: 12px 0 0; }
.ilm .tabpanel[hidden] { display: none; }
.ilm .muted { color: var(--text-dim); }

.ilm table.ref { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ilm table.ref th, .ilm table.ref td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ilm table.ref th { font-family: var(--mono); font-size: 11px; color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500; }
.ilm .tablewrap { overflow-x: auto; }

/* ---------- lightbox / fab / footer ---------- */
.ilm .lb { position: fixed; inset: 0; background: rgba(1,2,6,0.9); display: none; place-items: center; z-index: 50; padding: 16px; cursor: zoom-out; }
.ilm .lb.open { display: grid; }
.ilm .lb img { max-width: 100%; max-height: 92vh; border-radius: 8px; background: #fff; box-shadow: 0 0 60px rgba(77,243,195,0.2); }

.ilm .fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 30; background: var(--accent); color: #04110d; border: 0; border-radius: 999px;
  padding: 10px 16px; font-weight: 600; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,0.45), 0 0 24px rgba(77,243,195,0.3);
  opacity: 0; pointer-events: none; transition: opacity 0.2s; text-decoration: none;
}
.ilm .fab:hover { text-decoration: none; background: #6ff7d0; }
.ilm .fab.show { opacity: 1; pointer-events: auto; }

.ilm footer {
  color: var(--text-dim); font-family: var(--mono); font-size: 12px; text-align: center; margin-top: 48px;
  border-top: 1px solid var(--border); padding-top: 20px; letter-spacing: 0.04em;
}
.ilm footer a { color: var(--accent); }

@media (max-width: 640px) {
  .ilm .panel { padding: 16px; }
  .ilm .brand .long { display: none; }
  .ilm .check .lbl { display: none; }
  .ilm .home { display: none; }
}
@media print {
  .ilm .topbar, .ilm .search, .ilm .wizard, .ilm .fab, .ilm .check, .ilm .backtop, .ilm .scan, .ilm #symptoms .symgrid { display: none !important; }
  body.ilm { background: #fff; color: #000; }
  .ilm .panel { box-shadow: none; break-inside: avoid-page; border-color: #999; }
  .ilm details { display: block; } .ilm details > * { display: block; }
}
