:root {
  color-scheme: light;
  --ink: #17191d;
  --muted: #6d737d;
  --line: #e2e4e8;
  --line-strong: #cdd1d7;
  --surface: #ffffff;
  --surface-soft: #f6f7f8;
  --canvas: #eef0f2;
  --sidebar: #15171c;
  --sidebar-soft: #23262d;
  --accent: #00a9a5;
  --accent-dark: #087c7a;
  --accent-soft: #e1f7f5;
  --coral: #e65353;
  --violet: #7758d6;
  --warning: #b36a14;
  --shadow: 0 14px 42px rgba(20, 23, 30, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 14px; letter-spacing: 0; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
svg { width: 17px; height: 17px; flex: 0 0 auto; }
.hidden { display: none !important; }

.boot-view { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 16px; background: #f4f6f7; }
.boot-view img { border-radius: 50%; box-shadow: 0 8px 24px rgba(20, 23, 30, 0.14); }
.boot-pulse { width: 84px; height: 2px; overflow: hidden; border-radius: 2px; background: #dde1e4; }
.boot-pulse span { width: 42%; height: 100%; display: block; border-radius: inherit; background: var(--accent); animation: boot-slide 1.05s ease-in-out infinite; }
@keyframes boot-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(340%); }
}

.auth-view { min-height: 100vh; display: flex; flex-direction: column; background: #f4f6f7; }
.auth-header { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; background: #fff; border-bottom: 1px solid var(--line); }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.auth-brand img { border-radius: 50%; }
.auth-header > span { color: var(--muted); font-size: 11px; }
.auth-layout { width: min(1180px, calc(100% - 56px)); min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr); align-items: center; gap: 72px; margin: 0 auto; padding: 30px 0 34px; }
.auth-product-scene { min-width: 0; overflow: hidden; background: #16191f; border: 1px solid #2c3038; border-radius: 8px; box-shadow: 0 24px 60px rgba(20, 23, 30, 0.2); color: #eef1f4; }
.scene-topbar { height: 52px; display: flex; align-items: center; gap: 20px; padding: 0 18px; border-bottom: 1px solid #30343c; }
.scene-topbar > span:not(.scene-logo) { width: 58px; height: 6px; border-radius: 3px; background: #363b44; }
.scene-logo { width: 25px; height: 25px; margin-right: 8px; border-radius: 50%; background: var(--accent); }
.scene-search { height: 54px; display: flex; align-items: center; gap: 10px; margin: 18px; padding: 0 14px; border: 1px solid #434851; border-radius: 6px; background: #20242b; }
.scene-search svg { color: #8e96a2; }
.scene-search span { width: 68%; height: 7px; border-radius: 3px; background: #424852; }
.scene-body { display: grid; grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.1fr); min-height: 340px; border-top: 1px solid #30343c; }
.scene-results { border-right: 1px solid #30343c; }
.scene-tabs { height: 49px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid #30343c; }
.scene-tabs strong { font-size: 11px; }
.scene-tabs span { color: #8e96a2; font-size: 9px; }
.scene-row { min-height: 70px; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 9px; align-items: center; padding: 10px 15px; border-bottom: 1px solid #2b2f36; }
.scene-row.active { background: #1c3535; box-shadow: inset 3px 0 0 var(--accent); }
.scene-row b { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 4px; background: #343942; color: #b7bec8; font-size: 8px; }
.scene-row span, .scene-row strong, .scene-row small { display: block; min-width: 0; }
.scene-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.scene-row small { margin-top: 5px; color: #8d95a0; font-size: 8px; }
.scene-preview { padding: 18px; background: #1c2026; }
.scene-video { aspect-ratio: 16 / 9; display: grid; place-items: center; margin-bottom: 14px; background: #090b0e; color: #b9c0c9; }
.scene-video svg { width: 30px; height: 30px; }
.scene-preview > span, .scene-preview > strong, .scene-preview > small { display: block; }
.scene-preview > span { color: var(--accent); font-size: 8px; }
.scene-preview > strong { margin-top: 8px; font-size: 14px; }
.scene-preview > small { margin-top: 6px; color: #89919c; }
.auth-panel { width: 100%; max-width: 410px; justify-self: center; }
.auth-panel h1 { margin: 0; font-size: 31px; line-height: 1.15; }
.auth-account-line { margin: 10px 0 25px; color: var(--muted); line-height: 1.5; }
.google-button { width: 100%; height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink); font-weight: 700; }
.google-button:hover { border-color: #aeb4bc; background: #fafbfb; }
.google-mark { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: #4285f4; color: #fff; font-size: 11px; font-weight: 800; }
.auth-divider { height: 46px; display: flex; align-items: center; gap: 10px; color: #858b94; font-size: 10px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.login-form label { display: block; margin: 0 0 6px; color: #4f555e; font-size: 11px; font-weight: 700; }
.login-form > input, .password-field { width: 100%; height: 44px; margin-bottom: 15px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.login-form > input { padding: 0 11px; outline: 0; }
.password-field { display: flex; align-items: center; padding-left: 11px; }
.password-field:focus-within, .login-form > input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 169, 165, 0.1); }
.password-field input { min-width: 0; height: 100%; flex: 1; padding: 0; border: 0; outline: 0; background: transparent; }
.password-field .icon-button { border: 0; }
.login-button { width: 100%; min-height: 44px; margin-top: 2px; }
.auth-error { margin: 13px 0 0; padding: 10px 11px; border-left: 3px solid var(--coral); background: #fff0f0; color: #a73535; font-size: 11px; }
.perimeter-account { display: flex; align-items: center; gap: 9px; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.45; }
.perimeter-account svg { color: var(--accent-dark); }
.auth-legal { display: flex; gap: 16px; margin-top: 12px; font-size: 11px; }
.auth-legal a { color: var(--muted); }

.app-frame { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; background: var(--sidebar); color: #f5f7fa; border-right: 1px solid #262930; z-index: 20; }
.brand-row { height: 68px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 17px; border-bottom: 1px solid #292c33; }
.brand-home { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; color: inherit; }
.brand-logo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.brand-name { font-size: 19px; font-weight: 720; }
.sidebar-close { display: none !important; margin-left: auto; }
.workspace-switcher { margin: 14px 12px 10px; min-height: 52px; display: grid; grid-template-columns: 30px minmax(0, 1fr) 16px; align-items: center; gap: 9px; padding: 8px; color: inherit; background: var(--sidebar-soft); border: 1px solid #343842; border-radius: 7px; text-align: left; }
.workspace-switcher small { display: block; color: #9299a5; font-size: 10px; text-transform: uppercase; }
.workspace-switcher strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.workspace-switcher > svg { color: #8c939f; width: 14px; }
.workspace-mark { width: 30px; height: 30px; display: grid; place-items: center; background: var(--accent); color: #062d2c; border-radius: 6px; font-weight: 800; }
.primary-nav { padding: 2px 10px 9px; }
.nav-item, .project-nav-item { width: 100%; min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 9px; border: 0; border-radius: 6px; color: #b8bec8; background: transparent; text-align: left; }
.nav-item:hover, .project-nav-item:hover { color: #fff; background: #24272e; }
.nav-item.active, .project-nav-item.active { color: #fff; background: #2b2f37; }
.nav-count { margin-left: auto; color: #858c98; font-size: 12px; }
.sidebar-section-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 13px 7px 19px; color: #7f8793; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.sidebar .icon-button { color: #aeb4be; border-color: transparent; }
.project-nav { padding: 0 10px; overflow-y: auto; min-height: 0; }
.project-nav-item .project-icon { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.project-nav-item.private .project-icon { background: var(--violet); }
.project-nav-item span:nth-child(2) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.project-nav-item > svg { margin-left: auto; width: 13px; color: #727987; }
.sidebar-footer { width: 100%; margin-top: auto; min-height: 66px; display: flex; align-items: center; gap: 10px; padding: 12px 15px; border: 0; border-top: 1px solid #292c33; background: transparent; color: inherit; text-align: left; }
.sidebar-footer:hover { background: #20232a; }
.sidebar-footer > svg { margin-left: auto; width: 14px; color: #747c88; }
.user-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #f2c95c; color: #3c310f; font-size: 12px; font-weight: 800; }
.user-copy { min-width: 0; }
.user-copy strong, .user-copy span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.user-copy strong { font-size: 12px; }
.user-copy span { margin-top: 2px; color: #848b97; font-size: 10px; }
.account-menu { position: absolute; right: 10px; bottom: 69px; left: 10px; z-index: 4; padding: 6px; border: 1px solid #3a3e47; border-radius: 7px; background: #24272e; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32); }
.account-menu button { width: 100%; min-height: 36px; display: flex; align-items: center; gap: 9px; padding: 0 9px; border: 0; border-radius: 5px; background: transparent; color: #c8cdd5; text-align: left; font-size: 11px; }
.account-menu button:hover { background: #31353e; color: #fff; }
.account-menu button:last-child { color: #f09090; }
.sidebar-scrim { display: none; }

.main-shell { min-width: 0; min-height: 100vh; background: var(--surface-soft); }
.mobile-header { display: none; }
.projects-view { max-width: 1240px; margin: 0 auto; padding: 36px 42px 60px; }
.page-header, .project-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-header h1, .project-header h1 { margin: 0; font-size: 25px; line-height: 1.2; }
.page-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.workspace-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 30px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.workspace-summary > div { min-height: 82px; display: flex; flex-direction: column; justify-content: center; padding: 0 20px; border-right: 1px solid var(--line); }
.workspace-summary > div:last-child { border-right: 0; }
.workspace-summary span { color: var(--muted); font-size: 10px; }
.workspace-summary strong { margin-top: 5px; font-size: 22px; font-variant-numeric: tabular-nums; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-top: 30px; }
.section-heading h2 { margin: 0; font-size: 16px; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.project-toolbar { margin: 16px 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.filter-input { width: min(360px, 100%); height: 39px; display: flex; align-items: center; gap: 9px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.filter-input svg { color: #8a9098; }
.filter-input input { width: 100%; border: 0; outline: 0; background: transparent; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.project-card { min-width: 0; min-height: 168px; display: flex; flex-direction: column; padding: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease; }
.project-card:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(28, 31, 37, 0.08); }
.project-card button { border: 0; padding: 0; background: transparent; text-align: left; color: inherit; }
.project-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.project-folder { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: var(--accent-soft); color: var(--accent-dark); }
.project-card.private .project-folder { background: #eee9ff; color: var(--violet); }
.project-card h2 { margin: 14px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.project-card-description { min-height: 35px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; overflow: hidden; }
.project-card-meta { margin-top: auto; padding-top: 14px; display: flex; justify-content: space-between; gap: 10px; color: #7c828c; font-size: 11px; }
.owner-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.owner-dot { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #eceef1; color: #575c65; font-size: 8px; font-weight: 800; }
.owner-line span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-view { min-height: 300px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); border: 1px dashed var(--line-strong); }
.empty-view > svg { width: 28px; height: 28px; }
.empty-view h2 { margin: 0; color: var(--ink); font-size: 15px; }

.workspace-view { min-height: 100vh; display: flex; flex-direction: column; }
.project-header { min-height: 72px; padding: 11px 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.back-button { display: none !important; }
.project-title-block { min-width: 0; margin-right: auto; }
.project-title-line { display: flex; align-items: center; gap: 10px; }
.project-title-line h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-title-block > p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.visibility-badge { height: 24px; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border-radius: 999px; background: #edf5f4; color: #23706f; font-size: 10px; font-weight: 700; }
.visibility-badge.private { background: #eee9ff; color: #6645bd; }
.visibility-badge svg { width: 12px; }
.header-actions { display: flex; align-items: center; gap: 8px; }

.search-surface { padding: 15px 22px 11px; background: var(--surface); border-bottom: 1px solid var(--line); }
.search-form { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; gap: 10px; align-items: center; }
.search-input-wrap { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.search-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 169, 165, 0.11); }
.search-input-wrap svg { color: #7d838c; }
.search-input-wrap input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.segmented { display: inline-flex; align-items: center; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label span, .segmented button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 11px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font-size: 12px; white-space: nowrap; }
.segmented input:checked + span, .segmented button.active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 4px rgba(20, 23, 28, 0.12); }
.segmented svg { width: 14px; }
.segmented.compact button { min-height: 30px; }
.search-button { height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border: 0; border-radius: 6px; background: var(--ink); color: #fff; font-weight: 700; }
.search-button:hover { background: #2a2d33; }
.search-feedback { min-height: 26px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 280px); align-items: center; gap: 16px; padding-top: 8px; }
.status-group { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 11px; }
.status-group span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #8d949e; }
.status-group .loading { color: var(--accent-dark); }
.status-group .error { color: var(--coral); }
.progress-track { height: 4px; overflow: hidden; border-radius: 999px; background: #e3e6e9; }
.progress-bar { width: 0; height: 100%; background: var(--accent); transition: width 220ms ease; }

.search-workspace { min-height: 0; flex: 1; display: grid; grid-template-columns: 238px minmax(320px, 1fr) minmax(340px, 42%); background: var(--surface); }
.library-pane, .results-pane, .preview-pane { min-width: 0; min-height: 0; }
.library-pane { border-right: 1px solid var(--line); }
.pane-header { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px 0 16px; border-bottom: 1px solid var(--line); }
.pane-header h2 { margin: 0; font-size: 13px; }
.pane-header span { color: var(--muted); font-size: 10px; }
.video-list { height: calc(100vh - 222px); overflow-y: auto; padding: 7px; }
.video-row { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 26px; gap: 3px; align-items: center; border-radius: 5px; background: transparent; }
.video-row:hover { background: var(--surface-soft); }
.video-row.processing { background: #f2faf8; }
.video-row.failed { background: #fff6f5; }
.video-select { min-width: 0; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; align-items: center; padding: 9px; border: 0; background: transparent; color: inherit; text-align: left; }
.video-static { cursor: default; }
.video-delete { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: var(--muted); opacity: 0; }
.video-row:hover .video-delete, .video-delete:focus-visible { opacity: 1; }
.video-delete:hover { background: #fce8e6; color: #a62218; }
.video-delete svg { width: 13px; height: 13px; }
@media (hover: none) { .video-delete { opacity: 1; } }
.video-thumb { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 5px; background: #e8edf0; color: #59616a; }
.video-thumb svg { width: 14px; }
.video-row.processing .video-thumb { background: var(--accent-soft); color: var(--accent-dark); }
.video-row.failed .video-thumb { background: #fce8e6; color: #a62218; }
.video-row.processing .video-thumb svg { animation: video-status-spin 1.1s linear infinite; }
@keyframes video-status-spin { to { transform: rotate(360deg); } }
.video-copy { min-width: 0; }
.video-copy strong, .video-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-copy strong { font-size: 11px; }
.video-copy span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.empty-list { padding: 36px 14px; color: var(--muted); font-size: 11px; text-align: center; }

.results-pane { border-right: 1px solid var(--line); }
.result-tabs { height: 52px; display: flex; align-items: end; gap: 18px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.result-tab { position: relative; height: 100%; display: flex; align-items: center; gap: 7px; padding: 0 1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; }
.result-tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.result-tab > span:first-of-type { min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 5px; border-radius: 999px; background: #eceef1; color: #646a73; font-size: 9px; }
.new-result-dot { position: absolute; top: 10px; right: -5px; width: 6px; height: 6px; border-radius: 50%; background: var(--coral); }
.result-panel { display: none; }
.result-panel.active { display: block; }
.result-list { height: calc(100vh - 222px); overflow-y: auto; }
.result-card { width: 100%; display: block; padding: 13px 15px; border: 0; border-bottom: 1px solid #eceef0; background: #fff; color: inherit; text-align: left; }
.result-card:hover { background: #f8f9fa; }
.result-card.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.result-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.result-title { min-width: 0; display: flex; align-items: center; gap: 7px; }
.result-rank { width: 21px; height: 21px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 4px; background: #eceef1; color: #555b64; font-size: 9px; font-weight: 800; }
.result-card.active .result-rank { background: var(--accent); color: #042d2c; }
.result-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.result-duration { flex: 0 0 auto; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.result-time { margin: 7px 0 0 28px; color: var(--ink); font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; }
.result-reason { margin: 6px 0 0 28px; display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.preview-pane { display: flex; flex-direction: column; background: #fafafa; }
.preview-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 48vh; display: grid; place-items: center; background: #111318; }
.preview-stage video { width: 100%; height: 100%; object-fit: contain; }
.preview-placeholder { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 9px; color: #9299a5; pointer-events: none; }
.preview-placeholder svg { width: 26px; height: 26px; }
.preview-placeholder span { font-size: 11px; }
.preview-details { overflow-y: auto; padding: 18px 20px 28px; }
.preview-kicker { display: flex; justify-content: space-between; color: var(--accent-dark); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.preview-details h2 { margin: 8px 0 3px; overflow-wrap: anywhere; font-size: 16px; }
.preview-time { margin: 0; color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.preview-reason { margin: 14px 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.preview-details dl { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 6px 12px; margin: 15px 0 0; padding-top: 13px; border-top: 1px solid var(--line); font-size: 10px; }
.preview-details dt { color: var(--muted); }
.preview-details dd { margin: 0; overflow-wrap: anywhere; text-align: right; }

.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--ink); }
.icon-button:hover { background: rgba(128, 134, 143, 0.1); }
.primary-button, .secondary-button { min-height: 37px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border-radius: 6px; font-weight: 700; font-size: 12px; }
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: #fff; }
.primary-button:hover { background: #2b2e34; }
.secondary-button { border: 1px solid var(--line-strong); background: #fff; color: var(--ink); }
.danger-button { min-height: 37px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 1px solid #b42318; border-radius: 6px; background: #b42318; color: #fff; font-size: 12px; font-weight: 700; }
.danger-button:hover { background: #912018; }
.danger-button:disabled { opacity: 0.55; cursor: wait; }

.modal { width: min(520px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 8px; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(15, 17, 21, 0.56); }
.modal form { padding: 22px; }
.modal-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.modal-header h2 { margin: 0; font-size: 19px; }
.field-label { display: block; margin: 14px 0 6px; color: #4f555e; font-size: 11px; font-weight: 700; }
.text-field { width: 100%; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 6px; outline: 0; resize: vertical; }
.text-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 169, 165, 0.1); }
.visibility-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 17px 0 0; padding: 0; border: 0; }
.visibility-options legend { margin-bottom: 7px; color: #4f555e; font-size: 11px; font-weight: 700; }
.visibility-options label { cursor: pointer; }
.visibility-options input { position: absolute; opacity: 0; }
.visibility-options label > span { min-height: 78px; display: grid; grid-template-columns: 19px 1fr; grid-template-rows: auto auto; column-gap: 7px; padding: 11px; border: 1px solid var(--line); border-radius: 6px; }
.visibility-options input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.visibility-options svg { grid-row: 1 / 3; margin-top: 2px; color: var(--muted); }
.visibility-options strong { font-size: 11px; }
.visibility-options small { color: var(--muted); font-size: 9px; }
.danger-zone { margin-top: 18px; padding-top: 17px; border-top: 1px solid #efc9c5; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.danger-zone strong, .danger-zone span { display: block; }
.danger-zone strong { color: #8f1d15; font-size: 11px; }
.danger-zone span { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.confirm-modal form { text-align: center; }
.confirm-modal h2 { margin: 13px 0 7px; font-size: 18px; }
.confirm-modal p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.confirm-icon { width: 40px; height: 40px; display: grid; place-items: center; margin: 0 auto; border-radius: 50%; }
.confirm-icon.danger { background: #fce8e6; color: #a62218; }
.confirm-icon svg { width: 19px; height: 19px; }
.confirm-modal .modal-actions { justify-content: center; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.drop-zone { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 7px; border: 1px dashed #aeb4bc; border-radius: 7px; background: var(--surface-soft); color: var(--muted); cursor: pointer; }
.drop-zone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone svg { width: 28px; height: 28px; color: var(--accent-dark); }
.drop-zone strong { color: var(--ink); }
.drop-zone span { font-size: 11px; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.local-connector-note { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; background: #f1f8f7; }
.local-connector-note > svg { color: var(--accent-dark); }
.local-connector-note strong, .local-connector-note span { display: block; }
.local-connector-note strong { font-size: 11px; }
.local-connector-note span { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.local-connector-note a { color: var(--accent-dark); font-size: 10px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.local-connector-note a:hover { text-decoration: underline; }
.upload-progress { margin-top: 16px; }
.upload-progress > div:first-child { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.account-identity { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.account-identity strong, .account-identity span { display: block; }
.account-identity span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.password-section { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.password-section > div > strong, .password-section > div > span { display: block; }
.password-section > div > strong { font-size: 12px; }
.password-section > div > span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 380px; padding: 11px 13px; border: 1px solid #343840; border-radius: 6px; background: #1d2026; color: #fff; box-shadow: var(--shadow); font-size: 11px; animation: toast-in 180ms ease; }
.toast.error { border-color: var(--coral); }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1120px) {
  .search-workspace { grid-template-columns: 210px minmax(300px, 1fr) minmax(310px, 38%); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: minmax(320px, 1fr); width: min(480px, calc(100% - 40px)); }
  .auth-product-scene { display: none; }
  .app-frame { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: 260px; transition: transform 180ms ease; }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-close { display: inline-grid !important; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 15; background: rgba(13, 15, 18, 0.45); }
  body.nav-open .sidebar-scrim { display: block; }
  .mobile-header { height: 54px; display: flex; align-items: center; gap: 9px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .mobile-header img { border-radius: 50%; }
  .projects-view { padding: 26px 20px 50px; }
  .project-header { min-height: 68px; }
  .back-button { display: inline-grid !important; }
  .search-workspace { grid-template-columns: 190px minmax(300px, 1fr); }
  .preview-pane { grid-column: 1 / -1; min-height: 460px; border-top: 1px solid var(--line); }
  .preview-stage { max-height: none; }
  .video-list, .result-list { height: 520px; }
}

@media (max-width: 640px) {
  .auth-header { padding: 0 18px; }
  .auth-header > span { display: none; }
  .auth-layout { width: calc(100% - 32px); min-height: 0; padding: 42px 0; }
  .auth-panel h1 { font-size: 28px; }
  .page-header { align-items: flex-start; }
  .project-grid { grid-template-columns: 1fr; }
  .project-toolbar { align-items: stretch; flex-direction: column; }
  .workspace-summary { grid-template-columns: 1fr; }
  .workspace-summary > div { min-height: 62px; border-right: 0; border-bottom: 1px solid var(--line); }
  .workspace-summary > div:last-child { border-bottom: 0; }
  .filter-input { width: 100%; }
  .project-header { align-items: flex-start; padding: 12px; }
  .project-title-line { align-items: flex-start; flex-direction: column; gap: 5px; }
  .header-actions { margin-left: auto; }
  .header-actions .primary-button { width: 38px; padding: 0; font-size: 0; }
  .search-surface { padding: 12px; }
  .search-form { grid-template-columns: 1fr auto; }
  .search-input-wrap { grid-column: 1 / -1; }
  .search-feedback { grid-template-columns: 1fr; }
  .search-workspace { display: block; }
  .library-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .video-list { height: 190px; }
  .results-pane { border-right: 0; }
  .result-list { height: 420px; }
  .preview-pane { min-height: 400px; }
  .visibility-options { grid-template-columns: 1fr; }
}
