/* Arquivo do Paleógrafo - sala de leitura de um arquivo estatal soviético */

/* ===== Tokens ===== */
:root {
  --wall: #24382f;        /* verde de repartição pública */
  --wall-2: #2d4639;
  --wall-line: #3f5d4e;
  --manila: #e8dcb5;      /* ficha de catálogo */
  --manila-2: #d9ca9b;
  --manila-3: #f2e9cc;
  --ink: #1f1c17;
  --ink-soft: #5b5345;
  --stamp: #c3261b;       /* tinta de carimbo */
  --brass: #c19a52;       /* plaqueta de gaveta */
  --chalk: #dfe7df;
  --chalk-soft: #a3b6a9;

  --f-display: "Oranienbaum", "PT Serif", Georgia, serif;
  --f-body: "PT Serif", Georgia, serif;
  --f-mono: "PT Mono", ui-monospace, "Courier New", monospace;
  --f-stamp: "PT Sans Narrow", "Arial Narrow", sans-serif;

  --r: 3px;
  --gut: 16px;
  --maxw: 760px;
  --tabbar-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--wall);
  background-image:
    linear-gradient(180deg, rgba(0,0,0,.18), transparent 240px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 2px, transparent 2px 6px);
  color: var(--chalk);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--manila); color: var(--ink); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
main { outline: none; max-width: var(--maxw); margin: 0 auto; padding: calc(var(--safe-t) + 18px) var(--gut) calc(var(--tabbar-h) + var(--safe-b) + 32px); }
.boot { font-family: var(--f-mono); color: var(--chalk-soft); padding-top: 40vh; text-align: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mono { font-family: var(--f-mono); letter-spacing: .02em; }
.eyebrow { font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--chalk-soft); }

/* ===== Plaqueta (cabeçalho do acervo) ===== */
.plate {
  position: relative;
  margin: 6px 0 22px;
  padding: 22px 20px 20px;
  border: 1px solid var(--wall-line);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(0,0,0,.08));
}
.plate::before, .plate::after {
  content: ""; position: absolute; top: 10px; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e3c586, var(--brass) 60%, #6d5424);
}
.plate::before { left: 10px; } .plate::after { right: 10px; }
.plate .ru { font-family: var(--f-mono); font-size: 13px; letter-spacing: .3em; color: var(--brass); text-transform: uppercase; }
.plate h1 {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(38px, 11vw, 64px); line-height: .95; letter-spacing: -.01em;
  margin: 6px 0 12px; color: var(--manila-3);
}
.plate .meta { font-family: var(--f-mono); font-size: 13px; color: var(--chalk-soft); line-height: 1.6; }
.plate .actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: var(--r);
  font-family: var(--f-mono); font-size: 14px; letter-spacing: .04em; text-decoration: none;
  border: 1px solid var(--brass); background: transparent; color: var(--manila-3); cursor: pointer;
}
.btn:hover { background: rgba(193,154,82,.12); }
.btn-red { background: var(--stamp); border-color: var(--stamp); color: #fff6ee; }
.btn-red:hover { background: #a91f15; }
.btn-ghost { border-color: rgba(31,28,23,.35); color: var(--ink); }
.btn-ghost:hover { background: rgba(31,28,23,.06); }

/* ===== Abas de gaveta (séries) ===== */
.drawers { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gut) * -1) 14px; padding: 0 var(--gut); }
.drawers::-webkit-scrollbar { display: none; }
.drawer {
  flex: 0 0 auto; min-height: 40px; padding: 8px 12px 7px;
  border: 1px solid var(--wall-line); border-bottom-width: 3px; border-radius: var(--r) var(--r) 0 0;
  background: var(--wall-2); color: var(--chalk-soft); cursor: pointer;
  font-family: var(--f-mono); font-size: 13px; white-space: nowrap;
}
.drawer b { color: var(--brass); font-weight: 400; margin-right: 6px; }
.drawer[aria-pressed="true"] { background: var(--manila); color: var(--ink); border-color: var(--manila-2); }
.drawer[aria-pressed="true"] b { color: var(--stamp); }

/* ===== Fichas do catálogo ===== */
.series-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 26px 0 10px; }
.series-head h2 { font-family: var(--f-display); font-weight: 400; font-size: 26px; margin: 0; color: var(--manila-3); }
.series-head span { font-family: var(--f-mono); font-size: 12px; color: var(--chalk-soft); white-space: nowrap; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card {
  display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center;
  padding: 10px 12px 10px 10px; text-decoration: none; color: var(--ink);
  background: var(--manila);
  background-image: repeating-linear-gradient(180deg, transparent 0 25px, rgba(60,90,140,.13) 25px 26px);
  background-position: 0 18px;
  border-radius: 2px; position: relative;
  box-shadow: 0 1px 0 var(--manila-2), 0 6px 14px -8px rgba(0,0,0,.55);
  transition: transform .18s ease;
}
.card:hover { transform: translateY(-2px); }
.card .thumb { width: 76px; height: 76px; object-fit: cover; border-radius: 1px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); background: var(--manila-2); }
.card .cota { font-family: var(--f-mono); font-size: 11.5px; color: var(--stamp); letter-spacing: .04em; }
.card .t { font-family: var(--f-display); font-size: 21px; line-height: 1.1; margin: 2px 0 3px; overflow-wrap: anywhere; }
.card .tr { font-style: italic; font-size: 14px; color: var(--ink-soft); }
.card .d { font-family: var(--f-mono); font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

.foot-note { margin-top: 34px; font-family: var(--f-mono); font-size: 12px; color: var(--chalk-soft); text-align: center; line-height: 1.7; }
.foot-note a { color: var(--brass); }

/* ===== Documento ===== */
.doc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.back { font-family: var(--f-mono); font-size: 14px; color: var(--chalk); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.back:hover { color: var(--brass); }
.sheet {
  position: relative; color: var(--ink); background: var(--manila-3);
  background-image: linear-gradient(180deg, rgba(255,255,255,.35), transparent 120px);
  padding: 20px 18px 26px; border-radius: 2px;
  box-shadow: 0 1px 0 var(--manila-2), 0 18px 40px -18px rgba(0,0,0,.7);
}
.sheet-head { display: flex; justify-content: space-between; gap: 10px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); border-bottom: 1px solid rgba(31,28,23,.25); padding-bottom: 8px; }

/* capa com o disco saindo - espelha a lâmina impressa */
.sleeve-wrap { position: relative; width: min(78%, 330px); margin: 22px 0 30px; }
.disc {
  position: absolute; top: 4%; right: -22%; width: 92%; aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle, var(--label, #8c1d18) 0 15%, #111 15.5% 17%, transparent 17.5%),
    repeating-radial-gradient(circle, #151515 0 1px, #1d1d1d 1px 3px);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  transition: transform .9s cubic-bezier(.2,.8,.2,1);
}
.disc::after { content: ""; position: absolute; inset: 49%; border-radius: 50%; background: var(--manila-3); }
.sleeve { position: relative; width: 100%; aspect-ratio: 1; object-fit: cover; box-shadow: 0 10px 22px -8px rgba(0,0,0,.55); }
.sleeve-wrap:hover .disc { transform: translateX(8%) rotate(40deg); }

.doc-title { font-family: var(--f-display); font-weight: 400; font-size: clamp(32px, 9vw, 48px); line-height: 1; margin: 6px 0 4px; overflow-wrap: anywhere; }
.doc-trad { font-style: italic; color: var(--ink-soft); margin: 0 0 12px; }
.fields { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 16px 0 6px; font-size: 15px; }
.fields dt { font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); padding-top: 3px; }
.fields dd { margin: 0; border-bottom: 1px dotted rgba(31,28,23,.35); padding-bottom: 4px; }

.stamp {
  position: absolute; right: -8%; bottom: -14px; max-width: 70%; z-index: 2;
  background: rgba(242,233,204,.82);
  font-family: var(--f-stamp); font-weight: 700; text-transform: uppercase; text-align: center;
  font-size: clamp(15px, 4.4vw, 21px); line-height: 1.05; letter-spacing: .06em; color: var(--stamp);
  border: 3px double var(--stamp); padding: 8px 10px; border-radius: 4px;
  transform: rotate(-7deg); opacity: .92;
  -webkit-mask-image: repeating-radial-gradient(circle at 30% 40%, #000 0 2px, rgba(0,0,0,.72) 2px 3px);
          mask-image: repeating-radial-gradient(circle at 30% 40%, #000 0 2px, rgba(0,0,0,.72) 2px 3px);
  pointer-events: none;
}

.block { margin-top: 24px; }
.block h2 { font-family: var(--f-mono); font-weight: 400; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--stamp); margin: 0 0 6px; }
.block p { margin: 0; }
.block .src { display: inline-block; margin-top: 6px; font-family: var(--f-mono); font-size: 12px; color: var(--ink-soft); }
.directive { margin-top: 24px; padding: 14px 16px; border: 1.5px solid var(--ink); position: relative; background: rgba(255,255,255,.35); }
.directive h2 { position: absolute; top: -9px; left: 12px; background: var(--manila-3); padding: 0 6px; margin: 0; font-family: var(--f-mono); font-weight: 400; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; }
.directive p { margin: 0; font-size: 18px; font-style: italic; }

.play-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.embed { margin-top: 14px; }
.embed iframe { width: 100%; height: 352px; border: 0; border-radius: 12px; background: #111; }

.inventory { margin-top: 28px; }
.inventory summary { cursor: pointer; font-family: var(--f-mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; min-height: 44px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(31,28,23,.3); border-bottom: 1px solid rgba(31,28,23,.3); list-style: none; }
.inventory summary::-webkit-details-marker { display: none; }
.inventory summary::after { content: "+"; font-size: 18px; }
.inventory[open] summary::after { content: "−"; }
.inventory ol { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: f; }
.inventory li { counter-increment: f; display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; padding: 7px 0; border-bottom: 1px dotted rgba(31,28,23,.25); font-size: 15px; line-height: 1.3; }
.inventory li::before { content: counter(f, decimal-leading-zero); font-family: var(--f-mono); font-size: 12px; color: var(--ink-soft); padding-top: 2px; }
.inventory .a { display: block; font-size: 13px; color: var(--ink-soft); }
.inventory .dur { font-family: var(--f-mono); font-size: 12px; color: var(--ink-soft); padding-top: 2px; }
.inventory .partial { font-family: var(--f-mono); font-size: 12px; color: var(--ink-soft); margin: 10px 0 0; }

.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.pager a { font-family: var(--f-mono); font-size: 13px; color: var(--chalk); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; max-width: 48%; }
.pager a:hover { color: var(--brass); }

/* ===== Páginas de texto (estudo, proveniência, busca) ===== */
.page-title { font-family: var(--f-display); font-weight: 400; font-size: clamp(34px, 9vw, 52px); line-height: 1; margin: 8px 0 6px; color: var(--manila-3); }
.page-lead { color: var(--chalk-soft); margin: 0 0 20px; }
.report { color: var(--ink); background: var(--manila-3); padding: 20px 18px; border-radius: 2px; box-shadow: 0 18px 40px -18px rgba(0,0,0,.7); }
.report + .report { margin-top: 14px; }
.report h2 { font-family: var(--f-mono); font-weight: 400; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--stamp); margin: 0 0 12px; }
.big { font-family: var(--f-display); font-size: 54px; line-height: 1; }
.big small { font-family: var(--f-mono); font-size: 14px; color: var(--ink-soft); margin-left: 6px; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 16px; }
.facts div { border-top: 1px solid rgba(31,28,23,.3); padding-top: 6px; }
.facts b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 26px; line-height: 1.1; }
.facts span { font-family: var(--f-mono); font-size: 12px; color: var(--ink-soft); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bars li { display: grid; gap: 4px; }
.bars .lbl { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.bars .lbl span:last-child { font-family: var(--f-mono); font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.bars .bar { height: 10px; background: rgba(31,28,23,.1); }
.bars .bar i { display: block; height: 100%; background: var(--ink); }
.bars li:first-child .bar i { background: var(--stamp); }
.fine { font-family: var(--f-mono); font-size: 12px; color: var(--ink-soft); margin: 12px 0 0; }
.linklist { list-style: none; padding: 0; margin: 0; }
.linklist li { border-bottom: 1px dotted rgba(31,28,23,.3); }
.linklist a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; text-decoration: none; min-height: 44px; }
.linklist a span:last-child { font-family: var(--f-mono); font-size: 12px; color: var(--ink-soft); white-space: nowrap; }

.term p { margin: 0 0 12px; }
.term .clause b { font-family: var(--f-mono); font-size: 13px; letter-spacing: .06em; }
.term .sign { margin-top: 26px; font-family: var(--f-mono); font-size: 13px; }
.term .sign .line { display: block; margin-top: 28px; border-top: 1px solid var(--ink); width: 70%; padding-top: 4px; }

.search { position: relative; margin-bottom: 14px; }
.search input {
  width: 100%; min-height: 50px; padding: 12px 14px; font-size: 17px; font-family: var(--f-body);
  background: var(--manila-3); color: var(--ink); border: 0; border-radius: 2px;
}
.search input::placeholder { color: var(--ink-soft); }
.results { list-style: none; margin: 0; padding: 0; }
.results li a { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 11px 2px; text-decoration: none; border-bottom: 1px solid var(--wall-line); }
.results .rt { display: block; }
.results .ra { display: block; font-size: 14px; color: var(--chalk-soft); }
.results .rc { font-family: var(--f-mono); font-size: 12px; color: var(--brass); white-space: nowrap; padding-top: 3px; }
.empty { font-family: var(--f-mono); font-size: 14px; color: var(--chalk-soft); padding: 18px 0; }

.nfc-list { list-style: none; padding: 0; margin: 0; }
.nfc-list li { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dotted rgba(31,28,23,.3); }
.nfc-list code { font-family: var(--f-mono); font-size: 13px; overflow-wrap: anywhere; }

/* ===== Barra de abas ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(24,38,32,.96); border-top: 1px solid var(--wall-line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; font-family: var(--f-mono); font-size: 11px; color: var(--chalk-soft); }
.tabbar .tab-ico { font-size: 18px; line-height: 1; font-family: var(--f-mono); white-space: nowrap; }
.tabbar a[aria-current="page"] { color: var(--manila-3); }
.tabbar a[aria-current="page"] .tab-ico { color: var(--stamp); }

/* ===== Desarquivamento (chegada pelo selo NFC) ===== */
#overlay {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  background: rgba(18,28,23,.94); padding: 24px; cursor: pointer;
}
#overlay[hidden] { display: none; }
.unfile { width: min(92vw, 380px); color: var(--ink); background: var(--manila); padding: 26px 22px 64px; position: relative; box-shadow: 0 30px 60px rgba(0,0,0,.6); animation: folder-in .45s ease-out both; }
.unfile .l1 { font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.unfile .l2 { font-family: var(--f-mono); font-size: 18px; margin-top: 10px; min-height: 1.5em; white-space: pre-wrap; }
.unfile .l3 { font-family: var(--f-display); font-size: 30px; line-height: 1.05; margin-top: 12px; overflow-wrap: anywhere; opacity: 0; transition: opacity .3s; }
.unfile .l3.on { opacity: 1; }
.unfile .big-stamp {
  position: absolute; right: 12px; bottom: -18px; font-family: var(--f-stamp); font-weight: 700; font-size: 26px; letter-spacing: .08em;
  color: var(--stamp); border: 4px double var(--stamp); padding: 6px 12px; border-radius: 4px; background: rgba(242,233,204,.4);
  transform: rotate(-12deg) scale(2.4); opacity: 0;
}
.unfile .big-stamp.slam { animation: slam .32s cubic-bezier(.3,1.6,.5,1) forwards; }
.unfile .skip-hint { position: absolute; left: 22px; bottom: 8px; font-family: var(--f-mono); font-size: 11px; color: var(--ink-soft); }
@keyframes folder-in { from { transform: translateY(24px) rotate(-1deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slam { 0% { transform: rotate(-12deg) scale(2.4); opacity: 0; } 70% { opacity: .95; } 100% { transform: rotate(-12deg) scale(1); opacity: .9; } }
.shake { animation: shake .25s linear; }
@keyframes shake { 25% { transform: translate(2px, -1px); } 50% { transform: translate(-2px, 1px); } 75% { transform: translate(1px, 1px); } }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); transform: translateX(-50%); z-index: 30; background: var(--manila); color: var(--ink); font-family: var(--f-mono); font-size: 13px; padding: 10px 14px; border-radius: 2px; box-shadow: 0 8px 20px rgba(0,0,0,.4); max-width: calc(100vw - 32px); }

/* ===== Telas largas ===== */
@media (min-width: 720px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .sheet { padding: 28px 30px 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.termo-actions { position: sticky; bottom: 0; padding: 14px 0 4px; text-align: center; background: linear-gradient(180deg, transparent, rgba(18,28,23,.94) 40%); }

/* ===== Índice ===== */
.seg { display: inline-grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--wall-line); border-radius: var(--r); overflow: hidden; margin-bottom: 12px; }
.seg button { min-height: 42px; padding: 8px 18px; border: 0; background: var(--wall-2); color: var(--chalk-soft); font-family: var(--f-mono); font-size: 13px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--manila); color: var(--ink); }
.search.slim input { min-height: 44px; font-size: 16px; }
.rail {
  position: sticky; top: 0; z-index: 10; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(var(--gut) * -1) 6px; padding: calc(var(--safe-t) + 6px) var(--gut) 6px;
  background: rgba(24,38,32,.97); border-bottom: 1px solid var(--wall-line);
}
.rail::-webkit-scrollbar { display: none; }
.rail a { flex: 0 0 auto; min-width: 34px; min-height: 36px; display: grid; place-items: center; font-family: var(--f-mono); font-size: 14px; color: var(--manila-3); text-decoration: none; border-radius: var(--r); }
.rail a:hover, .rail a:focus-visible { background: var(--wall-2); color: var(--brass); }
.letter { scroll-margin-top: 70px; }
.letter-h { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--brass); }
.letter-h span { font-family: var(--f-display); font-weight: 400; font-size: 34px; line-height: 1; color: var(--brass); }
.letter-h small { font-family: var(--f-mono); font-size: 12px; color: var(--chalk-soft); }
.idx-list { list-style: none; margin: 0; padding: 0; }
.idx-row, .author summary { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--wall-line); }
.idx-main .rt { display: block; overflow-wrap: anywhere; }
.idx-main .ra { display: block; font-size: 14px; color: var(--chalk-soft); overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 120px; }
.chip { display: inline-flex; align-items: center; min-height: 30px; padding: 2px 8px; font-family: var(--f-mono); font-size: 12px; color: var(--brass); text-decoration: none; border: 1px solid rgba(193,154,82,.45); border-radius: var(--r); white-space: nowrap; }
.chip:hover { background: rgba(193,154,82,.12); }
.author summary { cursor: pointer; list-style: none; grid-template-columns: 1fr 20px; }
.author summary::-webkit-details-marker { display: none; }
.author summary::after { content: "+"; font-family: var(--f-mono); color: var(--brass); font-size: 18px; text-align: right; }
.author[open] summary::after { content: "−"; }
.author ul { list-style: none; margin: 0; padding: 4px 0 10px 12px; border-left: 2px solid var(--wall-line); }
.author ul li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; font-size: 15px; }

/* assinatura cursiva do termo */
.signature { display: block; width: 240px; height: auto; margin: 6px 0 -26px; }
.signature text { font-family: "Mrs Saint Delafield", cursive; font-size: 72px; fill: #243a74; }
.signature path { fill: none; stroke: #243a74; stroke-width: 1.6; stroke-linecap: round; opacity: .8; }
.foot-note a { text-decoration: underline; text-underline-offset: 3px; }

/* ===== Inventário: faixas clicáveis ===== */
.inventory li { display: block; padding: 0; }
.inventory li::before { content: none; }
.inventory .trk { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; padding: 8px 0; text-decoration: none; color: inherit; min-height: 44px; }
.inventory .trk::before { content: counter(f, decimal-leading-zero); font-family: var(--f-mono); font-size: 12px; color: var(--ink-soft); padding-top: 2px; }
.inventory .trk:hover .a, .inventory .trk:hover { color: var(--stamp); }
.st { font-size: 10px; vertical-align: 1px; }
.st-aprender { color: var(--brass); } .st-ensaiando { color: var(--stamp); } .st-domino { color: #2f6b45; }
.idx-main a.rt { color: inherit; text-decoration: none; }
.idx-main a.rt:hover { color: var(--brass); }
.author ul li a:not(.chip) { color: inherit; text-decoration: none; }

/* ===== Sala de Ensaio ===== */
.seg.four { grid-template-columns: repeat(4, 1fr); display: grid; width: 100%; }
.seg.four button { padding: 8px 4px; font-size: 12.5px; }
#panel { display: grid; gap: 14px; margin-top: 6px; }
.center { text-align: center; }
.row-gap { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.chipset { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chipset button { min-height: 38px; padding: 6px 11px; border: 1px solid rgba(31,28,23,.3); background: transparent; color: var(--ink); border-radius: var(--r); font-family: var(--f-mono); font-size: 12.5px; cursor: pointer; }
.chipset button small { color: var(--ink-soft); font-size: 11px; }
.chipset button[aria-pressed="true"] { background: var(--ink); color: var(--manila-3); border-color: var(--ink); }
.chipset button[aria-pressed="true"] small { color: var(--manila-2); }
.chipset.small-gap { margin-top: 16px; }
.keys { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-bottom: 8px; }
.keys button { min-height: 40px; border: 1px solid rgba(31,28,23,.3); background: transparent; color: var(--ink); font-family: var(--f-mono); font-size: 14px; border-radius: var(--r); cursor: pointer; }
.keys button[aria-pressed="true"] { background: var(--stamp); border-color: var(--stamp); color: #fff6ee; }
.fine a { color: var(--ink); }

/* afinador */
.gauge { position: relative; margin: 10px 0 14px; padding: 14px 10px 12px; text-align: center; border: 1.5px solid var(--ink); background: rgba(255,255,255,.35); }
.gauge .scale { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 11px; color: var(--ink-soft); }
.needle-track { position: relative; height: 70px; overflow: hidden; }
.needle-track::before { content: ""; position: absolute; left: 50%; top: 4px; width: 2px; height: 18px; margin-left: -1px; background: var(--stamp); }
.needle { position: absolute; left: 50%; bottom: 0; width: 3px; height: 66px; background: var(--ink); transform-origin: 50% 100%; transform: translateX(-50%) rotate(0deg); transition: transform .12s linear; border-radius: 2px; }
.note-big { font-family: var(--f-display); font-size: 58px; line-height: 1; margin-top: 6px; }
.note-big[data-ok="true"] { color: #2f6b45; }
.hint { font-size: 15px; margin-top: 4px; }
.freq { font-size: 12px; color: var(--ink-soft); margin-top: 2px; min-height: 1.2em; }
.strings { display: grid; grid-template-columns: repeat(var(--n, 6), 1fr); gap: 4px; }
.strings button { min-height: 58px; border: 1px solid rgba(31,28,23,.3); background: transparent; color: var(--ink); border-radius: var(--r); cursor: pointer; display: grid; place-items: center; gap: 0; padding: 4px 0; }
.strings b { font-family: var(--f-display); font-weight: 400; font-size: 17px; }
.strings small { font-family: var(--f-mono); font-size: 10px; color: var(--ink-soft); }
.strings button.on { background: var(--ink); color: var(--manila-3); }
.strings button.on small { color: var(--manila-2); }

/* metrônomo */
.bpm-row { display: flex; align-items: center; justify-content: center; gap: 18px; }
.round { width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font-size: 24px; cursor: pointer; }
.round.sm { width: 38px; height: 38px; font-size: 18px; }
.bpm { text-align: center; }
.bpm span { display: block; font-family: var(--f-display); font-size: 72px; line-height: 1; }
.bpm small { font-family: var(--f-mono); font-size: 12px; color: var(--ink-soft); }
.tempo-name { text-align: center; font-style: italic; margin: 4px 0 8px; }
.tempo-name span { font-style: normal; font-family: var(--f-mono); font-size: 12px; color: var(--ink-soft); margin-left: 6px; }
.metro input[type="range"] { width: 100%; accent-color: var(--stamp); min-height: 36px; }
.beats { display: flex; justify-content: center; gap: 12px; margin: 14px 0; }
.beats i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); transition: background .05s; }
.beats i.acc { border-color: var(--stamp); }
.beats i.on { background: var(--ink); }
.beats i.acc.on { background: var(--stamp); }

/* acordes */
.chord-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-top: 8px; }
.chord-grid.big { grid-template-columns: minmax(160px, 240px); justify-content: center; }
.chord-card { text-align: center; padding: 6px 4px 8px; border: 1px solid rgba(31,28,23,.2); border-radius: var(--r); background: rgba(255,255,255,.3); transition: box-shadow .3s; }
.chord-card.pulse { box-shadow: 0 0 0 3px var(--stamp); }
.chord-card > b { font-family: var(--f-display); font-weight: 400; font-size: 22px; display: block; }
.chord-svg { width: 100%; height: auto; cursor: pointer; }
.chord-svg .str { stroke: var(--ink); stroke-width: 1.2; }
.chord-svg .fret { stroke: var(--ink-soft); stroke-width: 1; }
.chord-svg .nut { stroke: var(--ink); stroke-width: 5; }
.chord-svg .dot { fill: var(--ink); }
.chord-svg .barre { fill: var(--ink); }
.chord-svg .open { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.chord-svg .mk { font: 16px var(--f-mono); fill: var(--stamp); }
.chord-svg .sn { font: 10px var(--f-mono); fill: var(--ink-soft); }
.chord-svg .basefret { font: 12px var(--f-mono); fill: var(--ink); }
.mini { margin-top: 4px; min-height: 32px; padding: 4px 8px; border: 1px solid rgba(31,28,23,.3); border-radius: var(--r); background: transparent; color: var(--ink); font-family: var(--f-mono); font-size: 11px; cursor: pointer; }
.deg { text-align: center; }
.deg > span { display: block; font-size: 12px; color: var(--stamp); margin-bottom: 2px; }

/* ficha de ensaio */
.doc-title.small { font-size: clamp(26px, 7vw, 38px); margin-top: 14px; }
.chipset.ink button[aria-pressed="true"] { background: var(--stamp); border-color: var(--stamp); color: #fff6ee; }
.ext { display: flex; flex-wrap: wrap; gap: 8px; }
.ext .btn { flex-direction: column; gap: 0; min-height: 50px; padding: 6px 12px; }
.ext .btn small { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--stamp); }
.cifra-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 10px; }
.cifra-tools .tr { display: flex; align-items: center; gap: 8px; }
.cifra-tools .mono { font-size: 13px; min-width: 88px; text-align: center; }
.cifra-ta { width: 100%; min-height: 300px; padding: 12px; font-family: var(--f-mono); font-size: 14px; line-height: 1.5; color: var(--ink); background: #fbf6e4; border: 1px solid rgba(31,28,23,.3); border-radius: 2px; resize: vertical; }
pre.cifra { margin: 0; padding: 12px 10px; background: #fbf6e4; border: 1px solid rgba(31,28,23,.2); font-family: var(--f-mono); font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
pre.cifra .cl { white-space: pre; }
.ch { font: inherit; font-weight: 700; color: var(--stamp); background: none; border: 0; padding: 0; cursor: pointer; }
.ch.inline { font-size: 12px; vertical-align: super; }
.results.light li a { border-bottom-color: rgba(31,28,23,.2); color: var(--ink); }
.results.light .ra { color: var(--ink-soft); }
.results.light .rc { color: var(--stamp); }
label.btn { cursor: pointer; }
/* botões sobre papel (fichas e relatórios) */
.report .btn:not(.btn-red), .sheet .btn:not(.btn-red) { color: var(--ink); border-color: rgba(31,28,23,.45); }
.report .btn:not(.btn-red):hover, .sheet .btn:not(.btn-red):hover { background: rgba(31,28,23,.06); }
