/* InnovaticT Community: docs-style gallery. Light first, dark supported. */
:root {
  --bg: #f7f8fa; --surface: #ffffff; --surface-2: #f1f3f6; --line: #e3e6eb; --line-2: #cfd4dc;
  --text: #121821; --text-2: #4a5462; --text-3: #6b7583; --brand: #0b6fd6; --brand-2: #0a5bb0; --brand-bg: #e8f1fc;
  --lime: #3f7d0e; --lime-bg: #eef7e4; --warn: #a15c00; --warn-bg: #fff4e0; --bad: #c42b1c; --bad-bg: #fde7e9;
  --code-bg: #0f1520; --code-fg: #e6edf3; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px -12px rgba(16,24,40,.12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; --maxw: 1200px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0b0f15; --surface: #121821; --surface-2: #18202b; --line: #232c38; --line-2: #313c4b;
  --text: #eef2f7; --text-2: #b4bdc9; --text-3: #8892a0; --brand: #4aa3ff; --brand-2: #6cb5ff; --brand-bg: #10243a;
  --lime: #9bd83a; --lime-bg: #1a2a10; --warn: #ffc14d; --warn-bg: #2b2210; --bad: #ff7b72; --bad-bg: #2d1414;
  --code-bg: #0a0e14; --code-fg: #e6edf3; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0b0f15; --surface: #121821; --surface-2: #18202b; --line: #232c38; --line-2: #313c4b;
  --text: #eef2f7; --text-2: #b4bdc9; --text-3: #8892a0; --brand: #4aa3ff; --brand-2: #6cb5ff; --brand-bg: #10243a;
  --lime: #9bd83a; --lime-bg: #1a2a10; --warn: #ffc14d; --warn-bg: #2b2210; --bad: #ff7b72; --bad-bg: #2d1414;
  --code-bg: #0a0e14; --code-fg: #e6edf3; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6); color-scheme: dark; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--surface); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.015em; text-wrap: balance; margin: 0; line-height: 1.2; }
code, pre { font-family: var(--mono); }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* header */
.hd { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.hd .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font: 600 16px/1 var(--display); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo img { width: 30px; height: 30px; border-radius: 50%; }
.logo .tag { font: 600 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--lime); background: var(--lime-bg); padding: 4px 6px; border-radius: 4px; }
.nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav a { color: var(--text-2); font-weight: 500; font-size: 14px; padding: 7px 10px; border-radius: 8px; white-space: nowrap; }
.nav a:hover, .nav a.on { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav .ext { color: var(--brand); }
.menu { display: none; margin-left: auto; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); align-items: center; justify-content: center; }
@media (max-width: 1080px) {
  .menu { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 60px; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px max(16px, env(safe-area-inset-right, 0px)) 14px max(16px, env(safe-area-inset-left, 0px)); }
  .nav.open { display: flex; }
}

/* hero */
.hero { background: radial-gradient(70% 120% at 100% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 60%), radial-gradient(50% 90% at 0% 100%, color-mix(in srgb, var(--lime) 10%, transparent), transparent 60%), var(--surface); border-bottom: 1px solid var(--line); }
.hero .wrap { padding-block: clamp(36px, 6vw, 64px); display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 32px; align-items: end; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } }
.eyebrow { font: 600 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--brand); }
.hero h1 { font-size: clamp(30px, 4.6vw, 50px); margin: 12px 0; }
.hero p { color: var(--text-2); font-size: 17px; max-width: 62ch; margin: 0 0 20px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font: 600 28px/1 var(--display); font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--text-3); }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); }
.btn:hover { text-decoration: none; border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }

/* product bar */
.pbar { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 6px; scrollbar-width: thin; }
.pbtn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13.5px; font-weight: 500; white-space: nowrap; color: var(--text); }
.pbtn:hover { border-color: var(--brand); text-decoration: none; }
.pbtn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.pbtn .n { font: 500 11.5px var(--mono); color: var(--text-3); }
.pbtn.on .n { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.pi { width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; color: #fff; font: 700 10px/1 var(--mono); flex: none; background: var(--c); }
.pi.all { background: linear-gradient(135deg, var(--brand), var(--lime)); }

/* toolbar */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 0 14px; }
.search { flex: 1 1 280px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 0 12px; height: 42px; min-width: 0; }
.search:focus-within { border-color: var(--brand); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0; }
.search kbd { font: 500 11px var(--mono); border: 1px solid var(--line-2); border-radius: 5px; padding: 2px 6px; color: var(--text-3); }
.sel { height: 42px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); padding: 0 10px; }
.tbtn { height: 42px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); padding: 0 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.tbtn[aria-expanded="true"] { border-color: var(--brand); color: var(--brand); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 16px; }
.filters h4 { margin: 0 0 8px; font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; background: var(--surface); color: var(--text-2); white-space: nowrap; }
.chip.on { background: var(--brand-bg); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.chip .n { font: 500 11px var(--mono); color: var(--text-3); }
.count { font-size: 13.5px; color: var(--text-3); margin: 0 0 12px; }
.clear { color: var(--brand); font-size: 13.5px; font-weight: 600; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
.card { display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; min-width: 0; }
.card:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); }
.card .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .kind { font: 600 11px var(--mono); color: var(--text-3); }
.card .scn { font: 600 11px var(--mono); letter-spacing: .04em; text-transform: uppercase; padding: 3px 7px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); }
.card .date { margin-left: auto; font: 500 11.5px var(--mono); color: var(--text-3); }
.card h3 { font-size: 16.5px; line-height: 1.3; }
.card p { margin: 0; font-size: 14px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .tools { display: flex; gap: 6px; flex-wrap: wrap; }
.tool { font: 500 11.5px var(--mono); padding: 3px 7px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; color: var(--text-3); }
.av { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font: 700 10px var(--display); color: #041018; background: linear-gradient(135deg, #3aa8ff, #9bd83a); flex: none; }
.who { display: inline-flex; gap: 8px; align-items: center; }
.go { color: var(--brand); font-weight: 600; }
.sev { font: 600 11px var(--mono); padding: 3px 7px; border-radius: 5px; }
.sev.High { background: var(--bad-bg); color: var(--bad); } .sev.Medium { background: var(--warn-bg); color: var(--warn); } .sev.Low { background: var(--lime-bg); color: var(--lime); }
.empty { padding: 40px; text-align: center; color: var(--text-2); border: 1px dashed var(--line-2); border-radius: 14px; grid-column: 1 / -1; }

/* sections */
.sec { padding-block: 36px; }
.sec-hd { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.sec-hd h2 { font-size: clamp(22px, 2.6vw, 28px); }
.sec-hd p { margin: 6px 0 0; color: var(--text-2); max-width: 70ch; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile { display: grid; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); align-content: start; }
.tile:hover { text-decoration: none; border-color: var(--brand); }
.tile .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-bg); color: var(--brand); }
.tile h3 { font-size: 17px; }
.tile p { margin: 0; font-size: 14px; color: var(--text-2); }
.tile .meta { font: 500 12px var(--mono); color: var(--text-3); }

/* detail pages */
.crumbs { font-size: 13.5px; color: var(--text-3); display: flex; gap: 8px; flex-wrap: wrap; padding-top: 22px; }
.page-hd { padding: 14px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.page-hd h1 { font-size: clamp(26px, 3.8vw, 40px); margin: 10px 0 12px; max-width: 30ch; }
.page-hd .lede { color: var(--text-2); font-size: 17px; max-width: 72ch; margin: 0 0 14px; }
.metarow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ptag { display: inline-flex; gap: 6px; align-items: center; padding: 4px 9px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--text); }
.ptag:hover { text-decoration: none; border-color: var(--brand); }
.ptag .pi { width: 20px; height: 20px; font-size: 8.5px; border-radius: 6px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; padding-bottom: 56px; }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } }
.main { min-width: 0; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.box > h2 { font-size: 19px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.box > h2 .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.box p { margin: 0 0 10px; }
.box p:last-child { margin-bottom: 0; }
.box ul, .box ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.box.symptom > h2 .ic { background: var(--bad-bg); color: var(--bad); }
.box.cause > h2 .ic { background: var(--warn-bg); color: var(--warn); }
.box.fix > h2 .ic { background: var(--lime-bg); color: var(--lime); }
.box.info > h2 .ic { background: var(--brand-bg); color: var(--brand); }
.box.disclaimer { font-size: 13px; color: var(--text-3); box-shadow: none; background: var(--surface-2); }
.steps { list-style: none; padding: 0 !important; counter-reset: s; gap: 0 !important; }
.steps > li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; position: relative; }
.steps > li::before { counter-increment: s; content: counter(s); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 600 14px var(--display); color: #041018; background: linear-gradient(135deg, #3aa8ff, #9bd83a); }
.steps > li::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 2px; width: 2px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.steps b { display: block; margin-top: 4px; }
.steps p { margin: 2px 0 8px; color: var(--text-2); }

/* tabs + code */
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.tab { padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--text-3); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.code { border-radius: 12px; overflow: hidden; background: var(--code-bg); margin: 12px 0; border: 1px solid color-mix(in srgb, var(--code-bg) 70%, var(--line)); }
.code header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; font: 500 12px var(--mono); color: #8b949e; border-bottom: 1px solid #222b36; }
.code header button { color: #79c0ff; font: 600 12px var(--mono); padding: 3px 8px; border-radius: 5px; }
.code header button:hover { background: #1f2937; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.65; color: var(--code-fg); }
.code .c { color: #8b949e; } .code .s { color: #a5d6ff; } .code .v { color: #ffa657; } .code .k { color: #d2a8ff; } .code .f { color: #7ee787; }
.panel[hidden] { display: none; }
.note { font-size: 13.5px; color: var(--text-2); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.t th { text-align: left; font: 600 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.prio { font: 600 11.5px var(--mono); padding: 3px 8px; border-radius: 5px; white-space: nowrap; }
.prio.vh { background: var(--brand-bg); color: var(--brand); } .prio.h { background: var(--lime-bg); color: var(--lime); } .prio.m { background: var(--surface-2); color: var(--text-2); }
.side { display: grid; gap: 14px; align-content: start; position: sticky; top: 80px; }
@media (max-width: 960px) { .side { position: static; } }
.side .box { margin: 0; }
.side h3 { font-size: 14px; font-family: var(--font); margin-bottom: 8px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 10px; font-size: 14px; margin: 0; }
.kv dt { color: var(--text-3); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.diagram { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 12px; margin: 6px 0 12px; }
.diagram svg { display: block; max-width: none; }
.dg-lane { fill: var(--surface); stroke: var(--line); } .dg-lt { fill: var(--text-3); font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.dg-node { fill: var(--surface); stroke: var(--c); stroke-width: 1.6; } .dg-num { fill: var(--c); } .dg-nt { fill: #fff; font: 700 10px var(--mono); text-anchor: middle; }
.dg-t { fill: var(--text); font: 600 12px var(--font); text-anchor: middle; } .dg-s { fill: var(--text-2); font: 400 10.5px var(--font); text-anchor: middle; }
.dg-ar { fill: none; stroke: var(--text-3); stroke-width: 1.4; } .dg-ah { fill: var(--text-3); }
.form { display: grid; gap: 12px; max-width: 520px; }
.form label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.form input, .form select { height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); padding: 0 12px; width: 100%; }
.msg { font-size: 14px; color: var(--lime); min-height: 1.5em; }
.profile { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px; align-items: center; }
@media (max-width: 560px) { .profile { grid-template-columns: 1fr; } }
.profile .big { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; font: 600 40px var(--display); color: #041018; background: linear-gradient(135deg, #3aa8ff, #9bd83a); }
.ft { border-top: 1px solid var(--line); background: var(--surface); padding-block: 26px; font-size: 13.5px; color: var(--text-3); }
.ft .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 13.5px; z-index: 90; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
