/* App Side Sheet — shared profile/journey/edit panels */

.drawer-panel.app-side-sheet {
    background: var(--color-surface, var(--bg-secondary));
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: 16px 0 0 16px;
    width: min(480px, 100vw);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-side-sheet__header-slot,
.app-side-sheet__footer-slot {
    flex-shrink: 0;
}

@supports (backdrop-filter: blur(4px)) {
    .drawer-overlay:not(.drawer-insights-overlay) {
        backdrop-filter: blur(4px);
    }
}

.app-side-sheet__header {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 16px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--color-surface, var(--bg-secondary)) 100%);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.app-side-sheet__header-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.app-side-sheet__brand {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-cyan) 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.app-side-sheet__brand .ui-icon {
    stroke: #fff;
}

.app-side-sheet__titles {
    min-width: 0;
}

.app-side-sheet__title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    margin: 0;
}

.app-side-sheet__subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 4px 0 0;
}

.app-side-sheet__close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
    transition: all 0.15s ease;
}

.app-side-sheet__close:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.app-side-sheet__close:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.app-side-sheet .drawer-body,
.app-side-sheet__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 20px 24px;
    -webkit-overflow-scrolling: touch;
}

.app-side-sheet__footer {
    position: sticky;
    bottom: 0;
    z-index: 3;
    padding: 14px 20px 18px;
    background: linear-gradient(0deg, var(--bg-secondary) 70%, transparent 100%);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.app-side-sheet__footer-helper {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0 0 12px;
    text-align: center;
}

.app-side-sheet__footer-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-side-sheet__footer-row {
    display: flex;
    gap: 8px;
}

.app-side-sheet__btn-primary {
    flex: 1;
    padding: 11px 16px;
    border: none;
    border-radius: var(--radius-md, 12px);
    background: var(--color-primary);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.app-side-sheet__btn-primary:hover {
    background: var(--color-primary-dark);
}

.app-side-sheet__btn-secondary {
    flex: 1;
    padding: 11px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 12px);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.app-side-sheet__btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.app-side-sheet__btn-ghost {
    width: 100%;
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.app-side-sheet__btn-ghost:hover {
    color: var(--color-primary);
}

.app-side-sheet-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 16px);
    padding: 14px 16px 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
}

.app-side-sheet-card:last-child {
    margin-bottom: 0;
}

.app-side-sheet-card__title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0 0 12px;
}

.app-side-sheet-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.app-side-sheet-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.app-side-sheet-row:first-child {
    padding-top: 0;
}

.app-side-sheet-row .criteria-icon-badge {
    width: 30px;
    height: 30px;
    margin-top: 1px;
    flex-shrink: 0;
}

.app-side-sheet-row__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.app-side-sheet-row__label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.app-side-sheet-row__value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
}

.app-side-sheet-row.is-muted .app-side-sheet-row__value {
    color: var(--text-muted);
    font-weight: 500;
}

.app-side-sheet-row__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.app-side-sheet-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s ease;
}

.app-side-sheet-chip:hover,
.app-side-sheet-chip--action:hover {
    border-color: rgba(37, 99, 235, 0.35);
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.app-side-sheet-chip--action {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
}

.app-side-sheet-empty {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    padding: 8px 0;
}

.app-side-sheet-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Journey drawer */
.journey-summary-card {
    background: var(--accent-surface-gradient);
    border-color: rgba(37, 99, 235, 0.15);
}

.journey-summary-step {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.journey-summary-pct {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary);
}

.journey-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.journey-summary-status {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.profile-journey-step__desc {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.35;
    margin-top: 2px;
}

.profile-journey-step--active .profile-journey-dot {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22);
}

.journey-next-action-text {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-primary);
    margin: 0 0 12px;
}

/* Edit form */
.edit-form-section {
    margin-bottom: 12px;
}

.edit-form-field {
    margin-bottom: 14px;
}

.edit-form-field:last-child {
    margin-bottom: 0;
}

.edit-form-field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.edit-form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 12px);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.edit-form-input::placeholder {
    color: var(--text-muted);
}

textarea.edit-form-input {
    min-height: 72px;
    resize: vertical;
}

.drawer-body .buyer-profile-panel {
    padding: 0;
}

.buyer-profile-missing-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 640px) {
    .drawer-panel.app-side-sheet {
        width: 100vw;
        max-width: 100vw;
        border-radius: 0;
    }
}

@media (max-width: 900px) {
    .drawer-panel.app-side-sheet {
        width: min(420px, 100vw);
    }
}
