/* -------------------------
   Surface Variables & Base Styles
   ------------------------- */
   :root {
    --bg-color: #212121;
    --text-color: #ffffff;
    --text-color-rgb: 255, 255, 255;
    --source-only-color: #9a9a9a;
    --correct-color: #8bc9f9;
    --replace-color: #f9f2f2;
    --replace-strike-thru-color: #9a5fff;
    --delete-color: #cb4a55;
    --insert-color: #94caf3;
    --source-incorrect-color: #f2b36f;
    --sentence-highlight-bg: rgb(56, 58, 61);
    --sentence-separator-color: rgba(26, 26, 26, 0.22);
    --sentence-separator-thickness: 1px;
    --section-separator-color: rgba(247, 247, 247, 0.34);
    --panel-content-gutter-x: 10px;
    --reading-frame-width: 980px;
    --reading-frame-inline-pad: 24px;
    --sentence-number-gutter: 30px;
    --terminal-card-gap: 24px;
    --terminal-bottom-inset: calc(20px + 1.6em);
    --sidebar-panel-width: min(25vw, 360px);
    --sidebar-layout-width: calc(var(--sidebar-panel-width) + 8.5px);
    --sidebar-panel-bg: #121212;
    --topbar-bg: var(--surface-reading-bg);
    --topbar-text: #ffffff;
    --topbar-border: #2524293b;
    --topbar-button-bg: #121214;
    --topbar-button-hover-bg: rgb(44, 44, 46);
    --topbar-button-text: #ffffff;
    --writing-tab-active-bg: #1d242c;
    --surface-upper-bg: #171717;
    --surface-reading-bg: #0a0a0a;
    --highlight-box-color: #272828;
    --highlight-box-hover-color: rgb(77, 77, 78);
    --send-button-color: #f3f3f3;
    --send-button-border-color: rgba(243, 243, 243, 0.08);
    --topbar-height: 48px;
  }

  /* -------------------------
     Global Styles
     ------------------------- */
  body {
    font-family: "Courier New", Courier, monospace;
    font-size: 19px;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    overflow: hidden;
  }

  body.app-bootstrap-pending #app,
  body.app-bootstrap-pending #hamburger-anchor,
  body.app-bootstrap-pending #brand-anchor,
  body.app-bootstrap-pending #writing-tabs-anchor,
  body.app-bootstrap-pending #print-anchor,
  body.app-bootstrap-pending #menu-anchor {
    visibility: hidden;
    pointer-events: none;
  }
  
  /* -------------------------
     Top Bar
     ------------------------- */
  #theme-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    color: var(--topbar-text);
    z-index: 1000;
    border-bottom: 0;
    pointer-events: auto;
    isolation: isolate;
  }

  #theme-bar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, #000000 0%, var(--topbar-bg) 100%);
    z-index: 0;
    pointer-events: none;
  }

  #writing-tabs-anchor {
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    height: 28px;
    z-index: 1001;
    pointer-events: none;
  }

  #writing-tabs-anchor .full-writing-tabs {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    pointer-events: auto;
  }

  #writing-tabs-anchor .full-writing-save-button {
    position: absolute;
    top: 0;
    right: 14px;
    transform: none;
    pointer-events: auto;
  }

  #resubmit-button {
    position: absolute;
    top: 10px;
    left: 58px;
    z-index: 1002;
    height: 28px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: var(--topbar-button-bg);
    color: var(--topbar-button-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    pointer-events: auto;
  }

  #resubmit-button:hover {
    background: var(--topbar-button-hover-bg);
  }

  #resubmit-button:disabled {
    cursor: wait;
    opacity: 0.68;
  }

  #menu-anchor {
    position: absolute;
    top: 10px;
    right: 14px;
    z-index: 1002;
    pointer-events: auto;
  }

  #print-anchor {
    position: absolute;
    top: 10px;
    right: 70px;
    z-index: 1002;
    pointer-events: auto;
  }

  #print-button {
    border: 0;
    background: var(--topbar-button-bg);
    color: var(--topbar-button-text);
    height: 28px;
    min-width: 52px;
    padding: 0 12px;
    border-radius: 7px;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
  }

  #print-button:hover {
    background: var(--topbar-button-hover-bg);
  }

  #print-preview[hidden] {
    display: none !important;
  }

  #print-preview {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: #5d6067;
    overflow: hidden;
  }

  #print-preview-stage::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  #print-preview-stage::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
  }

  #print-preview-stage::-webkit-scrollbar-track-piece:start {
    margin-top: 2px;
  }

  #print-preview-stage::-webkit-scrollbar-thumb {
    background: rgba(220, 220, 220, 0.55);
    border-radius: 8px;
  }

  #print-preview-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 18px;
    padding: 14px 20px;
    background: #191b1f;
    border-bottom: 1px solid rgba(247, 247, 247, 0.08);
    background-clip: padding-box;
    backdrop-filter: none;
    box-sizing: border-box;
  }

  #print-preview-page-count {
    justify-self: start;
    color: rgba(247, 242, 232, 0.9);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.2;
    letter-spacing: 0.02em;
  }

  #print-preview-view-toggle {
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(247, 242, 232, 0.94);
    height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
  }

  #print-preview-view-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
  }

  #print-preview-close,
  #print-preview-confirm {
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(247, 242, 232, 0.94);
    height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
  }

  #print-preview-actions {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }

  #print-preview-confirm {
    background: rgba(139, 92, 246, 0.22);
  }

  #print-preview-close:hover,
  #print-preview-confirm:hover {
    background: rgba(255, 255, 255, 0.14);
  }

  #print-preview-confirm:hover {
    background: rgba(139, 92, 246, 0.3);
  }

  #print-preview-stage {
    position: absolute;
    top: 63px;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 19px 28px 24px;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
  }

  #print-preview.print-preview-dark-view {
    background: #0c0d10;
  }

  #print-preview.print-preview-dark-view #print-preview-toolbar {
    background: #121418;
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }

  #print-preview.print-preview-dark-view #print-preview-stage {
    background: #0c0d10;
  }

  #print-preview.print-preview-dark-view .print-preview-page {
    background: #17181b;
    color: #ececec;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.46);
  }

  #print-preview.print-preview-dark-view .print-preview-sheet {
    color: #ececec;
  }

  #print-preview.print-preview-dark-view .print-preview-final-line,
  #print-preview.print-preview-dark-view .print-preview-annotated-line,
  #print-preview.print-preview-dark-view .print-preview-token.equal,
  #print-preview.print-preview-dark-view .print-preview-token[data-replacement-block-id] {
    color: #ececec;
  }

  #print-preview.print-preview-dark-view .print-preview-sentence::before {
    border-top-color: rgba(255, 255, 255, 0.12);
  }

  #print-preview.print-preview-dark-view .print-preview-sentence::after {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 1%, transparent);
  }

  #print-preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin: 0 auto;
    --print-preview-font-size: 15px;
    --print-preview-line-height: 1.15;
    --print-preview-sentence-padding-bottom: 5px;
    --print-preview-sentence-gap: 8px;
    box-sizing: border-box;
  }

  #print-preview-content.print-density-compressed {
    --print-preview-line-height: 1.06;
    --print-preview-sentence-padding-bottom: 2px;
    --print-preview-sentence-gap: 2px;
  }

  .print-preview-page {
    width: 210mm;
    height: 297mm;
    max-width: 210mm;
    background: #ffffff;
    color: #17171a;
    border-radius: 2px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
    box-sizing: border-box;
    overflow: hidden;
    flex: 0 0 auto;
    margin: 0 auto;
    break-after: page;
    page-break-after: always;
  }

  .print-preview-measurement-page {
    visibility: hidden;
    position: absolute;
    inset: 0 auto auto 0;
    pointer-events: none;
    z-index: -1;
  }

  .print-preview-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .print-preview-sheet {
    width: 100%;
    height: 100%;
    padding: 16mm 14mm 10mm 14mm;
    box-sizing: border-box;
    overflow: hidden;
    color: #17171a;
    font-size: var(--print-preview-font-size);
    line-height: var(--print-preview-line-height);
  }

  .print-preview-sentence {
    position: relative;
    --print-gap-final-to-annotated: 4px;
    --print-gap-annotated-to-final: 10px;
    --print-gap-packed-band-to-annotated: 0px;
    --print-gap-line-to-separator: 3px;
    margin-top: 0;
    padding-top: 8px;
    padding-bottom: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-preview-sentence + .print-preview-sentence {
    margin-top: var(--print-preview-sentence-gap);
  }

  .print-preview-aligned-sentence {
    display: flex;
    flex-direction: column;
  }

  .print-preview-final-line,
  .print-preview-annotated-line {
    display: block;
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0 1rem 0 calc(var(--panel-content-gutter-x) + 4px);
    box-sizing: border-box;
    color: #222222;
    text-align: left;
    white-space: nowrap;
    overflow-wrap: break-word;
    line-height: var(--print-preview-line-height);
  }

  .print-preview-source-sentence-number {
    position: absolute;
    left: calc(var(--panel-content-gutter-x) - 3.25ch);
    top: 0;
    min-width: 2.5ch;
    color: #6f6f6f;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9em;
    font-weight: 700;
    pointer-events: none;
    user-select: none;
  }

  .print-preview-final-line + .print-preview-annotated-line {
    margin-top: var(--print-gap-final-to-annotated);
  }

  .print-preview-annotated-line + .print-preview-final-line {
    margin-top: var(--print-gap-annotated-to-final);
  }

  .print-preview-packed-block > .print-preview-final-line + .print-preview-packed-band {
    margin-top: var(--print-gap-final-to-annotated);
  }

  .print-preview-packed-block + .print-preview-final-line,
  .print-preview-packed-guest-annotated + .print-preview-final-line {
    margin-top: var(--print-gap-annotated-to-final);
  }

  .print-preview-packed-block > .print-preview-packed-band + .print-preview-packed-guest-annotated {
    margin-top: var(--print-gap-packed-band-to-annotated);
  }

  .print-preview-packed-band {
    display: grid;
    align-items: start;
    min-height: 0;
    height: var(--print-packed-band-height, calc(var(--print-preview-line-height) * 1em));
  }

  .print-preview-packed-host-annotated {
    grid-area: 1 / 1;
    align-self: start;
    position: relative;
    z-index: 0;
  }

  .print-preview-packed-guest-final {
    grid-area: 1 / 1;
    align-self: start;
    position: relative;
    transform: translateY(var(--print-packed-guest-offset-y, 0px));
    z-index: 1;
  }

  .print-preview-token,
  .print-preview-corrected-char {
    display: inline-block;
    width: 1ch;
    min-width: 1ch;
    text-align: center;
    vertical-align: top;
  }

  .print-preview-token.equal {
    color: #222222;
  }

  .print-preview-token[data-replacement-block-id] {
    color: #222222;
    text-decoration: line-through;
    text-decoration-color: #7c3aed;
    text-decoration-thickness: 2px;
  }

  .print-preview-token[data-replacement-block-id].no-strike {
    text-decoration: none;
  }

  .print-preview-token[data-delete-block-id] {
    color: #b4232f;
    text-decoration: line-through;
    text-decoration-color: #7c3aed;
    text-decoration-thickness: 2px;
  }

  .print-preview-token[data-insert-block-id],
  .print-preview-corrected-char {
    color: #1f6fb2;
    font-weight: 500;
  }

  .print-preview-sentence-separator {
    display: block;
    margin-top: 0;
    margin-left: calc(var(--panel-content-gutter-x) + 4px);
    width: var(--print-sentence-decoration-width, calc(100% - (var(--panel-content-gutter-x) + 4px) - 2px));
    min-height: 1em;
    box-sizing: border-box;
    color: #000000;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.92em;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    pointer-events: none;
  }

  .print-preview-sentence-separator-text {
    display: inline-block;
    white-space: pre;
    letter-spacing: 0;
  }

  .print-preview-packed-band + .print-preview-sentence-separator,
  .print-preview-packed-guest-annotated + .print-preview-sentence-separator,
  .print-preview-final-line + .print-preview-sentence-separator,
  .print-preview-annotated-line + .print-preview-sentence-separator {
    margin-top: var(--print-gap-line-to-separator);
  }

  .print-preview-split-divider {
    position: relative;
    display: block;
    width: 26em;
    height: 46px;
    max-width: 100%;
    margin: 2px 0 2px calc(var(--panel-content-gutter-x) - 23px);
    overflow: visible;
    color: #b39afc;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 0.95em;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
  }

  .print-preview-final-line + .print-preview-split-divider,
  .print-preview-packed-band + .print-preview-split-divider,
  .print-preview-packed-guest-annotated + .print-preview-split-divider,
  .print-preview-annotated-line + .print-preview-split-divider {
    margin-top: 0;
  }

  .print-preview-split-divider-svg {
    position: absolute;
    top: 50%;
    left: 0;
    display: block;
    width: 70%;
    height: 4.1em;
    transform: translateY(-50%);
  }

  .print-preview-split-divider-label {
    fill: currentColor;
    stroke: none;
    font: inherit;
    font-size: 1.16em;
    font-weight: 500;
    text-anchor: middle;
    dominant-baseline: middle;
    white-space: nowrap;
    pointer-events: none;
  }

  .print-preview-split-divider-bg {
    fill: #000000;
  }

  #print-preview.print-preview-real-view .print-preview-split-divider-bg {
    display: none;
  }

  #print-preview.print-preview-dark-view .print-preview-sentence-separator {
    color: #ffffff;
  }

  .print-preview-sentence::before {
    width: var(--print-sentence-decoration-width, calc(100% - (var(--panel-content-gutter-x) + 4px) - 2px));
    border-top-color: var(--sentence-separator-color);
  }

  .print-preview-sentence::after {
    width: var(--print-sentence-decoration-width, calc(100% - (var(--panel-content-gutter-x) + 4px) - 2px));
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.06) 1%, transparent);
  }

  .print-preview-panel .content-card__body {
    max-height: none !important;
    overflow: visible !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
    padding-bottom: 0 !important;
  }

  .print-preview-panel .content-card__body::after {
    display: none !important;
  }

  .print-preview-panel .page-status-summary {
    display: none !important;
  }

  body.print-preview-open #theme-bar,
  body.print-preview-open #sidebar-scrim,
  body.print-preview-open #sidebar-panel,
  body.print-preview-open #app {
    visibility: hidden;
  }

  @page {
    size: A4;
    margin: 0;
  }

  @media print {
    body * {
      visibility: hidden !important;
    }

    #print-preview,
    #print-preview * {
      visibility: visible !important;
      -webkit-print-color-adjust: exact;
      print-color-adjust: exact;
    }

    #print-preview {
      position: static;
      inset: auto;
      background: #ffffff;
      overflow: visible;
    }

    #print-preview-toolbar {
      display: none !important;
    }

    #print-preview-stage {
      position: static;
      top: auto;
      left: auto;
      right: auto;
      bottom: auto;
      padding: 0;
      display: block;
      min-width: 0;
      overflow: visible;
    }

    #print-preview-content {
      gap: 0;
      width: auto;
      margin: 0;
      align-items: stretch;
    }

    .print-preview-page {
      width: 210mm;
      height: 297mm;
      margin: 0;
      border-radius: 0;
      box-shadow: none;
      background: #ffffff;
      color: #222222;
    }

    .print-preview-sheet {
      padding: 16mm 14mm 10mm 14mm;
    }

    .print-preview-page:not(:last-child) {
      break-after: page;
      page-break-after: always;
    }
  }

  #hamburger-anchor {
    position: absolute;
    top: 1px;
    left: 14px;
    transform: none;
    pointer-events: auto;
    z-index: 1002;
  }

  #brand-anchor {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1002;
    pointer-events: none;
  }

  #brand-anchor .compose-wordmark {
    margin: 0;
    color: rgba(245, 245, 245, 0.9);
  }

  body.auth-mode #brand-anchor {
    display: none;
  }

  #hamburger-toggle {
    border: 0;
    background: transparent;
    color: var(--topbar-text);
    min-width: 0;
    height: 40px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 0 12px;
    border-radius: 7px;
  }

  #hamburger-toggle .line {
    width: 22px;
    height: 3px;
    border-radius: 2px;
    background: currentColor;
    opacity: 0.95;
    display: block;
  }

  #hamburger-toggle .line.middle {
    width: 16px;
  }

  #hamburger-toggle:hover {
    background: #1a1a1a;
  }

  #sidebar-panel {
    position: fixed;
    top: var(--topbar-height);
    bottom: 0;
    left: 0;
    width: var(--sidebar-panel-width);
    min-width: 240px;
    max-width: none;
    border-top: 0;
    border-left: 0;
    border-right: 0.5px solid rgba(22, 23, 27, 0.98);
    border-bottom: 1px solid rgba(119, 123, 136, 0.65);
    border-radius: 0;
    background-color: var(--sidebar-panel-bg) !important;
    background-image: none;
    padding: 6px 0 6px 8px;
    min-height: 0;
    height: auto !important;
    max-height: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    z-index: 1100;
  }

  #sidebar-panel[hidden] {
    display: none !important;
  }

  #sidebar-scrim {
    position: fixed;
    top: var(--topbar-height);
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.52);
    z-index: 900;
  }

  #sidebar-scrim[hidden] {
    display: none !important;
  }

  #sidebar-close {
    position: absolute;
    top: 8px;
    right: 10px;
    border: 0;
    background: transparent;
    color: #b7bcc3;
    font-family: "Courier New", Courier, monospace;
    font-size: 18px;
    line-height: 1;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.95;
  }

  #sidebar-close:hover {
    transform: translateY(-3px);
    opacity: 1;
    background: rgba(255, 255, 255, 0.12);
  }

  @media (max-width: 248.5px) {
    :root {
      --sidebar-panel-width: calc(100vw - 8.5px);
    }

    #sidebar-panel {
      min-width: 0;
    }
  }

  #sidebar-panel .sidebar-item {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #f2f2f2;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    text-align: left;
    padding: 10px 8px 4px 8px;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
  }

  #sidebar-new-entry .new-writing-icon {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.95;
    flex: 0 0 auto;
  }

  #sidebar-panel #sidebar-new-entry {
    margin-top: 26px;
    display: flex;
    align-items: center !important;
    height: 38px;
    min-height: 38px;
    box-sizing: border-box;
    padding: 0 43px 0 9px !important;
    line-height: 1;
    background-color: rgba(142, 148, 158, 0.24);
    border-color: transparent;
    transition: background-color 140ms ease;
  }

  #sidebar-new-entry .label {
    display: block;
    line-height: 1;
  }

  #sidebar-new-entry .new-writing-icon {
    display: block;
    align-self: center;
  }

  #sidebar-entry {
    margin-top: 8px;
    padding-right: 43px !important;
  }

  #sidebar-auth-status {
    margin: 6px 0 14px 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  #sidebar-auth-user {
    color: rgba(242, 242, 242, 0.78);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.25;
  }

  #sidebar-sign-out {
    border: 0;
    padding: 0;
    background: transparent;
    color: rgba(139, 201, 249, 0.92);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
  }

  #sidebar-sign-out:hover {
    color: #b7dcff;
  }

  #sidebar-writing-list {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 4px 0 0 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
    scrollbar-gutter: stable;
    white-space: normal;
  }

  #sidebar-writing-list::-webkit-scrollbar {
    width: 10px;
  }

  #sidebar-writing-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
  }

  #sidebar-writing-list::-webkit-scrollbar-track-piece:start {
    margin-top: 2px;
  }

  #sidebar-writing-list::-webkit-scrollbar-thumb {
    background: rgba(220, 220, 220, 0.55);
    border-radius: 8px;
  }

  #sidebar-utility-footer {
    flex: 0 0 auto;
    min-height: 34px;
    margin-top: 2px;
    padding-right: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .sidebar-writing-link {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    border: 0;
    background: transparent;
    color: rgba(242, 242, 242, 0.82);
    text-align: left;
    padding: 4px 6px;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.35;
    cursor: pointer;
    border-radius: 6px;
    white-space: normal;
    overflow-wrap: anywhere;
    user-select: none;
  }

  .sidebar-writing-link:hover {
    background: rgba(142, 148, 158, 0.16);
    color: #f2f2f2;
  }

  .sidebar-writing-link.is-active {
    background: rgba(142, 148, 158, 0.16);
    color: #f2f2f2;
  }

  .sidebar-writing-link-text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    user-select: text;
  }

  .sidebar-writing-link-deleted {
    color: rgba(242, 242, 242, 0.56);
  }

  .sidebar-writing-link-deleted:hover {
    color: rgba(242, 242, 242, 0.82);
  }

  .sidebar-writing-link-deleted .sidebar-writing-delete {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-writing-delete {
    flex: 0 0 auto;
    margin-left: auto;
    border: 0;
    padding: 0;
    background: transparent;
    color: rgba(242, 242, 242, 0.56);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease, color 120ms ease;
  }

  .sidebar-writing-link:hover .sidebar-writing-delete,
  .sidebar-writing-link.is-active .sidebar-writing-delete,
  .sidebar-writing-link:focus-within .sidebar-writing-delete {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-writing-delete:hover,
  .sidebar-writing-delete:focus-visible {
    color: #f2f2f2;
    outline: none;
  }

  .sidebar-writing-restore {
    font-size: 12px;
    line-height: 1.2;
    padding: 2px 0;
    color: rgba(242, 242, 242, 0.72);
  }

  .sidebar-writing-nav {
    width: 100%;
    box-sizing: border-box;
    margin-top: 0;
    border: 0;
    background: transparent;
    color: #7a2a30;
    padding: 0 6px;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 18px;
    line-height: 1;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.8ch;
    position: relative;
    top: 0;
  }

  .sidebar-writing-nav:hover,
  .sidebar-writing-nav:focus-visible {
    color: #9f3a41;
    outline: none;
  }

  #sidebar-entry .caret {
    font-size: 24px;
    line-height: 1;
    margin-left: 0.45ch;
    color: currentColor;
    transform: translateY(-1px);
  }

  #sidebar-entry {
    color: #fbfbfb;
  }

  #sidebar-entry:hover {
    color: rgba(242, 242, 242, 0.82);
  }

  #sidebar-panel #sidebar-new-entry:hover,
  #sidebar-panel #sidebar-new-entry:focus-visible {
    background-color: rgba(42, 47, 54, 0.82);
  }

  #sidebar-entry:hover {
    background: transparent;
    border-color: transparent;
  }

  #menu-toggle {
    border: 0;
    background: transparent;
    color: var(--topbar-text);
    min-width: 0;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 0 10px;
    border-radius: 7px;
  }

  #menu-toggle:hover {
    background: #1a1a1a;
  }

  #menu-toggle .menu-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    opacity: 0.95;
  }

  #menu-dropdown {
    position: absolute;
    top: 34px;
    right: 0;
    min-width: 84px;
    border: 1px solid rgba(119, 123, 136, 0.65);
    border-radius: 8px;
    background: #3a3d43;
    padding: 4px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  }

  #menu-dropdown:empty {
    display: none;
  }

  #menu-dropdown button {
    width: 100%;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--topbar-text);
    text-align: center;
    padding: 7px 9px;
    font-family: "Courier New", Courier, monospace;
    font-size: 14px;
    cursor: pointer;
  }

  #menu-dropdown button:hover {
    background: rgba(93, 138, 197, 0.22);
  }

  #menu-dropdown button:disabled {
    opacity: 0.45;
    cursor: default;
  }

  #menu-dropdown button:disabled:hover {
    background: transparent;
  }
  
  #theme-toggle-button {
    background-color: var(--topbar-button-bg);
    color: var(--topbar-button-text);
    border: 1px solid rgba(69, 70, 71, 0.8);
    border-radius: 15px;
    padding: 3px 6px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: -9px;
    margin-left: -3px;
  }
  
  #theme-toggle-button:hover {
    background-color: var(--topbar-button-hover-bg);
  }
  
  /* -------------------------
     Three-Section Layout
     ------------------------- */
  #app {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-height));
    margin: 0;
    margin-top: var(--topbar-height);
    padding-top: 0;
  }

  body.sidebar-open #app {
    width: calc(100% - var(--sidebar-layout-width));
    margin-left: var(--sidebar-layout-width);
  }

  #app.compose-mode,
  #app.compose-mode #upper-container,
  #app.compose-mode #upper-container .compose-shell,
  #app.compose-mode #upper-container .compose-center {
    background-color: var(--surface-reading-bg);
  }

  #app #upper-container,
  #app #lower-container,
  #app .explanation-panel,
  #app .corrections-list {
    transition: flex-basis 220ms ease, margin-bottom 220ms ease;
  }

  #app.compose-mode #upper-container {
    flex: 1 1 auto;
    min-height: 100vh;
    color: rgba(247, 247, 247, 0.78);
    white-space: normal;
  }

#app.compose-mode #upper-scroll-content {
  min-height: 100%;
  padding: 92px 24px 40px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background-color: var(--surface-reading-bg);
  white-space: normal;
}

#app.compose-mode #upper-container .compose-shell {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  min-height: auto;
  margin: 0 auto;
}

.compose-center {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  min-height: auto;
  margin-top: 12px;
}

  .compose-center .compose-card {
    align-self: flex-start;
  }

  #app.compose-mode #lower-container {
    display: none;
  }
  
  #upper-container {
    flex: 0 0 auto;
    flex: 0 0 42vh;
    position: relative;
    background: var(--surface-upper-bg);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 22px;
    line-height: 1.5;
    box-sizing: border-box;
    overflow: hidden;
    white-space: pre-line;
    color: rgba(247, 247, 247, 0.78);
  }

  #lower-toggle {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    z-index: 20;
  }

  #upper-scroll-content {
    height: 100%;
    padding: 24px calc(var(--panel-content-gutter-x) + 4px) 44px calc(var(--panel-content-gutter-x) + 4px);
    box-sizing: border-box;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    overflow-anchor: none;
    white-space: inherit;
    color: inherit;
  }

#upper-container.full-writing-corrected {
    background: #000000;
}

  #upper-container.full-writing-source {
    background: var(--surface-reading-bg);
  }

  #upper-container.full-writing-corrected #upper-scroll-content,
  #upper-container.full-writing-source #upper-scroll-content,
  #upper-container.ocr-edit-mode #upper-scroll-content {
    -webkit-mask-image:
      linear-gradient(
        to bottom,
        #000 0%,
        #000 88%,
        transparent 100%
      ),
      linear-gradient(#000, #000);
    mask-image:
      linear-gradient(
        to bottom,
        #000 0%,
        #000 88%,
        transparent 100%
      ),
      linear-gradient(#000, #000);
    -webkit-mask-size: calc(100% - 10px) 100%, 10px 100%;
    mask-size: calc(100% - 10px) 100%, 10px 100%;
    -webkit-mask-position: left top, right top;
    mask-position: left top, right top;
    -webkit-mask-repeat: no-repeat, no-repeat;
    mask-repeat: no-repeat, no-repeat;
  }

  #upper-container.full-writing-corrected::after,
  #upper-container.full-writing-source::after,
  #upper-container.ocr-edit-mode::after {
    content: none;
  }

#upper-scroll-content::-webkit-scrollbar {
  width: 10px;
}

#upper-scroll-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

#upper-scroll-content::-webkit-scrollbar-track-piece:start {
  margin-top: 2px;
}

#upper-scroll-content::-webkit-scrollbar-thumb {
  background: rgba(220, 220, 220, 0.55);
  border-radius: 8px;
}

  #upper-container.ocr-edit-mode {
    white-space: pre-wrap;
  }

  #upper-container.ocr-edit-mode #upper-scroll-content {
    padding: 24px calc(var(--panel-content-gutter-x) + 4px) 12px calc(var(--panel-content-gutter-x) + 4px);
  }

  #app.auth-mode {
    min-height: calc(100vh - var(--topbar-height));
    background: var(--surface-reading-bg);
  }

  #app.auth-mode #upper-container,
  #app.auth-mode .explanation-panel {
    flex: 1 1 auto;
    min-height: calc(100vh - var(--topbar-height));
    background: var(--surface-reading-bg);
    padding: 0;
  }

  #app.auth-mode #upper-scroll-content,
  #app.auth-mode .explanation-panel #upper-scroll-content {
    min-height: calc(100vh - var(--topbar-height));
    padding: 0;
    overflow-y: auto;
  }

  #app.auth-mode #lower-container,
  #app.auth-mode .corrections-list {
    display: none;
  }

  #upper-container.auth-screen #upper-scroll-content {
    white-space: normal;
  }

  .auth-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(247, 247, 247, 0.86);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
  }

  .compose-wordmark {
    display: inline-block;
    white-space: nowrap;
    margin: 0 auto 26px auto;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 23px;
    line-height: 1;
    letter-spacing: 0.08em;
    pointer-events: none;
  }

  .compose-wordmark-part {
    display: inline;
    text-transform: none;
    line-height: 1;
    background: linear-gradient(to top, rgba(150, 150, 150, 0.92) 0%, rgba(245, 245, 245, 0.98) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .compose-wordmark-hw {
    font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
    letter-spacing: 0.02em;
  }

  .compose-wordmark-hw,
  .compose-wordmark-h,
  .compose-wordmark-r,
  .compose-wordmark-o,
  .compose-wordmark-gap {
    color: transparent;
  }

  .compose-wordmark-hw-shift {
    position: relative;
    left: 3px;
  }

  .compose-wordmark-h {
    margin-right: -4px;
  }

  .compose-wordmark-o {
    display: inline-block;
    overflow: visible;
    margin-left: -6px;
  }

  .compose-wordmark-r {
    margin-left: -3px;
  }

  .compose-wordmark-gap {
    display: inline-block;
    width: 0px;
  }

  .compose-wordmark-lower {
    text-transform: lowercase;
  }

  .compose-wordmark-e {
    display: inline-block;
    position: relative;
    width: 16px;
    height: 14px;
    margin: 0 0;
    vertical-align: baseline;
    line-height: 0;
    font-size: 0;
  }

  .compose-wordmark-e .line {
    display: block;
    position: absolute;
    left: 0;
    width: 16px;
    height: 2px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 2px;
    border-bottom-right-radius: 2px;
    background: currentColor;
    opacity: 0.95;
  }

  .compose-wordmark-e .line:first-child {
    top: 0;
  }

  .compose-wordmark-e .line.middle {
    width: 12px;
    top: 6px;
    background: #cb4a55;
  }

  .compose-wordmark-e .line:last-child {
    top: 12px;
    height: 2.5px;
    background: rgba(247, 247, 247, 0.45);
  }

  .auth-title-part {
    display: inline-block;
  }

  .auth-title-e {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2px;
    width: 13px;
    height: 14px;
    margin: 0 1px;
    transform: translateY(1px);
  }

  .auth-title-e .line {
    display: block;
    width: 13px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    opacity: 0.95;
  }

  .auth-title-e .line.middle {
    width: 9px;
  }

  .auth-shell {
    min-height: calc(100vh - var(--topbar-height));
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 82px 24px 40px;
    box-sizing: border-box;
    background: var(--surface-reading-bg);
  }

  .auth-card {
    width: min(560px, 100%);
    padding: 26px 26px 30px;
    background: transparent;
    border-top: 3px solid rgba(247, 247, 247, 0.74);
    color: rgba(247, 247, 247, 0.92);
    box-sizing: border-box;
  }

  .auth-heading {
    margin: 0 0 10px 0;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 33px;
    line-height: 1.05;
    font-weight: 600;
    color: #f7f7f7;
  }

  .auth-subheading {
    margin: 0 0 26px 0;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.5;
    color: rgba(247, 247, 247, 0.62);
  }

  .auth-form {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
  }

  .auth-field-label {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.2;
    color: rgba(247, 247, 247, 0.58);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .auth-password-shell {
    position: relative;
  }

  .auth-password {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 52px 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(247, 247, 247, 0.96);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 18px;
    line-height: 1.2;
    outline: none;
  }

  .auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    border: 0;
    padding: 0;
    background: transparent;
    color: rgba(247, 247, 247, 0.72);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
  }

  .auth-password-toggle:hover {
    color: rgba(247, 247, 247, 0.92);
  }

  .auth-select-shell {
    position: relative;
  }

  .auth-select-button {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 52px 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(247, 247, 247, 0.96);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 18px;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
  }

  .auth-select-button-text {
    display: block;
  }

  .auth-select-caret {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-55%);
    color: rgba(247, 247, 247, 0.72);
    font-size: 18px;
    line-height: 1;
    pointer-events: none;
  }

  .auth-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgb(74, 74, 74);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
    z-index: 5;
  }

  .auth-select-option {
    width: 100%;
    border: 0;
    border-radius: 6px;
    padding: 12px 12px;
    background: transparent;
    color: rgba(247, 247, 247, 0.96);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
  }

  .auth-select-option:hover {
    background: rgba(255, 255, 255, 0.09);
  }

  .auth-select-button:focus,
  .auth-password:focus {
    border-color: rgba(139, 201, 249, 0.72);
    box-shadow: 0 0 0 1px rgba(139, 201, 249, 0.28);
  }

  .auth-error {
    min-height: 20px;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.35;
    color: #e27f8d;
  }

  .auth-options {
    display: grid;
    gap: 14px;
  }

  .auth-user-option {
    width: 100%;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(247, 247, 247, 0.96);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 21px;
    line-height: 1.2;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
  }

  .auth-user-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
  }

  .ocr-edit-wrapper {
    display: block;
    inline-size: min(var(--reading-frame-width), 100%);
    max-inline-size: min(var(--reading-frame-width), 100%);
    margin: 0 auto;
    box-sizing: border-box;
    background: #1A1A1A;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  }

  .ocr-edit-toolbar {
    min-height: 36px;
    padding: 6px 10px 0 10px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 8px;
    position: relative;
  }

  .ocr-close-button {
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.10);
    color: #f3f3f3;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 15px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    left: 50%;
    top: 6px;
    transform: translateX(-50%);
  }

  .ocr-close-button:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .ocr-save-button {
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    color: #f3f3f3;
    border-radius: 7px;
    padding: 7px 14px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
  }

  .ocr-save-button:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .ocr-save-button.saved {
    border-color: rgba(255, 255, 255, 0.22);
    color: #f3f3f3;
  }

  .ocr-save-button[hidden] {
    display: none;
  }

  .ocr-edit-content {
    padding: 0 0 12px 0;
  }

  .source-editor-wrapper {
    position: relative;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
  }

  .source-editor-toolbar {
    position: absolute;
    top: 2px;
    right: 6px;
    left: auto;
    min-height: 0;
    padding: 0;
    z-index: 2;
    pointer-events: none;
  }

  .source-editor-toolbar .ocr-save-button {
    pointer-events: auto;
  }

  .source-editor-instruction {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 6px 2px 6px;
    color: rgba(247, 247, 247, 0.52);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.35;
    user-select: none;
  }

  .source-editor-emoji {
    opacity: 1;
    filter: none;
    color: initial;
  }

  .source-editor-content {
    padding: 0 0 6px 0;
  }

  .source-editor-content,
  .ocr-edit-line-text {
    font-size: 18px;
    line-height: 1.35;
  }

  .source-editor-content .ocr-edit-line {
    padding: 0.01rem 1rem 0.01rem calc(var(--panel-content-gutter-x) + 4px);
  }

  .source-editor-content .source-editor-sentence-number {
    left: calc(var(--panel-content-gutter-x) - 3.25ch);
    top: 0.01rem;
  }

  .full-writing-wrapper {
    display: block;
    inline-size: min(var(--reading-frame-width), 100%);
    max-inline-size: min(var(--reading-frame-width), 100%);
    margin: 0 auto;
    box-sizing: border-box;
    min-height: 100%;
    padding: 0;
  }

  .full-writing-save-button {
    position: static;
  }

  .ocr-save-button {
    background: #111111;
  }

  .ocr-save-button:hover {
    background: #1a1a1a;
  }

  .full-writing-content {
    white-space: pre-wrap;
    color: rgba(247, 247, 247, 0.86);
    font-size: 22px;
    line-height: 1.55;
    user-select: text;
    cursor: text;
    padding: 14px 0 16px 0;
  }

  .improved-text-intro-status-view {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 240px;
    padding-top: 28px;
  }

  .improved-text-intro-status-shell {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 3.2em;
  }

  .improved-text-intro-status-message {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 180ms ease, transform 180ms ease;
    color: rgba(247, 247, 247, 0.92);
    font-size: 0.92em;
    line-height: 1.2;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .improved-text-intro-status-message.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .improved-text-intro-status-message.is-error {
    color: #ffb4a8;
  }

  .content-card {
    position: relative;
    margin: 0;
  }

  .section-scroll-anchor {
    position: absolute;
    top: 37px;
    left: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
    opacity: 0;
  }

  .content-card__header {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 94px 4px 94px;
  }

  .content-card--lower > .content-card__header {
    padding: 0 14px 4px 14px;
  }

  .content-card__divider {
    width: 100%;
    margin-top: 9px;
    border-top: 3px solid var(--section-separator-color);
  }

  .page-status-summary {
    position: relative;
    left: auto;
    width: 100%;
    max-width: none;
    margin: var(--terminal-card-gap) 0 0 0;
    border: 0;
    border-radius: 0;
    background: rgba(139, 201, 249, 0.055);
    color: rgba(247, 247, 247, 0.76);
    font-family: "Courier New", Courier, monospace;
    font-size: 19px;
    line-height: 1.5;
    box-sizing: border-box;
    transform: none;
  }

  .page-status-summary__toggle {
    position: relative;
    min-height: 66px;
    padding: 18px 52px 18px 24px;
    box-sizing: border-box;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
  }

  .page-status-summary__current {
    font-weight: 700;
  }

  .page-status-summary__toggle::-webkit-details-marker {
    display: none;
  }

  .page-status-summary__toggle::after {
    content: "+";
    position: absolute;
    top: 15px;
    right: 24px;
    color: rgba(247, 247, 247, 0.42);
    font-size: 22px;
  }

  .page-status-summary[open] > .page-status-summary__toggle::after {
    content: "−";
  }

  .page-status-summary__current.is-error,
  .page-status-summary__item.is-error {
    color: rgba(255, 147, 147, 0.92);
  }

  .page-status-summary__current.is-completed,
  .page-status-summary__item.is-completed {
    color: rgba(184, 220, 190, 0.82);
  }

  .page-status-summary__history {
    max-height: 16rem;
    margin: 0;
    padding: 12px 28px 18px 48px;
    overflow: auto;
    border: 0;
  }

  .page-status-summary__item + .page-status-summary__item {
    margin-top: 5px;
  }

  .content-card__header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    margin-top: 8px;
  }

  .content-card__header-actions > .content-card__label {
    grid-column: 2;
    justify-self: center;
  }

  .content-card__header-actions > .content-card__toggle {
    grid-column: 3;
    justify-self: end;
  }

  .content-card__toggle.was-clicked {
    background: rgba(139, 201, 249, 0.22);
    color: var(--text-color);
  }

  .content-card__header > .content-card__label--corrected,
  .content-card__header > .content-card__label--source,
  .content-card__header > .content-card__label--source-image {
    position: static;
    width: 100%;
    margin: 0;
    padding-bottom: 0;
    text-align: center;
    box-sizing: border-box;
  }

  .content-card__body {
    position: relative;
    padding: 0 0 16px 0;
  }

  .terminal-pending-source-text {
    padding: 14px 1rem 16px calc(var(--panel-content-gutter-x) + 4px);
    color: rgba(var(--text-color-rgb), 0.82);
    font-family: "Courier New", Courier, monospace;
    font-size: 18px;
    line-height: 1.35;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .content-card.is-condensed .content-card__body {
    max-height: 40px;
    overflow: hidden;
    padding-bottom: 18px;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
  }

  .content-card.is-condensed .content-card__body::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: 44px;
    background: linear-gradient(to top, var(--surface-reading-bg) 0%, rgba(10, 10, 10, 0.12) 42%, rgba(10, 10, 10, 0) 100%);
    pointer-events: none;
  }

  .content-card--corrected.is-condensed .content-card__body::after {
    background: linear-gradient(to top, var(--surface-reading-bg) 0%, rgba(10, 10, 10, 0.28) 44%, rgba(10, 10, 10, 0) 100%);
  }

  .content-card--source-image.is-condensed .content-card__body {
    display: none;
    max-height: 0;
    padding: 0;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .content-card--source-image.is-condensed .content-card__body::after {
    display: none;
  }

  .content-card--practice-view.is-condensed .content-card__body,
  .content-card--correction-report.is-condensed .content-card__body {
    display: none;
    max-height: 0;
    padding: 0;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .content-card--practice-view.is-condensed .content-card__body::after,
  .content-card--correction-report.is-condensed .content-card__body::after {
    display: none;
  }

  .content-card .content-card__toggle {
    min-width: 88px;
    height: 28px;
    margin: 0;
    text-align: center;
    white-space: nowrap;
    border: 0;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(var(--text-color-rgb), 0.84);
    border-radius: 999px;
    padding: 0 14px;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    line-height: 28px;
    cursor: pointer;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.18);
  }

  .content-card .content-card__toggle:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .full-writing-content.corrected-view {
    background: transparent;
    color: inherit;
    padding-bottom: 108px;
  }

  .student-report-card {
    margin: 0 1rem 28px calc(var(--panel-content-gutter-x) + 4px);
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
    color: rgba(var(--text-color-rgb), 0.9);
    font-size: 18px;
    line-height: 1.45;
    white-space: normal;
  }

  .student-report-card-title {
    margin: 0 0 0.85em 0;
    color: rgba(var(--text-color-rgb), 0.72);
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .student-report-card h3 {
    margin: 0 0 0.6em 0;
    color: rgba(var(--text-color-rgb), 0.96);
    font-size: 1.08em;
    line-height: 1.25;
  }

  .student-report-card p {
    margin: 0 0 0.85em 0;
  }

  .student-report-card p:last-child,
  .student-report-card blockquote:last-child,
  .student-report-card ul:last-child {
    margin-bottom: 0;
  }

  .student-report-card blockquote {
    margin: 0 0 0.9em 0;
    padding: 0.48em 0 0.48em 0.9em;
    border-left: 3px solid rgba(var(--text-color-rgb), 0.32);
    color: rgba(var(--text-color-rgb), 0.96);
  }

  .student-report-card ul {
    margin: 0 0 0.9em 1.1em;
    padding: 0;
  }

  .student-report-card li {
    margin: 0.25em 0;
  }

  .content-card__body--student-feedback,
  .content-card__body--student-error-diagnostics {
    padding: 16px 14px 24px;
    color: rgba(var(--text-color-rgb), 0.9);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 18px;
    line-height: 1.45;
    white-space: normal;
  }

  .student-error-diagnostics__sentences {
    margin-left: 1.1em;
  }

  .student-error-diagnostics__sentence + .student-error-diagnostics__sentence {
    margin-top: 1.25em;
  }

  .student-error-diagnostics__traces {
    margin-top: 0.65em;
  }

  .student-error-diagnostics__trace + .student-error-diagnostics__trace {
    margin-top: 0.85em;
  }

  .student-error-diagnostics__trace {
    list-style: none;
  }

  .student-error-diagnostics__mapping {
    color: #f2b36f;
  }

  .content-card__body--student-feedback h1,
  .content-card__body--student-feedback h2,
  .content-card__body--student-feedback h3,
  .content-card__body--student-error-diagnostics h1,
  .content-card__body--student-error-diagnostics h2,
  .content-card__body--student-error-diagnostics h3 {
    margin: 0 0 0.6em;
    color: rgba(var(--text-color-rgb), 0.96);
    line-height: 1.25;
  }

  .content-card__body--student-feedback h1,
  .content-card__body--student-error-diagnostics h1 {
    font-size: 1.45em;
  }

  .content-card__body--student-feedback h2,
  .content-card__body--student-error-diagnostics h2 {
    font-size: 1.28em;
  }

  .content-card__body--student-feedback h3,
  .content-card__body--student-error-diagnostics h3 {
    font-size: 1.12em;
  }

  .content-card__body--student-feedback p,
  .content-card__body--student-error-diagnostics p {
    margin: 0 0 0.85em;
  }

  .content-card__body--student-feedback p:last-child,
  .content-card__body--student-feedback blockquote:last-child,
  .content-card__body--student-feedback ul:last-child,
  .content-card__body--student-error-diagnostics p:last-child,
  .content-card__body--student-error-diagnostics blockquote:last-child,
  .content-card__body--student-error-diagnostics ul:last-child {
    margin-bottom: 0;
  }

  .content-card__body--student-feedback blockquote,
  .content-card__body--student-error-diagnostics blockquote {
    margin: 0 0 0.9em;
    padding: 0.48em 0 0.48em 0.9em;
    border-left: 3px solid rgba(var(--text-color-rgb), 0.32);
  }

  .content-card__body--student-feedback ul,
  .content-card__body--student-error-diagnostics ul {
    margin: 0 0 0.9em 1.1em;
    padding: 0;
  }

  .content-card__body--student-feedback li > ul,
  .content-card__body--student-error-diagnostics li > ul {
    margin: 0.35em 0 0.9em 1.45em;
  }

  .content-card__body--student-feedback li > ul > li,
  .content-card__body--student-error-diagnostics li > ul > li {
    padding-left: 0.2em;
  }

  .content-card__body--student-feedback > div > ul > li + li,
  .content-card__body--student-error-diagnostics > div > ul > li + li {
    margin-top: 0.5em;
  }

  .content-card__body--student-feedback
    .markdown-list-item--quoted-lead
    > .highlighted-word:first-child,
  .content-card__body--student-error-diagnostics
    .markdown-list-item--quoted-lead
    > .highlighted-word:first-child {
    color: #f2b36f;
  }

  .content-card__label--corrected {
    margin: 0 0 0.85em 0;
    text-align: center;
    color: rgba(247, 247, 247, 0.62);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.3;
    user-select: none;
  }

  .content-card__label--source,
  .content-card__label--source-image {
    margin: 0;
    text-align: center;
    color: rgba(247, 247, 247, 0.62);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.3;
    user-select: none;
  }

  .content-card__divider--source,
  .content-card__divider--source-image {
    border-top: 3px solid var(--section-separator-color);
  }

  .content-card__divider--corrected {
    border-top: 3px solid var(--section-separator-color);
  }

  .full-writing-source-embed {
    color: rgba(var(--text-color-rgb), 0.82);
  }

  .full-writing-source-image-shell {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 0 18px;
  }

  .full-writing-source-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
  }

  .full-writing-correction-label {
    margin: 0.45em 0 0.45em 0;
    color: rgba(var(--text-color-rgb), 0.72);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.3;
    text-align: center;
    user-select: none;
  }

  .full-writing-correction-embed {
    margin-top: 0;
    min-height: 0;
    padding-top: 0.35em;
    padding-bottom: 12px;
  }

  .full-writing-correction-embed > .correction-history-entry,
  .full-writing-correction-embed > .correction-error-response {
    margin-top: 0;
  }

  .paragraph-spacer-sentence {
    pointer-events: none;
    user-select: none;
  }

  .paragraph-spacer-line {
    visibility: hidden;
  }

  .correction-working {
    display: block;
    min-height: 32px;
    margin-top: 18px;
    color: rgba(var(--text-color-rgb), 0.44);
    font-size: 18px;
    line-height: 1.4;
    user-select: none;
  }

  .correction-working-text {
    display: inline-block;
    color: rgba(var(--text-color-rgb), 0.34);
    background: linear-gradient(
      90deg,
      rgba(var(--text-color-rgb), 0.26) 0%,
      rgba(var(--text-color-rgb), 0.32) 22%,
      rgba(var(--text-color-rgb), 0.9) 50%,
      rgba(var(--text-color-rgb), 0.32) 78%,
      rgba(var(--text-color-rgb), 0.26) 100%
    );
    background-size: 220% 100%;
    background-position: 100% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: correction-working-wave 2.05s linear infinite;
  }

  .correction-error-response {
    margin-top: 18px;
  }

  @keyframes correction-working-wave {
    0% {
      background-position: 100% 50%;
    }
    70.73% {
      background-position: -100% 50%;
    }
    100% {
      background-position: -100% 50%;
    }
  }

  .full-writing-content.source-view {
    background: transparent;
    padding: 0;
  }

  .compose-card {
    display: flex;
    flex-direction: column;
    width: min(1040px, calc(100% - 24px));
    margin: 0 auto;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  .compose-mobile-upload-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: 8px 0 80px 0;
  }

  .compose-mobile-upload-button {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(247, 247, 247, 0.94);
    border-radius: 999px;
    padding: 12px 20px;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.2;
    cursor: pointer;
  }

  .compose-mobile-upload-button:hover {
    background: rgba(255, 255, 255, 0.09);
  }

  .compose-mobile-upload-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    align-self: stretch;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .compose-mobile-upload-panel-status {
    min-height: 1.25em;
    color: rgba(247, 247, 247, 0.74);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.25;
    text-align: center;
  }

  .compose-mobile-upload-qr {
    width: min(100%, 240px);
    height: auto;
    display: block;
    border: 0;
    border-radius: 0;
    outline: 0;
    box-shadow: none;
    background: transparent;
  }

  .compose-mobile-upload-image {
    width: 100%;
    max-height: calc(100vh - 220px);
    align-self: stretch;
    display: block;
    object-fit: contain;
    background: transparent;
    user-select: none;
  }

  .compose-mobile-upload-preview {
    position: relative;
    width: 100%;
    align-self: stretch;
    margin-top: 8px;
    touch-action: none;
  }

  .compose-mobile-upload-crop {
    position: relative;
    overflow: hidden;
    width: 100%;
    align-self: stretch;
  }

  .compose-mobile-marker-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
    flex-wrap: nowrap;
  }

  .compose-mobile-marker-button {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(247, 247, 247, 0.94);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
  }

  .compose-mobile-marker-button:hover,
  .compose-mobile-marker-button.is-active {
    background: rgba(255, 255, 255, 0.18);
    filter: brightness(1.08);
  }

  .compose-mobile-marker-button:disabled {
    opacity: 0.42;
    cursor: default;
  }

  .compose-mobile-marker-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #000000;
    display: block;
  }

  .compose-mobile-marker-instruction {
    color: rgba(247, 247, 247, 0.78);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.25;
    margin: 0 2px;
  }

  .compose-mobile-upload-layout-overlay {
    position: absolute;
    pointer-events: none;
  }

  .compose-mobile-marker-overlay {
    position: absolute;
    pointer-events: none;
  }

  .compose-mobile-marker-mark {
    position: absolute;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #000000;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
  }

  .compose-mobile-layout-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
  }

  .compose-mobile-layout-polygon {
    fill: rgba(88, 214, 141, 0.08);
    stroke: rgba(88, 214, 141, 0.96);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
  }

  .compose-mobile-layout-box {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.78);
    border-radius: 3px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.04);
  }

  .compose-mobile-layout-box.essay {
    border-color: rgba(88, 214, 141, 0.96);
    background: rgba(88, 214, 141, 0.08);
  }

  .compose-mobile-layout-box.name {
    border-color: rgba(255, 214, 102, 0.96);
    background: rgba(255, 214, 102, 0.1);
  }

  .compose-mobile-layout-box.title {
    border-color: rgba(91, 192, 235, 0.96);
    background: rgba(91, 192, 235, 0.1);
  }

  .compose-mobile-layout-box.page,
  .compose-mobile-layout-box.ignored {
    border-color: rgba(234, 139, 151, 0.78);
    background: rgba(234, 139, 151, 0.08);
  }

  .compose-mobile-layout-label {
    position: absolute;
    left: -2px;
    top: -24px;
    max-width: 160px;
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(18, 18, 18, 0.92);
    color: rgba(247, 247, 247, 0.94);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .compose-mobile-upload-ocr-review {
    width: 100%;
    min-height: 180px;
    max-height: 320px;
    align-self: stretch;
    box-sizing: border-box;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(18, 18, 18, 0.78);
    color: rgba(247, 247, 247, 0.94);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    resize: vertical;
    outline: none;
  }

  .compose-mobile-upload-ocr-review:focus {
    border-color: rgba(139, 201, 249, 0.72);
    box-shadow: 0 0 0 3px rgba(139, 201, 249, 0.12);
  }

  .compose-mobile-upload-spelling-errors {
    margin: 10px 0 2px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.05);
    font-size: 13px;
    line-height: 1.45;
  }

  .compose-mobile-upload-spelling-title {
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .compose-mobile-upload-spelling-item {
    overflow-wrap: anywhere;
  }

  .compose-mobile-upload-batch {
    width: 100%;
    align-self: stretch;
    margin-top: 10px;
  }

  .compose-mobile-upload-batch-list {
    display: grid;
    gap: 10px;
  }

  .compose-mobile-upload-batch-item {
    display: grid;
    grid-template-columns: auto 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
  }

  .compose-mobile-upload-batch-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #8bc9f9;
  }

  .compose-mobile-upload-batch-image {
    display: block;
    width: 72px;
    height: 88px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
  }

  .compose-mobile-upload-batch-details {
    min-width: 0;
  }

  .compose-mobile-upload-batch-name {
    overflow: hidden;
    color: rgba(247, 247, 247, 0.94);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .compose-mobile-upload-batch-status {
    margin-top: 4px;
    color: rgba(247, 247, 247, 0.62);
    font-size: 12px;
  }

  .compose-mobile-upload-batch-remove {
    border: 0;
    background: transparent;
    color: #ea8b97;
    cursor: pointer;
    font-size: 13px;
  }

  .compose-mobile-upload-batch-remove:disabled {
    cursor: default;
    opacity: 0.45;
  }

  .compose-mobile-upload-action-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    align-self: stretch;
    margin-top: 18px;
  }

  .compose-mobile-upload-error {
    width: 100%;
    align-self: stretch;
    margin-top: 14px;
    text-align: center;
    color: #ea8b97;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
  }

  .compose-mobile-upload-processing {
    display: none;
    width: 100%;
    margin-top: 18px;
    text-align: center;
    user-select: none;
  }

  .compose-mobile-upload-processing-text {
    display: inline-block;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 32px;
    line-height: 1.1;
    font-weight: 600;
    background: linear-gradient(
      90deg,
      rgba(247, 247, 247, 0.22) 0%,
      rgba(247, 247, 247, 0.3) 22%,
      rgba(255, 255, 255, 0.92) 50%,
      rgba(247, 247, 247, 0.3) 78%,
      rgba(247, 247, 247, 0.22) 100%
    );
    background-size: 220% 100%;
    background-position: 100% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: correction-working-wave 2.05s linear infinite;
  }

  .compose-content {
    flex: 0 0 auto;
    padding-top: 0;
    padding-right: 0;
    padding-bottom: 0;
    padding-left: 0;
  }

  .compose-input-shell {
    position: relative;
    width: 100%;
    background: #262626;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.02);
    overflow: hidden;
  }

  .compose-input-shell .compose-upload-button {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
  }

  .compose-input-shell .compose-submit-button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    border: 0;
    background: #824dea;
    box-shadow: none;
    transition: background 140ms ease, opacity 140ms ease;
  }

  .compose-input-shell .compose-submit-button:hover {
    background: #6f42da;
  }

  .compose-input-shell .compose-submit-button::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(0, 0, 0, 0);
    transition: background 140ms ease;
    pointer-events: none;
  }

  .compose-input-shell .compose-submit-button:hover::after {
    background: rgba(0, 0, 0, 0.28);
  }

  .compose-input-footer {
    display: none;
  }

  .compose-input-shell.has-scroll-footer {
    padding-bottom: 70px;
  }

  .compose-input-shell.has-scroll-footer .compose-input-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    padding: 0 12px 9px;
    background: inherit;
    z-index: 2;
  }

  .compose-input-shell.has-scroll-footer .compose-input {
    width: calc(100% - 10px);
    margin-right: 10px;
  }

  .compose-input-footer .compose-upload-button,
  .compose-input-footer .compose-submit-button {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    transform: none;
  }

  .compose-line-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
  }

  .compose-line-overlay-content {
    box-sizing: border-box;
  }

  .compose-line {
    width: 100%;
    border-radius: 2px;
    background: transparent;
  }

  #app.compose-mode #upper-container::-webkit-scrollbar {
    width: 10px;
  }

  #app.compose-mode #upper-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
  }

  #app.compose-mode #upper-container::-webkit-scrollbar-thumb {
    background: rgba(220, 220, 220, 0.55);
    border-radius: 8px;
  }

  .compose-submit-button,
  .compose-upload-button {
    border: 1px solid var(--send-button-border-color);
    background: rgba(255, 255, 255, 0.11);
    color: #f3f3f3;
    border-radius: 999px;
    width: 52px;
    height: 52px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.32);
    transition: opacity 140ms ease;
  }

  .compose-upload-button::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(0, 0, 0, 0);
    transition: background 140ms ease;
    pointer-events: none;
  }

  .compose-upload-button:hover::after {
    background: rgba(0, 0, 0, 0.16);
  }

  .compose-submit-icon-svg,
  .compose-upload-icon-svg {
    width: 28px;
    height: 28px;
    stroke: var(--send-button-color);
    stroke-width: 2.65;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: translateY(-0.5px);
    transition: opacity 140ms ease;
  }

  .compose-upload-icon-svg {
    width: 30px;
    height: 30px;
    stroke-width: 1.65;
    stroke: #8bc9f9;
  }

  .compose-submit-button:not(.is-ready):not(.is-loading)::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(139, 92, 246, 0.16);
    box-shadow: none;
    pointer-events: none;
  }

  .compose-submit-button.is-ready:not(.is-loading)::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(139, 92, 246, 0.08);
    box-shadow: none;
    pointer-events: none;
  }

  .compose-input-shell .compose-submit-button .compose-submit-icon-svg {
    stroke: #ffffff;
  }

  .compose-submit-button.is-loading .compose-submit-icon-svg {
    opacity: 0.55;
  }

  .compose-upload-button.is-loading .compose-upload-icon-svg {
    opacity: 0.55;
  }

  .compose-submit-button:disabled,
  .compose-upload-button:disabled {
    opacity: 0.65;
    cursor: default;
  }

  .compose-input {
    position: relative;
    z-index: 1;
    display: block;
    min-height: 76px;
    max-height: 320px;
    height: auto;
    width: 100%;
    padding: 22px 86px 18px 86px;
    box-sizing: border-box;
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1.45;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: rgba(245, 245, 245, 0.96);
    white-space: pre-wrap;
    outline: none;
    caret-color: #ffffff;
    resize: none;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-color: rgba(18, 18, 20, 0.98) #262626;
    scrollbar-width: thin;
  }

  .compose-input::-webkit-scrollbar {
    width: 10px;
  }

  .compose-input::-webkit-scrollbar-track {
    background: #262626;
  }

  .compose-input::-webkit-scrollbar-thumb {
    background: rgba(18, 18, 20, 0.98);
    border-radius: 8px;
    border: 2px solid #262626;
  }

  .compose-input-placeholder {
    position: absolute;
    left: 86px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: none;
    color: #ffffff;
    font-size: 24px;
    line-height: 1.45;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    opacity: 1;
  }

  .compose-input-placeholder[hidden] {
    display: none;
  }

  .ocr-edit-line {
    display: block;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 0 8px 0;
    padding: 0 0 0 3.25ch;
    border-radius: 6px;
  }

  .source-editor-sentence-number {
    position: absolute;
    left: 0;
    top: 0;
    min-width: 2.5ch;
    color: #777777;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9em;
    font-weight: 700;
    line-height: 1.35;
    pointer-events: none;
    user-select: none;
  }

  .ocr-edit-line:last-child {
    margin-bottom: 0;
  }

  .ocr-edit-line-text {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    border-radius: 6px;
    padding: 0;
    cursor: text;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    caret-color: #f5f5f5;
    outline: none;
  }

  .ocr-edit-line:hover {
    background: rgba(255, 255, 255, 0.06);
  }

  .ocr-edit-line:focus-within {
    background: rgba(255, 255, 255, 0.06);
  }

  .ocr-edit-line.edit-dirty {
    background: rgba(255, 255, 255, 0.06);
  }

  .ocr-edit-line-text .edited-fragment {
    color: #3a8fb8;
  }
  
#lower-container {
    position: relative;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    overflow-anchor: none;
    background-color: #000000;
}

#lower-container::-webkit-scrollbar {
  width: 10px;
}

#lower-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

#lower-container::-webkit-scrollbar-track-piece:start {
  margin-top: 2px;
}

#lower-container::-webkit-scrollbar-thumb {
  background: rgba(220, 220, 220, 0.55);
  border-radius: 8px;
}

#app:not(.upper-populated) #lower-toggle {
    display: none;
}

#lower-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 14px;
    border: 0;
    background: transparent;
    color: rgba(230, 230, 230, 0.72);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

#lower-toggle:hover {
    color: rgba(245, 245, 245, 0.88);
  }

#lower-toggle .chevron {
    width: 26px;
    height: 26px;
    display: block;
    stroke: currentColor;
    stroke-width: 2.4;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 180ms ease;
}

#lower-toggle.expanded .chevron {
    transform: rotate(180deg);
}

#lower-content {
    width: min(calc(var(--reading-frame-width) + var(--sentence-number-gutter)), 100%);
    max-width: min(calc(var(--reading-frame-width) + var(--sentence-number-gutter)), 100%);
    min-height: var(--terminal-viewport-height, 100%);
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-left: var(--sentence-number-gutter);
    padding-top: 8px;
    padding-bottom: var(--terminal-bottom-inset);
    background-color: var(--surface-reading-bg);
}

#lower-content > .content-card {
    flex: 0 0 auto;
}

#lower-content > .content-card + .content-card {
    margin-top: var(--terminal-card-gap);
}

  .content-card__label {
    margin: 0;
    text-align: center;
    color: rgba(247, 247, 247, 0.58);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.3;
    user-select: none;
    padding-top: 0;
    padding-bottom: 0;
    width: 100%;
    box-sizing: border-box;
  }

#app.upper-populated #upper-container,
#app.upper-populated .explanation-panel {
  flex-basis: calc(100% - 44px);
}

#app.upper-populated #lower-container,
#app.upper-populated .corrections-list {
  flex: 0 0 24px;
  margin-bottom: 20px;
}

#app.upper-populated.lower-expanded #upper-container,
#app.upper-populated.lower-expanded .explanation-panel {
  flex-basis: 42vh;
}

#app.upper-populated.lower-expanded #lower-container,
#app.upper-populated.lower-expanded .corrections-list {
  flex-basis: calc(58vh - 20px);
  margin-bottom: 0;
}

  /* -------------------------
     Sentence & Token Styles
     ------------------------- */
  .sentence-container {
    position: relative;
    --gap-final-to-annotated: 4px;
    --gap-annotated-to-final: 10px;
    padding-top: 5px;
    padding-bottom: 22px;
    margin-top: 18px;
  }

  .sentence-container.aligned-text-sentence {
    display: flex;
    flex-direction: column;
  }

  .content-card--correction-report .sentence-container.source-only-block,
  .content-card--correction-report .sentence-container.source-only-block .token,
  .content-card--correction-report .sentence-container.source-only-block .corrected-char {
    color: var(--source-only-color);
  }

  .content-card--correction-report .sentence-container.source-only-block .token {
    text-decoration: line-through;
    text-decoration-color: var(--replace-strike-thru-color);
    text-decoration-thickness: 0.9px;
  }
  
  .sentence-container .final-line,
  .sentence-container .annotated-line,
  .sentence-container .practice-line {
    display: block;
    position: relative;
    width: 100%;
    text-align: left;
    margin: 0;
    padding: 0.01rem 1rem 0.01rem calc(var(--panel-content-gutter-x) + 4px);
    line-height: 1;
    white-space: nowrap;
    overflow-wrap: break-word;
  }

  .source-sentence-number {
    position: absolute;
    left: calc(var(--panel-content-gutter-x) - 3.25ch);
    top: 0.01rem;
    min-width: 2.5ch;
    color: #777777;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.88em;
    font-weight: 700;
    pointer-events: none;
    user-select: none;
  }

  .practice-sentence-number {
    position: absolute;
    left: calc(var(--panel-content-gutter-x) - 3.25ch);
    top: 0.01rem;
    min-width: 2.5ch;
    color: rgba(var(--text-color-rgb), 0.58);
    font-family: "Courier New", Courier, monospace;
    font-size: 0.88em;
    font-weight: 700;
    pointer-events: none;
    user-select: none;
  }

  .sentence-container .final-line + .annotated-line {
    margin-top: var(--gap-final-to-annotated);
  }

  .sentence-container .annotated-line + .final-line {
    margin-top: var(--gap-annotated-to-final);
  }

  .content-card__body--default,
  .content-card__body--original-text,
  .content-card__body--minimal-revision,
  .content-card__body--practice-view,
  .content-card__body--correction-report {
    padding-left: 0;
    padding-right: 0;
    max-height: none;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .practice-sentence .practice-line + .practice-line {
    margin-top: 7px;
  }

  .worksheet-sentence .worksheet-line + .worksheet-line {
    margin-top: 12px;
  }

  .worksheet-blank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1ch;
    color: var(--correct-color);
    font-family: "Courier New", Courier, monospace;
    font-weight: 700;
    text-align: center;
    pointer-events: auto;
    position: relative;
    z-index: 5;
    cursor: pointer;
    vertical-align: top;
  }

  .worksheet-blank.is-active-blank {
    background-color: transparent;
    outline: none;
  }

  .worksheet-blank:focus,
  .worksheet-blank:focus-visible {
    outline: none;
    box-shadow: none;
  }

  .sentence-block {
    display: flow-root;
    width: 100%;
  }

  .sentence-block + .sentence-block:not(.is-riding) {
    margin-top: var(--gap-annotated-to-final);
  }

  .sentence-block.is-riding {
    margin-top: 0;
  }

  .sentence-block.is-riding:empty {
    display: none;
  }

  .sentence-block-final-row,
  .sentence-block-annotation-slot {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    width: 100%;
  }

  .sentence-block-annotation-slot {
    margin-top: var(--gap-final-to-annotated);
  }

  .sentence-block-final-row > .sentence-line,
  .sentence-block-annotation-slot > .sentence-line {
    grid-area: 1 / 1;
    margin: 0;
    pointer-events: none;
  }

  .sentence-split-divider {
    display: inline-block;
    width: 26em;
    height: 4.1em;
    max-width: 100%;
    margin: 2px 0 2px calc(var(--panel-content-gutter-x) - 23px);
    color: #b39afc;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 0.95em;
    line-height: 1;
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
    pointer-events: none;
  }

  .sentence-split-divider-label {
    fill: currentColor;
    stroke: none;
    font: inherit;
    font-size: 1.16em;
    font-weight: 500;
    text-anchor: middle;
    dominant-baseline: middle;
    white-space: nowrap;
    pointer-events: none;
  }

  .sentence-split-divider-svg {
    display: block;
    width: 70%;
    height: 4.1em;
  }

  .sentence-split-divider-bg {
    fill: #000000;
  }

  #lower-container .sentence-container.is-selected {
    background-color: var(--surface-reading-bg);
  }

.explanation-sentence-preview {
    margin: 0 0 18px 0;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 0;
    padding-right: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
    font-family: "Courier New", Courier, monospace;
    font-size: 18px;
    line-height: 1;
    background: #0a0a0a;
}

  .explanation-sentence-preview .sentence-container {
    pointer-events: none;
    background: transparent;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
  }

  .explanation-sentence-preview .final-line,
  .explanation-sentence-preview .annotated-line {
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    overflow: visible;
  }

  .explanation-sentence-preview .highlight-box {
    background-color: rgba(24, 24, 24, 0.92);
  }

  .explanation-sentence-preview .highlight-box.hovered {
    background-color: rgba(48, 48, 48, 0.98);
  }

  .explanation-sentence-preview .token,
  .explanation-sentence-preview .corrected-char {
    cursor: default;
    pointer-events: none;
  }

  .explanation-sentence-preview .token.equal {
    color: rgba(255, 255, 255, 0.98);
  }

  #app .explanation-sentence-preview
    .sentence-container.has-clicked-preview-correction
    .final-line .token:not(.is-clicked-preview-correction),
  #app .explanation-sentence-preview
    .sentence-container.has-clicked-preview-correction
    .annotated-line .corrected-char:not(.is-clicked-preview-correction) {
    color: rgba(255, 255, 255, 0.98);
  }

  .explanation-response {
    margin-top: 0.7em;
    color: rgba(247, 242, 232, 0.96);
    font-size: 18px;
    line-height: 1.35;
    white-space: pre-wrap;
  }

  .correction-history-entry > .explanation-response {
    padding: 12px 14px;
    border-radius: 6px;
    box-sizing: border-box;
    background-color: var(--sidebar-panel-bg);
  }

  .section-separator {
    display: block;
    width: 100%;
    height: 0;
    margin: 0.7em 0 0.55em 0;
    border-top: 3px solid var(--section-separator-color);
  }

  .correction-explanation-separator {
    margin: 0.45em 0 0.95em 0;
  }

  .korean-explanation-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin-top: 0.85em;
    padding: 0;
    border: 0;
    background: transparent;
    color: #cb4a55;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.2;
    cursor: pointer;
  }

  .korean-explanation-toggle-chevron {
    display: inline-block;
    transform: translateY(-1px);
    font-size: 18px;
    line-height: 1;
    transition: transform 160ms ease;
    color: #cb4a55;
  }

  .korean-explanation-toggle.is-open .korean-explanation-toggle-chevron {
    transform: translateY(-1px) rotate(90deg);
  }

  .korean-explanation-toggle-text {
    letter-spacing: 0.02em;
    color: #cb4a55;
  }

  .korean-explanation-response {
    margin-top: 0.5em;
  }
  
#lower-container .sentence-separator {
    position: absolute;
    bottom: var(--sentence-decoration-anchor-bottom, 0px);
    left: calc(var(--panel-content-gutter-x) + 4px);
    width: var(--sentence-decoration-width, calc(100% - (var(--panel-content-gutter-x) + 4px) - 10px));
    height: var(--sentence-gradient-height, 6px);
    box-sizing: border-box;
    border-top: var(--sentence-separator-thickness) solid var(--sentence-separator-color);
    background: linear-gradient(to bottom, rgba(144,141,139,0.065) 1%, transparent);
    pointer-events: none;
    z-index: 0;
  }

  .content-card__body--default > .sentence-container:last-child > .sentence-separator,
  .content-card__body--original-text > .sentence-container:last-child > .sentence-separator,
  .content-card__body--minimal-revision > .sentence-container:last-child > .sentence-separator,
  .content-card__body--practice-view > .sentence-container:last-child > .sentence-separator,
  .content-card__body--correction-report > .sentence-container:last-child > .sentence-separator {
    display: none;
  }

  #lower-container {
    font-size: 18px; /* Adjust this value as needed */
  }
  


#app .token[data-replacement-block-id],
#app .token[data-edit-span-id] {
    color: var(--replace-color);
    text-decoration: line-through;
    text-decoration-color: var(--replace-strike-thru-color); 
    text-decoration-thickness: 0.9px;
    
}

#app .token[data-replacement-block-id].no-strike,
#app .token[data-edit-span-id].no-strike {
    text-decoration: none;
}

#app .token[data-delete-block-id] {
    color: var(--delete-color);
    text-decoration: line-through; /* Optional, for strike-through effect */
    text-decoration-color: var(--replace-strike-thru-color);
    text-decoration-thickness: 0.9px;
}

#app .token[data-insert-block-id] {
    color: var(--insert-color);
}

.corrected-char {
    color: var(--correct-color); /* Change this if corrected text should have a different color */
}

  .content-card--original-text .source-original-token {
    color: rgba(var(--text-color-rgb), 0.82);
    text-decoration: none;
    pointer-events: none;
    cursor: default;
  }

  .content-card--original-text .source-incorrect-char {
    color: var(--source-incorrect-color);
  }

  .content-card--original-text .original-text-sentence {
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  .content-card--original-text .original-text-sentence + .original-text-sentence {
    margin-top: 0.45em;
  }

  .content-card--minimal-revision .practice-sentence {
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  .content-card--minimal-revision .practice-sentence + .practice-sentence {
    margin-top: 0.45em;
  }

  .intro-improved-token,
  .intro-original-token {
    pointer-events: none;
    cursor: default;
    transition: color 140ms ease, opacity 140ms ease;
    text-decoration: none !important;
  }

  .intro-improved-token[data-phase="scaffold"],
  .intro-original-token[data-phase="scaffold"] {
    color: rgba(var(--text-color-rgb), 0.82);
  }

  .intro-improved-token[data-phase="final"].intro-token-equal {
    color: rgba(var(--text-color-rgb), 0.82);
  }

  .intro-improved-token[data-phase="final"].intro-token-corrected {
    color: var(--correct-color);
  }

  .intro-improved-token[data-phase="final"].intro-token-insert {
    color: var(--insert-color);
  }

  .intro-improved-token[data-phase="final"].intro-token-delete,
  .intro-improved-token[data-phase="final"].intro-token-replace {
    color: var(--replace-color);
  }

  .intro-original-token[data-phase="final"].intro-original-token-equal {
    color: rgba(var(--text-color-rgb), 0.82);
  }

  .intro-original-token[data-phase="final"].intro-original-token-source-incorrect {
    color: var(--source-incorrect-color);
  }

  
  .token,
  .corrected-char {
    display: inline-block;
    width: 1ch;
    min-width: 1ch;
    text-align: center;
    pointer-events: auto;
    position: relative;
    z-index: 5;
    cursor: pointer;
    vertical-align: top;
  }
  
  .token.hovered,
  .corrected-char.hovered,
  .worksheet-blank.hovered {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  .correction-history-separator {
    display: none;
  }

  .full-writing-correction-embed > .correction-history-separator {
    display: block;
    width: 100%;
    height: 0;
    margin: 0.9em 0 0.45em 0;
    border-top: 3px solid var(--section-separator-color);
  }

  
  /* -------------------------
     Highlight Box for Tokens
     ------------------------- */
  .highlight-box {
    position: absolute;
    background-color: var(--highlight-box-color);
    pointer-events: none;
    z-index: 1;
    isolation: isolate;
    border-radius: 4px;
    overflow: hidden;
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease;
  }
  
  .highlight-box.hovered {
    background-color: var(--highlight-box-hover-color);
  }
  
  /* -------------------------
     Compact View (if needed)
     ------------------------- */
  body.compact-view {
    line-height: 1.0;
  }
  
  .highlighted-word {
    /* Specific styling for quoted content */
    color: rgb(132, 180, 226); /* or any color you choose */
    font-weight: bold;
  }
