:root {
  color-scheme: light;
  --bg: #f4f2ed;
  --panel: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.82);
  --panel-overlay: rgba(255, 255, 255, 0.96);
  --panel-muted: rgba(244, 248, 249, 0.72);
  --panel-active: #d8eff1;
  --panel-active-border: rgba(13, 107, 118, 0.24);
  --ink: #1d2529;
  --muted: #607078;
  --subtitle-ink: rgba(28, 55, 61, 0.82);
  --line: #d7d2c8;
  --control-outline: rgba(13, 107, 118, 0.18);
  --input-border: rgba(13, 107, 118, 0.22);
  --accent: #0d6b76;
  --accent-strong: #0a4f58;
  --shadow: 0 18px 60px rgba(29, 37, 41, 0.14);
  --shadow-soft: 0 12px 28px rgba(29, 37, 41, 0.16);
  --shadow-panel: 0 18px 46px rgba(29, 37, 41, 0.18);
  --focus-ring: rgba(13, 107, 118, 0.28);
  --overlay-backdrop: rgba(18, 26, 30, 0.16);
  --stage-bg: #e9e5dc;
  --viewer-status-bg: rgba(233, 229, 220, 0.92);
  --viewer-status-ink: rgba(16, 24, 28, 0.9);
  --viewer-status-shadow: 0 2px 14px rgba(255, 255, 255, 0.9);
  --kbd-bg: rgba(240, 246, 247, 0.92);
  --input-bg: rgba(255, 255, 255, 0.92);
  --note-popup-bg: rgba(255, 255, 255, 0.6);
  --draft-popup-bg: rgba(170, 176, 184, 0.6);
  --fullscreen-note-popup-bg: rgba(0, 0, 0, 0.6);
  --fullscreen-draft-popup-bg: rgba(28, 32, 36, 0.6);
  --popup-title-ink: #000;
  --top-icon-ink: rgba(29, 37, 41, 0.72);
  --viewer-icon-ink: rgb(156, 170, 174);
  --viewer-accent-ink: rgba(13, 79, 88, 0.52);
  --viewer-badge-ink: rgba(13, 79, 88, 0.82);
  --viewer-title-ink: rgb(156, 170, 174);
  --viewer-title-size: 19px;
  --viewer-title-size-mobile: 19px;
  --danger-bg: rgba(250, 238, 238, 0.94);
  --danger-border: rgba(158, 44, 44, 0.22);
  --danger-ink: #8e2222;
  --thumb-strip-bg: rgba(255, 255, 255, 0.78);
  --thumb-button-bg: #e6e1d8;
  --viewer-icon-text-shadow: none;
  --viewer-icon-drop-shadow: none;
  --viewer-indicator-corner-padding: 15px;
  --viewer-indicator-cell-size: 42px;
  --viewer-indicator-left-edge: var(--viewer-indicator-corner-padding);
  --viewer-indicator-right-edge: var(--viewer-indicator-corner-padding);
  --viewer-indicator-top-edge: var(--viewer-indicator-corner-padding);
  --viewer-indicator-bottom-edge: var(--viewer-indicator-corner-padding);
  --page-top-tray-right-edge: max(8px, env(safe-area-inset-right));
  --page-top-tray-counter-gap: 8px;
  --page-top-tray-width: 48px;
  --page-top-counter-reserved-width: 78px;
  --image-textbox-ink: #1d2529;
  --settings-color-swatch-white: #ffffff;
  --settings-color-swatch-standard: #e9e5dc;
  --settings-color-swatch-dark: #12161d;
}

:root[data-color-scheme="white"] {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.92);
  --panel-overlay: rgba(255, 255, 255, 0.985);
  --panel-muted: rgba(242, 244, 247, 0.94);
  --panel-active: #edf2f4;
  --panel-active-border: rgba(13, 107, 118, 0.2);
  --muted: #4f5d66;
  --subtitle-ink: rgba(38, 48, 54, 0.78);
  --line: #d6dce2;
  --control-outline: rgba(13, 107, 118, 0.14);
  --input-border: rgba(13, 107, 118, 0.16);
  --shadow: 0 20px 58px rgba(29, 37, 41, 0.11);
  --shadow-soft: 0 12px 26px rgba(29, 37, 41, 0.12);
  --shadow-panel: 0 18px 42px rgba(29, 37, 41, 0.14);
  --stage-bg: #fafafa;
  --viewer-status-bg: rgba(255, 255, 255, 0.98);
  --kbd-bg: rgba(239, 242, 246, 0.98);
  --input-bg: rgba(255, 255, 255, 0.99);
  --note-popup-bg: rgba(255, 255, 255, 0.6);
  --draft-popup-bg: rgba(227, 231, 236, 0.6);
  --top-icon-ink: rgba(27, 34, 39, 0.76);
  --viewer-icon-ink: rgba(112, 123, 132, 0.86);
  --viewer-accent-ink: rgba(10, 79, 88, 0.58);
  --viewer-badge-ink: rgba(10, 79, 88, 0.84);
  --viewer-title-ink: rgb(156, 170, 174);
  --viewer-title-size: 19px;
  --viewer-title-size-mobile: 19px;
  --thumb-strip-bg: rgba(245, 247, 249, 0.92);
  --thumb-button-bg: #edf1f4;
}

:root[data-color-scheme="dark"] {
  color-scheme: dark;
  --bg: #090b10;
  --panel: #11151d;
  --panel-soft: rgba(17, 21, 29, 0.86);
  --panel-overlay: rgba(18, 23, 31, 0.95);
  --panel-muted: rgba(18, 25, 34, 0.9);
  --panel-active: #1b3137;
  --panel-active-border: rgba(123, 184, 192, 0.36);
  --ink: #edf4f7;
  --muted: #9cabb6;
  --subtitle-ink: rgba(214, 226, 232, 0.76);
  --line: #273240;
  --control-outline: rgba(123, 184, 192, 0.22);
  --input-border: rgba(123, 184, 192, 0.28);
  --accent: #7bb8c0;
  --accent-strong: #b5e3e8;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.4);
  --shadow-panel: 0 18px 46px rgba(0, 0, 0, 0.48);
  --focus-ring: rgba(123, 184, 192, 0.4);
  --overlay-backdrop: rgba(1, 4, 8, 0.56);
  --stage-bg: #12161d;
  --viewer-status-bg: rgba(14, 18, 25, 0.96);
  --viewer-status-ink: #eef5f7;
  --viewer-status-shadow: 0 2px 18px rgba(0, 0, 0, 0.72);
  --kbd-bg: rgba(26, 34, 44, 0.96);
  --input-bg: rgba(13, 18, 25, 0.92);
  --note-popup-bg: rgba(18, 23, 31, 0.6);
  --draft-popup-bg: rgba(36, 42, 52, 0.6);
  --popup-title-ink: #f3f7f8;
  --top-icon-ink: rgba(221, 233, 238, 0.76);
  --viewer-icon-ink: rgba(196, 210, 218, 0.84);
  --viewer-accent-ink: rgba(181, 227, 232, 0.72);
  --viewer-badge-ink: rgba(181, 227, 232, 0.88);
  --viewer-title-ink: rgb(156, 170, 174);
  --viewer-title-size: 19px;
  --viewer-title-size-mobile: 19px;
  --danger-bg: rgba(68, 27, 31, 0.88);
  --danger-border: rgba(231, 132, 132, 0.28);
  --danger-ink: #ffb6b6;
  --thumb-strip-bg: rgba(16, 21, 29, 0.92);
  --thumb-button-bg: #1b2430;
  --viewer-icon-text-shadow: none;
  --viewer-icon-drop-shadow: none;
}

@font-face {
  font-family: "Devnotes Helvetica Neue Regular";
  src: url("./fonts/HelveticaNeue-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Devnotes Helvetica Neue Bold";
  src: url("./fonts/HelveticaNeue-Bold.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Devnotes Helvetica Neue Italic";
  src: url("./fonts/HelveticaNeue-Italic.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Devnotes Helvetica Neue Bold Italic";
  src: url("./fonts/HelveticaNeue-BoldItalic.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Devnotes Helvetica Neue Condensed Bold";
  src: url("./fonts/HelveticaNeue-CondensedBold.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Devnotes Helvetica Neue UltraLight";
  src: url("./fonts/HelveticaNeue-UltraLight.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Devnotes Helvetica Neue UltraLight Italic";
  src: url("./fonts/HelveticaNeue-UltraLightItalic.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Devnotes Helvetica Neue Light";
  src: url("./fonts/HelveticaNeue-Light.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Devnotes Helvetica Neue Light Italic";
  src: url("./fonts/HelveticaNeue-LightItalic.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Devnotes Helvetica Neue Condensed Black";
  src: url("./fonts/HelveticaNeue-CondensedBlack.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Devnotes Helvetica Neue Medium";
  src: url("./fonts/HelveticaNeue-Medium.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Devnotes Helvetica Neue Medium Italic";
  src: url("./fonts/HelveticaNeue-MediumItalic.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Devnotes Helvetica Neue Thin";
  src: url("./fonts/HelveticaNeue-Thin.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Devnotes Helvetica Neue Thin Italic";
  src: url("./fonts/HelveticaNeue-ThinItalic.ttf") format("truetype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.fullscreen-view {
  --viewer-icon-text-shadow: none;
  --viewer-icon-drop-shadow: none;
  --viewer-indicator-left-edge: max(var(--viewer-indicator-corner-padding), env(safe-area-inset-left));
  --viewer-indicator-right-edge: max(var(--viewer-indicator-corner-padding), env(safe-area-inset-right));
  --viewer-indicator-top-edge: max(var(--viewer-indicator-corner-padding), env(safe-area-inset-top));
  --viewer-indicator-bottom-edge: max(var(--viewer-indicator-corner-padding), env(safe-area-inset-bottom));
}

@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
  body.fullscreen-view {
    --viewer-indicator-left-edge: var(--viewer-indicator-corner-padding);
    --viewer-indicator-right-edge: var(--viewer-indicator-corner-padding);
  }

  body.safari-like-browser .top-left-control-tray {
    left: 8px;
  }

  body.safari-like-browser {
    --page-top-tray-right-edge: 8px;
  }
}

button {
  color: inherit;
  font: inherit;
}

.top-left-control-tray {
  position: absolute;
  z-index: 22;
  top: max(8px, env(safe-area-inset-top));
  left: max(8px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100dvw - 16px);
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
  transform: translateX(calc(-1 * var(--sidebar-slide-offset, 0px)));
  transition: transform 160ms ease;
}

.top-left-control-tray:has(.settings-panel[open]) {
  z-index: 24;
}

.settings-panel {
  position: relative;
  z-index: 0;
  width: max-content;
  max-width: min(280px, calc(100dvw - 32px));
}

.top-left-control-spacer {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
}

.top-left-control-placeholder {
  color: var(--top-icon-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  user-select: none;
  cursor: pointer;
}

.top-left-control-placeholder:hover {
  color: var(--accent-strong);
}

.top-left-control-spacer-icon {
  display: block;
  width: 30.52px;
  height: 30.52px;
  object-fit: contain;
  pointer-events: none;
  transform: translateX(4px);
}

.folder-button.sidebar-mode-button {
  position: relative;
  font-weight: 400;
  min-height: 40px;
  padding: 5px 6px;
  font-size: 15px;
  flex: 0 0 auto;
}

.sidebar-mode-button .folder-button-label {
  position: relative;
  z-index: 0;
  gap: 5px;
}

.sidebar-mode-button .folder-button-text {
  font-size: 15px;
  line-height: 1.2;
}

.sidebar-mode-button .folder-button-file-icon {
  width: 25.2px;
  height: 25.2px;
}

.sidebar-mode-button-symbol {
  display: grid;
  place-items: center;
  width: 25.2px;
  height: 25.2px;
  flex: 0 0 auto;
  color: var(--viewer-icon-ink);
  font-size: 25.2px;
  line-height: 1;
  font-family: "Apple Symbols", "Noto Sans Symbols 2", "Segoe UI Symbol", sans-serif;
  transform: translateY(4px);
}

.sidebar-record-button .folder-button-file-icon {
  width: 22.18px;
  height: 27.72px;
  margin-right: 1.82px;
}

.sidebar-draft-button .folder-button-file-icon {
  width: 23.38px;
  height: 27.72px;
  margin-right: 1.82px;
}

.sidebar-memo-button .folder-button-file-icon {
  width: 23.38px;
  height: 27.72px;
  margin-right: 1.82px;
}

.sidebar-flash-button .folder-button-file-icon {
  width: 30.43px;
  height: 30.43px;
  margin-right: -5.23px;
  transform: translate(-3px, -2px);
}

.sidebar-flash-button .folder-button-label {
  overflow: visible;
}

.sidebar-flash-button .folder-button-text {
  overflow: hidden;
}

.sidebar-bookmarks-button {
  padding-right: 0;
}

.sidebar-bookmarks-button .folder-button-label {
  overflow: visible;
}

.sidebar-bookmarks-button .folder-button-text {
  overflow: visible;
  text-overflow: clip;
  transform: translateX(-4px);
}

.sidebar-bookmarks-button .bookmarks-label-tail {
  font-size: 13px;
}

.sidebar-bookmarks-button .sidebar-mode-button-info {
  right: 0;
}

.sidebar-mode-button .sidebar-mode-button-info {
  position: absolute;
  top: 50%;
  right: 6px;
  z-index: 1;
  color: var(--muted);
  font-size: 16.875px;
  line-height: 1;
  opacity: 0;
  pointer-events: auto;
  transform: translateY(-50%);
  visibility: hidden;
  transition: opacity 160ms ease;
}

.sidebar-mode-button.is-active .sidebar-mode-button-info {
  opacity: 1;
  visibility: visible;
}

.sidebar-mode-button.is-unavailable {
  opacity: 0.4;
}

.folder-button.sidebar-mode-button.memo-sidebar-page-button {
  min-height: 20px;
  padding: 2.5px 3px 2.5px 8px;
}

.memo-sidebar-page-button .folder-button-label {
  justify-content: flex-end;
}

.memo-sidebar-page-button .folder-button-text {
  text-align: right;
}

.memo-sidebar-page-button.is-truncated .folder-button-label {
  justify-content: flex-start;
}

.memo-sidebar-page-button.is-truncated .folder-button-text {
  text-align: left;
}

.sidebar-mode-message-row {
  align-items: flex-start;
  cursor: default;
  opacity: 0.4;
}

.sidebar-mode-message-row .folder-button-label {
  align-items: flex-start;
  overflow: visible;
  justify-content: flex-start;
}

.sidebar-mode-message-row .folder-button-text {
  font-style: italic;
  overflow: visible;
  overflow-wrap: anywhere;
  text-align: left;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.35;
}

.sidebar-pane-settings-copy {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.sidebar-pane-settings-copy-with-gap {
  margin-top: 10px;
}

.sidebar-pane-settings-list-label {
  font-weight: 700;
}

.sidebar-pane-settings-book-list {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.sidebar-pane-settings-book-row {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}

.sidebar-pane-settings-book-button {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.top-right-control-tray {
  position: absolute;
  z-index: 22;
  top: max(8px, env(safe-area-inset-top));
  right: var(--page-top-tray-right-edge);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.top-right-control-tray:has(.settings-panel[open]) {
  z-index: 26;
}

.fullscreen-toggle {
  position: absolute;
  z-index: 21;
  top: var(--viewer-indicator-top-edge);
  right: var(--viewer-indicator-right-edge);
  display: grid;
  width: var(--viewer-indicator-cell-size);
  height: var(--viewer-indicator-cell-size);
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgb(156, 170, 174);
  cursor: pointer;
  padding: 0;
  text-shadow: none;
}

body.fullscreen-view.desktop-chrome-native-pdf .fullscreen-toggle {
  top: var(--viewer-indicator-top-edge);
  right: var(--viewer-indicator-right-edge);
}

.fullscreen-icon {
  display: grid;
  grid-template-columns: repeat(2, 12px);
  grid-template-rows: repeat(2, 12px);
  width: 20px;
  height: 24px;
  line-height: 1;
  position: relative;
  top: -3.5px;
  transition: opacity 650ms ease;
}

.fullscreen-toggle:hover {
  color: rgb(156, 170, 174);
}

.log-indicator-top {
  position: relative;
  z-index: 0;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--top-icon-ink);
  cursor: pointer;
  padding: 0;
}

.log-indicator-top:hover {
  color: var(--accent-strong);
}

.log-indicator-icon {
  display: block;
  width: 29.63px;
  height: 29.63px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--viewer-icon-drop-shadow);
  transform: translate(4px, 1px);
}

.flash-indicator-top {
  position: relative;
  z-index: 0;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--top-icon-ink);
  cursor: pointer;
  padding: 0;
}

.flash-indicator-top:hover {
  color: var(--accent-strong);
}

.flash-indicator-top-icon {
  display: block;
  width: 23.81px;
  height: 28.82px;
  object-fit: contain;
  pointer-events: none;
  transform: translateY(1px);
}

.flash-indicator-icon {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--viewer-icon-drop-shadow);
}

.fullscreen-icon span {
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  -webkit-text-stroke: 0.35px currentColor;
}

.settings-toggle {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.settings-toggle::-webkit-details-marker {
  display: none;
}

.settings-toggle-icon {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--viewer-icon-drop-shadow);
}

.settings-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 26;
  min-width: 210px;
  margin-top: 0;
  max-height: calc(100dvh - max(8px, env(safe-area-inset-top)) - 38px - 24px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-overlay);
  box-shadow: var(--shadow);
  padding: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.top-right-control-tray .settings-menu {
  left: auto;
  right: 0;
}

.top-right-control-tray .settings-toggle {
  width: 42px;
  height: 42px;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.settings-color-scheme-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  height: 30px;
  margin-bottom: 8px;
}

.settings-color-swatch {
  min-width: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(29, 37, 41, 0.12);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.settings-color-swatch:hover {
  transform: translateY(-1px);
}

.settings-color-swatch:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.settings-color-swatch[data-color-scheme="white"] {
  background: var(--settings-color-swatch-white);
}

.settings-color-swatch[data-color-scheme="standard"] {
  background: var(--settings-color-swatch-standard);
}

.settings-color-swatch[data-color-scheme="dark"] {
  background: var(--settings-color-swatch-dark);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.settings-color-swatch.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus-ring), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.setting-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.setting-row-radio-group {
  min-height: 0;
  margin: 4px 0 2px;
  padding: 10px 12px 12px;
  border: 1px solid var(--control-outline);
  border-radius: 10px;
  background: var(--panel-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  cursor: default;
}

.setting-row-radio-group-label {
  width: 100%;
  margin: 0;
  padding: 0 4px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.setting-row-radio-option {
  min-height: 0;
  gap: 6px;
  font-size: 13px;
}

.setting-row-highlight-star {
  color: #ffd54a;
}

.setting-row-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting-row-multiline {
  align-items: flex-start;
}

.setting-row-multiline .setting-row-copy {
  padding-top: 1px;
}

.setting-row-copy-main {
  font-weight: 700;
}

.setting-row-copy-subtitle {
  color: var(--subtitle-ink);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 400;
}

.note-settings-reactivate-hint {
  font-size: 11.2px;
  opacity: 0.8;
}

.settings-action {
  display: block;
  width: 100%;
  min-height: 34px;
  margin-top: 6px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--panel-muted);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.settings-action-danger {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-ink);
}

.settings-version-label {
  margin-top: 8px;
  color: var(--subtitle-ink);
  font-size: 6px;
  line-height: 1.2;
  text-align: left;
  user-select: text;
}

.help-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--overlay-backdrop);
  place-items: center;
  padding: 20px;
  overflow: auto;
}

.help-overlay.is-visible {
  display: grid;
}

.help-dialog {
  width: min(420px, 100%);
  max-height: calc(100dvh - 40px);
  border: 1px solid var(--control-outline);
  border-radius: 14px;
  background: var(--panel-overlay);
  box-shadow: var(--shadow-panel);
  box-sizing: border-box;
  padding: 18px 18px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.help-title {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.image-textbox-font-size-dialog {
  width: min(200px, 100%);
  padding: 16px 16px 14px;
}

.counter-go-to-page-dialog {
  width: min(260px, 100%);
  padding: 16px 16px 14px;
}

.image-textbox-font-size-title {
  margin-bottom: 10px;
  text-align: center;
}

.image-textbox-font-size-input {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--ink);
  font-size: 30px;
  line-height: 1.1;
  padding: 8px 10px;
  text-align: center;
}

.counter-go-to-page-row {
  display: grid;
  grid-template-columns: 92px auto;
  align-items: center;
  gap: 10px;
  justify-content: center;
  width: fit-content;
  margin: 0 auto;
}

.counter-go-to-page-input {
  min-width: 0;
  margin: 0;
}

.counter-go-to-page-book-size {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}

.counter-go-to-page-history {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.counter-go-to-page-history-title {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}

.counter-go-to-page-history-list {
  display: grid;
  gap: 6px;
}

.counter-go-to-page-history-item {
  width: 100%;
  color: var(--ink);
}

.counter-go-to-page-history-item .folder-button-label {
  justify-content: flex-start;
}

.counter-go-to-page-history-item .folder-button-text {
  font-size: 15px;
  text-align: left;
}

.counter-go-to-page-history-item:disabled {
  cursor: default;
}

.image-textbox-font-size-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.image-textbox-font-size-actions .settings-action {
  margin-top: 0;
}

.confirm-copy {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.confirm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.single-column-actions {
  grid-template-columns: minmax(0, 1fr);
}

.study-tools-threshold {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--control-outline);
  border-radius: 10px;
  background: var(--panel-muted);
}

.study-tools-options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.study-tools-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--control-outline);
  border-radius: 10px;
  background: var(--panel-muted);
}

.study-tools-option input {
  margin-top: 2px;
}

.study-tools-option-copy {
  display: grid;
  gap: 4px;
}

.study-tools-option-title {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
}

.study-tools-option-subtitle {
  color: var(--subtitle-ink);
  font-size: 12px;
  line-height: 1.4;
}

.study-tools-threshold-copy {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}

.study-tools-threshold-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.study-tools-threshold-range {
  width: 100%;
}

.study-tools-threshold-value {
  min-width: 2.8em;
  text-align: right;
  color: var(--accent-strong);
  font-weight: 800;
}

.help-list {
  display: grid;
  gap: 8px;
}

.help-section-title {
  margin-top: 10px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.help-list > .help-section-title:first-child {
  margin-top: 0;
}

.help-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.help-row kbd {
  display: inline-grid;
  min-width: 74px;
  min-height: 28px;
  place-items: center;
  justify-self: stretch;
  border: 1px solid var(--control-outline);
  border-radius: 8px;
  background: var(--kbd-bg);
  color: var(--ink);
  font: 700 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}

.text-styles-dialog {
  width: min(460px, 100%);
}

.text-style-sections {
  display: grid;
  gap: 14px;
}

.text-style-section {
  display: grid;
  gap: 10px;
  border: 1px solid var(--control-outline);
  border-radius: 10px;
  background: var(--panel-muted);
  padding: 12px;
}

.text-style-heading {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}

.text-style-field {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.text-style-select,
.text-style-number,
.text-style-range {
  width: 100%;
}

.text-style-select,
.text-style-number {
  min-height: 34px;
  border: 1px solid var(--control-outline);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--ink);
  font: 500 14px/1.2 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: 6px 10px;
}

.text-style-size-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  align-items: center;
  gap: 10px;
}

.text-style-range {
  accent-color: var(--accent);
}

body.hide-bottom-scroller .thumb-strip {
  pointer-events: none;
  visibility: hidden;
}

body.hide-bottom-scroller .viewer {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

body.hide-bottom-scroller .bottom-scroller-region {
  display: none;
  height: 0;
}

body.bottom-scroller-restoring .bottom-scroller-region {
  transition: none;
}

body.bottom-scroller-restoring.hide-bottom-scroller .bottom-scroller-region {
  display: none;
  height: 0 !important;
}

body.study-mode .study-actions.is-visible {
  display: block;
}

body.hide-study-actions .study-actions.is-visible {
  display: none;
}

body.study-mode .study-progress.is-visible {
  display: flex;
}

body.flicker-stars-mode.study-mode .study-progress.is-visible {
  opacity: 0;
}

body.flicker-stars-mode.study-mode .study-progress.is-visible.is-flash-visible {
  opacity: 1;
}

.memo-indicator.is-visible {
  display: grid;
}

body.fullscreen-view {
  background: #000;
}

body.fullscreen-view .settings-panel,
body.fullscreen-view .top-left-control-tray,
body.fullscreen-view .top-right-control-tray,
body.fullscreen-view .counter,
body.fullscreen-view .viewer-title-block,
body.fullscreen-view .folder-panel,
body.fullscreen-view .sidebar-resizer-slot,
body.fullscreen-view .viewer-bar,
body.fullscreen-view .bottom-scroller-region,
body.fullscreen-view .bottom-scroller-toggle-slot,
body.fullscreen-view .thumb-strip {
  display: none;
}

body.fullscreen-view .fullscreen-toggle {
  top: var(--viewer-indicator-top-edge);
  right: var(--viewer-indicator-right-edge);
  color: rgb(156, 170, 174);
}

body.fullscreen-view .app-shell {
  display: block;
  background: #000;
}

body.fullscreen-view .viewer {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: 100dvh;
  padding: 0;
  gap: 0;
  background: #000;
}

body.fullscreen-view .stage {
  width: 100%;
  max-width: none;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #000;
  box-shadow: none;
}

body.fullscreen-view .slide {
  padding: 0;
}

body.fullscreen-view .image-frame {
  background-color: #000;
  color: rgba(255, 255, 255, 0.74);
}

body.fullscreen-view .nav-button.prev {
  left: var(--viewer-indicator-left-edge);
}

body.fullscreen-view .nav-button.next {
  right: var(--viewer-indicator-right-edge);
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar-layout-width, var(--sidebar-width, 168px)) 18px minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.sidebar-resizer-slot {
  position: relative;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}

.sidebar-resize-handle,
.bottom-scroller-toggle-handle {
  position: relative;
  display: grid;
  gap: 3px;
  align-content: center;
  justify-items: center;
  border: 1px solid rgb(156, 170, 174);
  border-radius: 9px;
  background: var(--panel-soft);
  color: rgb(156, 170, 174);
  box-shadow: var(--shadow-soft);
  opacity: 0.5;
  user-select: none;
}

.sidebar-resize-handle::before,
.bottom-scroller-toggle-handle::before {
  content: "";
  position: absolute;
}

.sidebar-resize-handle {
  width: 14px;
  min-height: 66px;
  padding: 8px 0;
  cursor: col-resize;
  touch-action: none;
}

.sidebar-resize-handle::before {
  inset: -7px;
}

.sidebar-resize-dot {
  display: block;
  font-size: 15px;
  line-height: 0.55;
}

.bottom-scroller-toggle-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 18px;
  flex: 0 0 auto;
}

.bottom-scroller-region {
  height: var(--bottom-scroller-layout-height, var(--bottom-scroller-visible-height, 74px));
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  transition: height 160ms ease;
}

.bottom-scroller-toggle-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  min-height: 14px;
  padding: 0 8px;
  cursor: row-resize;
  touch-action: none;
}

.bottom-scroller-toggle-handle::before {
  inset: -7px;
}

.bottom-scroller-toggle-dot {
  display: block;
  font-size: 15px;
  line-height: 0.55;
  position: relative;
  top: -1px;
}

body.sidebar-resize-active,
body.sidebar-resize-active * {
  cursor: col-resize !important;
  user-select: none;
}

body.sidebar-resize-active .top-left-control-tray,
body.sidebar-resize-active .folder-panel {
  transition: none;
}

body.bottom-scroller-resize-active,
body.bottom-scroller-resize-active * {
  cursor: row-resize !important;
  user-select: none;
}

body.bottom-scroller-resize-active .thumb-strip {
  transition: none;
}

body.bottom-scroller-resize-active .bottom-scroller-region {
  transition: none;
}

body.sidebar-menu-cooldown .book-list {
  pointer-events: none;
}

body.bottom-scroller-menu-cooldown .thumb-strip {
  pointer-events: none;
}

.folder-panel {
  position: sticky;
  z-index: 23;
  top: 0;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  width: var(--sidebar-panel-width, var(--sidebar-visible-min-width, 132px));
  min-width: var(--sidebar-panel-width, var(--sidebar-visible-min-width, 132px));
  max-width: var(--sidebar-panel-width, var(--sidebar-visible-min-width, 132px));
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  border-right: 0;
  background: transparent;
  padding: calc(max(8px, env(safe-area-inset-top)) + 56px) 1px 8px 8px;
  pointer-events: none;
  transform: translateX(calc(-1 * var(--sidebar-slide-offset, 0px)));
  transition: transform 160ms ease;
}

.folder-group {
  min-width: 0;
  width: 100%;
}

.book-list {
  display: grid;
  align-content: start;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  gap: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  box-shadow: var(--shadow-soft);
  padding: 12px;
  pointer-events: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.book-list[aria-label="Note files"] {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.book-list[aria-label="Note files"] .folder-button.sidebar-mode-button {
  width: calc(100% + 16px);
  max-width: calc(100% + 16px);
  margin-left: -8px;
  margin-right: -8px;
}

.book-list[aria-label="Note files"] .sidebar-mode-button .folder-button-text {
  font-size: 13.5px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  width: 100%;
  gap: 6px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15.4px;
  font-weight: 400;
  letter-spacing: 0;
  overflow: hidden;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.panel-title-text {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-title::-webkit-details-marker {
  display: none;
}

.panel-title::before {
  content: "▾";
  display: inline-grid;
  width: 13px;
  height: 13px;
  place-items: center;
  color: var(--accent);
  font-size: 13.2px;
  transition: transform 160ms ease;
}

.folder-group:not([open]) .panel-title::before {
  transform: rotate(-90deg);
}

.folder-group:not([open]) .panel-title {
  margin-bottom: 0;
}

.folder-list {
  display: grid;
  gap: 3px;
  min-width: 0;
  width: 100%;
}

.book-list[aria-label="Books"] .folder-group > .folder-list > .folder-button .folder-button-label {
  justify-content: flex-end;
}

.book-list[aria-label="Books"] .folder-group > .folder-list > .folder-button .folder-button-text {
  text-align: right;
}

.book-list[aria-label="Markup books"] .folder-group > .folder-list > .folder-button .folder-button-label {
  justify-content: flex-end;
}

.book-list[aria-label="Markup books"] .folder-group > .folder-list > .folder-button .folder-button-text {
  text-align: right;
}

.book-list[aria-label="Markup books"] .folder-group > .folder-list > .sidebar-mode-message-row .folder-button-label {
  justify-content: flex-start;
}

.book-list[aria-label="Markup books"] .folder-group > .folder-list > .sidebar-mode-message-row .folder-button-text {
  text-align: left;
}

.book-list[aria-label="Markup books"] .folder-button.sidebar-mode-button {
  width: calc(100% + 16px);
  max-width: calc(100% + 16px);
  margin-left: -8px;
  margin-right: -8px;
}

.sidebar-markups-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  width: 100%;
}

.sidebar-markups-toolbar-icon {
  display: grid;
  place-items: center;
  width: var(--viewer-indicator-cell-size);
  height: var(--viewer-indicator-cell-size);
  border: 0;
  background: transparent;
  padding: 0;
  color: rgb(156, 170, 174);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  cursor: pointer;
}

.sidebar-markups-toolbar-icon.is-placeholder {
  cursor: default;
  pointer-events: none;
}

.markup-sidebar-header {
  cursor: pointer;
}

.markup-sidebar-header .markup-sidebar-header-icon {
  width: 25.2px;
  height: 25.2px;
  object-fit: contain;
  transform: none;
}

.markup-sidebar-header .folder-button-text {
  font-size: 13.5px;
}

.markup-page-group {
  width: 100%;
}

.markup-page-group > .folder-button {
  margin-bottom: 0;
}

.markup-page-group > .folder-button .folder-button-label {
  justify-content: flex-start;
}

.markup-page-group > .folder-button .folder-button-text {
  font-size: 15px;
  text-align: left;
}

.markup-page-group > .folder-button::-webkit-details-marker {
  display: none;
}

.markup-page-detail-list {
  padding-top: 2px;
}

.markup-sidebar-detail-row {
  align-items: flex-start;
  justify-content: flex-end;
  cursor: default;
  opacity: 1;
  text-align: right;
}

.markup-sidebar-detail-row .folder-button-label {
  justify-content: flex-end;
}

.markup-sidebar-detail-row .folder-button-text {
  color: inherit;
  font-style: italic;
  text-align: right;
}

.book-list[aria-label="Markup books"] .markup-page-group > .markup-page-detail-list > .markup-sidebar-detail-row .folder-button-label {
  justify-content: flex-end;
}

.book-list[aria-label="Markup books"] .markup-page-group > .markup-page-detail-list > .markup-sidebar-detail-row .folder-button-text {
  text-align: right;
}

.unknown-note-children {
  padding-left: 12px;
}

.folder-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 18px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  padding: 4px 5px;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}

.folder-button-label {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  gap: 3px;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  text-align: left;
}

.folder-button-text {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-button-file-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex: 0 0 auto;
  pointer-events: none;
}

.folder-button:disabled {
  cursor: default;
  opacity: 0.58;
}

.folder-button:disabled:hover {
  border-color: transparent;
  background: transparent;
}

.folder-button.is-active {
  border-color: var(--panel-active-border);
  background: var(--panel-active);
  color: var(--accent-strong);
}

@media (hover: hover) and (pointer: fine) {
  .sidebar-mode-button:hover .sidebar-mode-button-info {
    opacity: 1;
    visibility: visible;
  }

  .sidebar-pane-settings-book-button:hover {
    color: var(--accent-strong);
  }

  .folder-button:hover {
    border-color: var(--line);
    background: var(--panel);
  }
}

.folder-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.book-list[aria-label="Books"] .folder-count {
  margin-left: 3px;
}

.viewer {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  padding: 18px 8px 0 1px;
  gap: 0;
  overflow: hidden;
}

.viewer-bar {
  display: block;
  min-height: 54px;
  margin-bottom: -7px;
}

.viewer-title-block {
  display: flex;
  align-items: center;
  min-width: 0;
  position: absolute;
  z-index: 21;
  top: max(8px, env(safe-area-inset-top));
  left: calc(var(--sidebar-layout-width, var(--sidebar-width, 168px)) + 19px);
  right: calc(
    var(--page-top-tray-right-edge) +
    var(--page-top-tray-width) +
    var(--page-top-tray-counter-gap) +
    var(--page-top-counter-reserved-width) +
    8px
  );
  height: 48px;
}

.viewer-title-block.is-title-hint-visible,
.viewer-title-block:has(.viewer-title-tap-hint:not([hidden])) {
  z-index: 24;
}

.viewer-title-line {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  position: relative;
  text-overflow: ellipsis;
  white-space: nowrap;
  top: 0;
  pointer-events: none;
}

.viewer-title-line h1,
.viewer-title-line #imageTitle {
  display: inline;
  vertical-align: baseline;
}

#folderTitle {
  margin: 0;
  color: var(--viewer-title-ink);
  font-size: var(--viewer-title-size);
  line-height: 1.05;
  position: relative;
  top: 1px;
}

#imageTitle {
  margin: 0 0 0 6px;
  color: var(--muted);
  font-size: 14px;
  position: relative;
  top: 1px;
}

#imageTitle:empty {
  margin-left: 0;
}

.viewer-title-tap-hint {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1100;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  padding: 8px 10px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.counter {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  width: max-content;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  padding: 0 11px;
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  right: calc(var(--page-top-tray-right-edge) + var(--page-top-tray-width) + var(--page-top-tray-counter-gap));
  z-index: 22;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.stage {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--stage-bg);
  box-shadow: var(--shadow);
  touch-action: none;
  outline: none;
}

.slide-track {
  display: flex;
  width: 300%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  will-change: transform;
}

.slide-track.is-animating {
  transition: transform 260ms ease;
}

.slide {
  display: grid;
  flex: 0 0 33.333333%;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 12px;
  overflow: hidden;
}

.image-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  cursor: grab;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.image-media-layer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.page-transition-hold-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  padding: 12px;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 1;
}

.page-transition-hold-overlay .image-frame {
  width: 100%;
  height: 100%;
}

body.fullscreen-view .page-transition-hold-overlay {
  padding: 0;
}

.image-frame.is-zoomed {
  cursor: move;
}

.image-frame.has-native-pdf,
.image-frame.has-native-pdf.is-zoomed {
  cursor: default;
}

.image-frame.is-pending-deferred-zoom .image-media-layer,
.image-frame.is-pending-deferred-zoom .image-highlight-layer,
.image-frame.is-pending-deferred-zoom .image-textbox-layer {
  opacity: 0;
}

.image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex: 0 1 100%;
  object-fit: contain;
  object-position: center;
  transform-origin: center;
  user-select: none;
  will-change: transform;
  -webkit-user-drag: none;
}

.image-highlight-layer,
.image-textbox-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.image-highlight-layer {
  z-index: 0;
}

.image-highlight-svg {
  position: absolute;
  overflow: visible;
  pointer-events: none;
}

.image-highlight-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.image-textbox-layer {
  z-index: 1;
}

.image-textbox {
  position: absolute;
  overflow: visible;
  pointer-events: auto;
  touch-action: none;
}

.image-textbox.is-placeholder::after {
  content: attr(data-placeholder);
  position: absolute;
  inset: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  color: rgba(106, 112, 118, 0.92);
  font-family: var(--image-textbox-font-family, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 16px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.22;
  text-align: center;
  white-space: pre-wrap;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0.995) 30%,
    rgba(247, 248, 249, 0.985) 46%,
    rgba(232, 236, 239, 0.94) 66%,
    rgba(196, 205, 209, 0.62) 84%,
    rgba(156, 170, 174, 0.34) 100%
  );
  border-radius: 10px;
  filter: blur(0.15px);
}

.image-textbox.is-active {
  outline: 1px dashed rgba(13, 107, 118, 0.4);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  body.image-highlighter-mode .stage,
  body.image-highlighter-mode .stage .slide,
  body.image-highlighter-mode .stage .image-frame,
  body.image-highlighter-mode .stage .image-media-layer,
  body.image-highlighter-mode .stage .image-highlight-layer,
  body.image-highlighter-mode .stage .image-textbox-layer,
  body.image-highlighter-mode .stage .image-textbox,
  body.image-highlighter-mode .stage .image-textbox-content {
    cursor: url("./images/highlighter.png?v=20260521-01") 10 126, crosshair;
  }

  body.image-highlighter-mode .stage .image-textbox.is-active .image-textbox-content {
    cursor: text;
  }
}

@media (pointer: fine) {
  body.image-eraser-mode .stage,
  body.image-eraser-mode .stage .slide,
  body.image-eraser-mode .stage .image-frame,
  body.image-eraser-mode .stage .image-media-layer,
  body.image-eraser-mode .stage .image-highlight-layer,
  body.image-eraser-mode .stage .image-textbox-layer,
  body.image-eraser-mode .stage .image-textbox,
  body.image-eraser-mode .stage .image-textbox-content {
    cursor: crosshair;
  }

  body.image-eraser-mode .stage .image-textbox.is-active .image-textbox-content {
    cursor: text;
  }
}

.viewer-eraser-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 999;
  border: 2px solid rgb(156, 170, 174);
  border-radius: 999px;
  background: rgba(156, 170, 174, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 120ms ease;
}

.viewer-eraser-cursor.is-visible {
  opacity: 1;
}

.image-textbox.is-active::after {
  content: none;
}

.image-textbox-content {
  position: relative;
  z-index: 1;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--image-textbox-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 500;
  line-height: 1.22;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  outline: none;
  user-select: none;
  cursor: default;
}

textarea.image-textbox-content {
  appearance: none;
  -webkit-appearance: none;
  resize: none;
  overflow: auto;
}

textarea.image-textbox-content::placeholder {
  color: rgba(106, 112, 118, 0.92);
  font-style: italic;
}

.image-textbox.is-active .image-textbox-content {
  user-select: text;
  cursor: text;
}

.image-textbox-drag-handle {
  position: absolute;
  z-index: 3;
  cursor: move;
}

.image-textbox-drag-handle-top {
  top: -5px;
  left: -6px;
  right: 12px;
  height: 10px;
}

.image-textbox-drag-handle-right {
  top: -8px;
  right: -8px;
  bottom: 12px;
  width: 16px;
}

.image-textbox-drag-handle-bottom {
  right: 12px;
  bottom: -8px;
  left: -8px;
  height: 16px;
}

.image-textbox-drag-handle-left {
  top: -8px;
  bottom: -8px;
  left: -8px;
  width: 16px;
}

.image-textbox-delete-button {
  appearance: none;
  position: absolute;
  top: -10px;
  right: -10px;
  width: 15px;
  height: 15px;
  border: 0;
  padding: 0;
  background: transparent;
  z-index: 4;
  cursor: pointer;
}

.image-textbox-delete-icon {
  display: block;
  width: 15px;
  height: 15px;
}

.image-textbox-delete-icon-light {
  display: none;
}

.native-pdf-shell {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}

.native-pdf-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.nav-button {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  width: var(--viewer-indicator-cell-size);
  height: var(--viewer-indicator-cell-size);
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgb(156, 170, 174);
  cursor: pointer;
  transform: translateY(-50%);
}

.nav-button:hover {
  background: transparent;
}

.nav-button span {
  font-size: 42px;
  line-height: 0.6;
  transition: opacity 650ms ease;
}

.nav-button.prev {
  left: var(--viewer-indicator-left-edge);
}

.nav-button.next {
  right: var(--viewer-indicator-right-edge);
}

.hidden-mode-zone {
  position: absolute;
  z-index: 5;
  display: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  outline: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.hidden-mode-zone:hover,
.hidden-mode-zone:active,
.hidden-mode-zone:focus,
.hidden-mode-zone:focus-visible {
  background: transparent;
  outline: none;
  box-shadow: none;
}

body.viewer-icons-hidden .hidden-mode-zone {
  display: block;
}

body.fullscreen-view.viewer-icons-hidden .hidden-mode-zone {
  pointer-events: none;
}

.hidden-mode-zone-prev {
  top: 0;
  bottom: 0;
  left: var(--viewer-indicator-left-edge);
  width: var(--viewer-indicator-cell-size);
}

.hidden-mode-zone-next {
  top: 0;
  bottom: 0;
  right: var(--viewer-indicator-right-edge);
  width: var(--viewer-indicator-cell-size);
}

body.fullscreen-view.viewer-icons-hidden .hidden-mode-zone-prev {
  left: 0;
  width: calc(var(--viewer-indicator-left-edge) + (var(--viewer-indicator-cell-size) * 2));
}

body.fullscreen-view.viewer-icons-hidden .hidden-mode-zone-next {
  right: 0;
  width: calc(var(--viewer-indicator-right-edge) + (var(--viewer-indicator-cell-size) * 2));
}

.hidden-mode-zone-center {
  display: none;
}

body.fullscreen-view.viewer-icons-hidden .hidden-mode-zone-center {
  display: block;
  top: 0;
  bottom: 0;
  left: calc(var(--viewer-indicator-left-edge) + (var(--viewer-indicator-cell-size) * 2));
  right: calc(var(--viewer-indicator-right-edge) + (var(--viewer-indicator-cell-size) * 2));
}

.hidden-mode-zone-reveal {
  left: var(--viewer-indicator-left-edge);
  bottom: var(--viewer-indicator-bottom-edge);
  width: calc(var(--viewer-indicator-cell-size) * 2);
  height: calc(var(--viewer-indicator-cell-size) * 2);
}

.hidden-mode-zone-fullscreen {
  top: var(--viewer-indicator-top-edge);
  right: var(--viewer-indicator-right-edge);
  width: calc(var(--viewer-indicator-cell-size) * 2);
  height: calc(var(--viewer-indicator-cell-size) * 2);
}

.study-actions {
  display: none;
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
}

.study-progress {
  display: none;
  position: absolute;
  z-index: 4;
  left: clamp(12px, 2vw, 20px);
  top: clamp(12px, 2.6vh, 22px);
  align-items: center;
  gap: 3px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(16, 24, 28, 0.12);
  backdrop-filter: blur(3px);
  opacity: 1;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.study-progress-star {
  color: rgba(255, 255, 255, 0.9);
  font-size: 24px;
  line-height: 1;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.18);
  opacity: 0.92;
}

.study-progress-star.is-filled {
  color: #ffd54a;
  opacity: 1;
}

.study-bulk-toast {
  display: none;
  position: fixed;
  z-index: 45;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: min(82vw, 420px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(16, 24, 28, 0.18);
  backdrop-filter: blur(3px);
  color: rgba(255, 255, 255, 0.96);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.study-bulk-toast.is-visible {
  display: block;
  opacity: 1;
}

.viewer-book-status {
  display: none;
  position: absolute;
  z-index: 3;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--viewer-status-ink);
  font-size: clamp(20px, 2.9vw, 30px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
  text-shadow: var(--viewer-status-shadow);
  pointer-events: none;
}

.viewer-book-status.is-visible {
  display: flex;
}

.stage.is-book-status-empty .slide-track {
  visibility: hidden;
}

.stage.is-book-status-empty .viewer-book-status {
  background: var(--viewer-status-bg);
}

.viewer-indicator-tray {
  position: absolute;
  z-index: 4;
  bottom: var(--viewer-indicator-bottom-edge);
  display: flex;
  align-items: flex-end;
  gap: 0;
  pointer-events: none;
}

.viewer-indicator-tray-left {
  left: var(--viewer-indicator-left-edge);
}

.viewer-indicator-tray-right {
  right: var(--viewer-indicator-right-edge);
}

.viewer-indicator-cell-spacer {
  display: block;
  width: var(--viewer-indicator-cell-size);
  height: var(--viewer-indicator-cell-size);
  flex: 0 0 var(--viewer-indicator-cell-size);
  pointer-events: none;
}

.viewer-visibility-indicator,
.viewer-undo-indicator {
  position: absolute;
  z-index: 4;
  display: grid;
  width: var(--viewer-indicator-cell-size);
  height: var(--viewer-indicator-cell-size);
  place-items: center;
  border: 0;
  background: transparent;
  color: rgb(156, 170, 174);
  padding: 0;
  cursor: pointer;
}

.viewer-visibility-indicator {
  position: relative;
  top: auto;
  left: auto;
  color: var(--viewer-accent-ink);
  pointer-events: auto;
}

.viewer-undo-indicator {
  top: var(--viewer-indicator-top-edge);
  left: var(--viewer-indicator-left-edge);
}

.viewer-redo-indicator {
  position: absolute;
  z-index: 4;
  top: var(--viewer-indicator-top-edge);
  left: calc(var(--viewer-indicator-left-edge) + var(--viewer-indicator-cell-size));
  display: none;
  width: var(--viewer-indicator-cell-size);
  height: var(--viewer-indicator-cell-size);
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.viewer-redo-indicator.is-visible {
  display: grid;
}

.viewer-bookmarks-indicator,
.viewer-bookmark-go-back-indicator {
  position: absolute;
  z-index: 4;
  top: var(--viewer-indicator-top-edge);
  display: grid;
  width: var(--viewer-indicator-cell-size);
  height: var(--viewer-indicator-cell-size);
  place-items: center;
  border: 0;
  background: transparent;
  color: rgb(156, 170, 174);
  padding: 0;
  cursor: pointer;
  text-shadow: var(--viewer-icon-text-shadow);
}

.viewer-bookmarks-indicator-icon {
  display: block;
  width: 20px;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}

.viewer-bookmark-go-back-indicator-label {
  display: block;
  pointer-events: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
}

.viewer-bookmark-go-back-indicator {
  display: none;
  width: auto;
  min-width: var(--viewer-indicator-cell-size);
  padding: 0 8px;
}

.viewer-bookmark-go-back-indicator.is-visible {
  display: grid;
}

.viewer-bookmarks-menu {
  position: absolute;
  z-index: 4;
  top: calc(var(--viewer-indicator-top-edge) + var(--viewer-indicator-cell-size));
  display: grid;
  grid-template-columns: minmax(var(--viewer-indicator-cell-size), max-content);
  grid-auto-rows: var(--viewer-indicator-cell-size);
  gap: 0;
}

.viewer-bookmarks-menu[hidden] {
  display: none;
}

.viewer-bookmark-item {
  display: grid;
  width: auto;
  min-width: var(--viewer-indicator-cell-size);
  height: var(--viewer-indicator-cell-size);
  place-items: center;
  border: 0;
  background: transparent;
  color: rgb(156, 170, 174);
  padding: 0 8px;
  cursor: pointer;
  text-shadow: var(--viewer-icon-text-shadow);
}

.viewer-bookmark-item-label {
  display: block;
  pointer-events: none;
  font-size: 21px;
  font-weight: 500;
  line-height: 1;
}

.viewer-bookmark-item-action {
  width: var(--viewer-indicator-cell-size);
  min-width: var(--viewer-indicator-cell-size);
  padding: 0;
}

.viewer-bookmark-item-recent {
  justify-content: start;
}

.viewer-undo-indicator-icon,
.viewer-redo-indicator-icon,
.viewer-visibility-indicator-icon {
  display: block;
  width: 28px;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  filter: var(--viewer-icon-drop-shadow);
}

.viewer-redo-indicator-icon {
  transform: rotate(180deg);
}

.viewer-visibility-indicator-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 34px;
  transition: opacity 650ms ease;
}

.viewer-visibility-indicator-icon-open {
  width: 32px;
  transform: translateY(-3px);
}

.viewer-visibility-indicator-icon-closed {
  opacity: 0;
  transform: translateY(3px);
}

body.viewer-icons-hidden .viewer-visibility-indicator-icon-open {
  opacity: 0;
}

body.viewer-icons-hidden .viewer-visibility-indicator-icon-closed {
  opacity: 1;
}

body.fullscreen-view.viewer-icons-hidden.viewer-clear-view-eye-hidden .viewer-visibility-indicator-icon-closed {
  opacity: 0;
}

body.fullscreen-view.viewer-icons-hidden.viewer-clear-view-eye-hidden .viewer-visibility-indicator {
  opacity: 0;
  pointer-events: none;
}

.memo-indicator,
.draft-indicator,
.viewer-flash-indicator,
.viewer-log-indicator,
.viewer-record-indicator,
.viewer-study-data-indicator,
.viewer-aa-indicator,
.viewer-highlighter-indicator,
.viewer-eraser-indicator {
  position: relative;
  z-index: auto;
  width: var(--viewer-indicator-cell-size);
  height: var(--viewer-indicator-cell-size);
  border: 0;
  background: transparent;
  place-items: center;
  padding: 0;
  pointer-events: auto;
}

.viewer-undo-indicator,
.viewer-redo-indicator,
.viewer-bookmarks-indicator,
.viewer-bookmark-go-back-indicator,
.memo-indicator,
.draft-indicator,
.viewer-flash-indicator,
.viewer-log-indicator,
.viewer-record-indicator,
.viewer-study-data-indicator,
.viewer-aa-indicator,
.viewer-highlighter-indicator,
.viewer-eraser-indicator,
.study-action {
  transition: opacity 650ms ease;
}

body.viewer-icons-hidden .viewer-undo-indicator,
body.viewer-icons-hidden .viewer-redo-indicator,
body.viewer-icons-hidden .viewer-bookmarks-indicator,
body.viewer-icons-hidden .viewer-bookmark-go-back-indicator,
body.viewer-icons-hidden .memo-indicator,
body.viewer-icons-hidden .draft-indicator,
body.viewer-icons-hidden .viewer-flash-indicator,
body.viewer-icons-hidden .viewer-log-indicator,
body.viewer-icons-hidden .viewer-record-indicator,
body.viewer-icons-hidden .viewer-study-data-indicator,
body.viewer-icons-hidden .viewer-aa-indicator,
body.viewer-icons-hidden .viewer-highlighter-indicator,
body.viewer-icons-hidden .viewer-eraser-indicator,
body.viewer-icons-hidden .study-action {
  opacity: 0;
  pointer-events: none;
}

body.fullscreen-view.viewer-icons-hidden.viewer-clear-view-eye-hidden .fullscreen-icon,
body.viewer-icons-hidden .nav-button span {
  opacity: 0;
}

body.fullscreen-view.viewer-icons-hidden.viewer-hidden-peek-visible .nav-button span {
  opacity: 1;
}

.memo-indicator {
  display: none;
  order: 50;
  place-items: center;
  cursor: pointer;
  color: var(--viewer-icon-ink);
}

:root[data-color-scheme="dark"] .memo-indicator {
  color: rgb(156, 170, 174);
}

.memo-indicator-icon {
  display: block;
  width: 23.6px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--viewer-icon-drop-shadow);
  transform: translateY(2px);
}

.draft-indicator {
  display: none;
  order: 40;
  place-items: center;
  cursor: pointer;
}

.draft-indicator-icon {
  display: block;
  width: 23.6px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--viewer-icon-drop-shadow);
  transform: translateY(2px);
}

.draft-indicator.is-visible {
  display: grid;
}

.viewer-flash-indicator {
  display: none;
  order: 10;
  place-items: center;
  cursor: pointer;
}

.viewer-flash-indicator.is-visible {
  display: grid;
}

.viewer-flash-indicator-icon {
  display: block;
  width: 28.98px;
  height: 28.98px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--viewer-icon-drop-shadow);
  transform: translateY(-3px);
}

.viewer-log-indicator {
  display: none;
  order: 20;
  place-items: center;
  cursor: pointer;
}

.viewer-log-indicator.is-visible {
  display: grid;
}

.viewer-log-indicator-icon {
  display: block;
  width: 25.2px;
  height: 25.2px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--viewer-icon-drop-shadow);
  transform: translateY(1px);
}

.viewer-record-indicator {
  display: none;
  order: 30;
  place-items: center;
  cursor: pointer;
  color: var(--viewer-icon-ink);
  text-shadow: var(--viewer-icon-text-shadow);
}

.viewer-record-indicator.is-visible {
  display: grid;
}

.viewer-record-indicator-icon {
  display: block;
  width: 22.4px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--viewer-icon-drop-shadow);
  transform: translateY(1px);
}

.viewer-study-data-indicator {
  appearance: none;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.viewer-study-data-indicator-icon {
  display: block;
  width: 14px;
  height: 24px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--viewer-icon-drop-shadow);
}

.viewer-study-data-indicator-icon-light {
  display: none;
}

:root[data-color-scheme="dark"] .viewer-study-data-indicator-icon-dark,
:root[data-color-scheme="dark"] .note-popup-close-icon-dark,
:root[data-color-scheme="dark"] .study-data-close-icon-dark,
:root[data-color-scheme="dark"] .image-textbox-delete-icon-dark {
  display: none;
}

:root[data-color-scheme="dark"] .viewer-study-data-indicator-icon-light,
:root[data-color-scheme="dark"] .note-popup-close-icon-light,
:root[data-color-scheme="dark"] .study-data-close-icon-light,
:root[data-color-scheme="dark"] .image-textbox-delete-icon-light {
  display: block;
}

:root[data-color-scheme="dark"] #viewerStudyDataIndicator .viewer-study-data-indicator-icon-dark {
  display: block;
}

:root[data-color-scheme="dark"] #viewerStudyDataIndicator .viewer-study-data-indicator-icon-light {
  display: none;
}

.viewer-aa-indicator {
  display: none;
  place-items: center;
}

.viewer-aa-indicator.is-visible {
  display: grid;
}

.viewer-aa-indicator-button {
  appearance: none;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.viewer-aa-menu {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 46px;
  max-height: min(70dvh, 420px);
  padding: 6px;
  border: 1px solid var(--control-outline);
  border-radius: 10px;
  background: var(--panel-overlay);
  box-shadow: var(--shadow-soft);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transform: translateX(-50%);
}

.viewer-aa-menu[hidden] {
  display: none;
}

.viewer-aa-menu-option {
  appearance: none;
  min-height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--accent-strong);
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
  padding: 0 8px;
  cursor: pointer;
}

.viewer-aa-menu-option.is-selected {
  background: var(--panel-active);
}

.viewer-aa-menu-option-custom {
  letter-spacing: 0.04em;
}

.viewer-aa-indicator-label {
  display: block;
  color: var(--viewer-icon-ink);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.01em;
  text-shadow: none;
}

.viewer-highlighter-indicator {
  appearance: none;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.viewer-highlighter-indicator-glyph {
  display: block;
  width: 23px;
  height: 23px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--viewer-icon-drop-shadow);
  transform: scale(1.15);
}

.viewer-highlighter-indicator.is-active {
  background: rgba(255, 226, 0, 0.18);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(159, 126, 0, 0.3);
}

.viewer-eraser-indicator.is-active {
  background: rgba(156, 170, 174, 0.16);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(156, 170, 174, 0.34);
}

.viewer-eraser-indicator {
  appearance: none;
  display: grid;
  place-items: center;
  cursor: default;
}

.viewer-eraser-indicator-glyph {
  display: block;
  width: 20px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
  filter: var(--viewer-icon-drop-shadow);
  transform: translateY(2px) scale(1.1);
}
.memo-popup,
.draft-popup,
.log-popup,
.record-popup,
.flash-popup,
.unified-text-settings-popup {
  display: none;
  position: fixed;
  z-index: 25;
  top: 0;
  left: 0;
  border: 1px solid var(--control-outline);
  border-radius: 10px;
  background: var(--note-popup-bg);
  backdrop-filter: blur(2px);
  box-sizing: border-box;
  box-shadow: var(--shadow-soft);
  cursor: move;
  padding: 10px 10px 10px;
  touch-action: none;
}

.note-popup-title {
  margin: 0 0 8px;
  padding-right: 22px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  color: var(--popup-title-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.1;
  cursor: move;
  user-select: none;
}

.note-popup-title-label,
.study-data-title-label {
  color: inherit;
  font: inherit;
}

.note-popup-sync-status {
  display: inline-block;
  color: inherit;
  font: inherit;
  opacity: 0.78;
  white-space: nowrap;
  transform-origin: 50% 56%;
}

.note-popup-sync-status.is-spinning {
  animation: note-sync-spin 0.3s linear 1;
}

@keyframes note-sync-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

body.hide-note-sync-status .note-popup-sync-status {
  display: none;
}

.note-popup-close-button {
  appearance: none;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 15px;
  height: 15px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.note-popup-close-icon {
  display: block;
  width: 15px;
  height: 15px;
}

.note-popup-close-icon-light {
  display: none;
}

.draft-popup {
  background: var(--draft-popup-bg);
}

.memo-popup.is-visible,
.draft-popup.is-visible,
.log-popup.is-visible,
.record-popup.is-visible,
.flash-popup.is-visible,
.unified-text-settings-popup.is-visible {
  display: flex;
  flex-direction: column;
}

.unified-text-settings-popup {
  width: 20ch;
  min-width: 126px;
}

.unified-text-settings-popup .note-popup-title-label {
  overflow-wrap: anywhere;
}

.unified-text-settings-popup-body {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 30px;
}

.unified-text-settings-popup.has-custom-size .unified-text-settings-popup-body {
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.study-data-popup {
  width: min(224px, calc(100dvw - 24px));
  max-width: calc(100dvw - 24px);
  max-height: 75dvh;
  cursor: default;
  padding-bottom: 10px;
}

.study-data-popup.is-visible {
  display: flex;
  flex-direction: column;
}

.study-data-title {
  margin: 0 0 8px;
  padding-right: 22px;
  color: var(--popup-title-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.1;
  cursor: move;
  user-select: none;
}

.study-data-close-button {
  appearance: none;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 15px;
  height: 15px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.study-data-close-icon {
  display: block;
  width: 15px;
  height: 15px;
}

.study-data-close-icon-light {
  display: none;
}

.study-data-list {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.study-data-empty {
  color: var(--subtitle-ink);
  font-size: 14px;
  line-height: 1.35;
}

.study-data-row {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.study-data-label {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.study-data-stars {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}

.study-data-star {
  border: 0;
  background: transparent;
  padding: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 20px;
  line-height: 1;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.18);
  opacity: 0.92;
  cursor: pointer;
}

.study-data-star.is-filled {
  color: #ffd54a;
  opacity: 1;
}

.memo-textarea,
.draft-textarea,
.log-textarea,
.record-textarea,
.flash-textarea {
  display: block;
  flex: 0 0 auto;
  width: 20ch;
  min-width: 126px;
  max-width: 20ch;
  min-height: 30px;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: text;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  outline: none;
  padding: 0;
  touch-action: auto;
}

.memo-popup.has-custom-size .memo-textarea,
.draft-popup.has-custom-size .draft-textarea,
.log-popup.has-custom-size .log-textarea,
.record-popup.has-custom-size .record-textarea,
.flash-popup.has-custom-size .flash-textarea {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: auto;
  min-height: 0;
}

.study-data-popup.has-custom-size .study-data-list {
  max-height: none;
}

.study-data-popup.has-custom-size {
  max-height: none;
}

.memo-resize-handle,
.draft-resize-handle,
.log-resize-handle,
.record-resize-handle,
.flash-resize-handle,
.unified-text-settings-resize-handle {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 28px;
  height: 28px;
  z-index: 3;
  cursor: nwse-resize;
  touch-action: none;
}

.study-data-resize-handle,
.image-textbox-resize-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 28px;
  height: 28px;
  z-index: 3;
  cursor: nwse-resize;
  touch-action: none;
}

.memo-resize-handle::before,
.draft-resize-handle::before,
.log-resize-handle::before,
.record-resize-handle::before,
.flash-resize-handle::before,
.unified-text-settings-resize-handle::before,
.study-data-resize-handle::before,
.image-textbox-resize-handle::before {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(13, 107, 118, 0.52);
  border-bottom: 2px solid rgba(13, 107, 118, 0.52);
}

.study-action {
  position: absolute;
  display: grid;
  width: var(--viewer-indicator-cell-size);
  height: var(--viewer-indicator-cell-size);
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgb(156, 170, 174);
  cursor: pointer;
  font-size: 46px;
  font-weight: 400;
  line-height: 1;
  padding: 0;
  pointer-events: auto;
  text-shadow: none;
}

.study-action-x {
  left: var(--viewer-indicator-left-edge);
  bottom: calc(var(--viewer-indicator-bottom-edge) + (var(--viewer-indicator-cell-size) * 2));
}

.study-action-check {
  right: var(--viewer-indicator-right-edge);
  bottom: calc(var(--viewer-indicator-bottom-edge) + (var(--viewer-indicator-cell-size) * 2));
  font-size: 35px;
  transform: translateY(19%);
}

body.fullscreen-view .study-progress {
  background: rgba(255, 255, 255, 0.12);
}

body.fullscreen-view .study-bulk-toast {
  background: rgba(255, 255, 255, 0.14);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.42);
}

body.fullscreen-view .study-progress-star {
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.42);
}

body.fullscreen-view .memo-popup,
body.fullscreen-view .draft-popup,
body.fullscreen-view .log-popup,
body.fullscreen-view .record-popup,
body.fullscreen-view .flash-popup {
  background: var(--fullscreen-note-popup-bg);
  border-color: rgba(255, 255, 255, 0.16);
}

body.fullscreen-view .draft-popup {
  background: var(--fullscreen-draft-popup-bg);
}

body.fullscreen-view .memo-textarea,
body.fullscreen-view .draft-textarea,
body.fullscreen-view .log-textarea,
body.fullscreen-view .record-textarea,
body.fullscreen-view .flash-textarea {
  color: rgba(255, 255, 255, 0.88);
}

body.fullscreen-view .note-popup-title {
  color: rgba(255, 255, 255, 0.88);
}

body.fullscreen-view .study-data-title,
body.fullscreen-view .study-data-label,
body.fullscreen-view .study-data-empty {
  color: rgba(255, 255, 255, 0.88);
}

body.fullscreen-view .memo-resize-handle::before,
body.fullscreen-view .draft-resize-handle::before,
body.fullscreen-view .log-resize-handle::before,
body.fullscreen-view .record-resize-handle::before,
body.fullscreen-view .flash-resize-handle::before,
body.fullscreen-view .unified-text-settings-resize-handle::before,
body.fullscreen-view .study-data-resize-handle::before {
  border-right-color: rgba(255, 255, 255, 0.62);
  border-bottom-color: rgba(255, 255, 255, 0.62);
}

.thumb-strip {
  display: flex;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: var(--bottom-scroller-visible-height, 74px);
  flex: 0 0 var(--bottom-scroller-visible-height, 74px);
  max-width: 100%;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--thumb-strip-bg);
  box-shadow: var(--shadow-soft);
  box-sizing: border-box;
  padding: 8px;
}

.thumb-button {
  display: grid;
  place-items: center;
  flex: 0 0 70px;
  width: 70px;
  height: 56px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 6px;
  background: var(--thumb-button-bg);
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.thumb-button.is-active {
  border-color: var(--accent);
}

.thumb-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
