/* Slot Template Global Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --rail-width: 360px;
    --nav-height: 64px;
    --transition-speed: 0.3s;
    --z-nav: 1000;
    --z-rail: 900;
    --z-overlay: 800;
    --z-toast: 2000;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   SLOT 1: Top Navigation
   ======================================== */
#slot-nav {
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: var(--z-nav);
    height: var(--nav-height);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* the logo goes to the home page, the chat (owner 2026-10-27) */
.logo__link { text-decoration: none; color: inherit; cursor: pointer; }

.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-color);
    transition: background var(--transition-speed), color var(--transition-speed);
}

.nav-icon-btn:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.nav-icon-btn.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--error-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.user-profile .btn { white-space: nowrap; flex: 0 0 auto; }

.user-name {
    font-weight: 600;
    color: var(--text-color);
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ========================================
   Layout Wrapper (rails + main)
   ======================================== */
#slot-layout {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* ========================================
   SLOT 2: Main Content
   ======================================== */
#slot-main {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    overflow-y: auto;
}

/* ========================================
   SLOT 3 & 4: Rails (Right & Left)
   ======================================== */
.rail {
    position: fixed;
    top: var(--nav-height);
    bottom: 0;
    width: var(--rail-width);
    background: white;
    z-index: var(--z-rail);
    transition: transform var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rail--left {
    left: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.rail--right {
    right: 0;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

.rail--closed.rail--left {
    transform: translateX(-100%);
}

.rail--closed.rail--right {
    transform: translateX(100%);
}

.rail--open {
    transform: translateX(0);
}

.rail__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.rail__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
}

.rail__close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 6px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.rail__close-btn:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.rail__content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* ========================================
   Left Rail Navigation Menu
   ======================================== */
/* ========================================
   Team Switcher
   ======================================== */

.team-switcher {
    position: relative;
    margin: 0 -0.5rem 1rem -0.5rem;
    padding: 0 0.75rem 0.75rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.team-switcher__current {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    padding: 0.375rem 0.5rem;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: left;
    transition: background 0.15s;
}

.team-switcher__current:hover {
    background: rgba(102, 126, 234, 0.08);
}

.team-switcher__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-switcher__chevron {
    flex-shrink: 0;
    opacity: 0.5;
    transition: transform 0.2s;
}

.team-switcher__current[aria-expanded="true"] .team-switcher__chevron {
    transform: rotate(180deg);
}

.team-switcher__dropdown {
    position: absolute;
    top: calc(100% - 0.5rem);
    left: 0.25rem;
    right: 0.25rem;
    z-index: 200;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.team-switcher__list {
    list-style: none;
    margin: 0;
    padding: 0.375rem 0;
    max-height: 240px;
    overflow-y: auto;
}

.team-switcher__option {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    text-align: left;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.12s;
}

.team-switcher__option:hover {
    background: var(--bg-color);
}

.team-switcher__item--active .team-switcher__option {
    font-weight: 600;
    color: var(--primary-color);
}

/* ========================================
   Team Settings Page
   ======================================== */

.team-settings-page {
    max-width: 560px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.team-settings-page__header {
    margin-bottom: 2rem;
}

.team-settings-page__header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.team-settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.form-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text-color);
    cursor: pointer;
    max-width: 200px;
    transition: border-color 0.15s;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.form-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.team-settings__value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 0.5rem;
}

.team-settings__status {
    font-size: 0.85rem;
}

.team-settings__status--success {
    color: var(--success-color);
}

.team-settings__status--error {
    color: var(--error-color);
}

.team-settings-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.team-settings-section__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
}

.team-settings-section__desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
}

.domains-list {
    margin-bottom: 0.75rem;
}

.domains-list__empty {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem;
}

.domain-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-color);
}

.domain-row__name {
    flex: 1;
    font-size: 0.9rem;
    font-family: monospace;
    color: var(--text-primary);
}

.domain-row__remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

.domain-row__remove:hover {
    background: var(--error-color);
    color: #fff;
}

.add-domain-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.form-input {
    flex: 1;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.nav-menu {
    margin: -0.5rem;
}

.nav-menu__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu__item {
    margin-bottom: 2px;
}

.nav-menu__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.nav-menu__link:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.nav-menu__link.active {
    background: #eff6ff;
    color: var(--primary-color);
}

.nav-menu__icon {
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-menu__link:hover .nav-menu__icon,
.nav-menu__link.active .nav-menu__icon {
    opacity: 1;
}

/* ========================================
   Overlay (mobile rail backdrop)
   ======================================== */
.slot-overlay {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: calc(var(--z-rail) - 1);
    opacity: 0;
    transition: opacity var(--transition-speed);
    pointer-events: none;
}

.slot-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}

/* ========================================
   SLOT 5: Toast Notifications
   ======================================== */
#slot-toast {
    position: fixed;
    top: calc(var(--nav-height) + 1rem);
    right: 2rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: calc(100vh - var(--nav-height) - 2rem);
    overflow-y: auto;
    pointer-events: none;
}

.toast {
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-color);
    min-width: 300px;
    animation: slideIn 0.3s ease;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast--exiting {
    animation: slideOut 0.3s ease forwards;
}

.toast__title {
    font-weight: 700;
    font-size: 0.9rem;
}

.toast__message {
    font-size: 0.85rem;
    color: #64748b;
}

.toast__dismiss {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.toast__dismiss:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ========================================
   SLOT 6: Footer
   ======================================== */
#slot-footer {
    background: #f1f5f9;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    text-align: center;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

#slot-footer p {
    color: #64748b;
    font-size: 0.9rem;
}

/* ========================================
   Loading State
   ======================================== */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    font-size: 1.2rem;
    color: #94a3b8;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    margin-left: 1rem;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Error State
   ======================================== */
.error-message {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.error-message h2 {
    color: var(--error-color);
    margin-bottom: 1rem;
}

.error-message p {
    color: #64748b;
    margin-bottom: 2rem;
}

.error-message button {
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.error-message button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   Login / Signup
   ======================================== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.btn-login {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.login-error {
    color: var(--error-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* ========================================
   Dashboard
   ======================================== */
.dashboard {
    text-align: center;
    padding: 3rem 1rem;
}

.dashboard h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.dashboard > p {
    color: #64748b;
    margin-bottom: 2.5rem;
}

.dashboard-cards {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 2rem;
    width: 260px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.dashboard-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.dashboard-card p {
    color: #64748b;
    font-size: 0.9rem;
}

.dashboard-card--create {
    border: 2px dashed var(--primary-color);
    background: #f0f7ff;
}

.dashboard-card--create h3 {
    color: var(--primary-color);
}

.dashboard-card .board-meta {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Count Repair Notifications */
.count-repair-notifications {
    margin-bottom: 1rem;
}

.count-repair-notification {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #92400e;
}

.count-repair-notification span {
    flex: 1;
}

.count-repair-notification .btn-recount {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.count-repair-notification .btn-recount:hover {
    opacity: 0.9;
}

.count-repair-notification .btn-dismiss {
    background: transparent;
    color: #92400e;
    border: 1px solid #d97706;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.count-repair-notification .btn-dismiss:hover {
    background: #fde68a;
}

/* ========================================
   Board Component
   ======================================== */

/* Board List View */
.board-list-view {
    max-width: 1000px;
    margin: 0 auto;
}

.board-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.board-list-header h2 {
    font-size: 1.5rem;
}

.btn-create-board {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-create-board:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.board-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.board-list-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
}

.board-list-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.board-list-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.board-list-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.board-list-card p {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.board-list-card__meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #94a3b8;
}

.board-list-card__role {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: capitalize;
}

/* Custom element display */
board-component,
card-component,
task-component {
    display: block;
    width: 100%;
}

/* Kanban Board View */
.board-kanban {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--nav-height) - 6rem);
}

.board-kanban__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.board-kanban__header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-back-boards {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-back-boards:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.board-kanban__title {
    font-size: 1.4rem;
}

.board-kanban__title--linked {
    color: var(--primary-color);
    cursor: pointer;
}

.board-kanban__title--linked:hover {
    text-decoration: underline;
}

.board-kanban__title-input {
    font-size: 1.4rem;
    font-weight: 600;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    padding: 4px 10px;
    background: transparent;
    color: var(--text-color);
    outline: none;
    min-width: 200px;
}

.board-kanban__title-input:focus {
    border-color: var(--primary-color);
    background: white;
}

.board-unsaved-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--warning-color);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-save-board {
    padding: 8px 20px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-save-board:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-edit-board {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    border-radius: 6px;
    color: #94a3b8;
    transition: all 0.2s;
}

.btn-edit-board:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.board-kanban__header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.board-kanban__members {
    display: flex;
    align-items: center;
}

.board-member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -8px;
    border: 2px solid white;
    cursor: default;
}

.board-member-avatar:first-child {
    margin-left: 0;
}

.board-member-avatar--more {
    background: #94a3b8;
    font-size: 0.7rem;
}

.btn-invite-member,
.btn-create-project,
.btn-board-project,
.btn-add-column {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-invite-member:hover,
.btn-create-project:hover,
.btn-board-project:hover,
.btn-add-column:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Columns Container */
.board-columns {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    flex: 1;
    padding-bottom: 1rem;
    align-items: flex-start;
}

.board-columns::-webkit-scrollbar {
    height: 8px;
}

.board-columns::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.board-columns::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Column */
.board-column {
    min-width: 280px;
    max-width: 320px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.board-column--dragging {
    opacity: 0.4;
    border: 2px dashed var(--primary-color);
    transform: scale(0.97);
}

.board-column--drop-left {
    border-left: 3px solid var(--primary-color);
    border-radius: 3px 12px 12px 3px;
}

.board-column--drop-right {
    border-right: 3px solid var(--primary-color);
    border-radius: 12px 3px 3px 12px;
}

.board-column__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
}

.board-column__grip {
    cursor: grab;
    color: #cbd5e1;
    font-size: 0.85rem;
    letter-spacing: -3px;
    user-select: none;
    padding: 2px 0;
    transition: color 0.2s;
    flex-shrink: 0;
}

.board-column__grip:hover {
    color: var(--primary-color);
}

.board-column__grip:active {
    cursor: grabbing;
}

.board-column__name {
    font-weight: 700;
    font-size: 0.9rem;
    flex: 1;
}

.board-column__count {
    background: #cbd5e1;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-column-menu {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    color: #94a3b8;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

.btn-column-menu:hover {
    background: white;
    color: var(--text-color);
}

/* Column Menu */
.board-column-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 100;
    overflow: hidden;
}

.board-column-menu__item {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.board-column-menu__item:hover {
    background: var(--bg-color);
}

.board-column-menu__item--danger {
    color: var(--error-color);
}

.board-column-menu__item--danger:hover {
    background: #fef2f2;
}

/* Cards in column */
.board-column__cards {
    flex: 1;
    overflow-y: visible;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 40px;
    padding: 2px;
}

.board-column__cards--drag-over {
    background: rgba(102, 126, 234, 0.08);
    border-radius: 8px;
    border: 2px dashed var(--primary-color);
}

.btn-add-card {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: transparent;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.85rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-add-card:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

/* Board Card */
.board-card {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    overflow: hidden;
}

.board-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.board-card--dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.board-card__stripe {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 8px 8px 0 0;
}

.board-card__title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.board-card__assignee {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #64748b;
}

.board-card__avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.board-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

.board-card__tag {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    border-radius: 4px;
    font-weight: 500;
}

/* Board Modals */
.board-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.board-modal {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

.board-modal h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.board-modal h4 {
    margin: 1.5rem 0 0.75rem;
    font-size: 0.9rem;
    color: #64748b;
}

.board-modal .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.board-modal .form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

.board-modal .form-group textarea:focus,
.board-modal .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.card-search-results {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.card-search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}

.card-search-item:hover {
    background: #f1f5f9;
}

.card-search-title {
    font-weight: 500;
    color: #1e293b;
}

.card-search-meta {
    font-size: 0.8rem;
    color: #94a3b8;
}

.card-search-empty {
    padding: 0.75rem;
    color: #94a3b8;
    font-size: 0.9rem;
    text-align: center;
}

.board-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-primary {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-cancel {
    padding: 0.6rem 1.2rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: var(--bg-color);
}

.btn-danger {
    padding: 0.6rem 1.2rem;
    background: white;
    border: 1px solid var(--error-color);
    border-radius: 8px;
    color: var(--error-color);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #fef2f2;
}

.board-modal__error {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.board-modal__member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.board-modal__member-role {
    color: #94a3b8;
    text-transform: capitalize;
    margin-left: auto;
    margin-right: 0.5rem;
}

.btn-remove-member {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-member:hover {
    background: #fef2f2;
    color: var(--error-color);
}

/* Modal Tabs */
.board-modal__tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.board-modal__tab {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: #94a3b8;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.board-modal__tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.board-modal__tab:hover {
    color: var(--text-color);
}

.board-error {
    text-align: center;
    padding: 3rem;
    color: var(--error-color);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }

    .nav-controls {
        gap: 0.25rem;
    }

    #slot-main {
        padding: 1rem;
    }

    .rail {
        width: 100%;
    }

    #slot-toast {
        right: 1rem;
        left: 1rem;
    }

    .toast {
        min-width: auto;
    }

    .card-detail__add-form {
        flex-direction: column;
    }

    .card-detail__add-form .btn-sm {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 560px) {
    /* Nav flex children must be allowed to shrink — without min-width: 0 the
       user block's content size wins and pushes past the right viewport edge. */
    .nav-container {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .nav-icon-btn {
        width: 36px;
        height: 36px;
    }

    #user-info,
    .user-profile {
        min-width: 0;
    }

    .user-profile {
        gap: 0.5rem;
    }

    .user-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .btn-logout {
        flex: 0 0 auto;
        padding: 0.5rem 0.6rem;
    }

    .env-wrapper__banner {
        gap: 0.4rem;
        padding: 0.35rem 0.5rem;
    }

    .env-wrapper__direct-link {
        max-width: 34vw;
    }
}

/* ======================================================================
   CARD DETAIL PANEL (Right Rail)
   ====================================================================== */

.card-detail {
    padding: 0;
}

.card-detail__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.card-detail__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
    flex: 1;
}

.card-detail__title--linked {
    color: var(--primary-color);
    cursor: pointer;
}

.card-detail__title--linked:hover {
    text-decoration: underline;
}

.card-detail__status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    text-transform: uppercase;
    white-space: nowrap;
    background: #e2e8f0;
    color: #475569;
}

.card-detail__status--active { background: #dcfce7; color: #166534; }
.card-detail__status--done { background: #dbeafe; color: #1e40af; }
.card-detail__status--blocked { background: #fee2e2; color: #991b1b; }

.card-detail__desc-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}

.card-detail__description {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
    min-width: 0;
    flex: 1;
}

.card-detail__description--truncated {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-card-desc-expand {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0 0.15rem;
    cursor: pointer;
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
    margin-top: 0.1rem;
}

.btn-card-desc-expand:hover {
    color: var(--primary-color);
}

.card-detail__section {
    margin-bottom: 1.5rem;
}

.card-detail__section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.card-detail__section-header h4 {
    margin: 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 700;
}

.card-detail__empty {
    color: #94a3b8;
    font-size: 0.85rem;
    padding: 0.5rem 0;
    font-style: italic;
}

.card-detail__error {
    color: #dc2626;
    padding: 1rem;
    text-align: center;
}

/* Tasks */
.card-detail__task {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.card-detail__task input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.task-title {
    font-size: 0.9rem;
    color: var(--text-color);
}

.task-title--done {
    text-decoration: line-through;
    color: #94a3b8;
}

/* Sub-cards */
.card-detail__subcard {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.card-detail__subcard:hover {
    background: #f1f5f9;
}

.subcard-color {
    width: 4px;
    height: 20px;
    border-radius: 2px;
    flex-shrink: 0;
}

.subcard-title {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-color);
}

.subcard-column {
    font-size: 0.75rem;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

/* Add buttons */
.btn-add-task,
.btn-add-subcard {
    font-size: 0.78rem;
    border: 1px dashed #cbd5e1;
    background: transparent;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.15s;
}

.btn-add-task:hover,
.btn-add-subcard:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f0f7ff;
}

/* Inline add form */
.card-detail__add-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.card-detail__add-subcard-form .card-detail__add-form {
    flex-direction: column;
}

.card-detail__add-form input,
.card-detail__add-form textarea {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    resize: vertical;
}

.card-detail__add-form textarea {
    min-height: 6.5rem;
}

.card-detail__add-form input:focus,
.card-detail__add-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

/* Open as Board */
.btn-open-subboard {
    width: 100%;
    padding: 0.6rem;
    margin-top: 0.75rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary-color);
    transition: all 0.15s;
}

.btn-open-subboard:hover {
    background: #e0e7ff;
    border-color: var(--primary-color);
}

/* Sub-board indicator on board cards */
.board-card__subboard-indicator {
    font-size: 0.85rem;
    color: #6366f1;
    margin-left: 0.3rem;
    vertical-align: middle;
}

/* Parent board picker (right rail) */
.parent-board-picker p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 1rem;
}

.parent-board-picker__list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.parent-board-picker__item {
    display: block;
    padding: 0.75rem 1rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
}

.parent-board-picker__item:hover {
    background: #e0e7ff;
    border-color: var(--primary-color);
}

/* Multi-board link in card detail header */
.card-detail__multi-board-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    background: #e0e7ff;
    white-space: nowrap;
}

.card-detail__multi-board-link:hover {
    background: #c7d2fe;
    text-decoration: underline;
}

/* Board picker modal list */
.board-picker__list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.board-picker__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
}

.board-picker__item:hover {
    background: #e0e7ff;
    border-color: var(--primary-color);
}

.board-picker__name {
    font-weight: 500;
}

.board-picker__column {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
}

/* Archive trash icon (shared across dashboard cards, kanban cards, sub-cards) */
.btn-archive {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: #cbd5e1;
    padding: 0.25rem;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
    opacity: 0;
    pointer-events: none;
}

.dashboard-card:hover .btn-archive,
.board-card:hover .btn-archive,
.card-detail__subcard:hover .btn-archive {
    opacity: 1;
    pointer-events: auto;
}

.btn-archive:hover {
    color: var(--error-color);
    background: #fef2f2;
}

/* Archive confirmation modal -- red primary button */
.btn-danger-fill {
    padding: 0.6rem 1.2rem;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-danger-fill:hover {
    background: #dc2626;
}

.btn-danger-fill:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================
   Budget Page
   ======================================== */
.budget-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.budget-page h2 {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
}

.budget-alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.budget-alert--exhausted {
    background: #fef2f2;
    border: 1px solid var(--error-color);
    color: #991b1b;
}

.budget-alert--exhausted strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.budget-alert--exhausted p {
    margin: 0;
    font-size: 0.9rem;
}

.budget-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.budget-card {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 1.25rem;
    text-align: center;
}

.budget-card--danger {
    border: 2px solid var(--error-color);
}

.budget-card__label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.budget-card__value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.budget-card--danger .budget-card__value {
    color: var(--error-color);
}

.budget-card__sub {
    font-size: 0.8rem;
    color: #94a3b8;
}

.budget-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.budget-action-card {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.budget-action-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.budget-action-card p {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.budget-action-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.budget-action-form label {
    font-weight: 600;
    font-size: 0.85rem;
}

.budget-action-form input {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.budget-action-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.budget-form-error {
    color: var(--error-color);
    font-size: 0.85rem;
}

.budget-plan-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.budget-plan {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.15s;
}

.budget-plan--current {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.budget-plan__name {
    font-weight: 700;
    min-width: 70px;
}

.budget-plan__price {
    font-size: 0.9rem;
    color: #64748b;
    min-width: 80px;
}

.budget-plan__budget {
    flex: 1;
    font-size: 0.85rem;
    color: #94a3b8;
}

.budget-plan__badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

/* Card detail metadata */
.card-detail__meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #94a3b8;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

/* ========================================
   Groups and Users Page
   ======================================== */
.groups-page {
    padding: 2rem;
}

.groups-section {
    margin-bottom: 3rem;
}

.groups-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.groups-section__header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.search-input {
    width: 300px;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.group-card--selected {
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.user-card h3 {
    margin-bottom: 0.25rem;
}

.user-card p {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.role-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.role-badge--admin {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.role-badge--user {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.subgroup-card {
    border-left: 3px solid #0ea5e9;
    cursor: pointer;
}

.subgroup-card h3 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #0ea5e9;
}

.subgroup-card__icon {
    flex-shrink: 0;
}

.subgroup-card:hover {
    border-left-color: #0284c7;
}

.subgroup-card:hover h3 {
    color: #0284c7;
}

/* Remove-from-group button — appears on hover in the top-right of user/subgroup cards */
.btn-remove-member {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
    z-index: 2;
}

.dashboard-card:hover .btn-remove-member {
    opacity: 1;
}

.btn-remove-member:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Create Group card */
.create-group-card {
    border: 2px dashed #cbd5e1;
    background: transparent;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.create-group-card:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.04);
    transform: none;
    box-shadow: none;
}

.create-group-card__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
}

.create-group-card:hover .create-group-card__content {
    color: #667eea;
}

.create-group-form {
    display: flex;
    flex-direction: column;
    cursor: default;
}

.create-group-form:hover {
    transform: none;
}

.empty-state {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 2rem;
}

.error-message {
    text-align: center;
    padding: 3rem;
}

.error-message h2 {
    color: var(--error-color);
    margin-bottom: 1rem;
}

.error-message p {
    color: #64748b;
}

/* ========================================
   Autocomplete Results
   ======================================== */
.autocomplete-results {
    display: none;
    position: absolute;
    z-index: 1000;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
    width: 100%;
    left: 0;
}

.autocomplete-section {
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #f8fafc;
}

.autocomplete-icon {
    display: flex;
    align-items: center;
    margin-right: 10px;
    color: #64748b;
}

.autocomplete-main {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.autocomplete-name {
    font-weight: 500;
    color: #1e293b;
}

.autocomplete-meta {
    font-size: 0.85rem;
    color: #64748b;
}

.autocomplete-empty {
    padding: 12px;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
}

/* Group member styling in board modal */
.board-modal__member--group {
    background: #f0f9ff;
    border-left: 3px solid #0ea5e9;
}

.board-modal__member-icon {
    vertical-align: middle;
    margin-right: 4px;
}

/* Group member avatar in board header */
.board-member-avatar--group {
    background: #0ea5e9;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
}

/* ========================================
   Owner Display & Assignment
   ======================================== */

/* Board header owner label */
.board-kanban__owner {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
}

.owner-label {
    font-size: 0.85rem;
    color: #64748b;
    white-space: nowrap;
}

.btn-change-owner {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: #94a3b8;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.btn-change-owner:hover {
    color: var(--primary-color);
    background: #f1f5f9;
}

/* Card detail owner row */
.card-detail__owner {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-detail__owner span {
    font-size: 0.85rem;
    color: #64748b;
}

/* Task owner badge */
.task-owner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: auto;
    flex-shrink: 0;
    cursor: default;
}

.card-detail__task .task-owner {
    cursor: pointer;
    transition: background 0.15s;
}

.card-detail__task .task-owner:hover {
    background: var(--secondary-color);
}

/* ========================================
   Title wrap + truncation / expand
   ======================================== */

.card-detail__title-wrap,
.board-info__title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
    min-width: 0;
}

.card-detail__title--truncated,
.board-info__title--truncated {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-card-title-expand,
.btn-board-title-expand {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0 0.15rem;
    cursor: pointer;
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
    margin-top: 0.1rem;
}

.btn-card-title-expand:hover,
.btn-board-title-expand:hover {
    color: var(--primary-color);
}

/* ========================================
   Section collapse toggle
   ======================================== */

.btn-section-toggle {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0 0.15rem;
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1;
    order: -1;
}

.btn-section-toggle:hover {
    color: var(--primary-color);
}

/* ========================================
   Board chat button in kanban header
   ======================================== */

.btn-board-chat {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    color: #64748b;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.btn-board-chat:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ========================================
   Chat section in right rail
   ======================================== */

.card-detail__chat-section {
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.board-info__chat-section {
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

/* ========================================
   hitloop-chat component
   ======================================== */

hitloop-chat {
    display: block;
    font-size: 0.88rem;
}

.chat-wrap {
    display: flex;
    flex-direction: column;
    height: 420px;
    min-height: 280px;
}

/* Scrollable message area */
.chat-messages-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.chat-messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

/* Load more button */
.chat-load-more {
    display: block;
    width: 100%;
    background: none;
    border: none;
    padding: 0.3rem;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 0.25rem;
}
.chat-load-more:hover { text-decoration: underline; }
.chat-load-more:disabled { color: #94a3b8; cursor: default; }

/* Individual message */
.chat-message {
    display: flex;
    gap: 0.5rem;
    padding: 0.3rem 0.4rem;
    border-radius: 6px;
    transition: background 0.1s;
}
.chat-message:hover { background: #f8fafc; }

/* Avatar circle */
.chat-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.1rem;
}
.chat-avatar--sm { width: 22px; height: 22px; font-size: 0.65rem; }
.chat-avatar--xs { width: 18px; height: 18px; font-size: 0.6rem; flex-shrink: 0; }

/* Message body */
.chat-message__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.chat-message__header {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}
.chat-message__name {
    font-weight: 600;
    font-size: 0.82rem;
    color: #1e293b;
}
.chat-message__time {
    font-size: 0.72rem;
    color: #94a3b8;
}
.chat-delete-btn {
    background: none;
    border: none;
    padding: 0 0.2rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: #cbd5e1;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.1s;
    line-height: 1;
}
.chat-message:hover .chat-delete-btn { opacity: 1; }
.chat-delete-btn:hover { color: #ef4444; }

/* Rendered message content */
.chat-message__content {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-color);
    word-break: break-word;
}
.chat-message__content strong { font-weight: 700; }
.chat-message__content em { font-style: italic; }
.chat-message__content code {
    background: #f1f5f9;
    border-radius: 3px;
    padding: 0.1em 0.3em;
    font-family: monospace;
    font-size: 0.83em;
}
.chat-message__content pre {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    overflow-x: auto;
    margin: 0.3rem 0;
}
.chat-message__content pre code { background: none; padding: 0; color: inherit; }
.chat-message__content table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.3rem 0;
    font-size: 0.82rem;
}
.chat-message__content th,
.chat-message__content td {
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.4rem;
    text-align: left;
}
.chat-message__content th { background: #f1f5f9; font-weight: 600; }
.chat-message__content a { color: var(--primary-color); }

/* @mention token in rendered text */
.chat-mention {
    background: #dbeafe;
    color: #1e40af;
    border-radius: 3px;
    padding: 0 0.2em;
    font-weight: 600;
}

/* File attachments */
.chat-attachment {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-size: 0.78rem;
    color: var(--primary-color);
    text-decoration: none;
    margin: 0.15rem 0.15rem 0 0;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-attachment:hover { background: #e2e8f0; }
.chat-attachment-row { display: inline-flex; align-items: center; gap: 0.1rem; max-width: 100%; }
.chat-attachment--removed { color: #64748b; background: transparent; border-style: dashed; max-width: 320px; }
.chat-attachment--removed:hover { background: transparent; }
.chat-attachment__remove { margin-top: 0.15rem; }
.chat-attachment__size { color: #94a3b8; margin-left: 0.2rem; }

/* Actions row (thread button) */
.chat-message__actions { margin-top: 0.1rem; }

.chat-thread-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 0.75rem;
    color: #64748b;
}
.chat-thread-btn:hover { color: var(--primary-color); text-decoration: underline; }
.chat-thread-btn--active { color: var(--primary-color); font-weight: 600; }

/* Inline thread container */
.chat-thread-container { display: none; }
.chat-thread-container--open { display: block; }

.chat-thread {
    border-left: 3px solid var(--primary-color);
    margin: 0.25rem 0 0.25rem 2rem;
    padding: 0.4rem 0.6rem;
    background: #f8fafc;
    border-radius: 0 6px 6px 0;
}
.chat-thread__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}
.chat-thread__close {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 0.82rem;
    color: #94a3b8;
}
.chat-thread__close:hover { color: #ef4444; }
.chat-thread__messages { display: flex; flex-direction: column; gap: 0.25rem; }

/* Thread reply variant — slightly smaller avatar handled by --sm */
.chat-message--thread { padding: 0.2rem 0.3rem; }

/* Empty states */
.chat-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
    padding: 1.5rem 0;
}
.chat-empty--sm { padding: 0.5rem 0; font-size: 0.78rem; }

/* ── Input area ── */
.chat-input-area {
    border-top: 1px solid var(--border-color);
    padding-top: 0.4rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

/* Pending files */
.chat-pending-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}
.chat-pending-file {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.78rem;
}
.chat-pending-file__remove {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #94a3b8;
    line-height: 1;
}
.chat-pending-file__remove:hover { color: #ef4444; }

/* Reply indicator bar */
.chat-reply-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    padding: 0.25rem 0.5rem;
    margin-bottom: -1px;
}
.chat-reply-cancel {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #94a3b8;
    margin-left: auto;
    font-size: 0.9rem;
    line-height: 1;
}
.chat-reply-cancel:hover { color: #ef4444; }

/* Textarea + @mention dropdown */
.chat-textarea-wrap { position: relative; }

.chat-mention-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    max-height: 160px;
    overflow-y: auto;
    z-index: 200;
    margin-bottom: 2px;
}
.chat-mention-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    font-size: 0.85rem;
}
.chat-mention-option:hover,
.chat-mention-option.selected { background: #f1f5f9; }

.chat-textarea {
    display: block;
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    resize: vertical;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem 0.55rem;
    font-size: 0.88rem;
    font-family: inherit;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.chat-textarea:focus { border-color: var(--primary-color); }

/* Footer row: toolbar left, send right */
.chat-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.3rem;
}
.chat-input-footer-left {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}
.chat-toolbar-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.15rem 0.35rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.3;
}
.chat-toolbar-btn:hover {
    background: #f1f5f9;
    border-color: var(--border-color);
    color: var(--text-color);
}
.chat-attach-label { cursor: pointer; }

.chat-send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s;
}
.chat-send-btn:hover { background: var(--secondary-color); }
.chat-send-btn:disabled { opacity: 0.5; cursor: default; }

.chat-session-bar {
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    margin-bottom: 0.3rem;
    font-size: 0.78rem;
}
.chat-session-indicator { font-weight: 500; color: #475569; }
.chat-session-indicator--listening { color: #16a34a; }
.chat-session-indicator--working { color: #d97706; }
.chat-session-indicator--error { color: #dc2626; }

/* ========================================
   Board info component
   ======================================== */

.board-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.board-info__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
    flex: 1;
}

.board-info__description {
    font-size: 0.88rem;
    color: #475569;
    margin: 0;
    line-height: 1.5;
}

/* Clickable toast */
.toast[style*="cursor: pointer"]:hover {
    opacity: 0.92;
}

/* =========================================
   Profile Type Badges
   ========================================= */

.profile-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.profile-type-badge--human {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.profile-type-badge--agent {
    background: rgba(102, 126, 234, 0.12);
    color: #3730a3;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

/* =========================================
   Clickable username in top nav
   ========================================= */

.user-name--link {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border-radius: 4px;
    padding: 2px 4px;
    transition: background 0.15s;
}

.user-name--link:hover {
    background: rgba(255, 255, 255, 0.15);
    text-decoration: underline;
}

/* =========================================
   Profile Cards (Users page grid)
   ========================================= */

.profile-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.profile-card__photo-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.profile-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    display: block;
}

.profile-card__photo--placeholder {
    width: 100%;
    height: 100%;
    border-radius: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    font-weight: 700;
}

.profile-card__body {
    padding: 1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.profile-card__body h3 {
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.3;
}

.profile-card__at-name {
    color: #64748b;
    font-weight: 400;
    font-size: 0.85em;
}

.profile-card__title {
    color: #64748b;
    font-size: 0.82rem;
    margin: 0;
}

.profile-card__team {
    color: #94a3b8;
}

.profile-card .profile-type-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.45rem;
    padding: 0.15rem 0.45rem;
}

.profile-card .profile-type-badge--human {
    background: #059669;
    color: #fff;
    border-color: #059669;
}

.profile-card .profile-type-badge--agent {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

/* =========================================
   Profile Page
   ========================================= */

.profile-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.profile-header {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar__img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
}

.profile-avatar__placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
}

.profile-avatar__change-btn {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: background 0.15s;
}

.profile-avatar__change-btn:hover {
    background: var(--bg-color);
}

.profile-identity {
    flex: 1;
    min-width: 0;
}

.profile-identity > * + * {
    margin-top: 0.4rem;
}

.profile-edit-hint {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.profile-display-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}

.profile-title {
    font-size: 1rem;
    color: #64748b;
}

.profile-at-name {
    font-size: 0.95rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 1px;
}

.profile-at-name__at {
    font-weight: 600;
    color: var(--primary-color);
}

.profile-at-name__value {
    color: #475569;
}

.profile-linkedin a {
    color: #0077b5;
    font-size: 0.9rem;
    text-decoration: none;
}

.profile-linkedin a:hover {
    text-decoration: underline;
}

/* Inline editable field */
.profile-field--editable {
    cursor: text;
    border-radius: 4px;
    padding: 2px 4px;
    margin-left: -4px;
    transition: background 0.15s;
}

.profile-field--editable:hover {
    background: rgba(102, 126, 234, 0.07);
    outline: 1px dashed rgba(102, 126, 234, 0.4);
}

.profile-inline-edit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.profile-inline-input {
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: inherit;
    font-family: inherit;
    flex: 1;
    min-width: 120px;
    outline: none;
}

.profile-inline-input:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.profile-empty {
    color: #94a3b8;
    font-style: italic;
}

/* Profile sections */
.profile-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

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

.profile-section__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.profile-section__header .profile-section__title {
    margin-bottom: 0;
}

/* Charter */
.profile-charter-display {
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 6px;
    min-height: 60px;
    border: 1px dashed transparent;
    transition: border-color 0.15s, background 0.15s;
    line-height: 1.6;
    font-size: 0.95rem;
}

.profile-charter-display:hover {
    border-color: rgba(102, 126, 234, 0.4);
    background: rgba(102, 126, 234, 0.03);
}

.profile-charter-display h1,
.profile-charter-display h2,
.profile-charter-display h3 {
    margin: 1rem 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.profile-charter-display ul,
.profile-charter-display ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.profile-charter-display code {
    background: #f1f5f9;
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-size: 0.88em;
}

.profile-charter-display pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.875rem;
    margin: 0.75rem 0;
}

.profile-charter-display pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.profile-charter-editor {
    width: 100%;
    min-height: 200px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
    line-height: 1.6;
}

.profile-charter-editor:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.profile-charter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Inline access toggles (external visible / hirable) */
.profile-access-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #475569;
    cursor: pointer;
    padding: 0.375rem 0;
}

.profile-access-toggle input {
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Team settings inline toggle */
.team-setting-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #475569;
    cursor: pointer;
    font-weight: normal;
    line-height: 1.5;
}

.team-setting-toggle input {
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

/* Members list */
.profile-members {
    margin-bottom: 1rem;
}

.profile-member-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-member-row:last-child {
    border-bottom: none;
}

.profile-member-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-color);
}

.profile-member-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.25rem;
    transition: color 0.15s;
}

.profile-member-remove:hover {
    color: var(--error-color);
}

.profile-members__add {
    position: relative;
    margin-top: 0.75rem;
}

/* New agent form */
.profile-form {
    max-width: 560px;
}

.profile-form__field {
    margin-bottom: 1.25rem;
}

.profile-form__field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.4rem;
}

.profile-form__field label .required {
    color: var(--error-color);
}

.form-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.at-name-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.at-name-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.at-name-prefix {
    padding: 0.6rem 0.5rem 0.6rem 0.75rem;
    background: var(--bg-color);
    color: var(--primary-color);
    font-weight: 700;
    border-right: 1px solid var(--border-color);
    user-select: none;
}

.form-input--at {
    border: none;
    box-shadow: none;
    border-radius: 0;
    flex: 1;
}

.form-input--at:focus {
    box-shadow: none;
}

.profile-form__hint {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.3rem;
}

.profile-form__actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.profile-form__error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(239, 68, 68, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Button size variants */
.btn--sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
}

.btn--xs {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
}

.btn--primary {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.15s;
}

.btn--primary:hover:not(:disabled) {
    opacity: 0.88;
}

.btn--primary:disabled {
    opacity: 0.55;
    cursor: default;
}

.btn--ghost {
    background: transparent;
    color: #475569;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s;
}

.btn--ghost:hover:not(:disabled) {
    background: var(--bg-color);
}

.btn--ghost:disabled {
    opacity: 0.55;
    cursor: default;
}

/* .btn (below) sets border: none; a ghost button keeps its outline (2026-10-30) */
.btn.btn--ghost { border: 1px solid var(--border-color); }

/* ========================================
   BASE BUTTON (used by project components)
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
    transition: opacity 0.15s, background 0.15s;
}

/* ========================================
   BADGE COLORS
   ======================================== */
.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #e2e8f0;
    color: #475569;
}
.badge--green  { background: #dcfce7; color: #166534; }
.badge--yellow { background: #fef9c3; color: #854d0e; }
.badge--blue   { background: #dbeafe; color: #1e40af; }
.badge--red    { background: #fee2e2; color: #991b1b; }
.badge--gray   { background: #f1f5f9; color: #475569; }

/* ========================================
   FORM FIELDS (project create form)
   ======================================== */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
}
.form-field__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.form-field__label .required { color: var(--error-color); }
.form-field__hint {
    font-size: 0.75rem;
    font-weight: 400;
    color: #94a3b8;
}
.form-field__input,
.form-field__textarea {
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-color);
    background: #fff;
    transition: border-color 0.15s;
    width: 100%;
    font-family: inherit;
}
.form-field__input:focus,
.form-field__textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}
.form-field__slug-preview {
    font-size: 0.78rem;
    color: #64748b;
    font-family: monospace;
    margin-top: 0.1rem;
}

/* ========================================
   PROJECT LIST
   ======================================== */
.project-list {
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}
.project-list__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.project-list__title { font-size: 1.5rem; font-weight: 700; color: var(--text-color); }
.project-list__items { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.project-list__item-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.project-list__item-link:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}
.project-list__item-main { display: flex; flex-direction: column; gap: 0.2rem; }
.project-list__item-name { font-weight: 600; font-size: 0.95rem; color: var(--text-color); }
.project-list__item-slug { font-size: 0.78rem; color: #94a3b8; font-family: monospace; }
.project-list__item-status { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: #64748b; }
.project-list__item-status--active   { color: #166534; }
.project-list__item-status--error    { color: #991b1b; }
.project-list__item-status--provisioning { color: #854d0e; }
.project-list__loading { color: #94a3b8; font-size: 0.9rem; }
.project-list__error   { color: var(--error-color); font-size: 0.9rem; }
.project-list__empty   { text-align: center; padding: 3rem 1rem; color: #94a3b8; display: flex; flex-direction: column; align-items: center; gap: 1rem; }

/* ========================================
   PROJECT CREATE FORM
   ======================================== */
.project-create {
    max-width: 560px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}
.project-create__header { margin-bottom: 1.75rem; }
.project-create__header h2 { font-size: 1.4rem; font-weight: 700; margin-top: 0.75rem; }
.project-create__team-label { font-size: 0.9rem; font-weight: 400; color: #64748b; }
.project-create__form {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.75rem;
}
.project-create__error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: rgba(239, 68, 68, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.project-create__actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }

/* ========================================
   PROJECT DETAIL
   ======================================== */
.project-detail {
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}
.project-detail__header { margin-bottom: 1.75rem; }
.pd-back { background: none; border: none; color: var(--primary-color); font: inherit; font-size: 0.9rem; padding: 0.25rem 0; cursor: pointer; }
.pd-back:hover { text-decoration: underline; }
.project-detail__meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.project-detail__title-row .project-detail__settings { margin-left: auto; flex: 0 0 auto; }
.project-detail__title-row { flex-wrap: nowrap; align-items: flex-start; }
.project-detail__title-row .project-detail__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.project-detail__title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 0.35rem;
}
.project-detail__name { font-size: 1.5rem; font-weight: 700; }
.project-detail__slug { font-size: 0.8rem; color: #94a3b8; font-family: monospace; }
.project-detail__desc { font-size: 0.9rem; color: #64748b; margin-top: 0.5rem; }
.project-detail__section {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}
.project-detail__section h3 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; margin-bottom: 0.75rem; }
.pd-linked-boards__hint { font-size: 0.85rem; color: var(--text-secondary, #64748b); margin: 0 0 0.5rem; }
.pd-linked-boards { list-style: none; margin: 0 0 0.75rem; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.pd-linked-boards li { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pd-linked-boards li > a { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pd-linked-boards__none { color: var(--text-secondary, #64748b); font-size: 0.9rem; }
.pd-linked-boards__actions, .pd-linked-boards__form { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pd-linked-boards__form { margin-top: 0.5rem; }
.pd-linked-boards__actions select, .pd-linked-boards__form input { max-width: 100%; min-width: 0; padding: 0.35rem 0.5rem; border: 1px solid var(--border-color, #cbd5e1); border-radius: 6px; font: inherit; }
.project-detail__section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.project-detail__section-header h3 { margin-bottom: 0; }
.project-detail__section--provisioning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.project-detail__section--error { background: #fef2f2; border-color: #fecaca; }
.project-detail__section--error h3 { color: #991b1b; }
.project-detail__gh-link { font-size: 0.875rem; color: var(--primary-color); word-break: break-all; }
.project-detail__env-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.project-detail__env-list li { display: flex; flex-direction: column; gap: 0; font-size: 0.875rem; }
.project-detail__env-header { display: flex; align-items: center; gap: 0.5rem 0.75rem; flex-wrap: wrap; }
.project-detail__env-header > a { min-width: 0; overflow-wrap: anywhere; }
.pd-env-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-left: auto; }
.pd-env-hint { font-size: 0.8rem; color: var(--text-secondary, #64748b); margin: 0.35rem 0 0; }
.project-detail__env-list a { color: var(--primary-color); font-family: monospace; font-size: 0.85rem; text-decoration: none; }
.project-detail__env-list a.pd-env-open { font-family: inherit; font-size: 0.875rem; font-weight: 600; }
.project-detail__env-list a:hover { text-decoration: underline; }
.project-detail__prs { margin-top: 0.5rem; margin-left: 2.5rem; }
.project-detail__pr-list { display: flex; flex-direction: column; gap: 0.4rem; }
.project-detail__pr-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; margin-bottom: 0.25rem; display: block; }
.project-detail__pr-item { display: flex; align-items: center; gap: 0.6rem; }
.project-detail__pr-title { flex: 1; color: var(--primary-color); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28rem; text-decoration: none; }
.project-detail__pr-title:hover { text-decoration: underline; }
.project-detail__pr-branch { font-family: monospace; font-size: 0.75rem; color: #94a3b8; white-space: nowrap; }
.project-detail__pr-error { font-size: 0.78rem; color: #ef4444; }
.project-detail__members { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.project-detail__member { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.875rem; }
.project-detail__member > span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.project-detail__member-add { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.75rem; }
.project-detail__member-add select, .project-detail__member-add select.form-input { flex: 0 0 auto; width: auto; min-width: 7rem; }
.project-detail__member-add input { flex: 1 1 14rem; max-width: 24rem; min-width: 0; padding: 0.35rem 0.5rem; border: 1px solid var(--border-color, #cbd5e1); border-radius: 6px; font: inherit; }
.project-detail__member-add .team-settings__status { flex-basis: 100%; }
.pd-section-hint { font-size: 0.85rem; color: var(--text-secondary, #64748b); margin: -0.25rem 0 0.75rem; }
.project-detail__empty { color: #94a3b8; font-size: 0.875rem; }
.project-detail__deployments { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.project-detail__deployment { display: flex; align-items: center; gap: 0.35rem 0.75rem; flex-wrap: wrap; font-size: 0.875rem; }
.project-detail__deploy-sha { font-family: monospace; font-size: 0.8rem; color: #64748b; }
.project-detail__deploy-date { color: #94a3b8; font-size: 0.78rem; margin-left: auto; }
.project-detail--not-found { text-align: center; padding: 3rem 1rem; }
/* Next steps for a new project (owner 2026-10-30): what the page is for, in four steps */
.pd-next { background: linear-gradient(135deg, #eef2ff, #faf5ff); border-color: #c7d2fe; }
.pd-next__lead { font-size: 0.95rem; color: var(--text-color, #1e293b); margin: 0 0 0.85rem; line-height: 1.5; }
.pd-next__steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; counter-reset: pdnext; }
.pd-next__steps li { display: grid; grid-template-columns: 1.75rem 1fr; gap: 0.15rem 0.6rem; align-items: start; counter-increment: pdnext; }
.pd-next__steps li::before { content: counter(pdnext); grid-row: span 2; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--primary-color); color: #fff; font-weight: 700; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; }
.pd-next__title { font-weight: 600; font-size: 0.92rem; }
.pd-next__text { font-size: 0.85rem; color: var(--text-secondary, #64748b); line-height: 1.45; }
.pd-next__text a, .pd-next__text button.pd-linkish { color: var(--primary-color); font-weight: 600; }
button.pd-linkish { background: none; border: none; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.pd-instructions > summary { cursor: pointer; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; list-style-position: inside; }
.pd-instructions[open] > summary { margin-bottom: 0.75rem; }
@media (max-width: 768px) {
    .project-detail { margin: 0.5rem auto 1.5rem; padding: 0; }
    .project-detail__section { padding: 1rem; }
    .project-detail__prs { margin-left: 0; }
    .project-detail__pr-item { flex-wrap: wrap; }
    .project-detail__pr-title { max-width: 100%; white-space: normal; }
    .project-detail__deploy-date { margin-left: 0; flex-basis: 100%; }
}
.project-detail__not-found h2 { margin-bottom: 1rem; }

/* ── env-wrapper (V2-A): banner + isolated environment iframe ─────────────── */
.env-wrapper {
    position: fixed;
    inset: 0;
    /* On a top-level env-copy origin the fixed self-banner occupies the top
       26px — start the takeover below it so level banners stack (one per
       nesting level) instead of overlapping (owner 2026-09-01). */
    top: var(--envcopy-banner-h, 0px);
    /* full-screen takeover: above nav (--z-nav) and rails, below toast */
    z-index: calc(var(--z-nav) + 100);
    display: flex;
    flex-direction: column;
    background: #fff;
}
.env-wrapper__banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    flex: 0 0 auto;
}
.env-wrapper__banner--dev { background: #c0392b; color: #fff; }
.env-wrapper__banner--qa  { background: #f1c40f; color: #2c2c00; }
.env-wrapper__back {
    border: none;
    background: rgba(255, 255, 255, 0.25);
    color: inherit;
    border-radius: 4px;
    padding: 0.1rem 0.55rem;
    font-size: 1rem;
    cursor: pointer;
}
.env-wrapper__back:hover { background: rgba(255, 255, 255, 0.45); }
.env-wrapper__env-label {
    letter-spacing: 0.12em;
    border: 1.5px solid currentColor;
    border-radius: 4px;
    padding: 0 0.4rem;
}
.env-wrapper__spacer { flex: 1; }
.env-wrapper__project-name {
    /* Long names must truncate, not wrap — the banner stays one row tall. */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.env-wrapper__host {
    opacity: 0.85;
    font-weight: 400;
    /* Subdomain hostnames are long unbroken strings — truncate instead of
       widening the document past the viewport. */
    flex: 0 1 auto;
    min-width: 0;
    max-width: 45vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.env-wrapper__direct-link:hover { opacity: 1; text-decoration: underline; }
.env-wrapper__frame {
    flex: 1;
    border: none;
    width: 100%;
}
.project-detail__env-direct {
    font-size: 0.8rem;
    opacity: 0.7;
}
.project-detail__clone-warning-list {
    margin: 0.5rem 0 0.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* Agent-instructions panel: in-place editor (charter-style large text field) */
.agent-instructions__editor {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.agent-instructions__editor .ai-edit-content {
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
    line-height: 1.45;
    resize: vertical;
    min-height: 8rem;
}

/* ── Home page (owner 2026-09-04): headline + chat box, public for all ────── */
.home-page { position: relative; min-height: calc(100vh - 120px); background: #fff; }
.home-auth-area { position: absolute; top: 0.75rem; right: 1rem; display: flex; gap: 0.5rem; z-index: 5; }
/* The app shell already pads 16px — 4px here lands the owner's ~20px mobile
   gutters; max-width 858 (850 + 2*4) caps the chat box at 850 on desktop. */
.home-page__center { max-width: 858px; margin: 0 auto; padding: 14vh 4px 3rem; display: flex; flex-direction: column; align-items: center; }
.home-page__legal { display: flex; justify-content: center; gap: 16px; padding: 0 16px 16px; font-size: .85rem; }
.home-page__legal a { color: var(--spectrum-gray-700, #4b5563); }
.home-page__headline { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; margin-bottom: 2rem; text-align: center; }
/* once the chat has content the headline makes room for it (owner 2026-10-30) */
.home-page--chat .home-page__center { padding-top: 1rem; }
.home-page--chat .home-page__headline { font-size: 1.1rem; margin-bottom: 0.75rem; color: #64748b; }
.home-page--chat .home-chat__transcript { max-height: calc(100dvh - var(--nav-height) - 13rem); }
/* Custom elements default to display:inline — without this the chat box
   shrink-wraps its placeholder text (182px!) instead of filling the page
   (found 2026-09-05 via rect probe). */
home-chat-component { display: block; width: 100%; }
.home-chat { width: 100%; }
.home-chat__transcript { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.9rem; max-height: 46vh; overflow-y: auto; }
.home-chat__msg { padding: 0.6rem 0.9rem; border-radius: 12px; font-size: 0.95rem; line-height: 1.45; max-width: 90%; }
.home-chat__msg--user { align-self: flex-end; background: #eef0ff; }
.home-chat__msg--assistant { align-self: flex-start; background: #f6f8fa; }
.home-chat__msg--thinking { color: #94a3b8; }
.home-chat__msg--status { color: #57606a; font-size: 0.85rem; display: flex; align-items: baseline; gap: 0.45rem; padding: 0.15rem 0.9rem; background: none; }
.home-chat__msg--status-live { color: #24292f; }
.home-chat__msg--status + .home-chat__msg--status { margin-top: -0.45rem; }
.home-chat__status-detail { color: #94a3b8; white-space: nowrap; }
.home-chat__status-dot { width: 8px; height: 8px; border-radius: 50%; background: #5b5bd6; flex: none; align-self: center; animation: hl-pulse 1.4s ease-in-out infinite; }
@keyframes hl-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .home-chat__status-dot { animation: none; } }
/* the build agent's live progress under the project's Dev link (owner 2026-10-27) */
.pd-agent-progress { display: flex; align-items: baseline; gap: 0.45rem; margin-top: 0.4rem; font-size: 0.85rem; color: #57606a; }
.pd-agent-progress[hidden] { display: none; }
.pd-agent-progress .home-chat__status-dot { align-self: center; }
.home-chat__actions { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.home-chat__action-chip { display: inline-block; padding: 0.25rem 0.7rem; border: 1px solid #d0d7de; border-radius: 999px; font-size: 0.85rem; text-decoration: none; color: inherit; background: #fff; }
.home-chat__action-chip:hover { background: #f3f4f6; }
.home-chat__box { border: 1px solid #d0d7de; border-radius: 16px; padding: 0.75rem 0.9rem 0.6rem; box-shadow: 0 2px 12px rgba(0,0,0,0.05); background: #fff; }
.home-chat__input { width: 100%; border: none; outline: none; resize: none; font: inherit; font-size: 1rem; background: transparent; }
.home-chat__bar { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.35rem; }
.home-chat__model { font-size: 0.8rem; border: 1px solid #d0d7de; border-radius: 8px; padding: 0.2rem 0.4rem; max-width: 220px; color: #57606a; background: #fff; }
.home-chat__spacer { flex: 1; }
.home-chat__send { width: 34px; height: 34px; border-radius: 50%; border: none; background: #5b5bd6; color: #fff; font-size: 1.05rem; cursor: pointer; }
.home-chat__send:disabled { opacity: 0.5; cursor: default; }


/* ── Visitors (owner 2026-10-28): free-account modal, visitor profile ── */
.account-modal__reason { font-weight: 600; margin-bottom: 0.25rem; }
.account-modal__lead { color: #64748b; margin-bottom: 1rem; }
.account-modal__alt { margin-top: 1rem; font-size: 0.9rem; text-align: center; }
.account-modal .form-group { margin-bottom: 1rem; }
.account-modal .form-group label { display: block; font-weight: 500; margin-bottom: 0.35rem; }
.account-modal .form-group input {
    width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--border-color); border-radius: 8px; font-size: 1rem;
}
.account-modal__code { font-size: 1.5rem !important; letter-spacing: 0.5rem; text-align: center; font-variant-numeric: tabular-nums; }
.account-modal__status { min-height: 1.25rem; color: #64748b; font-size: 0.9rem; }
.account-modal__choices { display: grid; gap: 0.75rem; margin: 1rem 0; }
.account-modal__choice {
    display: flex; flex-direction: column; gap: 0.2rem; text-align: left; padding: 0.85rem 1rem;
    background: white; border: 1px solid var(--border-color); border-radius: 10px; cursor: pointer; font: inherit;
}
.account-modal__choice:hover, .account-modal__choice:focus-visible { border-color: var(--primary-color); }
.account-modal__choice span { color: #64748b; font-size: 0.85rem; }
.account-modal .muted, .visitor-profile__fields .muted { color: #94a3b8; font-weight: 400; }
.home-chat__signup { margin-top: 0.5rem; }

.visitor-profile__fields { display: grid; grid-template-columns: max-content 1fr; gap: 0.75rem 1.25rem; align-items: start; }
.visitor-profile__fields dt { font-weight: 600; color: #475569; }
.visitor-profile__fields dd { margin: 0; }
.visitor-profile__fields textarea { width: 100%; padding: 0.5rem; border: 1px solid var(--border-color); border-radius: 8px; font: inherit; }
.profile-avatar__placeholder {
    width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); color: white; font-size: 2.5rem; font-weight: 700;
}
.login-error--info { color: #475569 !important; background: #f1f5f9 !important; }
.login-save-note { background: #eef2ff; border: 1px solid #c7d2fe; color: #3730a3; border-radius: 8px; padding: 0.6rem 0.8rem; margin-bottom: 1rem; font-size: 0.9rem; }
.btn-login--secondary { background: white; color: var(--primary-color); border: 1px solid var(--primary-color); }
.btn-login--secondary:hover { background: #eef2ff; }
/* the hidden attribute always hides (a component's display rule must not beat it, 2026-10-28) */
[hidden] { display: none !important; }

/* Notifications (owner 2026-10-29): the bell's mute mark and the unread list in the right rail */
.bell-mute-slash { display: none; }
.nav-icon-btn--muted .bell-mute-slash { display: inline; }

.notice-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
}

.notice-list__empty {
    color: #64748b;
    font-size: 0.9rem;
}

.notice-row {
    padding: 0.6rem 0.75rem;
    border-left: 3px solid var(--primary-color);
    border-radius: 6px;
    background: var(--bg-color);
}

.notice-row--success { border-left-color: var(--success-color); }
.notice-row--error { border-left-color: var(--error-color); }
.notice-row--warning { border-left-color: var(--warning-color); }
.notice-row--link { cursor: pointer; }
.notice-row--link:hover { filter: brightness(0.97); }

.notice-row__head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: baseline;
}

.notice-row__title { font-size: 0.9rem; }

.notice-row__time {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
}

.notice-row__text {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.15rem;
}

/* Agent instructions panel: rows wrap on a phone (2026-10-30) */
.agent-instructions__list { list-style: none; padding: 0; margin: 0 0 0.75rem; display: flex; flex-direction: column; gap: 0.6rem; }
.agent-instructions__row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.agent-instructions__row > strong { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.agent-instructions__add { display: flex; flex-direction: column; gap: 0.5rem; }
.agent-instructions__settings { display: flex; flex-direction: column; gap: 0.35rem; margin: 0 0 1rem; }
.agent-instructions__settings-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.agent-instructions__settings .spectrum-Textfield { inline-size: 6rem; }
.agent-instructions__add .form-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* Board header on a phone (2026-10-30): the buttons on the right went past the screen edge */
@media (max-width: 768px) {
    .board-kanban { height: auto; min-height: calc(100dvh - var(--nav-height) - 2rem); }
    .board-kanban__header { flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
    .board-kanban__header-left { flex-wrap: wrap; min-width: 0; width: 100%; gap: 0.5rem; }
    .board-kanban__title { font-size: 1.2rem; flex: 1; min-width: 0; overflow-wrap: anywhere; }
    .board-kanban__owner { margin-left: 0; padding-left: 0; border-left: none; flex-basis: 100%; }
    .board-kanban__header-right { flex-wrap: wrap; gap: 0.5rem; width: 100%; }
}
.btn-board-project { color: var(--text-color); text-decoration: none; display: inline-flex; align-items: center; gap: 0.3rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-detail__member select.pd-member-role { width: auto; max-width: 12rem; }

/* ── Design system admin (owner 2026-11-02) ─────────────────────────────── */
.design-admin__presets { display: flex; flex-wrap: wrap; gap: .5rem; }
.design-admin__colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin: 1rem 0; }
.design-admin__color { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.design-admin__color input[type=color] { width: 36px; height: 28px; padding: 0; border: 1px solid var(--border-color); border-radius: 6px; background: none; }
.design-admin__color code { margin-left: auto; font-size: .8rem; color: #64748b; }
.design-admin__preview { padding: 1.25rem; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-color); color: var(--text-color); margin-bottom: 1rem; }
.design-admin__preview-card { background: color-mix(in srgb, var(--bg-color) 85%, #fff); border: 1px solid var(--border-color); border-radius: 8px; padding: 1rem; }
.design-admin__preview a { color: var(--primary-color); }
.design-admin__dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 .2rem 0 .6rem; vertical-align: middle; }
.design-admin__dot[data-dot=success] { background: var(--success-color); }
.design-admin__dot[data-dot=warning] { background: var(--warning-color); }
.design-admin__dot[data-dot=error] { background: var(--error-color); }
.design-admin__results { padding-left: 1.25rem; }
.design-admin__results li { margin: .5rem 0; }

/* ── Home pitches: ideas to claim (owner 2026-11-02, F1) ─────────────────── */
home-pitches-component { display: block; width: 100%; max-width: 640px; margin: 0 auto 1rem; }
.home-pitches { border: 1px solid var(--border-color); border-radius: 16px; padding: .9rem 1rem 1rem; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.home-pitches__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .35rem; }
.home-pitches__label { color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.home-pitches__count { color: #94a3b8; }
.home-pitches__row { display: flex; align-items: center; gap: .5rem; min-height: 4.2rem; }
.home-pitches__text { flex: 1; margin: 0; text-align: center; color: var(--text-color); animation: hl-fade-in .35s ease-out; }
@media (prefers-reduced-motion: reduce) { .home-pitches__text { animation: none; } }
@keyframes hl-fade-in { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.home-pitches__nav { flex: none; }
.home-pitches__actions { display: flex; flex-direction: column; align-items: center; gap: .4rem; margin-top: .6rem; }
.home-pitches__help { text-align: center; }
.home-pitches__note { margin: .4rem 0 0; font-size: .85rem; color: var(--error-color); text-align: center; }
.home-pitches__note:empty { display: none; }
.home-pitches__or { text-align: center; margin: 1rem 0 0; font-size: 1.35rem; font-weight: 700; letter-spacing: .12em; color: #64748b; }

.home-pitches--done { display: flex; align-items: baseline; gap: .6rem; padding: .6rem 1rem; }
.home-pitches--done .home-pitches__text { text-align: left; margin: 0; }
/* once the chat has content the carousel steps aside; a claimed idea stays as one line */
.home-page--chat home-pitches-component:not(.home-pitches--claimed) { display: none; }
@media (max-width: 480px) { .home-pitches { padding: .7rem .6rem .8rem; border-radius: 12px; } .home-pitches__row { min-height: 5.4rem; } }
.ha-pitches { width: 100%; } .ha-pitches .ha-pitch-text { width: 100%; min-width: 260px; } .ha-pitch-actions { white-space: nowrap; } .ha-pitch-actions .spectrum-Button { margin-right: .25rem; }

/* ── Project page (owner 2026-11-02, F2): Spectrum breadcrumbs, cards, status lights, step list ── */
.pd2 { max-width: 1040px; }
.pd2__crumbs { margin-bottom: .5rem; }
.pd2__crumbs .spectrum-Breadcrumbs-itemLink { font-size: .85rem; color: #64748b; text-decoration: none; cursor: pointer; }
.pd2__crumbs .spectrum-Breadcrumbs-itemLink[aria-current] { color: var(--text-color); cursor: default; }
.pd2__crumbs .spectrum-Breadcrumbs-itemSeparator { width: 10px; height: 10px; margin: 0 .35rem; color: #94a3b8; }
.pd2__header { margin-bottom: 1.25rem; }
.pd2__title-row { display: flex; align-items: flex-start; gap: .75rem; }
.pd2__title-row .project-detail__name { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; margin: 0; }
.pd2__header-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; flex: none; }
.pd2__meta { margin-top: .4rem; gap: .6rem; }
.pd2__alert { margin-bottom: 1rem; }
.pd2__cards { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .9rem; border: none; }
.pd2__card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border-color); border-radius: 12px; background: #fff; padding: 0; }
.pd2__card--building { border-color: var(--warning-color); }
.pd2__card-body { padding: .9rem 1rem .5rem; flex: 1; }
.pd2__cards a { font-family: inherit; font-size: inherit; }
.pd2__cards .spectrum-Button { font-family: inherit; }
.pd2__card-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; margin: 0 0 .5rem; }
.pd2__card-content { font-size: .9rem; }
.pd2__card-footer { display: flex; flex-wrap: wrap; gap: .4rem; padding: .5rem 1rem .9rem; border-top: 1px solid #f1f5f9; }
.pd2__line { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .6rem; min-height: 1.6rem; }
.pd2__path { display: block; margin: .35rem 0; color: var(--primary-color); font-family: monospace; font-size: .82rem; overflow-wrap: anywhere; text-decoration: none; }
.pd2__path:hover { text-decoration: underline; }
.pd2__hint { margin: .35rem 0 0; font-size: .85rem; color: #64748b; }
.pd2__pending { opacity: .9; }
.pd2__section { margin-bottom: 1.5rem; padding: 1rem; border: 1px solid var(--border-color); border-radius: 12px; background: #fff; }
.pd2__section-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.pd2__h { font-size: .95rem; font-weight: 700; margin: 0; }
.pd2__steplist { margin: .25rem 0 .75rem; }
.pd2__steplist .spectrum-Steplist-label { font-size: .8rem; }
.pd2__steps-text { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.pd2__steps-text li { display: grid; grid-template-columns: 9rem 1fr; gap: .5rem; font-size: .9rem; padding: .4rem .5rem; border-radius: 8px; }
.pd2__steps-text li.is-current { background: #f1f5f9; }
.pd2__steps-text .pd-next__title { font-weight: 600; }
@media (max-width: 600px) { .pd2__steps-text li { grid-template-columns: 1fr; gap: .15rem; } .pd2__title-row { flex-wrap: wrap; } .pd2__header-actions { margin-left: 0; width: 100%; } .pd2__steplist { display: none; } .pd2 .pd-linked-boards__actions select { flex: 1 1 100%; } }
.pd2__avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-color); color: var(--primary-contrast, #fff); font-size: .7rem; font-weight: 700; flex: none; }
.pd2__avatar--agent { background: #f1f5f9; font-size: .9rem; }
.pd2__member { gap: .6rem; }
.pd2__member > span:first-child { flex: none; }
.pd2 .pd-linked-boards__actions select, .pd2 .project-detail__member-add select { max-width: 100%; min-width: 0; }
.pd2 .pd-linked-boards__actions { align-items: stretch; }
.pd2__member-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pd2__summary { cursor: pointer; font-weight: 600; font-size: .95rem; display: flex; align-items: center; gap: .4rem; list-style: none; }
.pd2__summary::-webkit-details-marker { display: none; }
.pd2__summary-icon { width: 10px; height: 10px; transition: transform .15s; }
details[open] > .pd2__summary .pd2__summary-icon { transform: rotate(90deg); }
.pd2 .project-detail__deployment { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: .875rem; padding: .3rem 0; }
.pd2 .project-detail__deploy-note { font-size: 11px; color: #64748b; }
.pd2 .spectrum-StatusLight { font-size: .85rem; }
.pd-rail { padding: .25rem 0; }
.pd-rail__actions { display: flex; flex-direction: column; gap: .4rem; margin: .5rem 0 1rem; }
.pd-rail__actions .spectrum-Button { justify-content: center; }
.pd-rail__label { color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; margin: .75rem 0 .35rem; }
.pd-rail__members { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.pd-rail__members li { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.pd-rail__last { font-size: .9rem; color: #475569; margin: 0; }

/* ── Card rail (owner 2026-11-02, F3): title, description, tasks, then the chat as the main element ── */
card-component { display: flex; flex-direction: column; min-height: 100%; }
.cd { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cd__crumbs { display: flex; align-items: center; gap: .25rem; color: #94a3b8; margin-bottom: .25rem; }
.cd__crumb-sep { width: 8px; height: 8px; color: #cbd5e1; }
.cd__title-row { margin-bottom: .5rem; align-items: center; }
.cd__title-row .card-detail__title { font-size: 1.05rem; line-height: 1.35; }
.cd .card-detail__desc-wrap { margin-bottom: .6rem; }
.cd__meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; color: #94a3b8; margin-bottom: .6rem; }
.cd__linkish { background: none; border: none; padding: 0; color: var(--primary-color); font: inherit; cursor: pointer; }
.cd__alert { margin-bottom: .6rem; }
.cd__note { margin-bottom: .5rem; }
.cd__accordion { margin-bottom: .75rem; border-top: 1px solid var(--border-color); }
.cd__section { border-bottom: 1px solid var(--border-color); padding: 0; margin: 0; }
.cd__section-head { display: flex !important; flex-direction: row !important; align-items: center; gap: .25rem; margin: 0; padding: .35rem 0; }
.cd__section-toggle.spectrum-Accordion-itemHeader { min-height: 0; padding: .3rem 0; }
.cd__section-toggle { flex: 1; min-width: 0; display: flex; align-items: center; background: none; border: none; padding: .3rem 0; text-align: left; font: inherit; font-weight: 600; font-size: .9rem; color: var(--text-color); cursor: pointer; order: 0; }
.cd__section-toggle:hover { color: var(--primary-color); }
.cd__count { font-weight: 500; color: #94a3b8; font-size: .8rem; margin-left: .25rem; }
.cd__section-icon { order: -1; width: 12px; height: 12px; color: #94a3b8; display: inline-flex; }
.cd__section-icon .spectrum-Icon { width: 10px; height: 10px; }
.cd__section-body { padding: 0 0 .5rem 1rem; }
.cd__section:not(.is-open) .cd__section-body > .card-detail__add-task-form,
.cd__section:not(.is-open) .cd__section-body > .card-detail__add-subcard-form { display: none !important; }
.cd__task { display: flex; align-items: flex-start; gap: .5rem; padding: .25rem 0; }
.cd__check { flex: none; margin-top: .1rem; }
.cd__task .task-title { flex: 1; min-width: 0; font-size: .9rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.cd__task .task-title.task-title--open { white-space: normal; }
.cd__task .task-title--done { text-decoration: line-through; color: #94a3b8; }
.cd__avatar { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--primary-color); color: var(--primary-contrast, #fff); font-size: .65rem; font-weight: 700; flex: none; }
.cd__input { width: 100%; padding: .4rem .55rem; border: 1px solid var(--border-color); border-radius: 6px; font: inherit; font-size: .9rem; }
.cd .card-detail__add-form { display: flex; flex-direction: column; gap: .4rem; margin: .25rem 0 .5rem; }
.cd__chat { display: flex; flex-direction: column; flex: 1; min-height: 360px; border-top: none; padding-top: 0; margin-top: 0; }
.cd__chat-head { display: flex; align-items: center; gap: .35rem; margin-bottom: .35rem; }
.cd__chat-title { flex: 1; font-size: .9rem; font-weight: 700; margin: 0; }
.cd__help { position: relative; }
.cd__help-pop { position: absolute; right: 0; top: 2rem; width: min(320px, 80vw); z-index: 5; display: none; padding: .9rem 1rem; }
.cd__help-pop.is-open { display: block; }
.cd__help-pop .spectrum-ContextualHelp-heading { font-size: .95rem; margin: 0 0 .5rem; }
.cd__help-pop p { margin: 0 0 .5rem; font-size: .85rem; }
.cd__help-pop code { background: #f1f5f9; padding: 0 .3em; border-radius: 3px; }
.cd__unfocus { display: none; }
.cd__chat hitloop-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cd__chat .chat-wrap { flex: 1; height: auto; min-height: 300px; }
/* chat focus: the top folds to the title line; the chat takes the rest of the rail */
.card-detail--focus .cd__top > *:not(.cd__title-row):not(.cd__crumbs) { display: none; }
.card-detail--focus .cd__title-row { margin-bottom: .35rem; cursor: pointer; }
.card-detail--focus .cd__title-row .card-detail__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-detail--focus .cd__unfocus { display: inline-flex; }
.card-detail--focus .cd__chat { min-height: 0; }
.card-detail--focus .cd__chat .chat-wrap { min-height: 0; }
.rail__content:has(.card-detail--focus) { display: flex; flex-direction: column; overflow: hidden; padding-top: .75rem; }
/* the chat list: Slack-like */
.chat-day { display: flex; align-items: center; gap: .6rem; margin: .5rem 0 .25rem; color: #94a3b8; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.chat-day::before, .chat-day::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }
.chat-message--cont { padding-top: .05rem; padding-bottom: .05rem; }
.chat-message__gutter { width: 28px; flex: none; font-size: .65rem; text-align: right; opacity: 0; line-height: 1.6; }
.chat-message:hover .chat-message__gutter { opacity: 1; }
.chat-message--cont .chat-message__header:empty { display: none; }
.chat-avatar.spectrum-Avatar { font-size: .75rem; }
.chat-input-footer-left.spectrum-ActionGroup { gap: .1rem; }
.chat-input-footer .chat-toolbar-btn { border: none; }
/* the board: breadcrumbs above the header */
.board-crumbs { margin: 0 0 .35rem; }
.board-crumbs .spectrum-Breadcrumbs-itemLink { font-size: .85rem; color: #64748b; text-decoration: none; cursor: pointer; }
.board-crumbs .spectrum-Breadcrumbs-itemLink[aria-current] { color: var(--text-color); cursor: default; }
.board-crumbs .spectrum-Breadcrumbs-itemSeparator { width: 10px; height: 10px; margin: 0 .35rem; color: #94a3b8; }

/* ── Publish dialog and state (owner 2026-11-02, F4) ────────────────────── */
.pd-dialog-wrap { position: fixed; inset: 0; z-index: 2100; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.pd-dialog-underlay { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.pd-dialog-modal { position: relative; z-index: 1; max-width: 480px; width: 100%; }
.pd-dialog { background: #fff; border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.25); padding: 1.25rem 1.5rem; }
.pd-dialog .spectrum-Dialog-heading { font-size: 1.2rem; font-weight: 700; margin: 0 0 .75rem; }
/* Spectrum's .spectrum-Dialog is a flex row: its one child holds the heading, the content and the footer */
.pd-dialog__grid { flex: 1 1 auto; min-inline-size: 0; }
/* the dialog fills its modal: Spectrum's size classes are narrower than the modal and showed a white band */
.pd-dialog-modal .pd-dialog { inline-size: 100%; box-sizing: border-box; }
.pd-dialog__divider { border: none; border-top: 1px solid var(--border-color); margin: 0 0 .9rem; }
.pd-dialog__content p { margin: 0 0 .6rem; font-size: .95rem; }
.pd-dialog__url code { font-size: .9rem; }
.pd-dialog__footer { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; padding-block-start: 0; }
.pd2__publish { margin-bottom: .6rem; }
.pd2__progress { width: 100%; margin: .4rem 0; }
.pd2__progress .spectrum-ProgressBar-track { height: 6px; border-radius: 3px; background: #e2e8f0; overflow: hidden; }
.pd2__progress .spectrum-ProgressBar-fill { height: 100%; width: 40%; border-radius: 3px; background: var(--primary-color); animation: hl-indeterminate 1.4s ease-in-out infinite; }
@keyframes hl-indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { .pd2__progress .spectrum-ProgressBar-fill { animation: none; width: 100%; opacity: .5; } }
.pd2__publish[data-state] ~ .pd2__pending { display: none; }
.pd2__publish[data-state=publishing] ~ .pd2__line .pd-env-deploy, .pd2__publish[data-state=done] ~ .pd2__line .pd-env-deploy { display: none; }

/* ── Project page fixes (owner 2026-11-02) ───────────────────────────────── */
/* Spectrum's card draws a full-size focus layer over its content: it took every click */
.pd2__card::before, .pd2__card::after { display: none; }
/* Linked boards: the board link, Unlink at its right; a type-ahead below */
.pd2__boards { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.pd2__board { display: flex !important; flex-direction: row !important; align-items: center; justify-content: space-between; gap: 1rem; padding: .3rem .25rem; border-radius: 6px; }
.pd2__board:hover { background: #f8fafc; }
.pd2__board-link { flex: 1; min-width: 0; color: var(--primary-color); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.pd2__board-link:hover { text-decoration: underline; }
.pd2__unlink { flex: none; color: #64748b; }
.pd2__combo { position: relative; width: 100%; }
.pd2__combo-field { width: 100%; }
.pd2__combo-input { width: 100%; box-sizing: border-box; padding: .45rem .6rem; border: 1px solid var(--border-color); border-radius: 6px; font: inherit; font-size: .9rem; background: #fff; }
.pd2__combo-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color) 20%, transparent); }
.pd2__combo-pop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: .25rem 0; max-height: 260px; overflow-y: auto; }
.pd2__combo-pop[hidden] { display: none; }
.pd2__combo-menu { list-style: none; margin: 0; padding: 0; }
.pd2__combo-item, .pd2__combo-empty { padding: .45rem .75rem; font-size: .9rem; cursor: pointer; }
.pd2__combo-item:hover, .pd2__combo-item.is-focused { background: #f1f5f9; }
.pd2__combo-empty { color: #94a3b8; cursor: default; }
.pd2__combo-pop.is-open { visibility: visible; opacity: 1; transform: none; }
.pd-next__lead { margin: 0 0 .5rem; }

/* Budgeted actions (owner 2026-11-04): the "save your work" reminder (a Spectrum toast in the
   toast slot), the add-funds dialog (pd-dialog classes) and the balance page. */
.budget-reminder { margin: 0 0 .5rem auto; max-width: 440px; width: 100%; pointer-events: auto; box-sizing: border-box; }
.budget-reminder .spectrum-Toast-body { gap: .5rem; flex-wrap: wrap; }
.budget-reminder .spectrum-Toast-buttons { gap: .4rem; }
.budget-funds__field { width: 100%; margin: .25rem 0 .5rem; }
.budget-funds__field .spectrum-Textfield-input { width: 100%; box-sizing: border-box; }
.budget-funds__msg { min-height: 1.2em; color: var(--danger-color, #b42318); font-size: .9rem; margin: 0; }
.budget-page__balance { font-size: 2rem; font-weight: 700; margin: .25rem 0; }
.budget-page__table { width: 100%; border-collapse: collapse; margin-top: .5rem; font-size: .92rem; }
.budget-page__table th, .budget-page__table td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--border-color); }
.budget-page__amount { text-align: right; font-variant-numeric: tabular-nums; }
.budget-page__amount.is-credit { color: var(--success-color, #067647); }
@media (max-width: 600px) { .budget-reminder { max-width: none; } }

/* ── Project sections (owner 2026-11-08): Overview · Chat · Wiki · Files as Spectrum Tabs on the
   project pages; on a board or a card the project chip opens a Spectrum Menu in a Popover ── */
.pnav { position: relative; margin: .25rem 0 1rem; }
.pnav .spectrum-Tabs-item { text-decoration: none; }
.pnav .spectrum-Tabs-item.is-disabled { cursor: default; }
.pnav__soon { font-size: .62rem; margin-left: .3rem; opacity: .65; text-transform: uppercase; letter-spacing: .05em; }
.pnav__indicator { position: absolute; bottom: 0; left: 0; height: 2px; background: var(--primary-color); transition: transform .15s ease, width .15s ease; }
.pnav__menu-wrap { position: relative; display: inline-flex; }
.pnav__popover { position: absolute; top: calc(100% + 4px); left: 0; z-index: 40; min-width: 180px; }
.pnav__chev { margin-left: .15rem; width: 10px; height: 10px; }
.pd2__soon { margin: 3rem auto; text-align: center; max-width: 32rem; display: flex; flex-direction: column; gap: .75rem; align-items: center; }

/* ── The project chat: a Slack-like list and conversation ── */
project-chat-component { display: block; }
.pchat { display: flex; flex-direction: column; height: calc(100vh - var(--nav-height) - 4rem); min-height: 480px; }
.pchat .pnav { margin-bottom: .6rem; }
.pchat__body { flex: 1; min-height: 0; display: grid; grid-template-columns: 264px minmax(0, 1fr); border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; background: #fff; }
.pchat__side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border-color); background: #f8fafc; }
.pchat__side-head { padding: .65rem .75rem .35rem; display: flex; flex-direction: column; gap: .45rem; }
.pchat__title { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pchat__search { width: 100%; }
.pchat__search .spectrum-Textfield { width: 100%; }
.pchat__nav { flex: 1; overflow-y: auto; padding: 0 .4rem .5rem; }
.pchat__nav .spectrum-SideNav { max-width: none; }
.pchat__nav > .spectrum-SideNav > .pchat__section { margin-top: .35rem; }
.pchat__heading { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin: .5rem .35rem .1rem; }
.pchat__sec-toggle { display: inline-flex; align-items: center; gap: .3rem; background: none; border: 0; padding: .1rem .15rem; cursor: pointer; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; border-radius: 4px; }
.pchat__sec-toggle:hover { background: rgba(15, 23, 42, .05); }
.pchat__sec-chev { width: 10px; height: 10px; }
.pchat__count { font-weight: 700; font-size: .66rem; background: var(--primary-color); color: #fff; border-radius: 999px; padding: .05rem .4rem; line-height: 1.2; }
.pchat__addr { color: #64748b; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: 0; font-weight: 400; }
.pchat__sec--closed { display: none; }
.pchat__link { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.pchat__link .spectrum-SideNav-link-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.pchat__mark { width: 1em; text-align: center; color: #94a3b8; font-size: .85em; flex-shrink: 0; }
.pchat__unread .spectrum-SideNav-link-text { font-weight: 700; color: #0f172a; }
.pchat__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-color); flex-shrink: 0; }
.pchat__plus-btn { background: none; border: 0; width: 100%; text-align: left; cursor: pointer; font: inherit; color: #64748b; }
.pchat__plus-btn:hover { color: var(--primary-color); }
.pchat__empty { padding: .15rem .75rem .25rem; color: #94a3b8; list-style: none; }
.pchat__side-foot { padding: .4rem .5rem; border-top: 1px solid var(--border-color); }
.pchat__main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pchat__head { display: flex; align-items: center; gap: .4rem; padding: .5rem .85rem; border-bottom: 1px solid var(--border-color); min-height: 50px; }
.pchat__head-text { min-width: 0; display: flex; flex-direction: column; gap: .05rem; }
.pchat__name { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pchat__sub, .pchat__open { color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.pchat__back { display: none; flex-shrink: 0; }
.pchat__conv { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 .85rem .6rem; }
.pchat__conv hitloop-chat, .pchat__conv hitloop-mail-thread { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.pchat__conv .chat-wrap { flex: 1; height: auto; min-height: 0; }
.pchat__conv--none { align-items: center; justify-content: center; }
.pchat__ill { margin: auto; text-align: center; padding: 1rem; }
.pchat__compose { padding: .85rem; display: flex; flex-direction: column; gap: .6rem; overflow: auto; }
.pchat__field { width: 100%; display: flex; flex-direction: column; }
.pchat__field .spectrum-Textfield-input { width: 100%; }
.pchat__compose-actions { display: flex; gap: .5rem; justify-content: flex-end; }

/* the email thread as a chat */
.mail-thread__to { color: #64748b; padding: 0 0 .25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-thread__hint { color: #94a3b8; margin-right: auto; }
.chat-avatar--mail { background: #64748b; }
.mail-msg__addr { color: #94a3b8; }

/* Slack-like: a message's actions show on hover (always when it has replies, always on touch) */
.chat-message { position: relative; }
@media (hover: hover) {
    .chat-message__actions { opacity: 0; transition: opacity .1s; }
    .chat-message:hover .chat-message__actions, .chat-message:focus-within .chat-message__actions, .chat-message--has-replies .chat-message__actions { opacity: 1; }
}

/* a phone: the list fills the screen; a conversation opens over it with Back (Slack mobile) */
@media (max-width: 768px) {
    .pchat { height: calc(100dvh - var(--nav-height) - 2rem); min-height: 0; }
    .pchat__crumbs { display: none; }
    .pchat__body { grid-template-columns: minmax(0, 1fr); border: 0; border-radius: 0; }
    .pchat__side { border-right: 0; }
    .pchat__main { display: none; }
    .pchat--conv .pchat__side { display: none; }
    .pchat--conv .pchat__main { display: flex; }
    .pchat--conv .pnav { display: none; }
    .pchat__back { display: inline-flex; }
    .pchat__head { padding-left: .35rem; }
    .pnav__popover { left: auto; right: 0; }
}

/* the project's Boards section (owner 2026-11-09): the linked boards as a list */
.pd2__boards--page { margin: 1rem 0; max-width: 40rem; }
.pd2__boards--page .pd2__board { padding: .5rem 0; border-bottom: 1px solid var(--spectrum-gray-200, #e1e1e1); }

/* Agents and agencies (owner 2026-11-09): components/agents/agents-component.js */
.ag { max-width: 960px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.ag-search { width: 100%; max-width: 40rem; margin: .5rem 0 .25rem; }
.ag-search .spectrum-Search-textfield, .ag-search .spectrum-Search-input { width: 100%; }
.ag-help { color: var(--spectrum-gray-700, #475569); font-size: .85rem; margin: .25rem 0 .75rem; }
.ag-results { list-style: none; padding: 0; margin: 0 0 1.5rem; display: flex; flex-direction: column; gap: .4rem; }
.ag-result { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .55rem .75rem; border: 1px solid var(--spectrum-gray-200, #e2e8f0); border-radius: 8px; }
.ag-result__name { font-weight: 600; }
.ag-result__summary { flex: 1 1 14rem; min-width: 0; color: var(--spectrum-gray-700, #475569); font-size: .9rem; }
.ag-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.ag-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }
.ag-card { padding: .9rem 1rem; }
.ag-card__title { font-weight: 700; display: block; margin-bottom: .25rem; }
.ag-card__text { margin: 0 0 .4rem; font-size: .9rem; }
.ag-card__meta { color: var(--spectrum-gray-700, #475569); font-size: .8rem; margin: 0 0 .75rem; }
.ag-empty { color: var(--spectrum-gray-700, #475569); list-style: none; }
.ag-members { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .35rem; }
.ag-member { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--spectrum-gray-200, #e2e8f0); }
.ag-member__name { font-weight: 600; }
.ag-member__role { flex: 1 1 12rem; max-width: 20rem; }
.ag-add { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1.25rem; }
.ag-add select, .ag-add input { flex: 1 1 12rem; max-width: 18rem; }
.ag-switch-row { margin: .35rem 0; }
.ag-delete { margin-top: 1.5rem; }
.ag-modal { max-width: 640px; }
.ag-form { display: flex; flex-direction: column; gap: .35rem; max-height: 65vh; overflow: auto; }
.ag-field, .ag-field .spectrum-Textfield-input { width: 100%; }
.ag-pick { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .35rem; }
.ag-pick__row { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(8rem, 1.4fr) auto; gap: .5rem; align-items: center; }
.ag-pick__agent, .ag-pick__orch { font-size: .9rem; display: flex; align-items: center; gap: .3rem; }
@media (max-width: 600px) {
    .ag-pick__row { grid-template-columns: 1fr; }
    .ag-head { flex-direction: column; align-items: flex-start; }
}

/* Balance in the header, with Add funds (owner 2026-11-09) */
#user-info { display: flex; align-items: center; gap: 0.75rem; }
.budget-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.25rem 0.2rem 0.6rem;
    border: 1px solid var(--border-color); border-radius: 999px; white-space: nowrap; }
.budget-chip__label { color: var(--text-secondary); font-size: 0.8rem; }
.budget-chip__amount { color: var(--text-color); font-variant-numeric: tabular-nums; }
.budget-chip--low { border-color: var(--warning-color); }
.budget-chip--out .budget-chip__amount { color: var(--error-color); }
@media (max-width: 640px) {
    .budget-chip__label { display: none; }
    .budget-chip { padding-left: 0.45rem; }
}

/* A project's Total Cost, near the top of its page (owner 2026-11-09) */
.pd2__cost { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; margin: 0.5rem 0 0.25rem; }
.pd2__cost-total { display: flex; align-items: baseline; gap: 0.5rem; }
.pd2__cost-label { color: var(--text-secondary); }
.pd2__cost-amount { margin: 0; font-variant-numeric: tabular-nums; }
.pd2__cost-balance { display: flex; align-items: center; gap: 0.5rem; }
.pd2__cost-balance strong { color: var(--text-color); font-variant-numeric: tabular-nums; }

/* What the agents in a chat have cost so far (owner 2026-11-09) */
.chat-cost-live { font-size: 0.8rem; color: var(--text-secondary); padding: 0.15rem 0.5rem; font-variant-numeric: tabular-nums; }
/* Stop (owner 2026-11-19): beside Send while an agent is at work in this chat. Spectrum: button (negative, outline), help-text */
.chat-input-footer-right { display: flex; align-items: center; gap: 0.4rem; }
.chat-stop-note { padding: 0.15rem 0.5rem; }
/* an agent's steps in a chat (owner 2026-11-19): the home chat's status lines, in every chat */
.chat-agent-progress { margin: 0.35rem 0.5rem; padding: 0.4rem 0.6rem; border-left: 3px solid var(--spectrum-accent-color-800, #5b5bd6); font-size: 0.85rem; color: var(--text-secondary); max-width: 100%; overflow-wrap: anywhere; }
.chat-agent-progress__who { font-weight: 600; margin-bottom: 0.15rem; }
.chat-agent-progress__steps { list-style: none; margin: 0; padding: 0; }
.chat-agent-progress__step { display: flex; gap: 0.4rem; align-items: baseline; padding: 0.05rem 0; }
.chat-agent-progress__step .home-chat__status-dot { display: none; }
.chat-agent-progress__step--live { color: var(--text-primary); }
.chat-agent-progress__step--live .home-chat__status-dot { display: inline-block; }
.chat-agent-progress__detail { color: var(--text-secondary); }

/* ── Project Marketing section (PLAN_MARKETING_SUITE.md, Phase 1) ─────────────────────────── */
.pmk { display: flex; flex-direction: column; gap: .75rem; max-width: 1100px; }
.pmk__body { display: flex; flex-direction: column; gap: 1.25rem; padding-top: .5rem; }
.pmk__empty { max-width: 560px; margin: 2rem auto; text-align: center; gap: .75rem; }
.pmk__hint, .pmk__none { color: var(--spectrum-neutral-subdued-content-color-default, var(--text-secondary)); }
.pmk__section { display: flex; flex-direction: column; gap: .5rem; }
.pmk__well { display: flex; align-items: center; justify-content: space-between; gap: .75rem; overflow-x: auto; }
.pmk__code { font-family: var(--spectrum-code-font-family, ui-monospace, monospace); font-size: .8rem; white-space: nowrap; }
.pmk__bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.pmk__field { display: flex; flex-direction: column; gap: .2rem; }
.pmk__select { min-width: 180px; }
.pmk__table { width: 100%; }
.pmk__ci, .pmk__desc { color: var(--spectrum-neutral-subdued-content-color-default, var(--text-secondary)); font-size: .8em; }
.pmk__pbest { min-width: 140px; }
.pmk__exp { background: var(--spectrum-gray-75, transparent); }
.pmk__summary { margin: 0; }
@media (max-width: 768px) {
    .pmk__table { display: block; overflow-x: auto; }
    .pmk__select { min-width: 0; width: 100%; }
    .pmk__field { flex: 1 1 140px; }
}

/* Marketing → Creatives (Studio, PLAN_MARKETING_SUITE.md Phase 2) */
.pmk__make { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.pmk__field--grow { flex: 1 1 320px; }
.pmk__field--grow .spectrum-Textfield { width: 100%; }
.pmk__assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.pmk__asset { width: auto; }
.pmk__preview { min-height: 140px; display: flex; align-items: center; justify-content: center; background: var(--spectrum-gray-100, #f3f3f3); overflow: hidden; }
.pmk__preview img, .pmk__preview video { width: 100%; max-height: 320px; object-fit: contain; display: block; }
.pmk__preview audio { width: 95%; }
.pmk__asset-foot { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.pmk__dl { font-size: .8em; }

/* Marketing → Campaigns (PLAN_MARKETING_SUITE.md Phase 3) */
.pmk__campaign { display: flex; flex-direction: column; gap: .4rem; padding: .75rem 0; border-top: 1px solid var(--border-color); }
.pmk__campaign:first-child { border-top: 0; }
.pmk__campaign h3 { margin: 0; }
.pmk__decisions ul { margin: .25rem 0 0 1rem; padding: 0; }

/* admin Marketing page (components/admin/marketing-admin.js) */
.mka { max-width: 1100px; }
.mka-section { margin: 1.5rem 0; display: flex; flex-direction: column; gap: .5rem; }
.mka-muted { color: var(--spectrum-gray-700, #6e6e6e); font-size: .85rem; }
.mka-table { width: 100%; }
.mka-keys { font-size: .8rem; word-break: break-word; }
.mka-num { display: inline-flex; align-items: center; gap: .25rem; width: 8.5rem; }
.mka-num .spectrum-Textfield-input { width: 6.5rem; }
.mka-unit { color: var(--spectrum-gray-700, #6e6e6e); font-size: .85rem; }
.mka-actions { display: flex; justify-content: flex-end; }
@media (max-width: 640px) { .mka-table .spectrum-Table-cell { padding: .4rem; } .mka-num { width: 7rem; } }
.pmk__settings { margin-top: .5rem; }
.pmk__settings > summary { cursor: pointer; }
.pmk__settings-form { display: flex; flex-direction: column; gap: .75rem; padding: .75rem 0; }
.pmk__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem .75rem; }
.pmk__grid .spectrum-Textfield { width: 100%; }
.pmk__limits { display: flex; flex-direction: column; gap: .5rem; padding: .75rem; margin-bottom: 1rem; border: 1px solid var(--spectrum-gray-300, #d1d1d1); border-radius: 8px; }
.pmk__meter { width: 100%; --mod-meter-inline-size: 100%; --mod-meter-max-width: 100%; }
.pmk__bar--end { justify-content: flex-end; gap: .5rem; }

/* Hitloop's own measurement: the consent banner (components/shared/measure.js) */
.hl-measure { position: fixed; inset-inline: 16px; inset-block-end: 16px; z-index: 1000; max-inline-size: 720px; margin-inline: auto; }

/* Inbox (/inbox, owner 2026-11-12) */
.inbox { max-width: 1200px; }
.inbox__layout { display: flex; gap: 1.5rem; align-items: flex-start; }
.inbox__side { flex: 0 0 240px; display: flex; flex-direction: column; gap: .5rem; position: sticky; top: 1rem; }
.inbox__picker { width: 100%; }
.inbox__side .spectrum-Button { align-self: flex-start; }
.inbox__main { flex: 1; min-width: 0; }
.inbox__table { width: 100%; table-layout: fixed; }
.inbox__table th:nth-child(1) { width: 28%; }
.inbox__table th:nth-child(3) { width: 11rem; }
.inbox__who, .inbox__when { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--spectrum-gray-800, #4b4b4b); }
.inbox__subject { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox__subject:hover, .inbox__subject:focus-visible { text-decoration: underline; }
.inbox__row--unread .inbox__subject, .inbox__row--unread .inbox__who { font-weight: 700; }
.inbox__message { display: flex; flex-direction: column; gap: .75rem; padding: .5rem 0; }
.inbox__meta { font-size: .85rem; display: grid; gap: .15rem; }
.inbox__text { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: .95rem; margin: 0; max-height: 60vh; overflow: auto; }
.inbox__html { width: 100%; height: 60vh; display: block; border: 1px solid var(--spectrum-gray-300, #d5d5d5); border-radius: 4px; background: #fff; }
.inbox__actions { display: flex; gap: .5rem; }
.inbox__reply { display: flex; flex-direction: column; gap: .5rem; max-width: 720px; }
.inbox__reply[hidden] { display: none; }
.inbox__textarea, .inbox__textarea textarea { width: 100%; }
@media (max-width: 720px) {
    .inbox__layout { flex-direction: column; }
    .inbox__side { position: static; flex-basis: auto; width: 100%; }
    .inbox__table th:nth-child(1) { width: 35%; }
    .inbox__table th:nth-child(3) { width: 7rem; }
}

/* ── Chats in no project (rooms-component, owner 2026-11-16): the project chat's layout, plus the people panel ── */
.rooms .pchat__head { flex-wrap: wrap; }
.rooms__head-spacer { flex: 1; }
.rooms__people { display: flex; flex-direction: column; gap: .5rem; padding: .5rem .85rem; border-bottom: 1px solid var(--border-color); background: #f8fafc; position: relative; }
.rooms__tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.rooms__tag { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .5rem; border: 1px solid var(--border-color); border-radius: 999px; background: #fff; font-size: .8rem; }
.rooms__tag--agent { border-color: #c7d2fe; background: #eef2ff; }
.rooms__drop { background: none; border: 0; cursor: pointer; color: #64748b; padding: 0 0 0 .15rem; line-height: 1; display: inline-flex; }
.rooms__drop:hover { color: #b91c1c; }
.rooms__add { max-width: 360px; }
.rooms__found { position: absolute; top: 100%; left: .85rem; z-index: 5; min-width: 260px; max-width: 360px; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, .12); padding: .25rem 0; margin: 0; list-style: none; }
.rooms__found-item { padding: .4rem .75rem; cursor: pointer; font-size: .9rem; }
.rooms__found-item:hover { background: #f1f5f9; }
.rooms__found-item.is-disabled { color: #94a3b8; cursor: default; }
.rooms__field { width: 100%; margin-bottom: .6rem; }
.rooms__field .spectrum-Textfield-input { width: 100%; }
.rooms__help { margin: 0; color: #64748b; }

/* "Report a problem" (2026-11-19): the dialog. Design system: standard-dialog, drop-zone, text-area, help-text, in-line-alert. */
.prb__modal { max-width: 560px; }
.prb__content { display: flex; flex-direction: column; gap: .6rem; max-height: 70vh; overflow-y: auto; }
.prb__lead { margin: 0; }
/* two classes: the DropZone styles load after this file and set their own sizes */
.prb__content .prb__zone { box-sizing: border-box; inline-size: 100%; min-inline-size: 0; max-inline-size: none; padding: 1rem; text-align: center; }
.prb__zone.is-dragged { border-style: solid; }
.prb__zone-text { margin: 0 0 .6rem; }
.prb__zone-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.prb__preview { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.prb__preview[hidden], .prb__empty[hidden], .prb__alert[hidden] { display: none; }
.prb__img { max-inline-size: 100%; max-block-size: 220px; border: 1px solid var(--border-color); border-radius: 6px; }
.prb__field, .prb__field .spectrum-Textfield-input { inline-size: 100%; box-sizing: border-box; }
.prb__alert { inline-size: 100%; box-sizing: border-box; padding: .6rem .9rem; }
.prb__alert .spectrum-InLineAlert-content { margin: 0; }
.prb__field .spectrum-Textfield-input { min-block-size: 5.5rem; }
/* the settings for reports, with the agents' other platform settings */
.agent-instructions__settings--reports { border-top: 1px solid var(--border-color); padding-top: .75rem; }
.agent-instructions__settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .6rem .9rem; align-items: end; }
.agent-instructions__settings-grid > div { display: flex; flex-direction: column; gap: .2rem; }
.agent-instructions__settings-grid .spectrum-Textfield, .agent-instructions__settings-grid .spectrum-Picker { inline-size: 100%; }

/* The Problem reports page (admin; owner 2026-11-19). Spectrum: table, checkbox, badge, action-bar. */
.reports__head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.reports__head h2 { margin: 0 auto 0 0; }
.reports__filter { width: auto; flex: 0 0 auto; }
.reports__bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; position: sticky; top: .5rem; z-index: 5; margin: .75rem 0; padding: .5rem .75rem;
    background: var(--spectrum-gray-100, #f3f3f3); border: 1px solid var(--spectrum-gray-300, #d5d5d5); border-radius: 8px; }
.reports__bar[hidden] { display: none; }
.reports__bar.is-open { block-size: auto; pointer-events: auto; }
.team-settings-page.reports { max-width: 960px; }
.reports__count { font-weight: 600; margin-right: auto; }
.reports__table { width: 100%; }
.reports__table td { vertical-align: top; }
.reports__pick { width: 2.5rem; }
.reports__text { white-space: pre-wrap; word-break: break-word; max-height: 9rem; overflow: auto; }
.reports__dim { font-size: .85rem; color: var(--spectrum-gray-700, #6d6d6d); word-break: break-word; }
.reports__links { font-size: .85rem; margin-top: .25rem; }

/* A project's Files page (owner 2026-11-19). Spectrum: table, breadcrumbs, drop-zone, button, alert-dialog. */
.pfl { display: flex; flex-direction: column; max-width: 1100px; }
.pfl__body { display: flex; flex-direction: column; gap: .75rem; }
.pfl__bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.pfl__path { margin: 0; padding: 0; flex-wrap: wrap; }
.pfl__path .spectrum-Breadcrumbs-itemLink { cursor: pointer; }
.pfl__path .spectrum-Breadcrumbs-itemLink[aria-current] { cursor: default; font-weight: 600; }
.pfl__path .spectrum-Breadcrumbs-itemSeparator { width: 10px; height: 10px; margin: 0 .35rem; }
.pfl .pfl__zone { box-sizing: border-box; inline-size: 100%; min-inline-size: 0; max-inline-size: none; padding: .75rem 1rem; text-align: center; }
.pfl__zone.is-dragged { border-style: solid; }
.pfl__zone-msg p { margin: 0; }
.pfl__table { width: 100%; }
.pfl__name { display: inline-flex; align-items: center; gap: .5rem; color: inherit; text-decoration: none; word-break: break-word; }
.pfl__name:hover span { text-decoration: underline; }
.pfl__name--folder { font-weight: 600; }
.pfl__icon { width: 18px; height: 18px; flex: none; color: var(--spectrum-gray-600, #8a8a8a); }
.pfl__dim { font-size: .85rem; color: var(--spectrum-gray-700, #6d6d6d); white-space: nowrap; }
p.pfl__dim { white-space: normal; margin: .25rem 0 0; }
.pfl__act { text-align: right; white-space: nowrap; }
.pfl__empty { margin: 2rem auto; }
@media (max-width: 640px) {
    .pfl__table th:nth-child(3), .pfl__table td:nth-child(3) { display: none; }
}
