:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --fg: #0a0a0a;
  --muted: #737373;
  --line: #e5e5e5;
  --chip: #f5f5f5;
  --accent: #e11d48;
  --accent-2: #171717;
  --shadow: 0 1px 2px rgba(10, 10, 10, .04);
  --radius: 12px;
  --ring: #0a0a0a;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #171717;
  --fg: #fafafa;
  --muted: #a3a3a3;
  --line: #262626;
  --chip: #1c1c1c;
  --accent: #fb7185;
  --accent-2: #fafafa;
  --shadow: none;
  --ring: #fafafa;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--fg); }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
/* 반드시 body > header 로 좁힌다. 그냥 header 라고 쓰면 요소 선택자라 페이지 안의
   <header> 까지 잡는다. 실제로 work.php 의 <header class="watch-head">(작품 제목 블록)가
   이 규칙을 물려받아 sticky; top:0; z-index:20 이 되어 있었다. 그 블록은 사이트 헤더보다
   DOM 뒤에 있고 z-index 가 같아서, 스크롤하면 화면 맨 위에 붙어 사이트 헤더와 그 안의
   프로필 메뉴를 통째로 덮었다. "헤더가 사라진다", "메뉴가 가려진다" 두 제보가 모두
   이 한 줄에서 나왔다. */
body > header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
/* 앵커(#review)로 이동하면 목적지가 sticky 헤더 밑에 깔린다. 헤더 높이만큼 띄운다.
   헤더는 720px 경계로 65px / 112px 두 값이다. */
html { scroll-padding-top: 76px; }
.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; padding: 8px 0; }
/* 520px 는 데스크톱에서 헤더의 절반 가까이를 먹었다. 필요한 만큼만 준다. */
.search { flex: 0 1 300px; display: flex; max-width: 300px; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.search-page { flex: 0 1 420px; max-width: 420px; margin: 0 0 22px; }
.search input { flex: 1; border: 0; background: transparent; color: var(--fg); padding: 9px 14px; font: inherit; min-width: 0; outline: none; }
.search button { border: 0; background: var(--chip); color: var(--fg); padding: 9px 14px; cursor: pointer; font: inherit; }
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; letter-spacing: -.03em; text-decoration: none; font-size: 20px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 18px; }
.brand-text em { font-style: normal; font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: 0; }
.brand-mark { width: 26px; height: 26px; display: block; flex-shrink: 0; }
.nav { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.nav a, .nav button {
  background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; text-decoration: none;
  border-radius: 8px; padding: 8px 10px;
}
.nav a:hover, .nav button:hover { background: var(--chip); color: var(--fg); }
.nav .btn.primary { color: var(--bg); padding: 7px 12px; }
.theme-toggle {
  width: 36px; height: 36px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
}
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle:hover { color: var(--fg); background: var(--chip); }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
main { padding: 28px 0 72px; }
.kicker { color: var(--accent); font-weight: 700; font-size: 12px; letter-spacing: .12em; margin: 0 0 8px; }
h1 { font-size: clamp(22px, 3vw, 32px); letter-spacing: -.03em; margin: 0 0 10px; font-weight: 650; }
h2 { font-size: 18px; margin: 8px 0 16px; letter-spacing: -.02em; font-weight: 600; }
h2 a { color: inherit; text-decoration: none; }
h2 a:hover { text-decoration: underline; }
.page-title { font-size: 24px; }
.lead { color: var(--muted); max-width: 40rem; margin: 0 0 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 26px; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  background: var(--surface); color: var(--muted); cursor: pointer; font-size: 13px; text-decoration: none;
}
.chip:hover { background: var(--chip); color: var(--fg); }
.chip.on, a.chip.on { background: var(--accent-2); color: var(--bg); border-color: var(--accent-2); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px 16px; }
.card { min-width: 0; }
.card-body { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; }
.card-copy { min-width: 0; flex: 1; }
/* /me 에서 찜을 푼 카드. 화면을 다시 그리지 않으므로 카드가 자리에 남는데,
   그대로 두면 "찜한 작품" 제목 아래 빈 하트짜리 카드가 앉아 말이 어긋난다.
   흐리게 해서 해제됐음을 보인다 — 지우지 않는 이유는 되돌릴 하트를 남기기
   위해서다. 카드 통째로 opacity 를 걸면 안 된다. opacity 는 그룹을 만들어서
   자식에 opacity:1 을 줘도 되돌릴 수 없고, 되돌릴 수단인 하트까지 흐려진다. */
.card.fav-off .thumb, .card.fav-off .card-copy { opacity: .38; }
.card .thumb, .card .card-copy { transition: opacity .18s ease; }
.thumb {
  position: relative; aspect-ratio: 16/9; background: #111; border-radius: 12px; overflow: hidden; display: block;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .thumb img { transform: scale(1.03); }
.meta { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.card h3 { font-size: 14px; line-height: 1.4; margin: 0 0 4px; font-weight: 600; letter-spacing: -.01em; }
.card h3 a { text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.more { text-align: center; margin: 28px 0 8px; color: var(--muted); font-size: 13px; }
.watch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 16px 0 0; }
.watch-copy { min-width: 0; flex: 1; }
.watch-copy h1 { font-size: 22px; margin: 0 0 6px; }
.watch-links { margin-top: 16px; }
.err { color: var(--accent); font-size: 14px; }
.auth {
  max-width: 400px; margin: 32px auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 28px 24px;
}
.auth h1 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 6px; }
.auth .lead { font-size: 14px; margin: 0 0 20px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--fg); }
.field input {
  height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--fg); font: inherit; font-weight: 400;
}
.field input:focus { outline: 2px solid var(--ring); outline-offset: 1px; border-color: transparent; }
/* 입력칸 아래 보조 설명. .field 가 font-weight:500 이라 그대로 두면 라벨과
   같은 무게로 읽혀 무엇이 라벨인지 흐려진다. */
.field-note { font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.5; }
.field-note code { font-size: 11.5px; padding: 1px 5px; border-radius: 5px; background: var(--chip); color: var(--fg); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--fg); cursor: pointer; font: inherit; text-decoration: none; font-weight: 550;
}
.btn:hover { background: var(--chip); }
.btn.primary { background: var(--accent-2); color: var(--bg); border-color: transparent; }
.btn.primary:hover { opacity: .92; background: var(--accent-2); }
.btn.outline { background: var(--surface); }
.btn.google { width: 100%; margin: 0 0 4px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.or:before, .or:after { content: ""; flex: 1; height: 1px; background: var(--line); }
.or span { white-space: nowrap; }
/* 구글 버튼 바로 아래 놓이는 보조 링크. 버튼과 경쟁하지 않게 작고 조용하게 둔다. */
.or-alt { margin: 8px 0 0; text-align: center; font-size: 12.5px; }
.or-alt a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.or-alt a:hover { color: var(--fg); }
.auth-foot { color: var(--muted); font-size: 13px; margin: 16px 0 0; text-align: center; }
.auth-foot a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 13px; text-align: center; }
.player { aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #000; }
.player iframe { width: 100%; height: 100%; border: 0; }
@media (max-width: 720px) {
  .bar { flex-wrap: wrap; }
  /* 검색창을 모바일에서 한 줄 폭으로 펼치던 규칙은 없앴다. 이제 돋보기 + 모달이라
     display: none 으로 접힌다(아래 헤더 블록). 남겨 두면 죽은 규칙이 충돌한다. */
  .watch-head { flex-direction: column; align-items: stretch; }
}

.policy { max-width: 40rem; }
.policy h2 { font-size: 16px; margin: 28px 0 8px; }
.policy p { color: var(--muted); margin: 0 0 12px; }
.policy a { text-decoration: underline; text-underline-offset: 3px; }
footer a { color: inherit; }

.flash { background: var(--chip); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 18px; }
.thumb-ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-size: 36px; font-weight: 700; color: #fff; background: #262626;
}
.poster-only img { width: 100%; height: 100%; object-fit: cover; }
.stars { color: #d4a017; letter-spacing: .04em; }
.otts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.ott {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 11px; font-weight: 650; text-decoration: none;
  background: var(--chip); color: var(--fg); border: 1px solid var(--line);
}
.ott:hover { background: var(--surface); }
.ott-netflix { background: #e50914; color: #fff; border-color: #e50914; }
.ott-tving { background: #111; color: #fff; border-color: #ff7aa2; }
.ott-wavve { background: #1b4dff; color: #fff; border-color: #1b4dff; }
.ott-coupang { background: #21a0e8; color: #fff; border-color: #21a0e8; }
.ott-disney { background: #113ccf; color: #fff; border-color: #113ccf; }
.ott-watcha { background: #ff0558; color: #fff; border-color: #ff0558; }
.ott-other { background: #525252; color: #fff; border-color: #525252; }
.ott-chips { margin-top: -10px; }
.rating-sum { color: var(--fg); }
.review-list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 12px; }
.review-row {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.review-row p { margin: 8px 0 10px; }
.review-meta, .review-row { }
.review-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nick { font-weight: 650; }
.review-work { font-weight: 650; text-decoration: none; margin-right: 8px; }
.review-work:hover { text-decoration: underline; }
.badge {
  font-size: 11px; font-weight: 650; border-radius: 999px; padding: 2px 8px;
  background: var(--chip); color: var(--muted); border: 1px solid var(--line);
}
.badge.quiet { font-weight: 500; }
.badge.warn { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.spoiler-blur {
  filter: blur(7px); cursor: pointer; user-select: none; color: var(--fg);
}
.spoiler-blur.open { filter: none; cursor: text; user-select: text; }
.agree { margin: 0; }
.agree-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; height: 30px; padding: 0 12px; font: inherit; font-size: 12px; font-weight: 650;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
}
.agree-btn:hover { background: var(--chip); color: var(--fg); }
.agree-btn.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.review-form-wrap { margin: 28px 0; }
.review-form { max-width: 36rem; }
.field select, .field textarea {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--fg); font: inherit; font-weight: 400;
}
.field textarea { min-height: 72px; resize: vertical; }
.field select:focus, .field textarea:focus { outline: 2px solid var(--ring); outline-offset: 1px; border-color: transparent; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.muted { color: var(--muted); font-weight: 400; }
.work-page .player { margin-bottom: 8px; }

.field.radios { border: 0; margin: 0; padding: 0; min-width: 0; }
.field.radios legend { padding: 0; margin: 0 0 6px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-weight: 550; cursor: pointer;
}
.radio-chip:has(input:checked) {
  border-color: var(--fg); background: var(--chip);
}
.radio-chip input { margin: 0; accent-color: var(--accent); }

.fav-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; flex: 0 0 auto;
}
.fav-btn svg { width: 18px; height: 18px; display: block; flex: 0 0 auto; }
.fav-btn:hover { background: var(--chip); color: var(--accent); }
.fav-btn.on {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}
/* .fav-btn:hover 와 .fav-btn.on 은 우선순위(0,2,0)가 같아 소스 순서로 갈린다.
   .on 이 뒤에 있어 배경이 항상 .on 값으로 고정돼 버려서, 찜한 상태에서 호버해도
   아무것도 안 바뀐다 — 하필 취소하려고 올리는 바로 그 상태에서 피드백이 죽는다. */
.fav-btn.on:hover { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.fav-btn.labeled { width: auto; height: 36px; padding: 0 15px 0 13px; gap: 7px; color: var(--fg); }
.fav-btn.labeled.on { color: var(--accent); }
/* 제목과 찜 버튼이 한 줄을 나눠 쓴다. 버튼을 h1 '안'에 넣으면 무효 마크업이고
   제목의 접근성 이름까지 오염되므로, 형제로 두고 줄만 공유한다.
   제목이 길어 자리가 모자라면 wrap 으로 버튼이 아래로 내려간다 — 잘리지 않는다. */
.watch-copy .title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; }
/* .watch-copy h1 의 아래 여백은 이제 .title-row 가 갖는다. 두 선택자의 명시도가
   같아 순서에 기대게 되므로, 헷갈리지 않도록 명시도를 올려 잡는다. */
.watch-copy .title-row h1 { margin: 0; }
.watch-actions { display: flex; gap: 8px; }

.field.radios input,
.radio-chip input {
  height: auto; width: auto; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; outline: none;
  accent-color: var(--accent);
}
.field.radios input:focus,
.radio-chip input:focus {
  outline: none; box-shadow: none; border: 0;
}
.radio-chip:focus-within { border-color: var(--fg); }
.radio-chip.ghost {
  color: var(--muted); background: transparent;
}

.trailer-admin {
  max-width: 36rem; margin: 12px 0 20px;
  padding: 10px 16px 14px; border: 1px dashed var(--line); border-radius: 12px;
  background: var(--surface);
}
.trailer-admin summary {
  cursor: pointer; font-weight: 650; color: var(--muted); list-style: none;
}
.trailer-admin summary::-webkit-details-marker { display: none; }
.trailer-admin[open] summary { margin-bottom: 10px; color: var(--fg); }
.trailer-admin .btn { align-self: flex-start; }

/* 폭·높이는 .input-row 가 잡는다. 여기서는 간격만 준다. */
.trailer-inline { margin-top: 10px; }

.copy-btn {
  height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted); font: inherit; font-size: 12px;
  font-weight: 650; cursor: pointer;
}
.copy-btn:hover { color: var(--fg); background: var(--chip); }
/* .copy-btn 은 <button> 기준 규칙이라 <a> 로 쓰면 인라인이 되어 height 가 안 먹고
   밑줄도 남는다. 링크로 쓰는 자리(유튜브에서 찾기)를 버튼과 같은 알약으로 맞춘다. */
a.copy-btn { display: inline-flex; align-items: center; text-decoration: none; }

.btn.danger { color: #b42318; border-color: #fecdca; background: #fef3f2; }
.btn.danger:hover { background: #fee4e2; }

.review-form > .btn { align-self: flex-start; }
.inline-form { display: inline; margin: 0; }
.trailer-admin .copy-btn,
.trailer-admin .inline-form { margin-top: 8px; }
.trailer-admin .form .copy-btn { align-self: flex-start; }
.copy-btn.danger { color: #b42318; border-color: #fecdca; background: #fef3f2; }
.copy-btn.danger:hover { background: #fee4e2; }

/* ===== 메인 UI 개편 — 홈(안 A) / 한줄 피드(안 B) ===== */

/* 공용 */
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 14px; }
.sec-h h2 { font-size: 18px; margin: 0; letter-spacing: -.02em; font-weight: 600; }
.more-a { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 550; text-decoration: none; }
.more-a:hover { color: var(--fg); }
.rowsec { margin: 34px 0 0; }
.seg { display: inline-flex; background: var(--chip); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
/* 줄바꿈 방지 — 이 요소들은 전부 flex 아이템이라 기본 flex-shrink: 1 로 압축된다.
   한글은 글자 단위로 줄바꿈되므로 좁은 화면에서 "드/라/마" 처럼 세로로 쪼개진다.
   nowrap 으로 줄을 막고, 줄지 않게 flex 를 고정한다. */
.nav a, .nav button, .btn, .chip, .seg a { white-space: nowrap; }
.nav > *, .tools-otts > .chip, .seg > a { flex: 0 0 auto; }

.seg a { padding: 5px 15px; border-radius: 999px; font-size: 13px; font-weight: 550; color: var(--muted); text-decoration: none; }
/* --surface 알약을 --chip 컨테이너 위에 얹는 방식은 대비가 라이트 1.09 / 다크 1.05 로
   사실상 같은 색이었다. 다크에서는 --shadow 도 none 이라 단서가 아예 없다.
   같은 툴바의 OTT 칩(.chip.on)이 쓰는 반전을 그대로 써서 선택 표시를 통일한다. */
.seg a.on { background: var(--accent-2); color: var(--bg); box-shadow: none; }
.seg a.on:hover { color: var(--bg); }
.sel {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--fg);
  font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.sel:hover { background: var(--chip); }
.tools { position: sticky; top: 64px; background: var(--bg); border-bottom: 1px solid var(--line); z-index: 10; }
.tools-in { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.tools-otts { display: flex; gap: 8px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tools-otts::-webkit-scrollbar { display: none; }
.tools-div { width: 1px; height: 22px; background: var(--line); flex: 0 0 auto; }

/* 홈 — 히어로 */
.hero { position: relative; height: 430px; overflow: hidden; background: #111; }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 32%; }
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(6,6,8,.94) 0%, rgba(6,6,8,.78) 38%, rgba(6,6,8,.18) 72%, rgba(6,6,8,.05) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(6,6,8,0) 34%);
}
.hero-in { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; }
/* 스크림만으로는 밝은 스틸이나 자막 위에서 부족하다. 글자 자체에도 그림자를 준다. */
/* max-width 를 ch 로 두면 안 된다. ch 는 '0' 글자 폭(≈0.5em)이라 한글로는
   15ch 가 약 8글자(345px)밖에 안 되어, 13글자짜리 제목이 700px 자리에서도
   강제로 접혔다. 한글 음절은 ≈1em 이므로 em 으로 잡는다. 14em ≈ 14글자.
   그래도 접히는 긴 제목은 balance 로 두 줄을 고르게 나눈다. */
.hero .hero-title {
  font-size: 46px; line-height: 1.08; letter-spacing: -.035em; margin: 0 0 12px;
  font-weight: 650; color: #fff; max-width: 14em; text-wrap: balance;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .6);
}
.hero-meta, .hero .kicker { text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }
.hero-meta { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: rgba(255,255,255,.86); font-size: 14px; flex-wrap: wrap; }
.hero-cta { display: flex; gap: 10px; }
.btn.hero-primary { background: var(--accent); color: #fff; border-color: transparent; font-weight: 650; }
.btn.hero-primary:hover { background: var(--accent); opacity: .92; }
/* 다크의 --accent(#fb7185)는 밝아서 흰 글자면 대비가 2.69:1까지 떨어진다(AA 미달).
   어두운 글자로 뒤집으면 7.36:1. 라이트는 #fff가 4.70:1로 더 나으므로 그대로 둔다. */
[data-theme="dark"] .btn.hero-primary { color: #0a0a0a; }
.btn.hero-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.34); }
.btn.hero-ghost:hover { background: rgba(255,255,255,.2); }

/* 홈 — 가로 행 타일 */
/* 4열. 5열은 모바일 2열에서 2+2+1 로 어긋나고, 6열은 나눠지긴 해도 타일이
   185px(이미지 104px)까지 줄어 썸네일이 너무 작아진다. 4열이면 284px(이미지 160px)
   이면서 2열·4열 어디서든 행이 딱 맞는다. */
.row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
/* 제목과 정보는 이미지 아래에 둔다. 예고편 스틸에는 자막이 박혀 있는 일이 잦아
   글자를 위에 얹으면 두 겹으로 읽히고 장면 자체도 가린다. */
.tile { position: relative; min-width: 0; }
.tile-img {
  display: block; position: relative; aspect-ratio: 16/9;
  border-radius: var(--radius); overflow: hidden; background: #111;
}
.tile-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.tile:hover .tile-img img { transform: scale(1.04); }
/* 제목·정보줄 묶음과 찜 버튼이 한 행을 나눠 쓴다. 찜 버튼을 정보줄 안에 두면
   OTT 배지·별점과 자리를 다투다가 좁은 폭에서 혼자 다음 줄로 밀려났다.
   _work_card.php 의 .card-body / .card-copy 와 같은 구조다. */
.tile-body { margin-top: 9px; display: flex; align-items: flex-start; gap: 8px; }
.tile-copy { min-width: 0; flex: 1; }
.tile-body h3 {
  margin: 0 0 3px; font-size: 14px; font-weight: 600; letter-spacing: -.01em; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile-body h3 a { color: var(--fg); text-decoration: none; }
.tile-body h3 a:hover { color: var(--accent); }
/* nowrap 이 없으면 좁은 타일에서 "아직 한줄 없/음" 처럼 글자 중간이 끊긴다.
   대신 wrap 을 열어 두어, 배지까지 한 줄에 안 들어가면 통째로 다음 줄로 내려간다
   (overflow:hidden 만 있으면 오른쪽이 잘려 별점이나 연도가 사라졌다). */
.tile-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px;
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.tile-meta > * { flex: 0 0 auto; }
/* 스틸 위가 아니라 제목 아래 정보줄에 놓는다 — 예고편 썸네일 왼쪽 위는
   공급사 로고나 박힌 제목 자리라 배지를 얹으면 서로 겹쳐 둘 다 못 읽는다. */
.tile-ott { display: inline-flex; }
.tile-ott .ott { height: 20px; padding: 0 7px; font-size: 11px; }
/* 정보줄 밖으로 나갔으므로 margin-left:auto 가 필요 없다 — flex 형제라 자리가 잡힌다. */
.tile-body .fav-btn {
  width: 28px; height: 28px; border-color: transparent;
  background: transparent; color: var(--muted);
}
.tile-body .fav-btn svg { width: 17px; height: 17px; }
.tile-body .fav-btn:hover { background: var(--chip); color: var(--accent); }
.tile-body .fav-btn.on { color: var(--accent); background: transparent; border-color: transparent; }
/* 위와 같은 이유로 .tile-body .fav-btn.on 이 배경을 transparent 로 고정해 호버가 죽는다. */
.tile-body .fav-btn.on:hover { background: var(--chip); }

/* 홈 — 전체 그리드 */
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px 16px; }
.grid-sec { margin-top: 44px; padding-top: 32px; border-top: 1px solid var(--line); }

/* 홈 — 최근 한줄 3장 */
.rv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

/* 빈 상태 유도 블록 */
.empty {
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 38px 40px 34px; text-align: center;
}
/* 가로 행과 같은 4열. auto-fill 로 두면 폭에 따라 5개가 들어가 6개가 5+1 로
   어긋났다. 고정 열로 행이 항상 맞아떨어지게 한다. */
.seedrow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 24px; text-align: left; }
.seed {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0; overflow: hidden;
}
.seed .thumb { border-radius: 0; }
.seed-body { padding: 13px 15px 15px; }

/* 한줄 피드 — 2컬럼 */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
/* 사이드바가 없을 때 340px 자리를 비워 두면 본문만 좁아진다. 한 컬럼으로 편다. */
.cols.solo { grid-template-columns: minmax(0, 1fr); }
.cols aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 96px; }

/* 한줄 피드 — 컴포저 */
.compose {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin: 0 0 18px;
}
.compose-row { display: flex; gap: 13px; align-items: flex-start; }
/* 아바타는 .compose(배경 --surface) 위에 놓인다. 배경을 --chip, 테두리를 --line 으로
   두면 다크에서 #1c1c1c / #262626 / #171717 이 거의 같아 원이 사라지고 글자만
   떠 있는 것처럼 보인다. 강조색을 옅게 섞어 두 테마 모두에서 원이 드러나게 한다. */
.ava {
  width: 40px; height: 40px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  /* 테두리는 강조색 70% — 카드 배경 대비 다크 4.08:1 / 라이트 3.54:1 로
     UI 요소 경계 기준(3:1)을 넘긴다. 40%면 2.3 대에 머물러 여전히 흐릿하다. */
  border: 1px solid color-mix(in srgb, var(--accent) 70%, var(--line));
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  color: var(--fg); flex: 0 0 auto;
}
.compose-ctl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.compose-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* 한줄 피드 — 리뷰 카드 */
.rfeed { display: flex; flex-direction: column; gap: 14px; }
.rcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; gap: 14px;
}
.rthumb { flex: 0 0 auto; width: 104px; aspect-ratio: 16/9; border-radius: 9px; overflow: hidden; background: #111; display: block; }
.rthumb img { width: 100%; height: 100%; object-fit: cover; }
.rbody { min-width: 0; flex: 1; }
.rhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 7px; }
.rhead a { font-weight: 650; letter-spacing: -.015em; font-size: 15px; text-decoration: none; }
.rhead a:hover { text-decoration: underline; }
.rtext { margin: 0 0 11px; font-size: 15.5px; line-height: 1.58; letter-spacing: -.005em; }
.rfoot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rfoot-sp { flex: 1; }

/* 한줄 피드 — 사이드바 */
.aside-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.rank { display: flex; flex-direction: column; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-n { width: 19px; text-align: center; font-size: 14px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.rank-t { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.rank-s { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.mini { display: flex; gap: 11px; align-items: center; padding: 9px 0; text-decoration: none; }
.mini-th { flex: 0 0 auto; width: 68px; aspect-ratio: 16/9; border-radius: 7px; overflow: hidden; background: #111; }
.mini-th img { width: 100%; height: 100%; object-fit: cover; }
.mini-t { display: block; font-weight: 600; font-size: 13px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-m { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }

/* 유틸리티 — 뷰에서 인라인 style을 쓰지 않기 위한 최소 집합 */
.u-flex1 { flex: 1; min-width: 0; }
.empty-h { margin: 0 0 8px; font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.empty-lead { margin: 0 auto; max-width: 34rem; color: var(--muted); }
.grid-note { margin: -8px 0 18px; font-size: 13px; color: var(--muted); }
.seed-cta { width: 100%; margin-top: 12px; }
.sec-h.tight { margin-bottom: 4px; }
.aside-h { font-size: 15px; }
.aside-note { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); }
.compose-lead { margin: 0 0 11px; color: var(--muted); }

/* 스포일러 — 버튼으로 바꾸면서 기본 버튼 스타일을 지운다 */
button.spoiler-blur {
  display: block; width: 100%; text-align: left; font: inherit;
  background: none; border: 0; padding: 0; margin: 8px 0 10px; color: var(--fg);
  -webkit-appearance: none; appearance: none;
}

@media (max-width: 720px) {
  /* 모바일에서는 .bar가 줄바꿈되며 헤더가 64px보다 커지는데, 헤더도 sticky이고
     z-index가 20이라 .tools(10)를 덮어 버린다. 고정을 풀어 흐름에 맡긴다.
     .cols aside를 static으로 되돌리는 것과 같은 이유다. */
  .tools { position: static; }
  .tools-in { flex-wrap: wrap; row-gap: 10px; }

  /* OTT 칩에 자기 줄을 통째로 준다. 세그먼트와 한 줄을 나눠 쓰면 폭이 모자라
     "넷플…" 처럼 글자 중간에서 잘리고, 가로로 넘길 수 있다는 것도 드러나지 않는다.
     order 로 맨 아래에 두면 앞의 항목들이 먼저 자리를 채운다. */
  .tools-otts {
    order: 9; flex: 1 0 100%; padding-bottom: 2px;
    /* 오른쪽 끝을 흐리게 해서 더 있다는 걸 알린다 */
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent 100%);
  }
  .tools-div { display: none; }

  /* 헤더: 브랜드 / 네비 / 검색을 각자 줄에 둔다. 390px 에 항목 7개를 한 줄에
     밀어넣으면 브랜드가 밀려 사라지고 네비 글자가 뭉개진다. 네비는 가로 스크롤. */
  .nav {
    order: 2; width: 100%;
    flex-wrap: nowrap; justify-content: flex-start;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin: 2px 0 4px;
  }
  .nav::-webkit-scrollbar { display: none; }
  /* 검색은 이제 돋보기 + 모달이라 순서를 줄 필요가 없다 (아래 헤더 블록에서 접는다) */

  .hero { height: auto; }
  .hero > img { position: static; height: 219px; object-position: center 28%; }
  /* 스크림을 진하게. 예고편 스틸에는 자막이 박혀 있는 경우가 많아서
     .35 정도로는 제목과 겹쳐 두 겹으로 읽힌다. */
  .hero-scrim {
    background: linear-gradient(0deg,
      var(--bg) 6%, rgba(6,6,8,.94) 32%, rgba(6,6,8,.66) 58%, rgba(6,6,8,.18) 100%);
  }
  .hero-in { margin-top: -84px; padding-bottom: 18px; }
  .hero .hero-title { font-size: 27px; margin-bottom: 9px; }
  .hero-cta .btn { flex: 1; height: 46px; }
  html { scroll-padding-top: 124px; }
  .row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile-body h3 { font-size: 13px; }
  .agrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .rv { grid-template-columns: 1fr; }
  /* 시드 카드는 모바일에서도 2열. 4개면 2행으로 딱 맞는다. */
  .seedrow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cols { grid-template-columns: 1fr; gap: 26px; }
  .cols aside { position: static; }
  .rcard { padding: 15px 16px; }
  .rthumb { display: none; }
  .empty { padding: 30px 20px 26px; }
  .seg a, .sel, .chip { min-height: 44px; display: inline-flex; align-items: center; }
  .btn, .agree-btn { min-height: 44px; }
}

/* ===== 헤더 정리 — 좁은 검색, 프로필 메뉴, 검색 모달 ===== */

.nav { margin-right: auto; }
.hdr-end { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.nav-login { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 8px; white-space: nowrap; }
.nav-login:hover { background: var(--chip); color: var(--fg); }

.icon-btn {
  width: 36px; height: 36px; padding: 0; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 8px; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { color: var(--fg); background: var(--chip); }
.icon-btn svg { width: 18px; height: 18px; display: block; }
/* 검색은 데스크톱에서 입력창이 그대로 보이므로 돋보기가 필요 없다. */
.search-open { display: none; }

/* 프로필 메뉴 — 여닫기는 <details> 가 처리한다 */
.ava-sm { width: 34px; height: 34px; font-size: 13px; cursor: pointer; }
.profile { position: relative; flex: 0 0 auto; }
.profile > button { padding: 0; font-family: inherit; }
.profile > button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 최상위 레이어(top layer)에 그린다. 헤더가 쌓임맥락을 만드는 탓에 예전 구조에서는
   메뉴가 그 안에 갇혀, 유튜브 예고편(크로스오리진 iframe)이 아래쪽을 덮었다.
   z-index 를 올려도 will-change 로 합성 레이어를 만들어도 소용없었다. popover 는
   쌓임맥락과 합성 레이어를 통째로 벗어나므로 무엇이 있든 그 위에 뜬다.
   자리 잡기는 layout.php 의 스크립트가 한다(popover 기본값은 화면 정중앙). */
.profile-menu {
  position: fixed; margin: 0; inset: auto;
  min-width: 180px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}
.profile-menu:popover-open { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
/* popover 를 모르는 브라우저에서는 [popover] 가 무시되어 메뉴가 늘 펼쳐진 채 남는다.
   숨겨 두고 스크립트가 .is-open 으로 여닫게 한다(예전 absolute 배치 그대로). */
@supports not selector(:popover-open) {
  .profile-menu {
    display: none;
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  }
  .profile-menu.is-open { display: flex; flex-direction: column; gap: 2px; }
}
.profile-who {
  margin: 0; padding: 8px 10px 10px; font-weight: 650; font-size: 13px;
  border-bottom: 1px solid var(--line); color: var(--fg);
}
.profile-menu a, .profile-menu button {
  display: block; width: 100%; text-align: left;
  padding: 10px; border: 0; border-radius: 8px;
  background: none; color: var(--fg); font: inherit; font-size: 14px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.profile-menu a:hover, .profile-menu button:hover { background: var(--chip); color: var(--fg); }
.profile-menu form { margin: 0; }

/* 검색 모달 */
.search-modal {
  width: min(520px, calc(100% - 32px)); margin-top: 14vh; padding: 18px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--fg);
}
.search-modal::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px); }
.search-modal form {
  display: flex; border: 1px solid var(--line); border-radius: 999px;
  overflow: hidden; background: var(--bg);
}
.search-modal input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--fg);
  padding: 12px 16px; font: inherit; outline: none;
}
.search-modal button[type="submit"] {
  border: 0; background: var(--chip); color: var(--fg);
  padding: 0 18px; cursor: pointer; font: inherit;
}
.search-cancel {
  display: block; margin: 12px auto 0; padding: 8px 14px;
  border: 0; background: none; color: var(--muted);
  font: inherit; font-size: 13px; cursor: pointer; border-radius: 8px;
}
.search-cancel:hover { background: var(--chip); color: var(--fg); }

@media (max-width: 720px) {
  /* 검색창은 한 줄을 통째로 먹었다. 돋보기로 접고 모달로 연다. */
  .search { display: none; }
  .search-open { display: grid; }
  .search-page { flex: 1 1 auto; max-width: none; }
  /* 네비 항목이 4개로 줄어 스크롤 없이도 들어간다. 줄만 따로 쓴다. */
  .nav { order: 2; width: 100%; margin-right: 0; }
  .profile-menu { right: 0; min-width: 200px; }
  .icon-btn, .profile > summary { min-height: 40px; }
  .search-modal { margin-top: 8vh; }
}

/* 쪽 이동 — 551편 중 48편만 보이고 나머지에 닿을 방법이 없었다 */
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 34px 0 0; flex-wrap: wrap; }
.btn.is-off { opacity: .45; cursor: default; pointer-events: none; }
.pager-nums { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.pager-num {
  display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--muted);
  font-size: 13px; font-weight: 550; text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.pager-num:hover { background: var(--chip); color: var(--fg); }
/* 세그먼트·칩과 같은 반전을 써서 '지금 여기'가 한눈에 보이게 한다. */
.pager-num.on { background: var(--accent-2); color: var(--bg); border-color: var(--accent-2); }
.pager-gap { color: var(--muted); padding: 0 2px; }

/* 입력창 + 버튼을 한 줄에 두는 조합. 관리자 등록 폼이 쓴다.
   기본 .field input 은 40px / radius 8px 인데, 주소를 붙여넣는 칸으로는
   낮고 둥글어 보인다. 이 조합에서만 키우고 각을 준다. */
.input-row { display: flex; align-items: stretch; gap: 8px; }
/* .field 래퍼 없이 쓰이는 자리도 있으므로(관리자 목록) 테두리·배경까지 스스로 갖는다.
   높이는 이 코드베이스의 기본값 40px(.btn, .field input)에 맞춘다. */
.input-row input:not([type="hidden"]) {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--fg); font: inherit; font-weight: 400;
}
.input-row input:focus { outline: 2px solid var(--ring); outline-offset: 1px; border-color: transparent; }
.input-row .btn { flex: 0 0 auto; height: 40px; padding: 0 18px; border-radius: 6px; }

/* 작품 정보 편집 — 종류·연도·상태를 한 줄에 */
.edit-row { display: flex; gap: 12px; flex-wrap: wrap; }
.edit-row .field { flex: 1 1 130px; }
.edit-row select, .edit-row input { height: 40px; }
