:root {
  color-scheme: light;
  --tg-bg: var(--tg-theme-bg-color, #efe7d4);
  --tg-text: var(--tg-theme-text-color, #131417);
  --tg-hint: var(--tg-theme-hint-color, #746f64);
  --tg-link: var(--tg-theme-link-color, #0b78ff);
  --tg-button: var(--tg-theme-button-color, #111111);
  --tg-button-text: var(--tg-theme-button-text-color, #ffffff);
  --panel: rgba(255, 251, 244, 0.88);
  --panel-strong: rgba(255, 253, 249, 0.96);
  --panel-border: rgba(19, 20, 23, 0.08);
  --shadow: 0 18px 48px rgba(21, 25, 32, 0.1);
  --surface-shadow: 0 10px 30px rgba(17, 21, 28, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 214, 143, 0.38), transparent 28%),
    radial-gradient(circle at top right, rgba(34, 155, 255, 0.15), transparent 24%),
    linear-gradient(180deg, #f8f0db 0%, var(--tg-bg) 56%, #eadfca 100%);
  color: var(--tg-text);
}

body {
  padding: 18px 12px 36px;
}

body.viewer-open {
  overflow: hidden;
}

body.home-mode,
body.detail-mode,
body.favorites-mode {
  background:
    radial-gradient(circle at top left, rgba(72, 101, 255, 0.2), transparent 22%),
    radial-gradient(circle at top right, rgba(42, 214, 255, 0.14), transparent 20%),
    linear-gradient(180deg, #0f1116 0%, #141820 52%, #0d0f14 100%);
  color: #edf1f7;
}

body.home-mode {
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 0 calc(env(safe-area-inset-bottom, 0px) + 28px);
}

body.home-mode.top-panels-hidden .hero,
body.home-mode.top-panels-hidden .toolbar,
body.detail-mode.top-panels-hidden .hero,
body.detail-mode.top-panels-hidden .toolbar {
  display: none;
}

body.favorites-mode .hero,
body.favorites-mode .toolbar,
body.favorites-mode .channel-meta,
body.favorites-mode .district-filter {
  display: none;
}

body.detail-mode .district-filter {
  display: none !important;
}

body.home-mode .hero,
body.home-mode .channel-meta,
body.home-mode .district-filter,
body.home-mode .detail-panel,
body.home-mode .detail-topbar,
body.home-mode .detail-actions,
body.home-mode .favorites-topbar,
body.detail-mode .hero,
body.detail-mode .channel-meta,
body.detail-mode .detail-panel,
body.detail-mode .detail-topbar,
body.detail-mode .detail-actions,
body.detail-mode .contact-modal,
body.favorites-mode .favorites-topbar {
  background: rgba(18, 22, 30, 0.9);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

body.home-mode .hero-text,
body.home-mode .toolbar-label,
body.home-mode .channel-copy p,
body.home-mode .district-chip,
body.detail-mode .hero-text,
body.detail-mode .toolbar-label,
body.detail-mode .channel-copy p,
body.detail-mode .detail-meta span,
body.detail-mode .contact-modal p {
  color: #9aa5b6;
}

body.home-mode .toolbar-item,
body.home-mode .district-filter,
body.detail-mode .toolbar-item {
  background: rgba(18, 22, 30, 0.82);
  border-color: rgba(255, 255, 255, 0.08);
}

body.home-mode .channel-form input,
body.home-mode .ghost-button,
body.home-mode .nav-button,
body.home-mode .district-chip,
body.detail-mode .channel-form input,
body.detail-mode .ghost-button,
body.detail-mode .nav-button,
body.favorites-mode .nav-button {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #edf1f7;
}

body.home-mode .girl-card {
  background: rgba(18, 22, 30, 0.94);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

body.favorites-mode .girl-card {
  background: rgba(18, 22, 30, 0.94);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

body.home-mode .girl-card-body {
  color: #edf1f7;
}

body.favorites-mode .girl-card-body {
  color: #edf1f7;
}

body.home-mode .girl-excerpt,
body.detail-mode .detail-title-button,
body.detail-mode .detail-text,
body.detail-mode .translated,
body.detail-mode .contact-modal h2 {
  color: #edf1f7;
}

body.detail-mode .detail-cover,
body.detail-mode .detail-media-item {
  background: rgba(11, 14, 20, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
}

body.detail-mode .detail-text-panel {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

button,
input {
  font: inherit;
}

a {
  color: var(--tg-link);
}

img,
video {
  display: block;
  max-width: 100%;
}

.app-shell {
  max-width: 1080px;
  margin: 0 auto;
}

body.home-mode .app-shell {
  max-width: none;
  width: 100%;
}

.hero,
.channel-meta,
.detail-panel,
.detail-topbar,
.detail-actions {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--tg-hint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 0.96;
}

.hero-text {
  margin: 10px 0 0;
  max-width: 560px;
  color: var(--tg-hint);
  line-height: 1.5;
}

.channel-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px;
  gap: 10px;
}

.telegram-launch {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.telegram-mini-app-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(98, 214, 255, 0.35);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(16, 185, 255, 0.22), rgba(37, 99, 235, 0.18));
  color: #dff7ff;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(17, 24, 39, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.telegram-mini-app-button:active {
  transform: translateY(1px);
}

.telegram-mini-app-hint {
  color: #9aa5b6;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}

.channel-form input,
.channel-form button,
.ghost-button,
.nav-button,
.primary-button {
  min-height: 46px;
  border-radius: 8px;
}

.channel-form input {
  border: 1px solid var(--panel-border);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--tg-text);
}

.channel-form button,
.primary-button {
  border: 0;
  background: var(--tg-button);
  color: var(--tg-button-text);
  cursor: pointer;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}

.channel-list {
  padding: 8px 12px;
  margin: -3px 0 4px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
}

.channel-list-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}

.channel-list-row::-webkit-scrollbar {
  display: none;
}

.channel-chip {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: linear-gradient(135deg, #dbeafe 0%, #f8fafc 100%);
  color: var(--tg-text);
  cursor: pointer;
  overflow: hidden;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.channel-chip.is-active {
  border-color: rgba(37, 99, 235, 0.95);
  box-shadow:
    0 12px 24px rgba(37, 99, 235, 0.28),
    0 0 0 3px rgba(147, 197, 253, 0.45);
  transform: translateY(-1px);
}

.channel-chip.is-active::before {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  z-index: 2;
  width: 10px;
  height: 10px;
  margin: 0;
  border-radius: 999px;
  background: #2563eb;
  box-shadow:
    0 0 0 2px #fff,
    0 0 10px rgba(37, 99, 235, 0.55);
}

.channel-chip-avatar,
.channel-chip-fallback {
  display: block;
  width: 100%;
  height: 100%;
}

.channel-chip-avatar {
  object-fit: cover;
}

.channel-chip-fallback {
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  color: #1d4ed8;
}

.toolbar-item {
  min-width: 132px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
}

.toolbar-label {
  display: block;
  margin-bottom: 4px;
  color: var(--tg-hint);
  font-size: 12px;
}

.ghost-button,
.nav-button {
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--tg-text);
  cursor: pointer;
}

.channel-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 6px 12px 12px;
  margin-bottom: 10px;
}

.district-filter {
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
}

.district-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.district-filter-row::-webkit-scrollbar {
  display: none;
}

.district-chip,
.district-modal-option {
  position: relative;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--tg-text);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.district-chip.is-active,
.district-modal-option.is-active {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 52%, #60a5fa 100%);
  border-color: rgba(147, 197, 253, 0.55);
  color: #edf1f7;
  box-shadow:
    0 12px 24px rgba(37, 99, 235, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transform: translateY(-1px);
}

.district-chip.is-active::before,
.district-modal-option.is-active::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.42);
  vertical-align: middle;
}

.district-chip-more {
  padding-right: 16px;
}

.channel-avatar {
  width: 70px;
  height: 70px;
  flex: 0 0 70px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.06);
}

.channel-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
  max-height: 70px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.channel-copy h2 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-copy p {
  margin: 0;
  color: var(--tg-hint);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-share-button {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8fe0ff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.channel-share-button:active {
  transform: translateY(1px) scale(0.98);
}

.channel-share-icon {
  width: 28px;
  height: 28px;
  display: block;
  fill: currentColor;
  filter: drop-shadow(0 0 10px rgba(98, 214, 255, 0.28));
}

.channel-favorites-button {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ff8db8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.channel-favorites-button:active {
  transform: translateY(1px) scale(0.98);
}

.channel-favorites-icon {
  width: 28px;
  height: 28px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(255, 98, 160, 0.24));
}

.channel-favorites-button.is-active .channel-favorites-icon,
.girl-favorite-button.is-active .girl-favorite-icon,
.detail-fab-favorite.is-active .detail-favorite-icon {
  fill: currentColor;
}

.message-box {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--panel-border);
}

#loading-box {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 50%;
  z-index: 30;
  width: min(calc(100vw - 24px), 420px);
  margin: 0;
  transform: translateX(-50%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.loading {
  background: rgba(255, 246, 212, 0.92);
}

.error {
  background: rgba(255, 232, 228, 0.92);
  color: #8d241a;
}

body.home-mode .loading,
body.detail-mode .loading,
body.favorites-mode .loading {
  background: rgba(18, 22, 30, 0.9);
  border-color: rgba(255, 255, 255, 0.08);
  color: #edf1f7;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

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

#load-more-button {
  width: calc(100% - 24px);
  margin: 14px 12px 0;
}

.girl-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  box-shadow: var(--surface-shadow);
}

.girl-card-hit {
  display: block;
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.girl-cover {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.girl-favorite-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(10, 13, 18, 0.48);
  color: rgba(255, 237, 245, 0.98);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.girl-favorite-button:active {
  transform: translateY(1px) scale(0.98);
}

.girl-favorite-button.is-active {
  color: #ff8db8;
}

.girl-favorite-icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.girl-cover-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 13, 18, 0.72);
  color: rgba(237, 241, 247, 0.9);
  font-size: 13px;
  letter-spacing: 0;
  pointer-events: none;
}

.girl-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(12, 13, 17, 0.28) 100%);
  pointer-events: none;
}

.girl-cover-image,
.girl-cover-video {
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
}

.girl-cover-video {
  opacity: 0;
  pointer-events: none;
}

.girl-cover-video.is-ready {
  opacity: 1;
  transition: opacity 0.18s ease;
}

.girl-card-body {
  padding: 9px 7px;
}

.girl-excerpt {
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.skeleton-card {
  pointer-events: none;
}

.skeleton-cover,
.skeleton-line {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

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

.skeleton-cover {
  min-height: 240px;
}

.skeleton-line {
  height: 14px;
  border-radius: 999px;
}

.skeleton-line + .skeleton-line {
  margin-top: 10px;
}

.skeleton-line-long {
  width: 100%;
}

.skeleton-line-short {
  width: 68%;
}

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

.detail-view {
  padding-bottom: 24px;
}

.favorites-view {
  padding-bottom: 24px;
}

.favorites-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
}

.favorites-topbar .nav-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 56px;
  min-height: 40px;
  padding: 0 12px;
}

.favorites-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.favorites-meta strong {
  font-size: 18px;
  line-height: 1.2;
}

.favorites-meta span {
  color: #9aa5b6;
  font-size: 12px;
}

.favorites-share-button {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8fe0ff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.favorites-share-button:active {
  transform: translateY(1px) scale(0.98);
}

.favorites-share-icon {
  width: 24px;
  height: 24px;
  display: block;
  fill: currentColor;
  filter: drop-shadow(0 0 10px rgba(98, 214, 255, 0.28));
}

.detail-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 16px;
}

.detail-topbar .nav-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 68px;
  padding: 0 14px;
}

.detail-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 12px;
  width: 100%;
}

.detail-heading {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.detail-title-button {
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  font-size: 16px;
  line-height: 1.4;
  min-width: 0;
  width: 100%;
  max-height: calc(1.4em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-channel {
  display: block;
  min-width: 0;
  color: #8fe0ff;
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#detail-date {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

#detail-date,
#detail-date .detail-date-day,
#detail-date .detail-date-time {
  color: var(--tg-hint);
  font-size: 12px;
  line-height: 1.4;
}

#detail-date .detail-date-day,
#detail-date .detail-date-time {
  display: block;
  white-space: nowrap;
}

#detail-date {
  text-align: right;
  padding-top: 2px;
  justify-self: end;
}

.detail-panel {
  padding: 0;
  overflow: hidden;
}

.detail-cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 0;
  margin-bottom: 0;
  min-height: min(78vh, 420px);
  aspect-ratio: 4 / 5;
  background: rgba(255, 255, 255, 0.62);
  border-width: 0 0 1px;
  border-style: solid;
  border-color: var(--panel-border);
}

.detail-cover-media {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: cover;
  background: #000;
}

.detail-cover-fallback-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  z-index: 0;
  background: transparent;
}

.detail-cover-live-layer {
  position: relative;
  z-index: 1;
  opacity: 0;
  background: transparent;
  transition: opacity 0.18s ease;
}

.detail-cover-live-layer.is-ready {
  opacity: 1;
}

.detail-cover-skeleton {
  width: 100%;
  min-height: inherit;
}

.viewer-trigger {
  cursor: zoom-in;
}

.detail-text-panel {
  margin-bottom: 0;
  padding: 18px;
  border-bottom: 1px solid var(--panel-border);
}

.detail-text,
.translated {
  line-height: 1.7;
  word-break: break-word;
}

.detail-text-skeleton {
  display: grid;
  gap: 10px;
}

.detail-media {
  display: grid;
  gap: 0;
}

.detail-media-skeleton {
  display: grid;
  gap: 0;
}

.detail-media-skeleton-item {
  min-height: 220px;
  border-width: 0 0 1px;
  border-style: solid;
  border-color: var(--panel-border);
}

.detail-loading-note {
  padding: 14px 18px 18px;
  color: var(--tg-hint);
  font-size: 13px;
  line-height: 1.5;
}

.detail-media-item {
  overflow: hidden;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.62);
  border-width: 0 0 1px;
  border-style: solid;
  border-color: var(--panel-border);
}

.detail-media-item img,
.detail-media-item video {
  width: 100%;
  height: auto;
  background: #000;
}

.detail-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  margin-top: 16px;
}

.detail-fab {
  position: fixed;
  right: 14px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 90px);
  z-index: 12;
  min-width: 118px;
  height: 62px;
  padding: 0 22px;
  border: 1px solid rgba(210, 228, 255, 0.22);
  border-radius: 999px;
  background: rgba(18, 24, 34, 0.54);
  color: rgba(244, 247, 251, 0.96);
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    0 18px 36px rgba(4, 8, 16, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.detail-fab::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-fab::after {
  content: "";
  position: absolute;
  top: 11px;
  right: 11px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(153, 222, 255, 0.92);
  box-shadow: 0 0 10px rgba(153, 222, 255, 0.46);
}

.detail-fab span {
  position: relative;
  z-index: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.detail-fab-back {
  min-width: 86px;
  width: 86px;
  height: 86px;
  padding: 0;
  left: 14px;
  right: auto;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  bottom: auto;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.detail-fab-back::before {
  display: none;
}

.detail-fab-back::after {
  display: none;
}

.detail-fab-back span {
  color: #d9eeff;
  line-height: 1;
}

.detail-fab-back-icon {
  width: 20px;
  height: 20px;
  border-left: 3.5px solid currentColor;
  border-bottom: 3.5px solid currentColor;
  border-radius: 1px;
  transform: rotate(45deg);
  animation: back-arrow-breathe 1.8s ease-in-out infinite;
  will-change: opacity, filter, transform;
}

@keyframes back-arrow-breathe {
  0%,
  100% {
    opacity: 0.78;
    filter: drop-shadow(0 0 0 rgba(217, 238, 255, 0));
    transform: rotate(45deg) scale(1);
  }

  50% {
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(217, 238, 255, 0.55));
    transform: rotate(45deg) scale(1.08);
  }
}

#floating-back-button.hidden,
.detail-view.hidden #floating-back-button,
body.home-mode #floating-back-button {
  display: none !important;
}

#floating-back-button:not(.hidden) {
  display: flex;
}

.detail-fab-favorite {
  min-width: 58px;
  width: 58px;
  height: 58px;
  padding: 0;
  right: 14px;
  left: auto;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  bottom: auto;
  background: rgba(18, 24, 34, 0.44);
  border-color: rgba(255, 162, 197, 0.2);
  color: #ff9cc3;
  box-shadow:
    0 18px 36px rgba(4, 8, 16, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.detail-fab-favorite::after {
  display: none;
}

.detail-fab-favorite .detail-favorite-icon {
  width: 24px;
  height: 24px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#floating-favorite-button.hidden,
.detail-view.hidden #floating-favorite-button,
body.home-mode #floating-favorite-button,
body.favorites-mode #floating-favorite-button {
  display: none !important;
}

#floating-favorite-button:not(.hidden) {
  display: flex;
}

#contact-button {
  touch-action: manipulation;
}

#contact-button.hidden,
.detail-view.hidden #contact-button {
  display: none !important;
}

#contact-button:not(.hidden) {
  display: flex;
}

#contact-button:focus-visible {
  outline: 2px solid rgba(178, 214, 255, 0.72);
  outline-offset: 2px;
}

#contact-button:active {
  transform: translateY(1px) scale(0.98);
  box-shadow:
    0 10px 20px rgba(4, 8, 16, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

body.home-mode #contact-button {
  display: none !important;
}

body.detail-mode #contact-button {
  display: flex;
}

body.detail-mode .detail-actions {
  padding-right: 88px;
}

body.detail-mode .detail-actions .nav-button {
  width: 100%;
}

#contact-button {
  background: linear-gradient(135deg, rgba(179, 52, 120, 0.98) 0%, rgba(224, 72, 110, 0.98) 50%, rgba(249, 115, 22, 0.98) 100%);
  border: 1px solid rgba(255, 198, 166, 0.34);
  color: #fffaf7;
  font-weight: 800;
  box-shadow: 0 20px 40px rgba(123, 37, 69, 0.34);
  animation: contact-button-breathe 2.1s ease-in-out infinite;
  will-change: transform, box-shadow, filter;
}

#contact-button::before {
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0) 22%, rgba(255, 240, 214, 0.08) 39%, rgba(255, 255, 255, 0.54) 50%, rgba(255, 243, 220, 0.16) 58%, rgba(255, 255, 255, 0) 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 100%);
  background-size: 185% 100%, 100% 100%;
  background-position: 150% 50%, 0 0;
  animation: contact-button-sheen 2.55s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
  mix-blend-mode: screen;
}

#contact-button::after {
  animation: contact-button-dot-breathe 2.1s ease-in-out infinite;
}

@keyframes contact-button-breathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow:
      0 20px 40px rgba(123, 37, 69, 0.3),
      0 0 0 0 rgba(255, 126, 88, 0);
    filter: saturate(1) brightness(1);
  }

  50% {
    transform: translateY(-1px) scale(1.035);
    box-shadow:
      0 24px 46px rgba(146, 43, 79, 0.42),
      0 0 0 10px rgba(255, 126, 88, 0.08);
    filter: saturate(1.08) brightness(1.05);
  }
}

@keyframes contact-button-dot-breathe {
  0%,
  100% {
    opacity: 0.82;
    box-shadow: 0 0 10px rgba(153, 222, 255, 0.34);
  }

  50% {
    opacity: 1;
    box-shadow: 0 0 16px rgba(255, 232, 186, 0.68);
  }
}

@keyframes contact-button-sheen {
  0%,
  100% {
    background-position: 150% 50%, 0 0;
  }

  38% {
    background-position: 150% 50%, 0 0;
  }

  68% {
    background-position: -55% 50%, 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #contact-button,
  #contact-button::before,
  #contact-button::after {
    animation: none;
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(13, 15, 20, 0.5);
  backdrop-filter: blur(6px);
}

.contact-modal {
  width: min(100%, 420px);
  padding: 20px;
  border-radius: 8px;
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  text-align: center;
}

.contact-modal h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.contact-modal p {
  margin: 0;
  color: var(--tg-hint);
  line-height: 1.6;
}

.contact-modal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.district-modal {
  text-align: left;
}

.district-modal-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

#modal-contact-button {
  background: linear-gradient(135deg, #2a5bd7 0%, #3b82f6 100%);
  color: #fff;
  border: 1px solid rgba(130, 182, 255, 0.28);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.28);
}

#modal-contact-button:active {
  transform: translateY(1px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
}

.viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 12px;
  background: rgba(7, 9, 12, 0.92);
}

.viewer-shell {
  display: grid;
  width: 100%;
  height: 100%;
}

.viewer-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px 12px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 22;
  pointer-events: none;
}

.viewer-counter {
  color: #fff;
  font-size: 14px;
  pointer-events: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(7, 10, 15, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.viewer-tools {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  right: 12px;
  pointer-events: auto;
}

.viewer-tool-button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 13, 18, 0.9);
  color: #fff;
  cursor: pointer;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(8px);
}

.viewer-stage-wrap {
  position: relative;
  min-height: 0;
  height: 100%;
}

.viewer-stage {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.viewer-media-frame {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.viewer-image,
.viewer-video {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  transform-origin: center center;
  transition: transform 0.18s ease;
}

.viewer-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 21;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(8, 11, 16, 0.92);
  color: #fff;
  cursor: pointer;
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(10px);
}

.viewer-nav-left {
  left: 18px;
}

.viewer-nav-right {
  right: 18px;
}

.detail-entry-transition {
  position: fixed;
  z-index: 24;
  overflow: hidden;
  border-radius: 12px;
  pointer-events: none;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
  opacity: 1;
  transition:
    left 220ms ease,
    top 220ms ease,
    width 220ms ease,
    height 220ms ease,
    border-radius 220ms ease,
    opacity 140ms ease;
}

.detail-entry-transition img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

.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;
}

@media (max-width: 640px) {
  body {
    padding: 12px 12px 28px;
  }

  .hero {
    padding: 18px;
  }

  .channel-form,
  .detail-actions,
  .contact-modal-actions {
    grid-template-columns: 1fr;
  }

  .viewer-stage {
    height: 100vh;
  }

  .viewer-tools {
    top: calc(env(safe-area-inset-top, 0px) + 72px);
    right: 10px;
  }

  .viewer-nav {
    width: 54px;
    height: 54px;
    font-size: 34px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-item,
  .ghost-button,
  .nav-button,
  .primary-button {
    width: 100%;
  }

  .channel-meta {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 4px 10px 10px;
  }

  .channel-avatar {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
  }

  .channel-copy {
    max-height: 56px;
    gap: 2px;
  }

  .channel-share-button {
    width: 46px;
    height: 46px;
  }

  .channel-share-icon {
    width: 26px;
    height: 26px;
  }

  .channel-favorites-button {
    width: 46px;
    height: 46px;
  }

  .channel-favorites-icon {
    width: 26px;
    height: 26px;
  }

  .channel-copy h2 {
    margin: 0;
    font-size: 16px;
  }

  .channel-copy p {
    font-size: 12px;
  }

  .detail-topbar {
    align-items: flex-start;
  }

  .detail-topbar .nav-button {
    width: auto;
  }

  .girl-cover {
    min-height: 220px;
  }
}

@media (max-width: 390px) {
  .channel-meta {
    gap: 10px;
    padding: 4px 8px 8px;
  }

  .channel-avatar {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
  }

  .channel-copy {
    max-height: 50px;
  }

  .channel-share-button {
    width: 42px;
    height: 42px;
  }

  .channel-share-icon {
    width: 24px;
    height: 24px;
  }

  .channel-favorites-button {
    width: 42px;
    height: 42px;
  }

  .channel-favorites-icon {
    width: 24px;
    height: 24px;
  }

  .channel-copy h2 {
    font-size: 15px;
  }

  .channel-copy p {
    font-size: 11px;
  }
}
