.note-card-cover-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--compact-modal-light-backdrop);
}

.note-card-cover-panel,
.note-card-cover-exit {
  box-sizing: border-box;
  width: min(740px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  border: 1px solid var(--compact-modal-light-border);
  border-radius: 20px;
  padding: 18px 20px;
  background: var(--compact-modal-light-surface);
  color: var(--text);
  box-shadow: var(--compact-modal-light-shadow);
}

.note-card-cover-modal-header {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.note-card-cover-modal-header h2 {
  margin: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.note-card-cover-modal-header svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.note-card-cover-heading {
  margin-bottom: 12px;
}

.note-card-cover-heading h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.note-card-cover-heading p,
.note-card-cover-hint,
.note-card-cover-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.note-card-cover-panel .note-card-cover-heading h4 {
  display: none;
}

.note-card-cover-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.85fr);
  align-items: start;
  gap: 18px;
}

.note-card-cover-framing {
  min-width: 0;
}

.note-card-cover-label {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.note-card-cover-preview {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line);
  touch-action: none;
}

.note-card-cover-preview.has-photo { cursor: grab; }
.note-card-cover-preview.is-dragging { cursor: grabbing; }
.note-card-cover-preview[aria-disabled="true"] { cursor: default; touch-action: pan-y; }
.note-card-cover-preview:focus-visible {
  outline: 2px solid var(--primary-action);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px var(--primary-action-glow);
}

.note-card-cover-preview-image {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.note-card-cover-preview-image[hidden],
.note-card-cover-placeholder[hidden] { display: none; }

.note-card-cover-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.note-card-cover-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

.note-card-cover-zoom input[type="range"] {
  width: 100%;
  min-width: 0;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--primary-action);
}

.note-card-cover-zoom output { min-width: 3.2em; text-align: right; }
.note-card-cover-zoom > span { flex: 0 0 auto; white-space: nowrap; }

.note-card-cover-reset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 9px;
}

.note-card-cover-reset-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
}

.note-card-cover-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  max-height: 232px;
  overflow: auto;
  padding: 3px;
  scrollbar-width: thin;
}

.note-card-cover-photo {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  min-height: 0;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.note-card-cover-photo:hover {
  border-color: var(--green-light);
  background: rgba(255, 255, 255, 0.42);
}

.note-card-cover-photo.is-selected {
  border-color: var(--primary-action);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 8px var(--primary-action-glow);
}

.note-card-cover-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 3px;
}

.note-card-cover-photo img[hidden],
.note-card-cover-photo-placeholder[hidden] { display: none; }
.note-card-cover-photo-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--bg);
  color: var(--muted);
}
.note-card-cover-photo-placeholder svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.note-card-cover-photo span {
  overflow: hidden;
  width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
}

.note-card-cover-status:not(:empty) { margin-top: 12px; }
.note-card-cover-exit { width: min(390px, 100%); }
.note-card-cover-exit p { margin: 4px 0 18px; line-height: 1.5; }
.note-card-cover-exit-actions { display: flex; justify-content: flex-end; gap: 10px; }
.note-card-cover-danger { background: var(--red); }
.note-card-cover-danger:hover { background: var(--red-light); color: var(--text); }
.note-card-cover-exit-actions .secondary:focus { box-shadow: 0 0 0 3px var(--primary-action-glow); border-color: var(--primary-action); }

@media (max-width: 640px) {
  .note-card-cover-modal { padding: 12px; }
  .note-card-cover-panel { max-height: calc(100dvh - 24px); padding: 14px; border-radius: 16px; }
  .note-card-cover-modal-header { grid-template-columns: 40px minmax(0, 1fr) 40px; margin-bottom: 14px; }
  .note-card-cover-modal-header .icon-button { width: 40px; height: 40px; }
  .note-card-cover-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .note-card-cover-picker {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    padding: 3px 3px 5px;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
  }
  .note-card-cover-photo { flex: 0 0 70px; }
  .note-card-cover-reset-actions button { min-height: 40px; font-size: 13px; }
  .note-card-cover-zoom input { font-size: 16px; }
  .note-card-cover-exit-actions { display: grid; }
  .note-card-cover-exit-actions button { min-height: 44px; }
}
