/* Tiny Pockets Press v6.1 */
:root {
  --ink: #231f20;
  --muted: #6b6460;
  --line: #ded8cf;
  --panel: #fff;
  --accent: #7b1f2a;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    sans-serif;
  background: #f3efe8;
  color: var(--ink);
}
.app-header {
  grid-row: 1;
}
#bookChromeBar {
  grid-row: 2;
}
#progress {
  grid-row: 3;
}
.app-shell {
  grid-row: 4;
}
.book-chrome-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding: 0.6rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
#bookChromeBar .book-toolbar-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 12px;
  padding: 0.5rem 0.72rem;
}
.book-toolbar-icon {
  font-size: 1rem;
  line-height: 1;
}
.book-toolbar-label {
  line-height: 1.1;
}
body.book-icons-only #bookChromeBar .book-toolbar-label {
  display: none;
}
body.book-icons-only #bookChromeBar .book-toolbar-button {
  min-width: 2.2rem;
  justify-content: center;
  padding-inline: 0.58rem;
}
#bookTabsBar,
#bookActionsBar {
  margin: 0;
}
.app-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 1rem;
  background: #251d1d;
  color: white;
  z-index: 50;
}
.app-header h1 {
  font-size: 1.25rem;
  margin: 0;
}
.app-header p {
  margin: 0.1rem 0 0;
  color: #e8ddd2;
  font-size: 0.9rem;
}
.tabs,
.header-actions,
.menu-row,
.reader-toolbar,
.toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
button {
  border: 0;
  border-radius: 999px;
  padding: 0.58rem 0.8rem;
  font-weight: 800;
  cursor: pointer;
  background: #e6ddd2;
  color: #251d1d;
}
button.primary {
  background: #ffcc66;
}
.button-cancel {
  background: #d8d0c3;
  color: #4a403b;
}
.primary.alt {
  background: #bde3ff;
}
.tab.active,
.chapter-pill.active {
  background: #ffcc66;
}
.app-shell {
  display: grid;
  grid-template-columns: minmax(360px, 480px) 1fr;
  min-height: 0;
}
.app-shell.no-sidebar {
  grid-template-columns: 1fr;
}
body.book-chrome-hidden #bookChromeBar {
  display: none !important;
}
.settings {
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
}
.controls,
.data-sidebar {
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1rem 2rem;
  background: #fff;
  overscroll-behavior: contain;
}
details {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.7rem;
  background: #fffdf8;
}
summary {
  font-weight: 900;
  cursor: pointer;
  margin-bottom: 0.6rem;
}
label {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
  font-size: 0.88rem;
  font-weight: 650;
}
label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfc6bc;
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  font: inherit;
  background: white;
}
input[type="checkbox"] {
  width: auto;
}
.color-box {
  width: 3rem !important;
  height: 2.25rem !important;
  padding: 0 !important;
  border-radius: 8px !important;
}
.color-picker-shell {
  display: inline-flex;
  align-items: center;
}
.color-input-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
}
.color-picker-trigger {
  width: 3rem;
  height: 2.25rem;
  min-width: 3rem;
  padding: 0;
  border: 1px solid #cfc6bc;
  border-radius: 8px;
  background:
    linear-gradient(rgb(255 255 255 / 0.3), rgb(255 255 255 / 0.05)),
    var(--picker-color, #000000);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.18);
}
.color-picker-trigger:focus-visible {
  outline: 2px solid #d1a84c;
  outline-offset: 2px;
}
.cover-text-table .color-picker-trigger {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  border-radius: 4px;
}
.front-cover-text-outline-cell .color-picker-shell {
  flex: 0 0 auto;
}
.front-cover-text-outline-cell .color-picker-trigger {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  border-radius: 4px;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.workspace {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 1rem;
}
.view {
  display: none;
}
.view.active {
  display: block;
}
.workspace-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.hint {
  color: var(--muted);
  font-size: 0.85rem;
}
.summary {
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: #fff8e8;
  border: 1px solid #ead9ba;
  margin-bottom: 1rem;
}
.chapter-list {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.chapter-pill {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  gap: 0.4rem;
  align-items: center;
  text-align: left;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0.5rem 0.65rem;
  background: #fff;
}
.chapter-pill .indent {
  display: inline-block;
  width: calc(var(--level) * 1.2rem);
}
.chapter-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 10px 30px rgb(0 0 0/0.05);
}
.asset-field {
  margin-top: 0.2rem;
}
.asset-control-group {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.asset-picker-surface {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.25rem;
  gap: 0.8rem;
  align-items: center;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  text-align: left;
}
.asset-field-copy {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}
.asset-field-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
}
.asset-inline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.asset-field-meta {
  font-size: 0.82rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.asset-preview,
.asset-empty {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 12px;
}
.asset-preview {
  display: block;
  background: #f1e8dd;
  border: 1px solid #e2d6c8;
  object-fit: cover;
}
.asset-empty {
  display: grid;
  place-items: center;
  padding: 0.45rem;
  border: 1px dashed #d3c8bb;
  background: #faf5ee;
  color: #8a7d70;
  font-size: 0.74rem;
  text-align: center;
}
.asset-slider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  gap: 0.65rem;
}
.asset-slider-grid label {
  margin-bottom: 0;
}
.rotation-range-label {
  display: grid;
  gap: 0.22rem;
}
.rotation-range-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
}
.rotation-step-cycle {
  display: inline-grid;
  justify-items: center;
  align-content: center;
  gap: 0.08rem;
  min-width: 2.2rem;
  min-height: 2.2rem;
  padding: 0.18rem 0.18rem;
  border: 1px solid #cfc6bc;
  border-radius: 10px;
  background: #fff;
  color: #5f5044;
  font-size: 0.68rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: normal;
  text-align: center;
}
.rotation-step-cycle span[aria-hidden="true"] {
  font-size: 0.86rem;
}
.cover-text-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}
.cover-text-group {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.cover-text-group label {
  margin-bottom: 0;
}
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.editor-grid textarea,
.md-preview {
  height: 18rem;
  overflow: auto;
}
.md-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  padding: 0.7rem;
}
.md-preview .page-break {
  border-top: 2px dashed #b8ad9f;
  margin: 0.75rem 0;
  padding-top: 0.75rem;
  color: #8b7b6b;
  font-size: 0.8rem;
}
.progress {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  align-items: center;
  background: #fff8e8;
  border: 1px solid #ead9ba;
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
  margin-bottom: 0.75rem;
  min-height: 2.1rem;
  overflow: hidden;
}
.progress[hidden] {
  display: none !important;
}
#progressBar {
  grid-area: 1/1;
  height: 1.3rem;
  width: 0%;
  min-width: 2rem;
  background: #7b1f2a;
  border-radius: 999px;
  transition: width 0.15s linear;
  animation: pulse 1s infinite;
}
#progressText {
  grid-area: 1/1;
  justify-self: center;
  align-self: center;
  position: relative;
  z-index: 1;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow:
    -1px 0 0 #2a211b,
    1px 0 0 #2a211b,
    0 -1px 0 #2a211b,
    0 1px 0 #2a211b;
}
@keyframes pulse {
  50% {
    opacity: 0.55;
  }
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
}
.library-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgb(0 0 0/0.06);
}
.library-card.active {
  border-color: #ffcc66;
  box-shadow:
    0 0 0 3px rgb(255 204 102 / 0.4),
    0 18px 38px rgb(90 59 13 / 0.18);
}
.library-cover {
  height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
  cursor: pointer;
  background: #7b1f2a;
  color: white;
  background-size: cover;
  background-position: center;
}
.library-card-body {
  padding: 0.8rem;
}
.library-card h3 {
  margin: 0.1rem 0;
  font-size: 1rem;
}
.library-card p {
  margin: 0.1rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.library-meta {
  font-weight: 650;
  color: #7a7065;
}
.small {
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
}
.about-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.data-sidebar-head {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1rem;
}
.data-sidebar-head h2 {
  margin: 0;
}
.data-sidebar-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.data-sidebar-nav {
  display: grid;
  gap: 0.45rem;
}
.data-sidebar-footer {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.data-sidebar-link {
  text-align: left;
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  background: #f2eadf;
  color: #5f5143;
}
.data-sidebar-link.active {
  background: #ffcc66;
  color: #251d1d;
}
.data-sidebar-link-bottom {
  background: #e8dfd3;
}
.data-panel {
  display: grid;
  gap: 1rem;
}
.data-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgb(0 0 0/0.05);
  padding: 1rem;
  overflow: auto;
}
.data-summary-copy {
  margin-bottom: 0.8rem;
}
.data-tab-panel {
  display: grid;
  gap: 0.75rem;
}
.data-raw-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.data-raw-details {
  border: 1px solid #403428;
  border-radius: 14px;
  background: #221c1a;
  color: #f7f0e7;
  padding: 0.7rem 0.85rem;
}
.data-raw-details details,
.data-code-json details {
  background: transparent;
  border: 0;
  margin: 0;
  padding: 0;
  color: inherit;
}
.data-raw-details summary {
  margin: 0 0 0.6rem;
  color: #f7f0e7;
}
.data-raw-details details > summary,
.data-code-json details > summary {
  margin-bottom: 0;
}
.data-raw-details[open] summary {
  margin-bottom: 0.6rem;
}
.data-raw-details:not([open]) summary {
  margin-bottom: 0;
}
.json-node {
  margin: 0;
}
.json-node summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.json-node summary::-webkit-details-marker {
  display: none;
}
.json-node[open] > summary {
  margin-bottom: 0.1rem;
}
.json-node:not([open]) > summary {
  margin-bottom: 0;
}
.json-node:not([open]) > .json-children {
  display: none;
}
.json-line,
.json-node summary {
  display: block;
  padding-left: calc(var(--json-depth, 0) * 1rem);
}
.json-indent {
  display: none;
}
.json-children {
  display: grid;
  gap: 0.15rem;
}
.json-meta {
  color: #b8ad9f;
  margin: 0 0.45rem;
}
.json-punct {
  color: #f7f0e7;
}
.json-token.key {
  color: #f5c36a;
}
.json-token.string {
  color: #9bd08c;
}
.json-token.number {
  color: #7fd3ff;
}
.json-token.boolean {
  color: #ff9f7d;
}
.json-token.null {
  color: #d7a7ff;
}
.data-stale-section {
  display: grid;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: #fff3e7;
  border: 1px solid #ecd2b0;
}
.data-stale-toolbar {
  display: flex;
  justify-content: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.data-stale-list {
  display: grid;
  gap: 0.5rem;
}
.data-stale-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #fffdf8;
  border: 1px solid #eee4d7;
}
.data-stale-item.unknown {
  border-color: #efc2c8;
  background: #fff6f7;
}
.data-stale-path {
  font-weight: 800;
  overflow-wrap: anywhere;
}
.data-stale-status {
  font-size: 0.82rem;
  color: var(--muted);
}
.data-stale-details {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: #5d554d;
}
.data-stale-empty {
  color: var(--muted);
  font-style: italic;
}
.data-node {
  display: grid;
  gap: 0.75rem;
}
.data-object {
  display: grid;
  gap: 0.75rem;
}
.data-field {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #fffdf8;
  border: 1px solid #eee4d7;
}
.data-field-name {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7f7368;
  overflow-wrap: anywhere;
}
.data-key-label {
  display: inline-block;
}
.data-key-label.deprecated {
  text-decoration: line-through;
  color: #9b6e4a;
}
.data-key-label.unknown {
  color: #9d2f3f;
  background: #f8e2e4;
  border-radius: 999px;
  padding: 0.05rem 0.35rem;
}
.data-field-value {
  min-width: 0;
  overflow-wrap: anywhere;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fff;
  border: 1px solid #eee4d7;
  border-radius: 12px;
  overflow: hidden;
}
.data-table th,
.data-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #eee4d7;
  border-right: 1px solid #eee4d7;
  vertical-align: top;
  text-align: left;
}
.data-table th:last-child,
.data-table td:last-child {
  border-right: 0;
}
.data-table tr:last-child td {
  border-bottom: 0;
}
.data-table th {
  background: #f6efe4;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #67594b;
}
.book-info-table-wrap {
  margin-bottom: 0.5rem;
  overflow-x: auto;
}
.book-info-table {
  table-layout: fixed;
  font-size: 0.82rem;
}
.book-info-table col.book-info-col-field {
  width: 28%;
}
.book-info-table col.book-info-col-value {
  width: auto;
}
.book-info-table col.book-info-col-action {
  width: 2.4rem;
}
.book-info-table th,
.book-info-table td {
  vertical-align: middle;
  padding: 0.3rem 0.4rem;
}
.book-info-table td:nth-child(1) {
  font-weight: 700;
}
.book-info-table td:nth-child(3) {
  text-align: center;
}
.book-info-table input,
.book-info-table select,
.book-info-table textarea {
  margin: 0;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
}
.book-info-value-cell {
  min-width: 10rem;
}
.book-info-field-cell {
  padding-right: 0.25rem;
}
.book-info-field-label {
  display: inline-block;
  line-height: 1.15;
}
.book-info-action-cell {
  width: 2.4rem;
  padding-inline: 0.1rem;
}
.book-info-trash {
  min-width: 1.9rem;
  padding: 0.2rem 0.35rem;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1;
}
.book-info-table thead th:last-child {
  color: transparent;
}
.book-info-classification-picker {
  width: 100%;
}
.book-info-classification-button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #cfc6bc;
  background: #fff;
  padding: 0.45rem 0.55rem;
  text-align: left;
  display: grid;
  gap: 0.16rem;
}
.book-info-classification-title {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.1;
}
.book-info-classification-meta {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.15;
}
.classification-search-wrap {
  position: relative;
}
.classification-search-label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}
.classification-search-label input {
  width: 100%;
}
.drag-handle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 1rem;
  margin-right: 0.35rem;
  color: var(--muted);
  cursor: grab;
  user-select: none;
}
.drag-preview-chip {
  position: fixed;
  left: -9999px;
  top: -9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 16rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid #d9cfbf;
  border-radius: 10px;
  background: #fffdf8;
  color: var(--ink);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.14);
  font-size: 0.82rem;
  font-weight: 700;
  pointer-events: none;
}
.drag-preview-handle {
  color: var(--muted);
  line-height: 1;
}
.drag-preview-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  padding: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 0.34rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #dfd2c2 0%, #d0c2b2 100%);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0.9rem;
  height: 0.9rem;
  margin-top: calc((0.34rem - 0.9rem) / 2);
  border: 1px solid #b89f86;
  border-radius: 999px;
  background: #fffaf2;
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.14),
    inset 0 0 0 1px rgb(255 255 255 / 0.72);
}
input[type="range"]::-moz-range-track {
  height: 0.34rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #dfd2c2 0%, #d0c2b2 100%);
}
input[type="range"]::-moz-range-thumb {
  width: 0.9rem;
  height: 0.9rem;
  border: 1px solid #b89f86;
  border-radius: 999px;
  background: #fffaf2;
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.14),
    inset 0 0 0 1px rgb(255 255 255 / 0.72);
}
.range-value-tooltip {
  position: fixed;
  z-index: 1200;
  pointer-events: none;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  background: rgb(28 24 20 / 0.92);
  color: #fffaf2;
  font-size: 0.72rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.22);
  white-space: nowrap;
}
.is-dragging {
  background: #fff8e8;
  box-shadow: inset 0 0 0 1px #ead9ba;
}
.drag-drop-before {
  box-shadow: inset 0 3px 0 #d1a84c;
}
.drag-drop-after {
  box-shadow: inset 0 -3px 0 #d1a84c;
}
.cover-text-table {
  table-layout: fixed;
  font-size: 0.82rem;
}
.cover-text-table col.cover-text-col-field {
  width: auto;
}
.cover-text-table col.cover-text-col-size {
  width: 5.7rem;
}
.cover-text-table col.cover-text-col-position {
  width: 5.8rem;
}
.cover-text-table col.cover-text-col-align {
  width: 5.2rem;
}
.cover-text-table col.cover-text-col-outline {
  width: 4.7rem;
}
.cover-text-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}
.cover-text-table th,
.cover-text-table td {
  padding: 0.3rem 0.35rem;
  vertical-align: middle;
}
.cover-text-table th {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.05;
}
.cover-text-table th:nth-child(4),
.cover-text-table td:nth-child(4) {
  text-align: center;
}
.cover-text-table th:nth-child(2),
.cover-text-table th:nth-child(4) {
  padding-inline: 0.25rem;
  font-size: 0.72rem;
}
.cover-text-table td:nth-child(1) {
  width: auto;
  font-weight: 400;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.cover-text-table input {
  margin: 0;
  padding: 0.25rem 0.35rem;
}
.cover-text-table .text-size {
  width: 3.25rem;
  max-width: 100%;
  padding-inline: 0.2rem;
}
.cover-text-size-stack {
  display: grid;
  gap: 0.2rem;
}
.cover-text-size-stack label,
.cover-text-size-stack .rotation-range-label {
  display: grid;
  gap: 0.14rem;
  margin: 0;
}
.cover-text-size-stack label > span,
.cover-text-size-stack .rotation-range-label > span:first-child {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a6755;
}
.cover-text-size-stack input[type="range"] {
  width: 100%;
  max-width: 4.2rem;
  margin: 0;
}
.cover-text-size-stack .rotation-range-control {
  gap: 0.2rem;
}
.cover-text-size-stack .rotation-step-cycle {
  min-width: 1.95rem;
  min-height: 1.95rem;
  padding: 0.16rem;
  border-radius: 8px;
}
.cover-text-size-stack .rotation-step-cycle span:last-child {
  font-size: 0.62rem;
}
.cover-text-table input[type="checkbox"] {
  width: auto;
  margin-inline: auto;
}
.cover-text-table .color-box {
  width: 1rem !important;
  height: 1rem !important;
  min-width: 1rem !important;
  border: 1px solid #cfc6bc !important;
  border-radius: 4px !important;
  background: transparent !important;
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
}
.cover-text-table .color-box::-webkit-color-swatch-wrapper,
.front-cover-text-outline-cell .color-box::-webkit-color-swatch-wrapper {
  padding: 0;
}
.cover-text-table .color-box::-webkit-color-swatch,
.front-cover-text-outline-cell .color-box::-webkit-color-swatch {
  border: 0;
  border-radius: 3px;
}
.cover-text-table .color-box::-moz-color-swatch,
.front-cover-text-outline-cell .color-box::-moz-color-swatch {
  border: 0;
  border-radius: 3px;
}
.front-cover-text-outline-cell {
  display: inline-grid;
  gap: 0.18rem;
  justify-items: center;
  padding: 0.14rem 0.16rem;
  border: 1px solid #cfc6bc;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  max-width: 4.9rem;
  margin-inline: auto;
}
.front-cover-text-outline-pair {
  position: relative;
  display: inline-block;
  min-width: 0;
}
.front-cover-text-outline-hit {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  position: absolute;
  top: 0;
  bottom: 0;
  cursor: pointer;
  border-radius: 6px;
}
.front-cover-text-outline-hit-fill {
  left: 0;
  width: 50%;
}
.front-cover-text-outline-hit-outline {
  right: 0;
  width: 50%;
}
.front-cover-text-outline-hit:focus-visible {
  outline: 2px solid #d1a84c;
  outline-offset: 1px;
}
.front-cover-text-outline-icon {
  width: 3.2rem;
  height: 1.15rem;
  display: block;
  overflow: visible;
}
.front-cover-text-outline-fill-swatch {
  fill: var(--text-fill-color, #ffffff);
  stroke: #cfc6bc;
  stroke-width: 1;
}
.front-cover-text-outline-stroke-swatch {
  fill: var(--text-outline-color, #000000);
  stroke: #cfc6bc;
  stroke-width: 1;
}
.front-cover-text-outline-fill-line {
  stroke: var(--text-fill-color, #ffffff);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.front-cover-text-outline-fill-dot {
  fill: var(--text-fill-color, #ffffff);
  stroke: #8e8277;
  stroke-width: 0.8;
}
.front-cover-text-outline-stroke-line,
.front-cover-text-outline-stroke-ring {
  stroke: var(--text-outline-color, #000000);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.front-cover-text-outline-cell .text-swatch-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}
.front-cover-text-outline-cell:focus-within {
  border-color: #d1a84c;
  box-shadow: 0 0 0 2px rgb(255 204 102 / 0.22);
}
.front-cover-text-outline-cell .text-outline-size {
  flex: 0 1 2rem;
  min-width: 0;
  width: 2rem;
  max-width: 2rem;
  border: 0;
  padding: 0.08rem 0.05rem;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
  box-shadow: none;
  text-align: right;
  font-size: 0.76rem;
  line-height: 1.2;
  appearance: textfield;
  -moz-appearance: textfield;
  font-variant-numeric: tabular-nums;
}
.front-cover-text-outline-cell .text-outline-size::-webkit-outer-spin-button,
.front-cover-text-outline-cell .text-outline-size::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.front-cover-text-actions {
  display: flex;
  gap: 0.2rem;
  justify-content: center;
  align-items: center;
  min-width: 2.2rem;
  width: 100%;
}
.front-cover-text-actions .small {
  padding: 0.18rem 0.3rem;
  border-radius: 8px;
}
.cover-text-group .toolbar strong {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cover-text-table td:nth-child(1) .drag-handle {
  vertical-align: middle;
}
.back-cover-text-field-cell {
  display: grid;
  gap: 0.28rem;
}
.back-cover-text-field-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.25rem;
}
.back-cover-text-field-top .small {
  min-width: 0;
  padding: 0.18rem 0.38rem;
}
.back-cover-text-field-top select {
  min-width: 0;
}
.back-cover-text-field-label {
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.back-cover-text-field-label.is-custom {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
}
.back-cover-text-edit-button {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.95rem;
  line-height: 1;
}
.back-cover-slider-stack {
  display: grid;
  gap: 0.14rem;
}
.back-cover-slider-stack label {
  display: grid;
  grid-template-columns: 0.7rem minmax(0, 1fr);
  align-items: center;
  gap: 0.2rem;
  margin: 0;
}
.back-cover-slider-stack span {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a6755;
}
.back-cover-slider-stack input[type="range"] {
  width: 100%;
  max-width: 4.6rem;
  margin: 0;
}
.back-cover-align-stack {
  display: grid;
  gap: 0.2rem;
  justify-items: center;
}
.back-cover-align-stack label {
  display: grid;
  justify-items: center;
  width: 100%;
  margin: 0;
}
.back-cover-align-stack input[type="range"] {
  width: 100%;
  max-width: 3.2rem;
  margin: 0;
}
.text-align-cycle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid #cfc6bc;
  border-radius: 8px;
  background: #fff;
}
.text-align-cycle img {
  width: 1rem;
  height: 1rem;
  display: block;
}
.cover-text-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}
.front-cover-trash-drop {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 10.5rem;
  padding: 0.42rem 0.75rem;
  border: 1px dashed #d8b36a;
  border-radius: 10px;
  background: #fff8e8;
  color: #8b5c18;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
.cover-text-actions-bar > .small {
  justify-self: start;
  border-radius: 10px;
  padding: 0.42rem 0.7rem;
}
.front-cover-trash-drop.is-visible {
  display: inline-flex;
}
.front-cover-trash-drop.is-over {
  border-style: solid;
  background: #ffe7e1;
  border-color: #cf6a57;
  color: #9f2b17;
}
.front-cover-trash-icon {
  font-size: 0.95rem;
  line-height: 1;
}
.data-inline-object {
  display: grid;
  gap: 0.45rem;
}
.data-inline-object .data-field {
  grid-template-columns: 8rem minmax(0, 1fr);
  padding: 0.45rem 0.55rem;
}
.data-empty {
  color: var(--muted);
  font-style: italic;
}
.data-primitive {
  white-space: pre-wrap;
}
.data-color-value {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.data-color-swatch {
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  border: 1px solid #000;
  border-radius: 0.15rem;
}
.data-date-meta {
  display: grid;
  gap: 0.12rem;
  margin-top: 0.22rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.data-file-value,
.data-image-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.data-file-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.data-file-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #f2eadf;
  color: #5f5143;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.2;
}
.data-file-action {
  padding: 0.42rem 0.7rem;
  font-size: 0.82rem;
  background: #efe4d5;
}
.data-image-chip {
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid #d8cfbf;
  border-radius: 12px;
  background: #fff8e8;
  overflow: hidden;
}
.data-image-chip img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.data-image-meta {
  font-size: 0.8rem;
  color: var(--muted);
}
.data-image-stage {
  display: grid;
  place-items: center;
  min-height: 18rem;
  max-height: min(70vh, 42rem);
  padding: 0.5rem;
  border-radius: 16px;
  background: #f7f1e8;
  border: 1px solid #ead9ba;
}
.data-image-stage img {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 14px 36px rgb(0 0 0/0.12);
}
.data-code {
  margin: 0;
  max-height: min(70vh, 44rem);
  overflow: auto;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid #ead9ba;
  background: #221c1a;
  color: #f7f0e7;
  font:
    12px/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.data-code-hex {
  white-space: pre;
  word-break: normal;
}
.data-code-json {
  background: #221c1a;
  border-color: #403428;
  white-space: pre;
  word-break: normal;
  overflow: auto;
}
.modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(56rem, calc(100vw - 2rem));
  width: 100%;
}
.modal::backdrop {
  background: rgb(25 17 13 / 0.55);
  backdrop-filter: blur(3px);
}
.modal-card {
  margin: 0;
  padding: 1rem;
  background: #fffdf8;
  border: 1px solid #e5d7c5;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgb(0 0 0/0.25);
  display: grid;
  gap: 1rem;
}
.modal-card h2 {
  margin: 0.1rem 0;
}
.modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.book-info-picker-selection {
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 0.8rem;
}
.classification-extension-browser {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid #ead9ba;
}
.classification-extension-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.classification-extension-breadcrumbs,
.classification-extension-list {
  display: grid;
  gap: 0.45rem;
}
.asset-upload-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}
.asset-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}
.asset-card-preview-button {
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  overflow: hidden;
}
.asset-card-preview {
  width: 120px;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid #e2d6c8;
  background: #f6eee4;
  display: block;
}
.asset-card-meta {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}
.asset-card-title {
  font-weight: 900;
  overflow-wrap: anywhere;
}
.asset-card-sub {
  font-size: 0.83rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.asset-card-refs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.asset-ref {
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: #f2eadf;
  color: #5f5143;
  font-size: 0.76rem;
  font-weight: 700;
}
.asset-card-actions {
  display: grid;
  gap: 0.5rem;
  justify-items: end;
}
.asset-card.current {
  border-color: #ffcc66;
  box-shadow: 0 0 0 2px rgb(255 204 102 / 0.3);
}
.asset-card-actions button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
@media (max-width: 1050px) {
  body {
    display: block;
    overflow: auto;
  }
  .app-header {
    grid-template-columns: 1fr;
  }
  .app-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .settings {
    overflow: visible;
    border-right: 0;
  }
  .controls {
    height: auto;
    overflow: visible;
  }
  .editor-grid,
  .conflict-grid,
  .asset-card,
  .asset-slider-grid,
  .cover-text-grid,
  .data-field {
    grid-template-columns: 1fr;
  }
  .asset-card-actions {
    justify-items: start;
  }
  .asset-picker-surface {
    grid-template-columns: minmax(0, 1fr) 4.5rem;
  }
  .editor-grid textarea,
  .md-preview {
    height: 14rem;
  }
}
