/*
 * SnapHop API console, in the SnapHop Design System as written (ADR 0011, ADR 0012; DESIGN.md records the revision).
 * Colour comes in three layers: the ramp (absolute values), the --sac-* roles (what a colour is for, the only names a
 * rule below uses, each the design-system role it names) and the themes, which re-declare the roles. Every role is
 * declared in one cascade layer, so a host's own declaration of a --sac-* property, in no layer, wins whatever its
 * selector and whichever theme shows.
 */
@layer snaphop-api-console {
    :where(.sac) {
        /* Ramp: the design system's values, which never flip between themes. */
        --sac-white: #ffffff;
        --sac-ink-1000: #1a1b26;
        --sac-ink-750: #363c4d;
        --sac-ink-590: #575d79;
        --sac-ink-600: #565a6e;
        --sac-ink-580: #5a607b;
        --sac-ink-570: #5e647e;
        --sac-line-strong: #c1c2c7;
        --sac-line-450: #d2d4dd;
        --sac-line-250: #e0e2e8;
        --sac-line-150: #e4e5eb;
        --sac-line-100: #e6e7ed;
        --sac-line-75: #eaebf0;
        --sac-grey-50: #f7f8fb;
        --sac-grey-150: #eceef3;
        --sac-blue-100: #e2eaf6;
        --sac-blue-400: #5f88c4;
        --sac-blue-500: #2959aa;
        --sac-blue-600: #204a90;
        --sac-blue-700: #0f4b6e;
        --sac-green-700: #385f0d;
        --sac-cyan-500: #006c86;
        --sac-purple-500: #65359d;
        --sac-amber-500: #a87016;
        --sac-amber-750: #875812;
        --sac-red-50: #faf1f1;
        --sac-red-200: #e3c9c9;
        --sac-red-600: #942f2f;
        --sac-dark-950: #16161e;
        --sac-dark-900: #1a1b26;
        --sac-dark-850: #1f2335;
        --sac-dark-800: #24283b;
        --sac-dark-650: #3b4261;
        --sac-dark-600: #414868;
        --sac-dark-300: #a9b1d6;
        --sac-dark-200: #c0caf5;

        /* Roles, light. Each names the design-system role it translates. */
        --sac-strong: var(--sac-ink-1000);          /* text-strong */
        --sac-text: var(--sac-ink-750);             /* text-body */
        --sac-label: var(--sac-ink-590);            /* text-label */
        --sac-detail: var(--sac-ink-600);           /* text-detail */
        --sac-muted: var(--sac-ink-580);            /* text-muted */
        --sac-eyebrow: var(--sac-ink-580);          /* text-eyebrow */
        --sac-faint: var(--sac-ink-570);            /* text-faint */
        --sac-link: var(--sac-blue-500);            /* text-link */
        --sac-link-hover: var(--sac-blue-700);      /* text-link-hover */
        --sac-invalid: var(--sac-amber-750);        /* text-invalid */
        --sac-danger: var(--sac-red-600);           /* status-danger-fg */
        --sac-ok: var(--sac-green-700);             /* status-ok-fg */
        --sac-canvas: var(--sac-line-100);          /* surface-app */
        --sac-surface: var(--sac-white);            /* surface-card */
        --sac-control: var(--sac-white);            /* surface-control */
        --sac-control-disabled: var(--sac-grey-150);/* surface-control-disabled */
        --sac-subtle: var(--sac-grey-50);           /* surface-subtle */
        --sac-panel: var(--sac-line-75);            /* surface-panel */
        --sac-danger-subtle: var(--sac-red-50);     /* surface-danger-subtle */
        --sac-border: var(--sac-line-250);          /* border-control */
        --sac-border-hover: var(--sac-line-strong); /* border-control-hover */
        --sac-border-card: var(--sac-line-150);     /* border-card */
        --sac-border-divider: var(--sac-line-100);  /* border-divider */
        --sac-border-row: var(--sac-line-75);       /* border-row */
        --sac-border-dashed: var(--sac-line-450);   /* border-dashed */
        --sac-border-invalid: var(--sac-amber-500); /* border-invalid */
        --sac-border-danger: var(--sac-red-200);    /* border-danger */
        --sac-accent: var(--sac-blue-500);          /* accent */
        --sac-accent-hover: var(--sac-blue-600);    /* accent-hover */
        --sac-accent-quiet: var(--sac-blue-100);    /* accent-quiet */
        --sac-on-accent: var(--sac-white);          /* text-on-accent */
        --sac-focus: var(--sac-blue-400);           /* focus-ring */
        --sac-focus-halo: var(--sac-blue-100);      /* focus-halo */
        /*
         * JSON, as the SnapHop editor colours it (ADR 0013). The design system declares no syntax role, so these are
         * the editor's: in light a ramp step, in dark a dark role's value, each 4.5:1 or better on every surface JSON
         * sits on -- the control and the panel -- in both themes.
         */
        --sac-syntax-key: var(--sac-blue-500);      /* the editor's --se-key */
        --sac-syntax-string: var(--sac-green-700);  /* --se-string */
        --sac-syntax-number: var(--sac-cyan-500);   /* --se-number */
        --sac-syntax-literal: var(--sac-purple-500);/* --se-literal: true, false, null */
        --sac-syntax-punctuation: var(--sac-ink-600);/* --se-punctuation, text-detail */

        /* Geometry, type and motion. Hosts that serve Inter and JetBrains Mono get them; the console loads no font. */
        --sac-radius: 6px;                          /* radius-md: buttons */
        --sac-radius-panel: 7px;                    /* radius-lg: inputs, in-card panels */
        --sac-radius-card: 9px;                     /* radius-xl: cards */
        /*
         * Type sizes, the design system's half-point scale: every rule below names a size through one of these, never
         * a literal, and each text is one of upstream's "Type in an application" roles.
         */
        --sac-text-2xs: 9.5px;                      /* text-2xs: table headers, eyebrows */
        --sac-text-xs: 10.5px;                      /* text-xs: help, meta, Mono */
        --sac-text-sm: 11px;                        /* text-sm: labels, buttons */
        --sac-text-base: 11.5px;                    /* text-base: body, inputs, code blocks */
        --sac-text-md: 12px;                        /* text-md: ErrorSummary's title */
        --sac-text-lg: 12.5px;                      /* text-lg: a card's title */
        --sac-text-2xl: 14px;                       /* text-2xl: ErrorState's and EmptyState's titles */
        --sac-text-5xl: 19px;                       /* text-5xl: the page title, type-title */
        /* Control heights: a field and the button beside it of the same size line up. */
        --sac-control-height-sm: 28px;              /* control-height-sm */
        --sac-control-height-md: 32px;              /* control-height-md */
        --sac-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
        --sac-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
        --sac-ease-standard: cubic-bezier(.2, 0, .2, 1); /* ease-standard */
        --sac-duration-fast: 120ms;                 /* duration-fast */
        --sac-transition-control: background-color var(--sac-duration-fast) var(--sac-ease-standard),
            border-color var(--sac-duration-fast) var(--sac-ease-standard), color var(--sac-duration-fast) var(--sac-ease-standard);
    }

    /*
     * Themes. data-theme="light", "dark" or "auto" on the console's root or on any element around it chooses one, and the
     * nearest wins, as the design system's themes do: each theme's scope -- the element that chooses it, the console
     * included, and what it holds -- stops at an element that chooses another. With
     * none anywhere, the console follows the reader's preference. Dark is screen-only, so a page prints light, and forced
     * colours replace every theme.
     */
    @media screen and (forced-colors: none) {
        @scope ([data-theme="dark"]) to ([data-theme="light"], [data-theme="auto"]) {
            :where(:scope.sac, :scope .sac) {
                --sac-strong: var(--sac-dark-200);
                --sac-text: var(--sac-dark-300);
                --sac-label: #949cc5;
                --sac-detail: #99a1cb;
                --sac-muted: #8f98c1;
                --sac-eyebrow: #8f98c1;
                --sac-faint: #8c94bc;
                --sac-link: #7aa2f7;
                --sac-link-hover: #9ab8ff;
                --sac-invalid: #e0af68;
                --sac-danger: #f7768e;
                --sac-ok: #9ece6a;
                --sac-canvas: var(--sac-dark-900);
                --sac-surface: var(--sac-dark-850);
                --sac-control: var(--sac-dark-850);
                --sac-control-disabled: #22263a;
                --sac-subtle: var(--sac-dark-800);
                --sac-panel: var(--sac-dark-800);
                --sac-danger-subtle: #2b1f28;
                --sac-border: #343a54;
                --sac-border-hover: var(--sac-dark-600);
                --sac-border-card: #2b3049;
                --sac-border-divider: var(--sac-dark-800);
                --sac-border-row: #232739;
                --sac-border-dashed: var(--sac-dark-650);
                --sac-border-invalid: #e0af68;
                --sac-border-danger: #5c3140;
                --sac-accent: #7aa2f7;
                --sac-accent-hover: #9ab8ff;
                --sac-accent-quiet: #283457;
                --sac-on-accent: var(--sac-dark-950);
                --sac-focus: #7aa2f7;
                --sac-focus-halo: rgba(122, 162, 247, .28);
                --sac-syntax-key: #7aa2f7;
                --sac-syntax-string: #9ece6a;
                --sac-syntax-number: #7dcfff;
                --sac-syntax-literal: #9ab8ff;          /* text-link-hover: the dark theme declares no purple */
                --sac-syntax-punctuation: #99a1cb;      /* text-detail */
            }
        }
    }
    @media screen and (forced-colors: none) and (prefers-color-scheme: dark) {
        @scope ([data-theme="auto"]) to ([data-theme="light"], [data-theme="dark"]) {
            :where(:scope.sac, :scope .sac) {
                --sac-strong: var(--sac-dark-200);
                --sac-text: var(--sac-dark-300);
                --sac-label: #949cc5;
                --sac-detail: #99a1cb;
                --sac-muted: #8f98c1;
                --sac-eyebrow: #8f98c1;
                --sac-faint: #8c94bc;
                --sac-link: #7aa2f7;
                --sac-link-hover: #9ab8ff;
                --sac-invalid: #e0af68;
                --sac-danger: #f7768e;
                --sac-ok: #9ece6a;
                --sac-canvas: var(--sac-dark-900);
                --sac-surface: var(--sac-dark-850);
                --sac-control: var(--sac-dark-850);
                --sac-control-disabled: #22263a;
                --sac-subtle: var(--sac-dark-800);
                --sac-panel: var(--sac-dark-800);
                --sac-danger-subtle: #2b1f28;
                --sac-border: #343a54;
                --sac-border-hover: var(--sac-dark-600);
                --sac-border-card: #2b3049;
                --sac-border-divider: var(--sac-dark-800);
                --sac-border-row: #232739;
                --sac-border-dashed: var(--sac-dark-650);
                --sac-border-invalid: #e0af68;
                --sac-border-danger: #5c3140;
                --sac-accent: #7aa2f7;
                --sac-accent-hover: #9ab8ff;
                --sac-accent-quiet: #283457;
                --sac-on-accent: var(--sac-dark-950);
                --sac-focus: #7aa2f7;
                --sac-focus-halo: rgba(122, 162, 247, .28);
                --sac-syntax-key: #7aa2f7;
                --sac-syntax-string: #9ece6a;
                --sac-syntax-number: #7dcfff;
                --sac-syntax-literal: #9ab8ff;          /* text-link-hover: the dark theme declares no purple */
                --sac-syntax-punctuation: #99a1cb;      /* text-detail */
            }
        }
        :where(.sac:not([data-theme], [data-theme] *)) {
            --sac-strong: var(--sac-dark-200);
            --sac-text: var(--sac-dark-300);
            --sac-label: #949cc5;
            --sac-detail: #99a1cb;
            --sac-muted: #8f98c1;
            --sac-eyebrow: #8f98c1;
            --sac-faint: #8c94bc;
            --sac-link: #7aa2f7;
            --sac-link-hover: #9ab8ff;
            --sac-invalid: #e0af68;
            --sac-danger: #f7768e;
            --sac-ok: #9ece6a;
            --sac-canvas: var(--sac-dark-900);
            --sac-surface: var(--sac-dark-850);
            --sac-control: var(--sac-dark-850);
            --sac-control-disabled: #22263a;
            --sac-subtle: var(--sac-dark-800);
            --sac-panel: var(--sac-dark-800);
            --sac-danger-subtle: #2b1f28;
            --sac-border: #343a54;
            --sac-border-hover: var(--sac-dark-600);
            --sac-border-card: #2b3049;
            --sac-border-divider: var(--sac-dark-800);
            --sac-border-row: #232739;
            --sac-border-dashed: var(--sac-dark-650);
            --sac-border-invalid: #e0af68;
            --sac-border-danger: #5c3140;
            --sac-accent: #7aa2f7;
            --sac-accent-hover: #9ab8ff;
            --sac-accent-quiet: #283457;
            --sac-on-accent: var(--sac-dark-950);
            --sac-focus: #7aa2f7;
            --sac-focus-halo: rgba(122, 162, 247, .28);
            --sac-syntax-key: #7aa2f7;
            --sac-syntax-string: #9ece6a;
            --sac-syntax-number: #7dcfff;
            --sac-syntax-literal: #9ab8ff;
            --sac-syntax-punctuation: #99a1cb;
        }
    }
    /*
     * Forced colours: every role a system colour, as the design system maps them. Every structural border is CanvasText,
     * the disabled dashed edge GrayText, and the two edges that mark an interaction, hover and focus, Highlight.
     */
    @media (forced-colors: active) {
        :where(.sac) {
            --sac-strong: CanvasText;
            --sac-text: CanvasText;
            --sac-label: CanvasText;
            --sac-detail: CanvasText;
            --sac-muted: CanvasText;
            --sac-eyebrow: CanvasText;
            --sac-faint: GrayText;
            --sac-link: LinkText;
            --sac-link-hover: LinkText;
            --sac-invalid: CanvasText;
            --sac-danger: CanvasText;
            --sac-ok: CanvasText;
            --sac-canvas: Canvas;
            --sac-surface: Canvas;
            --sac-control: Field;
            --sac-control-disabled: Canvas;
            --sac-subtle: Canvas;
            --sac-panel: Canvas;
            --sac-danger-subtle: Canvas;
            --sac-border: CanvasText;
            --sac-border-hover: Highlight;
            --sac-border-card: CanvasText;
            --sac-border-divider: CanvasText;
            --sac-border-row: CanvasText;
            --sac-border-dashed: GrayText;
            --sac-border-invalid: CanvasText;
            --sac-border-danger: CanvasText;
            --sac-accent: Highlight;
            --sac-accent-hover: Highlight;
            --sac-accent-quiet: Canvas;
            --sac-on-accent: HighlightText;
            --sac-focus: Highlight;
            --sac-focus-halo: transparent;
            --sac-syntax-key: CanvasText;
            --sac-syntax-string: CanvasText;
            --sac-syntax-number: CanvasText;
            --sac-syntax-literal: CanvasText;
            --sac-syntax-punctuation: CanvasText;
            forced-color-adjust: none;
        }
    }
}

.sac {
    color-scheme: light;
    max-width: 1080px;
    margin: 0 auto;
    padding: 16px 18px;
    color: var(--sac-text);
    background: var(--sac-canvas);
    font: 450 var(--sac-text-base)/1.55 var(--sac-font);
    -webkit-font-smoothing: antialiased;
}
/* The browser's own controls and scrollbars follow the theme, chosen as the roles are. */
@media screen and (forced-colors: none) {
    @scope ([data-theme="dark"]) to ([data-theme="light"], [data-theme="auto"]) {
        :scope.sac, :scope .sac { color-scheme: dark; }
    }
}
@media screen and (forced-colors: none) and (prefers-color-scheme: dark) {
    @scope ([data-theme="auto"]) to ([data-theme="light"], [data-theme="dark"]) {
        :scope.sac, :scope .sac { color-scheme: dark; }
    }
    .sac:not([data-theme], [data-theme] *) { color-scheme: dark; }
}

.sac *, .sac *::before, .sac *::after { box-sizing: border-box; }
.sac ::selection { color: var(--sac-strong); background: var(--sac-accent-quiet); }
/* In forced colours the selection would be Canvas behind CanvasText; it takes the system's pair. */
@media (forced-colors: active) {
    .sac ::selection { color: HighlightText; background: Highlight; }
}
.sac h1 { margin: 0 0 4px; color: var(--sac-strong); font-size: var(--sac-text-5xl); font-weight: 700; letter-spacing: -0.025em; line-height: 1.35; }
/*
 * A section over a run of cards -- "Operations (8)", a tag's operations -- is labelled with the design system's Eyebrow
 * at its default: sans, 9.5px at 700, uppercase, label tracking. "Type in an application" has no larger heading between
 * the page title and a card's title.
 */
.sac h2 {
    margin: 26px 0 10px;
    color: var(--sac-eyebrow);
    font-size: var(--sac-text-2xs);
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1.55;
    text-transform: uppercase;
}
.sac h3 { margin: 0 0 6px; color: var(--sac-strong); font-size: var(--sac-text-lg); font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
/* Machine values are Mono, type-identifier: 10.5px with mono tracking, in a title as anywhere else. */
.sac code, .sac-method { font-family: var(--sac-mono); font-size: var(--sac-text-xs); letter-spacing: .03em; }
/* A code block is the design system's mono block: body size at code leading. */
.sac pre { font-family: var(--sac-mono); font-size: var(--sac-text-base); line-height: 1.75; }
.sac pre code { font-size: inherit; letter-spacing: normal; }
/* Machine strings read left to right in any direction, isolated from the words around them. */
.sac code, .sac pre, .sac-method { direction: ltr; unicode-bidi: isolate; }
/*
 * A link is underlined, not only coloured: the link blue is about 1.6:1 against body text. 1px at rest, 2px on hover.
 * A folded section's summary is a link that does not navigate, so it is drawn as one.
 */
.sac a, .sac summary {
    color: var(--sac-link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: var(--sac-transition-control);
}
.sac a:hover, .sac summary:hover { color: var(--sac-link-hover); text-decoration-thickness: 2px; }
.sac summary { cursor: pointer; }
.sac :focus-visible { outline: 2px solid var(--sac-focus); outline-offset: 1px; }

.sac-meta, .sac-help { margin: 4px 0 0; color: var(--sac-muted); font-size: var(--sac-text-xs); line-height: 1.55; }
.sac-text { max-width: 820px; white-space: pre-line; overflow-wrap: anywhere; }
.sac-steps { max-width: 820px; margin: 12px 0; padding-inline-start: 22px; }

/* Controls: the key and the filter, a main column and an aside, on upstream's window-width ladder: the aside is
   372px from --bp-xl (1440px) up, 340px from --bp-lg (1180px) up, and under main below that. A width on a step takes
   that step's row. Media queries cannot read custom properties, so the px repeat the tokens. */
.sac-controls { display: grid; gap: 12px; margin: 22px 0; }
@media (min-width: 1180px) {
    .sac-controls { grid-template-columns: 1fr 340px; }
}
@media (min-width: 1440px) {
    .sac-controls { grid-template-columns: 1fr 372px; }
}
/* A field: its label, its control, then its help, or the problem that replaces the help. */
.sac-field { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; }
.sac-controls .sac-field { margin: 0; }
.sac-field > .sac-help { margin: 0; }
.sac-field label { color: var(--sac-label); font-size: var(--sac-text-sm); font-weight: 550; letter-spacing: -0.01em; }
/* A required field's mark: a muted asterisk, aria-hidden and kept on the label's last word; required and aria-required
   on the control are what a reader is told. */
.sac-required { color: var(--sac-muted); font-weight: 450; white-space: nowrap; }
.sac-error { margin: 0; color: var(--sac-invalid); font-size: var(--sac-text-xs); line-height: 1.55; }
.sac input, .sac textarea {
    width: 100%;
    border: 1px solid var(--sac-border);
    border-radius: var(--sac-radius-panel);
    color: var(--sac-strong);
    background: var(--sac-control);
    transition: var(--sac-transition-control);
}
.sac input { height: var(--sac-control-height-md); padding: 0 11px; font: 450 var(--sac-text-base) var(--sac-font); letter-spacing: -0.01em; }
.sac textarea { padding: 9px 11px; font: 450 var(--sac-text-base)/1.55 var(--sac-mono); resize: vertical; }
/*
 * A field's edge says its state, in the design system's order: invalid, focused, disabled, hovered, at rest. Hover is
 * one border step with no tint, and has the least weight, so focus and invalid always show over it.
 */
.sac input:where(:hover:not(:disabled)), .sac textarea:where(:hover:not(:disabled)) { border-color: var(--sac-border-hover); }
/* An input takes the accent border and a 3px halo rather than an outline. */
.sac input:focus-visible, .sac textarea:focus-visible {
    outline: none;
    border-color: var(--sac-accent);
    box-shadow: 0 0 0 3px var(--sac-focus-halo);
}
/* Invalid is the amber border, whatever else the field is doing. */
.sac input[aria-invalid="true"], .sac textarea[aria-invalid="true"] { border-color: var(--sac-border-invalid); }

.sac button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    overflow: hidden;
    border: 1px solid var(--sac-border);
    border-radius: var(--sac-radius);
    /* Button md: one height every md control shares, so a button lines up with a field beside it. */
    height: var(--sac-control-height-md);
    padding: 0 12px;
    color: var(--sac-text);
    background: var(--sac-control);
    font: 600 var(--sac-text-sm)/1.35 var(--sac-font);
    letter-spacing: -0.01em;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--sac-transition-control);
}
/* Hover is one step, and a disabled or pending button does not react: secondary tints and steps its border. */
.sac button:hover:not(:disabled, [aria-busy="true"]) { border-color: var(--sac-border-hover); background: var(--sac-subtle); }
.sac button.sac-send { border-color: var(--sac-accent); color: var(--sac-on-accent); background: var(--sac-accent); }
.sac button.sac-send:hover:not(:disabled, [aria-busy="true"]) { border-color: var(--sac-accent-hover); background: var(--sac-accent-hover); }
/* Unavailable is a dashed edge and faint words that say why, never a control that fades out. */
.sac button:disabled {
    border-style: dashed;
    border-color: var(--sac-border-dashed);
    color: var(--sac-faint);
    background: var(--sac-control-disabled);
    cursor: default;
}
/*
 * Pending keeps the button's own colours, with a 2px indeterminate rule along its foot that scales from the centre,
 * so it reads the same right to left. Dashed stays for unavailable: the two mean different things.
 */
.sac button[aria-busy="true"] { cursor: progress; }
.sac button[aria-busy="true"]::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 2px;
    background: currentColor;
    opacity: .55;
    transform-origin: center;
    animation: sac-pending 1.1s var(--sac-ease-standard) infinite;
}
@keyframes sac-pending { 0% { transform: scaleX(0); } 50% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
/* Under reduced motion the rule stops and stands still at full width, still saying the request is out. */
@media (prefers-reduced-motion: reduce) {
    .sac button[aria-busy="true"]::after { animation: none; }
}
.sac-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }

.sac-index ul { margin: 0; padding-inline-start: 22px; columns: 2 320px; }
.sac-index li { break-inside: avoid; margin: 3px 0; }
.sac-method { display: inline-block; min-width: 4.2em; }

/*
 * An operation is the design system's Card: white on the canvas, a hairline and no shadow, its title in a header
 * strip over a divider and the rest in its body.
 */
.sac-operation {
    margin: 12px 0;
    border: 1px solid var(--sac-border-card);
    border-radius: var(--sac-radius-card);
    background: var(--sac-surface);
    scroll-margin-block-start: 12px;
}
.sac-operation-header { border-bottom: 1px solid var(--sac-border-divider); padding: 11px 14px; }
.sac-operation-header h3 { margin: 0; }
.sac-operation-body { padding: 13px 14px; }
.sac-summary { margin: 0; }

.sac-answer:empty { display: none; }
.sac-answer { margin-top: 12px; border-top: 1px solid var(--sac-border-divider); padding-top: 12px; }
.sac-answer[data-state="succeeded"] .sac-status { color: var(--sac-ok); }
.sac-answer[data-state="refused"] .sac-status, .sac-answer[data-state="failed"] .sac-status { color: var(--sac-danger); }
.sac-status { margin: 0; font-weight: 600; }
.sac-body, .sac-curl {
    max-height: 420px;
    overflow: auto;
    margin: 8px 0 0;
    border-radius: var(--sac-radius-panel);
    padding: 12px;
    color: var(--sac-text);
    background: var(--sac-panel);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.sac-use-key { margin-top: 8px; }

/*
 * The body is the SnapHop editor's JSON field (ADR 0013), drawn as the editor draws it but in the console's roles: a
 * mono Textarea with its lines numbered in a gutter and a footer holding its check and Format. The textarea's own text
 * is transparent over the coloured copy, which is aria-hidden: the textarea stays the control, the form's field and
 * what is selected and copied.
 */
.sac .se {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    overflow: hidden;
    border: 1px solid var(--sac-border);
    border-radius: var(--sac-radius-panel);
    color: var(--sac-strong);
    background: var(--sac-control);
    font: 450 var(--sac-text-base)/1.55 var(--sac-mono);
    text-align: start;
    transition: var(--sac-transition-control);
    /* The coloured copy is the text a reader sees; forced colours must not also paint the textarea's text over it. */
    forced-color-adjust: none;
}
/* The field's edge says its state, in the design system's order: invalid, then focused, then hovered, then at rest. */
.sac .se:hover { border-color: var(--sac-border-hover); }
.sac .se:has(.se-input:focus) { border-color: var(--sac-accent); box-shadow: 0 0 0 3px var(--sac-focus-halo); }
.sac .se:is(.se-has-error, :has(.se-input[aria-invalid="true"])) { border-color: var(--sac-border-invalid); }
/* The numbers never make the field taller: the textarea sets its height, and they scroll with it. */
.sac .se-gutter {
    height: 0;
    min-height: 100%;
    overflow: hidden;
    padding-block: 9px;
    padding-inline: 10px 8px;
    border-inline-end: 1px solid var(--sac-border);
    color: var(--sac-label);
    text-align: end;
    user-select: none;
}
.sac .se-line { display: block; min-width: 2ch; }
.sac .se-line-error { color: var(--sac-invalid); font-weight: 600; }
.sac .se-body { position: relative; min-width: 0; }
.sac .se-highlight, .sac .se textarea.se-input {
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 9px 11px;
    direction: ltr;
    unicode-bidi: isolate;
    font: inherit;
    letter-spacing: normal;
    white-space: pre;
    tab-size: 2;
    overflow-wrap: normal;
    word-break: normal;
}
.sac .se-highlight {
    position: absolute;
    inset: 0;
    overflow: hidden;
    padding-inline-end: 35px;
    padding-block-end: 33px;
    color: var(--sac-strong);
    pointer-events: none;
}
.sac .se textarea.se-input {
    position: relative;
    display: block;
    min-height: 8em;
    overflow: auto;
    outline: none;
    color: transparent;
    background: transparent;
    box-shadow: none;
    caret-color: var(--sac-strong);
    transition: none;
}
.sac .se-footer {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 36px;
    padding-block: 4px;
    padding-inline: 10px 6px;
    border-block-start: 1px solid var(--sac-border);
    font-family: var(--sac-font);
}
/* The editor's check is a Field's error: 10.5px in text-invalid, said as the text is typed. */
.sac .se-message { flex: 1; margin: 0; color: var(--sac-invalid); font-size: var(--sac-text-xs); line-height: 1.55; }
/* Format is a small secondary Button, at the sm height; unavailable, it is dashed and says why in its label. */
.sac button.se-format { margin-inline-start: auto; height: var(--sac-control-height-sm); padding: 0 10px; font-weight: 550; }

/* JSON, in the body field and in an answer: the editor's classes, in the syntax roles. */
.sac .se-key { color: var(--sac-syntax-key); }
.sac .se-string { color: var(--sac-syntax-string); }
.sac .se-number { color: var(--sac-syntax-number); }
.sac .se-literal { color: var(--sac-syntax-literal); }
.sac .se-punctuation { color: var(--sac-syntax-punctuation); }
/* What is not JSON is underlined as well as amber, so an error is never shown by colour alone. */
.sac .se-invalid {
    color: var(--sac-invalid);
    text-decoration: wavy underline var(--sac-invalid);
    text-decoration-skip-ink: none;
}

/* A body's fields are the design system's DataTable: a card, a subtle header strip, hairline rows. */
.sac-fields { margin-top: 8px; }
.sac-table {
    overflow-x: auto;
    margin-top: 6px;
    border: 1px solid var(--sac-border-card);
    border-radius: var(--sac-radius-card);
    background: var(--sac-surface);
}
.sac table { width: 100%; border-collapse: collapse; }
.sac th, .sac td { padding: 11px 6px; text-align: start; vertical-align: middle; overflow-wrap: anywhere; }
.sac th:first-child, .sac td:first-child { padding-inline-start: 15px; }
.sac th:last-child, .sac td:last-child { padding-inline-end: 15px; }
.sac th {
    padding-block: 9px;
    border-bottom: 1px solid var(--sac-border-divider);
    color: var(--sac-muted);
    background: var(--sac-subtle);
    font-size: var(--sac-text-2xs);
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.sac td { border-bottom: 1px solid var(--sac-border-row); color: var(--sac-text); }
.sac tbody tr:hover { background: var(--sac-subtle); }
.sac-other { margin-top: 32px; }

/* A form that a press found problems in: the design system's ErrorSummary, red since the form refused to go. */
.sac-error-summary:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
    border: 1px solid var(--sac-border-danger);
    border-radius: var(--sac-radius-panel);
    padding: 12px 14px;
    background: var(--sac-danger-subtle);
    outline: none;
}
.sac-error-summary-title { margin: 0; color: var(--sac-danger); font-size: var(--sac-text-md); font-weight: 650; letter-spacing: -0.02em; }
.sac-error-summary ol { display: flex; flex-direction: column; gap: 5px; margin: 0; padding-inline-start: 18px; }
.sac-error-summary li { color: var(--sac-text); text-wrap: pretty; }
.sac-error-summary li a, .sac-error-summary li strong { font-weight: 600; }
.sac-error-summary li strong { color: var(--sac-strong); }
.sac-error-summary-note { margin: 0; color: var(--sac-detail); font-size: var(--sac-text-xs); }

/* A description that could not be read: the design system's ErrorState, a system that failed. */
.sac-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    border: 1px dashed var(--sac-border-danger);
    border-radius: var(--sac-radius-card);
    padding: 44px 22px;
    background: var(--sac-surface);
    text-align: center;
}
.sac-error-state p { margin: 0; }
.sac-error-title { color: var(--sac-danger); font-size: var(--sac-text-2xl); font-weight: 650; letter-spacing: -0.02em; }
.sac-error-reason { max-width: 440px; color: var(--sac-detail); text-wrap: pretty; }
.sac-error-retry { color: var(--sac-muted); font-size: var(--sac-text-xs); }
.sac-error-action { margin-top: 4px; }

/* Nothing to show: the design system's EmptyState, a dashed panel that names the empty condition in plain words. */
.sac-empty:not([hidden]) {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    margin: 12px 0;
    border: 1px dashed var(--sac-border-dashed);
    border-radius: var(--sac-radius-card);
    padding: 52px 22px;
    background: var(--sac-surface);
    text-align: center;
}
.sac-empty p { margin: 0; }
.sac-empty-title { color: var(--sac-strong); font-size: var(--sac-text-2xl); font-weight: 650; letter-spacing: -0.02em; }
.sac-empty-text { max-width: 420px; color: var(--sac-detail); text-wrap: pretty; }

/* On paper: drop what cannot be done there, marked at the source, and keep every piece of information. */
@media print {
    .sac { background: #fff; }
    .sac, .sac * { box-shadow: none; }
    .sac [data-print="hide"] { display: none; }
    .sac [data-scroll] { max-height: none; overflow: visible; }
    .sac [data-block] { break-inside: avoid; }
    .sac [aria-busy="true"]::after { display: none; }
    /*
     * A textarea prints only the part in view, so the body prints whole from its coloured copy, wrapped; its line
     * numbers would no longer match wrapped lines, and Format cannot be pressed on paper. Its check is still written.
     */
    .sac .se { overflow: visible; }
    .sac :is(.se-gutter, .se-format, .se textarea.se-input) { display: none; }
    .sac .se-body { grid-column: 1 / -1; }
    .sac .se-highlight {
        position: static;
        overflow: visible;
        padding: 9px 11px;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
    }
    /* A folded section holds information, so it prints open; the module also opens it when printing starts. */
    .sac details::details-content { content-visibility: visible; }
    @page { margin: 14mm; }
}
