/* UPUPG_CARDS_LAYOUT_V21 - only applies over Cards layout v2. */
.cards-editor-grid[data-cards-layout="2"] .cards-preview-area {
  position: static !important;
  top: auto !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  scrollbar-width: none;
  align-self: start;
}
.cards-editor-grid[data-cards-layout="2"] .cards-canvas-wrap {
  max-height: none !important;
  height: auto !important;
}
.cards-editor-grid[data-cards-layout="2"] #cards-canvas {
  display: block;
  height: auto;
  max-width: 100%;
}
.cards-editor-grid[data-cards-layout="2"] #cards-layer-below[hidden] { display:none !important; }
.cards-editor-grid[data-cards-layout="2"] .cards-v21-layer-selector {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #516a8b;
  border-radius: 10px;
  background: #101f38;
}
.cards-editor-grid[data-cards-layout="2"] .cards-v21-layer-selector label { color:#f2c071;font-weight:700;font-size:13px; }
.cards-editor-grid[data-cards-layout="2"] .cards-v21-layer-selector select {
  width:100%; min-width:0; padding:9px; border-radius:7px;
  background:#0c1930; color:#f0f5ff; border:1px solid #587195;
}
.cards-editor-grid[data-cards-layout="2"] .cards-v21-layer-selector button { justify-self:start; }
.cards-editor-grid[data-cards-layout="2"] #cards-selection-warning {
  margin: 8px 0 14px; font-size:12px; line-height:1.8;
}
.cards-editor-grid[data-cards-layout="2"] .cards-v21-preset-heading {
  display:flex; justify-content:space-between; align-items:center; gap:7px; margin-bottom:9px; flex-wrap:wrap;
}
.cards-editor-grid[data-cards-layout="2"] .cards-v21-preset-heading label {margin:0;color:#e8ecf8}
.cards-editor-grid[data-cards-layout="2"] .cards-v21-more {
  color:#f3be64; border:1px solid #6b84a4; background:#203655;
  padding:6px 10px; border-radius:7px; cursor:pointer; font-size:12px;
}
.cards-v21-shelf-note { margin:0 0 11px;color:#c4d5ed;font-size:13px;line-height:1.7 }
.cards-v21-dialog {
  position:fixed; inset:0; margin:auto;
  width:min(790px,calc(100vw - 24px)); max-width:790px; max-height:min(88vh,850px);
  padding:18px; box-sizing:border-box; border-radius:14px; border:1px solid #547297;
  background:#182844; color:#e5eefa; box-shadow:0 20px 70px #030a16c0;
  overflow:auto; font:14px/1.8 Tahoma,Arial,sans-serif; text-align:right; z-index:100000;
}
.cards-v21-dialog::backdrop { background:rgba(0,6,20,.75); }
.cards-v21-dialog-head,.cards-v21-dialog-foot {display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.cards-v21-dialog h2 {font-size:20px;color:#f4c071;margin:0}
.cards-v21-dialog button {cursor:pointer;border:1px solid #627b9b;border-radius:8px;background:#233958;color:#e8f0ff;padding:7px 12px;font:inherit}
.cards-v21-dialog button:hover {border-color:#efb959}
.cards-v21-dialog .cards-v21-close {color:#f0c073}
.cards-v21-dialog-hint {color:#c2d2ea;font-size:12px;margin:8px 0 15px}
.cards-v21-categories {display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:12px}
.cards-v21-categories button {font-size:12px;padding:5px 10px}
.cards-v21-categories button.active {background:#e9b65c;border-color:#e9b65c;color:#15243a;font-weight:bold}
.cards-v21-search-label {display:block;margin-bottom:5px}
.cards-v21-dialog input[type=search] {display:block;width:100%;min-height:40px;background:#0d1c34;border:1px solid #6580a0;color:#e9f1fd;border-radius:8px;padding:10px 12px;font:inherit;box-sizing:border-box}
.cards-v21-phrases {display:grid;gap:10px;max-height:45vh;overflow:auto;margin:14px 0}
.cards-v21-phrase {border:1px solid #455f80;border-radius:10px;padding:12px;background:#12213a}
.cards-v21-phrase strong {color:#f0bd68}
.cards-v21-phrase p {white-space:pre-wrap;margin:6px 0 12px;line-height:2}
.cards-v21-phrase-actions {display:flex;gap:8px;flex-wrap:wrap}
.cards-v21-phrase-actions button:last-child {background:#e7b55f;color:#15233a;border-color:#e7b55f}
.cards-v21-dialog-foot {border-top:1px solid #415b7e;padding-top:12px}
.cards-v21-empty,.cards-v21-status {color:#e8c67d;font-size:12px}
@media (max-width:680px) {
  .cards-v21-dialog {width:calc(100vw - 12px);max-height:92vh;padding:12px}
  .cards-v21-dialog h2 {font-size:17px}
  .cards-v21-phrases {max-height:47vh}
  .cards-v21-preset-heading {align-items:flex-start}
}
