:root {
  color-scheme: dark;
  --bg: #0a0e13;
  --bg-soft: #0e141c;
  --panel: #121a24;
  --panel-2: #18222e;
  --line: #243243;
  --line-soft: #1b2634;
  --text: #e9eef6;
  --muted: #9cabc0;
  --accent: #e7b96a;
  --accent-strong: #f3d08c;
  --accent-ink: #1b1305;
  --danger: #ff9a9a;
  --ok: #8bd9ae;
  --radius: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background:
    radial-gradient(1200px 600px at 75% -10%, rgba(46, 78, 115, 0.24), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(120, 84, 35, 0.12), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 34px;
  height: 100vh;
  padding: 30px 22px 24px;
  border-right: 1px solid var(--line-soft);
  background: rgba(9, 13, 18, 0.78);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(231, 185, 106, 0.45);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(231, 185, 106, 0.2), rgba(231, 185, 106, 0.04));
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 20px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand small {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav a,
.nav-disabled {
  display: block;
  padding: 11px 14px;
  border-radius: 11px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
}

.nav a.is-active {
  background: linear-gradient(90deg, rgba(231, 185, 106, 0.16), rgba(231, 185, 106, 0.05));
  color: var(--accent-strong);
}

.nav-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(139, 217, 174, 0.12);
}

.account strong,
.account small {
  display: block;
  font-size: 13px;
}

.account small {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-button:hover {
  color: var(--text);
}

.main {
  width: 100%;
  max-width: 1440px;
  padding: 42px clamp(20px, 4.4vw, 64px) 80px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 38px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.lede {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
}

.page-head .lede {
  margin-top: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-strong);
  text-decoration: none;
}

.btn-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(231, 185, 106, 0.5);
  background: rgba(231, 185, 106, 0.08);
}

.btn-wide {
  width: 100%;
}

.section {
  margin-top: 42px;
}

.section:first-of-type {
  margin-top: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.section-head a {
  font-size: 13.5px;
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 22px;
}

.card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card a:hover {
  text-decoration: none;
}

.card-poster {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(160deg, #1a2533, #0d131b);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.card a:hover .card-poster img {
  transform: scale(1.035);
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(7, 11, 16, 0.72);
  color: #e7edf6;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.card-progress {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.card-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-strong);
}

.card-text {
  padding: 12px 2px 0;
}

.card-text h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-text p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert {
  display: grid;
  gap: 4px;
  margin-bottom: 26px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 154, 154, 0.34);
  border-radius: 14px;
  background: rgba(255, 154, 154, 0.08);
  color: #ffd9d9;
  font-size: 14px;
}

.alert code {
  color: #fff;
}

.empty {
  padding: 44px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.015);
  text-align: center;
}

.empty h3 {
  margin-bottom: 8px;
}

.empty p {
  margin-bottom: 18px;
  color: var(--muted);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumbs a {
  color: var(--muted);
}

.breadcrumbs a:hover {
  color: var(--text);
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(180px, 264px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 46px);
  align-items: start;
}

.detail-poster {
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: linear-gradient(160deg, #1a2533, #0d131b);
  box-shadow: var(--shadow);
}

.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info {
  padding-top: 8px;
}

.detail-info h1 {
  max-width: 900px;
  margin-bottom: 10px;
  font-size: clamp(30px, 3.6vw, 52px);
}

.detail-sub {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 15px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: #c9d5e4;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.overview {
  max-width: 76ch;
  margin-bottom: 0;
  color: #c4cfdd;
  font-size: 15px;
  line-height: 1.65;
}

.player-section {
  margin-top: 46px;
}

.player-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #05080b;
  box-shadow: var(--shadow);
}

.player-frame:not(.is-audio) {
  aspect-ratio: 16 / 9;
}

.player-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #05080b;
}

.player-frame.is-audio {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  padding: 22px;
  background:
    radial-gradient(600px 300px at 10% 0%, rgba(231, 185, 106, 0.12), transparent 70%),
    #0a0f15;
}

.audio-art {
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 14px;
  background: #0d131b;
}

.audio-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-frame audio {
  width: 100%;
}

.player-note {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 12.5px;
}

.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filters input[type="search"] {
  flex: 1 1 260px;
  min-width: 200px;
  max-width: 560px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
}

.filters .btn {
  min-height: 42px;
}

.mobile-filter-button {
  display: none;
}

.filters input::placeholder {
  color: #7f8ea3;
}

.segmented {
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.segmented a {
  padding: 8px 13px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.segmented a:hover {
  color: var(--text);
  text-decoration: none;
}

.segmented a.is-active {
  background: rgba(231, 185, 106, 0.16);
  color: var(--accent-strong);
}

.result-count {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 50;
  max-width: calc(100vw - 40px);
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 26, 36, 0.96);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Вход */
.login-body {
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-shell {
  width: 100%;
  max-width: 470px;
}

.login-card {
  padding: clamp(26px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(500px 250px at 100% 0%, rgba(231, 185, 106, 0.1), transparent 65%),
    rgba(18, 26, 36, 0.92);
  box-shadow: var(--shadow);
}

.login-card .brand {
  margin-bottom: 34px;
}

.login-card h1 {
  margin-bottom: 10px;
  font-size: 38px;
}

.login-card .lede {
  margin-bottom: 26px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #c9d5e4;
  font-size: 13px;
  font-weight: 650;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b1118;
  color: var(--text);
}

.field input:focus {
  border-color: rgba(231, 185, 106, 0.65);
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 12.5px;
}

.form-error {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 154, 154, 0.34);
  border-radius: 12px;
  background: rgba(255, 154, 154, 0.08);
  color: #ffd9d9;
  font-size: 13.5px;
}

.login-hint {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.login-hint code {
  color: #d8c7a5;
}

/* Доступ, роли и приглашения */
.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.messages .alert {
  margin-bottom: 0;
}

.alert-success {
  border-color: rgba(139, 217, 174, 0.34);
  background: rgba(139, 217, 174, 0.08);
  color: #d6f5e3;
}

.alert-info {
  border-color: rgba(142, 163, 192, 0.34);
  background: rgba(142, 163, 192, 0.08);
  color: #dbe6f5;
}

.alert-error,
.alert-danger {
  border-color: rgba(255, 154, 154, 0.34);
  background: rgba(255, 154, 154, 0.08);
  color: #ffd9d9;
}

.footer-link {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
}

.footer-link:hover {
  color: var(--text);
}

.guest-note {
  color: #cbb98f;
}

.btn-small {
  padding: 7px 10px;
  font-size: 12.5px;
}

.field select,
.field textarea,
.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b1118;
  color: var(--text);
}

.field select:focus,
.field textarea:focus,
.input:focus {
  border-color: rgba(231, 185, 106, 0.65);
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.access-card {
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.015);
}

.access-card .section-head {
  margin-bottom: 12px;
}

.access-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.access-note {
  margin: 16px 0 0;
  font-size: 12.5px;
}

.access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table form {
  margin: 0;
}

.status-pill {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-active {
  border-color: rgba(139, 217, 174, 0.28);
  background: rgba(139, 217, 174, 0.12);
  color: var(--ok);
}

.status-off,
.status-used {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.status-expired {
  border-color: rgba(255, 154, 154, 0.24);
  background: rgba(255, 154, 154, 0.07);
  color: var(--danger);
}

.invite-list {
  display: grid;
  gap: 12px;
}

.invite-card {
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.015);
}

.invite-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.invite-url-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.invite-url {
  flex: 1;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 12px;
}

.invite-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.invite-actions form {
  margin: 0;
}

.visibility-panel {
  margin-top: 36px;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.012);
}

.visibility-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.visibility-form select {
  min-width: 220px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b1118;
  color: var(--text);
}

.visibility-hint {
  margin: 10px 0 0;
  font-size: 12.5px;
}

.login-alt {
  margin: 16px 0 0;
  font-size: 13px;
  text-align: center;
}

.empty.compact {
  padding: 28px 20px;
}

/* Профиль и лента */
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.profile-hero {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  margin-bottom: 34px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: 1px solid rgba(231, 185, 106, 0.28);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(231, 185, 106, 0.22), transparent 60%),
    #121a24;
  color: var(--accent-strong);
  font-size: 46px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.profile-intro h1 {
  margin-bottom: 10px;
  font-size: clamp(32px, 4vw, 54px);
}

.profile-bio {
  max-width: 72ch;
  margin-bottom: 18px;
  color: #c4cfdd;
  font-size: 16px;
  line-height: 1.7;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: #c9d5e4;
  font-size: 12px;
  font-weight: 650;
}

.profile-facts {
  display: grid;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
}

.profile-facts div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
}

.profile-facts dt {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-facts dd {
  margin: 0;
  color: #d5dfec;
  font-size: 14px;
}

.profile-stats {
  max-width: 980px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.stat-card {
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(18, 26, 36, 0.55);
}

.stat-card strong {
  color: var(--accent-strong);
  font-size: 28px;
  line-height: 1.1;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.stats-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 20px;
}

.stats-columns h3,
.stats-tags h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.stat-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stat-list li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 36px;
  gap: 8px;
  align-items: center;
  font-size: 13.5px;
}

.stat-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line-soft);
}

.stat-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.stat-list strong {
  color: var(--muted);
  font-size: 12.5px;
  text-align: right;
}

.stats-tags {
  margin-top: 4px;
}

.stats-tags .tag-list li strong {
  color: var(--accent-strong);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.post-card {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(18, 26, 36, 0.72);
  transition: border-color 160ms ease, transform 160ms ease;
}

.post-card.is-draft {
  border-style: dashed;
}

.post-card:hover {
  border-color: rgba(231, 185, 106, 0.4);
  transform: translateY(-2px);
}

.post-card-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.post-card-link:hover {
  text-decoration: none;
}

.post-card-cover {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0c1219;
}

.post-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-cover.is-empty {
  display: grid;
  place-items: center;
  background:
    radial-gradient(500px 240px at 80% 0%, rgba(231, 185, 106, 0.16), transparent 65%),
    linear-gradient(150deg, #1a2533, #0c1219);
}

.post-card-cover.is-empty span {
  color: rgba(231, 185, 106, 0.72);
  font-size: 54px;
  font-weight: 700;
}

.post-card-body {
  padding: 16px 18px 18px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.post-badge {
  padding: 3px 8px;
  border: 1px solid rgba(231, 185, 106, 0.3);
  border-radius: 999px;
  background: rgba(231, 185, 106, 0.12);
  color: var(--accent-strong);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-card h3 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.35;
}

.post-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.post-card p.post-spoiler-note {
  color: #cbb98f;
  font-style: italic;
}

.post-read {
  color: var(--accent-strong);
  font-size: 12.5px;
  font-weight: 650;
}

.post-card-action {
  margin: 0;
  padding: 0 18px 16px;
  text-align: right;
}

.feed-list {
  display: grid;
  gap: 28px;
  max-width: 920px;
}

.feed-post {
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(18, 26, 36, 0.58);
}

.feed-post.is-draft {
  border-style: dashed;
}

.feed-post-title {
  margin: 0 0 14px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.25;
}

.feed-post-title a {
  color: var(--text);
}

.feed-post-title a:hover {
  color: var(--accent-strong);
  text-decoration: none;
}

.feed-post-cover {
  overflow: hidden;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #05080b;
}

.feed-post-cover img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

.feed-post .post-body {
  max-width: none;
}

.feed-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.feed-post-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.feed-post-footer form {
  margin: 0;
}

.like-pill,
.btn.like-active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 125, 150, 0.45);
  border-radius: 999px;
  color: #ffa9ba;
  background: rgba(255, 105, 135, 0.08);
  font-weight: 600;
  line-height: 1;
}

.btn.like-active:hover {
  color: #ffc2ce;
  border-color: rgba(255, 145, 165, 0.7);
}

.btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}

.pagination-status {
  color: var(--muted);
  font-size: 14px;
}

.post-engagement {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.post-engagement form {
  margin: 0;
}

.comments {
  max-width: 920px;
}

.comment-list {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.comment {
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(18, 26, 36, 0.5);
}

.comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.comment-head strong {
  font-size: 15px;
}

.comment-head time {
  color: var(--muted);
  font-size: 12.5px;
}

.comment-head form {
  margin: 0 0 0 auto;
}

.comment-delete {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: none;
  font-size: 12.5px;
  cursor: pointer;
}

.comment-delete:hover {
  color: var(--danger);
  text-decoration: underline;
}

.comment p {
  margin: 0;
  color: var(--text);
}

.comment-form {
  display: grid;
  gap: 12px;
  max-width: 640px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.comment-form .field {
  margin: 0;
}

.comment-form button {
  justify-self: start;
}

.top-list {
  display: grid;
  gap: 10px;
  max-width: 900px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.top-groups {
  display: grid;
  gap: 30px;
}

.top-group .section-head h3 {
  margin: 0;
  font-size: 20px;
}

.top-item {
  display: grid;
  grid-template-columns: 40px 64px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(18, 26, 36, 0.55);
}

.top-rank {
  color: var(--accent-strong);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.top-poster {
  width: 64px;
  height: 84px;
  border-radius: 8px;
  object-fit: cover;
  background: #0c1219;
}

.top-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.top-text strong {
  font-size: 16px;
}

.top-text strong a {
  color: var(--text);
}

.top-text strong a:hover {
  color: var(--accent-strong);
  text-decoration: none;
}

.top-text small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-item.is-unavailable {
  opacity: 0.62;
}

.top-item.is-unavailable .top-poster {
  filter: grayscale(1);
}

.manage-list {
  display: grid;
  gap: 10px;
  max-width: 900px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.manage-groups {
  display: grid;
  gap: 30px;
}

.manage-group .section-head h2 {
  margin: 0;
  font-size: 20px;
}

.manage-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(18, 26, 36, 0.55);
}

.manage-rank {
  color: var(--accent-strong);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.manage-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.manage-text strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-text small {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.manage-actions form {
  margin: 0;
}

.manage-note {
  margin-top: 18px;
  font-size: 12.5px;
}

.post-article {
  max-width: 900px;
}

.post-head {
  margin-bottom: 22px;
}

.post-head h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.18;
}

.post-cover {
  overflow: hidden;
  margin: 0 0 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #05080b;
  box-shadow: var(--shadow);
}

.post-cover img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
}

.post-body {
  max-width: 76ch;
  color: #d5dfec;
  font-size: 16.5px;
  line-height: 1.8;
}

.post-body p {
  margin: 0 0 1em;
}

.spoiler {
  margin: 0 0 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.spoiler summary {
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 650;
}

.spoiler .post-body {
  margin-top: 18px;
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.attachment-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--text);
}

.attachment-card:hover {
  border-color: rgba(231, 185, 106, 0.4);
  text-decoration: none;
}

.attachment-card img {
  width: 58px;
  height: 78px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover;
  background: #0c1219;
}

.attachment-card span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.attachment-card strong {
  overflow: hidden;
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-card small {
  color: var(--muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.post-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.post-footer form {
  margin: 0;
}

.editor-form {
  display: grid;
  gap: 24px;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.editor-main {
  display: grid;
  gap: 18px;
}

.editor-side {
  display: grid;
  gap: 16px;
}

.editor-panel {
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.015);
}

.editor-panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.cover-preview {
  width: 100%;
  max-height: 220px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  object-fit: cover;
}

.attachment-picker {
  display: grid;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #d5dfec;
  font-size: 13.5px;
  line-height: 1.45;
}

.check-row input {
  width: auto;
  margin-top: 3px;
  accent-color: var(--accent);
}

.check-row small {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-danger {
  border-color: rgba(255, 154, 154, 0.42);
  background: rgba(255, 154, 154, 0.14);
  color: #ffd9d9;
}

.btn-danger:hover {
  background: rgba(255, 154, 154, 0.22);
}

@media (max-width: 900px) {
  .access-grid {
    grid-template-columns: 1fr;
  }

  .editor-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .profile-hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .avatar {
    width: 84px;
    height: 84px;
    font-size: 34px;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .feed-post {
    padding: 16px;
  }

  .top-item {
    grid-template-columns: 28px 52px minmax(0, 1fr);
    gap: 10px;
    padding: 8px;
  }

  .top-poster {
    width: 52px;
    height: 68px;
  }

  .top-text strong {
    font-size: 14px;
  }

  .manage-item {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .manage-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .invite-url-row {
    flex-direction: column;
    align-items: stretch;
  }

  .invite-url-row .btn {
    width: 100%;
  }

  .invite-actions {
    justify-content: stretch;
  }

  .invite-actions form,
  .invite-actions .btn {
    width: 100%;
  }

  .data-table {
    min-width: 560px;
  }

  .visibility-form {
    align-items: stretch;
    flex-direction: column;
  }

  .visibility-form select,
  .visibility-form .btn {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    height: auto;
    padding: 16px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .nav {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }

  .nav a,
  .nav-disabled {
    padding: 8px 12px;
    font-size: 13.5px;
  }

  .nav-disabled {
    display: none;
  }

  .sidebar-footer {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding-top: 0;
    border-top: 0;
  }

  .account {
    display: none;
  }

  .main {
    padding-top: 30px;
  }

  .detail-hero {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 28px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
    gap: 16px;
  }

  .detail-hero {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    width: min(58vw, 220px);
  }

  .player-frame.is-audio {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }

  .audio-art {
    width: min(56vw, 190px);
  }

  .filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .filters input[type="search"] {
    grid-column: 1 / -1;
    width: 100%;
    height: 40px;
    font-size: 16px;
  }

  .filters .segmented {
    grid-column: 1 / -1;
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 3px;
    scrollbar-width: none;
  }

  .filters .segmented::-webkit-scrollbar {
    display: none;
  }

  .filters .segmented a {
    flex: 0 0 auto;
    padding: 7px 11px;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
  }

  .mobile-filter-button {
    display: inline-flex;
  }

  .filters.is-collapsed .segmented,
  .filters.is-collapsed select {
    display: none;
  }

  .filters select {
    grid-column: 1 / -1;
    width: 100%;
    height: 40px;
    font-size: 16px;
  }

  .filters .btn {
    width: auto;
    min-height: 40px;
    padding: 0 14px;
    white-space: nowrap;
  }

  .sidebar {
    grid-template-columns: 1fr auto;
  }

  .nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    order: 3;
  }

  .sidebar-footer {
    justify-self: end;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .footer-link {
    text-align: right;
  }
}

.profile-status {
  margin: 8px 0 0;
  color: var(--accent-strong);
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 600;
}

.filters select {
  height: 42px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--panel);
}

.lookup-tabs {
  margin: 14px 0 0;
}

.lookup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.lookup-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(18, 26, 36, 0.58);
}

.lookup-poster img,
.lookup-placeholder {
  width: 120px;
  height: 180px;
  border-radius: 10px;
  object-fit: cover;
  background: #0c1219;
}

.lookup-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.lookup-info {
  min-width: 0;
}

.lookup-info h2 {
  margin: 4px 0 6px;
  font-size: 20px;
  line-height: 1.25;
}

.lookup-info p {
  margin: 0 0 8px;
}

.lookup-info form {
  margin-top: 10px;
}

.library-current {
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.reader-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
}

.reader-head h1 {
  margin: 4px 0;
}

.reader-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 980px;
  margin: 18px auto;
}

.chapter-picker {
  min-width: 180px;
  padding: 8px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel);
}

.chapter-picker summary {
  cursor: pointer;
  color: var(--accent-strong);
}

.chapter-picker ol {
  max-height: 320px;
  margin: 10px 0 0;
  padding-left: 22px;
  overflow-y: auto;
}

.chapter-picker li {
  margin: 5px 0;
}

.reader-content {
  max-width: 820px;
  margin: 26px auto 40px;
  padding: clamp(20px, 4vw, 44px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(18, 26, 36, 0.72);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.75;
}

.reader-content h1,
.reader-content h2,
.reader-content h3,
.reader-content h4 {
  line-height: 1.25;
}

.reader-content img {
  max-width: 100%;
  height: auto;
  margin: 18px auto;
  border-radius: 8px;
}

.reader-content blockquote {
  margin: 20px 0;
  padding-left: 18px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.reader-content table {
  width: 100%;
  border-collapse: collapse;
}

.reader-content td,
.reader-content th {
  padding: 6px 8px;
  border: 1px solid var(--line);
}

.pdf-reader {
  max-width: 1100px;
  margin: 22px auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.pdf-reader iframe {
  display: block;
  width: 100%;
  height: 82vh;
  border: 0;
}

.track-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 900px;
}

.track {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.track-number {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.track-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.track-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-text small,
.track-duration {
  color: var(--muted);
  font-size: 13px;
}

.track-duration {
  font-variant-numeric: tabular-nums;
}

.progress-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.progress-actions form {
  margin: 0;
}

.bulk-counts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.bulk-count {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(18, 26, 36, 0.55);
}

.bulk-count strong {
  color: var(--accent-strong);
  font-size: 22px;
}

.bulk-count span {
  color: var(--muted);
  font-size: 13px;
}

.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 4px 0 14px;
}

.library-list {
  display: grid;
  gap: 8px;
  max-width: 980px;
}

.library-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(18, 26, 36, 0.55);
}

.library-row-poster img {
  width: 56px;
  height: 84px;
  border-radius: 7px;
  object-fit: cover;
  background: #0c1219;
}

.library-row-main {
  min-width: 0;
}

.library-row-title {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-row-title:hover {
  color: var(--accent-strong);
  text-decoration: none;
}

.library-row-meta {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-row-extra {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .library-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .library-row-poster img {
    width: 44px;
    height: 66px;
  }

  .library-row-extra {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .lookup-grid {
    grid-template-columns: 1fr;
  }

  .lookup-card {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .lookup-poster img,
  .lookup-placeholder {
    width: 90px;
    height: 135px;
  }

  .reader-content {
    font-size: 17px;
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}