:root {
  color-scheme: dark;
  --left-width: 272px;
  --right-width: 320px;
  --mobile-topbar-height: 105px;
  --mobile-statusbar-height: 34px;
  --mobile-visual-offset-top: 0px;
  --mobile-visual-bottom-inset: 0px;
  --bg: #08090c;
  --canvas-bg: #0a0b10;
  --panel: #101116;
  --panel-2: #151720;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f7;
  --muted: #8f96a3;
  --soft: #c7ccd5;
  --accent: #6e7cff;
  --accent-2: #00c2a8;
  --danger: #ff6b6b;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f7;
  --canvas-bg: #eef1f5;
  --panel: #ffffff;
  --panel-2: #f6f7fa;
  --line: rgba(16, 24, 40, 0.1);
  --line-strong: rgba(16, 24, 40, 0.16);
  --text: #17181d;
  --muted: #667085;
  --soft: #344054;
  --accent: #4f63ff;
  --accent-2: #00a88f;
  --danger: #e5484d;
  --shadow: 0 18px 44px rgba(16, 24, 40, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: auto;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF UI Text", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}

body.resizing-panels {
  cursor: col-resize;
  user-select: none;
}

@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app {
  display: grid;
  grid-template-columns: var(--left-width) 6px minmax(0, 1fr) 6px var(--right-width);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.rail,
.comments {
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border-color: var(--line);
  border-style: solid;
  padding: 18px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  overscroll-behavior: contain;
}

.app.left-collapsed {
  --left-width: 0px;
  grid-template-columns: 0 6px minmax(0, 1fr) 6px var(--right-width);
}

.app.right-collapsed {
  --right-width: 0px;
  grid-template-columns: var(--left-width) 6px minmax(0, 1fr) 6px 0;
}

.app.left-collapsed.right-collapsed {
  grid-template-columns: 0 6px minmax(0, 1fr) 6px 0;
}

.app.left-collapsed .rail,
.app.right-collapsed .comments {
  border-width: 0;
  opacity: 0;
  padding: 0;
  pointer-events: none;
}

.rail {
  border-width: 0;
}

.comments {
  border-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.resize-handle {
  position: relative;
  z-index: 20;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.resize-handle::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 50%;
  width: 1px;
  background: color-mix(in srgb, var(--line) 42%, transparent);
  transform: translateX(-50%);
  transition:
    background 140ms ease,
    width 140ms ease;
}

.resize-handle:hover,
.resize-handle.dragging {
  background: transparent;
}

.resize-handle:hover::after,
.resize-handle.dragging::after {
  width: 2px;
  background: color-mix(in srgb, var(--accent) 62%, var(--line));
}

.collapse-toggle {
  position: absolute;
  top: 50%;
  z-index: 18;
  display: grid;
  width: 18px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--soft);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
  transform: translateY(-50%);
  backdrop-filter: blur(12px);
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    width 140ms ease,
    transform 140ms ease;
}

.collapse-toggle:hover {
  width: 26px;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  color: var(--text);
  transform: translateY(-50%);
}

.collapse-toggle svg {
  width: 13px;
  height: 13px;
}

.collapse-toggle-left {
  left: 50%;
  border-radius: 0 7px 7px 0;
}

.collapse-toggle-right {
  right: 50%;
  border-radius: 7px 0 0 7px;
}

.brand,
.document-title,
.comments-head,
.file-card,
.comment {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  margin-bottom: 18px;
}

.rail > .brand {
  display: none;
}

.mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

.mark img {
  display: block;
  width: 30px;
  height: auto;
}

.brand strong,
.document-title strong,
.file-card strong {
  display: block;
  font-size: 13px;
}

.brand span,
.document-title span,
.file-card span,
.panel-title,
.dropzone small,
.comment time {
  color: var(--muted);
  font-size: 12px;
}

#brandSub:empty {
  display: none;
}

#docSubtitle:empty {
  display: none;
}

#docSubtitle {
  display: none;
}

.dropzone {
  position: relative;
  display: grid;
  min-height: 160px;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  color: var(--soft);
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.document-preview {
  min-height: 178px;
  cursor: default;
  padding: 14px;
}

.document-preview > strong,
.document-preview > small {
  display: none;
}

.dropzone.document-preview::after {
  display: none;
}

.document-preview:hover,
.document-preview:focus-within {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  color: var(--soft);
  box-shadow: none;
  transform: none;
}

.document-preview-frame {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 150px;
  place-items: center;
  overflow: hidden;
}

.document-preview-frame > img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.document-preview-frame > img[hidden],
.document-preview-empty[hidden] {
  display: none;
}

.document-preview-empty {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.document-preview-empty svg {
  width: 34px;
  height: 34px;
  stroke-width: 1.45;
}

.dropzone::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 7px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 48%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.dropzone input {
  display: none;
}

.visually-hidden-file {
  position: fixed;
  left: -100vw;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone:hover,
.dropzone:focus-within {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 13%, transparent), rgba(255, 255, 255, 0.018));
  color: var(--text);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent),
    0 14px 30px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.dropzone:hover::after,
.dropzone:focus-within::after,
.dropzone.dragging::after {
  opacity: 1;
}

.dropzone:active {
  transform: translateY(0) scale(0.995);
}

.dropzone.dragging {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent),
    0 18px 38px rgba(0, 0, 0, 0.28);
}

.drop-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.dropzone:hover .drop-icon,
.dropzone:focus-within .drop-icon,
.dropzone.dragging .drop-icon {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 18%, transparent);
  transform: translateY(-2px);
}

.dropzone strong,
.dropzone small,
.drop-icon {
  position: relative;
  z-index: 1;
}

.panel {
  margin-top: 22px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-title {
  margin-bottom: 0;
}

.panel-new-document-btn {
  min-width: 76px;
  height: 32px;
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
}

.panel-new-document-btn:hover {
  filter: brightness(1.06);
}

.file-list {
  display: grid;
  gap: 4px;
}

.file-card {
  position: relative;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  margin-bottom: 2px;
  padding: 10px 40px 10px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.file-card > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.file-card > div > strong,
.file-card > div > span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card:hover {
  background: color-mix(in srgb, var(--panel-2) 72%, transparent);
}

.file-card.active {
  background: var(--panel-2);
  border-color: var(--line);
}

.file-card.selected {
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-2));
  border-color: color-mix(in srgb, var(--accent) 46%, transparent);
}

.file-card.active.selected {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
}

.file-delete {
  position: absolute;
  right: 8px;
  top: 50%;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
  opacity: 0;
  transform: translateY(-50%) scale(0.92);
  transition:
    background 140ms ease,
    color 140ms ease,
    opacity 140ms ease,
    transform 140ms ease;
}

.file-card:hover .file-delete,
.file-card:focus-visible .file-delete,
.file-delete:focus-visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.file-delete:hover,
.file-delete:focus-visible {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
  outline: 0;
}

.file-delete svg {
  width: 15px;
  height: 15px;
}

.file-empty {
  display: grid;
  gap: 5px;
  padding: 10px 2px;
  color: var(--muted);
}

.file-empty span {
  color: var(--soft);
  font-size: 13px;
  font-weight: 650;
}

.file-empty small {
  color: var(--muted);
  font-size: 12px;
}

.file-type {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 107, 107, 0.12);
  color: #ffb1b1;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
}

.file-type.image {
  background: rgba(0, 194, 168, 0.12);
  color: #9bf4e9;
}

.file-type.has-thumbnail {
  border: 0;
  border-radius: 0;
  background: #f6f7f9;
  color: transparent;
}

.file-type.has-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}

.file-type.blank-icon {
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--muted) 66%, transparent);
}

.file-type.blank-icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.6;
}

.workspace {
  display: grid;
  grid-template-rows: 70px minmax(0, 1fr) 34px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    var(--canvas-bg);
  background-size: 32px 32px;
}

.statusbar {
  position: relative;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 0 18px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  color: var(--muted);
  font-size: 12px;
  backdrop-filter: blur(18px);
}

.statusbar-item {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.statusbar-item:first-child {
  margin-right: auto;
}

.statusbar-icon-toggle {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.statusbar-icon-toggle:hover,
.statusbar-icon-toggle.active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--text);
}

.statusbar-icon-toggle svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.status-zoom-slider {
  width: 120px;
}

.status-zoom-slider,
.mobile-zoom-control input {
  height: 18px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.status-zoom-slider::-webkit-slider-runnable-track,
.mobile-zoom-control input::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--soft) 22%, transparent);
}

.status-zoom-slider::-webkit-slider-thumb,
.mobile-zoom-control input::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 44%, transparent);
  -webkit-appearance: none;
}

.status-zoom-slider::-moz-range-track,
.mobile-zoom-control input::-moz-range-track {
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--soft) 22%, transparent);
}

.status-zoom-slider::-moz-range-thumb,
.mobile-zoom-control input::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 44%, transparent);
}

.statusbar-label {
  color: var(--muted);
}

.statusbar strong {
  max-width: 280px;
  overflow: hidden;
  color: var(--soft);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statusbar-description {
  max-width: 280px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px);
}

.document-title {
  gap: 10px;
  min-width: 0;
}

.title-brand-mark {
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.title-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.document-title div {
  min-width: 0;
}

.document-title strong,
.document-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tools,
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tools {
  justify-content: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}

.actions {
  justify-content: flex-end;
}

.export-menu {
  position: fixed;
  z-index: 80;
  display: none;
  width: 146px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: var(--shadow);
  padding: 5px;
  backdrop-filter: blur(16px);
}

.export-menu.open {
  display: grid;
  gap: 3px;
}

.export-menu button {
  display: flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  background: transparent;
  color: var(--soft);
  padding: 0 8px;
  font-size: 13px;
  text-align: center;
}

.export-menu button:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text);
}

.export-menu svg {
  width: 15px;
  height: 15px;
}

.export-image-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  background: rgba(5, 7, 12, 0.76);
  padding: 28px;
  backdrop-filter: blur(14px);
}

.export-image-overlay.open {
  display: grid;
  place-items: stretch;
}

.export-image-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.export-image-overlay:not(.export-html-overlay).open {
  place-items: stretch center;
}

.export-image-overlay:not(.export-html-overlay) .export-image-panel {
  width: min(1080px, 100%);
  height: 100%;
}

.export-image-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.export-image-head div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.export-image-head strong {
  color: var(--text);
  font-size: 14px;
}

.export-image-head span {
  color: var(--muted);
  font-size: 12px;
}

.export-image-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.export-image-close:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.export-image-list {
  display: grid;
  align-items: start;
  justify-items: center;
  gap: 16px;
  overflow: auto;
  padding: 18px;
}

.export-image-card {
  display: grid;
  justify-self: center;
  width: auto;
  max-width: 100%;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.export-image-card > img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  background: #fff;
}

.export-image-card-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.export-image-action {
  display: inline-flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--soft);
  padding: 0 11px;
  font-size: 13px;
}

.export-image-action:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  color: var(--text);
}

.export-image-action svg {
  width: 15px;
  height: 15px;
}

.export-image-body {
  display: grid;
  align-content: start;
  gap: 12px;
  border-top: 1px solid rgba(17, 24, 39, 0.12);
  background: #f7f8fb;
  padding: 18px 22px;
}

.export-image-body > strong {
  color: #111827;
  font-size: 13px;
}

.export-image-comments {
  display: grid;
  gap: 8px;
}

.export-image-comment {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.export-image-comment span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: var(--annotation-color, var(--accent));
  color: white;
  font-size: 11px;
  font-weight: 750;
}

.export-image-comment p,
.export-image-empty {
  margin: 0;
  color: #111827;
  font-size: 12px;
  line-height: 1.55;
}

.export-image-download {
  justify-self: start;
  display: inline-flex;
  height: 34px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: white;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
}

.export-image-download:hover {
  filter: brightness(1.05);
}

.export-image-download svg {
  width: 15px;
  height: 15px;
}

.export-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.export-image-head .export-preview-actions {
  display: inline-flex;
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}

.export-preview-download {
  display: inline-flex;
  height: 32px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: white;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
}

.export-preview-download svg {
  width: 15px;
  height: 15px;
}

.export-html-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  min-height: 0;
  overflow: hidden;
}

.export-html-stage {
  min-width: 0;
  overflow: auto;
  padding: 28px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #090a10;
  background-size: 32px 32px;
}

.export-html-pages {
  display: grid;
  justify-items: center;
  gap: 30px;
}

.export-html-page {
  position: relative;
  width: min(980px, 100%);
  background: white;
}

.export-html-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(3, 7, 18, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.export-html-preview.mask-active .export-html-page::after {
  opacity: 1;
}

.export-html-page > img {
  display: block;
  width: 100%;
  height: auto;
}

.export-html-video-preview .export-html-stage {
  display: grid;
  align-content: start;
}

.export-html-video-shell {
  display: grid;
  width: min(980px, 100%);
  justify-self: center;
  gap: 10px;
}

.export-html-video-frame {
  position: relative;
  overflow: hidden;
  background: #000;
}

.export-html-video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.export-html-video-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.export-html-video-layer .export-html-mark,
.export-html-video-layer .export-html-dot-wrap {
  pointer-events: auto;
}

.export-html-video-missing {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.74);
  padding: 24px;
  text-align: center;
}

.export-html-video-missing.show {
  display: grid;
}

.export-html-video-missing > strong,
.export-html-video-missing > span,
.export-html-video-missing > input {
  display: block;
}

.export-html-video-missing > strong {
  margin-bottom: 6px;
  color: var(--soft);
  font-size: 15px;
}

.export-html-video-missing > span {
  max-width: 380px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.export-html-video-missing > input {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.export-html-video-controls {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 20, 29, 0.9);
  padding: 10px;
}

.export-html-video-control-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.export-html-video-time {
  color: var(--soft);
  font-size: 12px;
}

.export-html-video-play {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.export-html-video-play:hover,
.export-html-video-play:focus-visible {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
}

.export-html-video-timeline-wrap {
  position: relative;
  height: 18px;
}

.export-html-video-timeline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 18px;
  margin: 0;
  accent-color: #d6dae3;
  background: transparent;
}

.export-html-video-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.export-html-video-marker {
  position: absolute;
  top: 50%;
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: var(--annotation-color);
  color: white;
  font-size: 0;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
}

.export-html-video-marker:hover,
.export-html-video-marker:focus-visible,
.export-html-video-marker.active,
.export-html-video-marker.playback-active {
  border-color: white;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--annotation-color) 24%, transparent);
}

.export-html-video-waveform {
  display: block;
  width: 100%;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.export-html-page-badge {
  position: absolute;
  left: 0;
  bottom: calc(100% + 5px);
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 750;
  line-height: 20px;
}

.export-html-mark,
.export-html-dot-wrap {
  position: absolute;
  z-index: 3;
  --annotation-color: var(--accent);
}

.export-html-mark {
  border: 2px solid var(--annotation-color);
  background: transparent;
}

.export-html-mark.delete {
  background: color-mix(in srgb, var(--annotation-color) 16%, transparent);
}

.export-html-mark.active,
.export-html-dot-wrap.active {
  z-index: 4;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--annotation-color) 62%, transparent));
}

.export-html-mark.active {
  background: color-mix(in srgb, var(--annotation-color) 14%, transparent);
}

.export-html-dot {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid white;
  border-radius: 999px;
  background: var(--annotation-color);
  transform: translate(-50%, -50%);
}

.export-html-index {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid white;
  border-radius: 999px;
  background: var(--annotation-color);
  color: white;
  font-size: 11px;
  font-weight: 800;
  transform: translate(-50%, -50%);
}

.export-html-side {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  border-left: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}

.export-html-side-head,
.export-html-comment-group-head,
.export-html-comment-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.export-html-side-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  padding: 16px;
}

.export-html-side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.export-html-side-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.export-html-filter {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 0 6px;
  font-size: 12px;
}

.export-html-filter.active,
.export-html-filter:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text);
}

.export-html-comment-list {
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.export-html-side-head strong {
  color: var(--soft);
  font-size: 13px;
}

.export-html-side-head span,
.export-html-comment-title span {
  color: var(--muted);
  font-size: 12px;
}

.export-html-comment-group {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.export-html-comment-group-head {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--soft);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 650;
}

.export-html-comment {
  position: relative;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 12px 10px 10px 38px;
}

.export-html-comment[hidden],
.export-html-comment-group[hidden] {
  display: none;
}

.export-html-comment:hover,
.export-html-comment.active {
  border-color: color-mix(in srgb, var(--annotation-color) 62%, var(--line));
  background: color-mix(in srgb, var(--annotation-color) 12%, transparent);
}

.export-html-comment-index {
  position: absolute;
  left: 12px;
  top: 12px;
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  line-height: 18px;
  border-radius: 999px;
  background: var(--annotation-color);
  color: white;
  font-size: 10px;
  font-weight: 800;
}

.export-html-comment-title strong {
  color: var(--soft);
  font-size: 12px;
  font-weight: 600;
}

.export-html-comment p {
  margin: 0;
  color: #c7ccd5;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.export-html-comment-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #fff;
}

.tool,
.ghost,
.primary,
.mobile-file-btn,
.new-document-btn {
  display: inline-flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: var(--soft);
}

.tool,
.ghost {
  width: 34px;
  background: transparent;
}

.tool:hover,
.ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.tool.active {
  background: var(--text);
  color: var(--bg);
  box-shadow: none;
}

.tool.magnifier-toggle.active {
  background: color-mix(in srgb, var(--accent) 24%, rgba(255, 255, 255, 0.04));
  color: #dfe4ff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 42%, transparent);
}

.primary {
  width: 76px;
  gap: 0;
  border: 0;
  padding: 0;
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 650;
  box-shadow: none;
}

.primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, white);
  color: white;
}

.primary svg,
.primary i {
  display: none;
}

.mobile-file-btn {
  display: none;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line));
  background: color-mix(in srgb, var(--accent) 13%, var(--panel));
  color: var(--text);
  font-weight: 700;
}

.new-document-btn {
  padding: 0 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  color: var(--soft);
  font-size: 13px;
}

.panel-new-document-btn {
  width: 76px;
  min-width: 76px;
  height: 32px;
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 0;
  font-size: 13px;
  font-weight: 650;
}

.panel-new-document-btn:hover {
  border-color: transparent;
  background: color-mix(in srgb, var(--accent) 88%, white);
  color: #fff;
}

.new-document-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  color: var(--text);
}

.new-document-btn:disabled {
  cursor: default;
  opacity: 0.58;
  transform: none;
}

.mobile-file-btn:hover {
  background: color-mix(in srgb, var(--accent) 20%, var(--panel));
}

.zoom-readout {
  display: none;
  min-width: 48px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.canvas-viewport {
  position: relative;
  min-height: 0;
  overflow: hidden;
  cursor: default;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 50% 20%, rgba(110, 124, 255, 0.08), transparent 34%),
    var(--canvas-bg);
  background-size: 32px 32px, 32px 32px, auto, auto;
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.canvas-viewport::after {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: 12;
  border: 2px dashed color-mix(in srgb, var(--accent) 68%, white);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.canvas-viewport.file-dragging::after {
  opacity: 1;
}

.empty-state {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.empty-state.open {
  opacity: 1;
  pointer-events: auto;
}

.canvas-surface,
.page-stack,
.doc-page,
.doc-page canvas,
.doc-page video,
.overlay,
.annotation-layer,
.placeholder,
.annotation-ui {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.doc-page,
.doc-page canvas,
.doc-page video,
.canvas-surface {
  outline: 0;
}

.canvas-viewport.space-panning {
  cursor: grab;
}

.canvas-viewport[data-tool="mark"] {
  cursor: crosshair;
}

.canvas-viewport.dragging {
  cursor: grabbing;
}

.canvas-menu {
  position: fixed;
  z-index: 100;
  display: none;
  min-width: 156px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.canvas-menu.open {
  display: grid;
  gap: 4px;
}

.canvas-menu button {
  display: flex;
  width: 100%;
  height: 34px;
  align-items: center;
  gap: 9px;
  border-radius: 7px;
  background: transparent;
  color: var(--soft);
  padding: 0 9px;
  text-align: left;
}

.canvas-menu button:hover,
.canvas-menu button.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text);
}

.canvas-menu button.danger:hover {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: #ffb4b4;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  padding: 18px;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.confirm-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.confirm-dialog {
  display: grid;
  width: min(360px, 100%);
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 98%, transparent);
  box-shadow: var(--shadow);
  padding: 16px;
  transform: translateY(6px) scale(0.98);
  transition: transform 140ms ease;
}

.confirm-modal.open .confirm-dialog {
  transform: translateY(0) scale(1);
}

.confirm-title {
  color: var(--text);
  font-size: 14px;
}

.confirm-body {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.confirm-cancel,
.confirm-delete,
.confirm-rename {
  height: 30px;
  border-radius: 7px;
  padding: 0 12px;
  font-size: 12px;
}

.confirm-cancel {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 88%, transparent);
  color: var(--soft);
}

.confirm-delete {
  background: var(--danger);
  color: white;
}

.confirm-rename {
  background: var(--accent);
  color: white;
}

.confirm-cancel:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.confirm-delete:hover,
.confirm-rename:hover {
  filter: brightness(1.05);
}

.rename-input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: color-mix(in srgb, var(--panel-2) 88%, transparent);
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
}

.rename-input:focus {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.annotation-notice {
  position: fixed;
  left: 50%;
  top: 74px;
  z-index: 120;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 97%, transparent);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.annotation-notice.open {
  opacity: 1;
  transform: translate(-50%, 0);
}

.magnifier-lens {
  position: fixed;
  z-index: 130;
  display: grid;
  width: 180px;
  height: 180px;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--accent) 76%, white);
  border-radius: 999px;
  background: var(--panel);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: scale(0.92);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.magnifier-lens.open {
  opacity: 1;
  transform: scale(1);
}

.magnifier-lens canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.magnifier-lens::before,
.magnifier-lens::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: color-mix(in srgb, var(--accent-2) 86%, white);
  filter:
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.95))
    drop-shadow(0 0 5px rgba(0, 0, 0, 0.45));
  transform: translate(-50%, -50%);
}

.magnifier-lens::before {
  width: 64%;
  height: 1px;
}

.magnifier-lens::after {
  width: 1px;
  height: 64%;
}

.canvas-surface {
  position: absolute;
  left: 0;
  top: 0;
  width: 5200px;
  height: 5200px;
  transform-origin: 0 0;
  will-change: transform;
}

.page-stack {
  position: absolute;
  left: 2200px;
  top: 220px;
  display: grid;
  justify-items: center;
  gap: 34px;
  width: 820px;
}

.doc-page {
  position: relative;
  width: min(760px, 100%);
  min-height: 980px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: #f6f7f9;
  box-shadow: var(--shadow);
}

html[data-theme="light"] .doc-page,
html[data-theme="light"] .placeholder {
  background-color: #ffffff;
}

html[data-theme="light"] .doc-page {
  border-color: transparent;
}

html[data-theme="light"] .placeholder {
  background:
    linear-gradient(90deg, rgba(16, 24, 40, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(16, 24, 40, 0.06) 1px, transparent 1px),
    #ffffff;
  background-size: 34px 34px;
}

.doc-page canvas,
.doc-page video,
.video-annotation-hitbox,
.overlay,
.annotation-layer,
.placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.doc-page canvas {
  display: block;
}

.doc-page video {
  z-index: 1;
  display: block;
  object-fit: contain;
  background: #05060a;
}

.video-frame-canvas {
  opacity: 0;
}

.video-page {
  display: grid;
  gap: 10px;
  min-height: 0;
  background: transparent;
  box-shadow: none;
}

.video-stage {
  position: relative;
  width: 100%;
  overflow: visible;
  background: #05060a;
  box-shadow: var(--shadow);
}

.video-annotation-hitbox {
  z-index: 3;
  cursor: inherit;
}

.video-controls {
  position: relative;
  z-index: 8;
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: var(--shadow);
  padding: 9px 10px 10px;
  pointer-events: auto;
}

.video-controls.waveform-hidden {
  min-height: 0;
}

.video-quick-comment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.video-quick-comment-input {
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: color-mix(in srgb, var(--panel-2) 88%, transparent);
  color: var(--text);
  padding: 0 10px;
  font-size: 12px;
}

.video-quick-comment-input::placeholder {
  color: var(--muted);
}

.video-quick-comment-input:focus {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent);
}

.video-quick-comment-button {
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 750;
}

.video-quick-comment-button:hover,
.video-quick-comment-button:focus-visible {
  filter: brightness(1.06);
}

.video-control-top {
  display: grid;
  grid-template-columns: minmax(104px, 1fr) auto minmax(104px, 1fr);
  align-items: center;
  gap: 9px;
}

.video-time-group,
.video-option-group,
.video-transport {
  display: flex;
  align-items: center;
}

.video-time-group {
  gap: 8px;
  justify-self: start;
}

.video-transport {
  justify-self: center;
  gap: 7px;
}

.video-option-group {
  justify-self: end;
  gap: 8px;
}

.video-timeline-zoom-control {
  position: relative;
  display: grid;
  width: 82px;
  align-items: center;
}

.video-timeline-zoom {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.video-timeline-zoom-value {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  z-index: 13;
  min-width: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--panel) 98%, transparent);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, 4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.video-timeline-zoom-value::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
}

.video-timeline-zoom-control.show-value .video-timeline-zoom-value,
.video-timeline-zoom-control:hover .video-timeline-zoom-value,
.video-timeline-zoom-control:focus-within .video-timeline-zoom-value {
  opacity: 1;
  transform: translate(-50%, 0);
}

.video-control-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 90%, transparent);
  color: var(--soft);
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.video-control-button:hover,
.video-control-button:focus-visible {
  border-color: color-mix(in srgb, var(--soft) 48%, var(--line));
  background: color-mix(in srgb, var(--soft) 12%, var(--panel-2));
  color: var(--text);
  filter: none;
}

.video-control-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.6;
}

.video-play-button {
  width: 38px;
  height: 38px;
  border-color: color-mix(in srgb, var(--soft) 44%, var(--line));
  background: color-mix(in srgb, var(--soft) 12%, var(--panel-2));
  color: var(--text);
}

.video-play-button:hover,
.video-play-button:focus-visible {
  border-color: color-mix(in srgb, var(--text) 48%, var(--line));
  background: color-mix(in srgb, var(--text) 11%, var(--panel-2));
  transform: translateY(-1px);
}

.video-annotation-nav {
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  background: color-mix(in srgb, var(--panel-2) 90%, transparent);
  color: var(--soft);
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.video-annotation-nav svg {
  width: 16px;
  height: 16px;
}

.video-annotation-nav:hover,
.video-annotation-nav:focus-visible {
  border-color: color-mix(in srgb, var(--soft) 52%, var(--line));
  background: color-mix(in srgb, var(--soft) 12%, var(--panel-2));
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.045);
  filter: none;
  transform: translateY(-1px);
}

.video-annotation-nav:active {
  transform: translateY(0);
}

.video-annotation-nav:disabled {
  cursor: default;
  opacity: 0.36;
  filter: none;
  transform: none;
  box-shadow: none;
}

.video-mute-button {
  background: color-mix(in srgb, var(--panel-2) 88%, transparent);
  color: var(--soft);
}

.video-volume-control {
  position: relative;
  display: grid;
  place-items: center;
}

.video-volume-panel {
  position: absolute;
  right: 50%;
  bottom: calc(100% + 4px);
  z-index: 12;
  display: grid;
  justify-items: center;
  gap: 7px;
  width: 42px;
  height: 128px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 98%, transparent);
  box-shadow: var(--shadow);
  padding: 9px 7px 7px;
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 6px);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    visibility 140ms ease;
  visibility: hidden;
}

.video-volume-panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -12px;
  height: 14px;
}

.video-volume-control:hover .video-volume-panel,
.video-volume-control:focus-within .video-volume-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translate(50%, 0);
  visibility: visible;
}

.video-volume-slider {
  width: 24px;
  height: 86px;
  accent-color: var(--accent);
  cursor: pointer;
  direction: rtl;
  writing-mode: vertical-rl;
}

.video-volume-slider:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 52%, transparent);
  outline-offset: 3px;
}

.video-volume-value {
  color: var(--soft);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.video-time {
  color: var(--soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.video-time-duration {
  color: var(--muted);
  text-align: right;
}

.video-speed {
  height: 32px;
  min-width: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: color-mix(in srgb, var(--panel-2) 88%, transparent);
  color: var(--text);
  padding: 0 8px;
  font-size: 12px;
}

.video-speed:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.video-timeline-wrap {
  display: grid;
  position: relative;
  min-width: 0;
}

.video-timeline-scroller {
  display: grid;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.video-timeline-scroller::-webkit-scrollbar {
  display: none;
}

.video-timeline-content {
  --timeline-zoom: 1;
  display: grid;
  gap: 8px;
  width: max(100%, calc(100% * var(--timeline-zoom)));
  min-width: 100%;
}

.video-timeline {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 120px;
  height: 18px;
  background: transparent;
  accent-color: #d6dae3;
  cursor: pointer;
}

.video-marker-track {
  position: absolute;
  left: 9px;
  right: 9px;
  top: 9px;
  height: 5px;
  pointer-events: none;
}

.video-timeline-marker {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border: 2px solid color-mix(in srgb, var(--annotation-color, var(--accent)) 34%, black);
  border-radius: 999px;
  background: var(--annotation-color, var(--accent));
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--annotation-color, var(--accent)) 24%, transparent),
    0 2px 9px rgba(0, 0, 0, 0.42);
  padding: 0;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.video-timeline-marker:hover,
.video-timeline-marker:focus-visible,
.video-timeline-marker.playback-active {
  z-index: 4;
  transform: translate(-50%, -50%) scale(1.25);
}

.video-timeline-marker.playback-active {
  border-color: #ffffff;
  box-shadow:
    0 0 0 5px color-mix(in srgb, var(--annotation-color, var(--accent)) 34%, transparent),
    0 0 18px color-mix(in srgb, var(--annotation-color, var(--accent)) 54%, transparent),
    0 2px 9px rgba(0, 0, 0, 0.42);
}

.video-marker-tooltip {
  position: absolute;
  left: 50%;
  bottom: 15px;
  display: grid;
  width: max-content;
  max-width: 240px;
  gap: 3px;
  border: 1px solid color-mix(in srgb, var(--annotation-color, var(--accent)) 40%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 98%, transparent);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 8px 9px;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, 6px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.video-marker-tooltip strong {
  color: var(--annotation-color, var(--accent));
  font-size: 11px;
  font-weight: 750;
}

.video-marker-tooltip span {
  overflow-wrap: anywhere;
}

.video-timeline-marker:hover .video-marker-tooltip,
.video-timeline-marker:focus-visible .video-marker-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.video-timeline::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--soft) 26%, var(--line));
}

.video-timeline::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5.5px;
  border: 2px solid color-mix(in srgb, var(--panel) 86%, white);
  border-radius: 999px;
  background: #d6dae3;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.28);
}

.video-timeline::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--soft) 26%, var(--line));
}

.video-timeline::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, var(--panel) 86%, white);
  border-radius: 999px;
  background: #d6dae3;
}

.doc-page .video-waveform {
  position: relative;
  inset: auto;
  display: block;
  width: 100%;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: color-mix(in srgb, var(--panel-2) 94%, black);
}

.video-controls.waveform-hidden .video-waveform {
  display: none;
}

@media (max-width: 560px) {
  .video-controls {
    min-height: 112px;
    padding: 8px;
  }

  .video-control-top {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 6px;
  }

  .video-quick-comment {
    grid-template-columns: minmax(0, 1fr) 52px;
  }

  .video-quick-comment-input,
  .video-quick-comment-button {
    height: 32px;
  }

  .video-time-group,
  .video-option-group,
  .video-transport {
    justify-self: stretch;
    justify-content: center;
  }

  .video-time-group {
    justify-content: space-between;
  }

  .video-option-group {
    justify-content: center;
    flex-wrap: wrap;
  }

  .video-control-button {
    width: 32px;
    height: 32px;
  }

  .video-speed {
    min-width: 64px;
    padding: 0 5px;
  }

  .video-timeline-zoom-control {
    width: 76px;
  }

  .video-volume-panel {
    height: 116px;
  }

  .video-volume-slider {
    height: 76px;
  }

  .doc-page .video-waveform {
    height: 48px;
  }
}

.placeholder {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 12%;
  color: #17181d;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px),
    #f6f7f9;
  background-size: 34px 34px;
}

.empty-state .placeholder {
  position: relative;
  inset: auto;
  width: min(390px, 100%);
  height: auto;
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  color: var(--text);
  text-align: center;
  backdrop-filter: blur(14px);
  animation: emptyPanelIn 260ms ease-out both;
}

.empty-state .placeholder h1 {
  max-width: 320px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
  font-weight: 750;
}

.empty-state .placeholder p {
  max-width: 300px;
  color: var(--soft);
  margin-bottom: 10px;
  transition: color 160ms ease;
}

.empty-state .placeholder p.feedback {
  color: color-mix(in srgb, var(--accent) 78%, white);
}

.placeholder span {
  width: fit-content;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 99px;
  padding: 5px 10px;
  color: #555d6b;
  font-size: 12px;
  font-weight: 700;
}

.placeholder h1 {
  max-width: 460px;
  margin: 0;
  color: #0b0c10;
  font-size: 14px;
  line-height: 0.96;
  letter-spacing: 0;
}

.placeholder p {
  max-width: 390px;
  margin: 0;
  color: #596170;
  font-size: 14px;
  line-height: 1.65;
}

.placeholder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.placeholder-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  border: 1px solid rgba(16, 24, 40, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  color: #252934;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.empty-state .placeholder-action {
  height: 46px;
  min-width: 124px;
  border-color: var(--line);
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  color: var(--soft);
  box-shadow: none;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.empty-state .placeholder-action span {
  display: contents;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
}

.empty-state .placeholder-action.primary-action {
  border: 0;
  border-color: transparent;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 22%, transparent);
}

.empty-state .placeholder-action.primary-action span {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
}

.empty-state .placeholder-action:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
  color: var(--text);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.empty-state .placeholder-action:active {
  transform: translateY(0) scale(0.98);
  box-shadow: none;
}

.empty-state .placeholder-action:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, white);
  outline-offset: 3px;
}

.empty-state .placeholder-action.primary-action:hover {
  background: color-mix(in srgb, var(--accent) 88%, white);
  color: #ffffff;
  border: 0;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 26%, transparent);
  transform: translateY(-1px);
}

@keyframes emptyPanelIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .empty-state .placeholder {
    animation: none;
  }

  .empty-state .placeholder-action {
    transition: none;
  }
}

.placeholder-action.primary-action {
  border-color: #111827;
  background: #111827;
  color: #ffffff;
}

.placeholder-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.placeholder-action svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.placeholder-tips {
  display: grid;
  gap: 6px;
  max-width: 460px;
  margin: 2px 0 0;
  padding: 0;
  color: #596170;
  font-size: 12px;
  line-height: 1.45;
  list-style: none;
}

.placeholder-tips li {
  position: relative;
  padding-left: 13px;
}

.placeholder-tips li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #00c2a8;
}

.page-badge {
  position: absolute;
  left: 0;
  bottom: calc(100% + 4px);
  z-index: 3;
  display: inline-flex;
  height: 22px;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 5px 0 7px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  backdrop-filter: blur(10px);
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.page-badge:hover,
.page-badge:focus-within {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
  background: color-mix(in srgb, var(--panel) 98%, transparent);
  color: var(--text);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.video-page .page-badge > span {
  display: block;
  max-width: min(320px, calc(100vw - 520px));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-delete {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  opacity: 0;
  padding: 0;
  transform: scale(0.88);
  transition:
    background 140ms ease,
    color 140ms ease,
    opacity 140ms ease,
    transform 140ms ease;
}

.page-badge:hover .page-delete,
.page-badge:focus-within .page-delete {
  opacity: 1;
  transform: scale(1);
}

.page-delete:hover,
.page-delete:focus-visible {
  background: color-mix(in srgb, var(--danger) 18%, transparent);
  color: var(--danger);
  outline: 0;
}

.page-delete svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}

.overlay {
  z-index: 2;
  pointer-events: none;
}

.annotation-layer {
  z-index: 4;
  pointer-events: none;
}

.video-stage .annotation-layer {
  z-index: 9;
}

.annotation-ui {
  position: absolute;
  z-index: 2;
  pointer-events: auto;
}

.annotation-arrow {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  color: var(--annotation-color, var(--accent));
  overflow: visible;
  pointer-events: none;
}

.annotation-arrow line {
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.annotation-arrow .arrow-line {
  stroke: currentColor;
  stroke-width: var(--arrow-width, 0.75px);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.42));
  pointer-events: none;
}

.annotation-arrow .arrow-hit {
  stroke: transparent;
  stroke-width: 12px;
  cursor: grab;
  pointer-events: stroke;
}

.annotation-arrow .arrow-endpoint {
  fill: var(--annotation-color, var(--accent));
  stroke: white;
  stroke-width: 0.45;
  cursor: grab;
  opacity: 0;
  pointer-events: auto;
  vector-effect: non-scaling-stroke;
}

.annotation-arrow.hovered .arrow-line,
.annotation-arrow.dragging .arrow-line {
  filter:
    drop-shadow(0 1px 3px rgba(0, 0, 0, 0.42))
    drop-shadow(0 0 9px color-mix(in srgb, var(--annotation-color, var(--accent)) 72%, transparent));
}

.annotation-arrow.hovered .arrow-endpoint,
.annotation-arrow.dragging .arrow-endpoint {
  opacity: 1;
}

.annotation-arrow.dragging .arrow-hit,
.annotation-arrow.dragging .arrow-endpoint {
  cursor: grabbing;
}

.annotation-detail-line {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  color: var(--annotation-color, var(--accent));
  overflow: visible;
  pointer-events: none;
}

.detail-line-path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4px;
  stroke-linecap: round;
  stroke-dasharray: 3 2;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.annotation-detail-callout {
  position: absolute;
  z-index: 4;
  display: grid;
  width: 180px;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--annotation-color, var(--accent)) 48%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: var(--shadow);
  padding: 8px 10px;
  color: var(--soft);
  pointer-events: none;
  transform: translateY(-50%);
}

.annotation-detail-callout.detail-left {
  text-align: right;
}

.annotation-detail-callout strong {
  color: var(--annotation-color, var(--accent));
  font-size: 11px;
  line-height: 1.2;
}

.annotation-detail-callout p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.mark-box {
  min-width: 28px;
  min-height: 0;
  border: 2px solid var(--annotation-color, var(--accent));
  border-radius: 0;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
  cursor: move;
}

.annotation-index-badge {
  position: absolute;
  left: -9px;
  top: -9px;
  z-index: 6;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  background: var(--annotation-color, var(--accent));
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

.annotation-index-badge[hidden] {
  display: none;
}

.text-dot .annotation-index-badge {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.annotation-ui:hover > .annotation-index-badge,
.annotation-ui.editing > .annotation-index-badge,
.annotation-ui:hover .text-dot .annotation-index-badge,
.annotation-ui.editing .text-dot .annotation-index-badge {
  opacity: 0;
}

.mark-box.intent-deleteContent {
  background: color-mix(in srgb, var(--annotation-color, #ff6b6b) 16%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--annotation-color, #ff6b6b) 26%, white) inset,
    0 0 14px color-mix(in srgb, var(--annotation-color, #ff6b6b) 20%, transparent);
}

.mark-box.video-full-frame-annotation:not(.editing):not(.moving):not(.resizing) {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  cursor: default;
}

.mark-box.video-full-frame-annotation:not(.editing):not(.moving):not(.resizing) .arrow-anchor,
.mark-box.video-full-frame-annotation:not(.editing):not(.moving):not(.resizing) .resize-corner {
  display: none;
}

.arrow-anchor {
  --control-scale: var(--inverse-zoom, 1);
  position: absolute;
  z-index: 4;
  box-sizing: border-box;
  display: block;
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  border: 2px solid white;
  border-radius: 99px;
  background: var(--annotation-color, var(--accent));
  cursor: crosshair;
  opacity: 0;
  padding: 0;
  pointer-events: auto;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%) scale(var(--control-scale));
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}

.arrow-anchor-top {
  left: 50%;
  top: 0;
}

.arrow-anchor-right {
  left: 100%;
  top: 50%;
}

.arrow-anchor-bottom {
  left: 50%;
  top: 100%;
}

.arrow-anchor-left {
  left: 0;
  top: 50%;
}

.mark-box:hover .arrow-anchor,
.mark-box.editing .arrow-anchor,
.arrow-anchor:hover {
  opacity: 1;
  transform: translate(-50%, -50%) scale(var(--control-scale));
}

.arrow-anchor:hover {
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.25),
    0 0 0 5px color-mix(in srgb, var(--annotation-color, var(--accent)) 22%, transparent);
}

.mark-box.previewing {
  min-width: 1px;
  min-height: 1px;
  border-style: dashed;
  background: transparent;
  cursor: crosshair;
}

.mark-box.moving,
.mark-box.resizing {
  background: transparent;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22) inset,
    0 0 18px rgba(110, 124, 255, 0.32);
}

.mark-box.intent-deleteContent.moving,
.mark-box.intent-deleteContent.resizing {
  background: color-mix(in srgb, var(--annotation-color, #ff6b6b) 16%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--annotation-color, #ff6b6b) 28%, white) inset,
    0 0 18px color-mix(in srgb, var(--annotation-color, #ff6b6b) 30%, transparent);
}

.annotation-ui.focused {
  animation: annotation-focus 900ms ease;
}

@keyframes annotation-focus {
  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(110, 124, 255, 0));
  }

  35% {
    filter: drop-shadow(0 0 18px rgba(110, 124, 255, 0.72));
  }
}

.annotation-focus-mask {
  pointer-events: none;
}

.annotation-focus-dim {
  fill: rgba(2, 5, 14, 0.58);
  stroke: none;
}

.annotation-editor {
  --editor-scale: var(--inverse-zoom, 1);
  position: absolute;
  z-index: 18;
  display: block;
  width: 280px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 97%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  pointer-events: auto;
  transform-origin: top left;
}

.mobile-annotation-dock {
  display: none;
}

.mobile-zoom-control {
  display: none;
}

.annotation-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  z-index: 12;
  display: grid;
  width: max-content;
  min-width: 128px;
  max-width: 230px;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.annotation-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 9px;
  height: 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
}

.annotation-tooltip p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.tooltip-reference {
  position: relative;
  z-index: 1;
  display: block;
  width: 180px;
  max-height: 116px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.annotation-ui:not(.editing):hover > .annotation-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.details-visible .video-annotation:not(.editing) > .annotation-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.details-visible .text-note.video-annotation:not(.editing) > .annotation-tooltip {
  transform: translateY(0);
}

.annotation-operating .annotation-detail-line,
.annotation-operating .annotation-detail-callout,
.annotation-operating .annotation-ui:not(.moving):not(.resizing) .annotation-index-badge,
.annotation-operating .annotation-ui:not(.moving):not(.resizing) .resize-corner,
.annotation-operating .annotation-ui:not(.moving):not(.resizing) .arrow-anchor,
.annotation-operating .annotation-ui:not(.moving):not(.resizing) .annotation-arrow,
.annotation-operating .annotation-ui.moving > .annotation-tooltip,
.annotation-operating .annotation-ui.resizing > .annotation-tooltip {
  opacity: 0 !important;
  pointer-events: none !important;
}

.text-note .annotation-tooltip {
  left: 12px;
  bottom: calc(100% + 9px);
  transform: translateY(4px);
}

.text-note:not(.editing):hover > .annotation-tooltip {
  transform: translateY(0);
}

.text-note .annotation-tooltip::after {
  left: 8px;
  transform: rotate(45deg);
}

.editor-body {
  display: grid;
  gap: 8px;
}

.annotation-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 28px;
  gap: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
}

.annotation-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 6px;
  font-size: 12px;
  white-space: nowrap;
}

.annotation-tab-dot {
  display: block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 99px;
  background: #58d7a5;
  box-shadow: 0 0 0 2px rgba(88, 215, 165, 0.12);
}

.annotation-tab.edit .annotation-tab-dot {
  background: #6e7cff;
  box-shadow: 0 0 0 2px rgba(110, 124, 255, 0.14);
}

.annotation-tab.danger .annotation-tab-dot {
  background: var(--danger);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 16%, transparent);
}

.annotation-tab:hover,
.annotation-tab.active {
  background: color-mix(in srgb, var(--annotation-color, var(--accent)) 16%, transparent);
  color: var(--text);
}

.annotation-tab.danger:hover,
.annotation-tab.danger.active {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: #ffb4b4;
}

.annotation-input-row {
  position: relative;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 92%, transparent);
  padding: 5px;
}

.annotation-input-actions {
  position: absolute;
  right: 5px;
  bottom: 5px;
  z-index: 4;
  display: inline-flex;
  align-items: flex-end;
  gap: 5px;
  pointer-events: auto;
}

.inline-reference-list {
  position: absolute;
  inset: 5px;
  z-index: 0;
  overflow: hidden;
  padding: 7px 96px 38px 6px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
  white-space: pre-wrap;
  word-break: break-word;
}

.inline-reference-list::-webkit-scrollbar {
  display: none;
}

.inline-reference-list {
  scrollbar-width: none;
}

.inline-reference-list:empty {
  display: block;
}

.inline-reference-image {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin: 0 3px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 5px;
  background: #f6f7f9;
  object-fit: cover;
  vertical-align: -6px;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

.reference-list {
  display: grid;
  gap: 6px;
}

.reference-list.compact {
  display: flex;
  flex-wrap: wrap;
}

.reference-image {
  display: block;
  width: 170px;
  max-height: 120px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 7px;
  background: #f6f7f9;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

.reference-list.compact .reference-image {
  width: 54px;
  height: 54px;
  max-height: none;
  aspect-ratio: 1;
}

.inline-reference-image.reference-highlighted,
.reference-image.reference-highlighted {
  border-color: var(--annotation-color, var(--accent));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--annotation-color, var(--accent)) 26%, transparent);
  transform: translateY(-1px);
}

.mark-editor {
  transform: scale(var(--editor-scale));
  transform-origin: top left;
}

.mark-editor.flipped {
  transform: translateX(-100%) scale(var(--editor-scale));
  transform-origin: top right;
}

.mark-editor.vertical-flipped {
  transform-origin: bottom left;
}

.mark-editor.flipped.vertical-flipped {
  transform: translateX(-100%) scale(var(--editor-scale));
  transform-origin: bottom right;
}

.text-editor {
  transform: translateY(var(--editor-offset-y, -10px)) scale(var(--editor-scale));
  transform-origin: top left;
}

.text-editor.vertical-flipped {
  transform-origin: bottom left;
}

.save-annotation {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: var(--annotation-color, var(--accent));
  color: white;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  transform: scale(0.92);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    filter 140ms ease;
}

.save-annotation-group {
  position: relative;
  display: inline-flex;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.save-annotation-group.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.save-annotation-group.visible .save-annotation,
.save-annotation-group.visible .save-shortcut-toggle {
  pointer-events: auto;
}

.save-annotation-group .save-annotation {
  border-radius: 7px 0 0 7px;
  transform: none;
}

.save-shortcut-toggle {
  display: grid;
  width: 18px;
  height: 28px;
  place-items: center;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0 7px 7px 0;
  background: var(--annotation-color, var(--accent));
  color: white;
  padding: 0;
}

.save-shortcut-toggle:hover {
  filter: brightness(1.05);
}

.save-shortcut-toggle svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}

.save-shortcut-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 7px);
  z-index: 3;
  display: none;
  min-width: 148px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 98%, transparent);
  box-shadow: var(--shadow);
  padding: 5px;
}

.save-shortcut-menu.open {
  display: grid;
  gap: 3px;
}

.save-shortcut-menu button {
  height: 28px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 8px;
  text-align: left;
  font-size: 12px;
}

.save-shortcut-menu button:hover,
.save-shortcut-menu button.active {
  background: color-mix(in srgb, var(--annotation-color, var(--accent)) 14%, transparent);
  color: var(--text);
}

.paste-annotation {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel) 76%, transparent);
  color: var(--muted);
  padding: 0;
}

.paste-annotation:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.paste-annotation svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.close-annotation {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.close-annotation:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.close-annotation svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.save-annotation.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.save-annotation:hover {
  filter: brightness(1.05);
}

.save-annotation svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}

.mark-input,
.text-input {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: calc(2lh + 14px);
  max-height: 132px;
  border: 0;
  border-radius: 6px;
  padding: 7px 96px 38px 6px;
  outline: 0;
  background: transparent;
  color: transparent;
  caret-color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  overflow-y: auto;
  resize: none;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--soft) 34%, transparent) transparent;
}

.mark-input::-webkit-scrollbar,
.text-input::-webkit-scrollbar {
  width: 6px;
}

.mark-input::-webkit-scrollbar-track,
.text-input::-webkit-scrollbar-track {
  background: transparent;
}

.mark-input::-webkit-scrollbar-thumb,
.text-input::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--soft) 28%, transparent);
}

.mark-input::-webkit-scrollbar-thumb:hover,
.text-input::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--soft) 44%, transparent);
}

.mark-input::placeholder,
.text-input::placeholder {
  color: var(--muted);
}

.mark-input:placeholder-shown,
.text-input:placeholder-shown {
  color: var(--text);
}

.text-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.text-dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 9px;
  border: 2px solid white;
  border-radius: 99px;
  background: var(--annotation-color, var(--danger));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.resize-corner {
  --control-scale: var(--inverse-zoom, 1);
  position: absolute;
  box-sizing: border-box;
  display: block;
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  border: 2px solid white;
  border-radius: 0;
  background: var(--annotation-color, var(--accent));
  padding: 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: scale(var(--control-scale));
  transition: opacity 120ms ease;
}

.resize-corner-top-left {
  left: -7px;
  top: -7px;
  cursor: nwse-resize;
  transform-origin: center;
}

.resize-corner-bottom-right {
  right: -7px;
  bottom: -7px;
  cursor: nwse-resize;
  transform-origin: center;
}

.mark-box:hover .resize-corner,
.mark-box.resizing .resize-corner,
.mark-box.editing .resize-corner {
  opacity: 1;
}

.comments-head {
  justify-content: space-between;
  margin-bottom: 16px;
}

.comments-head > div {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: 4px;
}

.comments-head span {
  display: inline;
  color: var(--muted);
  font-size: 12px;
}

.comments-head strong {
  color: var(--muted);
  font-size: 14px;
}

.comment-filters {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.comment-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 6px;
}

.comment-search {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 84%, transparent);
  color: var(--muted);
  padding: 0 9px;
}

.comment-search:focus-within {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  color: var(--text);
}

.comment-search svg {
  width: 15px;
  height: 15px;
}

.comment-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.comment-search input::placeholder {
  color: var(--muted);
}

.comment-view-select-wrap {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  width: 84px;
  height: 34px;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 84%, transparent);
  color: var(--muted);
  padding: 0 6px;
}

.comment-view-select-wrap:hover,
.comment-view-select-wrap:focus-within {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text);
}

.comment-view-select-wrap svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.comment-view-select {
  width: 100%;
  height: 34px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: currentColor;
  padding: 0;
  font-size: 12px;
  color-scheme: dark;
}

.comment-view-select option {
  background: var(--panel);
  color: var(--text);
}

html[data-theme="light"] .comment-view-select {
  color-scheme: light;
}

.comment-list.view-text .comment-region-preview,
.comment-list.view-text .comment-reference-list {
  display: none;
}

.comment-list.view-thumbnail .comment-body.has-comment-media {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  grid-template-areas:
    "media title"
    "media text"
    "media refs";
  column-gap: 10px;
  align-items: start;
}

.comment-list.view-thumbnail .comment-body.has-comment-media .comment-title {
  grid-area: title;
}

.comment-list.view-thumbnail .comment-body.has-comment-media > p {
  grid-area: text;
}

.comment-list.view-thumbnail .comment-body.has-comment-media .comment-region-preview {
  grid-area: media;
  width: 76px;
  height: 54px;
  min-height: 0;
  margin: 2px 0 0;
  overflow: hidden;
}

.comment-list.view-thumbnail .comment-body.has-comment-media .comment-region-preview img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}

.comment-list.view-thumbnail .comment-body.has-comment-media .comment-reference-list {
  grid-area: media;
  margin: 2px 0 0;
}

.comment-list.view-thumbnail .comment-body.has-comment-media .comment-reference-thumb {
  width: 76px;
  height: 54px;
}

.comment-list.view-thumbnail .comment-body.has-comment-media .comment-reference-thumb img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}

.comment-filter-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 74%, transparent);
  padding: 3px;
}

.comment-filter-tab {
  min-width: 0;
  height: 26px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 5px;
  font-size: 12px;
  white-space: nowrap;
}

.comment-filter-tab:hover,
.comment-filter-tab.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text);
}

.compact {
  width: 32px;
  height: 32px;
}

.comment-list {
  display: grid;
  align-content: start;
  align-items: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;
}

.comment-list::-webkit-scrollbar {
  display: none;
}

.comment-page-group {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.comment-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 82%, transparent);
  color: var(--soft);
  padding: 0 9px;
}

.comment-page-header:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--panel-2));
  color: var(--text);
}

.comment-page-title {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.comment-page-title svg {
  width: 14px;
  height: 14px;
  transition: transform 140ms ease;
}

.comment-page-count {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.comment-page-items {
  display: grid;
  gap: 10px;
}

.comment-page-group.collapsed .comment-page-title svg {
  transform: rotate(-90deg);
}

.comment-page-group.collapsed .comment-page-items {
  display: none;
}

.comment {
  position: relative;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 12px 12px 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.comment[data-annotation-id] {
  cursor: pointer;
}

.comment[data-annotation-id]:hover,
.comment.hover-active,
.comment.playback-active,
.comment.active {
  border-color: color-mix(in srgb, var(--annotation-color, var(--accent)) 58%, var(--line));
  background: color-mix(in srgb, var(--annotation-color, var(--accent)) 14%, transparent);
  transform: translateY(-1px);
}

.comment-body {
  min-width: 0;
  width: 100%;
}

.comment-index-badge {
  position: absolute;
  left: 12px;
  top: 13px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--annotation-color, var(--accent)) 20%, transparent);
  color: color-mix(in srgb, var(--annotation-color, var(--accent)) 76%, white);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.comment-list.view-thumbnail .comment.video-comment .comment-body.has-comment-media {
  grid-template-columns: minmax(0, 1fr) 92px;
  grid-template-areas:
    "title media"
    "text media"
    "refs media";
}

.comment-list.view-thumbnail .comment.video-comment .comment-body.has-comment-media .comment-region-preview {
  width: 92px;
  height: 56px;
}

.comment-region-preview {
  display: block;
  width: 100%;
  margin: 8px 0 7px;
  border: 0;
  border-radius: 0;
  background: var(--panel-2);
  padding: 0;
  overflow: visible;
  transition:
    transform 140ms ease;
}

.comment-region-preview:hover,
.comment-region-preview:focus-visible {
  outline: 0;
  transform: translateY(-1px);
}

.comment-region-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 180px;
  border-radius: 0;
  object-fit: contain;
}

.comment-region-preview.loading {
  display: grid;
  min-height: 118px;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--annotation-color, var(--accent)) 34%, var(--line));
  background: color-mix(in srgb, var(--panel-2) 92%, transparent);
}

.comment-region-preview-placeholder {
  color: var(--muted);
  font-size: 12px;
}

.comment-reference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 7px;
}

.comment-reference-thumb {
  display: block;
  width: min(100%, 140px);
  max-width: 140px;
  height: auto;
  border: 0;
  border-radius: 0;
  background: var(--panel-2);
  padding: 0;
  transition:
    transform 140ms ease;
}

.comment-reference-thumb:hover,
.comment-reference-thumb:focus-visible {
  transform: translateY(-1px);
  outline: 0;
}

.comment-reference-thumb img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 140px;
  border-radius: 0;
  object-fit: contain;
}

.comment-image-preview {
  position: fixed;
  z-index: 100;
  display: grid;
  place-items: center;
  max-height: 240px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 97%, transparent);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(0.98);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.comment-image-preview.open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.comment-image-preview img {
  display: block;
  width: 100%;
  max-height: 224px;
  border-radius: 6px;
  object-fit: contain;
}

html[data-theme="light"] .comment {
  background: rgba(16, 24, 40, 0.025);
}

html[data-theme="light"] .comment[data-annotation-id]:hover,
html[data-theme="light"] .comment.hover-active,
html[data-theme="light"] .comment.playback-active,
html[data-theme="light"] .comment.active {
  background: color-mix(in srgb, var(--annotation-color, var(--accent)) 10%, white);
}

.comment-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.comment-title-page {
  flex: 0 0 auto;
  margin-left: auto;
  color: color-mix(in srgb, var(--muted) 82%, transparent);
}

.comment-title-meta {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.comment-title-time {
  color: color-mix(in srgb, var(--muted) 58%, transparent);
  font-size: 12px;
  font-weight: 400;
}

.comment p {
  margin: 5px 0 7px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
  }

  .resize-handle {
    display: none;
  }

  .rail {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr);
    gap: 14px;
    border-width: 0 0 1px;
    padding: 12px;
  }

  .brand {
    margin: 0;
  }

  .dropzone {
    min-height: 78px;
    grid-auto-flow: column;
    justify-content: start;
    padding: 12px;
  }

  .panel {
    display: none;
  }

  .workspace {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .statusbar {
    display: none;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    padding: 10px 12px;
  }

  .tools {
    order: 3;
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .tool {
    flex: 1;
  }

  .canvas-surface {
    width: 3600px;
    height: 4200px;
  }

  .page-stack {
    left: 1390px;
    top: 160px;
    width: 760px;
    gap: 24px;
  }

  .comments {
    max-height: 220px;
    overflow: hidden;
    border-width: 1px 0 0;
    padding: 12px 12px max(12px, env(safe-area-inset-bottom));
  }

  .comment-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(245px, 1fr);
    overflow: auto;
  }
}

@media (max-width: 560px) {
  html,
  body {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  html.mobile-panel-open,
  html.mobile-panel-open body {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: 100dvh;
    min-height: 100dvh;
  }

  .app.left-collapsed,
  .app.right-collapsed,
  .app.left-collapsed.right-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .app::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 24;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .app.mobile-panel-open::before {
    opacity: 1;
    pointer-events: auto;
  }

  .rail {
    position: fixed;
    z-index: 30;
    top: var(--mobile-topbar-height);
    bottom: var(--mobile-statusbar-height);
    left: 0;
    display: grid;
    width: min(82vw, 308px);
    grid-template-columns: 1fr;
    align-content: start;
    gap: 14px;
    border-width: 0 1px 0 0;
    padding: 14px;
    background: color-mix(in srgb, var(--panel) 96%, transparent);
    box-shadow: 18px 0 44px rgba(0, 0, 0, 0.38);
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
    transition: transform 210ms cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(18px);
  }

  .app.left-collapsed .rail {
    border-width: 0 1px 0 0;
    padding: 14px;
    opacity: 1;
    pointer-events: none;
    transform: translateX(calc(-100% - 18px));
  }

  .rail .panel {
    display: block;
    margin-top: 0;
  }

  .rail .dropzone {
    display: none;
  }

  .rail .brand {
    margin: 0;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 70;
    min-height: var(--mobile-topbar-height);
    padding: 8px 10px;
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  .workspace {
    grid-column: 1 / -1;
    grid-row: 1;
    display: block;
    padding-top: var(--mobile-topbar-height);
    padding-bottom: var(--mobile-statusbar-height);
  }

  .canvas-viewport {
    height: calc(100dvh - var(--mobile-topbar-height) - var(--mobile-statusbar-height));
  }

  .statusbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 78;
    display: flex;
    height: var(--mobile-statusbar-height);
    padding: 0 12px max(0px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(16px);
  }

  .statusbar-item {
    gap: 4px;
  }

  .statusbar-label,
  .statusbar-description,
  .status-zoom-slider {
    display: none;
  }

  .statusbar strong {
    max-width: 150px;
    font-size: 11px;
  }

  .statusbar-icon-toggle {
    width: 24px;
    height: 24px;
  }

  .tools {
    min-height: 40px;
    gap: 6px;
    padding: 3px;
  }

  .document-title #docSubtitle {
    display: none;
  }

  .actions {
    gap: 5px;
  }

  #languageBtn,
  #themeBtn {
    display: none;
  }

  .ghost,
  .tool {
    width: 36px;
    height: 36px;
  }

  #undoBtn {
    display: none;
  }

  .mobile-file-btn {
    display: none;
    height: 36px;
    align-items: center;
    justify-content: center;
    max-width: 118px;
    padding: 0 10px;
    font-weight: 400;
    line-height: 36px;
    white-space: nowrap;
  }

  .new-document-btn {
    height: 36px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .mobile-file-btn svg,
  .mobile-file-btn i {
    display: none;
  }

  .mobile-file-btn span {
    overflow: hidden;
    line-height: 1;
    text-overflow: ellipsis;
  }

  .primary {
    width: 36px;
    min-width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    flex: 0 0 36px;
    box-shadow: none;
  }

  .primary svg,
  .primary i {
    display: block;
    width: 18px;
    height: 18px;
    margin: 0;
  }

  .primary {
    font-size: 0;
    line-height: 0;
  }

  .primary span {
    display: none;
  }

  .zoom-readout {
    display: none;
  }

  .canvas-surface {
    width: 2600px;
    height: 3600px;
  }

  .page-stack {
    left: 1080px;
    top: 96px;
    width: min(390px, calc(100vw - 28px));
    gap: 18px;
  }

  .empty-state {
    align-items: start;
    padding-top: 34px;
  }

  .empty-state .placeholder {
    width: min(330px, 100%);
  }

  .empty-state .placeholder-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .empty-state .placeholder-action {
    justify-content: center;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
  }

  .doc-page {
    min-height: 520px;
  }

  .resize-handle {
    position: fixed;
    z-index: 32;
    top: 0;
    bottom: 0;
    display: block;
    width: 0;
    height: auto;
    transform: none;
    background: transparent;
    cursor: pointer;
  }

  .resize-handle::after {
    display: none;
  }

  .resize-handle-left {
    left: 0;
  }

  .resize-handle-right {
    right: 0;
  }

  .collapse-toggle {
    position: fixed;
    top: calc(var(--mobile-topbar-height) + (100dvh - var(--mobile-topbar-height) - var(--mobile-statusbar-height)) / 2);
    z-index: 82;
    width: 24px;
    height: 44px;
    border-color: color-mix(in srgb, var(--line) 78%, transparent);
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34);
    transform: translateY(-50%);
  }

  .collapse-toggle:hover {
    transform: translateY(-50%);
  }

  .collapse-toggle-left {
    left: 0;
    right: auto;
    border-radius: 0 8px 8px 0;
  }

  .app:not(.left-collapsed) .collapse-toggle-left {
    left: min(82vw, 308px);
  }

  .collapse-toggle-right {
    right: 0;
    left: auto;
    border-radius: 8px 0 0 8px;
  }

  .app:not(.right-collapsed) .collapse-toggle-right {
    right: min(88vw, 360px);
  }

  .comments {
    position: fixed;
    z-index: 31;
    top: var(--mobile-topbar-height);
    right: 0;
    bottom: var(--mobile-statusbar-height);
    width: min(88vw, 360px);
    max-height: none;
    grid-template-rows: auto auto minmax(0, 1fr);
    border-width: 0 0 0 1px;
    padding: 14px 10px 12px;
    background: color-mix(in srgb, var(--panel) 96%, transparent);
    box-shadow: -18px 0 44px rgba(0, 0, 0, 0.38);
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
    transition: transform 210ms cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(18px);
  }

  .app.right-collapsed .comments {
    border-width: 0 0 0 1px;
    padding: 14px 10px 12px;
    opacity: 1;
    pointer-events: none;
    transform: translateX(calc(100% + 18px));
  }

  .comments-head {
    margin-bottom: 8px;
  }

  .comment-filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    margin-bottom: 8px;
  }

  .comment-search {
    height: 30px;
  }

  .comment-search-row {
    grid-template-columns: minmax(0, 1fr) 76px;
  }

  .comment-view-select-wrap {
    width: 76px;
    height: 30px;
    padding: 0 5px;
  }

  .comment-filter-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .comment-filter-tab {
    height: 24px;
    font-size: 11px;
  }

  .comment-list {
    gap: 8px;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow: auto;
  }

  .comment-page-group {
    min-width: 0;
  }

  .comment {
    padding: 10px 10px 10px 36px;
  }

  .comment-index-badge {
    left: 10px;
    top: 11px;
  }

  .mobile-annotation-dock {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(var(--mobile-visual-bottom-inset) + var(--mobile-statusbar-height) + env(safe-area-inset-bottom));
    z-index: 80;
    display: block;
    pointer-events: none;
  }

  .mobile-zoom-control {
    display: none;
  }

  .mobile-annotation-dock:not(:empty) + .mobile-zoom-control {
    display: none;
  }

  .mobile-zoom-control input {
    width: 100%;
    accent-color: var(--accent);
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  .mobile-annotation-dock .annotation-editor {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    transform: none;
    transform-origin: center bottom;
    pointer-events: auto;
  }

  .mobile-annotation-dock .mark-editor,
  .mobile-annotation-dock .mark-editor.flipped,
  .mobile-annotation-dock .text-editor {
    transform: none;
  }

  .mobile-annotation-dock .annotation-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 30px;
    gap: 3px;
  }

  .mobile-annotation-dock .close-annotation {
    position: static;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: color-mix(in srgb, var(--panel-2) 90%, transparent);
    color: var(--soft);
    padding: 0;
  }

  .mobile-annotation-dock .close-annotation:hover {
    border-color: var(--line-strong);
    color: var(--text);
  }

  .mobile-annotation-dock .close-annotation svg {
    width: 15px;
    height: 15px;
    stroke-width: 2.2;
  }

  .mobile-annotation-dock .annotation-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 4px;
    font-size: 11px;
  }

  .mobile-annotation-dock .annotation-tab-dot {
    align-self: center;
  }

  .mobile-annotation-dock .save-shortcut-toggle,
  .mobile-annotation-dock .save-shortcut-menu {
    display: none !important;
  }

  .mobile-annotation-dock .save-annotation-group {
    gap: 0;
  }

  .mobile-annotation-dock .save-annotation-group .save-annotation {
    border-radius: 7px;
  }

  .mobile-annotation-dock .mark-input,
  .mobile-annotation-dock .text-input,
  .mobile-annotation-dock .inline-reference-list {
    font-size: 16px;
    line-height: 1.35;
  }

  .mobile-annotation-dock .save-annotation {
    width: 34px;
    height: 34px;
  }

  .magnifier-lens {
    width: 150px;
    height: 150px;
  }

  .magnifier-lens canvas {
    width: 150px;
    height: 150px;
  }
}
