* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    color: #24262b;
    background: #fff;
}
button,
input,
a {
    font: inherit;
}
button,
a {
    -webkit-tap-highlight-color: transparent;
}
button {
    cursor: pointer;
    border: 1px solid #d5d7db;
    background: white;
    border-radius: 8px;
    padding: 10px 15px;
    color: #25262a;
}
button:hover:not(:disabled) {
    border-color: #d90035;
    color: #d90035;
}
button:disabled {
    opacity: 0.4;
    cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid #007ac2;
    outline-offset: 3px;
}
.viewer {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 16px 20px 10px;
    gap: 10px;
}
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}
.eyebrow {
    font-size: 11px;
    letter-spacing: 2px;
    font-weight: 700;
    color: #d90035;
}
h1 {
    font-size: 19px;
    margin: 3px 0;
    font-weight: 700;
}
header a {
    font-size: 13px;
    color: #42454b;
    text-decoration: none;
    background: #fff;
    padding: 10px 13px;
    border-radius: 8px;
    white-space: nowrap;
}
.stage {
    position: relative;
    flex: 1;
    min-height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
#book {
    margin: auto;
}
.catalog-page {
    background: #fff;
    overflow: hidden;
}
.catalog-page img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}
.catalog-page .placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 13px;
}
.catalog-page:has(img[src]) .placeholder {
    display: none;
}
#loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f2f4;
    z-index: 5;
    padding: 25px;
    text-align: center;
}
#loading[hidden] {
    display: none;
}
.toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
    font-size: 13px;
}
.toolbar input {
    width: 60px;
    border: 1px solid #d5d7db;
    border-radius: 7px;
    background: white;
    padding: 9px 4px;
    text-align: center;
}
.toolbar label {
    display: flex;
    gap: 7px;
    align-items: center;
}
.separator {
    width: 12px;
}
.hint {
    text-align: center;
    color: #777;
    font-size: 11px;
    margin: 0;
    flex-shrink: 0;
}
dialog {
    border: 0;
    border-radius: 12px;
    padding: 0;
    width: min(98vw, 1700px);
    height: 94vh;
    max-height: 94vh;
    background: #ddd;
}
dialog::backdrop {
    background: #000a;
}
.detailbar {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    z-index: 1;
}
#detailbody {
    overflow: auto;
    padding: 12px;
    text-align: center;
    height: calc(100% - 63px);
}
#detailbody img {
    display: block;
    margin: auto;
    width: 100%;
    height: auto;
    max-width: 1600px;
}
#detailbody p {
    padding: 30px;
}
.stf__parent {
    isolation: isolate;
}
@media (max-width: 560px) {
    .viewer {
        padding: 10px 8px 8px;
        gap: 8px;
    }
    h1 {
        font-size: 15px;
    }
    header a {
        font-size: 11px;
        padding: 9px;
    }
    .toolbar {
        gap: 5px;
    }
    .toolbar button {
        padding: 9px 11px;
        font-size: 12px;
    }
    .separator {
        display: none;
    }
    .hint {
        font-size: 10px;
    }
}
@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto;
    }
}

#zoom, .hint {
	display: none !important;
}
