/* D:\projects\fanzanian\app\static\mylist\app.css */
:root {
  color-scheme: dark;
  --bg: #08080a;
  --surface: #121217;
  --text: #fff;
  --text-soft: rgba(255, 255, 255, .72);
  --text-muted: rgba(255, 255, 255, .5);
  --line: rgba(255, 255, 255, .12);
  --accent: #c44cff;
  --accent-2: #ff459d;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --bottom-nav-height: 62px;
  font-family:
    Inter, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic",
    Meiryo, system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--bg); color: var(--text); }
body { padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom)); }
button, a { font: inherit; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid #d899ff; outline-offset: 3px; }
svg { width: 1.4em; height: 1.4em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.mylist-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  gap: 7px;
  padding: calc(17px + var(--safe-top)) max(14px, var(--safe-right)) 0 max(14px, var(--safe-left));
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(8,8,10,.94);
}

.brand {
  width: fit-content;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-decoration: none;
}

.mylist-header h1 { display:flex; align-items:center; gap:7px; margin:2px 0 0; font-size:25px; line-height:1.2; }
.mylist-header h1 span { color:#ff4f91; font-size:.88em; }
.mylist-header p { margin: 0; color: var(--text-muted); font-size: 11px; }

.mylist-tabs {
  display: flex;
  gap: 20px;
  margin: 8px -14px 0;
  padding: 0 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.mylist-tabs::-webkit-scrollbar { display: none; }
.mylist-tabs button {
  position: relative;
  flex: 0 0 auto;
  min-height: 43px;
  padding: 8px 0 10px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.mylist-tabs button::after {
  content: "";
  position: absolute;
  right: 12%;
  bottom: 0;
  left: 12%;
  height: 2px;
  background: transparent;
}
.mylist-tabs button.is-active { color: #fff; }
.mylist-tabs button.is-active::after { background: #fff; }

.mylist-main {
  max-width: 1640px;
  margin: 0 auto;
  padding: 15px max(6px, var(--safe-right)) 42px max(6px, var(--safe-left));
  touch-action: pan-y pinch-zoom;
}

.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  padding: 0 7px 10px;
}
.list-heading[hidden] { display: none; }
.list-heading p { margin: 0; color: var(--text-muted); font-size: 12px; }
.loading-indicator {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.18);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

.mylist-card {
  position: relative;
  overflow: hidden;
  background: #121217;
}

.mylist-card__state-action {
  position: absolute;
  z-index: 7;
  top: 8px;
  right: 8px;
  margin: 0;
  appearance: none;
  cursor: pointer;
  pointer-events: auto;
}
.mylist-card__state-action:disabled {
  cursor: wait;
  opacity: .55;
}

.card-link { display: block; color: inherit; text-decoration: none; }
.card-image-wrap { position: relative; aspect-ratio: 2/3; overflow: hidden; background: #17171d; }
.card-image-wrap img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 180ms ease; }
.card-link:hover img { transform: scale(1.025); }
.card-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: var(--text-muted); font-size: 11px; }
.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 7px;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.78));
  pointer-events: none;
}
.card-state {
  max-width: calc(100% - 35px);
  overflow: hidden;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(0,0,0,.68);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255,255,255,.18);
}
.card-progress span { display: block; height: 100%; background: linear-gradient(90deg,var(--accent),var(--accent-2)); }
.card-title { display: none; }
.card-remove-button {
  position: absolute;
  z-index: 3;
  right: 7px;
  bottom: 7px;
  min-height: 31px;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.skeleton-card {
  aspect-ratio: 2/3;
  background: linear-gradient(100deg,#131318 20%,#1c1c22 36%,#131318 52%);
  background-size: 220% 100%;
  animation: shimmer 1.1s linear infinite;
}
@keyframes shimmer { to { background-position-x: -220%; } }

.message-state {
  display: grid;
  place-items: center;
  gap: 9px;
  min-height: 45vh;
  padding: 30px;
  color: var(--text-soft);
  text-align: center;
}
.message-state[hidden] { display: none; }
.message-state p { margin: 0; font-size: 13px; }
.message-state a,
.message-state button {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #08080a;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.bottom-navigation {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  min-height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding: 8px max(10px,var(--safe-right)) var(--safe-bottom) max(10px,var(--safe-left));
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(8,8,10,.94);
}
.bottom-navigation a {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}
.bottom-navigation a.is-active { color:#fff; }
.bottom-navigation svg { width:22px; height:22px; }
.bottom-navigation a:first-child svg { fill:currentColor; stroke:currentColor; }

.bottom-navigation .mylist-heart-icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.bottom-navigation a.is-active .mylist-heart-icon { fill: currentColor; }

.toast {
  position: fixed;
  z-index: 60;
  right: 18px;
  bottom: calc(var(--bottom-nav-height) + 22px + var(--safe-bottom));
  left: 18px;
  width: fit-content;
  max-width: calc(100vw - 36px);
  margin: 0 auto;
  padding: 11px 16px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 999px;
  background: rgba(18,18,22,.94);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.toast[hidden] { display:none; }

@media (min-width:430px) { .mylist-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (min-width:760px) {
  .mylist-header { padding-right:24px; padding-left:24px; }
  .mylist-tabs { margin-right:-24px; margin-left:-24px; padding:0 24px; }
  .mylist-main { padding:20px 18px 50px; }
  .mylist-grid { grid-template-columns: repeat(5,minmax(0,1fr)); gap:10px; }
  .card-title {
    display:-webkit-box;
    min-height:38px;
    padding:8px 8px 9px;
    overflow:hidden;
    color:var(--text-soft);
    font-size:11px;
    font-weight:700;
    line-height:1.45;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
  }
}
@media (min-width:1100px) {
  :root { --bottom-nav-height:0px; }
  body { padding-bottom:0; padding-left:64px; }
  .mylist-header { left:64px; }
  .bottom-navigation {
    top:0; right:auto; bottom:0; width:64px; min-height:100%;
    padding:22px 7px; grid-template-columns:1fr; grid-template-rows:repeat(4,min-content);
    align-content:center; gap:22px; border-top:0; border-right:1px solid rgba(255,255,255,.08);
  }
  .bottom-navigation a { min-height:48px; }
  .bottom-navigation span { font-size:9px; }
  .mylist-grid { grid-template-columns: repeat(7,minmax(0,1fr)); }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}

/* Phase 5A14: catalog-consistent one-column my list */
.mylist-main { max-width: 760px; padding-right: max(12px, var(--safe-right)); padding-left: max(12px, var(--safe-left)); }
.mylist-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 30px; }
.mylist-card { overflow: visible; border: 0; border-radius: 0; background: transparent; }
.card-link.card-media-link { display: block; color: inherit; text-decoration: none; }
.card-image-wrap {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .06), transparent 58%),
    #101014;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .3);
}
.card-image-wrap img { width: 100%; height: 100%; padding: 10px; object-fit: contain; object-position: center; }
.card-copy { display: grid; gap: 7px; padding: 11px 3px 0; }
.card-title.card-title-link {
  display: -webkit-box;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, .94);
  font-size: clamp(15px, 2.8vw, 20px);
  font-weight: 800;
  line-height: 1.45;
  text-decoration: none;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.card-title-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.card-actresses { margin: 0; color: rgba(255, 255, 255, .62); font-size: 13px; line-height: 1.55; }
.card-actresses a { color: inherit; text-decoration-color: rgba(255, 255, 255, .28); text-underline-offset: 3px; }
.card-actresses a:hover { color: #fff; }
.card-remove-button { top: 10px; right: 10px; bottom: auto; }
.skeleton-card { aspect-ratio: 4 / 5; border-radius: 14px; }

@media (max-width: 699px) {
  .mylist-main { padding-right: max(10px, var(--safe-right)); padding-left: max(10px, var(--safe-left)); }
  .mylist-grid { gap: 24px; }
  .card-image-wrap { border-radius: 12px; }
  .card-image-wrap img { padding: 7px; }
  .card-title.card-title-link { font-size: 15px; line-height: 1.5; }
}


/* Phase 5A15: landscape-first one-column saved cards */
.mylist-main { max-width: 920px; }
.mylist-grid { gap: 34px; }
.card-image-wrap,
.skeleton-card {
  aspect-ratio: 16 / 9;
}
.card-image-wrap {
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(255, 255, 255, .09), transparent 52%),
    linear-gradient(145deg, #17171d, #09090c 70%);
}
.card-image-wrap img {
  width: 100%;
  height: 100%;
  padding: clamp(8px, 1.8vw, 16px);
  object-fit: contain;
}
.card-copy { padding-top: 12px; }

@media (max-width: 699px) {
  .mylist-grid { gap: 28px; }
  .card-image-wrap,
  .skeleton-card { aspect-ratio: 16 / 9; }
  .card-image-wrap img { padding: 7px; }
}


/* Phase 5A21: favorite removal and undo */
.card-favorite-remove {
  position: absolute;
  z-index: 5;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 50%;
  background: rgba(7, 7, 10, .78);
  color: #ffd66b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .36);
  backdrop-filter: blur(10px);
  cursor: pointer;
}
.card-favorite-remove svg { width: 25px; height: 25px; fill: currentColor; stroke: currentColor; }
.card-favorite-remove:hover,
.card-favorite-remove:focus-visible { background: rgba(255, 214, 107, .14); border-color: rgba(255, 214, 107, .46); }
.card-good-remove { color: #8ee6b3; }
.card-good-remove:hover,
.card-good-remove:focus-visible { background: rgba(88, 214, 141, .14); border-color: rgba(88, 214, 141, .46); }
.card-good-remove svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.card-favorite-remove:disabled { opacity: .45; cursor: wait; }
.mylist-card.is-removing { animation: favorite-card-remove 180ms ease forwards; pointer-events: none; }
@keyframes favorite-card-remove { to { opacity: 0; transform: scale(.97); } }

.toast { display: flex; align-items: center; gap: 14px; }
.toast-action {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: #fff;
  color: #0b0b0d;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 699px) {
  .card-favorite-remove { top: 8px; right: 8px; width: 44px; height: 44px; }
}


/* Phase 5B3: unified red text-only FANZANIAN brand */
.brand,
.brand:hover,
.brand:focus-visible {
  color: #e60012;
}

.settings-gear-icon { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }


/* 20260813B: unified public FANZANIAN wordmark. */
.brand,
.brand:hover,
.brand:focus-visible {
  color: #e60012;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .11em;
  text-decoration: none;
}


/* 20260813C: native vertical scroll plus horizontal tab swipes. */
.mylist-main { touch-action: pan-y pinch-zoom; }


/* 20260816F1: favorite actresses reuse explicit actress entity preferences. */
.favorite-actresses { margin: 0 0 24px; }
.favorite-actresses[hidden] { display: none; }
.favorite-actresses-heading { display:flex; align-items:end; justify-content:space-between; gap:12px; margin-bottom:10px; }
.favorite-actresses-heading small { color:rgba(255,255,255,.42); font-size:9px; letter-spacing:.14em; }
.favorite-actresses-heading h2 { margin:2px 0 0; font-size:17px; }
.favorite-actresses-heading > span { color:rgba(255,255,255,.52); font-size:11px; }
.favorite-actresses-list { display:flex; gap:10px; overflow-x:auto; padding:2px 2px 8px; scrollbar-width:none; scroll-snap-type:x proximity; }
.favorite-actresses-list::-webkit-scrollbar { display:none; }
.favorite-actress-card { position:relative; flex:0 0 92px; scroll-snap-align:start; }
.favorite-actress-link { display:grid; gap:7px; color:#fff; text-decoration:none; }
.favorite-actress-link img, .favorite-actress-fallback { width:92px; height:112px; border-radius:13px; object-fit:cover; background:rgba(255,255,255,.07); }
.favorite-actress-fallback { display:grid; place-items:center; font-size:24px; font-weight:800; }
.favorite-actress-link strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.favorite-actress-remove { position:absolute; top:6px; right:6px; width:30px; height:30px; border:0; border-radius:999px; background:rgba(12,12,15,.74); color:#ff4f91; font-size:15px; cursor:pointer; backdrop-filter:blur(8px); }


/* 20260816 U1.4: Favorite Actress is a first-class LIKE tab. */
.favorite-actresses-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 14px 10px;
  overflow: visible;
  padding: 2px 0 8px;
  scroll-snap-type: none;
}
.favorite-actress-card { min-width: 0; }
.favorite-actress-link img,
.favorite-actress-fallback { width: 100%; max-width: 116px; height: 132px; }
.favorite-actresses-empty {
  display: grid;
  gap: 5px;
  padding: 28px 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
  text-align: center;
}
.favorite-actresses-empty[hidden] { display: none; }
.favorite-actresses-empty strong { color: rgba(255,255,255,.86); font-size: 13px; }
.favorite-actresses-empty span { color: rgba(255,255,255,.5); font-size: 11px; line-height: 1.6; }
@media (max-width: 560px) {
  .favorite-actresses-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
  .favorite-actress-link img,
  .favorite-actress-fallback { max-width: none; height: 116px; }
}

/* 20260818 Saved Playlist R1 */
.list-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.saved-playlist-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.saved-playlist-actions[hidden] { display: none !important; }

.saved-playlist-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .055);
  color: rgba(255, 255, 255, .92);
  font-size: 11px;
  font-weight: 820;
  cursor: pointer;
}

.saved-playlist-actions button:first-child {
  background: rgba(255, 255, 255, .94);
  color: #0a0a0c;
}

.saved-playlist-actions button:disabled {
  opacity: .38;
  cursor: default;
}

.saved-playlist-actions button span:first-child {
  font-size: 12px;
  line-height: 1;
}

@media (max-width: 560px) {
  .list-heading {
    align-items: flex-start;
    gap: 8px;
  }

  .list-heading-actions {
    gap: 7px;
  }

  .saved-playlist-actions {
    gap: 6px;
  }

  .saved-playlist-actions button {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 10px;
  }
}

/* R5-A S2 20260827: LIKE > ジャンル is maintenance-only. */
.genre-maintenance {
  display: block;
  padding: 2px 0 24px;
}
.genre-maintenance[hidden] { display: none !important; }
.favorite-genres-list {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px !important;
  align-items: center;
  padding: 2px 0 8px;
}
.genre-maintenance-chip {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  color: rgba(255, 255, 255, .76);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.genre-maintenance-chip:hover {
  border-color: rgba(255, 255, 255, .28);
  color: #fff;
}
.genre-maintenance-chip[aria-pressed="true"] {
  border-color: #e60012;
  background: #e60012;
  color: #fff;
}
.genre-maintenance-chip:active { transform: scale(.97); }
.genre-maintenance-chip:disabled { cursor: wait; opacity: .58; }

@media (max-width: 520px) {
  .favorite-genres-list { gap: 7px !important; }
  .genre-maintenance-chip { min-height: 36px; padding: 7px 11px; font-size: 11px; }
}

/* R31_LIKE_SWIPE_RELIABILITY: browser_gesture_ownership_v1 */
.mylist-page {
  overscroll-behavior-x: contain;
  touch-action: pan-y pinch-zoom;
}
.mylist-main,
.mylist-header > .public-brand-row {
  touch-action: pan-y pinch-zoom;
}


/* R32_GENRE_PROGRESSIVE_LOAD: master-first state hydration */
.genre-maintenance-chip.is-state-pending {
  opacity: .58;
  cursor: wait;
}
.favorite-genres-status {
  margin: 12px 5px 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
}
.favorite-genres-status[hidden] { display: none; }

/* R32_LIKE_GESTURE_ENGINE: horizontal gestures belong to LIKE content. */
.mylist-main { touch-action: pan-y pinch-zoom; }

/* R33_LIKE_SWIPE_RELIABILITY: the page, including visual whitespace, owns horizontal gestures. */
.mylist-page { touch-action: pan-y pinch-zoom; }


/* R34_LIKE_GESTURE_RELIABILITY: keep the full visible page inside the gesture surface. */
html, body.mylist-page { min-height: 100dvh; }
body.mylist-page { overscroll-behavior-x: none; touch-action: pan-y pinch-zoom; }
.mylist-main { min-height: calc(100dvh - 190px); }
.genre-maintenance-chip[data-write-pending="1"] { opacity: .82; }
.genre-maintenance-chip[data-write-pending="1"][aria-pressed="true"] {
  border-color: #e60012;
  background: #e60012;
  color: #fff;
}
