:root {
  --blue: #1a73e8;
  --blue-dark: #1765cc;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --text: #202124;
  --muted: #5f6368;
  --line: #e0e3e7;
  --hover: #f1f3f4;
  --green: #188038;
  --amber: #f9ab00;
  --red: #d93025;
  --shadow-1: 0 1px 2px rgba(60,64,67,.15), 0 1px 3px rgba(60,64,67,.1);
  --shadow-2: 0 1px 3px rgba(60,64,67,.2), 0 4px 8px rgba(60,64,67,.15);
  --radius: 8px;
}

:root[data-theme="dark"] {
  --bg: #1b1c1f;
  --surface: #26272b;
  --text: #e4e6eb;
  --muted: #9aa0a6;
  --line: #3a3c40;
  --hover: #303136;
  --shadow-1: 0 1px 2px rgba(0,0,0,.5), 0 1px 3px rgba(0,0,0,.4);
  --shadow-2: 0 1px 3px rgba(0,0,0,.6), 0 4px 10px rgba(0,0,0,.5);
}

[data-theme="dark"] table.films thead th { background: #202124; }
[data-theme="dark"] .chip-person:hover,
[data-theme="dark"] .multipicker.active .mp-btn { background: #1f3147; color: #8ab4f8; }
[data-theme="dark"] .rating-kp { background: #3a2a17; color: #f0a868; }
[data-theme="dark"] .rating-imdb { background: #3a3413; color: #e4cf57; }
[data-theme="dark"] .flash { background: #3a3413; border-color: #9a7b00; color: #f3e08a; }
[data-theme="dark"] .avatar-fallback,
[data-theme="dark"] .viewer-av-fb { color: #fff; }
[data-theme="dark"] input:not(.search-input):not(#filter-text),
[data-theme="dark"] select,
[data-theme="dark"] textarea { background: var(--surface); color: var(--text); }
[data-theme="dark"] .filter-search,
[data-theme="dark"] .search-bar { background: var(--hover); }
[data-theme="dark"] .search-input,
[data-theme="dark"] #filter-text { color: var(--text); }
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #80868b; }

.theme-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.theme-btn:hover { background: var(--hover); color: var(--blue); }
.theme-btn svg { display: block; }
.theme-btn .ico-sun { display: none; }
[data-theme="dark"] .theme-btn .ico-moon { display: none; }
[data-theme="dark"] .theme-btn .ico-sun { display: block; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}
a { color: inherit; }
code { background: var(--hover); padding: 1px 5px; border-radius: 4px; font-size: 13px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  height: 64px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-left { justify-self: start; display: flex; align-items: center; gap: 14px; }
.topbar-users { gap: 6px; white-space: nowrap; }
.topbar-center { justify-self: center; }
.topbar-right { justify-self: end; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-icon { font-size: 22px; }
.brand-name { font-size: 20px; color: var(--muted); font-weight: 500; letter-spacing: .2px; }

.primary-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blue); color: #fff; border: none; cursor: pointer;
  font: 500 14px "Inter", Roboto, sans-serif;
  padding: 9px 18px; border-radius: 20px; text-decoration: none;
  box-shadow: var(--shadow-1); transition: background .15s, box-shadow .15s;
}
.primary-btn:hover { background: var(--blue-dark); box-shadow: var(--shadow-2); }
.primary-btn.lg { padding: 13px 28px; font-size: 16px; border-radius: 24px; }
.primary-btn.sm { padding: 6px 14px; font-size: 13px; }
.primary-btn.added { background: var(--green); }
.add-btn .plus { font-size: 18px; line-height: 1; }
.ghost-btn {
  display: inline-flex; align-items: center;
  background: var(--surface); color: var(--blue); border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 20px; cursor: pointer; text-decoration: none;
  font: 500 14px "Inter", Roboto, sans-serif;
}
.ghost-btn:hover { background: var(--hover); }
.text-btn { background: none; border: none; color: var(--blue); cursor: pointer; font: 500 14px Roboto; padding: 6px 0; }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 16px; padding: 4px 6px; border-radius: 50%; line-height: 1; }
.icon-btn:hover { background: var(--hover); }

.share-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.share-btn:hover { color: var(--blue); background: var(--hover); }
.share-btn svg { display: block; }
.share-card { max-width: 340px; }
.share-body { padding: 6px 22px 24px; text-align: center; }
.share-qr { width: 220px; height: 220px; image-rendering: pixelated; margin: 6px auto 18px; display: block; }
.share-link { display: flex; gap: 8px; }
.share-link input { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--text); }
.share-link input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(26,115,232,.18); }

.lang-wrap { display: inline-flex; align-items: center; gap: 4px; }
.lang-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.lang-btn:hover { color: var(--blue); background: var(--hover); }
.lang-btn svg { display: block; }
.lang-label { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .04em; }

.avatar-wrap { position: relative; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.avatar-fallback { background: var(--blue); color: #fff; font-weight: 500; }
.avatar-menu {
  position: absolute; right: 0; top: 46px; width: 230px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-2); padding: 14px; display: none; text-align: center;
}
.avatar-wrap:hover .avatar-menu { display: block; }
.avatar-menu-name { font-weight: 500; }
.avatar-menu-email { color: var(--muted); font-size: 12px; margin-bottom: 8px; }

.avatar-menu form { margin: 0; }
.avatar-menu .text-btn { display: block; width: 100%; text-align: center; padding: 8px 0; font: 500 14px Roboto, sans-serif; }
.avatar-menu #delete-account-btn { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }

.hero-browse { margin-top: 16px; }
.hero-browse a { color: var(--blue); text-decoration: none; }
.hero-browse a:hover { text-decoration: underline; }
.user-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.user-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-1); }
.user-card-link { display: flex; gap: 12px; align-items: center; padding: 12px 14px; text-decoration: none; }
.user-card-av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.user-card-av-fb { background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 500; font-size: 18px; }
.user-card-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.user-card-name { font-weight: 500; color: var(--text); }
.user-card-link:hover .user-card-name { color: var(--blue); }
.user-card-meta { font-size: 12px; color: var(--muted); }
.user-card-genres { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }

.site-footer { border-top: 1px solid var(--line); padding: 22px clamp(20px, 2vw, 48px); margin-top: 20px; text-align: center; color: var(--muted); }
.footer-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 13px; }
.footer-links a:hover { color: var(--blue); text-decoration: underline; }
.footer-tagline { font-size: 12px; margin: 0; }
.legal { max-width: 760px; margin: 0 auto; line-height: 1.6; }
.legal h1 { font-size: 26px; font-weight: 500; margin: 0 0 4px; }
.legal h2 { font-size: 16px; font-weight: 500; margin: 26px 0 6px; }
.legal p { color: var(--text); }
.legal-upd { color: var(--muted); font-size: 13px; margin-top: 0; }
.legal a, .legal code { color: var(--blue); }
.hero-consent { font-size: 12px; color: var(--muted); margin: 12px auto 0; max-width: 460px; }
.hero-consent a { color: var(--blue); text-decoration: none; }
.hero-consent a:hover { text-decoration: underline; }
.da-card { max-width: 420px; }
.da-body { padding: 4px 22px 22px; }
.da-warn { color: var(--text); line-height: 1.5; margin: 0 0 16px; }
.da-stage.hidden { display: none; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.field-label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); text-align: left; }
.captcha-box { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; user-select: none; }

.content { max-width: none; margin: 0 auto; padding: 24px clamp(20px, 2vw, 48px) 60px; }
.flash-zone { max-width: none; margin: 12px auto 0; padding: 0 clamp(20px, 2vw, 48px); }
.flash { background: #fef7e0; border: 1px solid var(--amber); color: #7a5900; padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.list-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.page-title { font-size: 22px; font-weight: 500; margin: 0; }
.count-chip { background: var(--hover); color: var(--muted); padding: 3px 10px; border-radius: 12px; font-size: 12px; }

.hero { text-align: center; padding: 64px 20px 80px; }
.hero-icon { font-size: 64px; }
.hero h1 { font-size: 32px; font-weight: 500; margin: 12px 0; }
.hero-sub { color: var(--muted); max-width: 560px; margin: 0 auto 18px; font-size: 16px; }
.hero-lead { max-width: 640px; margin: 0 auto 40px; font-size: 15px; line-height: 1.6; color: var(--text); }
.hero-about-h { font-size: 18px; font-weight: 500; margin: 0 0 20px; }
.hero-features { list-style: none; margin: 0 auto 44px; padding: 0; max-width: 920px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; text-align: left; }
.hero-feature { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-1); padding: 18px 20px; display: grid; gap: 6px; }
.hero-feature-ico { font-size: 26px; }
.hero-feature-t { font-weight: 500; font-size: 15px; }
.hero-feature-d { color: var(--muted); font-size: 13px; line-height: 1.5; }
.hero-cta { margin-top: 8px; }
.card-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-1); padding: 28px; }
.card-panel.narrow { max-width: 460px; margin: 48px auto; }
.stack { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.input { padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(26,115,232,.2); }

.empty { text-align: center; color: var(--muted); padding: 70px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 8px; }

.profile-layout { display: flex; gap: 20px; align-items: flex-start; }
.main-col { flex: 0 0 60%; max-width: 60%; min-width: 0; }
.side-col { flex: 1 1 0; min-width: 0; }
.recent-col { order: 1; }
.main-col { order: 2; }
.wishlist-col { order: 3; }

.wishlist-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-1); overflow: hidden; }
.wishlist-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.wishlist-head h2 { margin: 0; font-size: 14px; font-weight: 500; }
.wl-add { width: 28px; height: 28px; font-size: 20px; line-height: 1; color: var(--blue); display: inline-flex; align-items: center; justify-content: center; }
.wl-add:hover { background: var(--hover); }
.wishlist-empty { padding: 16px 14px; color: var(--muted); font-size: 12px; }
.wishlist-items { list-style: none; margin: 0; padding: 0; }
.wl-item { position: relative; padding: 10px; border-bottom: 1px solid var(--line); }
.wl-item:last-child { border-bottom: none; }
.wl-main { display: flex; gap: 10px; align-items: flex-start; text-decoration: none; }
.wl-poster { width: 40px; height: 58px; object-fit: cover; border-radius: 4px; box-shadow: var(--shadow-1); flex: 0 0 auto; }
.wl-poster-empty { display: inline-flex; align-items: center; justify-content: center; background: var(--hover); font-size: 18px; }
.wl-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wl-title { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wl-main:hover .wl-title { color: var(--blue); text-decoration: underline; }
.wl-sub { font-size: 11px; color: var(--muted); }
.wl-genres { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.chip-sm { padding: 1px 7px; font-size: 11px; margin: 0; }

.wl-actions, .rv-actions { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.wl-actions { display: flex; gap: 6px; align-items: stretch; }
.rv-actions { display: flex; flex-direction: column; gap: 6px; }
.wl-action-btn { flex: 1 1 auto; min-width: 0; background: var(--surface); border: 1px solid var(--line); color: var(--blue); border-radius: 16px; padding: 5px 10px; font: 500 12px "Inter", Roboto, sans-serif; cursor: pointer; }
.wl-action-btn:hover { background: var(--hover); }
.rv-actions .wl-action-btn { width: 100%; }
.wl-action-btn.done { color: var(--green); border-color: var(--green); }
.wl-pin-btn { flex: 0 0 auto; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--line); color: var(--muted); border-radius: 50%; cursor: pointer; transition: color .12s, border-color .12s, background .12s; }
.wl-pin-btn:hover { background: var(--hover); color: var(--text); }
.wl-pin-btn.pinned { color: var(--blue); border-color: var(--blue); background: rgba(26,115,232,.10); }
.wl-pinned { background: rgba(26,115,232,.045); }

.rv-user { display: flex; align-items: center; gap: 6px; text-decoration: none; margin-top: 8px; }
.rv-av { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.rv-av-fb { background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; }
.rv-name { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.rv-user:hover .rv-name { color: var(--blue); }
.rv-rating { font-size: 15px; flex: 0 0 auto; }
.wl-remove-form { position: absolute; top: 4px; right: 4px; margin: 0; }
.wl-remove { display: inline-flex; align-items: center; justify-content: center; padding: 0; background: var(--surface); border: 1px solid var(--line); color: var(--muted); width: 20px; height: 20px; border-radius: 50%; font-size: 11px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s; }
.wl-item:hover .wl-remove { opacity: 1; }
.wl-remove:hover { color: var(--red); border-color: var(--red); }

.rating-picker { display: inline-flex; width: max-content; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.rp-btn { border: none; border-left: 1px solid var(--line); background: var(--surface); padding: 8px 18px; font-size: 18px; line-height: 1; cursor: pointer; }
.rp-btn:first-child { border-left: none; }
.rp-btn:hover { background: var(--hover); }

.rp-btn:focus { outline: none; }
.rp-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.rp-btn.active { background: rgba(26,115,232,.14); box-shadow: inset 0 0 0 1px var(--blue); }

.watched-grid { display: flex; flex-direction: column; gap: 14px; padding: 14px 22px 22px; }
.watched-grid label, .watched-grid .rg-field, .edit-grid .rg-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.watched-grid select, .watched-grid textarea { font: 400 14px Roboto, sans-serif; color: var(--text); background: var(--surface); padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.watched-grid select:focus, .watched-grid textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(26,115,232,.18); }
.watched-card { max-width: 420px; }

@media (max-width: 900px) {
  .profile-layout { flex-direction: column; }
  .main-col, .side-col { width: 100%; max-width: none; flex-basis: auto; }
  .main-col { order: -1; }
}

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.filter-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; flex: 1 1 240px; box-shadow: var(--shadow-1); }
.filter-search:focus-within { box-shadow: var(--shadow-2); }
.filter-search input { border: none; outline: none; background: transparent; font-size: 14px; width: 100%; }
.fs-icon { font-size: 15px; }
.filter-count { color: var(--muted); font-size: 13px; }

.multipicker { position: relative; }
.mp-btn { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font: 500 13px "Inter", Roboto, sans-serif; color: var(--text); cursor: pointer; }
.mp-btn:hover { background: var(--hover); }
.multipicker.active .mp-btn { border-color: var(--blue); color: var(--blue); background: #e8f0fe; }
.mp-caret { color: var(--muted); font-size: 11px; }
.mp-menu { position: absolute; top: 44px; left: 0; z-index: 40; min-width: 220px; max-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); padding: 6px; display: none; }
.multipicker.open .mp-menu { display: block; }
.mp-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.mp-item:hover { background: var(--hover); }
.mp-item[hidden] { display: none; }
.mp-item > span:first-of-type { flex: 1; }
.mp-n { color: var(--muted); font-size: 12px; }
.mp-search { position: sticky; top: 0; z-index: 1; padding: 2px 2px 6px; background: var(--surface); }
.mp-search-input { width: 100%; box-sizing: border-box; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font: 400 13px "Inter", Roboto, sans-serif; color: var(--text); background: var(--surface); }
.mp-search-input:focus { outline: none; border-color: var(--blue); }
.mp-empty { padding: 8px 10px; color: var(--muted); font-size: 13px; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-1); overflow-x: auto; }
table.films { width: 100%; border-collapse: collapse; }
table.films thead th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fafbfc;
}
table.films tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.films tbody tr:last-child td { border-bottom: none; }
table.films tbody tr:hover { background: var(--hover); }

.c-poster { width: 56px; }
.c-year { width: 56px; color: var(--muted); }
.c-own { width: 64px; text-align: center; }
.c-act { width: 78px; white-space: nowrap; }
.c-act form { display: inline; }

.poster { width: 44px; height: 64px; object-fit: cover; border-radius: 4px; box-shadow: var(--shadow-1); display: block; }
.poster-wrap { position: relative; display: inline-block; padding: 0; border: none; background: none; cursor: pointer; line-height: 0; }
.poster-wish-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 4px; color: #fff; font-size: 22px; font-weight: 700; opacity: 0; background: rgba(26,115,232,0); transition: opacity .12s, background .12s; }
.poster-wrap:hover .poster-wish-overlay { opacity: 1; background: rgba(26,115,232,.55); }
.poster-wrap.loading .poster-wish-overlay { opacity: 1; background: rgba(0,0,0,.45); }
.poster-wrap.added .poster-wish-overlay { opacity: 1; background: rgba(24,128,56,.62); }
.poster-empty { display: flex; align-items: center; justify-content: center; background: var(--hover); font-size: 22px; }
.film-title { font-weight: 500; }
.film-title-btn { background: none; border: none; padding: 0; font-family: inherit; font-size: inherit; color: var(--text); cursor: pointer; text-align: left; line-height: inherit; }
.film-title-btn:hover { color: var(--blue); text-decoration: underline; }
.film-orig { color: var(--muted); font-size: 12px; }
.film-kind { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }
.watched-mark { color: var(--green); font-weight: 500; }
[data-theme="dark"] .watched-mark { color: #81c995; }
.chip { display: inline-block; background: var(--hover); color: var(--muted); padding: 2px 9px; border-radius: 12px; font-size: 12px; margin: 0 4px 4px 0; }
.chip-person { text-decoration: none; cursor: pointer; transition: background .12s, color .12s; }
.chip-person:hover { background: #e8f0fe; color: var(--blue); }

.chip-filter { text-decoration: none; cursor: pointer; transition: background .12s, color .12s; }
.chip-filter:hover { background: #e8f0fe; color: var(--blue); }
.chip-active, .chip-active:hover { background: #d2e3fc; color: var(--blue); font-weight: 500; }
[data-theme="dark"] .chip-filter:hover { background: #1f3147; color: #8ab4f8; }
[data-theme="dark"] .chip-active, [data-theme="dark"] .chip-active:hover { background: #28406b; color: #8ab4f8; }

th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable::after { content: "⇅"; opacity: .35; margin-left: 4px; font-size: 11px; }
th.sortable.sort-asc::after { content: "▲"; opacity: 1; }
th.sortable.sort-desc::after { content: "▼"; opacity: 1; }

.rating { display: inline-block; text-decoration: none; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; margin: 0 4px 4px 0; border: 1px solid transparent; }
.rating-kp { background: #fff3e0; color: #e8730c; }
.rating-imdb { background: #fdf3c4; color: #9a7b00; }
.rating:hover { border-color: currentColor; }
.own { font-size: 20px; }

.c-views { white-space: nowrap; width: 96px; }
.views-btn { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; cursor: pointer; color: var(--muted); font: 500 13px Roboto, sans-serif; padding: 4px 7px; border-radius: 8px; }
.views-btn:hover { background: var(--hover); color: var(--blue); }
.views-btn .eye { display: block; }
.views-avg { color: var(--muted); }
.views-btn:hover .views-avg { color: var(--blue); }

.viewers-card { max-width: 480px; }
.viewers-body { max-height: 60vh; overflow-y: auto; padding: 6px 16px 18px; }
.viewers-empty { color: var(--muted); font-size: 13px; padding: 18px 6px; text-align: center; }
.viewer { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.viewer:last-child { border-bottom: none; }
.viewer-user { display: flex; align-items: center; gap: 8px; text-decoration: none; flex: 0 0 150px; min-width: 0; }
.viewer-av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.viewer-av-fb { background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; }
.viewer-name { font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-rating { font-size: 18px; flex: 0 0 auto; }
.viewer-comment { color: var(--muted); font-size: 13px; flex: 1; min-width: 0; }

.film-title-link { color: var(--text); text-decoration: none; font-weight: 500; }
.film-title-link:hover { color: var(--blue); text-decoration: underline; }

.rv-rating-badge { position: absolute; top: 8px; right: 8px; font-size: 16px; line-height: 1; z-index: 1; }
.recent-col .wl-info { padding-right: 16px; }

.on-platform { color: var(--green); }

.primary-btn.on-platform { background: var(--green); color: #fff; }
.primary-btn.on-platform:hover { background: #146c2e; }

.result-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.result-wish { width: 34px; height: 34px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--line); color: var(--muted); border-radius: 50%; cursor: pointer; transition: color .12s, border-color .12s, background .12s; }
.result-wish:hover { color: var(--green); border-color: var(--green); background: var(--hover); }
.result-wish.added { color: #fff; background: var(--green); border-color: var(--green); }
.result-wish.loading { opacity: .6; }

.admin-section { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-1); padding: 20px; max-width: 920px; }
.admin-h2 { font-size: 16px; font-weight: 500; margin: 0 0 6px; }
.admin-table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.admin-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.admin-actions { display: flex; gap: 10px; }
.admin-actions form { display: inline; margin: 0; }
.ticket-msg { white-space: pre-wrap; word-break: break-word; max-width: 480px; }
.admin-section + .admin-section { margin-top: 18px; }
.admin-layout { display: flex; gap: 20px; align-items: flex-start; }
.admin-col-main { flex: 1 1 0; min-width: 0; }
.admin-col-side { flex: 1 1 0; min-width: 0; }
.admin-layout .admin-section { max-width: none; }
.admin-usearch { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; }
.admin-usearch .input { flex: 1; min-width: 0; }
.admin-col-side .admin-table { font-size: 12px; }
.admin-col-side .admin-table td.muted.small { word-break: break-word; }
.admin-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.admin-pager .disabled { opacity: .4; pointer-events: none; }
.pager-info { font-size: 12px; color: var(--muted); }
.list-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 16px 0 4px; }
.list-pager .disabled { opacity: .4; pointer-events: none; }
@media (max-width: 1000px) {
  .admin-layout { flex-direction: column; }
  .admin-col-main, .admin-col-side { width: 100%; flex-basis: auto; }
}
.text-btn.danger { color: var(--red); }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500; white-space: nowrap; }
.tag-ok { background: #e6f4ea; color: var(--green); }
.tag-exhausted { background: #fce8e6; color: var(--red); }
.tag-off { background: var(--hover); color: var(--muted); }
[data-theme="dark"] .tag-ok { background: #1e3a28; color: #81c995; }
[data-theme="dark"] .tag-exhausted { background: #3a1f1d; color: #f28b82; }
.admin-add { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.admin-add .input { flex: 1 1 240px; }

.users-card { max-width: 600px; }
.users-search { display: flex; align-items: center; gap: 8px; margin: 8px 22px 0; padding: 8px 14px; background: var(--hover); border-radius: 999px; }
.users-search input { flex: 1; border: none; background: transparent; outline: none; font-size: 14px; color: var(--text); }
.users-body { max-height: 62vh; overflow-y: auto; padding: 12px 16px 18px; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--line); }
.users-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
.users-table tbody tr { cursor: pointer; }
.users-table tbody tr:hover { background: var(--hover); }
.users-table tbody tr:last-child td { border-bottom: none; }
.ut-name { font-weight: 500; }
.ut-count { text-align: center; font-weight: 500; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(32,33,36,.5); display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh; z-index: 50; }
.modal-backdrop.hidden { display: none; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: 0 8px 28px rgba(0,0,0,.28); width: 100%; max-width: 640px; }
.search-modal { padding: 8px; }
.search-bar { display: flex; align-items: center; gap: 10px; background: var(--hover); border-radius: 999px; padding: 8px 14px; }
.search-bar:focus-within { background: var(--surface); box-shadow: var(--shadow-2); }
.search-icon { font-size: 16px; }
.search-input { flex: 1; border: none; background: transparent; font-size: 16px; outline: none; }
.search-status { color: var(--muted); font-size: 13px; padding: 8px 16px; }
.search-results { list-style: none; margin: 0; padding: 4px; max-height: 60vh; overflow-y: auto; }
.result-section { display: flex; align-items: center; gap: 10px; padding: 8px 10px 4px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.result-section::before, .result-section::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.result { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 10px; }
.result:hover { background: var(--hover); }
.result-poster { width: 40px; height: 58px; border-radius: 4px; background: var(--hover); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto; }
.result-poster img { width: 100%; height: 100%; object-fit: cover; }
.result-main { flex: 1; min-width: 0; }
.result-title { font-weight: 500; }
.result-year { color: var(--muted); font-weight: 400; }
.result-meta { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal-header h3 { margin: 0; font-weight: 500; }
.edit-modal { padding-bottom: 22px; }
.edit-modal > .muted { padding: 0 22px; margin: 6px 0 16px; }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 22px; }
.edit-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.edit-grid .span2 { grid-column: 1 / -1; }
.edit-grid input, .edit-grid select, .edit-grid textarea {
  font: 400 14px Roboto, sans-serif; color: var(--text);
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; resize: vertical;
}
.edit-grid input:focus, .edit-grid select:focus, .edit-grid textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(26,115,232,.18); }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.actions-spacer { flex: 1; }
.ghost-btn.danger { color: var(--red); border-color: transparent; }
.ghost-btn.danger:hover { background: rgba(217,48,37,.10); border-color: var(--red); }

@media (max-width: 760px) {
  .topbar { grid-template-columns: auto 1fr auto; }
  .c-cast, .c-dir, .c-comment { display: none; }
  .edit-grid { grid-template-columns: 1fr; }
}
