:root {
  color-scheme: light;
  overflow-x: clip;
  --system-blue: #007aff;
  --system-green: #248a3d;
  --system-red: #d92d20;
  --page: #f2f2f7;
  --surface: #ffffff;
  --surface-secondary: #f2f2f7;
  --label: #1c1c1e;
  --label-secondary: #5f636b;
  --label-tertiary: #777a82;
  --separator: rgba(60, 60, 67, 0.18);
  --fill: rgba(120, 120, 128, 0.12);
  --blue-tint: rgba(0, 122, 255, 0.1);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.07);
  --player-height: 112px;
  --font-system: "UKIJ Ekran", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-family: var(--font-system);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --system-blue: #0a84ff;
  --system-green: #30d158;
  --system-red: #ff453a;
  --page: #000000;
  --surface: #1c1c1e;
  --surface-secondary: #2c2c2e;
  --label: #ffffff;
  --label-secondary: #c2c2c8;
  --label-tertiary: #98989f;
  --separator: rgba(84, 84, 88, 0.72);
  --fill: rgba(120, 120, 128, 0.28);
  --blue-tint: rgba(10, 132, 255, 0.18);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body { margin: 0; min-width: 320px; background: var(--page); color: var(--label); }
button, input { font: inherit; }
button { color: inherit; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid color-mix(in srgb, var(--system-blue) 55%, transparent); outline-offset: 2px; }
button:disabled, input:disabled { cursor: not-allowed; opacity: 0.45; }

.app-shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: calc(26px + env(safe-area-inset-top, 0px)) 16px 20px;
  display: flex;
  flex-direction: column;
  background: var(--page);
  border-inline-end: 1px solid var(--separator);
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; }
.brand { min-height: 48px; padding: 0; display: inline-flex; align-items: center; gap: 11px; text-align: start; background: transparent; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--system-blue); color: #fff; font-size: 23px; font-weight: 700; }
.brand strong { display: block; font-size: 17px; line-height: 21px; font-weight: 700; }
.brand small { display: block; margin-top: 1px; color: var(--label-secondary); font-size: 13px; line-height: 17px; }
.theme-toggle { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 22px; color: var(--system-blue); background: transparent; font-size: 21px; }
.theme-toggle:hover { background: var(--fill); }
.sidebar-section { margin-top: 44px; }
.sidebar-section-heading { min-height: 32px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; color: var(--label-secondary); font-size: 13px; font-weight: 600; }
.sidebar-section-heading span:last-child { color: var(--label-tertiary); font-weight: 400; }
.resource-nav { display: grid; gap: 4px; margin-top: 6px; }
.resource-nav-item {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  color: var(--label);
  background: transparent;
  text-align: start;
  font-size: 15px;
  transition: background-color 160ms ease, color 160ms ease;
}
.resource-nav-item:hover { background: var(--fill); }
.resource-nav-item.is-active { color: var(--system-blue); background: var(--blue-tint); font-weight: 600; }
.resource-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent, var(--system-blue)); }
.history-nav-icon { width: 10px; color: var(--system-blue); font-size: 17px; line-height: 1; }
.nav-arrow { color: var(--label-tertiary); font-size: 22px; line-height: 1; text-align: end; transform: rotate(180deg); }
.nav-count { color: var(--label-tertiary); font-size: 12px; line-height: 1; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; text-align: end; }
.sidebar-note { margin-top: auto; padding: 12px 10px; display: flex; align-items: center; gap: 9px; color: var(--label-secondary); font-size: 13px; }
.note-icon { color: var(--system-blue); font-size: 18px; }

.main-content { width: 100%; max-width: 1320px; min-width: 0; margin: 0 auto; padding: 48px clamp(24px, 4vw, 64px) calc(var(--player-height) + 42px); }
.page-heading { position: relative; margin-bottom: 40px; }
.eyebrow { margin-bottom: 5px; color: var(--label-secondary); font-size: 15px; line-height: 20px; font-weight: 500; }
.page-heading h1 { margin: 0; font-size: 34px; line-height: 41px; font-weight: 700; }
.page-subtitle { margin: 5px 0 0; color: var(--label-secondary); font-size: 15px; line-height: 21px; }
.section-block { margin-top: 28px; }
.section-heading { min-height: 44px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.section-heading h2 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 700; }
.section-heading p { margin: 3px 0 0; color: var(--label-secondary); font-size: 13px; line-height: 18px; }
.history-all-link { min-width: 44px; min-height: 44px; padding: 0 8px; border-radius: 8px; background: transparent; color: var(--system-blue); font-size: 15px; }
.history-all-link:hover { background: var(--blue-tint); }
.history-clear-button { min-height: 44px; padding: 0 10px; display: inline-flex; align-items: center; gap: 7px; border-radius: 8px; color: var(--system-red); background: transparent; font-size: 14px; }
.history-clear-button:hover:not(:disabled), .history-delete-button:hover { background: color-mix(in srgb, var(--system-red) 10%, transparent); }
.history-clear-button svg, .history-delete-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.history-list { overflow: hidden; border: 1px solid var(--separator); border-radius: 12px; background: var(--surface); }
.history-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; border-bottom: 1px solid var(--separator); background: var(--surface); }
.history-row:last-child { border-bottom: 0; }
.history-row.has-delete { grid-template-columns: minmax(0, 1fr) 48px; }
.history-row-play { width: 100%; min-width: 0; min-height: 76px; padding: 9px 14px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 24px; align-items: center; gap: 12px; background: transparent; text-align: start; transition: background-color 140ms ease; }
.history-row-play:hover { background: var(--blue-tint); }
.history-delete-button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; color: var(--system-red); background: transparent; }
.history-art { position: relative; width: 44px; height: 56px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: var(--surface-secondary); color: var(--label-secondary); }
.history-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.history-art > span { display: none; font-size: 19px; font-weight: 600; }
.history-art.is-fallback > span { display: grid; }
.history-copy { min-width: 0; display: grid; gap: 4px; }
.history-copy strong, .history-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-copy strong { color: var(--label); font-size: 15px; line-height: 20px; font-weight: 600; }
.history-copy small { color: var(--label-secondary); font-size: 12px; line-height: 17px; }
.history-time { color: var(--label-tertiary); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.history-play { color: var(--system-blue); font-size: 14px; text-align: center; }
.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.resource-card {
  width: 100%;
  min-height: 108px;
  padding: 16px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--separator);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: start;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.resource-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
.resource-card:active, .novel-card:active, .episode-row:active { transform: scale(0.985); }
.resource-glyph { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--accent, var(--system-blue)) 14%, var(--surface)); color: var(--accent, var(--system-blue)); font-size: 22px; font-weight: 650; }
.resource-card-content { min-width: 0; display: grid; gap: 3px; }
.resource-card-content strong { overflow: hidden; color: var(--label); font-size: 16px; line-height: 21px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.resource-card-content small { overflow: hidden; color: var(--label-secondary); font-size: 13px; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
.resource-card-content > span { overflow: hidden; color: var(--label-tertiary); font-size: 12px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.resource-chevron { color: var(--label-tertiary); font-size: 24px; line-height: 1; text-align: end; transform: rotate(180deg); }

.back-button { min-height: 44px; margin: 0 0 14px; margin-inline-start: -8px; padding: 0 8px; display: inline-flex; align-items: center; gap: 4px; border-radius: 8px; color: var(--system-blue); background: transparent; font-size: 16px; }
.back-button:hover { background: var(--blue-tint); }
.back-button > span:first-child { font-size: 30px; line-height: 1; }
.list-view .page-heading { margin-bottom: 30px; }
.apsun-tabs { margin-bottom: 18px; display: flex; gap: 14px; overflow-x: auto; border-bottom: 1px solid var(--separator); scrollbar-width: none; }
.apsun-tabs::-webkit-scrollbar { display: none; }
.apsun-tab { min-height: 46px; margin-bottom: -1px; padding: 0 6px; flex: 0 0 auto; border-bottom: 2px solid transparent; background: transparent; color: var(--label-secondary); font-size: 14px; font-weight: 500; white-space: nowrap; }
.apsun-tab:hover { color: var(--system-blue); }
.apsun-tab.is-active { border-bottom-color: var(--system-blue); color: var(--system-blue); font-weight: 600; }
.list-tools { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.search-box { width: min(460px, 100%); min-height: 44px; padding: 0 12px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--separator); border-radius: 10px; background: var(--surface); color: var(--label-secondary); }
.search-box > span { font-size: 23px; line-height: 1; }
.search-box input { width: 100%; min-width: 0; height: 42px; border: 0; outline: 0; background: transparent; color: var(--label); font-size: 15px; }
.search-box input::placeholder { color: var(--label-tertiary); }
.search-box:focus-within { border-color: var(--system-blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.result-count { flex: 0 0 auto; color: var(--label-secondary); font-size: 13px; }
.novel-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px 14px; }
.novel-card { min-width: 0; padding: 0; display: block; overflow: hidden; border: 1px solid var(--separator); border-radius: 12px; background: var(--surface); text-align: start; box-shadow: var(--shadow-card); transition: transform 160ms ease, box-shadow 160ms ease; }
.novel-card:hover { box-shadow: 0 5px 16px rgba(0, 0, 0, 0.12); }
.cover { position: relative; width: 100%; aspect-ratio: 0.74; display: grid; place-items: center; overflow: hidden; border-radius: 0; background: var(--surface-secondary); color: var(--label-secondary); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover > span { position: relative; font-size: 50px; line-height: 1; font-weight: 600; opacity: 0.48; }
.cover-fallback { background: var(--surface-secondary); }
.novel-card-content { min-height: 82px; padding: 11px 12px 12px; display: grid; align-content: start; gap: 4px; }
.novel-card-content strong { overflow-wrap: anywhere; color: var(--label); font-size: 15px; line-height: 20px; font-weight: 600; text-overflow: clip; white-space: normal; }
.novel-card-content small { overflow: hidden; color: var(--label-secondary); font-size: 12px; line-height: 17px; text-overflow: ellipsis; white-space: nowrap; }
.novel-meta { margin-top: 3px; color: var(--label-tertiary); font-size: 12px; line-height: 16px; }
.list-pagination { margin-top: 22px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.list-page-button { min-width: 100px; min-height: 44px; padding: 0 12px; border: 1px solid var(--separator); border-radius: 8px; background: var(--surface); color: var(--system-blue); font-size: 14px; }
.list-page-button:hover:not(:disabled) { background: var(--blue-tint); }
.list-page-number { min-width: 56px; color: var(--label-secondary); font-size: 14px; text-align: center; font-variant-numeric: tabular-nums; }

.detail-heading { margin-bottom: 22px; }
.book-hero { padding: 24px; display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: center; gap: 24px; border: 1px solid var(--separator); border-radius: 16px; background: var(--surface); }
.hero-cover { width: 180px; border-radius: 12px; box-shadow: var(--shadow-card); }
.book-hero-copy h1 { margin: 0; font-size: 28px; line-height: 34px; font-weight: 700; overflow-wrap: anywhere; }
.book-hero-copy p { margin: 8px 0 0; color: var(--label-secondary); font-size: 15px; line-height: 21px; }
.book-facts { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--label-secondary); font-size: 13px; line-height: 18px; }
.episode-section { margin-top: 34px; }
.episode-list { overflow: hidden; border: 1px solid var(--separator); border-radius: 12px; background: var(--surface); }
.episode-row { width: 100%; min-height: 64px; padding: 8px 16px; display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; align-items: center; gap: 12px; border-bottom: 1px solid var(--separator); background: var(--surface); text-align: start; transition: background-color 140ms ease, transform 140ms ease; }
.episode-row:last-child { border-bottom: 0; }
.episode-row:hover, .episode-row.is-playing { background: var(--blue-tint); }
.episode-number { color: var(--label-tertiary); font-size: 13px; font-variant-numeric: tabular-nums; text-align: center; }
.episode-copy { min-width: 0; display: grid; gap: 3px; }
.episode-copy strong { overflow: hidden; color: var(--label); font-size: 15px; line-height: 20px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.episode-copy small { overflow: hidden; color: var(--label-secondary); font-size: 12px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.episode-row.is-played .episode-number, .episode-row.is-played .episode-copy small, .episode-row.is-played .episode-play { color: var(--system-green); }
.episode-row.is-played .episode-play { font-weight: 700; }
.episode-row.is-playing .episode-copy strong, .episode-row.is-playing .episode-play { color: var(--system-blue); }
.episode-play { color: var(--system-blue); font-size: 16px; text-align: center; }

.loading-state, .empty-state { min-height: 140px; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--label-secondary); text-align: center; font-size: 14px; }
.empty-state { grid-column: 1 / -1; min-height: 220px; border: 1px solid var(--separator); border-radius: 12px; background: var(--surface); }
.empty-state strong { color: var(--label); font-size: 17px; line-height: 22px; font-weight: 600; }
.empty-state > span:last-child { font-size: 13px; line-height: 18px; }
.empty-symbol { color: var(--label-tertiary); font-size: 32px; line-height: 36px; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--fill); border-top-color: var(--system-blue); border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-banner { margin: 0 0 20px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--system-red) 26%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--system-red) 9%, var(--surface)); color: var(--system-red); font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }

.player {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: var(--player-height);
  padding: 12px max(24px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(380px, 1.6fr) minmax(220px, 1fr);
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  border-top: 1px solid var(--separator);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--label);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(24px) saturate(1.7);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
}
.player-track { min-width: 0; display: flex; align-items: center; gap: 12px; }
.player-art { width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: var(--surface-secondary); color: var(--system-blue); font-size: 20px; font-weight: 600; box-shadow: var(--shadow-card); }
.player-art img { width: 100%; height: 100%; object-fit: cover; }
.player-track-copy { min-width: 0; }
.player-track-copy strong, .player-track-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-track-copy strong { color: var(--label); font-size: 14px; line-height: 19px; font-weight: 600; }
.player-track-copy small { margin-top: 3px; color: var(--label-secondary); font-size: 12px; line-height: 16px; }
.player-track-state { margin-top: 5px; display: flex; align-items: center; gap: 6px; color: var(--label-tertiary); font-size: 11px; line-height: 14px; }
.player-track-state i { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--label-tertiary); }
.player.is-playing .player-track-state i { background: var(--system-green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--system-green) 15%, transparent); }
.player-controls { min-width: 0; }
.player-control-row { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: clamp(2px, 0.8vw, 10px); }
.player-control, .player-icon-button, .player-rate, .player-queue-toggle { min-width: 44px; height: 44px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 22px; color: var(--label-secondary); background: transparent; font-size: 13px; font-weight: 600; transition: background-color 150ms ease, color 150ms ease, transform 150ms ease; }
.player-control svg, .player-icon-button svg, .player-queue-toggle svg, .player-queue-indicator svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.player-control:hover, .player-icon-button:hover, .player-rate:hover, .player-queue-toggle:hover { background: var(--fill); color: var(--label); }
.player-control:active, .player-icon-button:active, .player-rate:active, .player-queue-toggle:active { transform: scale(0.94); }
.player-control:disabled { color: var(--label-tertiary); cursor: not-allowed; opacity: 0.45; }
.player-skip { min-width: 42px; padding: 0 4px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.player-toggle { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--system-blue); box-shadow: 0 3px 9px color-mix(in srgb, var(--system-blue) 25%, transparent); transition: transform 150ms ease, filter 150ms ease; }
.player-toggle svg { width: 23px; height: 23px; fill: currentColor; }
.player-toggle:hover { filter: brightness(0.94); }
.player-toggle:active { transform: scale(0.94); }
.player-toggle:disabled { cursor: wait; }
.player-spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.45); border-top-color: #fff; border-radius: 50%; animation: spin 700ms linear infinite; }
.player-timeline { min-height: 24px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; align-items: center; gap: 8px; }
.player-timeline time { color: var(--label-tertiary); font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }
.player-progress { width: 100%; height: 28px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
.player-progress::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--system-blue) var(--progress-level, 0%), var(--fill) var(--progress-level, 0%)); }
.player-progress::-moz-range-track { height: 4px; border-radius: 4px; background: var(--fill); }
.player-progress::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--system-blue); }
.player-progress::-webkit-slider-thumb { width: 14px; height: 14px; margin-top: -5px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 50%; background: var(--system-blue); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.player-progress::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--system-blue); }
.player-progress:focus-visible, .player-volume:focus-visible { outline: 0; }
.player-progress:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--blue-tint); }
.player-message { margin: 2px 0 0; overflow: hidden; color: var(--system-red); font-size: 11px; line-height: 15px; text-overflow: ellipsis; white-space: nowrap; }
.player-extras { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.player-volume-control { min-width: 0; display: flex; align-items: center; gap: 3px; }
.player-volume-toggle { width: 40px; min-width: 40px; padding: 0; }
.player-volume { width: clamp(54px, 6vw, 84px); height: 28px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
.player-volume::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, var(--system-blue) var(--volume-level, 80%), var(--fill) var(--volume-level, 80%)); }
.player-volume::-moz-range-track { height: 3px; border-radius: 3px; background: var(--fill); }
.player-volume::-moz-range-progress { height: 3px; background: var(--system-blue); }
.player-volume::-webkit-slider-thumb { width: 11px; height: 11px; margin-top: -4px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 50%; background: var(--system-blue); }
.player-volume::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--system-blue); }
.player-rate { min-width: 48px; color: var(--system-blue); font-variant-numeric: tabular-nums; }
.player-queue-toggle { padding: 0 10px; }
.player-queue-toggle.is-active { color: var(--system-blue); background: var(--blue-tint); }
.player-empty { justify-self: end; color: var(--label-secondary); font-size: 13px; }
.player-ready-dot { width: 7px; height: 7px; margin-inline-end: 8px; display: inline-block; border-radius: 50%; background: var(--system-green); }
.player-queue { position: absolute; inset-inline-end: 20px; inset-block-end: calc(100% + 12px); width: min(380px, calc(100vw - 24px)); max-height: min(62vh, 560px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--separator); border-radius: 12px; background: var(--surface); color: var(--label); box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18); }
.player-queue-header { min-height: 64px; padding-block: 10px; padding-inline: 18px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--separator); }
.player-queue-header > div { min-width: 0; flex: 1 1 auto; }
.player-queue-header .player-icon-button { flex: 0 0 44px; }
.player-queue-header strong, .player-queue-header small { display: block; }
.player-queue-header strong { font-size: 15px; line-height: 20px; }
.player-queue-header small { margin-top: 2px; overflow: hidden; color: var(--label-secondary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.player-queue-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 8px; }
.player-queue-item { width: 100%; min-height: 56px; padding: 7px 8px; display: grid; grid-template-columns: 32px minmax(0, 1fr) 24px; align-items: center; gap: 10px; border-radius: 8px; color: var(--label); text-align: start; background: transparent; }
.player-queue-item:hover { background: var(--fill); }
.player-queue-item.is-current { color: var(--system-blue); background: var(--blue-tint); }
.player-queue-index { color: var(--label-tertiary); font-size: 12px; font-variant-numeric: tabular-nums; text-align: center; }
.player-queue-copy { min-width: 0; }
.player-queue-copy strong, .player-queue-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-queue-copy strong { font-size: 13px; line-height: 18px; font-weight: 500; }
.player-queue-copy small { margin-top: 2px; color: var(--label-tertiary); font-size: 11px; line-height: 15px; }
.player-queue-indicator svg { width: 16px; height: 16px; fill: currentColor; }
.player :focus-visible { outline: 2px solid var(--system-blue); outline-offset: 2px; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 228px minmax(0, 1fr); }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .novel-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .player { grid-template-columns: minmax(170px, 1fr) minmax(360px, 1.6fr) minmax(190px, 0.9fr); gap: 12px; }
}
@media (max-width: 840px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; z-index: 10; top: 0; width: 100%; height: auto; padding: calc(10px + env(safe-area-inset-top, 0px)) 20px 8px; display: block; border-inline-end: 0; border-bottom: 1px solid var(--separator); background: color-mix(in srgb, var(--page) 90%, transparent); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); }
  .sidebar-top { min-height: 48px; }
  .sidebar-section { margin-top: 7px; }
  .sidebar-section-heading, .sidebar-note { display: none; }
  .resource-nav { display: flex; gap: 6px; margin-top: 0; overflow-x: auto; scrollbar-width: none; }
  .resource-nav::-webkit-scrollbar { display: none; }
  .resource-nav-item { width: auto; min-width: max-content; min-height: 40px; padding: 0 12px; display: inline-flex; gap: 8px; border-radius: 20px; font-size: 14px; }
  .resource-nav-item .nav-arrow, .resource-nav-item .resource-dot { display: none; }
  .history-nav-icon { width: auto; font-size: 15px; }
  .main-content { padding: 32px 24px calc(var(--player-height) + 36px); }
  .page-heading { margin-bottom: 30px; }
  .novel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  :root { --player-height: 156px; }
  .player { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "track extras" "controls controls"; gap: 4px 12px; padding: 9px max(16px, env(safe-area-inset-right, 0px)) calc(9px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .player-track { grid-area: track; }
  .player-controls { grid-area: controls; display: grid; gap: 0; }
  .player-control-row { min-height: 44px; }
  .player-extras { grid-area: extras; }
  .player-volume { width: 56px; }
  .player-queue { inset-inline-end: 12px; }
  .player:not(.has-track) .player-empty { grid-area: extras; justify-self: end; }
}
@media (max-width: 600px) {
  :root { --player-height: 172px; }
  .sidebar { padding-right: 16px; padding-left: 16px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 21px; }
  .brand strong { font-size: 16px; }
  .main-content { padding: 26px 16px calc(var(--player-height) + 30px); }
  .page-heading { margin-bottom: 28px; }
  .page-heading h1 { font-size: 32px; line-height: 39px; }
  .page-subtitle { max-width: 34ch; }
  .section-block { margin-top: 24px; }
  .section-heading h2 { font-size: 20px; line-height: 26px; }
  .history-row.has-delete { grid-template-columns: minmax(0, 1fr) 44px; }
  .history-row-play { min-height: 68px; padding: 7px 10px; grid-template-columns: 38px minmax(0, 1fr) auto 20px; gap: 8px; }
  .history-art { width: 38px; height: 50px; }
  .history-copy strong { font-size: 14px; line-height: 19px; }
  .history-copy small, .history-time { font-size: 11px; }
  .resource-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .resource-card { min-height: 84px; padding: 12px; grid-template-columns: 48px minmax(0, 1fr) 18px; gap: 12px; }
  .resource-glyph { width: 48px; height: 48px; border-radius: 11px; font-size: 20px; }
  .resource-card-content > span { display: none; }
  .list-view .page-heading { margin-bottom: 22px; }
  .apsun-tabs { gap: 10px; margin-bottom: 14px; }
  .apsun-tab { min-height: 44px; padding: 0 4px; font-size: 13px; }
  .list-tools { align-items: flex-start; flex-direction: column; gap: 10px; }
  .search-box { width: 100%; }
  .novel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .list-pagination { gap: 8px; }
  .list-page-button { min-width: 92px; padding: 0 9px; font-size: 13px; }
  .novel-card-content { min-height: 76px; padding: 9px 10px 10px; }
  .novel-card-content strong { font-size: 14px; line-height: 19px; }
  .novel-card-content small, .novel-meta { font-size: 11px; }
  .book-hero { padding: 15px; grid-template-columns: 104px minmax(0, 1fr); align-items: start; gap: 14px; border-radius: 14px; }
  .hero-cover { width: 104px; border-radius: 10px; }
  .book-hero-copy { align-self: center; }
  .book-hero-copy .eyebrow { margin-bottom: 3px; font-size: 13px; }
  .book-hero-copy h1 { font-size: 20px; line-height: 26px; }
  .book-hero-copy p { margin-top: 5px; font-size: 13px; line-height: 18px; }
  .book-facts { margin-top: 11px; gap: 4px 10px; font-size: 11px; line-height: 15px; }
  .episode-section { margin-top: 26px; }
  .episode-row { min-height: 60px; padding: 7px 11px; grid-template-columns: 28px minmax(0, 1fr) 32px; gap: 8px; }
  .episode-number { font-size: 12px; }
  .episode-copy strong { font-size: 14px; }
  .player { min-height: var(--player-height); grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "track extras" "controls controls" "timeline timeline"; align-content: center; gap: 2px 8px; padding: 8px max(12px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
  .player-track { grid-area: track; gap: 8px; }
  .player-art { width: 40px; height: 40px; flex-basis: 40px; border-radius: 8px; }
  .player-track-copy strong { font-size: 13px; line-height: 17px; }
  .player-track-copy small { margin-top: 1px; font-size: 11px; }
  .player-track-state { display: none; }
  .player-controls { display: contents; }
  .player-control-row { grid-area: controls; min-height: 44px; gap: clamp(1px, 1vw, 6px); }
  .player-control, .player-icon-button, .player-rate, .player-queue-toggle { min-width: 40px; height: 40px; padding: 0 5px; }
  .player-control svg, .player-icon-button svg, .player-queue-toggle svg { width: 19px; height: 19px; }
  .player-skip { min-width: 38px; padding: 0 2px; font-size: 11px; }
  .player-toggle { width: 44px; height: 44px; flex-basis: 44px; }
  .player-rate { min-width: 42px; }
  .player-extras { grid-area: extras; gap: 1px; }
  .player-volume-control { gap: 0; }
  .player-volume { display: none; }
  .player-queue-toggle span { display: none; }
  .player-queue-toggle { width: 40px; }
  .player-timeline { grid-area: timeline; grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 5px; }
  .player-timeline time { font-size: 10px; }
  .player-message { grid-column: 1 / -1; }
  .player:not(.has-track) { min-height: 82px; grid-template-areas: "track extras"; }
  .player-queue { inset-inline: 0; inset-block-end: calc(100% + 8px); width: auto; max-height: 58vh; }
  .player-queue-header { min-height: 58px; }
}
@media (max-width: 360px) {
  .resource-nav-item { padding: 0 10px; font-size: 13px; }
  .player { padding-right: 10px; padding-left: 10px; }
  .player-control-row { gap: 1px; }
  .player-skip { min-width: 34px; font-size: 10px; }
  .player-control { min-width: 36px; }
  .player-toggle { width: 42px; height: 42px; flex-basis: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
