:root {
  --cneip-wine: #8f2234;
  --cneip-wine-dark: #711928;
  --cneip-ink: #232529;
  --cneip-muted: #67717e;
  --cneip-line: #dfe3e8;
  --cneip-surface: #f1f3f5;
  --cneip-paper: #ffffff;
  --cneip-bar-h: 82px;
  --cneip-foot-h: 42px;
  --cneip-shadow: 0 18px 44px rgba(19, 25, 31, .14);
}

html.cneip_epub_reader_document,
body.cneip_epub_reader {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--cneip-surface);
}

body.cneip_epub_reader {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--cneip-ink);
}

.cneip-epub,
.cneip-epub * {
  box-sizing: border-box;
}

.cneip-epub {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--cneip-surface);
  color: var(--cneip-ink);
  z-index: 9999;
}

.cneip-readerbar {
  position: relative;
  z-index: 40;
  min-height: var(--cneip-bar-h);
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(300px, 2fr) auto;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, .98);
  border-bottom: 1px solid var(--cneip-line);
  box-shadow: 0 1px 8px rgba(24, 31, 38, .04);
}

.cneip-readerbar__return {
  align-self: center;
  color: var(--cneip-wine);
  text-decoration: none;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
}

.cneip-readerbar__return:hover,
.cneip-readerbar__return:focus-visible {
  color: var(--cneip-wine-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cneip-readerbar__identity {
  min-width: 0;
  text-align: center;
}

.cneip-readerbar__eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #747c86;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.cneip-readerbar__section {
  overflow: hidden;
  color: var(--cneip-ink);
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cneip-readerbar__document {
  margin-top: 2px;
  overflow: hidden;
  color: #808690;
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cneip-readerbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.cneip-icon-button,
.cneip-panel__close {
  border: 1px solid #d6dce2;
  background: #fff;
  color: #33383d;
  cursor: pointer;
}

.cneip-icon-button {
  min-width: 42px;
  height: 42px;
  border-radius: 9px;
  font: inherit;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-weight: 700;
}

.cneip-icon-button:hover,
.cneip-icon-button:focus-visible {
  border-color: #b8c0c8;
  background: #f7f8f9;
}

.cneip-readerbar__download {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border-radius: 9px;
  background: var(--cneip-wine);
  color: #fff;
  text-decoration: none;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.cneip-readerbar__download:hover,
.cneip-readerbar__download:focus-visible {
  background: var(--cneip-wine-dark);
  color: #fff;
}

.cneip-readerbar__download-short {
  display: none;
}

.cneip-reader-notice {
  grid-column: 1 / -1;
  padding: 7px 10px;
  border-radius: 7px;
  background: #fff3cd;
  color: #694f00;
  font-size: 12px;
}

.cneip-reader-shell {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: var(--cneip-surface);
}

.cneip-reader-stage {
  position: absolute;
  inset: 0;
  background: var(--cneip-surface);
}

.cneip-epub-viewport {
  position: absolute;
  inset-block: 18px;
  inset-inline: 4.5%;
  overflow: hidden;
  border: 1px solid #e4e7ea;
  border-radius: 13px;
  background: var(--cneip-paper);
  box-shadow: 0 9px 24px rgba(22, 28, 34, .08);
  transition: inset .2s ease, background .2s ease;
}

.cneip-epub[data-reading-width="narrow"] .cneip-epub-viewport {
  inset-inline: 13%;
}

.cneip-epub[data-reading-width="balanced"] .cneip-epub-viewport {
  inset-inline: 6.5%;
}

.cneip-epub[data-reading-width="wide"] .cneip-epub-viewport {
  inset-inline: 2.2%;
}

.cneip-reader-status {
  position: absolute;
  z-index: 15;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(560px, 82vw);
  padding: 14px 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--cneip-shadow);
  font-size: 14px;
  line-height: 1.45;
}

.cneip-reader-status.is-error {
  color: #8f1d28;
  border: 1px solid #e6b4ba;
}

.cneip-status-retry {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: var(--cneip-wine);
  color: #fff;
  cursor: pointer;
}

.cneip-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid #d5d9dd;
  border-top-color: var(--cneip-wine);
  border-radius: 50%;
  animation: cneip-spin .8s linear infinite;
}

.cneip-reader-status.is-error .cneip-spinner {
  display: none;
}

@keyframes cneip-spin {
  to { transform: rotate(360deg); }
}

.cneip-nav-arrow {
  position: absolute;
  z-index: 5;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 76px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 2px 14px rgba(0, 0, 0, .10);
  color: var(--cneip-wine);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.cneip-nav-arrow:hover,
.cneip-nav-arrow:focus-visible {
  background: #fff;
}

.cneip-nav-arrow--prev { left: 8px; }
.cneip-nav-arrow--next { right: 8px; }

.cneip-panel,
.cneip-context-panel,
.cneip-annotation-panel {
  position: absolute;
  z-index: 25;
  top: 0;
  bottom: 0;
  width: min(420px, 90vw);
  background: #fff;
  box-shadow: var(--cneip-shadow);
  overflow: auto;
  padding: 0 0 28px;
}

.cneip-panel--left {
  left: 0;
  border-right: 1px solid var(--cneip-line);
}

.cneip-panel--right,
.cneip-context-panel,
.cneip-annotation-panel {
  right: 0;
  border-left: 1px solid var(--cneip-line);
}

.cneip-panel--wide {
  width: min(650px, 94vw);
}

.cneip-panel[hidden],
.cneip-panel-scrim[hidden],
.cneip-context-panel[hidden],
.cneip-annotation-panel[hidden],
.cneip-figure-viewer[hidden] {
  display: none !important;
}

.cneip-panel-scrim {
  position: absolute;
  z-index: 20;
  inset: 0;
  border: 0;
  background: rgba(23, 25, 28, .30);
  cursor: default;
}

.cneip-panel__header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 22px 15px;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--cneip-line);
  backdrop-filter: blur(8px);
}

.cneip-panel__header h2 {
  margin: 2px 0 0;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.2;
}

.cneip-panel__kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cneip-wine);
}

.cneip-panel__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #666;
  font-size: 28px;
  line-height: 1;
}

.cneip-panel__close:hover,
.cneip-panel__close:focus-visible {
  background: #f2f3f5;
  color: var(--cneip-wine);
}

.cneip-toc-filter {
  padding: 15px 18px 6px;
}

.cneip-toc-filter label,
.cneip-search label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #4c545d;
}

.cneip-toc-filter input,
.cneip-search input {
  width: 100%;
  height: 41px;
  border: 1px solid #cbd1d7;
  border-radius: 8px;
  padding: 0 11px;
  font: inherit;
}

.cneip-toc-filter input:focus,
.cneip-search input:focus {
  border-color: var(--cneip-wine);
  outline: 2px solid rgba(143, 34, 52, .15);
}

.cneip-toc {
  padding: 7px 11px 16px;
}

.cneip-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cneip-toc__list--1,
.cneip-toc__list--2,
.cneip-toc__list--3,
.cneip-toc__list--4 {
  margin-left: 12px;
  padding-left: 8px;
  border-left: 1px solid #eceff1;
}

.cneip-toc__item[hidden] {
  display: none;
}

.cneip-toc__link {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  color: #34383c;
  font: inherit;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.34;
  cursor: pointer;
}

.cneip-toc__link:hover,
.cneip-toc__link:focus-visible {
  background: #f3f4f5;
  color: var(--cneip-wine);
}

.cneip-toc__link.is-active {
  background: #f4e8eb;
  color: var(--cneip-wine-dark);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--cneip-wine);
}

.cneip-empty {
  padding: 16px;
  color: var(--cneip-muted);
  font-size: 14px;
  line-height: 1.5;
}

.cneip-search {
  padding: 18px 20px 10px;
}

.cneip-search__row {
  display: flex;
  gap: 7px;
}

.cneip-search__row input {
  min-width: 0;
  flex: 1;
}

.cneip-search__row button,
.cneip-secondary-button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 13px;
  background: var(--cneip-wine);
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.cneip-search__status {
  padding: 4px 20px 10px;
  color: var(--cneip-muted);
  font-size: 12px;
}

.cneip-search__results {
  padding: 0 12px;
}

.cneip-search-result {
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid #eee;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.cneip-search-result:hover,
.cneip-search-result:focus-visible {
  background: #f7f7f8;
}

.cneip-search-result__body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.cneip-search-result__section {
  color: var(--cneip-wine);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.cneip-search-result__excerpt {
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.45;
}

.cneip-search-result__go {
  flex: 0 0 auto;
  color: var(--cneip-wine);
  font-size: 11px;
  font-weight: 750;
}

.cneip-settings {
  padding: 18px 20px;
}

.cneip-settings fieldset {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.cneip-settings legend {
  margin-bottom: 9px;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
}

.cneip-segmented {
  display: flex;
  align-items: stretch;
  border: 1px solid #d3d7dc;
  border-radius: 9px;
  overflow: hidden;
}

.cneip-segmented button,
.cneip-segmented output {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  border: 0;
  border-right: 1px solid #d3d7dc;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
  text-align: center;
}

.cneip-segmented button:last-child,
.cneip-segmented output:last-child {
  border-right: 0;
}

.cneip-segmented button {
  cursor: pointer;
}

.cneip-segmented button:hover,
.cneip-segmented button:focus-visible {
  background: #f7f7f8;
}

.cneip-segmented button.is-active {
  background: #f0e7e9;
  color: var(--cneip-wine);
  font-weight: 750;
}

.cneip-theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cneip-theme-grid button {
  min-height: 42px;
  border: 1px solid #d4d9de;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  cursor: pointer;
}

.cneip-theme-grid button.is-active {
  outline: 2px solid var(--cneip-wine);
  outline-offset: 1px;
}

.cneip-theme-grid button[data-theme="sepia"] { background: #f5efe3; }
.cneip-theme-grid button[data-theme="dark"] { background: #17191c; color: #fff; }
.cneip-theme-grid button[data-theme="contrast"] { background: #000; color: #ffdf00; }

.cneip-reset {
  width: 100%;
  min-height: 40px;
  border: 1px solid #d4d9de;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  cursor: pointer;
}

.cneip-resource-tabs {
  position: sticky;
  top: 78px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-bottom: 1px solid var(--cneip-line);
}

.cneip-resource-tabs button {
  min-height: 48px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: #fff;
  color: #525a64;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.cneip-resource-tabs button span {
  display: inline-flex;
  min-width: 19px;
  justify-content: center;
  margin-left: 3px;
  padding: 1px 4px;
  border-radius: 99px;
  background: #eef0f2;
  font-size: 10px;
}

.cneip-resource-tabs button.is-active,
.cneip-resource-tabs button[aria-selected="true"] {
  color: var(--cneip-wine);
  border-bottom-color: var(--cneip-wine);
}

.cneip-resource-status {
  padding: 11px 18px 5px;
  color: var(--cneip-muted);
  font-size: 11px;
}

.cneip-resource-content {
  padding: 8px 13px 20px;
}

.cneip-resource-list {
  display: grid;
  gap: 8px;
}

.cneip-resource-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid #e1e5e9;
  border-radius: 10px;
  background: #fff;
}

.cneip-resource-card__number {
  display: inline-flex;
  min-width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f3e8eb;
  color: var(--cneip-wine);
  font-size: 10px;
  font-weight: 800;
}

.cneip-resource-card__body {
  min-width: 0;
}

.cneip-resource-card h3 {
  margin: 0;
  color: #2f3337;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.38;
}

.cneip-resource-card p {
  margin: 5px 0 0;
  color: var(--cneip-muted);
  font-size: 11px;
  line-height: 1.42;
}

.cneip-resource-card__go {
  border: 0;
  background: transparent;
  color: var(--cneip-wine);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}

.cneip-resource-card__go:disabled {
  color: #999;
  cursor: default;
}

.cneip-info-card {
  padding: 5px;
}

.cneip-metadata-list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(100px, .6fr) minmax(0, 1.4fr);
  border: 1px solid #e1e5e9;
  border-radius: 10px;
  overflow: hidden;
}

.cneip-metadata-list dt,
.cneip-metadata-list dd {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid #e8ebee;
}

.cneip-metadata-list dt {
  background: #f7f8f9;
  color: #59616a;
  font-size: 11px;
  font-weight: 800;
}

.cneip-metadata-list dd {
  color: #2c3035;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.cneip-metadata-list dt:last-of-type,
.cneip-metadata-list dd:last-of-type {
  border-bottom: 0;
}

.cneip-context-panel,
.cneip-annotation-panel {
  width: min(510px, 92vw);
}

.cneip-context-panel.is-visible,
.cneip-annotation-panel.is-visible {
  animation: cneip-panel-in .16s ease-out;
}

@keyframes cneip-panel-in {
  from { transform: translateX(14px); opacity: .6; }
  to { transform: translateX(0); opacity: 1; }
}

.cneip-context-panel__content {
  padding: 20px;
  color: #2d3136;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.62;
}

.cneip-context-panel__content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.cneip-context-panel__content th,
.cneip-context-panel__content td {
  border: 1px solid #dadddf;
  padding: 7px;
  vertical-align: top;
}

.cneip-context-panel__footer {
  position: sticky;
  bottom: 0;
  padding: 12px 20px;
  background: rgba(255, 255, 255, .97);
  border-top: 1px solid var(--cneip-line);
}

.cneip-secondary-button {
  width: 100%;
}

.cneip-reader-footer {
  position: relative;
  z-index: 30;
  min-height: var(--cneip-foot-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 18px;
  background: #fff;
  border-top: 1px solid var(--cneip-line);
  color: var(--cneip-muted);
  font-size: 12px;
}

.cneip-location {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cneip-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(320px, 42vw);
}

.cneip-progress__track {
  height: 5px;
  flex: 1;
  background: #eceff1;
  border-radius: 99px;
  overflow: hidden;
}

.cneip-progress__track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cneip-wine);
  transition: width .2s;
}

.cneip-progress__value {
  width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cneip-figure-viewer {
  position: fixed;
  z-index: 10050;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 14, 16, .82);
}

.cneip-figure-viewer__shell {
  width: min(1100px, 96vw);
  max-height: 94vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .36);
}

.cneip-figure-viewer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--cneip-line);
}

.cneip-figure-viewer__header h2 {
  margin: 0;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 17px;
}

.cneip-figure-viewer__stage {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 16px;
  background: #f4f5f6;
}

.cneip-figure-viewer__stage img {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
}

.cneip-figure-viewer__caption,
.cneip-figure-viewer__alt {
  padding: 10px 18px;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  line-height: 1.45;
}

.cneip-figure-viewer__caption {
  color: #30343a;
  font-size: 13px;
}

.cneip-figure-viewer__alt {
  padding-top: 0;
  color: #66707a;
  font-size: 11px;
}

body.cneip-figure-open {
  overflow: hidden !important;
}

.cneip-epub[data-theme="dark"] .cneip-readerbar,
.cneip-epub[data-theme="dark"] .cneip-reader-footer {
  background: #202327;
  color: #dfe3e7;
  border-color: #373b40;
}

.cneip-epub[data-theme="dark"] .cneip-readerbar__section,
.cneip-epub[data-theme="dark"] .cneip-readerbar__return {
  color: #f2f3f4;
}

.cneip-epub[data-theme="dark"] .cneip-readerbar__document,
.cneip-epub[data-theme="dark"] .cneip-readerbar__eyebrow {
  color: #adb5be;
}

.cneip-epub[data-theme="dark"] .cneip-reader-shell,
.cneip-epub[data-theme="dark"] .cneip-reader-stage {
  background: #111315;
}

.cneip-epub[data-theme="dark"] .cneip-epub-viewport {
  border-color: #30343a;
  background: #17191c;
}

.cneip-epub[data-theme="contrast"] .cneip-readerbar,
.cneip-epub[data-theme="contrast"] .cneip-reader-footer {
  background: #000;
  color: #fff;
  border-color: #fff;
}

.cneip-epub[data-theme="contrast"] .cneip-readerbar__section,
.cneip-epub[data-theme="contrast"] .cneip-readerbar__return,
.cneip-epub[data-theme="contrast"] .cneip-readerbar__eyebrow {
  color: #ffdf00;
}

.cneip-epub[data-theme="contrast"] .cneip-readerbar__document {
  color: #fff;
}

.cneip-epub[data-theme="contrast"] .cneip-reader-shell,
.cneip-epub[data-theme="contrast"] .cneip-reader-stage,
.cneip-epub[data-theme="contrast"] .cneip-epub-viewport {
  background: #000;
  border-color: #fff;
}

@media (max-width: 1020px) {
  .cneip-readerbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .cneip-readerbar__document {
    display: none;
  }
  .cneip-readerbar__download-long {
    display: none;
  }
  .cneip-readerbar__download-short {
    display: inline;
  }
  .cneip-resource-card {
    grid-template-columns: auto 1fr;
  }
  .cneip-resource-card__go {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 760px) {
  :root { --cneip-bar-h: 58px; }

  .cneip-readerbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 7px;
    padding: 7px 8px;
  }

  .cneip-readerbar__return span,
  .cneip-readerbar__eyebrow {
    display: none;
  }

  .cneip-readerbar__return {
    font-size: 21px;
  }

  .cneip-readerbar__section {
    font-size: 12px;
    text-align: left;
  }

  .cneip-readerbar__actions {
    gap: 3px;
  }

  .cneip-icon-button {
    min-width: 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 12px;
  }

  .cneip-readerbar__download {
    min-width: 36px;
    min-height: 34px;
    padding: 0 7px;
    font-size: 0;
  }

  .cneip-readerbar__download-short {
    display: inline;
    font-size: 11px;
  }

  .cneip-epub-viewport,
  .cneip-epub[data-reading-width="narrow"] .cneip-epub-viewport,
  .cneip-epub[data-reading-width="balanced"] .cneip-epub-viewport,
  .cneip-epub[data-reading-width="wide"] .cneip-epub-viewport {
    inset: 7px 12px;
    border-radius: 6px;
  }

  /* v1.8.2: paginated EPUB must remain operable on narrow touch screens. */
  .cneip-nav-arrow {
    display: grid;
    place-items: center;
    width: 30px;
    height: 58px;
    border: 1px solid rgba(143, 34, 52, .16);
    border-radius: 10px;
    background: rgba(255, 255, 255, .94);
    font-size: 27px;
    touch-action: manipulation;
  }

  .cneip-nav-arrow--prev { left: 1px; }
  .cneip-nav-arrow--next { right: 1px; }

  .cneip-reader-footer {
    padding: 7px 9px;
    gap: 8px;
  }

  .cneip-location {
    max-width: 46vw;
    font-size: 10px;
  }

  .cneip-progress {
    min-width: 46vw;
  }

  .cneip-panel,
  .cneip-panel--wide,
  .cneip-context-panel {
    width: min(390px, 96vw);
  }

  .cneip-panel__header {
    padding: 16px 16px 12px;
  }

  .cneip-panel__header h2 {
    font-size: 19px;
  }

  .cneip-resource-tabs {
    top: 65px;
    grid-template-columns: repeat(2, 1fr);
  }

  .cneip-resource-tabs button {
    min-height: 42px;
  }

  .cneip-resource-card {
    grid-template-columns: auto 1fr;
  }

  .cneip-resource-card__go {
    grid-column: 1 / -1;
    justify-self: stretch;
    padding: 8px;
    border-radius: 6px;
    background: #f7f1f2;
    text-align: center;
  }

  .cneip-metadata-list {
    grid-template-columns: 1fr;
  }

  .cneip-metadata-list dt {
    padding-bottom: 4px;
    border-bottom: 0;
  }

  .cneip-metadata-list dd {
    padding-top: 4px;
  }

  .cneip-figure-viewer {
    padding: 8px;
  }

  .cneip-figure-viewer__shell {
    width: 100%;
    max-height: 98vh;
  }
}

@media (max-width: 520px) {
  .cneip-readerbar__actions [data-action="toggle-resources"] {
    display: none;
  }
  .cneip-segmented--three {
    flex-direction: column;
  }
  .cneip-segmented--three button {
    border-right: 0;
    border-bottom: 1px solid #d3d7dc;
  }
  .cneip-segmented--three button:last-child {
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* v1.1.1 — consolidación científica */
.cneip-resource-card__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.cneip-resource-card__preview {
  border: 1px solid #d8c0c8;
  border-radius: 7px;
  background: #fff;
  color: var(--cneip-wine);
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.cneip-resource-card__preview:hover,
.cneip-resource-card__preview:focus-visible {
  background: #fbf5f7;
}

.cneip-metadata-authors {
  margin: 0;
  padding-left: 1.1rem;
}

.cneip-metadata-authors li + li {
  margin-top: .22rem;
}

.cneip-metadata-list dd a {
  color: var(--cneip-wine);
  font-weight: 700;
  text-underline-offset: .12em;
}

.cneip-table-preview {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.cneip-table-preview figure,
.cneip-table-preview .table-wrap {
  margin: 0;
  min-width: max-content;
}

.cneip-table-preview table {
  min-width: 100%;
  width: max-content;
  max-width: none;
}

.cneip-table-preview figcaption,
.cneip-table-preview .label,
.cneip-table-preview p {
  max-width: 72ch;
}

@media (max-width: 720px) {
  .cneip-resource-card__actions {
    grid-column: 2;
    align-items: stretch;
    width: 100%;
  }

  .cneip-resource-card__preview,
  .cneip-resource-card__go {
    width: 100%;
    text-align: left;
  }
}

/* v1.2.0 — herramientas científicas avanzadas */
.cneip-resource-tabs {
  display: flex;
  grid-template-columns: none;
  overflow-x: auto;
  scrollbar-width: thin;
}

.cneip-resource-tabs button {
  flex: 1 0 98px;
  padding-inline: 8px;
}

.cneip-orcid-badge {
  display: inline-flex;
  align-items: center;
  margin-left: .45rem;
  padding: .12rem .4rem;
  border: 1px solid #cfe1b7;
  border-radius: 999px;
  background: #f5faef;
  color: #4d6f22 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
  vertical-align: middle;
}

.cneip-article-map {
  display: grid;
  gap: 12px;
}

.cneip-article-map__intro,
.cneip-citation-tools__heading {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #eadde1;
  border-radius: 10px;
  background: #fbf7f8;
  color: #3b4148;
}

.cneip-article-map__intro strong,
.cneip-citation-tools__heading strong {
  color: var(--cneip-wine);
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 14px;
}

.cneip-article-map__intro span,
.cneip-citation-tools__heading span {
  color: var(--cneip-muted);
  font-size: 11px;
  line-height: 1.45;
}

.cneip-article-map__list {
  display: grid;
  gap: 6px;
}

.cneip-map-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px 10px calc(11px + (var(--map-depth, 0) * 16px));
  border: 1px solid #e1e5e9;
  border-radius: 9px;
  background: #fff;
  color: #30353a;
  text-align: left;
  cursor: pointer;
}

.cneip-map-row:hover,
.cneip-map-row:focus-visible,
.cneip-map-row.is-active {
  border-color: #d4abb6;
  background: #fcf7f8;
}

.cneip-map-row.is-active {
  box-shadow: inset 3px 0 0 var(--cneip-wine);
}

.cneip-map-row__main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cneip-map-row__number {
  flex: 0 0 auto;
  color: #9b4b59;
  font-size: 9px;
  font-weight: 800;
}

.cneip-map-row__label {
  overflow: hidden;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cneip-map-row__stats {
  display: flex;
  gap: 4px;
}

.cneip-map-row__stats span {
  display: inline-flex;
  min-width: 28px;
  justify-content: center;
  padding: 3px 6px;
  border-radius: 999px;
  background: #eef1f3;
  color: #606973;
  font-size: 9px;
  font-weight: 800;
}

.cneip-map-row__go {
  color: var(--cneip-wine);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.cneip-citation-tools {
  display: grid;
  gap: 12px;
}

.cneip-citation-box {
  padding: 14px;
  border: 1px solid #dfe3e8;
  border-radius: 10px;
  background: #fff;
}

.cneip-citation-box__label {
  display: block;
  margin-bottom: 7px;
  color: #69727c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.cneip-citation-box p {
  margin: 0;
  color: #2c3035;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.55;
}

.cneip-citation-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.cneip-citation-actions button,
.cneip-resource-card__external {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid #d8c0c8;
  border-radius: 7px;
  background: #fff;
  color: var(--cneip-wine);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.cneip-citation-actions button:hover,
.cneip-citation-actions button:focus-visible,
.cneip-resource-card__external:hover,
.cneip-resource-card__external:focus-visible {
  background: #fbf5f7;
}

.cneip-citation-note {
  margin: 0;
  color: var(--cneip-muted);
  font-size: 10px;
  line-height: 1.45;
}

.cneip-citation-occurrences {
  display: grid;
  gap: 7px;
}

.cneip-citation-occurrence {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid #e0e4e8;
  border-radius: 8px;
  background: #fff;
  color: #33383d;
  text-align: left;
  cursor: pointer;
}

.cneip-citation-occurrence:hover,
.cneip-citation-occurrence:focus-visible {
  border-color: #d4abb6;
  background: #fcf7f8;
}

.cneip-citation-occurrence__section {
  color: var(--cneip-wine);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.cneip-citation-occurrence__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cneip-citation-occurrence__go {
  color: var(--cneip-wine);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 10px;
  font-weight: 800;
}

@media (max-width: 720px) {
  .cneip-resource-tabs button { flex-basis: 92px; }
  .cneip-map-row { grid-template-columns: minmax(0, 1fr) auto; }
  .cneip-map-row__stats { grid-column: 1; padding-left: 27px; }
  .cneip-map-row__go { grid-column: 2; grid-row: 1 / span 2; }
  .cneip-citation-actions { grid-template-columns: 1fr; }
  .cneip-citation-occurrence { grid-template-columns: 1fr auto; }
  .cneip-citation-occurrence__section { grid-column: 1; }
  .cneip-citation-occurrence__label { grid-column: 1; white-space: normal; }
  .cneip-citation-occurrence__go { grid-column: 2; grid-row: 1 / span 2; }
}

/* v1.2.2 — productividad científica y exploración bibliográfica */
.cneip-map-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.cneip-map-summary > span {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 6px;
  border: 1px solid #e1e5e9;
  border-radius: 9px;
  background: #fff;
}

.cneip-map-summary strong {
  color: var(--cneip-wine);
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 15px;
}

.cneip-map-summary small {
  color: var(--cneip-muted);
  font-size: 9px;
  font-weight: 700;
}

.cneip-reference-explorer {
  display: grid;
  gap: 10px;
}

.cneip-reference-controls {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e1e5e9;
  border-radius: 10px;
  background: #fafbfc;
}

.cneip-reference-controls input[type="search"] {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #ccd3da;
  border-radius: 7px;
  background: #fff;
  color: #272c31;
  font: inherit;
  font-size: 11px;
}

.cneip-reference-controls input[type="search"]:focus {
  outline: 2px solid rgba(151, 31, 56, .2);
  border-color: var(--cneip-wine);
}

.cneip-reference-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.cneip-reference-filters button {
  padding: 5px 8px;
  border: 1px solid #d7dde2;
  border-radius: 999px;
  background: #fff;
  color: #555e67;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.cneip-reference-filters button:hover,
.cneip-reference-filters button:focus-visible,
.cneip-reference-filters button.is-active {
  border-color: #d4abb6;
  background: #f8edef;
  color: var(--cneip-wine);
}

.cneip-reference-count {
  color: var(--cneip-muted);
  font-size: 9px;
  font-weight: 700;
}

.cneip-citation-occurrence__context {
  grid-column: 1 / -1;
  color: #5d6670;
  font-size: 10px;
  line-height: 1.45;
  white-space: normal;
}

@media (max-width: 720px) {
  .cneip-map-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cneip-reference-controls { position: static; }
  .cneip-citation-occurrence__context { grid-column: 1 / -1; }
}

/* v1.3.0 — accesibilidad científica avanzada */
.cneip-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.cneip-skip-link {
  position: fixed;
  z-index: 11000;
  left: 16px;
  top: 10px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: var(--cneip-wine-dark);
  box-shadow: var(--cneip-shadow);
  font-weight: 800;
  text-decoration: underline;
  transition: transform .15s ease;
}
.cneip-skip-link:focus { transform: translateY(0); outline: 3px solid var(--cneip-wine); outline-offset: 3px; }

.cneip-epub :focus-visible {
  outline: 3px solid var(--cneip-wine) !important;
  outline-offset: 3px !important;
}

.cneip-a11y-toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cneip-a11y-toggle-grid button {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #d4d9de;
  border-radius: 8px;
  background: #fff;
  color: #343a40;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.cneip-a11y-toggle-grid button.is-active,
.cneip-a11y-toggle-grid button[aria-pressed="true"] {
  border-color: #c7838f;
  background: #f5e9ec;
  color: var(--cneip-wine-dark);
  box-shadow: inset 0 0 0 1px var(--cneip-wine);
  font-weight: 750;
}
.cneip-settings-help {
  margin: 10px 0 0;
  color: var(--cneip-muted);
  font-size: 11px;
  line-height: 1.55;
}

.cneip-resource-tabs {
  display: flex;
  grid-template-columns: none;
  overflow-x: auto;
  scrollbar-width: thin;
}
.cneip-resource-tabs button {
  min-width: 82px;
  flex: 1 0 auto;
  padding-inline: 8px;
}

.cneip-a11y-card { display: grid; gap: 12px; padding: 5px; }
.cneip-a11y-card__intro {
  display: grid;
  gap: 4px;
  padding: 14px 15px;
  border: 1px solid #ead4d9;
  border-radius: 10px;
  background: #fbf5f6;
}
.cneip-a11y-card__intro strong {
  color: var(--cneip-wine-dark);
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 17px;
}
.cneip-a11y-card__intro span { color: var(--cneip-muted); font-size: 12px; line-height: 1.5; }
.cneip-a11y-section {
  padding: 14px;
  border: 1px solid #e1e5e9;
  border-radius: 10px;
  background: #fff;
}
.cneip-a11y-section h3 {
  margin: 0 0 11px;
  color: #30343a;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 15px;
}
.cneip-a11y-list {
  display: grid;
  grid-template-columns: minmax(120px,.65fr) minmax(0,1.35fr);
  margin: 0;
  overflow: hidden;
  border: 1px solid #e7eaed;
  border-radius: 8px;
}
.cneip-a11y-list dt,
.cneip-a11y-list dd { margin: 0; padding: 8px 10px; border-bottom: 1px solid #eceff1; }
.cneip-a11y-list dt { background: #f7f8f9; color: #5c6670; font-size: 11px; font-weight: 800; }
.cneip-a11y-list dd { color: #30343a; font-family: Georgia, Cambria, "Times New Roman", serif; font-size: 12px; overflow-wrap: anywhere; }
.cneip-a11y-checks { display: grid; gap: 7px; }
.cneip-a11y-check {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #e4e8eb;
  border-radius: 8px;
}
.cneip-a11y-check__mark {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #e8f2ec;
  color: #24613d;
  font-weight: 900;
}
.cneip-a11y-check.is-warning .cneip-a11y-check__mark { background: #fff1d6; color: #805400; }
.cneip-a11y-check > span:last-child { display: grid; gap: 2px; }
.cneip-a11y-check strong { font-size: 12px; }
.cneip-a11y-check small { color: var(--cneip-muted); font-size: 11px; line-height: 1.4; }
.cneip-a11y-disclaimer {
  margin: 0;
  padding: 11px 13px;
  border-left: 3px solid #aeb5bc;
  background: #f7f8f9;
  color: #5c6670;
  font-size: 11px;
  line-height: 1.55;
}

.cneip-epub[data-readable-font="true"] .cneip-readerbar,
.cneip-epub[data-readable-font="true"] .cneip-panel,
.cneip-epub[data-readable-font="true"] .cneip-reader-footer { font-family: Arial, Helvetica, "Segoe UI", sans-serif; }
.cneip-epub[data-underline-links="true"] a { text-decoration: underline !important; text-decoration-thickness: .1em !important; text-underline-offset: .15em !important; }
.cneip-epub[data-enhanced-spacing="true"] .cneip-panel p,
.cneip-epub[data-enhanced-spacing="true"] .cneip-panel li { line-height: 1.75; }
.cneip-epub[data-reduce-motion="true"] *,
.cneip-epub[data-reduce-motion="true"] *::before,
.cneip-epub[data-reduce-motion="true"] *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
.cneip-epub[data-reduce-motion="true"] .cneip-spinner { animation: none !important; border-top-color: #d5d9dd; }

@media (prefers-reduced-motion: reduce) {
  .cneip-epub *, .cneip-epub *::before, .cneip-epub *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .cneip-spinner { animation: none !important; }
}

@media (max-width: 620px) {
  .cneip-a11y-toggle-grid { grid-template-columns: 1fr; }
  .cneip-a11y-list { grid-template-columns: 1fr; }
  .cneip-a11y-list dt { border-bottom: 0; padding-bottom: 3px; }
  .cneip-a11y-list dd { padding-top: 3px; }
}


.cneip-a11y-discovery { margin: 0 0 10px; padding: 9px 11px; border-radius: 8px; font-size: 11px; line-height: 1.45; }
.cneip-a11y-discovery.is-complete { background: #eaf4ed; color: #245d3c; }
.cneip-a11y-discovery.is-warning { background: #fff3dd; color: #765000; }


/* v1.4.0 — Continuidad de lectura, marcadores y enlaces profundos */
.cneip-bookmarks { display: grid; gap: 14px; padding: 4px; }
.cneip-bookmarks__intro {
  display: grid;
  gap: 5px;
  padding: 15px 16px;
  border: 1px solid #ead4d9;
  border-radius: 11px;
  background: #fbf5f6;
}
.cneip-bookmarks__intro strong {
  color: var(--cneip-wine-dark);
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 17px;
}
.cneip-bookmarks__intro span { color: var(--cneip-muted); font-size: 12px; line-height: 1.55; }
.cneip-bookmarks__current {
  display: grid;
  grid-template-columns: minmax(150px,.8fr) minmax(180px,1.2fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid #e0e5e9;
  border-radius: 10px;
  background: #fff;
}
.cneip-bookmarks__current-meta { display: grid; gap: 3px; min-width: 0; }
.cneip-bookmarks__current-meta strong { font-family: Georgia, Cambria, "Times New Roman", serif; font-size: 14px; }
.cneip-bookmarks__current-meta span { color: var(--cneip-muted); font-size: 11px; }
.cneip-bookmarks__current input {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #d6dce2;
  border-radius: 8px;
  background: #fff;
  color: var(--cneip-ink);
  font: inherit;
  font-size: 12px;
}
.cneip-bookmarks__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.cneip-primary-inline,
.cneip-secondary-inline,
.cneip-bookmark-card__actions button {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #dbc2c8;
  border-radius: 8px;
  background: #fff;
  color: var(--cneip-wine);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.cneip-primary-inline { border-color: var(--cneip-wine); background: var(--cneip-wine); color: #fff; }
.cneip-primary-inline:disabled,
.cneip-secondary-inline:disabled { opacity: .5; cursor: not-allowed; }
.cneip-bookmark-list { display: grid; gap: 9px; }
.cneip-bookmark-card {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 12px 13px;
  border: 1px solid #e0e5e9;
  border-radius: 10px;
  background: #fff;
}
.cneip-bookmark-card__number {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #f7e9ec;
  color: var(--cneip-wine);
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-weight: 800;
}
.cneip-bookmark-card__body { display: grid; gap: 3px; min-width: 0; }
.cneip-bookmark-card__body strong { font-family: Georgia, Cambria, "Times New Roman", serif; font-size: 14px; overflow-wrap: anywhere; }
.cneip-bookmark-card__body span { color: var(--cneip-muted); font-size: 11px; }
.cneip-bookmark-card__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.cneip-bookmark-card__actions .is-destructive { color: #7c2b2b; border-color: #e3c7c7; }

@media (max-width: 760px) {
  .cneip-bookmarks__current { grid-template-columns: 1fr; }
  .cneip-bookmarks__actions { justify-content: stretch; }
  .cneip-bookmarks__actions button { flex: 1 1 160px; }
  .cneip-bookmark-card { grid-template-columns: 38px minmax(0,1fr); }
  .cneip-bookmark-card__actions { grid-column: 1 / -1; justify-content: flex-start; padding-left: 49px; }
}


/* v1.5.0 — Anotaciones, resaltados y modo de estudio */
.cneip-annotation-editor { display: grid; gap: 11px; padding: 18px 20px; }
.cneip-annotation-editor__section { color: var(--cneip-wine); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.cneip-annotation-editor blockquote { margin: 0; padding: 13px 15px; border-left: 4px solid var(--cneip-wine); border-radius: 0 8px 8px 0; background: #faf4f5; color: #30343a; font-family: Georgia, Cambria, "Times New Roman", serif; font-size: 14px; line-height: 1.55; }
.cneip-annotation-editor label { color: #4b535c; font-size: 11px; font-weight: 800; }
.cneip-annotation-editor label span { font-weight: 500; color: var(--cneip-muted); }
.cneip-annotation-editor select, .cneip-annotation-editor textarea { width: 100%; padding: 10px 11px; border: 1px solid #d4dae0; border-radius: 8px; background: #fff; color: var(--cneip-ink); font: inherit; font-size: 12px; }
.cneip-annotation-editor textarea { resize: vertical; line-height: 1.5; }
.cneip-annotation-editor__privacy { margin: 0; color: var(--cneip-muted); font-size: 10px; line-height: 1.45; }
.cneip-annotation-editor__footer { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--cneip-line); background: rgba(255,255,255,.98); }
.cneip-annotation-editor__footer .is-destructive { color: #7c2b2b; border-color: #e3c7c7; }

.cneip-study { display: grid; gap: 13px; padding: 4px; }
.cneip-study__intro { display: grid; gap: 5px; padding: 15px 16px; border: 1px solid #ead4d9; border-radius: 11px; background: #fbf5f6; }
.cneip-study__intro strong { color: var(--cneip-wine-dark); font-family: Georgia, Cambria, "Times New Roman", serif; font-size: 17px; }
.cneip-study__intro span { color: var(--cneip-muted); font-size: 12px; line-height: 1.55; }
.cneip-study-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cneip-study-summary > div { display: grid; place-items: center; gap: 2px; min-height: 66px; padding: 9px; border: 1px solid #e0e5e9; border-radius: 10px; background: #fff; text-align: center; }
.cneip-study-summary strong { color: var(--cneip-wine); font-family: Georgia, Cambria, "Times New Roman", serif; font-size: 19px; }
.cneip-study-summary span { color: var(--cneip-muted); font-size: 10px; font-weight: 700; }
.cneip-study-tools { display: flex; flex-wrap: wrap; gap: 7px; }
.cneip-study-list { display: grid; gap: 9px; }
.cneip-study-empty { padding: 18px; border: 1px dashed #d4dae0; border-radius: 10px; color: var(--cneip-muted); background: #fff; }
.cneip-study-empty strong { color: #353a40; font-family: Georgia, Cambria, "Times New Roman", serif; }
.cneip-study-empty p { margin: 6px 0 0; font-size: 11px; line-height: 1.55; }
.cneip-study-card { display: grid; gap: 9px; padding: 13px 14px; border: 1px solid #dfe4e8; border-radius: 10px; background: #fff; }
.cneip-study-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.cneip-study-card__head > span:last-child { color: var(--cneip-muted); font-size: 10px; }
.cneip-study-tag { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.cneip-study-tag.is-idea { background: #f5e5e8; color: #7d2332; }
.cneip-study-tag.is-method { background: #e5f0f8; color: #275b7e; }
.cneip-study-tag.is-result { background: #e7f1e4; color: #356431; }
.cneip-study-tag.is-question { background: #f8efd8; color: #785d18; }
.cneip-study-tag.is-other { background: #eeeaf4; color: #5e4d75; }
.cneip-study-card blockquote { margin: 0; color: #30343a; font-family: Georgia, Cambria, "Times New Roman", serif; font-size: 13px; line-height: 1.5; }
.cneip-study-note { margin: 0; padding: 10px 11px; white-space: pre-wrap; border-radius: 8px; background: #f6f7f8; color: #444b53; font-size: 11px; line-height: 1.5; }
.cneip-study-card__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.cneip-study-card__actions button { min-height: 34px; padding: 6px 9px; border: 1px solid #dbc2c8; border-radius: 8px; background: #fff; color: var(--cneip-wine); font: inherit; font-size: 10px; font-weight: 800; cursor: pointer; }
.cneip-study-card__actions .is-destructive { color: #7c2b2b; border-color: #e3c7c7; }

@media (max-width: 620px) {
  .cneip-study-summary { grid-template-columns: 1fr; }
  .cneip-annotation-editor__footer > button { flex: 1 1 130px; }
  .cneip-study-card__actions { justify-content: flex-start; }
}


/* v1.6.0 — modo de estudio avanzado */
.cneip-study--advanced { gap: 14px; }
.cneip-study--advanced .cneip-study-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cneip-study-personal,
.cneip-study-controls,
.cneip-study-unified-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dfe4e8;
  border-radius: 12px;
  background: #fff;
}
.cneip-study-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.cneip-study-section-head > div { display: grid; gap: 3px; }
.cneip-study-section-head strong {
  color: var(--cneip-wine);
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 14px;
}
.cneip-study-section-head span { color: var(--cneip-muted); font-size: 10px; line-height: 1.45; }
.cneip-study-personal textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid #ccd4db;
  border-radius: 9px;
  background: #fff;
  color: #30343a;
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
}
.cneip-study-personal small { justify-self: end; color: var(--cneip-muted); font-size: 9px; }
.cneip-study-controls > input[type="search"] {
  width: 100%;
  box-sizing: border-box;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid #ccd4db;
  border-radius: 9px;
  background: #fff;
  color: #30343a;
  font: inherit;
}
.cneip-study-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.cneip-study-filters button,
.cneip-study-selects select {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #d4dce2;
  border-radius: 999px;
  background: #fff;
  color: #4e5863;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
}
.cneip-study-filters button { cursor: pointer; }
.cneip-study-filters button.is-active {
  border-color: #dcaab4;
  background: #fbf1f3;
  color: var(--cneip-wine);
}
.cneip-study-selects { display: flex; flex-wrap: wrap; gap: 10px; }
.cneip-study-selects label { display: inline-flex; align-items: center; gap: 6px; color: var(--cneip-muted); font-size: 10px; font-weight: 700; }
.cneip-study-result-count { color: var(--cneip-muted); font-size: 10px; font-weight: 800; }
.cneip-study-annotation-host { display: grid; gap: 12px; }
.cneip-study-group { display: grid; gap: 8px; }
.cneip-study-group > h3 {
  margin: 0;
  padding: 0 2px;
  color: #4a5159;
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: 13px;
}
.cneip-study-compact-list,
.cneip-study-resource-history { display: grid; gap: 7px; }
.cneip-study-compact-row,
.cneip-study-resource-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #e1e6ea;
  border-radius: 9px;
  background: #fafbfc;
}
.cneip-study-compact-row > div,
.cneip-study-resource-row > div { display: grid; gap: 2px; }
.cneip-study-compact-row strong,
.cneip-study-resource-row strong { color: #343a40; font-size: 11px; }
.cneip-study-compact-row span,
.cneip-study-resource-row span { color: var(--cneip-muted); font-size: 9px; line-height: 1.4; }
.cneip-study-compact-row button,
.cneip-study-resource-row button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #dbc2c8;
  border-radius: 8px;
  background: #fff;
  color: var(--cneip-wine);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.cneip-study-resource-row { grid-template-columns: auto 1fr auto; }
.cneip-study-resource-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 27px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f5e8eb;
  color: var(--cneip-wine) !important;
  font-size: 9px !important;
  font-weight: 900;
}
@media (max-width: 760px) {
  .cneip-study--advanced .cneip-study-summary { grid-template-columns: repeat(2, 1fr); }
  .cneip-study-section-head { flex-direction: column; }
  .cneip-study-resource-row { grid-template-columns: 1fr; }
  .cneip-study-resource-type { justify-self: start; }
}
@media (max-width: 520px) {
  .cneip-study--advanced .cneip-study-summary { grid-template-columns: 1fr 1fr; }
  .cneip-study-selects { display: grid; grid-template-columns: 1fr; }
  .cneip-study-selects label { justify-content: space-between; }
  .cneip-study-compact-row { grid-template-columns: 1fr; }
}


/* v1.7.0 — Lectura asistida / síntesis de voz */
.cneip-icon-button.is-active { background:#f8e9ec; color:var(--cneip-wine); box-shadow:inset 0 0 0 1px #ddb8c0; }
.cneip-speech-panel { width:min(440px,92vw); }
.cneip-speech { display:grid; gap:13px; padding:16px 18px 22px; }
.cneip-speech__support { padding:8px 10px; border-radius:8px; background:#edf5ef; color:#35613e; font-size:10px; font-weight:900; letter-spacing:.02em; }
.cneip-speech__support.is-error { background:#f8e7e7; color:#842d2d; }
.cneip-speech__now { display:grid; gap:5px; padding:14px; border:1px solid #ead7dc; border-radius:12px; background:#fcf7f8; }
.cneip-speech__now>span { color:var(--cneip-wine); font-size:9px; font-weight:900; letter-spacing:.07em; text-transform:uppercase; }
.cneip-speech__now>strong { color:#333940; font-family:Georgia,Cambria,"Times New Roman",serif; font-size:14px; }
.cneip-speech__now>p { margin:2px 0 0; max-height:8.5em; overflow:auto; color:#454c54; font-size:11px; line-height:1.55; }
.cneip-speech__now>small { color:var(--cneip-muted); font-size:9px; font-weight:700; }
.cneip-speech__micro-progress { height:3px; margin-top:5px; overflow:hidden; border-radius:999px; background:#e8dfe1; }
.cneip-speech__micro-progress>span { display:block; width:0; height:100%; background:var(--cneip-wine); transition:width .12s linear; }
.cneip-speech__transport { display:grid; grid-template-columns:40px 1.35fr 1fr 1fr 40px; gap:6px; }
.cneip-speech__transport button { min-height:40px; padding:6px 8px; border:1px solid #d7dde2; border-radius:9px; background:#fff; color:#4d555d; font:inherit; font-size:10px; font-weight:900; cursor:pointer; }
.cneip-speech__transport button.is-primary { border-color:var(--cneip-wine); background:var(--cneip-wine); color:#fff; }
.cneip-speech__transport button:disabled { cursor:not-allowed; opacity:.45; }
.cneip-speech fieldset { display:grid; gap:7px; margin:0; padding:11px 12px; border:1px solid #e1e6ea; border-radius:10px; background:#fff; }
.cneip-speech legend { padding:0 5px; color:#515861; font-size:10px; font-weight:900; }
.cneip-speech select { width:100%; min-height:38px; padding:7px 9px; border:1px solid #cfd7dd; border-radius:8px; background:#fff; color:#343a40; font:inherit; font-size:11px; }
.cneip-speech input[type="range"] { width:100%; accent-color:var(--cneip-wine); }
.cneip-speech output { float:right; color:var(--cneip-wine); font-weight:900; }
.cneip-speech__toggle { display:grid; grid-template-columns:auto 1fr; gap:9px; align-items:start; padding:11px 12px; border:1px solid #e1e6ea; border-radius:10px; background:#fff; cursor:pointer; }
.cneip-speech__toggle input { margin-top:2px; accent-color:var(--cneip-wine); }
.cneip-speech__toggle span { display:grid; gap:2px; }
.cneip-speech__toggle strong { color:#3d444b; font-size:11px; }
.cneip-speech__toggle small { color:var(--cneip-muted); font-size:9px; line-height:1.4; }
.cneip-speech__note,.cneip-speech__shortcut { margin:0; color:var(--cneip-muted); font-size:9px; line-height:1.55; }
.cneip-speech__shortcut kbd { padding:1px 5px; border:1px solid #d2d8de; border-bottom-width:2px; border-radius:5px; background:#fff; color:#4a5158; font-family:inherit; font-size:9px; font-weight:800; }
@media(max-width:580px){.cneip-speech__transport{grid-template-columns:repeat(5,1fr)}.cneip-speech__transport button{padding:5px 4px;font-size:9px}}

/* v1.8.0 — Relaciones científicas / capa semántica local */
.cneip-semantic { display:grid; gap:14px; }
.cneip-semantic-loading,
.cneip-semantic-empty { padding:16px; border:1px solid #e0e5e9; border-radius:12px; background:#fafbfc; color:var(--cneip-muted); font-size:11px; line-height:1.55; }
.cneip-semantic-empty { display:grid; gap:5px; }
.cneip-semantic-empty strong { color:#3d444b; font-family:Georgia,Cambria,"Times New Roman",serif; font-size:14px; }
.cneip-semantic-empty p { margin:0; }
.cneip-semantic-intro { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(220px,.8fr); gap:14px; align-items:stretch; }
.cneip-semantic-intro>div:first-child { display:grid; align-content:start; gap:4px; padding:15px; border:1px solid #eadce0; border-radius:12px; background:#fcf8f9; }
.cneip-semantic-intro span { color:var(--cneip-wine); font-size:9px; font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
.cneip-semantic-intro h3 { margin:0; color:#30353a; font-family:Georgia,Cambria,"Times New Roman",serif; font-size:18px; }
.cneip-semantic-intro p { margin:2px 0 0; color:#5c6570; font-size:10px; line-height:1.5; }
.cneip-semantic-note { display:flex; align-items:center; padding:13px 14px; border:1px solid #e2e6e9; border-radius:12px; background:#fff; color:#65707a; font-size:9px; line-height:1.55; }
.cneip-semantic-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.cneip-semantic-summary>div { display:grid; gap:2px; padding:11px 12px; border:1px solid #e0e5e9; border-radius:10px; background:#fff; }
.cneip-semantic-summary strong { color:var(--cneip-wine); font-family:Georgia,Cambria,"Times New Roman",serif; font-size:19px; line-height:1; }
.cneip-semantic-summary span { color:var(--cneip-muted); font-size:9px; font-weight:800; }
.cneip-semantic-controls { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(190px,.7fr); gap:8px; }
.cneip-semantic-controls input,
.cneip-semantic-controls select { width:100%; min-height:40px; padding:8px 10px; border:1px solid #cfd7dd; border-radius:9px; background:#fff; color:#343a40; font:inherit; font-size:10px; }
.cneip-semantic-section-list,
.cneip-semantic-concepts { display:grid; gap:9px; }
.cneip-semantic-heading { display:flex; align-items:end; justify-content:space-between; gap:10px; padding:0 2px; }
.cneip-semantic-heading strong { color:#3c434a; font-family:Georgia,Cambria,"Times New Roman",serif; font-size:14px; }
.cneip-semantic-heading span { color:var(--cneip-muted); font-size:9px; }
.cneip-semantic-section-card { display:grid; gap:9px; padding:12px; border:1px solid #e0e5e9; border-radius:11px; background:#fff; }
.cneip-semantic-section-card__head { display:flex; align-items:start; justify-content:space-between; gap:10px; }
.cneip-semantic-section-card__head strong { color:#30363c; font-family:Georgia,Cambria,"Times New Roman",serif; font-size:13px; }
.cneip-semantic-section-card__head span { max-width:60%; color:var(--cneip-muted); font-size:8.5px; font-weight:800; text-align:right; line-height:1.45; }
.cneip-semantic-relations { display:grid; gap:6px; }
.cneip-semantic-relation { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:9px; align-items:center; padding:8px 9px; border:1px solid #e7eaed; border-radius:8px; background:#fafbfc; }
.cneip-semantic-relation__type { min-width:62px; padding:4px 7px; border-radius:999px; background:#f4e8eb; color:var(--cneip-wine); font-size:8px; font-weight:900; text-align:center; }
.cneip-semantic-relation>div { display:grid; gap:2px; min-width:0; }
.cneip-semantic-relation strong { overflow:hidden; color:#3c434a; font-size:9.5px; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
.cneip-semantic-relation>div span { color:var(--cneip-muted); font-size:8px; }
.cneip-semantic-relation button,
.cneip-semantic-concept__sections button { border:1px solid #dbc8cd; border-radius:8px; background:#fff; color:var(--cneip-wine); font:inherit; font-size:8.5px; font-weight:900; cursor:pointer; }
.cneip-semantic-relation button { min-height:30px; padding:5px 8px; white-space:nowrap; }
.cneip-semantic-concept-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.cneip-semantic-concept { display:grid; gap:6px; padding:11px; border:1px solid #e0e5e9; border-radius:10px; background:#fff; }
.cneip-semantic-concept>strong { color:#363d44; font-family:Georgia,Cambria,"Times New Roman",serif; font-size:12px; }
.cneip-semantic-concept>span { color:var(--cneip-muted); font-size:8.5px; font-weight:800; }
.cneip-semantic-concept__sections { display:flex; flex-wrap:wrap; gap:5px; }
.cneip-semantic-concept__sections button { padding:4px 6px; border-radius:999px; background:#fbf7f8; }
.cneip-semantic-muted { margin:0; color:var(--cneip-muted); font-size:9px; line-height:1.5; }
.cneip-semantic-unresolved { margin:0; padding:9px 11px; border-left:3px solid #c8a15a; background:#fff9ee; color:#66572f; font-size:8.5px; line-height:1.5; }
@media(max-width:760px){
  .cneip-semantic-intro{grid-template-columns:1fr}
  .cneip-semantic-summary{grid-template-columns:repeat(2,1fr)}
  .cneip-semantic-controls{grid-template-columns:1fr}
  .cneip-semantic-concept-grid{grid-template-columns:1fr}
  .cneip-semantic-section-card__head{display:grid}
  .cneip-semantic-section-card__head span{max-width:none;text-align:left}
}
@media(max-width:520px){
  .cneip-semantic-relation{grid-template-columns:1fr}
  .cneip-semantic-relation__type{justify-self:start}
  .cneip-semantic-relation button{justify-self:start}
}
