.kuehn-reader-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.08);
    z-index: 1000;
}

.kuehn-reader-progress__bar {
    width: 0;
    height: 100%;
    background: #0b6b63;
    transition: width 140ms linear;
}

.kuehn-reader-progress__label {
    position: absolute;
    right: 12px;
    top: 12px;
    font-size: 12px;
    background: #ffffff;
    border: 1px solid #d9d9d9;
    padding: 2px 8px;
    border-radius: 999px;
}

.kuehn-bookmark-widget {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 999;
}

.kuehn-bookmark-widget__toggle {
    width: 46px;
    height: 46px;
    border: 1px solid #d3d3d3;
    border-radius: 999px;
    background: #ffffff;
    color: #1e1e1e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.kuehn-bookmark-widget[data-state="open"] .kuehn-bookmark-widget__toggle {
    background: #0b6b63;
    color: #fff;
}

.kuehn-bookmark-panel {
    position: absolute;
    right: 0;
    bottom: 56px;
    width: min(360px, calc(100vw - 24px));
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.kuehn-bookmark-widget[data-state="open"] .kuehn-bookmark-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.kuehn-bookmark-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.kuehn-bookmark-panel__close {
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #525252;
}

.kuehn-bookmark-panel__actions {
    border-top: 1px solid #efefef;
    border-bottom: 1px solid #efefef;
    padding: 10px 0;
    margin-bottom: 8px;
}

.kuehn-bookmark-panel__note {
    width: 100%;
    min-height: 58px;
    margin: 0 0 8px;
}

.kuehn-bookmark-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid #ececec;
    padding-top: 10px;
    margin-top: 10px;
}

.kuehn-bookmark-item__content {
    min-width: 0;
    flex: 1;
}

.kuehn-bookmark-item__jump {
    border: 0;
    padding: 0;
    background: transparent;
    color: #0b6b63;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

.kuehn-bookmark-item__note {
    margin: 4px 0;
    color: #3d3d3d;
}

.kuehn-bookmark-item__meta {
    display: block;
    color: #777;
}

.kuehn-bookmark-item__delete {
    align-self: flex-start;
}

.kuehn-bookmark-panel__empty {
    color: #666;
    margin: 8px 0;
}

@media (max-width: 768px) {
    .kuehn-bookmark-widget {
        right: 10px;
        bottom: 72px;
    }
    .kuehn-bookmark-panel {
        width: min(340px, calc(100vw - 20px));
        max-height: 60vh;
        overflow-y: auto;
    }
}

.kuehn-reader-settings-toggle {
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 1000;
}

.kuehn-reader-settings {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1001;
}

.kuehn-reader-settings[data-state="open"] {
    display: block;
}

.kuehn-reader-settings__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}

.kuehn-reader-settings__panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(420px, 95vw);
    background: #fff;
    padding: 20px;
    overflow-y: auto;
}

.kuehn-reader-settings__group {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.kuehn-reader-settings__group button.is-active {
    border: 2px solid #0b6b63;
}

/* --------------------------------------------------------------------------
   Quote Share: Trigger Button
   -------------------------------------------------------------------------- */

.kuehn-quote-share-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #0b6b63;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    transition: background 0.15s, transform 0.15s;
    white-space: nowrap;
}

.kuehn-quote-share-trigger:hover {
    background: #095c55;
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Quote Share: Modal Overlay
   -------------------------------------------------------------------------- */

.kuehn-quote-share-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10002;
}

.kuehn-quote-share-modal[hidden] {
    display: none;
}

.kuehn-quote-share-modal__inner {
    width: min(360px, calc(100vw - 32px));
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: grid;
    gap: 6px;
}

[data-site-theme-resolved="dark"] .kuehn-bookmark-widget__toggle {
    background: #1a1f28;
    border-color: #334054;
    color: #e7eaf0;
}

[data-site-theme-resolved="dark"] .kuehn-bookmark-widget[data-state="open"] .kuehn-bookmark-widget__toggle {
    background: #1f3f39;
    color: #e7eaf0;
}

[data-site-theme-resolved="dark"] .kuehn-bookmark-panel,
[data-site-theme-resolved="dark"] .kuehn-reader-settings__panel,
[data-site-theme-resolved="dark"] .kuehn-quote-share-modal__inner {
    background: #171c25;
    border-color: #2b3340;
    color: #e7eaf0;
}

[data-site-theme-resolved="dark"] .kuehn-bookmark-panel__actions,
[data-site-theme-resolved="dark"] .kuehn-bookmark-item {
    border-color: #2b3340;
}

[data-site-theme-resolved="dark"] .kuehn-bookmark-panel__close,
[data-site-theme-resolved="dark"] .kuehn-bookmark-panel__empty,
[data-site-theme-resolved="dark"] .kuehn-bookmark-item__note,
[data-site-theme-resolved="dark"] .kuehn-bookmark-item__meta {
    color: #a1a8b5;
}

[data-site-theme-resolved="dark"] .kuehn-bookmark-item__jump {
    color: #9fc2ff;
}

[data-site-theme-resolved="dark"] .kuehn-bookmark-panel__note {
    background: #1f2633;
    border: 1px solid #334054;
    color: #e7eaf0;
}

/* All buttons and links inside the modal */
.kuehn-quote-share-modal__inner button,
.kuehn-quote-share-modal__inner a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: transparent;
    color: #1c2024;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.kuehn-quote-share-modal__inner button:hover,
.kuehn-quote-share-modal__inner a:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

/* Close button – subtle */
.kuehn-quote-share-modal__inner [data-quote-close] {
    margin-top: 4px;
    border: none;
    color: #6b7280;
    font-size: 13px;
}

.kuehn-quote-share-modal__inner [data-quote-close]:hover {
    background: #f3f4f6;
    color: #374151;
}

/* --------------------------------------------------------------------------
   Quote Share: Dark Mode
   -------------------------------------------------------------------------- */

[data-site-theme-resolved="dark"] .kuehn-quote-share-modal__inner {
    background: var(--kuehn-site-surface, #1a1f28);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

[data-site-theme-resolved="dark"] .kuehn-quote-share-modal__inner button,
[data-site-theme-resolved="dark"] .kuehn-quote-share-modal__inner a {
    border-color: var(--kuehn-site-border, #2b3340);
    color: var(--kuehn-site-text, #e7eaf0);
}

[data-site-theme-resolved="dark"] .kuehn-quote-share-modal__inner button:hover,
[data-site-theme-resolved="dark"] .kuehn-quote-share-modal__inner a:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-site-theme-resolved="dark"] .kuehn-quote-share-modal__inner [data-quote-close] {
    color: var(--kuehn-site-muted, #a1a8b5);
}

[data-site-theme-resolved="dark"] .kuehn-quote-share-modal__inner [data-quote-close]:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--kuehn-site-text, #e7eaf0);
}

/* --------------------------------------------------------------------------
   Toast Notification
   -------------------------------------------------------------------------- */

.kuehn-toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 24px;
    background: #0b6b63;
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 10003;
}

.kuehn-bookshelf-actions {
    margin-top: 20px;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    padding: 14px;
}

.kuehn-bookshelf-actions__buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
