/* Anotar PDF page. Shared PDF CSS stays; this file only restyles this page. */
.anpdf-page {
  --an-ink: #172033;
  --an-body: #3d4658;
  --an-muted: #64748b;
  --an-line: #e3e9f1;
  --an-blue: #2563eb;
  --an-blue-dark: #1d4ed8;
  --an-aside-w: 220px;
  --an-side-w: 268px;
  display: grid;
  grid-template-columns: var(--an-aside-w) minmax(0, 1fr);
  gap: 18px 22px;
  align-items: start;
  margin: 4px 0 28px;
}

.anpdf-aside { display: flex; flex-direction: column; min-width: 0; padding-top: 4px; }

.anpdf-title {
  margin: 0 0 12px;
  color: var(--an-ink);
  font-size: clamp(1.9rem, 2.6vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.98;
  text-align: left;
}

.article .anpdf-lede {
  margin: 0 0 18px;
  color: #3b4d9a;
  font-size: 0.98rem;
  line-height: 1.45;
  text-align: left;
}

.article .anpdf-perks,
.article .anpdf-tip-list,
.article .anpdf-marks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.article .anpdf-perks { display: grid; gap: 14px; }

.article .anpdf-perks li,
.article .anpdf-tip-list li,
.article .anpdf-marks li { margin: 0; padding: 0; }

.article .anpdf-perks li::before,
.article .anpdf-marks li::before { content: none; }

.article .anpdf-perks li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--an-body);
  font-size: 0.82rem;
  line-height: 1.3;
  text-align: left;
}

.anpdf-perks strong { display: block; color: var(--an-ink); font-size: 0.9rem; }

.anpdf-perk {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  background: #fff center / 20px no-repeat;
}

.anpdf-perk.is-online {
  background-color: #dcfce7;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2316a34a' d='M12 2 5 5v6.2c0 4.4 2.9 8.2 7 9.3 4.1-1.1 7-4.9 7-9.3V5z'/%3E%3Cpath d='m8.2 12.1 2.4 2.4 5-5.2' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.anpdf-perk.is-fast {
  background-color: #ffe4e6;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23e11d48' d='M13.5 2 4.5 13.5h6.2L9.8 22l9-11.5h-6.2z'/%3E%3C/svg%3E");
}

.anpdf-perk.is-easy {
  background-color: #dbeafe;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%232563eb' d='M14 2H6.5A2.5 2.5 0 0 0 4 4.5v15A2.5 2.5 0 0 0 6.5 22h11a2.5 2.5 0 0 0 2.5-2.5V8z'/%3E%3Cpath fill='%23fff' d='M8 12h8v1.6H8zm0 3.4h6V17H8z'/%3E%3C/svg%3E");
}

.anpdf-perk.is-device {
  background-color: #ede9fe;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2'%3E%3Crect x='8' y='2' width='8' height='20' rx='2'/%3E%3Cpath d='M11 18h2'/%3E%3C/svg%3E");
}

.article img.anpdf-art {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 16px 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

body.page-anotar-pdf-online .cpdf-app {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.page-anotar-pdf-online .cpdf-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--an-side-w);
  gap: 14px;
  align-items: start;
}

body.page-anotar-pdf-online .cpdf-main {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.anpdf-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--an-line);
  border-radius: 16px;
  background: #fff;
}

.anpdf-top #anpdf-clear { margin-left: auto; }

.anpdf-ico,
.anpdf-glyph,
.anpdf-iconbtn svg,
.anpdf-nav svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.anpdf-ico { width: 18px; height: 18px; flex: none; }

body.page-anotar-pdf-online .cpdf-app .cpdf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 12px;
}

body.page-anotar-pdf-online .cpdf-app #anpdf-pick,
body.page-anotar-pdf-online .cpdf-app #anpdf-save {
  border-color: var(--an-blue-dark);
  background: linear-gradient(180deg, #2f6ff0, #1d5ad6);
}

.anpdf-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--an-line);
  border-radius: 16px;
  background: #fff;
}

.anpdf-tool {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 64px;
  min-height: 58px;
  padding: 6px 8px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.1;
  cursor: pointer;
}

.anpdf-tool.is-active {
  border-color: var(--an-blue);
  color: var(--an-blue-dark);
  box-shadow: inset 0 0 0 1px var(--an-blue);
}

.anpdf-glyph { width: 22px; height: 22px; }

.anpdf-inkbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.anpdf-colors { display: flex; align-items: center; gap: 6px; }

.anpdf-swatch {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #d5deea;
  cursor: pointer;
}

.anpdf-swatch.is-active { box-shadow: 0 0 0 2px var(--an-blue); }

.anpdf-size {
  display: grid;
  gap: 2px;
  min-width: 92px;
  color: var(--an-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.anpdf-size input {
  width: 92px;
  height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--an-blue);
}

.anpdf-frame {
  overflow: hidden;
  border: 1px solid var(--an-line);
  border-radius: 16px;
  background: #fff;
}

.anpdf-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--an-line);
  background: #f8fafc;
}

.anpdf-iconbtn,
.anpdf-zoomlabel {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--an-line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 1rem;
  font-weight: 750;
  cursor: pointer;
}

.anpdf-iconbtn svg { width: 16px; height: 16px; }

.anpdf-iconbtn:disabled,
.anpdf-zoomlabel:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#anpdf-page-label {
  min-width: 3.2rem;
  color: var(--an-ink);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

.anpdf-zoomlabel { font-size: 0.78rem; }

.anpdf-nav #anpdf-undo { margin-left: auto; }

.anpdf-canvas-wrap { min-height: 460px; background: #d7dde8; }

.anpdf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 460px;
  padding: 24px;
  color: #475569;
  text-align: center;
  cursor: pointer;
}

.anpdf-empty strong { color: var(--an-ink); font-size: 1rem; }
.anpdf-empty span { font-size: 0.84rem; }
.anpdf-empty.is-dragover { background: #e7eefc; }

.anpdf-empty[hidden],
.anpdf-workspace[hidden],
.anpdf-marks[hidden],
.anpdf-text-pop[hidden],
#anpdf-thumbs-empty[hidden] { display: none !important; }

.anpdf-stage {
  max-height: min(720px, 68vh);
  overflow: auto;
  padding: 18px 12px 22px;
  text-align: center;
}

.anpdf-sheet {
  position: relative;
  display: inline-block;
  line-height: 0;
  text-align: left;
}

body.page-anotar-pdf-online #anpdf-pdf,
body.page-anotar-pdf-online #anpdf-ink {
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  background: #fff;
}

body.page-anotar-pdf-online #anpdf-pdf { box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16); }

body.page-anotar-pdf-online #anpdf-ink {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  box-shadow: none;
  touch-action: none;
  cursor: crosshair;
}

.article .anpdf-marks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.article .anpdf-mark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--an-line);
  border-radius: 10px;
  background: #fff;
  color: var(--an-body);
  font-size: 0.82rem;
  text-align: left;
}

.article .anpdf-status,
.anpdf-status {
  margin: 0;
  color: var(--an-muted);
  font-size: 0.84rem;
  text-align: left;
}

.anpdf-text-pop {
  position: fixed;
  z-index: 40;
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--an-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.16);
}

.anpdf-text-pop input {
  min-width: 160px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--an-line);
  border-radius: 8px;
  font: inherit;
}

body.page-anotar-pdf-online .cpdf-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  background: transparent;
}

body.page-anotar-pdf-online .cpdf-card {
  padding: 14px;
  border: 1px solid var(--an-line);
  border-radius: 16px;
  background: #fff;
}

body.page-anotar-pdf-online .cpdf-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--an-ink);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  opacity: 1;
}

.anpdf-card-ico {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  background: #e8f0fe center / 16px no-repeat;
}

.anpdf-card-ico.is-pages {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%232563eb' d='M7 3h8l4 4v14H7z'/%3E%3Cpath fill='%23fff' d='M15 3v4h4'/%3E%3C/svg%3E");
}

.anpdf-card-ico.is-bulb {
  background-color: #fff4d6;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23f5b400' d='M12 2a7 7 0 0 0-4 12.7V17h8v-2.3A7 7 0 0 0 12 2z'/%3E%3Cpath fill='%23f5b400' d='M9 19h6v1.4a2 2 0 0 1-2 1.6h-2a2 2 0 0 1-2-1.6z'/%3E%3C/svg%3E");
}

.anpdf-card-ico.is-down {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 11l5 5 5-5M5 20h14'/%3E%3C/svg%3E");
}

.anpdf-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.anpdf-thumb {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 6px 4px 4px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #f4f7fb;
  cursor: pointer;
}

.anpdf-thumb.is-on {
  border-color: var(--an-blue);
  background: #eff6ff;
}

.anpdf-thumb canvas {
  width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.anpdf-thumb span {
  color: var(--an-muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.anpdf-thumbs-empty {
  margin: 0;
  color: var(--an-muted);
  font-size: 0.82rem;
  text-align: left;
}

.article .anpdf-tip-list { display: grid; gap: 8px; counter-reset: anpdf-tip; }

.article .anpdf-tip-list li {
  position: relative;
  padding: 1px 0 1px 28px;
  color: var(--an-body);
  font-size: 0.84rem;
  line-height: 1.35;
  text-align: left;
  counter-increment: anpdf-tip;
}

.article .anpdf-tip-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23f5b400'/%3E%3Cpath d='m7 12.4 3.2 3.2L17 9' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

body.page-anotar-pdf-online .cpdf-card.anpdf-tips { background: #fff8e8; border-color: #f6e3b0; }

.article .anpdf-save-card p {
  margin: 0 0 12px;
  color: var(--an-body);
  font-size: 0.84rem;
  line-height: 1.4;
  text-align: left;
}

.anpdf-save { width: 100%; }

@media (min-width: 1360px) {
  .anpdf-page {
    --an-stage-w: min(1560px, calc(100vw - 96px));
    --an-aside-w: clamp(210px, 16vw, 260px);
    --an-side-w: clamp(250px, 18vw, 300px);
    width: var(--an-stage-w);
    margin-left: calc((100% - var(--an-stage-w)) / 2);
  }
}

@media (max-width: 980px) {
  .anpdf-page { grid-template-columns: minmax(0, 1fr); }
  .article .anpdf-perks,
  .article img.anpdf-art { display: none; }
  body.page-anotar-pdf-online .cpdf-shell { grid-template-columns: minmax(0, 1fr); }
  .anpdf-inkbar { margin-left: 0; }
}

@media (max-width: 640px) {
  .anpdf-title { font-size: 1.85rem; }
  .anpdf-top #anpdf-clear { margin-left: 0; }
  .anpdf-top .cpdf-btn { flex: 1; }
  .anpdf-nav #anpdf-undo { margin-left: 0; }
  .anpdf-canvas-wrap,
  .anpdf-empty { min-height: 320px; }
}

html[data-theme="dark"] .anpdf-page {
  --an-ink: #f1f5f9;
  --an-body: #cbd5e1;
  --an-muted: #94a3b8;
  --an-line: #334155;
}

html[data-theme="dark"] .article .anpdf-lede { color: #a5b4fc; }

html[data-theme="dark"] .anpdf-top,
html[data-theme="dark"] .anpdf-tools,
html[data-theme="dark"] .anpdf-tool,
html[data-theme="dark"] .anpdf-frame,
html[data-theme="dark"] .anpdf-iconbtn,
html[data-theme="dark"] .anpdf-zoomlabel,
html[data-theme="dark"] body.page-anotar-pdf-online .cpdf-card,
html[data-theme="dark"] .article .anpdf-mark,
html[data-theme="dark"] .anpdf-text-pop {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

html[data-theme="dark"] .anpdf-nav { background: #0f172a; }
html[data-theme="dark"] .anpdf-canvas-wrap,
html[data-theme="dark"] .anpdf-stage { background: #0b1220; }
html[data-theme="dark"] .anpdf-thumb { background: #0f172a; }
html[data-theme="dark"] .anpdf-tool.is-active { color: #93c5fd; }
html[data-theme="dark"] body.page-anotar-pdf-online .cpdf-card.anpdf-tips { background: #2a2416; border-color: #4a3d1c; }
html[data-theme="dark"] body.page-anotar-pdf-online .cpdf-app .cpdf-btn:not(.cpdf-btn-primary) {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
