#cover-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}

#cover-overlay.open {
  display: flex;
}

#cover-modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r2);
  width: 92vw;
  max-width: 1100px;
  height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#cover-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#cover-design-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
  flex-shrink: 0;
}

.cv-tab, .cv-design-tab {
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  padding: 4px 12px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 10px;
  font-family: 'IBM Plex Mono', monospace;
  white-space: nowrap;
}

.cv-tab.active, .cv-design-tab.active {
  color: var(--accent);
  background: var(--accentbg);
  border-color: var(--accent2);
}

#cover-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

#cover-left {
  width: 360px;
  min-width: 360px;
  overflow-y: auto;
  padding: 16px;
  border-right: 1px solid var(--border);
}

#cover-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
  background: #e8e4de;
}

#cover-canvas-wrap {
  background: #fff;
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.cv-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.cv-section-title {
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.cv-title {
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 600;
}

.cv-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 9px;
  border-radius: var(--r);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  outline: none;
  width: 100%;
  margin-bottom: 8px;
}

.cv-input:focus {
  border-color: var(--accent);
}

.cv-input.cv-color {
  width: 36px;
  height: 28px;
  padding: 2px;
}

.cv-elem-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.cv-elem-idx {
  min-width: 18px;
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
}

.cv-elem-move {
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  font-size: 9px;
  line-height: 1;
  padding: 2px 4px;
  color: var(--text2);
}

.cv-elem-move:hover:not([disabled]) {
  background: var(--bg-shade);
  color: var(--text);
}

.cv-elem-type {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 6px;
  border-radius: var(--r);
  font-size: 10px;
  font-family: 'IBM Plex Mono', monospace;
  outline: none;
}

.cv-elem-del {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
}

.cv-add-btn {
  background: var(--accentbg);
  border: 1px dashed var(--accent);
  color: var(--accent);
  padding: 6px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 10px;
  width: 100%;
  margin-top: 4px;
  font-family: 'IBM Plex Mono', monospace;
}

.cv-style-card {
  background: var(--bg3);
  transition: background 0.1s;
}

.cv-style-card:hover {
  background: var(--accentbg);
  border-color: var(--accent) !important;
}

.cv-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.cv-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.cv-label {
  font-size: 10px;
  color: var(--text3);
  min-width: 50px;
}

.cv-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}