:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f8f9fb;
    --text: #16161a;
    --muted: #6f7179;
    --line: #e5e7ec;
    --brand: #6f2cff;
    --brand-2: #9d61ff;
    --danger: #d9384e;
    --success: #17a673;
    --shadow: 0 18px 45px rgba(24, 20, 37, .08);
    --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
}
.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, #1f172d, var(--brand));
    box-shadow: 0 10px 24px rgba(111, 44, 255, .22);
    flex: 0 0 auto;
}
.brand-mark.large { width: 64px; height: 64px; border-radius: 20px; font-size: 25px; }
.brand > span:last-child { display: grid; line-height: 1; gap: 4px; }
.brand strong { letter-spacing: .13em; font-size: 14px; }
.brand small { color: var(--muted); font-size: 9px; letter-spacing: .16em; font-weight: 700; }
.brand-large .brand-mark { width: 49px; height: 49px; border-radius: 15px; }

.btn {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 12px 28px rgba(111, 44, 255, .22); }
.btn-secondary { color: var(--text); background: var(--surface); border-color: var(--line); }
.btn-secondary:hover { border-color: #c9cbd2; box-shadow: 0 8px 20px rgba(20, 20, 25, .06); }
.btn-danger { color: #fff; background: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 12px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-weight: 800; }
.text-button { border: 0; padding: 6px 0; color: var(--brand); background: transparent; font-weight: 700; }

.app-header {
    height: 76px;
    padding: 0 clamp(20px, 4vw, 58px);
    display: flex;
    align-items: center;
    gap: 34px;
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid rgba(229, 231, 236, .88);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(18px);
}
.main-nav { display: flex; gap: 8px; margin-left: 18px; }
.main-nav a { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: 13px; border-radius: 10px; }
.main-nav a.active { color: var(--brand); background: #f1ebff; }
.header-user { margin-left: auto; display: flex; align-items: center; gap: 13px; }
.header-user > span { display: grid; text-align: right; line-height: 1.25; }
.header-user b { font-size: 12px; }
.header-user small { color: var(--muted); font-size: 10px; }

.app-main { width: min(1260px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 70px; }
.app-main.narrow { width: min(920px, calc(100% - 40px)); }
.dashboard-heading, .page-heading, .profile-editor-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}
.dashboard-heading h1, .page-heading h1, .profile-editor-toolbar h1 { margin: 4px 0 5px; font-size: clamp(27px, 4vw, 42px); line-height: 1.08; letter-spacing: -.045em; }
.dashboard-heading p, .page-heading p, .profile-editor-toolbar p { margin: 0; color: var(--muted); font-size: 14px; }
.eyebrow { color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.back-link { display: inline-block; color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.flash-stack { display: grid; gap: 10px; margin: 0 0 22px; }
.flash { padding: 14px 16px; border-radius: 13px; font-size: 13px; font-weight: 600; border: 1px solid transparent; }
.flash-success { color: #08724d; background: #e9fbf4; border-color: #c8f0df; }
.flash-error { color: #a7293c; background: #fff0f2; border-color: #ffd1d8; }

.search-row { margin-bottom: 22px; }
.search-row input { width: min(420px, 100%); }
input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    color: var(--text);
    background: var(--surface);
    border-radius: 12px;
    outline: none;
    transition: border .18s ease, box-shadow .18s ease;
}
input, select { height: 48px; padding: 0 14px; }
textarea { min-height: 110px; resize: vertical; padding: 13px 14px; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: rgba(111, 44, 255, .62); box-shadow: 0 0 0 4px rgba(111, 44, 255, .10); }
label { display: grid; gap: 8px; color: #3d3e45; font-size: 12px; font-weight: 700; }
label small { color: var(--muted); font-size: 10px; font-weight: 500; }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.input-prefix:focus-within { border-color: rgba(111, 44, 255, .62); box-shadow: 0 0 0 4px rgba(111, 44, 255, .10); }
.input-prefix span { padding-left: 14px; color: var(--muted); font-weight: 700; }
.input-prefix input { border: 0; box-shadow: none !important; padding-left: 4px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-panel { padding: clamp(22px, 4vw, 36px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-grid.compact { gap: 14px; }
.field-wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); margin-top: 28px; padding-top: 22px; }
.upload-field { padding: 17px; background: var(--surface-2); border: 1px dashed #cfd1d8; border-radius: 14px; }
.upload-field input { height: auto; padding: 0; border: 0; border-radius: 0; background: transparent; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.switch-row input { width: 20px; height: 20px; accent-color: var(--brand); }
.switch-row span { display: grid; gap: 2px; }
.current-avatar-row { display: flex; align-items: center; gap: 14px; padding-bottom: 25px; margin-bottom: 25px; border-bottom: 1px solid var(--line); }
.current-avatar-row > div:last-child { display: grid; gap: 3px; }
.current-avatar-row span { color: var(--muted); font-size: 12px; }
.edit-avatar { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; border: 1px solid var(--line); }
.avatar-fallback { display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #1e1729, var(--brand)); font-weight: 800; }

.profile-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.profile-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 10px 30px rgba(22, 22, 26, .05); transition: transform .18s ease, box-shadow .18s ease; }
.profile-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.profile-card-head { display: flex; align-items: center; gap: 12px; padding: 18px; }
.card-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.profile-card-head > div:nth-child(2) { min-width: 0; }
.profile-card h2 { margin: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-card p { margin: 2px 0 0; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-pill { margin-left: auto; padding: 5px 9px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.status-pill.active { color: #08724d; background: #e8faf2; }
.status-pill.inactive { color: #9b3342; background: #fff0f2; }
.mini-feed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: #fff; }
.mini-feed > * { width: 100%; aspect-ratio: 1; object-fit: cover; }
.mini-feed video { display: block; background: #111; }
.mini-feed > div { display: grid; place-items: center; background: linear-gradient(135deg, #f0edf5, #ddd6ea); color: rgba(111, 44, 255, .35); font-weight: 800; }
.profile-card-foot { padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; }
.profile-card-foot span { color: var(--muted); font-size: 11px; }
.profile-card-foot b { color: var(--text); }
.empty-dashboard, .empty-feed { text-align: center; padding: 68px 20px; background: var(--surface); border: 1px dashed #d5d7dd; border-radius: var(--radius); }
.empty-dashboard .brand-mark { margin: 0 auto 16px; }
.empty-dashboard h2, .empty-feed h2 { margin: 0 0 8px; }
.empty-dashboard p, .empty-feed p { max-width: 500px; margin: 0 auto 22px; color: var(--muted); font-size: 13px; }

.share-panel { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 0 0 22px; padding: 16px 18px; border-radius: 15px; border: 1px solid #ded2ff; background: #f5f0ff; }
.share-panel > div { display: flex; align-items: center; gap: 12px; min-width: 0; }
.share-panel > div > div { min-width: 0; }
.share-panel b { font-size: 12px; }
.share-panel p { margin: 2px 0 0; color: #7053a2; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 720px; }
.share-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(23, 166, 115, .12); }

.instagram-editor-shell, .instagram-page { width: min(935px, 100%); margin: 0 auto; }
.instagram-editor-shell { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.ig-profile-header { min-height: 250px; display: grid; grid-template-columns: 290px 1fr; align-items: center; border-bottom: 1px solid transparent; padding: 34px 36px; }
.ig-avatar-wrap { display: flex; justify-content: center; }
.ig-avatar { width: 150px; height: 150px; object-fit: cover; border-radius: 50%; border: 1px solid var(--line); }
.ig-profile-info { min-width: 0; }
.ig-title-row { display: flex; align-items: center; gap: 18px; }
.ig-title-row h1 { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.ig-stats { display: flex; flex-wrap: wrap; gap: 34px; margin: 24px 0 18px; font-size: 13px; }
.ig-stats b { font-weight: 700; }
.ig-bio { display: grid; justify-items: start; line-height: 1.48; font-size: 12px; }
.ig-bio strong { font-size: 13px; }
.ig-category { color: var(--muted); }
.ig-bio p { margin: 4px 0 2px; }
.ig-bio a { color: #153d68; font-weight: 700; }
.ig-highlights-wrap { padding: 3px 26px 22px; overflow: hidden; }
.ig-highlights { display: flex; align-items: flex-start; gap: 20px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.highlight-item-wrap { position: relative; flex: 0 0 78px; display: grid; justify-items: center; gap: 3px; }
.highlight-item { width: 78px; padding: 0; border: 0; background: transparent; display: grid; justify-items: center; gap: 7px; color: var(--text); font-size: 9px; font-weight: 600; line-height: 1.2; text-align: center; }
.highlight-item > span:last-child { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.highlight-circle { width: 68px; height: 68px; padding: 3px; display: grid; place-items: center; border-radius: 50%; border: 1px solid #d4d5da; background: #fff; overflow: hidden; }
.highlight-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.highlight-circle b { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; color: var(--brand); background: #f3edff; font-size: 22px; }
.highlight-add { flex: 0 0 78px; }
.highlight-add .highlight-circle { border-style: dashed; }
.highlight-edit-link { color: var(--brand); font-size: 8px; font-weight: 700; }
.ig-tabs { height: 53px; display: flex; justify-content: center; border-top: 1px solid var(--line); }
.ig-tabs span { height: 53px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.ig-tabs .active { color: var(--text); border-top: 1px solid var(--text); margin-top: -1px; }
.grid-icon { font-size: 15px !important; letter-spacing: normal !important; }
.ig-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; background: #fff; }
.ig-grid-item { position: relative; min-width: 0; background: #eee; }
.ig-grid-item.is-dragging { opacity: .45; transform: scale(.98); }
.ig-grid-item.drag-over { outline: 4px solid var(--brand); outline-offset: -4px; }
.ig-post-button { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #ececf0; aspect-ratio: 1; overflow: hidden; }
.ig-post-button > img, .ig-post-button > video { width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease; }
.ig-post-button:hover > img, .ig-post-button:hover > video { transform: scale(1.025); }
.ig-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 9px; color: #fff; background: rgba(0, 0, 0, .42); opacity: 0; transition: opacity .18s ease; font-size: 11px; }
.ig-overlay b { font-size: 20px; }
.ig-post-button:hover .ig-overlay { opacity: 1; }
.post-placeholder { width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: 7px; color: rgba(255, 255, 255, .88); background: linear-gradient(135deg, #2b2336, #7650a6); }
.post-placeholder span { font-size: clamp(28px, 5vw, 56px); font-weight: 800; }
.post-placeholder small { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.post-placeholder.large { min-height: 520px; }
.post-type-icon { position: absolute; right: 11px; top: 9px; color: #fff; font-size: 20px; text-shadow: 0 2px 8px rgba(0,0,0,.45); }
.drag-handle { position: absolute; z-index: 5; left: 8px; top: 8px; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: rgba(0, 0, 0, .62); cursor: grab; font-size: 16px; letter-spacing: -5px; padding-right: 5px; }
.order-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
.order-bar span { color: var(--muted); font-size: 11px; }

.public-feed-body { background: #fff; }
.public-topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(18px, calc((100vw - 980px) / 2)); border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 20; }
.read-only-badge { color: #506070; background: #f2f4f6; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.instagram-page { padding: 22px 0 50px; }
.public-feed-body .ig-profile-header { padding-left: 12px; padding-right: 12px; }
.client-footer { padding: 35px 15px 5px; text-align: center; color: #92949b; font-size: 10px; }
.public-error { min-height: 100vh; display: grid; place-items: center; align-content: center; text-align: center; padding: 25px; }
.public-error h1 { margin: 18px 0 7px; }
.public-error p { margin: 0; color: var(--muted); }

.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.is-open { display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .78); backdrop-filter: blur(2px); }
.post-modal-panel { position: relative; z-index: 1; width: min(1120px, calc(100% - 32px)); max-height: calc(100vh - 32px); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); background: #fff; overflow: hidden; box-shadow: 0 28px 90px rgba(0, 0, 0, .35); }
.post-modal-media { min-height: 590px; background: #0e0e0f; display: grid; place-items: center; overflow: hidden; }
.post-modal-media > img, .post-modal-media > video { width: 100%; height: 100%; max-height: calc(100vh - 32px); object-fit: contain; }
.modal-video { background: #000; }
.post-modal-content { min-width: 0; display: flex; flex-direction: column; padding: 0 22px 22px; overflow-y: auto; }
.modal-x { position: absolute; z-index: 2; right: 10px; top: 8px; width: 38px; height: 38px; border: 0; border-radius: 50%; color: #fff; background: rgba(0,0,0,.55); font-size: 26px; line-height: 1; }
.modal-profile-line { min-height: 70px; display: flex; align-items: center; gap: 10px; padding-right: 35px; border-bottom: 1px solid var(--line); }
.modal-avatar { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; }
.modal-profile-line > div:last-child { display: grid; }
.modal-profile-line strong { font-size: 11px; }
.modal-profile-line small { color: var(--muted); font-size: 9px; }
.modal-caption { padding: 20px 0; font-size: 12px; line-height: 1.65; white-space: normal; }
.modal-caption strong { margin-right: 4px; }
.post-plan-meta { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.post-plan-meta span { display: grid; color: var(--muted); font-size: 11px; }
.post-plan-meta b { color: var(--text); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.internal-note { margin-top: 17px; padding: 14px; background: #fff8df; border: 1px solid #f2df9e; border-radius: 12px; }
.internal-note b { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.internal-note p { margin: 5px 0 0; font-size: 11px; line-height: 1.5; }
.modal-admin-actions { margin-top: auto; padding-top: 22px; }
body.modal-open { overflow: hidden; }

.post-editor-layout { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.4fr); gap: 30px; }
.post-image-column { display: flex; flex-direction: column; gap: 12px; }
.current-post-image, .upload-preview { width: 100%; aspect-ratio: 1; border-radius: 16px; overflow: hidden; }
.current-post-image img, .current-post-image video { width: 100%; height: 100%; object-fit: contain; background: #0e0e0f; }
.upload-preview { display: grid; place-items: center; align-content: center; gap: 5px; text-align: center; border: 2px dashed #d6d7dd; background: var(--surface-2); color: var(--muted); padding: 20px; }
.upload-preview span { font-size: 31px; color: var(--brand); }
.upload-preview b { color: var(--text); font-size: 12px; }
.upload-preview small { font-size: 9px; }
.upload-preview.has-image { background-size: cover; background-position: center; border-style: solid; }
.upload-preview.has-image > * { display: none; }
.upload-preview.has-media { padding: 0; border-style: solid; }
.upload-preview.has-media img, .upload-preview.has-media video { width: 100%; height: 100%; object-fit: contain; background: #0e0e0f; }
.compact-upload { padding: 13px; }
.upload-button { min-height: 44px; display: flex; align-items: center; justify-content: center; color: var(--brand); background: #f3edff; border: 1px solid #ddd0ff; border-radius: 12px; font-size: 11px; }
.upload-button input { display: none; }
.post-fields { display: grid; gap: 18px; }
.danger-panel { margin-top: 20px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #fff; border: 1px solid #ffd1d8; border-radius: 16px; }
.danger-panel > div { display: grid; }
.danger-panel b { font-size: 12px; }
.danger-panel span { color: var(--muted); font-size: 10px; }

.story-modal-panel { position: relative; z-index: 1; width: min(430px, calc(100% - 28px)); max-height: calc(100vh - 24px); overflow: hidden; border-radius: 18px; background: #111; box-shadow: 0 28px 90px rgba(0,0,0,.48); }
.story-header { height: 62px; display: flex; align-items: center; gap: 10px; padding: 0 48px 0 14px; color: #fff; background: rgba(0,0,0,.72); }
.story-header > div:last-child { display: grid; }
.story-header strong { font-size: 11px; }
.story-header small { color: rgba(255,255,255,.7); font-size: 9px; }
.story-media { width: 100%; aspect-ratio: 9 / 16; max-height: calc(100vh - 90px); display: grid; place-items: center; background: #000; }
.story-media img, .story-media video { width: 100%; height: 100%; object-fit: contain; }
.story-media .post-placeholder.large { min-height: 0; height: 100%; }
.story-admin-actions { padding: 12px; background: #fff; text-align: center; }
.highlight-editor-layout { display: grid; grid-template-columns: minmax(190px, .55fr) minmax(0, 1.35fr); gap: 30px; }
.highlight-preview-column { display: grid; justify-items: center; align-content: start; gap: 12px; text-align: center; color: var(--muted); font-size: 10px; }
.highlight-cover-preview { width: 150px; height: 150px; padding: 4px; border: 1px solid var(--line); border-radius: 50%; overflow: hidden; background: #fff; }
.highlight-cover-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.highlight-cover-preview.avatar-fallback { color: #fff; padding: 0; font-size: 38px; }
.current-highlight-media { display: grid; gap: 10px; }
.current-highlight-media > b { font-size: 11px; }
.highlight-story-preview { width: min(280px, 100%); aspect-ratio: 9 / 16; overflow: hidden; border-radius: 13px; background: #111; }
.highlight-story-preview img, .highlight-story-preview video { width: 100%; height: 100%; object-fit: contain; background: #111; }
.story-upload-preview { padding: 20px; }
.team-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr); gap: 22px; align-items: start; }
.team-layout .panel { padding: 24px; }
.team-layout h2 { margin: 0 0 16px; font-size: 18px; }
.team-list { display: grid; }
.team-row { display: flex; align-items: center; gap: 13px; padding: 15px 0; border-top: 1px solid var(--line); }
.team-row:first-child { border-top: 0; }
.team-avatar { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: linear-gradient(135deg, #1f172d, var(--brand)); border-radius: 13px; font-weight: 800; }
.team-info { min-width: 0; display: grid; }
.team-info b { font-size: 12px; }
.team-info span { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
.create-user-panel p { margin: -8px 0 20px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.create-user-panel form { display: grid; gap: 15px; }

.login-body { overflow-x: hidden; background: #f4f1f8; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .88fr) minmax(0, 1.12fr); }
.login-panel { padding: clamp(34px, 6vw, 84px); display: flex; flex-direction: column; background: #fff; }
.login-copy { max-width: 520px; margin: auto 0 34px; }
.login-copy h1 { margin: 8px 0 15px; font-size: clamp(38px, 5vw, 68px); line-height: .98; letter-spacing: -.06em; }
.login-copy p { max-width: 480px; margin: 0; color: var(--muted); line-height: 1.7; font-size: 13px; }
.login-form { max-width: 440px; display: grid; gap: 16px; }
.login-visual { position: relative; overflow: hidden; display: grid; place-items: center; padding: 40px; background: radial-gradient(circle at 30% 20%, #b68cff 0, transparent 36%), linear-gradient(145deg, #151020, #532b83 58%, #8f5fd4); }
.login-visual::before { content: ""; position: absolute; width: 560px; height: 560px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15); }
.phone-mock { position: relative; z-index: 1; width: min(390px, 86%); padding: 18px 13px 25px; border: 8px solid #18151d; border-radius: 42px; background: #fff; box-shadow: 0 40px 90px rgba(0,0,0,.38); transform: rotate(3deg); }
.phone-bar { width: 110px; height: 18px; border-radius: 999px; background: #17151a; margin: -8px auto 18px; }
.phone-profile { display: flex; align-items: center; gap: 12px; padding: 12px; }
.mock-avatar { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #1f172d, var(--brand)); font-weight: 800; }
.phone-profile > div:last-child { display: grid; }
.phone-profile b { font-size: 12px; }
.phone-profile span { color: var(--muted); font-size: 9px; }
.mock-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.mock-grid div { aspect-ratio: 1; display: grid; place-items: center; background: linear-gradient(135deg, #2a2036, #8058aa); color: rgba(255,255,255,.7); font-weight: 800; }

@media (max-width: 1040px) {
    .profile-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-layout { grid-template-columns: 1fr 1fr; }
    .login-panel { padding: 45px; }
    .ig-profile-header { grid-template-columns: 230px 1fr; }
    .post-modal-panel { grid-template-columns: 1fr 360px; }
}

@media (max-width: 780px) {
    .app-header { height: auto; min-height: 68px; padding: 12px 18px; gap: 12px; flex-wrap: wrap; }
    .app-header .brand small { display: none; }
    .main-nav { order: 3; width: 100%; margin: 0; border-top: 1px solid var(--line); padding-top: 8px; }
    .main-nav a { flex: 1; text-align: center; }
    .header-user > span { display: none; }
    .app-main, .app-main.narrow { width: min(100% - 24px, 1000px); padding-top: 26px; }
    .dashboard-heading, .page-heading, .profile-editor-toolbar { align-items: flex-start; flex-direction: column; }
    .dashboard-heading .btn, .page-heading > .btn { width: 100%; }
    .toolbar-actions { width: 100%; justify-content: stretch; }
    .toolbar-actions .btn { flex: 1 1 180px; }
    .profile-card-grid { grid-template-columns: 1fr; }
    .form-grid, .form-grid.compact { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .share-panel { align-items: flex-start; flex-direction: column; }
    .share-panel form { width: 100%; text-align: right; }
    .instagram-editor-shell { border-radius: 12px; }
    .ig-profile-header { min-height: 0; grid-template-columns: 100px 1fr; align-items: start; padding: 24px 18px; }
    .ig-avatar { width: 82px; height: 82px; }
    .ig-title-row { align-items: flex-start; flex-direction: column; gap: 8px; }
    .ig-title-row h1 { font-size: 16px; }
    .ig-stats { gap: 12px; justify-content: space-between; margin: 15px 0 13px; font-size: 10px; }
    .ig-bio { font-size: 10px; }
    .ig-bio strong { font-size: 11px; }
    .post-editor-layout, .highlight-editor-layout { grid-template-columns: 1fr; }
    .post-image-column { width: min(100%, 420px); margin: 0 auto; }
    .team-layout { grid-template-columns: 1fr; }
    .team-row { flex-wrap: wrap; }
    .team-info { flex: 1; }
    .login-layout { grid-template-columns: 1fr; }
    .login-panel { min-height: 100vh; padding: 30px 24px; }
    .login-copy { margin-top: auto; }
    .login-visual { display: none; }
    .post-modal-panel { width: min(100% - 14px, 620px); max-height: calc(100vh - 14px); grid-template-columns: 1fr; overflow-y: auto; }
    .post-modal-media { min-height: 0; aspect-ratio: 1; }
    .post-modal-media > img, .post-modal-media > video { max-height: none; object-fit: contain; }
    .post-placeholder.large { min-height: 0; aspect-ratio: 1; }
    .post-modal-content { overflow: visible; }
    .modal-x { position: fixed; right: 13px; top: 10px; }
}

@media (max-width: 520px) {
    .app-main, .app-main.narrow { width: min(100% - 18px, 1000px); }
    .dashboard-heading h1, .page-heading h1, .profile-editor-toolbar h1 { font-size: 29px; }
    .form-panel { padding: 18px; border-radius: 16px; }
    .ig-profile-header { grid-template-columns: 78px 1fr; padding: 20px 12px; gap: 8px; }
    .ig-avatar { width: 68px; height: 68px; }
    .ig-stats { grid-column: 1 / -1; }
    .ig-stats span { display: grid; text-align: center; }
    .ig-title-row .btn { min-height: 31px; }
    .ig-grid { gap: 2px; }
    .drag-handle { width: 25px; height: 25px; left: 5px; top: 5px; font-size: 12px; }
    .post-type-icon { right: 6px; top: 5px; font-size: 15px; }
    .ig-overlay { display: none; }
    .order-bar { align-items: stretch; flex-direction: column; }
    .order-bar .btn { width: 100%; }
    .public-topbar { height: 58px; padding: 0 12px; }
    .public-topbar .brand-mark { width: 34px; height: 34px; }
    .public-topbar .brand strong { font-size: 11px; }
    .public-topbar .brand small { font-size: 7px; }
    .instagram-page { padding-top: 5px; }
    .public-feed-body .ig-profile-header { padding-left: 9px; padding-right: 9px; }
    .ig-highlights-wrap { padding-left: 10px; padding-right: 10px; }
    .ig-highlights { gap: 12px; }
    .highlight-item, .highlight-item-wrap, .highlight-add { width: 68px; flex-basis: 68px; }
    .highlight-circle { width: 60px; height: 60px; }
    .profile-card-foot { align-items: stretch; flex-direction: column; gap: 10px; }
    .profile-card-foot .btn { width: 100%; }
    .danger-panel { align-items: stretch; flex-direction: column; }
}
