.article-body {
  -webkit-user-select: text;
  user-select: text;
}

.reader-highlight {
  border-radius: 4px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 238, 150, 0) 8%,
      rgba(255, 225, 94, 0.58) 8%,
      rgba(255, 225, 94, 0.72) 88%,
      rgba(255, 238, 150, 0) 88%
    );
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  cursor: pointer;
  padding: 0 0.05em;
}

.reader-highlight:focus-visible {
  outline: 2px solid rgba(166, 94, 56, 0.55);
  outline-offset: 2px;
}

.highlight-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 5px;
  border: 1px solid rgba(116, 98, 68, 0.26);
  border-radius: 8px;
  background: rgba(255, 252, 245, 0.96);
  box-shadow: 0 18px 38px rgba(38, 34, 27, 0.18);
  backdrop-filter: blur(16px);
}

.highlight-toolbar.is-visible {
  display: flex;
}

.highlight-toolbar button,
.highlight-sync-button,
.highlight-sync-panel button {
  min-height: 32px;
  border: 1px solid rgba(116, 98, 68, 0.22);
  border-radius: 7px;
  background: rgba(255, 248, 235, 0.82);
  color: #26221b;
  padding: 0 11px;
  cursor: pointer;
}

.highlight-toolbar button:hover,
.highlight-sync-button:hover,
.highlight-sync-panel button:hover {
  background: #fff2c6;
}

.highlight-toolbar [data-highlight-action="remove"] {
  color: #7d3f25;
}

.highlight-toolbar[data-mode="create"] [data-highlight-action="remove"],
.highlight-toolbar[data-mode="remove"] [data-highlight-action="create"] {
  display: none;
}

.highlight-sync-button {
  width: 100%;
  min-height: 38px;
  text-align: left;
}

.highlight-sync-state {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.highlight-sync-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  background: rgba(38, 34, 27, 0.22);
}

.highlight-sync-backdrop.is-visible {
  display: block;
}

.highlight-sync-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 71;
  display: none;
  width: min(420px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  border: 1px solid rgba(116, 98, 68, 0.24);
  border-radius: 8px;
  background: #fffaf1;
  box-shadow: 0 26px 70px rgba(38, 34, 27, 0.24);
}

.highlight-sync-panel.is-visible {
  display: block;
}

.highlight-sync-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.highlight-sync-panel strong {
  font-family: var(--serif);
  font-size: 20px;
}

.highlight-sync-close {
  width: 32px;
  min-width: 32px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.highlight-sync-body {
  padding: 16px 18px 18px;
}

.highlight-sync-body label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.highlight-sync-body input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.highlight-sync-body input:focus {
  border-color: rgba(166, 94, 56, 0.55);
  box-shadow: 0 0 0 3px rgba(166, 94, 56, 0.12);
}

.highlight-sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.highlight-sync-actions button:first-child {
  background: #ffe15e;
  border-color: rgba(166, 94, 56, 0.28);
}

.highlight-sync-message {
  min-height: 20px;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.mobile-sync-slot {
  display: none;
}

@media (max-width: 860px) {
  .highlight-toolbar {
    top: auto;
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: 14px;
    justify-content: center;
    min-height: 48px;
  }

  .highlight-toolbar button {
    flex: 1;
    min-height: 38px;
  }

  .mobile-sync-slot {
    display: block;
  }

  .highlight-sync-panel {
    top: auto;
    bottom: max(14px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
  }
}
