:root {
  --bg: #f4f1ea;
  --paper: #fffdf8;
  --paper-soft: #faf6ed;
  --ink: #132323;
  --muted: #66706b;
  --line: #ded7ca;
  --accent: #0f5954;
  --accent-strong: #0a403d;
  --warm: #8c3c2e;
  --warm-soft: #f4e8df;
  --chord: #b23a2a;
  --shadow: 0 22px 60px rgba(42, 36, 28, .11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(15, 89, 84, .045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 89, 84, .035) 1px, transparent 1px),
    var(--bg);
  background-size: 34px 34px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-weight: 850;
  justify-content: center;
  min-height: 40px;
  padding: 9px 15px;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
}

button:hover,
.button:hover {
  border-color: rgba(15, 89, 84, .28);
  box-shadow: 0 8px 20px rgba(42, 36, 28, .08);
  transform: translateY(-1px);
}

.primary,
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.primary:hover,
button.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 10px 26px rgba(15, 89, 84, .22);
}

.secondary,
button.secondary {
  background: var(--paper);
  border-color: rgba(15, 89, 84, .22);
  color: var(--accent-strong);
}

.ghost,
button.ghost {
  background: rgba(255, 253, 248, .62);
  border-color: transparent;
  color: var(--accent-strong);
}

.danger {
  background: #fff9f6;
  border-color: #edd2c9;
  color: var(--warm);
}

.danger.subtle {
  background: transparent;
  border-color: transparent;
}

.danger:hover {
  background: #fff0eb;
  border-color: #e7b9aa;
  color: #763022;
}

.topbar {
  align-items: center;
  background: rgba(244, 241, 234, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(222, 215, 202, .75);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 900;
  gap: 10px;
  letter-spacing: .01em;
}

.brand span {
  align-items: center;
  background: var(--accent);
  border-radius: 7px;
  color: #fff;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

nav {
  align-items: center;
  display: flex;
  gap: 8px;
}

.nav-link {
  align-items: center;
  border-radius: 7px;
  color: var(--muted);
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 40px;
  padding: 10px 12px;
}

.nav-link:hover {
  background: rgba(255, 253, 248, .7);
  color: var(--ink);
}

.nav-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  padding-inline: 16px;
}

.nav-primary:hover {
  background: var(--accent-strong);
  color: #fff;
}

.page {
  margin: 0 auto;
  max-width: 1180px;
  padding: 30px clamp(14px, 4vw, 44px) 72px;
}

.library-head {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 6px 0 22px;
}

.eyebrow {
  color: var(--warm);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .12em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.library-head h1,
.form-shell h1,
.reader-head h1 {
  font-size: clamp(1.85rem, 4vw, 3rem);
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
}

.toolbar {
  margin-bottom: 18px;
}

.search {
  background: rgba(255, 253, 248, .75);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(42, 36, 28, .06);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) minmax(210px, 280px) auto;
  padding: 8px;
}

input,
select,
textarea {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  min-height: 44px;
  outline: none;
  padding: 11px 12px;
  width: 100%;
}

.search input,
.search select {
  background-color: transparent;
  border: 0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 89, 84, .12);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent-strong) 50%),
    linear-gradient(135deg, var(--accent-strong) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 19px,
    calc(100% - 12px) 19px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  color: var(--muted);
  padding-right: 34px;
}

textarea {
  min-height: 320px;
  resize: vertical;
}

textarea.small {
  min-height: 110px;
}

textarea.raw-import {
  min-height: 460px;
}

.notice,
.error {
  border-radius: 7px;
  line-height: 1.45;
  margin: 14px 0 18px;
  padding: 12px 14px;
}

.notice {
  background: rgba(15, 89, 84, .08);
  color: var(--accent-strong);
}

.error {
  background: #fff0ed;
  color: var(--warm);
}

.song-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.playlist-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.pager {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.top-pager {
  margin: -4px 0 16px;
}

.bottom-pager {
  margin-top: 18px;
}

.pager-status {
  color: var(--muted);
  font-size: .92rem;
  font-weight: 800;
}

.pager-actions {
  align-items: center;
  background: rgba(255, 253, 248, .78);
  border: 1px solid rgba(222, 215, 202, .74);
  border-radius: 10px;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.pager-link,
.pager-number {
  min-height: 36px;
  padding: 7px 11px;
}

.pager-number {
  min-width: 36px;
}

.pager-number.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  pointer-events: none;
}

.pager-link.disabled {
  color: rgba(102, 112, 107, .46);
  cursor: default;
  pointer-events: none;
}

.song-card {
  background: rgba(255, 253, 248, .88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(42, 36, 28, .06);
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  position: relative;
}

.playlist-card {
  background: rgba(255, 253, 248, .88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(42, 36, 28, .06);
  display: grid;
  gap: 8px;
  min-height: 138px;
  padding: 18px;
}

.playlist-card:hover {
  border-color: rgba(15, 89, 84, .36);
  transform: translateY(-1px);
}

.playlist-count,
.playlist-position {
  align-items: center;
  background: var(--accent);
  border-radius: 7px;
  color: #fff;
  display: inline-flex;
  font-weight: 950;
  height: 38px;
  justify-content: center;
  min-width: 38px;
  padding: 0 10px;
}

.song-card:hover {
  border-color: rgba(15, 89, 84, .36);
  transform: translateY(-1px);
}

.tone-badge {
  align-items: center;
  background: var(--accent);
  border-radius: 7px;
  color: #fff !important;
  display: inline-flex;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  justify-self: start;
  min-width: 38px;
  padding: 0 10px;
}

.song-title {
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1.2;
}

.song-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.song-main strong {
  overflow-wrap: anywhere;
}

.song-main small {
  color: var(--muted);
}

.song-meta,
.tag {
  color: var(--muted);
  font-size: .92rem;
}

.tag {
  align-self: end;
  background: var(--warm-soft);
  border-radius: 7px;
  color: var(--warm);
  justify-self: start;
  padding: 5px 9px;
}

.empty,
.form-shell {
  background: rgba(255, 253, 248, .9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 4vw, 30px);
}

.form-shell {
  max-width: 900px;
}

.playlist-form-shell {
  max-width: 1100px;
}

.playlist-picker-head {
  align-items: center;
  background: rgba(15, 89, 84, .055);
  border: 1px solid rgba(15, 89, 84, .14);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  padding: 14px;
}

.playlist-selected-count {
  background: var(--accent);
  border-radius: 999px;
  color: #fff !important;
  flex: 0 0 auto;
  font-size: .86rem;
  font-weight: 900;
  padding: 8px 12px;
}

.playlist-search {
  align-items: center;
  background: rgba(255, 253, 248, .75);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 8px;
}

.playlist-search input {
  background: transparent;
  border: 0;
}

.playlist-picker {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  max-height: 62vh;
  overflow: auto;
}

.playlist-pick-row {
  align-items: center;
  background: rgba(255, 253, 248, .72);
  border-bottom: 1px solid rgba(222, 215, 202, .72);
  display: grid !important;
  gap: 12px;
  grid-template-columns: 24px 72px minmax(0, 1fr) auto;
  min-height: 72px;
  padding: 12px;
}

.playlist-pick-row[hidden],
.playlist-pick-row.is-hidden {
  display: none !important;
}

.playlist-pick-row:last-child {
  border-bottom: 0;
}

.playlist-pick-row:hover {
  background: rgba(250, 246, 237, .86);
}

.playlist-pick-row.selected {
  background: rgba(15, 89, 84, .075);
  box-shadow: inset 4px 0 0 var(--accent);
}

.playlist-pick-row.selected .order-input {
  border-color: rgba(15, 89, 84, .38);
  color: var(--accent-strong);
  font-weight: 900;
}

.playlist-pick-row > input[type="checkbox"] {
  min-height: auto;
  width: auto;
}

.order-input {
  min-height: 38px;
  padding: 7px 8px;
}

.playlist-view {
  display: grid;
  gap: 18px;
}

.playlist-start {
  display: flex;
  justify-content: flex-start;
}

.share-box {
  background: rgba(255, 253, 248, .9);
  border: 1px solid rgba(15, 89, 84, .16);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(42, 36, 28, .06);
  display: grid;
  gap: 12px;
  padding: 16px;
}

.share-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.share-actions input {
  font-size: .94rem;
}

.copy-feedback {
  color: var(--accent-strong);
  font-weight: 850;
  margin: 0;
}

.public-share-box {
  background: rgba(15, 89, 84, .055);
  border: 1px solid rgba(15, 89, 84, .16);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.public-share-box form {
  display: contents;
}

.playlist-track {
  background: rgba(255, 253, 248, .9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  overflow: hidden;
}

.playlist-row {
  align-items: center;
  border-bottom: 1px solid rgba(222, 215, 202, .75);
  display: grid;
  gap: 14px;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  min-height: 78px;
  padding: 14px 16px;
}

.playlist-row:last-child {
  border-bottom: 0;
}

.playlist-row:hover {
  background: rgba(250, 246, 237, .86);
}

.playlist-context {
  color: var(--accent-strong) !important;
  font-weight: 850;
}

.playlist-context a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
  margin: 8px 0 0;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.login-card {
  background: rgba(255, 253, 248, .92);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  max-width: 430px;
  padding: clamp(20px, 4vw, 30px);
  width: 100%;
}

.login-card label {
  display: grid;
  gap: 8px;
}

.login-card label span {
  color: var(--muted);
  font-weight: 850;
}

.users-shell {
  display: grid;
  gap: 16px;
  grid-template-columns: 340px minmax(0, 1fr);
}

.users-list {
  display: grid;
  gap: 12px;
}

.user-card {
  background: rgba(255, 253, 248, .9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(42, 36, 28, .06);
  display: grid;
  gap: 12px;
  padding: 16px;
}

.user-form-card {
  align-self: start;
}

.user-card h2 {
  font-size: 1.12rem;
  margin: 0;
}

.user-card label {
  display: grid;
  gap: 8px;
}

.user-card label span {
  color: var(--muted);
  font-weight: 850;
}

.user-card-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.status-pill {
  background: rgba(15, 89, 84, .1);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: .82rem;
  font-weight: 900;
  padding: 6px 10px;
}

.status-pill.blocked {
  background: var(--warm-soft);
  color: var(--warm);
}

.check-line {
  align-items: center;
  display: flex !important;
  gap: 10px;
  font-weight: 850;
}

.check-line input {
  min-height: auto;
  width: auto;
}

.user-row-fields {
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
}

.song-form,
.song-form label {
  display: grid;
  gap: 8px;
}

.song-form {
  gap: 16px;
}

.song-form span {
  color: var(--muted);
  font-weight: 800;
}

.field-row {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(100px, 160px) 1fr;
}

.actions,
.reader-head {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.head-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.action-menu {
  display: block;
}

.action-menu summary {
  display: none;
}

.action-menu-body {
  display: flex;
}

.nav-actions,
.manage-actions {
  align-items: center;
  background: rgba(255, 253, 248, .78);
  border: 1px solid rgba(222, 215, 202, .74);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(42, 36, 28, .055);
  display: inline-flex;
  gap: 4px;
  padding: 4px;
}

.head-actions .button,
.head-actions button {
  min-height: 40px;
  padding-inline: 13px;
}

.nav-button {
  color: var(--accent-strong);
  min-width: 86px;
}

.nav-button.disabled {
  color: rgba(102, 112, 107, .46);
  cursor: default;
  pointer-events: none;
}

.head-actions form {
  display: contents;
}

.song-reader {
  display: grid;
  gap: 18px;
}

.reader-head {
  margin: 4px 0 2px;
}

.reader-head p:not(.eyebrow) {
  color: var(--muted);
  margin: 10px 0 0;
}

.reader-bar {
  align-items: center;
  background: rgba(255, 253, 248, .84);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(42, 36, 28, .06);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 10px;
  position: sticky;
  top: 72px;
  z-index: 4;
}

.view-menu {
  width: 100%;
}

.reader-tools {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  width: 100%;
}

.tabs {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: inline-grid;
  gap: 4px;
  grid-template-columns: repeat(3, minmax(86px, auto));
  padding: 4px;
}

.tab {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-weight: 900;
  min-height: 36px;
  padding: 7px 11px;
}

.tab.active {
  background: var(--paper);
  box-shadow: 0 8px 20px rgba(42, 36, 28, .08);
  color: var(--accent-strong);
}

.controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.save-status {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
  padding: 0 4px;
}

.control-group {
  align-items: center;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  grid-template-columns: 46px auto 46px;
  min-height: 40px;
  padding: 3px;
}

.control-group button {
  background: transparent;
  border: 0;
  color: var(--warm);
  font-weight: 900;
  min-height: 32px;
  padding: 0;
}

.control-group button:hover {
  background: rgba(140, 60, 46, .08);
  box-shadow: none;
  transform: none;
}

.control-group span {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 800;
  min-width: 54px;
  text-align: center;
}

.tone-control span {
  min-width: 92px;
}

.tone-control strong {
  color: var(--ink);
}

.icon-button {
  background: var(--paper);
  border-color: rgba(15, 89, 84, .2);
  color: var(--accent-strong);
  min-height: 48px;
}

.reader-paper {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 58vh;
  padding: clamp(22px, 5vw, 56px);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.song-text,
.cipher-text {
  color: #10212a;
  font-family: "Roboto Mono", "SFMono-Regular", Consolas, monospace;
  font-size: var(--song-size, 18px);
  line-height: 1.9;
  margin: 0;
  white-space: pre-wrap;
}

.cipher-line {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  min-height: calc(var(--song-size, 18px) * 2.55);
}

.syllable {
  display: inline-grid;
  grid-template-rows: 1.05em 1.4em;
  min-width: .45em;
  white-space: pre;
}

.chord {
  color: var(--chord);
  font-size: .76em;
  font-weight: 950;
  line-height: 1;
}

.lyric {
  line-height: 1.25;
}

.song-text strong,
.lyric strong {
  font-weight: 950;
}

.blank-line {
  min-height: 1.2em;
}

.letter-line {
  min-height: 1.4em;
}

.song-divider {
  border-top: 2px solid rgba(15, 89, 84, .22);
  margin: 1.1em 0;
  min-height: 0;
}

.info-panel dl {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 0 0 22px;
}

.info-panel dl div {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.info-panel dt {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.info-panel dd {
  font-weight: 800;
  margin: 6px 0 0;
}

.info-panel p {
  color: var(--muted);
  line-height: 1.65;
}

.empty-song {
  background: var(--paper-soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
  margin-bottom: 22px;
  padding: 18px;
}

.empty-song h2 {
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.empty-song p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.source-links a {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--accent-strong);
  font-weight: 850;
  padding: 8px 10px;
}

.inline-import {
  background: linear-gradient(180deg, rgba(15, 89, 84, .055), rgba(255, 253, 248, .78));
  border: 1px solid rgba(15, 89, 84, .16);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
  margin-bottom: 22px;
  padding: 5px;
}

.inline-import summary {
  align-items: center;
  color: var(--accent-strong);
  cursor: pointer;
  display: flex;
  font-weight: 900;
  justify-content: space-between;
  list-style: none;
  min-height: 50px;
  padding: 12px 16px;
}

.inline-import summary::-webkit-details-marker {
  display: none;
}

.inline-import summary::after {
  content: "+";
  align-items: center;
  background: var(--paper);
  border: 1px solid rgba(15, 89, 84, .18);
  border-radius: 999px;
  display: inline-flex;
  font-weight: 950;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.inline-import[open] summary::after {
  content: "-";
}

.inline-import form {
  display: grid;
  gap: 12px;
  padding: 0 10px 10px;
}

.inline-import label {
  display: grid;
  gap: 8px;
}

.inline-import label span {
  color: var(--muted);
  font-weight: 850;
}

.inline-import textarea {
  min-height: 240px;
}

@media (max-width: 820px) {
  .library-head,
  .reader-head,
  .reader-bar,
  .playlist-picker-head,
  .reader-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .controls,
  .tabs {
    width: 100%;
  }

  .tabs {
    grid-template-columns: repeat(3, 1fr);
  }

  .controls {
    justify-content: stretch;
  }

  .head-actions {
    align-self: flex-start;
  }

  .nav-actions,
  .manage-actions {
    width: max-content;
  }

  .control-group,
  .icon-button {
    flex: 1 1 190px;
  }
}

@media (max-width: 640px) {
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
    padding: 12px 14px;
  }

  .brand {
    justify-self: start;
  }

  .brand span {
    height: 30px;
    width: 30px;
  }

  nav {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  }

  .nav-link {
    background: rgba(255, 253, 248, .72);
    border: 1px solid rgba(222, 215, 202, .82);
    font-size: .9rem;
    min-height: 38px;
    padding: 8px 6px;
  }

  .nav-primary {
    background: var(--accent);
    border-color: var(--accent);
  }

  .search,
  .playlist-search,
  .share-actions,
  .field-row,
  .users-shell,
  .user-row-fields,
  .playlist-pick-row,
  .playlist-row {
    grid-template-columns: 1fr;
  }

  .playlist-pick-row {
    align-items: stretch;
  }

  .playlist-pick-row > input[type="checkbox"] {
    justify-self: start;
  }

  .playlist-row .tone-badge {
    justify-self: start;
  }

  .pager {
    align-items: stretch;
    flex-direction: column;
  }

  .pager-actions {
    justify-content: center;
    overflow-x: auto;
  }

  .page {
    padding-top: 20px;
  }

  .reader-bar {
    position: static;
  }

  .head-actions {
    align-self: stretch;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .action-menu {
    background: rgba(255, 253, 248, .82);
    border: 1px solid rgba(222, 215, 202, .82);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(42, 36, 28, .055);
    display: block;
    overflow: hidden;
  }

  .action-menu summary {
    align-items: center;
    color: var(--accent-strong);
    cursor: pointer;
    display: flex;
    font-weight: 900;
    justify-content: space-between;
    list-style: none;
    min-height: 44px;
    padding: 10px 12px;
  }

  .action-menu summary::-webkit-details-marker {
    display: none;
  }

  .action-menu summary::after {
    align-items: center;
    background: var(--paper);
    border: 1px solid rgba(15, 89, 84, .18);
    border-radius: 999px;
    content: "+";
    display: inline-flex;
    height: 24px;
    justify-content: center;
    width: 24px;
  }

  .action-menu[open] summary::after {
    content: "-";
  }

  .action-menu-body {
    display: none;
    padding: 0 8px 8px;
  }

  .action-menu[open] .action-menu-body {
    display: grid;
    gap: 8px;
  }

  .nav-actions,
  .manage-actions,
  .reader-tools {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0 8px 8px;
    width: 100%;
  }

  .nav-actions,
  .manage-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .view-menu {
    width: 100%;
  }

  .view-menu:not([open]) {
    margin-bottom: 0;
  }

  .reader-paper {
    padding: 18px;
  }
}

@media print {
  .topbar,
  .reader-bar,
  .head-actions {
    display: none;
  }

  body,
  .page,
  .reader-paper {
    background: #fff;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
}
