/* AVstackr external records console modal — the External Records Console window's own rules on Global Settings
   (/global-config).
   ========================================================================
   Built to docs/superpowers/plans/2026-11-14-global-config-friendly-style.md (Tasks 3 and 4). The author-facing
   shell (frame, header, body, notices, panel, field register, chips, footer, buttons and numbers), the
   right-aligned footer and the note are shared with the other author-facing windows in author-modal.css, as
   `am-` classes; that file carries the register, the colour token table and the --am-radius-* steps declared
   on .am-modal, which the rules here use. This file holds only what the console window alone uses, every
   class `erc-` prefixed: the modal element
   (ExternalRecordsConsoleModal.razor) wears `am-modal erc-modal`, and the console body
   (ExternalRecordsConsole.razor) lays its Inputs, Result and History panels out as `am-panel erc-panel`.
   A plain stylesheet rather than a scoped .razor.css, because the window is drawn by two components on the
   same shell as the others. Colours are --app-* tokens only; no literal colours and no important flags.

   Promotion rule: a class used by a second author-facing window moves to author-modal.css as `am-`.

   Tool names, namespaces, ids, the JSON and the timings are identifiers and numbers, so they take the
   monospace stack; the output and the history summaries wrap rather than clip.
   ======================================================================== */

/* ── shell ──────────────────────────────────────────────────────────────── */

/* The shared rule's max-width: calc(100vw - 48px) already bounds the width on small screens. */
.erc-modal { width: 1140px; }

/* The terminal glyph before the title, in the label colour: it names the window, it does not signal a state. */
.erc-title-icon {
    font-size: 18px;
    color: var(--app-text-label);
}

/* ── layout ─────────────────────────────────────────────────────────────── */

/* Inputs on the left, Result and History on the right; one column on a narrow screen. */
.erc-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
    gap: 16px;
}

@media (max-width: 768px) {
    .erc-grid { grid-template-columns: minmax(0, 1fr); }
}

.erc-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* A panel stacks its title, fields and actions. */
.erc-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Result and the last call's timing on one line. */
.erc-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.erc-panel-title { margin: 0; }

/* ── inputs ─────────────────────────────────────────────────────────────── */

.erc-tool {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
}

.erc-payload.am-textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    background: var(--app-surface-panel);
}

.erc-run {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ── result ─────────────────────────────────────────────────────────────── */

/* The tool's JSON response; long lines wrap inside the panel and a long response scrolls. */
.erc-output {
    max-height: 460px;
    margin: 0;
    padding: 10px 12px;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--app-text-data);
    background: var(--app-surface-panel);
    border: 1px solid var(--app-border-hairline);
    border-radius: calc(var(--am-radius-panel) - 4px);
}

/* The two-step delete gate inside the warning notice. */
.erc-confirm { font-size: 13px; }

.erc-confirm-text { margin: 4px 0 10px; }

.erc-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ── history ────────────────────────────────────────────────────────────── */

.erc-history {
    max-height: 320px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.erc-history-item {
    padding: 8px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--app-border-hairline);
}
.erc-history-item:last-child { border-bottom: 0; }

.erc-history-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    color: var(--app-text-data);
}

.erc-history-meta { color: var(--app-text-label); }

/* The call's one-line summary wraps rather than clips. */
.erc-history-summary {
    margin-top: 2px;
    overflow-wrap: anywhere;
    color: var(--app-text-label);
}
