/* ── Base: icons, focus, keyboard hints, small utilities ────────────────────
   Shared by every page that loads app.css (linked after it). Colours only
   through semantic tokens (DESIGN.md §1). */

/* Icons from static/lib/icons.js: they take the colour of their text. */
svg.i {
    width: 16px; height: 16px;
    flex: none;
    display: inline-block;
    vertical-align: -3px;
    stroke: currentColor;
    fill: none;
}
svg.i.i-sm { width: 14px; height: 14px; vertical-align: -2px; }
svg.i.i-lg { width: 20px; height: 20px; }

/* X2: one visible focus ring for everything focusable. Inputs keep their
   own (border + soft halo, forms.css); nothing gets outline:none without a
   replacement. */
:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* Keyboard hints: sans, small, quiet (G3: mono is for identifiers). */
kbd, .kbd {
    display: inline-flex; align-items: center;
    font-family: var(--sans);
    font-size: var(--fs-11);
    font-weight: 500;
    line-height: 16px;
    color: var(--text-3);
    padding: 1px 6px;
    border-radius: var(--radius-xs);
    background: var(--sunken);
    box-shadow: inset 0 0 0 1px var(--border);
    white-space: nowrap;
}

/* M2: kbd hints and desktop tips mean nothing on a touch screen. */
@media (pointer: coarse) {
    kbd, .kbd, .kbd-hint, .desktop-tip, .cmdk-hint { display: none !important; }
}

/* Icon-only buttons (always carry an aria-label). */
.icon-btn {
    display: inline-grid; place-items: center;
    width: 32px; height: 32px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    position: relative;
    transition: background var(--dur-med) var(--ease-out), color var(--dur-med) var(--ease-out);
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--hover); color: var(--text); }

/* Ghost and extra-small buttons extend the shared .btn (app.css). */
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); border-color: transparent; color: var(--text); }
.btn-xs { font-size: var(--fs-12); padding: 2px 8px; min-height: 26px; gap: 4px; }
.btn .i { margin: 0 -1px; }

/* G3 + DESIGN.md §3: identifiers in mono, numbers in tabular figures. */
.mono, code, .code { font-family: var(--mono); font-weight: var(--mono-font-weight); font-size: 0.93em; letter-spacing: -0.01em; }
.num, .tabular { font-variant-numeric: tabular-nums; }

/* Visually hidden, still read by screen readers. */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Avatars: initials on a soft accent disc. */
.avatar {
    display: inline-grid; place-items: center;
    width: 28px; height: 28px;
    flex: none;
    border-radius: 50%;
    font-size: var(--fs-11);
    font-weight: 600;
    background: var(--accent-dim);
    color: var(--accent-text);
}
