.season-catalogue-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; margin: 8px 0; border: 1px solid #deded8; border-radius: 16px; }
  .season-catalogue-row.listened { background: #edf8ee; border-color: #aed8b5; color: #326942; }
  .season-catalogue-row button { min-height: 44px; }
  :root {
    --bg: #ffffff;
    --panel: #ffffff;
    --panel-strong: #ffffff;
    --ink: #25211d;
    --muted: #746d63;
    --line: #e1d8c8;
    --accent: #315f72;
    --accent-soft: #d7e9ed;
    --green: #607a54;
    --rose: #9e665e;
    --shadow: 0 18px 45px rgba(64, 50, 34, 0.12);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  * {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }

  [hidden] {
    display: none !important;
  }

  body {
    margin: 0;
    min-height: 100vh;
    background: #ffffff;
    color: var(--ink);
    -webkit-text-size-adjust: 100%;
  }

  button,
  input,
  select,
  textarea {
    font: inherit;
    font-size: 16px;
  }

  button {
    touch-action: manipulation;
  }

  .app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
  }

  .sidebar {
    padding: 24px 18px;
    border-right: 1px solid var(--line);
    background: #ffffff;
  }

  .brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 28px;
  }

  .brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-weight: 800;
  }

  h1,
  h2,
  p {
    margin: 0;
  }

  h1 {
    font-size: 21px;
  }

  h2 {
    font-size: clamp(26px, 4vw, 42px);
    letter-spacing: 0;
  }

  .brand p,
  .eyebrow,
  small {
    color: var(--muted);
  }

  .tabs {
    display: grid;
    gap: 8px;
  }

  .tab-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 13px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
  }

  .tab-button[aria-selected="true"] {
    border-color: var(--line);
    background: var(--panel-strong);
    box-shadow: 0 10px 24px rgba(49, 95, 114, 0.1);
  }

  .workspace {
    min-width: 0;
    padding: 28px;
  }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .filters,
  .list-panel,
  .detail-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
  }

  .filters {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(0, 2.4fr);
    gap: 18px;
    align-items: start;
    padding: 16px;
    margin-bottom: 18px;
  }

  .search,
  .field {
    display: grid;
    align-self: start;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
  }

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

  .search input,
  .field select,
  .field input:not([type="hidden"]) {
    min-height: 48px;
  }

  input:focus,
  select:focus,
  textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }

  .filter-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
  }

  .filter-grid .field {
    flex: 1 1 210px;
    min-width: 190px;
  }

  .filter-grid .field select {
    height: 48px;
  }

  .content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }

  .content-grid.has-detail {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.95fr);
  }

  .panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    border-bottom: 1px solid var(--line);
  }

  .records {
    display: grid;
    max-height: none;
    overflow: visible;
    padding: 12px;
  }

  .records-table {
    display: grid;
    gap: 6px;
  }

  .records-header,
  .record-row {
    display: grid;
    grid-template-columns: var(--columns);
    gap: 10px;
    align-items: center;
  }

  .records-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .record-row {
    width: 100%;
    min-height: 50px;
    padding: 10px 12px;
    border: 1px solid var(--row-border, var(--line));
    border-radius: 8px;
    background: linear-gradient(90deg, var(--row-bg, rgba(255, 255, 255, 0.88)), rgba(255, 255, 255, 0.86));
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: inset 4px 0 0 var(--row-accent, transparent);
  }

  .record-row:hover,
  .record-row.active {
    border-color: var(--accent);
    background: linear-gradient(90deg, var(--row-bg-hover, #fbfdff), #ffffff);
  }

  .record-title {
    display: grid;
    min-width: 0;
    gap: 2px;
  }

  .record-title.with-cover {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }

  .record-title-text {
    display: grid;
    min-width: 0;
    gap: 2px;
  }

  .album-cover {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--row-accent, var(--accent)) 25%, var(--line));
    border-radius: 10px;
    background:
      linear-gradient(135deg, rgba(255,255,255,.65), rgba(255,255,255,.2)),
      color-mix(in srgb, var(--row-accent, var(--accent)) 12%, white);
    color: color-mix(in srgb, var(--row-accent, var(--accent)) 75%, #17313a);
    font-weight: 900;
    box-shadow: 0 5px 12px rgba(64, 50, 34, 0.08);
    cursor: zoom-in;
  }

  .album-cover.missing {
    cursor: default;
  }

  .album-cover-list {
    width: 42px;
    height: 42px;
  }

  .album-cover-detail {
    width: 92px;
    height: 92px;
    border-radius: 18px;
    font-size: 28px;
  }

  .album-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .album-cover.loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.72), transparent);
    animation: cover-shimmer 1.2s infinite;
    transform: translateX(-100%);
  }

  .album-cover.missing {
    opacity: .72;
  }

  @keyframes cover-shimmer {
    to { transform: translateX(100%); }
  }

  .record-title strong,
  .record-title small,
  .record-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .record-cell {
    min-width: 0;
    color: #4a443d;
  }

  .record-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
  }

  .group-label {
    position: sticky;
    top: 39px;
    z-index: 1;
    padding: 10px 6px 6px;
    background: #ffffff;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .group-title {
    min-width: 0;
  }

  .discography-badge {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    font: inherit;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    line-height: 1.15;
    white-space: nowrap;
    user-select: none;
  }

  .discography-badge.complete {
    border-color: #b9d8bf;
    background: #edf8f1;
    color: #3f7455;
  }

  .discography-badge.missing {
    border-color: #ead9a1;
    background: #fff7df;
    color: #8a6b18;
  }

  .discography-badge.unknown,
  .discography-badge.checking {
    border-color: #bed6ee;
    background: #eef6ff;
    color: #356a92;
  }

  .discography-refreshing {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
  }

  .discography-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(25, 28, 31, 0.34);
  }

  .discography-card {
    position: relative;
    width: min(760px, 100%);
    max-height: min(760px, calc(100vh - 36px));
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(23, 27, 30, 0.24);
  }

  .discography-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: #eef6f8;
    color: var(--accent);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
  }

  .discography-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-right: 40px;
  }

  .discography-head h2 {
    margin: 0;
    font-size: clamp(26px, 4vw, 42px);
  }

  .discography-eyebrow,
  .discography-summary,
  .discography-help {
    color: var(--muted);
  }

  .discography-eyebrow {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .discography-summary {
    align-self: center;
    white-space: nowrap;
    font-weight: 800;
  }

  .discography-help {
    margin: 0;
    line-height: 1.45;
  }

  .discography-editor-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: auto;
    padding-right: 2px;
  }

  .discography-editor-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) 104px 42px;
    gap: 8px;
    align-items: center;
    padding: 4px;
    border: 1px solid transparent;
    border-radius: 18px;
  }

  .discography-editor-row.listened {
    border-color: #b9d8bd;
    background: #eef8ee;
  }

  .discography-editor-row.listened input {
    border-color: #b9d8bd;
    background: #f8fff8;
  }

  .discography-editor-row input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 13px;
    font: inherit;
    background: #fff;
  }

  .discography-listened-mark {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: transparent;
    color: transparent;
    font-size: 16px;
    font-weight: 900;
  }

  .discography-editor-row.listened .discography-listened-mark {
    background: #cfead2;
    color: #2f7a3a;
  }

  .discography-listen-add {
    min-height: 36px;
    border: 1px solid #bed6ee;
    border-radius: 999px;
    background: #eef6ff;
    color: #356a92;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
  }

  .discography-listen-add:hover {
    background: #e2f0ff;
  }

  .discography-remove {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: #f5e5e3;
    color: #9d493e;
    font-size: 24px;
    font-weight: 900;
    cursor: pointer;
  }

  .discography-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 4px;
  }

  .record-card:hover,
  .record-card.active {
    border-color: var(--accent);
    background: #fbfdff;
  }

  .record-number {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }

  .record-main {
    display: grid;
    min-width: 0;
    gap: 3px;
  }

  .record-main strong,
  .record-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .record-score {
    min-width: 40px;
    padding: 5px 8px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--row-accent, var(--accent)) 15%, white);
    color: color-mix(in srgb, var(--row-accent, var(--accent)) 70%, #17313a);
    font-weight: 700;
    text-align: center;
  }

  .detail-panel {
    min-height: 0;
    padding: 18px;
  }

  .detail-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2;
    background: transparent;
    display: block;
  }

  .detail-drawer {
    position: sticky;
    top: 28px;
    z-index: 3;
    max-height: calc(100vh - 56px);
    overflow: auto;
  }

  .detail-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
  }

  .detail-heading {
    display: flex;
    align-items: flex-start;
    min-width: 0;
    gap: 14px;
  }

  .detail-title h3 {
    margin: 0;
    font-size: 28px;
  }

  .edit-button {
    flex: 0 0 auto;
  }

  .detail-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
  }

  .meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
  }

  .cover-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
  }

  .cover-action {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--accent);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }

  .cover-action:disabled {
    opacity: .55;
    cursor: wait;
  }

  .cover-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    background: rgba(18, 18, 18, .78);
    backdrop-filter: blur(10px);
  }

  .cover-lightbox-card {
    position: relative;
    display: grid;
    gap: 12px;
    width: min(92vw, 620px);
    max-height: 92vh;
    justify-items: center;
  }

  .cover-lightbox-card img {
    display: block;
    max-width: 100%;
    max-height: min(78vh, 620px);
    object-fit: contain;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .42);
  }

  .cover-lightbox-title {
    max-width: 100%;
    color: #fff;
    font-weight: 800;
    text-align: center;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
  }

  .cover-lightbox-close {
    position: absolute;
    top: -14px;
    right: -10px;
    z-index: 1;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: #1f2e34;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .24);
  }

  .pill {
    border-radius: 999px;
    background: #f0f4f5;
    color: #5d564b;
    padding: 6px 10px;
    font-size: 13px;
  }

  .person-link {
    border: 0;
    background: var(--accent-soft);
    color: var(--accent);
    cursor: pointer;
  }

  .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .read-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
  }

  .read-field {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
  }

  .read-field.compact {
    grid-column: span 3;
  }

  .read-field.medium {
    grid-column: span 6;
  }

  .read-field.long {
    grid-column: 1 / -1;
    background: #ffffff;
  }

  .read-field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .read-field div {
    color: var(--ink);
    font-size: 18px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .read-field.compact div {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
  }

  .read-field.long div {
    font-size: 17px;
    line-height: 1.62;
  }

  .read-field em {
    color: var(--muted);
    font-style: normal;
  }

  .read-field blockquote {
    margin: 0 0 10px;
    padding: 13px 14px;
    border-left: 4px solid var(--rose);
    border-radius: 8px;
    background: #fff4ef;
    color: #5f403c;
  }

  .read-field blockquote:last-child {
    margin-bottom: 0;
  }

  .field.full {
    grid-column: 1 / -1;
  }

  textarea {
    min-height: 100px;
    resize: vertical;
    overflow: hidden;
  }

  .actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
  }

  .primary-button,
  .ghost-button,
  .danger-button,
  .icon-button {
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 10px 13px;
    cursor: pointer;
  }

  .primary-button {
    background: var(--accent);
    color: white;
  }

  .ghost-button {
    background: white;
    color: var(--accent);
  }

  .danger-button {
    border-color: #d9aaa2;
    background: #fff4ef;
    color: #9e3f35;
  }

  .icon-button {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    padding: 0;
    border-radius: 999px;
    background: white;
    color: var(--accent);
    font-size: 28px;
    line-height: 1;
  }

  .tag {
    display: inline-flex;
    align-items: center;
    margin: 0 6px 6px 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
  }

  .tag-button,
  .tag-option,
  .tag-selected-item {
    border: 0;
    cursor: pointer;
  }

  .tag-selected {
    min-height: 36px;
  }

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

  .tag-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    max-height: 118px;
    overflow: auto;
    padding-top: 2px;
  }

  .alphabet-filter {
    display: flex;
    grid-column: 1 / -1;
    flex: 1 0 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .alphabet-filter > span {
    margin-right: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .letter-button,
  .sort-header {
    border: 1px solid var(--line);
    background: white;
    color: var(--muted);
    cursor: pointer;
  }

  .letter-button {
    min-width: 34px;
    border-radius: 999px;
    padding: 7px 9px;
    font-size: 13px;
    font-weight: 800;
  }

  .letter-button[aria-pressed="true"],
  .sort-header[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
  }

  .sort-header {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 999px;
    font-size: inherit;
    font-weight: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
  }

  .quote-appender {
    display: grid;
    gap: 10px;
  }

  .quote-draft {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
  }

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

  .quote-editor-item {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    padding: 12px;
  }

  .quote-editor-item textarea {
    min-height: 120px;
  }

  .quote-remove {
    justify-self: start;
    padding: 7px 12px;
  }

  .text-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: -2px;
  }

  .text-tools button {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: white;
    color: var(--accent);
    padding: 5px 9px;
    cursor: pointer;
    font-size: 13px;
  }

  .field-hint {
    margin-top: -2px;
    color: var(--muted);
    font-size: 12px;
  }

  .primary-button:disabled,
  .ghost-button:disabled,
  .danger-button:disabled {
    cursor: wait;
    opacity: 0.55;
  }

  .empty-state {
    display: grid;
    place-items: center;
    min-height: 360px;
    text-align: center;
    color: var(--muted);
  }

  .empty-state span {
    color: var(--ink);
    font-size: 22px;
    font-weight: 700;
  }

  .quote {
    margin-top: 14px;
    padding: 16px;
    border-left: 4px solid var(--rose);
    border-radius: 8px;
    background: #fff4ef;
    color: #5f403c;
    line-height: 1.55;
  }

  .related {
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
  }

  .related-list {
    display: grid;
    gap: 6px;
    margin-top: 8px;
  }

  .related-item {
    border: 0;
    border-radius: 8px;
    background: #eef4eb;
    color: var(--green);
    padding: 9px 10px;
    text-align: left;
    cursor: pointer;
  }

  .quotes-list {
    display: grid;
    gap: 10px;
  }

  .quote-source {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0;
    padding: 16px 6px 6px;
    background: #ffffff;
    color: var(--ink);
    font-size: 20px;
  }

  .quote-row {
    width: 100%;
    border: 1px solid var(--row-border, transparent);
    border-radius: 8px;
    background: linear-gradient(90deg, var(--row-bg, #fff4ef), #ffffff);
    color: #5f403c;
    padding: 0;
    text-align: left;
    cursor: pointer;
    box-shadow: inset 4px 0 0 var(--row-accent, var(--rose));
  }

  .quote-row:hover {
    background: linear-gradient(90deg, var(--row-bg-hover, #ffece4), #ffffff);
    border-color: var(--accent);
  }

  .quote-row blockquote {
    margin: 0;
    padding: 14px 16px;
    border-left: 0;
    line-height: 1.55;
  }

  @media (max-width: 900px) {
    body {
      background: #ffffff;
    }

    body.detail-open {
      overflow: hidden;
      overscroll-behavior: none;
    }

    .app-shell {
      grid-template-columns: 1fr;
      display: block;
      padding-bottom: 116px;
    }

    .sidebar {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 20;
      padding: 8px 10px max(10px, env(safe-area-inset-bottom));
      border-top: 1px solid var(--line);
      border-right: 0;
      border-bottom: 0;
      background: #ffffff;
      box-shadow: 0 -12px 28px rgba(64, 50, 34, 0.16);
    }

    .brand {
      display: none;
    }

    .tabs {
      display: flex;
      overflow-x: auto;
      gap: 4px;
      justify-content: space-between;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
      display: none;
    }

    .tab-button {
      display: grid;
      min-width: 54px;
      flex: 1 0 54px;
      justify-items: center;
      gap: 2px;
      padding: 7px 5px;
      border-radius: 13px;
      font-size: 10px;
      line-height: 1.1;
    }

    .tab-button span {
      display: grid;
      gap: 2px;
      justify-items: center;
    }

    .tab-button small {
      font-size: 9px;
    }

    .workspace {
      padding: max(12px, env(safe-area-inset-top)) 12px 112px;
    }

    .topbar {
      align-items: flex-start;
      gap: 10px;
      margin-bottom: 12px;
    }

    .topbar .ghost-button {
      padding: 8px 10px;
      border-radius: 12px;
      font-size: 13px;
    }

    h2 {
      font-size: 30px;
      line-height: 1.05;
    }

    .filters {
      position: static;
      z-index: 8;
      gap: 8px;
      padding: 10px;
      margin: 0 0 12px;
      border-radius: 18px;
      box-shadow: 0 10px 26px rgba(64, 50, 34, 0.08);
    }

    .filters,
    .content-grid,
    .form-grid {
      grid-template-columns: 1fr;
    }

    .content-grid.has-detail {
      grid-template-columns: 1fr;
    }

    .records {
      padding: 8px;
    }

    .records-table {
      display: grid;
      gap: 9px;
    }

    .records-header {
      display: none;
    }

    .record-row {
      display: grid;
      grid-template-columns: 44px minmax(0, 1fr) auto;
      gap: 10px;
      min-height: 76px;
      padding: 12px;
      border-radius: 16px;
      box-shadow: inset 4px 0 0 var(--row-accent, transparent), 0 8px 18px rgba(64, 50, 34, 0.06);
    }

    .record-row .record-cell {
      display: none;
    }

    .record-number {
      align-self: start;
      padding-top: 3px;
      font-size: 13px;
    }

    .record-title strong {
      font-size: 15px;
      line-height: 1.2;
      white-space: normal;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }

    .record-title small {
      font-size: 12px;
      line-height: 1.25;
      white-space: normal;
    }

    .record-title.with-cover {
      grid-template-columns: 48px minmax(0, 1fr);
      gap: 10px;
    }

    .album-cover-list {
      width: 48px;
      height: 48px;
      border-radius: 12px;
    }

    .record-score {
      align-self: start;
      min-width: 38px;
      padding: 5px 8px;
      border-radius: 999px;
      font-size: 13px;
    }

    .list-panel {
      border-radius: 18px;
      box-shadow: 0 12px 28px rgba(64, 50, 34, 0.08);
    }

    .panel-head {
      padding: 11px 12px;
    }

    .panel-head .primary-button {
      padding: 8px 10px;
      border-radius: 12px;
      font-size: 13px;
    }

    .read-grid {
      grid-template-columns: 1fr;
    }

    .read-field.compact,
    .read-field.medium,
    .read-field.long {
      grid-column: 1;
    }

    .detail-title {
      display: grid;
    }

    .detail-heading {
      display: grid;
      grid-template-columns: 82px minmax(0, 1fr);
      align-items: start;
      gap: 12px;
    }

    .album-cover-detail {
      width: 82px;
      height: 82px;
      border-radius: 16px;
    }

    .detail-drawer {
      position: fixed;
      inset: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
      z-index: 40;
      max-height: calc(100vh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
      padding: 14px;
      border-radius: 22px;
      overflow-y: auto;
      overscroll-behavior: contain;
      touch-action: pan-y;
      -webkit-overflow-scrolling: touch;
    }

    .detail-backdrop {
      display: block;
      z-index: 30;
      touch-action: none;
    }

    .detail-title h3 {
      font-size: 24px;
      line-height: 1.08;
    }

    .detail-actions {
      width: 100%;
      justify-content: flex-end;
    }

    .detail-actions .ghost-button,
    .detail-actions .danger-button {
      flex: 1;
    }

    .detail-actions .icon-button {
      flex: 0 0 46px;
    }

    .detail-actions .delete-button {
      flex: 0 0 52px;
    }

    .discography-modal {
      align-items: end;
      padding: 8px;
    }

    .discography-card {
      width: 100%;
      max-height: calc(100vh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
      padding: 16px;
      border-radius: 24px;
    }

    .discography-head {
      display: grid;
      padding-right: 40px;
    }

    .discography-summary {
      justify-self: start;
      align-self: start;
      white-space: normal;
    }

    .discography-editor-row {
      grid-template-columns: 74px minmax(0, 1fr) 86px 40px;
    }

    .discography-listen-add {
      min-height: 34px;
      padding: 0 8px;
      font-size: 12px;
    }

    .discography-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
    }

    .discography-actions .add-discography-album {
      grid-column: 1 / -1;
    }

    .records {
      max-height: none;
    }

    .detail-panel {
      min-height: 0;
    }
  }
  .long-text-input { overflow: auto; overscroll-behavior: contain; line-height: 1.65; max-height: 55vh; resize: vertical; }
  .long-text-overlay { position: fixed; inset: 0; z-index: 10000; background: #18232b88; display: grid; place-items: center; padding: 20px; }
  .long-text-card { background: white; width: min(900px, 100%); height: min(90dvh, 1000px); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 80px #0003; }
  .long-text-card header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .long-text-card h2 { margin: 0; font-size: 22px; }
  .long-text-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  .long-text-body textarea { flex: 1; min-height: 0; overflow: auto; resize: none; line-height: 1.7; font-size: 18px; overscroll-behavior: contain; padding: 20px; }
  .long-text-card small { color: var(--muted); }
  .book-badge { background: #fff6dc; color: #8b6b19; border: 1px solid #e8d598; border-radius: 30px; padding: 7px 13px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0; }
  .book-badge.complete { background: #edf8ef; color: #34724e; border-color: #afd3b5; }
  .bibliography-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
  .book-catalogue-row { display: grid; grid-template-columns: 85px minmax(100px, 1fr) auto 42px; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; align-items: center; }
  .book-catalogue-row[hidden] { display: none; }
  .book-catalogue-row.listened { background: #edf8ef; border-color: #afd3b5; }
  .book-catalogue-row input { min-width: 0; width: 100%; }
  .album-cover[data-media-type="books"] img { object-fit: contain; }
  @media (max-width: 700px) {
    .long-text-overlay { padding: 0; }
    .long-text-card { width: 100%; height: 100dvh; border-radius: 0; padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); }
    .book-catalogue-row { grid-template-columns: 65px 1fr 42px; }
    .book-catalogue-row [data-read] { grid-column: 2; grid-row: 2; }
    .book-catalogue-row [data-remove] { grid-column: 3; grid-row: 1; }
  }
  /* Quote finder is deliberately isolated from the catalogue sections. */
  .quotes-mode .filters { grid-template-columns: 1fr; gap: 10px; padding: 12px; }
  .quotes-mode .filter-grid { gap: 8px; }
  .quotes-mode .filter-grid .field { flex: 1 1 160px; min-width: 130px; }
  .quotes-mode .list-panel { box-shadow: none; background: #fff; }
  .quotes-mode .panel-head { padding: 12px; }
  .quotes-mode .records { padding: 0 12px 12px; }
  .quote-cards { display: grid; gap: 8px; }
  .quote-card { border: 1px solid #e2e7e9; border-radius: 10px; padding: 12px 14px 6px; background: #fff; min-width: 0; }
  .quote-card .quote-text { margin: 0; padding: 0; border: 0; color: #242c31; font-size: 16px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
  .quote-text.collapsed { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .quote-card mark { background: #fff0a9; color: inherit; border-radius: 2px; }
  .quote-card-footer { display: flex; gap: 6px 12px; align-items: center; justify-content: space-between; margin-top: 6px; flex-wrap: wrap; }
  .quote-card-footer small { color: #65737c; font-size: 12px; overflow-wrap: anywhere; }
  .quote-card-footer > div { display: flex; gap: 8px; margin-left: auto; }
  .quote-action { border: 0; background: transparent; color: #285e74; font-size: 13px; font-weight: 600; min-height: 44px; padding: 4px 8px; cursor: pointer; border-radius: 6px; }
  .quote-action:focus-visible { outline: 2px solid #285e74; }
  .quote-action:hover { background: #f1f6f8; }
  .quote-copy-status { display: block; color: #346b4c; font-size: 12px; }
  .quote-copy-status:empty { display: none; }
  .quote-pagination { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 16px 0 4px; }
  .quote-empty { padding: 20px 4px; color: #65737c; }
  @media (max-width: 600px) {
    .quotes-mode .filters { padding: 10px; margin-bottom: 10px; }
    .quotes-mode .filter-grid .field { flex-basis: calc(50% - 8px); min-width: 0; }
    .quotes-mode .records { padding: 0 7px 8px; }
    .quote-card { padding: 11px 11px 4px; }
    .quote-card .quote-text { font-size: 16px; }
    .quote-card-footer small { max-width: 100%; }
  }
  .quote-filter-details { width: 100%; }
  .quote-filter-details summary { cursor: pointer; color: #526873; font-size: 13px; min-height: 32px; padding: 8px 0; }
  .quote-filter-controls { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; align-items: end; }
  .quote-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; align-items: start; }
  .quote-card { padding: 12px 12px 2px; border-radius: 8px; }
  .quote-card .quote-text { font-size: 15px; line-height: 1.4; }
  .quote-text.collapsed { -webkit-line-clamp: 4; }
  .quote-card-footer { flex-wrap: nowrap; gap: 2px; margin-top: 4px; }
  .quote-card-footer small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
  .quote-card-footer > div { gap: 0; flex-shrink: 0; }
  .quote-action { min-width: 36px; min-height: 44px; padding: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
  .quote-expanded { grid-column: 1 / -1; }
  .quote-expanded .quote-text { font-size: 16px; line-height: 1.5; }
  .quote-expanded .quote-card-footer small { white-space: normal; }
  @media (max-width: 600px) {
    .quote-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .quote-card { padding: 9px 9px 0; }
    .quote-card .quote-text { font-size: 15px; line-height: 1.4; }
    .quote-text.collapsed { -webkit-line-clamp: 4; }
    .quote-card-footer { display: grid; grid-template-columns: 1fr auto; }
    .quote-card-footer small { grid-column: 1 / -1; margin-top: 4px; }
    .quote-card-footer > div { grid-column: 2; margin-top: -3px; }
    .quote-expanded .quote-card-footer small { grid-column: 1; }
  }
  @media (max-width: 340px) { .quote-cards { grid-template-columns: 1fr; } }
  .quote-work { margin: 0 0 18px; }
  .quote-work-title { margin: 0 0 9px; padding: 7px 10px; border-left: 3px solid hsl(var(--quote-hue) 30% 55%); color: #303d44; font-size: 15px; line-height: 1.4; }
  .quote-work-title small { display: block; margin-top: 2px; font-size: 11px; font-weight: 400; color: #6b747a; }
  .quote-work .quote-card { background: hsl(var(--quote-hue) 35% 97%); border-color: hsl(var(--quote-hue) 25% 86%); }
  .quote-work-more { margin-top: 10px; }
  .quote-work-more[hidden] { display: none; }
  .quote-work { margin-bottom: 10px; }
  .quote-work-title { margin-bottom: 5px; padding: 4px 8px; font-size: 14px; }
  .quote-work-title small { display: inline; margin-left: 5px; }
  .quote-cards { gap: 5px; }
  .quote-card { padding: 7px 8px 0; cursor: pointer; }
  .quote-card .quote-text { line-height: 1.35; }
  .quote-card .quote-text:focus-visible { outline: 2px solid #285e74; outline-offset: 2px; }
  .quote-card-footer { display: flex; justify-content: flex-end; margin-top: 0; gap: 0; }
  .quote-card-footer > div { margin: 0 0 0 auto; }
  .quote-card .quote-action { min-width: 38px; min-height: 36px; padding: 2px 7px; }
  @media (max-width: 600px) {
    .quote-cards { gap: 5px; }
    .quote-card { padding: 7px 7px 0; }
    .quote-card-footer { display: flex; }
    .quote-card-footer > div { margin-top: 0; }
  }
  .quote-work-grid { display: grid; grid-template-columns: repeat(var(--work-columns, 1), minmax(0, 1fr)); gap: 10px 6px; align-items: start; }
  .quote-work-grid .quote-work { grid-column: span var(--work-span, 1); min-width: 0; margin: 0; }
  .quote-work-grid .quote-cards { grid-template-columns: repeat(var(--work-span, 1), minmax(0, 1fr)); }
  .quote-work-grid .quote-work:has(.quote-expanded) { grid-column: 1 / -1; }
  .quote-work-grid .quote-work-title { overflow-wrap: anywhere; }