.wizard-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 64px 32px 96px;
    position: relative;
}

.wizard-page::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 720px;
    height: 480px;
    background: radial-gradient(ellipse, rgba(167,139,250,0.14) 0%, rgba(195,255,212,0.05) 35%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.wizard-header {
    text-align: center;
    margin-bottom: 48px;
}

.wizard-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding: 6px 16px;
    background: rgba(195,255,212,0.08);
    border: 1px solid rgba(195,255,212,0.15);
    border-radius: 980px;
}

.wizard-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
    color: var(--text);
    line-height: 1.1;
}

.wizard-header h1 .highlight {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wizard-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.55;
}

.wizard-stepper {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin: 0 auto 52px;
    max-width: 760px;
    padding: 0;
    position: relative;
    counter-reset: step;
}

.wizard-stepper-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    font-weight: 500;
}

.wizard-stepper-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 18px;
    left: calc(50% + 22px);
    right: calc(-50% + 22px);
    height: 1.5px;
    background: var(--border);
}

.wizard-stepper-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all var(--transition);
    backdrop-filter: blur(10px);
}

.wizard-stepper-label {
    font-size: 0.8rem;
    letter-spacing: -0.01em;
    text-align: center;
    white-space: nowrap;
}

.wizard-stepper-item.active {
    color: var(--accent);
}

.wizard-stepper-item.active .wizard-stepper-num {
    background: rgba(195,255,212,0.1);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 4px rgba(195,255,212,0.08), var(--glow-accent);
}

.wizard-stepper-item.done {
    color: var(--success);
}

.wizard-stepper-item.done .wizard-stepper-num {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
}

.wizard-stepper-item.done:not(:last-child)::after {
    background: var(--success);
}

.wizard-card {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg), var(--glow-purple);
}

.character-preview {
    background: linear-gradient(180deg, rgba(167,139,250,0.12) 0%, rgba(195,255,212,0.04) 100%);
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    border-right: 1px solid var(--border);
    position: relative;
}

.character-preview::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(195,255,212,0.18) 0%, transparent 70%);
    pointer-events: none;
}

.character-portrait {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(167,139,250,0.2) 0%, rgba(195,255,212,0.12) 100%);
    border: 2px solid rgba(195,255,212,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.5rem;
    margin-bottom: 24px;
    box-shadow: var(--glow-accent), inset 0 0 30px rgba(167,139,250,0.15);
    position: relative;
    z-index: 1;
    transition: all var(--transition);
}

.character-tagline {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.character-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

.character-fields {
    padding: 44px 40px;
}

.field {
    margin-bottom: 28px;
}

.field:last-of-type {
    margin-bottom: 36px;
}

.field-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.field-hint {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-bottom: 14px;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.avatar-cell {
    aspect-ratio: 1;
    border: 1.5px solid var(--border);
    background: var(--bg-input);
    border-radius: var(--radius);
    font-size: 1.6rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-family: inherit;
}

.avatar-cell:hover {
    border-color: var(--accent-secondary);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.avatar-cell.selected {
    border-color: var(--accent);
    background: rgba(195,255,212,0.08);
    box-shadow: 0 0 0 3px rgba(195,255,212,0.12), var(--glow-accent);
}

.wizard-input,
.wizard-select {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all var(--transition);
    text-align: left;
    font-weight: 500;
}

.wizard-input:focus,
.wizard-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(195,255,212,0.1);
}

.wizard-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.select-wrap {
    position: relative;
}

.select-wrap::after {
    content: '▾';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
    font-size: 0.9rem;
}

.wizard-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 38px;
    cursor: pointer;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
}

.segmented input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.segmented label:hover {
    color: var(--text);
}

.segmented input[type="radio"]:checked + label {
    background: rgba(195,255,212,0.1);
    color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(195,255,212,0.3);
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.wizard-actions .btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.wizard-actions .btn-secondary[disabled] { border-color: var(--border); color: var(--text-tertiary); }

@media (max-width: 860px) {
    .wizard-card { grid-template-columns: 1fr; }
    .character-preview { border-right: none; border-bottom: 1px solid var(--border); padding: 36px 24px; }
    .character-fields { padding: 32px 24px; }
    .wizard-stepper-label { font-size: 0.7rem; }
    .wizard-header h1 { font-size: 2.1rem; }
}

@media (max-width: 520px) {
    .wizard-page { padding: 40px 16px 64px; }
    .wizard-stepper { gap: 4px; }
    .wizard-stepper-label { display: none; }
    .wizard-stepper-item:not(:last-child)::after { left: calc(50% + 20px); right: calc(-50% + 20px); }
    .segmented label { font-size: 0.78rem; padding: 8px 4px; }
}

.portrait-placeholder {
    overflow: hidden;
    background: radial-gradient(circle at 50% 40%, rgba(167,139,250,0.22) 0%, rgba(195,255,212,0.08) 60%, rgba(11,0,20,0.4) 100%);
    border: 2px dashed rgba(195,255,212,0.28);
}

.portrait-silhouette {
    font-size: 5rem;
    color: rgba(195,255,212,0.45);
    line-height: 1;
    filter: blur(0.4px);
    z-index: 1;
}

.portrait-shimmer {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
    z-index: 4;
    background: radial-gradient(circle at 50% 50%, rgba(195,255,212,0.7) 0%, transparent 55%);
    animation: portrait-shimmer-blob-a 5s ease-in-out infinite alternate;
    filter: blur(18px);
}

.portrait-shimmer::before,
.portrait-shimmer::after {
    content: '';
    position: absolute;
    inset: -30%;
    border-radius: 50%;
    pointer-events: none;
}

.portrait-shimmer::before {
    background: radial-gradient(circle at 30% 30%, rgba(167,139,250,0.95) 0%, transparent 45%);
    animation: portrait-shimmer-blob-b 6s ease-in-out infinite alternate;
}

.portrait-shimmer::after {
    background: radial-gradient(circle at 70% 70%, rgba(255,179,233,0.9) 0%, transparent 50%);
    animation: portrait-shimmer-blob-c 8s ease-in-out infinite alternate;
}

@keyframes portrait-shimmer-blob-a {
    0%   { transform: translate(-32%, -20%) scale(1.1) rotate(0deg); }
    100% { transform: translate(34%, 26%)   scale(1.35) rotate(38deg); }
}

@keyframes portrait-shimmer-blob-b {
    0%   { transform: translate(28%, -34%)  scale(1.25) rotate(-18deg); }
    100% { transform: translate(-36%, 30%)  scale(1.05) rotate(24deg); }
}

@keyframes portrait-shimmer-blob-c {
    0%   { transform: translate(-34%, 28%)  scale(1.0)  rotate(14deg); }
    100% { transform: translate(30%, -28%)  scale(1.4)  rotate(-30deg); }
}

.character-hint {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    line-height: 1.45;
    margin-top: 14px;
    max-width: 220px;
    position: relative;
    z-index: 1;
}

.wizard-step {
    animation: wizard-fade 280ms ease;
}

.wizard-step[hidden] { display: none; }

@keyframes wizard-fade {
    from { opacity: 0; transform: translateX(8px); }
    to   { opacity: 1; transform: translateX(0); }
}

.role-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.role-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 14px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    font-family: inherit;
}

.role-card:hover {
    border-color: var(--accent-secondary);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.role-card .role-icon-disc {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
    color: #0B0014;
    transition: transform var(--transition), box-shadow var(--transition);
}

.role-card .role-icon-disc svg {
    width: 30px;
    height: 30px;
    display: block;
}

.role-icon-community { background: linear-gradient(135deg, #C3FFD4 0%, #7FD9B4 100%); }
.role-icon-defi      { background: linear-gradient(135deg, #A78BFA 0%, #8B5CF6 100%); }
.role-icon-support   { background: linear-gradient(135deg, #A0E7E5 0%, #79C5C2 100%); }
.role-icon-dev       { background: linear-gradient(135deg, #C084FC 0%, #A78BFA 100%); }
.role-icon-social    { background: linear-gradient(135deg, #FFB3E9 0%, #F472B6 100%); }
.role-icon-custom    { background: linear-gradient(135deg, #FCD34D 0%, #F59E0B 100%); }

.role-card:hover .role-icon-disc { transform: scale(1.05); }
.role-card:hover .role-icon-community { box-shadow: 0 0 22px rgba(195,255,212,0.45); }
.role-card:hover .role-icon-defi      { box-shadow: 0 0 22px rgba(167,139,250,0.5); }
.role-card:hover .role-icon-support   { box-shadow: 0 0 22px rgba(160,231,229,0.5); }
.role-card:hover .role-icon-dev       { box-shadow: 0 0 22px rgba(192,132,252,0.5); }
.role-card:hover .role-icon-social    { box-shadow: 0 0 22px rgba(244,114,182,0.5); }
.role-card:hover .role-icon-custom    { box-shadow: 0 0 22px rgba(245,158,11,0.5); }

.role-card .role-title {
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.role-card .role-desc {
    font-size: 0.76rem;
    color: var(--text-tertiary);
    line-height: 1.35;
}

.role-card.selected {
    border-color: var(--accent);
    background: rgba(195,255,212,0.08);
    box-shadow: 0 0 0 3px rgba(195,255,212,0.12), var(--glow-accent);
}

.role-card.selected .role-icon-disc {
    box-shadow: 0 0 0 2px var(--accent), 0 0 20px rgba(195,255,212,0.4);
}

.role-card.selected .role-desc { color: var(--text-secondary); }

.role-card[data-tone] { padding: 14px 14px 12px; align-items: flex-start; text-align: left; }

.wizard-textarea {
    resize: vertical;
    min-height: 78px;
    line-height: 1.5;
    font-family: inherit;
}

.chip-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chip-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip-selected:empty { display: none; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px 5px 12px;
    background: rgba(195,255,212,0.12);
    border: 1px solid rgba(195,255,212,0.32);
    color: var(--accent);
    border-radius: 980px;
    font-size: 0.82rem;
    font-weight: 500;
}

.chip-x {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: rgba(195,255,212,0.18);
    color: var(--accent);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all var(--transition);
}

.chip-x:hover {
    background: var(--accent);
    color: #0B0014;
}

.chip-suggest {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.chip-suggest-btn {
    padding: 5px 12px;
    background: transparent;
    border: 1px dashed var(--border);
    color: var(--text-secondary);
    border-radius: 980px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}

.chip-suggest-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(195,255,212,0.05);
}

.wizard-placeholder {
    padding: 80px 24px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.95rem;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

@media (max-width: 520px) {
    .role-card-grid { grid-template-columns: 1fr; }
}

.portrait-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 600ms ease, filter 1.6s ease, transform 1.6s ease;
    z-index: 3;
    filter: blur(10px) saturate(1.2);
}

.character-portrait.has-preview .portrait-img {
    opacity: 1;
    transform: scale(1);
}

.character-portrait.has-preview .portrait-silhouette {
    opacity: 0;
}

.character-portrait.has-preview .portrait-shimmer {
    mix-blend-mode: overlay;
    opacity: 0.85;
    animation-duration: 4.5s;
}

.portrait-status {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
    z-index: 4;
    animation: portrait-status-pulse 1.6s ease-in-out infinite;
}

@keyframes portrait-status-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.character-portrait.is-loading {
    border-color: var(--accent);
    box-shadow: var(--glow-accent), 0 0 0 4px rgba(195,255,212,0.08);
}


/* Character cards (step 2 starter employees) */
.character-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.character-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px 14px 16px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    color: var(--text);
    gap: 6px;
}

.character-card:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--accent-secondary);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md), var(--glow-purple);
}

.character-card.selected {
    border-color: var(--accent);
    background: rgba(195,255,212,0.06);
    box-shadow: 0 0 0 3px rgba(195,255,212,0.18), var(--glow-accent);
}

.character-card-portrait {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(195,255,212,0.3);
    box-shadow: var(--glow-accent);
    margin-bottom: 8px;
    background: linear-gradient(135deg, rgba(167,139,250,0.18) 0%, rgba(195,255,212,0.12) 100%);
    transition: all var(--transition);
}

.character-card:hover .character-card-portrait {
    border-color: var(--accent);
    box-shadow: 0 0 24px rgba(195,255,212,0.45);
}

.character-card.selected .character-card-portrait {
    border-color: var(--accent);
    box-shadow: 0 0 28px rgba(195,255,212,0.55);
}

.character-card-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.character-card-portrait-blank {
    display: flex;
    align-items: center;
    justify-content: center;
    border-style: dashed;
    background: transparent;
}

.character-card-plus {
    font-size: 2.4rem;
    font-weight: 300;
    color: var(--text-tertiary);
    line-height: 1;
}

.character-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    margin-top: 2px;
}

.character-card-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(195,255,212,0.1);
    border: 1px solid rgba(195,255,212,0.2);
    padding: 2px 10px;
    border-radius: 980px;
    letter-spacing: 0.01em;
}

.character-card-tagline {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    font-style: italic;
    min-height: 32px;
}

.character-card-blank .character-card-tagline {
    font-style: normal;
}

@media (max-width: 720px) {
    .character-card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 440px) {
    .character-card-grid { grid-template-columns: 1fr; }
}

/* Step 4: Review + Avatar generation */
.review-card {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    padding: 8px 0 24px;
}

.review-portrait-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.review-portrait {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(195,255,212,0.3);
    box-shadow: var(--glow-accent);
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(167,139,250,0.2) 0%, rgba(195,255,212,0.12) 100%);
    position: relative;
}

.review-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.6s ease;
    filter: blur(8px);
}

.review-portrait.is-final img {
    filter: blur(0);
}

.review-portrait-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, rgba(195,255,212,0.55) 0%, transparent 45%),
        radial-gradient(circle at 70% 70%, rgba(167,139,250,0.55) 0%, transparent 50%);
    mix-blend-mode: overlay;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.8s ease;
}

.review-portrait.is-final .review-portrait-overlay {
    opacity: 0;
}

.review-portrait.is-generating .review-portrait-overlay {
    opacity: 0.85;
    animation: portrait-shimmer-flow 5s ease-in-out infinite alternate;
}

.review-portrait-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.review-portrait-hint {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    line-height: 1.5;
    max-width: 200px;
}

.review-summary {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.review-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin: 0;
}

.review-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.review-meta-pill {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(195,255,212,0.1);
    border: 1px solid rgba(195,255,212,0.2);
    padding: 4px 12px;
    border-radius: 980px;
}

.review-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 16px;
    padding: 10px 0;
    border-top: 1px solid var(--border-light);
}

.review-row-label {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.review-row-value {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.5;
}

.review-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.review-tag {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--accent);
    background: rgba(195,255,212,0.08);
    border: 1px solid rgba(195,255,212,0.18);
    padding: 3px 10px;
    border-radius: 980px;
}

.review-goals {
    white-space: pre-wrap;
}

.btn-cta {
    font-size: 1.05rem;
    padding: 14px 32px;
    font-weight: 700;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

/* Success screen */
.wizard-step-success {
    grid-column: 1 / -1;
    padding: 64px 48px;
    text-align: center;
}

.success-block {
    max-width: 540px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}

.success-icon {
    font-size: 3rem;
    margin-bottom: 4px;
    animation: success-bounce 2s ease-in-out infinite;
}

@keyframes success-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.success-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.success-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.success-row {
    width: 100%;
    text-align: left;
    margin-top: 12px;
}

.success-row-label {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.success-link {
    display: inline-block;
    color: var(--accent);
    font-weight: 600;
    padding: 12px 18px;
    background: rgba(195,255,212,0.08);
    border: 1px solid rgba(195,255,212,0.2);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all var(--transition);
}

.success-link:hover {
    background: rgba(195,255,212,0.14);
    transform: translateY(-1px);
}

.success-config {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    font-family: 'JetBrains Mono', Menlo, monospace;
    font-size: 0.78rem;
    color: var(--text);
    overflow-x: auto;
    white-space: pre;
    margin-bottom: 8px;
}

@media (max-width: 720px) {
    .review-card { grid-template-columns: 1fr; }
    .review-portrait-block { margin-bottom: 12px; }
    .review-row { grid-template-columns: 1fr; gap: 4px; }
}

.field-required {
    color: var(--danger);
    margin-left: 4px;
    font-weight: 700;
}

/* ============ Auth modal ============ */
.auth-modal-backdrop[hidden] { display: none !important; }
.auth-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 0, 18, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.22s ease;
}
.auth-modal-backdrop.is-open { opacity: 1; }
.auth-modal {
    width: 100%;
    max-width: 440px;
    background: linear-gradient(160deg, rgba(30,18,50,0.92) 0%, rgba(15,8,30,0.92) 100%);
    border: 1px solid rgba(195,255,212,0.12);
    border-radius: var(--radius-xl);
    padding: 32px 28px 24px;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(167,139,250,0.15);
    position: relative;
    color: var(--text);
    transform: translateY(28px) scale(0.96);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.22,1,0.36,1), opacity 0.22s ease;
}
.auth-modal-backdrop.is-open .auth-modal { transform: translateY(0) scale(1); opacity: 1; }
.auth-modal-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}
.auth-modal-close:hover { color: var(--text); border-color: var(--accent); background: rgba(195,255,212,0.08); }
.auth-modal-title { font-size: 22px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.01em; }
.auth-modal-sub { color: var(--text-secondary); font-size: 14px; margin: 0 0 22px; line-height: 1.5; }

.auth-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 16px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    font-family: inherit;
}
.auth-btn:disabled { opacity: 0.65; cursor: wait; }
.auth-btn-google {
    background: #FFFFFF;
    color: #1F1F1F;
    margin-bottom: 10px;
}
.auth-btn-google:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255,255,255,0.18); }
.auth-btn-apple {
    background: #0A0A0A;
    color: #FFFFFF;
    border-color: rgba(255,255,255,0.18);
    margin-bottom: 4px;
}
.auth-btn-apple:hover:not(:disabled) { transform: translateY(-1px); background: #1A1A1A; }
.auth-note {
    font-size: 11px;
    color: var(--text-tertiary);
    text-align: center;
    margin-bottom: 18px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 18px;
    color: var(--text-tertiary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-divider span { white-space: nowrap; }

.auth-email-form { display: flex; flex-direction: column; gap: 12px; }
.auth-label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.auth-label input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 11px 14px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}
.auth-label input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    background: var(--bg-card-hover);
}
.auth-error {
    color: var(--danger);
    background: var(--danger-bg);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 13px;
}
.auth-submit { width: 100%; margin-top: 4px; }
.auth-switch {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}
.auth-switch a { color: var(--accent); margin-left: 6px; text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }
.auth-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
    vertical-align: -2px;
    margin-right: 6px;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* ============ Dashboard ============ */
.dashboard-page {
    max-width: 1080px;
    margin: 32px auto 80px;
    padding: 0 20px;
}
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.dashboard-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.dashboard-subtitle { color: var(--text-secondary); margin: 0; font-size: 15px; }
.dashboard-cta { white-space: nowrap; }
.dashboard-loading { color: var(--text-tertiary); padding: 40px 0; text-align: center; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 600px) { .dashboard-grid { grid-template-columns: 1fr; } }

.dashboard-agent-card {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}
.dashboard-agent-card:hover { transform: translateY(-3px); border-color: var(--accent-secondary); box-shadow: var(--glow-purple); }

.dashboard-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.dashboard-card-portrait {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(195,255,212,0.2);
    background: var(--bg-card);
}
.dashboard-card-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--success-bg);
    color: var(--success);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}
.dashboard-card-name { font-size: 19px; font-weight: 700; margin: 0; }
.dashboard-card-role-pill {
    align-self: flex-start;
    background: rgba(167,139,250,0.14);
    color: var(--accent-secondary);
    border: 1px solid rgba(167,139,250,0.25);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.dashboard-card-meta { font-size: 12px; color: var(--text-tertiary); }
.dashboard-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 8px;
}
.dashboard-card-actions .btn-sm { flex: 1; min-width: 0; padding: 7px 10px; font-size: 12px; }
.dashboard-card-tg { text-align: center; text-decoration: none; }
.dashboard-card-delete { color: var(--danger); border-color: rgba(255,107,107,0.3); }
.dashboard-card-delete:hover { background: var(--danger-bg); border-color: var(--danger); }

.dashboard-empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--gradient-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-xl);
}
.dashboard-empty-icon { font-size: 48px; margin-bottom: 12px; }
.dashboard-empty-title { font-size: 24px; margin: 0 0 8px; }
.dashboard-empty-text { color: var(--text-secondary); margin: 0 0 24px; }

.auth-step[hidden] { display: none !important; }
.auth-code-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 16px;
}
.auth-code-hint strong { color: var(--text); }
.auth-code-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    margin-top: 12px;
}
.auth-code-actions a {
    color: var(--accent);
    text-decoration: none;
}
.auth-code-actions a:hover { text-decoration: underline; }
.auth-sep { color: var(--text-tertiary); }
#auth-code {
    text-align: center;
    letter-spacing: 0.4em;
    font-size: 1.2rem;
    font-weight: 600;
}

.auth-email-input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all var(--transition);
    margin-bottom: 14px;
}
.auth-email-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(195,255,212,0.1);
}
.auth-email-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.auth-legal {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    text-align: center;
    margin: 18px 0 0;
    line-height: 1.5;
}
.auth-legal a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.auth-legal a:hover { color: var(--accent); }

.nav-links a.nav-cta {
    color: var(--accent-text);
    background: var(--gradient-cta);
    padding: 8px 18px;
    border-radius: 980px;
    font-weight: 600;
    transition: all var(--transition);
}
.nav-links a.nav-cta:hover {
    color: var(--accent-text);
    transform: translateY(-1px);
    box-shadow: var(--glow-accent);
}

.dashboard-card-clickable { cursor: pointer; transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.dashboard-card-clickable:hover { transform: translateY(-3px); border-color: var(--accent-secondary); box-shadow: var(--glow-purple); }

.agent-detail-page { max-width: var(--max-width); margin: 0 auto; padding: 32px 24px 80px; }

.agent-detail-header {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center;
    gap: 20px; padding: 20px 0 28px; border-bottom: 1px solid var(--border-light); margin-bottom: 32px;
}
.agent-detail-back {
    color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 500;
    padding: 8px 14px; border-radius: 980px; border: 1px solid var(--border); transition: all var(--transition);
}
.agent-detail-back:hover { color: var(--accent); border-color: var(--accent); }
.agent-detail-title-block { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.agent-detail-title { font-size: 28px; font-weight: 700; color: var(--text); margin: 0; }
.agent-detail-role-pill {
    background: var(--info-bg); color: var(--accent-secondary); padding: 6px 14px;
    border-radius: 980px; font-size: 13px; font-weight: 600;
}
.agent-status-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 980px;
    background: var(--success-bg); color: var(--success); font-size: 12px; font-weight: 600; text-transform: capitalize;
}
.agent-status-badge .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.agent-status-badge.status-paused { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
.agent-status-badge.status-paused .status-dot { background: var(--text-tertiary); }
.agent-detail-actions { display: flex; gap: 8px; }

.agent-detail-body { display: grid; grid-template-columns: 320px 1fr; gap: 32px; align-items: start; }

.agent-detail-sidebar {
    position: sticky; top: 24px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 28px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px;
    backdrop-filter: blur(20px);
}
.portrait-wrap {
    position: relative; width: 100%;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.agent-detail-portrait {
    width: 200px; height: 200px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--accent); box-shadow: var(--glow-accent); background: var(--bg-secondary);
}

/* ===== Thought bubble (cloud above avatar, tail puffs pointing down) ===== */
.thought-bubble {
    position: relative; align-self: stretch;
    margin-bottom: 18px;
    padding: 10px 13px;
    background: linear-gradient(135deg, rgba(195,255,212,0.14) 0%, rgba(167,139,250,0.09) 100%);
    border: 1px solid rgba(195,255,212,0.3);
    border-radius: 18px;
    color: var(--text-primary); font-size: 11.5px; line-height: 1.45;
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.04);
    display: flex; gap: 7px; align-items: flex-start;
    z-index: 2;
}
.thought-bubble[hidden] { display: none; }
.thought-bubble::before,
.thought-bubble::after {
    content: ''; position: absolute;
    background: rgba(195,255,212,0.18);
    border: 1px solid rgba(195,255,212,0.3);
    border-radius: 50%;
}
.thought-bubble::before {
    bottom: -8px; left: calc(50% - 6px); width: 12px; height: 12px;
}
.thought-bubble::after {
    bottom: -18px; left: calc(50% + 2px); width: 7px; height: 7px;
    background: rgba(195,255,212,0.13);
}
.thought-bubble-icon { font-size: 14px; line-height: 1.3; flex-shrink: 0; }
.thought-bubble-text { flex: 1; word-wrap: break-word; }
.thought-bubble { cursor: pointer; transition: transform 180ms ease, box-shadow 180ms ease; }
.thought-bubble:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(195,255,212,0.2); }
.thought-bubble:active { transform: translateY(0); }
.thought-bubble-in { animation: bubbleIn 460ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes bubbleIn {
    0%   { opacity: 0; transform: translateX(-14px) scale(0.9); }
    60%  { opacity: 1; transform: translateX(3px) scale(1.03); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}
.thought-bubble-kind-tool   { border-color: rgba(167,139,250,0.4); background: linear-gradient(135deg, rgba(167,139,250,0.17) 0%, rgba(167,139,250,0.07) 100%); }
.thought-bubble-kind-tool::before, .thought-bubble-kind-tool::after { background: rgba(167,139,250,0.18); border-color: rgba(167,139,250,0.4); }
.thought-bubble-kind-send   { border-color: rgba(195,255,212,0.4); }
.thought-bubble-kind-search { border-color: rgba(125,211,252,0.4); background: linear-gradient(135deg, rgba(125,211,252,0.15) 0%, rgba(125,211,252,0.06) 100%); }
.thought-bubble-kind-search::before, .thought-bubble-kind-search::after { background: rgba(125,211,252,0.18); border-color: rgba(125,211,252,0.4); }
.thought-bubble-kind-write  { border-color: rgba(251,191,119,0.4); background: linear-gradient(135deg, rgba(251,191,119,0.15) 0%, rgba(251,191,119,0.06) 100%); }
.thought-bubble-kind-write::before, .thought-bubble-kind-write::after { background: rgba(251,191,119,0.18); border-color: rgba(251,191,119,0.4); }
.thought-bubble-kind-wait   { opacity: 0.7; }
.agent-detail-sidebar-name { font-size: 24px; font-weight: 700; margin: 8px 0 0; color: var(--text); text-align: center; }
.agent-detail-sidebar-role { color: var(--text-secondary); font-size: 14px; text-align: center; }
.agent-tone-pill {
    background: var(--bg-card-hover); color: var(--accent); padding: 5px 12px; border-radius: 980px;
    font-size: 12px; font-weight: 600; text-transform: capitalize; border: 1px solid var(--border);
}
.agent-detail-cta-stack { display: flex; flex-direction: column; gap: 8px; width: 100%; margin: 12px 0; }
.agent-detail-cta-stack .btn { width: 100%; justify-content: center; }
.agent-meta-row {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    width: 100%; font-size: 13px; color: var(--text-secondary);
    padding: 6px 0; border-top: 1px solid var(--border-light);
}
.agent-meta-label { color: var(--text-tertiary); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.agent-chip {
    background: var(--bg-card-hover); border: 1px solid var(--border); padding: 3px 10px; border-radius: 980px;
    font-size: 12px; color: var(--text); font-weight: 500;
}
.agent-chip-mint { background: var(--info-bg); color: var(--accent); border-color: rgba(195,255,212,0.2); }

.agent-detail-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.agent-stats-grid {
    display: flex; flex-direction: column; gap: 8px;
    margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.06);
}
.agent-stat-cell {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px; padding: 10px 14px;
}
.agent-stat-num { font-size: 22px; font-weight: 700; color: var(--accent); line-height: 1.1; font-variant-numeric: tabular-nums; }
.agent-stat-label { color: var(--text-secondary); font-size: 12px; }

.agent-section {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 20px 24px; backdrop-filter: blur(20px);
}
.agent-section-label {
    font-size: 12px; font-weight: 600; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 12px;
}
.agent-section-content { color: var(--text); font-size: 15px; line-height: 1.6; }
.agent-section-content p { margin: 0; white-space: pre-line; }
.agent-knowledge-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.agent-mcp-block { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.agent-mcp-code {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 16px; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px;
    color: var(--text); width: 100%; overflow-x: auto; white-space: pre; line-height: 1.5;
}
.btn-copied { color: var(--accent) !important; border-color: var(--accent) !important; }

.danger-zone {
    border: 1px solid rgba(255,107,107,0.3); background: var(--danger-bg);
    border-radius: var(--radius-lg); padding: 20px 24px; margin-top: 8px;
}
.danger-zone-label { color: var(--danger) !important; }
.danger-zone-text { color: var(--text-secondary); font-size: 14px; margin: 0 0 14px; }
.btn-danger {
    background: var(--danger); color: #fff; border: none; padding: 10px 20px;
    border-radius: var(--radius); font-weight: 600; cursor: pointer; transition: all var(--transition);
}
.btn-danger:hover { background: #ff5252; transform: translateY(-1px); }

.empty-state-not-found { text-align: center; padding: 80px 24px; }

/* ===== Section hint + live dot + close ===== */
.agent-section-label { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.agent-section-hint {
    font-weight: 400; font-size: 12px; color: var(--text-tertiary);
    margin-left: 10px; letter-spacing: 0;
}
.agent-section-close {
    margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-tertiary); width: 26px; height: 26px; border-radius: 50%;
    font-size: 18px; line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 160ms ease;
}
.agent-section-close:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); border-color: rgba(255,255,255,0.25); }
.agent-section-thoughts[hidden] { display: none; }

/* ===== Editable section blocks ===== */
.agent-section-edit {
    margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,0.1);
    width: 28px; height: 28px; border-radius: 8px;
    font-size: 14px; line-height: 1; cursor: pointer; opacity: 0.6;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 160ms ease;
}
.agent-section-edit:hover { opacity: 1; background: rgba(255,255,255,0.06); border-color: rgba(195,255,212,0.4); }
.agent-section.is-editing .agent-section-edit { opacity: 0.2; pointer-events: none; }

.agent-section-editor {
    display: flex; flex-direction: column; gap: 10px; margin-top: 4px;
    animation: editorIn 200ms ease;
}
@keyframes editorIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.agent-section-input {
    width: 100%; box-sizing: border-box;
    background: rgba(0,0,0,0.18); border: 1px solid rgba(195,255,212,0.3);
    border-radius: 10px; padding: 10px 12px;
    color: var(--text-primary); font-size: 14px; font-family: inherit; line-height: 1.5;
    transition: border-color var(--transition);
    resize: vertical;
}
.agent-section-input:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px rgba(195,255,212,0.12); }
textarea.agent-section-input { min-height: 90px; }
.agent-section-editor-actions { display: flex; gap: 8px; justify-content: flex-end; }
.thoughts-live-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--mint); margin-right: 8px; vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(195,255,212,0.6); animation: thoughtsPulse 2s infinite;
}
@keyframes thoughtsPulse {
    0%   { box-shadow: 0 0 0 0 rgba(195,255,212,0.55); }
    70%  { box-shadow: 0 0 0 10px rgba(195,255,212,0); }
    100% { box-shadow: 0 0 0 0 rgba(195,255,212,0); }
}

/* ===== Live thoughts stream ===== */
.thoughts-stream {
    list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column;
    gap: 8px; max-height: 540px; overflow-y: auto;
}
.thoughts-stream::-webkit-scrollbar { width: 6px; }
.thoughts-stream::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.thoughts-stream-empty {
    color: var(--text-tertiary); font-style: italic; font-size: 14px; padding: 8px 0;
}
.thoughts-item {
    display: grid; grid-template-columns: 26px 1fr auto; align-items: start;
    gap: 10px; padding: 10px 12px; border-radius: 10px;
    background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.06);
    animation: thoughtsFadeIn 360ms ease;
}
@keyframes thoughtsFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.thoughts-icon { font-size: 16px; line-height: 1.4; text-align: center; }
.thoughts-text { font-size: 14px; color: var(--text-primary); line-height: 1.5; }
.thoughts-time { font-size: 11px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; padding-top: 2px; }
.thoughts-item-tool   { border-left: 2px solid #A78BFA; }
.thoughts-item-send   { border-left: 2px solid var(--mint); }
.thoughts-item-search { border-left: 2px solid #7DD3FC; }
.thoughts-item-write  { border-left: 2px solid #FBBF77; }
.thoughts-item-wait   { border-left: 2px solid rgba(255,255,255,0.15); opacity: 0.75; }

/* ===== Direct chat ===== */
.direct-chat { display: flex; flex-direction: column; gap: 12px; }
.direct-chat-log {
    display: flex; flex-direction: column; gap: 10px;
    background: rgba(0,0,0,0.18); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px; padding: 14px; min-height: 140px; max-height: 320px; overflow-y: auto;
}
.direct-chat-log::-webkit-scrollbar { width: 6px; }
.direct-chat-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.direct-chat-msg {
    display: flex; flex-direction: column; gap: 2px; max-width: 78%;
    padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45;
    animation: chatMsgIn 220ms ease;
}
@keyframes chatMsgIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.direct-chat-author { font-size: 11px; color: var(--text-tertiary); font-weight: 500; }
.direct-chat-text { color: var(--text-primary); white-space: pre-wrap; word-wrap: break-word; }
.direct-chat-msg-agent {
    align-self: flex-start; background: rgba(195,255,212,0.07);
    border: 1px solid rgba(195,255,212,0.15); border-bottom-left-radius: 4px;
}
.direct-chat-msg-user {
    align-self: flex-end; background: rgba(167,139,250,0.14);
    border: 1px solid rgba(167,139,250,0.3); border-bottom-right-radius: 4px;
}
.direct-chat-msg-typing .direct-chat-text { color: var(--text-tertiary); font-style: italic; }
.direct-chat-form { display: flex; gap: 8px; }
.direct-chat-input {
    flex: 1; padding: 11px 14px; border-radius: 10px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-primary); font-size: 14px; font-family: inherit;
    transition: border-color var(--transition);
}
.direct-chat-input:focus { outline: none; border-color: var(--mint); }

@media (max-width: 880px) {
    .agent-detail-body { grid-template-columns: 1fr; }
    .agent-detail-sidebar { position: static; }
    .agent-detail-header { grid-template-columns: 1fr; gap: 12px; }
    .agent-detail-actions { flex-wrap: wrap; }
    .agent-stats-grid {
        display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
        margin-top: 16px; padding-top: 16px;
    }
    .agent-stat-cell { flex-direction: column; align-items: flex-start; padding: 14px; }
    .agent-stat-num { font-size: 26px; }
    .agent-section-hint { display: block; margin-left: 0; margin-top: 4px; }
    .thought-bubble { max-width: 100%; }
}
