/* The brand's shared pieces (docs/brand/brand-book.html is the source of truth; docs/DESIGN.md lists them).
   Tokens live in app.css :root. Here: keys, tags, count badge, pips, avatar, line icons, motion.
   Rule: yellow (--sun) is only ever the next move: a key fill with ink text. Never text colour, never a status. */

/* Line icons: inline <svg class="i"> from web/icons.js. Colour is the text colour. */
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* Keys: anything you press has a 4 px edge and goes down when pressed. .btn alone is the white key. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 0; border-radius: var(--r); font: 700 15px/1.2 var(--display); letter-spacing: .01em; text-align: center; text-decoration: none; cursor: pointer; margin-bottom: var(--edge); touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform .08s ease-out, box-shadow .08s ease-out, background-color .15s;
  background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2), 0 var(--edge) 0 var(--line-2); }
.btn:hover { background: var(--mist); color: var(--ink); }
.btn:active { transform: translateY(var(--edge)); transition-duration: .05s; box-shadow: inset 0 0 0 1.5px var(--line-2), 0 0 0 var(--line-2); }
.btn-white { background: var(--paper); color: var(--ink); }
/* the yellow key: the next move, one per view. .primary is the old name for it. */
.btn-key, .btn.primary { background: var(--sun); color: var(--ink); box-shadow: 0 var(--edge) 0 var(--sun-edge); }
.btn-key:hover, .btn.primary:hover { background: var(--sun-hi); color: var(--ink); }
.btn-key:active, .btn.primary:active { box-shadow: 0 0 0 var(--sun-edge); }
.btn-ink { background: var(--ink); color: #fff; box-shadow: 0 var(--edge) 0 #000; }
.btn-ink:hover { background: var(--ink-2); color: #fff; }
.btn-ink:active { box-shadow: 0 0 0 #000; }
/* the quiet key: no edge, for the third action. .quiet is the old name. */
.btn-quiet, .btn.quiet { background: transparent; color: var(--ink); box-shadow: none; margin-bottom: 0; }
.btn-quiet:hover, .btn.quiet:hover { background: var(--mist-2); color: var(--ink); }
.btn-quiet:active, .btn.quiet:active { transform: none; background: var(--line); box-shadow: none; }
/* small (34 px, 44 px on a touch screen) and big. .small is the old name. */
.btn-s, .btn.small { min-height: 34px; padding: 7px 12px; font-size: 13.5px; border-radius: 10px; --edge: 3px; }
.btn-s .i, .btn.small .i { width: 16px; height: 16px; }
.btn.big { min-height: 52px; padding: 12px 24px; font-size: 16px; }
@media (pointer: coarse) { .btn-s, .btn.small { min-height: 44px; } }
.btn:disabled, .btn[disabled], .btn[aria-disabled="true"] { background: var(--mist-2); color: var(--faint); box-shadow: 0 var(--edge) 0 var(--line); cursor: not-allowed; transform: none; }
.btn-quiet:disabled, .btn.quiet:disabled { background: transparent; box-shadow: none; }
.btn.busy { position: relative; color: transparent; pointer-events: none; }
.btn.busy::after { content: ''; position: absolute; width: 16px; height: 16px; border: 2px solid var(--ink); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-ink.busy::after { border-color: #fff; border-top-color: transparent; }

/* Tags: status is a colour, an icon and a word, always all three (use tag() from web/ui.js). A bare .tag is idle. */
.tag, .pill { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px 0 8px; border-radius: 99px; font: 600 13px/1.2 var(--text); white-space: nowrap; text-decoration: none; text-transform: none; letter-spacing: 0; vertical-align: baseline; background: var(--mist-2); color: var(--muted); }
.tag .i, .pill .i { width: 14px; height: 14px; stroke-width: 2.5; vertical-align: 0; }
.tag-pass, .pill.ok { background: var(--pass-soft); color: var(--pass-ink); }
.tag-stuck, .pill.warn, .pill.bad { background: var(--stuck-soft); color: var(--stuck-ink); }
.tag-going, .pill.acc { background: var(--going-soft); color: var(--going-ink); }
.tag-idle { background: var(--mist-2); color: var(--muted); }
a.pill:hover { filter: brightness(.96); }
/* A .pill written without an icon gets its status icon from CSS, so no status is colour and word alone. */
.pill.ok:not(:has(.i))::before, .pill.warn:not(:has(.i))::before, .pill.bad:not(:has(.i))::before, .pill.acc:not(:has(.i))::before { content: ''; width: 14px; height: 14px; flex: none; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.pill.ok { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.pill.warn, .pill.bad { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }
.pill.acc { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4.1 12 6'/%3E%3Cpath d='m5.1 8-2.9-.8'/%3E%3Cpath d='m6 12-1.9 2'/%3E%3Cpath d='M7.2 2.2 8 5.1'/%3E%3Cpath d='M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z'/%3E%3C/svg%3E"); }

/* Count badge: how many need you (red, white number). Sits at the end of a nav item or tab. */
.count { display: inline-block; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--stuck); color: #fff; font: 700 12px/20px var(--text); text-align: center; font-variant-numeric: tabular-nums; }

/* Pips: progress counted in things done, drawn as things. States: on (ink), pass, stuck, going, now (yellow, ringed). */
.pips { display: flex; gap: 3px; }
.pips i { width: 14px; height: 8px; border-radius: 3px; background: var(--line); }
.pips i.on { background: var(--ink); }
.pips i.pass { background: var(--pass); }
.pips i.stuck { background: var(--stuck); }
.pips i.going { background: var(--going); }
.pips i.now { background: var(--sun); box-shadow: 0 0 0 2px var(--ink); }

/* Avatar: initials in a soft square (use avatar() from web/ui.js). .avatar.round for the signed-in person. */
.avatar { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; font: 700 13px/1 var(--display); background: var(--mist-2); color: var(--ink-3); letter-spacing: .02em; text-transform: uppercase; }
.avatar.round { border-radius: 50%; }

/* Motion: a wrong tap shakes, a right one pops, the next move rings. All off for reduced motion. */
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255, 201, 51, .9); } 100% { box-shadow: 0 0 0 12px rgba(255, 201, 51, 0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
