@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap");

:root {
    --bg-a: #6d81db;
    --bg-b: #7b66c7;
    --card: rgba(255, 255, 255, .95);
    --line: rgba(59, 72, 128, .16);
    --ink-1: #263149;
    --ink-2: #5e6785;
    --accent: #5c70e7;
    --accent-2: #7a66d4;
    --warm: #f6d776;
    --ok: #59a957;
    --danger: #da6e73;
    --soft-shadow: 0 18px 42px rgba(41, 44, 109, .18);
}

* {
    box-sizing: border-box;
}

html {
    letter-spacing: 0;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--ink-1);
    font-family: "Manrope", "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 244, 214, .45), transparent 24rem),
        linear-gradient(130deg, var(--bg-a), var(--bg-b));
}

body.auth-body {
    display: grid;
    place-items: center;
    padding: 16px;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.auth-shell {
    width: min(430px, 100%);
}

.auth-card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
    box-shadow: var(--soft-shadow);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.auth-brand h1 {
    margin: 0;
    color: #5f6fdf;
    font-size: 28px;
    font-weight: 900;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.app-shell {
    min-height: 100vh;
    padding: 14px 16px 24px;
}

.site-nav,
.main-content {
    width: min(1240px, 100%);
    max-width: 100%;
    margin-inline: auto;
}

.site-nav {
    margin-bottom: 12px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    box-shadow: var(--soft-shadow);
}

.brand {
    min-width: 205px;
    color: var(--ink-1);
}

.brand:hover {
    color: var(--ink-1);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid rgba(90, 96, 160, .22);
    border-radius: 12px;
    background: linear-gradient(150deg, #fef4d6, #f4f6ff);
    color: #5f6fdf;
    font-size: 18px;
    font-weight: 800;
}

.brand strong {
    display: block;
    color: #5f6fdf;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.brand small,
.side-profile small {
    display: block;
    margin-top: 4px;
    color: var(--ink-2);
    font-size: 12px;
}

.side-nav {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    justify-content: center;
    gap: 5px;
}

.side-nav::-webkit-scrollbar {
    display: none;
}

.side-nav .nav-link {
    min-height: 40px;
    gap: 8px !important;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #6a7090;
    font-size: 14px;
    font-weight: 800;
}

.side-nav .nav-link:hover,
.side-nav .nav-link.active {
    color: #3d63e0;
    border-color: rgba(90, 107, 210, .24);
    background: linear-gradient(130deg, rgba(105, 131, 243, .18), rgba(84, 212, 245, .10));
    box-shadow: 0 10px 24px rgba(96, 116, 224, .28);
}

.side-nav .nav-link svg,
.btn svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.side-profile {
    flex: 0 0 auto;
    min-width: 0;
    color: #6a75b7;
}

.profile-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    max-width: 178px;
    padding: 6px 9px;
    border: 1px solid #d8def8;
    border-radius: 10px;
    background: #edf0ff;
    color: #6a75b7;
    text-align: left;
}

.profile-toggle:hover,
.profile-toggle[aria-expanded="true"] {
    border-color: rgba(90, 107, 210, .28);
    background: #f2f5ff;
    color: #4f5f96;
}

.profile-toggle > svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.side-profile strong {
    overflow: hidden;
    display: block;
    color: #4f5f96;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-summary {
    overflow: hidden;
    min-width: 70px;
    max-width: 90px;
}

.profile-dropdown {
    min-width: 184px;
    padding: 8px;
    border: 1px solid rgba(90, 101, 165, .16);
    border-radius: 12px;
    box-shadow: 0 16px 38px rgba(18, 28, 62, .18);
}

.profile-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    border-radius: 9px;
    color: #4f5f96;
    font-size: 13px;
    font-weight: 800;
}

.profile-dropdown .dropdown-item svg {
    width: 16px;
    height: 16px;
}

.profile-dropdown .dropdown-item:hover {
    background: #eef2ff;
    color: #344dbe;
}

.profile-dropdown .dropdown-item.is-logout {
    color: #b42318;
}

.profile-dropdown .dropdown-item.is-logout:hover {
    background: #fff1f2;
    color: #9f1239;
}

.avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.main-content {
    padding: 0;
}

.workspace-card {
    max-width: 100%;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    box-shadow: var(--soft-shadow);
}

.min-w-0 {
    min-width: 0;
}

.eyebrow {
    color: #5f6fdf;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 800;
    line-height: 1.05;
}

.topbar {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(84, 94, 152, .14);
}

.search-box {
    width: min(320px, 36vw);
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(90, 101, 165, .22);
    border-radius: 12px;
    background: #fbfcff;
}

.search-box svg {
    width: 18px;
    height: 18px;
    color: var(--ink-2);
}

.icon-square,
.icon-square-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.icon-square {
    width: 42px;
    height: 42px;
}

.icon-square-sm {
    width: 34px;
    height: 34px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    font-weight: 800;
}

.btn-primary {
    border: 0;
    background: linear-gradient(130deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 18px rgba(93, 103, 196, .24);
}

.btn-primary:hover,
.btn-primary:focus {
    filter: brightness(1.04);
    background: linear-gradient(130deg, var(--accent), var(--accent-2));
}

.btn-outline-primary {
    border-color: rgba(92, 112, 231, .34);
    color: #5168c6;
}

.btn-outline-primary:hover {
    border-color: transparent;
    background: linear-gradient(130deg, var(--accent), var(--accent-2));
}

.btn-light,
.btn-outline-secondary {
    border-color: rgba(90, 101, 165, .18);
    background: #eef1f8;
    color: #6f7594;
}

.card {
    overflow: hidden;
    border-color: rgba(90, 101, 165, .16);
    border-radius: 12px;
    background: #fcfdff;
}

.panel-card,
.metric-card {
    box-shadow: none;
}

.metric-card {
    position: relative;
    min-height: 142px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.metric-card:hover,
.panel-card:hover {
    border-color: rgba(90, 101, 165, .26);
    box-shadow: 0 10px 18px rgba(80, 92, 162, .12);
}

.metric-card:hover {
    transform: translateY(-1px);
}

.metric-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(90, 101, 165, .16);
    border-radius: 10px;
    background: #f7f9fd;
    color: #5f6fdf;
}

.text-success {
    color: var(--ok) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: #c48724 !important;
}

.text-secondary {
    color: var(--ink-2) !important;
}

.text-bg-success {
    background: #e8f8e4 !important;
    color: #5c9f4f !important;
}

.text-bg-warning {
    background: #fff3dc !important;
    color: #a86f18 !important;
}

.text-bg-secondary {
    background: #eef1f8 !important;
    color: #6f7594 !important;
}

.text-bg-primary,
.text-bg-info {
    background: #edf0ff !important;
    color: #5f6fdf !important;
}

.bar-chart {
    display: grid;
    grid-template-columns: repeat(7, minmax(38px, 1fr));
    align-items: end;
    gap: 14px;
    min-height: 252px;
}

.bar-item {
    display: grid;
    align-items: end;
    gap: 8px;
    height: 100%;
    text-align: center;
    color: var(--ink-2);
    font-weight: 800;
}

.bar-track {
    display: flex;
    align-items: flex-end;
    width: 100%;
    height: 210px;
    overflow: hidden;
    border: 1px solid rgba(90, 101, 165, .12);
    border-radius: 10px;
    background: #f0f3fa;
}

.bar-fill {
    display: block;
    width: 100%;
    min-height: 12px;
    border-radius: 10px 10px 0 0;
    background: linear-gradient(180deg, #6f82ef, #54c8de);
}

.list-group-item {
    border-color: rgba(90, 101, 165, .14);
    background: #f7f9fd;
}

.form-control,
.form-select {
    min-height: 42px;
    border-color: rgba(90, 101, 165, .22);
    border-radius: 12px;
    background-color: #fbfcff;
    color: var(--ink-1);
}

.form-control:focus,
.form-select:focus {
    border-color: #7384e9;
    box-shadow: 0 0 0 .25rem rgba(97, 114, 229, .18);
}

.form-label {
    color: #677091;
    font-size: 13px;
    font-weight: 800;
}

.form-check-input:checked {
    border-color: var(--accent);
    background-color: var(--accent);
}

.table {
    min-width: 720px;
}

.table th {
    color: #69759c;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
    background: #f5f7fe;
}

.table td {
    color: #2f3957;
    white-space: nowrap;
}

.table-hover > tbody > tr:hover > * {
    background-color: #f7f9fd;
}

.badge {
    font-weight: 800;
}

.settings-card {
    max-width: 860px;
}

.profile-card {
    max-width: 760px;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(90, 101, 165, .16);
    border-radius: 12px;
    background: #f7f9fd;
}

.profile-info p {
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 800;
}

.profile-info strong {
    color: var(--ink-1);
    font-size: 17px;
    font-weight: 900;
}

.settings-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.settings-switch-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.settings-switch {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid rgba(90, 101, 165, .16);
    border-radius: 12px;
    background: #f7f9fd;
}

.settings-switch .form-check-input {
    width: 44px;
    height: 22px;
    margin: 0;
}

.settings-switch .form-check-label {
    color: #4f5f96;
    font-weight: 800;
}

.settings-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #2f3957;
    font-size: 15px;
    font-weight: 900;
}

.settings-section-title svg {
    width: 18px;
    height: 18px;
    color: #5c70e7;
}

.secret-input .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.secret-input .btn {
    min-width: 46px;
    border-color: rgba(90, 101, 165, .22);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    color: #596381;
}

.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.generate-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
    gap: 16px;
}

.generate-card {
    min-height: 100%;
}

.generate-log-card {
    grid-column: 1 / -1;
}

.generate-log-card .generate-log {
    min-height: 240px;
    max-height: 360px;
}

.generate-preview-shell {
    display: grid;
    gap: 12px;
}

.generate-preview-card .preview-tabs {
    margin-bottom: 0;
}

.generate-preview-card .preview-toolbar,
.generate-preview-card .preview-controls {
    align-items: stretch;
    flex-direction: column;
}

.generate-preview-card .preview-controls {
    justify-content: flex-start;
}

.generate-preview-card .preview-picker,
.generate-preview-card .preview-buttons,
.generate-preview-card .preview-controls > .btn-primary {
    width: 100%;
}

.generate-preview-card .preview-buttons .btn {
    flex: 1 1 0;
    min-width: 0;
}

.generate-preview-card .preview-meta {
    min-width: 0;
}

.generate-preview-card .preview-meta h2 {
    overflow-wrap: anywhere;
}

.generate-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.generate-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.generate-mode-switch {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border: 1px solid rgba(90, 101, 165, .16);
    border-radius: 12px;
    background: #f7f9fd;
}

.generate-mode-switch .btn {
    min-width: 86px;
    min-height: 36px;
    border-radius: 9px;
}

.generate-mode-switch .btn-check:checked + .btn {
    border-color: transparent;
    background: linear-gradient(130deg, #5c70e7, #7a66d4);
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(82, 119, 221, .20);
}

.btn.btn-generate {
    border: 0;
    background: linear-gradient(130deg, #5c70e7, #54c8de);
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(82, 119, 221, .22);
}

.btn.btn-generate:hover {
    filter: brightness(1.05);
    color: #ffffff;
    box-shadow: 0 14px 24px rgba(82, 119, 221, .30);
}

.generate-meta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 46px;
    padding: 9px 14px;
    font-weight: 800;
    white-space: nowrap;
}

.generate-meta-btn svg {
    width: 15px;
    height: 15px;
}

.title-meta-group .form-control {
    min-width: 0;
}

.title-meta-group .generate-meta-btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.meta-modal .modal-content {
    border: 1px solid rgba(90, 101, 165, .16);
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(18, 28, 62, .24);
}

.meta-modal .modal-header,
.meta-modal .modal-footer {
    border-color: rgba(90, 101, 165, .12);
}

.meta-option-list {
    display: grid;
    gap: 12px;
}

.meta-option-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(90, 101, 165, .16);
    border-radius: 12px;
    background: #f7f9fd;
}

.meta-option-card h3 {
    margin: 0 0 8px;
    color: #263149;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.35;
}

.meta-option-card p {
    margin: 0;
    color: #5e6785;
    font-size: 14px;
    line-height: 1.55;
}

.meta-option-index {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    margin-bottom: 10px;
    border-radius: 999px;
    background: #edf0ff;
    color: #5f6fdf;
    font-size: 12px;
    font-weight: 900;
}

.meta-option-action {
    align-self: center;
    white-space: nowrap;
}

.generate-switch {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid rgba(90, 101, 165, .16);
    border-radius: 12px;
    background: #f7f9fd;
}

.generate-switch .form-check-input {
    width: 44px;
    height: 22px;
    margin: 0;
}

.generate-switch .form-check-label {
    color: #4f5f96;
    font-weight: 800;
}

.generate-switch-inline {
    min-height: 46px;
    margin: 0;
    white-space: nowrap;
}

.amp-url-builder {
    width: 100%;
}

.amp-url-group {
    flex-wrap: nowrap;
}

.amp-url-group .amp-url-name {
    min-width: 130px;
    flex: 1 1 160px;
}

.amp-url-group .amp-url-suffix {
    min-width: 116px;
    max-width: 130px;
    flex: 0 0 126px;
    font-weight: 800;
}

.amp-url-group .amp-url-type {
    min-width: 120px;
    max-width: 132px;
    flex: 0 0 126px;
    font-weight: 800;
}

.amp-url-group .input-group-text {
    border-color: rgba(90, 101, 165, .22);
    background: #f7f9fd;
    color: #69759c;
    font-weight: 900;
}

.amp-url-group .form-control:disabled {
    background: #eef1f8;
    color: #4f5f96;
    opacity: 1;
}

.amp-url-r2-note {
    margin-top: 8px;
    color: #657198;
    font-size: .82rem;
    font-weight: 700;
}

.amp-url-check-status {
    margin-top: 8px;
    font-size: .82rem;
    font-weight: 800;
}

.amp-url-check-status.is-checking {
    color: #657198;
}

.amp-url-check-status.is-ok {
    color: #15803d;
}

.amp-url-check-status.is-warn {
    color: #b7791f;
}

.amp-url-check-status.is-error {
    color: #b42318;
}

.generate-log {
    min-height: 520px;
    padding: 14px;
    overflow: auto;
    border: 1px solid rgba(90, 101, 165, .16);
    border-radius: 12px;
    background: #101820;
    color: #d7e1f4;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
}

.log-line {
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.log-line:last-child {
    border-bottom: 0;
}

.log-line.is-ok {
    color: #8fe18f;
}

.log-line.is-warn {
    color: #ffd27a;
}

.generate-batch {
    display: grid;
    gap: 12px;
}

.batch-input {
    min-height: 360px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.55;
}

.batch-preview-list {
    display: grid;
    gap: 12px;
    margin-top: 6px;
}

.batch-preview-card {
    padding: 14px;
    border: 1px solid rgba(90, 101, 165, .16);
    border-radius: 12px;
    background: #f7f9fd;
}

.batch-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.batch-preview-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}

.batch-preview-head small {
    color: var(--ink-2);
    font-weight: 700;
}

.batch-preview-card .form-control,
.batch-preview-card .form-select {
    background-color: #ffffff;
}

.placeholder-layout {
    align-items: stretch;
}

.placeholder-editor-card .preview-tabs {
    margin-bottom: 12px;
}

.placeholder-editor-content {
    display: grid;
    gap: 12px;
}

.placeholder-code-editor {
    min-height: 610px;
    height: min(66vh, 760px);
    resize: vertical;
    border-color: rgba(16, 24, 32, .34);
    background: #101820;
    color: #d7e1f4;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.55;
    tab-size: 4;
}

.placeholder-code-editor:focus {
    border-color: #54c8de;
    background: #101820;
    color: #f6fbff;
    box-shadow: 0 0 0 .25rem rgba(84, 200, 222, .18);
}

.placeholder-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.btn.btn-placeholder-save {
    border: 0;
    background: linear-gradient(130deg, #20b7a7, #5c70e7);
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(32, 183, 167, .20);
}

.btn.btn-placeholder-save:hover {
    filter: brightness(1.05);
    color: #ffffff;
    box-shadow: 0 14px 24px rgba(32, 183, 167, .28);
}

.btn.btn-placeholder-save:disabled {
    background: #dce2ef;
    color: #7a839d;
    box-shadow: none;
    opacity: 1;
}

.placeholder-status {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef1f8;
    color: #687391;
    font-size: 12px;
    font-weight: 900;
}

.placeholder-status.is-ok {
    background: #e8f8e4;
    color: #4f944a;
}

.placeholder-status.is-warn {
    background: #fff3dc;
    color: #a86f18;
}

.placeholder-status.is-error {
    background: #ffe9eb;
    color: #b84b52;
}

.placeholder-preview-card .generate-preview-stage {
    min-height: 610px;
}

.placeholder-preview-card .generate-preview-stage .preview-frame {
    height: 610px;
}

.filemanager-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
    gap: 16px;
}

.filemanager-layout:not(.is-editing) {
    grid-template-columns: 1fr;
}

.filemanager-card {
    min-height: 100%;
}

.filemanager-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.filemanager-rename-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 380px;
    max-width: 560px;
}

.filemanager-rename-inline .form-control {
    flex: 1 1 auto;
    min-width: 180px;
    height: 34px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
}

.filemanager-rename-inline .btn {
    flex: 0 0 auto;
    height: 34px;
    border-radius: 8px;
}

.filemanager-browser {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 14px;
}

.filemanager-layout.is-editing .filemanager-browser {
    display: none;
}

.filemanager-layout.is-editing [data-filemanager-heading] {
    display: none !important;
}

.filemanager-layout:not(.is-editing) [data-filemanager-save],
.filemanager-layout:not(.is-editing) [data-filemanager-cancel],
.filemanager-layout.is-editing [data-filemanager-edit],
.filemanager-layout.is-editing [data-filemanager-rename],
.filemanager-layout.is-editing [data-filemanager-rename-inline],
.filemanager-layout.is-editing [data-filemanager-copy],
.filemanager-layout.is-editing [data-filemanager-delete] {
    display: none;
}

.filemanager-sidebar,
.filemanager-main {
    min-width: 0;
    border: 1px solid rgba(90, 101, 165, .16);
    border-radius: 12px;
    background: #f7f9fd;
}

.filemanager-sidebar {
    display: grid;
    align-content: start;
    gap: 6px;
    min-height: 650px;
    max-height: 720px;
    overflow: auto;
    padding: 10px;
}

.filemanager-folder {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #33405f;
    text-align: left;
    font-weight: 900;
}

.filemanager-folder:hover,
.filemanager-folder.active {
    border-color: rgba(92, 112, 231, .24);
    background: #ffffff;
    color: #2432a7;
    box-shadow: 0 8px 18px rgba(80, 92, 162, .1);
}

.filemanager-folder svg {
    width: 18px;
    height: 18px;
    color: #f0a020;
}

.filemanager-folder span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filemanager-folder small {
    min-width: 26px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #eef1ff;
    color: #5c70e7;
    font-size: 11px;
    font-weight: 900;
    text-align: center;
}

.filemanager-main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 650px;
    overflow: hidden;
}

.filemanager-pathbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(90, 101, 165, .14);
    background: #ffffff;
}

.filemanager-path-actions {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
}

.filemanager-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 1 320px;
    min-width: 210px;
}

.filemanager-search > svg {
    position: absolute;
    left: 10px;
    width: 16px;
    height: 16px;
    color: #6b7390;
    pointer-events: none;
}

.filemanager-search .form-control {
    min-height: 36px;
    padding-left: 32px;
    padding-right: 40px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
}

.filemanager-search .btn {
    position: absolute;
    right: 4px;
    display: grid;
    width: 28px;
    height: 28px;
    min-width: 0;
    padding: 0;
    place-items: center;
    border-radius: 7px;
}

.filemanager-search .btn svg {
    width: 14px;
    height: 14px;
}

.filemanager-pathbar strong,
.filemanager-pathbar small {
    overflow-wrap: anywhere;
}

.filemanager-pathbar strong {
    color: #263149;
    font-size: 16px;
    font-weight: 950;
}

.filemanager-pathbar small {
    min-width: 0;
    color: #6b7390;
    font-weight: 800;
    text-align: right;
}

.filemanager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    align-content: start;
    gap: 12px;
    max-height: 660px;
    overflow: auto;
    padding: 14px;
}

.filemanager-empty-root {
    grid-column: 1 / -1;
    display: grid;
    min-height: 160px;
    place-items: center;
    color: #7b849d;
    font-size: 13px;
    font-weight: 800;
}

.filemanager-item {
    display: grid;
    justify-items: center;
    gap: 7px;
    width: 100%;
    min-height: 140px;
    padding: 14px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #263149;
    text-align: center;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.filemanager-item:hover,
.filemanager-item.active {
    border-color: rgba(92, 112, 231, .3);
    background: #ffffff;
    box-shadow: 0 10px 18px rgba(80, 92, 162, .12);
    transform: translateY(-1px);
}

.filemanager-file-icon {
    display: grid;
    width: 54px;
    height: 64px;
    place-items: center;
    border: 1px solid rgba(92, 112, 231, .18);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #edf2ff 100%);
    color: #5c70e7;
    box-shadow: inset 0 -8px 18px rgba(92, 112, 231, .08);
}

.filemanager-file-icon svg {
    width: 30px;
    height: 30px;
}

.filemanager-item-name {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: anywhere;
    color: #263149;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.filemanager-item-path {
    display: none;
}

.filemanager-item-meta {
    overflow-wrap: anywhere;
    color: #6b7390;
    font-size: 11px;
    font-weight: 800;
}

.filemanager-editor-shell {
    min-width: 0;
    display: grid;
    gap: 10px;
}

.filemanager-current {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid rgba(90, 101, 165, .16);
    border-radius: 12px;
    background: #f7f9fd;
}

.filemanager-name-input {
    display: none;
    min-height: 38px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 900;
}

.filemanager-layout.is-editing .filemanager-name-input {
    display: block;
}

.filemanager-layout.is-editing [data-filemanager-current-name] {
    display: none;
}

.filemanager-current span {
    overflow-wrap: anywhere;
    color: #263149;
    font-size: 14px;
    font-weight: 900;
}

.filemanager-current small {
    overflow-wrap: anywhere;
    color: #6b7390;
    font-weight: 800;
}

.filemanager-editor[readonly] {
    background: #17212b;
    color: #aebbd0;
}

.filemanager-monaco {
    display: none;
    min-height: 620px;
    height: 72vh;
    border: 1px solid rgba(101, 119, 160, .3);
    border-radius: 8px;
    background: #0d1117;
    overflow: hidden;
}

.filemanager-monaco.is-ready {
    display: block;
}

.filemanager-monaco.is-readonly {
    opacity: .9;
}

.filemanager-editor.has-monaco {
    display: none;
}

.filemanager-preview-stage {
    min-height: 720px;
}

.filemanager-preview-stage .preview-frame {
    height: 720px;
}

.preview-shell {
    display: grid;
    gap: 12px;
}

.preview-tabs {
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(84, 94, 152, .14);
}

.preview-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #6a7090;
    font-weight: 800;
}

.preview-tabs .nav-link:hover,
.preview-tabs .nav-link.active {
    color: #3d63e0;
    border-color: rgba(90, 107, 210, .24);
    background: linear-gradient(130deg, rgba(105, 131, 243, .18), rgba(84, 212, 245, .10));
    box-shadow: 0 10px 24px rgba(96, 116, 224, .24);
}

.preview-count {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding-inline: 7px;
    border-radius: 999px;
    background: #edf0ff;
    color: #5f6fdf;
    font-size: 12px;
}

.preview-card {
    background: #fcfdff;
}

.preview-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.preview-meta {
    min-width: 180px;
}

.preview-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 auto;
    gap: 10px;
}

.preview-picker {
    width: min(380px, 100%);
}

.preview-picker .ts-wrapper {
    width: 100%;
}

.preview-picker .ts-control {
    min-height: 42px;
    border: 1px solid rgba(90, 101, 165, .22);
    border-radius: 12px;
    background: #fbfcff;
    color: var(--ink-1);
    box-shadow: none;
}

.preview-picker .ts-control input {
    min-width: 120px;
}

.preview-picker .ts-wrapper.focus .ts-control {
    border-color: #7384e9;
    box-shadow: 0 0 0 .25rem rgba(97, 114, 229, .18);
}

.preview-picker .ts-dropdown {
    overflow: hidden;
    border: 1px solid rgba(90, 101, 165, .22);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(41, 44, 109, .16);
}

.preview-picker .ts-dropdown .dropdown-input-wrap {
    padding: 8px;
    border-bottom: 1px solid rgba(90, 101, 165, .14);
    background: #f7f9fd;
}

.preview-picker .ts-dropdown .dropdown-input {
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(90, 101, 165, .22);
    border-radius: 10px;
    background: #ffffff;
    color: var(--ink-1);
    outline: 0;
}

.preview-picker .ts-dropdown .dropdown-input:focus {
    border-color: #7384e9;
    box-shadow: 0 0 0 .2rem rgba(97, 114, 229, .16);
}

.preview-picker .ts-dropdown .option {
    padding: 9px 12px;
    color: #2f3957;
}

.preview-picker .ts-dropdown .active {
    background: #edf0ff;
    color: #3d63e0;
}

.preview-picker .no-results {
    padding: 9px 12px;
    color: #7f89aa;
}

.preview-buttons .btn {
    min-width: 92px;
}

.preview-buttons .btn,
.preview-amp-actions .btn,
.preview-controls > .btn-primary {
    min-height: 42px;
    padding-inline: 14px;
    border-radius: 10px;
    white-space: nowrap;
}

.preview-buttons .btn-outline-secondary {
    border: 1px solid rgba(92, 112, 231, .20);
    background: #eef1f8;
    color: #6f7594;
}

.preview-buttons .btn-outline-secondary:hover {
    border-color: rgba(92, 112, 231, .38);
    background: #e5eaff;
    color: #5168c6;
}

.preview-amp-actions .btn,
.preview-lp-actions .btn {
    min-width: 118px;
}

.preview-amp-actions .btn-success {
    border: 0;
    background: linear-gradient(130deg, #56b66b, #45a967);
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(74, 159, 91, .20);
}

.preview-amp-actions .btn-success:hover {
    filter: brightness(1.04);
    box-shadow: 0 14px 24px rgba(74, 159, 91, .28);
}

.preview-amp-actions .btn-warning {
    border: 0;
    background: linear-gradient(130deg, #f0c866, #e7a94e);
    color: #5d4215;
    box-shadow: 0 10px 18px rgba(189, 137, 49, .18);
}

.preview-amp-actions .btn-warning:hover {
    filter: brightness(1.03);
    color: #4d350e;
    box-shadow: 0 14px 24px rgba(189, 137, 49, .26);
}

.preview-lp-actions .btn-create-lp {
    border: 0;
    background: linear-gradient(130deg, #7a66d4, #9b6add);
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(122, 102, 212, .22);
}

.preview-lp-actions .btn-create-lp:hover {
    filter: brightness(1.05);
    color: #ffffff;
    box-shadow: 0 14px 24px rgba(122, 102, 212, .30);
}

.preview-lp-actions .btn-edit-lp {
    border: 0;
    background: linear-gradient(130deg, #ff8b64, #e86a2c);
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(232, 106, 44, .18);
}

.preview-lp-actions .btn-edit-lp:hover {
    filter: brightness(1.04);
    color: #ffffff;
    box-shadow: 0 14px 24px rgba(232, 106, 44, .26);
}

.preview-controls > .btn-primary {
    background: linear-gradient(130deg, #6a7df0, #7d5bd8);
    box-shadow: 0 12px 24px rgba(93, 103, 196, .28);
}

.preview-controls > .btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 16px 28px rgba(93, 103, 196, .34);
}

.preview-buttons .btn:active,
.preview-amp-actions .btn:active,
.preview-lp-actions .btn:active,
.preview-controls > .btn-primary:active {
    transform: translateY(1px);
}

.preview-buttons .btn:disabled,
.preview-amp-actions .btn:disabled,
.preview-lp-actions .btn:disabled,
.preview-controls > .btn-primary.disabled {
    opacity: .58;
    box-shadow: none;
    transform: none;
}

.preview-stage {
    min-height: 680px;
    padding: 12px;
    border: 1px solid rgba(90, 101, 165, .16);
    border-radius: 12px;
    background: #eef1f8;
}

.preview-stage.is-amp {
    display: flex;
    justify-content: center;
}

.preview-frame {
    width: 100%;
    height: 680px;
    border: 0;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(80, 92, 162, .16);
}

.preview-stage.is-amp .preview-frame {
    max-width: 430px;
    border-radius: 24px;
}

.generate-preview-stage {
    min-height: 560px;
}

.generate-preview-stage .preview-frame {
    height: 560px;
}

@media (max-width: 980px) {
    .site-nav {
        flex-direction: column;
        align-items: stretch !important;
    }

    .brand {
        min-width: 0;
    }

    .brand strong {
        font-size: 26px;
    }

    .side-nav {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 2px;
    }

    .side-nav .nav-link {
        flex: 0 0 auto;
    }

    .side-profile {
        min-width: 0;
    }

    .search-box {
        width: min(320px, 44vw);
    }

    .generate-layout {
        grid-template-columns: 1fr;
    }

    .filemanager-layout,
    .filemanager-browser {
        grid-template-columns: 1fr;
    }

    .filemanager-sidebar {
        max-height: 300px;
        min-height: auto;
    }

    .filemanager-main {
        min-height: 520px;
    }

    .filemanager-pathbar,
    .filemanager-path-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .filemanager-pathbar small {
        text-align: left;
    }

    .filemanager-search {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }

    .filemanager-grid {
        grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
        max-height: 520px;
    }

    .filemanager-rename-inline {
        flex: 1 1 100%;
        flex-wrap: wrap;
        max-width: none;
    }

    .filemanager-rename-inline .form-control {
        flex: 1 1 100%;
    }

    .filemanager-rename-inline .btn {
        flex: 1 1 calc(50% - 4px);
        width: auto !important;
    }

    .settings-switch-row {
        grid-template-columns: 1fr;
    }

    .preview-toolbar,
    .preview-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .preview-picker,
    .preview-select {
        width: 100%;
    }

    .preview-buttons {
        width: 100%;
    }

    .preview-amp-actions {
        width: 100%;
    }

    .preview-lp-actions {
        width: 100%;
    }

    .preview-buttons .btn {
        flex: 1 1 0;
        min-width: 0;
    }

    .placeholder-code-editor {
        min-height: 520px;
        height: 58vh;
    }

    .filemanager-monaco {
        min-height: 520px;
        height: 58vh;
    }

    .preview-amp-actions .btn,
    .preview-lp-actions .btn {
        flex: 1 1 0;
        min-width: 0;
    }
}

@media (max-width: 575.98px) {
    .app-shell {
        padding: 10px;
    }

    .site-nav,
    .workspace-card {
        border-radius: 12px;
    }

    .topbar {
        flex-wrap: wrap;
    }

    .topbar-actions {
        display: none !important;
    }

    .metric-icon {
        display: none;
    }

    .btn:not(.icon-square):not(.icon-square-sm) {
        width: 100%;
    }

    .title-meta-group {
        gap: 6px;
    }

    .title-meta-group .form-control,
    .title-meta-group .generate-meta-btn {
        flex: 1 1 100%;
        width: 100%;
        border-radius: 12px !important;
    }

    .bar-chart {
        gap: 8px;
        min-height: 220px;
    }

    .amp-url-group {
        gap: 6px;
        flex-wrap: wrap;
    }

    .amp-url-group .input-group-text {
        display: none;
    }

    .amp-url-group .amp-url-name,
    .amp-url-group .amp-url-suffix,
    .amp-url-group .amp-url-type {
        max-width: none;
        border-radius: 12px !important;
    }

    .amp-url-group .amp-url-name {
        flex: 1 1 100%;
    }

    .amp-url-group .amp-url-suffix,
    .amp-url-group .amp-url-type {
        flex: 1 1 calc(50% - 3px);
    }

    .meta-option-card {
        grid-template-columns: 1fr;
    }

    .meta-option-action {
        width: 100%;
    }

    .bar-track {
        height: 180px;
    }

    .preview-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .preview-tabs::-webkit-scrollbar {
        display: none;
    }

    .preview-tabs .nav-link {
        flex: 0 0 auto;
    }

    .preview-stage {
        min-height: 560px;
        padding: 8px;
    }

    .preview-frame {
        height: 560px;
    }

    .placeholder-preview-card .generate-preview-stage {
        min-height: 560px;
    }

    .placeholder-preview-card .generate-preview-stage .preview-frame {
        height: 560px;
    }

    .filemanager-preview-stage {
        min-height: 560px;
    }

    .filemanager-preview-stage .preview-frame {
        height: 560px;
    }
}
