@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/literata-600-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/literata-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/roboto-mono-400-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/roboto-mono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/roboto-mono-500-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/roboto-mono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122;
}

:root {
  --paper: #f4f1ea;
  --card: #fffdf8;
  --ink: #1a1a1a;
  --muted: #6f675e;
  --line: #e4dcd0;
  --chord: #c4232b;
  --accent: #6d4ea8;
  --soft: #efeaf8;
  --fs: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  min-height: 100vh;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }

.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--paper);
  padding: calc(14px + env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid transparent;
}
.top h1 {
  font-family: Literata, Georgia, serif;
  font-weight: 600;
  font-size: 28px;
  margin: 0 0 4px;
}
.sub { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.search {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
}
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.rowbtns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip, .tool {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 14px;
}
.chip.on, .tool.on { background: var(--soft); border-color: var(--accent); color: var(--accent); }

.list { padding: 4px 12px 20px; }
.group {
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 6px 6px;
}
.song {
  display: block; width: 100%; text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 8px;
}
.song b { display: block; font-weight: 650; font-size: 17px; }
.song span { color: var(--muted); font-size: 14px; }
.song em { font-style: normal; color: var(--chord); font-size: 13px; }
.empty { color: var(--muted); padding: 24px 8px; }

.pull {
  height: 0; overflow: hidden; text-align: center; color: var(--muted); font-size: 14px;
}

.sheet-top {
  position: sticky; top: 0; z-index: 6;
  background: rgba(244, 241, 234, .96);
  backdrop-filter: blur(8px);
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  border-bottom: 1px solid var(--line);
}
.sheet-top .who { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.back {
  border: 0; background: transparent; color: var(--accent);
  font-size: 16px; padding: 6px 4px 6px 0;
}
.who h2 {
  font-family: Literata, Georgia, serif;
  font-size: 20px; font-weight: 600; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.who p { margin: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.tool b { font-weight: 650; min-width: 1.6em; display: inline-block; text-align: center; }
.scrollset { display: inline-flex; align-items: center; gap: 4px; }
.speed { min-width: 1.1em; text-align: center; font-weight: 650; font-size: 15px; }
.hint, .comment {
  margin: 12px 16px 0;
  background: var(--soft);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14.5px;
  color: #3d3158;
}
.comment { background: #fff7e8; color: #5c4a32; white-space: pre-wrap; }

.sheet {
  padding: 12px 12px 8px;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: var(--fs);
  line-height: 1.35;
  color: var(--ink);
}
.seg { position: relative; margin: 0 0 .15em; }
.chordrow { position: relative; height: 1.25em; }
.ch {
  position: absolute; top: 0; left: calc(var(--at) * 1ch);
  color: var(--chord); font-weight: 500; white-space: nowrap;
}
.lyric { white-space: pre; min-height: 1.15em; }
.inline { white-space: pre; }
.inline .ch { position: static; left: auto; }
.label { font-family: "Segoe UI", system-ui, sans-serif; font-weight: 700; margin-top: .7em; }
.gap { height: .7em; }
.tabwrap { overflow-x: auto; margin: .2em 0 .4em; }
.tab { white-space: pre; color: #333; }

.diagrams {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 8px 12px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.diagrams figure { margin: 0; text-align: center; flex: 0 0 auto; }
.diagrams figcaption { color: var(--chord); font-family: "Roboto Mono", monospace; font-size: 13px; font-weight: 500; }
.source {
  display: block; margin: 4px 16px 0; color: var(--muted); font-size: 13px;
}
.install {
  margin: 16px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.install h3 { margin: 0 0 6px; font-family: Literata, Georgia, serif; font-size: 18px; }
.install p { margin: 0 0 8px; color: var(--muted); font-size: 14.5px; }
.install button { border: 0; background: transparent; color: var(--accent); padding: 0; }
