/* ==========================================================================
   Projects: a project's page (ProjectDetail.razor) and the faces a project's
   name can be set in, which its card on the Projects page uses as well.
   ========================================================================== */

/* ---- the page frame ------------------------------------------------------ */

/* The page sizes its columns to its own width, not the window's, so the sidebar
   being open or folded is accounted for. */
.pd { container: pd / inline-size; padding-top: 0.85rem; }

.pd-grid { display: grid; gap: 1rem; align-items: start; margin-top: 1rem; }
.pd-main, .pd-side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.pd-main > .card, .pd-side > .card, .pd-pair > .card { margin-bottom: 0; }

@container pd (min-width: 62rem) {
    .pd-grid { grid-template-columns: minmax(0, 1fr) clamp(20rem, 28%, 25rem); }
    .pd-side { position: sticky; top: 0.5rem; }
}

.pd-pair { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }

/* ---- the hero ------------------------------------------------------------ */

.pd-hero {
    --pd-hue: 225;
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: clamp(17rem, 30cqi, 23rem);
    border-radius: 18px;
    overflow: hidden;
    color: #fff;
    border: 1px solid color-mix(in srgb, var(--rl-border) 60%, transparent);
    box-shadow: var(--rl-shadow-md);
    animation: rl-rise 0.24s var(--rl-ease) both;
}

.pd-hero__banner { position: absolute; inset: 0; z-index: -1; background: #0c0e13; }
.pd-hero__banner img, .pd-hero__banner video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Legibility: the top darkens a little for the buttons, the bottom a lot for the name and the stats. */
.pd-hero__banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgb(0 0 0 / 0.35) 0%, rgb(0 0 0 / 0) 26%, rgb(0 0 0 / 0) 40%, rgb(0 0 0 / 0.55) 70%, rgb(0 0 0 / 0.82) 100%);
}

/* A project without a banner gets colours of its own from its id, and a quiet eclipse. */
.pd-hero--art .pd-hero__banner {
    background:
        radial-gradient(55% 85% at 82% 18%, hsl(var(--pd-hue) 85% 62% / 0.55), transparent 62%),
        radial-gradient(45% 75% at 12% 105%, hsl(calc(var(--pd-hue) + 55) 80% 58% / 0.5), transparent 66%),
        radial-gradient(35% 55% at 48% -10%, hsl(calc(var(--pd-hue) - 40) 80% 60% / 0.35), transparent 70%),
        linear-gradient(135deg, hsl(var(--pd-hue) 50% 16%), hsl(calc(var(--pd-hue) + 35) 55% 8%));
}

.pd-hero--art .pd-hero__banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgb(255 255 255 / 0.16) 1px, transparent 1.4px);
    background-size: 22px 22px;
    mask-image: linear-gradient(90deg, transparent 0%, #000 45%, #000 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 45%, #000 100%);
}

.pd-hero__orb {
    position: absolute;
    top: 40%;
    right: 17%;
    width: clamp(7rem, 17cqi, 13rem);
    aspect-ratio: 1;
    border-radius: 50%;
    transform: translateY(-50%);
    background: radial-gradient(circle at 38% 36%, hsl(var(--pd-hue) 40% 13%), hsl(var(--pd-hue) 45% 5%) 70%);
    box-shadow:
        0 0 0 1.5px hsl(var(--pd-hue) 95% 82% / 0.75),
        0 0 28px 6px hsl(var(--pd-hue) 95% 70% / 0.45),
        0 0 90px 24px hsl(calc(var(--pd-hue) + 40) 90% 60% / 0.3);
    animation: pd-glow 7s ease-in-out infinite alternate;
}

@keyframes pd-glow {
    from { box-shadow: 0 0 0 1.5px hsl(var(--pd-hue) 95% 82% / 0.7), 0 0 24px 5px hsl(var(--pd-hue) 95% 70% / 0.4), 0 0 80px 20px hsl(calc(var(--pd-hue) + 40) 90% 60% / 0.25); }
    to   { box-shadow: 0 0 0 1.5px hsl(var(--pd-hue) 95% 86% / 0.85), 0 0 34px 8px hsl(var(--pd-hue) 95% 72% / 0.55), 0 0 110px 30px hsl(calc(var(--pd-hue) + 40) 90% 62% / 0.36); }
}

.pd-hero__top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.85rem 1rem 0; }

.pd-glass {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgb(255 255 255 / 0.2);
    border-radius: 999px;
    background: rgb(10 12 18 / 0.42);
    backdrop-filter: blur(10px) saturate(1.3);
    -webkit-backdrop-filter: blur(10px) saturate(1.3);
    color: #fff;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--rl-dur), border-color var(--rl-dur), transform var(--rl-dur) var(--rl-ease);
}
.pd-glass:hover { background: rgb(10 12 18 / 0.62); border-color: rgb(255 255 255 / 0.36); color: #fff; }
.pd-glass:active { transform: scale(0.97); }
.pd-glass:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.pd-glass svg { width: 1rem; height: 1rem; }
.pd-crumb svg { transform: rotate(180deg); }

.pd-hero__body {
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    padding: 2.5rem 1.5rem 1.1rem;
}

.pd-icon {
    position: relative;
    flex: none;
    width: clamp(5rem, 9cqi, 7.25rem);
    aspect-ratio: 1;
    padding: 0;
    border: 3px solid rgb(255 255 255 / 0.9);
    border-radius: 24%;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(140deg, hsl(var(--pd-hue) 70% 55%), hsl(calc(var(--pd-hue) + 50) 70% 42%));
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.45);
    transition: transform var(--rl-dur) var(--rl-ease), box-shadow var(--rl-dur);
}
.pd-icon:hover { transform: translateY(-2px) rotate(-1.5deg); box-shadow: 0 14px 36px rgb(0 0 0 / 0.55); }
.pd-icon:focus-visible { outline: 3px solid var(--rl-accent); outline-offset: 3px; }
.pd-icon img, .pd-icon video { width: 100%; height: 100%; object-fit: cover; display: block; }

.pd-icon__initials {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #fff;
    font-size: clamp(1.6rem, 3cqi, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgb(0 0 0 / 0.3);
}

.pd-icon__edit {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgb(0 0 0 / 0.5);
    opacity: 0;
    transition: opacity var(--rl-dur);
}
.pd-icon__edit svg { width: 1.6rem; height: 1.6rem; color: #fff; }
.pd-icon:hover .pd-icon__edit, .pd-icon:focus-visible .pd-icon__edit { opacity: 1; }

.pd-hero__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }

/* The name and the description are inputs that read as a heading and a line of text until they are pointed at. */
.pd-hero__name, .pd-hero__desc {
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 0 -0.45rem;
    padding: 0.1rem 0.45rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #fff;
    text-overflow: ellipsis;
    transition: background var(--rl-dur), border-color var(--rl-dur);
}
.pd-hero__name {
    font-family: var(--rl-font);
    font-size: clamp(1.75rem, 4.2cqi, 3rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 18px rgb(0 0 0 / 0.45);
}
.pd-hero__desc { font: inherit; font-size: 1rem; color: rgb(255 255 255 / 0.88); text-shadow: 0 1px 8px rgb(0 0 0 / 0.5); }
.pd-hero__name::placeholder, .pd-hero__desc::placeholder { color: rgb(255 255 255 / 0.55); }
.pd-hero__name:hover, .pd-hero__desc:hover { border-color: rgb(255 255 255 / 0.22); background: rgb(0 0 0 / 0.16); }
.pd-hero__name:focus, .pd-hero__desc:focus {
    outline: none;
    border-color: rgb(255 255 255 / 0.5);
    background: rgb(8 10 16 / 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.pd-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.35rem 0 0; padding: 0; }
.pd-chip {
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    background: rgb(255 255 255 / 0.14);
    border: 1px solid rgb(255 255 255 / 0.16);
    font-size: 0.76rem;
    color: rgb(255 255 255 / 0.92);
    white-space: nowrap;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.pd-chip code { color: inherit; background: none; padding: 0; font-size: 0.74rem; }
.pd-chip--owner { background: color-mix(in srgb, var(--rl-accent) 55%, transparent); border-color: color-mix(in srgb, var(--rl-accent) 80%, #fff 10%); font-weight: 600; }

.pd-hero__actions { flex: none; display: flex; gap: 0.5rem; align-items: center; }
.pd-cta { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1rem; border-radius: 999px; box-shadow: 0 6px 20px rgb(0 0 0 / 0.35); }
.pd-cta svg { width: 1rem; height: 1rem; }

.pd-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 2rem;
    margin: 0;
    padding: 0.6rem 1.5rem 0.7rem;
    background: rgb(6 8 12 / 0.45);
    border-top: 1px solid rgb(255 255 255 / 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.pd-stats div { display: flex; flex-direction: column-reverse; }
.pd-stats dt { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgb(255 255 255 / 0.62); }
.pd-stats dd { margin: 0; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pd-stats dd a { color: #fff; text-decoration: none; border-bottom: 1px dashed rgb(255 255 255 / 0.5); }
.pd-stats dd a:hover { border-bottom-style: solid; }

@container pd (max-width: 40rem) {
    .pd-hero__body { flex-wrap: wrap; padding: 1.75rem 1rem 0.9rem; gap: 0.85rem; }
    .pd-hero__text { flex-basis: calc(100% - 6.5rem); }
    .pd-hero__actions { flex-basis: 100%; }
    .pd-cta { flex: 1; justify-content: center; }
    .pd-stats { gap: 0.25rem 1.25rem; padding: 0.55rem 1rem; }
    .pd-hero__orb { width: 8rem; right: -2.75rem; top: 38%; opacity: 0.7; }
}

/* ---- cards --------------------------------------------------------------- */

.pd-card { display: flex; flex-direction: column; gap: 0.55rem; padding: 1rem 1.1rem; }
.pd-card__head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.pd-card__head h2 { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 1rem; }
.pd-card__head h2 > svg {
    width: 1.7rem;
    height: 1.7rem;
    padding: 0.3rem;
    box-sizing: border-box;
    border-radius: 8px;
    color: var(--rl-accent);
    background: color-mix(in srgb, var(--rl-accent) 14%, transparent);
}
.pd-card .card__actions { gap: 0.4rem; }
/* Phones give every .btn a taller touch target; keep the label in the middle of it. */
.pd-card__head > .btn, .pd-card__head .card__actions > .btn, .pd-danger > .btn, .pd-savebar .btn { display: inline-flex; align-items: center; justify-content: center; }

.pd-sub { margin: 0; color: var(--rl-text-muted); font-size: 0.84rem; line-height: 1.45; }
.pd-empty { margin: 0; padding: 0.85rem 1rem; border: 1px dashed var(--rl-border); border-radius: 10px; color: var(--rl-text-muted); font-size: 0.88rem; }
.pd-more { margin: 0; color: var(--rl-text-muted); font-size: 0.8rem; }
.pd-count {
    min-width: 1.4rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: var(--rl-surface-sunken);
    color: var(--rl-text-muted);
    font-size: 0.74rem;
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.pd-h3 { display: flex; align-items: center; gap: 0.45rem; margin: 0.6rem 0 0.1rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rl-text-muted); }

.pd-text {
    width: 100%;
    box-sizing: border-box;
    min-height: 11rem;
    flex: 1;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--rl-border);
    border-radius: 10px;
    background: var(--rl-surface-raised);
    color: var(--rl-text);
    font: inherit;
    font-size: 0.92rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color var(--rl-dur), box-shadow var(--rl-dur), background-color var(--rl-dur);
}
.pd-text:focus-visible { outline: none; border-color: var(--rl-accent); background: var(--rl-surface); box-shadow: var(--rl-ring); }
.pd-text::placeholder { color: var(--rl-text-muted); opacity: 0.75; }

.pd-notes.notes__preview {
    min-height: 11rem;
    box-sizing: border-box;
    margin: 0;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--rl-border);
    border-radius: 10px;
    background: var(--rl-surface-raised);
    cursor: text;
    overflow-wrap: anywhere;
}
.pd-notes .pd-empty { border: 0; padding: 0; }

.pd-tabs { display: inline-flex; padding: 0.15rem; border-radius: 999px; background: var(--rl-surface-sunken); }
.pd-tabs button {
    padding: 0.2rem 0.7rem;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--rl-text-muted);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--rl-dur), color var(--rl-dur);
}
.pd-tabs button.is-on { background: var(--rl-surface); color: var(--rl-text); box-shadow: var(--rl-shadow-sm); }
.pd-tabs button:focus-visible { outline: 2px solid var(--rl-accent); outline-offset: 1px; }

/* Rows of inputs that add something: they share the row and the widest one takes the slack. */
.pd-addrow { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.pd-addrow input, .pd-addrow select, .pd-serverActions select, .pd-people__role {
    min-height: var(--rl-control-h);
    box-sizing: border-box;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--rl-border);
    border-radius: 8px;
    background: var(--rl-surface-raised);
    color: var(--rl-text);
    font: inherit;
    font-size: 0.9rem;
}
.pd-addrow input { flex: 1 1 9rem; min-width: 0; }
.pd-addrow .pd-addrow__wide { flex: 3 1 14rem; }
.pd-addrow input:focus-visible, .pd-addrow select:focus-visible, .pd-serverActions select:focus-visible, .pd-people__role:focus-visible {
    outline: none;
    border-color: var(--rl-accent);
    box-shadow: var(--rl-ring);
}

.pd-tableWrap { overflow-x: auto; border: 1px solid var(--rl-border); border-radius: 10px; }
.pd-tableWrap .table { margin: 0; }
.pd-tableWrap .table th { background: var(--rl-surface-raised); font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; }
.pd-tableWrap .table tr:last-child td { border-bottom: 0; }
.pd-tableWrap code { overflow-wrap: anywhere; }

.pd-repo { display: flex; flex-wrap: wrap; gap: 0.35rem 0.85rem; align-items: center; margin: 0; font-size: 0.88rem; }
.pd-repo a { overflow-wrap: anywhere; }

.pd-form { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.pd-form .field { max-width: none; }
.pd-form__full { grid-column: 1 / -1; }

.pd-live { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 700; color: var(--rl-ok); }
.pd-live::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; animation: pd-pulse 1.4s ease-in-out infinite; }
@keyframes pd-pulse { 50% { opacity: 0.35; transform: scale(0.8); } }

.pd-run { display: flex; flex-direction: column; gap: 0.4rem; }
.pd-run__bar { height: 0.45rem; border-radius: 999px; background: var(--rl-surface-sunken); overflow: hidden; }
.pd-run__bar::before {
    content: "";
    display: block;
    height: 100%;
    width: calc(var(--pd-run, 0) * 100%);
    border-radius: inherit;
    background: linear-gradient(90deg, var(--rl-accent), color-mix(in srgb, var(--rl-accent) 50%, var(--rl-ok)));
    transition: width 0.4s var(--rl-ease);
}

/* ---- conversations ------------------------------------------------------- */

.pd-convos { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.pd-convos a {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    height: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--rl-border);
    border-radius: 10px;
    background: var(--rl-surface-raised);
    color: var(--rl-text);
    text-decoration: none;
    transition: border-color var(--rl-dur), background var(--rl-dur), transform var(--rl-dur) var(--rl-ease);
}
.pd-convos a:hover { border-color: color-mix(in srgb, var(--rl-accent) 55%, var(--rl-border)); background: var(--rl-surface); transform: translateY(-1px); }
.pd-convos a:focus-visible { outline: 2px solid var(--rl-accent); outline-offset: 2px; }
.pd-convos__title { display: flex; align-items: center; gap: 0.35rem; font-weight: 600; font-size: 0.9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-convos__meta { display: flex; flex-wrap: wrap; gap: 0 0.5rem; color: var(--rl-text-muted); font-size: 0.76rem; }
.pd-convos__meta > * + *::before { content: "·"; margin-right: 0.5rem; }

/* ---- spaces -------------------------------------------------------------- */

.pd-space {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.65rem;
    border: 1px solid var(--rl-border);
    border-radius: 12px;
    background: var(--rl-surface-raised);
    color: var(--rl-text);
    text-decoration: none;
    transition: border-color var(--rl-dur), background var(--rl-dur), transform var(--rl-dur) var(--rl-ease);
}
a.pd-space:hover { border-color: color-mix(in srgb, var(--rl-accent) 55%, var(--rl-border)); background: var(--rl-surface); }
a.pd-space:hover .pd-space__go { transform: translateX(2px); color: var(--rl-accent); }
a.pd-space:focus-visible { outline: 2px solid var(--rl-accent); outline-offset: 2px; }
.pd-space--empty { border-style: dashed; background: none; }
.pd-space--small { padding: 0.45rem 0.6rem; }

.pd-space__icon { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 10px; color: #fff; }
.pd-space--small .pd-space__icon { width: 1.9rem; height: 1.9rem; border-radius: 8px; }
.pd-space__icon svg { width: 1.2rem; height: 1.2rem; }
.pd-space--small .pd-space__icon svg { width: 1rem; height: 1rem; }
.pd-space__icon--board { background: linear-gradient(140deg, #f59e0b, #ef4444); }
.pd-space__icon--server { background: linear-gradient(140deg, #8b5cf6, #3b82f6); }
.pd-space__icon--kanban { background: linear-gradient(140deg, #10b981, #0ea5e9); }
.pd-space--empty .pd-space__icon { filter: grayscale(1); opacity: 0.6; }

.pd-space__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.05rem; }
.pd-space__text strong { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-space__text small { color: var(--rl-text-muted); font-size: 0.76rem; line-height: 1.35; }
.pd-space__go { flex: none; width: 1rem; height: 1rem; color: var(--rl-text-muted); transition: transform var(--rl-dur) var(--rl-ease), color var(--rl-dur); }

.pd-serverActions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.pd-serverActions select { flex: 1 1 10rem; min-width: 0; min-height: 0; padding: 0.25rem 0.5rem; font-size: 0.85rem; }

.pd-linkbtn { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--rl-text-muted); font: inherit; font-size: 0.8rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.pd-linkbtn:hover { color: var(--rl-danger); }

.pd-confirm { padding: 0.65rem 0.75rem; border: 1px solid color-mix(in srgb, var(--rl-danger) 45%, var(--rl-border)); border-radius: 10px; background: color-mix(in srgb, var(--rl-danger) 7%, transparent); }
.pd-confirm p { margin: 0 0 0.5rem; font-size: 0.82rem; }

/* ---- members ------------------------------------------------------------- */

.pd-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pd-people li { display: flex; align-items: center; gap: 0.65rem; padding: 0.45rem 0; border-bottom: 1px solid var(--rl-border); }
.pd-people li:last-child { border-bottom: 0; }
.pd-avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: linear-gradient(140deg, hsl(var(--pd-hue) 65% 55%), hsl(calc(var(--pd-hue) + 45) 65% 42%));
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}
.pd-people__name { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; }
.pd-people__name strong { font-size: 0.88rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-people__name small { color: var(--rl-text-muted); font-size: 0.76rem; }
.pd-people__role.pd-people__role { min-height: 0; padding: 0.05rem 0.4rem; font-size: 0.76rem; border-radius: 6px; }

.pd-side .invite__row { flex-wrap: wrap; }
.pd-side .invite__pick { flex: 1 1 100%; }

.pd-danger { border-color: color-mix(in srgb, var(--rl-danger) 35%, var(--rl-border)); }
.pd-danger .pd-card__head h2 > svg { color: var(--rl-danger); background: color-mix(in srgb, var(--rl-danger) 12%, transparent); }
.pd-danger .btn { align-self: flex-start; }

/* ---- the save bar and the toast ------------------------------------------ */

.pd-savebar {
    position: sticky;
    bottom: 1rem;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: fit-content;
    max-width: calc(100% - 1rem);
    margin: 1rem auto 0;
    padding: 0.5rem 0.6rem 0.5rem 1rem;
    border: 1px solid var(--rl-border-strong);
    border-radius: 999px;
    background: color-mix(in srgb, var(--rl-surface-raised) 88%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--rl-shadow-lg);
    animation: pd-up 0.22s var(--rl-ease-out) both;
}
.pd-savebar__dot { flex: none; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #e3b341; box-shadow: 0 0 0 4px rgb(227 179 65 / 0.2); }
.pd-savebar__text { font-size: 0.86rem; min-width: 0; }
.pd-savebar .btn { border-radius: 999px; flex: none; }

@keyframes pd-up { from { opacity: 0; transform: translateY(12px) scale(0.98); } }

.pd-toast {
    position: fixed;
    z-index: 70;
    top: 1rem;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: min(34rem, calc(100vw - 2rem));
    padding: 0.55rem 0.55rem 0.55rem 0.95rem;
    border: 1px solid var(--rl-border);
    border-left-width: 4px;
    border-radius: 10px;
    background: var(--rl-surface-raised);
    color: var(--rl-text);
    box-shadow: var(--rl-shadow-lg);
    font-size: 0.88rem;
    transform: translateX(-50%);
    animation: pd-drop 0.22s var(--rl-ease-out) both;
}
.pd-toast--ok { border-left-color: var(--rl-ok); }
.pd-toast--bad { border-left-color: var(--rl-danger); }
.pd-toast button { flex: none; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--rl-text-muted); cursor: pointer; }
.pd-toast button:hover { background: var(--rl-surface-sunken); color: var(--rl-text); }
.pd-toast svg { width: 0.95rem; height: 0.95rem; }

@keyframes pd-drop { from { opacity: 0; transform: translate(-50%, -10px); } }

/* ---- the Customize panel ------------------------------------------------- */

/* Light scrim, so the hero behind it stays visible: that is where a change shows first. */
.pd-look__scrim { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / 0.18); animation: rl-fade 0.15s ease-out both; }

.pd-look {
    position: fixed;
    z-index: 41;
    top: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    width: min(27rem, calc(100vw - 1.5rem));
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1rem 1.1rem 1.25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--rl-border);
    border-radius: 16px;
    background: var(--rl-surface);
    box-shadow: var(--rl-shadow-lg);
    animation: pd-slide 0.24s var(--rl-ease-out) both;
}
.pd-look:focus { outline: none; }
@keyframes pd-slide { from { opacity: 0; transform: translateX(24px); } }

.pd-look__head { display: flex; align-items: center; justify-content: space-between; }
.pd-look__head h2 { margin: 0; font-size: 1.1rem; }
.pd-look__close { display: grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--rl-text-muted); cursor: pointer; }
.pd-look__close:hover { background: var(--rl-surface-sunken); color: var(--rl-text); }
.pd-look__close svg { width: 1.1rem; height: 1.1rem; }

.pd-look__section { padding-top: 0.35rem; border-top: 1px solid var(--rl-border); margin-top: 0.4rem; }
.pd-look .cs-pick { margin: 0.5rem 0 0.25rem; align-items: flex-start; }
.pd-look .cs-pick--round .cs-pick__preview { border-radius: 24%; }
.pd-look .cs-pick--wide .cs-pick__preview { width: 9.5rem; height: 3.6rem; }
.pd-look .cs-pick__side small { font-size: 0.74rem; line-height: 1.4; }
.pd-look .cs-pick__btns .btn { display: inline-flex; align-items: center; justify-content: center; }

.pd-fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; margin-top: 0.5rem; }
.pd-font {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    min-width: 0;
    padding: 0.55rem 0.65rem 0.45rem;
    border: 1px solid var(--rl-border);
    border-radius: 10px;
    background: var(--rl-surface-raised);
    color: var(--rl-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--rl-dur), background var(--rl-dur), transform var(--rl-dur) var(--rl-ease);
}
.pd-font:hover:not(:disabled) { border-color: color-mix(in srgb, var(--rl-accent) 50%, var(--rl-border)); transform: translateY(-1px); }
.pd-font:focus-visible { outline: 2px solid var(--rl-accent); outline-offset: 2px; }
.pd-font:disabled { cursor: progress; }
.pd-font.is-on { border-color: var(--rl-accent); background: color-mix(in srgb, var(--rl-accent) 12%, var(--rl-surface-raised)); box-shadow: inset 0 0 0 1px var(--rl-accent); }
.pd-font__sample { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.pd-font small { color: var(--rl-text-muted); font-size: 0.72rem; }

@media (prefers-reduced-motion: reduce) {
    .pd-hero__orb, .pd-live::before { animation: none; }
    .pd-icon:hover, .pd-convos a:hover, .pd-font:hover:not(:disabled) { transform: none; }
}

/* ---- the faces a project's name can be set in -----------------------------
   One rule per key in Ripllm.Core.Projects.ProjectTitleFonts (a test checks the
   two match). The class is doubled so it outranks the rules that style a name
   where it sits (.pd-hero__name, .project__title a). Every stack ends in a
   generic family of the same character, for a reader without the first choice. */

.project-font--modern.project-font--modern     { font-family: Bahnschrift, "DIN Alternate", "DIN Condensed", "Arial Narrow", sans-serif; font-weight: 600; letter-spacing: -0.005em; }
.project-font--heavy.project-font--heavy       { font-family: "Arial Black", "Segoe UI Black", "Helvetica Neue", Arial, sans-serif; font-weight: 900; letter-spacing: -0.02em; }
.project-font--poster.project-font--poster     { font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Franklin Gothic Bold", sans-serif; font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em; }
.project-font--wide.project-font--wide         { font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif; font-weight: 300; text-transform: uppercase; letter-spacing: 0.16em; }
.project-font--serif.project-font--serif       { font-family: Georgia, Cambria, "Times New Roman", serif; font-weight: 700; letter-spacing: -0.01em; }
.project-font--book.project-font--book         { font-family: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", serif; font-weight: 400; font-style: italic; }
.project-font--engraved.project-font--engraved { font-family: "Copperplate Gothic Bold", "Copperplate Gothic", Copperplate, "Felix Titling", serif; font-weight: 400; text-transform: uppercase; letter-spacing: 0.06em; }
.project-font--slab.project-font--slab         { font-family: Rockwell, "Rockwell Nova", "Roboto Slab", "Sitka Heading", Georgia, serif; font-weight: 700; }
.project-font--rounded.project-font--rounded   { font-family: ui-rounded, "Arial Rounded MT Bold", "Varela Round", Nunito, "Segoe UI", sans-serif; font-weight: 700; }
.project-font--code.project-font--code         { font-family: "Cascadia Code", "Cascadia Mono", "SF Mono", Consolas, ui-monospace, monospace; font-weight: 600; letter-spacing: -0.03em; }
.project-font--hand.project-font--hand         { font-family: "Ink Free", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; font-weight: 400; }
.project-font--script.project-font--script     { font-family: "Segoe Script", "Brush Script MT", "Snell Roundhand", "Apple Chancery", cursive; font-weight: 400; }
.project-font--stencil.project-font--stencil   { font-family: Stencil, "Stencil Std", Impact, sans-serif; font-weight: 400; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- starting a tool from the project, and the project's assets pane ---------------------------------------------------------- */
.pd > .apane { margin-top: 1rem; }
.pd-cta--tools { background: rgb(255 255 255 / 0.14); color: #fff; border-color: rgb(255 255 255 / 0.28); backdrop-filter: blur(6px); }
.pd-cta--tools:hover { background: rgb(255 255 255 / 0.24); color: #fff; }
.pd-tools { display: flex; flex-direction: column; gap: 0.7rem; }
.pd-tools__group h3 { margin: 0 0 0.35rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--rl-text-muted); }
.pd-tools__row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pd-tool {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.7rem 0.35rem 0.5rem; border: 1px solid var(--rl-border);
    border-radius: 999px; background: var(--rl-surface-raised); color: var(--rl-text); font-size: 0.84rem; text-decoration: none;
    transition: border-color var(--rl-dur), background var(--rl-dur), transform var(--rl-dur) var(--rl-ease);
}
.pd-tool svg { width: 1rem; height: 1rem; color: var(--rl-accent); flex: none; }
.pd-tool:hover { border-color: var(--rl-accent); background: color-mix(in srgb, var(--rl-accent) 10%, var(--rl-surface-raised)); transform: translateY(-1px); }

/* ---- A project's face wherever it is named (Layout/ProjectIcon.razor, Layout/ProjectBanner.razor) ----------------------
   The icon uploaded for it, or its initials on the gradient its card and page use; the banner, or its generated art. The
   hue comes in as --pd-hue on the element itself. */
.proj-icon {
    --proj-icon: 1.4rem;
    display: inline-grid; place-items: center; flex: none; vertical-align: middle;
    width: var(--proj-icon); height: var(--proj-icon); border-radius: 26%; overflow: hidden;
    background: var(--rl-surface-sunken); box-shadow: 0 0 0 1px color-mix(in srgb, var(--rl-text) 10%, transparent);
}
.proj-icon img, .proj-icon video { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Reason: doubled so it outranks a row's "span { flex: 1 }" (.tmenu__item span), which would stretch the icon along the row. */
.proj-icon.proj-icon { flex: none; }
.proj-icon--initials {
    background: linear-gradient(140deg, hsl(var(--pd-hue) 70% 55%), hsl(calc(var(--pd-hue) + 50) 70% 42%));
    box-shadow: none; color: #fff; font-weight: 700; line-height: 1; letter-spacing: 0.02em; text-transform: none;
    font-size: calc(var(--proj-icon) * 0.42); text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);
}
.proj-icon--xs { --proj-icon: 1.05rem; border-radius: 30%; }
.proj-icon--xs.proj-icon--initials { font-size: 0.62rem; letter-spacing: 0; }
.proj-icon--sm { --proj-icon: 1.4rem; }
.proj-icon--md { --proj-icon: 2.1rem; }
.proj-icon--lg { --proj-icon: 2.9rem; border-radius: 24%; }

.proj-banner { position: relative; display: block; overflow: hidden; background: var(--rl-surface-sunken); }
.proj-banner img, .proj-banner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.proj-banner--art {
    background:
        radial-gradient(55% 85% at 82% 18%, hsl(var(--pd-hue) 85% 62% / 0.55), transparent 62%),
        radial-gradient(45% 75% at 12% 105%, hsl(calc(var(--pd-hue) + 55) 80% 58% / 0.5), transparent 66%),
        linear-gradient(135deg, hsl(var(--pd-hue) 50% 16%), hsl(calc(var(--pd-hue) + 35) 55% 8%));
}

/* Where the face is used: beside the Library's title when it shows one project's files, and on a project's tile on the
   Whiteboards page, where the banner tops the tile and the icon sits half on it. */
.library__projectIcon { margin: -0.2rem 0.55rem 0 0; }
/* Doubled: whiteboard.css's .wbi-tile padding may load after this file. */
.wbi-tile.wbi-tile--project { padding-top: 0; overflow: hidden; }
.wbi-tile__banner { height: 4.5rem; margin: 0 -0.95rem; }
/* Positioned so the icon paints over the banner (itself positioned) rather than under it. Only the icon rises onto the
   banner; a long name wraps down, below it. */
.wbi-tile__head { position: relative; display: flex; align-items: flex-start; gap: 0.6rem; }
.wbi-tile__head .proj-icon { margin-top: -1.35rem; box-shadow: 0 0 0 2px var(--rl-surface), 0 3px 8px rgb(0 0 0 / 0.3); }
.wbi-tile__head h3 { min-width: 0; padding-top: 0.3rem; overflow-wrap: anywhere; }
