:root {
  --bg: #f4f7fb;
  --surface: #fff;
  --soft: #f8fafc;
  --line: #e5eaf1;
  --ink: #1a2433;
  --muted: #8996a8;
  --blue: #3977ff;
  --blue-soft: #edf3ff;
  --green: #24b982;
  --green-soft: #eafaf4;
  --purple: #9c68e6;
  --purple-soft: #f4eeff;
  --orange: #ee9d3e;
  --orange-soft: #fff4e6;
  --shadow: 0 14px 36px rgba(38, 59, 93, .055);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand > span:last-child { display: block; }
.brand > strong { display: block; }
.brand strong { display: block; letter-spacing: -.04em; font-size: 18px; line-height: 20px; }
.brand small { display: block; margin-top: 2px; color: #a5afbd; font-size: 8px; font-weight: 800; letter-spacing: .21em; }
.brand-mark { width: 31px; height: 31px; display: flex; align-items: flex-end; gap: 3px; padding: 7px 6px; border-radius: 10px; background: var(--blue); box-shadow: 0 8px 17px rgba(57, 119, 255, .2); }
.brand-mark i { width: 4px; border-radius: 5px; background: #fff; }
.brand-mark i:nth-child(1) { height: 9px; opacity: .58; }
.brand-mark i:nth-child(2) { height: 15px; opacity: .82; }
.brand-mark i:nth-child(3) { height: 11px; }
.eyebrow { margin: 0 0 8px; color: #a5b0bf; font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.pulse, .footer-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #3fc895; box-shadow: 0 0 0 4px rgba(63, 200, 149, .12); }
.header-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: #27364b; font-size: 9px; font-weight: 800; }

/* Public home */
.public-shell { min-height: 100vh; display: flex; flex-direction: column; }
.public-header { height: 78px; display: flex; align-items: center; justify-content: space-between; width: min(1190px, calc(100% - 64px)); margin: 0 auto; border-bottom: 1px solid #e7ecf2; }
.public-nav { display: flex; align-items: center; gap: 4px; margin-left: 72px; padding: 4px; border: 1px solid #e0e8f3; border-radius: 12px; background: #f0f4fa; }
.public-nav button { min-height: 36px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; color: #66768b; background: transparent; font-size: 12px; font-weight: 600; transition: .2s ease; }
.public-nav button:hover { color: #315fbc; background: #fff; }
.public-nav button.active { border-color: #d4e0fa; color: #fff; background: linear-gradient(135deg, #4e83f8, #3269e4); box-shadow: 0 4px 10px rgba(57, 119, 255, .2); font-weight: 700; }
.header-state { display: flex; align-items: center; gap: 9px; color: #8d9aaa; font-size: 10px; }
.header-state .pulse { width: 6px; height: 6px; box-shadow: 0 0 0 3px rgba(63, 200, 149, .12); }
.header-state .header-avatar { margin-left: 8px; }
.public-main { width: min(1190px, calc(100% - 64px)); flex: 1; margin: 0 auto; }
.home-view { display: none; }
.home-view.active { display: block; }
.home-view:not(.active) { display: none !important; }
.home-hero.home-view.active { display: flex; }
.home-grid.home-view.active { display: grid; }
.how-section.home-view.active { display: grid; }
.home-hero { display: flex; align-items: center; justify-content: space-between; min-height: 92px; padding: 24px 7% 14px; }
.hero-copy { max-width: 570px; }
.hero-copy h1 { margin: 0 0 16px; color: #243248; letter-spacing: -.065em; font-size: clamp(38px, 5.3vw, 63px); line-height: 1.03; }
.hero-copy h1 em { color: var(--blue); font-style: normal; }
.hero-subtitle { max-width: 490px; margin: 0; color: #8795a7; font-size: 13px; line-height: 1.75; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 24px; color: #9ba8b7; font-size: 10px; }
.hero-pills span { display: flex; align-items: center; gap: 6px; }
.hero-pills b { color: #7a9ce0; font-size: 9px; }
.hero-orb { position: relative; width: 208px; height: 208px; margin-right: 5%; }
.orb-ring { position: absolute; left: 50%; top: 50%; border: 1px solid #dfe8f8; border-radius: 50%; transform: translate(-50%, -50%) rotate(28deg); }
.ring-a { width: 192px; height: 100px; }
.ring-b { width: 135px; height: 184px; transform: translate(-50%, -50%) rotate(-29deg); }
.orb-core { position: absolute; top: 50%; left: 50%; width: 92px; height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #cddcfa; border-radius: 28px; color: var(--blue); background: linear-gradient(145deg, #f4f8ff, #fff); box-shadow: 0 16px 36px rgba(58, 104, 186, .12); transform: translate(-50%, -50%); }
.orb-core span { font-size: 32px; line-height: 32px; }
.orb-core small { margin-top: 8px; color: #91a2bf; font-size: 7px; font-weight: 800; letter-spacing: .13em; }
.orb-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #83a9fb; box-shadow: 0 0 0 5px rgba(131, 169, 251, .13); }
.dot-a { top: 20px; right: 20px; }
.dot-b { bottom: 29px; left: 4px; width: 5px; height: 5px; background: #bd9aef; box-shadow: 0 0 0 4px rgba(189, 154, 239, .14); }
.home-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 19px; }
.direct-card, .admin-card { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.direct-card { padding: 24px; }
.card-title, .section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 17px; }
.card-title { margin-bottom: 14px; }
.card-title h2, .section-head h2 { margin: 0; color: #29364a; letter-spacing: -.04em; font-size: 20px; line-height: 1.2; }
.card-number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: #7798db; background: var(--blue-soft); font-size: 10px; font-weight: 800; }
.card-desc { margin: 0 0 16px; color: #8d9aac; font-size: 12px; line-height: 1.7; }
code { padding: 2px 5px; border-radius: 4px; color: #667790; background: #f2f5f8; font-family: "SFMono-Regular", Consolas, monospace; font-size: .9em; }
.direct-dropzone { min-height: 169px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; border: 1px dashed #bfd2f5; border-radius: 13px; color: #8492a4; background: #fbfdff; transition: .2s ease; }
.direct-dropzone:hover, .direct-dropzone:focus-visible, .direct-dropzone.dragover { border-color: var(--blue); outline: 0; background: #f5f8ff; box-shadow: 0 0 0 4px rgba(57, 119, 255, .06); }
.direct-dropzone.orange-drop:hover, .direct-dropzone.orange-drop:focus-visible, .direct-dropzone.orange-drop.dragover { border-color: var(--orange); background: #fffaf3; box-shadow: 0 0 0 4px rgba(238, 157, 62, .07); }
.drop-icon { width: 39px; height: 39px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 11px; color: var(--blue); background: var(--blue-soft); font-size: 23px; }
.drop-icon.warm { color: var(--orange); background: var(--orange-soft); }
.direct-dropzone strong { margin-bottom: 7px; color: #56667a; font-size: 13px; }
.direct-dropzone > span { color: #9ba7b5; font-size: 11px; }
.direct-dropzone small { margin-top: 13px; color: #b0bac6; font-size: 10px; }
.direct-dropzone.has-file { border-color: #8eaff7; background: #f7faff; box-shadow: 0 0 0 4px rgba(57, 119, 255, .06); }
.direct-dropzone.orange-drop.has-file { border-color: #e6b36f; background: #fffaf3; box-shadow: 0 0 0 4px rgba(238, 157, 62, .07); }
.direct-dropzone.has-file .drop-icon { color: #fff; background: var(--blue); }
.direct-dropzone.orange-drop.has-file .drop-icon { color: #fff; background: var(--orange); }
.direct-dropzone.has-file > strong { color: #315fbc; }
.direct-dropzone.orange-drop.has-file > strong { color: #b87327; }
.drop-selected-file { width: min(100%, 290px); display: block; margin-top: 11px !important; text-align: center; }
.drop-selected-file b, .drop-selected-file span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-selected-file b { color: #3977ff; font-size: 10px; font-weight: 700; }
.drop-selected-file span { margin-top: 3px; color: #8d9aaa; font-size: 9px; }
.orange-drop .drop-selected-file b { color: #d58b36; }
.inline-link { padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 11px; font-weight: 700; }
.import-card .inline-link { display: inline-flex; align-items: center; min-height: 30px; margin-left: 3px; padding: 0 10px; border: 1px solid #cbd9f5; border-radius: 8px; color: #3268d2; background: #fff; box-shadow: 0 2px 5px rgba(54, 94, 164, .07); }
.import-card .inline-link:hover { border-color: #9db8ef; color: #2457c0; background: #f5f8ff; }
.chosen-file { display: flex; align-items: center; gap: 9px; margin-top: 11px; padding: 9px 11px; border: 1px solid #e5ebf2; border-radius: 10px; background: #fcfdfe; }
.file-type, .video-type { width: 31px; height: 31px; display: grid; flex: 0 0 31px; place-items: center; border-radius: 8px; color: #6f91d4; background: var(--blue-soft); font-size: 8px; font-weight: 800; }
.file-type.video, .video-type { color: #c4873f; background: var(--orange-soft); }
.chosen-main { min-width: 0; flex: 1; }
.chosen-main strong, .chosen-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chosen-main strong { color: #56667b; font-size: 11px; }
.chosen-main small { margin-top: 3px; color: #aab5c1; font-size: 10px; }
.close-button { width: 22px; height: 22px; border: 0; border-radius: 6px; color: #adb7c2; background: transparent; font-size: 18px; line-height: 1; }
.close-button:hover { color: #e07169; background: #fff2f1; }
.secret-field { display: block; margin-top: 14px; color: #758499; font-size: 11px; font-weight: 700; }
.secret-field > small { display: block; margin-top: 6px; color: #abb5c1; font-size: 9px; font-weight: 400; }
.secret-input { display: flex; align-items: center; gap: 8px; height: 38px; margin-top: 7px; padding: 0 10px; border: 1px solid #e1e8f0; border-radius: 9px; background: #fbfcfe; }
.secret-input:focus-within { border-color: #bfd2f5; background: #fff; box-shadow: 0 0 0 3px #f2f6ff; }
.secret-input > b { color: #87a4dc; font-size: 17px; font-weight: 400; }
.secret-input input { width: 100%; height: 100%; border: 0; outline: 0; color: #5d6e84; background: transparent; font-size: 11px; }
.secret-input input::placeholder { color: #adb8c5; }
.secret-input button { padding: 0; border: 0; color: #a9b5c3; background: transparent; font-size: 12px; }
.cover-picker { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; margin-top: 12px; padding: 9px 10px; border: 1px solid #edf1f5; border-radius: 10px; background: #fcfdff; }
.cover-thumb { position: relative; width: 48px; height: 30px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; color: #b58a4c; background: linear-gradient(135deg, #fff1d9, #f5c981); font-size: 9px; font-weight: 700; }
.cover-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-picker.is-loading .cover-thumb img { opacity: .45; }
.cover-picker.is-loading .cover-thumb::after { position: absolute; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.55); border-top-color: #fff; border-radius: 50%; content: ''; animation: cover-spin .7s linear infinite; }
.cover-picker.is-loading .cover-info span { color: #d58b36; }
@keyframes cover-spin { to { transform: rotate(360deg); } }
.cover-info { min-width: 0; }
.cover-info strong, .cover-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-info strong { color: #65758a; font-size: 11px; }
.cover-info span { margin-top: 3px; color: #a4afbc; font-size: 9px; }
.cover-picker .outline-button { min-height: 32px; padding: 0 10px; font-size: 10px; }
.cover-picker .text-button { white-space: nowrap; }
.compress-control { display: grid; grid-template-columns: auto minmax(130px, 1fr); align-items: center; gap: 7px 12px; margin-top: 12px; padding: 10px 12px; border: 1px solid #f0eadf; border-radius: 10px; background: #fffcf7; }
.compress-control label { color: #6e7887; font-size: 11px; font-weight: 700; }
.compress-control select { width: 100%; height: 34px; padding: 0 9px; border: 1px solid #e8e3da; border-radius: 8px; outline: 0; color: #7b684f; background: #fff; font-size: 11px; }
.compress-control select:focus { border-color: #e6bb7d; box-shadow: 0 0 0 3px rgba(238, 157, 62, .1); }
.compress-control small { grid-column: 2; color: #a49a8b; font-size: 9px; }
.action-button, .outline-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 38px; padding: 0 15px; border-radius: 9px; font-size: 11px; font-weight: 700; transition: .2s ease; }
.action-button { border: 1px solid var(--blue); color: #fff; background: var(--blue); box-shadow: 0 7px 16px rgba(57, 119, 255, .15); }
.action-button:hover { border-color: #215fe5; background: #215fe5; transform: translateY(-1px); }
.action-button.orange { border-color: var(--orange); background: var(--orange); box-shadow: 0 7px 16px rgba(238, 157, 62, .17); }
.action-button.orange:hover { border-color: #dc8c28; background: #dc8c28; }
.action-button:disabled { border-color: #e5eaf1; color: #aeb8c6; background: #f4f6f9; box-shadow: none; transform: none; }
.action-button.full { width: 100%; margin-top: 13px; }
.import-card .action-button { min-height: 46px; border-radius: 11px; font-size: 13px; box-shadow: 0 8px 18px rgba(44, 101, 221, .24); }
.import-card .action-button:disabled { border-color: #cfdbf3; color: #6e84ad; background: #eaf0fd; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8); }
.outline-button { border: 1px solid #dce5ef; color: #5d718b; background: #fff; text-decoration: none; }
.outline-button:hover { border-color: #c5d6f4; color: var(--blue); background: #f8fbff; }
.text-button { padding: 4px 2px; border: 0; color: #94a3b4; background: transparent; font-size: 11px; }
.text-button:hover { color: #e17970; }
.text-button.danger { color: #cf7771; }
.task-progress { margin-top: 14px; }
.task-progress > div { display: flex; justify-content: space-between; margin-bottom: 7px; color: #95a1b0; font-size: 10px; }
.task-progress > div b { color: var(--blue); }
.task-progress > i { display: block; height: 5px; overflow: hidden; border-radius: 99px; background: #eaf0f8; }
.task-progress > i em { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .12s ease; }
.task-progress > i.orange-track em { background: var(--orange); }
.player-card { display: flex; flex-direction: column; }
.waiting-badge, .soft-badge, .orange-badge { padding: 6px 9px; border-radius: 7px; color: #7398d9; background: var(--blue-soft); font-size: 10px; white-space: nowrap; }
.video-frame { position: relative; min-height: 276px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: #111c2d; }
.video-frame.empty { border: 1px solid #dce7f7; background: radial-gradient(circle at 50% 42%, rgba(93, 143, 255, .13), transparent 23%), linear-gradient(145deg, #f8fbff, #eef3fb); }
.video-frame video { width: 100%; height: 276px; display: block; object-fit: contain; background: #111c2d; }
.video-placeholder { position: relative; align-self: stretch; width: 100%; min-height: 276px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; color: #7385a0; }
.video-placeholder::before, .video-placeholder::after { position: absolute; border: 1px solid rgba(113, 151, 222, .2); border-radius: 50%; content: ''; pointer-events: none; }
.video-placeholder::before { top: 50%; left: 50%; width: 148px; height: 86px; transform: translate(-50%, -50%) rotate(24deg); }
.video-placeholder::after { top: 50%; left: 50%; width: 108px; height: 132px; transform: translate(-50%, -50%) rotate(-28deg); }
.player-placeholder-icon { position: relative; z-index: 1; width: 70px; height: 70px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .8); border-radius: 23px; color: #fff; background: linear-gradient(145deg, #568bfa, #8b6cda); box-shadow: 0 15px 30px rgba(77, 116, 202, .25), inset 0 1px 0 rgba(255, 255, 255, .35); transform: rotate(-3deg); }
.player-placeholder-icon::before { position: absolute; inset: 7px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 18px; content: ''; }
.player-placeholder-icon i { position: relative; margin-left: 3px; font-size: 23px; font-style: normal; }
.video-placeholder strong { position: relative; z-index: 1; margin-top: 17px; color: #536982; font-size: 13px; letter-spacing: .01em; }
.video-label { position: absolute; top: 12px; right: 12px; left: 12px; display: flex; align-items: center; justify-content: space-between; color: #fff; text-shadow: 0 1px 5px rgba(0,0,0,.3); font-size: 10px; }
.video-label span { padding: 5px 8px; border-radius: 6px; color: #d8fff0; background: rgba(29, 177, 122, .8); font-weight: 700; }
.video-label b { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.player-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; }
.media-title { display: flex; align-items: center; min-width: 0; }
.media-title > div { min-width: 0; }
.media-title strong, .media-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-title strong { max-width: 220px; color: #5b6a7d; font-size: 11px; }
.media-title small { margin-top: 3px; color: #aab4c0; font-size: 10px; }
.player-actions { display: flex; align-items: center; gap: 6px; }
.home-player-actions { justify-content: flex-end; margin-top: 14px; }
.player-actions .text-button { padding: 0 5px; }
.home-player-actions .outline-button { min-height: 44px; border-color: #c7d7f4; color: #315fae; background: #f3f7ff; box-shadow: 0 3px 8px rgba(57, 89, 145, .08); font-size: 12px; }
.home-player-actions .outline-button:hover { border-color: #9eb9ee; color: #2457c0; background: #eaf1ff; }
.home-player-actions .text-button { min-height: 42px; padding: 0 12px; border: 1px solid #e0e7f0; border-radius: 9px; color: #718095; background: #fff; }
.resource-section { margin: 30px 0 0; padding: 23px 24px 14px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.resource-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.resource-heading h2 { margin: 0 0 6px; color: #2e3c50; letter-spacing: -.04em; font-size: 20px; }
.resource-heading > div > p:last-child { margin: 0; color: #95a1b0; font-size: 11px; }
.resource-search { display: flex; align-items: center; gap: 8px; width: min(265px, 100%); padding: 0 11px; border: 1px solid #e4eaf1; border-radius: 9px; color: #a5b0bc; background: #fbfcfe; }
.resource-search:focus-within { border-color: #bfd2f5; background: #fff; box-shadow: 0 0 0 3px #f2f6ff; }
.resource-search input { width: 100%; height: 34px; border: 0; outline: 0; color: #637287; background: transparent; font-size: 11px; }
.resource-search input::placeholder { color: #aeb7c3; }
.resource-list { display: grid; gap: 8px; }
.resource-item { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 11px 10px; border: 1px solid #edf1f5; border-radius: 10px; transition: .2s ease; }
.resource-item:hover { border-color: #d7e3f6; background: #fbfdff; transform: translateY(-1px); }
.resource-index { width: 29px; height: 29px; display: grid; flex: 0 0 29px; place-items: center; border-radius: 8px; color: #7898d8; background: var(--blue-soft); font-size: 9px; font-weight: 800; }
.resource-copy { min-width: 0; flex: 1; }
.resource-copy strong, .resource-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-copy strong { color: #59687b; font-size: 11px; }
.resource-copy small { margin-top: 3px; color: #a4afbc; font-size: 10px; }
.resource-open { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 12px; border: 1px solid #cbd9f5; border-radius: 8px; color: #285fc8; background: #edf3ff; font-size: 11px; font-weight: 700; white-space: nowrap; transition: .2s ease; }
.resource-open:hover { border-color: #a9c1f1; color: #fff; background: #3977ff; }
.resource-empty { display: flex; flex-direction: column; align-items: center; padding: 24px 10px 17px; color: #aab5c1; }
.resource-empty > span { width: 33px; height: 33px; display: grid; place-items: center; margin-bottom: 9px; border: 1px solid #e1e8f1; border-radius: 10px; color: #9eacbb; background: #fbfcfe; font-size: 15px; }
.resource-empty strong { color: #8291a3; font-size: 11px; }
.resource-empty small { margin-top: 5px; font-size: 10px; }
.how-section { display: grid; grid-template-columns: .65fr 1.35fr; gap: 30px; align-items: start; margin: 38px 6px 28px; }
.how-section h2 { margin: 0; color: #354459; letter-spacing: -.04em; font-size: 20px; }
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.how-steps > div { display: grid; grid-template-columns: 28px 1fr; column-gap: 9px; }
.how-steps > div > span { grid-row: span 2; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: #7898d8; background: var(--blue-soft); font-size: 9px; font-weight: 800; }
.how-steps strong, .how-steps small { display: block; }
.how-steps strong { color: #68788d; font-size: 11px; }
.how-steps small { margin-top: 5px; color: #a1acb9; font-size: 10px; line-height: 1.5; }
.public-footer, .admin-footer { display: flex; justify-content: space-between; gap: 15px; width: min(1190px, calc(100% - 64px)); margin: auto; padding: 16px 4px 20px; color: #acb7c3; font-size: 9px; }
.public-footer span:nth-child(2), .admin-footer span:nth-child(2) { display: inline-flex; align-items: center; gap: 5px; }
.footer-dot { width: 5px; height: 5px; box-shadow: none; }

/* Admin */
.admin-shell { display: flex; min-height: 100vh; }
.manage-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 18%, #f9fbff 0, var(--bg) 55%); }
.manage-gate[hidden], .admin-shell[hidden] { display: none; }
.manage-gate-card { width: min(360px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.gate-mark { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 12px; color: #fff; background: var(--blue); box-shadow: 0 9px 20px rgba(57, 119, 255, .2); font-size: 11px; font-weight: 800; }
.manage-gate-card label { display: block; color: #718095; font-size: 11px; font-weight: 700; text-align: left; }
.manage-gate-card label span { display: block; margin-bottom: 7px; }
.manage-gate-card input { width: 100%; height: 39px; padding: 0 11px; border: 1px solid #e1e8f0; border-radius: 9px; outline: 0; color: #5d6e84; background: #fbfcfe; font-size: 12px; }
.manage-gate-card input:focus { border-color: #bfd2f5; background: #fff; box-shadow: 0 0 0 3px #f2f6ff; }
.manage-gate-card .action-button { margin-top: 14px; }
.manage-gate-card > small { display: block; margin-top: 14px; color: #aab5c1; font-size: 10px; }
.manage-gate-card > small.error { color: #c66760; }
.manage-gate-card > small:empty, .settings-message:empty { display: none; }
.admin-sidebar { width: 232px; flex: 0 0 232px; display: flex; flex-direction: column; padding: 27px 17px 19px; border-right: 1px solid var(--line); background: #fff; }
.side-label { margin: 48px 12px 13px; color: #a4afbd; font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.side-nav { display: grid; gap: 5px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 10px; color: #8c99aa; font-size: 12px; }
.side-nav a span { width: 16px; color: currentColor; font-size: 17px; text-align: center; }
.side-nav a:hover { color: #56677b; background: #f8fafc; }
.side-nav a.active { color: var(--blue); background: var(--blue-soft); font-weight: 700; }
.side-spacer { flex: 1; min-height: 50px; }
.side-security { margin: 0 4px 20px; padding: 14px 12px; border: 1px solid #e4edf6; border-radius: 12px; background: #f8fbff; }
.side-security > div { color: #5074aa; font-size: 11px; font-weight: 700; }
.side-security p { margin: 9px 0 13px; color: #9eacbd; font-size: 9px; }
.side-security b { color: #4bb18a; font-size: 9px; letter-spacing: .12em; }
.return-home { padding: 14px 9px 0; border-top: 1px solid #edf1f5; color: #9aa7b6; font-size: 11px; }
.return-home:hover { color: var(--blue); }
.admin-main { min-width: 0; flex: 1; padding: 0 41px 18px; overflow: hidden; }
.admin-view { display: none; padding-top: 22px; }
.admin-view.active { display: block; }
.local-badge { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; border: 1px solid #dceee7; border-radius: 10px; background: #f6fffb; }
.local-badge .pulse { width: 6px; height: 6px; box-shadow: 0 0 0 3px rgba(63, 200, 149, .12); }
.local-badge strong, .local-badge small { display: block; }
.local-badge strong { color: #548571; font-size: 10px; }
.local-badge small { margin-top: 3px; color: #9bb3a8; font-size: 9px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { position: relative; min-height: 123px; overflow: hidden; padding: 16px 17px 13px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.stat-card::after { position: absolute; right: -26px; bottom: -38px; width: 105px; height: 105px; border: 1px solid currentColor; border-radius: 50%; opacity: .07; content: ''; }
.stat-card > div { display: flex; align-items: center; justify-content: space-between; color: #8f9cac; font-size: 11px; }
.stat-card > div b { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: currentColor; background: #f0f5ff; font-size: 14px; }
.stat-card > strong { display: block; margin: 13px 0 8px; color: #2e3a4d; letter-spacing: -.04em; font-size: 27px; line-height: 1; }
.stat-card > small { color: #acb6c1; font-size: 10px; }
.stat-card > small em { color: currentColor; font-style: normal; font-weight: 700; }
.stat-card.blue { color: var(--blue); }
.stat-card.green { color: var(--green); }
.stat-card.green > div b { background: var(--green-soft); }
.stat-card.purple { color: var(--purple); }
.stat-card.purple > div b { background: var(--purple-soft); }
.stat-card.orange { color: var(--orange); }
.stat-card.orange > div b { background: var(--orange-soft); }
.analytics-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(265px, .8fr); gap: 18px; min-width: 0; margin-bottom: 18px; }
.admin-card { padding: 22px; }
.section-head { margin-bottom: 18px; }
.section-head .eyebrow { margin-bottom: 7px; }
.legend { display: flex; align-items: center; gap: 13px; color: #9ba6b4; font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.blue-dot, .purple-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; }
.blue-dot { background: var(--blue); }
.purple-dot { background: var(--purple); }
.trend-card, .funnel-card, .trend-chart, .bars, .chart-labels { min-width: 0; }
.trend-chart { display: grid; grid-template-columns: 25px minmax(0, 1fr); height: 218px; margin-top: 20px; }
.chart-scale { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 1px; color: #b2bdc9; font-size: 9px; }
.bars { display: flex; align-items: stretch; justify-content: space-around; gap: 6px; padding: 0 8px; border-bottom: 1px solid #edf1f5; background: repeating-linear-gradient(to bottom, transparent 0, transparent 42px, #f0f3f6 43px); }
.bar-group { display: flex; flex: 1; align-items: flex-end; justify-content: center; gap: 3px; max-width: 42px; }
.bar { width: 7px; min-height: 2px; border-radius: 5px 5px 0 0; }
.bar.decrypt { background: linear-gradient(to top, #7daaff, var(--blue)); }
.bar.download { background: linear-gradient(to top, #c8a6ee, var(--purple)); }
.chart-labels { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); padding-left: 32px; margin-top: 8px; color: #b1bbc7; font-size: 9px; text-align: center; }
.chart-labels span { min-width: 0; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.chart-labels span:nth-child(2n) { visibility: hidden; }
.funnel-list { display: grid; gap: 22px; margin-top: 29px; }
.funnel-list p { display: flex; justify-content: space-between; margin: 0 0 8px; color: #8996a7; font-size: 11px; }
.funnel-list p b { color: #526176; font-size: 12px; }
.funnel-list i { display: block; height: 8px; overflow: hidden; border-radius: 99px; background: var(--blue-soft); }
.funnel-list i em { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .45s ease; }
.funnel-list i.green-track { background: var(--green-soft); }
.funnel-list i.green-track em { background: var(--green); }
.funnel-list i.purple-track { background: var(--purple-soft); }
.funnel-list i.purple-track em { background: var(--purple); }
.funnel-rate { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 5px; margin-top: 25px; padding-top: 14px; border-top: 1px solid #edf1f5; color: #99a5b3; font-size: 10px; }
.funnel-rate strong { color: #53667b; font-size: 24px; line-height: 1; }
.funnel-rate small { grid-column: 1 / -1; color: #b3bdc8; font-size: 9px; }
.soft-badge, .orange-badge { color: #7397d4; background: #f0f5fd; }
.orange-badge { color: #c9893d; background: var(--orange-soft); }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 0 11px 11px; border-bottom: 1px solid #edf1f5; color: #9da9b7; font-size: 10px; font-weight: 700; white-space: nowrap; }
td { padding: 12px 11px; border-bottom: 1px solid #f0f3f6; color: #667589; font-size: 11px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfe; }
.empty-row { padding: 27px 11px; color: #b1bbc6; text-align: center; }
.file-cell { display: flex; align-items: center; gap: 8px; }
.file-cell > span:last-child { min-width: 0; }
.file-cell strong, .file-cell small { display: block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-cell strong { color: #58677b; font-size: 11px; }
.file-cell small { margin-top: 3px; color: #a8b2bf; font-size: 9px; }
.source-label { padding: 4px 7px; border-radius: 5px; color: #7391c6; background: #eff4fc; font-size: 9px; }
.source-label.imported { color: #9a73c9; background: #f5effd; }
.muted-action { color: #a8b3bf; font-size: 10px; }
.good-rate { color: var(--green); font-weight: 700; }
.low-rate { color: var(--orange); font-weight: 700; }
.encrypt-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr); gap: 18px; }
.encrypt-box .card-desc { max-width: 570px; margin: 0 0 16px; }
.explain-box { overflow: hidden; background: linear-gradient(145deg, #fff, #fbfaff); }
.explain-box > h2 { margin: 0 0 10px; color: #2e3a4c; letter-spacing: -.04em; font-size: 20px; }
.explain-box > p:not(.eyebrow) { margin: 0 0 19px; color: #8f9baa; font-size: 12px; line-height: 1.7; }
.vault-graphic { position: relative; height: 89px; margin: -6px 0 13px; }
.vault-graphic > span { position: absolute; top: 18px; left: calc(50% - 25px); z-index: 1; width: 51px; height: 51px; display: grid; place-items: center; border: 1px solid #d5c8f2; border-radius: 17px; color: #9568db; background: #f4eeff; box-shadow: 0 9px 30px rgba(157, 103, 231, .16); font-size: 22px; }
.vault-graphic > i { position: absolute; left: 50%; border: 1px solid #e6daf7; border-radius: 50%; transform: translateX(-50%); }
.vault-graphic > i:nth-child(2) { top: 3px; width: 120px; height: 80px; transform: translateX(-50%) rotate(25deg); }
.vault-graphic > i:nth-child(3) { top: 10px; width: 165px; height: 63px; transform: translateX(-50%) rotate(-18deg); }
.feature-list { display: grid; gap: 12px; }
.feature-list > div { display: grid; grid-template-columns: 27px 1fr; gap: 9px; }
.feature-list > div > b { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: #a174d8; background: var(--purple-soft); font-size: 9px; }
.feature-list strong, .feature-list small { display: block; }
.feature-list strong { color: #617084; font-size: 11px; }
.feature-list small { margin-top: 3px; color: #a7b1bd; font-size: 10px; }
.resource-editor { margin-bottom: 18px; }
.resource-form { display: grid; grid-template-columns: minmax(180px, .72fr) minmax(260px, 1.28fr) auto; align-items: end; gap: 12px; }
.resource-form label { display: block; color: #718095; font-size: 11px; font-weight: 700; }
.resource-form label > span { display: block; margin-bottom: 7px; }
.resource-form input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #e1e8f0; border-radius: 9px; outline: 0; color: #5d6e84; background: #fbfcfe; font-size: 11px; }
.resource-form input:focus { border-color: #bfd2f5; background: #fff; box-shadow: 0 0 0 3px #f2f6ff; }
.resource-form input::placeholder { color: #adb8c5; }
.password-card { max-width: 760px; }
.password-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-message { margin: 14px 0 0; color: #91a0b0; font-size: 11px; line-height: 1.6; }
.settings-message.error { color: #b85e57; }
.resource-table-card { padding-bottom: 12px; }
.resource-table-title { color: #58677b; font-size: 11px; }
.resource-table-link { display: inline-block; max-width: 330px; overflow: hidden; color: #6f8fca; text-overflow: ellipsis; vertical-align: bottom; font-size: 10px; }
.resource-table-link:hover { text-decoration: underline; }
.table-action { margin-right: 10px; padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 10px; font-weight: 700; }
.table-action:hover { text-decoration: underline; }
.table-action.resource-delete, .table-action.license-delete, .table-action.local-delete { color: #d47b72; }
.files-card { padding-bottom: 12px; }
.files-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.files-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.search-box { display: flex; align-items: center; gap: 8px; width: min(320px, 100%); padding: 0 11px; border: 1px solid #e4eaf1; border-radius: 9px; color: #a5b0bc; background: #fbfcfe; }
.search-box:focus-within { border-color: #bfd2f5; background: #fff; box-shadow: 0 0 0 3px #f2f6ff; }
.search-box input { width: 100%; height: 34px; border: 0; outline: 0; color: #637287; background: transparent; font-size: 11px; }
.search-box input::placeholder { color: #aeb7c3; }
.license-editor { margin-bottom: 18px; }
.license-editor .section-head { align-items: center; }
.license-editor .section-head h2 { font-size: 18px; }
.license-editor .section-head small { display: block; max-width: 420px; margin-top: 5px; overflow: hidden; color: #9aa7b6; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.license-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px; }
.license-form label { display: block; color: #718095; font-size: 11px; font-weight: 700; }
.license-form label > span { display: block; margin-bottom: 7px; }
.license-form input[type="number"], .license-form input[type="datetime-local"] { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #e1e8f0; border-radius: 9px; outline: 0; color: #5d6e84; background: #fbfcfe; font-size: 11px; }
.license-form input:focus { border-color: #bfd2f5; background: #fff; box-shadow: 0 0 0 3px #f2f6ff; }
.license-form input::placeholder { color: #adb8c5; }
.license-switch { display: flex !important; align-items: center; gap: 8px; min-height: 38px; padding: 0 10px; border: 1px solid #e1e8f0; border-radius: 9px; color: #65758a !important; background: #fbfcfe; }
.license-switch > span { margin: 0 !important; }
.license-switch input { width: 16px; height: 16px; accent-color: var(--blue); }
.license-usage { grid-column: 1 / -1; min-height: 18px; color: #91a0b0; font-size: 10px; }
.license-form .action-button { min-height: 38px; }
.license-status { display: inline-block; max-width: 210px; overflow: hidden; padding: 4px 7px; border-radius: 5px; color: #4f9b7d; background: #eafaf4; font-size: 9px; text-overflow: ellipsis; vertical-align: middle; }
.license-status.warning { color: #b27b36; background: var(--orange-soft); }
.license-status.off { color: #b9635b; background: #fff0ee; }
.license-status.local { color: #8c99aa; background: #f1f4f8; }
.license-editor .settings-message { grid-column: 1 / -1; }
.admin-footer { width: auto; padding: 20px 3px 3px; }
.toast-stack { position: fixed; right: 22px; bottom: 20px; z-index: 10; display: grid; gap: 8px; width: min(330px, calc(100vw - 40px)); }
.toast { padding: 12px 14px; border: 1px solid #d8e5f7; border-radius: 10px; color: #53677f; background: #fff; box-shadow: 0 12px 30px rgba(39, 67, 104, .14); font-size: 11px; animation: toast-in .25s ease both; }
.toast.success { border-color: #c7eedf; color: #347b63; background: #f5fffb; }
.toast.error { border-color: #f4d2ce; color: #b85e57; background: #fff9f8; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1050px) {
  .public-header, .public-main, .public-footer { width: min(100% - 38px, 900px); }
  .admin-sidebar { width: 205px; flex-basis: 205px; }
  .admin-main { padding: 0 25px 18px; }
  .analytics-row, .encrypt-layout { grid-template-columns: 1fr; }
}
@media (max-width: 790px) {
  .public-header { height: 64px; }
  .public-nav { margin-left: 0; }
  .header-state > span:not(.header-avatar):not(.pulse) { display: none; }
  .home-hero { min-height: 0; padding: 42px 2% 31px; }
  .hero-orb { width: 150px; height: 150px; margin-right: 0; }
  .ring-a { width: 140px; height: 76px; }
  .ring-b { width: 100px; height: 134px; }
  .orb-core { width: 70px; height: 70px; border-radius: 20px; }
  .orb-core span { font-size: 23px; line-height: 23px; }
  .orb-core small { margin-top: 5px; font-size: 6px; }
  .home-grid { grid-template-columns: 1fr; }
  .resource-heading { align-items: stretch; flex-direction: column; }
  .resource-search { width: 100%; }
  .how-section { grid-template-columns: 1fr; gap: 20px; margin-top: 30px; }
  .how-steps { gap: 12px; }
  .admin-shell { display: block; }
  .admin-sidebar { width: auto; padding: 14px 18px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-label, .side-spacer, .side-security, .return-home { display: none; }
  .side-nav { display: flex; gap: 4px; margin-top: 13px; overflow-x: auto; }
  .side-nav a { flex: 0 0 auto; padding: 8px 10px; font-size: 11px; }
  .admin-main { padding: 0 18px 17px; overflow: visible; }
  .admin-view { padding-top: 17px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-row > .admin-card { width: 100%; min-width: 0; overflow: visible; }
  .chart-labels span:nth-child(2n) { visibility: visible; }
}
@media (max-width: 520px) {
  body { overflow-x: hidden; }
  .public-header, .public-main, .public-footer { width: calc(100% - 24px); }
  .public-header { height: auto; min-height: 64px; flex-wrap: wrap; gap: 10px; padding: 10px 0; }
  .brand { gap: 8px; }
  .brand strong { font-size: 16px; }
  .brand small { letter-spacing: .15em; }
  .header-state { margin-left: auto; }
  .public-nav { order: 3; width: 100%; gap: 4px; margin: 0; padding: 4px; }
  .public-nav button { flex: 1; min-height: 42px; padding: 8px 7px; font-size: 12px; }
  .home-hero, .home-hero.home-view.active { display: block; padding: 24px 0 18px; }
  .hero-copy h1 { font-size: 38px; }
  .hero-subtitle { font-size: 12px; }
  .hero-orb { display: none; }
  .hero-pills { gap: 8px 13px; }
  .direct-card, .admin-card { padding: 16px; border-radius: 14px; }
  .card-title h2, .section-head h2 { font-size: 18px; }
  .card-title { gap: 10px; }
  .card-desc { font-size: 11px; }
  .direct-dropzone { min-height: 158px; padding: 15px 11px; text-align: center; }
  .direct-dropzone small { font-size: 9px; }
  .action-button, .outline-button { min-height: 44px; }
  .video-frame, .video-frame video { min-height: 205px; height: 205px; }
  .video-placeholder { min-height: 205px; }
  .player-meta { align-items: flex-start; flex-direction: column; }
  .player-actions { width: 100%; gap: 8px; }
  .player-actions .outline-button { flex: 1; }
  .how-steps { grid-template-columns: 1fr; }
  .resource-section { margin-top: 18px; padding: 17px 16px 11px; border-radius: 14px; }
  .resource-item { align-items: flex-start; flex-wrap: wrap; gap: 9px; }
  .resource-copy { flex-basis: calc(100% - 40px); }
  .resource-open { min-height: 44px; margin-left: 38px; }
  .public-footer, .admin-footer { flex-wrap: wrap; gap: 9px 14px; }
  .public-footer span:last-child, .admin-footer span:last-child { width: 100%; }
  .local-badge { display: inline-flex; margin-top: 16px; }
  .resource-form { grid-template-columns: 1fr; }
  .license-form { grid-template-columns: 1fr 1fr; }
  .license-form .license-switch, .license-form .license-usage, .license-form .action-button, .license-form .settings-message { grid-column: 1 / -1; }
  .license-form .action-button { width: 100%; }
  .cover-picker { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; }
  .cover-picker .text-button { grid-column: 2 / -1; justify-self: start; }
  .resource-form .action-button { width: 100%; }
  .files-toolbar { align-items: stretch; flex-direction: column; }
  .files-toolbar-actions { justify-content: space-between; }
  .search-box { width: 100%; }
  .admin-sidebar { padding: 11px 12px 8px; }
  .admin-sidebar .brand strong { font-size: 16px; }
  .side-nav { margin-top: 10px; padding-bottom: 2px; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav a { min-height: 40px; padding: 8px 11px; }
  .admin-main { padding: 0 12px 15px; }
  .stat-grid { gap: 8px; }
  .stat-card { min-height: 112px; padding: 13px 12px 11px; border-radius: 12px; }
  .stat-card > strong { margin: 11px 0 7px; font-size: 24px; }
  .stat-card > div { font-size: 10px; }
  .analytics-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .analytics-row > .admin-card { width: 100%; min-width: 0; overflow: visible; }
  .trend-card .section-head { gap: 10px; flex-wrap: wrap; }
  .trend-card .section-head h2 { font-size: 17px; white-space: nowrap; }
  .trend-chart { height: 188px; margin-top: 15px; grid-template-columns: 24px minmax(0, 1fr); }
  .chart-scale { font-size: 8px; }
  .bars { gap: 2px; padding: 0 3px; }
  .bar-group { max-width: none; gap: 1px; }
  .bar { width: clamp(3px, 1.8vw, 6px); }
  .chart-labels { padding-left: 27px; margin-top: 6px; font-size: 8px; }
  .chart-labels span:nth-child(2n) { visibility: visible; }
  .legend { gap: 7px; font-size: 9px; }
  .funnel-list { gap: 15px; margin-top: 17px; }
  .funnel-rate { margin-top: 18px; }
  .admin-card { overflow: hidden; }
  .analytics-row .admin-card { overflow: visible; }
  .table-scroll { margin: 0 -3px; width: calc(100% + 6px); }
  .password-form { gap: 10px; }
}
