:root {
  color-scheme: dark;
  --bg: #071019;
  --bg-raised: #0a1520;
  --surface: #0e1b27;
  --surface-raised: #132331;
  --surface-hover: #172a38;
  --line: rgba(164, 195, 206, 0.12);
  --line-strong: rgba(164, 195, 206, 0.2);
  --text: #edf4f3;
  --muted: #91a4af;
  --muted-soft: #6f8591;
  --teal: #73d5ca;
  --teal-soft: rgba(115, 213, 202, 0.14);
  --blue: #89aef5;
  --amber: #e8b66f;
  --danger: #f08080;
  --success: #83d1ad;
  --font-sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.app-root { min-height: 100vh; }

/* Shared controls */
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 10px; padding: 0 18px; border: 1px solid transparent; border-radius: 13px; cursor: pointer; font-size: 13px; font-weight: 650; letter-spacing: 0.01em; text-decoration: none; transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, color 160ms ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: 0.48; cursor: not-allowed; }
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { background: var(--teal); color: #06201f; }
.button-primary:hover:not(:disabled) { background: #8be4d9; }
.button-secondary { background: rgba(13, 27, 38, 0.72); border-color: var(--line-strong); color: var(--text); }
.button-secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: rgba(115, 213, 202, 0.42); }
.button-quiet { background: transparent; border-color: var(--line); color: var(--muted); }
.button-quiet:hover:not(:disabled) { color: var(--text); background: var(--surface-raised); }
.button-danger { background: rgba(240, 128, 128, 0.12); border-color: rgba(240, 128, 128, 0.25); color: #ffc3c0; }
.button-wide { width: 100%; }
.icon-button { display: inline-grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 13px; background: transparent; color: var(--muted); cursor: pointer; transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease; }
.icon-button:hover { background: var(--surface-raised); color: var(--text); border-color: var(--line); }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--teal); cursor: pointer; font-size: 12px; font-weight: 650; }
.text-button:hover { color: #a6eee6; text-decoration: underline; text-underline-offset: 3px; }
.eyebrow { margin: 0; color: var(--teal); font-size: 10px; font-weight: 700; letter-spacing: 0.19em; text-transform: uppercase; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-mark { position: relative; display: inline-flex; width: 34px; height: 34px; align-items: flex-end; justify-content: center; gap: 3px; padding: 8px; overflow: hidden; border: 1px solid rgba(115, 213, 202, 0.35); border-radius: 11px; background: linear-gradient(145deg, rgba(115, 213, 202, 0.14), rgba(137, 174, 245, 0.06)); }
.brand-mark span { width: 4px; border-radius: 5px 5px 1px 1px; background: var(--teal); }
.brand-mark span:nth-child(1) { height: 8px; opacity: 0.72; }
.brand-mark span:nth-child(2) { height: 14px; }
.brand-mark span:nth-child(3) { height: 10px; opacity: 0.82; }
.brand-copy { display: grid; gap: 1px; line-height: 1; }
.brand-copy strong { font-size: 12px; font-weight: 750; letter-spacing: 0.16em; }
.brand-copy small { color: var(--muted-soft); font-size: 8px; font-weight: 650; letter-spacing: 0.2em; }

/* Sign-in and setup state */
.auth-screen { display: grid; min-height: 100vh; grid-template-columns: minmax(390px, 0.94fr) minmax(420px, 1.06fr); background: var(--bg); }
.auth-panel { display: flex; width: min(100%, 520px); flex-direction: column; justify-content: center; justify-self: center; padding: 44px clamp(28px, 6vw, 88px); }
.brand-auth { align-self: flex-start; margin-bottom: 62px; }
.auth-intro { margin-bottom: 29px; }
.auth-intro .eyebrow { margin-bottom: 14px; }
.auth-intro h1 { margin: 0; font-size: clamp(36px, 4vw, 54px); font-weight: 520; letter-spacing: -0.055em; line-height: 1.04; }
.auth-intro h1 em { color: var(--teal); font-family: var(--font-serif); font-weight: 400; }
.auth-copy { max-width: 370px; margin: 18px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.auth-form { display: grid; gap: 10px; }
.field-label { color: #dce6e5; font-size: 12px; font-weight: 600; }
.auth-form input, .field-control, .toolbar-select, .search-field input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(14, 27, 39, 0.82); color: var(--text); outline: none; }
.auth-form input { margin-bottom: 8px; }
.auth-form input::placeholder, .search-field input::placeholder { color: #5f7480; }
.auth-form input:focus, .field-control:focus, .toolbar-select:focus, .search-field input:focus { border-color: rgba(115, 213, 202, 0.66); box-shadow: 0 0 0 3px rgba(115, 213, 202, 0.08); }
.auth-form input:disabled { opacity: 0.52; cursor: not-allowed; }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.auth-form .button { margin-top: 7px; }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 25px 0 16px; color: var(--muted-soft); font-size: 9px; font-weight: 700; letter-spacing: 0.16em; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.auth-footnote { max-width: 350px; margin: 12px auto 0; color: var(--muted-soft); font-size: 10px; line-height: 1.6; text-align: center; }
.form-status { min-height: 18px; margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.form-status.is-error { color: #f3a7a4; }
.form-status.is-success { color: var(--success); }
.setup-notice { display: flex; gap: 11px; margin: 0 0 20px; padding: 13px 14px; border: 1px solid rgba(232, 182, 111, 0.28); border-radius: 13px; background: rgba(232, 182, 111, 0.08); color: #f3d4a5; }
.notice-icon { display: grid; width: 20px; height: 20px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(232, 182, 111, 0.56); border-radius: 50%; font-family: var(--font-serif); font-size: 13px; font-style: italic; }
.setup-notice strong { display: block; margin-bottom: 2px; font-size: 12px; }
.setup-notice p { margin: 0; color: #c3a982; font-size: 11px; line-height: 1.55; }
.reset-panel { padding: 2px 0 0; }
.reset-panel h2 { margin: 0 0 5px; font-size: 20px; font-weight: 600; }
.reset-panel > p { margin: 0 0 19px; color: var(--muted); font-size: 12px; }
.reset-back { margin-top: 17px; }
.auth-art { position: relative; min-height: 100vh; overflow: hidden; background: #091723; }
.auth-art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 61% center; }
.auth-art-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 13, 19, 0.08) 0%, rgba(5, 13, 19, 0.12) 36%, rgba(5, 13, 19, 0.83) 100%), linear-gradient(90deg, rgba(6, 15, 21, 0.18), transparent 45%); }
.art-caption { position: absolute; right: clamp(26px, 5vw, 72px); bottom: clamp(34px, 6vh, 74px); left: clamp(26px, 5vw, 72px); }
.art-index { color: rgba(227, 241, 239, 0.72); font-size: 9px; font-weight: 700; letter-spacing: 0.18em; }
.art-caption p { margin: 15px 0 18px; font-family: var(--font-serif); font-size: clamp(27px, 3vw, 40px); font-weight: 400; letter-spacing: -0.025em; line-height: 1.18; }
.art-caption-rule { display: block; width: 38px; height: 2px; margin-bottom: 12px; background: var(--teal); }
.art-caption-note { color: rgba(220, 232, 231, 0.72); font-size: 11px; }
.art-orbit { position: absolute; top: 12%; right: 13%; width: 116px; height: 116px; border: 1px solid rgba(198, 227, 225, 0.19); border-radius: 50%; }
.art-orbit::before, .art-orbit::after { position: absolute; top: 50%; left: 50%; border: 1px solid rgba(198, 227, 225, 0.12); border-radius: 50%; content: ""; transform: translate(-50%, -50%); }
.art-orbit::before { width: 76px; height: 76px; }
.art-orbit::after { width: 32px; height: 32px; }
.art-orbit span { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--teal); }
.art-orbit span:first-child { top: 20px; right: 13px; }
.art-orbit span:last-child { bottom: 27px; left: 12px; width: 3px; height: 3px; background: var(--amber); }

/* Main app frame */
.app-screen { min-height: 100vh; background: radial-gradient(ellipse at 70% -30%, rgba(41, 91, 102, 0.13), transparent 45%), var(--bg); }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; display: flex; width: 238px; flex-direction: column; padding: 24px 15px 18px; border-right: 1px solid var(--line); background: rgba(8, 18, 27, 0.96); }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 10px; }
.sidebar-close, .mobile-menu-button { display: none; }
.sidebar-section-label { margin: 42px 10px 13px; color: #59717d; font-size: 9px; font-weight: 750; letter-spacing: 0.17em; }
.side-nav { display: grid; gap: 4px; }
.nav-item { display: flex; min-height: 42px; align-items: center; gap: 12px; padding: 0 11px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: #9cabb3; cursor: pointer; text-align: left; transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease; }
.nav-item:hover { background: rgba(255, 255, 255, 0.035); color: var(--text); }
.nav-item[aria-current="page"] { border-color: rgba(115, 213, 202, 0.12); background: linear-gradient(90deg, rgba(115, 213, 202, 0.12), rgba(115, 213, 202, 0.045)); color: #d8f3ef; }
.nav-item[aria-current="page"] .nav-icon { color: var(--teal); }
.nav-icon { display: inline-grid; width: 19px; height: 19px; flex: 0 0 auto; place-items: center; color: #718793; }
.nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.nav-item-label { flex: 1; font-size: 12px; font-weight: 550; }
.nav-item-count { color: #6d808b; font-size: 10px; }
.nav-group-spacer { height: 12px; }
.sidebar-spacer { flex: 1; }
.sidebar-bottom { display: grid; gap: 15px; padding: 16px 8px 1px; border-top: 1px solid var(--line); }
.sidebar-privacy { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.privacy-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 12px rgba(115, 213, 202, 0.38); }
.sidebar-privacy strong, .sidebar-privacy small { display: block; }
.sidebar-privacy strong { color: #ced9d9; font-size: 10px; font-weight: 600; }
.sidebar-privacy small { margin-top: 2px; color: #6f838e; font-size: 9px; }
.logout-button { display: flex; min-height: 38px; align-items: center; gap: 10px; padding: 0 4px; border: 0; background: transparent; color: #7e929d; cursor: pointer; font-size: 11px; text-align: left; }
.logout-button:hover { color: #ffc3c0; }
.logout-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.workspace { min-height: 100vh; margin-left: 238px; }
.topbar { position: sticky; z-index: 15; top: 0; display: flex; height: 70px; align-items: center; gap: 22px; padding: 0 clamp(23px, 4.1vw, 58px); border-bottom: 1px solid rgba(164, 195, 206, 0.08); background: rgba(7, 16, 25, 0.84); backdrop-filter: blur(18px); }
.global-search { display: flex; width: min(390px, 44vw); height: 39px; align-items: center; gap: 10px; padding: 0 11px; border: 1px solid rgba(164, 195, 206, 0.11); border-radius: 11px; background: rgba(14, 27, 39, 0.55); color: var(--muted-soft); }
.global-search > svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.global-search input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font-size: 11px; }
.global-search input::placeholder { color: #667c88; }
.global-search input:focus-visible { outline: none; }
.global-search kbd { display: grid; min-width: 20px; height: 20px; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: #728894; font: 10px var(--font-sans); }
.topbar-actions { display: flex; align-items: center; gap: 15px; margin-left: auto; }
.connection-indicator { display: inline-flex; align-items: center; gap: 7px; color: #8ca09f; font-size: 10px; }
.connection-indicator > span:first-child { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px rgba(115, 213, 202, 0.4); }
.user-chip { display: flex; align-items: center; gap: 9px; }
.user-avatar { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid rgba(115, 213, 202, 0.3); border-radius: 50%; background: rgba(115, 213, 202, 0.12); color: #9ae7de; font-size: 11px; font-weight: 700; }
.user-email { max-width: 155px; overflow: hidden; color: #bdc9ca; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.main-content { width: min(100%, 1510px); min-height: calc(100vh - 70px); margin: 0 auto; padding: 32px clamp(23px, 4.1vw, 58px) 64px; }
.mobile-nav { display: none; }
.sidebar-scrim { display: none; }

/* Page layout and status */
.page-stack { display: grid; gap: 30px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-heading h1 { margin: 7px 0 5px; font-size: clamp(27px, 3vw, 36px); font-weight: 570; letter-spacing: -0.045em; line-height: 1.12; }
.page-heading p { max-width: 570px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.page-heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.preview-banner { display: flex; align-items: center; gap: 10px; padding: 10px 13px; border: 1px solid rgba(137, 174, 245, 0.18); border-radius: 12px; background: rgba(137, 174, 245, 0.065); color: #c7d6f4; font-size: 11px; }
.preview-banner strong { color: #e3ebfb; font-weight: 700; }
.preview-banner svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: var(--blue); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.preview-exit { margin-left: auto; padding: 4px 7px; border: 0; background: transparent; color: #9eb6eb; cursor: pointer; font-size: 10px; font-weight: 650; }
.preview-exit:hover { color: white; }

/* Dashboard hero */
.hero-card { position: relative; display: flex; min-height: 288px; align-items: flex-end; overflow: hidden; border: 1px solid rgba(183, 220, 221, 0.12); border-radius: 22px; background: #10212c; isolation: isolate; }
.hero-card-image { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 54%; }
.hero-card::after { position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgba(5, 13, 19, 0.94) 0%, rgba(5, 13, 19, 0.67) 38%, rgba(5, 13, 19, 0.12) 100%), linear-gradient(0deg, rgba(5, 13, 19, 0.53), transparent 65%); content: ""; }
.hero-copy { width: min(580px, 75%); padding: 31px 34px 30px; }
.hero-copy .eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.hero-copy .eyebrow::before { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); content: ""; }
.hero-copy h2 { max-width: 440px; margin: 14px 0 10px; font-size: clamp(29px, 4vw, 43px); font-weight: 520; letter-spacing: -0.05em; line-height: 1.04; }
.hero-copy h2 em { color: #a5e5dc; font-family: var(--font-serif); font-weight: 400; }
.hero-copy p { max-width: 410px; margin: 0 0 20px; color: rgba(225, 237, 235, 0.77); font-size: 12px; line-height: 1.7; }
.hero-action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.hero-note { color: rgba(219, 232, 230, 0.65); font-size: 10px; }
.hero-serial { position: absolute; right: 24px; bottom: 22px; color: rgba(223, 239, 237, 0.62); font-family: var(--font-serif); font-size: 12px; letter-spacing: 0.08em; writing-mode: vertical-rl; }

/* Dashboard metrics and sections */
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { position: relative; min-height: 105px; padding: 17px 18px 15px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(145deg, rgba(18, 35, 48, 0.8), rgba(12, 24, 34, 0.7)); }
.metric-card::after { position: absolute; top: -25px; right: -24px; width: 76px; height: 76px; border: 1px solid rgba(115, 213, 202, 0.08); border-radius: 50%; box-shadow: 0 0 0 12px rgba(115, 213, 202, 0.018), 0 0 0 25px rgba(115, 213, 202, 0.014); content: ""; }
.metric-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.metric-icon { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid rgba(115, 213, 202, 0.15); border-radius: 9px; background: rgba(115, 213, 202, 0.07); color: var(--teal); }
.metric-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.metric-value { display: block; margin-top: 6px; font-size: 24px; font-weight: 580; letter-spacing: -0.055em; line-height: 1.1; }
.metric-caption { display: block; margin-top: 3px; color: #6d828c; font-size: 9px; }
.section-block { display: grid; gap: 14px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading h2 { margin: 0; font-size: 17px; font-weight: 580; letter-spacing: -0.02em; }
.section-heading p { margin: 3px 0 0; color: var(--muted-soft); font-size: 10px; }
.section-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--teal); cursor: pointer; font-size: 11px; font-weight: 620; }
.section-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Movie library */
.library-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.toolbar-spacer { flex: 1; }
.toolbar-select { width: auto; min-width: 132px; min-height: 39px; padding: 0 30px 0 12px; border-radius: 10px; color: #c6d1d1; font-size: 10px; }
.view-switch { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: rgba(13, 26, 37, 0.8); }
.view-switch button { display: grid; width: 31px; height: 30px; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #718590; cursor: pointer; }
.view-switch button[aria-pressed="true"] { background: rgba(115, 213, 202, 0.12); color: var(--teal); }
.view-switch svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.result-count { color: var(--muted-soft); font-size: 10px; }
.movie-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px 14px; }
.movie-card { min-width: 0; }
.poster-button { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; border: 1px solid rgba(164, 195, 206, 0.1); border-radius: 13px; background: #14232c; cursor: pointer; text-align: left; }
.poster-button::after { position: absolute; inset: 0; border: 1px solid transparent; border-radius: inherit; background: linear-gradient(180deg, transparent 45%, rgba(4, 10, 15, 0.54)); content: ""; pointer-events: none; transition: background 180ms ease; }
.poster-button:hover::after, .poster-button:focus-visible::after { background: linear-gradient(180deg, rgba(4, 10, 15, 0.02), rgba(4, 10, 15, 0.4)); }
.poster-image { width: 100%; aspect-ratio: 0.68; object-fit: cover; transition: transform 260ms ease, filter 260ms ease; }
.poster-button:hover .poster-image { transform: scale(1.035); filter: saturate(1.06); }
.poster-open-hint { position: absolute; z-index: 1; right: 10px; bottom: 10px; left: 10px; color: rgba(244, 249, 247, 0.92); font-size: 9px; font-weight: 600; letter-spacing: 0.04em; opacity: 0; transform: translateY(4px); transition: opacity 150ms ease, transform 150ms ease; }
.poster-button:hover .poster-open-hint, .poster-button:focus-visible .poster-open-hint { opacity: 1; transform: translateY(0); }
.movie-card-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; padding: 9px 1px 0; }
.movie-card-title { min-width: 0; }
.movie-card-title h3 { overflow: hidden; margin: 0; color: #e4ecea; font-size: 11px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.movie-card-title p { overflow: hidden; margin: 3px 0 0; color: var(--muted-soft); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.favorite-button { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; margin: -4px -5px 0 0; border: 0; border-radius: 8px; background: transparent; color: #738792; cursor: pointer; }
.favorite-button:hover, .favorite-button[aria-pressed="true"] { background: rgba(240, 128, 128, 0.08); color: #f09d9b; }
.favorite-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.favorite-button[aria-pressed="true"] svg { fill: rgba(240, 128, 128, 0.27); }
.movie-provider-tag { display: inline-flex; max-width: 100%; align-items: center; gap: 5px; overflow: hidden; color: #81949d; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.movie-provider-tag::before { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: #6b8490; content: ""; }
.movie-provider-tag.is-preview::before { background: var(--blue); }
.movie-grid.is-list { grid-template-columns: 1fr; gap: 8px; }
.movie-grid.is-list .movie-card { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(14, 27, 39, 0.58); }
.movie-grid.is-list .poster-button { width: 58px; border-radius: 8px; }
.movie-grid.is-list .poster-image { aspect-ratio: 0.74; }
.movie-grid.is-list .poster-open-hint, .movie-grid.is-list .poster-button::after { display: none; }
.movie-grid.is-list .movie-card-meta { align-items: center; padding: 0; }
.movie-grid.is-list .movie-card-title h3 { font-size: 12px; }
.movie-grid.is-list .movie-card-title p { font-size: 10px; }
.movie-grid.is-list .favorite-button { margin: 0; }
.pagination-row { display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 8px; color: var(--muted); font-size: 10px; }
.pagination-row .button { min-height: 35px; padding: 0 12px; font-size: 10px; }

/* Files */
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted-soft); font-size: 10px; }
.breadcrumbs button { padding: 2px 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.breadcrumbs button:hover, .breadcrumbs button[aria-current="page"] { color: var(--teal); }
.breadcrumbs svg { width: 12px; height: 12px; fill: none; stroke: #617782; stroke-width: 1.7; }
.file-list-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: rgba(13, 25, 36, 0.52); }
.file-table { width: 100%; border-collapse: collapse; text-align: left; }
.file-table th { height: 41px; padding: 0 13px; border-bottom: 1px solid var(--line); color: #718690; font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.file-table td { height: 55px; padding: 7px 13px; border-bottom: 1px solid rgba(164, 195, 206, 0.07); color: #b9c7c9; font-size: 10px; }
.file-table tr:last-child td { border-bottom: 0; }
.file-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.file-name-cell { display: flex; min-width: 180px; align-items: center; gap: 10px; }
.file-type-icon { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: rgba(137, 174, 245, 0.07); color: #9cb7ed; }
.file-type-icon.is-folder { background: rgba(232, 182, 111, 0.08); color: var(--amber); }
.file-type-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.file-name-button { max-width: min(340px, 35vw); overflow: hidden; padding: 0; border: 0; background: transparent; color: #e1e9e8; cursor: pointer; font-size: 10px; font-weight: 570; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.file-name-button:hover { color: var(--teal); }
.file-subline { display: block; margin-top: 2px; color: #6d828c; font-size: 8px; }
.file-row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.file-row-actions .icon-button { width: 33px; height: 33px; }
.file-row-actions .icon-button svg { width: 15px; height: 15px; }
.file-table-empty { padding: 0 !important; }
.file-table-empty .empty-state { margin: 24px; }

/* Providers, history, settings, admin */
.provider-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.provider-card { display: flex; min-height: 186px; flex-direction: column; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(150deg, rgba(18, 35, 48, 0.78), rgba(11, 22, 32, 0.75)); }
.provider-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.provider-mark { display: grid; width: 37px; height: 37px; place-items: center; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(255, 255, 255, 0.035); color: var(--teal); font-size: 12px; font-weight: 750; }
.provider-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 8px; }
.provider-status::before { width: 5px; height: 5px; border-radius: 50%; background: #81939c; content: ""; }
.provider-status.is-connected { color: #9ad9bd; border-color: rgba(131, 209, 173, 0.22); }
.provider-status.is-connected::before { background: var(--success); }
.provider-status.is-preview { color: #b8c9ef; border-color: rgba(137, 174, 245, 0.2); }
.provider-status.is-preview::before { background: var(--blue); }
.provider-card h3 { margin: 15px 0 5px; font-size: 14px; font-weight: 620; }
.provider-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.provider-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 15px; }
.provider-capability { color: #718792; font-size: 9px; }
.provider-card-footer .button { min-height: 32px; padding: 0 10px; font-size: 9px; }
.info-callout { display: flex; gap: 11px; padding: 14px 15px; border: 1px solid rgba(137, 174, 245, 0.16); border-radius: 13px; background: rgba(137, 174, 245, 0.055); color: #aebfce; font-size: 10px; line-height: 1.65; }
.info-callout svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: var(--blue); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.75fr); gap: 14px; }
.settings-card, .admin-card { padding: 19px; border: 1px solid var(--line); border-radius: 15px; background: rgba(13, 25, 36, 0.64); }
.settings-card h2, .admin-card h2 { margin: 0; font-size: 14px; font-weight: 620; }
.settings-card > p, .admin-card > p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.settings-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border-bottom: 0; }
.settings-row strong { display: block; color: #dce5e3; font-size: 10px; font-weight: 600; }
.settings-row small { display: block; margin-top: 3px; color: #778c96; font-size: 9px; line-height: 1.5; }
.settings-value { max-width: 58%; overflow-wrap: anywhere; color: #95a9b1; font-size: 9px; text-align: right; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 14px; text-align: left; }
.admin-table th { padding: 8px 10px; border-bottom: 1px solid var(--line); color: #718690; font-size: 8px; letter-spacing: 0.09em; text-transform: uppercase; }
.admin-table td { padding: 10px; border-bottom: 1px solid rgba(164, 195, 206, 0.07); color: #c3d0d0; font-size: 10px; }
.admin-row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.admin-row-actions .button { min-height: 30px; padding: 0 9px; font-size: 9px; }

/* Loading, empty, and error states */
.empty-state { display: grid; min-height: 210px; align-content: center; justify-items: center; padding: 30px 22px; border: 1px dashed rgba(164, 195, 206, 0.18); border-radius: 16px; background: rgba(14, 27, 39, 0.34); text-align: center; }
.empty-icon { display: grid; width: 44px; height: 44px; place-items: center; margin-bottom: 12px; border: 1px solid rgba(115, 213, 202, 0.17); border-radius: 14px; background: rgba(115, 213, 202, 0.07); color: var(--teal); }
.empty-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.empty-state h2, .empty-state h3 { margin: 0; font-size: 14px; font-weight: 620; }
.empty-state p { max-width: 400px; margin: 6px 0 14px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.empty-state .button { min-height: 36px; font-size: 10px; }
.loading-state { display: grid; gap: 13px; }
.skeleton { min-height: 98px; border: 1px solid rgba(164, 195, 206, 0.08); border-radius: 14px; background: linear-gradient(100deg, rgba(15, 30, 42, 0.7) 20%, rgba(28, 48, 61, 0.8) 38%, rgba(15, 30, 42, 0.7) 60%); background-size: 220% 100%; animation: shimmer 1.7s ease-in-out infinite; }
.skeleton.skeleton-hero { min-height: 275px; }
.skeleton-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.skeleton-poster { aspect-ratio: 0.68; border-radius: 12px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.error-state { display: grid; gap: 10px; padding: 17px; border: 1px solid rgba(240, 128, 128, 0.22); border-radius: 13px; background: rgba(240, 128, 128, 0.06); color: #f0c1bd; font-size: 11px; }
.error-state p { margin: 0; line-height: 1.6; }
.inline-message { margin: 8px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

/* Dialogs and toasts */
.app-dialog { width: min(560px, calc(100vw - 24px)); max-width: none; max-height: min(88vh, 760px); padding: 0; overflow: auto; border: 1px solid var(--line-strong); border-radius: 20px; background: #0b1822; color: var(--text); box-shadow: var(--shadow); }
.app-dialog::backdrop { background: rgba(1, 7, 11, 0.72); backdrop-filter: blur(5px); }
.dialog-content { position: relative; }
.dialog-close { position: absolute; z-index: 2; top: 13px; right: 13px; }
.detail-hero { position: relative; min-height: 220px; overflow: hidden; border-radius: 19px 19px 0 0; background: #14242f; }
.detail-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 38%; }
.detail-hero::after { position: absolute; inset: 0; background: linear-gradient(0deg, #0b1822 0%, rgba(11, 24, 34, 0.05) 88%); content: ""; }
.detail-body { position: relative; margin-top: -34px; padding: 0 23px 24px; }
.detail-body h2 { margin: 4px 0 7px; font-size: 26px; font-weight: 580; letter-spacing: -0.04em; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; }
.detail-meta span + span::before { margin-right: 9px; color: #4d626d; content: "•"; }
.detail-description { margin: 16px 0 18px; color: #a8b8bc; font-size: 11px; line-height: 1.75; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.dialog-form { display: grid; gap: 12px; padding: 24px; }
.dialog-form h2 { margin: 0 38px 2px 0; font-size: 19px; font-weight: 620; letter-spacing: -0.025em; }
.dialog-form > p { margin: -7px 0 4px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field { display: grid; gap: 6px; }
.form-field label { color: #c9d4d4; font-size: 10px; font-weight: 600; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 10px; background: #0e1d29; color: var(--text); font-size: 11px; }
.form-field textarea { min-height: 88px; resize: vertical; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #607580; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 5px; }
.toast-region { position: fixed; z-index: 80; right: 18px; bottom: 18px; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: min(360px, calc(100vw - 36px)); padding: 12px 15px; border: 1px solid var(--line-strong); border-radius: 12px; background: #122331; color: #e4eeec; box-shadow: var(--shadow); font-size: 11px; animation: toast-in 180ms ease-out both; }
.toast.is-error { border-color: rgba(240, 128, 128, 0.35); color: #ffd1cc; }
.toast.is-success { border-color: rgba(131, 209, 173, 0.3); color: #c2f0d7; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive behavior */
@media (max-width: 1180px) {
  .movie-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .provider-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .auth-screen { grid-template-columns: minmax(360px, 1fr) minmax(300px, 0.85fr); }
  .auth-panel { padding-right: 36px; padding-left: 36px; }
  .brand-auth { margin-bottom: 45px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .movie-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .connection-indicator { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 13px; }
  .auth-screen { display: block; min-height: 100svh; }
  .auth-panel { position: relative; z-index: 2; width: 100%; min-height: 100svh; justify-content: center; padding: 30px 24px 34px; background: linear-gradient(180deg, rgba(7, 16, 25, 0.92), rgba(7, 16, 25, 0.96)); }
  .auth-art { position: fixed; z-index: 0; inset: 0; min-height: 100svh; opacity: 0.38; }
  .auth-art > img { object-position: 64% center; }
  .auth-art-shade { background: linear-gradient(90deg, rgba(5, 13, 19, 0.63), rgba(5, 13, 19, 0.34)), linear-gradient(0deg, rgba(5, 13, 19, 0.85), transparent 70%); }
  .art-caption, .art-orbit { display: none; }
  .brand-auth { margin-bottom: 44px; }
  .auth-intro { margin-bottom: 24px; }
  .auth-intro h1 { font-size: clamp(38px, 11vw, 50px); }
  .auth-copy { max-width: 410px; font-size: 13px; }
  .auth-form input { min-height: 49px; }
  .auth-footnote { color: #8ca0a8; }
  .sidebar { z-index: 50; width: min(300px, 86vw); transform: translateX(-101%); transition: transform 210ms ease; box-shadow: 28px 0 55px rgba(0, 0, 0, 0.27); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close, .mobile-menu-button { display: inline-grid; }
  .sidebar-section-label { margin-top: 30px; }
  .workspace { margin-left: 0; }
  .topbar { height: 60px; gap: 9px; padding: 0 15px; }
  .global-search { width: min(100%, 390px); height: 38px; gap: 7px; padding: 0 9px; }
  .global-search kbd { display: none; }
  .global-search input { font-size: 10px; }
  .topbar-actions { gap: 6px; }
  .top-settings { width: 36px; height: 36px; }
  .user-chip { gap: 0; }
  .user-avatar { width: 30px; height: 30px; }
  .user-email { display: none; }
  .main-content { min-height: calc(100svh - 126px); padding: 24px 16px 92px; }
  .sidebar-scrim { position: fixed; z-index: 40; inset: 0; display: block; border: 0; background: rgba(2, 8, 12, 0.58); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
  .sidebar-scrim.is-visible { opacity: 1; pointer-events: auto; }
  .mobile-nav { position: fixed; z-index: 25; right: 0; bottom: 0; left: 0; display: grid; min-height: calc(64px + env(safe-area-inset-bottom)); grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; padding: 6px 7px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(164, 195, 206, 0.12); background: rgba(8, 18, 27, 0.96); backdrop-filter: blur(18px); }
  .mobile-nav .nav-item { min-height: 48px; flex-direction: column; justify-content: center; gap: 3px; padding: 4px 2px; border-radius: 10px; }
  .mobile-nav .nav-icon { width: 20px; height: 20px; }
  .mobile-nav .nav-icon svg { width: 18px; height: 18px; }
  .mobile-nav .nav-item-label { max-width: 100%; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-nav .nav-item-count { display: none; }
  .page-stack { gap: 23px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 29px; }
  .page-heading p { font-size: 11px; }
  .page-heading-actions { justify-content: flex-start; }
  .hero-card { min-height: 295px; border-radius: 17px; }
  .hero-copy { width: 95%; padding: 23px 20px; }
  .hero-copy h2 { max-width: 330px; font-size: clamp(28px, 8.5vw, 38px); }
  .hero-copy p { max-width: 300px; font-size: 10px; }
  .hero-serial { right: 13px; bottom: 14px; font-size: 9px; }
  .metric-grid { gap: 8px; }
  .metric-card { min-height: 90px; padding: 12px; border-radius: 12px; }
  .metric-label { font-size: 9px; }
  .metric-icon { width: 24px; height: 24px; border-radius: 8px; }
  .metric-icon svg { width: 13px; height: 13px; }
  .metric-value { margin-top: 4px; font-size: 21px; }
  .metric-caption { font-size: 8px; }
  .section-heading h2 { font-size: 15px; }
  .movie-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px 10px; }
  .poster-button { border-radius: 10px; }
  .movie-card-meta { padding-top: 7px; }
  .movie-card-title h3 { font-size: 9px; }
  .movie-card-title p { font-size: 8px; }
  .favorite-button { width: 25px; height: 25px; }
  .favorite-button svg { width: 14px; height: 14px; }
  .library-toolbar { gap: 7px; }
  .toolbar-spacer { display: none; }
  .toolbar-select { min-width: 0; flex: 1 1 118px; min-height: 37px; padding-left: 9px; font-size: 9px; }
  .view-switch { flex: 0 0 auto; }
  .result-count { flex-basis: 100%; }
  .provider-grid { grid-template-columns: 1fr; }
  .provider-card { min-height: 165px; }
  .settings-grid { grid-template-columns: 1fr; }
  .file-list-wrap { overflow: visible; border: 0; background: transparent; }
  .file-table, .file-table tbody { display: block; width: 100%; min-width: 0; }
  .file-table thead { display: none; }
  .file-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; min-height: 72px; margin-bottom: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(13, 25, 36, 0.72); }
  .file-table tbody td { height: auto; padding: 0; border: 0; font-size: 8px; }
  .file-table tbody td:first-child { grid-column: 1; grid-row: 1 / 5; align-self: center; }
  .file-table tbody td:nth-child(2) { grid-column: 2; grid-row: 1; max-width: 145px; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
  .file-table tbody td:nth-child(3) { grid-column: 2; grid-row: 2; text-align: right; }
  .file-table tbody td:nth-child(4) { grid-column: 2; grid-row: 3; text-align: right; }
  .file-table tbody td:last-child { grid-column: 2; grid-row: 4; justify-self: end; }
  .file-name-cell { min-width: 0; }
  .file-name-button { max-width: calc(100vw - 155px); }
  .mobile-nav .nav-item[data-route="settings"] { display: none; }
  .dialog-form { padding: 20px 17px; }
  .detail-body { padding-right: 17px; padding-left: 17px; }
}
@media (max-width: 430px) {
  .topbar { gap: 4px; padding-right: 10px; padding-left: 8px; }
  .mobile-menu-button { width: 36px; height: 36px; }
  .global-search { gap: 5px; padding-right: 7px; padding-left: 7px; }
  .global-search > svg { width: 14px; height: 14px; }
  .top-settings { width: 32px; height: 34px; }
  .top-settings svg { width: 17px; height: 17px; }
  .main-content { padding-right: 13px; padding-left: 13px; }
  .page-heading { flex-direction: column; }
  .page-heading-actions { width: 100%; }
  .page-heading-actions .button { flex: 1; }
  .hero-copy { padding-right: 17px; padding-left: 17px; }
  .metric-card { padding: 10px; }
  .metric-label { align-items: flex-start; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .movie-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 11px; }
  .movie-grid.is-list .movie-card { grid-template-columns: 52px minmax(0, 1fr); }
  .movie-grid.is-list .poster-button { width: 52px; }
  .form-row { grid-template-columns: 1fr; }
  .settings-row { gap: 10px; }
  .settings-value { max-width: 52%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
