/* =====================================================================
   «Санбёрст» — визуальная система Музшколы.
   Акцент — градиент санбёрст, как лак на корпусе гитары (янтарь → вишня → тёмный край).
   Светлый нейтральный фон, белые панели с мягкой тёплой тенью, крупные скругления.
   Подробности и правила — docs/DESIGN.md.
   ===================================================================== */

@font-face {
  font-family: "Unbounded"; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url("../vendor/fonts/unbounded-cyrillic-wght-normal.3a5ed4d11365.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded"; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url("../vendor/fonts/unbounded-latin-wght-normal.8616dc355070.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("../vendor/fonts/onest-cyrillic-wght-normal.fe2bd26ae82a.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("../vendor/fonts/onest-latin-wght-normal.3db826ed1c5d.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --chassis: #f4f4f2;          /* фон страницы */
  --panel: #ffffff;
  --ink: #241417;              /* текст: тёмный край санбёрста */
  --ink-soft: #4d3a3d;
  --muted: #74666a;
  --line: #e6e1df;
  --brass: #f2b233;            /* янтарь: фокус, подчёркивания, выделение */
  --brass-deep: #b7791f;
  --cherry: #b3122a;           /* вишня: главные действия */
  --signal: #d4182f;           /* внимание: непрочитанное, долг, просрочка */
  --diode: #2f9e62;
  --cable: #3b6fd8;
  --faceplate: rgba(255,255,255,.82);
  --faceplate-text: #241417;
  --burst: linear-gradient(135deg, #f2b233 0%, #e8742a 32%, #c8102e 68%, #3a0f12 100%);
  --burst-btn: linear-gradient(135deg, #cf4a1f 0%, #b3122a 55%, #7d0f22 100%);
  --burst-radial: radial-gradient(ellipse at 38% 40%, #f7cf55 0%, #f2a33a 22%, #df5a24 42%, #b3122a 62%, #5a0f18 82%, #2a0b0e 100%);
  --shadow: 0 1px 2px rgba(58, 15, 18, .05), 0 10px 28px -14px rgba(58, 15, 18, .22);
  --panel-glass: rgba(255, 255, 255, .8);
  --glow-center: 48%; --glow-mid: 22%; --glow-edge: 34%;
  --g1: #f7cf55; --g2: #df5a24; --g3: #8a1020;   /* цвета фона-санбёрста: центр, кольцо, край */
  --btn-text: #fff;
  --btn-glow: rgba(179, 18, 42, .7);
  --link-line: rgba(200, 16, 46, .35);
  --focus-ring: rgba(242, 178, 51, .35);
  --bar: linear-gradient(180deg, #e8742a, #b3122a);
  --deck: radial-gradient(ellipse at 50% 50%, #f7cf55 0%, #f2a33a 30%, #df5a24 52%, #b3122a 70%, #4a0d14 88%, #22090c 100%);
  --binding: #efe7d6;

  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --text: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-panel: 16px;
  --r-field: 10px;
  --r-control: 999px;
  --gap: 1.1rem;
  color-scheme: light;
}
/* Тёмная тема: по настройке системы, если пользователь не выбрал светлую явно; или по явному выбору. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --chassis: #120b0c; --panel: #1f1517; --ink: #f3ece8; --ink-soft: #d8cbc6; --muted: #a8979a; --line: #3a2a2d;
    --signal: #ff5a6a; --diode: #4cc584; --cable: #86a6f0;
    --faceplate: rgba(24,16,17,.78); --faceplate-text: #f3ece8; --panel-glass: rgba(31,21,23,.7);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -16px rgba(0,0,0,.6);
    --glow-center: 30%; --glow-mid: 30%; --glow-edge: 70%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --chassis: #120b0c; --panel: #1f1517; --ink: #f3ece8; --ink-soft: #d8cbc6; --muted: #a8979a; --line: #3a2a2d;
    --signal: #ff5a6a; --diode: #4cc584; --cable: #86a6f0;
    --faceplate: rgba(24,16,17,.78); --faceplate-text: #f3ece8; --panel-glass: rgba(31,21,23,.7);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -16px rgba(0,0,0,.6);
    --glow-center: 30%; --glow-mid: 30%; --glow-edge: 70%;
    color-scheme: dark;
}

/* ---------- Отделки (как лак на гитаре): только акценты и фон-санбёрст; основу задаёт тема ---------- */
[data-finish="sunburst"] {
  --g1: #f7cf55; --g2: #df5a24; --g3: #8a1020;
  --burst: linear-gradient(135deg, #f2b233 0%, #e8742a 32%, #c8102e 68%, #3a0f12 100%);
  --burst-btn: linear-gradient(135deg, #cf4a1f 0%, #b3122a 55%, #7d0f22 100%);
  --burst-radial: radial-gradient(ellipse at 38% 40%, #f7cf55 0%, #f2a33a 22%, #df5a24 42%, #b3122a 62%, #5a0f18 82%, #2a0b0e 100%);
  --deck: radial-gradient(ellipse at 50% 50%, #f7cf55 0%, #f2a33a 30%, #df5a24 52%, #b3122a 70%, #4a0d14 88%, #22090c 100%);
  --brass: #f2b233; --btn-glow: rgba(179, 18, 42, .7); --link-line: rgba(200, 16, 46, .35);
  --focus-ring: rgba(242, 178, 51, .35); --bar: linear-gradient(180deg, #e8742a, #b3122a); --binding: #efe7d6; --btn-text: #fff;
}
[data-finish="honey"] {
  --g1: #fbe3a0; --g2: #e0952f; --g3: #6b3a12;
  --binding: #efe7d6; --btn-text: #fff;
  --burst: linear-gradient(135deg, #f6d27a 0%, #e9a93b 35%, #c97a1e 70%, #6b3a12 100%);
  --burst-btn: linear-gradient(135deg, #a8641a 0%, #7a4510 55%, #4d2a0b 100%);
  --burst-radial: radial-gradient(ellipse at 38% 40%, #fbe3a0 0%, #f2c25e 25%, #e0952f 48%, #b8691c 68%, #6b3a12 86%, #3a1f0a 100%);
  --deck: radial-gradient(ellipse at 50% 50%, #fbe3a0 0%, #f2c25e 32%, #e0952f 55%, #b8691c 72%, #6b3a12 89%, #3a1f0a 100%);
  --brass: #e9a93b; --btn-glow: rgba(122, 69, 16, .6); --link-line: rgba(168, 100, 26, .45);
  --focus-ring: rgba(233, 169, 59, .4); --bar: linear-gradient(180deg, #e9a93b, #8a4f14);
}
[data-finish="tobacco"] {
  --g1: #edc47c; --g2: #a8642a; --g3: #2a170c;
  --binding: #efe7d6; --btn-text: #fff;
  --burst: linear-gradient(135deg, #e3b56b 0%, #b5722f 35%, #5c3418 70%, #22140b 100%);
  --burst-btn: linear-gradient(135deg, #8a5226 0%, #5c3418 55%, #2e1a0c 100%);
  --burst-radial: radial-gradient(ellipse at 38% 40%, #edc47c 0%, #d29a4c 22%, #a8642a 45%, #5c3418 68%, #2a170c 86%, #140b06 100%);
  --deck: radial-gradient(ellipse at 50% 50%, #edc47c 0%, #d29a4c 28%, #a8642a 50%, #5c3418 70%, #2a170c 88%, #140b06 100%);
  --brass: #d9a35a; --btn-glow: rgba(92, 52, 24, .6); --link-line: rgba(138, 82, 38, .45);
  --focus-ring: rgba(217, 163, 90, .4); --bar: linear-gradient(180deg, #d29a4c, #5c3418);
}
[data-finish="goldtop"] {
  --g1: #fff0b0; --g2: #d4b04a; --g3: #6b5214;
  --btn-text: #fff;
  --burst: linear-gradient(135deg, #f6e7a4 0%, #dcbc5a 35%, #b08d2e 70%, #4a3418 100%);
  --burst-btn: linear-gradient(135deg, #6b4a2a 0%, #4a3018 55%, #2e1c0e 100%); /* тёмный орех, как задняя дека */
  --burst-radial: radial-gradient(circle at 35% 30%, #fff4c4 0%, #ecd27a 22%, #d4b04a 45%, #b08d2e 68%, #8a6a1e 85%, #5a4312 100%);
  --deck: radial-gradient(ellipse at 40% 35%, #fff4c4 0%, #ecd27a 25%, #d4b04a 50%, #b99634 72%, #9c7a24 100%);
  --brass: #d4b04a; --btn-glow: rgba(74, 48, 24, .55); --link-line: rgba(176, 141, 46, .55);
  --focus-ring: rgba(212, 176, 74, .45); --bar: linear-gradient(180deg, #e0c25a, #a8862a); --binding: #f3ead2;
}
[data-finish="cherry"] {
  --g1: #e86a5c; --g2: #a8191d; --g3: #3a070a;
  --btn-text: #fff;
  --burst: linear-gradient(135deg, #e0574b 0%, #b81f22 40%, #7a0f14 75%, #2a0608 100%);
  --burst-btn: linear-gradient(135deg, #b8221f 0%, #8a1416 55%, #5a0b0e 100%);
  --burst-radial: radial-gradient(ellipse at 38% 40%, #e86a5c 0%, #cc3329 25%, #a8191d 50%, #82101a 72%, #5a0b0e 88%, #3a070a 100%);
  --deck: radial-gradient(ellipse at 45% 45%, #e86a5c 0%, #cc3329 30%, #a8191d 55%, #82101a 76%, #5a0b0e 92%, #3a070a 100%);
  --brass: #f2b233; --btn-glow: rgba(138, 20, 22, .6); --link-line: rgba(168, 25, 29, .4);
  --focus-ring: rgba(204, 51, 41, .3); --bar: linear-gradient(180deg, #e0574b, #8a1416); --binding: #1c1617; /* чёрная накладка */
}
[data-finish="lazure"] {
  --g1: #d6f0fa; --g2: #6aaccb; --g3: #163a4d;
  --binding: #efe7d6; --btn-text: #fff;
  --burst: linear-gradient(135deg, #b8e0ef 0%, #6aaccb 35%, #2f6f8f 70%, #173a4d 100%);
  --burst-btn: linear-gradient(135deg, #2f7aa0 0%, #235f80 55%, #173f57 100%);
  --burst-radial: radial-gradient(circle at 35% 30%, #e6f5fb 0%, #a9d6e8 22%, #6aaccb 45%, #3f86a8 66%, #2a6280 84%, #163a4d 100%);
  --deck: radial-gradient(ellipse at 40% 35%, #e6f5fb 0%, #a9d6e8 25%, #6aaccb 48%, #4a91b2 70%, #2f6f8f 100%);
  --brass: #5fa6c7; --btn-glow: rgba(35, 95, 128, .55); --link-line: rgba(47, 122, 160, .45);
  --focus-ring: rgba(95, 166, 199, .4); --bar: linear-gradient(180deg, #6aaccb, #235f80);
}
[data-finish="ebony"] { /* чёрный лак и золотая фурнитура; в светлой теме — белый корпус и золото */
  --g1: #d4af37; --g2: #4a4541; --g3: #080707;
  --burst: linear-gradient(135deg, #f6e19a 0%, #d4af37 40%, #9c7a1c 75%, #3a2c0c 100%);
  --burst-btn: linear-gradient(135deg, #ecd27a 0%, #d4af37 55%, #b08d2e 100%);
  --btn-text: #1a1408;
  --burst-radial: radial-gradient(circle at 35% 30%, #5a5450 0%, #2e2a27 30%, #161312 65%, #0a0908 100%);
  --deck: radial-gradient(ellipse at 38% 32%, #4a4541 0%, #24201e 30%, #121010 65%, #080707 100%);
  --brass: #d4af37; --btn-glow: rgba(212, 175, 55, .35); --link-line: rgba(212, 175, 55, .55);
  --focus-ring: rgba(212, 175, 55, .4); --bar: linear-gradient(180deg, #ecd27a, #9c7a1c); --binding: #d4af37;
}

/* Выбор отделки: кружки-образцы */
.finish-picker { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; margin: 0; }
.finish-picker button { display: inline-flex; flex-direction: column; align-items: center; gap: .3rem; background: none; border: 0; padding: .2rem; cursor: pointer; color: var(--ink-soft); font: 500 .8rem var(--text); }
/* Кольцо задаётся на кнопке: внутри .swatch[data-finish] переменные уже «чужие» (той отделки, что в образце) */
.finish-picker button { --ring: transparent; }
.finish-picker button[aria-pressed="true"] { color: var(--ink); font-weight: 700; --ring: var(--ink); }
.swatch { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--burst-radial); box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 0 0 4.5px var(--ring), 0 3px 8px rgba(0,0,0,.25); }
.site-footer { max-width: 1120px; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2rem) 2.5rem; border-top: 1px solid var(--line); display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; justify-content: space-between; color: var(--muted); font-size: .875rem; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--chassis); color: var(--ink); min-height: 100vh;
  font: 400 1rem/1.55 var(--text); font-feature-settings: "kern", "liga";
}
img { max-width: 100%; }

/* Фон всех страниц — намёк на санбёрст: светлый центр, тёплое кольцо, тёмный край деки.
   Отдельный фиксированный слой: не перерисовывается при прокрутке и не «прыгает» на телефонах. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(ellipse 65% 55% at 50% 28%, color-mix(in srgb, var(--g1) var(--glow-center), transparent), transparent 72%),
    radial-gradient(ellipse 120% 95% at 50% 30%, transparent 42%, color-mix(in srgb, var(--g2) var(--glow-mid), transparent) 70%, color-mix(in srgb, var(--g3) var(--glow-edge), transparent) 100%);
}

/* ---------- Типографика: Unbounded — только заголовки и крупные цифры ---------- */
h1, h2, .display { font-family: var(--display); color: var(--ink); }
h1 { text-wrap: balance; font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2.1rem); font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; margin: .3em 0 .5em; }
h2 { font-size: 1.02rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; margin: 0 0 .75em; }
h3 { font: 600 1rem/1.4 var(--text); margin: 1.1em 0 .4em; }
p { margin: 0 0 .8em; max-width: 72ch; }
.prose p { max-width: 68ch; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
code { font-size: .9em; background: var(--chassis); padding: .05em .4em; border-radius: 6px; }

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--link-line); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; border-radius: 2px; }

/* ---------- Шапка: светлая, «стеклянная», полоса санбёрста сверху ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
  padding: .75rem clamp(1rem, 3vw, 2rem);
  color: var(--faceplate-text); background: var(--faceplate);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--burst); }
.topbar a { color: var(--faceplate-text); text-decoration: none; }
.topbar a.btn { color: var(--btn-text); } /* .topbar a специфичнее .btn — возвращаем белый текст кнопке */
.logo { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; }
.logo-mark { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--burst-radial); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-burger { display: none; margin-left: auto; cursor: pointer; padding: .35rem .9rem; border: 1px solid var(--line); border-radius: var(--r-control); font-size: .9rem; font-weight: 600; background: var(--panel); }
.mainnav { display: flex; align-items: center; gap: .2rem .15rem; flex-wrap: wrap; flex: 1; }
.mainnav .spacer { flex: 1; }
.mainnav a, .mainnav button.link { color: var(--ink-soft); font-size: .9rem; font-weight: 500; padding: .36rem .58rem; border-radius: var(--r-control); text-decoration: none; }
.mainnav a:hover { background: rgba(127,127,127,.09); color: var(--ink); }
.mainnav a[aria-current="page"] { background: var(--ink); color: var(--panel); }
.mainnav form { margin: 0; }
.mainnav button.link { color: var(--muted); }

/* Колокольчик-индикатор: точка горит вишнёвым, когда есть непрочитанное */
.jewel { display: inline-flex; align-items: center; gap: .45rem; }
.jewel::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--line); }
.jewel.on::before { background: var(--signal); box-shadow: 0 0 0 4px rgba(212,24,47,.16); }
.jewel .count { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .75rem; background: var(--signal); color: #fff; border-radius: 99px; padding: 0 .45em; }

@media (max-width: 1240px) {
  .nav-burger { display: inline-block; }
  .mainnav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: .1rem; padding: .5rem 0 .2rem; }
  .nav-toggle:checked ~ .mainnav { display: flex; }
  .nav-toggle:focus-visible + .nav-burger { outline: 3px solid var(--brass); outline-offset: 2px; }
  .mainnav .spacer { display: none; }
  .mainnav a, .mainnav button.link { padding: .55rem .8rem; font-size: 1rem; }
}

/* ---------- Раскладка ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 1.4rem clamp(1rem, 3vw, 2rem) 3.5rem; }
.narrow { max-width: 600px; margin-left: auto; margin-right: auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.grid2 > .card { margin-bottom: 0; }

/* Панель: белая, скругление 16px, мягкая тёплая тень */
.card { background: var(--panel-glass); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 1.3rem 1.45rem; margin-bottom: var(--gap); box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem 1rem; flex-wrap: wrap; }
.card-head h1, .card-head h2 { margin-bottom: .6em; }
.card > h2:first-child, .card-head:first-child h2 { margin-top: 0; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: .6rem 0; border-top: 1px solid var(--line); display: flex; gap: .35rem .7rem; align-items: baseline; flex-wrap: wrap; }
.list li:first-child { border-top: 0; padding-top: .1rem; }
.list li.unread a { font-weight: 650; }

/* ---------- Кнопки: «таблетки», главная — вишнёвая часть санбёрста ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4em; justify-content: center;
  font: 600 .95rem/1.2 var(--text); color: var(--btn-text); background: var(--burst-btn);
  border: 0; border-radius: var(--r-control); padding: .7rem 1.25rem;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 6px 16px -8px var(--btn-glow);
  transition: transform .08s, box-shadow .15s, filter .15s;
}
.btn:hover { filter: brightness(1.08); box-shadow: 0 8px 20px -8px var(--btn-glow); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(58,15,18,.05); }
.btn.secondary:hover { box-shadow: inset 0 0 0 1px var(--ink-soft); filter: none; }
.btn.small { padding: .42rem .85rem; font-size: .875rem; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.active { background: var(--ink); color: var(--panel); box-shadow: none; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-decoration-color: var(--link-line); text-underline-offset: 3px; cursor: pointer; }
.danger, button.link.danger, a.danger { color: var(--signal) !important; text-decoration-color: currentColor; }
form.inline { display: inline; }

/* ---------- Формы ---------- */
.field { margin-bottom: 1rem; }
.field > label { display: block; font-weight: 600; margin-bottom: .3rem; }
.field.checkbox label { font-weight: 400; display: flex; gap: .5rem; align-items: baseline; }
input, select, textarea { font: inherit; color: inherit; }
.field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea,
input.copy, .side select, #chatInput, .filters input, .filters select, .marker-form input, textarea.full, .chat-form textarea, #comments textarea {
  width: 100%; padding: .55rem .7rem; background: var(--panel); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--r-field);
}
.field input:focus, .field select:focus, .field textarea:focus, .filters input:focus, .marker-form input:focus, textarea:focus { border-color: var(--ink-soft); outline: none; box-shadow: 0 0 0 4px var(--focus-ring); }
.field ul, .field div > div { list-style: none; padding: 0; margin: 0; }
.field ul li, .field div > div > div { padding: .12rem 0; }
.field ul label, .field div > div label { font-weight: 400; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--brass-deep); width: 1.05em; height: 1.05em; }
.help { display: block; color: var(--muted); margin-top: .25rem; }
small.error { display: block; color: var(--signal); margin-top: .25rem; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--signal) !important; }
input.copy { max-width: 460px; font-size: .875rem; }

/* ---------- Сообщения: цветная полоса слева = смысл ---------- */
.messages { margin-bottom: 1rem; }
.msg { padding: .75rem 1rem; border-radius: var(--r-field); margin-bottom: .55rem; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--ink-soft); }
.msg.success { border-left-color: var(--diode); }
.msg.error { border-left-color: var(--signal); }
.msg.warning { border-left-color: var(--brass); }
.msg.info { border-left-color: var(--cable); }

/* ---------- Бейджи: цвет точки = смысл ---------- */
.badge {
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: .38em; white-space: nowrap;
  font-size: .8rem; line-height: 1.5; padding: .05rem .55rem .05rem .45rem;
  border-radius: 99px; background: var(--chassis); color: var(--ink-soft);
}
.badge::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: var(--muted); }
.badge.submitted::before, .badge.uploading::before, .badge.scheduled::before { background: var(--cable); }
.badge.accepted::before, .badge.done::before, .badge.ready::before { background: var(--diode); }
.badge.needs_work::before { background: var(--brass-deep); }
.badge.overdue, .badge.failed { color: var(--signal); }
.badge.overdue::before, .badge.failed::before, .badge.cancelled::before { background: var(--signal); }
.unread { display: inline-block; min-width: 1.3em; text-align: center; background: var(--signal); color: #fff; border-radius: 99px; font-size: .75rem; font-weight: 700; padding: 0 .35em; }

/* ---------- Главная: гриф ---------- */
.hero { position: relative; padding: clamp(1.5rem, 4vw, 3.5rem) 0 1rem; }
/* «Корпус гитары» в санбёрсте за заголовком */
.hero-burst { position: absolute; z-index: -1; right: -22%; top: -5rem; width: min(56vw, 620px); aspect-ratio: 1.08; border-radius: 50%;
  /* санбёрст как на деке: янтарный центр, вишнёвое кольцо, почти чёрный обод; тонкая кремовая окантовка */
  background: var(--deck);
  box-shadow: 0 0 0 6px var(--binding), 0 30px 60px -30px rgba(58,15,18,.6); transform: rotate(-12deg); }
@media (max-width: 760px) { .hero-burst { width: 46vw; right: -20%; top: -3.2rem; } }
.hero h1 { font-size: clamp(1.9rem, 1.2rem + 3.2vw, 3.6rem); font-weight: 700; line-height: 1.04; letter-spacing: -0.025em; max-width: 17ch; margin: 0 0 .5em; text-wrap: balance; }
.lead { font-size: clamp(1.05rem, 1rem + .3vw, 1.25rem); color: var(--ink-soft); max-width: 46ch; margin-bottom: 1.4rem; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-bottom: 2.2rem; }

.fretboard {
  --frets: 12;
  position: relative; height: clamp(190px, 26vw, 260px); border-radius: var(--r-panel); box-shadow: 0 24px 48px -24px rgba(58,15,18,.55);
  background:
    linear-gradient(180deg, rgba(0,0,0,.35), transparent 12%, transparent 88%, rgba(0,0,0,.35)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 2px, transparent 2px 7px),
    #3a271d; /* палисандр */
  border-top: 6px solid #efe7d6; border-bottom: 6px solid #efe7d6; /* окантовка грифа */
  overflow: hidden; touch-action: none; user-select: none; cursor: crosshair;
}
.fretboard .nut { position: absolute; left: 0; top: 0; bottom: 0; width: 14px; background: #efe8d6; box-shadow: 2px 0 4px rgba(0,0,0,.4); z-index: 2; }
.fretboard .fret { position: absolute; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: linear-gradient(90deg, #8c9198, #e8ebef 45%, #9aa0a8); }
.fretboard .inlay { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fffaf0, #d9d2c3 60%, #b9b2a3); opacity: .9; }
.fretboard .string {
  position: absolute; left: 0; right: 0; height: 22px; margin-top: -11px; padding: 0; border: 0; background: transparent; cursor: inherit; z-index: 3;
}
.fretboard .string::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: var(--gauge, 2px); transform: translateY(-50%);
  background: linear-gradient(180deg, #f6f7f9, #a7adb6 60%, #6f7680);
  box-shadow: 0 2px 2px rgba(0,0,0,.45);
}
.fretboard .string.wound::after { background: repeating-linear-gradient(90deg, #d9c9a3 0 1px, #9b8a63 1px 2px); }
.fretboard .string:focus-visible { outline: 2px solid var(--brass); outline-offset: 0; }
.fretboard .string.ringing::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at var(--x, 50%) 50%, rgba(242,178,51,.45), transparent 40%); pointer-events: none; }
.fretboard .string.ringing::after { animation: ring .5s ease-out; }
@keyframes ring {
  0% { transform: translateY(-50%) scaleY(3.5); filter: blur(.6px); }
  100% { transform: translateY(-50%) scaleY(1); filter: none; }
}
.fretboard-hint { color: var(--muted); font-size: .9rem; margin: .7rem 0 0; }

.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.2rem 3rem; padding: 3rem 0 1rem; max-width: 920px; }
@media (max-width: 640px) { .features { grid-template-columns: 1fr; } }
.features > div { padding-left: 1.1rem; border-left: 3px solid; border-image: var(--burst) 1; }
.features h3 { font: 600 1.05rem/1.3 var(--display); margin: 0 0 .4rem; }
.features p { color: var(--ink-soft); margin: 0; }

/* ---------- Календарь ---------- */
.cal-nav { display: flex; gap: .35rem; flex-wrap: wrap; }
.cal-wrap { overflow-x: auto; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--panel-glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow); }
table.cal { width: 100%; min-width: 640px; border-collapse: collapse; table-layout: fixed; }
.cal th { padding: .5rem; color: var(--muted); font-weight: 600; font-size: .85rem; text-align: left; border-bottom: 1px solid var(--line); }
.cal td { vertical-align: top; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); height: 96px; padding: .3rem; }
.cal td:last-child { border-right: 0; }
.cal tr:last-child td { border-bottom: 0; }
.cal.week td { height: 270px; }
.cal td.other { background: var(--chassis); color: var(--muted); }
.cal-day { font-size: .85rem; margin-bottom: .25rem; font-variant-numeric: tabular-nums; }
.cal td.today .cal-day { background: var(--burst-btn); color: var(--btn-text); border-radius: 99px; display: inline-block; padding: 0 .5em; font-weight: 700; }
.cal-lesson { display: block; font-size: .8rem; text-decoration: none; color: var(--ink); border-left: 3px solid var(--cable); background: var(--chassis); padding: .15rem .4rem; margin-bottom: .2rem; border-radius: 0 6px 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal.week .cal-lesson { white-space: normal; }
.cal-lesson.cancelled { text-decoration: line-through; opacity: .6; border-color: var(--signal); }
.cal-lesson.done { border-color: var(--diode); }

/* ---------- Дневник практики ---------- */
.practice-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.stat { background: var(--chassis); border-radius: 12px; padding: .55rem .75rem; }
main > .practice-stats .stat { background: var(--panel); border: 1px solid var(--line); }
.stat b { display: block; font: 600 1.45rem/1.2 var(--display); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .85rem; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; margin-bottom: 1.3rem; position: relative; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.bar-col.weekend::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; background: var(--line); }
.bar { background: var(--bar); border-radius: 4px 4px 0 0; }
.bar-label { position: absolute; bottom: -1.3rem; left: 0; font-size: .7rem; color: var(--muted); white-space: nowrap; }

/* ---------- Инструменты ---------- */
.metro-display { font: 700 3.4rem/1 var(--display); text-align: center; font-variant-numeric: tabular-nums; margin: .4rem 0 .6rem; }
.metro-display small { font: 500 .95rem var(--text); color: var(--muted); }
input[type=range] { width: 100%; accent-color: var(--brass-deep); }
.metro-beats { display: flex; gap: .6rem; justify-content: center; margin: .9rem 0; }
.metro-beats span { width: 20px; height: 20px; border-radius: 50%; background: var(--line); }
.metro-beats span.on { background: var(--burst-btn); box-shadow: 0 0 0 5px var(--focus-ring); }
.metro-beats span.accent.on { background: var(--burst-radial); box-shadow: 0 0 0 5px var(--focus-ring); }
.tuner-note { font: 700 3.2rem/1 var(--display); text-align: center; margin: .4rem 0; }
.tuner-note small { font: 400 1rem var(--text); color: var(--muted); }
.tuner-meter { position: relative; height: 36px; margin: .6rem 0; }
.tuner-scale { position: absolute; inset: 15px 0; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--signal), var(--brass) 38%, var(--diode) 47%, var(--diode) 53%, var(--brass) 62%, var(--signal)); }
.tuner-needle { position: absolute; top: 0; left: 50%; width: 6px; height: 36px; margin-left: -3px; background: var(--ink); border-radius: 99px; transition: left .08s; }
.tuner-needle.ok { background: var(--diode); }
.tuner-cents { text-align: center; min-height: 1.5em; }
.inline-num { width: 5em; padding: .3rem .5rem; border: 1.5px solid var(--line); border-radius: var(--r-field); background: var(--panel); }
.controls { display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; margin: .5rem 0; }
.controls label { font-size: .9rem; }
.controls select { padding: .32rem .5rem; border: 1.5px solid var(--line); border-radius: var(--r-field); background: var(--panel); }
.player-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
#media { width: 100%; max-height: 60vh; background: #000; border-radius: 12px; }
.player-row { margin: .7rem 0; }
.marker-form { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.marker-form input { width: auto; padding: .38rem .55rem; }
.marker-form input[name=label], .marker-form input[name=text] { flex: 1; min-width: 160px; }
.tabs-viewport { background: #fff; color: #000; border-radius: var(--r-panel); border: 1px solid var(--line); max-height: 75vh; overflow: auto; position: relative; }
.at-cursor-bar { background: rgba(242, 178, 51, .22); }
.at-selection div { background: rgba(49, 86, 196, .12); }
.at-cursor-beat { background: rgba(226, 58, 45, .8); width: 3px; }
.at-highlight * { fill: #b23127; stroke: #b23127; }

/* ---------- Урок, ДЗ, записи ---------- */
.submission { border-top: 1px solid var(--line); padding: .8rem 0; }
.submission:first-of-type { border-top: 0; padding-top: 0; }
.feedback { background: var(--chassis); border-left: 3px solid var(--brass); border-radius: 0 10px 10px 0; padding: .55rem .85rem; margin: .4rem 0; }
.lesson-actions { display: flex; gap: .4rem .9rem; align-items: center; flex-wrap: wrap; }
.markers, .comments { list-style: none; padding: .3rem 0 0 .9rem; margin: 0; font-size: .92rem; border-left: 2px solid var(--line); }
.markers li, .comments li { padding: .15rem 0; }
.list.recordings li { display: block; }
details summary { cursor: pointer; margin: .7rem 0; font-weight: 600; }
details summary::marker { color: var(--brass-deep); }
progress { width: 100%; accent-color: var(--brass-deep); }
.checklist li { border: 0; padding: .15rem 0; }
.danger-zone { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.filters { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; align-items: center; }
.filters input { flex: 1; min-width: 180px; width: auto; }
.filters select { width: auto; max-width: 100%; }
.w-price { max-width: 9.5em; flex: 0 1 auto !important; min-width: 0 !important; }
ol.steps { padding-left: 1.5rem; margin: 0; }
ol.steps li { padding: .6rem 0 .6rem .2rem; border-bottom: 1px solid var(--line); }
ol.steps li::marker { font-family: var(--display); font-weight: 600; color: var(--muted); }
ol.steps li.done b { color: var(--diode); }
.step-actions { margin-top: .35rem; }
.progress-line { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-line div { height: 100%; background: var(--burst); }
.progress-line.mini { height: 5px; flex-basis: 100%; }

/* ---------- Каталог ---------- */
.teacher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--gap); }
.teacher-card { display: flex; gap: 1rem; text-decoration: none; color: var(--ink); margin: 0; }
.teacher-card:hover { border-color: var(--ink-soft); }
.teacher-card b { font-family: var(--display); font-weight: 600; font-size: .98rem; }
.avatar { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar.big { width: 148px; height: 148px; }
.avatar.placeholder { display: flex; align-items: center; justify-content: center; background: var(--burst-radial); color: #fff; font: 700 1.8rem var(--display); text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.avatar.big.placeholder { font-size: 3.6rem; }
.teacher-head { display: flex; gap: 1.6rem; align-items: flex-start; flex-wrap: wrap; }
.teacher-head h1 { margin-top: 0; }
.lead-small { font-size: 1.1rem; color: var(--ink-soft); }
.stars { color: var(--brass-deep); font-weight: 600; }
.review { border-top: 1px solid var(--line); padding: .7rem 0; }
.review:first-of-type { border-top: 0; padding-top: 0; }
.pager { text-align: center; }

/* ---------- Лента ---------- */
.post h2 { margin: .3rem 0 .6rem; font-size: 1.15rem; }
.post h2 a { color: var(--ink); text-decoration: none; }
.post-media { width: 100%; max-height: 480px; background: #000; border-radius: 12px; }
.post-actions { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.post-actions a { text-decoration: none; }
.inline-details { display: inline-block; }
.inline-details summary { font-weight: 400; margin: 0; }

/* ---------- Чат ---------- */
.chat-log.big { max-height: 60vh; min-height: 320px; overflow-y: auto; padding: .8rem; background: var(--chassis); border-radius: 12px; }
.chat-msg { margin-bottom: .7rem; max-width: 80%; }
.chat-msg.mine { margin-left: auto; text-align: right; }
.chat-msg div { background: var(--panel); border: 1px solid var(--line); padding: .45rem .8rem; border-radius: 16px 16px 16px 4px; display: inline-block; text-align: left; }
.chat-msg.mine div { background: var(--burst-btn); color: var(--btn-text); border-color: transparent; border-radius: 16px 16px 4px 16px; }
.chat-form { display: flex; gap: .5rem; margin-top: .7rem; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: vertical; }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 600; font-size: .875rem; }

/* ---------- Встроенная видеокомната (бета) ---------- */
.room { padding: .7rem clamp(1rem, 3vw, 2rem); }
.room-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: .7rem; }
.room-status[data-level=ok] { color: var(--diode); } .room-status[data-level=warn] { color: var(--brass-deep); } .room-status[data-level=error] { color: var(--signal); }
.rec-badge { color: #fff; background: var(--signal); border-radius: 99px; padding: .1rem .6rem; font-size: .85rem; }
.room-body { display: grid; grid-template-columns: 1fr 320px; gap: 1rem; }
@media (max-width: 860px) { .room-body { grid-template-columns: 1fr; } }
.stage { position: relative; background: #000; border-radius: var(--r-panel); aspect-ratio: 16/9; overflow: hidden; }
#remoteVideo { width: 100%; height: 100%; object-fit: contain; }
#localVideo { position: absolute; right: 12px; bottom: 12px; width: 24%; border: 2px solid #fff; border-radius: 4px; background: #222; }
.side { display: flex; flex-direction: column; gap: .7rem; }
.side label { display: block; font-size: .9rem; }
.controls .off { background: var(--signal); color: #fff; }
.btn.rec.recording { background: var(--signal); color: #fff; }
.rec-panel { border: 1px solid var(--line); border-radius: 12px; padding: .6rem; }
.chat { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; min-height: 200px; }
.chat-log { flex: 1; overflow-y: auto; padding: .5rem; max-height: 280px; font-size: .9rem; }
#chatForm:not(.chat-form) { display: flex; gap: .3rem; padding: .4rem; border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
main { overflow-x: clip; } /* «корпус» на главной не должен давать горизонтальную прокрутку */

/* ---------- Переключатель темы ☀/☾ (работает без JS: показываем кнопку «в противоположную») ---------- */
.theme-toggle { margin: 0 0 0 .2rem; display: inline-flex; }
.theme-toggle button { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 1.05rem; cursor: pointer; }
.theme-toggle button:hover { border-color: var(--ink-soft); }
.theme-toggle .to-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .to-light { display: inline-flex; }
  :root:not([data-theme="light"]) .theme-toggle .to-dark { display: none; }
}
:root[data-theme="dark"] .theme-toggle .to-light { display: inline-flex; }
:root[data-theme="dark"] .theme-toggle .to-dark { display: none; }
@media (max-width: 1240px) { .theme-toggle { margin-left: auto; } .theme-toggle + .nav-burger { margin-left: .4rem; } }
.theme-picker { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; margin: 0; }
.theme-picker button { border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft); border-radius: 999px; padding: .3rem .75rem; font: 500 .8rem var(--text); cursor: pointer; }
.theme-picker button[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.footer-controls { display: flex; flex-direction: column; gap: .8rem; align-items: flex-end; }
@media (max-width: 760px) { .footer-controls { align-items: flex-start; } }
/* Порядок в шапке: логотип, меню, переключатель темы, «Меню» (на узких — меню уходит под шапку) */
.logo { order: 1; } .mainnav { order: 2; } .theme-toggle { order: 3; } .nav-burger { order: 4; }
@media (max-width: 1240px) { .mainnav { order: 5; } }
