/**
 * components.css - v141 design-system primitives
 *
 * These rules read ONLY from design-system tokens (--color-*, --radius-*,
 * --icon-*, --thumb-*). They never set colours or radii directly.
 *
 * Loaded after base (app.css), before per-page overrides.
 * As pages migrate off per-file <style> blocks their layout rules move
 * into utilities.css or get folded into existing primitives.
 */
/* ============================================================
   ICONS - uniform sizing + colour variants
   Pair <i class="fa-..."> with .icon-sm/md/lg/xl to size consistently.
   ============================================================ */
.icon-xs { font-size: var(--icon-xs); width: var(--icon-xs); height: var(--icon-xs); line-height: 1; }
.icon-sm { font-size: var(--icon-sm); width: var(--icon-sm); height: var(--icon-sm); line-height: 1; }
.icon-md { font-size: var(--icon-md); width: var(--icon-md); height: var(--icon-md); line-height: 1; }
.icon-lg { font-size: var(--icon-lg); width: var(--icon-lg); height: var(--icon-lg); line-height: 1; }
.icon-xl { font-size: var(--icon-xl); width: var(--icon-xl); height: var(--icon-xl); line-height: 1; }
.icon-primary    { color: var(--color-primary); }
.icon-secondary  { color: var(--color-secondary); }
.icon-feature-1  { color: var(--color-feature-1); }
.icon-feature-2  { color: var(--color-feature-2); }
.icon-feature-3  { color: var(--color-feature-3); }
.icon-feature-4  { color: var(--color-feature-4); }
.icon-utility-1  { color: var(--color-utility-1); }
.icon-utility-2  { color: var(--color-utility-2); }
.icon-utility-3  { color: var(--color-utility-3); }
.icon-utility-4  { color: var(--color-utility-4); }
.icon-muted      { color: var(--text-muted); }
/* ============================================================
   THUMBNAILS + AVATARS - sized by variant class
   Each size pulls its radius token so admin controls them independently.
   ============================================================ */
.thumb { display: inline-block; object-fit: cover; background: var(--color-surface-subtle); overflow: hidden; }
.thumb-xs { width: var(--thumb-xs); height: var(--thumb-xs); border-radius: var(--thumb-sm-radius, var(--radius-xs)); }
.thumb-sm { width: var(--thumb-sm); height: var(--thumb-sm); border-radius: var(--thumb-sm-radius, var(--radius-sm)); }
.thumb-md { width: var(--thumb-md); height: var(--thumb-md); border-radius: var(--thumb-md-radius, var(--radius-sm)); }
.thumb-lg { width: var(--thumb-lg); height: var(--thumb-lg); border-radius: var(--thumb-lg-radius, var(--radius-md)); }
.thumb-xl { width: var(--thumb-xl); height: var(--thumb-xl); border-radius: var(--thumb-lg-radius, var(--radius-md)); }
.avatar { display: inline-block; object-fit: cover; background: var(--color-surface-subtle); overflow: hidden; border-radius: var(--avatar-radius, var(--radius-circle)); }
.avatar.thumb-xs,
.avatar.thumb-sm,
.avatar.thumb-md,
.avatar.thumb-lg,
.avatar.thumb-xl { border-radius: var(--avatar-radius, var(--radius-circle)); }
/* ============================================================
   PILL - replaces .tab/.badge/.chip over time. Variant classes carry
   intent colour. New code should use .pill; .tab and .badge still work
   via legacy rules elsewhere.
   ============================================================ */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--pill-radius, var(--radius-pill));
    font-size: var(--pill-font-size, 13px);
    font-weight: 600;
    line-height: 1;
    background: var(--color-surface-subtle);
    color: var(--text-secondary, inherit);
    border: 0;
}
.pill-primary    { background: var(--color-primary);    color: var(--color-primary-reverse); }
.pill-secondary  { background: var(--color-secondary);  color: var(--color-secondary-reverse); }
.pill-feature-1  { background: var(--color-feature-1);  color: var(--color-feature-1-reverse); }
.pill-feature-2  { background: var(--color-feature-2);  color: var(--color-feature-2-reverse); }
.pill-feature-3  { background: var(--color-feature-3);  color: var(--color-feature-3-reverse); }
.pill-feature-4  { background: var(--color-feature-4);  color: var(--color-feature-4-reverse); }
.pill-utility-1  { background: var(--color-utility-1);  color: var(--color-utility-1-reverse); }
.pill-utility-2  { background: var(--color-utility-2);  color: var(--color-utility-2-reverse); }
.pill-utility-3  { background: var(--color-utility-3);  color: var(--color-utility-3-reverse); }
.pill-utility-4  { background: var(--color-utility-4);  color: var(--color-utility-4-reverse); }
.pill-subtle     { background: var(--color-surface-subtle); color: var(--text-secondary); }
/* ============================================================
   PAGE SHELL - the canonical structure every public page uses.
   Pages are built via includes/page.php helpers; this is where their
   look lives. See docs/DESIGN-SYSTEM.md.
   ============================================================ */
.page {
    display: block;
    width: 100%;
}
.page-container {
    /* v183: box-sizing: border-box so page-container matches header/footer
       geometry. Without this, the page content extends 48px wider than the
       header/footer pills (because default content-box adds padding to the
       outer width, but header/footer are border-box). */
    max-width: var(--page-width, 1400px);
    margin: 0 auto;
    padding: 0 var(--page-padding, 24px) var(--page-padding, 24px);
    box-sizing: border-box;
    width: 100%;
}
.page-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 20px 0 24px;
}
.page-header:has(.page-header-actions) {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.page-header-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
}
.page-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    flex: 0 0 auto;
}
.page-title {
    margin: 0;
    line-height: 1.1;
    font-size: var(--page-title-size, clamp(32px, 4.5vw, 48px));
    font-family: var(--page-title-font, inherit);
    color: var(--text, var(--color-surface-reverse));
}
.page-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.5;
    max-width: 68ch;
}
/* ============================================================
   SECTION - the universal content card. One shape, always.
   Variants modify padding or elevation, not identity.
   ============================================================ */
.section {
    background: var(--section-bg, var(--color-surface));
    color: var(--section-text, var(--color-surface-reverse));
    border-radius: var(--section-radius, var(--radius-lg));
    padding: 0;
    margin-bottom: var(--section-gap, 20px);
    overflow: hidden;
}
.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: var(--section-padding-y, 20px) var(--section-padding, 24px) 0;
}
.section-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
}
.section-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: inherit;
}
.section-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
    max-width: 68ch;
}
.section-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
}
.section-body {
    padding: var(--section-padding-y, 20px) var(--section-padding, 24px);
}
.section-footer {
    padding: 14px var(--section-padding, 24px);
    border-top: 1px solid var(--section-border, var(--color-surface-subtle));
}
.section-compact .section-header { padding-top: 12px; padding-left: 16px; padding-right: 16px; }
.section-compact .section-body   { padding: 12px 16px; }
.section-compact .section-footer { padding: 10px 16px; }
/* ============================================================
   BUTTON - one rule, size + intent variants
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 var(--button-padding, 18px);
    height: var(--button-height, 48px);
    min-height: var(--button-height, 48px);
    font-family: inherit;
    font-size: var(--button-font-size, 15px);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    border: 0;
    border-radius: var(--button-radius, var(--radius-md));
    transition: background .15s, color .15s, opacity .15s;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.is-disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.btn-sm { height: 36px; min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 56px; min-height: 56px; padding: 0 24px; font-size: 17px; }
.btn-primary    { background: var(--button-bg, var(--color-primary));   color: var(--button-text, var(--color-primary-reverse)); }
.btn-primary:hover:not(:disabled) { background: var(--color-primary-bold); }
.btn-secondary  { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; }
.btn-secondary:hover:not(:disabled) { background: var(--color-surface-subtle); }
.btn-success    { background: var(--color-utility-1); color: var(--color-utility-1-reverse); }
.btn-success:hover:not(:disabled) { background: var(--color-utility-1-bold); }
.btn-warning    { background: var(--color-utility-2); color: var(--color-utility-2-reverse); }
.btn-warning:hover:not(:disabled) { background: var(--color-utility-2-bold); }
.btn-danger     { background: var(--color-utility-3); color: var(--color-utility-3-reverse); }
.btn-danger:hover:not(:disabled) { background: var(--color-utility-3-bold); }
.btn-info       { background: var(--color-utility-4); color: var(--color-utility-4-reverse); }
.btn-info:hover:not(:disabled) { background: var(--color-utility-4-bold); }
.btn-ghost      { background: transparent; color: inherit; }
.btn-ghost:hover:not(:disabled) { background: var(--color-surface-subtle); }
.btn-link       { background: transparent; color: var(--color-primary); padding: 0; height: auto; min-height: 0; }
.btn-link:hover:not(:disabled) { text-decoration: underline; }
/* ============================================================
   INPUT / SELECT / TEXTAREA - one rule, variants by element
   ============================================================ */
.input, .select, .textarea,
.form-input, .form-select, .form-textarea, .form-control {
    display: block;
    width: 100%;
    height: var(--input-height, 48px);
    padding: 0 var(--input-padding, 16px);
    font-family: inherit;
    font-size: var(--input-font-size, 15px);
    line-height: 1;
    color: var(--color-surface-reverse);
    background: var(--input-bg-token, var(--input-bg, var(--color-surface)));
    border: 1px solid var(--input-border, var(--color-surface-subtle));
    border-radius: var(--input-radius, var(--radius-md));
    transition: border-color .15s, box-shadow .15s, background .15s;
    box-sizing: border-box;
}
.textarea, .form-textarea {
    height: auto;
    min-height: 120px;
    padding: 12px var(--input-padding, 16px);
    line-height: 1.5;
}
.input:focus, .select:focus, .textarea:focus,
.form-input:focus, .form-select:focus, .form-textarea:focus, .form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 20%, transparent);
}
.input::placeholder, .textarea::placeholder,
.form-input::placeholder, .form-textarea::placeholder, .form-control::placeholder {
    color: var(--text-muted);
}
/* ============================================================
   MODAL - overlay + box, sizes, consistent chrome
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(17, 18, 22, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.modal-overlay.is-open,
.modal-overlay.active { display: flex; }
.modal-overlay > .modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: auto;
    background: var(--section-bg, var(--color-surface));
    color: var(--section-text, var(--color-surface-reverse));
    border-radius: var(--modal-radius, var(--radius-lg));
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}
.modal-sm            { max-width: 400px; }
.modal-md            { max-width: 560px; }
.modal-lg            { max-width: 720px; }
.modal-content-width { max-width: min(var(--content-width, 1200px), 92vw); }
/* ============================================================
   ALERT - intent variants, no borders by default
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--alert-radius, var(--radius-md));
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 16px;
    color: var(--color-surface-reverse);
    background: var(--color-surface-subtle);
}
.alert-info    { background: var(--color-utility-4-subtle); color: var(--color-utility-4-bold); }
.alert-success { background: var(--color-utility-1-subtle); color: var(--color-utility-1-bold); }
.alert-warning { background: var(--color-utility-2-subtle); color: var(--color-utility-2-bold); }
.alert-danger  { background: var(--color-utility-3-subtle); color: var(--color-utility-3-bold); }
/* ============================================================
   CARD PRIMITIVE - .item-card (v180)
   
   Shared card look across every small clickable tile: top 10 song row,
   trending song, top artist, spotlight result, newest tile, etc.
   Tokens are admin-controlled via Theme > Cards:
     --card-bg               background colour
     --card-border-color     border colour (set to transparent for no border)
     --card-border-width     border thickness
     --card-radius           corner radius
     --card-padding          inner padding
     --card-hover-bg         background on hover for clickable cards
     --card-hover-border     border colour on hover for clickable cards
   
   No dividers between items - the border + background IS the separation.
   ============================================================ */
.item-card {
    background: var(--card-bg, var(--color-surface, #ffffff));
    border: var(--card-border-width, 1px) solid var(--card-border-color, var(--color-surface-subtle, rgba(0,0,0,.08)));
    border-radius: var(--card-radius, var(--radius-md, 12px));
    padding: var(--card-padding, 12px);
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 120ms ease, border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
/* Clickable cards get a hover state. Applies when the card is itself an
   anchor/button, or when it carries the .is-clickable modifier. */
a.item-card,
button.item-card,
.item-card.is-clickable {
    cursor: pointer;
}
a.item-card:hover,
button.item-card:hover,
.item-card.is-clickable:hover {
    background: var(--card-hover-bg, var(--color-primary-subtle, var(--color-surface-subtle)));
    border-color: var(--card-hover-border, var(--color-primary, var(--primary, #40026f)));
    transform: translateY(var(--card-hover-motion-y, 0));
    text-decoration: none;
}
/* Stacked list of item-cards: no gap is applied here (so adjacent cards
   touch borders cleanly). Use .item-card-list to add a small gap. */
.item-card-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ============================================================
   EMPTY STATE - canonical structure (helper: empty_state())
   ============================================================ */
.empty-state {
    /* v175: .empty-state is LAYOUT ONLY. The surrounding <section
       class="section"> provides the chrome (bg, radius, outer padding).
       Every call site is expected to emit a section wrapper - the PHP
       helper empty_state() does that by default, and every JS template
       was swept to match. If a bare .empty-state is injected into a grid
       parent anyway, grid-column: 1 / -1 keeps it full-width. */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 48px 24px;
    text-align: center;
    color: var(--section-text, var(--text));
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    grid-column: 1 / -1;
}
/* Section that exists only to carry an empty state: drop the inner
   section-body padding so the empty-state's own padding sets the rhythm. */
.section.section-empty > .section-body { padding: 0; }
.empty-state-icon {
    /* v166: big bright feature-1 chip with soft glow - the "more interesting"
       empty state the user remembers. Admin can retint via --color-feature-1. */
    width: 96px;
    height: 96px;
    border-radius: var(--radius-circle);
    background: var(--color-feature-1, var(--color-primary-subtle, var(--color-surface-subtle)));
    color: var(--color-feature-1-reverse, var(--color-primary, #40026f));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin-bottom: 6px;
    flex-shrink: 0;
    box-shadow: 0 6px 24px color-mix(in srgb, var(--color-feature-1, var(--color-primary)) 24%, transparent);
}
.empty-state-icon i { line-height: 1; }
.empty-state-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--section-text, var(--color-surface-reverse));
    line-height: 1.2;
}
.empty-state-message {
    margin: 0;
    max-width: 48ch;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-muted);
}
.empty-state-action { margin-top: 8px; }
/* Compact variant for use inside tight spaces (sidebar, small card) */
.empty-state-compact { padding: 32px 20px; gap: 10px; }
.empty-state-compact .empty-state-icon { width: 64px; height: 64px; font-size: 28px; box-shadow: 0 4px 16px color-mix(in srgb, var(--color-feature-1, var(--color-primary)) 20%, transparent); }
.empty-state-compact .empty-state-title { font-size: 17px; }
.empty-state-compact .empty-state-message { font-size: 14px; }
/* ============================================================
   DROPDOWN - menu + items
   ============================================================ */
.dropdown-menu {
    background: var(--section-bg, var(--color-surface));
    color: var(--section-text, var(--color-surface-reverse));
    border-radius: var(--dropdown-radius, var(--radius-lg));
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
    border: 0;
}
.dropdown-menu > .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
}
.dropdown-menu > .dropdown-item:hover {
    background: var(--color-surface-subtle);
}
.dropdown-menu > .dropdown-item.is-active {
    background: var(--color-primary);
    color: var(--color-primary-reverse);
}
/* ============================================================
   PROSE - typographic container for rich-text content
   (legal pages, admin-authored HTML, article bodies).
   ============================================================ */
.prose {
    color: var(--color-surface-reverse);
    line-height: 1.7;
    font-size: 16px;
}
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1,
.prose h2,
.prose h3 { margin: 1.6em 0 0.5em; line-height: 1.25; }
.prose h1 { font-size: 1.8em; }
.prose h2 { font-size: 1.4em; }
.prose h3 { font-size: 1.15em; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0.75em 0 1em 1.5em; }
.prose li { margin-bottom: 0.35em; }
.prose a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--color-primary-bold); }
.prose img { max-width: 100%; border-radius: var(--radius-md); }
.prose hr { border: 0; border-top: 1px solid var(--section-border, var(--color-surface-subtle)); margin: 2em 0; }
.prose blockquote {
    margin: 1em 0;
    padding: 12px 16px;
    border-left: 3px solid var(--color-primary);
    background: var(--color-surface-subtle);
    border-radius: var(--radius-sm);
}
.prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.9em;
    padding: 1px 6px;
    background: var(--color-surface-subtle);
    border-radius: var(--radius-xs);
}
/* ============================================================
   AUTH PAGES - narrow centered form card used by sign in, register,
   forgot/reset password, verify, resend verification.
   ============================================================ */
.page-auth .page-container {
    max-width: 480px;
    padding-top: 60px;
    padding-bottom: 60px;
}
.page-auth .page-header {
    margin: 0 0 16px;
}
.page-auth .page-title {
    font-size: 28px;
    text-align: center;
}
.page-auth .page-subtitle {
    margin: 4px auto 0;
    text-align: center;
}
.page-auth .section { margin-bottom: 20px; }
.page-auth .auth-switch {
    text-align: center;
    color: var(--text-muted);
    padding-top: 24px;
    border-top: 1px solid var(--section-border, var(--color-surface-subtle));
    margin-top: 24px;
}
.page-auth .auth-switch a { color: var(--color-primary); font-weight: 600; }
/* Full-width button helper (used in auth forms, modals, narrow panels) */
.btn-block { display: flex; width: 100%; }
/* v148 HOTFIX 4: unified input + select + option font-size.
   Inputs, selects, select's own options, textareas and the canonical
   search-field input ALL read the single admin token
   --input-font-size so admin can tune type size in one place and
   every form control moves together. Admin > Theme > Text Inputs >
   Font size controls this. */
html input[type="text"], html input[type="email"], html input[type="password"], html input[type="number"], html input[type="url"], html input[type="tel"], html input[type="search"], html input[type="date"], html input[type="time"], html input[type="datetime-local"], html select, html option, html textarea, html .form-input, html .form-select, html .form-control, html .form-textarea{
    font-size: var(--input-font-size, 17px) !important;
    line-height: 1.3;
}
/* v148.9: canonical empty-state is the ONLY empty-state. Legacy variant
   classes (.empty-state-standalone, .empty-state-sm) collapse to the same
   look so no page can accidentally diverge. */
.empty-state.empty-state-standalone,
.empty-state.empty-state-sm {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}
/* Also pin the icon inside the gutter */

/* ============================================================
   SEARCH FIELD - single canonical component.
   One wrapper (.search-field), one icon (.search-field-icon),
   one input (.search-field-input). All other files have had their
   .search-field* rules deleted - this is the ONLY place that styles
   the search field. No !important. Admin tokens flow via var()s.
   ============================================================ */
.search-field {
    /* v185.1: wrapper IS the visible pill. Chrome (bg, border, radius,
       padding) lives HERE so no global input rule can touch it. The input
       inside is transparent, borderless, zero-padding, flex: 1. The icon
       sits to the LEFT of the input by natural flex order - cannot ever
       overlap the text because there is no overlap, only sibling flex items. */
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    height: var(--input-height, 48px);
    padding: 0 18px;
    box-sizing: border-box;
    background: var(--input-bg-token, var(--input-bg, var(--color-surface, #ffffff)));
    color: var(--input-text-token, var(--text, #111216));
    border: 1px solid var(--input-border, transparent);
    border-radius: var(--input-radius, var(--radius-pill, 999px));
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.search-field:hover {
    background: var(--input-hover-bg-token, var(--input-bg-hover, color-mix(in srgb, var(--input-bg, #fff) 92%, var(--text, #000) 8%)));
}
.search-field:focus-within {
    border-color: var(--color-primary, var(--primary, #40026f));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, var(--primary, #40026f)) 20%, transparent);
}
.search-field-icon {
    color: var(--text-muted, #6b7280);
    font-size: var(--icon-sm, 16px);
    line-height: 1;
    flex-shrink: 0;
    /* no absolute positioning any more - flex child */
    position: static;
    width: auto;
    height: auto;
    left: auto;
    top: auto;
    transform: none;
}
.search-field-input,
.search-field > input.search-field-input {
    /* Transparent, borderless, no padding - the wrapper carries all chrome.
       No padding here means no rule can clobber the icon reserve: there is
       no icon reserve to clobber, the icon is a sibling not an overlap. */
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: var(--input-font-size, 15px);
    font-family: inherit;
    outline: none;
    box-shadow: none;
}
.search-field .search-field-input::placeholder {
    color: var(--text-muted, #9ca3af);
    opacity: 1;
}
.search-field .search-field-input:focus,
.search-field > input.search-field-input:focus {
    /* Focus ring is on the wrapper (:focus-within), not the input itself. */
    outline: none;
    border: 0;
    box-shadow: none;
    background: transparent;
}

/* Size variants */
.search-field.search-field-sm { height: 40px; padding: 0 14px; gap: 8px; }
.search-field.search-field-sm .search-field-input { font-size: 14px; }
.search-field.search-field-lg { height: 56px; padding: 0 22px; gap: 12px; }
.search-field.search-field-lg .search-field-input { font-size: 16px; }



/* ============================================================
   HEADER + FOOTER - single canonical component.
   
   Three primitives share the EXACT same geometry formula so they
   always line up pixel-for-pixel:
   
     .page-container  - the page body
     .header-inner    - the visible nav pill
     .footer-inner    - the visible footer pill
   
   All three:
     width: 100%
     max-width: var(--page-width, 1400px)
     margin-left: auto; margin-right: auto
     box-sizing: border-box   <-- padding INSIDE the max-width
   
   Zero !important. All colour + radius + padding via var() so admin
   tokens flow in cleanly.
   ============================================================ */

/* The invisible outer wrappers.
   .header and .footer are transparent positioning shells that just hold
   the sticky position / vertical margin. The VISIBLE pill is the -inner. */
/* v185: outer shells share ONE contract with .page-container. All three
   are centred, capped at --page-width, box-sizing: border-box, with the
   SAME horizontal padding. The visible pill (.header-inner / .footer-inner)
   fills the shell's content box, so the pill edge aligns with the sections
   underneath. */
.header {
    position: sticky;
    top: 0;
    z-index: 500;
    max-width: var(--page-width, 1400px);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    background: transparent;
    box-sizing: border-box;
    padding: 12px var(--page-padding, 24px) 0;
    margin-top: var(--nav-margin-top, 0);
}
.footer {
    max-width: var(--page-width, 1400px);
    width: 100%;
    margin: 56px auto 16px;
    background: transparent;
    box-sizing: border-box;
    padding: 0 var(--page-padding, 24px);
}

/* The visible pills fill their parent's content box (which is page-width -
   2 x page-padding). No own max-width, no own margin-auto - that is the
   outer shell's job. This is why the pill aligns with sections. */
.header-inner,
.footer-inner {
    width: 100%;
    box-sizing: border-box;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: var(--nav-padding-y, 12px) var(--nav-padding-x, 24px);
    background: var(--navbar-bg, var(--color-surface, #fff));
    color: var(--navbar-text, var(--color-surface-reverse, #111));
    border-radius: var(--navbar-radius, var(--radius-lg));
    box-shadow: var(--sk-shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
    position: relative;
    z-index: 1;
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    backdrop-filter: saturate(140%) blur(14px);
}

.footer-inner {
    padding: var(--nav-padding-y, 20px) var(--nav-padding-x, 24px);
    background: var(--footer-bg, var(--sk-chrome, var(--color-primary, #40026f)));
    color: var(--footer-text, var(--sk-chrome-text, #fff));
    border-radius: var(--footer-radius, var(--radius-lg));
    /* v161.1: footer pill centres its contents vertically-stacked */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

/* Page-container already defined above - this is a reminder it shares the
   same geometry formula. No need to redefine. */


/* v161: navbar items wired to new theme tokens.
   .nav-link + .nav-dropdown-toggle now read:
     --navbar-item-radius     (shape)
     --navbar-item-padding-x  (horizontal padding)
     --navbar-item-font-size  (type size)
     --navbar-item-font-weight (type weight)
   Admin Theme > Navbar items controls them in one place.
   .nav itself gets --navbar-item-gap. */
.header-inner .nav {
    gap: var(--navbar-item-gap, 4px);
}
.header-inner .nav-link,
.header-inner .nav-dropdown .nav-dropdown-toggle {
    font-size: var(--navbar-item-font-size, 15px);
    font-weight: var(--navbar-item-font-weight, 600);
    padding-left: var(--navbar-item-padding-x, 16px);
    padding-right: var(--navbar-item-padding-x, 16px);
    border-radius: var(--navbar-item-radius, 999px);
}


/* ============================================================
   v164: canonical item radius wiring.
   
   Every interactive item type reads its radius from ONE admin token.
   Competing rules in app.css + skin.css were stripped so there is no
   cascade battle. Zero !important.
   ============================================================ */

/* Navbar text items share --navbar-item-radius */
.nav-link:not(.nav-icon-link),
.nav-dropdown .nav-dropdown-toggle {
    border-radius: var(--navbar-item-radius, var(--radius-pill));
}
/* v171: icon buttons get their own radius so they can stay round when the
   text items go square. Falls back to the item radius if not set. */
.nav-icon-link,
.nav-link.nav-icon-link {
    border-radius: var(--navbar-icon-radius, var(--navbar-item-radius, var(--radius-pill)));
}

/* Tab bar items - any .tab, any button inside .tabs/.toolbar/.filter-row
   that isn't an actual .btn */
.tab,
.tabs > button:not(.btn):not(.btn-icon),
.toolbar > button:not(.btn):not(.btn-icon),
.filter-row > button:not(.btn):not(.btn-icon) {
    border-radius: var(--tabbar-item-radius, var(--radius-md));
}

/* Dropdown items - nav dropdowns, admin menu, profile menu, autocomplete */
.dropdown-menu > .dropdown-item,
.nav-dropdown-menu > .nav-dropdown-item,
.admin-menu .admin-menu-item,
.profile-menu .profile-menu-item,
.autocomplete-dropdown .autocomplete-item {
    border-radius: var(--dropdown-item-radius, var(--radius-sm));
}

/* Badge / pill - single token */
.badge,
.pill {
    border-radius: var(--pill-radius, var(--radius-pill));
}


/* ============================================================
   BODY TEXT SIZE UTILITIES (v182)
   Only four sizes for body text sitewide so the system reads as one
   rhythm. Tokens come from Theme > Theme.
   ============================================================ */
.text-xs   { font-size: var(--text-xs,   12px); line-height: 1.4; }
.text-sm   { font-size: var(--text-sm,   13px); line-height: 1.45; }
.text-base { font-size: var(--text-base, 15px); line-height: 1.5; }
.text-lg   { font-size: var(--text-lg,   17px); line-height: 1.55; }
