:root {
  color-scheme: light;
  --paper: #f7f4ef;
  --ink: #202226;
  --muted: #6f716f;
  --line: #d8d1c5;
  --panel: #fffdfa;
  --forest: #0f5f4c;
  --forest-dark: #0b493c;
  --brick: #a94332;
  --gold: #c79b31;
  --shadow: 0 18px 50px rgba(32, 34, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(15, 95, 76, 0.07) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(15, 95, 76, 0.06) 0 1px, transparent 1px 100%),
    var(--paper);
  background-size: 44px 44px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body.studio-page {
  background:
    radial-gradient(circle at top left, rgba(35, 82, 71, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(199, 155, 49, 0.14), transparent 26%),
    #111214;
  color: #f4f2ed;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-shell {
  width: min(100%, 430px);
}

.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(26px, 7vw, 42px);
}

.login-mark {
  display: grid;
  grid-template-columns: repeat(3, 30px);
  gap: 8px;
  margin-bottom: 26px;
}

.login-mark span {
  display: block;
  width: 30px;
  height: 42px;
  border-radius: 3px;
}

.login-mark span:nth-child(1) {
  background: var(--forest);
}

.login-mark span:nth-child(2) {
  background: var(--brick);
}

.login-mark span:nth-child(3) {
  background: var(--gold);
}

h1,
h2,
p {
  margin-top: 0;
}

.login-panel h1,
.library-header h1 {
  margin-bottom: 24px;
  font-size: clamp(2rem, 7vw, 3.8rem);
  line-height: 0.96;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
}

.login-form input:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(15, 95, 76, 0.15);
  outline: none;
}

.login-form button,
.download-link,
.ghost-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.login-form button,
.download-link {
  background: var(--forest);
  color: #fff;
  padding: 0 18px;
}

.login-form button:hover,
.download-link:hover {
  background: var(--forest-dark);
}

.form-error {
  margin: 0;
  color: #8b281c;
  font-weight: 700;
}

.library-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(26px, 5vw, 58px) 0;
}

.library-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(22px, 5vw, 42px);
}

.library-header h1 {
  margin: 0;
}

.library-count {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--brick);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.85);
  color: var(--ink);
  padding: 0 15px;
}

.ghost-button:hover {
  border-color: var(--forest);
}

.search-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(180px, 240px) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.9);
  padding: 10px;
}

.search-bar label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
  padding: 0 6px;
}

.search-bar input,
.search-bar select {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.search-bar input:focus,
.search-bar select:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(15, 95, 76, 0.15);
  outline: none;
}

.search-bar button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--forest);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 0 16px;
}

.search-bar button:hover {
  background: var(--forest-dark);
}

.sync-error {
  border-left: 4px solid var(--brick);
  background: rgba(169, 67, 50, 0.08);
  color: #7f2b21;
  font-weight: 800;
  margin-bottom: 18px;
  padding: 10px 12px;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr));
  gap: 18px;
}

.book-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.92);
  box-shadow: 0 12px 32px rgba(32, 34, 38, 0.08);
  padding: 16px;
}

.cover-frame {
  aspect-ratio: 2 / 3;
  width: 100%;
  align-self: start;
  overflow: hidden;
  border-radius: 6px;
  background: #ded7cd;
  box-shadow: 0 10px 24px rgba(32, 34, 38, 0.18);
}

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

.cover-placeholder {
  background:
    linear-gradient(135deg, rgba(15, 95, 76, 0.9), rgba(169, 67, 50, 0.8)),
    #ddd;
}

.book-details {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
}

.book-details h2 {
  margin-bottom: 3px;
  font-size: clamp(1.22rem, 3vw, 1.7rem);
  line-height: 1.08;
}

.book-author {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

.book-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.book-meta div {
  min-width: 0;
  border-left: 3px solid var(--gold);
  padding-left: 9px;
}

.book-meta dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.book-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.description {
  margin-bottom: 0;
  color: #454743;
}

.download-link {
  width: fit-content;
  margin-top: auto;
}

.book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.book-actions .ghost-button,
.book-actions .download-link {
  min-width: 118px;
}

.book-dialog {
  width: min(680px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
  padding: 20px;
}

.book-dialog::backdrop {
  background: rgba(32, 34, 38, 0.5);
}

.book-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.book-dialog-header h3 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  line-height: 1.08;
}

.book-dialog-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.book-dialog-meta div {
  min-width: 0;
  border-left: 3px solid var(--gold);
  padding-left: 10px;
}

.book-dialog-meta dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.book-dialog-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.book-dialog-description {
  margin: 8px 0 0;
  color: #454743;
}

.book-dialog-summary {
  margin-top: 18px;
}

.book-dialog-summary .eyebrow {
  margin-bottom: 0;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.8);
  padding: 32px;
}

.empty-state h2 {
  margin: 0;
}

.studio-shell {
  width: min(1320px, calc(100% - 32px));
  min-height: calc(100vh - 32px);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  margin: 16px auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(17, 18, 20, 0.92);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.studio-rail {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.studio-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.studio-brand-mark {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #20b38d;
  color: #0f1816;
  font-weight: 900;
}

.studio-nav {
  display: grid;
  gap: 8px;
}

.studio-nav-item {
  display: flex;
  min-height: 42px;
  align-items: center;
  border-radius: 10px;
  padding: 0 14px;
  color: rgba(244, 242, 237, 0.72);
  text-decoration: none;
}

.studio-nav-item-active {
  background: rgba(255, 255, 255, 0.09);
  color: #fffdfa;
}

.studio-main {
  padding: 28px;
}

.studio-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.studio-page .library-count,
.studio-page .book-author,
.studio-page .book-meta dt,
.studio-page .search-bar label {
  color: rgba(244, 242, 237, 0.68);
}

.studio-page .eyebrow {
  color: #ff8f6b;
}

.studio-page .ghost-button {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fffdfa;
}

.studio-page .ghost-button:hover {
  border-color: rgba(32, 179, 141, 0.5);
}

.studio-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.studio-section-head h2 {
  margin: 0;
  font-size: 1.3rem;
}

.studio-spotlight {
  margin-bottom: 28px;
}

.studio-spotlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.studio-spotlight-card {
  position: relative;
  min-height: 178px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: #181a1d;
}

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

.studio-spotlight-copy {
  position: absolute;
  inset: auto 0 0 0;
  padding: 18px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.78));
}

.studio-spotlight-copy h3,
.studio-spotlight-copy p {
  margin: 0;
}

.studio-spotlight-copy h3 {
  margin-bottom: 4px;
  font-size: 1.2rem;
}

.studio-spotlight-copy p {
  color: rgba(244, 242, 237, 0.84);
}

.studio-spotlight-badge {
  display: inline-flex;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(32, 179, 141, 0.18);
  color: #7ce3c8;
  padding: 4px 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

.studio-spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.studio-spotlight-actions .ghost-button,
.studio-spotlight-actions .download-link {
  min-width: 110px;
}

.studio-library {
  display: grid;
  gap: 18px;
}

.studio-page .search-bar {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.studio-page .search-bar input,
.studio-page .search-bar select {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #fffdfa;
}

.studio-page .search-bar button,
.studio-page .download-link {
  background: #20b38d;
  color: #0f1816;
}

.studio-page .search-bar button:hover,
.studio-page .download-link:hover {
  background: #199978;
}

.studio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.studio-tile {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
}

.studio-cover {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

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

.studio-copy h3,
.studio-copy p {
  margin: 0;
}

.studio-copy h3 {
  font-size: 1.05rem;
  line-height: 1.2;
}

.studio-author {
  margin-top: 4px;
  color: rgba(244, 242, 237, 0.78);
  font-weight: 700;
}

.studio-meta,
.studio-rating {
  margin-top: 6px;
  color: rgba(244, 242, 237, 0.66);
  font-size: 0.9rem;
}

.studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.studio-actions .ghost-button,
.studio-actions .download-link {
  min-width: 110px;
}

@media (max-width: 720px) {
  .library-header {
    align-items: stretch;
    flex-direction: column;
  }

  .library-header form,
  .ghost-button {
    width: 100%;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions form {
    flex: 1;
  }

  .search-bar {
    grid-template-columns: 1fr;
  }

  .search-bar label {
    padding: 0;
  }

  .book-card {
    grid-template-columns: 108px 1fr;
    gap: 14px;
    padding: 12px;
  }

  .book-meta {
    grid-template-columns: 1fr;
  }

  .book-dialog-meta {
    grid-template-columns: 1fr;
  }

  .studio-shell {
    grid-template-columns: 1fr;
  }

  .studio-rail {
    gap: 18px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .studio-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .studio-header {
    flex-direction: column;
  }

  .studio-spotlight-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .book-card {
    grid-template-columns: 1fr;
  }

  .cover-frame {
    max-width: 168px;
  }

  .download-link {
    width: 100%;
  }

  .book-actions {
    flex-direction: column;
  }

  .book-actions .ghost-button,
  .book-actions .download-link {
    width: 100%;
  }

  .book-dialog {
    padding: 16px;
  }

  .book-dialog-header {
    flex-direction: column;
  }

  .studio-main {
    padding: 18px;
  }

  .studio-nav {
    grid-template-columns: 1fr;
  }

  .studio-actions {
    flex-direction: column;
  }

  .studio-actions .ghost-button,
  .studio-actions .download-link {
    width: 100%;
  }

  .studio-spotlight-actions {
    flex-direction: column;
  }

  .studio-spotlight-actions .ghost-button,
  .studio-spotlight-actions .download-link {
    width: 100%;
  }
}

/* Audiobookshelf-inspired application layout */
body.studio-page {
  background: #090a0c;
  color: #f4f5f7;
}

.studio-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  grid-template-columns: 244px minmax(0, 1fr);
  border: 0;
  border-radius: 0;
  background: #111317;
  box-shadow: none;
}

.studio-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  gap: 36px;
  border-color: #292c32;
  background: #0b0d10;
  padding: 26px 18px;
}

.studio-brand {
  min-height: 42px;
  color: #f8f8f8;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.studio-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f47b20;
  color: #17100a;
}

.studio-nav {
  gap: 5px;
}

.studio-nav-item {
  min-height: 46px;
  gap: 13px;
  border-radius: 7px;
  color: #a9adb5;
  font-size: 0.95rem;
  font-weight: 650;
  transition: background 150ms ease, color 150ms ease;
}

.studio-nav-item svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.studio-nav-item:hover {
  background: #191c21;
  color: #fff;
}

.studio-nav-item-active {
  background: rgba(244, 123, 32, 0.14);
  color: #ff9343;
}

.studio-main {
  min-width: 0;
  padding: 32px clamp(22px, 4vw, 56px) 56px;
}

.studio-header {
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid #292c32;
}

.studio-header h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  letter-spacing: -0.035em;
}

.studio-page .eyebrow {
  margin-bottom: 5px;
  color: #f47b20;
}

.studio-page .library-count {
  margin-top: 7px;
  color: #8d929c;
  font-size: 0.84rem;
  font-weight: 600;
}

.studio-page .ghost-button {
  border-color: #30343b;
  border-radius: 7px;
  background: #191c21;
  color: #d8dae0;
}

.studio-page .ghost-button:hover {
  border-color: #f47b20;
  color: #fff;
}

.studio-page .search-bar {
  border-color: #2a2e35;
  border-radius: 9px;
  background: #171a1f;
}

.studio-page .search-bar input,
.studio-page .search-bar select {
  border-color: #30343b;
  border-radius: 6px;
  background: #0f1115;
}

.studio-page .search-bar button,
.studio-page .download-link {
  border-radius: 6px;
  background: #f47b20;
  color: #180e06;
}

.studio-page .search-bar button:hover,
.studio-page .download-link:hover {
  background: #ff9141;
}

.studio-spotlight-card,
.studio-tile {
  border-color: #2b2f36;
  border-radius: 10px;
  background: #181b20;
}

.studio-tile {
  transition: border-color 150ms ease, transform 150ms ease;
}

.studio-tile:hover {
  border-color: #454b55;
  transform: translateY(-2px);
}

.studio-cover {
  border-radius: 6px;
}

.studio-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px;
}

.studio-browser,
.browse-grid,
.collections-grid {
  min-width: 0;
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 192px);
  justify-content: center;
  gap: 34px 26px;
}

.browse-card {
  min-width: 0;
  width: 192px;
  display: block;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-decoration: none;
}

.browse-card:hover {
  background: transparent;
}

.browse-card-cover {
  width: 192px;
  height: 192px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 5px;
  background: #292d34;
  box-shadow: 0 4px 13px rgba(0, 0, 0, 0.4);
}

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

.browse-card-copy {
  min-width: 0;
  padding-top: 10px;
}

.browse-card h3,
.browse-card p,
.collection-card h3,
.collection-card p {
  margin: 0;
}

.browse-card h3 {
  overflow: hidden;
  color: #f5f6f8;
  font-size: 0.95rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browse-card p,
.collection-card p {
  margin-top: 3px;
  color: #9297a0;
  font-size: 0.84rem;
}

.browse-card-kind {
  display: block;
  margin-bottom: 3px;
  color: #f47b20;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.browse-card-arrow {
  display: none;
}

.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 260px);
  justify-content: center;
  gap: 32px 26px;
}

.collection-card {
  width: 260px;
  overflow: hidden;
  border: 1px solid #292d34;
  border-radius: 10px;
  background: #171a1f;
  color: inherit;
  padding-bottom: 18px;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease;
}

.collection-card:hover {
  border-color: #555b66;
  transform: translateY(-2px);
}

.collection-card > div:last-child {
  padding: 16px 18px 0;
}

.collection-card h3 {
  font-size: 1.08rem;
}

.collection-covers {
  height: 170px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  background: #22262c;
}

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

.studio-page .empty-state {
  border-color: #3a3f48;
  background: #171a1f;
}

@media (max-width: 820px) {
  .studio-shell {
    grid-template-columns: 1fr;
  }

  .studio-rail {
    position: static;
    height: auto;
    gap: 16px;
    padding: 14px 16px 12px;
  }

  .studio-brand {
    min-height: 34px;
  }

  .studio-nav {
    display: flex;
    max-width: 100%;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: thin;
  }

  .studio-nav-item {
    min-height: 40px;
    flex: 0 0 auto;
    padding: 0 12px;
  }

  .studio-main {
    padding: 22px 16px 40px;
  }
}

@media (max-width: 560px) {
  .studio-nav-item {
    gap: 8px;
  }

  .studio-header .header-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .browse-grid,
  .collections-grid {
    grid-template-columns: 1fr;
  }
}

/* Reference-scale shell: matches Audiobookshelf's compact rail and cover grid. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.studio-shell {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr);
  background: linear-gradient(115deg, #353636, #202121 72%);
}

.studio-topbar {
  position: sticky;
  z-index: 60;
  top: 0;
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 265px minmax(240px, 400px) 1fr;
  align-items: center;
  gap: 18px;
  height: 64px;
  border-bottom: 1px solid #161717;
  background: #222323;
  box-shadow: 0 4px 13px rgba(0, 0, 0, 0.28);
  padding: 0 28px;
}

.studio-topbar .studio-brand {
  min-height: 0;
  gap: 14px;
  font-size: 1.25rem;
  font-weight: 700;
}

.studio-topbar .studio-brand-mark {
  width: 42px;
  height: 42px;
  border: 2px solid #fff;
  background: #c99542;
  color: #fff;
  font-size: 1.15rem;
}

.studio-top-search {
  height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  border: 1px solid #50545a;
  border-radius: 5px;
  background: #202124;
}

.studio-top-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f1f2f3;
  padding: 0 13px;
}

.studio-top-search input::placeholder {
  color: #a5a9b0;
}

.studio-top-search button {
  border: 0;
  background: transparent;
  color: #adb3bd;
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
}

.studio-topbar .header-actions {
  justify-self: end;
}

.studio-topbar .ghost-button {
  min-height: 40px;
  border-color: #555a61;
  background: transparent;
  font-size: 0.82rem;
  padding: 0 13px;
}

.studio-rail {
  position: sticky;
  z-index: 40;
  top: 64px;
  grid-column: 1;
  grid-row: 2;
  width: 80px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  background: #353636;
  padding: 0;
}

.studio-nav {
  display: block;
}

.studio-nav-item {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 0;
  color: #e0e0e0;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 0 4px;
}

.studio-nav-item svg {
  width: 25px;
  height: 25px;
  stroke-width: 1.9;
}

.studio-nav-item:hover {
  background: #414242;
}

.studio-nav-item-active {
  background: #303131;
  color: #fff;
}

.studio-nav-item-active::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #ffd000;
  content: "";
}

.studio-main {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  padding: 0 0 56px;
}

.studio-header {
  min-height: 40px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin: 0;
  border: 0;
  background: #373838;
  box-shadow: 0 4px 11px rgba(0, 0, 0, 0.32);
  padding: 4px 28px;
}

.studio-header h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.studio-header .library-count {
  margin: 0;
  color: #f2f2f2;
  font-size: 0.9rem;
}

.studio-header .library-count span {
  margin-left: 8px;
  color: #9ea2a8;
  font-size: 0.75rem;
}

.studio-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-controls label {
  color: #c9cbd0;
  font-size: 0.78rem;
}

.studio-controls select {
  width: 240px;
  height: 32px;
  border: 1px solid #666a70;
  border-radius: 5px;
  background: #343638;
  color: #f5f5f5;
  padding: 0 10px;
}

.studio-library {
  display: block;
  padding: 18px 28px;
}

.studio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 192px);
  justify-content: center;
  gap: 34px 26px;
}

.studio-tile {
  position: relative;
  width: 192px;
  display: block;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  transition: none;
}

.studio-tile:hover {
  border-color: transparent;
  transform: none;
}

.studio-cover {
  width: 192px;
  height: 192px;
  aspect-ratio: 1;
  border-radius: 5px;
  box-shadow: 0 4px 13px rgba(0, 0, 0, 0.4);
}

.studio-copy {
  min-width: 0;
  padding-top: 11px;
}

.studio-copy h3 {
  overflow: hidden;
  color: #f1f1f1;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-author {
  overflow: hidden;
  margin-top: 5px !important;
  color: #a9adb4;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-meta,
.studio-rating {
  display: none;
}

.studio-actions {
  position: absolute;
  z-index: 2;
  top: 9px;
  right: 9px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.studio-tile:focus-within .studio-actions,
.studio-tile:hover .studio-actions {
  opacity: 1;
}

.studio-actions .ghost-button,
.studio-actions .download-link {
  width: auto;
  min-width: 78px;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(20, 21, 22, 0.88);
  color: #fff;
  font-size: 0.74rem;
  padding: 0 9px;
}

.studio-actions .download-link:hover {
  background: #f47b20;
}

.studio-browser {
  padding: 0 10px;
}

@media (max-width: 1100px) {
  .studio-grid {
    grid-template-columns: repeat(auto-fill, 170px);
    gap: 30px 22px;
  }

  .studio-tile,
  .studio-cover {
    width: 170px;
  }

  .studio-cover {
    height: 170px;
  }

  .browse-grid {
    grid-template-columns: repeat(auto-fill, 170px);
    gap: 30px 22px;
  }

  .browse-card,
  .browse-card-cover {
    width: 170px;
  }

  .browse-card-cover {
    height: 170px;
  }
}

@media (max-width: 980px) {
  .studio-topbar {
    grid-template-columns: auto minmax(180px, 1fr) auto;
    padding: 0 16px;
  }

  .studio-topbar .studio-brand > span:last-child,
  .studio-topbar .header-actions form:first-child {
    display: none;
  }

  .studio-topbar .studio-brand {
    width: 48px;
  }

  .studio-header {
    grid-template-columns: auto 1fr auto;
    padding-inline: 22px;
  }

  .studio-header .library-count span {
    display: none;
  }

  .studio-controls select {
    width: 170px;
  }
}

@media (max-width: 720px) {
  .studio-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 64px auto minmax(0, 1fr);
  }

  .studio-topbar {
    position: sticky;
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 9px;
    height: 64px;
    padding: 0 10px;
  }

  .studio-topbar .studio-brand,
  .studio-topbar .studio-brand-mark {
    width: 38px;
    height: 38px;
  }

  .studio-topbar .header-actions form:not(:last-child) {
    display: none;
  }

  .studio-topbar .header-actions,
  .studio-topbar .header-actions form,
  .studio-topbar .ghost-button {
    width: auto;
  }

  .studio-top-search {
    height: 38px;
    grid-template-columns: minmax(0, 1fr) 36px;
  }

  .studio-rail {
    position: sticky;
    top: 64px;
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    height: 62px;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0;
  }

  .studio-nav {
    width: 100%;
    height: 62px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    overflow: visible;
    padding: 0;
  }

  .studio-nav-item {
    width: auto;
    height: 62px;
    min-height: 62px;
    gap: 3px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 0;
    font-size: 0.64rem;
    padding: 0 2px;
  }

  .studio-nav-item svg {
    width: 21px;
    height: 21px;
  }

  .studio-nav-item-active::before {
    inset: auto 0 0 0;
    width: auto;
    height: 3px;
  }

  .studio-main {
    grid-column: 1;
    grid-row: 3;
    padding: 0 0 40px;
  }

  .studio-header {
    min-height: 48px;
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 6px 14px;
  }

  .studio-header .library-count {
    font-size: 0.75rem;
  }

  .studio-controls {
    grid-column: 1 / -1;
  }

  .studio-controls label {
    display: none;
  }

  .studio-controls select {
    width: 100%;
  }

  .studio-library {
    padding: 16px 12px;
  }

  .studio-grid {
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 28px 14px;
  }

  .studio-tile,
  .studio-cover {
    width: 100%;
  }

  .studio-cover {
    height: auto;
  }

  .studio-actions {
    opacity: 1;
  }

  .studio-actions .ghost-button,
  .studio-actions .download-link {
    min-width: 68px;
  }

  .browse-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 14px;
  }

  .browse-card,
  .browse-card-cover {
    width: 100%;
  }

  .browse-card-cover {
    height: auto;
  }

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

  .collection-card {
    width: 100%;
  }
}
