/* The custom KOReader app's look: its icons, and its notes toolbar (a white
   bar across the top, equal cells, a light grey box behind the tool in use). */

.kosvg { display: block; width: 30px; height: 30px; flex: none; background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.kosvg.sm { width: 24px; height: 24px; }
.kosvg.lg { width: 36px; height: 36px; }
.ic.ko { width: 26px; height: 26px; }

.notes .tb { left: 0; right: 0; top: 0; transform: none; max-width: none; border-radius: 0; box-shadow: none;
  padding: 0; gap: 0; height: 46px; border-bottom: 2px solid #bbb; background: #fff; }
.notes .tb button { flex: 1; width: auto; height: 100%; border-radius: 0; position: relative; color: #555; }
.notes .tb button.on { background: none; color: #101010; }
.notes .tb button.on::before { content: ""; position: absolute; inset: 3px 2px; background: #e4e4e4; border-radius: 2px; z-index: -1; }
.notes .tb button { isolation: isolate; }
.notes .tb .word { font-size: 15px; }
.notes .tb button.on .word { font-weight: 700; }
.notes .tb button .ic { width: 23px; height: 23px; }
.notes .tb button .dot { width: 23px; height: 23px; box-shadow: inset 0 0 0 1.5px #555; }
.notes .tb button .bar { width: 55%; max-width: 30px; border-radius: 99px; }
.notes .tb .sync { position: absolute; right: 4px; top: 4px; margin: 0; width: 6px; height: 6px; }
.notes .zl { top: 54px; }

/* More card and round buttons, in the phone's line icons */
.more .cells button .ic.ko { width: 28px; height: 28px; color: #101010; }
.more .cells button { color: #333; }
.rb .ic.ko { width: 24px; height: 24px; }
.rb.big .ic.ko { width: 28px; height: 28px; }
.rb { border: 2px solid #222; }
.rb.red { color: #d32f2f; border-color: #222; }

/* KOReader-style top menu: a row of tab icons, the chosen tab's items below */
.reader .topmenu { padding-bottom: 4px; }
.km-tabs { display: flex; align-items: center; border-bottom: 1px solid var(--line); padding: 0 4px; }
.km-tabs button { flex: 1; height: 52px; display: grid; place-items: center; position: relative; color: #333; }
.km-tabs button.on { color: #000; }
.km-tabs button.on::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 0; height: 3px; background: #000; }
.km-items { max-height: min(60vh, 420px); overflow-y: auto; }
.km-items button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 13px 20px; text-align: left; border-bottom: 1px solid #eee; font-size: 16px; }
.km-items button:active { background: #f0f0f0; }
.km-items button small { margin-left: auto; color: var(--ink-3); font-size: 14px; }
.km-items .sep { height: 6px; background: #f3f3f3; }
.km-title { padding: 8px 20px 0; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* KOReader-style bottom bar: option rows above, tab icons below */
.kc-body { padding: 4px 4px 8px; display: flex; flex-direction: column; gap: 6px; }
.kc-row { display: flex; align-items: center; gap: 10px; }
.kc-row > label { width: 92px; font-size: 14px; color: #333; flex: none; }
.kc-opts { display: flex; flex: 1; gap: 4px; flex-wrap: wrap; }
.kc-opts button { flex: 1; min-width: 54px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border-radius: 4px; font-size: 12px; color: #444; }
.kc-opts button.on { background: #e4e4e4; color: #000; font-weight: 600; }
.kc-tabs { display: flex; border-top: 1px solid var(--line); margin: 6px -12px -12px; }
.kc-tabs button { flex: 1; height: 52px; display: grid; place-items: center; position: relative; color: #333; }
.kc-tabs button.on::before { content: ""; position: absolute; left: 22%; right: 22%; top: 0; height: 3px; background: #000; }

.reader .dogear .kosvg { width: 34px; height: 34px; }

/* home */
.center .tag { font-size: 18px; color: var(--ink); margin: 2px 0 2px; font-weight: 500; }
.center .alt { margin-top: 10px; padding: 11px 22px; border-radius: 999px; border: 1.6px solid var(--ink); font-weight: 600; background: #fff; }
.center .fine { font-size: 13px; color: var(--ink-3); max-width: 360px; margin-top: 14px; }
.addbook { margin: 12px 16px; display: flex; gap: 10px; align-items: center; justify-content: center; padding: 12px; border: 1.6px dashed #aaa; border-radius: 12px; color: var(--ink-2); width: calc(100% - 32px); }

.item.book [data-d] { width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink-3); flex: none; }
div.item { cursor: pointer; }
.kc-row.skim button { width: 40px; height: 40px; display: grid; place-items: center; }
.kc-row.skim input { flex: 1; accent-color: var(--ink); }
.kc-row .slider { flex: 1; }
.skim-n { font-size: 13px; color: var(--ink-2); min-width: 60px; text-align: right; font-variant-numeric: tabular-nums; }
.sheet-modal .panel.small > p { padding: 16px 18px 4px; margin: 0; }
.item .kosvg { flex: none !important; }
.item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.card .grid.selmodes { grid-template-columns: repeat(3, 84px); }
.card .grid.selmodes button { height: auto; padding: 8px 4px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #333; }
.card .grid.selmodes .ic { width: 28px; height: 28px; }

.addrow { display: flex; gap: 10px; margin: 12px 16px; }
.addrow .addbook { margin: 0; flex: 1; width: auto; }
.canvasview { height: 100%; display: flex; flex-direction: column; background: #fffffc; }
.cv-bar { display: flex; align-items: center; gap: 2px; height: 46px; padding: 0 6px; background: #fff; border-bottom: 1px solid var(--line); flex: none; }
.cv-bar button { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 8px; }
.cv-bar button:active { background: #eee; }
.cv-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.cv-page { font-size: 14px; color: #222; min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.cv-host { position: relative; flex: 1; min-height: 0; }

.reader .homebtn { position: absolute; left: 10px; top: 10px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.92); border: 1.6px solid var(--ink); display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,0.18); z-index: 5; }
.reader .homebtn:active { background: #e4e4e4; }

.importbtn { display: flex; align-items: center; gap: 8px; margin: -2px 16px 4px; padding: 6px 4px; font-size: 14px; color: var(--ink-2); }
.item.book [data-x] { width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink-3); flex: none; }

.srcs .src { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14.5px; cursor: pointer; }
.srcs .src input { width: 20px; height: 20px; accent-color: #111; flex: none; margin-top: 1px; }
.sheet-modal .row.pad { padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.sheet-modal .prog { padding: 14px 18px 4px; font-variant-numeric: tabular-nums; }
.reader .bubble .kosvg.bub { width: 32px; height: 32px; }
.reader .bubble.on { background: #d0d0d0; color: var(--ink); }
