.header-line {
    display: inline-flex;
    align-items: baseline;
    gap: 12px;
}
.header-line h1,
.header-line h3 {
    margin: 0;
}

/* Global */
:root{
  --gutter: 16px;
  --border: #d6d9de;
  --panel-bg: #f6f7f9;
  --text: #1f2937;
  --muted: #6b7280;
  --brand: #111827;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:#fff;
}

/* Header + menu (master layout) */
.app-header{
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.titlebar{
  display:flex;
  align-items:center;
  background: rgb(100,130,180);
  color: #fff;
  padding: 0;
}
.titlebar-logo{
  margin-left: 10px;
  margin-right: 6px;
  height: 28px;
  width: auto;
  flex: 0 0 auto;
}
.titleblock{
  display:flex;
  flex-direction:column;
  line-height: 1.1;
}
.title{
  font-size: 18px;x;
  font-weight: 700;
  color: #fff;
}
.{
  font-size: 12px;
  color: rgba(255,255,255,0.85);
}

.menubar{
  display:flex;
  gap: 10px;
}
    .menu-item {
        display: inline-block;
        margin-left: 10px;
        border-radius: 8px;
        text-decoration: none;
        color: var(--text);
        border: 1px solid transparent;
    }
.menu-item:hover{
  border-color: var(--border);
  background: #fafafa;
}
.menu-item.active{
  border-color: #93c5fd;
  background: #eff6ff;
}

.app-main{
  padding: 16px;
}

/* Designer page layout */
.designer{
  display:flex;
  min-height: calc(100vh - 120px);
  gap: 16px;
}

.left{
  width: 300px;
  padding: var(--gutter);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-bg);
  height: fit-content;
}

.right{
  flex:1;
  padding: var(--gutter);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.panel-title{
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 700;
}

.palette{
  display:flex;
  flex-direction:column;
}
.palette-item{
  display:flex;
  align-items:center;
  /*padding: 10px;*/
  border: 1px solid var(--border);
  background:#fff;
  border-radius: 10px;
  cursor: grab;
  user-select:none;
}
.palette-item:active{ cursor: grabbing; }
.palette-item img{
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.caption{
  font-size: 14px;
  color: var(--muted);
}

.help{
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--border);
  background:#fff;
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted);
  display:flex;
  flex-direction:column;
  gap: 6px;
}

/* Workspace */
.workspace-header{
  margin-bottomm: 10px;
}
.metrics{
  font-size: 13px;
  color: var(--muted);
}
.workspace-shell{
  display:flex;
  align-items:flex-start;
  justify-content:flex-start;
}

.workspace-actions{
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.workspace-actions-hint{
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.workspace{
  position: relative;
  /* Workspace background should fill the entire workspace container,
     including the region outside the dotted boundary. */
  background: #fff url('/images/HorizlCardPunch.png') center center / cover no-repeat;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  padding: 0;
}
.boundary{
  position:absolute;
  /* Inset from workspace edge: left, top, right, bottom */
  left: 15px;
  top: 30px;
  right: 15px;
  bottom: 10px;
  /* Slightly wider dashed boundary */
  border: 3px dashed #d10000;
  border-radius: 10px;
  /* Keep boundary transparent so the workspace background shows through */
  background: transparent;
  overflow: hidden; /* clips anything outside */
}

/* Textboxes */
.ld-textbox{
  position:absolute;
  min-width: 90px;
  min-height: 28px;
    border: none;
  border-radius: 6px;
  background: transparent; /* transparent background */
  cursor: move;
}
.ld-textbox .ld-textbox-content{
  width: 100%;
  height: 100%;
  padding: 4px 6px;
  color: #111827;
  font-size: 16px;
  line-height: 1.2;
  background: transparent;
  outline: none;
  cursor: text;
  white-space: pre-wrap;
}

/* Hover cursor cue for textboxes (crossed-arrows / move cursor) */
.ld-textbox:hover,
.ld-textbox:hover .ld-textbox-content{
  cursor: move;
}


/* Textbox hover border (solid thin black; hover only) */
.ld-textbox:hover{
  outline: 1px solid #000;
  outline-offset: -1px;
}

/* Shapes */
.ld-shape{
  position:absolute;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: move;
}

/* Image placeholder */
.ld-imagebox{
  position:absolute;
  border: none;
  border-radius: 10px;
  background: rgba(31,41,55,0.04);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 14px;
  color: rgba(31,41,55,0.75);
  cursor: move;
  user-select: none;
}

.ld-imagebox img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* Image folder picker dialog */
.ld-imgdlg{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ld-imgdlg-toolbar{
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.ld-imgdlg-search{
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.ld-imgdlg-list{
  border: 1px solid rgba(31,41,55,0.18);
  border-radius: 10px;
  background: #fff;
  max-height: 320px;
  overflow: auto;
  padding: 6px;
}

.ld-imgdlg-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}

.ld-imgdlg-item:hover{
  background: rgba(17,24,39,0.04);
}

.ld-imgdlg-item.selected{
  background: rgba(59,130,246,0.12);
}

.ld-imgdlg-thumb{
  width: 48px;
  height: 32px;
  border-radius: 6px;
  background: rgba(31,41,55,0.04);
  flex: 0 0 auto;
  object-fit: contain;
}

.ld-imgdlg-name{
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ld-imgdlg-footer{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.ld-imgdlg-selected{
  font-size: 12px;
  color: var(--muted);
}

.ld-imgdlg-selectedname{
  color: var(--text);
}


/* Context menu */
.ld-context-menu{
  position: fixed;
  z-index: 9999;
  display: none;
  min-width: 160px;
  padding: 6px;
  border: 1px solid rgba(31,41,55,0.25);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}
.ld-context-menu button{
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}
.ld-context-menu button:hover{
  background: rgba(17,24,39,0.06);
}
.ld-context-menu button:disabled{
  opacity: 0.45;
  cursor: default;
}
.ld-context-menu .sep{
  height: 1px;
  margin: 6px 4px;
  background: rgba(31,41,55,0.12);
}


/* Modal (shape picker) */
.ld-modal{ /* full-screen modal overlay container */
  position: fixed;
  inset: 0;
  display: none;
  z-index: 10000;
}
.ld-modal[aria-hidden="false"]{ display: block; }

/*
  IMPORTANT:
  The app also contains another modal system based on .ld-modal-overlay/.open
  where .ld-modal is used as the *dialog panel* class. Those rules appear
  later in this file and have historically overridden the overlay behavior for
  the Design page modals (Image source / Images folder), causing them to show
  immediately on navigation to the Design page.

  To prevent that regression, we re-apply overlay semantics specifically for
  those Design-page modals further below (by id), which safely wins in CSS
  precedence without disturbing the other modal system.
*/
.ld-modal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(17,24,39,0.35);
}
.ld-modal-panel{
  position: absolute;
  left: 50%;
  top: 25%;
  transform: translate(-50%, -20%);
  width: min(420px, calc(100vw - 40px));
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  border: 1px solid rgba(31,41,55,0.12);
  overflow: hidden;
}
.ld-modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(31,41,55,0.10);
}
.ld-modal-title{
  font-weight: 600;
  color: #111827;
}
.ld-modal-close{
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 22px;
  cursor: pointer;
  color: #374151;
  padding: 0 6px;
}
.ld-modal-body{
  padding: 14px;
}
.ld-modal-hint{
  color: #374151;
  margin-bottomm: 10px;
  font-size: 0.95rem;
}
.ld-modal-actions{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
}
.ld-btn{
  border: 1px solid rgba(31,41,55,0.18);
  background: #f9fafb;
  color: #111827;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}
.ld-btn:hover{ background:#f3f4f6; }
.ld-btn-secondary{
  background:#fff;
  font-weight: 600;
}

/* Body fill rendering
   -------------------
   Keep containers transparent so fills do not paint rectangular artifacts
   around clipped shapes (e.g., triangles). We render fills via pseudo-elements.
*/
.ld-rect::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: 0px;
  background: var(--rect-fill, rgba(59,130,246,0.08));
  pointer-events:none;
}

/* Ellipse body fill rendered via pseudo-element so the container can remain
   transparent (prevents rectangular artifacts when opacity is applied).
   We use clip-path so the ellipse can be *reshaped* without resizing the box. */
.ld-ellipse::before{
  content:"";
  position:absolute;
  inset:0;
  background: var(--ell-fill, rgba(59,130,246,0.08));
  clip-path: var(--ell-clip, ellipse(50% 50% at 50% 50%));
  pointer-events:none;
}

/* Shape variants */
.ld-rect{ border-radius: 8px; }
.ld-ellipse{ border-radius: 0; }
.ld-triangle{
  border-radius: 0;
  /* Do NOT clip the container itself; we clip a pseudo-element so that
     resize/vertex handles remain reachable (children would otherwise be clipped). */
  clip-path: none;
}

.ld-triangle::before{
  content: "";
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  background: var(--tri-fill, rgba(59,130,246,0.08));
  border: inherit;
  clip-path: var(--tri-clip, polygon(50% 0%, 0% 100%, 100% 100%));
  pointer-events: none;
}

/*
  Ellipse handle reachability
  --------------------------
  For rounded shapes, corner hit-testing can make the diagonal handles hard to
  reach when handles are placed exactly at the bounding-box corners.

  We place the diagonal handles slightly *inside* the bounding box so they sit
  on the visible ellipse region (near the 45° points), while keeping N/E/S/W
  handles on the mid-edges.
*/
.ld-ellipse .ld-resize-handle.h-nw{ left: 15%; top: 15%; right: auto; bottom: auto; transform: translate(-50%,-50%); }
.ld-ellipse .ld-resize-handle.h-ne{ left: 85%; top: 15%; right: auto; bottom: auto; transform: translate(-50%,-50%); }
.ld-ellipse .ld-resize-handle.h-sw{ left: 15%; top: 85%; right: auto; bottom: auto; transform: translate(-50%,-50%); }
.ld-ellipse .ld-resize-handle.h-se{ left: 85%; top: 85%; right: auto; bottom: auto; transform: translate(-50%,-50%); }

/* Hover-only resize handles (for shapes and textboxes) */
.ld-resizable{ position: absolute; }

.ld-resize-handle{
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border: 1px solid rgba(17,24,39,0.7);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
  z-index: 50;
  display: none;
}

.ld-resizable:hover .ld-resize-handle{ display:block; }

/* Triangle vertex reshape handles (shown only on hover) */
.ld-vertex-handle{
  position: absolute;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 1px solid rgba(17,24,39,0.75);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
  z-index: 60;
  display: none;
  transform: translate(-50%,-50%);
  cursor: grab;
}
.ld-triangle:hover .ld-vertex-handle{ display:block; }
.ld-vertex-handle:active{ cursor: grabbing; }


/* Ellipse reshape handles (shown only on hover) */
.ld-ellipse-handle{
  position: absolute;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 1px solid rgba(17,24,39,0.75);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
  z-index: 60;
  display: none;
  transform: translate(-50%,-50%);
  cursor: grab;
}
.ld-ellipse:hover .ld-ellipse-handle{ display:block; }
.ld-ellipse-handle:active{ cursor: grabbing; }

/* Handle positioning */
.ld-resize-handle.h-nw{ left:0; top:0; transform: translate(-50%,-50%); cursor: nwse-resize; }
.ld-resize-handle.h-n{ left:50%; top:0; transform: translate(-50%,-50%); cursor: ns-resize; }
.ld-resize-handle.h-ne{ right:0; top:0; transform: translate(50%,-50%); cursor: nesw-resize; }
.ld-resize-handle.h-e{ right:0; top:50%; transform: translate(50%,-50%); cursor: ew-resize; }
.ld-resize-handle.h-se{ right:0; bottom:0; transform: translate(50%,50%); cursor: nwse-resize; }
.ld-resize-handle.h-s{ left:50%; bottom:0; transform: translate(-50%,50%); cursor: ns-resize; }
.ld-resize-handle.h-sw{ left:0; bottom:0; transform: translate(-50%,50%); cursor: nesw-resize; }
.ld-resize-handle.h-w{ left:0; top:50%; transform: translate(-50%,-50%); cursor: ew-resize; }

/* ---------------------------------
   Color picker modal
--------------------------------- */
.ld-modal-panel-wide{
  max-width: 760px;
}
.ld-colorpicker{ display:flex; flex-direction:column; gap: 14px; }
.ld-colorpicker-top{ display:flex; gap: 14px; align-items:stretch; }
.ld-colorpicker-canvases{ display:flex; gap: 10px; align-items:flex-start; }
#cpSv{ border-radius: 10px; cursor: crosshair; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.10); }
#cpHue{ border-radius: 10px; cursor: ns-resize; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.10); }
.ld-colorpicker-preview-row{ display:flex; flex-direction:column; gap: 10px; }
.ld-colorpicker-swatch{
  width: 100%;
  height: 92px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
  background: rgba(0,0,0,1);
}
.ld-colorpicker-readout{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color:#111827;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(17,24,39,0.04);
  border: 1px solid rgba(31,41,55,0.10);
}
.ld-colorpicker-controls{ display:flex; flex-direction:column; gap: 10px; }
.ld-colorpicker-row{ display:flex; flex-wrap:wrap; gap: 10px; align-items:center; }
.ld-colorpicker-row label{ display:flex; gap: 6px; align-items:center; font-size: 13px; color:#111827; }
.ld-colorpicker-row input[type="number"]{ width: 74px; padding: 6px 8px; border-radius: 10px; border: 1px solid rgba(31,41,55,0.18); }
.ld-colorpicker-row label.hex input{ width: 130px; }
.ld-colorpicker-row label.opacity{ flex:1; }
.ld-colorpicker-row input[type="range"]{ width: 100%; }
.ld-colorpicker-opacityvalue{ width: 56px; text-align:right; color:#111827; font-size: 13px; }



/* Font dialog */
.ld-input{
  width: 100%;
  padding: 6px 8px;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 6px;
  background: rgba(255,255,255,0.9);
}
.ld-fontdlg{
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ld-fontdlg-row{
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 10px;
}
.ld-fontdlg-styles{
  align-items: start;
}
.ld-fontdlg-styleboxes{
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.ld-check{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ld-fontdlg-preview{
  border-top: 1px solid rgba(0,0,0,0.12);
  padding-top: 10px;
}
.ld-fontdlg-previewlabel{
  font-size: 12px;
  opacity: 0.8;
  margin-bottomm: 6px;
}
.ld-fontdlg-previewbox{
  min-height: 44px;
  padding: 10px;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 8px;
  background: rgba(255,255,255,0.7);
}

/* Enforced by update: menu background */
.menubar, .menu-bar, .menuBar, nav.menubar, nav.menu, .top-menu, .topmenu, .main-menu, .mainmenu {
  background-color: rgb(150,175,220) !important;
}


/* Orientation toggle */
.orientation-toggle{
  display:flex;
  align-items:center;
  gap:8px;
  font-size: 13px;
  color: var(--text);
  user-select:none;
  margin-right: 12px;
}
.orientation-toggle input{
  width: 16px;
  height: 16px;
}

/* Vertical workspace variant */
.workspace.vertical{
  background: #fff url('/images/VerticalCardPunch.png') center center / cover no-repeat;
}

/* Adjust boundary margins for vertical workspace: left, top, right, bottom */
.workspace.vertical .boundary{
  left: 10px;
  right: 10px;
  bottom: 10px;
}



/* Textbox overflow bounding fix
   Ensures textbox border visually bounds its content by preventing content overflow
   and keeping inner editable content sized to the textbox box. */
.ld-textbox{
  box-sizing: border-box;
  overflow: hidden;          /* clip overflowing text to the textbox bounds */
}
.ld-textbox-content{
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  overflow: hidden;          /* avoid contenteditable painting outside */
  line-height: normal;       /* avoid excessive line-height pushing outside */
}


/* Textbox resize handles only + content flow */
.ld-textbox{ box-sizing: border-box; overflow: hidden; }
.ld-textbox-content{ box-sizing: border-box; width:100%; height:100%; overflow:hidden; white-space: pre-wrap; word-break: break-word; }


/* ----- Modal dialog (About) ----- */
.ld-modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.ld-modal-overlay.open{ display: flex; }

/* Ensure dialog-panel .ld-modal inside the overlay system is visible even though
   .ld-modal is also used elsewhere as a full-screen overlay container. */
.ld-modal-overlay.open > .ld-modal{
  display: block !important;
}

.ld-modal{
  background: #fff;
  border-radius: 8px;
  width: min(600px, 95vw);
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  border: 1px solid #333;
  z-index: 10000;
}

.ld-modal-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #ccc;
}
.ld-modal-title{ font-size: 18px; font-weight: 700; }

.ld-modal-close{
  border: 1px solid var(--border);
  background: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  line-height: 28px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.ld-modal-close:hover{ background:#fafafa; }

.ld-modal-body{
  padding: 14px;
  overflow: auto;
}

.ld-modal-footer{
  padding: 12px 14px;
  border-top: 1px solid #ccc;
  display:flex;
  gap: 10px;
  justify-content: flex-end;
}

.ld-btn{
  border: 1px solid var(--border);
  background: #e5e7eb;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 14px;
}
.ld-btn:hover{ background:#dfe3ea; }

.ld-btn-secondary{
  background: #fff;
  border: 1px solid var(--border);
}
.ld-btn-secondary:hover{ background:#fafafa; }

.ld-modal-footer-split{
  display:flex;
  align-items:center;
  gap: 10px;
}
.ld-spacer{ flex: 1 1 auto; }

/* Simple form styling for login/member modals */
.ld-form{ display:flex; flex-direction:column; gap: 10px; }
.ld-field{ display:flex; flex-direction:column; gap: 6px; }
.ld-label{ font-size: 13px; font-weight: 600; }
.ld-input, .ld-textarea{
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}
.ld-textarea{ resize: vertical; }
.ld-hint{ font-size: 13px; color: #374151; min-height: 18px; }

.ld-about-grid{
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  align-items: start;
}
.ld-about-image img{
  height: 220px;
  border: 1px solid #bbb;
  border-radius: 6px;
  display: block;
}
.ld-about-app{ font-size: 20px; font-weight: 700; margin-bottomm: 6px; }
.ld-about-line{ margin: 4px 0; }
.ld-about-muted{ color: #555; margin-top: 10px; }

@media (max-width: 400px){
  .ld-about-grid{ grid-template-columns: 1fr; }
  .ld-about-image{ max-width: 260px; }
}



/* ----- About Modal visibility overrides (ensure dialog shows above overlay) ----- */
#aboutModalOverlay.open { display: flex !important; }
#aboutModalOverlay.open .ld-modal { 
  display: block !important;
  position: relative;
  z-index: 10001;
}
#aboutModalOverlay { z-index: 10000 !important; }
/* Home page */
.home{
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 var(--gutter);
}
.home-hero{
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottomm: 18px;
}
.welcome-photo{
  height: 300px;
  border-radius: 12px;
  border: none;
}
.home-hero-text h1{
  margin-top: 0;
}
.home-cards{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.home-card{
  border: none;
  background: #fff;
  padding: 14px;
}


/* Footer */
.app-footer{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32px;
  background: #f1f3f6;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  z-index: 1000;
}
.app-main{
  padding-bottom: 40px; /* prevent overlap with footer */
}

.tagline {
    font-size: 1.2rem;
    line-height: 1.4;
    margin-top: 6px;
}
.noneed {
    font-size: 1.2rem;
    line-height: 1.4;
}

/* Right-side auth controls in menu bar */
.menubar{
  align-items: center;
  justify-content: space-between;
}
.menu-left{
  display:flex;
  gap: 10px;
  align-items: center;
}
.menu-right{
  display:flex;
  align-items:center;
  gap: 8px;
  margin-right: 10px;
}

.auth-icon-btn{
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.auth-icon-btn:hover{ background:#fafafa; }
.auth-icon-btn:disabled{
  opacity: 0.55;
  cursor: not-allowed;
}
.auth-icon{ fill: currentColor; }

/* Simple form styling for login/member modals */
.ld-form{ display:flex; flex-direction:column; gap: 10px; }
.ld-field{ display:flex; flex-direction:column; gap: 6px; }
.ld-label{ font-size: 13px; font-weight: 600; }
.ld-input, .ld-textarea{
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}
.ld-textarea{ resize: vertical; }
.ld-hint{ font-size: 13px; color: #374151; min-height: 18px; }

.ld-btn-secondary{
  background: #fff;
  border: 1px solid var(--border);
}
.ld-btn-secondary:hover{ background:#fafafa; }

.ld-modal-footer-split{
  display:flex;
  align-items:center;
  gap: 10px;
}
.ld-spacer{ flex: 1 1 auto; }

/* Ensure modal dialog box is visible inside overlay (overrides any legacy modal rules) */
.ld-modal-overlay .ld-modal{
  display: block;
  position: relative;
  inset: auto;
}

/* ------------------------------------------------------------
   Design page modals (Image source, Images folder, etc.)
   These use .ld-modal as the *overlay container*.
   We must force overlay semantics here because .ld-modal is also
   used as the dialog class within .ld-modal-overlay.
------------------------------------------------------------ */
#shapePickerModal.ld-modal,
#colorPickerModal.ld-modal,
#fontModal.ld-modal,
#imageSourceModal.ld-modal,
#imagesFolderModal.ld-modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 10000;
  background: transparent; /* overlay itself is transparent; backdrop handles dimming */
  border: 0;
  box-shadow: none;
  width: auto;
  max-height: none;
  overflow: visible;
}

#shapePickerModal.ld-modal[aria-hidden="false"],
#colorPickerModal.ld-modal[aria-hidden="false"],
#fontModal.ld-modal[aria-hidden="false"],
#imageSourceModal.ld-modal[aria-hidden="false"],
#imagesFolderModal.ld-modal[aria-hidden="false"]{
  display: block;
}


/* ============================================================
   FIX: Ensure overlay-based modals (Login/About/Member) render
   even though .ld-modal is also used by the fullscreen modal system.
   This rule is intentionally placed at the end of the file and uses
   higher specificity to win the cascade.
   ============================================================ */
.ld-modal-overlay.open > .ld-modal{
  display: block !important;
  position: relative !important;
  inset: auto !important;
  background: #fff;
  border-radius: 8px;
  width: min(600px, 95vw);
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}


/* Login password toggle */
.ld-password-wrap{
  position: relative;
  display: flex;
  align-items: center;
}
.ld-password-wrap input{
  width: 100%;
  padding-right: 42px;
}
.ld-password-toggle{
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  width: 30px;
  height: 30px;
  padding: 0;
}
/* simple eye icon using CSS */
.ld-eye{
  display: inline-block;
  width: 18px;
  height: 18px;
  position: relative;
}
.ld-eye::before{
  content: "";
  position: absolute;
  inset: 2px 0 2px 0;
  border: 2px solid #555;
  border-radius: 12px / 8px;
}
.ld-eye::after{
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border: 2px solid #555;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.ld-eye.slash{
  transform: rotate(-20deg);
}
.ld-eye.slash::before{}
.ld-eye.slash::after{}
.ld-eye.slash{
  background: linear-gradient(45deg, transparent 45%, #555 45%, #555 55%, transparent 55%);
}


/* Login input sizing */
.ld-login-input{
  width: 260px;
  max-width: 260px;
}
