/* NovelNutt ARC Reader */
:root { color-scheme: light; }
.nnr {
	--bg: #fbfaf7; --ink: #1f1d1a; --muted: #6d6860; --line: #e6e1d8; --bar: #fffdf9; --accent: #8a5a2b; --accent-ink: #fff;
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
	--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
	-webkit-text-size-adjust: 100%;
}
.nnr[data-theme="sepia"] { --bg: #f4ecd8; --ink: #3b2f22; --muted: #7a6a55; --line: #e2d5b8; --bar: #f8f1e1; --accent: #8a5a2b; }
.nnr[data-theme="dark"] { --bg: #16171a; --ink: #e7e3dc; --muted: #9b968e; --line: #2c2e33; --bar: #1d1f23; --accent: #d9a46c; --accent-ink: #16171a; color-scheme: dark; }

.nnr-top, .nnr-bottom {
	position: fixed; left: 0; right: 0; z-index: 10; display: flex; align-items: center; gap: 4px;
	background: var(--bar); border-color: var(--line); padding: 0 8px;
}
.nnr-top { top: 0; height: 52px; border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.nnr-bottom { bottom: 0; height: 56px; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); justify-content: space-between; }
.nnr-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; padding: 0 6px; }
.nnr-heading strong, .nnr-heading span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nnr-heading strong { font-size: 14px; }
.nnr-heading span { font-size: 12px; color: var(--muted); }
.nnr-icon {
	display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 8px;
	background: none; color: var(--ink); font-size: 20px; text-decoration: none; cursor: pointer;
}
.nnr-icon svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.nnr-icon[aria-pressed="true"] svg { fill: var(--accent); stroke: var(--accent); }
.nnr-icon:hover, .nnr-icon[aria-expanded="true"] { background: var(--line); }
.nnr-icon:focus-visible, .nnr button:focus-visible, .nnr a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nnr-aa { font-family: var(--serif); font-size: 18px; }

.nnr-panel, .nnr-drawer { position: fixed; z-index: 20; background: var(--bar); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.nnr-panel { top: 58px; right: 8px; width: 300px; max-width: calc(100vw - 16px); border-radius: 12px; padding: 12px 14px; }
.nnr-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 14px; }
.nnr-row + .nnr-row { border-top: 1px solid var(--line); }
.nnr-seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.nnr-seg button { border: 0; background: none; color: var(--ink); padding: 7px 10px; font-size: 13px; cursor: pointer; }
.nnr-seg button + button { border-left: 1px solid var(--line); }
.nnr-seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.nnr-drawer { top: 0; bottom: 0; left: 0; width: 340px; max-width: 88vw; overflow: auto; padding: 8px 0 24px; border-radius: 0 12px 12px 0; }
.nnr-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 6px; }
.nnr-drawer ol, .nnr-drawer ul { list-style: none; margin: 0; padding: 0 8px; }
.nnr-drawer li { display: flex; align-items: center; }
.nnr-drawer li button { flex: 1; text-align: left; border: 0; background: none; color: var(--ink); padding: 10px 8px; border-radius: 8px; font-size: 15px; cursor: pointer; }
.nnr-drawer li button:hover { background: var(--line); }
.nnr-drawer li button[aria-current="true"] { color: var(--accent); font-weight: 600; }
.nnr-drawer .nnr-del { flex: 0 0 auto; color: var(--muted); font-size: 20px; padding: 6px 12px; }
.nnr-drawer .nnr-empty { color: var(--muted); font-size: 14px; padding: 6px 16px; }

.nnr-page { min-height: 100vh; padding: 76px 16px 96px; box-sizing: border-box; }
.nnr-text, .nnr-end {
	max-width: 36em; margin: 0 auto; font-family: var(--serif); font-size: 19px; line-height: 1.65; hyphens: auto;
	-webkit-user-select: none; user-select: none;
}
.nnr[data-font="sans"] .nnr-text { font-family: var(--sans); }
.nnr[data-font="easy"] .nnr-text { font-family: Verdana, Tahoma, var(--sans); letter-spacing: .02em; word-spacing: .12em; line-height: 1.85; hyphens: manual; }
.nnr[data-size="1"] .nnr-text { font-size: 15px; }
.nnr[data-size="2"] .nnr-text { font-size: 17px; }
.nnr[data-size="3"] .nnr-text { font-size: 19px; }
.nnr[data-size="4"] .nnr-text { font-size: 21px; }
.nnr[data-size="5"] .nnr-text { font-size: 24px; }
.nnr[data-size="6"] .nnr-text { font-size: 28px; }
.nnr-text h2, .nnr-text h3, .nnr-text h4, .nnr-end h2 { font-weight: 600; line-height: 1.25; text-align: center; margin: 1.2em 0 1.4em; }
.nnr-text h2 { font-size: 1.45em; }
.nnr-text p { margin: 0; text-indent: 1.4em; }
.nnr-text p.nn-sub { text-indent: 0; text-align: center; font-style: italic; color: var(--muted); margin: -.8em 0 1.6em; }
.nnr-text h2 + p, .nnr-text h3 + p, .nnr-text p.nn-sub + p, .nnr-text h4 + p, .nnr-text hr + p, .nnr-text p.nn-c, .nnr-text blockquote p { text-indent: 0; }
.nnr-text p.nn-c { text-align: center; }
.nnr-text blockquote { margin: 1em 1.5em; }
.nnr-text hr.nn-scene { border: 0; margin: 1.4em 0; text-align: center; height: 1em; }
.nnr-text hr.nn-scene::after { content: "\2022\00a0\00a0\2022\00a0\00a0\2022"; color: var(--muted); }
.nnr-text .nnr-wm { margin-top: 3em; padding-top: .8em; border-top: 1px solid var(--line); text-indent: 0; text-align: center; font-family: var(--sans); font-size: 12px; line-height: 1.5; color: var(--muted); }
.nnr-text .nnr-note { text-indent: 0; font-family: var(--sans); font-size: 14px; background: var(--line); padding: 8px 12px; border-radius: 8px; margin-bottom: 1em; }
.nnr-loading { text-align: center; color: var(--muted); font-family: var(--sans); font-size: 15px; text-indent: 0; padding: 30vh 0; }

.nnr-end { text-align: center; padding-top: 12vh; }
.nnr-end .nnr-due { color: var(--muted); }
.nnr-btn { display: inline-block; background: var(--accent); color: var(--accent-ink); text-decoration: none; padding: 12px 22px; border-radius: 999px; font-family: var(--sans); font-size: 16px; font-weight: 600; }
.nnr-end a:not(.nnr-btn) { color: var(--accent); font-family: var(--sans); font-size: 15px; }

.nnr-nav { border: 0; background: none; color: var(--ink); font-size: 15px; padding: 10px 12px; border-radius: 8px; cursor: pointer; min-width: 92px; }
.nnr-nav:hover:not(:disabled) { background: var(--line); }
.nnr-nav:disabled { opacity: .35; cursor: default; }
.nnr-progress { flex: 1; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.nnr-progress-bar { width: 100%; height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.nnr-progress-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.nnr-toast { position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 30; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100vw - 32px); text-align: center; }
.nnr-toast.is-on { opacity: 1; }

.nnr-print-block { display: none; }
@media print {
	body > * { display: none !important; }
	.nnr-print-block { display: block !important; padding: 40px; font: 18px sans-serif; }
}
@media (max-width: 480px) {
	.nnr-page { padding-left: 18px; padding-right: 18px; }
	.nnr-nav { min-width: 0; padding: 10px 8px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .nnr-progress-bar span, .nnr-toast { transition: none; } }

/* Drop cap on the first paragraph of each chapter */
.nnr-text p.nnr-drop { text-indent: 0; }
.nnr-text p.nnr-drop:not(.nnr-has-dc)::first-letter { float: left; font-size: 3.4em; line-height: .8; margin: .06em .08em 0 0; color: var(--accent); font-weight: 600; }
.nnr-text .nnr-dc {
	float: left; font-family: var(--serif); font-weight: 600; color: var(--accent);
	font-size: 3.5em; line-height: .78; margin: .07em .09em 0 0; padding: 0;
}
.nnr-text .nnr-dcq { font-size: .42em; vertical-align: top; line-height: 1; margin-right: .04em; position: relative; top: .08em; }
.nnr[data-font="easy"] .nnr-text .nnr-dc, .nnr[data-font="sans"] .nnr-text .nnr-dc { font-family: var(--serif); }
.nnr-text p.nnr-drop + p { clear: left; }
.nnr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Button at the end of each chapter */
.nnr-chapter-end { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 2.6em 0 1em; text-align: center; font-family: var(--sans); }
.nnr-chapter-end .nnr-end-note { text-indent: 0; margin: 0; color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 1em; }
.nnr-chapter-end .nnr-btn { border: 0; cursor: pointer; }
.nnr-btn-ghost { display: inline-block; background: none; border: 1px solid var(--line); color: var(--ink); padding: 10px 18px; border-radius: 999px; font-family: var(--sans); font-size: 15px; cursor: pointer; }
.nnr-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Samples */
.nnr-drawer li button.nnr-locked { color: var(--muted); }
.nnr-drawer li button.nnr-locked::after { content: " \1F512"; font-size: .85em; }
.nnr-cta { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 1.6em 1.2em; border: 1px solid var(--line); border-radius: 16px; background: var(--bar); }
.nnr-end .nnr-cta { margin-top: 4vh; }
.nnr-cta h2, .nnr-cta h3 { margin: 0; font-family: var(--serif); }
.nnr-cta h3 { font-size: 1.25em; }
.nnr-cta .nnr-end-note { margin: 0; max-width: 30em; }
.nnr-cta-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.nnr-cta-buttons a { text-decoration: none; }
.nnr-back-link { color: var(--accent); font-family: var(--sans); font-size: 14px; }

/* Continue the series */
.nnr-series-h { margin: .6em 0 0; font-family: var(--serif); font-size: 1.25em; }
.nnr-series { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; width: 100%; max-width: 640px; margin: 4px auto 0; text-align: center; }
.nnr-book { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.nnr-book-link { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink); text-decoration: none; font-family: var(--sans); font-size: 14px; line-height: 1.3; position: relative; }
.nnr-book-link img { width: 120px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.18); margin-bottom: 4px; }
.nnr-book-no { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.nnr-book-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.nnr-btn-sm { padding: 7px 12px !important; font-size: 13px !important; }
.nnr-free-tag { display: inline-block; background: #e8459a; color: #fff; font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.nnr-btn-ghost, .nnr-btn { text-decoration: none; }
