/* POD INSPECTOR — a publisher's document, tags apart from text.

   Same rules as the rest of the site: nothing leaves the page beyond the reader on the VPS, no
   library, and every colour is a palette role so the white theme inverts with everything else. A
   test refuses any literal colour in this file. */

.brain-container.has-pod-inspector {
    position: relative;
}

.pod-inspector-view {
    position: absolute;
    inset: 0;
    /* above the cubes, which set z-index 50 inline on the BACK cube */
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.9rem 1rem 1rem;
    background: var(--page);
    border: 2px solid var(--rule);
    color: var(--ink);
    overflow-y: auto;
    /* NOT `contain`: the code block scrolls on its own, and a reader moving the page with one finger
       needs the drag to chain out when it runs out. */
    overscroll-behavior: auto;
    font-family: 'Courier New', monospace;
}

.pod-inspector-view[hidden],
.pod-inspector-view [hidden] {
    display: none !important;
}

.pod-inspector-view__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 0.4rem;
}

.pod-inspector-view__title {
    font-size: 1.05rem;
    letter-spacing: 0.16em;
    color: var(--accent-text);
}

.pod-inspector-view__sub {
    margin-top: 0.15rem;
    font-size: 0.66rem;
    color: var(--muted);
}

.pod-inspector-view__close {
    flex: none;
    width: 2rem;
    height: 2rem;
    font-size: 1.1rem;
    line-height: 1;
    background: var(--surface);
    color: var(--ink);
    border: 2px solid var(--cube-edge);
    cursor: pointer;
}

.pod-inspector-view__close:hover,
.pod-inspector-view__close:focus-visible {
    background: var(--active);
    color: var(--page);
}

.pod-inspector-view__form {
    display: flex;
    gap: 0.4rem;
}

.pod-inspector-url {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.42rem 0.55rem;
    font-family: inherit;
    font-size: 0.74rem;
    background: var(--surface);
    color: var(--ink);
    border: 2px solid var(--cube-edge);
}

.pod-inspector-url:focus-visible {
    outline: 2px solid var(--active);
    outline-offset: 1px;
}

.pod-inspector-go {
    flex: none;
    padding: 0 0.75rem;
    font-family: inherit;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    background: var(--surface);
    color: var(--accent-text);
    border: 2px solid var(--cube-edge);
    cursor: pointer;
}

.pod-inspector-go:hover,
.pod-inspector-go:focus-visible {
    background: var(--active);
    color: var(--page);
    border-color: var(--active);
}

.pod-inspector-view__status {
    min-height: 1rem;
    font-size: 0.68rem;
    color: var(--muted);
}

.pod-inspector-view__status.is-error {
    color: var(--accent-text);
}

.pod-inspector-link {
    padding: 0;
    font-family: inherit;
    font-size: 0.68rem;
    background: none;
    color: var(--accent-text);
    border: 0;
    border-bottom: 1px dotted var(--accent-text);
    cursor: pointer;
    word-break: break-all;
}

.pod-inspector-view__tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pod-inspector-tags {
    position: relative;
    font-size: 0.7rem;
}

.pod-inspector-tags__summary {
    cursor: pointer;
    padding: 0.16rem 0.5rem;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--cube-edge);
}

.pod-inspector-tags__summary:hover {
    color: var(--ink);
}

.pod-inspector-tags__menu {
    position: absolute;
    z-index: 2;
    top: 100%;
    left: 0;
    margin-top: 0.2rem;
    max-height: 16rem;
    overflow-y: auto;
    padding: 0.4rem;
    min-width: 15rem;
    background: var(--page);
    border: 2px solid var(--cube-edge);
    box-shadow: 0 4px 12px var(--scrim);
}

.pod-inspector-tags__all {
    width: 100%;
    margin-bottom: 0.3rem;
    padding: 0.12rem 0.4rem;
    font-family: inherit;
    font-size: 0.66rem;
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--cube-edge);
    cursor: pointer;
}

.pod-inspector-tags__row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.1rem 0.15rem;
    cursor: pointer;
}

.pod-inspector-tags__row:hover {
    background: var(--surface);
}

.pod-inspector-tags__name {
    flex: 1 1 auto;
    color: var(--ink);
}

.pod-inspector-tags__count {
    flex: none;
    color: var(--muted);
}

.pod-inspector-clear {
    padding: 0.16rem 0.5rem;
    font-family: inherit;
    font-size: 0.66rem;
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--cube-edge);
    cursor: pointer;
}

.pod-inspector-clear:hover,
.pod-inspector-clear:focus-visible {
    color: var(--ink);
    border-color: var(--active);
}

.pod-inspector-view__code {
    flex: 1 1 auto;
    margin: 0;
    min-height: 8rem;
    max-height: none;
    padding: 0.6rem 0.7rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--rule);
}

/* Markup carries the accent, the content stays ordinary ink: that split is the whole tool. */
.pod-inspector-tag {
    color: var(--accent-text);
}

.pod-inspector-tag.is-comment,
.pod-inspector-tag.is-cdata,
.pod-inspector-tag.is-decl,
.pod-inspector-tag.is-pi {
    color: var(--muted);
}

/* A tag picked from the dropdown: green, because D marks what is chosen in green. */
.pod-inspector-tag.is-hot {
    background: var(--active);
    color: var(--page);
    border-radius: 2px;
}

.pod-inspector-more {
    align-self: flex-start;
    padding: 0.16rem 0.6rem;
    font-family: inherit;
    font-size: 0.68rem;
    background: var(--surface);
    color: var(--accent-text);
    border: 1px solid var(--cube-edge);
    cursor: pointer;
}

.pod-inspector-more:hover,
.pod-inspector-more:focus-visible {
    border-color: var(--active);
}

.pod-inspector-view__note {
    font-size: 0.66rem;
    color: var(--muted);
}

@media (max-width: 600px) {
    .pod-inspector-view {
        padding: 0.7rem 0.6rem 1rem;
    }

    .pod-inspector-view__code {
        font-size: 0.68rem;
        padding: 0.5rem;
    }
}
