﻿.create-project-page {
    padding: 2.5rem 3rem;
    background-color: #f7f7fb;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.create-project-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.create-project-header h1 {
    margin: 0;
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
}

.create-project-header p {
    margin: 0.35rem 0 0;
    color: #4b5563;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.back-button {
    padding: 0;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    display: block;
}

.back-button:hover {
    color: #2563eb;
}

.project-grid-two {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 960px) {
    .project-grid-two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ghost-icon-button {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #1f2937;
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ghost-icon-button:hover {
    background-color: #f3f4f6;
    border-color: #2563eb;
}

.icon-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.project-card {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

.project-execution-card {
    padding: 1.25rem;
    flex: 1;
    min-width: 0;
}

.project-execution-webchat-row {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.project-webchat-card {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .project-execution-webchat-row {
        flex-direction: column;
    }

    .project-execution-card,
    .project-webchat-card {
        max-width: 100%;
    }
}

.execution-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.execution-profile-item {
    border: 1px solid #e5e7eb;
    border-radius: 0.8rem;
    padding: 0.85rem 1rem;
    background-color: #fcfcff;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.execution-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.execution-value {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.execution-meta {
    font-size: 0.85rem;
    color: #6b7280;
}

.project-card label {
    display: block;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.4rem;
}

.project-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 0.65rem;
    border: 1px solid #d1d5db;
    font-size: 1rem;
    font-family: inherit;
}

.project-textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 0.65rem;
    border: 1px solid #d1d5db;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    background-color: #fff;
}

.project-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.project-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.section-heading h2,
.section-heading h3 {
    margin: 0;
}

.section-heading p {
    margin: 0.25rem 0 0;
    color: #4b5563;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.optional {
    background-color: #eef2ff;
    color: #4c1d95;
}

.badge.future {
    background-color: #fff7ed;
    color: #9a3412;
}

.constitution-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.constitution-field:last-child {
    margin-bottom: 0;
}

.category-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.category-chip {
    display: flex;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.85rem;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.category-chip:hover {
    border-color: #2563eb;
}

.category-chip.active {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.chip-icon {
    width: 32px;
    height: 32px;
    border-radius: 0.75rem;
    background-color: #eef2ff;
    color: #1d4ed8;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.chip-copy {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.chip-label {
    font-weight: 600;
    color: #111827;
}

.memory-options {
    display: grid;
    gap: 0.75rem;
}

.memory-option {
    border: 1px solid #d1d5db;
    border-radius: 0.85rem;
    padding: 0.9rem 1rem;
    display: flex;
    gap: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.memory-option input {
    margin-top: 0.35rem;
}

.memory-option.active {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.memory-copy .option-title {
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.memory-copy p {
    margin: 0;
    color: #4b5563;
}

.memory-copy small {
    color: #6b7280;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.placeholder-card {
    background-color: #fbfbff;
    border-style: dashed;
}

.placeholder-copy {
    margin: 0 0 0.75rem 0;
    color: #4b5563;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.metadata-placeholder {
    border: 1px dashed #cbd5e1;
    border-radius: 0.65rem;
    padding: 0.6rem 0.75rem;
    color: #6b7280;
    background-color: #fff;
}

.metadata-list {
    margin: 0 0 0.75rem;
    padding-left: 1.2rem;
    color: #4b5563;
    line-height: 1.4;
}

.project-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    background-color: #fff;
    gap: 1rem;
}

.helper-copy {
    color: #4b5563;
}

.footer-actions {
    display: flex;
    gap: 0.75rem;
}

.primary-button,
.secondary-button,
.ghost-button {
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    background-color: transparent;
    font-size: 0.875rem;
    height: 38px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.25rem;
    transition: all 0.15s ease;
}

.primary-button {
    background-color: #111827;
    color: #fff;
    border-color: #111827;
}

.primary-button:hover:not(:disabled) {
    background-color: #1f2937;
}

.primary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.secondary-button {
    border-color: #d1d5db;
    color: #1f2937;
    background-color: #fff;
}

.secondary-button:hover:not(:disabled) {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.secondary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ghost-button {
    border-color: #d1d5db;
    color: #1f2937;
    background-color: #fff;
}

.ghost-button:hover:not(:disabled) {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.ghost-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.project-error-banner {
    border: 1px solid #fca5a5;
    background-color: #fef2f2;
    color: #b91c1c;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
}

.project-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    padding: 2rem 2.5rem;
    background-color: #f7f7fb;
}

.project-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.project-page-header > div:first-child {
    flex: 1;
    min-width: 280px;
}

.project-page-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.project-page-header p {
    margin: 0.35rem 0 0;
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.4;
}

.project-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.project-thread-sections {
    display: grid;
    grid-template-columns: minmax(320px, 2fr) minmax(240px, 1fr);
    gap: 1rem;
}

.project-thread-list,
.project-thread-placeholder {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.25rem;
}

.project-constitution-card {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.25rem;
}

.project-constitution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 769px) {
    .project-constitution-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, calc(25% - 0.75rem)));
        max-width: 100%;
    }
}

.constitution-item {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    background-color: #fcfcff;
    max-height: 12rem;
    overflow: hidden;
    position: relative;
}

.constitution-item p {
    margin: 0;
    font-size: 0.9rem;
    color: #4b5563;
    white-space: pre-wrap;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-execution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.execution-field-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* Ensure execution dropdowns align with their trigger within project cards */
.execution-field-card .selector-control {
    position: relative;
    width: 100%;
}

.execution-field-card .selector-button {
    width: 100%;
    justify-content: space-between;
}

.execution-field-card .selector-dropdown {
    left: 0;
    right: auto;
    min-width: 100%;
}

.execution-helper-text {
    color: #6b7280;
    font-size: 0.85rem;
}

.execution-error-text {
    margin-top: 0.75rem;
    color: #b91c1c;
    font-size: 0.9rem;
}

.constitution-item h4 {
    margin: 0 0 0.35rem 0;
    font-size: 0.95rem;
    color: #111827;
}

.project-thread-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.load-more-button {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 0.75rem;
    padding: 0.6rem;
    border: 1px dashed #d1d5db;
    border-radius: 0.65rem;
    background: transparent;
    color: #2563eb;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.load-more-button:hover {
    background-color: #f0f4ff;
    border-color: #93c5fd;
}

.project-view-all-link {
    display: block;
    text-align: center;
    margin-top: 0.75rem;
    padding: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background-color 0.15s ease;
}

.project-view-all-link:hover {
    background-color: #eff6ff;
    text-decoration: underline;
}

.project-thread-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e5e7eb;
    border-radius: 0.65rem;
    padding: 0.65rem 0.75rem;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s ease;
    width: 100%;
    text-align: left;
}

.project-thread-row:hover {
    background-color: #f9fafb;
}

.project-thread-row .thread-meta {
    font-size: 0.8rem;
    color: #6b7280;
}

.project-empty {
    color: #9ca3af;
    font-size: 0.9rem;
}

.project-input-panel {
    margin-top: auto;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.project-input-hint {
    font-size: 0.85rem;
    color: #6b7280;
}

.project-status {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #0f172a;
}

.project-page-loading {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
}

.project-page-error.subtle {
    border-color: #f87171;
    background-color: #fff1f2;
    color: #b91c1c;
}

.external-sources-card .secondary-button {
    margin-top: 1rem;
}

.external-source-empty {
    border: 1px dashed #d1d5db;
    border-radius: 0.85rem;
    padding: 1rem;
    color: #6b7280;
    text-align: center;
    background-color: #f9fafb;
}

.external-source-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.external-source-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.9rem;
    padding: 1rem;
    background-color: #fcfcff;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.external-source-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.external-source-card-actions {
    display: flex;
    gap: 0.35rem;
}

.external-source-type {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #4c1d95;
}

.external-source-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.external-source-meta {
    font-size: 0.85rem;
    color: #6b7280;
}

.github-repo-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.github-repo-list li {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.75rem;
    background-color: #fff;
}

.repo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.repo-branch {
    font-size: 0.8rem;
    color: #6b7280;
}

.artifact-roots-list {
    margin-top: 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: #4b5563;
    font-size: 0.85rem;
}

.external-source-editor {
    margin-top: 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.25rem;
    background-color: #fdfdfd;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.editor-repos {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.github-repo-editor {
    border: 1px solid #e5e7eb;
    border-radius: 0.85rem;
    padding: 0.85rem;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.repo-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.artifact-root-editor {
    border-top: 1px solid #f3f4f6;
    padding-top: 0.65rem;
}

.editor-subheader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.artifact-root-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(160px, 2fr) auto;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.artifact-root-empty {
    color: #94a3b8;
    font-size: 0.85rem;
}

.editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.form-error {
    color: #b91c1c;
    font-size: 0.9rem;
}

.ghost-icon-button.danger {
    border-color: #fecaca;
    color: #b91c1c;
}

.ghost-icon-button.danger:hover {
    background-color: #fee2e2;
    border-color: #ef4444;
}

.editor-header h3 {
    margin: 0;
}

.drawer-danger-button {
    border: 1px solid #f87171;
    background-color: #dc2626;
    color: #ffffff;
    font-weight: 600;
    padding: 0.65rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.drawer-danger-button:hover,
.drawer-danger-button:focus-visible {
    background-color: #b91c1c;
    border-color: #b91c1c;
}

.drawer-danger-button:focus-visible {
    outline: 2px solid #fecaca;
    outline-offset: 2px;
}

.drawer-danger-button:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.drawer-warning-button {
    border: 1px solid #fbbf24;
    background-color: #f59e0b;
    color: #ffffff;
    font-weight: 600;
    padding: 0.65rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.drawer-warning-button:hover,
.drawer-warning-button:focus-visible {
    background-color: #d97706;
    border-color: #d97706;
}

.drawer-warning-button:focus-visible {
    outline: 2px solid #fef3c7;
    outline-offset: 2px;
}

.drawer-warning-button:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.button-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: buttonSpinnerRotate 0.8s linear infinite;
    display: inline-block;
}

@keyframes buttonSpinnerRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.drawer-secondary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.drawer-danger-actions {
    display: flex;
    gap: 0.75rem;
}

@media (max-width: 1024px) {
    .project-page {
        padding: 1.5rem .75rem;
    }
}

@media (max-width: 768px) {
    .create-project-page {
        padding: 1.25rem;
    }

    .project-page {
        padding: 1.1rem .5rem;
    }

    .project-thread-sections {
        grid-template-columns: 1fr;
    }

    .project-thread-list,
    .project-constitution-card,
    .project-thread-placeholder {
        padding: 1rem;
    }

    .create-project-header {
        flex-direction: column;
    }

    .project-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    /* Hide desktop actions on mobile */
    .project-actions-desktop {
        display: none;
    }
    
    /* Show mobile overflow menu */
    .project-actions-mobile {
        display: flex;
    }
}

/* Desktop: show full buttons, hide mobile menu */
.project-actions-desktop {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.project-actions-mobile {
    display: none;
}

/* Overflow menu styling */
.project-overflow-menu {
    position: relative;
}

.overflow-menu-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: #ffffff;
    color: #374151;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.overflow-menu-trigger:hover,
.overflow-menu-trigger:focus-visible,
.overflow-menu-trigger.active {
    background-color: #f3f4f6;
    border-color: #9ca3af;
    outline: none;
}

.overflow-icon {
    font-weight: bold;
    letter-spacing: 2px;
}

/* Invisible backdrop to catch outside clicks */
.overflow-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
    background: transparent;
}

.overflow-menu-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 100;
    padding: 0.5rem;
    animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.overflow-menu-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: none;
    background: transparent;
    color: #1f2937;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: background-color 0.12s ease;
}

.overflow-menu-item:hover,
.overflow-menu-item:focus-visible {
    background-color: #f3f4f6;
    outline: none;
}

.menu-item-icon {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.overflow-menu-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 0.5rem 0;
}

.overflow-menu-status {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: #4b5563;
    position: relative;
}

.overflow-menu-status > span:first-of-type {
    display: none;
}

.overflow-menu-status select {
    flex: 1;
    padding: 0.55rem 0.5rem 0.35rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: #fff;
    font-size: 0.85rem;
    cursor: pointer;
}

.overflow-menu-status .menu-item-icon {
    position: absolute;
    top: 0.35rem;
    left: 0.85rem;
    font-size: 0.75rem;
}

/* Mobile-specific overflow menu enhancements */
@media (max-width: 768px) {
    .overflow-menu-dropdown {
        min-width: 240px;
        right: 0;
    }

    .overflow-menu-item {
        padding: 0.75rem 0.85rem;
        font-size: 1rem;
        min-height: 44px;
        flex-wrap: wrap;
    }

    .overflow-menu-item::after {
        content: attr(data-hint);
        display: block;
        width: 100%;
        font-size: 0.75rem;
        font-weight: 400;
        color: #94a3b8;
        margin-top: 0.15rem;
    }

    .overflow-menu-status {
        padding: 0.65rem 0.85rem;
        min-height: 44px;
        position: relative;
    }

    .overflow-menu-status > span:first-of-type {
        display: inline;
        position: absolute;
        top: -0.5rem;
        left: 1rem;
        background: #ffffff;
        padding: 0 0.35rem;
        font-size: 0.7rem;
        font-weight: 600;
        color: #64748b;
        z-index: 1;
    }

    .overflow-menu-status .menu-item-icon {
        display: none;
    }

    .overflow-menu-status select {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

/* Constitution modification styles */
.constitution-modification-card {
    background-color: #fef3c7;
    border-color: #fbbf24;
}

.constitution-modification-prompt {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modification-textarea {
    min-height: 80px;
}

.modification-preview-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background-color: #eff6ff;
    border: 1px solid #3b82f6;
    border-radius: 0.75rem;
}

.banner-content {
    display: flex;
    gap: 0.75rem;
    flex: 1;
}

.banner-icon {
    font-size: 1.5rem;
}

.banner-content strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #1e3a8a;
}

.banner-content p {
    margin: 0;
    color: #1e40af;
    font-size: 0.9rem;
}

.banner-actions {
    display: flex;
    gap: 0.5rem;
}

/* Danger zone */
.project-danger-card {
    background-color: #fef2f2;
    border-color: #fecaca;
}

.danger-button {
    background-color: #dc2626;
    color: #fff;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    padding: 0.65rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
}

.danger-button:hover:not(:disabled) {
    background-color: #b91c1c;
}

.danger-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.danger-zone-info {
    margin-bottom: 1rem;
}

.danger-zone-info p {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #7f1d1d;
}

.danger-zone-retention {
    font-weight: 500;
}

.danger-zone-detail {
    color: #991b1b;
}

.danger-zone-dpa {
    font-size: 0.85rem;
}

.danger-zone-dpa a {
    color: #1d4ed8;
    text-decoration: underline;
    font-weight: 500;
}

.danger-zone-dpa a:hover {
    color: #1e40af;
}

/* Node alias preview styles */
.alias-card {
    background: linear-gradient(135deg, #fafbff 0%, #f0f4ff 100%);
    border-color: #c7d2fe;
}

.alias-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.alias-url {
    display: flex;
    align-items: baseline;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1rem;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.65rem 1rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.alias-protocol {
    color: #9ca3af;
    font-size: 0.9rem;
}

.alias-value {
    color: #4f46e5;
    font-weight: 600;
    font-size: 1.05rem;
}

.alias-domain {
    color: #6b7280;
    font-size: 0.9rem;
}

.alias-loading {
    color: #6b7280;
    font-style: italic;
    font-size: 0.9rem;
}

.alias-error {
    color: #b91c1c;
    font-size: 0.9rem;
}

.alias-hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.refresh-alias {
    padding: 0.5rem;
    min-width: auto;
    border-radius: 0.5rem;
}

.refresh-alias .icon {
    font-size: 1.1rem;
}

/* Inline alias display on project page */
.project-alias-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.alias-label {
    color: #6b7280;
}

.alias-url-inline {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    background-color: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.35rem;
    color: #4b5563;
    font-size: 0.8rem;
}

.alias-value-inline {
    color: #4f46e5;
    font-weight: 600;
}

/* Floating error toast */
.project-error-toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 90%;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-1rem);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.project-error-toast .error-icon {
    font-size: 1.1rem;
    color: #dc2626;
    flex-shrink: 0;
}

.project-error-toast .error-text {
    color: #991b1b;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
}

.project-error-toast .error-dismiss {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.project-error-toast .error-dismiss:hover {
    color: #dc2626;
}

/* Sticky footer for create/save actions */
.project-footer-sticky {
    position: fixed;
    bottom: 0;
    left: var(--left-nav-width, 280px);
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 3rem;
    background-color: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    z-index: 100;
    gap: 1rem;
}

/* Add bottom padding to page content so it doesn't get hidden behind sticky footer */
.create-project-page {
    padding-bottom: 5rem;
}

@media (max-width: 768px) {
    .project-footer-sticky {
        left: 0;
        padding: 1rem 1.5rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .project-footer-sticky .helper-copy {
        text-align: center;
    }

    .project-footer-sticky .footer-actions {
        justify-content: center;
    }

    .project-error-toast {
        top: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
        transform: none;
        max-width: none;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-1rem);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ── Shared sub-resource card/panel classes ──
 * Used by ChildContent inside SubResourceLayout pages.
 * Global so they apply regardless of Blazor CSS isolation. */

.sub-resource-card {
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    background: white;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}

.sub-resource-card h2,
.sub-resource-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
}

.sub-resource-card p {
    margin: 0;
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.5;
}

.sub-resource-intro {
    padding: 1rem 1.25rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.6;
}

.sub-resource-intro.compact {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.sub-resource-intro.compact h3 {
    margin: 0 0 0.25rem;
    font-size: 0.875rem;
}

.sub-resource-intro ul {
    margin: 0;
    padding-left: 1.25rem;
}

.sub-resource-intro li {
    margin-bottom: 0.25rem;
}
