/* KCA design system, step 1 of 6 (29 Nov 2026): tokens and buttons. Loaded last, after every other sheet.
   Agreed with the owner in the design vision: Vision D colors and fonts stay, the button designs of 20 Nov (E-10c, all pills, one main action per screen) stay exactly as they are.
   This file does two things only: it names the sizes and spaces the later steps will use, and it fixes the few button defects an audit of 624 buttons found.
   Step 2 (page frame and records) builds on these tokens; the old sheets are removed in step 6. */

:root {
  /* type scale: seven sizes. Nothing meaningful under 14. Labels are 12.5, uppercase, never sentences. */
  --k-t-label: 12.5px; --k-t-meta: 14px; --k-t-body: 16px; --k-t-card: 20px; --k-t-h3: 24px; --k-t-h2: 32px; --k-t-h1: 44px;
  /* space scale, 4 px base: gutter 24 (16 phone), between sections 48 (32), inside a panel 24 (16), field group to its buttons 24, between buttons 12 */
  --k-s1: 4px; --k-s2: 8px; --k-s3: 12px; --k-s4: 16px; --k-s5: 24px; --k-s6: 32px; --k-s7: 48px; --k-s8: 64px; --k-s9: 96px;
  /* corners: containers 6, controls 10, tags 4, buttons and toggles pill */
  --k-r-box: 6px; --k-r-ctl: 10px; --k-r-tag: 4px; --k-r-pill: 99px;
  /* heights: small, regular, large; a touch target is never under 44 */
  --k-h-sm: 40px; --k-h-md: 48px; --k-h-lg: 56px; --k-h-touch: 44px;
  /* status marks: a solid dot and a word, never a tinted box */
  --k-ok: #1c7a5e; --k-warn: #9a6208; --k-bad: #b0372f;
}
html[data-kca-theme="dark"] { --k-ok: #4fc79c; --k-warn: #e0a24a; --k-bad: #ef7d74; }

/* small buttons are 40 high (an audit found 38 in places); the touch rule of site.css keeps 44 on phones */
.btn.btn--sm { min-height: var(--k-h-sm); }
@media (pointer: coarse), (max-width: 760px) { .btn.btn--sm { min-height: var(--k-h-touch); } }

/* the danger button: white text on the light red of dark mode read at 2.2 to 1; dark text on it reads above 7 */
html[data-kca-theme="dark"] .btn.btn--danger { color: #050508; }
html[data-kca-theme="dark"] .btn.btn--danger:hover { background: #f4958d; }

/* room around buttons in the console and in forms: 20 px between a field, a hint or a note and the button under it, and 12 between buttons that sit in a row */
:is(.s-page, .s-sec, .s-od__act, form) :is(.field, .hint, .input, .s-ta, .check, select, textarea, .s-err, .muted) + .btn { margin-top: 20px; }
:is(.s-page, .s-sec) .s-acts { gap: 12px; }
:is(.s-page, .s-sec) :is(.field, .hint, .input, .s-ta, .check, select, textarea) + .s-acts { margin-top: 20px; }
/* a text that explains a button sits 8 px under it, not against it */
.btn + :is(.hint, .muted, small) { margin-top: 8px; display: block; }
/* a line that only the Apple look of the console shows (design/apple-console) */
.ap-meta { display: none; }
