/* ITSpecta full overhaul mock-up: layout and components on top of kb.css tokens. */

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; }
.side { transition: width .2s ease; }
.side.collapsed { width: 64px; padding-inline: 8px; }
.side.collapsed .nav-label, .side.collapsed .brand > div, .side.collapsed .nav-text,
.side.collapsed .count, .side.collapsed .side-actions span, .side.collapsed .status-line span:last-child,
.side.collapsed .ver { display: none; }
.side.collapsed .nav-item { justify-content: center; padding: 9px 0; }
.side.collapsed .side-actions { flex-direction: column; }
.side.collapsed .brand { justify-content: center; padding: 0; }
.nav-item .count { margin-left: auto; }
.collapse-btn { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-content: center; }
.collapse-btn:hover { background: var(--card); color: var(--ink); }
.side.collapsed .collapse-btn { margin: 0 auto; }

.body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 10px 40px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--hair);
}
.search-btn {
  flex: 1; max-width: 460px; height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--hair); background: var(--card); color: var(--muted); cursor: pointer; font-size: 13.5px;
}
.search-btn svg { width: 15px; height: 15px; }
.search-btn kbd { margin-left: auto; }
kbd {
  font: 700 11px var(--mono); color: var(--ink); background: var(--raised); border: 1px solid var(--hair);
  border-bottom-width: 3px; border-radius: 7px; padding: 1px 6px; white-space: nowrap;
}
.keys { display: inline-flex; align-items: center; gap: 4px; }
.keys i { color: var(--accent-text); font-style: normal; font-weight: 800; }
.ctx-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--accent-tint); color: var(--ink); font-size: 12.5px; }
.ctx-chip b { font-family: var(--mono); font-weight: 600; color: var(--heading); }
.ctx-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; width: 22px; height: 22px; border-radius: 50%; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--hair); background: var(--card); cursor: pointer; display: grid; place-content: center; color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; border-radius: 999px; background: var(--flare); color: #fff; font: 800 10px "Figtree"; display: grid; place-content: center; padding: 0 4px; }
html[data-theme="light"] .icon-btn .badge { background: #c4500a; }

#view { flex: 1; }
main.page { max-width: 1320px; width: 100%; }

/* ---------- in-page tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hair); flex-wrap: wrap; }
.tabs button {
  border: 0; background: none; padding: 9px 14px; font-size: 13.5px; font-weight: 600; color: var(--sub);
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; display: inline-flex; gap: 7px; align-items: center;
}
.tabs button[aria-selected="true"] { color: var(--heading); border-bottom-color: var(--accent); }
.tabs .tag { font-size: 10.5px; }
[data-panel]:not(.on) { display: none !important; }

/* ---------- generic layout ---------- */
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.side-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.side-split.right { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 1100px) { .cols-3 { grid-template-columns: 1fr 1fr; } .side-split, .side-split.right { grid-template-columns: minmax(0, 1fr) !important; } }
@media (max-width: 760px) { .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); } }
.card h3 { margin: 0 0 8px; font-size: 15px; font-weight: 800; color: var(--heading); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.card-head .row { margin-left: auto; }
.sub { font-size: 12.5px; color: var(--muted); }
.sec-title { margin: 6px 0 0; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.kv dd.mono { font-family: var(--mono); font-size: 12.5px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; }
.list-row + .list-row { border-top: 1px solid var(--hair); border-radius: 0; }
.list-row b { color: var(--heading); font-weight: 700; }
.list-row .grow > span { display: block; }
.pill-ok, .pill-warn, .pill-bad, .pill-note, .pill-muted { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill-ok { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.pill-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, transparent); }
.pill-bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, transparent); }
.pill-note { color: var(--note); background: color-mix(in srgb, var(--note) 14%, transparent); }
.pill-muted { color: var(--sub); background: var(--raised); }
.menu-dots { border: 0; background: none; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; }
.menu-dots:hover { background: var(--raised); color: var(--ink); }
.bar { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.bar.good i { background: var(--good); } .bar.warn i { background: var(--warn); } .bar.bad i { background: var(--bad); }
.well { background: var(--well); color: #e8e2d4; border-radius: 14px; padding: 12px 14px; font: 12.5px/1.55 var(--mono); overflow: auto; }
.well .p { color: #7cc47a; } .well .w { color: #f2d65c; } .well .e { color: #e08a7a; } .well .m { color: #a39a86; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 34px 20px; border: 1px dashed color-mix(in srgb, var(--border) 60%, transparent); border-radius: 18px; color: var(--muted); }
.empty-state b { color: var(--heading); font-size: 16px; }
.empty-state svg { width: 40px; height: 40px; color: var(--track); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .input { width: auto; flex: 1; min-width: 180px; }
.info { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; padding: 10px 12px; border-radius: 12px; background: var(--raised); color: var(--sub); }
.info svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent-text); }
.info b { color: var(--heading); }
details.more > summary { cursor: pointer; color: var(--accent-text); font-weight: 700; font-size: 13px; }

/* ---------- dialogs, palette, sheet, toast ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(10,8,6,.55); backdrop-filter: blur(2px); }
.palette { width: min(620px, calc(100vw - 32px)); margin: 12vh auto 0; background: var(--card); border: 1px solid var(--hair); border-radius: 20px; box-shadow: 0 40px 100px -30px rgba(0,0,0,.8); overflow: hidden; }
.palette input { width: 100%; height: 54px; border: 0; border-bottom: 1px solid var(--hair); background: none; padding: 0 20px; font-size: 16px; outline: none; }
.palette ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow: auto; }
.palette li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.palette li svg { width: 16px; height: 16px; color: var(--accent-text); }
.palette li small { margin-left: auto; color: var(--muted); font-size: 12px; }
.palette li[aria-selected="true"] { background: var(--accent-tint); color: var(--heading); }
.palette .grp { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 4px; cursor: default; }
.modal { width: min(560px, calc(100vw - 32px)); margin: 10vh auto 0; background: var(--card); border: 1px solid var(--hair); border-radius: 22px; box-shadow: 0 40px 100px -30px rgba(0,0,0,.8); padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal h2 { margin: 0; font-size: 20px; font-weight: 900; letter-spacing: -.01em; color: var(--heading); }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; }

.sheet {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(460px, 100vw); background: var(--card);
  border-left: 1px solid var(--hair); box-shadow: -30px 0 80px -30px rgba(0,0,0,.7); display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform .28s ease;
}
.sheet.open { transform: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--hair); }
.sheet-head h2 { margin: 0; font-size: 16px; font-weight: 800; color: var(--heading); }
.sheet-body { flex: 1; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.sheet-foot { padding: 12px 18px; border-top: 1px solid var(--hair); display: flex; gap: 8px; flex-wrap: wrap; }

.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 14px; background: var(--heading); color: var(--bg); font-size: 13.5px; font-weight: 600; box-shadow: 0 20px 50px -20px rgba(0,0,0,.6); animation: rise .3s ease both; }
.toast button { border: 0; background: none; color: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }

/* ---------- snip: library, editor, text panel ---------- */
.cap-modes { display: flex; gap: 8px; flex-wrap: wrap; }
.cap-modes .btn { height: 40px; }
.record { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 999px; border: 1px solid var(--hair); background: var(--card); font-size: 13px; }
.record.on { border-color: color-mix(in srgb, var(--flare) 50%, transparent); background: color-mix(in srgb, var(--flare) 8%, var(--card)); }
.record .rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--track); }
.record.on .rec-dot { background: var(--flare); animation: breathe 3.6s ease-in-out infinite; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--track); border: 0; cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: transform .15s ease; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(16px); background: var(--on-accent); }

.snip-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
@media (max-width: 1250px) { .snip-layout { grid-template-columns: 180px minmax(0, 1fr); } .snip-layout .textpanel { grid-column: 1 / -1; } }
@media (max-width: 800px) { .snip-layout { grid-template-columns: minmax(0, 1fr); } }
.lib { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.lib .input { height: 34px; font-size: 13px; }
.lib-group { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.thumb { display: flex; flex-direction: column; gap: 5px; padding: 6px; border-radius: 12px; border: 1px solid transparent; background: none; cursor: pointer; text-align: left; color: inherit; }
.thumb:hover { background: var(--raised); }
.thumb[aria-current="true"] { border-color: var(--accent); background: var(--sel); }
.thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; display: block; border: 1px solid var(--hair); }
.thumb span { font-size: 12px; color: var(--sub); display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.thumb b { font-size: 12.5px; color: var(--heading); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.editor { padding: 0; overflow: hidden; }
.ed-tools { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--hair); flex-wrap: wrap; }
.ed-tool { height: 34px; min-width: 34px; padding: 0 9px; border-radius: 9px; border: 0; background: none; color: var(--sub); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.ed-tool svg { width: 16px; height: 16px; }
.ed-tool:hover { background: var(--raised); color: var(--ink); }
.ed-tool[aria-pressed="true"] { background: var(--accent-tint); color: var(--heading); }
.ed-tool[aria-pressed="true"] svg { color: var(--accent); }
.ed-sep { width: 1px; height: 22px; background: var(--hair); margin: 0 4px; }
.sw { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.sw[aria-pressed="true"] { border-color: var(--heading); box-shadow: 0 0 0 2px var(--card) inset; }
.canvas-area { background: repeating-conic-gradient(var(--raised) 0 25%, var(--card) 0 50%) 0 0 / 18px 18px; padding: 18px; display: grid; place-items: center; }
.shot { position: relative; width: 100%; max-width: 880px; box-shadow: 0 20px 50px -20px rgba(0,0,0,.6); border-radius: 8px; }
.shot > img { width: 100%; display: block; border-radius: 8px; }
.shot .ocr-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.ocr-layer .word { fill: transparent; }
.ocr-layer .hit { fill: rgba(255,169,70,.18); stroke: #ffa946; stroke-width: 1.5; }
.shot.show-words .ocr-layer .word { fill: rgba(232,226,212,.10); stroke: rgba(232,226,212,.25); }
.shot.hide-hits .ocr-layer .hit { display: none; }
.anno { position: absolute; pointer-events: none; }
.anno.box { border: 3px solid #ff6c4c; border-radius: 6px; }
.anno.num { width: 30px; height: 30px; border-radius: 50%; background: #ff6c4c; color: #191714; font: 900 15px "Figtree"; display: grid; place-content: center; box-shadow: 0 0 0 3px #fff; }
.anno.label { background: #ff6c4c; color: #191714; font: 800 13px "Figtree"; padding: 4px 10px; border-radius: 8px; }
.anno.redact { background: #111; border-radius: 3px; }
.ed-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--hair); flex-wrap: wrap; }
.ed-foot .hint { margin-right: auto; }

.textpanel { padding: 0; overflow: hidden; }
.textpanel .tabs { padding: 0 10px; }
.tp-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.found { display: flex; flex-direction: column; gap: 6px; }
.found-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 10px; border-radius: 10px; background: var(--raised); font-size: 13px; }
.found-row .k { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); width: 54px; flex: none; }
.found-row code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--heading); }
.found-row .acts { display: flex; gap: 4px; }
.mini-act { height: 26px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--hair); background: var(--card); color: var(--ink); font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.mini-act:hover { border-color: var(--accent); }
textarea.ocr { width: 100%; min-height: 170px; resize: vertical; border-radius: 12px; border: 1px solid var(--border); background: var(--well); color: #e8e2d4; padding: 10px 12px; font: 12px/1.5 var(--mono); }
.conf { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }

/* ---------- guides ---------- */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.gcard { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; text-align: left; cursor: pointer; color: inherit; font: inherit; text-decoration: none; }
.gcard:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.gcard img, .gcard .cover { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; display: block; border-bottom: 1px solid var(--hair); }
.gcard .cover { display: grid; place-content: center; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent), var(--raised); color: var(--accent-text); }
.gcard .cover svg { width: 34px; height: 34px; }
.gcard .gc-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.gcard b { color: var(--heading); font-size: 14.5px; }
.gcard .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tpl { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 16px; border: 1px solid var(--hair); background: var(--card); cursor: pointer; text-align: left; color: inherit; font: inherit; }
.tpl:hover, .tpl[aria-pressed="true"] { border-color: var(--accent); background: var(--sel); }
.tpl svg { width: 22px; height: 22px; color: var(--accent-text); }
.tpl b { color: var(--heading); }
.tpl span { font-size: 12.5px; color: var(--muted); }

.gedit { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .gedit { grid-template-columns: minmax(0, 1fr); } .outline { display: none; } }
.outline { position: sticky; top: 76px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.outline a { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; font-size: 13px; color: var(--sub); text-decoration: none; }
.outline a:hover { background: var(--raised); color: var(--ink); }
.outline a .n { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border); font-size: 10.5px; font-weight: 800; display: grid; place-content: center; flex: none; }
.outline a.h { font-weight: 800; color: var(--heading); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; margin-top: 6px; }
.outline .grip { margin-left: auto; color: var(--track); cursor: grab; }
.doc { padding: 30px 36px; border-radius: 22px; display: flex; flex-direction: column; gap: 16px; }
.doc-title { font: 900 30px/1.15 "Figtree"; letter-spacing: -.02em; color: var(--heading); border: 0; background: none; padding: 0; width: 100%; outline: none; }
.doc-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) { .doc-meta { grid-template-columns: 1fr 1fr; } .doc { padding: 20px; } }
.doc-meta .field .input { height: 34px; font-size: 13px; }
.doc h2 { margin: 8px 0 0; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.doc p.lead { margin: 0; color: var(--sub); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist li { display: flex; gap: 10px; align-items: center; font-size: 13.5px; }
.checklist li::before { content: ""; width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border); flex: none; }
.step-card { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; padding: 16px; border-radius: 18px; border: 1px solid var(--hair); background: color-mix(in srgb, var(--raised) 40%, var(--card)); }
.step-card:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.step-num { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 900; display: grid; place-content: center; }
.step-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.step-text { font-size: 14.5px; color: var(--ink); outline: none; border-radius: 8px; padding: 2px 4px; margin: -2px -4px; }
.step-text:focus { background: var(--raised); }
.step-text b { color: var(--heading); }
.step-img { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--hair); }
.step-img img { width: 100%; display: block; }
.step-img .over { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.step-img:hover .over, .step-img:focus-within .over { opacity: 1; }
.step-img .over .mini-act { background: rgba(20,18,15,.85); color: #f5eee0; border-color: transparent; }
.caption { font-size: 12.5px; color: var(--muted); font-style: italic; }
.step-side { display: flex; flex-direction: column; gap: 2px; }
.callout { display: flex; gap: 10px; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; border-left: 3px solid; }
.callout.note { border-color: var(--note); background: color-mix(in srgb, var(--note) 9%, transparent); }
.callout.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.callout.tip { border-color: var(--good); background: color-mix(in srgb, var(--good) 9%, transparent); }
.callout b { color: var(--heading); }
.cmd { display: flex; align-items: center; gap: 10px; background: var(--well); color: #e8e2d4; border-radius: 12px; padding: 10px 10px 10px 14px; font: 13px var(--mono); }
.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: pre; }
.cmd .mini-act { background: #2b2721; color: #e8e2d4; border-color: #3a342b; }
.insert { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px; border: 1px dashed color-mix(in srgb, var(--border) 60%, transparent); border-radius: 14px; }
.insert .hint { margin-right: 6px; }
.placeholder { color: var(--accent-text); background: var(--accent-tint); border-radius: 6px; padding: 0 5px; font-weight: 700; }
.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.save-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }

/* ---------- monitors / misc ---------- */
.graph { position: relative; background: var(--well); border-radius: 14px; padding: 10px 12px 6px; }
.graph svg { width: 100%; height: 170px; display: block; }
.ylab { position: absolute; left: 16px; font-size: 10.5px; color: #a39a86; }
.xlab { display: flex; justify-content: space-between; font-size: 10.5px; color: #a39a86; padding: 2px 0 0 40px; }
.hopdot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 8px; vertical-align: 0; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tg { padding: 10px 12px; border-radius: 12px; background: var(--raised); display: flex; flex-direction: column; gap: 2px; font-size: 12px; border-left: 3px solid var(--good); }
.tg b { font-size: 13px; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg.down { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--raised)); }
.tg.slow { border-left-color: var(--warn); }
.term { background: var(--well); border-radius: 0 0 14px 14px; padding: 12px 14px; font: 13px/1.5 var(--mono); color: #e8e2d4; height: calc(100vh - 330px); min-height: 320px; overflow: auto; }
.term-tabs { display: flex; gap: 4px; padding: 6px 6px 0; background: var(--bg-side); border-radius: 14px 14px 0 0; flex-wrap: wrap; }
.term-tab { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px 10px 0 0; font-size: 12.5px; font-weight: 600; color: var(--sub); background: none; border: 0; cursor: pointer; }
.term-tab[aria-selected="true"] { background: var(--well); color: #f5eee0; }
.term-tab .k { font: 800 10px "Figtree"; color: #fff; border-radius: 5px; padding: 1px 5px; }
.tool-cat { display: flex; flex-direction: column; gap: 6px; }
.tool-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: none; border: 0; color: var(--ink); text-align: left; font: inherit; font-size: 13.5px; cursor: pointer; }
.tool-link:hover { background: var(--raised); }
.tool-link[aria-current="true"] { background: var(--accent-tint); color: var(--heading); font-weight: 700; }
.tool-link svg { width: 16px; height: 16px; color: var(--accent-text); flex: none; }
.timeline { display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 54px 22px minmax(0, 1fr); gap: 10px; padding: 8px 0; }
.tl time { font: 600 12.5px var(--mono); color: var(--muted); padding-top: 2px; }
.tl .dotc { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent); margin-top: 4px; justify-self: center; position: relative; }
.tl .dotc.bad { border-color: var(--bad); } .tl .dotc.good { border-color: var(--good); } .tl .dotc.note { border-color: var(--note); }
.tl .what b { color: var(--heading); }
.help-topic h3 { margin: 0 0 6px; }
.help-topic ul { margin: 6px 0; padding-left: 18px; }
.kbd-table td { padding: 6px 10px; }
.side.collapsed .side-foot .row { flex-direction: column; }
.side.collapsed #collapse svg { transform: scaleX(-1); }
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown .menu { position: absolute; right: 0; top: 38px; z-index: 15; display: flex; flex-direction: column; padding: 6px; min-width: 210px; box-shadow: 0 20px 50px -20px rgba(0,0,0,.6); }
.menu button { border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; }
.menu button:hover { background: var(--raised); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mock-bar { right: auto; left: 232px; }
/* narrow windows: tables scroll inside their card, inline grids stack */
.card:has(> table.data) { overflow-x: auto; }
table.data th, table.data td.num { white-space: nowrap; }
@media (max-width: 1000px) {
  .kv[style] { grid-template-columns: max-content minmax(0, 1fr) !important; }
  form.card[style*="grid-template-columns"] { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 760px) {
  form.card[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .topbar { padding: 10px 16px; }
  .topbar .ctx-chip, .search-btn .keys { display: none; }
}
/* ---------- Ask AI ---------- */
.ai-btn { display: inline-flex; align-items: center; gap: 6px; }
.ai-btn::before { content: ""; width: 14px; height: 14px; background: var(--grad); -webkit-mask: url("icon/ai-spark.svg") center / contain no-repeat; mask: url("icon/ai-spark.svg") center / contain no-repeat; }
details.sent > summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chips-q { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-log { display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 10px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; max-width: 92%; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--on-accent); font-weight: 600; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--raised); border-bottom-left-radius: 4px; }
.msg.bot b { color: var(--heading); }
.msg .cite { margin-top: 8px; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.admin-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border: 0; border-radius: 999px; padding: 2px 9px; cursor: pointer; }
.admin-pill::before { content: "\1F6E1"; font-size: 11px; }
/* ---------- ServiceNow preview: follows the knowledge style guide (Arial, no colour) ---------- */
.sn-preview { background: #fff; color: #000; border-radius: 12px; padding: 18px 22px; font: 12pt/1.45 Arial, sans-serif; border: 1px solid var(--hair); max-height: 460px; overflow: auto; }
.sn-preview h2 { font: bold 14pt Arial, sans-serif; text-decoration: underline; margin: 14px 0 6px; color: #000; letter-spacing: 0; text-transform: none; }
.sn-preview h3 { font: bold 12pt Arial, sans-serif; margin: 10px 0 4px; color: #000; }
.sn-preview code { font: 10pt "Courier New", monospace; }
.sn-preview details { border: 1px solid #ccc; border-radius: 4px; margin: 6px 0; padding: 4px 10px; }
.sn-preview summary { font-weight: bold; cursor: pointer; }
.sn-preview .shotref { display: inline-block; border: 1px dashed #888; padding: 2px 8px; font-size: 10pt; color: #333; }
.sn-field { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.sn-field:last-child { border-bottom: 0; }
.sn-field .k { font-size: 13px; font-weight: 700; color: var(--sub); padding-top: 4px; }
.sn-field .k small { display: block; font-weight: 500; color: var(--muted); }
.sn-field .v { min-width: 0; font-size: 13px; }
@media (max-width: 760px) { .sn-field { grid-template-columns: minmax(0, 1fr); } }
.check-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: 13px; }
.check-item:last-child { border-bottom: 0; }
.check-item b { color: var(--heading); }
html.no-ai .ai-btn, html.no-ai [data-ai] { display: none !important; }
/* ---------- pop-up menu (shared by every "..." button) ---------- */
.popover { position: fixed; z-index: 70; display: flex; flex-direction: column; padding: 6px; min-width: 220px; max-width: 320px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.7); }
.popover button { border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink); }
.popover button:hover, .popover button:focus-visible { background: var(--raised); outline: none; }
.popover button.danger, .menu button.danger { color: var(--bad); }
.popover hr { border: 0; border-top: 1px solid var(--hair); margin: 4px 2px; width: auto; }
details.dropdown .menu { min-width: 220px; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.menu-dots[aria-expanded="true"] { background: var(--raised); color: var(--ink); }
/* ---------- vault switched off ---------- */
html.no-vault [data-vault] { display: none !important; }
html:not(.pw-credman) [data-credman], html:not(.pw-ask) [data-pwask] { display: none !important; }
html.compact table.data td { padding: 4px 8px; font-size: 12.5px; }
html.compact table.data th { padding: 4px 8px; }
html.compact .list-row { padding: 6px 10px; }
/* scan view helpers used outside its own style block */
.cat-chip:focus-visible, .host-row:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.side-split > *, .cols-2 > *, .cols-3 > * { min-width: 0; }
#family-menu .fm { width: 100%; border: 0; background: none; cursor: pointer; text-align: left; color: inherit; font: inherit; padding: 6px 8px; }
#family-menu .fm:hover, #family-menu .fm:focus-visible { background: var(--raised); }
#family-menu kbd { min-width: 24px; text-align: center; }

/* ---------- content-sized boxes (BUILD-SPEC 5.1 "Fit the content") ---------- */
main.page.page-wide { max-width: none; }
.canvas-area { overflow: auto; max-height: calc(100vh - 230px); }
.canvas-area.fit .shot { width: auto; max-width: 100%; }
.canvas-area.fit .shot > img { width: auto; max-width: 100%; max-height: calc(100vh - 300px); margin: 0 auto; }
.canvas-area.actual { place-items: start; }
.canvas-area.actual .shot { width: max-content; max-width: none; }
.canvas-area.actual .shot > img { width: var(--natural-w, auto); max-width: none; max-height: none; }
.snip-layout.wide { grid-template-columns: minmax(0, 1fr); }
.snip-layout.wide .lib { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; align-items: flex-start; }
.snip-layout.wide .lib > .input, .snip-layout.wide .lib > .seg, .snip-layout.wide .lib .lib-group { display: none; }
.snip-layout.wide .lib .thumb { flex: 0 0 170px; }
.snip-layout.wide .textpanel { grid-column: auto; }
textarea.ocr { field-sizing: content; min-height: 120px; max-height: 70vh; overflow: auto; }
textarea.ocr.nowrap { white-space: pre; }
.anno.label { white-space: pre-wrap; width: max-content; max-width: 45%; }

/* ---------- page intro: section eyebrow, lede, How to use this page ---------- */
.page-head .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 4px; }
.page-head .eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--accent); }
.page-head .eyebrow i { font-style: normal; font-weight: 600; letter-spacing: .02em; text-transform: none; color: var(--muted); }
.howto { margin-top: 8px; max-width: 72ch; }
.howto summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--accent-text); list-style: none; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary::before { content: "?"; display: grid; place-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-tint); font-size: 11px; font-weight: 900; }
.howto[open] summary { margin-bottom: 8px; }
.howto ol { margin: 0; padding: 10px 14px 10px 32px; border-radius: 12px; background: var(--card); border: 1px solid var(--hair); border-left: 3px solid var(--accent); color: var(--sub); font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.howto ol b { color: var(--heading); }

/* ---------- Add to dashboard pin ---------- */
.dash-pin { gap: 6px; }
.dash-pin svg { width: 14px; height: 14px; }
.dash-pin[aria-pressed="true"] { background: var(--sel); border-color: var(--accent); color: var(--accent-text); }

/* ---------- recording chip ---------- */
.rec-chip summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; max-width: 420px; white-space: nowrap; overflow: hidden; }
.rec-chip summary::-webkit-details-marker { display: none; }
.rec-chip summary b { overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--flare); animation: recpulse 1.6s ease-in-out infinite; flex: none; }
@keyframes recpulse { 50% { opacity: .3; } }
@media (max-width: 1100px) { .rec-chip summary b, .rec-chip summary .hint { display: none; } }

/* ---------- the tour (BUILD-SPEC A12) ---------- */
.tour { position: fixed; inset: 0; z-index: 900; pointer-events: none; }
.tour[hidden] { display: none; }
.tour-shade { position: absolute; inset: 0; pointer-events: auto; }
.tour.trying .tour-shade, .tour.paused .tour-shade { pointer-events: none; }
.tour-spot { position: absolute; border-radius: 14px; box-shadow: 0 0 0 200vmax rgba(10, 9, 8, .72); transition: left .45s cubic-bezier(.3, .8, .25, 1), top .45s cubic-bezier(.3, .8, .25, 1), width .45s cubic-bezier(.3, .8, .25, 1), height .45s cubic-bezier(.3, .8, .25, 1), box-shadow .3s; pointer-events: none; }
.tour-ring { position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent), 0 0 40px color-mix(in srgb, var(--accent) 45%, transparent); animation: tour-pulse 2.2s ease-in-out infinite; }
.tour.centred .tour-ring { display: none; }
@keyframes tour-pulse { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 8%, transparent), 0 0 60px color-mix(in srgb, var(--accent) 30%, transparent); } }
.tour.trying .tour-spot { box-shadow: 0 0 0 200vmax rgba(10, 9, 8, .25); }
.tour.paused .tour-spot, .tour.paused .tour-card, .tour.trying .tour-card { display: none; }
.tour-card { position: absolute; width: min(400px, calc(100vw - 24px)); pointer-events: auto; background: var(--card); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 20px; padding: 16px 18px 14px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .02); display: flex; flex-direction: column; gap: 8px; transition: left .45s cubic-bezier(.3, .8, .25, 1), top .45s cubic-bezier(.3, .8, .25, 1); }
.tour.centred .tour-card { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 24px)); padding: 26px 28px 20px; background: radial-gradient(420px 220px at 85% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), var(--card); }
.tour-card.from-right > :not(.tour-x) { opacity: 0; transform: translateX(14px); }
.tour-card.from-left > :not(.tour-x) { opacity: 0; transform: translateX(-14px); }
.tour-card.in > * { opacity: 1; transform: none; transition: opacity .3s ease, transform .35s cubic-bezier(.3, .8, .25, 1); }
.tour-card h2 { margin: 0; font-size: 20px; font-weight: 900; letter-spacing: -.01em; color: var(--heading); outline: none; }
.tour.centred .tour-card h2 { font-size: 26px; }
.tour-text { margin: 0; color: var(--sub); font-size: 14.5px; line-height: 1.55; }
.tour-keys { margin: 0; font-size: 13px; color: var(--heading); font-family: var(--mono); }
.tour-meta { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.tour-count { color: var(--muted); letter-spacing: .02em; }
.tour-progress { display: flex; gap: 4px; margin-right: 26px; }
.tour-progress button { flex: 1; height: 5px; border: 0; padding: 0; border-radius: 3px; background: var(--track); cursor: pointer; overflow: hidden; }
.tour-progress button i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .45s ease; }
.tour-progress button.done i { background: color-mix(in srgb, var(--accent) 65%, transparent); }
.tour-progress button:hover { outline: 1px solid var(--accent); outline-offset: 1px; }
.tour-links { display: flex; flex-wrap: wrap; gap: 6px; }
.tour-links:empty { display: none; }
.tour-more { background: var(--raised); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; color: var(--sub); max-height: 34vh; overflow: auto; animation: tour-open .25s ease; }
.tour-more ul { margin: 0 0 6px; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.tour-more b { color: var(--heading); }
@keyframes tour-open { from { opacity: 0; transform: translateY(-4px); } }
.tour-foot { display: flex; gap: 6px; align-items: center; border-top: 1px solid var(--hair); padding-top: 10px; margin-top: 2px; }
.tour-foot .btn.text { margin-right: auto; }
.tour-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 8px; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.tour-x:hover { background: var(--raised); color: var(--heading); }
.tour-resume { position: fixed; right: 18px; bottom: 18px; pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; max-width: min(560px, calc(100vw - 36px)); padding: 10px 16px; border-radius: 999px; border: 1px solid var(--accent); background: var(--card); color: var(--ink); font: 600 13.5px Figtree, sans-serif; cursor: pointer; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7); animation: tour-open .3s ease; }
.tour-resume b { color: var(--accent-text); white-space: nowrap; }
.tour-resume-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; animation: recpulse 1.6s ease-in-out infinite; }
.tour-mark { display: flex; justify-content: center; margin-bottom: 4px; }
.tour-mark[hidden] { display: none; }
.tour-mark svg { filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 55%, transparent)); animation: tour-float 3.2s ease-in-out infinite; }
@keyframes tour-float { 50% { transform: translateY(-4px) scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-card, .tour-card.in > *, .tour-progress i { transition: none !important; } .tour-ring, .tour-resume-dot { animation: none; } }
@media (max-width: 700px) { .tour-card:not(.tour.centred .tour-card) { left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto; } }

/* Ask AI state line (never numbers) */
.ai-state { margin: 0 0 6px; padding: 8px 12px; border-radius: 10px; font-size: 13px; background: color-mix(in srgb, var(--bad) 10%, transparent); border-left: 3px solid var(--bad); color: var(--ink); }
.ai-state[data-level="warn"] { background: color-mix(in srgb, var(--warn) 10%, transparent); border-left-color: var(--warn); }
.ai-state a { color: var(--accent-text); font-weight: 700; }
#ai-pill { text-decoration: none; }

/* ITSpecta mark (app.js mark()): the ring follows the theme; the sweep and blip stay amber */
.isp .isp-ring { stroke: var(--heading); }

/* Screenshot review: responsive search and monitor forms retain their contents. */
.search-btn { min-width:0; white-space:nowrap; overflow:hidden; }
.search-btn svg { flex:none; }
.search-btn > span:not(.keys) { min-width:0; overflow:hidden; text-overflow:ellipsis; }
@media(max-width:1100px) { .page form.add { grid-template-columns:repeat(2,minmax(0,1fr))!important; } .mon.min .mon-head { flex-wrap:wrap; } .mon.min .mon-head > .grow { min-width:150px; } .mon.min .mon-mini { max-width:100%; flex-wrap:wrap; } }
@media(max-width:600px) { .page form.add { grid-template-columns:minmax(0,1fr)!important; } }

/* Hidden table action labels must not enlarge the page outside its scroll well. */
.mon .sr-only { left:0; top:0; }

/* Website tour bar (SITE mode in app.js): links look like the bar's buttons */
.mock-bar a { font-size: 12px; padding: 4px 9px; border-radius: 8px; border: 1px solid #fff4; text-decoration: none; }
.mock-bar .hint { color: #fffb; font-size: 12px; }
@media (max-width: 760px) { .mock-bar { left: 8px; right: 8px; flex-wrap: wrap; } .mock-bar .hint { display: none; } }

/* Phone widths (the website tour): ITSpecta is a desktop app, so just keep every page inside the screen */
@media (max-width: 480px) {
  #view .row { flex-wrap: wrap !important; }
  #view img { max-width: 100%; height: auto; }
  #view .mono { overflow-wrap: anywhere; }
  #view .row > * { min-width: 0; max-width: 100%; }
  #view select.input, #view .field { max-width: 100% !important; min-width: 0 !important; }
}
