/* Anticode's interface system (docs/ui-system.md). One place for the scale every app page shares, and for the
   clean-ups that make the app read as one product: the dashboard, Settings, sign-in and the builder's chrome.
   Loaded after calm.css and before phone.css, scoped to the app's bodies, so the public home page is untouched.

   The rules it keeps (the owner's standing decisions): dark only, neutral greys, Plus Jakarta Sans only, flat full
   pills for buttons, one accent (#2a62f0) for the button that commits a step, no hairline outlines around surfaces,
   no glowing or pulsing dots, no labels over headings. */

/* ── Tokens ─────────────────────────────────────────────────────────────────────────────────────────────── */
body.dash, body.sp, body.calm, .build {
  /* type: six sizes. Body copy is 13.5px (desktop default 13pt), never under 11px */
  --t-xs: 11.5px; --t-sm: 12.5px; --t-base: 13.5px; --t-md: 15px; --t-lg: 20px; --t-xl: 26px;
  /* space: the 4px grid base.css already defines, --s-1 (4px) to --s-7 (48px) */
  /* shape: rows and fields 10px, sheets 16px, buttons full pills */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-pill: 999px;
  /* colour: the greys come from calm.css, the signals (--ok, --warn, --danger) from base.css. One accent, white on it 5.1:1 */
  --accent: #2a62f0; --on-accent: #ffffff;
  /* motion: short fades, nothing that bounces or loops */
  --dur-1: 120ms; --dur-2: 180ms; --ease-out: cubic-bezier(.2, .7, .2, 1);
}

/* ── Focus: one visible ring on everything you can reach with a keyboard ─────────────────────────────────── */
:is(body.dash, body.sp, body.calm) :focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ── Fields: a search box is one surface, not a box inside a box ─────────────────────────────────────────── */
:is(.dash, .sp) :is(.field, .cmdk-in, .sp-search) input:not(#dprompt) { background: transparent !important; box-shadow: none; }
/* Settings' search was a square-cornered slab beside rounded fields everywhere else */
:is(.sp, .dash) .sp-search { border-radius: var(--r-md); overflow: hidden; }

/* ── Colour discipline: blue is only for the button that commits a step ─────────────────────────────────── */
/* "Upgrade" beside the plan opens a page; it is a link, so it takes the text colour and weight, not the accent */
:is(body.dash, .build, .wsnav) .plan-chip .plan-up { color: var(--text); }
/* the Library's "New" badge: a quiet grey tag that holds still */
body.dash .snav-new { color: var(--body); background: color-mix(in srgb, var(--text) 8%, transparent); }
body.dash .snav-new .tw { animation: none; }

/* ── Page headers: title, one line of explanation, then the page ────────────────────────────────────────── */
body.dash .pview-head .lib-sub { max-width: 62ch; font-size: var(--t-base); line-height: 1.5; color: var(--muted); }
/* a section title never outranks the page title: the Library's shelves sat at 28px under a 26px "Library" */
body.dash .cm-rail-head h2 { font-size: var(--t-lg); letter-spacing: -0.015em; }
body.dash .cm-rail-head .cm-sub { font-size: var(--t-sm); color: var(--muted); }
/* every card on "Anticode originals" said "Anticode original" over its picture; the shelf's title already does */
body.dash .cm-pick { display: none; }

/* ── One action per place ──────────────────────────────────────────────────────────────────────────────── */
/* the Library's empty community shelf repeated the header's "Share yours" */
body.dash .cm-empty .btn { display: none; }
/* Projects with nothing in it: the empty state's own "New project" is the one to press, so the header's steps back */
body.dash .view-projects:has(.empty) .pview-tools > .btn { display: none; }
/* the box you build from is the home page's one action: "Upgrade" stamped on its Team button was a second sales line
   beside the sidebar's plan chip. Team still says it needs the plan (its title and description) and its menu leads there */
body.dash .dcomp .team-badge { display: none; }

/* ── Grow › Automations on a plan without them: what each kind does, to read, not to press ──────────────────── */
body.dash .gr-kinds-preview { margin: 0; padding: 0; list-style: none; }
body.dash .gr-kinds-preview .gr-kind { min-height: 0; cursor: default; background: var(--c-card); }

/* ── The app's own pages outside the dashboard: Data, Code projects, Engineer ─────────────────────────────── */
/* a hidden button stays hidden: calm.css draws every a.btn as a flex pill, which outranked [hidden], so Engineer
   showed "New run" over the very form it opens */
:is(body.cms, body.code, body.eng, body.auth) .btn[hidden] { display: none; }
/* Data with no collections: the form is already open, so its "New collection" toggle was a second button for it */
body.cms .cms-new.is-first > summary { display: none; }
/* one page-title size: Code projects' 40px title stood over Data's and Engineer's 20px headings */
body.code .code-main h1 { font-size: var(--t-xl); letter-spacing: -0.015em; }

/* ── A project before its first picture: its initial, not a blank grey tile ───────────────────────────────── */
/* the live picture (.shot) is drawn over it once the project has one */
body.dash .card-thumb .card-mono { position: absolute; inset: 0; z-index: 0; display: grid; place-items: center; font-size: 44px; font-weight: 500;
  letter-spacing: -0.02em; color: color-mix(in srgb, var(--text) 26%, transparent); pointer-events: none; user-select: none; }
body.dash .card-thumb.has-shot .card-mono { display: none; }

/* ── Sheets fit what they hold ─────────────────────────────────────────────────────────────────────────── */
/* Team without a team is three lines and two buttons; it sat in a 680px sheet that was mostly empty */
@media (min-width: 821px) {
  body.dash .sp-dialog.tm-dialog:has(.sp-wrap.is-single) { height: fit-content; max-height: min(680px, calc(100dvh - 32px)); }
}

/* ── Motion: nothing drifts forever ────────────────────────────────────────────────────────────────────── */
/* the connector logos stood in four rows sliding sideways for as long as the sheet was open; they stay put */
body.dash .scrim.is-open .mq { animation-play-state: paused; }

/* Reduce motion: every transition and animation on the app's pages becomes a cut */
@media (prefers-reduced-motion: reduce) {
  :is(body.dash, body.sp, body.calm, .build) *, :is(body.dash, body.sp, body.calm, .build) *::before, :is(body.dash, body.sp, body.calm, .build) *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
