.komikku-reader { color: #f4f4f4; font-size: 14px; letter-spacing: 0; }
.komikku-reader .reader-toolbar { grid-template-columns: 44px minmax(0,1fr) 44px 44px; gap: 4px; min-height: 64px; padding: calc(8px + env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left)); background: rgba(20,20,20,.93); }
.komikku-reader .reader-title { text-align: left; }
.komikku-reader .reader-title strong { font-size: 16px; font-weight: 600; }
.komikku-reader .reader-title span { font-size: 12px; color: #c6c6c6; margin-top: 4px; }
.reader-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border: 0; border-radius: 50%; background: transparent; color: inherit; padding: 10px; cursor: pointer; }
.reader-icon svg, .reader-command svg, .reader-chapter svg { width: 22px; height: 22px; flex-shrink: 0; }
.reader-icon[hidden] { display: none; }
.reader-icon:hover { background: #ffffff18; }
.reader-icon[aria-pressed=true] { color: #92dcc7; background: #92dcc71c; }
.reader-icon:focus-visible, .reader-sheet button:focus-visible { outline: 2px solid #92dcc7; outline-offset: -2px; }
.komikku-reader .reader-footer { display: block; padding: 4px max(8px,env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left)); background: rgba(20,20,20,.93); }
.reader-seek { display: grid; grid-template-columns: 44px minmax(30px,auto) minmax(0,1fr) minmax(30px,auto) 44px; gap: 6px; align-items: center; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.reader-seek input { width: 100%; min-width: 0; height: 36px; accent-color: #92dcc7; padding: 0; background: transparent; }
.reader-tools { display: flex; justify-content: space-evenly; }
.komikku-reader .reader-stage { touch-action: none; }
.komikku-reader .reader-stage[data-mode=webtoon], .komikku-reader .reader-stage[data-mode=continuous] { touch-action: pan-y; }
.komikku-reader .page-view, .komikku-reader.chrome-visible .page-view, .komikku-reader.chrome-hidden .page-view { padding: 0; --reader-page-height: var(--app-viewport-height,100dvh); transition: none; }
.komikku-reader .page-spread { gap: 0; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.komikku-reader .page-frame { position: relative; display: flex; justify-content: center; align-items: center; flex: 1 1 0; max-width: calc(100% / var(--spread-count)); min-width: 0; height: 100%; overflow: hidden; background: transparent; }
.komikku-reader .page-frame img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; box-shadow: none; user-select: none; }
/* Fit-to-screen: keep the grid cell inside the viewport. Without this the auto-sized track grows to
   height x page aspect ratio, so on tall (portrait) windows the page overflowed and was cropped. */
.komikku-reader .page-view.fit-mode-contain { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.komikku-reader .fit-mode-height .page-frame img { height: 100%; max-width: none; }
.komikku-reader .fit-mode-height { overflow-x: auto; }
.komikku-reader .fit-mode-width { display: block; overflow-y: auto; overflow-x: hidden; }
.komikku-reader .fit-mode-width .page-spread { height: auto; min-height: 100%; align-items: center; }
.komikku-reader .fit-mode-width .page-frame { height: auto; aspect-ratio: auto !important; }
.komikku-reader .fit-mode-width .page-frame img { width: 100%; max-height: none; }
.komikku-reader .split-frame img { max-width: 100%; max-height: 100%; object-fit: contain; }
.komikku-reader .webtoon-stage, .komikku-reader.chrome-visible .webtoon-stage { padding: 0; scroll-behavior: auto; position: relative; }
.komikku-reader .webtoon-strip { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--webtoon-gap); padding: 0 var(--side-padding); }
.komikku-reader .webtoon-page { position: relative; width: min(100%,1100px); min-height: 0; flex-shrink: 0; background: transparent; }
.komikku-reader .webtoon-page.image-ready { aspect-ratio: auto !important; }
.komikku-reader .webtoon-page img { max-width: 100%; }
.reader-page-indicator { position: absolute; z-index: 4; pointer-events: none; bottom: calc(12px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); padding: 3px 8px; background: #0009; color: #fff; border-radius: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }
.chrome-visible .reader-page-indicator { opacity: 0; }
.reader-image-retry { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); white-space: nowrap; }
.reader-panel-host { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.reader-panel-host:empty { display: none; }
.reader-backdrop { position: absolute; inset: 0; background: #0007; pointer-events: auto; }
.reader-sheet { position: absolute; left: 50%; bottom: max(12px,env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(480px,calc(100% - 24px)); max-height: min(75%,720px); display: flex; flex-direction: column; overflow: auto; overscroll-behavior: contain; background: #242625; color: #f5f5f5; border-radius: 8px; padding: 0 16px 16px; pointer-events: auto; box-shadow: 0 12px 48px #0007; }
.reader-sheet-heading { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; min-height: 52px; font-weight: 600; }
.reader-sheet h2 { font-size: 18px; margin: 8px 0; }
.reader-sheet p { color: #c6cbc8; }
.reader-tabs { display: flex; border-bottom: 1px solid #ffffff18; flex-shrink: 0; }
.reader-tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; color: #c7cbc9; flex: 1; padding: 12px 4px; border-radius: 0; white-space: nowrap; }
.reader-tabs button[aria-selected=true] { color: #92dcc7; border-bottom-color: #92dcc7; }
.reader-settings-body { overflow: auto; min-height: 0; }
.reader-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; min-height: 52px; border-bottom: 1px solid #ffffff0a; }
.reader-setting span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.reader-setting select { color: #e7edea; background: #323633; max-width: 55%; min-width: 0; padding: 8px; font-size: 13px; border: 1px solid #ffffff20; border-radius: 4px; }
.reader-setting input[type=checkbox] { width: 20px; height: 20px; accent-color: #92dcc7; flex-shrink: 0; }
.reader-setting-slider { display: block; }
.reader-setting-slider span { display: flex; justify-content: space-between; }
.reader-setting-slider input { width: 100%; height: 32px; accent-color: #92dcc7; padding: 0; margin-top: 6px; }
.reader-setting output { font-variant-numeric: tabular-nums; color: #92dcc7; }
.reader-swatches { display: flex; gap: 12px; }
.reader-swatches button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #8b918e; padding: 0; }
.reader-swatches button[aria-pressed=true] { outline: 2px solid #92dcc7; outline-offset: 3px; }
.reader-command { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 8px; border: 0; border-radius: 4px; background: transparent; color: #e9eeeb; text-align: left; }
.reader-command:hover, .reader-chapter:hover { background: #ffffff0b; }
.reader-chapter-list { overflow: auto; min-height: 0; }
.reader-chapter { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 0; background: transparent; color: #e9eeeb; text-align: left; padding: 14px 8px; }
.reader-chapter span { min-width: 0; overflow-wrap: anywhere; }
.reader-chapter.is-current { color: #92dcc7; background: #92dcc710; }
@media (max-width:360px) { .reader-tools .reader-icon { width: 40px; flex-basis: 40px; } .reader-seek { gap: 2px; } .komikku-reader .reader-title strong { font-size: 14px; } }
@media (max-height:480px) { .reader-sheet { bottom: 8px; max-height: 90%; } .komikku-reader .reader-toolbar { min-height: 48px; padding-top: env(safe-area-inset-top); padding-bottom: 0; } .reader-tools .reader-icon { height: 36px; } }
@media (prefers-reduced-motion:reduce) { .komikku-reader * { scroll-behavior: auto !important; transition: none !important; } }
