/* Haven & Hearth design system — colour tokens */
:root {
    --color-primary: #3e8374;
    --color-secondary: #637c75;
    --color-tertiary: #4b7e8e;
    --color-neutral: #737876;
    --color-brand-deep: #1a534a;
    --color-bg-page: #f7faf9;
    --color-bg-card: #ffffff;
    --color-bg-muted: #eef2f1;
    --color-bg-subtle: #f0f4f2;
    --color-text-body: #5a716a;
    --color-text-heading: #1a534a;
    --color-accent-soft: #a3e4d7;
    --color-dot-grid: rgba(62, 131, 116, 0.12);
    --color-footer-border: rgba(62, 131, 116, 0.12);
    --font-headline: "Plus Jakarta Sans", system-ui, sans-serif;
    --font-body: "Work Sans", system-ui, sans-serif;
    --radius-md: 12px;
    --radius-lg: 2rem;
    --shadow-card: 0 12px 40px rgba(29, 92, 78, 0.08);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--color-text-body);
    background-color: var(--color-bg-page);
}

/* Public shell — dot grid (matches light mint + pattern from mock) */
.public-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg-page);
    background-image: radial-gradient(var(--color-dot-grid) 1px, transparent 1px);
    background-size: 14px 14px;
}

.public-shell__main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.public-split {
    flex: 1 1 auto;
    min-height: min(100vh, 880px);
}

/* Left column — hero / page copy (empty block in shell) */
.public-hero {
    position: relative;
    padding: clamp(2rem, 5vw, 4rem);
    background:
        linear-gradient(
            160deg,
            rgba(62, 131, 116, 0.12) 0%,
            rgba(244, 249, 246, 0.92) 45%,
            rgba(244, 249, 246, 0.98) 100%
        ),
        radial-gradient(ellipse 120% 80% at 20% 40%, rgba(75, 126, 142, 0.08), transparent 55%);
}

.public-hero__inner {
    position: relative;
    z-index: 1;
    max-width: 42rem;
}

/* Right column — floating card for forms / panels */
.public-aside {
    padding: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
    justify-content: center;
}

.public-card {
    width: 100%;
    max-width: 26rem;
    margin-left: auto;
    margin-right: auto;
    padding: clamp(1.75rem, 4vw, 2.5rem);
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

/* Footer strip */
.public-footer {
    flex-shrink: 0;
    background: var(--color-bg-card);
    border-top: 1px solid var(--color-footer-border);
    padding: 0.875rem clamp(1rem, 3vw, 2rem);
    font-size: 0.8125rem;
    color: var(--color-neutral);
}

.public-footer a {
    color: var(--color-secondary);
    text-decoration: none;
}

.public-footer a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Typography helpers for child templates */
.public-heading {
    font-family: var(--font-headline);
    font-weight: 700;
    color: var(--color-text-heading);
    letter-spacing: -0.02em;
}

.public-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-neutral);
}

/* Login (Flockaroo) */
.login-hero__kicker {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-brand-deep);
    margin-bottom: 1rem;
}

.login-hero__title {
    font-family: var(--font-headline);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--color-brand-deep);
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}

.login-hero__lead {
    font-size: 1.0625rem;
    line-height: 1.6;
    max-width: 36ch;
    margin-bottom: 2rem;
}

.login-hero__accent {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-secondary);
}

.login-hero__accent::before {
    content: "";
    display: block;
    width: 2.5rem;
    height: 1px;
    background: var(--color-secondary);
    opacity: 0.45;
}

.login-card__brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.login-card__icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-md);
    background: var(--color-accent-soft);
    color: var(--color-brand-deep);
}

.login-card__icon-wrap svg {
    width: 1.5rem;
    height: 1.5rem;
}

.login-card__title {
    font-family: var(--font-headline);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-text-heading);
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-card__subtitle {
    font-size: 0.9375rem;
    text-align: center;
    color: var(--color-text-body);
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

.login-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-brand-deep);
    text-decoration: none;
}

.login-link:hover {
    text-decoration: underline;
}

.login-field {
    position: relative;
    margin-bottom: 1.25rem;
}

.login-field__icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.125rem;
    height: 1.125rem;
    color: var(--color-secondary);
    pointer-events: none;
    z-index: 2;
}

.login-field__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.login-field--password .form-control {
    padding-right: 2.75rem;
}

.login-field__reveal {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-neutral);
    border-radius: calc(var(--radius-md) - 4px);
    cursor: pointer;
}

.login-field__reveal:hover {
    color: var(--color-brand-deep);
    background: rgba(62, 131, 116, 0.08);
}

.login-field__reveal svg {
    width: 1.125rem;
    height: 1.125rem;
}

.login-field .form-control {
    padding-left: 2.75rem;
    min-height: 2.75rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(26, 83, 74, 0.12);
    background-color: var(--color-bg-muted);
    font-size: 0.9375rem;
    color: var(--color-text-heading);
}

.login-field .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(62, 131, 116, 0.2);
    background-color: var(--color-bg-card);
}

.btn-login {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--color-brand-deep);
    --bs-btn-border-color: var(--color-brand-deep);
    --bs-btn-hover-bg: #154a42;
    --bs-btn-hover-border-color: #154a42;
    --bs-btn-active-bg: #154a42;
    --bs-btn-active-border-color: #154a42;
    font-family: var(--font-headline);
    font-weight: 600;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    border-radius: var(--radius-md);
}

.login-card__signup {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9375rem;
    color: var(--color-text-body);
}

.login-card__signup a {
    font-weight: 600;
    color: var(--color-brand-deep);
    text-decoration: none;
}

.login-card__signup a:hover {
    text-decoration: underline;
}

.login-alert {
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.public-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.25rem;
}

@media (min-width: 768px) {
    .public-footer__links {
        justify-content: flex-start;
    }
}

/* Legal pages (privacy, terms) */
.legal-page {
    max-width: 48rem;
}

.legal-page h1 {
    font-family: var(--font-headline);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text-heading);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
}

.legal-page h2 {
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--color-text-heading);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.legal-page p,
.legal-page li {
    line-height: 1.65;
}

.legal-page__header a:hover {
    color: var(--color-primary) !important;
}

/* Authenticated app shell */
.app-shell {
    width: 100%;
    max-width: none;
}

.app-sidebar {
    width: 264px;
    flex: 0 0 264px;
    background: rgba(255, 255, 255, 0.55);
    border-right: 1px solid rgba(62, 131, 116, 0.12);
    backdrop-filter: blur(10px);
}

.app-sidebar__inner {
    padding: 1.25rem 1.25rem 1.5rem;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-family: var(--font-headline);
    font-weight: 700;
    color: var(--color-text-heading);
    letter-spacing: -0.02em;
}

.app-brand__mark {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(163, 228, 215, 0.6);
    color: var(--color-brand-deep);
    border: 1px solid rgba(26, 83, 74, 0.12);
}

.app-brand__text {
    font-size: 1rem;
}

.app-sidebar__toggle {
    color: var(--color-secondary);
    border: 1px solid rgba(55, 65, 81, 0.18);
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: 0.35rem 0.5rem;
}

.app-sidebar__toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    display: block;
}

@media (min-width: 992px) {
    .app-shell--builder-collapsed .app-sidebar {
        width: 6.25rem;
        flex-basis: 6.25rem;
    }

    .app-shell--builder-collapsed .app-sidebar__inner {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .app-shell--builder-collapsed .app-brand {
        justify-content: center;
    }

    .app-shell--builder-collapsed .app-brand__text,
    .app-shell--builder-collapsed .app-brand + *,
    .app-shell--builder-collapsed .app-navlink > span:last-child,
    .app-shell--builder-collapsed .app-sidebar .mt-auto {
        display: none !important;
    }

    .app-shell--builder-collapsed .app-navlink {
        justify-content: center;
        width: 100%;
        padding-left: 0.45rem;
        padding-right: 0.45rem;
    }

    .app-shell--builder-collapsed .app-navlink__icon {
        margin-right: 0;
    }
}

.app-navlink {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.95rem;
    color: var(--color-secondary);
    font-weight: 600;
    font-size: 0.9375rem;
}

.app-navlink:hover {
    color: var(--color-brand-deep);
    background: rgba(62, 131, 116, 0.08);
}

.app-navlink.active {
    color: #ffffff;
    background: rgba(26, 83, 74, 0.92);
}

.app-navlink__icon {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: rgba(240, 244, 242, 0.9);
    color: var(--color-brand-deep);
}

.app-navlink.active .app-navlink__icon {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.app-navlink__icon svg {
    width: 1.15rem;
    height: 1.15rem;
    display: block;
}

.app-cta {
    --bs-btn-color: #fff;
    --bs-btn-bg: rgba(26, 83, 74, 0.92);
    --bs-btn-border-color: rgba(26, 83, 74, 0.92);
    --bs-btn-hover-bg: #154a42;
    --bs-btn-hover-border-color: #154a42;
    --bs-btn-active-bg: #154a42;
    --bs-btn-active-border-color: #154a42;
    border-radius: 0.95rem;
    padding: 0.9rem 1rem;
    font-family: var(--font-headline);
    font-weight: 650;
    box-shadow: 0 10px 30px rgba(29, 92, 78, 0.16);
}

.app-header {
    background: rgba(247, 250, 249, 0.72);
    border-bottom: 1px solid rgba(62, 131, 116, 0.12);
    backdrop-filter: blur(10px);
}

.app-search .input-group-text {
    border: 1px solid rgba(26, 83, 74, 0.12);
    border-right: 0;
    background: rgba(238, 242, 241, 0.9);
    color: var(--color-secondary);
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
}

.app-search__icon svg {
    width: 1.1rem;
    height: 1.1rem;
    display: block;
}

.app-search__input {
    border: 1px solid rgba(26, 83, 74, 0.12);
    background: rgba(238, 242, 241, 0.9);
    border-left: 0;
    border-top-right-radius: 999px;
    border-bottom-right-radius: 999px;
    color: var(--color-text-heading);
}

.app-search__input:focus {
    background: var(--color-bg-card);
    box-shadow: 0 0 0 3px rgba(62, 131, 116, 0.18);
    border-color: rgba(62, 131, 116, 0.55);
}

.app-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 1px solid rgba(26, 83, 74, 0.12);
    background: rgba(255, 255, 255, 0.6);
    color: var(--color-secondary);
    padding: 0;
}

.app-icon-btn:hover {
    color: var(--color-brand-deep);
    background: rgba(163, 228, 215, 0.2);
    border-color: rgba(26, 83, 74, 0.2);
}

.app-icon-btn svg {
    width: 1.2rem;
    height: 1.2rem;
    display: block;
}

.app-avatar {
    position: relative;
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 999px;
    border: 1.5px solid rgba(26, 83, 74, 0.22);
    background: rgba(255, 255, 255, 0.7);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.app-avatar__inner {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    background: radial-gradient(circle at 35% 30%, rgba(62, 131, 116, 0.25), transparent 55%),
        linear-gradient(135deg, rgba(26, 83, 74, 0.18), rgba(75, 126, 142, 0.18));
}

.app-avatar__dot {
    position: absolute;
    top: -0.15rem;
    right: -0.1rem;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    background: var(--color-accent-soft);
    border: 2px solid rgba(247, 250, 249, 0.95);
}

.app-main {
    background:
        radial-gradient(ellipse 120% 80% at 20% 25%, rgba(75, 126, 142, 0.05), transparent 55%),
        radial-gradient(ellipse 120% 80% at 80% 45%, rgba(62, 131, 116, 0.06), transparent 55%),
        var(--color-bg-page);
}

@media (max-width: 991.98px) {
    .app-sidebar {
        width: 232px;
        flex-basis: 232px;
    }
}

@media (max-width: 767.98px) {
    .app-sidebar {
        display: none;
    }
}

/* Organisation switcher (post-login) — full-width shell like public/login (container-fluid) */
.org-switcher-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: clamp(2rem, 5vw, 4rem) 0 0;
    background-color: var(--color-bg-page);
}

.org-switcher-page > .container-fluid {
    min-height: 0;
}

.org-switcher-shell {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 clamp(2rem, 5vw, 4rem);
}

.org-switcher-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: 0 4px 24px rgba(17, 24, 39, 0.06);
    padding: 0;
    overflow: hidden;
}

.org-switcher-card__body {
    padding: clamp(1.5rem, 4vw, 2.25rem) clamp(1.25rem, 4vw, 2.5rem) 0;
}

.org-switcher__header {
    margin-bottom: 1.75rem;
}

.org-switcher__top {
    margin-bottom: 1.75rem;
}

.org-switcher__logo {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 1.25rem;
    color: #111827;
    letter-spacing: -0.02em;
}

.org-switcher__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 1.5px solid rgba(55, 65, 81, 0.35);
    color: #374151;
    background: transparent;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.org-switcher__avatar:hover {
    border-color: var(--color-brand-deep);
    color: var(--color-brand-deep);
    background: rgba(163, 228, 215, 0.2);
}

.org-switcher__avatar svg {
    width: 1.25rem;
    height: 1.25rem;
}

.org-switcher__intro {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}

.org-switcher__intro-copy {
    flex: 1 1 16rem;
    max-width: 40rem;
}

.org-switcher__kicker {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-brand-deep);
    margin-bottom: 0.5rem;
}

.org-switcher__title {
    font-family: var(--font-headline);
    font-size: clamp(1.65rem, 3.5vw, 2.125rem);
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.org-switcher__lead {
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--color-text-body);
}

.org-switcher__create {
    flex-shrink: 0;
    align-self: flex-start;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    white-space: nowrap;
}

.org-switcher__alert {
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.org-switcher__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.org-switcher-org {
    margin: 0;
}

.org-switcher-org__btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    width: 100%;
    height: 100%;
    min-height: 11rem;
    padding: 1.25rem;
    border: 1px solid rgba(17, 24, 39, 0.06);
    border-radius: var(--radius-md);
    background: var(--color-bg-card);
    box-shadow: 0 2px 12px rgba(17, 24, 39, 0.04);
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.org-switcher-org__btn:hover {
    border-color: rgba(26, 83, 74, 0.18);
    box-shadow: 0 8px 28px rgba(17, 24, 39, 0.08);
}

.org-switcher-org__btn--featured {
    border-left-width: 3px;
    border-left-color: #7eb8e8;
}

.org-switcher-org__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    background: var(--color-accent-soft);
    color: var(--color-brand-deep);
    margin-bottom: 1rem;
}

.org-switcher-org__icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.org-switcher__role {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

.org-switcher__role--admin {
    background: rgba(163, 228, 215, 0.55);
    color: var(--color-brand-deep);
}

.org-switcher__role--editor {
    background: #e8ebe9;
    color: #4b5563;
}

.org-switcher__role--viewer {
    background: #e8ebe9;
    color: #4b5563;
}

.org-switcher-org__name {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 1.0625rem;
    color: #111827;
    line-height: 1.3;
    margin-bottom: 0.35rem;
    padding-right: 4.5rem;
}

.org-switcher-org__meta {
    font-size: 0.8125rem;
    color: var(--color-neutral);
}

.org-switcher-discover {
    min-height: 11rem;
    padding: 1.5rem 1.25rem;
    border: 2px dashed rgba(156, 163, 175, 0.55);
    border-radius: var(--radius-md);
    background: #f0f2f1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.org-switcher-discover__icon {
    margin-bottom: 1rem;
    background: #e5e7eb;
    color: #6b7280;
}

.org-switcher-discover__title {
    font-family: var(--font-headline);
    font-size: 1.0625rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem;
}

.org-switcher-discover__text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-text-body);
    margin: 0 0 1rem;
    flex: 1 1 auto;
    max-width: 22rem;
}

.org-switcher-discover__link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-brand-deep);
    text-decoration: none;
}

.org-switcher-discover__link:hover {
    text-decoration: underline;
}

.org-switcher-cta {
    display: grid;
    grid-template-columns: 1fr;
    margin: 0;
    width: 100%;
}

@media (min-width: 768px) {
    .org-switcher-cta {
        grid-template-columns: 1fr 1fr;
    }
}

.org-switcher-cta__copy {
    background: linear-gradient(180deg, #e8f5f0 0%, #eef2f0 100%);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.org-switcher-cta__title {
    font-family: var(--font-headline);
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.25;
}

.org-switcher-cta__text {
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--color-text-body);
    margin: 0;
    max-width: 36ch;
}

.org-switcher-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.org-switcher-cta__btn-secondary {
    font-family: var(--font-headline);
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(55, 65, 81, 0.22);
    background: var(--color-bg-card);
    color: #374151;
}

.org-switcher-cta__btn-secondary:hover {
    border-color: rgba(55, 65, 81, 0.35);
    background: var(--color-bg-card);
    color: var(--color-brand-deep);
}

.org-switcher-cta__visual {
    min-height: 220px;
    position: relative;
    overflow: hidden;
}

.org-switcher-cta__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-height: 220px;
}

.org-switcher-page-footer {
    flex-shrink: 0;
    margin-top: clamp(1.25rem, 4vw, 2rem);
    padding: 1rem 0 1.25rem;
    font-size: 0.8125rem;
    color: #9ca3af;
    background: #eceeec;
    border-top: 1px solid rgba(17, 24, 39, 0.06);
}

.org-switcher-page-footer__inner {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 clamp(2rem, 5vw, 4rem);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
}

.org-switcher-page-footer__copy {
    color: #9ca3af;
}

.org-switcher-page-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.org-switcher-page-footer__nav a {
    color: #9ca3af;
    text-decoration: none;
}

.org-switcher-page-footer__nav a:hover {
    color: var(--color-secondary);
    text-decoration: underline;
}

/* Trix — content body editor (matches form controls) */
[data-controller="trix-editor"] trix-toolbar {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-color: transparent;
    background: var(--color-bg-muted);
}

[data-controller="trix-editor"] trix-editor.trix-content {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border: 1px solid rgba(26, 83, 74, 0.12);
    border-top: 0;
}

[data-controller="trix-editor"] .trix-color-picker-group {
    position: relative;
}

/* Hidden native color input; palette button opens it */
[data-controller="trix-editor"] .trix-color-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

[data-controller="trix-editor"] .trix-palette-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    min-width: 1.75rem;
}

[data-controller="trix-editor"] .trix-palette-button svg {
    display: block;
    width: 1.125rem;
    height: 1.125rem;
}

/* Content edit — recurrence segmented radio group */
.recurrence-segmented {
    display: flex;
    width: 100%;
    border: 1px solid rgba(26, 83, 74, 0.18);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-bg-card);
}

.recurrence-segmented__segment {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    position: relative;
}

.recurrence-segmented__segment + .recurrence-segmented__segment {
    border-left: 1px solid rgba(26, 83, 74, 0.18);
}

.recurrence-segmented__label {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.5rem 0.35rem;
    font-size: 0.6875rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    color: var(--color-neutral);
    background-color: var(--color-bg-muted);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.12s ease, color 0.12s ease, font-weight 0.12s ease;
}

.recurrence-segmented__label:hover {
    background-color: rgba(238, 242, 241, 0.85);
    color: var(--color-text-heading);
}

.recurrence-segmented__input:checked + .recurrence-segmented__label {
    background-color: var(--color-primary);
    color: #fff;
    font-weight: 700;
}

.recurrence-segmented__input:checked + .recurrence-segmented__label:hover {
    background-color: var(--color-primary);
    color: #fff;
}

.recurrence-segmented__input:focus-visible + .recurrence-segmented__label {
    outline: 2px solid var(--color-brand-deep);
    outline-offset: -2px;
    z-index: 1;
}

/* Builder drag-and-drop */
.builder-palette-item {
    cursor: grab;
}

.builder-palette-item:active {
    cursor: grabbing;
}

.builder-palette-item__drag {
    flex-shrink: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.builder-drop-zone {
    position: relative;
    min-height: 1.75rem;
    border-radius: 999px;
    border: 2px dashed transparent;
    background: transparent;
    transition: background-color 140ms ease, border-color 140ms ease, min-height 140ms ease, box-shadow 140ms ease;
}

.builder-drop-zone::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    transform: translateY(-50%);
    background: rgba(62, 131, 116, 0.18);
}

.builder-drop-zone__label {
    display: none;
}

.builder-dragging .builder-drop-zone {
    background: rgba(163, 228, 215, 0.14);
    border-color: rgba(62, 131, 116, 0.16);
}

.builder-dragging .builder-drop-zone__label {
    position: relative;
    z-index: 1;
    display: block;
    padding: 0.3rem 0.9rem;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-secondary);
}

.builder-drop-zone.is-active {
    min-height: 3.5rem;
    background: rgba(163, 228, 215, 0.28);
    border-color: rgba(62, 131, 116, 0.45);
    box-shadow: inset 0 0 0 1px rgba(62, 131, 116, 0.1);
}

.builder-drop-zone.is-active::before {
    background: rgba(26, 83, 74, 0.75);
    height: 3px;
}

.builder-drop-zone--empty {
    min-height: 4.5rem;
    background: rgba(163, 228, 215, 0.12);
    border-color: rgba(62, 131, 116, 0.22);
}

.builder-drop-zone--empty .builder-drop-zone__label {
    display: block;
    position: relative;
    z-index: 1;
    padding: 1.1rem 1rem;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-secondary);
}

.builder-network-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: rgba(247, 250, 249, 0.58);
    backdrop-filter: blur(2px);
    border-radius: 2rem;
}

.is-loading > .builder-network-overlay {
    display: flex;
}

.builder-network-overlay__card {
    min-width: 11rem;
    text-align: center;
    padding: 1.25rem 1.5rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 30px rgba(29, 92, 78, 0.12);
}

.card[data-controller="collapsible-card"].is-collapsed {
    border-color: rgba(26, 83, 74, 0.08);
}

.card[data-controller="collapsible-card"].is-collapsed .card-body {
    padding-bottom: 1rem;
}
