/* Erasmus — "Playful" look: lavender page, white rounded cards with a hard lilac shadow, coral and violet accents, Nunito. */
:root {
    --bg: #f6f1ff;
    --panel: #ffffff;
    --tint: #efe8ff;
    --ink: #2b2150;
    --muted: #5a5285;
    --line: #e4dbff;
    --shadow: #e4dbff;
    --accent: #4b3bb0;        /* violet: links, selected things, dark buttons */
    --accent-soft: #efe8ff;
    --coral: #ff7a59;         /* primary buttons */
    --coral-deep: #f26a47;
    --mint: #9be7c4;
    --mint-ink: #14382b;
    --amber: #ffb86b;
    --amber-soft: #ffe9a8;
    --amber-ink: #4a2a05;
    --good: #2f9e5b;
    --bad: #c8403a;
    --root: #ff7a59;
    --note: #4b3bb0;
    --radius: 28px;
    --radius-sm: 16px;
    font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { font-weight: 500; line-height: 1.45; }
a { color: var(--accent); font-weight: 700; }
a:hover { color: var(--ink); }
h1 { font-weight: 900; font-size: 2.2rem; line-height: 1.1; margin: 0 0 0.6rem; letter-spacing: -0.01em; }
h2 { font-weight: 900; font-size: 1.35rem; margin: 0 0 0.5rem; }
h3 { font-weight: 900; font-size: 1.1rem; margin: 0 0 0.3rem; }
code { font-family: Consolas, "Cascadia Mono", monospace; background: var(--tint); padding: 0.1em 0.35em; border-radius: 6px; }
.lead { font-size: 1.15rem; max-width: 60ch; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--bad); }

/* Layout: a top bar, the page, a footer */
.shell { display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: var(--bg); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 1rem 2rem; display: flex; flex-wrap: wrap; gap: 0.8rem 1rem; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-size: 1.6rem; font-weight: 900; }
.brand svg { display: block; }
.topnav { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; font-weight: 700; font-size: 0.95rem; }
.nav-link, .menu-btn { display: inline-block; color: var(--ink); text-decoration: none; padding: 0.55rem 1.1rem; border-radius: 999px; background: var(--panel); border: 0; font: inherit; font-weight: 700; cursor: pointer; line-height: 1.2; }
.nav-link:hover, .menu-btn:hover { background: var(--tint); color: var(--ink); }
.nav-link.active { background: var(--accent); color: #fff; }
.nav-link.join-link { background: var(--coral); color: var(--ink); }
.nav-link.login-link { background: var(--accent); color: #fff; }
.menu { position: relative; }
.menu-btn::after { content: " ▾"; font-size: 0.75em; color: var(--muted); }
.menu-list { display: none; position: absolute; top: 100%; left: 0; margin-top: 6px; min-width: 14rem; background: var(--panel); border-radius: 20px; box-shadow: 0 8px 0 var(--shadow), 0 12px 30px rgba(43, 33, 80, 0.12); padding: 0.5rem; z-index: 40; }
.menu-list::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 12px; }   /* bridges the gap so the mouse can cross it */
.menu.right .menu-list { left: auto; right: 0; }
.menu:hover .menu-list, .menu.open .menu-list { display: block; }
.menu.open .menu-btn { background: var(--tint); }
.menu-list .nav-link { display: block; border-radius: 12px; padding: 0.45rem 0.8rem; background: transparent; }
.menu-list .nav-link:hover { background: var(--tint); }
.menu-list .nav-link.active { background: var(--accent); color: #fff; }
.nav-section { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 0.6rem 0.8rem 0.2rem; }
.account-box { display: flex; align-items: center; gap: 0.5rem; margin-left: 0.5rem; }
.account-name { font-weight: 900; padding: 0.3rem 0.4rem; }
.link-button { font: inherit; font-weight: 700; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0.3rem 0.5rem; }
.link-button:hover { text-decoration: underline; }
.content { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.2rem 2rem 3rem; }
.site-footer { max-width: 1180px; margin: 0 auto; width: 100%; padding: 1rem 2rem 2.5rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; color: var(--muted); font-size: 0.9rem; }
.site-footer b { color: var(--ink); font-weight: 900; }
@media (max-width: 700px) {
    .topbar-inner, .content, .site-footer { padding-left: 1rem; padding-right: 1rem; }
    .menu-list { position: static; box-shadow: none; padding: 0.2rem 0 0.4rem 0.6rem; background: transparent; }
    .topnav { gap: 0.3rem; }
}

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2rem; margin-top: 1rem; }
.card { background: var(--panel); border: 0; border-radius: var(--radius); padding: 1.3rem 1.4rem; text-decoration: none; color: var(--ink); box-shadow: 0 8px 0 var(--shadow); font-weight: 500; transition: transform 0.12s; }
a.card:hover { transform: translateY(-2px); color: var(--ink); }
.card h2 { font-size: 1.25rem; }
.card p { color: var(--muted); margin: 0; }

/* Panels and tables */
.panel { background: var(--panel); border: 0; border-radius: var(--radius); padding: 1.3rem 1.5rem; margin-top: 1rem; box-shadow: 0 8px 0 var(--shadow); }
.table { border-collapse: collapse; width: 100%; }
.table th, .table td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.table tr.selected td { background: var(--accent-soft); }
.note { font-weight: 900; color: var(--note); }
.roman { font-weight: 900; letter-spacing: 0.02em; }

/* Controls */
.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-top: 0.8rem; }
.toolbar label, .form-row label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.toolbar label.check { flex-direction: row; align-items: center; gap: 0.4rem; padding-bottom: 0.5rem; }
.select, .input { font: inherit; font-weight: 600; color: var(--ink); padding: 0.5rem 0.8rem; border: 2px solid var(--line); border-radius: 14px; background: #fff; min-width: 10rem; }
.select:focus, .input:focus { outline: none; border-color: var(--accent); }
.input.narrow { min-width: 4.5rem; width: 4.5rem; }
.input.wide { min-width: 18rem; }
.button { font: inherit; font-weight: 900; background: var(--coral); color: var(--ink); border: 0; border-radius: 999px; padding: 0.6rem 1.2rem; cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.2; }
.button:hover { background: var(--coral-deep); color: var(--ink); }
.button.small { padding: 0.3rem 0.8rem; font-size: 0.82rem; }
.button.big { padding: 0.9rem 1.8rem; font-size: 1.1rem; }
.button.secondary { background: var(--panel); color: var(--ink); border: 2px solid var(--line); }
.button.secondary:hover { border-color: var(--accent); background: var(--panel); }
.button.dark { background: var(--accent); color: #fff; }
.button.dark:hover { background: #3a2c92; color: #fff; }
.button.danger { background: var(--bad); color: #fff; }
.button.active { background: var(--accent); color: #fff; border: 0; }
.button:disabled { opacity: 0.55; cursor: default; }
.form-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-end; }
.row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.row.right { justify-content: flex-end; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* Badges, tags, notices */
.badge { display: inline-block; padding: 0.15rem 0.65rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--tint); color: var(--ink); }
.badge.ok { background: var(--mint); color: var(--mint-ink); }
.badge.new { background: var(--coral); color: var(--ink); }
.tag { display: inline-block; padding: 0.15rem 0.65rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--tint); color: var(--accent); text-decoration: none; }
.tag.more { background: var(--line); color: var(--muted); }
a.tag:hover { background: var(--line); }
.notice { background: var(--amber-soft); border: 0; border-radius: var(--radius-sm); padding: 0.7rem 1rem; margin: 0 0 1rem; color: var(--amber-ink); }
.notice a { color: var(--amber-ink); }
code.invite { margin-left: 0.5rem; font-size: 1rem; letter-spacing: 0.08em; background: var(--amber-soft); padding: 0.1rem 0.4rem; border-radius: 6px; }
.ok { color: #1d6b3d; }
.validation-message { color: var(--bad); font-size: 0.85rem; }

/* Section headings on public pages */
.section-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; }
.section-head h2 { font-size: 1.9rem; }
.section-head h3 { font-size: 1.25rem; margin-top: 1.2rem; }
section + section { margin-top: 2.2rem; }

/* Home page */
.home-hero { display: flex; flex-wrap: wrap; gap: 2.5rem; align-items: center; padding: 0.6rem 0 2.5rem; }
.home-hero .copy { flex: 1 1 400px; }
.home-hero .eyebrow { display: inline-block; background: var(--panel); border-radius: 999px; padding: 0.35rem 1rem; font-weight: 700; font-size: 0.85rem; color: var(--accent); margin-bottom: 1rem; }
.home-hero h1 { font-size: clamp(2.4rem, 5.4vw, 4.1rem); line-height: 1.02; margin: 0 0 1rem; }
.home-hero .lead { font-size: 1.2rem; margin: 0 0 1.6rem; }
.home-hero .photo-card { flex: 1 1 380px; max-width: 520px; background: var(--panel); border-radius: 36px; padding: 0.9rem 0.9rem 0.7rem; box-shadow: 0 10px 0 var(--shadow); }
.home-hero .photo-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 26px; }
.home-hero .photo-caption { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.6rem; padding: 0 0.4rem; font-size: 0.85rem; color: var(--muted); }
.band { background: var(--panel); margin: 0 calc(50% - 50vw); padding: 2.6rem calc(50vw - 50%); }
.band + section { margin-top: 2.6rem; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; margin-top: 1rem; }
.tool-card { display: block; text-decoration: none; color: var(--ink); border-radius: var(--radius); padding: 1.4rem; font-weight: 500; transition: transform 0.12s; }
.tool-card:hover { transform: translateY(-3px); color: var(--ink); }
.tool-card svg { display: block; }
.tool-card .tool-name { font-weight: 900; font-size: 1.3rem; margin-top: 0.8rem; }
.tool-card p { margin: 0.2rem 0 0; font-size: 0.92rem; line-height: 1.4; }
.tool-card.mint { background: var(--mint); color: #1f4d3c; }
.tool-card.amber { background: #ffd29b; color: #6b3f08; }
.tool-card.lilac { background: #cfc7ff; color: #3a2f8a; }
.tool-card.coral { background: #ffc2b3; color: #7a2a1a; }
.tool-card.mint .tool-name { color: var(--mint-ink); }
.tool-card.amber .tool-name { color: var(--amber-ink); }
.tool-card.lilac .tool-name { color: #271f66; }
.tool-card.coral .tool-name { color: #521a0f; }
.tool-group-section { margin-top: 1.6rem; }
.tool-group-section h2 { font-size: 1.5rem; }
.tool-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.2rem; align-items: center; }
.tool-links .tag { font-size: 0.9rem; padding: 0.4rem 0.9rem; background: var(--bg); }
.job-card { display: flex; flex-direction: column; gap: 0.3rem; }
.job-card .kind { font-size: 0.75rem; font-weight: 900; letter-spacing: 0.05em; color: var(--accent); }
.job-card .title { font-weight: 900; font-size: 1.2rem; }
.job-card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 0.6rem; }
.job-card .pay { font-weight: 900; font-size: 1.4rem; }
.spotlight { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; padding: 1rem 1.6rem 1rem 1rem; }
.spotlight .spot-photo { flex: none; width: 170px; height: 150px; object-fit: cover; border-radius: 22px; background: var(--tint); }
.spotlight .spot-body { flex: 1 1 320px; }
.spotlight .spot-body h2 { font-size: 1.6rem; margin: 0.6rem 0 0.2rem; }
.spotlight .spot-body p { margin: 0.2rem 0; }
.spotlight .spot-buy { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.spotlight .spot-price { font-weight: 900; font-size: 1.8rem; }
.badge.sponsored { background: var(--amber-soft); color: var(--amber-ink); letter-spacing: 0.06em; font-size: 0.72rem; text-transform: uppercase; }
.hero { background: var(--panel); border: 0; border-radius: var(--radius); padding: 2rem 2rem 2.2rem; margin-bottom: 1.6rem; box-shadow: 0 8px 0 var(--shadow); }
.hero h1 { font-size: 2.2rem; margin: 0 0 0.5rem; }
.hero .lead { max-width: 40rem; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.2rem; }
.step { background: var(--panel); border-radius: var(--radius); padding: 1.3rem 1.4rem; box-shadow: 0 8px 0 var(--shadow); }
.step h3 { margin: 0.5rem 0 0.2rem; }
.step p { margin: 0; color: var(--muted); }
.step-no { display: inline-flex; width: 2rem; height: 2rem; border-radius: 50%; background: var(--coral); color: var(--ink); align-items: center; justify-content: center; font-weight: 900; }
.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1.2rem; }

/* Teacher directory and profiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.4rem; }
.tile { display: flex; flex-direction: column; background: var(--panel); border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none; box-shadow: 0 8px 0 var(--shadow); transition: transform 0.12s; font-weight: 500; }
.tile:hover { transform: translateY(-3px); color: inherit; }
.tile-photo { height: 11rem; background: var(--tint); display: flex; }
.tile-photo .photo { width: 100%; height: 100%; object-fit: cover; }
.photo.initials { display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 900; color: var(--accent); background: var(--tint); }
.tile-body { padding: 1rem 1.2rem 1.2rem; display: flex; flex-direction: column; gap: 0.35rem; }
.tile-body h3 { margin: 0; font-size: 1.25rem; }
.tile-headline { margin: 0; color: var(--muted); font-size: 0.92rem; }
.tile-tags { margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tile-foot { margin: 0.3rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.tile-rate { margin-left: auto; font-weight: 900; font-size: 0.9rem; }
.finder { display: grid; grid-template-columns: 16rem 1fr; gap: 1.4rem; align-items: start; }
@media (max-width: 800px) { .finder { grid-template-columns: 1fr; } }
.filters { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0; }
.filters fieldset, .tag-fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 0.5rem 0 0; display: flex; flex-direction: column; gap: 0.25rem; }
.filters legend, .tag-fieldset legend { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 900; padding-right: 0.4rem; }
.filters label.check, .tag-fieldset label.check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.tag-fieldset { flex-direction: row; flex-wrap: wrap; gap: 0.3rem 1.2rem; margin-bottom: 0.6rem; }
.tag-fieldset legend { width: 100%; }
.filter-search { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; font-weight: 700; }
.filter-search .input { min-width: 0; width: 100%; }
.profile-head { display: flex; gap: 1.6rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.profile-photo { width: 11rem; height: 11rem; border-radius: 50%; overflow: hidden; background: var(--tint); flex: 0 0 auto; display: flex; box-shadow: 0 8px 0 var(--shadow); }
.profile-photo.small { width: 7rem; height: 7rem; margin-bottom: 0.5rem; }
.profile-photo .photo { width: 100%; height: 100%; object-fit: cover; }
.profile-photo .photo.initials { font-size: 3rem; }
.profile-photo.small .photo.initials { font-size: 2rem; }
.intro-video { width: 100%; max-width: 40rem; border-radius: 22px; background: #000; }
.intro-video.small { max-width: 20rem; }
.bio { white-space: pre-line; margin: 0; }
.tag-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0.4rem 0; }
.tag-group-name { min-width: 8rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 900; }
.media-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.4rem; }
.file-button { cursor: pointer; display: inline-block; }
.request-head { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: baseline; margin-bottom: 0.4rem; }
.stars { color: var(--amber); letter-spacing: 0.05em; }
.stars .muted { color: var(--line); }

/* Accounts */
.auth-card { max-width: 26rem; margin: 2rem auto; background: var(--panel); border-radius: var(--radius); padding: 1.6rem 1.8rem; box-shadow: 0 8px 0 var(--shadow); }
.auth-card h1 { margin-top: 0; }
.form-stack { display: flex; flex-direction: column; gap: 0.8rem; }
.form-stack label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; font-weight: 700; }
.form-stack label.check { flex-direction: row; align-items: flex-start; gap: 0.5rem; }
.form-stack .input { min-width: 0; width: 100%; }
.role-choice { border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; display: flex; flex-direction: column; gap: 0.5rem; }
.role-choice legend { font-size: 0.85rem; color: var(--muted); font-weight: 700; padding: 0 0.3rem; }
.demo-hint { border-top: 1px dashed var(--line); padding-top: 0.6rem; }
ul.materials { list-style: none; padding: 0; margin: 0.4rem 0; display: flex; flex-direction: column; gap: 0.35rem; }
.material-link { display: inline-block; margin-right: 0.6rem; }
.welcome { border-left: 6px solid var(--coral); }
.diagram-readonly { overflow: auto; border: 2px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.diagram-readonly * { cursor: default !important; }
.page-tabs { margin: 0.6rem 0; }

/* Stats (dashboards, earnings) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.earn .stats { margin-bottom: 1rem; }
.stat { background: var(--panel); border-radius: var(--radius-sm); padding: 0.9rem 1.2rem; display: flex; flex-direction: column; box-shadow: 0 6px 0 var(--shadow); border-left: 6px solid var(--line); }
.stat.earned { border-left-color: var(--good); }
.stat.upcoming { border-left-color: #9db8d3; }
.stat.total { border-left-color: var(--coral); }
.stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 900; }
.stat-value { font-size: 1.9rem; font-weight: 900; line-height: 1.2; }
.stat-note { font-size: 0.85rem; color: var(--muted); }
.earn .notice { margin: 0 0 1rem; }
.earn .ok { margin: 0.5rem 0 0; }
.earn .panel { margin-bottom: 1rem; }
.earn-columns { display: grid; grid-template-columns: 3fr 2fr; gap: 1.2rem; align-items: start; }
@media (max-width: 900px) { .earn-columns { grid-template-columns: 1fr; } }
.bars { display: flex; align-items: flex-end; gap: 0.4rem; height: 210px; padding-top: 0.5rem; }
.bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-value { font-size: 0.7rem; color: var(--muted); height: 1.1rem; white-space: nowrap; }
.bar-track { flex: 1; width: 100%; max-width: 3.2rem; display: flex; flex-direction: column-reverse; background: var(--tint); border-radius: 8px 8px 0 0; overflow: hidden; }
.bar-earned { background: var(--good); }
.bar-pending { background: #9db8d3; }
.bar-label { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; white-space: nowrap; }
.legend-line { font-size: 0.8rem; color: var(--muted); margin: 0.6rem 0 0; }
.swatch { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 3px; margin: 0 0.25rem 0 0.8rem; vertical-align: -1px; }
.swatch.earned { background: var(--good); margin-left: 0; }
.swatch.upcoming { background: #9db8d3; }

/* Fretboard SVG */
.fretboard { width: 100%; max-width: 1100px; height: auto; display: block; }
.fretboard .string { stroke: #8a80b3; }
.fretboard .fret { stroke: #c9bff0; stroke-width: 2; }
.fretboard .nut { stroke: var(--ink); stroke-width: 6; }
.fretboard .marker { fill: var(--tint); }
.fretboard .fret-number { font-size: 10px; fill: var(--muted); text-anchor: middle; }
.fretboard .string-label { font-size: 11px; fill: var(--muted); text-anchor: end; }
.fretboard .note circle { fill: var(--note); stroke: #fff; stroke-width: 1.5; }
.fretboard .note.root circle { fill: var(--root); }
.fretboard .note text { font-size: 10px; fill: #fff; text-anchor: middle; font-weight: 700; }
.fretboard .note.root text { fill: var(--ink); }

/* Chord diagrams */
.diagrams { display: flex; flex-wrap: wrap; gap: 1rem; }
.diagram-card { width: 150px; text-align: center; }
.diagram-title { display: flex; justify-content: center; gap: 0.5rem; align-items: baseline; margin-bottom: 0.2rem; }
.chord-diagram { width: 120px; height: auto; display: block; margin: 0 auto; }
.chord-diagram .title { font-size: 11px; fill: var(--muted); text-anchor: middle; }
.chord-diagram .grid { stroke: #8a80b3; stroke-width: 1; }
.chord-diagram .nut { fill: var(--ink); }
.chord-diagram .fret-label { font-size: 10px; fill: var(--muted); text-anchor: end; }
.chord-diagram .marker-x { font-size: 10px; fill: var(--muted); text-anchor: middle; }
.chord-diagram .marker-o { fill: none; stroke: var(--note); stroke-width: 1.5; }
.chord-diagram .dot circle { fill: var(--note); }
.chord-diagram .dot.root circle { fill: var(--root); }
.chord-diagram .dot text { font-size: 8px; fill: #fff; text-anchor: middle; font-weight: 700; }
.chord-diagram .dot.root text { fill: var(--ink); }
.tab { display: inline-block; margin-top: 0.3rem; font-size: 0.8rem; }

/* Blazor error bar */
#blazor-error-ui { display: none; background: var(--amber-soft); color: var(--amber-ink); bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,0.2); left: 0; padding: 0.6rem 1.25rem 0.7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* ---- Diagram editor ---- */
.content:has(.editor) { max-width: none; padding: 0; }
.editor { display: flex; flex-direction: column; height: calc(100vh - 4.5rem); }
.editor-toolbar { display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.8rem; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.editor-toolbar .doc-title { min-width: 16rem; font-weight: 900; }
.editor-toolbar .sep { width: 1px; height: 1.4rem; background: var(--line); margin: 0 0.3rem; }
.editor-toolbar .zoom { min-width: 3.2rem; text-align: center; font-size: 0.85rem; color: var(--muted); }
.editor-toolbar .status { margin-left: auto; font-size: 0.8rem; color: var(--muted); }
.editor-toolbar label.check.small { flex-direction: row; align-items: center; gap: 0.3rem; font-size: 0.8rem; }
.editor-toolbar .input, .editor-toolbar .select { padding: 0.3rem 0.6rem; border-radius: 10px; }
.page-strip { display: flex; gap: 0.25rem; padding: 0.3rem 0.8rem; background: var(--tint); border-bottom: 1px solid var(--line); }
.page-tab { font: inherit; font-weight: 700; font-size: 0.8rem; background: transparent; border: 2px solid transparent; border-radius: 10px; padding: 0.25rem 0.6rem; cursor: pointer; color: var(--ink); }
.page-tab.active { background: var(--panel); border-color: var(--line); }
.page-tab.add { color: var(--muted); }
.editor-body { display: flex; flex: 1; min-height: 0; }
.toolbox { width: 92px; flex: 0 0 92px; background: var(--panel); border-right: 1px solid var(--line); padding: 0.5rem; overflow-y: auto; }
.tool-label { font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 900; margin: 0.6rem 0 0.2rem 0.2rem; }
.tool-group { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.tool { width: 36px; height: 34px; font-size: 1.05rem; line-height: 1; background: var(--bg); border: 2px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--ink); }
.tool.wide { width: 76px; font-size: 0.8rem; }
.tool.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tool:hover:not(.active) { border-color: var(--accent); }
.canvas-scroll { flex: 1; overflow: auto; background: #e9e2fb; padding: 1.2rem; outline: none; }
.canvas-scroll:focus { box-shadow: inset 0 0 0 2px rgba(75, 59, 176, 0.3); }
.canvas-zoom { position: relative; margin: 0 auto; }
.diagram-page { display: block; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.18); user-select: none; touch-action: none; }
.diagram-page text { user-select: none; }
.inspector { width: 320px; flex: 0 0 320px; background: var(--panel); border-left: 1px solid var(--line); padding: 0.8rem; overflow-y: auto; font-size: 0.85rem; }
.inspector h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.inspector h4 { margin: 0.8rem 0 0.3rem; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 900; }
.inspector label { display: flex; flex-direction: column; gap: 0.15rem; margin-bottom: 0.4rem; color: var(--muted); font-weight: 700; }
.inspector label.check { flex-direction: row; align-items: center; gap: 0.4rem; }
.inspector .select, .inspector .input { min-width: 0; width: 100%; padding: 0.3rem 0.5rem; border-radius: 10px; }
.inspector .input.narrow { width: 5rem; }
.inspector .row { display: flex; gap: 0.5rem; align-items: flex-end; flex-wrap: wrap; }
.inspector .row label { flex: 1; }
.inspector textarea.input { font: inherit; resize: vertical; }
.inspector input[type="color"] { width: 3rem; height: 1.8rem; padding: 0; border: 2px solid var(--line); border-radius: 8px; background: #fff; }
.inspector .tabs { display: flex; gap: 0.15rem; border-bottom: 1px solid var(--line); margin-bottom: 0.5rem; }
.inspector .tabs.sub { margin-top: 0.2rem; }
.inspector .tab-btn { font: inherit; font-weight: 700; font-size: 0.78rem; background: transparent; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; padding: 0.3rem 0.5rem; cursor: pointer; color: var(--muted); }
.inspector .tab-btn.active { background: var(--bg); border-color: var(--line); color: var(--ink); margin-bottom: -1px; }
.inspector .swatches { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.3rem 0; }
.inspector .swatch { display: inline-block; min-width: 1.8rem; text-align: center; padding: 0.15rem 0.3rem; border-radius: 6px; color: #fff; font-size: 0.7rem; font-weight: 700; }
.inspector .text-style { margin-bottom: 0.4rem; }
.inspector .text-style .row { margin-bottom: 0.3rem; align-items: center; }
.inspector .text-style .select { flex: 1; }
.inspector .toggle { font: inherit; width: 2rem; height: 1.8rem; background: #fff; border: 2px solid var(--line); border-radius: 8px; cursor: pointer; color: var(--ink); }
.inspector .toggle.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.inspector .sep { width: 1px; height: 1.4rem; background: var(--line); margin: 0 0.2rem; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(43, 33, 80, 0.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--panel); border-radius: var(--radius); padding: 1.4rem 1.6rem; width: min(560px, 92vw); max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1rem; margin: 0.8rem 0; }
.form-grid label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.form-grid label.check { flex-direction: row; align-items: center; gap: 0.4rem; grid-column: span 2; }

/* ---- Simon ---- */
.simon { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.simon-setup { width: 320px; flex: 0 0 320px; margin-top: 0; }
.simon-setup label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; font-weight: 700; color: var(--muted); margin-bottom: 0.5rem; }
.simon-setup label.check { flex-direction: row; align-items: center; gap: 0.4rem; }
.simon-setup .select, .simon-setup .input { min-width: 0; width: 100%; }
.simon-setup .input.narrow { width: 5rem; }
.simon-setup h4 { margin: 0.9rem 0 0.2rem; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 900; }
.simon-board { flex: 1; display: flex; justify-content: center; padding: 1rem; }
.scale-wheel { max-width: 100%; height: auto; }
.wheel-segment { transition: none; }
.wheel-segment.lit path { stroke: #FFFFFF; }

/* ---- Pitch input & tuner ---- */
.pitch-input label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; font-weight: 700; color: var(--muted); margin-bottom: 0.5rem; }
.pitch-input .select { min-width: 0; width: 100%; }
.tuner { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.tuner-side { width: 320px; flex: 0 0 320px; margin-top: 0; }
.tuner-side h4 { margin: 0.9rem 0 0.3rem; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 900; }
.tuner-side .select { min-width: 0; width: 100%; }
.tuner-side label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--muted); font-weight: 700; }
.string-refs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
.string-refs .button.active { background: var(--good); color: #fff; }
.tuner-face { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 1rem; min-width: 320px; }
.tuner-note { font-size: 5rem; font-weight: 900; line-height: 1; color: var(--muted); }
.tuner-note.in-tune { color: var(--good); }
.tuner-note.flat, .tuner-note.sharp { color: var(--coral-deep); }
.tuner-octave { color: var(--muted); margin-bottom: 0.5rem; }
.tuner-gauge { width: min(440px, 100%); height: auto; }
.tuner-cents { font-size: 1.2rem; font-weight: 900; min-height: 1.6rem; }
.tuner-cents.in-tune { color: var(--good); }
.level-bar { width: 200px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 0.6rem; }
.level-bar span { display: block; height: 100%; background: var(--good); transition: width 0.08s linear; }

/* ---- Metronome ---- */
.metro { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.metro-main { width: 380px; flex: 0 0 380px; margin-top: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.metro-tempo { display: flex; align-items: center; gap: 0.4rem; justify-content: center; }
.metro-bpm { display: flex; align-items: baseline; gap: 0.3rem; }
.metro-bpm .input { width: 6rem; min-width: 0; font-size: 2rem; font-weight: 900; text-align: center; padding: 0.2rem; }
.metro-slider { width: 100%; accent-color: var(--accent); }
.metro-marking { text-align: center; }
.beat-indicator { display: flex; gap: 0.6rem; justify-content: center; padding: 0.8rem 0; }
.beat-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--line); }
.beat-dot.first { border: 2px solid var(--accent); }
.beat-dot.on { background: var(--accent); transform: scale(1.25); }
.beat-dot.on.accent { background: var(--coral); }
.metro-controls label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.metro-controls label.check { flex-direction: row; align-items: center; gap: 0.4rem; align-self: flex-end; padding-bottom: 0.5rem; }
.metro-controls .select { min-width: 0; }
.metro-practice { flex: 1; min-width: 340px; margin-top: 0; }
.metro-practice label.inline { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); font-weight: 700; }
.metro-practice label.check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--muted); font-weight: 700; margin: 0.5rem 0; }
.practice-table .input { min-width: 0; width: 100%; }
.practice-table .input.narrow { width: 5rem; }
.practice-now { text-align: center; padding: 1rem; border-radius: var(--radius-sm); background: var(--tint); }
.practice-now.rest { background: #e3f6ec; }
.practice-now.paused { background: var(--amber-soft); }
.practice-block { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid rgba(43, 33, 80, 0.12); }
.practice-block-clock { font-size: 1.8rem; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.practice-name { font-size: 1.4rem; font-weight: 900; }
.practice-clock { font-size: 4rem; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.practice-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 0.6rem auto 0.3rem; max-width: 420px; }
.practice-bar span { display: block; height: 100%; background: var(--accent); transition: width 0.2s linear; }
.practice-list { margin: 0.8rem 0 0; padding-left: 1.4rem; }
.practice-list li.current { font-weight: 900; color: var(--accent); }
.practice-list li.done { color: var(--muted); text-decoration: line-through; }

/* ---- Calendar ---- */
.cal-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.8rem; }
.cal-title { font-size: 1.3rem; margin: 0 0 0 0.6rem; }
.cal-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; background: var(--line); border: 2px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.cal-dow { background: var(--tint); padding: 0.3rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 900; text-align: center; }
.cal-cell { background: var(--panel); min-height: 96px; padding: 0.25rem; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.cal-cell.other { background: #faf8ff; color: var(--muted); }
.cal-cell.today .cal-day { background: var(--coral); color: var(--ink); }
.cal-cell:hover { background: #fbf9ff; }
.cal-day { font-size: 0.8rem; font-weight: 700; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.chip { font: inherit; font-weight: 700; font-size: 0.72rem; text-align: left; background: var(--tint); color: var(--accent); border: 0; border-left: 3px solid var(--accent); border-radius: 6px; padding: 0.15rem 0.3rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-time { color: var(--muted); }
.chip.cancelled, .cal-event.cancelled, tr.cancelled td { text-decoration: line-through; opacity: 0.55; }
.chip.completed, .cal-event.completed { background: #e3f6ec; border-left-color: var(--good); color: #1d6b3d; }
.chip.noshow, .cal-event.noshow { background: #fde6e4; border-left-color: var(--bad); color: #7a1f1a; }
.cal-week { border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); overflow: hidden; }
.cal-week-head { display: grid; grid-template-columns: 60px repeat(7, 1fr); border-bottom: 1px solid var(--line); background: var(--tint); }
.cal-week-day { padding: 0.4rem; text-align: center; font-size: 0.85rem; font-weight: 700; }
.cal-week-day.today { color: var(--coral-deep); font-weight: 900; }
.cal-week-body { display: grid; grid-template-columns: 60px repeat(7, 1fr); max-height: 72vh; overflow-y: auto; }
.cal-gutter { border-right: 1px solid var(--line); }
.cal-hour { height: 48px; font-size: 0.7rem; color: var(--muted); text-align: right; padding-right: 0.3rem; transform: translateY(-0.5em); }
.cal-col { position: relative; border-right: 1px solid var(--line); }
.cal-slot { height: 24px; border-bottom: 1px dashed #f0ebff; cursor: pointer; }
.cal-slot:not(.half) { border-bottom-style: solid; border-bottom-color: var(--line); }
.cal-slot:hover { background: #fbf9ff; }
.cal-event { position: absolute; left: 3px; right: 3px; font: inherit; font-weight: 700; font-size: 0.72rem; text-align: left; background: var(--tint); color: var(--accent); border: 0; border-left: 3px solid var(--accent); border-radius: 6px; padding: 0.15rem 0.3rem; cursor: pointer; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.cal-event-notes { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fbf9ff; }
.lesson-dialog h4 { margin: 0.8rem 0 0.3rem; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 900; }
.lesson-dialog label.check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--ink); margin-bottom: 0.2rem; }
.lesson-dialog .weekdays { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.lesson-dialog .weekdays label.check { margin: 0; }
.lesson-dialog .conflict { background: var(--amber-soft); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; margin: 0.5rem 0; font-size: 0.85rem; color: var(--amber-ink); }
.lesson-dialog .conflict ul { margin: 0.3rem 0 0.5rem 1rem; }
.dialog-actions { margin-top: 0.8rem; }
.dialog-actions .spacer { flex: 1; }

/* Tab editor */
.tab-editor { display: flex; flex-direction: column; gap: 0.6rem; }
.tab-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; background: var(--panel); border-radius: var(--radius-sm); padding: 0.55rem 0.8rem; box-shadow: 0 6px 0 var(--shadow); }
.tab-toolbar label { display: flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); font-weight: 700; }
.tab-toolbar .input, .tab-toolbar .select { min-width: 0; padding: 0.3rem 0.6rem; border-radius: 10px; }
.tab-toolbar .input.narrow { width: 4.5rem; }
.tab-toolbar .spacer { flex: 1; }
.group-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 900; margin-left: 0.3rem; }
.button.secondary.small, .tab-toolbar .button.secondary { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.tab-message { color: var(--bad); font-size: 0.85rem; }
.tab-surface { overflow: auto; background: #fff; border: 2px solid var(--line); border-radius: var(--radius-sm); outline: none; max-height: 70vh; }
.tab-surface:focus { border-color: var(--accent); }
.tab-svg { display: block; user-select: none; -webkit-user-select: none; }
.tab-help p { margin: 0.3rem 0; line-height: 1.7; }
textarea.ascii { width: 100%; font-family: Consolas, "Courier New", monospace; font-size: 0.85rem; white-space: pre; }
.tab-gp-pick { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; padding: .7rem 1rem; background: var(--amber-soft); border-radius: var(--radius-sm); color: var(--amber-ink); }
.tab-gp-warnings { margin: .5rem 0; padding: .7rem 1rem; border: 2px solid var(--line); border-radius: var(--radius-sm); }
.tab-gp-warnings ul { margin: .3rem 0 .5rem 1.1rem; padding: 0; }
.tab-join { background: var(--amber-soft); }

/* Printing a tab: only the staff, as large as the page allows. */
@media print {
    @page { margin: 12mm; }
    body { background: #fff; }
    .shell { display: block; min-height: 0; }
    .topbar, .sidebar, .site-footer, #blazor-error-ui, .tab-toolbar, .tab-help, .tab-gp-pick, .tab-gp-warnings, .tab-editor > section, .content > h1, .content > p { display: none !important; }
    .content, .content:has(.editor) { max-width: none; padding: 0; }
    .tab-surface { max-height: none; overflow: visible; border: 0; border-radius: 0; }
    .tab-svg { max-width: 100%; height: auto; }
}

/* Fretboard Trainer */
.fretboard .string.dim { opacity: .25; }
.fretboard .string.target-string { stroke: var(--coral-deep); }
.fretboard .string-label.target-string-label { fill: var(--coral-deep); font-weight: 900; }
.fretboard.picker.interactive .pick-cell { fill: transparent; cursor: pointer; }
.fretboard.picker.interactive .pick-cell:hover { fill: rgba(255, 122, 89, .25); }
.fretboard .pick circle { stroke: #fff; stroke-width: 1.5; }
.fretboard .pick text { font-size: 10px; fill: #fff; text-anchor: middle; font-weight: 900; pointer-events: none; }
.fretboard .pick-target circle { fill: var(--coral); }
.fretboard .pick-target text { fill: var(--ink); }
.fretboard .pick-correct circle { fill: var(--good); }
.fretboard .pick-wrong circle { fill: var(--bad); }
.fretboard .pick-missed circle { fill: rgba(47, 158, 91, .15); stroke: var(--good); stroke-width: 2.5; stroke-dasharray: 3 2; }
.fretboard .pick-missed text { fill: #1d6b3d; }
.fretboard .heat { stroke: #fff; stroke-width: 1; pointer-events: none; }
.fretboard .heat-0 { fill: #c8403a; }
.fretboard .heat-1 { fill: #e08a3c; }
.fretboard .heat-2 { fill: #e3c04a; }
.fretboard .heat-3 { fill: #8cc152; }
.fretboard .heat-4 { fill: #2f9e5b; }
.fret-trainer { display: grid; gap: 1rem; max-width: 1150px; }
.fret-trainer .prompt { font-size: 1.5rem; margin: .25rem 0; font-weight: 700; }
.fret-trainer .prompt b { color: var(--coral-deep); }
.fret-trainer .answers { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.fret-trainer .answers .button { min-width: 3.4rem; }
.fret-trainer .answers .button.right { background: var(--good); color: #fff; }
.fret-trainer .answers .button.wrong { background: var(--bad); color: #fff; }
.fret-trainer .scorebar { display: flex; flex-wrap: wrap; gap: 1.25rem; color: var(--muted); font-size: .95rem; }
.fret-trainer .scorebar b { color: var(--ink); font-size: 1.1rem; }
.fret-trainer .feedback { min-height: 1.6rem; font-weight: 900; }
.fret-trainer .feedback.good { color: var(--good); }
.fret-trainer .feedback.bad { color: var(--bad); }
.fret-trainer .mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem; }
.fret-trainer .mode-card { border: 2px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .9rem; cursor: pointer; display: block; background: #fff; }
.fret-trainer .mode-card.selected { border-color: var(--coral); background: #fff3ee; }
.fret-trainer .mode-card input { margin-right: .4rem; }
.fret-trainer .string-checks { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.fret-trainer .heat-legend { display: flex; gap: .4rem; align-items: center; font-size: .85rem; color: var(--muted); }
.fret-trainer .heat-legend i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.fret-trainer .tabs { display: flex; gap: .5rem; }

/* Circle of fifths */
.circle-fifths { width: 100%; max-width: 560px; height: auto; display: block; margin: 0 auto; }
.circle-fifths .cf-wedge { stroke: #fff; stroke-width: 2; cursor: pointer; transition: fill .12s; }
.circle-fifths .cf-sig { cursor: default; fill: var(--tint); }
.circle-fifths .cf-major { fill: #ffe3d9; }
.circle-fifths .cf-minor { fill: #dcd6f7; }
.circle-fifths .cf-major:hover { fill: #ffc9b8; }
.circle-fifths .cf-minor:hover { fill: #c6bdf2; }
.circle-fifths .cf-major.neighbour { fill: #ffa78c; }
.circle-fifths .cf-minor.neighbour { fill: #a497e6; }
.circle-fifths .cf-major.related { fill: #ffc2ae; }
.circle-fifths .cf-minor.related { fill: #bbb1ee; }
.circle-fifths .cf-major.selected { fill: #ff7a59; }
.circle-fifths .cf-minor.selected { fill: #4b3bb0; }
.circle-fifths .cf-minor.selected ~ text, .circle-fifths .cf-label { pointer-events: none; }
.circle-fifths .cf-label { text-anchor: middle; fill: var(--ink); font-family: Nunito, Segoe UI, Arial, sans-serif; }
.circle-fifths .cf-label-major { font-size: 24px; font-weight: 900; }
.circle-fifths .cf-label-minor { font-size: 18px; font-weight: 700; }
.circle-fifths .cf-label-sig { font-size: 14px; fill: var(--muted); }
.circle-fifths .cf-label-alt { font-size: 14px; fill: var(--muted); }
.circle-fifths .cf-center { fill: #fff; stroke: var(--line); stroke-width: 2; }
.circle-fifths .cf-center-title { text-anchor: middle; font-size: 26px; font-weight: 900; fill: var(--ink); font-family: Nunito, Segoe UI, Arial, sans-serif; }
.circle-fifths .cf-center-sub { text-anchor: middle; font-size: 14px; fill: var(--muted); font-family: Nunito, Segoe UI, Arial, sans-serif; }
.circle-page { display: grid; grid-template-columns: minmax(300px, 560px) minmax(280px, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .circle-page { grid-template-columns: 1fr; } }
.circle-page .chord-table td, .circle-page .chord-table th { padding: .25rem .6rem; text-align: left; }
.circle-page .legend { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.circle-page .legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .3rem; vertical-align: middle; }
.tool-card .tab-digit { font-size: 16px; font-weight: 900; fill: currentColor; font-family: Nunito, sans-serif; }

body { overflow-x: hidden; }

/* Practice journal */
.journal { display: grid; grid-template-columns: minmax(320px, 1.1fr) minmax(280px, 1fr); gap: 1.2rem; align-items: start; }
@media (max-width: 900px) { .journal { grid-template-columns: 1fr; } }
.journal .panel { margin-top: 0; }
.journal > div > .panel + .panel { margin-top: 1.2rem; }
.journal-form label.memo { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; font-weight: 700; color: var(--muted); margin: 0.8rem 0; }
.journal-form textarea.input { min-width: 0; width: 100%; resize: vertical; font-weight: 500; }
.journal-cal .cal-cell { min-height: 64px; }
.journal-cal .cal-cell.selected { outline: 3px solid var(--coral); outline-offset: -3px; }
.journal-cal .chip { cursor: default; white-space: normal; }
.journal-entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.journal-entries li { background: var(--bg); border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; }
.journal-when { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.journal-memo { white-space: pre-line; margin: 0.3rem 0; }
.journal-actions { gap: 0.2rem; }
.journal-actions .link-button { padding: 0.1rem 0.4rem; font-size: 0.85rem; }
.link-button.danger { color: var(--bad); }
.journal-nudge { margin: 0.8rem 0 0; padding: 0.6rem 0.9rem; border-radius: var(--radius-sm); }
.metro-controls .button.small { align-self: flex-end; margin-bottom: 0.15rem; }

/* Every seven-note scale */
.scale-filters { align-items: flex-end; margin: 0.6rem 0 0.4rem; }
.scale-filters label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.scale-filters label.check { flex-direction: row; align-items: center; padding-bottom: 0.6rem; }
.scale-table { background: var(--panel); border-radius: var(--radius-sm); overflow: hidden; }
.scale-table > thead th { background: var(--tint); }
.degrees { display: inline-grid; grid-template-columns: repeat(7, 2.4rem); font-size: 1rem; font-weight: 700; }
.degrees > span { text-align: center; padding: 0.1rem 0; border-radius: 999px; border: 2px solid transparent; line-height: 1.3; }
.degrees > span.alt { color: var(--coral-deep); }
.degrees > span.now { border-color: var(--accent); background: var(--tint); }
.degrees.plain { display: inline; font-weight: inherit; }
.mode-chart .mc-cell.now { background: var(--accent); color: #fff !important; border-radius: 6px; }
.modes-row > td { background: var(--bg); padding: 0.4rem 0.7rem 0.8rem 2rem; }
.modes-table { background: transparent; }
.modes-table tr.rep td { font-weight: 700; }
.pager { margin-top: 1rem; }
.view-toggle { margin: 0.4rem 0 0.6rem; }
.wheel-view { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: flex-start; }
.wheel-view .scale-wheel { flex: none; }
.wheel-title { margin: 0 0 0.3rem; }
.wheel-modes { display: flex; flex-direction: column; gap: 0.35rem; align-items: flex-start; }
.wheel-modes .button { text-align: left; }
.mode-chart { display: grid; grid-template-columns: 2rem 9rem repeat(var(--cols), minmax(1.6rem, 1fr)); gap: 0; background: var(--panel); border: 2px solid var(--ink); border-radius: 10px; overflow-x: auto; font-size: 0.85rem; }
.mode-chart > div { padding: 0.25rem 0.1rem; text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 1.9rem; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; }
.mode-chart .mc-head { background: var(--tint); font-weight: 900; border-bottom: 2px solid var(--ink); }
.mode-chart .mc-corner { background: var(--tint); border-bottom: 2px solid var(--ink); }
.mode-chart .mc-roman { font-weight: 900; color: var(--muted); }
.mode-chart .mc-name { justify-content: flex-start; padding-left: 0.5rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 2px solid var(--ink); }
.mode-chart .mc-cell { color: transparent; }
.mode-chart .mc-cell.in { color: var(--muted); }
.mode-chart .mc-cell.in.on { color: var(--ink); font-weight: 700; }
.mode-chart .mc-cell.first { border-left: 2px solid var(--ink); }
.mode-chart .mc-cell.last { border-right: 2px solid var(--ink); }
.mode-chart .mc-cell.top { border-top: 2px solid var(--ink); }
.mode-chart .mc-cell.bottom { border-bottom: 2px solid var(--ink); }
.mode-chart .mc-cell.root { font-weight: 900; color: var(--coral-deep); }
.mode-chart .mc-cell.in.on.root { color: var(--coral-deep); }
.mode-chart .mc-head.on { color: var(--ink); }

/* Dev tools (development only) */
.nav-link.dev-link { background: var(--amber-soft); color: var(--amber-ink); }
.dev-shortcuts { margin-bottom: 1rem; }
.dev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.2rem; align-items: start; }
.dev-grid .panel { margin-top: 0; }
.dev-grid > div > .panel + .panel { margin-top: 1.2rem; }
.dev-grid .form-stack .input, .dev-grid .form-stack .select { min-width: 0; width: 100%; }
.dev-grid .form-stack .input.narrow { width: 6rem; }
.dev-grid .form-row label { flex: 1; }
.dev-grid .form-row label.check { flex: none; flex-direction: row; align-items: center; padding-bottom: 0.5rem; }

/* YouTube */
.yt-icon { display: inline-block; vertical-align: -2px; }
.badge.yt-badge { background: #fff0f0; color: #7a1a1a; display: inline-flex; align-items: center; gap: 0.3rem; }
.yt-link { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 900; }
.yt-section h2 { display: flex; align-items: center; gap: 0.5rem; }
.yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 0.6rem; }
.yt-card { display: flex; flex-direction: column; gap: 0.3rem; text-decoration: none; color: var(--ink); font-weight: 500; }
.yt-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; background: var(--tint); display: block; transition: transform 0.12s; }
.yt-card:hover img { transform: translateY(-2px); }
.yt-card.playing img { outline: 3px solid var(--coral); }
.yt-title { font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-player { margin: 0.4rem 0 1rem; }
.yt-player iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 18px; background: #000; }
.yt-now { margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: baseline; }
.badge.patreon-badge { background: #ffe4e6; color: #8a1c2b; }
.teacher-links { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.patreon-link { font-weight: 900; color: #c8102e; }
.dev-confirm { gap: 0.4rem; white-space: nowrap; }
.link-icon { display: inline-block; vertical-align: -3px; }
.badge.insta-badge { background: #fbe7f5; color: #7a1a5e; }
.insta-link { font-weight: 900; color: #b0208a; }
.badge.yt-badge, .badge.patreon-badge, .badge.insta-badge { display: inline-flex; align-items: center; gap: 0.3rem; }
.patreon-link, .insta-link, .yt-link { display: inline-flex; align-items: center; gap: 0.4rem; }
.tile-body h3 a { color: var(--ink); text-decoration: none; }
.tile-body h3 a:hover { color: var(--accent); }
.tile-more { margin: 0.4rem 0 0; }
a.badge { text-decoration: none; }
a.badge:hover { filter: brightness(0.95); }
.section-cta { margin: 1.6rem 0 0; }

/* For teachers */
.teach-hero .teach-stats { flex: 1 1 320px; display: grid; gap: 0.8rem; }
.teach-note { margin: -1rem 0 1.5rem; }
.teach-feature { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.3fr); gap: 2rem; align-items: center; margin-top: 2.5rem; }
.teach-feature.flip { grid-template-columns: minmax(300px, 1.3fr) minmax(260px, 1fr); }
.teach-feature.flip .teach-text { order: 2; }
@media (max-width: 800px) { .teach-feature, .teach-feature.flip { grid-template-columns: 1fr; } .teach-feature.flip .teach-text { order: 0; } }
.teach-text h2 { font-size: 1.8rem; }
.teach-sample { margin-top: 0; }
.teach-sample .sample-tile { max-width: 22rem; box-shadow: none; border: 2px solid var(--line); }
.teach-sample .sample-cal .cal-cell { min-height: 58px; }
.teach-sample .sample-bars { height: 160px; }
.teach-sample .cards { margin-top: 0; }
.teach-sample .card { box-shadow: none; border: 2px solid var(--line); }
.teach-cta { text-align: center; margin-top: 3rem; padding: 2.4rem; }
.teach-cta h2 { font-size: 2rem; }
.teach-link { font-weight: 900; }

/* Challenge cards */
.challenge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; margin-top: 1rem; }
.challenge { border-radius: var(--radius); padding: 1.4rem; background: var(--panel); box-shadow: 0 8px 0 var(--shadow); display: flex; flex-direction: column; gap: 0.4rem; }
.challenge h3 { font-size: 1.35rem; line-height: 1.2; margin: 0; }
.challenge p { margin: 0 0 0.6rem; color: var(--muted); flex: 1; }
.challenge-kicker { font-size: 0.75rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.challenge.mint .challenge-kicker { color: #1f7a52; }
.challenge.amber .challenge-kicker { color: #b4650e; }
.challenge.lilac .challenge-kicker { color: var(--accent); }
.challenge.coral .challenge-kicker { color: var(--coral-deep); }
.challenge.mint { border-top: 6px solid var(--mint); }
.challenge.amber { border-top: 6px solid var(--amber); }
.challenge.lilac { border-top: 6px solid #cfc7ff; }
.challenge.coral { border-top: 6px solid var(--coral); }

/* Metrics (development only) */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.2rem; align-items: start; }
.metrics-grid .panel { margin-top: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.prose h2 { margin-top: 1.2rem; }
a.account-name { text-decoration: none; color: var(--ink); }

/* ---- Feedback box at the foot of every tool, and share buttons ---- */
.tool-feedback { margin-top: 2.5rem; padding: 1.2rem 1.4rem; border-radius: var(--radius); background: var(--panel); box-shadow: 0 8px 0 var(--shadow); }
.tf-head { display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; }
.tf-head h3 { margin: 0; font-size: 1.1rem; }
.tf-row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.7rem; }
.tf-stars { display: inline-flex; gap: 0.1rem; }
.tf-star { background: none; border: 0; padding: 0 0.1rem; font-size: 1.7rem; line-height: 1; color: var(--line); cursor: pointer; }
.tf-star.on { color: var(--amber); }
.tf-star:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
.tf-text { flex: 1 1 16rem; min-width: 12rem; }
.tf-thanks { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.share-btn.ghost { background: transparent; box-shadow: none; border: 1px solid var(--line); }
.challenge.today { outline: 3px solid var(--coral); outline-offset: 2px; }
.challenge-today { align-self: flex-start; background: var(--coral); color: #fff; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.15rem 0.6rem; border-radius: 999px; }
.streak { display: inline-flex; align-items: center; gap: 0.3rem; background: var(--amber); color: var(--ink); font-weight: 800; padding: 0.2rem 0.75rem; border-radius: 999px; font-size: 0.9rem; }
.metrics-grid .panel.wide { grid-column: 1 / -1; }
.feedback-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.feedback-list li { padding: 0.6rem 0.8rem; border-radius: 10px; background: var(--bg); }
