:root {
    --ink: #202124;
    --muted: #667085;
    --line: #d9e2e7;
    --paper: #f7f8f5;
    --panel: #ffffff;
    --teal: #1f5665;
    --green: #4f7b45;
    --rose: #a84d63;
    --gold: #b58a2a;
    --shadow: 0 18px 45px rgba(24, 38, 45, 0.12);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--paper);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.is-hidden { display: none !important; }
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        linear-gradient(130deg, rgba(31,86,101,.18), transparent 38%),
        linear-gradient(320deg, rgba(181,138,42,.16), transparent 42%),
        var(--paper);
}
.auth-panel {
    width: min(460px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    box-shadow: var(--shadow);
}
.eyebrow {
    margin: 0 0 8px;
    color: var(--teal);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}
h1, h2, h3 { margin: 0; letter-spacing: 0; }
h1 { font-size: 34px; line-height: 1.05; }
h2 { font-size: 28px; }
h3 { font-size: 18px; }
.lede { color: var(--muted); line-height: 1.45; }
.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 22px 0;
}
.tab, .nav-item, .ghost {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 11px 12px;
    color: var(--ink);
}
.tab.is-active, .nav-item.is-active {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
}
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: #344054; font-size: 14px; }
input, textarea, select {
    width: 100%;
    border: 1px solid #cbd5dc;
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
    color: var(--ink);
}
input[readonly] {
    background: #f2f5f6;
    color: var(--muted);
}
select[multiple] {
    min-height: 136px;
}
select[multiple] option {
    padding: 7px 8px;
}
textarea { resize: vertical; }
.primary {
    border: 0;
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--teal);
    color: #fff;
    font-weight: 700;
}
.compact { padding: 10px 12px; }
.message { min-height: 20px; color: var(--rose); }
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px;
    border-right: 1px solid var(--line);
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--teal);
    color: #fff;
    font-weight: 800;
}
.brand span:last-child { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.nav { display: grid; gap: 8px; }
.nav-item { text-align: left; }
.ghost.danger {
    color: var(--rose);
    border-color: #eccbd2;
}
.account-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}
.account-actions .ghost {
    min-width: 160px;
}
.main { padding: 28px; max-width: 1180px; width: 100%; }
.view-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}
.view-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.feed-list, .loop-list { display: grid; gap: 14px; }
.feed-filter-panel {
    margin-bottom: 14px;
}
.filter-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 12px;
}
.filter-head span {
    color: var(--muted);
    font-size: 13px;
}
.filter-loop-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}
.filter-check {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #fbfcfc;
}
.filter-check input {
    width: auto;
    padding: 0;
    accent-color: var(--teal);
}
.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}
.feed-sentinel {
    min-height: 44px;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 14px;
}
.rello-card, .panel, .loop-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}
.rello-card { display: grid; gap: 13px; }
.rello-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.rello-meta { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.badge {
    align-self: start;
    border-radius: 999px;
    background: #ecf3f5;
    color: var(--teal);
    padding: 5px 9px;
    font-size: 12px;
    white-space: nowrap;
}
.embed iframe {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: #111;
}
.embed iframe:not(.provider-facebook) {
    aspect-ratio: 16 / 9;
}
.embed iframe.provider-facebook {
    background: #fff;
}
.native-media {
    display: block;
    width: 100%;
    max-height: 680px;
    border-radius: 8px;
    background: #111;
    object-fit: contain;
}
.native-image {
    background: #f3f6f7;
}
.embed .tiktok-embed,
.embed .twitter-tweet,
.embed .instagram-media,
.embed .snapchat-embed {
    max-width: 100%;
    min-width: 0;
    margin: 0 auto;
}
.embed .snapchat-embed {
    width: min(100%, 416px);
}
.embed .twitter-tweet {
    width: 100%;
}
.link-card {
    display: block;
    border-left: 4px solid var(--gold);
    padding: 12px;
    background: #fbfaf5;
    color: var(--ink);
    text-decoration: none;
}
.restricted {
    border-left-color: var(--rose);
    background: #fff6f7;
}
.rello-comment, .rello-excerpt { margin: 0; line-height: 1.45; }
.rello-excerpt { color: #475467; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    padding: 7px 10px;
    color: #344054;
}
.comment-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}
.comment-form button {
    border: 0;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    padding: 0 14px;
}
.comments { display: grid; gap: 7px; color: #344054; font-size: 14px; }
.compose-grid, .split {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
    gap: 16px;
    align-items: start;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preview-box {
    border: 1px dashed #b5c4cc;
    border-radius: 8px;
    padding: 14px;
    color: var(--muted);
    background: #f9fbfb;
}
.loop-card { display: grid; gap: 12px; }
.loop-selector-panel {
    margin-bottom: 14px;
}
.loop-members {
    display: grid;
    gap: 8px;
}
.loop-members h4 {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0;
}
.member-list {
    display: grid;
    gap: 8px;
}
.member-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #fbfcfc;
}
.member-row span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}
.member-loop-name {
    color: var(--green) !important;
}
.role-badge {
    margin-top: 0 !important;
    border-radius: 999px;
    background: #f0f4ed;
    color: var(--green) !important;
    padding: 5px 9px;
    font-size: 12px;
    white-space: nowrap;
}
.empty-note {
    margin: 0;
    color: var(--muted);
}
.add-member-form {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) minmax(96px, .7fr) minmax(120px, 1fr) auto;
    gap: 10px;
    align-items: end;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}
.form-status {
    grid-column: 1 / -1;
    min-height: 18px;
    font-size: 13px;
}

@media (max-width: 780px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        z-index: 2;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        height: auto;
        padding: 10px;
        border-right: 0;
        border-top: 1px solid var(--line);
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .brand { display: none; }
    .nav { grid-template-columns: repeat(4, 1fr); }
    .nav-item { text-align: center; padding: 10px 6px; font-size: 13px; }
    .main { padding: 20px 14px 88px; }
    .view-head { align-items: flex-start; flex-wrap: wrap; }
    .view-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .filter-head {
        display: grid;
        gap: 4px;
    }
    .filter-loop-list, .filter-actions {
        grid-template-columns: 1fr;
    }
    .filter-actions {
        display: grid;
    }
    h1 { font-size: 30px; }
    h2 { font-size: 24px; }
    .compose-grid, .split, .two-col, .add-member-form { grid-template-columns: 1fr; }
    .comment-form { grid-template-columns: 1fr; }
    .comment-form button { padding: 11px 14px; }
    .account-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    .account-actions .ghost {
        width: 100%;
        min-height: 44px;
    }
}
