a, span {
    text-decoration: none !important;
}

:root {
    --radius: 12px;
    --radius-xl: 24px;
    --bg: #f4f4f5;
    --surface: rgba(0, 0, 0, 0.04);
    --surface-hover: rgba(0, 0, 0, 0.08);
    --border: rgba(0, 0, 0, 0.1);
    --text: #18181b;
    --text-muted: #71717a;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --credit-negative: #ea580c;
    --credit-positive: #16a34a;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.search-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.search-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.search-modal-content {
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.3s ease;

    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

}

.search-modal-overlay.is-open .search-modal-content {
    transform: scale(1);
}

.search-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.search-modal-header .search-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}

.search-modal-header .search-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.search-input-wrap {
    position: relative;
}

.search-input-wrap svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-modal-header input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-modal-header input::placeholder {
    color: var(--text-muted);
}

.search-modal-header input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-results {
    overflow-y: auto;
    padding: 12px;
    max-height: 360px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    border: none;
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
}

.search-result-item:hover {
    background: var(--surface-hover);
    transform: translateX(2px);
}

.search-result-item .thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: var(--surface);
    object-fit: cover;
    flex-shrink: 0;
}

.search-result-item .thumb-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.search-no-results {
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.state-selected .create-actions .btn-secondary.search-only {
    display: inline-flex;
}


.state-empty .create-actions .btn-secondary.search-only {
    display: inline-flex;
}
