:root {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #20233a;
    background: #f5f7fb;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --ink: #20233a;
    --muted: #85899f;
    --line: #eceef4;
    --purple: #6656e8;
    --purple-dark: #5545d2;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.dashboard-body { background: #f6f7fb; }
.app-shell { min-height: 100vh; }
.sidebar { width: 250px; position: fixed; inset: 0 auto 0 0; padding: 28px 20px; background: #fff; border-right: 1px solid #eceef4; display: flex; flex-direction: column; z-index: 3; }
.brand, .auth-brand, .mobile-brand { display: flex; align-items: center; gap: 10px; font: 800 21px 'Manrope', sans-serif; letter-spacing: -1px; }
.brand-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; color: white; border-radius: 11px; background: linear-gradient(145deg, #8375ff, #5744d8); font: 800 17px 'Manrope', sans-serif; box-shadow: 0 5px 12px #6959e53b; }
.side-label, .eyebrow { color: #a4a8ba; letter-spacing: 1.3px; font-size: 10px; font-weight: 700; }
.side-label { margin: 53px 0 12px 10px; }
.side-link { color: #72778d; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 9px; }
.side-link.active { color: var(--purple); background: #f1efff; }
.side-icon { font-size: 19px; line-height: 14px; }
.sidebar-bottom { margin-top: auto; }
.profile { display: flex; align-items: center; gap: 10px; padding: 15px 3px 17px; border-top: 1px solid var(--line); }
.avatar { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; color: #5b4bd1; background: #eeebff; font-weight: 700; font-size: 12px; }
.profile-email { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; font-weight: 600; color: #555a70; }
.logout-button { cursor: pointer; border: 0; background: none; color: #85899f; font-size: 12px; width: 100%; padding: 10px 3px; text-align: left; }
.logout-button span { float: right; }
.main-content { margin-left: 250px; min-height: 100vh; }
.topbar { height: 73px; display: flex; align-items: center; justify-content: flex-end; gap: 25px; padding: 0 5.2%; border-bottom: 1px solid #eceef4; background: rgba(255,255,255,.82); }
.topbar-note { color: #9296a9; font-size: 12px; }
.status-pill { display: flex; align-items: center; gap: 7px; color: #687087; font-size: 11px; font-weight: 600; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: #45c69b; box-shadow: 0 0 0 4px #45c69b1c; }
.mobile-brand { display: none; }
.content-wrap { max-width: 1480px; padding: 42px 5.2% 20px; margin: auto; }
.welcome-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 30px; gap: 20px; }
.welcome-row .eyebrow { margin-bottom: 13px; }
h1, h2, h3, p { margin-top: 0; }
.welcome-row h1 { margin: 0; font: 800 clamp(27px, 3vw, 36px)/1.2 'Manrope', sans-serif; letter-spacing: -1.6px; color: #20233a; }
.welcome-row p { margin: 10px 0 0; color: #888da1; font-size: 13px; }
.button { border: 0; border-radius: 8px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 11px; padding: 0 17px; cursor: pointer; font-size: 12px; font-weight: 700; transition: background .16s, transform .16s, box-shadow .16s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--purple); color: white; box-shadow: 0 5px 13px #6656e82b; }
.button-primary:hover { background: var(--purple-dark); box-shadow: 0 7px 17px #6656e83b; }
.create-top { min-height: 41px; white-space: nowrap; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card { background: white; border: 1px solid #eceef4; border-radius: 12px; padding: 19px 21px 17px; min-height: 122px; box-shadow: 0 3px 9px #20233a04; }
.stat-label { display: flex; justify-content: space-between; color: #979bad; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.stat-icon { width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; }
.stat-icon.purple { color: #6758dc; background: #f0eeff; }
.stat-icon.green { color: #22a97d; background: #e9f8f2; }
.stat-icon.orange { color: #e29a4e; background: #fff5e9; }
.stat-value { margin-top: 8px; font: 800 27px 'Manrope', sans-serif; letter-spacing: -1px; }
.stat-small { font: 500 12px 'DM Sans', sans-serif; letter-spacing: 0; color: #898da0; }
.stat-caption { margin-top: 2px; color: #a0a4b4; font-size: 10px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .82fr); gap: 18px; align-items: start; }
.links-panel, .create-panel { border: 1px solid #eceef4; border-radius: 12px; background: white; box-shadow: 0 3px 9px #20233a04; }
.panel-heading { display: flex; justify-content: space-between; gap: 10px; align-items: center; min-height: 72px; padding: 16px 19px; border-bottom: 1px solid #f0f1f5; }
.panel-heading h2 { margin: 0 0 5px; font: 700 14px 'Manrope', sans-serif; letter-spacing: -.3px; }
.panel-heading p { margin: 0; color: #989cad; font-size: 10px; }
.count-badge { border-radius: 30px; background: #f4f4f8; padding: 6px 9px; color: #85899d; font-size: 9px; font-weight: 600; white-space: nowrap; }
.link-row { min-height: 86px; display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-bottom: 1px solid #f1f2f6; }
.link-row:last-child { border-bottom: 0; }
.link-thumb { width: 53px; height: 53px; flex: 0 0 53px; object-fit: cover; border-radius: 8px; background: #f0f1f5; }
.link-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.link-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; }
.link-info a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #6858df; font-size: 9px; font-weight: 600; }
.link-info a span { color: #9990df; }
.link-date { color: #a5a8b5; font-size: 9px; }
.link-clicks { min-width: 41px; display: flex; flex-direction: column; gap: 2px; text-align: center; }
.link-clicks strong { font: 700 12px 'Manrope', sans-serif; }
.link-clicks span { color: #a2a5b2; font-size: 8px; }
.icon-button { flex: 0 0 29px; height: 29px; display: grid; place-items: center; color: #85899d; background: white; border: 1px solid #eceef4; border-radius: 7px; font-size: 13px; cursor: pointer; }
.icon-button:hover { color: var(--purple); border-color: #d3ceff; background: #faf9ff; }
.copy-trigger { font-size: 16px; }
.copy-trigger.copied { color: #209a70; border-color: #bcebd7; background: #f0fbf6; }
.delete-button:hover { color: #df596a; border-color: #f6cdd2; background: #fff8f8; }
.link-row form { margin: 0; }
.create-panel { padding-bottom: 16px; }
.create-panel .panel-heading { margin-bottom: 15px; }
.link-form { padding: 0 17px; }
.stack-form { display: flex; flex-direction: column; gap: 14px; }
.stack-form label { display: flex; flex-direction: column; gap: 7px; color: #565b70; font-size: 10px; font-weight: 700; }
.required { color: #e36a71; }
.optional { color: #a4a8b6; font-weight: 500; }
.stack-form input:not([type=hidden]):not([type=file]), .stack-form textarea, .stack-form select { width: 100%; outline: none; border: 1px solid #e8eaf1; border-radius: 7px; background: #fff; color: #292c40; padding: 10px 11px; font-size: 10px; font-weight: 400; transition: border-color .15s, box-shadow .15s; }
.stack-form input::placeholder, .stack-form textarea::placeholder { color: #b0b3c0; }
.stack-form input:focus, .stack-form textarea:focus { border-color: #a69cff; box-shadow: 0 0 0 3px #6656e812; }
.stack-form textarea { resize: vertical; min-height: 66px; }
.field-help { margin-top: -3px; color: #9da1b0; font-size: 9px; font-weight: 400; }
.stack-form .file-input { width: 100%; padding: 8px; border: 1px dashed #dfe1ea; border-radius: 7px; color: #81869a; font-size: 9px; background: #fbfbfd; }
.file-input::file-selector-button { margin-right: 9px; padding: 6px 9px; border: 0; border-radius: 5px; background: #f0eeff; color: #6354d8; font: 600 9px 'DM Sans', sans-serif; cursor: pointer; }
.slug-input { display: flex; align-items: center; border: 1px solid #e8eaf1; border-radius: 7px; overflow: hidden; }
.slug-input:focus-within { border-color: #a69cff; box-shadow: 0 0 0 3px #6656e812; }
.slug-input > span { flex: 0 0 auto; padding: 0 0 0 9px; color: #a0a4b2; font-size: 9px; }
.slug-input input { min-width: 0; border: 0 !important; box-shadow: none !important; padding-left: 5px !important; }
.button-wide { width: 100%; }
.link-form .button { margin-top: 2px; }
.cancel-link { color: #7e8398; text-align: center; font-size: 10px; }
.current-image { width: 70px; height: 54px; margin-top: -8px; object-fit: cover; border-radius: 6px; }
.landing-meta-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack-form .preview-reset { display: flex; flex-direction: row; align-items: center; gap: 7px; font-weight: 500; }
.stack-form .preview-reset input[type=checkbox] { width: auto; margin: 0; padding: 0; }
[data-page-type-fields][hidden] { display: none; }
.empty-state { padding: 48px 20px; text-align: center; }
.empty-art { width: 42px; height: 42px; margin: 0 auto 14px; display: grid; place-items: center; color: #6656e8; border-radius: 13px; background: #f0eeff; font-size: 20px; }
.empty-state h3 { margin-bottom: 6px; font: 700 13px 'Manrope', sans-serif; }
.empty-state p { margin-bottom: 17px; color: #979bad; font-size: 10px; }
.empty-state .button { min-height: 36px; font-size: 10px; }
.alert { padding: 11px 13px; margin-bottom: 17px; border-radius: 8px; font-size: 11px; }
.alert-success { background: #eaf8f1; color: #217d5e; }
.alert-error { background: #fff0f1; color: #b44150; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; padding: 25px 3px 4px; color: #a1a5b3; font-size: 9px; }
.page-footer > span:first-child { font-size: 8px; letter-spacing: 1px; font-weight: 700; }
.footer-dot { color: #7567e6; }
.qr-dialog { width: min(390px, calc(100vw - 32px)); padding: 28px; border: 0; border-radius: 16px; text-align: center; color: var(--ink); box-shadow: 0 20px 70px #17162e35; }
.qr-dialog::backdrop { background: #17162e70; backdrop-filter: blur(3px); }
.qr-dialog .eyebrow { margin-bottom: 9px; }
.qr-dialog h2 { margin-bottom: 18px; font: 700 19px 'Manrope', sans-serif; }
.dialog-close { position: absolute; top: 12px; right: 14px; border: 0; background: none; color: #85899d; font-size: 24px; cursor: pointer; }
.qr-frame { width: 220px; height: 220px; margin: 0 auto 15px; padding: 8px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; }
.qr-frame img { width: 100%; height: 100%; object-fit: contain; }
.qr-url { overflow-wrap: anywhere; color: #777c92; font-size: 10px; margin-bottom: 17px; }

.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 30px 18px; background: radial-gradient(ellipse at 50% 0%, #efedff 0, #f7f8fc 56%, #f6f7fb 100%); }
.auth-shell { width: min(420px, 100%); }
.auth-brand { justify-content: center; margin-bottom: 27px; }
.auth-card { padding: 34px; border: 1px solid #eceef4; border-radius: 16px; background: white; box-shadow: 0 15px 50px #33325e0b; }
.auth-card .eyebrow { margin-bottom: 12px; color: #7669dd; }
.auth-card h1 { margin-bottom: 8px; font: 800 26px 'Manrope', sans-serif; letter-spacing: -1px; }
.auth-card .muted { margin-bottom: 22px; color: #9296a8; font-size: 12px; line-height: 1.6; }
.auth-card .stack-form { gap: 17px; }
.auth-card .stack-form label { gap: 8px; font-size: 11px; }
.auth-card .stack-form input:not([type=hidden]) { padding: 12px; font-size: 12px; }
.auth-card .button { min-height: 45px; margin-top: 4px; font-size: 12px; }
.auth-foot { margin-top: 20px; color: #a4a8b5; text-align: center; font-size: 10px; }
.auth-foot span { margin: 0 6px; color: #7669dd; }
.mobile-break { display: none; }

.landing-page { min-width: 320px; padding-bottom: 105px; color: #202b3a; background: #fff; font-family: Arial, Helvetica, sans-serif; }
.landing-header { padding: 18px max(22px, calc((100% - 1120px) / 2)); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; }
.landing-brand { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 700; color: #18243a; }
.landing-brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: white; border-radius: 11px; background: #2874ed; font-weight: 700; }
.landing-open { padding: 12px 19px; border-radius: 30px; color: white; background: #2874ed; font-size: 14px; font-weight: 600; }
.landing-open span { margin-left: 6px; }
.landing-share-info { padding: 22px max(22px, calc((100% - 1120px) / 2)); border-bottom: 1px solid #f1f1f1; }
.landing-share-info h1 { margin: 0; color: #111; font-size: 19px; font-weight: 600; }
.landing-share-info p { margin: 8px 0 0; color: #999; font-size: 13px; }
.landing-container { width: min(900px, 100%); margin: auto; padding: 27px 18px; }
.landing-video-title { margin: 0 0 18px; color: #344354; font-size: 20px; overflow-wrap: anywhere; }
.landing-main-player { position: relative; display: flex; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; align-items: center; justify-content: center; border-radius: 16px; background: #272331; }
.landing-main-player::after { position: absolute; inset: 0; content: ""; background: linear-gradient(0deg, #0009, transparent 48%, #0002); }
.landing-main-player > img { width: 100%; height: 100%; object-fit: cover; }
.landing-play { position: absolute; z-index: 1; display: flex; gap: 10px; align-items: center; padding: 12px 18px; border-radius: 30px; color: white; background: #000c; font-size: 16px; font-weight: 700; }
.landing-play span { font-size: 19px; }
.landing-video-meta { position: absolute; z-index: 1; bottom: 17px; left: 18px; color: white; font-size: 13px; }
.landing-section-title { margin: 32px 0 16px; color: #222; font-size: 21px; }
.landing-suggestions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.landing-video-card { min-width: 0; display: flex; flex-direction: column; }
.landing-thumbnail { position: relative; display: grid; aspect-ratio: 16 / 10; overflow: hidden; place-items: center; border-radius: 10px; background: #483937; }
.landing-thumbnail > img { width: 100%; height: 100%; object-fit: cover; }
.landing-thumb-play { position: absolute; display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; color: white; background: #000a; font-size: 16px; }
.landing-duration { position: absolute; right: 7px; bottom: 7px; padding: 4px 6px; border-radius: 4px; color: white; background: #000c; font-size: 11px; }
.landing-card-title { margin-top: 9px; color: #303c4a; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.landing-card-size { margin-top: 4px; color: #999; font-size: 11px; }
.landing-bottom-bar { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; display: flex; justify-content: center; gap: 12px; padding: 13px 18px; background: #fffffff5; box-shadow: 0 -4px 20px #00000012; }
.landing-bottom-button { flex: 1; max-width: 300px; padding: 15px 8px; border-radius: 11px; text-align: center; font-size: 14px; font-weight: 700; }
.landing-download { color: #1769dd; background: #e9f1ff; }
.landing-view { color: white; background: #2874ed; }

@media (max-width: 1150px) {
    .sidebar { width: 215px; }
    .main-content { margin-left: 215px; }
    .content-wrap { padding-left: 3.5%; padding-right: 3.5%; }
    .workspace-grid { grid-template-columns: minmax(0, 1.2fr) minmax(280px, .9fr); gap: 13px; }
    .link-row { gap: 8px; padding-left: 11px; padding-right: 11px; }
    .link-thumb { width: 45px; height: 45px; flex-basis: 45px; }
}
@media (max-width: 850px) {
    .sidebar { width: 65px; padding: 22px 10px; align-items: center; }
    .brand { gap: 0; }
    .brand > span:last-child, .side-label, .side-link:not(.active), .side-link.active { font-size: 0; }
    .side-link { width: 42px; height: 42px; justify-content: center; padding: 0; margin-top: 30px; }
    .side-icon { font-size: 19px; }
    .profile-email, .logout-button { display: none; }
    .profile { justify-content: center; }
    .main-content { margin-left: 65px; }
    .workspace-grid { grid-template-columns: minmax(0, 1.2fr) minmax(260px, .9fr); }
}
@media (max-width: 680px) {
    .sidebar { display: none; }
    .main-content { margin: 0; }
    .topbar { height: 61px; justify-content: space-between; padding: 0 18px; }
    .mobile-brand { display: flex; font-size: 17px; }
    .mobile-brand .brand-mark { width: 29px; height: 29px; border-radius: 9px; font-size: 15px; }
    .topbar-note { display: none; }
    .status-pill { font-size: 10px; }
    .content-wrap { padding: 29px 16px 17px; }
    .welcome-row { align-items: flex-start; margin-bottom: 22px; }
    .welcome-row h1 { font-size: 27px; letter-spacing: -1.2px; }
    .welcome-row p { max-width: 280px; font-size: 11px; line-height: 1.5; }
    .create-top { width: 40px; min-width: 40px; padding: 0; font-size: 20px; }
    .create-top span { display: none; }
    .welcome-row .eyebrow { margin-bottom: 10px; }
    .stats-grid { gap: 8px; margin-bottom: 14px; }
    .stat-card { min-height: 101px; padding: 12px 10px; border-radius: 9px; }
    .stat-label { font-size: 7px; letter-spacing: .5px; gap: 3px; }
    .stat-icon { width: 19px; height: 19px; border-radius: 6px; font-size: 11px; }
    .stat-value { margin-top: 8px; font-size: 22px; }
    .stat-small { display: block; font-size: 9px; }
    .stat-caption { font-size: 8px; line-height: 1.3; }
    .workspace-grid { grid-template-columns: 1fr; gap: 14px; }
    .panel-heading { min-height: 65px; padding: 13px 14px; }
    .link-row { min-height: 78px; gap: 8px; padding: 10px; }
    .link-thumb { width: 43px; height: 43px; flex-basis: 43px; }
    .link-info strong { font-size: 10px; }
    .link-info a { font-size: 8px; }
    .link-date { font-size: 8px; }
    .link-clicks { min-width: 32px; }
    .icon-button { flex-basis: 27px; height: 27px; }
    .create-panel { scroll-margin-top: 12px; }
    .link-form { padding: 0 14px; }
    .page-footer { font-size: 8px; }
    .mobile-break { display: initial; }
    .landing-header { padding: 14px 16px; }
    .landing-brand { gap: 8px; font-size: 18px; }
    .landing-brand-mark { width: 33px; height: 33px; }
    .landing-open { padding: 10px 14px; font-size: 12px; }
    .landing-share-info { padding: 18px 16px; }
    .landing-container { padding: 22px 15px; }
    .landing-suggestions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 12px; }
    .landing-play { gap: 7px; padding: 10px 13px; font-size: 13px; }
    .landing-video-meta { bottom: 12px; left: 12px; font-size: 11px; }
}
@media (max-width: 390px) {
    .link-row { gap: 6px; padding-left: 8px; padding-right: 8px; }
    .link-thumb { width: 38px; height: 38px; flex-basis: 38px; }
    .link-clicks { display: none; }
    .welcome-row h1 { font-size: 24px; }
}
