    :root {
      --paper: #eee9df;
      --grid-x: rgba(32, 33, 35, 0.04);
      --grid-y: rgba(32, 33, 35, 0.03);
      --topbar-bg: rgba(238, 233, 223, 0.92);
      --card-edge: #e9b949;
      --ink: #202124;
      --muted: #6d706d;
      --line: #d7d0c2;
      --accent: #e9b949;
      --accent-soft: rgba(233, 185, 73, 0.32);
      --reader-tone-accent: #e9b949;
      --reader-tone-soft: rgba(233, 185, 73, 0.18);
      --reader-tone-surface: rgba(255, 250, 238, 0.97);
      --mark-bg: rgba(233, 185, 73, 0.32);
      --mark-line: rgba(178, 127, 20, 0.5);
      --mark-solid: #e9b949;
      --bubble: #fffdf8;
      --card: rgba(255, 253, 248, 0.96);
      --heading-card: rgba(255, 246, 222, 0.97);
      --shadow: 0 18px 44px rgba(35, 31, 24, 0.18);
      --bubble-font-size: 16px;
    }

    :root[data-bg-tone="green"] {
      --paper: #e8f0e6;
      --grid-x: rgba(34, 92, 55, 0.055);
      --grid-y: rgba(34, 92, 55, 0.04);
      --topbar-bg: rgba(232, 240, 230, 0.92);
      --card-edge: #69a86e;
      --reader-tone-accent: #69a86e;
      --reader-tone-soft: rgba(105, 168, 110, 0.17);
      --reader-tone-surface: rgba(248, 255, 247, 0.97);
      --card: rgba(250, 255, 248, 0.96);
      --heading-card: rgba(238, 250, 233, 0.97);
    }

    :root[data-bg-tone="blue"] {
      --paper: #e4edf4;
      --grid-x: rgba(35, 85, 125, 0.055);
      --grid-y: rgba(35, 85, 125, 0.04);
      --topbar-bg: rgba(228, 237, 244, 0.92);
      --card-edge: #6fa8d7;
      --reader-tone-accent: #6fa8d7;
      --reader-tone-soft: rgba(111, 168, 215, 0.18);
      --reader-tone-surface: rgba(247, 252, 255, 0.97);
      --card: rgba(248, 252, 255, 0.96);
      --heading-card: rgba(235, 247, 255, 0.97);
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      min-height: 100vh;
      color: var(--ink);
      background:
        linear-gradient(90deg, var(--grid-x) 1px, transparent 1px),
        linear-gradient(180deg, var(--grid-y) 1px, transparent 1px),
        var(--paper);
      background-size: 28px 28px;
      font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
    }

    .topbar {
      position: sticky;
      top: 0;
      z-index: 30;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 16px;
      padding: 10px 22px;
      border-bottom: 1px solid rgba(50, 45, 34, 0.16);
      background: var(--topbar-bg);
      backdrop-filter: blur(14px);
      transition: padding 160ms ease, background 160ms ease, box-shadow 160ms ease;
    }

    .brand {
      display: flex;
      min-width: 0;
      align-items: center;
      gap: 10px;
    }

    .reader-home-button {
      width: 38px;
      height: 38px;
      flex: 0 0 auto;
      padding: 0;
      border: 1px solid rgba(50, 45, 34, 0.14);
      border-radius: 11px;
      background: rgba(255, 253, 248, 0.76);
      box-shadow: 0 8px 18px rgba(35, 31, 24, 0.14);
      cursor: pointer;
      overflow: hidden;
      transition: transform 140ms ease, box-shadow 140ms ease;
    }

    .reader-home-button:hover {
      transform: translateY(-1px);
      box-shadow: 0 12px 24px rgba(35, 31, 24, 0.18);
    }

    .reader-home-button:focus-visible {
      outline: 2px solid rgba(45, 100, 184, 0.36);
      outline-offset: 3px;
    }

    .reader-home-button img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
      transform: scale(1.16);
      transform-origin: center;
    }

    .brand-copy {
      min-width: 0;
    }

    .brand-title-row {
      display: flex;
      min-width: 0;
      align-items: center;
      gap: 12px;
    }

    .brand strong {
      display: inline-flex;
      flex: 0 0 auto;
      font-size: 17px;
      line-height: 1.2;
      letter-spacing: 0;
      white-space: nowrap;
    }

    .brand-source-title {
      display: block;
      margin-top: 3px;
      overflow: hidden;
      color: var(--muted);
      font-size: 12px;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: min(70vw, 760px);
    }

    .glossa-progress {
      display: grid;
      width: min(44vw, 420px);
      min-width: 220px;
      gap: 4px;
      color: #174F82;
      font-size: 12px;
    }

    .glossa-progress-text {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .glossa-progress-track {
      width: 100%;
      height: 6px;
      overflow: hidden;
      border-radius: 999px;
      background: rgba(23, 79, 130, 0.14);
    }

    .glossa-progress-bar {
      display: block;
      width: 0%;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, #174F82, #39A0A9);
      transition: width 0.25s ease;
    }

    .tools {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      justify-self: end;
    }

    .card-toolbar {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px;
      border: 1px solid rgba(50, 45, 34, 0.14);
      border-radius: 10px;
      background: rgba(255, 253, 248, 0.54);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
    }

    .card-tool-button {
      position: relative;
      display: inline-grid;
      place-items: center;
      width: 31px;
      height: 31px;
      padding: 0;
      border: 1px solid rgba(50, 45, 34, 0.14);
      border-radius: 8px;
      background: rgba(255, 253, 248, 0.7);
      color: #315064;
      cursor: pointer;
      transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
    }

    .card-tool-button svg {
      width: 16px;
      height: 16px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .card-tool-button:hover {
      transform: translateY(-1px);
      border-color: rgba(45, 100, 184, 0.28);
      background: rgba(255, 253, 248, 0.96);
      box-shadow: 0 8px 16px rgba(35, 31, 24, 0.12);
    }

    .card-tool-button:focus-visible {
      outline: 2px solid rgba(45, 100, 184, 0.32);
      outline-offset: 2px;
    }

    .card-tool-button.is-active {
      border-color: rgba(45, 100, 184, 0.34);
      background: rgba(106, 166, 255, 0.16);
      color: #174F82;
    }

    .card-tool-button::after {
      content: attr(data-tooltip);
      position: absolute;
      left: 50%;
      top: calc(100% + 8px);
      z-index: 36;
      padding: 5px 7px;
      border: 1px solid rgba(255, 253, 248, 0.14);
      border-radius: 6px;
      background: rgba(42, 48, 44, 0.92);
      color: #fffdf8;
      font: 12px/1.2 "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
      opacity: 0;
      pointer-events: none;
      transform: translate(-50%, -2px);
      transition: opacity 120ms ease, transform 120ms ease;
      white-space: nowrap;
    }

    .card-tool-button:hover::after,
    .card-tool-button:focus-visible::after {
      opacity: 1;
      transform: translate(-50%, 0);
    }

    .topbar.is-compact {
      padding-top: 6px;
      padding-bottom: 6px;
      box-shadow: 0 8px 24px rgba(35, 31, 24, 0.1);
    }

    .topbar.is-compact .reader-home-button {
      width: 31px;
      height: 31px;
      border-radius: 9px;
      box-shadow: 0 5px 13px rgba(35, 31, 24, 0.12);
    }

    .topbar.is-compact .brand-title-row {
      display: none;
    }

    .topbar.is-compact .brand-source-title {
      margin-top: 0;
      max-width: min(52vw, 720px);
      color: #3d4950;
      font-size: 12.5px;
    }

    .topbar.is-compact .card-toolbar {
      padding: 1px;
    }

    .topbar.is-compact .card-tool-button {
      width: 28px;
      height: 28px;
      border-radius: 7px;
    }

    .tool-button {
      min-height: 30px;
      padding: 5px 10px;
      border: 1px solid rgba(50, 45, 34, 0.18);
      border-radius: 7px;
      background: rgba(255, 253, 248, 0.74);
      color: #39352d;
      cursor: pointer;
      font: 13px/1.2 "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
    }

    .tool-button.is-active {
      border-color: rgba(178, 127, 20, 0.55);
      background: rgba(233, 185, 73, 0.28);
    }

    .font-control {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px;
      border: 1px solid rgba(50, 45, 34, 0.14);
      border-radius: 10px;
      background: rgba(255, 253, 248, 0.54);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
      white-space: nowrap;
    }

    .font-size-button {
      display: inline-grid;
      place-items: center;
      width: 31px;
      height: 31px;
      padding: 0;
      border: 1px solid rgba(50, 45, 34, 0.14);
      border-radius: 8px;
      background: rgba(255, 253, 248, 0.7);
      color: #315064;
      cursor: pointer;
      font: 700 13px/1 "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
      letter-spacing: 0;
      transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
    }

    .font-size-button:hover {
      transform: translateY(-1px);
      border-color: rgba(45, 100, 184, 0.28);
      background: rgba(255, 253, 248, 0.96);
      box-shadow: 0 8px 16px rgba(35, 31, 24, 0.12);
    }

    .font-size-button:focus-visible {
      outline: 2px solid rgba(45, 100, 184, 0.32);
      outline-offset: 2px;
    }

    .bg-control {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px;
      border: 1px solid rgba(50, 45, 34, 0.14);
      border-radius: 10px;
      background: rgba(255, 253, 248, 0.54);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
      white-space: nowrap;
    }

    .bg-swatch {
      width: 25px;
      height: 25px;
      padding: 0;
      border: 1px solid rgba(50, 45, 34, 0.18);
      border-radius: 999px;
      cursor: pointer;
      box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.56);
    }

    .bg-swatch-current {
      background: #eee9df;
    }

    .bg-swatch-green {
      background: #dcebd8;
    }

    .bg-swatch-blue {
      background: #d7e8f5;
    }

    .bg-swatch.is-active {
      border-color: rgba(33, 100, 75, 0.52);
      box-shadow: 0 0 0 2px rgba(33, 100, 75, 0.18), inset 0 0 0 3px rgba(255, 255, 255, 0.7);
    }

    .topbar.is-compact .font-control,
    .topbar.is-compact .bg-control {
      padding: 1px;
    }

    .topbar.is-compact .font-size-button {
      width: 28px;
      height: 28px;
      border-radius: 7px;
    }

    .topbar.is-compact .bg-swatch {
      width: 23px;
      height: 23px;
    }

    .reader-body {
      width: min(1700px, calc(100vw - 22px));
      margin: 0 auto;
    }

    #viewer {
      grid-column: 2;
      width: min(1480px, 100%);
      margin: 26px auto 60px;
    }

    .page-shell {
      position: relative;
      display: grid;
      grid-template-columns: minmax(168px, 230px) minmax(0, 820px) minmax(300px, 330px);
      gap: 14px;
      align-items: start;
      margin: 0 auto 42px;
    }

    .page {
      position: relative;
      grid-column: 2;
      width: 100%;
      background: #fff;
      box-shadow: 0 12px 34px rgba(45, 38, 25, 0.16);
      overflow: visible;
    }

    .page canvas {
      display: block;
      width: 100%;
      height: auto;
      background: #fff;
    }

    .overlay {
      position: absolute;
      inset: 0;
    }

    .hotspot {
      position: absolute;
      appearance: none;
      padding: 0;
      border: 0;
      border-radius: 2px;
      outline: 0;
      background: rgba(233, 185, 73, 0);
      cursor: help;
      font: inherit;
      transition: background 130ms ease;
    }

    .hotspot:hover,
    .hotspot.is-active,
    .text-hotspot.has-persisted-color {
      z-index: 5;
      background: var(--mark-bg);
    }

    .hotspot.is-occluded:not(.is-active):not(.is-selected):not(.has-persisted-color) {
      background: transparent;
    }

    .color-0 { --mark-bg: rgba(233, 185, 73, 0.34); --mark-line: rgba(178, 127, 20, 0.55); --mark-solid: #e9b949; }
    .color-1 { --mark-bg: rgba(106, 166, 255, 0.30); --mark-line: rgba(45, 100, 184, 0.55); --mark-solid: #6aa6ff; }
    .color-2 { --mark-bg: rgba(84, 190, 138, 0.30); --mark-line: rgba(33, 133, 88, 0.55); --mark-solid: #54be8a; }
    .color-clear { --mark-bg: rgba(0, 0, 0, 0); --mark-line: rgba(0, 0, 0, 0); --mark-solid: #d7d0c2; }

    .summary-card {
      position: absolute;
      z-index: 7;
      width: 205px;
      max-height: min(42vh, 380px);
      overflow: auto;
      padding: 10px 11px 11px;
      border: 1px solid rgba(50, 45, 34, 0.12);
      border-left: 4px solid var(--card-edge);
      border-radius: 7px;
      background: var(--card);
      box-shadow: 0 10px 28px rgba(40, 34, 24, 0.13);
      color: #1f2628;
      font-size: 14px;
      font-family: "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
      pointer-events: auto;
    }

    .summary-card.is-deleted {
      display: none;
    }

    .summary-card.left { right: calc(100% + 16px); }
    .summary-card.right {
      left: calc(100% + 18px);
      width: 330px;
    }

    .summary-card.is-active {
      border-color: var(--mark-line);
      border-left-color: var(--card-edge);
      box-shadow: 0 14px 34px rgba(40, 34, 24, 0.2);
    }

    .summary-heading-card {
      padding: 8px 10px;
      background: var(--heading-card);
      box-shadow: 0 8px 22px rgba(40, 34, 24, 0.11);
    }

    .section-heading-title {
      color: #1f2628;
      font-size: 16px;
      font-weight: 800;
      line-height: 1.35;
    }

    .editable-card-text {
      border-radius: 4px;
      outline: 0;
    }

    .editable-card-text[contenteditable="true"]:focus {
      background: rgba(106, 166, 255, 0.12);
      box-shadow: 0 0 0 1px rgba(45, 100, 184, 0.22);
    }

    .summary-card.is-editing {
      z-index: 14;
      box-shadow: 0 18px 44px rgba(40, 34, 24, 0.24);
    }

    .summary-card.is-editing .editable-card-text {
      cursor: text;
    }

    .paragraph-summary {
      color: #39443d;
      font-size: 14px;
      font-weight: 700;
      line-height: 1.42;
    }

    .summary-points {
      position: relative;
      display: grid;
      gap: 7px;
      margin-top: 9px;
      padding: 8px 0 0 15px;
      border-top: 1px solid #ece3d3;
      border-left: 1px solid rgba(105, 168, 110, 0.38);
    }

    .summary-point {
      position: relative;
      display: block;
      width: 100%;
      padding: 5px 7px 5px 8px;
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: #616961;
      cursor: pointer;
      font: inherit;
      font-size: 14px;
      line-height: 1.36;
      text-align: left;
    }

    .summary-point::before {
      content: "";
      position: absolute;
      left: -15px;
      top: 50%;
      width: 12px;
      border-top: 1px solid rgba(105, 168, 110, 0.44);
    }

    .summary-point.is-point-deleted {
      display: none;
    }

    .summary-point .point-index {
      display: none;
    }

    .summary-point .point-text {
      display: inline;
    }

    .summary-point:hover,
    .summary-point.is-active,
    .summary-point.has-persisted-color {
      color: #15191a;
    }

    #viewer {
      width: min(1420px, 100%);
    }

    .page-shell {
      grid-template-columns: minmax(150px, 220px) minmax(0, 910px) minmax(150px, 220px);
      gap: 16px;
    }

    .summary-card:not(.summary-heading-card) {
      display: block;
      width: 205px;
      max-height: none;
      overflow: visible;
      padding: 10px 11px 11px;
      border: 1px solid rgba(50, 45, 34, 0.12);
      border-left: 4px solid var(--card-edge);
      border-radius: 7px;
      background: var(--card);
      box-shadow: 0 10px 28px rgba(40, 34, 24, 0.13);
      color: #1f2628;
      font-size: 14px;
    }

    .summary-card.left { right: calc(100% + 16px); }
    .summary-card.right { left: calc(100% + 16px); width: 205px; }

    .summary-card:not(.summary-heading-card) .paragraph-summary-main {
      display: block;
      min-height: 0;
      padding: 0;
      border: 0;
      border-radius: 4px;
      background: transparent;
      box-shadow: none;
      color: #39443d;
      font-size: 14px;
      font-weight: 700;
      line-height: 1.42;
    }

    .summary-card:not(.summary-heading-card) .summary-points {
      display: grid;
      gap: 5px;
      margin-top: 7px;
      padding: 7px 0 0;
      border-top: 1px solid #ece3d3;
      border-left: 0;
    }

    .summary-card:not(.summary-heading-card) .summary-point {
      display: block;
      width: 100%;
      min-height: 0;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
      color: #616961;
      font-size: 14px;
      line-height: 1.36;
      text-align: left;
    }

    .summary-card:not(.summary-heading-card) .summary-point .point-index {
      display: inline;
      color: inherit;
    }

    .summary-card.left:not(.summary-heading-card).is-active .paragraph-summary-main,
    .summary-card.right:not(.summary-heading-card).is-active .paragraph-summary-main {
      background: linear-gradient(90deg, var(--mark-bg), rgba(255, 253, 248, 0.88) 78%);
      box-shadow: 0 2px 0 rgba(45, 38, 25, 0.08);
    }

    .summary-card.left:not(.summary-heading-card) .summary-point:hover,
    .summary-card.left:not(.summary-heading-card) .summary-point.is-active,
    .summary-card.left:not(.summary-heading-card) .summary-point.has-persisted-color,
    .summary-card.right:not(.summary-heading-card) .summary-point:hover,
    .summary-card.right:not(.summary-heading-card) .summary-point.is-active,
    .summary-card.right:not(.summary-heading-card) .summary-point.has-persisted-color {
      color: #15191a;
      background: linear-gradient(90deg, var(--mark-bg), rgba(255, 253, 248, 0.18) 82%);
    }

    .summary-card.left:not(.summary-heading-card),
    .summary-card.right:not(.summary-heading-card) {
      display: block;
      width: 205px;
      max-height: none;
      overflow: visible;
      padding: 10px 11px 11px;
      border: 1px solid rgba(50, 45, 34, 0.12);
      border-left: 4px solid var(--card-edge);
      border-radius: 7px;
      background: var(--card);
      box-shadow: 0 10px 28px rgba(40, 34, 24, 0.13);
      color: #1f2628;
      font-size: 14px;
    }

    .summary-card.left:not(.summary-heading-card) .paragraph-summary-main,
    .summary-card.right:not(.summary-heading-card) .paragraph-summary-main {
      display: block;
      min-height: 0;
      padding: 0;
      border: 0;
      border-radius: 4px;
      background: transparent;
      box-shadow: none;
      color: #39443d;
      font-size: 14px;
      font-weight: 700;
      line-height: 1.42;
    }

    .summary-card.left:not(.summary-heading-card) .summary-points,
    .summary-card.right:not(.summary-heading-card) .summary-points {
      display: grid;
      gap: 5px;
      margin-top: 7px;
      padding: 7px 0 0;
      border-top: 1px solid #ece3d3;
      border-left: 0;
    }

    .summary-card.left:not(.summary-heading-card) .summary-point,
    .summary-card.right:not(.summary-heading-card) .summary-point {
      display: block;
      width: 100%;
      min-height: 0;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
      color: #616961;
      font-size: 14px;
      line-height: 1.36;
      text-align: left;
    }

    .summary-card.left:not(.summary-heading-card) .summary-point::before,
    .summary-card.right:not(.summary-heading-card) .summary-point::before {
      display: none;
    }

    .summary-card.is-deleted,
    .summary-card:not(.summary-heading-card).is-deleted,
    .summary-point.is-point-deleted,
    .summary-card:not(.summary-heading-card) .summary-point.is-point-deleted {
      display: none !important;
      pointer-events: none;
    }

    body.reader-cards-hidden .summary-card {
      display: none !important;
      pointer-events: none;
    }

    .text-hotspot {
      display: block;
      overflow: hidden;
      color: transparent;
      white-space: nowrap;
      user-select: text;
      -webkit-user-select: text;
      cursor: text;
      text-align: left;
      line-height: 1;
    }

    .text-hotspot.is-selected {
      z-index: 6;
      background: transparent;
    }

    .selection-highlight,
    .note-highlight {
      position: absolute;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: var(--mark-bg);
      box-shadow: none;
    }

    .selection-highlight {
      z-index: 6;
      pointer-events: none;
    }

    .note-highlight {
      z-index: 6;
      cursor: pointer;
      pointer-events: auto;
    }

    .note-highlight:hover {
      background: var(--mark-bg);
      filter: saturate(1.18);
    }

    .note-highlight.transparent-note,
    .note-highlight.transparent-note:hover {
      background: transparent;
      filter: none;
    }

    .image-hotspot {
      position: absolute;
      z-index: 6;
      padding: 0;
      border: 1px solid transparent;
      border-radius: 6px;
      background: rgba(42, 111, 151, 0);
      cursor: copy;
      transition: background 130ms ease, border-color 130ms ease, box-shadow 130ms ease;
    }

    .image-hotspot:hover {
      border-color: rgba(42, 111, 151, 0.62);
      background: rgba(42, 111, 151, 0.08);
      box-shadow: inset 0 0 0 1px rgba(255, 253, 248, 0.72);
    }

    .image-hotspot::after {
      content: attr(data-note-label);
      position: absolute;
      right: 8px;
      top: 8px;
      padding: 3px 6px;
      border-radius: 5px;
      background: rgba(42, 111, 151, 0.86);
      color: #fff;
      font: 11px/1.2 "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
      opacity: 0;
      transition: opacity 130ms ease;
    }

    .image-hotspot:hover::after {
      opacity: 1;
    }

    .image-hotspot[data-kind="figure"] {
      border-color: rgba(42, 111, 151, 0.18);
    }

    .image-hotspot[data-kind="figure"]:hover {
      border-color: rgba(42, 111, 151, 0.72);
      background: rgba(42, 111, 151, 0.05);
    }

    body.manual-crop-active .page .overlay {
      cursor: crosshair;
    }

    body.manual-crop-active .page .overlay > *:not(.manual-crop-box) {
      pointer-events: none;
    }

    .manual-crop-box {
      position: absolute;
      z-index: 24;
      border: 1px solid rgba(23, 79, 130, 0.88);
      border-radius: 4px;
      background: rgba(57, 160, 169, 0.14);
      box-shadow: 0 0 0 1px rgba(255, 253, 248, 0.8), 0 8px 22px rgba(23, 79, 130, 0.2);
      pointer-events: none;
    }

    .manual-crop-box.is-review {
      border-width: 2px;
      background: rgba(57, 160, 169, 0.18);
      pointer-events: auto;
    }

    .manual-crop-edge {
      position: absolute;
      pointer-events: auto;
      touch-action: none;
    }

    .manual-crop-edge[data-edge="top"] {
      left: 0;
      right: 0;
      top: -7px;
      height: 14px;
      cursor: ns-resize;
    }

    .manual-crop-edge[data-edge="right"] {
      top: 0;
      right: -7px;
      bottom: 0;
      width: 14px;
      cursor: ew-resize;
    }

    .manual-crop-edge[data-edge="bottom"] {
      left: 0;
      right: 0;
      bottom: -7px;
      height: 14px;
      cursor: ns-resize;
    }

    .manual-crop-edge[data-edge="left"] {
      top: 0;
      left: -7px;
      bottom: 0;
      width: 14px;
      cursor: ew-resize;
    }

    .manual-crop-actions {
      position: absolute;
      right: -2px;
      bottom: -38px;
      display: flex;
      gap: 6px;
      pointer-events: auto;
    }

    .manual-crop-actions button {
      width: 30px;
      height: 30px;
      border: 1px solid rgba(34, 70, 82, 0.22);
      border-radius: 6px;
      background: #fffdf8;
      color: #26322e;
      box-shadow: 0 8px 20px rgba(32, 28, 20, 0.18);
      cursor: pointer;
      font: 700 16px/1 "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
    }

    .manual-crop-actions button[data-action="confirm"] {
      border-color: rgba(44, 126, 104, 0.48);
      background: rgba(106, 189, 153, 0.22);
    }

    .manual-crop-actions button[data-action="cancel"] {
      border-color: rgba(155, 65, 56, 0.34);
      background: rgba(244, 214, 201, 0.34);
    }

    .bubble {
      position: fixed;
      z-index: 60;
      width: min(430px, calc(100vw - 28px));
      max-height: min(34vh, 260px);
      overflow: auto;
      padding: 14px 16px 15px;
      border: 1px solid rgba(50, 45, 34, 0.13);
      border-radius: 8px;
      background: var(--bubble);
      box-shadow: var(--shadow);
      color: #1d2528;
      font-family: "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
      font-size: var(--bubble-font-size);
      line-height: 1.55;
      opacity: 0;
      pointer-events: none;
      transform: translateY(5px);
      transition: opacity 110ms ease, transform 110ms ease;
    }

    .bubble.visible {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
    }

    .bubble .meta {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 7px;
      color: #7d7668;
      font: 12px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace;
    }

    .bubble .note-title {
      margin-bottom: 6px;
      font-weight: 700;
    }

    .bubble .note-caption {
      margin-bottom: 8px;
      color: #5d675f;
      font-size: 0.92em;
    }

    .bubble sub,
    .bubble sup {
      font-size: 0.72em;
      line-height: 0;
    }

    .bubble sub {
      vertical-align: sub;
    }

    .bubble sup {
      vertical-align: super;
    }

    .bubble .source {
      margin-top: 11px;
      padding-top: 10px;
      border-top: 1px solid #ece4d5;
      color: #69665f;
      font: 12px/1.45 Georgia, "Times New Roman", serif;
    }

    .status {
      margin: 42px auto;
      padding: 20px;
      width: min(680px, 92vw);
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fffdf8;
      color: var(--muted);
      line-height: 1.6;
    }

    .page-loading {
      position: absolute;
      left: 50%;
      top: 50%;
      z-index: 1;
      width: auto;
      margin: 0;
      transform: translate(-50%, -50%);
      pointer-events: none;
      box-shadow: 0 10px 26px rgba(35, 31, 24, 0.12);
    }

    .note-badge {
      position: absolute;
      z-index: 12;
      min-width: 30px;
      min-height: 18px;
      padding: 2px 6px;
      border: 0;
      border-radius: 5px;
      background: rgba(42, 111, 151, 0.92);
      color: #fff;
      font: 10px/1.25 ui-monospace, SFMono-Regular, Consolas, monospace;
      letter-spacing: 0;
      cursor: pointer;
      pointer-events: auto;
      box-shadow: 0 4px 12px rgba(42, 111, 151, 0.24);
    }

    .context-menu {
      position: fixed;
      z-index: 90;
      display: none;
      min-width: 168px;
      padding: 6px;
      border: 1px solid rgba(50, 45, 34, 0.16);
      border-radius: 8px;
      background: #fffdf8;
      box-shadow: 0 14px 36px rgba(35, 31, 24, 0.2);
    }

    .context-menu.visible {
      display: block;
    }

    .context-menu button {
      display: block;
      width: 100%;
      padding: 8px 10px;
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: #2c302c;
      cursor: pointer;
      font: 13px/1.2 "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
      text-align: left;
    }

    .context-menu button:hover {
      background: rgba(233, 185, 73, 0.2);
    }

    .reader-toast {
      position: fixed;
      right: 18px;
      bottom: 62px;
      z-index: 100;
      padding: 7px 11px;
      border: 1px solid rgba(50, 45, 34, 0.16);
      border-radius: 999px;
      background: rgba(42, 48, 44, 0.92);
      color: #fffdf8;
      box-shadow: 0 12px 28px rgba(35, 31, 24, 0.18);
      font: 13px/1.25 "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
      opacity: 0;
      pointer-events: none;
      transform: translateY(6px);
      transition: opacity 130ms ease, transform 130ms ease;
    }

    .reader-toast.visible {
      opacity: 1;
      transform: translateY(0);
    }

    .note-editor {
      position: fixed;
      z-index: 80;
      display: none;
      left: 50%;
      top: 50%;
      width: min(430px, calc(100vw - 28px));
      max-height: min(520px, calc(100vh - 36px));
      overflow-y: auto;
      padding: 16px 16px 12px;
      border: 1px solid color-mix(in srgb, var(--note-accent) 42%, #ffffff);
      border-radius: 12px;
      background: linear-gradient(180deg, var(--note-surface, rgba(255, 254, 250, 0.97)), rgba(255, 252, 246, 0.98));
      box-shadow: 0 22px 58px rgba(32, 28, 20, 0.24);
      transform: translate(-50%, -50%);
      font-family: "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
      --note-accent: var(--reader-tone-accent);
      --note-accent-soft: var(--reader-tone-soft);
      --note-surface: var(--reader-tone-surface);
    }

    .note-editor.visible {
      display: block;
    }

    .note-editor.note-editor-manual-image {
      width: min(760px, calc(100vw - 32px));
      max-height: min(580px, calc(100vh - 36px));
      --note-accent: var(--reader-tone-accent);
      --note-accent-soft: var(--reader-tone-soft);
      --note-surface: var(--reader-tone-surface);
    }

    .note-editor.note-editor-manual-image.visible {
      display: grid;
      grid-template-columns: minmax(292px, 1.05fr) minmax(300px, 0.95fr);
      grid-template-areas:
        "title title"
        "preview image-title"
        "preview image-caption"
        "preview note"
        "preview glossa"
        "preview actions";
      column-gap: 16px;
      align-items: start;
    }

    .note-editor__tab {
      position: absolute;
      left: 16px;
      top: 16px;
      width: 28px;
      height: 28px;
      border-radius: 9px;
      background: linear-gradient(135deg, var(--note-accent), color-mix(in srgb, var(--note-accent) 72%, #ffffff));
      box-shadow: 0 8px 18px rgba(32, 28, 20, 0.15);
      pointer-events: none;
      z-index: 1;
    }

    .note-editor__tab::after {
      content: "";
      position: absolute;
      left: 8px;
      top: 6px;
      width: 10px;
      height: 14px;
      border: 2px solid rgba(255, 255, 255, 0.92);
      border-radius: 2px;
      background:
        linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)) 2px 4px / 6px 1.5px no-repeat,
        linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)) 2px 8px / 6px 1.5px no-repeat;
    }

    .note-editor__title {
      position: relative;
      z-index: 2;
      margin: 0 0 12px 42px;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--note-accent);
      color: var(--note-accent);
      font-size: 19px;
      font-weight: 800;
      line-height: 1.1;
    }

    .manual-image-fields {
      margin-bottom: 6px;
      padding: 0;
      border: 0;
      background: transparent;
    }

    .manual-image-fields[hidden] {
      display: none;
    }

    .manual-image-fields label {
      display: block;
      margin-bottom: 6px;
      color: #4f5c57;
      font: 13px/1.3 "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
    }

    .manual-image-fields label:last-child {
      margin-bottom: 0;
    }

    .note-editor.note-editor-manual-image .manual-image-fields:not([hidden]) {
      display: contents;
    }

    .note-editor.note-editor-manual-image .manual-image-field-title {
      grid-area: image-title;
    }

    .note-editor.note-editor-manual-image .manual-image-field-caption {
      grid-area: image-caption;
    }

    .manual-image-preview {
      display: grid;
      place-items: center;
      min-height: 124px;
      margin: 0 0 10px;
      padding: 8px;
      overflow: hidden;
      border: 1px solid color-mix(in srgb, var(--note-accent) 32%, #ffffff);
      border-radius: 9px;
      background: color-mix(in srgb, var(--note-accent-soft) 45%, rgba(255,255,255,.62));
    }

    .note-editor.note-editor-manual-image .manual-image-preview {
      grid-area: preview;
      min-height: 392px;
      height: 100%;
      margin: 0;
      padding: 10px;
    }

    .manual-image-preview[hidden] {
      display: none;
    }

    .manual-image-preview canvas {
      display: block;
      max-width: 100%;
      max-height: 112px;
      border: 1px solid color-mix(in srgb, var(--note-accent) 28%, #ffffff);
      border-radius: 7px;
      background: #fff;
      object-fit: contain;
    }

    .note-editor.note-editor-manual-image .manual-image-preview canvas {
      max-width: 100%;
      max-height: 372px;
    }

    .manual-image-fields input,
    .manual-image-fields textarea {
      box-sizing: border-box;
      display: block;
      width: 100%;
      margin-top: 8px;
      border: 1px solid color-mix(in srgb, var(--note-accent) 55%, #ffffff);
      border-radius: 8px;
      padding: 7px 9px;
      color: #232824;
      background: rgba(255, 255, 255, 0.72);
      font: 13px/1.42 "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
    }

    .manual-image-fields input:focus,
    .manual-image-fields textarea:focus,
    .note-editor textarea:focus {
      outline: none;
      border-color: var(--note-accent);
      box-shadow: 0 0 0 3px var(--note-accent-soft);
    }

    .manual-image-fields textarea {
      min-height: 42px;
      resize: vertical;
    }

    .note-editor textarea {
      box-sizing: border-box;
      width: 100%;
      min-height: 78px;
      resize: vertical;
      border: 1px solid color-mix(in srgb, var(--note-accent) 55%, #ffffff);
      border-radius: 8px;
      padding: 12px;
      color: #232824;
      background: rgba(255, 255, 255, 0.72);
      font: 14px/1.45 "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
    }

    .note-editor.note-editor-manual-image #noteEditorInput {
      grid-area: note;
      min-height: 42px;
    }

    .note-editor.note-editor-manual-image .glossa-note-fields {
      grid-area: glossa;
    }

    .note-editor.note-editor-manual-image .note-editor-actions {
      grid-area: actions;
    }

    @media (max-width: 740px) {
      .note-editor.note-editor-manual-image.visible {
        grid-template-columns: 1fr;
        grid-template-areas:
          "title"
          "preview"
          "image-title"
          "image-caption"
          "note"
          "glossa"
          "actions";
      }

      .note-editor.note-editor-manual-image .manual-image-preview {
        min-height: 220px;
      }
    }

    .note-editor-actions {
      display: flex;
      justify-content: flex-end;
      gap: 12px;
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px dashed rgba(68, 74, 66, 0.18);
    }

    .note-editor-actions button {
      min-width: 88px;
      padding: 10px 18px;
      border: 1px solid #d8cdbb;
      border-radius: 6px;
      background: #fffefa;
      color: #29302c;
      cursor: pointer;
      font: 13px/1.2 "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
    }

    .note-editor-actions button[data-action="save"] {
      border-color: var(--note-accent);
      background: var(--note-accent);
      color: #fff;
    }

    .note-actions {
      display: flex;
      justify-content: flex-end;
      margin-top: 10px;
    }

    .note-actions button {
      padding: 5px 9px;
      border: 1px solid rgba(150, 54, 45, 0.24);
      border-radius: 5px;
      background: rgba(150, 54, 45, 0.08);
      color: #71362f;
      cursor: pointer;
      font: 12px/1.2 "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
    }

    .note-actions button:hover {
      background: rgba(150, 54, 45, 0.14);
    }

    .page-indicator {
      position: fixed;
      right: 18px;
      bottom: 18px;
      z-index: 34;
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 5px;
      border: 1px solid rgba(50, 45, 34, 0.14);
      border-radius: 999px;
      background: rgba(255, 253, 248, 0.94);
      box-shadow: 0 12px 28px rgba(35, 31, 24, 0.14);
      color: #29302c;
      font: 600 12px/1.2 "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
      transition: opacity 140ms ease, transform 140ms ease;
    }

    .page-indicator.is-hidden {
      opacity: 0;
      pointer-events: none;
      transform: translateY(8px);
    }

    .page-jump-input {
      width: 2.6em;
      height: 24px;
      padding: 2px 3px;
      border: 1px solid transparent;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.48);
      color: #1f2628;
      text-align: center;
      font: inherit;
    }

    .page-jump-input::-webkit-outer-spin-button,
    .page-jump-input::-webkit-inner-spin-button {
      margin: 0;
      -webkit-appearance: none;
    }

    .page-jump-input:focus {
      outline: 2px solid rgba(45, 100, 184, 0.24);
      outline-offset: 1px;
    }

    .page-total-separator {
      color: rgba(41, 48, 44, 0.56);
    }

    .page-top-button {
      display: inline-grid;
      place-items: center;
      width: 24px;
      height: 24px;
      padding: 0;
      border: 1px solid rgba(50, 45, 34, 0.14);
      border-radius: 999px;
      background: rgba(250, 255, 248, 0.88);
      color: #315064;
      cursor: pointer;
      font: 700 14px/1 "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
    }

    .page-top-button:hover {
      border-color: rgba(45, 100, 184, 0.24);
      background: rgba(255, 253, 248, 0.98);
    }

    .page-top-button:focus-visible {
      outline: 2px solid rgba(45, 100, 184, 0.24);
      outline-offset: 2px;
    }

    @media (max-width: 1160px) {
      .reader-body {
        width: calc(100vw - 12px);
      }
      #viewer {
        width: 100%;
        overflow-x: auto;
      }
      .page-shell {
        grid-template-columns: 156px 700px 220px;
        gap: 10px;
        width: 1096px;
        margin-left: auto;
        margin-right: auto;
      }
      .summary-card {
        width: 150px;
        padding: 8px 9px 9px;
      }
      .summary-card.left { right: calc(100% + 10px); }
      .summary-card.right {
        left: calc(100% + 10px);
        width: 210px;
      }
      .summary-card.right:not(.summary-heading-card) {
        display: block;
        width: 210px;
        max-height: min(42vh, 380px);
        padding: 8px 9px 9px;
      }
      .summary-card.right:not(.summary-heading-card) .paragraph-summary-main {
        display: block;
        min-height: 0;
        padding: 0;
        border: 0;
        border-radius: 4px;
        background: transparent;
        box-shadow: none;
        color: #39443d;
        font-size: 14px;
        font-weight: 700;
      }
      .summary-card.right:not(.summary-heading-card) .summary-points {
        display: grid;
        margin-top: 9px;
        padding: 8px 0 0 15px;
        border-top: 1px solid #ece3d3;
        border-left: 1px solid rgba(105, 168, 110, 0.38);
        gap: 7px;
      }
      .summary-card.right:not(.summary-heading-card) .summary-point {
        min-height: 0;
        padding: 5px 7px 5px 8px;
        background: transparent;
      }
      .summary-card.right:not(.summary-heading-card) .summary-point::before {
        left: -15px;
        right: auto;
        width: 12px;
      }
      .section-heading-title {
        font-size: 14px;
      }
      .summary-point {
        font-size: 13px;
      }
      .page-shell {
        grid-template-columns: 156px 700px 156px;
        width: 1032px;
      }
      .summary-card.right {
        width: 150px;
      }
      .summary-card.right:not(.summary-heading-card) {
        width: 150px;
        max-height: none;
        padding: 8px 9px 9px;
      }
    }

    @media (max-width: 720px) {
      .topbar {
        align-items: flex-start;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px 14px;
      }
      .tools {
        justify-self: start;
      }
      .glossa-progress {
        width: min(82vw, 420px);
        min-width: 0;
      }
      .reader-body {
        width: calc(100vw - 8px);
      }
      #viewer {
        width: 100%;
        margin-top: 10px;
        overflow-x: visible;
      }
      .page-shell {
        display: block;
        width: auto;
        margin-bottom: 22px;
      }
      .page-indicator {
        right: 10px;
        bottom: 10px;
      }
      .summary-card {
        display: none;
      }
      .bubble {
        font-size: var(--bubble-font-size);
      }
    }

    .glossa-parse-menu {
      position: fixed;
      inset: 0;
      z-index: 80;
      display: grid;
      place-items: center;
      padding: 24px;
      background: rgba(24, 28, 30, .46);
      backdrop-filter: blur(5px);
    }
    body.glossa-parse-open {
      overflow: hidden;
    }
    .glossa-parse-menu[hidden] {
      display: none;
    }
    .glossa-parse-menu__panel {
      position: relative;
      display: grid;
      grid-template-columns: minmax(560px, 1.48fr) minmax(300px, .52fr);
      width: min(1220px, calc(100vw - 32px));
      max-height: min(880px, calc(100vh - 32px));
      overflow: hidden;
      border: 1px solid color-mix(in srgb, var(--accent) 28%, rgba(255,255,255,.6));
      border-radius: 18px;
      background: color-mix(in srgb, var(--page-bg) 78%, rgba(255,255,255,.94));
      box-shadow: 0 28px 72px rgba(26, 31, 34, .28);
    }
    .glossa-parse-preview {
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      min-height: 0;
      padding: 18px;
      background:
        linear-gradient(135deg, rgba(255,255,255,.62), rgba(255,255,255,.2)),
        color-mix(in srgb, var(--page-bg) 82%, var(--accent) 6%);
      border-right: 1px solid color-mix(in srgb, var(--accent) 20%, rgba(255,255,255,.5));
    }
    .glossa-parse-preview__toolbar {
      display: grid;
      grid-template-columns: 34px minmax(0, 1fr) 34px;
      align-items: center;
      gap: 10px;
      margin-bottom: 12px;
    }
    .glossa-parse-preview__toolbar button,
    .glossa-parse-close {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid rgba(23, 79, 130, .18);
      border-radius: 10px;
      background: rgba(255,255,255,.72);
      color: #174F82;
      cursor: pointer;
      font: inherit;
    }
    .glossa-parse-preview__toolbar button {
      width: 34px;
      height: 34px;
      font-size: 19px;
    }
    .glossa-parse-preview__toolbar button:hover,
    .glossa-parse-close:hover {
      background: rgba(255,255,255,.92);
      border-color: rgba(23, 79, 130, .34);
    }
    .glossa-parse-preview__label {
      display: grid;
      min-width: 0;
      text-align: center;
    }
    .glossa-parse-preview__label strong {
      color: #223342;
      font-size: 14px;
      line-height: 1.25;
    }
    .glossa-parse-menu__meta {
      overflow: hidden;
      color: #5c6b74;
      font-size: 12px;
      line-height: 1.35;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .glossa-parse-preview__frame {
      display: grid;
      min-height: min(650px, calc(100vh - 170px));
      overflow: hidden;
      place-items: center;
      border: 1px solid rgba(23, 79, 130, .13);
      border-radius: 14px;
      background:
        linear-gradient(90deg, rgba(23,79,130,.045) 1px, transparent 1px),
        linear-gradient(0deg, rgba(23,79,130,.045) 1px, transparent 1px),
        rgba(255,255,255,.58);
      background-size: 18px 18px;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,.42);
    }
    #glossaParsePreviewCanvas {
      max-width: calc(100% - 30px);
      max-height: calc(100% - 30px);
      background: #fff;
      box-shadow: 0 18px 34px rgba(35, 31, 24, .18);
    }
    .glossa-parse-preview__fallback {
      color: #5c6b74;
      font-size: 13px;
    }
    .glossa-parse-settings {
      position: relative;
      display: grid;
      align-content: start;
      gap: 16px;
      padding: 24px 24px 22px;
      background: rgba(255,253,248,.72);
    }
    .glossa-parse-close {
      position: absolute;
      top: 14px;
      right: 14px;
      width: 32px;
      height: 32px;
      font-size: 18px;
    }
    .glossa-parse-menu__eyebrow {
      margin: 0;
      color: #174F82;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: .06em;
    }
    .glossa-parse-menu__title {
      margin: 0;
      padding-right: 34px;
      color: #223342;
      font-size: 22px;
      line-height: 1.18;
      letter-spacing: 0;
    }
    .glossa-parse-menu__hint {
      margin: -7px 0 0;
      color: #5c6b74;
      font-size: 13px;
      line-height: 1.55;
    }
    .glossa-parse-target {
      display: grid;
      gap: 8px;
      padding: 14px;
      border: 1px solid rgba(23, 79, 130, .14);
      border-radius: 14px;
      background: rgba(255,255,255,.64);
    }
    .glossa-parse-target label[for="glossaParseTargetInput"],
    #glossaParseTargetRange,
    #glossaParseReparseButton {
      display: none;
    }
    .glossa-parse-page-tools {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto auto auto;
      align-items: center;
      gap: 8px;
      color: #315064;
      font-size: 13px;
    }
    .glossa-parse-page-tools strong {
      color: #223342;
      font-weight: 800;
    }
    .glossa-parse-page-tools span {
      color: #6a7880;
      font-size: 12px;
      white-space: nowrap;
    }
    .glossa-parse-page-tools button {
      min-height: 28px;
      border: 1px solid rgba(23, 79, 130, .18);
      border-radius: 8px;
      padding: 5px 8px;
      background: rgba(255,255,255,.72);
      color: #315064;
      cursor: pointer;
      font: inherit;
      font-size: 12px;
      font-weight: 800;
    }
    .glossa-parse-page-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
      gap: 8px;
      max-height: min(420px, calc(100vh - 390px));
      overflow: auto;
      padding: 2px 2px 4px;
    }
    .glossa-parse-page {
      position: relative;
      min-width: 0;
    }
    .glossa-parse-page input {
      position: absolute;
      top: 7px;
      left: 7px;
      z-index: 1;
      width: 14px;
      height: 14px;
      accent-color: #174F82;
    }
    .glossa-parse-page button {
      width: 100%;
      min-height: 46px;
      display: grid;
      place-items: center;
      padding: 7px 6px 6px 22px;
      border: 1px solid rgba(23, 79, 130, .14);
      border-radius: 10px;
      background: rgba(255,255,255,.72);
      color: #315064;
      cursor: pointer;
      font: inherit;
      font-size: 14px;
      font-weight: 800;
    }
    .glossa-parse-page.is-selected button {
      border-color: rgba(23, 79, 130, .42);
      background: rgba(232, 241, 247, .94);
      color: #174F82;
    }
    .glossa-parse-page.is-current button {
      outline: 2px solid rgba(43, 145, 160, .28);
      outline-offset: 2px;
    }
    .glossa-parse-page.is-parsed:not(.is-selected) button {
      color: #7a6d58;
      background: rgba(255,253,248,.76);
    }
    .glossa-parse-menu__actions {
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
    }
    .glossa-continue-button,
    .glossa-reparse-button {
      min-height: 42px;
      border: 1px solid rgba(23, 79, 130, .22);
      background: rgba(255,255,255,.76);
      color: #174F82;
      border-radius: 12px;
      padding: 9px 12px;
      font-size: 13px;
      font-weight: 700;
      white-space: nowrap;
      cursor: pointer;
      font-family: inherit;
    }
    .glossa-continue-button {
      border-color: transparent;
      background: linear-gradient(135deg, #174F82, #2B91A0);
      color: #fff;
      box-shadow: 0 12px 22px rgba(23, 79, 130, .22);
    }
    .glossa-continue-button:hover,
    .glossa-reparse-button:hover {
      border-color: rgba(23, 79, 130, .38);
      background: rgba(232, 241, 247, .92);
    }
    .glossa-continue-button:hover {
      background: linear-gradient(135deg, #123f68, #257f8c);
    }
    .glossa-continue-button:disabled {
      cursor: not-allowed;
      opacity: .52;
      box-shadow: none;
    }
    @media (max-width: 760px) {
      .glossa-parse-menu {
        padding: 12px;
      }
      .glossa-parse-menu__panel {
        grid-template-columns: 1fr;
        overflow-y: auto;
      }
      .glossa-parse-preview {
        min-height: 320px;
        border-right: 0;
        border-bottom: 1px solid color-mix(in srgb, var(--accent) 20%, rgba(255,255,255,.5));
      }
      .glossa-parse-preview__frame {
        min-height: 360px;
      }
      .glossa-parse-settings {
        padding: 20px;
      }
    }
    .glossa-note-fields {
      display: grid;
      gap: 9px;
      margin: 10px 0 0;
    }
    .glossa-note-fields label {
      display: grid;
      gap: 6px;
      color: #29302c;
      font: 13px/1.3 "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
    }
    .glossa-note-fields select,
    .glossa-note-fields input {
      border: 1px solid color-mix(in srgb, var(--note-accent) 55%, #ffffff);
      border-radius: 8px;
      padding: 8px 10px;
      font: 13px/1.42 "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
      background: rgba(255, 255, 255, .72);
      color: #232824;
      transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
    }
    .glossa-note-fields select:focus,
    .glossa-note-fields input:focus {
      outline: none;
      border-color: var(--note-accent);
      box-shadow: 0 0 0 3px var(--note-accent-soft);
    }

    .brand-source-title a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
    #manualCropButton, #restoreCardsButton, #glossaParseDialog, #noteEditor { display: none !important; }
