/* Lora Modal Header */
.modal-header {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--lora-border);
    position: relative;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: var(--space-1);
}

.modal-header-row {
    width: 84%;
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    position: relative;
    padding-right: 96px; /* Reserve space for nav buttons to prevent wrapping overlap */
}

.modal-nav-controls {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
    position: absolute;
    top: 0;
    right: 0;
}

.modal-nav-btn {
    display: grid;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.modal-nav-btn:hover:not(:disabled) {
    background: var(--bg-hover, var(--card-bg));
    border-color: var(--lora-accent);
    transform: translateY(-1px);
}

.modal-nav-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.modal-nav-btn i {
    font-size: 14px;
}

/* Destructive modal action: ghost icon button right-anchored by its own auto
   margin, revealing the danger color only on hover/focus. Shared by the model
   modal and the recipe modal. */
.modal-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.modal-delete-btn:hover,
.modal-delete-btn:focus-visible {
    color: var(--lora-error);
    border-color: var(--lora-error);
    background: oklch(from var(--lora-error) l c h / 0.08);
}

.modal-delete-btn i {
    font-size: 14px;
}

/* When license icons directly precede the delete button, they carry the auto
   margin instead, so the [license][delete] cluster stays right-anchored as
   one group with the delete button flush at the right edge and no split gap. */
.modal-header-actions .license-restrictions {
    margin-left: auto;
}

.modal-header-actions .license-permissions {
    margin-left: auto;
}

.modal-header-actions .license-restrictions + .modal-delete-btn,
.modal-header-actions .license-permissions + .modal-delete-btn {
    margin-left: 0;
}

.license-restrictions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.license-restrictions .license-icon {
    width: 22px;
    height: 22px;
    display: inline-block;
    background-color: var(--text-muted);
    -webkit-mask: var(--license-icon-image) center/contain no-repeat;
    mask: var(--license-icon-image) center/contain no-repeat;
    transition: background-color 0.2s ease, transform 0.2s ease;
    cursor: default;
}

.license-restrictions .license-icon:hover {
    background-color: var(--text-color);
    transform: translateY(-1px);
}

/* Set 2 — New style permission indicators */
.license-permissions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.license-icon-new {
    width: 22px;
    height: 22px;
    display: inline-block;
    border-radius: 4px;
    background-color: var(--text-muted);
    -webkit-mask: var(--license-icon-image) center/contain no-repeat;
    mask: var(--license-icon-image) center/contain no-repeat;
    transition: background-color 0.2s ease, transform 0.2s ease;
    cursor: default;
    outline: 2px solid transparent;
    outline-offset: 1px;
}

.license-icon-new.allowed {
    background-color: var(--color-success, #40c057);
    outline-color: color-mix(in oklch, var(--color-success, #40c057) 30%, transparent);
}

.license-icon-new.denied {
    background-color: var(--color-error, #fa5252);
    outline-color: color-mix(in oklch, var(--color-error, #fa5252) 30%, transparent);
}

.license-icon-new:hover {
    transform: translateY(-1px);
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.info-item {
    padding: var(--space-2);
    background: var(--surface-subtle);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius-sm);
}

/* Dark theme info item styles */
[data-theme="dark"] .info-item {
    background: var(--surface-subtle);
    border: 1px solid var(--lora-border);
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-item label {
    display: block;
    font-size: 0.85em;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 4px;
}

.info-item span {
    color: var(--text-color);
    word-break: break-word;
}

.info-item.usage-tips,
.info-item.notes {
    grid-column: 1 / -1 !important; /* Make notes section full width */
}

/* Add specific styles for notes content */
.info-item.notes .editable-field [contenteditable] {
    min-height: 60px;
    white-space: pre-wrap;
    line-height: 1.5;
    padding: 8px 12px;
}

/* Notes expand/collapse — collapsed by default; only applies when JS detects long content */
.info-item.notes .editable-field {
    position: relative;
    max-height: none;
    overflow: visible;
}

.info-item.notes .editable-field.collapsed {
    max-height: 80px;
    overflow: hidden;
}

/* Gradient fade overlay hint when collapsed */
.info-item.notes .editable-field.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: linear-gradient(transparent, var(--bg-color));
    pointer-events: none;
}

/* Notes header row — label left, toggle button right */
.notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Hashes footnote — borderless full-width muted line; reads as a footnote
   to the file info grid rather than a peer field */
.hash-footnote {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 0 var(--space-1);
    color: var(--text-color);
}

.hash-footnote .hash-entry {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.hash-footnote .hash-kind {
    font-size: 0.7em;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.hash-footnote .model-hash-value {
    font-family: monospace;
    font-size: 0.8em;
    opacity: 0.6;
    white-space: nowrap;
}

.hash-footnote .hash-sep {
    opacity: 0.3;
    font-size: 0.8em;
}

.hash-footnote .hash-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
    border: none;
    background: none;
    color: var(--text-color);
    opacity: 0.35;
    font-size: 0.7em;
    cursor: pointer;
    flex-shrink: 0;
}

.hash-footnote .hash-copy-btn:hover {
    opacity: 0.9;
}

/* Toggle button — icon only, inline with the label */
.notes-toggle-btn {
    display: none;  /* shown by JS when content exceeds threshold */
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    background: none;
    color: var(--lora-accent);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
    flex-shrink: 0;
}

.notes-toggle-btn:hover {
    background: rgba(66, 153, 225, 0.1);
}

.notes-toggle-btn i {
    font-size: 0.85em;
}

.file-path {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.file-path[data-action="open-file-location"] {
    cursor: pointer;
    text-decoration: underline;
}
.file-path[data-action="open-file-location"]:hover {
    opacity: 0.8;
}

.description-text {
    line-height: 1.5;
    max-height: 100px;
    overflow-y: auto;
}

/* Editable Fields */
.editable-field {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.editable-field [contenteditable] {
    flex: 1;
    min-height: 24px;
    padding: 4px 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xs);
    font-size: 0.9em;
    line-height: 1.4;
    color: var(--text-color);
    transition: border-color 0.2s;
    word-break: break-word;
}

.editable-field [contenteditable]:focus {
    outline: none;
    border-color: var(--lora-accent);
    background: var(--bg-color);
}

.editable-field [contenteditable]:empty::before {
    content: attr(data-placeholder);
    color: var(--text-color);
    opacity: 0.5;
}

.notes-hint {
    font-size: 0.8em;
    color: var(--text-color);
    opacity: 0.7;
    margin-left: 5px;
    cursor: help;
    position: relative; /* Add positioning context */
}

@media (max-width: 640px) {
    .info-item.usage-tips,
    .info-item.notes {
        grid-column: 1 / -1;
    }
}

/* Back-to-top button pinned inside modal */
.modal-content .back-to-top {
    position: sticky;
    float: right;
    bottom: 20px;
    margin-right: 20px;
    margin-top: -56px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity var(--transition-slow), visibility var(--transition-slow), transform var(--transition-slow);
    z-index: 10;
}

.modal-content .back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.modal-content .back-to-top:hover {
    background: var(--lora-accent);
    color: white;
    transform: translateY(-2px);
}

/* Editable inline field styles (file name, version name, etc.) */
.file-name-wrapper,
.version-name-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-radius: var(--border-radius-xs);
    transition: background-color 0.2s;
    position: relative;
}

.file-name-content,
.version-name-content {
    padding: 2px 4px 2px 0;
    border-radius: var(--border-radius-xs);
    border: 1px solid transparent;
    flex: 1;
}

.file-name-wrapper.editing .file-name-content,
.version-name-wrapper.editing .version-name-content {
    border: 1px solid var(--lora-accent);
    background: var(--bg-color);
    outline: none;
}

/* Consolidated edit button styles */
.edit-model-name-btn,
.edit-file-name-btn,
.edit-base-model-btn,
.edit-model-description-btn,
.edit-version-name-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    opacity: 0;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: var(--border-radius-xs);
    transition: opacity var(--transition-base), background-color var(--transition-base);
    margin-left: var(--space-1);
}

.edit-model-name-btn.visible,
.edit-file-name-btn.visible,
.edit-base-model-btn.visible,
.edit-model-description-btn.visible,
.edit-version-name-btn.visible,
.model-name-header:hover .edit-model-name-btn,
.file-name-wrapper:hover .edit-file-name-btn,
.base-model-display:hover .edit-base-model-btn,
.version-name-wrapper:hover .edit-version-name-btn,
.model-name-header:hover .edit-model-description-btn {
    opacity: 0.5;
}

.edit-model-name-btn:hover,
.edit-file-name-btn:hover,
.edit-base-model-btn:hover,
.edit-model-description-btn:hover,
.edit-version-name-btn:hover {
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .edit-model-name-btn:hover,
[data-theme="dark"] .edit-file-name-btn:hover,
[data-theme="dark"] .edit-base-model-btn:hover,
[data-theme="dark"] .edit-version-name-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Base Model and Size combined styles */
.info-item.base-size {
    display: flex;
    gap: var(--space-3);
}

.base-wrapper {
    flex: 2;  /* Allocate more space to base model */
}

/* Base model display and editing styles */
.base-model-display {
    display: flex;
    align-items: center;
    position: relative;
}

.base-model-content {
    padding: 2px 4px 2px 0;
    border-radius: var(--border-radius-xs);
    border: 1px solid transparent;
    color: var(--text-color);
    flex: 1;
}

/* ── Base Model Search Dropdown ─────────────────────────────────────────── */

.base-model-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
    z-index: 100;
}

.base-model-search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 1px solid var(--lora-accent);
    border-radius: var(--border-radius-xs);
    padding: 0 6px;
    gap: 4px;
}

.base-model-search-input-wrapper .search-icon {
    color: var(--text-color);
    opacity: 0.45;
    font-size: 12px;
    flex-shrink: 0;
    pointer-events: none;
    /* Reset global .search-icon rules from search-filter.css */
    position: static;
    right: auto;
    top: auto;
    transform: none;
}

.base-model-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 0.9em;
    padding: 3px 0;
    width: 100%;
    min-width: 0;
}

.base-model-search-input::placeholder {
    color: var(--text-color);
    opacity: 0.35;
}

.base-model-dropdown {
    position: absolute;
    top: 100%;
    left: -1px;
    right: -1px;
    max-height: 270px;
    overflow-y: auto;
    background: var(--bg-color);
    border: 1px solid var(--lora-border);
    border-top: none;
    border-radius: 0 0 var(--border-radius-xs) var(--border-radius-xs);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    z-index: 101;
}

[data-theme="dark"] .base-model-dropdown {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

/* Dropdown scrollbar styling */
.base-model-dropdown::-webkit-scrollbar {
    width: 6px;
}

.base-model-dropdown::-webkit-scrollbar-thumb {
    background: var(--lora-border);
    border-radius: 3px;
}

.base-model-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

/* Section */
.base-model-dropdown-section {
    border-bottom: 1px solid var(--lora-border);
}

.base-model-dropdown-section:last-child {
    border-bottom: none;
}

/* Section header */
.base-model-dropdown-header {
    padding: 5px 10px;
    font-size: 0.72em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-color);
    opacity: 0.5;
    background: var(--surface-subtle);
    position: sticky;
    top: 0;
    z-index: 1;
}

.base-model-dropdown-header.suggested-header {
    color: var(--lora-accent);
    opacity: 1;
    background: oklch(from var(--lora-accent) l c h / 0.08);
}

.base-model-dropdown-header.suggested-header i {
    margin-right: 4px;
    font-size: 0.85em;
}

/* Dropdown items */
.base-model-dropdown-item {
    padding: 5px 12px;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--text-color);
    transition: background 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.base-model-dropdown-item:hover {
    background: oklch(from var(--lora-accent) l c h / 0.1);
}

.base-model-dropdown-item.active {
    background: oklch(from var(--lora-accent) l c h / 0.16);
}

.base-model-dropdown-item.selected {
    font-weight: 600;
}

.base-model-dropdown-item.selected::after {
    content: '✓';
    float: right;
    color: var(--lora-accent);
    margin-left: 8px;
}

/* Empty state */
.base-model-dropdown-empty {
    padding: 18px 12px;
    text-align: center;
    color: var(--text-color);
    opacity: 0.4;
    font-size: 0.88em;
}

.size-wrapper {
    flex: 1;
    border-left: 1px solid var(--lora-border);
    padding-left: var(--space-3);
}

.base-wrapper label,
.size-wrapper label {
    display: block;
    margin-bottom: 4px;
}

.size-wrapper span {
    font-family: var(--font-mono);
    font-size: 0.9em;
    opacity: 0.9;
}

/* New Model Name Header Styles */
.model-name-header {
    display: flex;
    align-items: center;
    width: calc(100% - 40px); /* Avoid overlap with close button */
    position: relative;
}

.model-name-content {
    margin: 0;
    padding: var(--space-1);
    border-radius: var(--border-radius-xs);
    font-size: 1.5em;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-color);
    border: 1px solid transparent;
    outline: none;
    flex: 1;
    overflow-wrap: anywhere; /* Allow wrapping at any character, including hyphens */
}

.model-name-content:focus {
    border: 1px solid var(--lora-accent);
    background: var(--bg-color);
}

/* Tab System Styling */
.showcase-tabs {
    display: flex;
    border-bottom: 1px solid var(--lora-border);
    margin-bottom: var(--space-2);
    position: relative;
    z-index: 2;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.95em;
    transition: var(--transition-base);
    opacity: 0.7;
    position: relative;
}

.tab-btn:hover {
    opacity: 1;
    background: oklch(var(--lora-accent-l) var(--lora-accent-c) var(--lora-accent-h) / 0.05);
}

.tab-btn.active {
    border-bottom: 2px solid var(--lora-accent);
    opacity: 1;
    font-weight: 600;
}

.tab-btn .tab-label {
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.tab-btn .tab-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--border-radius-xs);
    background: var(--badge-update-bg);
    color: var(--badge-update-text);
    font-size: 0.68em;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 3px 10px var(--badge-update-glow);
    border: 1px solid color-mix(in oklab, var(--badge-update-bg) 55%, transparent);
    line-height: 1;
}

.tab-badge--update {
    animation: tab-badge-pulse 2.8s ease-in-out infinite;
}

.tab-btn--has-update:not(.active) {
    color: color-mix(in oklch, var(--text-color) 70%, var(--badge-update-bg) 30%);
}

.tab-btn--has-update.active {
    border-bottom-color: var(--badge-update-bg);
}

@keyframes tab-badge-pulse {
    0%, 100% {
        box-shadow: 0 3px 10px color-mix(in oklch, var(--badge-update-glow) 100%, transparent);
        transform: translateY(0);
    }
    50% {
        box-shadow: 0 5px 14px color-mix(in oklch, var(--badge-update-glow) 90%, transparent);
        transform: translateY(-1px);
    }
}

.tab-content {
    position: relative;
    min-height: 100px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.recipes-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) 0 var(--space-3);
    margin-bottom: var(--space-2);
    border-bottom: 1px solid var(--lora-border);
}

.recipes-header__text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 520px;
}

.recipes-header__eyebrow {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.6;
}

.recipes-header__text h3 {
    margin: 0;
    font-size: 1.1em;
    line-height: 1.4;
}

.recipes-header__description {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.5;
    color: var(--text-color);
    opacity: 0.75;
}

.recipes-header__view-all {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 8px 14px;
    border: 1px solid oklch(var(--lora-accent-l) var(--lora-accent-c) var(--lora-accent-h) / 0.35);
    background: transparent;
    color: var(--lora-accent);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.recipes-header__view-all i {
    font-size: 0.85em;
}

.recipes-header__view-all:hover,
.recipes-header__view-all:focus-visible {
    background: oklch(var(--lora-accent-l) var(--lora-accent-c) var(--lora-accent-h) / 0.15);
    border-color: var(--lora-accent);
    outline: none;
    transform: translateY(-1px);
}

.recipes-header__view-all:active {
    transform: translateY(0);
}

.recipes-card-grid {
    max-width: none;
    margin: var(--space-3) 0 0;
    padding: 0;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-3);
    row-gap: var(--space-3);
}

.recipe-card {
    background: var(--lora-surface);
    border: 1px solid var(--lora-border);
    border-radius: var(--border-radius-base);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 320px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.recipe-card:hover {
    transform: translateY(-4px);
    border-color: oklch(var(--lora-accent-l) var(--lora-accent-c) var(--lora-accent-h) / 0.6);
    box-shadow: 0 16px 32px rgba(17, 17, 26, 0.18);
}

.recipe-card:focus-visible {
    outline: 2px solid var(--lora-accent);
    outline-offset: 3px;
}

.recipe-card__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--lora-surface);
}

.recipe-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.recipe-card:hover .recipe-card__media img {
    transform: scale(1.02);
}

.recipe-card__media::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 36%;
    background: linear-gradient(180deg, transparent 0%, rgba(12, 13, 24, 0.55) 100%);
    pointer-events: none;
}

.recipe-card__media-top {
    position: absolute;
    top: var(--space-1);
    right: var(--space-1);
    display: flex;
    gap: var(--space-1);
}

.recipe-card__copy {
    background: rgba(15, 21, 40, 0.6);
    border: none;
    border-radius: 999px;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.recipe-card__copy i {
    font-size: 0.85em;
}

.recipe-card__copy:hover,
.recipe-card__copy:focus-visible {
    background: rgba(15, 21, 40, 0.8);
    transform: translateY(-1px);
    outline: none;
}

.recipe-card__copy:active {
    transform: translateY(0);
}

[data-theme="light"] .recipe-card__copy {
    background: rgba(255, 255, 255, 0.85);
    color: rgba(17, 23, 41, 0.8);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .recipe-card__copy:hover,
[data-theme="light"] .recipe-card__copy:focus-visible {
    background: rgba(255, 255, 255, 0.95);
}

.recipe-card__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-2);
    flex: 1;
}

.recipe-card__title {
    margin: 0;
    font-size: 1.05em;
    line-height: 1.4;
    font-weight: 600;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.recipe-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.recipe-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78em;
    font-weight: 600;
    line-height: 1;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
}

.recipe-card__badge i {
    font-size: 0.85em;
}

.recipe-card__badge--base {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

[data-theme="light"] .recipe-card__badge {
    background: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .recipe-card__badge--base {
    background: rgba(15, 23, 42, 0.12);
}

.recipe-card__badge--ready {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
}

.recipe-card__badge--missing {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
}

.recipe-card__badge--empty {
    background: rgba(148, 163, 184, 0.18);
    color: #e2e8f0;
}

[data-theme="light"] .recipe-card__badge--ready {
    color: #157347;
    background: rgba(76, 167, 120, 0.16);
}

[data-theme="light"] .recipe-card__badge--missing {
    color: #9f580a;
    background: rgba(245, 199, 43, 0.22);
}

[data-theme="light"] .recipe-card__badge--empty {
    color: rgba(71, 85, 105, 0.9);
    background: rgba(148, 163, 184, 0.2);
}

.recipe-card__cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--lora-accent);
    font-size: 0.9em;
    font-weight: 600;
    pointer-events: none;
}

.recipe-card__cta i {
    font-size: 0.85em;
    transition: transform 0.2s ease;
}

.recipe-card:hover .recipe-card__cta i {
    transform: translateX(4px);
}

@media (max-width: 900px) {
    .recipes-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .recipes-header__view-all {
        align-self: flex-start;
    }
}

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


/* Loading, error and empty states */
.recipes-loading,
.recipes-error,
.recipes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    min-height: 200px;
}

.recipes-loading i,
.recipes-error i,
.recipes-empty i {
    font-size: 32px;
    margin-bottom: 15px;
    color: var(--lora-accent);
}

.recipes-error i {
    color: var(--lora-error);
}

/* Creator Information Styles */
.creator-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 10px;
    background: var(--surface-subtle);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius-sm);
    max-width: fit-content;
    cursor: pointer;
    transition: var(--transition-base);
}

[data-theme="dark"] .creator-info,
[data-theme="dark"] .civitai-view,
[data-theme="dark"] .modal-send-btn {
    background: var(--surface-subtle);
    border: 1px solid var(--lora-border);
}

.creator-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lora-surface);
    border: 1px solid var(--lora-border);
}

.creator-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.creator-placeholder {
    background: var(--lora-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.creator-username {
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-color);
}

/* Add hover effect for creator info */
.creator-info:hover,
.civitai-view:hover,
.modal-send-btn:hover {
    background: oklch(var(--lora-accent-l) var(--lora-accent-c) var(--lora-accent-h) / 0.1);
    border-color: var(--lora-accent);
    transform: translateY(-1px);
}

.creator-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.civitai-view {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface-subtle);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-color);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9em;
    transition: var(--transition-base);
}

.civitai-view i {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Send to ComfyUI Button */
.modal-send-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface-subtle);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-color);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9em;
    transition: var(--transition-base);
}

[data-theme="dark"] .modal-send-btn {
    background: var(--surface-subtle);
    border: 1px solid var(--lora-border);
}

.modal-send-btn:hover {
    background: oklch(var(--lora-accent-l) var(--lora-accent-c) var(--lora-accent-h) / 0.1);
    border-color: var(--lora-accent);
    transform: translateY(-1px);
}

.modal-send-btn:active {
    transform: translateY(0);
}

.modal-send-btn i {
    font-size: 14px;
}

.modal-send-btn span {
    white-space: nowrap;
}
