:root {
    --bg: #03040d;
    --panel: rgba(10, 8, 30, 0.88);
    --panel2: rgba(19, 12, 49, 0.82);
    --line: rgba(201, 185, 255, 0.18);
    --line-strong: rgba(190, 172, 255, 0.38);
    --blue: #59a8ff;
    --blue2: #246bff;
    --purple: #8e54ff;
    --purple2: #bc68ff;
    --pink: #ff5fc6;
    --pink2: #ff83da;
    --text: #f4f1ff;
    --muted: #b8afd2;
    --green: #7fffd4;
    --danger: #ff7b96;
}

* { box-sizing: border-box; }

html, body {
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body {
    overflow-x: hidden;
    background:
        radial-gradient(circle at 76% 18%, rgba(88, 86, 255, .20), transparent 28%),
        radial-gradient(circle at 68% 80%, rgba(255, 72, 188, .12), transparent 32%),
        radial-gradient(circle at 36% 48%, rgba(35, 112, 255, .10), transparent 30%),
        linear-gradient(145deg, #02030a 0%, #070718 42%, #0c0721 70%, #03040d 100%);
}

.cosmic-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(circle at 11% 15%, rgba(255,255,255,.8) 0 1px, transparent 1.4px),
        radial-gradient(circle at 38% 44%, rgba(177,154,255,.9) 0 1px, transparent 1.5px),
        radial-gradient(circle at 74% 22%, rgba(94,174,255,.9) 0 1.1px, transparent 1.5px),
        radial-gradient(circle at 91% 67%, rgba(255,113,206,.75) 0 1px, transparent 1.5px),
        radial-gradient(circle at 59% 83%, rgba(255,255,255,.65) 0 .9px, transparent 1.3px);
    background-size: 160px 160px, 210px 210px, 250px 250px, 180px 180px, 300px 300px;
    opacity: .42;
}

.cloud {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(65px);
    opacity: .22;
    z-index: 0;
}

.cloud-a {
    width: 540px;
    height: 220px;
    left: 16%;
    top: 4%;
    background: linear-gradient(90deg, var(--blue), var(--purple));
}

.cloud-b {
    width: 650px;
    height: 260px;
    right: -170px;
    top: 32%;
    background: linear-gradient(90deg, var(--purple), var(--pink));
}

.cloud-c {
    width: 520px;
    height: 210px;
    left: 31%;
    bottom: -80px;
    background: linear-gradient(90deg, var(--blue2), var(--pink));
}

.lightning {
    position: fixed;
    width: 3px;
    height: 420px;
    z-index: 0;
    pointer-events: none;
    opacity: .35;
    filter: drop-shadow(0 0 8px #a98cff) drop-shadow(0 0 24px #4f93ff);
    background:
        linear-gradient(to bottom,
            transparent 0 6%,
            #fff 7% 8%,
            #8ec8ff 9% 18%,
            transparent 19% 26%,
            #fff 27% 28%,
            #b174ff 29% 43%,
            transparent 44% 54%,
            #fff 55% 56%,
            #ff80d3 57% 72%,
            transparent 73%);
    clip-path: polygon(48% 0, 70% 17%, 54% 19%, 79% 39%, 46% 37%, 62% 58%, 35% 55%, 49% 100%, 17% 67%, 36% 66%, 12% 46%, 42% 48%, 23% 25%, 48% 25%);
}

.bolt-a { top: -40px; right: 20%; transform: rotate(13deg); }
.bolt-b { bottom: -80px; right: 6%; transform: rotate(-18deg) scale(.8); opacity: .25; }
.bolt-c { top: 35%; left: 24%; transform: rotate(20deg) scale(.55); opacity: .18; }

.entity-silhouette {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    opacity: .09;
    filter: blur(.2px) drop-shadow(0 0 35px rgba(144, 93, 255, .45));
}

.entity-dragon {
    width: 460px;
    height: 310px;
    right: -80px;
    top: 90px;
}

.dragon-head {
    position: absolute;
    width: 100px;
    height: 78px;
    left: 175px;
    top: 110px;
    border-radius: 55% 50% 45% 50%;
    background: linear-gradient(145deg, var(--blue), var(--purple), var(--pink));
    transform: rotate(-8deg);
}

.dragon-head::before,
.dragon-head::after {
    content: "";
    position: absolute;
    width: 72px;
    height: 18px;
    top: -24px;
    background: linear-gradient(90deg, var(--purple), var(--pink));
    clip-path: polygon(0 60%, 100% 0, 70% 100%);
}

.dragon-head::before { left: -42px; transform: rotate(-26deg); }
.dragon-head::after { right: -44px; transform: scaleX(-1) rotate(-26deg); }

.dragon-wing {
    position: absolute;
    width: 235px;
    height: 180px;
    top: 55px;
    background: linear-gradient(135deg, var(--blue), var(--purple), var(--pink));
    clip-path: polygon(100% 46%, 64% 5%, 58% 35%, 22% 0, 37% 42%, 0 30%, 45% 100%);
}

.wing-left { left: 0; transform: rotate(-10deg); }
.wing-right { right: 0; transform: scaleX(-1) rotate(-10deg); }

.entity-seraph {
    width: 360px;
    height: 360px;
    right: 10%;
    bottom: -80px;
    opacity: .07;
}

.seraph-core {
    position: absolute;
    left: 145px;
    top: 130px;
    width: 70px;
    height: 130px;
    border-radius: 50% 50% 36% 36%;
    background: linear-gradient(var(--pink), var(--purple), var(--blue));
}

.seraph-wing {
    position: absolute;
    width: 150px;
    height: 115px;
    background: linear-gradient(135deg, var(--blue), var(--purple), var(--pink));
    clip-path: polygon(100% 50%, 67% 0, 60% 35%, 0 8%, 45% 57%, 7% 100%, 68% 72%);
}

.sw1 { left: 8px; top: 60px; transform: rotate(-20deg); }
.sw2 { right: 8px; top: 60px; transform: scaleX(-1) rotate(-20deg); }
.sw3 { left: 0; top: 190px; transform: rotate(16deg) scale(.9); }
.sw4 { right: 0; top: 190px; transform: scaleX(-1) rotate(16deg) scale(.9); }

.sidebar {
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    bottom: 0;
    width: 330px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line-strong);
    background:
        linear-gradient(180deg, rgba(9,8,28,.97), rgba(7,5,22,.95)),
        radial-gradient(circle at 0 0, rgba(65,120,255,.16), transparent 35%);
    box-shadow: 20px 0 60px rgba(0,0,0,.3), inset -1px 0 rgba(255,255,255,.03);
    backdrop-filter: blur(18px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 118px;
    padding: 25px 22px 22px;
    border-bottom: 1px solid var(--line);
}

.brand-sigil {
    display: grid;
    place-items: center;
    width: 49px;
    height: 49px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 1px solid rgba(154, 122, 255, .55);
    background:
        radial-gradient(circle, rgba(255,255,255,.22), transparent 35%),
        linear-gradient(145deg, rgba(80,160,255,.22), rgba(164,81,255,.28), rgba(255,80,195,.18));
    color: white;
    font-size: 26px;
    box-shadow: 0 0 24px rgba(128, 90, 255, .32);
}

.brand h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 25px;
    font-weight: 500;
    letter-spacing: .02em;
    background: linear-gradient(90deg, #9bd1ff, #c49cff 52%, #ff9cdb);
    -webkit-background-clip: text;
    color: transparent;
}

.brand p {
    margin: 5px 0 0;
    color: #a9a1c5;
    font-size: 11px;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.tree-label {
    padding: 19px 24px 11px;
    color: #786f9b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .22em;
}

.entity-tree {
    overflow-y: auto;
    padding: 0 12px 30px 17px;
    scrollbar-width: thin;
    scrollbar-color: #6d4fc0 transparent;
}

.tree-group {
    position: relative;
    margin-bottom: 5px;
}

.tree-root,
.tree-child {
    width: 100%;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    cursor: pointer;
    text-align: left;
}

.tree-root {
    position: relative;
    display: grid;
    grid-template-columns: 32px 1fr 24px;
    align-items: center;
    min-height: 48px;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 11px;
    color: #e4def8;
}

.tree-root:hover,
.tree-root.active {
    background: linear-gradient(90deg, rgba(68,119,255,.12), rgba(147,80,255,.10), rgba(255,80,196,.07));
}

.tree-orb {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #f3eaff;
    background: linear-gradient(145deg, rgba(69,153,255,.24), rgba(148,83,255,.3), rgba(255,85,199,.22));
    border: 1px solid rgba(177,153,255,.25);
    box-shadow: 0 0 16px rgba(135,92,255,.12);
}

.tree-root-name {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .025em;
}

.tree-arrow {
    color: #8c82ad;
    text-align: center;
    transition: transform .2s ease;
}

.tree-group:not(.open) .tree-arrow {
    transform: rotate(-90deg);
}

.tree-children {
    position: relative;
    margin-left: 23px;
    padding: 1px 0 5px 23px;
    border-left: 1px solid rgba(139, 103, 238, .30);
}

.tree-group:not(.open) .tree-children {
    display: none;
}

.tree-child {
    position: relative;
    display: grid;
    grid-template-columns: 16px 26px 1fr;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 4px 7px 4px 0;
    border-radius: 8px;
    color: #a9a1c6;
    font-size: 12px;
}

.tree-child:hover,
.tree-child.active {
    color: white;
    background: linear-gradient(90deg, rgba(69,128,255,.10), rgba(162,79,255,.11), rgba(255,76,190,.08));
    text-shadow: 0 0 12px rgba(173,134,255,.42);
}

.branch-line {
    width: 15px;
    height: 1px;
    margin-left: -23px;
    background: linear-gradient(90deg, rgba(126,92,211,.55), rgba(126,92,211,.18));
}

.entity-icon {
    display: grid;
    place-items: center;
    color: #a98cff;
    font-size: 15px;
}

.server-status {
    margin-top: auto;
    padding: 17px 23px;
    border-top: 1px solid var(--line);
    color: #9e95b9;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.status-light {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px rgba(127,255,212,.85);
}

.page {
    position: relative;
    z-index: 2;
    margin-left: 330px;
    min-height: 100vh;
    padding: 38px 46px 80px;
}

.hero {
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    gap: 24px;
    overflow: hidden;
    padding: 44px 42px;
    border: 1px solid var(--line-strong);
    border-radius: 28px;
    background:
        linear-gradient(120deg, rgba(12,10,35,.91), rgba(20,11,48,.72), rgba(10,8,30,.86)),
        radial-gradient(circle at 84% 20%, rgba(255,87,199,.22), transparent 30%);
    box-shadow:
        0 25px 70px rgba(0,0,0,.30),
        0 0 45px rgba(76,128,255,.08),
        inset 0 0 60px rgba(159,91,255,.04);
}

.hero::before {
    content: "";
    position: absolute;
    right: -10%;
    top: -60%;
    width: 580px;
    height: 580px;
    border-radius: 50%;
    border: 1px solid rgba(197,172,255,.11);
    box-shadow:
        inset 0 0 80px rgba(82,137,255,.06),
        0 0 50px rgba(255,85,198,.07);
}

.hero::after {
    content: "";
    position: absolute;
    right: 120px;
    bottom: -60px;
    width: 380px;
    height: 210px;
    background: linear-gradient(90deg, rgba(70,147,255,.08), rgba(145,80,255,.08), rgba(255,85,196,.08));
    clip-path: polygon(50% 0, 62% 36%, 100% 12%, 76% 57%, 98% 100%, 54% 72%, 50% 100%, 46% 72%, 2% 100%, 24% 57%, 0 12%, 38% 36%);
    filter: blur(2px);
}

.hero-symbol {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    flex: 0 0 auto;
    border: 1px solid rgba(186,163,255,.38);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.16), rgba(92,85,255,.16) 38%, rgba(255,86,198,.08) 65%, transparent 68%);
    box-shadow: 0 0 35px rgba(126, 93, 255, .24);
    font-size: 39px;
    color: white;
}

.hero-copy {
    position: relative;
    z-index: 2;
    max-width: 680px;
}

.kicker {
    color: #9e8bd6;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .20em;
}

.hero h2 {
    max-width: 720px;
    margin: 12px 0 13px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(35px, 4.5vw, 66px);
    line-height: .98;
    font-weight: 500;
    letter-spacing: -.025em;
    background: linear-gradient(90deg, #f6f1ff 0%, #bcdcff 35%, #c9a6ff 65%, #ffb4e2 100%);
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 30px rgba(126,91,255,.06);
}

.hero p {
    max-width: 640px;
    margin: 0;
    color: #b6aecf;
    font-size: 15px;
    line-height: 1.7;
}

.post-button {
    position: relative;
    z-index: 2;
    margin-left: auto;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 19px;
    border: 1px solid rgba(218,197,255,.34);
    border-radius: 13px;
    color: white;
    cursor: pointer;
    font-weight: 800;
    background:
        linear-gradient(100deg, rgba(52,129,255,.86), rgba(132,74,255,.92) 52%, rgba(255,75,190,.88));
    box-shadow: 0 10px 35px rgba(114,74,255,.28), inset 0 1px rgba(255,255,255,.18);
}

.post-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 40px rgba(143,78,255,.34);
}

.plus { font-size: 20px; line-height: 1; }

.entity-banner {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 22px 0;
    min-height: 68px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: linear-gradient(90deg, rgba(37,81,172,.10), rgba(104,58,178,.10), rgba(189,57,136,.08));
}

.banner-orb {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #c6b8ff;
    background: rgba(139,88,255,.12);
    border: 1px solid rgba(174,147,255,.22);
}

.banner-small {
    display: block;
    margin-bottom: 2px;
    color: #71698f;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .16em;
}

.entity-banner strong {
    font-size: 13px;
    font-weight: 700;
}

.clear-filter {
    margin-left: auto;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255,255,255,.025);
    color: #aaa1c8;
    cursor: pointer;
}

.notice {
    margin: 0 0 18px;
    padding: 13px 15px;
    border-radius: 11px;
    border: 1px solid var(--line);
    font-size: 13px;
}

.notice.success {
    color: #a4ffdf;
    background: rgba(42,168,133,.08);
}

.notice.error {
    color: #ffadbc;
    background: rgba(255,67,108,.08);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.video-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(13,10,36,.86), rgba(9,8,25,.91));
    box-shadow: 0 16px 45px rgba(0,0,0,.20);
}

.video-card.hidden {
    display: none;
}

.video-shell {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 25%, rgba(53,133,255,.16), transparent 30%),
        radial-gradient(circle at 78% 70%, rgba(255,74,189,.13), transparent 30%),
        #04040e;
}

.video-shell video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #03030a;
}

.video-corner {
    position: absolute;
    width: 38px;
    height: 38px;
    pointer-events: none;
}

.corner-one {
    left: 11px;
    top: 11px;
    border-left: 1px solid #7dbaff;
    border-top: 1px solid #a57dff;
}

.corner-two {
    right: 11px;
    bottom: 11px;
    border-right: 1px solid #ff7bcb;
    border-bottom: 1px solid #ad77ff;
}

.video-rune {
    position: absolute;
    right: 13px;
    top: 11px;
    color: #cab6ff;
    text-shadow: 0 0 12px #8c68ff;
    pointer-events: none;
}

.video-info {
    padding: 16px 17px 18px;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #746c91;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.video-info h3 {
    margin: 9px 0 7px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 500;
}

.video-info p {
    margin: 0 0 13px;
    color: #aaa2c2;
    font-size: 13px;
    line-height: 1.6;
}

.delete-button {
    padding: 7px 10px;
    border: 1px solid rgba(255,103,136,.18);
    border-radius: 8px;
    color: #a88291;
    background: transparent;
    cursor: pointer;
    font-size: 11px;
}

.delete-button:hover {
    color: #ff9aaf;
    border-color: rgba(255,103,136,.38);
}

.empty-state {
    grid-column: 1 / -1;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px dashed rgba(164,138,255,.23);
    border-radius: 18px;
    background: rgba(11,9,29,.44);
}

.empty-entity {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.empty-core {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.12), rgba(127,87,255,.14), transparent 67%);
    color: #cdbbff;
    font-size: 31px;
    box-shadow: 0 0 24px rgba(123,82,255,.18);
}

.empty-wing {
    width: 78px;
    height: 45px;
    background: linear-gradient(90deg, rgba(80,154,255,.34), rgba(154,87,255,.34), rgba(255,82,193,.26));
    clip-path: polygon(100% 52%, 55% 0, 65% 38%, 0 10%, 48% 58%, 10% 100%, 64% 75%);
}

.empty-wing.right { transform: scaleX(-1); }

.empty-state h3 {
    margin: 0 0 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
    font-weight: 500;
}

.empty-state p {
    margin: 0;
    color: #8f87a9;
    font-size: 13px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 25px;
    background: rgba(1,2,8,.78);
    backdrop-filter: blur(13px);
}

.modal-backdrop.open {
    display: flex;
}

.upload-modal {
    position: relative;
    width: min(620px, 96vw);
    max-height: 92vh;
    overflow: auto;
    padding: 28px;
    border: 1px solid rgba(190,166,255,.35);
    border-radius: 23px;
    background:
        radial-gradient(circle at 0 0, rgba(52,124,255,.14), transparent 32%),
        radial-gradient(circle at 100% 100%, rgba(255,80,193,.12), transparent 32%),
        linear-gradient(145deg, rgba(12,10,35,.98), rgba(8,7,25,.98));
    box-shadow: 0 30px 100px rgba(0,0,0,.55), 0 0 50px rgba(134,85,255,.16);
}

.modal-close {
    position: absolute;
    right: 17px;
    top: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.045);
    color: #b9b0d0;
    cursor: pointer;
    font-size: 23px;
}

.modal-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-right: 45px;
    margin-bottom: 21px;
}

.modal-rune {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    border: 1px solid rgba(180,153,255,.28);
    border-radius: 50%;
    color: #f0eaff;
    background: linear-gradient(145deg, rgba(70,146,255,.16), rgba(151,78,255,.18), rgba(255,80,194,.14));
}

.modal-heading h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 27px;
    font-weight: 500;
}

.modal-heading p {
    margin: 4px 0 0;
    color: #8f86a7;
    font-size: 12px;
}

.upload-modal form {
    display: grid;
    gap: 15px;
}

.upload-modal label {
    display: grid;
    gap: 7px;
    color: #bbb1d1;
    font-size: 12px;
    font-weight: 700;
}

.upload-modal input[type="text"],
.upload-modal select,
.upload-modal textarea {
    width: 100%;
    border: 1px solid rgba(186,163,255,.18);
    border-radius: 10px;
    outline: none;
    padding: 12px 13px;
    background: rgba(255,255,255,.035);
    color: #f5f1ff;
    font: inherit;
}

.upload-modal select option,
.upload-modal select optgroup {
    background: #100d28;
    color: white;
}

.upload-modal textarea {
    resize: vertical;
    min-height: 95px;
}

.upload-modal input:focus,
.upload-modal select:focus,
.upload-modal textarea:focus {
    border-color: rgba(131,113,255,.55);
    box-shadow: 0 0 0 3px rgba(116,88,255,.09);
}

.file-drop {
    position: relative;
    min-height: 135px;
    place-items: center;
    align-content: center;
    text-align: center;
    padding: 19px;
    border: 1px dashed rgba(170,143,255,.34);
    border-radius: 13px;
    background: linear-gradient(145deg, rgba(67,127,255,.055), rgba(146,80,255,.055), rgba(255,77,188,.045));
}

.file-drop input[type="file"] {
    width: 100%;
    margin-top: 9px;
    color: #8f87a8;
    font-size: 11px;
}

.file-rune {
    color: #b8a1ff;
    font-size: 30px;
}

.file-drop strong {
    color: #eae4fb;
    font-size: 14px;
}

.file-drop > span:last-of-type {
    color: #766e8c;
    font-size: 10px;
    font-weight: 500;
}

.publish-button {
    padding: 13px 16px;
    border: 1px solid rgba(221,198,255,.25);
    border-radius: 11px;
    color: white;
    cursor: pointer;
    font-weight: 800;
    background: linear-gradient(90deg, #397fff, #8f54ff 52%, #ff56c3);
    box-shadow: 0 11px 32px rgba(120,77,255,.22);
}

@media (max-width: 1050px) {
    .sidebar { width: 285px; }
    .page { margin-left: 285px; padding: 28px 26px 60px; }
    .hero { align-items: flex-start; flex-wrap: wrap; }
    .post-button { margin-left: 116px; }
    .video-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        max-height: none;
    }

    .entity-tree {
        max-height: 420px;
    }

    .page {
        margin-left: 0;
        padding: 20px 15px 50px;
    }

    .hero {
        min-height: 0;
        padding: 30px 22px;
    }

    .hero-symbol {
        width: 66px;
        height: 66px;
        font-size: 28px;
    }

    .hero h2 { font-size: 38px; }
    .post-button { margin-left: 0; width: 100%; justify-content: center; }
}


/* Owner-only controls. Hidden entirely from normal visitors because
   the server only renders them into the page after owner authentication. */

.owner-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid rgba(203,178,255,.32);
    border-radius: 13px;
    background: linear-gradient(90deg, rgba(49,113,255,.12), rgba(137,77,255,.14), rgba(255,79,193,.10));
    box-shadow: 0 0 32px rgba(123,81,255,.08);
}

.owner-bar strong {
    font-size: 12px;
    color: #d8cdf5;
}

.owner-badge {
    display: inline-block;
    margin-right: 10px;
    padding: 6px 8px;
    border-radius: 999px;
    color: #9fffe0;
    background: rgba(84,255,200,.08);
    border: 1px solid rgba(84,255,200,.20);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .14em;
}

.owner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.owner-actions form { margin: 0; }

.owner-action-btn,
.owner-logout-btn {
    padding: 9px 12px;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 800;
    font-size: 11px;
}

.owner-action-btn {
    color: white;
    border: 1px solid rgba(194,170,255,.24);
    background: linear-gradient(90deg, rgba(65,128,255,.62), rgba(139,77,255,.68), rgba(255,80,194,.60));
}

.owner-logout-btn {
    color: #b8afcc;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.035);
}

.chronicle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-bottom: 22px;
}

.chronicle-card {
    position: relative;
    min-height: 190px;
    overflow: hidden;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0, rgba(255,83,195,.08), transparent 33%),
        linear-gradient(145deg, rgba(13,10,36,.86), rgba(9,8,25,.91));
    box-shadow: 0 16px 45px rgba(0,0,0,.20);
}

.chronicle-card.hidden { display: none; }

.chronicle-rune {
    position: absolute;
    right: 18px;
    top: 16px;
    color: #b69cff;
    font-size: 21px;
    text-shadow: 0 0 15px rgba(155,112,255,.55);
}

.chronicle-card h3 {
    margin: 12px 0 9px;
    padding-right: 34px;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    font-size: 24px;
}

.chronicle-card p {
    margin: 0 0 16px;
    white-space: pre-wrap;
    color: #aaa2c2;
    line-height: 1.7;
    font-size: 13px;
}

.owner-login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 25px;
}

.owner-login-card {
    position: relative;
    z-index: 2;
    width: min(460px, 94vw);
    padding: 36px;
    text-align: center;
    border: 1px solid rgba(190,166,255,.35);
    border-radius: 24px;
    background:
        radial-gradient(circle at 0 0, rgba(52,124,255,.14), transparent 34%),
        radial-gradient(circle at 100% 100%, rgba(255,80,193,.12), transparent 34%),
        linear-gradient(145deg, rgba(12,10,35,.98), rgba(8,7,25,.98));
    box-shadow: 0 30px 100px rgba(0,0,0,.55), 0 0 60px rgba(134,85,255,.14);
}

.owner-sigil {
    margin: 0 auto 15px;
}

.owner-login-card h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 35px;
    font-weight: 500;
    background: linear-gradient(90deg, #9bd1ff, #c49cff 52%, #ff9cdb);
    -webkit-background-clip: text;
    color: transparent;
}

.owner-subtitle {
    margin: 7px 0 25px;
    color: #9e95b9;
    font-size: 11px;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.owner-login-form {
    display: grid;
    gap: 16px;
    text-align: left;
}

.owner-login-form label {
    display: grid;
    gap: 7px;
    color: #bbb1d1;
    font-size: 12px;
    font-weight: 700;
}

.owner-login-form input {
    width: 100%;
    border: 1px solid rgba(186,163,255,.18);
    border-radius: 10px;
    outline: none;
    padding: 13px;
    background: rgba(255,255,255,.035);
    color: #f5f1ff;
}

.owner-back-link {
    display: inline-block;
    margin-top: 22px;
    color: #8f84b0;
    text-decoration: none;
    font-size: 12px;
}

.owner-back-link:hover { color: #c8b8f4; }

@media (max-width: 760px) {
    .owner-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .owner-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .chronicle-grid {
        grid-template-columns: 1fr;
    }
}


/* Video download permissions */
.download-row {
    margin-top: 12px;
}

.download-button,
.download-protected {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
}

.download-button {
    color: #f4ecff;
    text-decoration: none;
    border: 1px solid rgba(142, 204, 255, .30);
    background: linear-gradient(90deg, rgba(53, 127, 255, .20), rgba(147, 79, 255, .22), rgba(255, 75, 190, .18));
}

.download-button:hover {
    border-color: rgba(199, 178, 255, .55);
    box-shadow: 0 0 18px rgba(140, 91, 255, .15);
}

.download-protected {
    color: #a9a0bd;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.025);
}

.video-owner-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.video-owner-controls form {
    margin: 0;
}

.download-toggle {
    padding: 8px 10px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 850;
}

.download-toggle.enable {
    color: #e9f9ff;
    border: 1px solid rgba(88, 190, 255, .28);
    background: rgba(61, 135, 255, .12);
}

.download-toggle.disable {
    color: #ffd9f1;
    border: 1px solid rgba(255, 89, 190, .26);
    background: rgba(255, 74, 184, .10);
}

.download-global.allow {
    border-color: rgba(100, 205, 255, .28);
}

.download-global.block {
    border-color: rgba(255, 100, 198, .28);
}

.download-choice {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: flex-start;
    gap: 10px !important;
    padding: 12px;
    border: 1px solid rgba(187, 161, 255, .16);
    border-radius: 11px;
    background: rgba(255,255,255,.025);
    cursor: pointer;
}

.download-choice input {
    width: auto !important;
    margin-top: 3px;
    accent-color: #a36cff;
}

.download-choice span {
    display: grid;
    gap: 3px;
}

.download-choice strong {
    color: #e6dcf8;
    font-size: 11px;
}

.download-choice small {
    color: #8f87a5;
    font-size: 10px;
}
