/* Shared Pocket Standard visual foundation. */
:root {
  --ink: #0f172a;
  --muted: #64748b;
  --paper: #f1f5f9;
  --card: #ffffff;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --sage: #dbeafe;
  --green: var(--accent);
  --gold: #60a5fa;
  --coral: #3b82f6;
  --shadow: 0 2px 5px rgb(15 23 42 / .05);
  --tone-ecdfbd: #ecdfbd;
  --tone-4f625d: #4f625d;
  --tone-415650: #415650;
  --tone-efdcae: #efdcae;
  --tone-fffefb: #fffefb;
  --tone-c9d9ce: #c9d9ce;
  --tone-f8f4e8: #f8f4e8;
  --tone-bbccc3: #bbccc3;
  --tone-e8bd63: #e8bd63;
  --tone-e2e8f0: #e2e8f0;
  --tone-fff: #fff;
  --tone-c8d6cd: #c8d6cd;
  --tone-f0f6f1: #f0f6f1;
  --tone-c5dccd: #c5dccd;
  --tone-bbc8c0: #bbc8c0;
  --tone-7d8a81: #7d8a81;
  --tone-8db19c: #8db19c;
  --tone-e8eee8: #e8eee8;
  --tone-3b5d4d: #3b5d4d;
  --tone-5f706b: #5f706b;
  --tone-50665d: #50665d;
  --tone-718179: #718179;
  --tone-cbd8ce: #cbd8ce;
  --tone-8b9184: #8b9184;
  --tone-8a968d: #8a968d;
  --tone-f8e8e3: #f8e8e3;
  --tone-d7ddd7: #d7ddd7;
  --tone-d6d9cf: #d6d9cf;
  --tone-cbd2ca: #cbd2ca;
  --tone-0f172a: #0f172a;
  --tone-64748b: #64748b;
  --tone-f1f5f9: #f1f5f9;
  --tone-dbeafe: #dbeafe;
  --tone-2563eb: #2563eb;
  --tone-60a5fa: #60a5fa;
  --tone-3b82f6: #3b82f6;
  --tone-334155: #334155;
  --tone-eff6ff: #eff6ff;
  --tone-f8fafc: #f8fafc;
  --tone-f0fdf4: #f0fdf4;
  --tone-cbd5e1: #cbd5e1;
  --tone-94a3b8: #94a3b8;
  --tone-e0f2fe: #e0f2fe;
  --tone-0369a1: #0369a1;
  --tone-475569: #475569;
  --tone-0284c7: #0284c7;
  --tone-eaf0f7: #eaf0f7;
  --tone-dc2626: #dc2626;
  --tone-d97706: #d97706;
  --tone-16a34a: #16a34a;
  --tone-1d4ed8: #1d4ed8;
  --tone-93c5fd: #93c5fd;
  --tone-0f172a33: #0f172a33;
  --tone-0f172a66: #0f172a66;
  --font: Nunito, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-xs: .75rem;
  --text-sm: .875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px; --space-12: 48px;
  --radius-sm: 6px; --radius: 8px; --radius-lg: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--font); }
button, input, select, textarea { font: inherit; }
button, [role="button"] { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
.btn, button { min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); font-weight: 700; }
.btn-primary, button.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }
.btn-secondary, .secondary { border-color: var(--accent); background: var(--card); color: var(--accent); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn-danger { border-color: var(--danger); background: var(--danger); color: var(--accent-text); }
.btn-small { min-height: 32px; padding: 5px 8px; font-size: var(--text-xs); }
.field { display: grid; gap: var(--space-1); margin: var(--space-3) 0; }
.field label, label { font-weight: 700; }
.field input, input, textarea, select { min-height: 44px; max-width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); background: var(--card); }
.field-hint { color: var(--muted); font-size: var(--text-sm); }
.field-error { color: var(--danger); font-size: var(--text-sm); }
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow); }
.jam-panel { margin-top: var(--space-4); padding: var(--space-4); }
.jam-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: end; margin: var(--space-4) 0; }
.jam-form label { display: grid; min-width: 0; gap: var(--space-1); color: var(--muted); font-size: var(--text-sm); }
.jam-form .jam-button { white-space: nowrap; }
.panel, details.account-panel, details.jam-panel { margin: var(--space-4) 0; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); }
.panel > summary, details.account-panel > summary, details.jam-panel > summary { min-height: 44px; padding: var(--space-2) 0; cursor: pointer; color: var(--ink); font-weight: 800; }
.chip, .instrument-custom { display: inline-block; padding: 6px 10px; border-radius: 999px; background: var(--sage); color: var(--ink); }
.empty-state, .empty { padding: var(--space-8) var(--space-4); border: 1px dashed var(--line); border-radius: var(--radius-lg); color: var(--muted); text-align: center; }
.page { width: min(100% - 32px, 560px); margin: 40px auto; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); }
.signed-in-notice { width: min(100% - 32px, 760px); margin: var(--space-4) auto; padding: var(--space-3); border: 1px solid var(--success); border-radius: var(--radius); background: #f0fdf4; color: var(--ink); line-height: 1.5; }
.signed-in-notice button { min-height: auto; margin-left: var(--space-2); padding: 2px 6px; border: 0; background: transparent; color: var(--accent); text-decoration: underline; }
#authStatus { min-height: 24px; line-height: 1.45; }
.auth-page { display: grid; gap: var(--space-3); }
.auth-page h1, .auth-page p { margin: 0; }
.wordmark { color: var(--ink); font-size: var(--text-lg); font-weight: 900; text-decoration: none; }
.auth-page form { display: grid; gap: var(--space-2); }
.auth-page input, .auth-page button { width: 100%; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.text-link { width: auto !important; min-height: auto; padding: 0; border: 0; background: transparent; color: var(--accent); font-weight: 700; text-decoration: underline; }
.auth-submit { margin-top: var(--space-2); }
.account-signed-out { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.account-signed-out[hidden] { display: none; }
.account-signed-out p { margin: 0; }
.account-signed-out .btn-primary { justify-self: start; display: inline-flex; align-items: center; text-decoration: none; }
.code { letter-spacing: .35em; font-size: 1.3rem; text-align: center; }
.account-panel { color: var(--ink); font-size: 14px; }
.main-nav { display:flex; gap:6px; align-items:center; margin:12px 0; }
.main-nav a { min-height:44px; display:inline-flex; align-items:center; padding:0 10px; border-radius:8px; color:var(--tone-475569); font-weight:700; text-decoration:none; }
.main-nav a[aria-current="page"] { color:var(--green); background:var(--tone-eff6ff); font-weight:800; }
@media (max-width:849px) { .main-nav { position:fixed; z-index:20; inset:auto 0 0; height:56px; margin:0; padding:0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); justify-content:space-around; background:var(--card); border-top:1px solid var(--line); } .main-nav a { min-width:0; flex:1; justify-content:center; padding:0 2px; font-size:.75rem; } body { padding-bottom:calc(64px + env(safe-area-inset-bottom)); } }
.account-panel label { display: block; margin: 12px 0 4px; }
.profile-page { width: min(720px, calc(100% - 32px)); margin: 0 auto; }
.profile-section { margin: 24px 0; }
.profile-section input, .profile-section select, .profile-section textarea, #areaSearch { box-sizing: border-box; width: 100%; min-height: 44px; font-size: 16px; }
.profile-save { position: sticky; bottom: 8px; display: flex; gap: 12px; align-items: center; padding: 12px 0; background: var(--page, var(--card)); }
#areaResults { display: grid; gap: 4px; max-height: 260px; overflow: auto; margin-top: 4px; }
#areaResults button { text-align: left; min-height: 44px; width: 100%; }
.account-panel textarea { min-height: 90px; }
.account-panel button { margin: 6px 4px 6px 0; }
.instrument-families, .instrument-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.instrument-picker { border: 0; padding: 0; margin: 12px 0; }
.instrument-family.selected, .instrument-chip.selected { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.account-panel p { line-height: 1.5; overflow-wrap: anywhere; }
.friend-card { padding: 14px 0; border-top: 1px solid var(--line); }
.account-grid, .match-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.account-panel [hidden] { display: none !important; }
.account-panel input[type=checkbox] { width: 24px; height: 24px; vertical-align: middle; margin-right: 8px; }
.profile-page { width: min(100%, 720px); margin: var(--space-4) auto; }
.profile-section { margin: var(--space-5) 0; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); }
.profile-section h2 { margin-top: 0; }
.profile-section label { display: block; margin: var(--space-3) 0 var(--space-1); }
.profile-section input:not([type=checkbox]), .profile-section textarea, .profile-section select { box-sizing: border-box; width: 100%; font-size: 16px; }
.profile-section .check-label { display: flex; gap: var(--space-2); align-items: center; }
.profile-section .check-label input { flex: 0 0 auto; }
.profile-save { position: sticky; bottom: calc(56px + env(safe-area-inset-bottom)); z-index: 10; display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.profile-dirty-save { display: none; }
@media (max-width: 849px) { .profile-dirty-save { position: fixed; z-index: 21; right: 16px; bottom: calc(56px + env(safe-area-inset-bottom)); left: 16px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); } .profile-dirty-save button { margin: 0; } }
.instrument-groups { display: grid; gap: var(--space-3); }
.instrument-group h3 { margin: 0 0 var(--space-1); font-size: var(--text-sm); }
.instrument-chip { margin: 0; border: 1px solid var(--accent); background: var(--card); color: var(--accent); }
.instrument-chip:disabled { opacity: .45; }
.instrument-custom { margin: var(--space-2) var(--space-2) 0 0; border: 1px solid var(--line); }
.match-columns > * { min-width: 0; }
.match-card { margin: 10px 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); overflow-wrap: anywhere; }
.match-card h3 { margin: 0 0 5px; font-size: var(--text-base); }
.match-count { color: var(--accent); font-size: 1.25rem; font-weight: 800; }
.match-muted { color: var(--muted); font-size: var(--text-sm); }
.match-song-list { max-height: 330px; padding: 0; list-style: none; overflow-y: auto; overflow-x: hidden; }
.match-song-list li { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.match-song-list li > span { min-width: 0; flex: 1; }
.match-song-list button { min-width: 44px; margin: 2px; flex-shrink: 0; }
.matching-panel fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.matching-panel[open] > summary { display: none; }
body[data-matching-page="players"] [data-matching-feature="sets"], body[data-matching-page="sets"] [data-matching-feature="players"] { display: none; }
body.signed-in .matching-signed-out { display: none; }
.matching-panel .match-band-label { display: flex; gap: 8px; align-items: center; }
@media (max-width: 800px) { .match-columns { grid-template-columns: 1fr; } .match-song-list li { flex-wrap: wrap; } .match-song-list li > span { flex-basis: 100%; } }
@media (max-width: 650px) { .account-grid { grid-template-columns: 1fr; gap: 8px; } .account-panel { padding: 12px; } .account-panel input, .account-panel textarea { font-size: 16px; } .toolbar-actions { flex-wrap: wrap; } .control, .rating-select, .note-btn { min-height: 44px; } .check { width: 28px; height: 28px; } .tune td { padding-top: 14px; padding-bottom: 14px; } }
@media (max-width: 580px) { .jam-form { grid-template-columns: 1fr; align-items: stretch; } .jam-form .jam-button { width: 100%; } }
@media (max-width: 375px) { .page { width: 100%; min-height: 100vh; margin: 0; padding: 20px; border: 0; border-radius: 0; } }
