#page-heatmap .heatmap-inner { max-width: none; height: calc(100dvh - 56px); padding: 20px 24px 18px; display: flex; flex-direction: column; gap: 16px; }
.heatmap-inner .page-header { flex: 0 0 auto; gap: 12px; margin-bottom: 0; }
.heatmap-inner .page-header > div { flex: 1; min-width: 0; }
.heatmap-inner .page-header h1 { font-size: 22px; }
.heatmap-inner .page-header p { max-width: none; margin-top: 6px; font-size: 12px; }
.hm-layout { display: grid; flex: 1; min-height: 0; grid-template-columns: 280px minmax(0,1fr); gap: 16px; align-items: stretch; }
.hm-controls { min-height: 0; padding: 16px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.hm-step { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.hm-step > span { font-size: 10px; color: #84908a; font-variant-numeric: tabular-nums; }
.hm-step h2 { margin: 0; font-size: 14px; font-weight: 600; }
.hm-upload { display: grid; grid-template-columns: 24px minmax(0,1fr); align-items: center; gap: 4px 10px; padding: 12px; text-align: left; border: 1px dashed #b5c7bc; border-radius: 10px; background: #f5f9f6; cursor: pointer; }
.hm-upload > [data-icon] { grid-row: span 2; }
.hm-upload { position: relative; overflow: hidden; }
.hm-upload:hover { background: #eaf3ed; }
.hm-upload:focus-within { outline: 2px solid #52775f; outline-offset: 2px; }
.hm-upload > input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 1; }
.hm-upload.is-busy { opacity: .6; cursor: wait; }
.hm-upload.is-busy > input { cursor: wait; }
.hm-dragging .hm-upload { border: 2px solid #52775f; background: #e5f3e9; }
.hm-dragging .hm-viewer { outline: 3px solid #52775f; outline-offset: 2px; }
.hm-upload svg { width: 23px; height: 23px; color: #537360; }
.hm-upload strong { font-size: 12px; }
.hm-upload small { font-size: 10px; color: #7b857f; }
.hm-label { display: block; font-size: 11px; font-weight: 600; margin: 15px 0 8px; }
.hm-controls select,.hm-controls textarea { width: 100%; border: 1px solid #dedee3; border-radius: 8px; background: #fff; padding: 10px; font: inherit; font-size: 12px; }
.hm-controls textarea { resize: vertical; line-height: 1.6; min-height: 72px; height: clamp(80px,12dvh,116px); max-height: 24dvh; }
.hm-controls textarea:focus { outline: 2px solid #90b69d; outline-offset: 2px; }
.hm-muted { margin: 8px 0; font-size: 10px; line-height: 1.5; color: #80858a; overflow-wrap: anywhere; }
.hm-divider { height: 1px; background: #ececef; margin: 14px 0; }
#hm-score,#hm-cancel { margin-top: 12px; width: 100%; justify-content: center; }
#hm-progress { font-size: 11px; line-height: 1.7; color: #506659; margin-top: 15px; }
#hm-progress-bar { width: 100%; height: 6px; accent-color: #52775f; }
.hm-error { color: #a63232; font-size: 12px; line-height: 1.6; }
.hm-scale { display: flex; justify-content: space-between; font-size: 9px; color: #717778; }
.hm-gradient { height: 7px; background: linear-gradient(90deg,#f4b3b3,#f5d5a2,#eceba5,#c4e5ab,#a4dcb4); border-radius: 6px; margin-top: 8px; }
.hm-viewer { display: flex; flex-direction: column; overflow: hidden; min-width: 0; min-height: 0; }
.hm-viewer-toolbar { flex: 0 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #e8e9eb; flex-wrap: wrap; }
.hm-viewer-toolbar > div:first-child { min-width: 0; flex: 1; }
.hm-viewer-toolbar strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-viewer-toolbar small { display: block; font-size: 10px; color: #858990; margin-top: 5px; line-height: 1.4; }
.hm-navigation { display: flex; align-items: center; gap: 6px; max-width: 100%; }
.hm-navigation select { width: 150px; min-width: 0; border: 1px solid #e4e6e8; border-radius: 7px; background: #fff; padding: 7px; font-size: 11px; }
.hm-navigation button { width: 30px; height: 30px; border: 1px solid #e4e6e8; border-radius: 7px; background: #fff; cursor: pointer; font-size: 17px; }
.hm-navigation button:disabled { opacity: .35; cursor: default; }
.hm-navigation button:not(:disabled):hover { background: #edf3ef; }
#hm-zoom-fit { width: auto; padding: 0 8px; font-size: 10px; }
#hm-match-count { min-width: 44px; text-align: center; font-size: 10px; color: #80858a; font-variant-numeric: tabular-nums; }
.hm-view-body { flex: 1; min-height: 0; background: #f1f2f4; overflow: auto; overscroll-behavior: contain; }
.hm-empty { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; color: #92979c; }
.hm-empty svg { width: 34px; height: 34px; color: #7a9a85; }
.hm-empty h2 { color: #49564f; font-size: 18px; font-weight: 500; margin: 20px 0 8px; }
.hm-empty p { max-width: 330px; font-size: 12px; line-height: 1.8; }
.hm-paper { margin: 24px auto; padding: 35px 40px; background: white; width: calc(100% - 48px); max-width: 850px; box-shadow: 0 2px 9px #00000008; }
.hm-reader-note { font-family: inherit; font-size: 10px; line-height: 1.6; color: #93989c; border-bottom: 1px solid #eee; padding-bottom: 18px; margin: 0 0 25px; }
.hm-paragraph { position: relative; margin: 18px 0; }
.hm-paragraph-label { display: block; color: #9a9c9e; font: 9px system-ui; margin-bottom: 6px; }
.hm-paragraph p { margin: 0; line-height: 2; font-family: Georgia, serif; font-size: 15px; }
.hm-sentence { display: inline; border: 0; border-radius: 3px; padding: 2px 1px; font: inherit; color: #2d3430; background: var(--sentence-color); cursor: pointer; text-align: left; box-decoration-break: clone; -webkit-box-decoration-break: clone; transition: background-color .25s; }
.hm-sentence:hover,.hm-sentence.selected { outline: 1px solid #3e6750; outline-offset: 1px; }
.hm-sentence:focus-visible { outline: 2px solid #263e30; }
.hm-failed { text-decoration: underline dotted #a84444; }
.hm-ranked { padding: 24px; }
.hm-ranked article { display: flex; gap: 14px; padding: 18px; margin-bottom: 10px; border: 1px solid #e5e7e8; border-radius: 8px; background: #fff; }
.hm-ranked article > div { font-size: 13px; line-height: 1.8; }
.hm-ranked small { display: block; margin-bottom: 7px; font-size: 9px; color: #8c9195; }
.hm-rank-score { border-radius: 6px; padding: 7px; height: fit-content; font-size: 12px; font-variant-numeric: tabular-nums; min-width: 42px; text-align: center; }
.hm-original-frame { display: block; width: 100%; height: 100%; min-height: 0; border: 0; background: white; }
.hm-upload { width: 100%; font-family: inherit; }
.hm-upload:disabled { cursor: wait; opacity: .6; }
.hm-pdf-pages { padding: 16px; }
.hm-pdf-page { position: relative; background: white; margin: 0 auto 24px; box-shadow: 0 2px 12px #00000015; }
.hm-pdf-page:last-child { margin-bottom: 0; }
.hm-pdf-page img { width: 100%; height: auto; display: block; }
.hm-overlay { position: absolute; border: 0; padding: 0; cursor: pointer; z-index: 2; mix-blend-mode: multiply; border-radius: 2px; transition: background-color .25s; }
.hm-overlay:hover,.hm-overlay:focus-visible { outline: 1px solid #294e3a!important; }
#hm-detail { position: relative; z-index: 5; flex: 0 0 40px; height: 40px; max-height: 40px; border-bottom: 1px solid #e8e9eb; padding: 3px 38px 3px 12px; background: #f8fbf9; }
#hm-close-detail { position: absolute; right: 8px; top: 6px; border: 0; border-radius: 5px; background: transparent; font-size: 22px; line-height: 1; padding: 3px 6px; cursor: pointer; }
#hm-close-detail:hover { background: #e5ede8; }
#hm-detail strong { font-size: 11px; color: #42624f; }
#hm-detail small { font-size: 10px; color: #888; }
.hm-detail-line { height: 18px; display: flex; align-items: center; gap: 10px; white-space: nowrap; overflow: hidden; }
.hm-detail-line > strong { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hm-detail-line > small { flex: 0 0 auto; }
.hm-detail-line > button { flex: 0 0 auto; font-size: 10px; border: 0; border-bottom: 1px dotted #84998c; padding: 0; background: transparent; color: #52775f; cursor: pointer; }
.hm-detail-line > button[aria-expanded=true] { color: #142b1d; border-bottom-style: solid; }
.hm-category-probabilities { display: flex; gap: 12px; height: 15px; font-size: 10px; line-height: 14px; white-space: nowrap; overflow-x: auto; scrollbar-width: none; color: #68766d; }
.hm-category-probabilities::-webkit-scrollbar { display: none; }
.hm-category-probability { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.hm-category-probability i { width: 6px; height: 6px; border-radius: 50%; }
.hm-category-probability b { font-variant-numeric: tabular-nums; color: #42624f; }
.hm-detail-popover { position: absolute; top: calc(100% + 4px); right: 8px; width: min(420px,calc(100% - 16px)); max-height: min(280px,35dvh); overflow: auto; overscroll-behavior: contain; padding: 14px; border: 1px solid #dfe7e1; border-radius: 8px; background: white; box-shadow: 0 8px 24px #0002; }
.hm-detail-popover p { margin: 8px 0 0; font-size: 12px; line-height: 1.6; }
@media(max-width:1440px) { .hm-layout { grid-template-columns:260px minmax(0,1fr); gap:12px; } }
@media(max-height:800px) and (min-width:981px) {
  #page-heatmap .heatmap-inner { padding-top: 14px; padding-bottom: 12px; gap: 12px; }
  .hm-controls { padding: 14px; }
  .hm-divider { margin: 10px 0; }
  .hm-step { margin-bottom: 8px; }
  .hm-controls .hm-label { margin-top: 10px; }
  #hm-progress { margin-top: 10px; }
}
@media(max-width:980px) {
  #page-heatmap .heatmap-inner { height: auto; padding: 20px 18px; }
  .hm-layout { grid-template-columns:1fr; flex: none; }
  .hm-controls { overflow: visible; }
  .hm-controls textarea { max-height: 200px; }
  .hm-viewer { height: 75dvh; min-height: 360px; }
  .hm-viewer-toolbar { padding: 12px; }
}
