:root {
  --bg: #f5f6f8;
  --card-bg: #ffffff;
  --border: #e2e4e9;
  --text: #1c1e21;
  --text-muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 8px;
}

* { box-sizing: border-box; }

/* .btn 등 display를 지정하는 클래스가 있어도 [hidden] 속성이 항상 우선하도록 강제한다. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: #eef2ff; color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: #f0f1f3; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.btn-block { width: 100%; }

.input, .textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 10px;
}
.textarea { resize: vertical; }

.page-center {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px;
  padding-top: 7.5vh;
  zoom: 1.6;
}

.page-content {
  width: 100%;
  max-width: 765px;
}

.upload-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  width: 100%;
  max-width: 612px;
}

/* 비밀번호/만료 안내 카드(officepin_password_gate.html, officepin_expired.html) 전용 —
   /officepin/review/f/, /a/ 링크에서 뜨는 화면이라 랜딩 페이지의 upload-card보다
   30% 더 작게 보이도록 별도 클래스로 분리한다. */
.upload-card.compact {
  zoom: 0.7;
}

.upload-columns { display: flex; align-items: stretch; gap: 16px; }
.upload-box {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.upload-box-title { font-weight: 600; margin: 0 0 12px; }
.upload-box .dropzone { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.upload-box form { display: flex; flex-direction: column; flex: 1; }
.upload-or {
  align-self: center;
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.logo-row { margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.logo { font-weight: 700; font-size: 18px; }
.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50% 50% 50% 4px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.page-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin-bottom: 28px;
}

.intro {
  width: 100%;
  margin-bottom: 28px;
  text-align: left;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.intro-text { min-width: 0; }
.intro p { margin: 0; }
.intro-muted {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.01em;
}
.intro-highlight {
  margin-top: 14px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.03em;
  color: var(--text);
}
.intro-highlight strong {
  color: var(--primary);
  font-weight: 800;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone.dragover { border-color: var(--primary); background: #eef2ff; }
.dropzone-title { font-weight: 600; margin: 0 0 6px; }
.dropzone-sub { color: var(--text-muted); font-size: 13px; margin: 0; }

.progress-bar {
  margin-top: 12px;
  height: 6px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill { height: 100%; width: 0%; background: var(--primary); transition: width 0.2s; }

.divider { display: flex; align-items: center; margin: 20px 0; color: var(--text-muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.divider span { padding: 0 10px; }

.hint { color: var(--text-muted); font-size: 12px; margin: 8px 0 0; }
.file-name { color: var(--text-muted); margin: 0 0 20px; }

.alert { padding: 10px 12px; border-radius: var(--radius); margin-bottom: 14px; font-size: 14px; }
.alert-error { background: var(--danger-bg); color: var(--danger); }

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

.link-block { margin-bottom: 18px; }
.link-block label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.link-row { display: flex; gap: 6px; }
.link-input { margin-bottom: 0; font-size: 12px; color: var(--text-muted); }
.checkbox-label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.checkbox-label input { width: auto; margin: 0; }

/* Viewer shell */
.viewer-shell { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.file-title { font-weight: 600; }
.provided-by-link { color: var(--primary); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.provided-by-link:hover { text-decoration: underline; }

.badge {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f0f1f3;
  color: var(--text-muted);
}
.badge.reviewing { background: #fef9c3; color: #854d0e; }
.badge.pending_approval { background: #dbeafe; color: #1d4ed8; }
.badge.approved { background: #dcfce7; color: #166534; }

.approved-banner {
  background: #dcfce7;
  color: #166534;
  padding: 8px 16px;
  font-size: 13px;
  text-align: center;
  flex-shrink: 0;
}

/* App shell / left sidebar */
.app-shell { display: flex; height: 100vh; }

.page-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  overflow: hidden;
  transition: width 0.15s, padding 0.15s, opacity 0.1s;
}
.page-sidebar.collapsed {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right: none;
  opacity: 0;
  pointer-events: none;
}

.sidebar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sidebar-logo { font-weight: 700; font-size: 15px; color: var(--text); text-decoration: none; white-space: nowrap; }
.sidebar-toggle-btn, .sidebar-expand-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
}
.sidebar-toggle-btn:hover, .sidebar-expand-btn:hover { background: #f0f1f3; }
.sidebar-expand-btn {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 40;
}

/* 사이드바가 접혀 펼치기(») 버튼이 뜨면, 그 버튼과 상단바의 file-title이 겹치지 않도록
   viewer-shell 쪽 상단바 왼쪽에 여백을 준다. */
#page-sidebar.collapsed ~ .viewer-shell .topbar-left { padding-left: 46px; }

.sidebar-new-page-btn { margin-bottom: 14px; white-space: nowrap; }

.sidebar-section-label { font-size: 12px; font-weight: 600; color: var(--text-muted); padding: 0 6px 6px; }
.sidebar-page-list { flex: 1; overflow-y: auto; margin-bottom: 10px; }
.sidebar-provided-by {
  display: block;
  flex-shrink: 0;
  padding: 10px 6px 2px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.sidebar-page-item {
  display: flex;
  align-items: center;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
}
.sidebar-page-item:hover { background: #f0f1f3; }
.sidebar-page-item.active { background: #eef2ff; color: var(--primary); font-weight: 600; }
.sidebar-page-item.dragging { opacity: 0.4; }
.sidebar-page-item.drag-over { box-shadow: inset 0 2px 0 var(--primary); }
.sidebar-drag-handle {
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  color: var(--text-muted);
  cursor: grab;
  visibility: hidden;
  font-size: 13px;
}
.sidebar-page-item:hover .sidebar-drag-handle { visibility: visible; }
.sidebar-page-link {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 8px 6px;
  color: inherit;
  text-decoration: none;
}
.sidebar-page-item .icon { flex-shrink: 0; }
.sidebar-page-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.sidebar-page-item .meta { flex-shrink: 0; font-size: 12px; }

.sidebar-page-actions { display: none; align-items: center; gap: 2px; padding-right: 6px; flex-shrink: 0; }
.sidebar-page-item:hover .sidebar-page-actions { display: flex; }
.sidebar-page-action {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
}
.sidebar-page-action:hover { background: #e5e7eb; }

/* Text page inline edit (nested inside the already-styled .text-wrap box) */
.text-edit { width: 100%; }
.text-edit-title { font-size: 20px; font-weight: 700; border: none; padding: 0 0 10px; margin-bottom: 10px; border-bottom: 1px solid var(--border); border-radius: 0; }
.text-edit-title:focus { outline: none; }
.text-edit-content { min-height: 400px; border: none; padding: 0; font-size: 15px; line-height: 1.7; }
.text-edit-content:focus { outline: none; }

/* Rich text (contenteditable) input areas: 텍스트 직접 작성 / 텍스트 페이지 편집 */
.rich-editable { white-space: pre-wrap; overflow-wrap: break-word; cursor: text; }
.rich-editable:empty:before { content: attr(data-placeholder); color: var(--text-muted); pointer-events: none; }

.rich-editable-counter {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  margin: -6px 0 10px;
}
.rich-editable-counter.over-limit { color: var(--danger); }

/* "텍스트 직접 작성" 완료 후 모달 밖(업로드 카드 안)으로 돌아왔을 때는, 글이 길어도
   페이지 전체가 같이 늘어나지 않도록 최대 15줄까지만 보이고 나머지는 스크롤한다.
   글을 넓게 쓸 때 쓰는 모달 안(.text-editor-modal-body)에서는 이 제한을 적용하지 않는다. */
.upload-box #text-upload-editable {
  max-height: 356px; /* line-height 1.6 * 14px 폰트 기준 15줄 + 상하 패딩 20px */
  overflow-y: auto;
  line-height: 1.6;
}

.rich-toolbar {
  position: fixed;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 2px;
  background: #1c1e21;
  color: #fff;
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.rich-toolbar[hidden] { display: none; }
.rich-toolbar-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}
.rich-toolbar-btn:hover { background: rgba(255,255,255,0.15); }
.rich-toolbar-btn.active { background: var(--primary); }
.rich-toolbar-size {
  height: 28px;
  border-radius: 5px;
  border: none;
  font-size: 12px;
  padding: 0 4px;
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.rich-toolbar-size option { color: #000; }
.rich-toolbar-color {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  position: relative;
}
.rich-toolbar-color:hover { background: rgba(255,255,255,0.15); }
.rich-toolbar-color input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  border: none;
  padding: 0;
  cursor: pointer;
}
.rich-toolbar-bg span { font-size: 14px; }

.text-editor-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
}
.text-editor-modal-box {
  width: 80vw;
  max-width: 900px;
  height: 78vh;
  background: var(--card-bg);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.text-editor-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  flex-shrink: 0;
}
.text-editor-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 4px;
}
.text-editor-modal-close:hover { color: var(--text); }
.text-editor-modal-body { flex: 1; overflow: auto; padding: 18px; }
.text-editor-modal-body .rich-editable {
  min-height: 100%;
  height: 100%;
  font-size: 16px;
  border: none;
  padding: 0;
  margin-bottom: 0;
}
.text-editor-modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.viewer-body { flex: 1; display: flex; min-height: 0; }
/* justify-content:center로 가운데 정렬하면 콘텐츠가 컨테이너보다 커졌을 때
   시작 쪽으로 넘친 부분이 스크롤로 닿지 않는 브라우저 버그가 있어, 대신
   콘텐츠 쪽에 margin:auto를 줘서 가운데 정렬한다. overflow-anchor는 폴링으로
   레이어가 갱신될 때 브라우저가 스크롤 위치를 임의로 보정해 드래그 팬이
   끊기는 것을 막기 위해 끈다. */
.content-pane { flex: 7; overflow: auto; overflow-anchor: none; background: #eceef1; display: flex; }
.content-container { padding: 24px; margin: auto; }
/* image-wrap/pdf-page-wrap/text-content가 각자 더 구체적인 cursor(crosshair, text)를
   지정하고 있어서 상위 .content-pane에만 cursor를 걸면 그 안에서는 무시된다.
   스페이스 팬 상태일 때는 자식 요소까지 명시적으로 손가락(grab) 커서로 덮어쓴다. */
.content-pane.space-pan,
.content-pane.space-pan .image-wrap,
.content-pane.space-pan .pdf-page-wrap,
.content-pane.space-pan .text-content { cursor: grab; }
.content-pane.space-panning,
.content-pane.space-panning .image-wrap,
.content-pane.space-panning .pdf-page-wrap,
.content-pane.space-panning .text-content { cursor: grabbing; }

.image-wrap, .pdf-page-wrap { position: relative; display: inline-block; transform-origin: top center; }
.image-wrap, .pdf-page-wrap { cursor: crosshair; }
.text-content { cursor: text; }
.image-wrap img { max-width: 100%; display: block; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
#pdf-canvas { display: block; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }

.text-wrap { position: relative; background: #fff; padding: 32px; max-width: 720px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); transform-origin: top center; }
.text-content { white-space: pre-wrap; line-height: 1.7; font-size: 15px; }
.text-content mark { background: #fde68a; cursor: pointer; }
.text-content mark.bounce { display: inline-block; animation: ic-mark-bounce 0.4s ease; }
.text-content mark.pending-select { background: #bfdbfe; cursor: text; }

@keyframes ic-mark-bounce {
  0% { transform: scale(1); }
  35% { transform: scale(1.12); }
  60% { transform: scale(0.97); }
  100% { transform: scale(1); }
}

.pin-layer { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.attachment-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

.pins-hidden .pin-layer, .pins-hidden .attachment-layer { display: none; }
.pins-hidden .text-content mark { background: transparent; cursor: text; pointer-events: none; }

.attachment-item {
  position: absolute;
  pointer-events: auto;
}
.attachment-item img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  border-radius: 4px;
}
.attachment-item.editable { cursor: pointer; }
.attachment-item.editable.dragging { cursor: grabbing; }
/* 마우스를 누른 채 옮길 수 있는 동안에만 테두리를 파란색으로 보여주고,
   손을 떼면(= pressed 클래스가 사라지면) 바로 사라진다. */
.attachment-item.editable.pressed img { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.attachment-resize {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border: 2px solid #fff;
  border-radius: 3px;
  cursor: nwse-resize;
  display: none;
}
.attachment-delete {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.attachment-item.deletable:hover .attachment-delete { display: flex; }
.attachment-item.editable:hover .attachment-resize { display: block; }
.attachment-item.highlight { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.pin {
  position: absolute;
  transform: translate(-50%, -100%);
  width: 26px;
  height: 26px;
  border-radius: 50% 50% 50% 0;
  background: var(--danger);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transform-origin: bottom center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  pointer-events: auto;
}
.pin.resolved { background: #9ca3af; }
/* .pin 자체는 border-radius로만 물방울(핀) 모양을 내고 있어 실제로 회전되어
   있지 않으므로, 안쪽 숫자에 반대 회전을 걸 필요가 없다. 예전 코드가 남아있던
   rotate(-45deg)가 숫자만 기울어져 보이게 하고 있었다. */
.pin-shape { display:flex; align-items:center; justify-content:center; width:100%; height:100%;}

.pin-tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: #1c1e21;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  display: none;
  pointer-events: none;
}
.pin:hover .pin-tooltip { display: block; }

.comment-sidebar {
  flex: 3;
  min-width: 280px;
  max-width: 400px;
  border-left: 1px solid var(--border);
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
}
.comment-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.comment-list { flex: 1; overflow-y: auto; padding: 10px; }
.comment-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}
.comment-card.highlight { border-color: var(--primary); box-shadow: 0 0 0 2px #dbeafe; }
.comment-card-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; flex-shrink: 0;
}
.comment-nick { font-weight: 600; font-size: 13px; }
.comment-time { color: var(--text-muted); font-size: 11px; margin-left: auto; }
.comment-body { font-size: 13px; line-height: 1.6; white-space: pre-wrap; margin: 0 0 8px; }
.comment-actions { display: flex; gap: 6px; }
.comment-actions button {
  background: none; border: none; color: var(--text-muted);
  font-size: 12px; cursor: pointer; padding: 2px 4px;
}
.comment-actions button:hover { color: var(--primary); }
.comment-replies { margin-top: 8px; padding-left: 12px; border-left: 2px solid var(--border); }
.reply-form { display: none; margin-top: 8px; }
.reply-form.open { display: block; }
.empty-state { color: var(--text-muted); font-size: 13px; text-align: center; padding: 30px 10px; }

.attachment-card-thumb { margin-bottom: 8px; border-radius: 6px; overflow: hidden; background: #f0f1f3; }
.attachment-card-thumb img { width: 100%; max-height: 160px; object-fit: contain; display: block; }
.attachment-card-label { color: var(--text-muted); }

.bottom-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  font-size: 13px;
}
.page-nav, .zoom-ctrl, .toolbar-right { display: flex; align-items: center; gap: 8px; }
.page-nav { min-width: 120px; }
#zoom-slider { width: 120px; }
#pin-visible-btn.active { background: #eef2ff; color: var(--primary); border-color: var(--primary); }

.popover {
  position: fixed;
  width: 300px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  z-index: 100;
  padding: 14px;
}
.popover-header { font-weight: 600; margin-bottom: 10px; }
.popover-field { margin-bottom: 8px; }
.popover-field label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.popover-actions { display: flex; justify-content: flex-end; gap: 6px; }

.history-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 340px;
  background: var(--card-bg);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  z-index: 90;
  display: flex;
  flex-direction: column;
}
.history-panel[hidden] { display: none; }
.history-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600;
}
.history-list { flex: 1; overflow-y: auto; padding: 10px 16px; }
.history-item { padding: 10px 0; border-bottom: 1px solid #f0f1f3; font-size: 13px; }
.history-item .h-meta { color: var(--text-muted); font-size: 11px; margin-bottom: 3px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: #fff; border-radius: 10px; padding: 22px; max-width: 360px; width: 90%;
}
.share-modal-box { max-width: 480px; text-align: left; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
