:root {
    --bg: #f3f5f7;
    --bg-strong: #ffffff;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: #ffffff;
    --ink: #17212b;
    --muted: #697586;
    --line: rgba(23, 33, 43, 0.08);
    --blue: #2563eb;
    --blue-soft: rgba(37, 99, 235, 0.12);
    --green-soft: rgba(34, 197, 94, 0.14);
    --red-soft: rgba(239, 68, 68, 0.12);
    --yellow-soft: rgba(245, 158, 11, 0.14);
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.1), transparent 26%),
        linear-gradient(180deg, #f8fafc, #eef2f7);
    color: var(--ink);
    font-family: "Avenir Next", "Segoe UI", sans-serif;
}

body {
    position: relative;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.ambient {
    position: fixed;
    width: 18rem;
    height: 18rem;
    border-radius: 999px;
    filter: blur(42px);
    pointer-events: none;
    opacity: 0.55;
}

.ambient-left {
    top: 2rem;
    left: -7rem;
    background: rgba(59, 130, 246, 0.18);
}

.ambient-right {
    right: -6rem;
    bottom: 4rem;
    background: rgba(14, 165, 233, 0.14);
}

.parent-header,
.page-shell {
    position: relative;
    z-index: 1;
}

.parent-header {
    width: min(1180px, calc(100% - 1.5rem));
    margin: 0 auto;
    padding: 1rem 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-lockup,
.icon-link,
.icon-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-link,
.icon-pill {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow);
}

.brand-lockup {
    height: 3rem;
    padding: 0 0.25rem;
}

.brand-lockup img {
    height: 2rem;
    width: auto;
    display: block;
}

.parent-nav {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.icon-link,
.icon-pill {
    color: var(--ink);
    cursor: pointer;
    transition: transform 140ms ease, background 140ms ease;
}

.icon-link:hover,
.icon-pill:hover,
.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.child-tab:hover,
.shortcut-row:hover,
.profile-card:hover,
.add-profile-card:hover {
    transform: translateY(-1px);
}

.icon-link svg,
.icon-pill svg {
    width: 1.15rem;
    height: 1.15rem;
}

.page-shell {
    width: min(1180px, calc(100% - 1.5rem));
    margin: 0 auto;
    padding: 1rem 0 2rem;
}

.flash-banner,
.error-banner,
.panel {
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.flash-banner,
.error-banner {
    margin-bottom: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
}

.flash-banner {
    color: #1d4ed8;
}

.error-banner {
    color: #b91c1c;
}

.panel {
    border-radius: 26px;
}

.compact-panel {
    padding: 1.25rem;
}

.form-panel {
    padding: 1.4rem;
}

.simple-shell {
    width: min(520px, 100%);
    margin: 2.5rem auto 0;
    display: grid;
    gap: 1rem;
}

.simple-head {
    display: grid;
    gap: 0.4rem;
    text-align: center;
}

.simple-head h1,
.stage-head h1,
.child-hero-copy h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 0.95;
}

.eyebrow {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-panel {
    width: 100%;
}

.stack-form {
    display: grid;
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.42rem;
}

.field span,
.compact-rule-group > span,
.rules-summary > div > span,
.metric-card span,
.profile-subtitle,
.list-row span,
.shortcut-row span,
.empty-state {
    color: var(--muted);
    font-size: 0.92rem;
}

.field input,
.field select {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
}

.check-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--muted);
}

.check-row input,
.choice-pill input {
    accent-color: var(--blue);
}

.honey-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.primary-button,
.secondary-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.9rem 1.1rem;
    border-radius: 18px;
    border: 0;
    cursor: pointer;
    transition: transform 140ms ease;
}

.primary-button {
    background: linear-gradient(135deg, #111827, #2563eb);
    color: white;
}

.secondary-button {
    background: var(--blue-soft);
    color: #1d4ed8;
}

.secondary-button.subtle {
    background: rgba(15, 23, 42, 0.06);
    color: var(--ink);
}

.secondary-button.small-button {
    width: 100%;
    padding: 0.72rem 0.95rem;
    border-radius: 16px;
    font-size: 0.9rem;
}

.danger-button {
    background: var(--red-soft);
    color: #b91c1c;
}

.auth-switch {
    margin: 0;
    text-align: center;
}

.auth-switch a {
    color: #1d4ed8;
    font-weight: 700;
}

.profiles-stage {
    display: grid;
    gap: 1.25rem;
    min-height: calc(100vh - 7rem);
    align-content: center;
}

.stage-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-stage-head {
    align-items: stretch;
}

.mini-callout {
    padding: 0.85rem 1rem;
    border-radius: 999px;
    background: var(--yellow-soft);
    color: #92400e;
    font-weight: 600;
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.profile-card,
.add-profile-card,
.empty-panel {
    min-height: 23rem;
    padding: 1.1rem;
}

.profile-card,
.add-profile-card {
    display: grid;
    gap: 1rem;
}

.profile-card-main,
.add-profile-card,
.empty-panel {
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 0.85rem;
    text-align: center;
}

.profile-card-main h2,
.add-profile-card h2,
.empty-panel h2,
.section-head h2 {
    margin: 0;
    font-size: 1.25rem;
}

.profile-card-actions {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
}

.profile-primary-action {
    width: 100%;
}

.profile-card-reset {
    width: 100%;
}

.active-feed-summary {
    width: min(360px, 100%);
    padding: 1.25rem;
    display: grid;
    gap: 0.55rem;
    align-content: center;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 38%),
        rgba(255, 255, 255, 0.88);
}

.active-feed-summary strong {
    font-size: 1.2rem;
}

.active-feed-summary p {
    margin: 0;
    color: var(--muted);
}

.active-feed-summary-main,
.active-feed-summary-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.active-feed-summary-main {
    align-items: flex-start;
}

.active-feed-summary-copy {
    display: grid;
    gap: 0.28rem;
}

.active-feed-summary-copy strong {
    line-height: 1;
}

.active-feed-kicker {
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.active-feed-summary-actions {
    justify-content: space-between;
    flex-wrap: wrap;
}

.active-feed-actions-cluster {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.active-feed-actions-cluster .secondary-button svg {
    flex: 0 0 auto;
}

.install-note {
    display: none;
    margin-top: -0.25rem;
    padding: 1rem 1.1rem;
    border-radius: 20px;
    color: var(--muted);
    line-height: 1.5;
}

.install-note:not([hidden]) {
    display: block;
}

.active-feed-card {
    position: relative;
    border-color: rgba(37, 99, 235, 0.18);
    background:
        linear-gradient(180deg, rgba(219, 234, 254, 0.55), rgba(255, 255, 255, 0.84) 26%),
        rgba(255, 255, 255, 0.88);
    box-shadow: 0 24px 60px rgba(37, 99, 235, 0.15);
    transform: translateY(-4px);
}

.active-feed-ribbon {
    justify-self: center;
    margin-bottom: -0.2rem;
    padding: 0.42rem 0.82rem;
    border-radius: 999px;
    background: #1d4ed8;
    color: white;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    color: white;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.profile-avatar.xl {
    width: 7rem;
    height: 7rem;
    font-size: 2.4rem;
}

.profile-avatar.large {
    width: 5rem;
    height: 5rem;
    font-size: 1.8rem;
}

.tone-1 {
    background: linear-gradient(135deg, #ec4899, #f97316);
}

.tone-2 {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.tone-3 {
    background: linear-gradient(135deg, #22c55e, #14b8a6);
}

.tone-4 {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.add-avatar {
    background: rgba(15, 23, 42, 0.08);
    color: var(--ink);
}

.profile-stats,
.meta-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 700;
}

.meta-pill.open {
    background: var(--green-soft);
    color: #15803d;
}

.meta-pill.active {
    background: rgba(219, 234, 254, 1);
    color: #1d4ed8;
}

.meta-pill.locked {
    background: var(--red-soft);
    color: #b91c1c;
}

.profile-glance {
    display: grid;
    gap: 0.25rem;
    width: 100%;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.compact-rule-group {
    width: 100%;
    display: grid;
    gap: 0.45rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.tag-list.centered {
    justify-content: center;
}

.rule-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.68rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 700;
}

.empty-panel {
    align-content: center;
}

.child-hero {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.child-hero-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.child-hero-copy {
    display: grid;
    gap: 0.6rem;
}

.child-hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.child-hero-actions .icon-pill {
    width: auto;
    min-width: 3rem;
    padding: 0 1rem;
    gap: 0.55rem;
}

.inline-action-form {
    margin: 0;
}

.inline-action-form .secondary-button {
    white-space: nowrap;
}

.child-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 1rem 0;
}

.child-tab {
    padding: 0.78rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--line);
    font-weight: 700;
    color: var(--muted);
    transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}

.child-tab.active {
    background: #111827;
    color: white;
}

.tile-grid,
.two-up {
    display: grid;
    gap: 1rem;
}

.tile-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.two-up {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.tight-top {
    margin-top: 1rem;
}

.no-margin {
    margin: 0;
}

.metric-card {
    padding: 1.2rem;
    display: grid;
    gap: 0.3rem;
}

.metric-card strong {
    font-size: 1.5rem;
}

.metric-card small {
    color: var(--muted);
}

.status-callout {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 24px;
    border: 1px solid rgba(29, 78, 216, 0.12);
    background: rgba(219, 234, 254, 0.7);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.status-callout.locked {
    border-color: rgba(220, 38, 38, 0.12);
    background: rgba(254, 226, 226, 0.78);
}

.status-callout strong {
    display: block;
    margin-bottom: 0.2rem;
}

.status-callout p {
    margin: 0;
    color: var(--muted);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.rules-summary,
.shortcut-list,
.list-stack {
    display: grid;
    gap: 0.8rem;
}

.rules-summary > div,
.shortcut-row,
.list-row {
    padding: 0.95rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--line);
}

.rules-summary > div {
    display: grid;
    gap: 0.55rem;
}

.shortcut-row {
    display: grid;
    gap: 0.15rem;
}

.shortcut-row strong,
.list-row strong {
    font-size: 1rem;
}

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.compact-row {
    padding: 0.9rem 1rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.choice-pill {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.88rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
}

.choice-pill span {
    font-weight: 600;
}

.empty-state {
    padding: 1rem;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.05);
}

.content-block-grid,
.content-card-grid {
    display: grid;
    gap: 1rem;
}

.content-block-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.content-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.content-block-panel {
    padding: 1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--line);
    display: grid;
    gap: 0.9rem;
}

.content-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.content-block-head span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.7rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: var(--ink);
    font-weight: 700;
}

.content-chip-list,
.content-video-stack {
    display: grid;
    gap: 0.75rem;
}

.chip-action-form {
    margin: 0;
}

.content-chip {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.04);
    text-align: left;
    cursor: pointer;
}

.content-chip span,
.content-mini-copy,
.content-video-copy {
    display: grid;
    gap: 0.18rem;
}

.content-chip small,
.content-mini-copy span,
.content-video-copy span {
    color: var(--muted);
    font-size: 0.85rem;
}

.content-chip em {
    font-style: normal;
    color: #b91c1c;
    font-weight: 700;
    white-space: nowrap;
}

.content-chip.blocked,
.content-mini-card.is-blocked,
.content-video-card.blocked {
    border-color: rgba(220, 38, 38, 0.14);
    background: rgba(254, 242, 242, 0.92);
}

.content-mini-card,
.content-video-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.95rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
}

.content-mini-card {
    flex-direction: column;
    align-items: flex-start;
}

.content-mini-card form,
.content-video-card form {
    margin: 0;
}

.content-mini-card .secondary-button,
.content-video-card .secondary-button {
    width: 100%;
}

.content-video-thumb {
    width: 4.4rem;
    height: 4.4rem;
    flex: 0 0 auto;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.08);
    display: grid;
    place-items: center;
}

.content-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.content-video-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: #1d4ed8;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(6, 182, 212, 0.2));
}

.content-video-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.content-video-copy strong,
.content-mini-copy strong {
    font-size: 0.98rem;
}

.danger-zone {
    margin-top: 1rem;
}

@media (max-width: 820px) {
    .parent-header,
    .page-shell {
        width: min(100% - 1rem, 1180px);
    }

    .profiles-stage {
        min-height: auto;
        align-content: start;
        padding-top: 1rem;
    }

    .dashboard-stage-head,
    .stage-head,
    .child-hero,
    .section-head,
    .list-row,
    .content-video-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .child-hero-main {
        width: 100%;
    }

    .child-hero-actions {
        width: 100%;
    }

    .status-callout,
    .child-hero-actions,
    .active-feed-actions-cluster {
        flex-direction: column;
        align-items: stretch;
    }

    .active-feed-summary-main,
    .active-feed-summary-actions {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .inline-action-form,
    .inline-action-form .secondary-button,
    .child-hero-actions .icon-pill,
    .profile-primary-action .primary-button,
    .profile-primary-action .secondary-button,
    .content-mini-card .secondary-button,
    .content-video-card .secondary-button {
        width: 100%;
    }

    .profile-card,
    .add-profile-card,
    .empty-panel {
        min-height: auto;
    }
}
