.avatar { position: relative; flex: 0 0 auto; overflow: hidden; aspect-ratio: 1; }
.avatar img { position: absolute; inset: 0; display: block; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; object-position: center top; border-radius: 50%; }
.profile-detail-card .avatar { width: 56px; height: 56px; }
.profile-avatar-picker { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; }
.profile-avatar-picker > span:last-of-type { color: var(--lime); font-size: 9px; }
.cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover, .book-detail-cover .cover, .home-continuation .cover { aspect-ratio: 1; border: 1px solid rgba(255, 255, 255, .28); border-radius: 4px; box-shadow: 0 8px 18px #0006; }
.cover::before { content: ''; position: absolute; z-index: 2; inset: 0 auto 0 0; width: 9px; background: linear-gradient(90deg, rgba(255,255,255,.38), rgba(0,0,0,.24), rgba(255,255,255,.12)); pointer-events: none; }
.cover::after { content: ''; position: absolute; z-index: 2; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.22), transparent 28%, transparent 72%, rgba(255,255,255,.05)); pointer-events: none; }
.cover .book-play, .cover .cover-pip, .cover .progress-line { z-index: 3; }
html[data-theme="light"] .cover { border-color: rgba(65, 70, 62, .38); box-shadow: 0 7px 16px rgba(45, 50, 42, .24); }
.podcast-card { position: relative; padding: 0; overflow: hidden; }
.podcast-card-open { display: flex; width: 100%; flex-direction: column; align-items: flex-start; gap: 7px; padding: 10px; border: 0; background: transparent; color: inherit; text-align: left; }
.podcast-card-open > b { padding-right: 28px; font: 600 12px Manrope; line-height: 1.4; }
.podcast-card-open > span:not(.podcast-cover), .podcast-card-open > small { color: #9b9da5; font-size: 9px; }
.podcast-delete-button { position: absolute; right: 16px; top: 16px; display: grid; place-items: center; width: 29px; height: 29px; padding: 0; border: 1px solid #493438; border-radius: 50%; background: #251a1de8; color: #ef8e83; font-size: 14px; }
.podcast-delete-button:hover { background: #a83d3d; color: white; }
.podcast-cover { position: relative; border: 1px solid rgba(255, 255, 255, .28); border-radius: 4px; box-shadow: 0 7px 16px #0005; }
.podcast-cover::before { content: ''; position: absolute; z-index: 2; inset: 0 auto 0 0; width: 9px; background: linear-gradient(90deg, rgba(255,255,255,.38), rgba(0,0,0,.24), rgba(255,255,255,.12)); pointer-events: none; }
.podcast-cover::after { content: ''; position: absolute; z-index: 2; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.22), transparent 28%, transparent 72%, rgba(255,255,255,.05)); pointer-events: none; }
html[data-theme="light"] .podcast-cover { border-color: rgba(65, 70, 62, .38); box-shadow: 0 6px 14px rgba(45, 50, 42, .22); }

html[data-theme="light"] .admin-section { color: #252a23; }
html[data-theme="light"] .admin-section > .muted,
html[data-theme="light"] .admin-user .muted { color: #535b50; }
html[data-theme="light"] .admin-create-user,
html[data-theme="light"] .admin-user {
  background: #fff;
  border-color: #8a9185;
  box-shadow: 0 1px 3px rgba(35, 42, 32, .08);
  color: #252a23;
}
html[data-theme="light"] .admin-create-user h3,
html[data-theme="light"] .admin-user-heading b { color: #252a23; }
html[data-theme="light"] .admin-create-user label,
html[data-theme="light"] .admin-user label {
  color: #30362d;
  font-size: 11px;
  font-weight: 600;
}
html[data-theme="light"] .admin-create-user input[type="text"],
html[data-theme="light"] .admin-create-user input[type="password"],
html[data-theme="light"] .admin-user input[type="password"] {
  width: 100%;
  min-height: 40px;
  margin-top: 7px;
  padding: 9px 11px;
  border: 1px solid #737b6e;
  border-radius: 6px;
  background: #fff;
  color: #20251f;
  outline: none;
}
html[data-theme="light"] .admin-create-user input:focus,
html[data-theme="light"] .admin-user input:focus {
  border-color: #58751f;
  box-shadow: 0 0 0 3px rgba(120, 155, 45, .2);
}
html[data-theme="light"] .admin-create-user input::placeholder,
html[data-theme="light"] .admin-user input::placeholder { color: #626a5f; }
html[data-theme="light"] .admin-section .collection-picker {
  background: #f4f6f0;
  border-color: #8a9185;
}
html[data-theme="light"] .admin-section .collection-picker legend { color: #3d453a; }
html[data-theme="light"] .admin-section .collection-choice {
  background: #fff;
  border-color: #8a9185;
  color: #30362d;
}
html[data-theme="light"] .admin-section .collection-choice span { color: #30362d; }
html[data-theme="light"] .admin-section .button:not(.primary) {
  background: #fff;
  border-color: #737b6e;
  color: #30362d;
}
html[data-theme="light"] .admin-section .button:not(.primary):hover { background: #e8ece3; }
html[data-theme="light"] .admin-section .button.danger {
  border-color: #a33838;
  color: #8b2020;
}
@media (max-width: 620px) {
  .admin-user-actions { align-items: stretch; flex-direction: column; }
  .admin-user-actions label, .admin-user-actions .button { width: 100%; min-width: 0; }
}

.admin-user-table-wrap { margin-top: 20px; overflow-x: auto; border: 1px solid #303138; border-radius: 9px; }
.admin-user-table { width: 100%; border-collapse: collapse; background: #17181c; text-align: left; }
.admin-user-table th { padding: 11px 14px; border-bottom: 1px solid #303138; color: #92949d; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.admin-user-table td { padding: 13px 14px; border-bottom: 1px solid #292b31; vertical-align: top; font-size: 12px; }
.admin-user-table tr:last-child td { border-bottom: 0; }
.admin-user-table td:first-child { width: 22%; }
.admin-user-table td:nth-child(2) { width: 25%; }
.admin-user-table td:nth-child(2) small { display: block; margin-top: 5px; color: #92949d; font-size: 9px; }
.access-pill { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 700; }
.access-pill.admin { background: #34451d; color: #d5f68e; }
.access-pill.user { background: #292b31; color: #c6c8cf; }
.admin-row-actions { display: flex; align-items: flex-start; gap: 7px; flex-wrap: wrap; }
.admin-action { position: relative; }
.admin-action > summary { display: flex; align-items: center; list-style: none; user-select: none; }
.admin-action > summary::-webkit-details-marker { display: none; }
.admin-action[open] > summary { border-color: var(--lime); color: var(--lime); }
.admin-action-panel { display: flex; flex-direction: column; gap: 11px; min-width: 340px; margin-top: 8px; padding: 12px; border: 1px solid #3a3c43; border-radius: 8px; background: #1d1f24; }
.admin-action-panel > .muted { margin: 0; font-size: 10px; }
.admin-action-panel > .button { align-self: flex-start; }
.admin-action-panel label { color: #c1c2c8; font-size: 10px; font-weight: 600; }
.admin-action-panel input[type="password"] { display: block; width: 100%; min-height: 38px; margin-top: 7px; padding: 9px 10px; border: 1px solid #454850; border-radius: 6px; background: #111216; color: #ecebe7; }

html[data-theme="light"] .admin-user-table-wrap { border-color: #8a9185; }
html[data-theme="light"] .admin-user-table { background: #fff; color: #252a23; }
html[data-theme="light"] .admin-user-table th { border-color: #8a9185; background: #eef1ea; color: #4e564b; }
html[data-theme="light"] .admin-user-table td { border-color: #c9cec4; }
html[data-theme="light"] .admin-user-table td:nth-child(2) small { color: #535b50; }
html[data-theme="light"] .access-pill.admin { background: #dcebc4; color: #334c12; }
html[data-theme="light"] .access-pill.user { background: #e5e8e1; color: #343a31; }
html[data-theme="light"] .admin-action-panel { background: #f4f6f0; border-color: #737b6e; }
html[data-theme="light"] .admin-action-panel label { color: #30362d; }
html[data-theme="light"] .admin-action-panel input[type="password"] { background: #fff; border-color: #737b6e; color: #20251f; }

@media (max-width: 720px) {
  .admin-user-table { min-width: 620px; }
  .admin-action-panel { min-width: 280px; }
}

.user-access-dialog { width: min(680px, calc(100% - 28px)); }
.user-access-dialog > .muted { margin: 10px 0 20px; font-size: 11px; }
.user-access-dialog section { margin: 0 0 20px; padding: 14px; border: 1px solid #34373d; border-radius: 8px; background: #15161a; }
.user-access-dialog section h3 { margin: 0 0 11px; font: 600 13px Manrope; }
.access-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.access-section-heading h3 { margin: 0 !important; }
.access-section-heading label { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: #d5d7dc; font-size: 10px; font-weight: 700; }
.access-section-heading input { accent-color: var(--lime); }
.user-access-dialog .collection-choices { max-height: 210px; overflow-y: auto; }
html[data-theme="light"] .user-access-dialog section { border-color: #8a9185; background: #f4f6f0; }
html[data-theme="light"] .user-access-dialog section h3 { color: #252a23; }
html[data-theme="light"] .access-section-heading label { color: #30362d; }
.admin-promotion { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 6px; padding: 14px; border: 1px solid #603a3a; border-radius: 8px; background: #211719; }
.admin-promotion > div { display: flex; flex-direction: column; gap: 4px; }
.admin-promotion b { font-size: 11px; }
.admin-promotion span { color: #aaa0a2; font-size: 9px; line-height: 1.4; }
html[data-theme="light"] .admin-promotion { border-color: #a33838; background: #fff4f2; }
html[data-theme="light"] .admin-promotion b { color: #682020; }
html[data-theme="light"] .admin-promotion span { color: #655354; }
.admin-heading-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.create-user-dialog > .muted { margin: 10px 0 18px; font-size: 11px; line-height: 1.5; }
.create-user-dialog form { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 620px) {
  .admin-section > .section-heading { align-items: flex-start; gap: 12px; }
  .admin-heading-actions { justify-content: flex-start; }
  .admin-promotion { align-items: stretch; flex-direction: column; }
}
