/* AMPS console — "Two-column summary" (chosen 2026-10-12; sketch: docs/design/console-explorations/2026-10-12/sketches/n3-split.html).
   Traditional, quiet, informative, light: soft off-white page, white panels with hairline borders and 12px radius, one sage
   accent. Work on the left, context and help on the right. Every number says what it counts.
   Motion: nothing on navigation; 160ms button press, one 500ms bar fill; all off under reduced motion. */

:root {
  --page: #f2f5f1;
  --panel: #ffffff;
  --line: #d3dfd8;
  --line-strong: #b9ccc2;
  --ink: #0a2a24;
  --muted: #557069;          /* 4.9:1 on --page */
  --sage: #0b6b59;           /* bars, marks */
  --sage-ink: #0b6b59;       /* sage text and filled buttons (6.4:1 on white) */
  --sage-hover: #04342c;
  --tint: #e7f6ef;
  --track: #e7eee8;
  --amber-bg: #fff1c7;      /* the deck's gold-soft, lightened: --amber on it is 4.8:1 */
  --amber-line: #e2a80e;
  --amber: #8a6300;
  --ok: #1f8a5b;
  --error: #c2413a;
  --error-bg: #fdf2f1;
  --ring: rgba(11, 107, 89, .30);
  --code-bg: #0b2b25;
  --code-ink: #ddefe7;
  --code-dim: #7fa69a;
  --code-op: #9fd0a5;
  --code-params: #f2c98b;
  --code-name: #b7c8f5;
  --on-accent: #ffffff;       /* text on filled --sage-ink buttons */
  --error-line: #ebc3bf;
  --tint-line: #cfe6da;
  --placeholder: #7f958e;
  --selection: rgba(11, 107, 89, .20);
  color-scheme: light;
  --sans: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(4, 52, 44, .04);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --fast: 120ms;
  --base: 200ms;
}

/* Dark: the same family on deep icon green (user-feedback-2026-10.md §4.3). The OS decides unless the header toggle
   set data-theme; text pairs keep >= 4.5:1 (checked by apps/console/web/contrast_test.go). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0b1a17; --panel: #112420; --line: #22392f; --line-strong: #33503f; --ink: #e3f0ea; --muted: #9ab5ab;
    --sage: #3fb592; --sage-ink: #5fcfaa; --sage-hover: #8fe0c6; --on-accent: #04241e; --tint: #14302a; --track: #1b322b;
    --amber-bg: #2c2408; --amber-line: #c9930c; --amber: #f2c64a; --ok: #4cc58a; --error: #ff8f86; --error-bg: #2c1514;
    --error-line: #6b302c; --tint-line: #24493d; --placeholder: #6f8a81; --selection: rgba(95, 207, 170, .30);
    --ring: rgba(95, 207, 170, .40); --code-bg: #06120f; --shadow: 0 1px 2px rgba(0, 0, 0, .30); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0b1a17; --panel: #112420; --line: #22392f; --line-strong: #33503f; --ink: #e3f0ea; --muted: #9ab5ab;
  --sage: #3fb592; --sage-ink: #5fcfaa; --sage-hover: #8fe0c6; --on-accent: #04241e; --tint: #14302a; --track: #1b322b;
  --amber-bg: #2c2408; --amber-line: #c9930c; --amber: #f2c64a; --ok: #4cc58a; --error: #ff8f86; --error-bg: #2c1514;
  --error-line: #6b302c; --tint-line: #24493d; --placeholder: #6f8a81; --selection: rgba(95, 207, 170, .30);
  --ring: rgba(95, 207, 170, .40); --code-bg: #06120f; --shadow: 0 1px 2px rgba(0, 0, 0, .30); color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; background: var(--page); }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; background: var(--page); color: var(--ink); font: 400 14px/1.5 var(--sans); font-variant-numeric: tabular-nums; }
::selection { background: var(--selection); color: var(--ink); }
pre ::selection, pre::selection { background: rgba(159, 208, 165, .35); color: #fff; }
input, textarea { caret-color: var(--sage-ink); }
:where(.page, header.site, footer.site, .docs-hint) a { color: var(--sage-ink); font-weight: 600; text-decoration: none; }
:where(.page, header.site, footer.site, .docs-hint) a:hover { text-decoration: underline; text-underline-offset: 3px; }
.page :focus-visible, header.site :focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); border-radius: 6px; }
:where(.page) :is(h1, h2, h3) { margin: 0; font-weight: 700; text-wrap: balance; }
:where(.page) h1 { font-size: 26px; line-height: 1.25; }
:where(.page) h2 { font-size: 15px; line-height: 1.35; }
:where(.page) p { margin: 0 0 .7em; }
:where(.page) p:last-child { margin-bottom: 0; }
strong, b { font-weight: 700; }
.muted { color: var(--muted); }
.dim { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.trunc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.trunc { display: table-cell; max-width: 0; } /* a truncating cell stays a cell: display:block would pull it out of its row (files, staff users) */
.id, .path { font: 13px/1.4 var(--mono); }
.select-all { user-select: all; cursor: text; }
td .path.trunc { margin-top: 2px; max-width: 100%; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
main { flex: 1; }
main.page { padding: 32px 0 64px; }
main.docs { padding: 0; overflow-x: clip; }

/* ---------- top bar ---------- */
header.site { position: sticky; top: 0; z-index: 20; height: 60px; background: var(--panel); border-bottom: 1px solid var(--line); }
header.site .wrap { height: 100%; display: flex; align-items: center; gap: 40px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 17px; text-decoration: none; flex: none; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 24px; height: 24px; flex: none; display: block; } /* static/amps-icon.svg, also the favicon */
header.site nav { display: flex; align-items: stretch; gap: 28px; flex: 1; height: 100%; min-width: 0; }
header.site nav .tabs { display: flex; gap: 28px; height: 100%; }
header.site nav a:not(.btn):not(.who) { white-space: nowrap; display: flex; align-items: center; height: 100%; color: var(--muted); font-weight: 400; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--fast) ease; }
header.site nav a:not(.btn):not(.who):hover { color: var(--ink); }
header.site nav a.on { color: var(--ink) !important; font-weight: 600 !important; border-bottom-color: var(--sage) !important; }
header.site nav .end { margin-left: auto; display: flex; align-items: center; gap: 20px; }
header.site nav form { margin: 0; display: flex; align-items: center; }
.who { display: inline-flex; align-items: center; gap: 8px; max-width: 18rem; color: var(--muted); font-size: 13px; font-weight: 400; text-decoration: none; }
.who:hover { color: var(--ink); text-decoration: none; }
.who .avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--tint); color: var(--sage-ink); display: inline-grid; place-items: center; font: 700 11px/1.3 var(--sans); text-transform: uppercase; flex: none; }
.who .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who code { font-size: 12px; background: none; padding: 0; color: inherit; }
header.site .btn.quiet { color: var(--sage-ink); font-size: 13px; height: 30px; padding: 0 8px; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub, .sub { margin: 2px 0 0; color: var(--muted); }
.lede { color: var(--muted); font-size: 15px; max-width: 40rem; margin: 6px 0 0; }
.page-head .meta { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 4px; }
.section { margin-top: 16px; }

/* ---------- the two columns ---------- */
.two { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.two > .main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.two > .side { display: flex; flex-direction: column; gap: 16px; }
/* a page with no side column: the same stack as .two > .main, at full width */
.one { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* generic help behind a question-mark button in the page head: the button opens a bubble (console.js); what is
   specific to the account stays on the page */
.help-pop { position: relative; margin-bottom: 4px; }
.help-btn { width: 28px; height: 28px; padding: 0; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted); font: inherit; font-weight: 700; font-size: 14px; line-height: 1; cursor: pointer; }
.help-btn:hover, .help-btn[aria-expanded="true"] { color: var(--sage-ink); border-color: var(--sage-ink); }
.help-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.help-bubble { position: absolute; right: 0; top: calc(100% + 12px); z-index: 20; width: min(380px, calc(100vw - 32px)); padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel); box-shadow: 0 10px 28px rgba(0, 0, 0, .18); }
.help-bubble::before { content: ""; position: absolute; top: -7px; right: 8px; width: 12px; height: 12px; background: var(--panel); border-left: 1px solid var(--line-strong); border-top: 1px solid var(--line-strong); transform: rotate(45deg); }
.help-bubble b { display: block; font-size: 14px; }
.help-bubble p { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.help-bubble p + b { margin-top: 14px; }
.narrow { max-width: 30rem; }
.legal { max-width: 38rem; } /* /privacy and /terms: a column of text panels */
.legal .panel + .panel { margin-top: 14px; }
.legal .panel ul { margin: 0; padding-left: 20px; }
.legal .panel li + li { margin-top: 6px; }
.legal .panel :is(ul, p) + p { margin-top: 10px; }
.page .grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.page .grid > * { min-width: 0; }

/* ---------- panels and cards ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 20px; min-width: 0; }
.panel.flush { padding: 0; }
.panel > .pt, .pt { margin: 0; font-size: 15px; font-weight: 700; padding: 14px 20px 6px; }
.panel.flush > .pt + .psub { margin: -2px 20px 8px; font-size: 13px; color: var(--muted); }
.panel > h2 { margin-bottom: 10px; }
.card .k, .k { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; margin-bottom: 6px; }
.card .big { font-size: 20px; font-weight: 700; line-height: 1.2; }
.card p { font-size: 13px; color: var(--muted); margin-top: 6px; }
.card .status { margin-top: 6px; font-size: 13px; color: var(--ink); }
.note { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber); box-shadow: none; }
.note b { display: block; font-size: 14px; margin-bottom: 4px; }
.note p { color: var(--amber) !important; margin: 0; }
.note a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.help b { display: block; font-size: 14px; margin-bottom: 4px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: 1px; flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--amber); }

/* ---------- meters ---------- */
.meter { padding: 10px 20px 12px; border-top: 1px solid var(--line); }
.pt + .meter, .meter:first-child { border-top: 0; }
.mrow { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.mn { font-weight: 600; line-height: 18px; text-transform: none; }
.md { font-size: 12px; color: var(--muted); line-height: 16px; margin-top: 1px; }
.fig { font-weight: 600; white-space: nowrap; text-align: right; }
.fig span { color: var(--muted); font-weight: 400; }
.fig.hot { color: var(--amber); }
.fig.full { color: var(--error); }
.bar { height: 6px; border-radius: 3px; background: var(--track); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--sage); transform-origin: left center; animation: fill 500ms var(--ease-out) both; }
.bar.hot i { background: var(--amber-line); }
.bar.full i { background: var(--error); }
.bar .stack { display: flex; height: 100%; transform-origin: left center; animation: fill 500ms var(--ease-out) both; }
.bar .stack i { animation: none; }
/* reserved by open uploads: the meter's own colour, hatched (not stored yet; released on cancel or expiry) */
.bar i.held, .held-key { background: repeating-linear-gradient(135deg, var(--sage) 0 2px, color-mix(in srgb, var(--sage) 35%, transparent) 2px 5px); }
.bar.hot i.held, .held-key.hot { background: repeating-linear-gradient(135deg, var(--amber-line) 0 2px, color-mix(in srgb, var(--amber-line) 35%, transparent) 2px 5px); }
.bar.full i.held, .held-key.full { background: repeating-linear-gradient(135deg, var(--error) 0 2px, color-mix(in srgb, var(--error) 35%, transparent) 2px 5px); }
.bar .stack i:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.bar .stack i.held { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.held-key { display: inline-block; width: 10px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
@keyframes fill { from { transform: scaleX(0); } }

/* ---------- lists ---------- */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 12px 32px; align-items: baseline; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.rows a { display: flex; align-items: center; gap: 12px; padding: 11px 0; color: var(--ink); font-weight: 600; text-decoration: none; }
.rows a:hover { color: var(--sage-ink); }
.rows a span { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 400; }
.rows a::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-top: 1.5px solid var(--muted); transform: rotate(45deg); flex: none; transition: transform var(--base) var(--ease-out); }
.rows a:hover::after { transform: translateX(2px) rotate(45deg); border-color: var(--sage-ink); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.page table { width: 100%; border-collapse: collapse; font-size: 13px; }
.page th { text-align: left; font-weight: 600; color: var(--muted); height: 34px; padding: 0 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.page td { height: 40px; padding: 4px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.page tbody tr:last-child td { border-bottom: 0; }
td.num, th.num, .r { text-align: right; }
td.actions { text-align: right; white-space: nowrap; }
table.fixed { table-layout: fixed; }
.panel:not(.flush) table th:first-child, .panel:not(.flush) table td:first-child { padding-left: 0; }
.panel:not(.flush) table th:last-child, .panel:not(.flush) table td:last-child { padding-right: 0; }

/* ---------- tags ---------- */
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--tint); color: var(--sage-ink); white-space: nowrap; vertical-align: middle; }
/* an app's name in a table cell, its badges (default, public or private) side by side on the line under it; a name
   longer than the cell is shortened */
.appname { display: block; min-width: 0; }
.appname a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appname .badges { display: flex; gap: 6px; margin-top: 4px; }
/* the apps table's other columns are fixed, so in a narrow panel the name's column was left with nothing; above the
   phone layout the table keeps a width that leaves the name room, and its wrapper scrolls */
@media (min-width: 721px) { table.apps { min-width: 720px; } }
/* the staff user page's apps sit in the narrow main column beside the side cards, where a column for the app id left
   the table wider than its panel (it scrolled sideways and hid Files). The id goes under the name instead: name and
   badges on one line, the id on the next, and the table fits any width. */
table.staff-apps .appname { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
table.staff-apps .appname a { flex: 0 1 auto; min-width: 0; }
table.staff-apps .appname .badges { margin-top: 0; }
table.staff-apps .appname .id { flex-basis: 100%; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.ok { background: var(--tint); color: var(--sage-ink); }
.pill.warn, .tag { background: var(--amber-bg); color: var(--amber); }
.pill.error { background: var(--error-bg); color: var(--error); }
.tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; vertical-align: middle; }
h1 .pill { vertical-align: 5px; margin-left: 8px; }

/* ---------- buttons ---------- */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px;
  border: 1px solid var(--sage-ink); border-radius: 8px; background: var(--sage-ink); color: var(--on-accent); font: 600 14px/1.3 var(--sans);
  cursor: pointer; text-decoration: none; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out), background-color var(--fast) ease, color var(--fast) ease, box-shadow var(--fast) ease;
}
.btn:hover { background: var(--sage-hover); border-color: var(--sage-hover); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:focus-visible { box-shadow: 0 0 0 3px var(--ring); }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--page); border-color: var(--line-strong); }
.btn.quiet { background: transparent; color: var(--sage-ink); border-color: transparent; }
.btn.quiet:hover { background: var(--tint); color: var(--sage-hover); border-color: transparent; }
.btn.link { background: transparent; border-color: transparent; color: var(--sage-ink); padding: 0 4px; height: 30px; }
.btn.link:hover { background: var(--tint); }
.btn.danger { background: var(--panel); color: var(--error); border-color: var(--error-line); }
.btn.danger:hover { background: var(--error-bg); border-color: var(--error-line); }
.btn.sm { height: 30px; padding: 0 14px; font-size: 13px; }
.btn.lg { height: 42px; padding: 0 20px; font-size: 15px; }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }
.btn.loading { color: transparent !important; pointer-events: none; position: relative; opacity: 1; }
.btn.loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--on-accent) 40%, transparent); border-top-color: var(--on-accent); animation: spin 600ms linear infinite; }
.btn.ghost.loading::after, .btn.quiet.loading::after, .btn.link.loading::after, .btn.danger.loading::after { border-color: var(--line-strong); border-top-color: var(--sage-ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.actions-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.actions-row .hint { color: var(--muted); font-size: 13px; }

/* ---------- forms ---------- */
.page label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin: 0 0 6px; }
.page .field { margin-bottom: 16px; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 6px; }
.page input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), .page .field select {
  width: 100%; min-width: 0; height: 40px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); font: inherit; font-size: 15px;
  transition: border-color var(--fast) ease, box-shadow var(--fast) ease;
}
.page input::placeholder { color: var(--placeholder); }
.page input:focus { outline: none; border-color: var(--sage-ink); box-shadow: 0 0 0 3px var(--ring); }
input.mono { font-family: var(--mono); font-size: 14px; }
.input-row { display: flex; gap: 10px; }
.input-row input { flex: 1; }
.input-row .btn { height: 40px; flex: none; }

/* ---------- code ---------- */
pre, code { font-family: var(--mono); }
.page pre { margin: 0; background: var(--code-bg); color: var(--code-ink); border-radius: 10px; padding: 14px 16px; font-size: 13px; line-height: 1.6; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
pre .c { color: var(--code-dim); }
pre .k { color: var(--code-op); }
.page code { font-size: .92em; background: var(--track); color: var(--ink); padding: .1em .4em; border-radius: 5px; }
pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.secret { position: relative; }
.secret pre { padding: 18px 100px 18px 18px; font-size: 14px; white-space: pre-wrap; word-break: break-all; }
.secret .copy { position: absolute; top: 12px; right: 12px; }
/* the dark key panel's copy button only; a copy button elsewhere (home) keeps its .btn look */
.secret .copy { background: rgba(255, 255, 255, .1); color: var(--code-ink); border-color: rgba(255, 255, 255, .25); }
.secret .copy:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .4); }
.copy span { display: inline-block; transition: filter 160ms ease, opacity 160ms ease; }
.copy.swap span { filter: blur(2px); opacity: .5; }
.secret .copy.done { color: var(--code-op); }
/* a secret shown in place (the app's webhook secret): dots until the eye reveals it, Copy beside it */
.secret-field { display: flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 4px 4px 12px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: var(--page); }
.secret-value, .secret-mask { flex: 1 1 auto; min-width: 0; font: 13px/1.6 var(--mono); }
.secret-value { display: none; overflow-wrap: anywhere; }
.secret-mask { color: var(--muted); letter-spacing: 1px; white-space: nowrap; overflow: hidden; }
.secret-field.revealed .secret-value { display: block; }
.secret-field.revealed .secret-mask, .secret-field.revealed .secret-sr { display: none; }
.icon-btn { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border: 1px solid transparent;
  border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; transition: color var(--fast), background var(--fast); }
.icon-btn:hover { color: var(--ink); background: var(--track); }
.icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .i-hide, .secret-field.revealed .icon-btn .i-show { display: none; }
.secret-field.revealed .icon-btn .i-hide { display: block; }
.secret-field .copy { flex: none; }
.secret-field .copy.done { color: var(--ok); }
.secret-note { margin: 6px 0 0; }

/* ---------- alerts, empty ---------- */
.alert { border-radius: 10px; padding: 12px 16px; font-size: 14px; margin-bottom: 20px; border: 1px solid var(--line); background: var(--panel); }
.alert.error { background: var(--error-bg); border-color: var(--error-line); color: var(--error); }
.alert.info { background: var(--tint); border-color: var(--tint-line); }
.alert.warn { background: var(--amber-bg); border-color: var(--amber-line); }
.empty { padding: 20px; color: var(--muted); font-size: 14px; }
.empty b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }

/* ---------- home ---------- */
.hero { padding: 32px 0 8px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(32px, 4.2vw, 46px); line-height: 1.1; letter-spacing: -.01em; max-width: 12em; }
/* the AMPS acronym, right under the header line, right edge aligned with the header's last control (same .wrap) */
.tagline { margin: -20px 0 8px; text-align: right; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.tagline b { color: var(--sage-ink); }
.hero .lede { font-size: 17px; line-height: 1.55; margin-top: 14px; max-width: 30rem; }
.hero .actions-row { margin-top: 22px; }
.url-card { background: var(--code-bg); color: var(--code-ink); border-radius: 12px; padding: 20px 20px 16px; min-width: 0; }
.url-card .title { color: var(--code-dim); font: 600 12px/1.3 var(--sans); margin-bottom: 12px; display: flex; justify-content: space-between; }
.url { font: 14px/1.7 var(--mono); overflow-wrap: anywhere; }
.url .seg { display: inline-block; }
.url .host { color: var(--code-dim); }
.url .path { font-size: inherit; }
.url .path b { font-weight: 400; padding: 0 2px; border-bottom: 1px dashed var(--code-dim); }
.url .op { color: var(--code-op); }
.url .params { color: var(--code-params); }
.url .name { color: var(--code-name); }
.url-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .12); color: var(--code-dim); font: 12px/1.3 var(--sans); }
.url-legend span { display: inline-flex; align-items: center; gap: 7px; }
.url-legend i { width: 8px; height: 8px; border-radius: 2px; }
.url-legend .k-op { background: var(--code-op); }
.url-legend .k-params { background: var(--code-params); }
.url-legend .k-name { background: var(--code-name); }
.url-legend .k-path { background: var(--code-ink); }
.steps { margin-top: 40px; display: flex; flex-direction: column; gap: 12px; }
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px 24px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 18px 20px; }
.step .n { width: 28px; height: 28px; border-radius: 50%; background: var(--tint); color: var(--sage-ink); display: grid; place-items: center; font: 700 13px/1.3 var(--sans); }
.step h2 { margin-top: 3px; }
.step p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.step .text { min-width: 0; }
.step pre { font-size: 12.5px; grid-column: 3; grid-row: 1; white-space: pre-wrap; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.facts > div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.facts h2 { margin-bottom: 6px; }
.facts p { color: var(--muted); font-size: 14px; }

/* ---------- footer ---------- */
footer.site { border-top: 1px solid var(--line); }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding-top: 18px; padding-bottom: 26px; color: var(--muted); font-size: 12px; }
footer.site a { color: var(--muted); font-weight: 400; }
footer.site .spacer { flex: 1; }
footer.site .version { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }

/* ---------- entrance (home only) ---------- */
.rise { animation: rise 420ms var(--ease-out) both; }
.rise.d1 { animation-delay: 80ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .two { grid-template-columns: 1fr; gap: 16px; }
  .two > .side { padding-top: 0; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 16px; }
  .step { grid-template-columns: 28px minmax(0, 1fr); }
  .step pre { grid-column: 1 / -1; grid-row: auto; margin-top: 8px; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  main.page { padding: 24px 0 48px; }
  h1 { font-size: 24px; }
  /* two rows: brand and sign-in/out on top, the tabs on their own full-width row (they no longer fit beside it) */
  header.site { height: auto; }
  header.site .wrap { flex-wrap: wrap; gap: 0 16px; padding-top: 10px; }
  header.site nav { display: contents; }
  header.site nav .end { order: 1; margin-left: auto; gap: 10px; }
  header.site nav .tabs { order: 2; flex: 0 0 100%; height: 42px; gap: 18px; overflow-x: auto; scrollbar-width: none; }
  header.site nav .tabs::-webkit-scrollbar { display: none; }
  .who { display: none; }
  .panel { padding: 14px 16px; }
  /* apps: name, keys and Files fit a phone; the app id and created date go (both are on the app's own page). The
     fixed column widths of the desktop table add up to more than a phone, which collapsed the name column. */
  table.apps th:nth-child(2), table.apps td:nth-child(2), table.apps th:nth-child(4), table.apps td:nth-child(4) { display: none; }
  table.apps th:nth-child(3) { width: 52px !important; }
  table.apps th:nth-child(5) { width: 84px !important; }
  table.apps td:first-child { overflow-wrap: anywhere; }
  /* staff users list: the user (the link to the account) and its status; apps, last active and created go. The fixed
     widths of the desktop columns left the user column no room at all on a phone. */
  table.users th:nth-child(n+3), table.users td:nth-child(n+3) { display: none; }
  table.users th:nth-child(2) { width: 96px !important; }
  table.users td:first-child { white-space: normal; overflow-wrap: anywhere; }
  table.users td:first-child .id { display: block; font-size: 12px; }
  /* keys: the prefix and its label keep the width; last used and created go (the key's own row says enough) */
  table.keys th:nth-child(2), table.keys td:nth-child(2), table.keys th:nth-child(3), table.keys td:nth-child(3) { display: none; }
  /* staff user page: name (with the app id under it), keys and Files fit a phone; the created date goes */
  table.staff-apps th:nth-child(3), table.staff-apps td:nth-child(3) { display: none; }
  table.staff-apps th:nth-child(2) { width: 52px !important; }
  table.staff-apps th:nth-child(4) { width: 84px !important; }
  .meter { padding: 10px 16px 12px; }
  .pt { padding: 12px 16px 6px !important; }
  th, td { padding-left: 16px; padding-right: 16px; }
  table.uploads th:nth-child(2), table.uploads td:nth-child(2), table.uploads th:nth-child(4), table.uploads td:nth-child(4) { display: none; }
  header.site nav .tabs a[href="/docs"] { display: none; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dt { margin-top: 10px; }
  .dl dt:first-child { margin-top: 0; }
  /* home: the curl steps scroll sideways instead of wrapping inside their JSON */
  .step pre { white-space: pre; overflow-wrap: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .bar i, .bar .stack, .rise { animation: none; }
  .btn:active { transform: none; }
  .rows a::after, .rows a:hover::after { transition: none; transform: rotate(45deg); }
}


/* app pages: breadcrumbs, file listing thumbnails, the file preview */
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs span { margin: 0 6px; color: var(--line-strong); }
.crumbs b { color: var(--ink); font-weight: 600; }
p.sub.crumbs { font: 13px/1.4 var(--mono); }
.thumb { display: block; width: 48px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--tint); }
.icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 8px; background: var(--tint); color: var(--muted); font-size: 18px; vertical-align: middle; }
.icon svg { display: block; }
.icon.dir { color: var(--sage-ink); }
table.files td { vertical-align: middle; }
table.files td.trunc a { display: inline-block; line-height: 1.3; } /* the name sits on the row's centre line, with or without a second line */
.preview { padding: 0; overflow: hidden; background: var(--code-bg); display: flex; justify-content: center; }
.preview img { max-width: 100%; max-height: 520px; display: block; }
.preview video { max-width: 100%; max-height: 520px; display: block; }
.preview.text { display: block; }
.page .preview.text pre.filetext { border-radius: 0; padding: 16px 20px; max-height: 520px; overflow: auto; white-space: pre; tab-size: 4; }
.preview.text p { margin: 0; padding: 8px 20px; background: var(--tint); }
.preview.audio { padding: 24px; background: var(--tint); }
.preview.placeholder { flex-direction: column; align-items: center; gap: 12px; padding: 40px 20px; background: var(--tint); }
.preview.placeholder .icon.file { width: 96px; height: 96px; border-radius: 16px; background: var(--panel); }
.preview.placeholder .icon.file svg { width: 44px; height: 44px; }
.icon.file { flex-direction: column; gap: 1px; }
.icon.file b { font-size: 9px; letter-spacing: .04em; line-height: 1; }
.preview.placeholder .icon.file b { font-size: 13px; }
.icon.file.pdf { color: #b5483b; } .icon.file.vector, .icon.file.image { color: #8a5a9e; } .icon.file.code { color: #3f6f8f; }
.icon.file.archive { color: #8a6d2f; } .icon.file.sheet { color: #3e7d4f; } .icon.file.slides { color: #b06a2c; }
.icon.file.doc { color: #3b5f9e; } .icon.file.video, .icon.file.audio { color: var(--sage-ink); }
.dl.urls dd a.url { font: 13px/1.5 var(--mono); }
@media (max-width: 720px) {
  table.files th:nth-child(5), table.files td:nth-child(5), table.files th:nth-child(3), table.files td:nth-child(3) { display: none; }
}

/* keys: inline forms in a table row, the revoke confirmation row */
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
form.inline select, .actions-row select { font: inherit; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--ink); }
/* the key column takes what is left and truncates (max-width 0 + width 100 % in an auto-layout table); the rest fit
   their content, so the table never needs to scroll sideways */
table.keys { width: 100%; }
table.keys td.trunc { max-width: 0; width: 100%; }
table.keys td.actions { white-space: nowrap; text-align: right; }
table.keys tr.confirm td.actions { white-space: normal; }
table.keys tr.confirm form.inline { flex-wrap: wrap; justify-content: flex-end; }
tr.confirm td { background: var(--amber-bg); }
.actions-row input[name="name"], .actions-row input[name="label"] { flex: 1; min-width: 0; }
/* the new-application form: the name and Create in one row, the Private tick and what it means under it */
.new-app { padding: 12px 20px 16px; }
.new-app .actions-row { margin-top: 0; }
.new-app .check { display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 14px; cursor: pointer; }
.new-app .help { color: var(--muted); font-size: 12px; margin: 4px 0 0; max-width: 64ch; }

/* plans: one card per plan, the current one outlined in sage; the facts stay two columns on a phone (short values) */
.gap-below { margin-bottom: 16px; }

/* ---------- billing: one summary panel (plan, price, status, actions, period), then the invoices ---------- */
.bill-head { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.bill-head .actions-row { margin-top: 0; }
.bill-label { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.bill-plan { margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bill-name { font-size: 22px; font-weight: 700; color: var(--ink); }
.bill-price { color: var(--muted); font-size: 15px; }
.bill-plan .pill { align-self: center; }
.bill-facts { display: flex; flex-wrap: wrap; gap: 12px 40px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.bill-facts > div > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.bill-facts .bill-note { flex: 1 1 18rem; align-self: flex-end; color: var(--muted); font-size: 13px; }
.bill-pad { padding: 0 20px 14px; }
table.invoices col.c-num { width: 26%; }
table.invoices col.c-status { width: 16%; }
table.invoices col.c-amount { width: 14%; }
table.invoices col.c-act { width: 96px; }
@media (max-width: 720px) {
  table.invoices { table-layout: auto; } /* the period column goes: fixed widths would keep its share */
  table.invoices col { width: auto !important; }
  table.invoices th:nth-child(2), table.invoices td:nth-child(2) { display: none; }
  table.invoices th, table.invoices td { padding-left: 8px; padding-right: 8px; }
  table.invoices th:first-child, table.invoices td:first-child { padding-left: 16px; }
  table.invoices td:last-child { padding-right: 12px; }
  .bill-facts { gap: 10px 24px; }
}
.page .grid.plans { grid-template-columns: repeat(4, minmax(0, 1fr)); } /* one row of four; the cards narrow before they wrap */
@media (max-width: 1100px) { .page .grid.plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .page .grid.plans { grid-template-columns: 1fr; } }
.plan { display: flex; flex-direction: column; gap: 12px; }
.plan.current { border-color: var(--sage); box-shadow: 0 0 0 1px var(--sage); }
.plan.asked { border-color: var(--amber-line); box-shadow: 0 0 0 2px var(--amber-bg); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.plan-head h2 { margin: 0; font-size: 17px; }
.plan .price { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; }
.plan .dl { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.plan .dl dt { margin-top: 0; }
.plan .dl dd { text-align: right; font-weight: 600; }
.plan-foot { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 30px; }
.plan-foot p { margin: 0; }
.error-text { color: var(--error); }

/* ---------- staff audit log: the filter form in one row (wrapping), the entries table ---------- */
.audit-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 0 16px; align-items: end; }
.audit-filters .go { display: flex; gap: 14px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.audit-filters .check { display: inline-flex; align-items: center; gap: 8px; height: 40px; font-size: 14px; color: var(--ink); white-space: nowrap; cursor: pointer; }
@media (max-width: 980px) { .audit-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .audit-filters .go { grid-column: 1 / -1; justify-content: space-between; } }
@media (max-width: 520px) { .audit-filters { grid-template-columns: 1fr; } }

/* checkboxes: the inputs' line and radius, sage when on (no browser blue) */
.page input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 0; border-radius: 5px;
  border: 1px solid var(--line-strong); background: var(--panel) center / 12px 12px no-repeat; cursor: pointer;
  transition: background-color var(--fast) ease, border-color var(--fast) ease, box-shadow var(--fast) ease;
}
.page input[type="checkbox"]:hover { border-color: var(--sage-ink); }
.page input[type="checkbox"]:checked {
  background-color: var(--sage-ink); border-color: var(--sage-ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6 9.6 3.6' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.page input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.audit-filters .go .btn { height: 40px; }
table.audit td { vertical-align: middle; }
table.audit td.trunc a { color: inherit; }
table.audit td.trunc a.id, table.audit td.trunc a code { color: var(--sage-ink); }
table.audit .under { display: none; } /* the detail under the action, phones only */
/* phones: time and action (with the detail as its second line); actor, user and the detail column go */
@media (max-width: 720px) {
  table.audit th:nth-child(1), table.audit td:nth-child(1) { width: 104px !important; }
  table.audit th:nth-child(2), table.audit td:nth-child(2) { width: auto !important; }
  table.audit th:nth-child(n+3), table.audit td:nth-child(n+3) { display: none; }
  table.audit .under { display: block; margin-top: 2px; }
}

/* the theme toggle in the header (user-feedback-2026-10.md §4.3) */
.theme-toggle { min-width: 36px; padding: 6px 8px; font-size: 16px; line-height: 1; }
/* file-type icons, lighter on the dark panel */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon.file.pdf { color: #f08a7e; } :root:not([data-theme="light"]) .icon.file.vector, :root:not([data-theme="light"]) .icon.file.image { color: #c9a3dc; }
  :root:not([data-theme="light"]) .icon.file.code { color: #8cbfe0; } :root:not([data-theme="light"]) .icon.file.archive { color: #d9b86a; }
  :root:not([data-theme="light"]) .icon.file.sheet { color: #86cf98; } :root:not([data-theme="light"]) .icon.file.slides { color: #eaa66a; } :root:not([data-theme="light"]) .icon.file.doc { color: #93b2ea; }
}
:root[data-theme="dark"] .icon.file.pdf { color: #f08a7e; } :root[data-theme="dark"] .icon.file.vector, :root[data-theme="dark"] .icon.file.image { color: #c9a3dc; }
:root[data-theme="dark"] .icon.file.code { color: #8cbfe0; } :root[data-theme="dark"] .icon.file.archive { color: #d9b86a; }
:root[data-theme="dark"] .icon.file.sheet { color: #86cf98; } :root[data-theme="dark"] .icon.file.slides { color: #eaa66a; } :root[data-theme="dark"] .icon.file.doc { color: #93b2ea; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- the playground (design/playground.md): files with uploads, the image studio, agent views ---------- */
/* the app switcher beside the page title: one link per app, the current one outlined */
.crumbs .pill { margin: 0 0 0 4px; color: var(--sage-ink); } /* not a separator: .crumbs span greys those */
/* the Playground tab: one card per application to choose from */
.app-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.app-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; color: var(--ink) !important; text-decoration: none; transition: border-color var(--fast) ease, box-shadow var(--fast) ease; }
.app-card:hover, .app-card:focus-visible { border-color: var(--sage-ink); box-shadow: 0 0 0 1px var(--sage-ink); outline: none; }
.app-card-name { font-size: 18px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-card .badges { display: flex; gap: 6px; }
.app-card .id { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-card-go { margin-top: 6px; color: var(--sage-ink); font-weight: 600; }
.app-switch { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 4px; }
.app-switch a { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted) !important; font-size: 13px; font-weight: 600; text-decoration: none !important; }
.app-switch a:hover { color: var(--ink) !important; border-color: var(--sage-ink); }
.app-switch a.on { color: var(--sage-ink) !important; border-color: var(--sage); box-shadow: 0 0 0 1px var(--sage); }

/* the drop zone: a dashed target over the uploads in flight */
.dropzone { padding: 0; border-style: dashed; border-width: 1.5px; border-color: var(--line-strong); transition: border-color var(--fast) ease, background-color var(--fast) ease; }
.dropzone.over { border-color: var(--sage); background: var(--tint); }
.dz-target { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 18px 20px; }
.dz-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--tint); color: var(--sage-ink); }
.dropzone.over .dz-icon { background: var(--panel); }
.dz-text b { display: block; font-weight: 700; }
.dz-text p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.dz-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.dz-actions label.btn { margin: 0; color: var(--on-accent); font-size: 13px; font-weight: 600; }
.dropzone input[data-pick] { width: 1px !important; height: 1px !important; padding: 0 !important; border: 0 !important; } /* .sr-only against the console's full-width inputs */
.dz-actions label.btn { display: inline-flex; }
.dz-noscript { margin: 0; padding: 0 20px 16px; color: var(--muted); font-size: 13px; }
.pg-uploads { list-style: none; margin: 0; padding: 0; }
.pg-uploads:empty { display: none; }
.pg-up { border-top: 1px solid var(--line); padding: 10px 20px 12px; }
.up-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.up-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-meta { color: var(--muted); font-size: 13px; margin-left: auto; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.up-open { font-size: 13px; white-space: nowrap; }
.up-bar { margin-top: 8px; }
.up-bar i { width: 0; animation: none; transition: width 200ms linear; }
.pg-up.ok .up-meta { color: var(--ok); }
.pg-up.failed .up-meta { color: var(--error); }
.pg-up.failed .up-bar i { background: var(--error); }
.pg-up .agent { margin-top: 10px; }

/* the listing's row actions; the confirmation row of a delete */
/* columns size to their content and the name takes the rest, truncating: no fixed widths to outgrow when a label changes */
table.files.pg td.trunc { width: 100%; max-width: 0; }
table.files.pg th.num, table.files.pg td.num { padding-left: 24px; }
table.files.pg td.actions { padding-right: 14px; }
.row-actions { display: inline-flex; gap: 2px; align-items: center; justify-content: flex-end; }
.btn.link.del { color: var(--error); }
.btn.link.del:hover { background: var(--error-bg); }
table.files .md .under { display: none; } /* the size under the type, phones only */
.confirm-del { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin: 0; }
.confirm-actions { display: inline-flex; gap: 8px; }
.alert.deleted p { margin: 0; }
.alert.deleted .agent { margin-top: 10px; background: var(--panel); }

/* the agent view: the same call with a key, folded under its lead */
.agent { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.agent summary { display: flex; align-items: baseline; gap: 10px; padding: 11px 16px; cursor: pointer; list-style: none; border-radius: 12px; }
.agent summary::-webkit-details-marker { display: none; }
.agent summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); flex: none; align-self: center; transition: transform var(--base) var(--ease-out); }
.agent[open] summary::before { transform: rotate(45deg); }
.agent summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.agent-title { font-weight: 700; font-size: 14px; }
.agent-lead { color: var(--muted); font-size: 13px; min-width: 0; }
.agent-code { position: relative; padding: 0 12px 12px; }
.agent-code pre { padding-right: 84px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; }
.agent-code .copy { position: absolute; top: 10px; right: 22px; background: rgba(255, 255, 255, .1); color: var(--code-ink); border-color: rgba(255, 255, 255, .25); }
.agent-code .copy:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .4); }
.agent-code .copy.done { color: var(--code-op); }

/* the studio: the controls on the left, the original and the render side by side, the URL under them */
.studio { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
.studio-controls { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 0; padding: 4px 18px 18px; }
.ctl { border: 0; margin: 0; padding: 14px 0 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.ctl legend { float: left; width: 100%; padding: 0; margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ctl legend + * { clear: both; }
.ctl-help { margin: 8px 0 0 !important; color: var(--muted); font-size: 12px; line-height: 1.45; }
.ctl[hidden] { display: none; }
.opswitch { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; gap: 3px; border-radius: 10px; background: var(--track); }
.opswitch label { margin: 0 !important; position: relative; cursor: pointer; }
.opswitch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opswitch span { display: block; text-align: center; padding: 6px 0; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); transition: background-color var(--fast) ease, color var(--fast) ease, box-shadow var(--fast) ease; }
.opswitch input:checked + span { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(4, 52, 44, .12), 0 0 0 1px var(--line); }
.opswitch input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }
.pair { display: flex; align-items: center; gap: 8px; }
.num-field, .sel-field { flex: 1; min-width: 0; display: flex !important; align-items: center; margin: 0 !important; position: relative; }
.num-field span { position: absolute; left: 11px; color: var(--muted); font: 600 12px/1 var(--sans); pointer-events: none; }
.studio .num-field input { padding-left: 28px !important; height: 36px !important; font: 15px/1 var(--mono) !important; }
.sel-field { gap: 10px; }
.sel-field span { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.sel-field select { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); font: 14px var(--sans); }
.sel-field select:focus { outline: none; border-color: var(--sage-ink); box-shadow: 0 0 0 3px var(--ring); }
.presets { display: flex; gap: 6px; margin-top: 10px; }
.chip { flex: 1; height: 28px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); font: 600 13px/1 var(--sans); cursor: pointer; transition: border-color var(--fast) ease, background-color var(--fast) ease; }
.chip:hover { border-color: var(--sage-ink); background: var(--tint); }
.chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
/* the studio's optional effects, as in the WixMP playground: an "Enable …" box, and under it the effect's panel with
   its Reset */
.studio .check { display: flex !important; align-items: center; gap: 8px; margin: 0 !important; font-size: 14px; font-weight: 600; cursor: pointer; }
.studio .ctl .pair + .check { margin-top: 10px !important; font-weight: 400; }
.ctl.opt { padding: 12px 0; }
.opt-panel { margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--track); }
.opt-panel .check { font-weight: 400; }
.opt-panel .check + .check { margin-top: 8px !important; }
.opt-panel .range:first-of-type { margin-top: 0 !important; }
.opt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.chip.reset { flex: none; height: 24px; padding: 0 10px; font-size: 12px; }
.presets-label { align-self: center; margin-right: 4px; font-size: 13px; font-weight: 600; white-space: nowrap; }
/* unlinked, each side has its own row: the longer label sits above its chips */
.presets.axis { flex-wrap: wrap; }
.presets.axis .presets-label { flex-basis: 100%; margin: 0 0 2px; font-weight: 400; color: var(--muted); }
.chip[aria-pressed="true"] { border-color: var(--sage-ink); background: var(--sage-ink); color: var(--on-accent); }
.pair.xy { margin-top: 10px; }
/* the studio hides what does not apply with the hidden attribute; a display set by a class must not win over it */
.studio [hidden] { display: none !important; }
.studio .num-field.wide span { position: static; margin-right: 8px; font-size: 13px; white-space: nowrap; }
.studio .num-field.wide input { padding-left: 10px !important; }
.studio input.frames { width: 72px; height: 30px; margin-left: 4px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); font: 14px/1 var(--mono); }
.studio input.frames:disabled { opacity: .5; }
.range { display: block !important; margin: 10px 0 0 !important; font-weight: 400 !important; }
.range > span { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.range output { font: 12px/1.5 var(--mono); color: var(--muted); font-weight: 400; }
.range[hidden] { display: none !important; }
.page .studio input[type="range"] { width: 100%; height: 20px !important; margin: 0; padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; accent-color: var(--sage-ink); background: transparent !important; }
.render-row { display: flex; align-items: center; gap: 12px; padding-top: 16px; flex-wrap: wrap; }
.render-row .hint { color: var(--muted); font-size: 12px; flex: 1; min-width: 10rem; }
.studio-view { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.frame { margin: 0; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.frame figcaption { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.frame figcaption span { color: var(--muted); font-variant-numeric: tabular-nums; }
/* a checkerboard behind the images, so a transparent render reads as transparent */
.canvas { flex: 1; min-height: 300px; display: grid; place-items: center; padding: 14px;
  background-color: var(--page); background-image: linear-gradient(45deg, var(--track) 25%, transparent 25%, transparent 75%, var(--track) 75%), linear-gradient(45deg, var(--track) 25%, transparent 25%, transparent 75%, var(--track) 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.canvas img { max-width: 100%; max-height: 380px; display: block; border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.canvas img[hidden] { display: none; }
.canvas-note { margin: 0; max-width: 22rem; padding: 10px 14px; border-radius: 8px; background: var(--panel); color: var(--muted); font-size: 13px; text-align: center; box-shadow: var(--shadow); }
.canvas-note[hidden] { display: none; }
.studio-url .url { min-height: 3.4em; }
.studio-url .u-base { color: var(--code-ink); }
.studio-url .u-sep { color: var(--code-dim); }
.studio-url .u-op { color: var(--code-op); }
.studio-url .u-params { color: var(--code-params); }
.studio-url .u-name { color: var(--code-name); }
/* each parameter, the operation and the output name is a piece of its own; the one a control just changed pulses once */
.studio-url .u-piece { display: inline-block; border-radius: 4px; }
.studio-url .u-changed { animation: url-pulse .7s cubic-bezier(.4, 0, .2, 1); }
@keyframes url-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); background: transparent; }
  40% { transform: scale(1.12); box-shadow: 0 0 0 5px rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .16); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); background: transparent; }
}
.studio-url .u-token { color: var(--code-dim); display: inline-block; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.url-legend .k-token { background: var(--code-dim); }
.url-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.url-actions .btn.ghost { background: rgba(255, 255, 255, .06); color: var(--code-ink); border-color: rgba(255, 255, 255, .25); }
.url-actions .btn.ghost:hover { background: rgba(255, 255, 255, .14); }
.url-actions .copy.done { color: var(--on-accent); }
@media (max-width: 980px) {
  .studio { grid-template-columns: 1fr; }
  .studio-controls { position: static; }
}
@media (max-width: 720px) {
  .dz-target { grid-template-columns: auto minmax(0, 1fr); padding: 14px 16px; }
  .dz-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .pg-up { padding: 10px 16px 12px; }
  .up-head { flex-wrap: wrap; }
  .up-meta { margin-left: 0; text-align: left; flex-basis: 100%; order: 3; }
  /* phones: the name (with the size under it) and the actions; the size and created columns go */
  table.files.pg th:nth-child(3), table.files.pg td:nth-child(3), table.files.pg th:nth-child(4), table.files.pg td:nth-child(4) { display: none; }
  table.files.pg th:first-child { width: 56px !important; }
  table.files.pg th:nth-child(5), table.files.pg td:nth-child(5) { display: table-cell; } /* the Files page's phone rule hides its fifth column */
  table.files.pg td:first-child { padding-right: 0; }
  .agent-code pre { white-space: pre; overflow-wrap: normal; padding-right: 16px; padding-top: 48px; } /* the curl scrolls sideways, as on the home page */
  .agent-code .copy { top: 10px; right: 22px; }
  table.files.pg .row-actions .btn { padding: 0 6px; }
  table.files.pg .row-actions .play { display: none; } /* an image's page has the Playground button */
  table.files .md .under { display: inline; }
  .compare { grid-template-columns: 1fr; }
  .canvas { min-height: 200px; }
  .agent summary { flex-wrap: wrap; gap: 2px 10px; }
  .agent-lead { flex-basis: 100%; padding-left: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .studio-url .u-changed { animation: none; }
  .up-bar i, .agent summary::before { transition: none; }
}
