/* Foundation layer: fonts, material, reset, and reusable primitives.
   Loaded AFTER tokens.brand.css + tokens.product.css and BEFORE app.css.
   Values come only from var(--token); no literal hex/radius here. */

/* Shared by the app shell and standalone authentication/OAuth pages. */
@import url("pretendard.bc5f80205313.css");

/* --- Base document typography (owns html/body; app.css must not redeclare) --- */
html {
  background: var(--paper);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

/* Product surfaces are flat; no texture overlay or viewport paint layer. */
/* --- Accessibility / focus primitive --- */
.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;
}
:focus-visible {
  outline: var(--focus-w) solid var(--blue);
  outline-offset: var(--focus-outset);
}
::selection { background: var(--blue-soft); color: var(--ink); }

/* --- Typography scale primitive --- */
h1, h2, h3 { margin: 0; font-weight: var(--weight-title); letter-spacing: var(--track-title); line-height: 1.2; }
h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-title); }

/* --- Button primitive (9px radius, never a full pill) --- */
.button {
  min-height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font: inherit;
  font-weight: var(--weight-em);
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.button:active { transform: translateY(1px) scale(.985); }
/* A disabled button used to be pixel-identical to a live one, so "Promote"
   (disabled until an area is picked) read as broken rather than as waiting.
   Dimming alone would drop it under 4.5:1, so the cursor and the dropped hover
   carry the message too — and :disabled is exposed to assistive tech anyway. */
.button:disabled { opacity: .55; cursor: not-allowed; }
.button:disabled:hover { transform: none; }
/* .button sets metrics only -- no colour, no text-decoration. On a <button>
   the UA supplies a background and the element inherits colour, but an
   <a class="button"> keeps the browser's blue AND its underline, so it renders
   as a raw link wearing button padding. That shipped on Home's connect panel
   and is still live on the OAuth consent screen's Cancel. This is the same fix
   a.btn already carries a few hundred lines into app.css; .button itself stays
   untouched for the <button> case. */
a.button { text-decoration: none; }
/* The colour reset is a FLOOR, not a ceiling, so it goes through :where() --
   which contributes no specificity, leaving this at plain `a` (0,0,1). Written
   as `a.button { color: inherit }` (0,1,1) it out-specified
   `.button-primary { color: var(--paper-solid) }` (0,1,0) and repainted the
   primary CTA's label in whatever muted colour surrounded it. */
a:where(.button) { color: inherit; }
.button-small { min-height: 34px; padding: 0 12px; font-size: var(--text-md); }
.button-primary { background: var(--blue-strong); color: var(--paper-solid); border-color: var(--blue-strong); }
.button-primary:hover { background: var(--blue); border-color: var(--blue); transform: translateY(-1px); }

/* --- Form-control focus primitive --- */
/* Text-entry controls hold a 14px readability floor above the dense 13px body. */
/* font-family, NOT the `font` shorthand. `font: inherit` drags font-size along
   with it, so any component rule that reached for the same shorthand silently
   inherited its ancestor's size and undid the floor below — which is how the
   Create Area dialog came out at the sidebar's 11px. */
button, pre, code, kbd, samp { font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: var(--text-md); }
/* Text-entry controls carry NO focus ring. Deliberate, and a knowing WCAG
   2.4.7 regression (TP-401): a field keeps its own 1px border when focused, so
   a 2px ring pulled inward stacked on top of it and the edge went from 1px to
   three — the "one band" the focus tokens describe was never what rendered.
   The owner chose removal over the two alternatives that kept an indicator.

   `outline: none` and not a deleted rule. Drop the rule and these fall back to
   the universal :focus-visible above, whose --focus-outset draws the ring
   OUTSIDE the field, which is thicker still. The removal has to be explicit.

   Scoped away from controls you do not type into: a checkbox, radio, file or
   input-button keeps the universal ring, and so does everything that is not a
   form control. `select` is in the list because it sits in the same rows as
   the text fields and a ring on it alone reads as a rendering bug. */
input:where(:not([type="checkbox"], [type="radio"], [type="file"], [type="button"], [type="submit"], [type="reset"])):focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
}

/* --- Skip link: 13 of 18 focusable elements on a page are sidebar chrome, so
   without this every keyboard user re-tabs the whole nav on every page. --- */
.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--paper-raised);
  color: var(--ink);
  border: 1px solid var(--blue);
  border-radius: var(--radius-small);
  font-weight: var(--weight-em);
  text-decoration: none;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 8px; }

/* --- Brand artwork ---
   Supplied PNG with alpha, so it cannot follow currentColor the way an inline
   SVG would: the theme change is a file swap. Sizes set width only — height
   follows the artwork's own ratio (symbol 253x230, wordmark 586x168). */
.brand-art { display: inline-flex; align-items: center; gap: 9px; line-height: 0; }
.brand-art img { display: block; width: 100%; height: auto; }
.brand-art-mark { display: block; width: 24px; }
.brand-art-word { display: block; width: 66px; }
.brand-art .art-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-art .art-light { display: none; }
  :root:not([data-theme="light"]) .brand-art .art-dark { display: block; }
}
:root[data-theme="dark"] .brand-art .art-light { display: none; }
:root[data-theme="dark"] .brand-art .art-dark { display: block; }


/* --- The workspace card ---
   Here rather than in app.css because BOTH shells render it: the app
   (Settings -> Your workspaces) and the auth shell (/workspaces/), and
   _auth_head.html loads tokens + base + auth only. Putting it in app.css
   left the picker's cards unstyled while every test stayed green. */
.ws-card { border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: var(--space-12); overflow: hidden; background: var(--paper-raised); }
.ws-card--current { border-color: var(--accent); }
.ws-card-hit { display: block; padding: var(--space-12) var(--space-16);
  text-decoration: none; color: inherit; }
.ws-card-hit:hover .ws-card-name { color: var(--blue); }
.ws-card-line { display: block; }
.ws-card-id { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-6); }
.ws-card-name { font-weight: var(--weight-title); font-size: var(--text-md); color: var(--ink); }
.ws-card-key { font-family: inherit; font-size: var(--text-xs);
  letter-spacing: normal; color: var(--muted); border: 1px solid var(--border);
  border-radius: var(--radius-small); padding: 0 var(--space-4); }
.ws-card-role { color: var(--muted); font-size: var(--text-sm); }
.ws-card-here { color: var(--accent); font-size: var(--text-sm); }
.ws-card-dot { color: var(--line-strong); }
.ws-card-desc { margin-top: var(--space-4); color: var(--text); font-size: var(--text-base); }
.ws-card-desc--empty { color: var(--muted); font-style: italic; }
.ws-card-stats { margin-top: var(--space-6); color: var(--muted); font-size: var(--text-sm); }
.ws-card-fill { display: inline-block; margin: 0 var(--space-16) var(--space-12);
  color: var(--blue); font-size: var(--text-sm); text-decoration: none; }
.ws-card-fill:hover { text-decoration: underline; }
.ws-card-foot { padding: var(--space-8) var(--space-16); border-top: 1px dashed var(--line); }

/* The plan badge, built like .role-badge because it is the same kind of thing.
   Core never writes these words -- they arrive through the entitlements hook,
   so a self-host renders no badge at all rather than an invented one. `block`
   is filled rather than outlined: it is the only one of the three that means
   something has already stopped working. */
.ws-plan { margin-left: auto; font-size: var(--text-xs); font-weight: var(--weight-em);
  border: 1px solid var(--border); border-radius: var(--radius-small);
  padding: 1px var(--space-8); white-space: nowrap; color: var(--muted); }
.ws-plan--ok { color: var(--accent); border-color: var(--accent); }
.ws-plan--warn { color: var(--warn); border-color: var(--warn); }
.ws-plan--block { color: var(--paper); background: var(--warn); border-color: var(--warn); }