.search-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 16px;
}

.search-choice-btn {
    border: 1pt solid rgb(141, 59, 248);
    color: white;
    background: rgb(141, 59, 248);
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.search-choice-btn.active {
    background: white;
    color: rgb(141, 59, 248);
    border-color: rgb(141, 59, 248);
}

.search-choice-btn .barcode-icon {
    width: 24px;
    height: 14px;
    fill: currentColor;
}

.search-panels {
    margin-bottom: 16px;
}

.search-panel {
    display: none;
}

.search-panel.is-active {
    display: block;
}

.search-panel-body {
    position: relative;
    vertical-align: middle;
    max-width: 420pt;
    padding-bottom: 10pt;
}

.search-scan-body {
    text-align: left;
    max-width: 520pt;
}

.scan-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1pt solid rgb(59, 78, 248);
    background: rgb(59, 78, 248);
    color: white;
    padding: 10px 14px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

.search-choice-btn:hover {
    background: white;
    color: rgb(141, 59, 248);
    border-color: rgb(141, 59, 248);
}

.scan-button:hover {
    background: white;
    color: rgb(59, 78, 248);
    border-color: rgb(59, 78, 248);
}

.scan-button-icon {
    width: 28px;
    height: 18px;
    display: inline-flex;
}

.scan-button-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.scan-hint {
    margin: 10px 0;
    color: #555;
    font-size: 0.9em;
}

.scan-target {
    max-width: 600px;
    width: 100%;
    margin: 8px auto 0;
    position: relative;
}

.scanner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.scanner-modal {
    background: white;
    color: black;
    width: min(90vw, 640px);
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.scanner-modal.fullscreen {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    background: black;
    color: white;
}

.scanner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.05);
}

.scanner-modal.fullscreen .scanner-header {
    background: rgba(0, 0, 0, 0.35);
}

.scanner-title {
    font-weight: 700;
}

.scanner-close {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
}

.scanner-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px 16px;
}

.scanner-modal.fullscreen .scanner-body {
    padding: 0;
}

.scanner-body video,
.scanner-body canvas,
.scanner-body div {
    width: 100%;
}

.scan-target video,
.scan-target canvas {
    position: relative;
    z-index: 1;
}

.scan-target::before {
    content: "";
    position: absolute;
    inset: 12% 8%;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
    z-index: 2;
    pointer-events: none;
}

.scan-target::after {
    content: "";
    position: absolute;
    inset: 12% 8%;
    z-index: 3;
    pointer-events: none;
    background:
        linear-gradient(rgb(84, 99, 99), rgb(84, 99, 99)) left top / 28px 3px no-repeat,
        linear-gradient(rgb(84, 99, 99), rgb(84, 99, 99)) left top / 3px 28px no-repeat,
        linear-gradient(rgb(84, 99, 99), rgb(84, 99, 99)) right top / 28px 3px no-repeat,
        linear-gradient(rgb(84, 99, 99), rgb(84, 99, 99)) right top / 3px 28px no-repeat,
        linear-gradient(rgb(84, 99, 99), rgb(84, 99, 99)) left bottom / 28px 3px no-repeat,
        linear-gradient(rgb(84, 99, 99), rgb(84, 99, 99)) left bottom / 3px 28px no-repeat,
        linear-gradient(rgb(84, 99, 99), rgb(84, 99, 99)) right bottom / 28px 3px no-repeat,
        linear-gradient(rgb(84, 99, 99), rgb(84, 99, 99)) right bottom / 3px 28px no-repeat,
        linear-gradient(rgba(255, 106, 0, 0.9), rgba(119, 223, 101, 0.9)) center / 70% 2px no-repeat;
}

.scanner-modal.fullscreen .scanner-body video {
    height: 100%;
    object-fit: cover;
}

.scanner-modal.fullscreen .scan-target {
    height: 100%;
}

@media (max-width: 768px) {
    .scan-target::before,
    .scan-target::after {
        inset: 28% 8%;
    }
}

.isbn-sheet {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 10000;
    pointer-events: none;
}

.isbn-sheet.is-open {
    pointer-events: auto;
}

.isbn-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 200ms ease;
}

.isbn-sheet.is-open .isbn-sheet-backdrop {
    opacity: 1;
}

.isbn-sheet-panel {
    position: relative;
    background: white;
    color: #111;
    width: min(640px, 100%);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.25);
    padding: 18px 18px 22px;
    transform: translateY(100%);
    transition: transform 220ms ease;
}

.isbn-sheet.is-open .isbn-sheet-panel {
    transform: translateY(0);
}

.isbn-sheet-close {
    position: absolute;
    top: 8px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.isbn-sheet-title {
    font-weight: 700;
    margin-bottom: 12px;
}

.isbn-sheet-card {
    display: flex;
    gap: 14px;
    align-items: center;
    text-decoration: none;
    color: inherit;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 14px;
    padding: 12px;
}

.isbn-sheet-cover-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.isbn-sheet-cover {
    width: 70px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.05);
    flex: 0 0 auto;
}

.isbn-sheet-status {
    font-size: 0.85em;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid currentColor;
    background: rgba(0, 0, 0, 0.03);
    text-align: center;
    white-space: nowrap;
}

.isbn-sheet-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.isbn-sheet-book-title {
    font-weight: 700;
}

.isbn-sheet-book-author {
    color: #555;
}

.isbn-sheet-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgb(59, 78, 248);
    font-weight: 700;
}

.isbn-sheet-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    bottom: 0;
    background: white;
    padding: 8px 0 4px;
    z-index: 1;
}

.isbn-action-btn {
    border: 1px solid currentColor;
    background: var(--isbn-action-color, currentColor);
    color: #fff;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}


.isbn-action-btn svg {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

.isbn-action-btn.alire {
    --isbn-action-color: rgb(255, 123, 0);
}

.isbn-action-btn.encours {
    --isbn-action-color: blue;
}

.isbn-action-btn.lu {
    --isbn-action-color: green;
}

.isbn-action-btn.is-active {
    background: #fff;
    border-color: var(--isbn-action-color, currentColor);
    color: var(--isbn-action-color, currentColor);
}

.isbn-action-btn.is-active.alire {
    color: rgb(255, 123, 0);
}

.isbn-action-btn.is-active.encours {
    color: blue;
}

.isbn-action-btn.is-active.lu {
    color: green;
}

@media (max-width: 520px) {
    .isbn-sheet-actions {
        gap: 6px;
    }
    .isbn-action-btn {
        padding: 6px 10px;
        font-size: 0.9em;
    }
}


.isbn-rating-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.isbn-rating-modal.is-open {
    display: flex;
}

.isbn-rating-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.isbn-rating-panel {
    position: relative;
    background: white;
    color: #111;
    border-radius: 16px;
    padding: 18px 20px;
    width: min(90vw, 360px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.isbn-rating-modal .modal-content {
    background: #fff;
}

.isbn-rating-modal .container {
    background: #fff;
}

.isbn-rating-close {
    position: absolute;
    right: 10px;
    top: 8px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.isbn-sheet-rating {
    margin-top: 12px;
}

.isbn-sheet-rating-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.isbn-rate {
    font-size: 18pt;
}

