/* === Composer Layout === */
.composer-shell {
    min-height: 100vh;
}

.composer-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}

.nav-brand {
    font-weight: 700;
    font-size: 1rem;
    color: #2a2a2a;
}
.nav-brand:hover {
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    font-size: 0.875rem;
    color: #6b7280;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}
.nav-link:hover {
    color: #2a2a2a;
    text-decoration: none;
}
.nav-link.active {
    color: #2563eb;
    font-weight: 600;
}

.composer-breadcrumb {
    padding: 0.5rem 1.5rem;
    font-size: 0.8125rem;
    color: #9ca3af;
    border-bottom: 1px solid #f3f4f6;
}
.composer-breadcrumb a {
    color: #6b7280;
}
.composer-breadcrumb:empty {
    display: none;
}

.composer-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* === Flow List === */
.flow-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.flow-list-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.flow-table {
    width: 100%;
    border-collapse: collapse;
}
.flow-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}
.flow-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9375rem;
}
.flow-table tr:hover td {
    background: #f9fafb;
}
.flow-table a {
    font-weight: 500;
}

.status-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 3px;
}
.status-badge.draft {
    background: #f3f4f6;
    color: #6b7280;
}
.status-badge.ready {
    background: #dcfce7;
    color: #16a34a;
}

/* === Flow Editor === */
.flow-editor-header {
    margin-bottom: 1.5rem;
}

.flow-meta-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}
.flow-meta-form .field-full {
    grid-column: 1 / -1;
}
.flow-meta-form .field-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.field-group {
    display: flex;
    flex-direction: column;
}

/* === Step List === */
.steps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.steps-header h2 {
    font-size: 1rem;
    font-weight: 700;
}

.step-list {
    list-style: none;
}
.step-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    margin-bottom: 0.375rem;
    background: #fff;
}
.step-item:hover {
    border-color: #d1d5db;
}

.step-order {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 600;
    min-width: 1.5rem;
    text-align: center;
}

.step-type-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 2px;
    background: #e0e7ff;
    color: #4338ca;
    min-width: 5rem;
    text-align: center;
}
.step-type-badge.scene      { background: #f0fdf4; color: #166534; }
.step-type-badge.choice     { background: #fef3c7; color: #92400e; }
.step-type-badge.companion  { background: #fce7f3; color: #9d174d; }
.step-type-badge.action     { background: #fee2e2; color: #991b1b; }
.step-type-badge.reflection { background: #e0e7ff; color: #4338ca; }
.step-type-badge.complete   { background: #d1fae5; color: #065f46; }

.step-info {
    flex: 1;
}
.step-info a {
    font-weight: 500;
    color: #2a2a2a;
}
.step-info .step-internal-name {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-left: 0.5rem;
}

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

.warning-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    margin-left: 0.375rem;
}

/* === Step Editor === */
.step-editor-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step-editor-form .field-group {
    display: flex;
    flex-direction: column;
}

.step-editor-form .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.type-section {
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    padding: 1rem;
    margin-top: 0.5rem;
    background: #fafafa;
}
.type-section h3 {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.step-editor-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* === Options/Traits Repeater === */
.repeater-item {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    margin-bottom: 0.5rem;
    background: #fff;
}
.repeater-item .repeater-fields {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.repeater-item .repeater-fields .field-full {
    grid-column: 1 / -1;
}

.image-preview {
    max-width: 120px;
    max-height: 80px;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    margin-top: 0.5rem;
}
