/* The Code Inspector (Board 2's Code Inspector board): what is selected, its sizes and styles,
   the marks on the screen, and the code, coloured the same way in both skins. */

.panel-body.insp-panel { gap: 12px; padding: 14px 16px 24px; }

/* Nothing selected yet */
.insp-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 14px; text-align: center; color: var(--ink); border: var(--bwc) dashed var(--control); border-radius: var(--rc); }
.insp-empty b { font-family: var(--display); font-size: var(--card-title); font-weight: var(--hw); letter-spacing: var(--hs); text-transform: var(--ht); }

/* What is selected */
.insp-sel { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #ffe9e3; border: 2px solid #271813; }
:root[data-skin="clean"] .insp-sel { background: #f7f1e3; border: 1px solid #e6dccb; border-radius: 10px; }
.insp-art { flex: none; display: inline-flex; }
.insp-sel .col { min-width: 0; gap: 1px; }

/* Its sizes and styles; every value copies when clicked */
.insp-props { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px 10px; align-items: center; font-size: 12px; }
.insp-kvs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; font-family: var(--mono); font-size: 11.5px; }
.insp-kv { min-width: 0; padding: 2px 5px; font: inherit; line-height: 1.4; text-align: center; color: var(--ink); background: #ffffff; border: var(--bwc) solid #271813; border-radius: 0; cursor: copy; }
:root[data-skin="clean"] .insp-kv { border-color: #d3c6ad; border-radius: 6px; }
.insp-val { min-width: 0; display: inline-flex; align-items: center; gap: 6px; padding: 0; font-family: var(--mono); font-size: 11.5px; line-height: 1.45; text-align: left; overflow-wrap: anywhere; color: var(--ink); background: transparent; border: 0; cursor: copy; }
.insp-kv:hover, .insp-val:hover { color: var(--accent-ink); }
.insp-kv:focus-visible, .insp-val:focus-visible, .insp-size:focus-visible, .insp-gap-n:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }
.insp-sw { width: 14px; height: 14px; flex: none; box-sizing: border-box; border: var(--bwc) solid var(--line); border-radius: var(--rs); }
.insp-none { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.insp-does { font-size: 12px; line-height: 1.4; }

/* Code boxes */
.insp-code { flex: none; display: flex; flex-direction: column; overflow: hidden; border: var(--bwc) solid var(--line); border-radius: var(--rc); }
.insp-code-head { height: 32px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px 0 10px; background: var(--head); border-bottom: var(--bw) solid var(--line); }
.insp-code-head .eyebrow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-code .insp-copy { width: 26px; height: 24px; }
.insp-code.is-tall .code { max-height: 56vh; overflow-y: auto; }
.insp-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.insp-actions > button { min-width: 0; }
.insp-actions > button > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.code { margin: 0; padding: 10px; font-family: var(--mono); font-size: 11px; line-height: 1.55; color: var(--ink); background: #fffaf6; }
:root[data-skin="clean"] .code { background: #fbf8f1; }
.code code { font: inherit; }
.code-line { display: block; white-space: pre-wrap; text-indent: -2ch; }
.code-line > span { white-space: pre; }
.c-sel { color: #b91c1c; }
.c-prop { color: #7c3aed; }
.c-punct { color: #5b4138; }
.c-num { color: #b45309; }
.c-str { color: #047857; }
.c-tag { color: #2563eb; }
.c-attr { color: #db2777; }
.c-eq, .c-text { color: var(--ink); }
.c-value { color: #059669; }
.c-more { color: var(--muted); }

/* "Whole screen" */
.insp-whole { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; }
.insp-whole .btn-link { margin-top: 2px; text-align: left; }

/* Canvas: the chip, the device and the HTML card */
.insp-chip { position: absolute; left: 16px; top: 16px; z-index: 3; }
.insp-dot { width: 10px; height: 10px; flex: none; background: var(--measure); border-radius: var(--pill); }
.insp-dev .wf-part { cursor: pointer; }
.insp-card { position: absolute; z-index: 5; width: 300px; display: flex; flex-direction: column; overflow: hidden; }
.insp-card-head { height: 38px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 12px; }
.insp-card .insp-copy { width: 28px; height: 26px; }
.insp-card-code .code { max-height: 360px; overflow-y: auto; padding: 12px; font-size: 11.5px; line-height: 1.6; }
.insp-card > .card-foot:first-child { border-top: 0; }

/* Marks on the screen, in screen pixels: the size, the component under the pointer, distances */
.insp-size { position: absolute; right: 0; top: -31px; padding: 0 5px; font-family: var(--mono); font-size: 10px; line-height: 16px; font-weight: 700; white-space: nowrap; color: #ffffff; background: var(--measure); border: 0; border-radius: 0; pointer-events: auto; cursor: copy; }
.insp-box.label-below .insp-size { top: calc(100% + 7px); }
.insp-box.size-flip .insp-size { top: calc(100% + 10px); }
.insp-box.label-below.size-flip .insp-size { top: calc(100% + 35px); }
.insp-hover { position: absolute; z-index: 29; pointer-events: none; outline: 1.5px dashed var(--measure); outline-offset: 1px; }
.insp-gap { position: absolute; z-index: 31; pointer-events: none; background: var(--measure); }
.insp-gap.is-x { height: 1px; }
.insp-gap.is-y { width: 1px; }
.insp-gap-n { position: absolute; padding: 0 3px; font-family: var(--mono); font-size: 10px; line-height: 14px; font-weight: 700; white-space: nowrap; color: #ffffff; background: var(--measure); border: 0; border-radius: 0; pointer-events: auto; cursor: copy; }
.insp-gap.is-x .insp-gap-n { left: 50%; top: 4px; transform: translateX(-50%); }
.insp-gap.is-y .insp-gap-n { left: 6px; top: 50%; transform: translateY(-50%); }
