:root { --adtoon-viewport-height:100vh; color-scheme: dark; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #f8fafc; background: #000; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.42) #000; }
@supports (height:100svh) { :root { --adtoon-viewport-height:100svh; } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; margin: 0; }
body { background: #000; }
#app { width: min(100%, 680px); min-height: var(--adtoon-viewport-height, 100vh); margin: 0 auto; background: #000; }
#viewer { width: 100%; min-height: var(--adtoon-viewport-height, 100vh); background:#000; }
.viewer-back-link { position:fixed; top:max(14px,env(safe-area-inset-top)); left:max(14px,env(safe-area-inset-left)); z-index:1200; color:rgba(255,255,255,.86); font:600 14px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; text-decoration:none; text-shadow:0 1px 4px rgba(0,0,0,.78); }
.viewer-back-link:hover { color:#fff; text-decoration:underline; text-underline-offset:3px; }
.viewer-back-link:focus-visible { outline:3px solid #60a5fa; outline-offset:4px; border-radius:2px; }
html[data-reader-theme="light"] { color-scheme:light; color:#18212b; background:#e9edf2; scrollbar-color:#73808d #e9edf2; }
html[data-reader-theme="light"] body,
html[data-reader-theme="light"] #app,
html[data-reader-theme="light"] #viewer { background:#e9edf2; }
html[data-reader-theme="light"] .viewer-back-link { color:rgba(24,33,43,.84); text-shadow:0 1px 3px rgba(255,255,255,.9); }
html[data-reader-theme="light"] .viewer-back-link:hover { color:#111820; }
html[data-reader-theme="light"]::-webkit-scrollbar-track { background:#e9edf2; }
html[data-reader-theme="light"]::-webkit-scrollbar-thumb { border-color:#e9edf2; background:#73808d; }
:root::-webkit-scrollbar { width:8px; height:8px; }
:root::-webkit-scrollbar-track { background:#000; }
:root::-webkit-scrollbar-thumb { border:2px solid #000; border-radius:999px; background:rgba(255,255,255,.46); background-clip:padding-box; }
:root::-webkit-scrollbar-button { display:none; width:0; height:0; }
@media (hover:hover) and (pointer:fine) and (min-width:500px) {
  :root { scrollbar-width:none; }
  :root::-webkit-scrollbar { display:none; }
  html[data-reader-mode="paged_vertical"] body,
  html[data-reader-mode="paged_horizontal"] body { min-height:var(--adtoon-viewport-height, 100vh); display:flex; align-items:center; justify-content:center; overflow:hidden; }
}
@media (max-width:499px), (hover:none), (pointer:coarse) {
  #app { width:100% !important; }
}
html[data-reader-mode="paged_vertical"] #app,
html[data-reader-mode="paged_horizontal"] #app,
html[data-reader-mode="paged_vertical"] #viewer,
html[data-reader-mode="paged_horizontal"] #viewer { height:var(--adtoon-viewport-height, 100vh); min-height:0; overflow:hidden; }
@media (hover:hover) and (pointer:fine) and (min-width:500px) {
  html[data-reader-mode="paged_vertical"] #app,
  html[data-reader-mode="paged_horizontal"] #app,
  html[data-reader-mode="paged_vertical"] #viewer,
  html[data-reader-mode="paged_horizontal"] #viewer { height:100%; min-height:0; }
  html[data-reader-mode="paged_vertical"] #app,
  html[data-reader-mode="paged_horizontal"] #app { max-width:none; margin:auto; }
}
html[data-reader-mode],
html[data-reader-mode] body,
html[data-reader-mode] #app,
html[data-reader-mode] #viewer { background: #000; }
html[data-reader-mode][data-reader-theme="light"],
html[data-reader-mode][data-reader-theme="light"] body,
html[data-reader-mode][data-reader-theme="light"] #app,
html[data-reader-mode][data-reader-theme="light"] #viewer { background:#e9edf2; }
.status-card { width: min(92%, 560px); margin: 15vh auto 0; padding: 22px; border: 1px solid #334155; border-radius: 10px; background: #111827; color:#e2e8f0; text-align: center; line-height: 1.6; }
.status-card.error { border-color: #ef4444; background: #2a1013; color: #fecaca; }
.reader-menu-open { position: fixed; right: 10px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 1100; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; background: rgba(1,26,39,.86); color: #fff; font: 700 22px/1 system-ui,sans-serif; box-shadow: 0 5px 18px rgba(0,0,0,.22); cursor: pointer; }
.reader-menu-open:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
dialog { width: min(92vw, 520px); padding: 0; border: 0; border-radius: 12px; box-shadow: 0 20px 60px rgba(15, 23, 42, .3); }
dialog::backdrop { background: rgba(15, 23, 42, .6); }
.reader-menu { width: min(100vw, 520px); max-width: 100%; margin: auto auto 0; border-radius: 22px 22px 0 0; background: #fff; }
.reader-menu-sheet { display: grid; gap: 18px; padding: 8px 18px max(22px, env(safe-area-inset-bottom)); }
.reader-menu-handle { width: 42px; height: 4px; margin: 0 auto -4px; border-radius: 999px; background: #cbd5e1; }
.reader-mode-actions, .reader-direction-actions, .reader-snap-actions, .reader-auto-settings { display: grid; gap: 9px; }
.reader-setting-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.reader-setting-heading p { margin: 0; color: #12233f; font-size: 15px; font-weight: 800; }
.reader-setting-heading span { color: #52647c; font-size: 12px; line-height: 1.4; text-align: right; }
.reader-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reader-direction-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reader-snap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.reader-mode-grid button, .reader-direction-grid button, .reader-snap-grid button, .reader-menu-secondary, .reader-menu-action { min-height: 48px; border: 1px solid #a9b7c9; border-radius: 11px; background: #fff; color: #13233d; font: 700 15px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; cursor: pointer; }
.reader-mode-grid button[aria-pressed="true"], .reader-direction-grid button[aria-pressed="true"], .reader-snap-grid button[aria-pressed="true"] { border-color: #2563eb; background: #eaf2ff; color: #1245a8; box-shadow: inset 0 0 0 1px #2563eb; }
.reader-snap-grid button { display: grid; place-content: center; gap: 2px; min-height: 64px; padding: 8px 5px; }
.reader-snap-grid strong { font-size: 16px; }
.reader-snap-grid small { color: #52647c; font-size: 11px; font-weight: 600; line-height: 1.35; }
.reader-snap-grid button[aria-pressed="true"] small { color: #2959aa; }
.reader-auto-settings { padding: 13px; border: 1px solid #cbd8ea; border-radius: 12px; background: #f7faff; }
.reader-auto-settings label { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; color: #243752; font-size: 14px; font-weight: 700; }
.reader-auto-settings input { min-height: 32px; padding: 0; border: 0; accent-color: #2563eb; }
.reader-auto-settings output { min-width: 38px; color: #1245a8; text-align: right; }
.reader-menu-secondary { width: 100%; border-color: #a9b7c9; background: #f8fafc; }
.reader-menu-secondary:hover { background: #eef4fb; }
.reader-menu-action { width: 100%; border-color: #e4b7b7; background: #fffafa; color: #9f2727; }
.reader-menu-action:hover { background: #fff2f2; }
#report-form { display: grid; gap: 12px; padding: 18px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-heading h1 { margin: 0; font-size: 20px; }
.dialog-heading button { width: auto; min-width: 76px; height: 36px; padding: 0 12px; border: 1px solid #a9b7c9; border-radius: 999px; background: #fff; color: #12233f; font: 700 14px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; cursor: pointer; }
.dialog-heading button:hover { border-color: #7f93ad; background: #eef4fb; }
#report-form > p { margin: 0; color: #334155; font-size: 14px; line-height: 1.55; }
#report-form label { display: grid; gap: 5px; font-size: 14px; font-weight: 700; }
select, input, textarea { width: 100%; padding: 9px 10px; border: 1px solid #94a3b8; border-radius: 6px; background: #fff; color: #0f172a; font: inherit; }
textarea { min-height: 112px; resize: vertical; }
.report-submit { min-height: 42px; border: 1px solid #1d4ed8; border-radius: 7px; background: #2563eb; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.report-message { min-height: 1.4em; color: #166534 !important; font-weight: 700; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
@media (max-width: 420px) {
  .reader-menu-sheet { gap: 15px; padding-inline: 14px; }
  .reader-setting-heading { display: grid; gap: 2px; }
  .reader-setting-heading span { text-align: left; }
  .reader-snap-grid { gap: 6px; }
  .reader-snap-grid small { font-size: 10px; }
}
