/* UPUPG_CARDS_LAYOUT_V2 — isolated to /cards/ page and editor only. */
body.upupg-cards-wide-page .up-shell{max-width:none;width:95%;margin-inline:auto}
body.upupg-cards-wide-page .cards-app{max-width:none;width:100%;margin-inline:auto}
body.upupg-cards-wide-page .cards-gallery-panel,
body.upupg-cards-wide-page .cards-workspace{width:100%;min-width:0}
body.upupg-cards-wide-page .cards-head{padding:20px 26px}
body.upupg-cards-wide-page .cards-editor-grid[data-cards-layout="2"]{
  display:grid;direction:rtl;grid-template-columns:minmax(250px,24%) minmax(0,1fr) minmax(250px,24%);
  gap:15px;align-items:start;
}
.cards-editor-grid[data-cards-layout="2"] .cards-tools-right{grid-column:1;grid-row:1}
.cards-editor-grid[data-cards-layout="2"] .cards-preview-area{grid-column:2;grid-row:1}
.cards-editor-grid[data-cards-layout="2"] .cards-tools-left{grid-column:3;grid-row:1}
.cards-editor-grid[data-cards-layout="2"] .cards-tools-right,
.cards-editor-grid[data-cards-layout="2"] .cards-tools-left{
  border:1px solid #496184;background:#14243e;border-radius:13px;padding:14px;min-width:0;
  max-height:calc(100vh - 35px);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#567094 #14243e;
}
.cards-editor-grid[data-cards-layout="2"] .cards-preview-area{
  min-width:0;width:100%;max-width:none;position:sticky;top:12px;max-height:calc(100vh - 28px);
  padding:14px;overflow-x:auto;overflow-y:auto;scrollbar-width:thin;
}
.cards-editor-grid[data-cards-layout="2"] .cards-canvas-wrap{width:100%;max-width:none;min-width:0}
.cards-editor-grid[data-cards-layout="2"] .cards-layer-below{width:100%;max-width:none;padding:10px;gap:6px;margin-top:12px}
.cards-editor-grid[data-cards-layout="2"] .cards-layer-below textarea{display:none}
.cards-editor-grid[data-cards-layout="2"] .cards-tools-heading{
  display:flex;align-items:center;justify-content:flex-start;gap:9px;
  padding:0 0 10px;margin-bottom:13px;border-bottom:1px solid #4b6487;color:#f2be63;
  font-size:15px;line-height:1.6;
}
.cards-editor-grid[data-cards-layout="2"] .cards-tools-heading span{font-size:19px}
.cards-editor-grid[data-cards-layout="2"] .cards-edit-text-slot{
  border:1px solid #425a7b;border-radius:10px;padding:10px;margin:0 0 12px;background:#192d49
}
.cards-editor-grid[data-cards-layout="2"] .cards-edit-text-slot label{
  display:block;color:#f1c477;font-size:12px;font-weight:bold;margin-bottom:6px
}
.cards-editor-grid[data-cards-layout="2"] .cards-edit-text-slot textarea{
  display:block;min-height:90px;width:100%;resize:vertical;border:1px solid #526b8a;
  border-radius:8px;padding:10px;background:#0f2039;color:#eef5ff;font:inherit
}
.cards-editor-grid[data-cards-layout="2"] .cards-preview-heading{
  width:100%;display:flex;justify-content:space-between;align-items:center;gap:10px;
  margin-bottom:12px;color:#f0ba60;font-size:15px;
}
.cards-editor-grid[data-cards-layout="2"] .cards-preview-heading small{direction:ltr;color:#b5c8e3;font-size:11px}
.cards-editor-grid[data-cards-layout="2"] .cards-zoom-toolbar{
  width:100%;display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:9px;margin-top:12px;padding-top:10px;border-top:1px solid #435778;
  color:#b9c9e2;font-size:11px;
}
.cards-editor-grid[data-cards-layout="2"] .cards-zoom-actions{display:flex;align-items:center;gap:6px;direction:ltr}
.cards-editor-grid[data-cards-layout="2"] .cards-zoom-actions button{
  color:#f2e6ce;background:#172943;border:1px solid #526a8b;border-radius:7px;padding:5px 9px;min-width:32px
}
.cards-editor-grid[data-cards-layout="2"] .cards-zoom-actions output{min-width:44px;text-align:center;font-size:12px}
.cards-editor-grid[data-cards-layout="2"] .cards-mode-switch button{padding:10px 5px}
.cards-editor-grid[data-cards-layout="2"] .cards-controls{width:auto;margin:0}
.cards-editor-grid[data-cards-layout="2"] .cards-two{grid-template-columns:minmax(0,1fr) 70px;gap:7px}
.cards-editor-grid[data-cards-layout="2"] .cards-control{margin-bottom:13px}
.cards-editor-grid[data-cards-layout="2"] .cards-card-actions{min-width:0}
.cards-editor-grid[data-cards-layout="2"] .cards-inline{flex-wrap:wrap}
.cards-editor-grid[data-cards-layout="2"] .cards-inline button{min-width:105px}
.cards-layout-shelf{margin-top:17px;padding:12px 16px;background:#152641;border:1px solid #405b80;border-radius:13px}
.cards-layout-shelf .cards-tools-heading{display:flex;align-items:center;gap:8px;color:#f0be67;margin-bottom:8px;font-size:15px}
.cards-layout-shelf-row{display:flex;gap:12px;overflow-x:auto;direction:rtl;scroll-snap-type:x proximity;padding:5px 0 8px}
.cards-layout-template-thumb{scroll-snap-align:start;flex:0 0 108px;max-width:108px;border:1px solid #4e6382;background:#1a2a46;border-radius:9px;padding:5px;color:#e4edfa;text-align:center;font-size:11px}
.cards-layout-template-thumb:hover,.cards-layout-template-thumb.selected{border-color:#edba60}
.cards-layout-template-thumb img{display:block;width:100%;height:78px;object-fit:cover;border-radius:5px}
.cards-layout-template-thumb span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:4px}
@media(max-width:1090px){
  body.upupg-cards-wide-page .cards-editor-grid[data-cards-layout="2"]{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .cards-editor-grid[data-cards-layout="2"] .cards-preview-area{grid-column:1/-1;grid-row:1;position:static;max-height:none;overflow-x:auto}
  .cards-editor-grid[data-cards-layout="2"] .cards-tools-right{grid-column:1;grid-row:2}
  .cards-editor-grid[data-cards-layout="2"] .cards-tools-left{grid-column:2;grid-row:2}
  .cards-editor-grid[data-cards-layout="2"] .cards-tools-right,
  .cards-editor-grid[data-cards-layout="2"] .cards-tools-left{max-height:none;overflow:visible}
  .cards-editor-grid[data-cards-layout="2"] .cards-canvas-wrap{max-width:620px!important}
}
@media(max-width:680px){
  body.upupg-cards-wide-page .up-shell{width:100%}
  body.upupg-cards-wide-page .cards-editor-grid[data-cards-layout="2"]{grid-template-columns:minmax(0,1fr);gap:12px}
  .cards-editor-grid[data-cards-layout="2"] .cards-preview-area{grid-column:1;grid-row:1}
  .cards-editor-grid[data-cards-layout="2"] .cards-tools-right{grid-column:1;grid-row:2}
  .cards-editor-grid[data-cards-layout="2"] .cards-tools-left{grid-column:1;grid-row:3}
  .cards-editor-grid[data-cards-layout="2"] .cards-tools-left,
  .cards-editor-grid[data-cards-layout="2"] .cards-tools-right{padding:12px}
  .cards-layout-template-thumb{flex-basis:92px;max-width:92px}
  .cards-layout-template-thumb img{height:65px}
}
