@font-face {
    font-family: "Inter";
    src: url("/assets/fonts/inter/InterVariable-jznyFqg.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Instrument Serif";
    src: url("/assets/fonts/instrument-serif/InstrumentSerif-Regular-619HrUk.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Instrument Serif";
    src: url("/assets/fonts/instrument-serif/InstrumentSerif-Italic-MaWV3i0.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

:root {
    --bg: #ffffff;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #94a3b8;
    --line: #eef2f7;
    --line-strong: #e2e8f0;
    --accent: #111c35;
    --accent-soft: #f8fafc;
    --success: #10b981;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", sans-serif;
}

body {
    margin: 0;
}

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

.shell-body {
    min-height: 100vh;
    background: #fff;
}

.landing-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(15, 23, 42, 0.04), transparent 28rem),
        radial-gradient(circle at bottom right, rgba(212, 176, 104, 0.12), transparent 30rem),
        #fcfcfa;
}

.auth-body {
    min-height: 100vh;
    background: #f7f8fb;
}

.shell-icon {
    width: 1rem;
    height: 1rem;
}

.shell-icon--sm {
    width: 0.82rem;
    height: 0.82rem;
}

.shell-icon--xs {
    width: 0.72rem;
    height: 0.72rem;
}

.shell-topnav,
.shell-subnav {
    position: fixed;
    left: 0;
    right: 0;
    background: #fff;
    z-index: 40;
}

.shell-topnav {
    top: 0;
    height: 3.5rem;
    padding: 0 2.8rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shell-subnav {
    top: 3.5rem;
    height: 3.5rem;
    padding: 0 2.8rem;
    border-bottom: 1px solid #f5f7fb;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.shell-topnav__left,
.shell-topnav__right,
.shell-primary-nav,
.shell-subnav__links,
.shell-subnav__label,
.shell-brand {
    display: flex;
    align-items: center;
}

.shell-topnav__left,
.shell-topnav__right {
    gap: 2rem;
}

.shell-brand {
    gap: 0.95rem;
}

.shell-brand__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
}

.shell-brand__label {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.shell-primary-nav,
.shell-subnav__links {
    gap: 2.8rem;
}

.shell-primary-nav a,
.shell-subnav__links a {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #9bacc4;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid transparent;
}

.shell-primary-nav a.is-active,
.shell-subnav__links a.is-active {
    color: var(--accent);
    border-color: var(--accent);
}

.shell-icon-button {
    border: 0;
    background: transparent;
    color: #a7b4c9;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.shell-space-indicator {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
}

.shell-space-switcher {
    position: relative;
}

.shell-space-switcher summary {
    list-style: none;
}

.shell-space-switcher summary::-webkit-details-marker {
    display: none;
}

.shell-space-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    min-width: 14rem;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 0.9rem;
    box-shadow: 0 16px 40px -24px rgba(15, 23, 42, 0.3);
    padding: 0.35rem;
    z-index: 80;
}

.shell-space-menu__item,
.shell-space-menu__empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0.65rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.76rem;
    color: #5f6f88;
}

.shell-space-menu__item:hover {
    background: #f6f9ff;
    text-decoration: none;
}

.shell-space-menu__item.is-active {
    background: #f3f7ff;
    color: #172848;
    font-weight: 700;
}

.shell-space-menu__empty {
    color: #9aabc2;
}

.shell-divider {
    width: 1px;
    height: 1.4rem;
    background: var(--line);
}

.shell-user-badge {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: #f8fafc;
    font-size: 0.72rem;
    font-weight: 800;
}

.shell-user-badge--link {
    color: var(--accent);
}

.landing-shell {
    width: min(1180px, calc(100vw - 2rem));
    margin: 0 auto;
    padding: 1rem 0 4rem;
}

.auth-flash {
    width: min(1200px, calc(100vw - 4rem));
    margin: 0.9rem auto 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line-strong);
    border-radius: 0.85rem;
    background: #fff;
}

.landing-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 18px 60px -42px rgba(15, 23, 42, 0.25);
}

.landing-topbar__nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.landing-topbar__nav > a:not(.button) {
    color: #7b8798;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.landing-content {
    padding: 4rem 0 0;
}

.auth-topbar {
    height: 3.5rem;
    border-bottom: 1px solid #edf1f7;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.auth-topbar__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-topbar__dot {
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 999px;
    background: var(--accent);
    position: relative;
}

.auth-topbar__dot::after {
    content: "";
    position: absolute;
    inset: 0.36rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.auth-topbar__login {
    color: #172848;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-login-wrap {
    display: flex;
    justify-content: center;
    padding: 3.2rem 1rem 2rem;
}

.auth-login-card {
    width: min(36rem, calc(100vw - 2rem));
    text-align: center;
}

.auth-login-card h1 {
    font-size: clamp(3rem, 4.8vw, 3.65rem);
    line-height: 0.98;
    margin-bottom: 0.75rem;
}

.auth-login-subtitle {
    margin: 0 0 2rem;
    color: var(--muted);
    font-size: 1rem;
}

.auth-login-actions {
    display: grid;
    gap: 0.8rem;
}

.auth-provider-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    min-height: 3.8rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.88rem;
    font-weight: 800;
    transition: transform 0.14s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.auth-provider-button:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.auth-provider-button--google {
    background: #0f1f3d;
    color: #fff;
    border: 1px solid #0f1f3d;
}

.auth-provider-button--google:hover {
    background: #14284d;
    border-color: #14284d;
}

.auth-provider-button--entra {
    background: transparent;
    color: #7f90a8;
    border: 1px solid transparent;
}

.auth-provider-button--entra:hover {
    background: #f6f9ff;
    border-color: #e1e9f4;
    color: #1c304f;
}

.auth-provider-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-provider-icon--google {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
}

.auth-provider-icon--entra {
    width: 1.2rem;
    height: 1.2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1px;
}

.auth-provider-icon--entra span:nth-child(1) { background: #f35325; }
.auth-provider-icon--entra span:nth-child(2) { background: #81bc06; }
.auth-provider-icon--entra span:nth-child(3) { background: #05a6f0; }
.auth-provider-icon--entra span:nth-child(4) { background: #ffba08; }

.auth-login-hint {
    margin-top: 1.8rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
}

.auth-login-hint p {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.shell-subnav__label {
    gap: 0.55rem;
    color: #c3cfdf;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    min-width: 6rem;
}

.shell-frame {
    display: flex;
    min-height: 100vh;
    padding-top: 7rem;
}

.shell-sidebar {
    width: 23.125rem;
    border-right: 1px solid var(--line);
    background: #fff;
    min-height: calc(100vh - 7rem);
    padding: 3.7rem 2.8rem 2.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.shell-sidebar__group + .shell-sidebar__group {
    margin-top: 4rem;
}

.shell-sidebar__heading {
    margin: 0 0 2.1rem;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #c7d2e2;
}

.shell-sidebar__nav {
    display: grid;
    gap: 1.85rem;
}

.shell-sidebar__item {
    display: flex;
    align-items: center;
    gap: 1.35rem;
    color: #8fa1bd;
    font-size: 1.05rem;
    font-weight: 500;
}

.shell-sidebar__item.is-active {
    color: var(--accent);
}

.shell-sidebar__footer {
    padding-top: 3rem;
}

.shell-collapse {
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.3);
}

.shell-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.shell-content {
    flex: 1;
    padding: 4.8rem 5.8rem 2rem;
}

.shell-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 2.6rem 5.8rem 3rem;
    color: #d2dae7;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.26em;
    text-transform: uppercase;
}

.shell-footer div {
    display: flex;
    gap: 2.8rem;
}

.flash {
    margin: 1.5rem 5.8rem 0;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line-strong);
    border-radius: 1rem;
    background: #fff;
}

.eyebrow,
.panel__label,
.entry-pill {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: "Instrument Serif", serif;
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.03em;
    color: var(--accent);
}

h1 {
    font-size: clamp(4.2rem, 5vw, 5.6rem);
    line-height: 0.94;
}

h2 {
    font-size: 2.4rem;
    line-height: 1;
}

h3 {
    font-size: 1.95rem;
    line-height: 1.05;
}

.hero,
.space-hero,
.auth-card {
    max-width: 92rem;
}

.landing-hero {
    display: grid;
    grid-template-columns: 1.35fr 0.9fr;
    gap: 2rem;
    align-items: stretch;
}

.landing-hero__copy,
.landing-hero__panel {
    border: 1px solid var(--line);
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.82);
    padding: 2.2rem;
}

.landing-hero__copy h1 {
    max-width: 11ch;
    margin-bottom: 1.5rem;
}

.landing-hero__panel {
    display: grid;
    gap: 1rem;
}

.landing-stat {
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.landing-stat:last-child {
    border-bottom: 0;
}

.landing-stat__value {
    font-family: "Instrument Serif", serif;
    font-size: 2rem;
    line-height: 1;
    font-style: italic;
    color: var(--accent);
    margin-bottom: 0.6rem;
}

.hero__copy {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 3rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid var(--line);
}

.hero__lede,
.panel__caption,
.space-card p,
.persona-card p,
.timeline__item p {
    font-size: 1rem;
    line-height: 1.75;
    color: #93a1b8;
}

.hero__copy > div:first-child,
.hero__copy > .hero-copy__intro {
    max-width: 47rem;
}

.hero__actions,
.auth-actions,
.space-card__footer,
.space-card__header,
.persona-card__header,
.timeline__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.button--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.button--ghost {
    background: #fff;
    color: var(--accent);
}

.section-heading {
    margin-bottom: 2rem;
}

.space-grid,
.persona-grid {
    display: grid;
    gap: 1.5rem;
}

.space-grid {
    grid-template-columns: 1fr;
}

.persona-grid {
    grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
}

.space-card,
.hero__panel,
.auth-card,
.persona-create-card,
.persona-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 2rem;
    padding: 2rem;
}

.space-card__token,
.entry-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
}

.persona-card__focus {
    margin: 1rem 0;
}

.persona-card__challenge,
.timeline__item {
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    padding: 1rem 1.1rem;
    background: #fff;
}

.persona-card__challenge span,
.timeline__opportunity strong {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #a0aec0;
}

.timeline {
    display: grid;
    gap: 1rem;
    margin-top: 1.1rem;
}

.timeline__opportunity {
    margin-top: 0.8rem;
}

.persona-create-card {
    margin-bottom: 1.5rem;
}

.persona-create-card__head {
    margin-bottom: 1rem;
}

.persona-create-form {
    display: grid;
    gap: 0.8rem;
}

.persona-create-form label {
    margin: 0;
}

.persona-create-form label > span {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #93a2ba;
}

.persona-create-form textarea {
    min-height: 4.3rem;
    resize: vertical;
}

.persona-create-form__actions {
    display: flex;
    justify-content: flex-end;
}

.persona-card--sky {
    background: #fcfdff;
}

.persona-card--amber {
    background: #fffdfa;
}

.persona-card--emerald {
    background: #fbfffd;
}

.persona-card--rose {
    background: #fffdfd;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4rem;
    padding: 4.2rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.dashboard-metric__label {
    margin: 0 0 1rem;
    color: #a2b0c6;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.dashboard-metric__value {
    font-family: "Instrument Serif", serif;
    font-size: 3rem;
    line-height: 1;
    color: var(--accent);
}

.dashboard-metric__delta {
    margin-top: 1.1rem;
    color: var(--success);
    font-size: 0.95rem;
    font-weight: 700;
}

.dashboard-metric__delta span {
    color: #c6d0df;
    font-weight: 500;
    margin-left: 0.45rem;
}

.auth-card {
    max-width: 50rem;
    display: grid;
    gap: 2rem;
}

code {
    display: block;
    overflow-x: auto;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: #fff;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.9rem;
}

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

    .shell-content,
    .shell-footer {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (max-width: 820px) {
    .shell-topnav,
    .shell-subnav {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .shell-primary-nav,
    .shell-subnav__links,
    .shell-footer div {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .shell-topnav {
        height: auto;
        padding-top: 1rem;
        padding-bottom: 1rem;
        align-items: flex-start;
        flex-direction: column;
    }

    .shell-subnav {
        top: 5.4rem;
        height: auto;
        padding-top: 0.9rem;
        padding-bottom: 0.9rem;
        align-items: flex-start;
        flex-direction: column;
    }

    .shell-frame {
        padding-top: 9.6rem;
    }

    .hero__copy,
    .dashboard-metrics,
    .landing-hero {
        grid-template-columns: 1fr;
        display: grid;
    }

    .hero__copy {
        align-items: start;
    }

    .landing-shell {
        width: min(100vw - 1rem, 1180px);
    }

    .landing-topbar {
        flex-direction: column;
        align-items: flex-start;
        border-radius: 1.5rem;
    }

    .auth-login-wrap {
        padding-top: 2rem;
    }

    .auth-login-card {
        width: min(100vw - 1.3rem, 36rem);
    }

    .auth-provider-button {
        min-height: 3.4rem;
        font-size: 0.75rem;
        letter-spacing: 0.12em;
    }
}

/* Backend shell (ported from davinciplatform sizing/tone) */
.backend-body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 400;
    color: #1f2b3d;
    background: #f7f8fb;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.backend-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #ffffff;
    border-bottom: 1px solid #edf1f7;
    z-index: 1300;
}

.backend-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 22px;
}

.backend-top-main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    height: 100%;
}

.backend-top-main-left {
    display: flex;
    align-items: center;
    gap: 28px;
}

.backend-brand-block {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.backend-brand-dot {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #0f1f3d;
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.04em;
}

.backend-brand-title {
    font-weight: 700;
    font-size: 1.06rem;
    color: #0f2747;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
}

.backend-brand-title:hover {
    text-decoration: none;
}

.backend-brand-logo {
    display: block;
    height: 28px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.backend-top-main-links {
    display: flex;
    align-items: center;
    gap: 26px;
}

.backend-top-main-links a {
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
    color: #90a0b8;
    padding-bottom: 2px;
    text-decoration: none;
}

.backend-top-main-links a.is-active {
    color: #101f3a;
    border-bottom: 1px solid #101f3a;
}

.backend-top-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 280px;
}

.backend-top-search {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.backend-top-search-input-wrap {
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: width 0.22s ease, opacity 0.18s ease;
}

.backend-top-search-input-wrap.is-open {
    width: min(34vw, 360px);
    opacity: 1;
}

.backend-top-search-input {
    width: 100%;
    height: 34px;
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    padding: 0 0.8rem;
    font-size: 0.72rem;
    color: #223752;
    background: #fff;
}

.backend-top-search-input::placeholder {
    color: #9aa9bf;
}

.backend-top-search-input:focus {
    outline: none;
    border-color: #95b3e8;
    box-shadow: 0 0 0 3px rgba(36, 88, 214, 0.1);
}

.backend-icon-btn {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #9aa7bd;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.backend-search-icon {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.backend-icon-btn:hover {
    background: #f6f9ff;
    color: #172747;
}

.backend-space-switcher {
    position: relative;
    flex: 0 0 auto;
    width: 176px;
    min-width: 132px;
    max-width: 320px;
}

.backend-space-trigger {
    width: 100%;
    height: 36px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
    font-weight: 600;
    color: #131f35;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.backend-space-trigger:hover {
    border-color: #e3eaf3;
    background: #fbfdff;
}

.backend-space-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.backend-space-chevron {
    width: 14px;
    height: 14px;
    color: #152848;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.backend-space-switcher.is-open .backend-space-chevron {
    transform: rotate(180deg);
}

.backend-space-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 260px;
    background: #fff;
    border: 1px solid #e3eaf3;
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(15, 35, 66, 0.14);
    padding: 8px 0;
    z-index: 1400;
}

.backend-space-dropdown.is-open {
    display: block;
}

.backend-space-dropdown-header {
    padding: 6px 14px 8px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #b3bed0;
}

.backend-space-option {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 9px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4a5d7d;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
}

.backend-space-option:hover {
    background: #f6f9ff;
    color: #172848;
    text-decoration: none;
}

.backend-space-option.is-active {
    color: #172848;
    background: #f6f9ff;
}

.backend-space-option--empty {
    color: #9babc1;
    pointer-events: none;
}

.backend-space-option-check {
    font-size: 0.82rem;
    opacity: 0;
}

.backend-space-option.is-active .backend-space-option-check {
    opacity: 1;
}

.backend-space-dropdown-sep {
    height: 1px;
    background: #f0f4f9;
    margin: 7px 0;
}

.backend-space-manage {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #2a5ad3;
    text-decoration: none;
}

.backend-space-manage:hover {
    background: #eef4ff;
    text-decoration: none;
}

.backend-top-sep {
    height: 16px;
    width: 1px;
    background: #e7edf6;
    margin: 0 2px;
}

.backend-profile-menu {
    position: relative;
}

.backend-profile-trigger {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #e2e9f3;
    background: #f2f5fa;
    color: #172747;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    cursor: pointer;
}

.backend-profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 254px;
    padding: 8px 0;
    border: 1px solid #e3eaf3;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(13, 35, 63, 0.14);
    z-index: 1400;
}

.backend-profile-dropdown.is-open {
    display: block;
}

.backend-profile-dropdown-head {
    padding: 10px 14px 8px;
    border-bottom: 1px solid #f0f4f9;
    margin-bottom: 4px;
}

.backend-profile-dropdown-name {
    font-size: 0.74rem;
    font-weight: 700;
    color: #1a2942;
    line-height: 1.2;
}

.backend-profile-dropdown-role {
    margin-top: 3px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #a8b6ca;
}

.backend-profile-dropdown a {
    display: block;
    color: #1f3554;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 9px 14px;
    text-decoration: none;
}

.backend-profile-dropdown a:hover {
    background: #f6f9ff;
    text-decoration: none;
}

.backend-profile-dropdown-sep {
    height: 1px;
    background: #f0f4f9;
    margin: 6px 0;
}

.backend-subbar {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    height: 40px;
    background: #fff;
    border-bottom: 1px solid #f0f3f8;
    z-index: 1250;
    display: flex;
    align-items: center;
}

.backend-subbar-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.backend-subbar-label {
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #b4bfd0;
}

.backend-subbar-links a {
    font-size: 0.74rem;
    font-weight: 500;
    color: #8ea0b8;
    text-decoration: none;
}

.backend-subbar-links a.is-active {
    color: #152744;
}

.backend-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: calc(100vh - 96px);
    margin-top: 96px;
}

.backend-sidebar {
    border-right: 1px solid #dbe2ee;
    background: #fff;
    padding: 20px 14px;
    position: sticky;
    top: 96px;
    height: calc(100vh - 96px);
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.backend-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 4px 6px;
}

.backend-sidebar-title {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #b0bccf;
}

.backend-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.backend-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 10px;
    color: #8a9ab1;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 500;
    font-size: 0.75rem;
}

.backend-menu-item:hover {
    color: #2a405f;
    text-decoration: none;
}

.backend-menu-item.is-active {
    color: #132844;
    font-weight: 600;
}

.backend-menu-icon {
    width: 22px;
    display: inline-flex;
    justify-content: center;
    font-size: 1.02rem;
    line-height: 1;
    opacity: 0.76;
    flex: 0 0 22px;
}

.backend-content {
    min-width: 0;
    padding: 20px 22px;
    background: #fff;
}

.backend-content h1 {
    font-size: clamp(2.7rem, 3vw, 3.9rem);
    line-height: 1.08;
    margin: 0 0 14px;
    font-family: "Instrument Serif", Georgia, serif;
    color: #182741;
}

.backend-content h2 {
    font-size: clamp(1.7rem, 2.3vw, 2.3rem);
    line-height: 1.1;
    margin: 0 0 10px;
    font-family: "Instrument Serif", Georgia, serif;
    color: #182741;
}

.backend-content p {
    font-size: 0.96rem;
    line-height: 1.55;
    color: #6f7f96;
}

.flash {
    border: 1px solid #dbe2ee;
    background: #fff;
    color: #1f2b3d;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 8px;
}

.flash-success {
    border-color: #9de8ca;
    background: #f1fdf8;
    color: #0b7a5e;
}

.flash-error {
    border-color: #f3b6b6;
    background: #fff4f4;
    color: #b33a3a;
}

@media (max-width: 980px) {
    .backend-shell {
        grid-template-columns: 1fr;
    }

    .backend-sidebar {
        display: none;
    }

    .backend-top-main-links,
    .backend-subbar {
        display: none;
    }
}

.backend-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.4rem;
}

.backend-page-head p {
    margin: 0;
    font-size: 0.92rem;
    color: #74859e;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #0f1f3d;
    background: #0f1f3d;
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.btn:hover {
    background: #13264a;
    border-color: #13264a;
    text-decoration: none;
}

.btn-secondary-solid {
    background: #f6f9ff;
    border-color: #dbe2ee;
    color: #355072;
}

.btn-secondary-solid:hover {
    background: #edf3ff;
    border-color: #cfd9e8;
    color: #1f3554;
}

.backend-table-wrap {
    border-top: 1px solid #edf2f8;
    padding-top: 0.65rem;
}

.backend-form-card {
    max-width: 720px;
    border: 1px solid #e5ebf4;
    border-radius: 1.5rem;
    padding: 1.5rem;
    background: #fff;
    transition: max-height 0.4s cubic-bezier(0.2, 0, 0, 1), opacity 0.2s ease, transform 0.2s ease, margin 0.2s ease, padding 0.2s ease;
    transform-origin: top;
    margin-bottom: 1rem;
}

.persona-form-card {
    max-width: none;
}

.task-filter-card {
    max-width: none;
}

.backend-form-grid {
    display: grid;
    gap: 12px;
}

.task-filter-grid {
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 0.85rem;
}

.friction-filter-grid {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 0.85rem;
}

.friction-filter-actions {
    margin-top: 0.5rem;
}

.persona-form-grid {
    gap: 14px;
}

.persona-form-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(420px, 1.35fr);
    gap: 18px;
    align-items: start;
}

.persona-form-column {
    display: grid;
    gap: 10px;
}

.persona-form-textareas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.backend-form-grid label {
    display: block;
}

.backend-form-grid label > span {
    display: block;
    margin-bottom: 0.4rem;
    color: #94a3b8;
    font-size: 0.56rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 700;
}

.backend-form-grid textarea {
    min-height: 96px;
    resize: vertical;
}

.task-filter-grid select {
    width: 100%;
    border: 1px solid #dbe4f1;
    border-radius: 0.75rem;
    padding: 0.5rem 0.6rem;
    font-size: 0.74rem;
    color: #334b68;
    background: #fff;
}

.task-filter-grid select:focus {
    outline: none;
    border-color: #95b3e8;
    box-shadow: 0 0 0 2px rgba(36, 88, 214, 0.1);
}

.friction-filter-grid select {
    width: 100%;
    border: 1px solid #dbe4f1;
    border-radius: 0.75rem;
    padding: 0.5rem 0.6rem;
    font-size: 0.74rem;
    color: #334b68;
    background: #fff;
}

.friction-filter-grid select:focus {
    outline: none;
    border-color: #95b3e8;
    box-shadow: 0 0 0 2px rgba(36, 88, 214, 0.1);
}

.persona-form-column textarea {
    min-height: 124px;
}

.backend-form-card--hidden {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    transform: translateY(-4px);
}

.backend-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

.backend-space-table {
    width: 100%;
    border-collapse: collapse;
}

.backend-space-table th,
.backend-space-table td {
    padding: 16px 8px;
    border-bottom: 1px solid #edf2f8;
    text-align: left;
    font-size: 0.95rem;
    color: #5f6f88;
}

.backend-space-table th {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #7e92ae;
}

.backend-task-number {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #7b8eaa;
    white-space: nowrap;
}

.task-overview-table th,
.task-overview-table td {
    padding: 9px 6px;
    font-size: 0.74rem;
}

.task-overview-table th {
    font-size: 0.52rem;
}

.task-ref-form {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
}

.task-ref-form input[type="text"] {
    width: 7.3rem;
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    padding: 0.24rem 0.48rem;
    font-size: 0.6rem;
    color: #334b68;
    background: #fff;
}

.task-tags-cell {
    min-width: 11rem;
    display: grid;
    gap: 0.28rem;
}

.task-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.task-tag-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    padding: 0.1rem 0.38rem;
    font-size: 0.54rem;
    font-weight: 600;
    color: #5f7493;
    background: #f8fbff;
    line-height: 1.2;
}

.task-tag-pill-remove {
    border: 0;
    background: transparent;
    color: #7f90a8;
    font-size: 0.62rem;
    line-height: 1;
    padding: 0;
    margin-left: 0.24rem;
    cursor: pointer;
}

.task-tag-pill-remove:hover {
    color: #b44343;
}

.task-tag-add-form input[type="text"] {
    width: 100%;
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    padding: 0.2rem 0.45rem;
    font-size: 0.58rem;
    color: #334b68;
    background: #fff;
}

.task-tag-add-form input[type="text"]:focus {
    outline: none;
    border-color: #95b3e8;
    box-shadow: 0 0 0 2px rgba(36, 88, 214, 0.1);
}

.friction-tags-cell {
    margin: 0.18rem 0 0.24rem;
}

.admin-users-table td {
    vertical-align: top;
}

.admin-user-email {
    margin-top: 0.14rem;
    font-size: 0.64rem;
    color: #8ea0b8;
}

.admin-provider-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.18rem 0.45rem;
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.admin-provider-pill.provider-google {
    background: #f2f7ff;
    color: #385a8d;
    border: 1px solid #d7e4f8;
}

.admin-provider-pill.provider-entra {
    background: #f3f9ff;
    color: #325f83;
    border: 1px solid #d4e8f5;
}

.admin-user-space-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    max-width: 26rem;
}

.admin-user-space-pill-form {
    margin: 0;
}

.admin-user-space-add-form input[type="text"] {
    width: 12rem;
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    padding: 0.24rem 0.48rem;
    font-size: 0.6rem;
    color: #334b68;
    background: #fff;
}

.admin-user-space-add-form input[type="text"]:focus {
    outline: none;
    border-color: #95b3e8;
    box-shadow: 0 0 0 2px rgba(36, 88, 214, 0.1);
}

.task-ref-form input[type="text"]:focus {
    outline: none;
    border-color: #95b3e8;
    box-shadow: 0 0 0 2px rgba(36, 88, 214, 0.1);
}


.backend-space-name-wrap {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.backend-space-icon {
    color: #8ea0b8;
    font-size: 0.85rem;
}

.backend-space-name {
    color: #1e2d44;
    font-weight: 700;
}

.backend-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 5.5rem;
    padding: 4px 9px;
    border: 1px solid #86d8b2;
    border-radius: 999px;
    color: #1aa56f;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
    background: #f3fdf8;
}

.backend-action-link {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #1c2f4b;
    font-weight: 700;
    text-decoration: none;
}

.ta-right {
    text-align: right !important;
}

.muted {
    color: #91a0b5;
}

.backend-dot-sep {
    margin: 0 0.45rem;
    color: #b3bfd0;
}

.persona-jobs-quick-card {
    max-width: none;
    padding: 1rem;
}

.persona-jobs-quick-form input[type="text"] {
    width: 100%;
    border: 1px solid #dce5f2;
    border-radius: 999px;
    padding: 0.72rem 0.9rem;
    font-size: 0.86rem;
    color: #1f2b3d;
}

.persona-jobs-quick-form input[type="text"]:focus {
    outline: none;
    border-color: #95b3e8;
    box-shadow: 0 0 0 3px rgba(36, 88, 214, 0.12);
}

.backend-priority-section {
    margin-top: 1rem;
}

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

.backend-priority-count {
    min-width: 2rem;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7d8ea8;
    padding: 0.28rem 0.55rem;
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    background: #f7faff;
}

.backend-jobs-list {
    border-top: 1px solid #edf2f8;
}

.backend-job-row {
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
    border-bottom: 1px solid #edf2f8;
    padding: 0.5rem 0.2rem;
}

.backend-job-main {
    min-width: 0;
}

.backend-job-main h3 {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    font-family: "Inter", sans-serif;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0;
    color: #1f2f49;
}

.backend-job-inline-form {
    margin: 0 0 0.36rem;
    max-width: 24rem;
}

.backend-job-inline-form input[type="text"] {
    width: 100%;
    border: 1px solid #dce5f2;
    border-radius: 999px;
    padding: 0.38rem 0.62rem;
    font-size: 0.7rem;
    line-height: 1.2;
    color: #324765;
    background: #fbfdff;
}

.backend-job-inline-form input[type="text"]:focus {
    outline: none;
    border-color: #95b3e8;
    box-shadow: 0 0 0 3px rgba(36, 88, 214, 0.1);
}

.backend-step-number {
    display: inline-block;
    min-width: 1.6rem;
    color: #7f90a8;
    font-weight: 700;
}

.backend-job-title-link {
    color: #1f2f49;
    text-decoration: none;
}

.backend-job-title-link:hover {
    color: #13284b;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.backend-job-main p {
    margin: 0;
    font-size: 0.68rem;
    color: #73839b;
    line-height: 1.35;
}

.backend-job-metrics {
    margin: 0 0 0.24rem;
    font-size: 0.62rem;
    font-weight: 600;
    color: #7f90a8;
    letter-spacing: 0.02em;
}

.backend-friction-title-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    margin: 0.08rem 0 0.18rem;
}

.backend-friction-title-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    background: #fbfdff;
    color: #5b7192;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    text-decoration: none;
    padding: 0.22rem 0.46rem;
}

.backend-friction-title-pill:hover {
    text-decoration: none;
    background: #f5f8ff;
    border-color: #c8d7ef;
    color: #2f486e;
}

.backend-step-chain {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.26rem;
    margin: 0 0 0.32rem;
}

.backend-step-node {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    padding: 0.12rem 0.46rem 0.14rem;
    color: #5f7493;
    font-size: 0.57rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    background: #fbfdff;
}

.backend-step-node:hover {
    text-decoration: none;
    border-color: #c8d7ef;
    background: #f6f9ff;
    color: #2c4469;
}

.backend-step-node-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0.9rem;
    height: 0.9rem;
    border-radius: 999px;
    background: #eef4ff;
    color: #4f6c95;
    font-size: 0.5rem;
    font-weight: 700;
}

.backend-step-node-title {
    letter-spacing: 0.01em;
}

.backend-step-node-friction {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0.86rem;
    height: 0.86rem;
    border-radius: 999px;
    background: #fff2f2;
    color: #a96d6d;
    font-size: 0.5rem;
    font-weight: 700;
}

.backend-step-node.has-friction {
    border-color: #ebd6d6;
}

.backend-step-link {
    color: #b4c1d4;
    font-size: 0.68rem;
    line-height: 1;
}

.backend-friction-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    padding: 0.16rem 0.5rem;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.backend-friction-pill.is-none {
    background: #f8fbff;
    border-color: #dbe4f1;
    color: #8fa0b7;
}

.backend-friction-pill.is-low {
    background: #f8fbff;
    border-color: #cddcf2;
    color: #6d84a9;
}

.backend-friction-pill.is-medium {
    background: #fffaf4;
    border-color: #efdcbf;
    color: #a3783f;
}

.backend-friction-pill.is-high {
    background: #fff6f6;
    border-color: #efc9c9;
    color: #b36a6a;
}

.backend-job-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.backend-mini-btn {
    border: 1px solid #dbe4f1;
    background: #fff;
    border-radius: 999px;
    color: #415775;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.38rem 0.55rem;
    cursor: pointer;
}

.backend-mini-btn:hover {
    background: #f5f8ff;
}

.backend-drag-handle {
    color: #9aabc2;
    font-size: 0.82rem;
    line-height: 1;
    cursor: grab;
    letter-spacing: -0.08em;
    user-select: none;
}

.backend-job-row.is-dragging {
    opacity: 0.52;
    background: #f8fbff;
}

.backend-job-row.is-selected {
    background: #f7faff;
}

.backend-priority-select {
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    padding: 0.28rem 0.45rem;
    font-size: 0.58rem;
    color: #334b68;
    background: #fff;
}

.backend-icon-btn {
    width: 1.95rem;
    height: 1.95rem;
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    background: #fff;
    color: #7f8ea5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.backend-icon-btn svg {
    width: 0.8rem;
    height: 0.8rem;
    fill: currentColor;
}

.backend-icon-btn:hover {
    background: #f6f9ff;
    color: #536784;
}

.backend-icon-btn--danger:hover {
    background: #fff5f5;
    color: #b44343;
    border-color: #f1c0c0;
}

.backend-friction-classify-form {
    display: inline-flex;
    align-items: flex-end;
    gap: 0.35rem;
    margin-right: 0.25rem;
}

.backend-friction-field {
    display: inline-flex;
    flex-direction: column;
    gap: 0.12rem;
}

.backend-friction-field > span {
    font-size: 0.5rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8ea0b8;
    font-weight: 700;
    line-height: 1;
}

.backend-friction-field select {
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    padding: 0.24rem 0.42rem;
    font-size: 0.56rem;
    color: #334b68;
    background: #fff;
    min-width: 4.35rem;
}

.backend-friction-field select[name="status"] {
    min-width: 7.2rem;
}

.backend-inline-task-form input[type="text"] {
    width: 12.5rem;
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    padding: 0.32rem 0.58rem;
    font-size: 0.62rem;
    color: #334b68;
    background: #fff;
}

.backend-inline-task-form input[type="text"]:focus {
    outline: none;
    border-color: #95b3e8;
    box-shadow: 0 0 0 2px rgba(36, 88, 214, 0.1);
}

.backend-inline-task-list {
    margin: 0.25rem 0 0;
    padding-left: 1.7rem;
    color: #61758f;
    font-size: 0.64rem;
    line-height: 1.4;
}

.backend-friction-comments {
    margin-top: 0.28rem;
}

.backend-friction-comment-row,
.backend-friction-comment-empty {
    margin: 0;
    font-size: 0.62rem;
    line-height: 1.35;
    color: #6f819a;
}

.backend-friction-comment-row strong {
    color: #2d4262;
    font-weight: 700;
}

.backend-friction-comment-form {
    margin-top: 0.28rem;
}

.backend-friction-comment-form input[type="text"] {
    width: 100%;
    max-width: 19rem;
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    padding: 0.28rem 0.56rem;
    font-size: 0.61rem;
    color: #334b68;
    background: #fff;
}

.backend-friction-comment-form input[type="text"]:focus {
    outline: none;
    border-color: #95b3e8;
    box-shadow: 0 0 0 2px rgba(36, 88, 214, 0.1);
}

.tag-tree-shell {
    max-width: none;
}

.tag-tree-head {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 0.7rem;
}

.tag-tree-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
}

.tag-tree-toolbar input[type="search"] {
    width: 12rem;
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    padding: 0.36rem 0.58rem;
    font-size: 0.66rem;
    color: #334b68;
    background: #fff;
}

.tag-tree-toolbar input[type="search"]:focus {
    outline: none;
    border-color: #95b3e8;
    box-shadow: 0 0 0 2px rgba(36, 88, 214, 0.1);
}

.tag-root-dropzone {
    border: 1px solid #e6edf7;
    border-radius: 0.75rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.62rem;
    color: #8094b0;
    margin-bottom: 0.55rem;
    background: #fbfdff;
}

.tag-root-dropzone.is-drop-target {
    border-color: #99b4e6;
    background: #f2f7ff;
}

.tag-tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tag-tree-item {
    margin: 0;
    padding: 0.08rem 0;
}

.tag-tree-row {
    margin-left: calc(var(--depth) * 1.2rem);
    border: 1px solid transparent;
    border-radius: 0.55rem;
    padding: 0.24rem 0.4rem;
    display: inline-flex;
    align-items: center;
    min-width: 8rem;
    background: #fff;
    justify-content: space-between;
    gap: 0.6rem;
}

.tag-tree-row.is-draggable {
    cursor: grab;
}

.tag-tree-row strong {
    font-size: 0.77rem;
    color: #1b2d49;
    font-weight: 600;
}

.tag-tree-main {
    min-width: 0;
}

.tag-tree-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.tag-icon-btn {
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    width: 1.42rem;
    height: 1.42rem;
    padding: 0;
    font-size: 0.62rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #617892;
    background: #fff;
    cursor: pointer;
}

.tag-icon-btn:hover {
    background: #f5f8ff;
    border-color: #c8d7ef;
}

.tag-icon-btn.danger:hover {
    background: #fff5f5;
    border-color: #f1c0c0;
    color: #b44343;
}

.tag-tree-row.is-dragging {
    opacity: 0.6;
}

.tag-tree-row.is-drop-target {
    border-color: #99b4e6;
    background: #f3f8ff;
}

.backend-empty-jobs {
    margin: 0;
    padding: 0.62rem 0;
    color: #94a3b8;
    font-size: 0.68rem;
}

.search-page-card {
    padding: 1rem;
}

.search-page-form {
    margin: 0;
}

.search-page-input-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.search-page-input-row input[type="search"] {
    flex: 1 1 auto;
    min-width: 180px;
    border: 1px solid #dce5f2;
    border-radius: 999px;
    padding: 0.62rem 0.9rem;
    font-size: 0.78rem;
    color: #1f2b3d;
}

.search-page-input-row input[type="search"]:focus {
    outline: none;
    border-color: #95b3e8;
    box-shadow: 0 0 0 3px rgba(36, 88, 214, 0.12);
}

.search-page-actions {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.search-results-grid {
    margin-top: 0.9rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.8rem;
}

.search-result-group-card {
    padding: 0.85rem;
}

.search-result-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.search-result-row {
    text-decoration: none;
    border: 1px solid #e5ebf5;
    border-radius: 0.7rem;
    padding: 0.55rem 0.66rem;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.search-result-row strong {
    color: #1d2f4a;
    font-size: 0.76rem;
    line-height: 1.2;
}

.search-result-row .muted {
    font-size: 0.68rem;
}

.search-result-row:hover {
    background: #f7faff;
    border-color: #d4e1f3;
}

.friction-matrix-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
    gap: 1rem;
    align-items: start;
}

.friction-matrix-card,
.friction-list-card {
    border: 1px solid #e5ebf4;
    border-radius: 1.5rem;
    background: #fff;
    padding: 1rem;
}

.friction-matrix-card-head h2,
.friction-list-head h2 {
    margin: 0;
    font-family: "Inter", sans-serif;
    font-style: normal;
    font-size: 0.94rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #62789a;
    font-weight: 700;
}

.friction-matrix-card-head p {
    margin: 0.32rem 0 0.7rem;
    font-size: 0.68rem;
    color: #8ea0b8;
}

.friction-matrix-stage {
    position: relative;
    aspect-ratio: 16 / 10;
    border: 1px solid #e6edf7;
    border-radius: 0.9rem;
    overflow: hidden;
    background: #fff;
}

.friction-matrix-quadrants {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    z-index: 0;
}

.friction-quadrant {
    padding: 0.8rem 0.85rem;
    border-right: 1px solid rgba(159, 178, 205, 0.18);
    border-bottom: 1px solid rgba(159, 178, 205, 0.18);
}

.friction-quadrant strong {
    display: block;
    font-family: "Instrument Serif", serif;
    font-size: 0.74rem;
    color: #2b3f60;
    margin-bottom: 0.12rem;
}

.friction-quadrant span {
    font-size: 0.62rem;
    color: #5f7698;
}

.friction-quadrant--high-high {
    background: rgba(162, 185, 222, 0.26);
}

.friction-quadrant--high-low {
    background: rgba(211, 220, 233, 0.38);
    border-right: 0;
}

.friction-quadrant--low-high {
    background: rgba(235, 214, 225, 0.36);
    border-bottom: 0;
}

.friction-quadrant--low-low {
    background: rgba(235, 224, 193, 0.4);
    border-right: 0;
    border-bottom: 0;
}

.friction-matrix-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(191, 204, 224, 0.28) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(191, 204, 224, 0.28) 1px, transparent 1px);
    background-size: calc(100% / 6) calc(100% / 6);
}

.friction-matrix-cross {
    position: absolute;
    background: #d4deeb;
}

.friction-matrix-cross--x {
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
}

.friction-matrix-cross--y {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
}

.friction-axis-label {
    position: absolute;
    z-index: 2;
    color: #7f93b1;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.friction-axis-label--y {
    top: 10%;
    left: calc(50% - 0.72rem);
    transform: rotate(-90deg);
    transform-origin: left center;
}

.friction-axis-label--x {
    top: calc(50% + 0.62rem);
    right: 0.8rem;
    left: auto;
    bottom: auto;
    text-align: right;
}

.friction-axis-hint {
    position: absolute;
    z-index: 2;
    color: #8fa0b9;
    font-size: 0.54rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
}

.friction-axis-hint--x-left {
    bottom: 0.48rem;
    left: 0.62rem;
}

.friction-axis-hint--x-right {
    bottom: 0.48rem;
    right: 3.5rem;
}

.friction-axis-hint--y-top {
    top: 0.5rem;
    left: 2.4rem;
}

.friction-axis-hint--y-bottom {
    bottom: 2.25rem;
    left: 2.4rem;
}

.friction-dot {
    appearance: none;
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    margin-left: calc(var(--size) * -0.5);
    margin-top: calc(var(--size) * -0.5);
    border-radius: 999px;
    border: 1px solid rgba(15, 31, 61, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 3;
    box-shadow: 0 6px 20px -12px rgba(15, 35, 66, 0.55);
    padding: 0;
    cursor: grab;
}

.friction-dot span {
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    line-height: 1;
}

.friction-dot--high {
    background: #12284b;
}

.friction-dot--medium {
    background: #5d7597;
}

.friction-dot--low {
    background: #9aaec9;
}

.friction-dot:hover {
    transform: scale(1.06);
}

.friction-dot.is-dragging {
    cursor: grabbing;
}

.friction-empty {
    position: absolute;
    left: 0.8rem;
    top: 0.8rem;
}

.friction-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.65rem;
}

.friction-list {
    display: grid;
    gap: 0.35rem;
}

.friction-list-row {
    display: grid;
    grid-template-columns: 1.55rem minmax(0, 1fr);
    gap: 0.5rem;
    align-items: start;
    border: 1px solid #edf2f8;
    border-radius: 0.78rem;
    padding: 0.45rem 0.52rem;
}

.friction-list-row:hover {
    border-color: #d2deee;
    background: #f8fbff;
    text-decoration: none;
}

.friction-list-index {
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 999px;
    border: 1px solid #dbe4f1;
    background: #f6f9ff;
    color: #607793;
    font-size: 0.58rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.friction-list-main {
    min-width: 0;
}

.friction-list-main strong {
    display: block;
    color: #1f2f49;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.3;
}

.friction-list-main p {
    margin: 0.16rem 0 0;
    color: #71849e;
    font-size: 0.62rem;
    line-height: 1.35;
}

.friction-list-controls {
    margin-top: 0.32rem;
    display: flex;
    align-items: center;
    gap: 0.38rem;
    flex-wrap: wrap;
}

.friction-list-controls label {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.friction-list-controls label > span {
    font-size: 0.54rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #8ea0b8;
}

.friction-list-controls select {
    border: 1px solid #dbe4f1;
    border-radius: 999px;
    padding: 0.14rem 0.35rem;
    font-size: 0.55rem;
    color: #334b68;
    background: #fff;
}

.friction-list-controls select:focus {
    outline: none;
    border-color: #95b3e8;
    box-shadow: 0 0 0 2px rgba(36, 88, 214, 0.1);
}

.friction-open-link {
    font-size: 0.56rem;
}

.friction-list-scores {
    color: #8ea0b8 !important;
    letter-spacing: 0.04em;
}

@media (max-width: 1100px) {
    .task-filter-grid {
        grid-template-columns: 1fr;
    }

    .friction-filter-grid {
        grid-template-columns: 1fr;
    }

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

    .persona-form-textareas {
        grid-template-columns: 1fr;
    }

    .backend-job-row {
        flex-direction: column;
        align-items: flex-start;
    }

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