/* ─────────────────────────────────────────────────────────────────────────────
   Tonera component classes — mirrors the design.md primitives.
   Requires tokens.css + fonts.css. Sentence case everywhere, including buttons.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Base ── */
.t-page {
    background: var(--bg-page);
    color: var(--text-body);
    font-family: var(--font-body);
    font-size: var(--text-15);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
.t-display {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-body);
}
.t-mono-label {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: var(--text-12);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ── Button ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: var(--text-15);
    border-radius: var(--radius-control);
    border: 1px solid transparent;
    cursor: pointer;
    transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn--sm { height: 32px; padding: 0 12px; font-size: var(--text-13); }
.btn--md { height: 40px; padding: 0 16px; }
.btn--lg { height: 48px; padding: 0 22px; }
.btn--full { width: 100%; }

.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover  { background: var(--accent-hover); }
.btn--primary:active { background: var(--accent-active); }

.btn--secondary { background: var(--surface-card); color: var(--text-body); border-color: var(--border-strong); }
.btn--secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn--ghost { background: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--bg-subtle); color: var(--text-body); }

.btn--danger { background: var(--danger); color: var(--on-accent); }

.btn .t-icon { width: 18px; height: 18px; flex: none; }

/* ── Card ── */
.t-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
}

/* ── Badge ── */
.t-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-13);
    font-weight: 500;
    background: var(--bg-subtle);
    color: var(--text-muted);
}
.t-badge--accent { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border); }
.t-badge--match  { background: var(--match-soft);  color: var(--match); }
.t-badge--warn   { background: var(--warn-soft);   color: var(--warn); }
.t-badge--danger { background: var(--danger-soft); color: var(--danger); }
.t-badge--solid-accent { background: var(--accent); color: var(--on-accent); }
.t-badge--mono {
    font-family: var(--font-mono);
    font-size: var(--text-12);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ── Tone swatch (circular swatch + mono code) ── */
.t-swatch {
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform var(--dur-fast) var(--ease-out);
}
.t-swatch:hover { transform: translateY(-2px); }
.t-swatch.selected, .t-swatch:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ── Fields ── */
.t-input, .t-select {
    font-family: var(--font-body);
    font-size: var(--text-15);
    color: var(--text-body);
    background: var(--surface-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-control);
    height: 40px;
    padding: 0 12px;
}
.t-input:focus, .t-select:focus { outline: none; box-shadow: var(--focus-ring); border-color: var(--accent); }

/* ── Tabs (underline, accent indicator) ── */
.t-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.t-tab {
    padding: 10px 14px;
    font-size: var(--text-15);
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
}
.t-tab:hover { color: var(--text-body); }
.t-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Dialog / Toast ── */
.t-scrim { position: fixed; inset: 0; background: var(--scrim); }
.t-dialog {
    background: var(--surface-card);
    border-radius: var(--radius-sheet);
    box-shadow: var(--shadow-lg);
}
.t-toast {
    background: var(--surface-inverse);
    color: #fff;
    border-radius: var(--radius-card);
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    font-size: var(--text-13);
}

/* ── Feedback ── */
.t-error {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid color-mix(in oklch, var(--danger) 25%, transparent);
    border-radius: var(--radius-control);
    padding: 12px 14px;
    font-size: var(--text-13);
}
.t-spinner {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 3px solid var(--bg-subtle);
    border-top-color: var(--accent);
    animation: t-spin 0.9s linear infinite;
}
@keyframes t-spin { to { transform: rotate(360deg); } }

/* ── Brand lockup ── */
.t-lockup { display: inline-block; height: 30px; }
.t-lockup img, .t-lockup svg { height: 100%; width: auto; display: block; }
