:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-card-hover: #1c1c1c;
  --bg-elevated: #1a1a1a;
  --bg-sidebar: #0f0f0f;
  --gold: #d4af37;
  --gold-dim: #a6892d;
  --gold-soft: rgba(212, 175, 55, 0.15);
  --gold-border: rgba(212, 175, 55, 0.35);
  --text: #f0ebe3;
  --text-muted: #9a948a;
  --text-dim: #6b6560;
  --watched: #2a2418;
  --danger: #c45c5c;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.45);
  --sidebar-w: 260px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; }
body {
  font-family: "Noto Sans KR", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(212,175,55,0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(80,60,20,0.15), transparent);
}
.app { display: flex; min-height: 100dvh; }
/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid #222;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: hidden;
  z-index: 40;
}
.sidebar-head {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid var(--gold-border);
}
.sidebar-head .eyebrow {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.35rem;
}
.sidebar-head h1 {
  font-family: "Playfair Display", "Noto Sans KR", serif;
  font-size: 1.25rem;
  color: var(--gold);
  font-weight: 700;
}
.sidebar-head .sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}
.actor-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.5rem;
  -webkit-overflow-scrolling: touch;
}
.actor-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.25rem;
  transition: background .15s, border-color .15s, color .15s;
}
.actor-btn:hover { background: var(--bg-card); color: var(--text); }
.actor-btn.active {
  background: var(--gold-soft);
  border-color: var(--gold-border);
  color: var(--gold);
}
.actor-btn .name { font-weight: 600; }
.actor-btn .en { font-size: 0.72rem; color: var(--text-dim); font-style: italic; }
.actor-btn.active .en { color: var(--gold-dim); }
.actor-btn .prog {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}
.actor-btn.active .prog { color: var(--gold-dim); }
.nav-section {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--gold-dim);
  padding: 0.85rem 0.85rem 0.3rem;
  font-weight: 700;
}
.nav-section:first-of-type { padding-top: 0.6rem; }
.mini-bar {
  height: 3px;
  background: #2a2a2a;
  border-radius: 2px;
  margin-top: 0.35rem;
  overflow: hidden;
}
.mini-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 2px;
  width: 0%;
}
/* Main */
.main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 1.25rem calc(2.5rem + var(--safe-b));
  max-width: 820px;
}
header.page-head {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gold-border);
}
header.page-head h1,
header.page-head h2 {
  font-family: "Playfair Display", "Noto Sans KR", serif;
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--gold);
  font-weight: 700;
}
.sidebar-head .sidebar-title {
  font-family: "Playfair Display", "Noto Sans KR", serif;
  font-size: 1.25rem;
  color: var(--gold);
  font-weight: 700;
}
header.page-head .subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}
.progress-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.progress-label { font-size: 0.95rem; font-weight: 500; }
.progress-label strong { color: var(--gold); font-size: 1.3rem; }
.progress-pct { color: var(--gold-dim); font-weight: 700; font-size: 1.05rem; }
.bar { height: 8px; background: #2a2a2a; border-radius: 4px; overflow: hidden; }
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 4px;
  width: 0%;
  transition: width .35s ease;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
  align-items: center;
}
.search { flex: 1 1 180px; min-width: 0; }
.search input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid #333;
  color: var(--text);
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  outline: none;
}
.search input:focus { border-color: var(--gold-border); }
.search input::placeholder { color: var(--text-dim); }
.filter-group {
  display: flex;
  background: var(--bg-card);
  border: 1px solid #333;
  border-radius: 10px;
  overflow: hidden;
}
.filter-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}
.filter-btn.active { background: var(--gold-soft); color: var(--gold); font-weight: 600; }
.btn {
  background: var(--bg-card);
  border: 1px solid #444;
  color: var(--text-muted);
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--gold-border); color: var(--gold); }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.list { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.movie {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid #222;
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  -webkit-user-select: none;
  user-select: none;
}
.movie:hover { background: var(--bg-card-hover); border-color: #333; }
.movie.watched {
  background: var(--watched);
  border-color: var(--gold-border);
}
.movie input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  accent-color: var(--gold);
  flex-shrink: 0;
  cursor: pointer;
}
.info { flex: 1; min-width: 0; }
.titles { display: flex; flex-direction: column; gap: 0.1rem; }
.ko { font-weight: 600; font-size: 1.02rem; color: var(--text); }
.movie.watched .ko { color: var(--gold); }
.en { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.year { color: var(--gold-dim); font-weight: 600; font-variant-numeric: tabular-nums; }
.score {
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.score.estimated { color: var(--text-muted); font-weight: 600; }
.score .est {
  font-weight: 500;
  font-size: 0.68rem;
  margin-left: 0.2rem;
  color: var(--text-dim);
}
.era, .kind {
  display: inline-block;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.45;
  border-radius: 999px;
  padding: 0 0.45rem;
  border: 1px solid var(--gold-border);
  color: var(--gold);
}
.kind { color: var(--text-muted); border-color: #444; font-weight: 600; }
.period { color: var(--text-dim); }
.netflix-badge {
  display: inline-block;
  background: #e50914;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 3px;
  padding: 0.05rem 0.38rem;
  line-height: 1.45;
}
.film-source {
  margin-left: auto;
  color: var(--gold-dim);
  text-decoration: none;
  font-size: 0.75rem;
}
.film-source:hover { color: var(--gold); text-decoration: underline; }
.list-source {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.82rem;
  color: var(--gold-dim);
  text-decoration: none;
}
.list-source:hover { color: var(--gold); text-decoration: underline; }
.list-source[hidden] { display: none; }
.genre::before, .note::before {
  content: "·";
  margin-right: 0.65rem;
  color: #444;
}
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
  display: none;
}
.empty.show { display: block; }
/* Overview cards */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
.ov-card {
  background: var(--bg-card);
  border: 1px solid #222;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ov-card:hover { border-color: var(--gold-border); background: var(--bg-card-hover); }
.ov-card .n { font-weight: 700; color: var(--text); margin-bottom: 0.15rem; }
.ov-card .e { font-size: 0.78rem; color: var(--text-dim); font-style: italic; margin-bottom: 0.55rem; }
.ov-card .s { font-size: 0.85rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.ov-section {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--gold-dim);
  font-weight: 700;
  margin: 0 0 0.6rem;
}
.overview-grid + .ov-section { margin-top: 1.4rem; }
footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #222;
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.7;
}
/* Sync panel */
.sync-panel {
  background: var(--bg-elevated);
  border: 1px solid #2a2a2a;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}
.sync-panel.first { border-color: var(--gold-border); box-shadow: var(--shadow); }
.sync-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.65rem; }
.sync-label { color: var(--text-muted); }
.sync-status {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.sync-status::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #555;
}
.sync-status.saved::before { background: #6fbf73; }
.sync-status.saving::before { background: var(--gold); }
.sync-status.offline::before { background: var(--danger); }
.sync-help { color: var(--text-dim); font-size: 0.75rem; margin-top: 0.5rem; line-height: 1.6; }
.sync-panel [hidden] { display: none !important; }
.sync-panel.on { padding: 0.6rem 1rem; }
.sync-panel.on .sync-status { margin-left: 0; }
.sync-login { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.65rem; }
.sync-login input {
  flex: 1 1 140px;
  min-width: 0;
  max-width: 260px;
  background: var(--bg-card);
  border: 1px solid #333;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  font: inherit;
  font-size: 1rem; /* 16px+ avoids iOS zoom on focus */
  outline: none;
}
.sync-login input:focus { border-color: var(--gold-border); }
.sync-logout {
  margin-left: auto;
  background: none;
  border: 0;
  padding: 0.2rem 0;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
}
.sync-logout:hover { color: var(--text-muted); }
.sync-msg { font-size: 0.75rem; margin-top: 0.4rem; color: var(--text-muted); min-height: 1em; }
.sync-msg.err { color: var(--danger); }
.btn.small { padding: 0.4rem 0.7rem; font-size: 0.78rem; }
/* Mobile drawer */
.menu-toggle {
  display: none;
  position: fixed;
  bottom: calc(1rem + var(--safe-b));
  left: 1rem;
  z-index: 60;
  background: var(--gold);
  color: #0a0a0a;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 8px 28px rgba(212,175,55,0.35);
  cursor: pointer;
}
.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 35;
}
.backdrop.show { display: block; }
@media (max-width: 820px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-105%);
    transition: transform .25s ease;
    box-shadow: 8px 0 32px rgba(0,0,0,0.5);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .actor-nav { padding-bottom: calc(5rem + var(--safe-b)); } /* keep the last entry clear of the floating toggle */
  .main { padding: 1.1rem 1rem calc(5rem + var(--safe-b)); width: 100%; }
}

/* View tabs */
.view-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.view-tab {
  text-decoration: none;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid #333;
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 600;
}
.view-tab:hover { border-color: var(--gold-border); color: var(--gold); }
.view-tab.active, .view-tab[aria-current="page"] {
  background: var(--gold-soft);
  border-color: var(--gold-border);
  color: var(--gold);
}
.intro {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0.35rem 0 0;
}
.basis {
  display: inline-block;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.08rem 0.45rem;
  border: 1px solid var(--gold-border);
  color: var(--gold);
  margin-right: 0.35rem;
}
.basis.loose { color: var(--text-muted); border-color: #444; }
.oneline {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-style: normal;
}
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.tagpill { font-size: 0.75rem; color: var(--gold-dim); font-style: normal; }
article.movie { align-items: flex-start; }
article.movie details { flex: 1; min-width: 0; }
article.movie summary { list-style: none; cursor: pointer; }
article.movie summary::-webkit-details-marker { display: none; }
article.movie summary h2 {
  font-family: "Noto Sans KR", system-ui, sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
  color: inherit;
}
article.movie.watched summary h2 { color: var(--gold); }
.detail {
  margin-top: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid #2a2a2a;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.detail h3 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}
.detail p { font-size: 0.9rem; color: var(--text); }
.shared-note { color: var(--gold-dim); font-size: 0.78rem; }
.tag-btn .name { font-weight: 600; }
footer a { color: var(--gold-dim); text-decoration: none; }
footer a:hover { color: var(--gold); }
.movie[hidden] { display: none !important; }

/* Coupang Partners footer banner (광고) */
.cpb { max-width: 640px; margin: 2.5rem auto 0; padding: 0; text-align: left; }
.cpb-link { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--gold-border); border-radius: var(--radius); background: var(--bg-card); color: var(--text); font-size: 14px; line-height: 1.5; text-decoration: none; word-break: keep-all; transition: border-color .15s ease, color .15s ease; }
.cpb-link:hover, .cpb-link:focus-visible { border-color: var(--gold); color: var(--gold); text-decoration: none; }
.cpb-label { flex-shrink: 0; padding: 1px 6px; border: 1px solid var(--gold-border); border-radius: 4px; color: var(--text-dim); font-size: 11px; line-height: 1.5; }
.cpb-copy { flex: 1; min-width: 0; }
.cpb-arrow { flex-shrink: 0; color: var(--gold); }
.cpb-note { margin: 8px 0 0; color: var(--text-dim); font-size: 11px; line-height: 1.6; text-align: center; word-break: keep-all; }

.group-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .8rem; }
.list-group {
  margin: 1.05rem 0 0.45rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gold);
}
.group-filter + .list-group { margin-top: 0.15rem; }
.movie .plot { font-size: .82rem; opacity: .8; margin-top: .25rem; line-height: 1.4; }
/* Check confirmation dialog */
.check-confirm-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; padding: 20px; }
.check-confirm { background: var(--bg-elevated); border: 1px solid var(--gold-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 20px 16px; width: 100%; max-width: 360px; }
.check-confirm-msg { color: var(--text); font-size: 0.98rem; line-height: 1.55; margin-bottom: 16px; word-break: keep-all; }
.check-confirm-btns { display: flex; gap: 8px; justify-content: flex-end; }
.check-confirm-btns button { font: inherit; font-size: 0.9rem; padding: 8px 18px; border-radius: 8px; cursor: pointer; border: 1px solid #333; background: var(--bg-card); color: var(--text-muted); }
.check-confirm-btns .check-confirm-ok { background: var(--gold-soft); border-color: var(--gold-border); color: var(--gold); font-weight: 600; }
.check-confirm-btns button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
