.fav-page {
    max-width: 1100px;
    margin: 0 auto 60px;
    padding: 0 16px;
}

.fav-page__intro h1 {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.2;
}

.fav-page__intro p {
    margin: 0 0 20px;
    color: #555;
    font-size: 15px;
}

.fav-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

.fav-search {
    flex: 1 1 220px;
    min-width: 180px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
}

.fav-filters {
    display: inline-flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.fav-filters button {
    border: none;
    background: #fff;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    color: #555;
}

.fav-filters button + button {
    border-left: 1px solid #ddd;
}

.fav-filters button.is-active {
    background: #7ac143;
    color: #fff;
}

.fav-sort {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
}

.fav-count {
    margin-left: auto;
    color: #777;
    font-size: 13px;
}

.fav-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.fav-list.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.fav-card {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.fav-card__preview {
    min-height: 120px;
    height: auto;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    border-bottom: 1px solid #eee;
    padding: 16px;
    box-sizing: border-box;
}

.fav-card__preview--cutsheet {
    background: #fff;
    align-items: flex-start;
}

.fav-card__preview--cutsheet .fav-cutsheet-face {
    display: block;
    overflow: visible;
}

.fav-card__preview--cutsheet .label-container {
    margin: 0;
}

/* Match cutsheet: no extra chrome on the label face */
.fav-card__preview--cutsheet .disLabel {
    box-shadow: none;
    margin: 0 !important;
}

/* metal-brushed.css sets large em fonts/margins for .metal buttons — keep cutsheet mm sizing */
.fav-card__preview--cutsheet .disLabel.metal {
    font-size: inherit;
    line-height: inherit;
    text-shadow: none;
    box-shadow: none;
    outline: 1px solid #666;
}

.fav-card__preview--cutsheet .disLabel .hole {
    background: #fff;
}

.fav-card__preview--cutsheet .stats {
    margin-top: 4px;
    font-size: 12px;
    color: #333;
    line-height: 1.3;
}

.fav-card__preview--cutsheet .stats .act-reorder,
.fav-card__preview--cutsheet .stats .act-favourite {
    display: none !important;
}

.fav-card__preview--svg svg,
.fav-card__preview--svg > svg {
    max-width: 100%;
    max-height: 136px;
    width: auto;
    height: auto;
}

.fav-card__preview--img img {
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
}

.fav-card__preview--text {
    padding: 12px;
    text-align: center;
    font-size: 14px;
    color: #333;
    word-break: break-word;
}

.fav-card__preview--fallback {
    color: #bbb;
    font-size: 28px;
}

.fav-card__body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.fav-card__head {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.fav-card__title {
    margin: 0;
    font-size: 16px;
    line-height: 1.3;
    flex: 1;
    word-break: break-word;
}

.fav-card__badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    padding: 3px 6px;
}

.fav-card__sub,
.fav-card__meta,
.fav-card__order,
.fav-card__review {
    margin: 0;
    font-size: 13px;
    color: #666;
    word-break: break-word;
}

.fav-card__review {
    color: #856404;
}

.fav-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    flex-wrap: wrap;
}

.fav-card__add {
    background: #7ac143;
    border-color: #7ac143;
    color: #fff;
    margin: 0;
}

.fav-card__nick.btn-link {
    border: none;
    background: none;
    color: #555;
    text-decoration: underline;
    cursor: pointer;
    padding: 6px 4px;
    font-size: 13px;
}

.fav-card__remove {
    margin-left: auto;
    border: 1px solid #ddd;
    background: #fff;
    color: #c0392b;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fav-card__remove:hover,
.fav-card__remove:focus-visible {
    border-color: #c0392b;
    outline: 2px solid #7ac143;
    outline-offset: 2px;
}

.fav-empty,
.fav-no-results,
.fav-error {
    text-align: center;
    padding: 40px 16px;
    border: 1px dashed #ddd;
    border-radius: 8px;
    background: #fafafa;
}

.fav-empty h2,
.fav-no-results h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.fav-empty p,
.fav-no-results p {
    margin: 0 0 16px;
    color: #666;
}

.fav-error {
    border-style: solid;
    border-color: #f5c2c0;
    background: #fdecea;
    color: #b00020;
}

.fav-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.fav-pager__status {
    font-size: 13px;
    color: #666;
}

.act-favourite {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    border: 1px solid #ccc;
    background: #fff;
    color: #444;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    line-height: 1.2;
    vertical-align: middle;
    text-decoration: none;
}

a.act-favourite:hover {
    color: #444;
    text-decoration: none;
}

.act-favourite i {
    color: #888;
}

.act-favourite.is-favourited {
    border-color: #c0392b;
    color: #c0392b;
}

.act-favourite.is-favourited i {
    color: #c0392b;
}

.act-favourite:focus-visible {
    outline: 2px solid #7ac143;
    outline-offset: 2px;
}

.act-favourite[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    min-width: 180px;
    max-width: 240px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #222;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 20;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.act-favourite[data-tooltip]::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 2px);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #222;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 20;
}

.act-favourite[data-tooltip]:hover::after,
.act-favourite[data-tooltip]:focus-visible::after,
.act-favourite[data-tooltip]:hover::before,
.act-favourite[data-tooltip]:focus-visible::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.act-favourite.is-favourited[data-tooltip]::after {
    content: 'Saved to Favourites. Click to remove, or open Favourites anytime to reorder.';
}

@media (max-width: 640px) {
    .fav-count { width: 100%; margin-left: 0; }
    .fav-card__actions { gap: 6px; }
}
