/*
   ═══════════════════════════════════════════════════════════════════════════
   GENERATED COPY — DO NOT EDIT. Source: <extension repo>/Pinako/ui-primitives.css
   Regenerate with: node "Pinako Pro/_build/sync-shared.mjs"
   (see that script's header for the shared-source rules)
   ═══════════════════════════════════════════════════════════════════════════
*/

/* UI primitives shared by every extension page — pinako.html and chat.html.
 *
 * THE universal Pinako button (owner directive 2026-09-13, unified 2026-09-16):
 * EVERY button that carries text is .general-btn. Add .general-btn-primary for
 * the one action a dialog or card leads with. Symbol-only buttons — the square
 * toolbar and tree-row controls, a +/- stepper, a close X — keep their own
 * compact styles.
 *
 * There used to be two text buttons: this raised one (.general-btn, from the
 * theme customizer) and a flat one (.pinako-modal-btn, with .pinako-ai-btn as
 * an alias) that every modal and the AI Settings cards wore. They differed
 * only in dress, not in job, so the owner folded the flat one into this one
 * (2026-09-16); every former .pinako-modal-btn* call site now says
 * .general-btn*. The flat button's two behaviours that the raised one lacked
 * came along: the :focus-visible rule (dialogs focus their primary button on
 * open so Enter works, and under :focus that painted the hover glow — the
 * button opened looking permanently lit) and the :disabled dimming.
 *
 * .box-btn is the same button with plain white highlight slots instead of
 * accent-tinted ones, for buttons that sit inside an already-tinted container
 * (the settings panels' .panel-menubox) where a second accent glow reads as
 * noise. The two differ by ONE value (--btn-highlight) and share every rule.
 *
 * The rules live here rather than in pinako.html's <style> because the AI
 * Settings module (loaded by BOTH pages) needs them on chat.html too; a linked
 * file is the one copy that serves both pages without drifting
 * (ai-settings-ui.css is the precedent). It is a shared file in
 * scripts/shared-ui-manifest.json (U6 chunk 4): build-mcp-app.js inlines it
 * verbatim into the MCP app, and every portal page links a generated copy
 * (portal/css/ui-primitives.css) before tree-ui.css (owner 2026-09-24).
 *
 * WHY THE CUSTOM PROPERTIES ARE DECLARED ON THE BUTTON, not at :root: a custom
 * property holding var(--accent-color) resolves it on the element that
 * declares it, so at :root it would freeze the stylesheet's accent and ignore
 * the theme customizer, which writes --accent-color INLINE on <body>
 * (pinako.js, applyTheme). Declared here, the substitution happens on the
 * button, which inherits body's inline value. Keep it that way.
 *
 * Variants stay out of this file: .btn-row-even, .sync-divergence-buttons and
 * the save pulse live in tree-ui.css (the shared base sheet), .general-btn-warn
 * and .btn-icon-label in the page that uses them. The design-tokens plan
 * (docs/design-system-tokens-plan.md) can absorb this file when it lands.
 */

.general-btn,
.box-btn {
  --btn-glow: 0 0 5px color-mix(in srgb, var(--accent-color) 60%, transparent);
  /* The raised inset stack. The dark stack has two highlight layers, the
     light stack (below) three; every one is --btn-highlight, so the accent
     and white versions differ by that single value. */
  --btn-inset: inset -2px -2px 7px rgba(0, 0, 0, 0.35),
               inset 2px 2px 4px var(--btn-highlight),
               inset -1px -1px 5px rgba(0, 0, 0, 0.2),
               inset 1px 1px 1px var(--btn-highlight),
               inset -1px -1px 3px rgba(0, 0, 0, 0.3);
  background: var(--item-bg);
  /* A plain black wash rather than an accent tint, so the accent shows only
     in the inset glow and on :hover. */
  border: 1px solid color-mix(in srgb, #000000, transparent 85%);
  color: var(--text-color);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: default;
  font-family: inherit;
  font-size: var(--font-main);
  box-shadow: var(--btn-inset);
  transition: background 120ms, border-color 120ms, box-shadow 120ms;
}
.general-btn { --btn-highlight: color-mix(in srgb, var(--accent-color) 10%, transparent); }
.box-btn     { --btn-highlight: rgba(255, 255, 255, 0.15); }

/* Light mode swaps the whole stack for the same reason the cards do — the
   dark weights read as grime on a light ground (owner values 2026-09-17).
   The stack opens with a hairline like the one the light-mode cards carry.
   It has to come FIRST: box-shadow paints the first layer on top, and the
   2px highlight layer is an opaque near-white on .general-btn, so a hairline
   listed after it is painted underneath and never shows. (.general-btn's
   highlight is an accent wash on white here; .box-btn keeps its plain white.)
   The border is the card bevel: none on top/left, black on right/bottom. */
body.light-mode .general-btn,
body.light-mode .box-btn {
  --btn-inset: inset 0.5px 0.5px 0.5px rgba(0, 0, 0, 0.15),
               inset 2px 2px 6px var(--btn-highlight),
               inset -2px -2px 7px rgba(0, 0, 0, 0.25),
               inset 1px 1px 4px var(--btn-highlight),
               inset -1px -1px 2px rgba(0, 0, 0, 0.2),
               inset 1px 1px 1px var(--btn-highlight),
               inset -1px -1px 1px rgba(0, 0, 0, 0.15);
  border-top: none;
  border-left: none;
  border-right: 1px solid rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
}
body.light-mode .general-btn {
  --btn-highlight: color-mix(in srgb, var(--accent-color) 20%, white);
}
body.light-mode .general-btn:hover,
body.light-mode .box-btn:hover,
body.light-mode .general-btn:focus-visible,
body.light-mode .box-btn:focus-visible {
  border-color: color-mix(in srgb, var(--accent-color) 60%, transparent);
}
body.light-mode .general-btn:disabled:hover,
body.light-mode .box-btn:disabled:hover {
  border-color: rgba(0, 0, 0, 0.5);
}

/* Hover keeps the inset stack and adds the outer glow on top of it — listing
   only the glow would drop the frame on hover. :focus-visible, NOT :focus,
   gets the same dress (see the header). */
.general-btn:hover,
.box-btn:hover,
.general-btn:focus-visible,
.box-btn:focus-visible {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: var(--btn-glow), var(--btn-inset);
}
.general-btn:focus,
.box-btn:focus {
  outline: none;
}

/* Disabled: dimmed, and hover no longer lights it — but it keeps its frame
   and stays hoverable, because a greyed button carries the tooltip that says
   why it is greyed (ruling G: greyed, never omitted). */
.general-btn:disabled,
.box-btn:disabled {
  opacity: 0.5;
}
.general-btn:disabled:hover,
.box-btn:disabled:hover {
  border-color: color-mix(in srgb, #000000, transparent 85%);
  box-shadow: var(--btn-inset);
}

/* The lead action of a dialog or card: a whisper of accent in the face, a
   faint accent border and a faint outer glow, rising a little on hover (owner
   values 2026-09-16/17). box-shadow is ONE property, so the glow is listed
   together with the inset stack: writing the glow alone would silently drop
   the raised shading (which is what happens when you try it in devtools). */
.general-btn-primary {
  background: color-mix(in srgb, var(--accent-color) 3%, var(--item-bg));
  border-color: color-mix(in srgb, var(--accent-color), transparent 80%);
  box-shadow: 0 0 3px color-mix(in srgb, var(--accent-color) 23%, transparent), var(--btn-inset);
}
.general-btn-primary:hover,
.general-btn-primary:focus-visible {
  background: color-mix(in srgb, var(--accent-color) 7%, var(--item-bg));
}
.general-btn-primary:disabled:hover {
  background: color-mix(in srgb, var(--accent-color) 3%, var(--item-bg));
  border-color: color-mix(in srgb, var(--accent-color), transparent 80%);
}
/* Light mode: the accent border fades into the light background; use a more
   opaque accent for visibility. */
body.light-mode .general-btn-primary {
  border-color: color-mix(in srgb, var(--accent-color), transparent 30%);
}
