/* =========================================================================
   embed-builder.css — embed-builder.html only
   ========================================================================= */

.eb-layout{
  display:grid; grid-template-columns:minmax(0, 1.15fr) minmax(0, .85fr); gap:48px; align-items:start;
  min-width:0;
}

/* Prevent long, unbroken user text from expanding the preview grid track. */
.eb-layout > *{ min-width:0; }

@media (max-width:900px){ .eb-layout{ grid-template-columns:1fr; } }

.eb-form{ display:flex; flex-direction:column; gap:22px; }
.eb-field{ display:flex; flex-direction:column; gap:8px; }
.eb-field label{
  font-size:12px; letter-spacing:.1em; text-transform:uppercase; color:var(--dim);
}
.eb-row{ display:flex; gap:10px; }
.eb-row .eb-input{ flex:1; min-width:0; }

.eb-input{
  width:100%;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:10px;
  padding:12px 14px;
  color:var(--ink);
  font-family:'Inter', sans-serif;
  font-size:13.5px;
  transition:border-color .3s ease;
}
select.eb-input{
  -webkit-appearance:none;
  -moz-appearance:none;
  appearance:none;
  background:var(--panel);
  color:var(--ink);
}
select{
  background:var(--panel);
  color:var(--ink);
}
.eb-input::placeholder{ color:#5a564f; }
.eb-input:focus{ outline:none; border-color:#5a5650; }
.eb-textarea{ resize:vertical; min-height:76px; line-height:1.55; font-family:'Inter', sans-serif; }

.eb-color-row{ align-items:center; }
.eb-color-picker{
  width:44px; height:44px; flex-shrink:0;
  background:var(--panel); border:1px solid var(--line); border-radius:10px;
  padding:4px; cursor:pointer;
}

.eb-chips{ display:flex; flex-wrap:wrap; gap:6px; }
.eb-chip{
  font-family:'Fraunces', serif; font-style:italic;
  font-size:11.5px; color:var(--dim);
  background:transparent; border:1px solid var(--line); border-radius:100px;
  padding:5px 11px; cursor:pointer;
  transition:border-color .25s ease, color .25s ease;
}
.eb-chip:hover{ border-color:#5a5650; color:var(--ink); }

.eb-button-row{ display:flex; gap:8px; margin-bottom:8px; }
.eb-button-row .eb-input{ flex:1; }
.eb-cb-btn-row{ display:flex; gap:8px; margin-bottom:8px; align-items:center; }
.eb-cb-btn-row .eb-input{ flex:1; }
.eb-cb-btn-remove{
  flex:0 0 auto; width:30px; height:30px;
  border:1px solid var(--line); background:transparent;
  color:var(--dim); border-radius:6px; cursor:pointer;
  font-size:0.9rem; line-height:1;
}
.eb-cb-btn-remove:hover{ color:var(--ink); border-color:var(--ink); }
.eb-btn-remove{
  align-self:flex-start;
  background:none; border:none; cursor:pointer;
  font-size:13px; color:var(--body); letter-spacing:.02em;
  padding-bottom:2px; border-bottom:1px solid var(--line);
  transition:border-color .3s ease, color .3s ease;
}
.eb-add-btn:hover{ border-color:var(--ink); color:var(--ink); }

.eb-preview-col{
  position:sticky; top:110px; display:flex; flex-direction:column; gap:10px;
  min-width:0; width:100%;
}
.eb-preview-label, .eb-output-label{
  font-size:12px; letter-spacing:.2em; text-transform:uppercase; color:var(--dim);
}
.eb-output-label{ margin-top:14px; }

.eb-discord-preview{
  background:#1e1f22;
  border:1px solid var(--line);
  border-radius:12px;
  padding:16px;
  font-family:'gg sans', 'Inter', sans-serif;
  min-width:0;
  max-width:100%;
  overflow:hidden;
  box-sizing:border-box;
}
.eb-msg{ color:#dbdee1; font-size:13.5px; margin-bottom:8px; word-break:break-word; overflow-wrap:anywhere; min-width:0; }
.eb-embed{
  display:flex; gap:14px;
  background:#2b2d31;
  border-left:4px solid #3a3733;
  border-radius:4px;
  padding:12px 14px;
}
.eb-embed-body{ flex:1; min-width:0; }
.eb-embed-author{ display:flex; align-items:center; gap:8px; font-size:13px; color:#dbdee1; font-weight:600; margin-bottom:6px; }
.eb-embed-author-icon{ width:20px; height:20px; border-radius:50%; object-fit:cover; }
.eb-embed-title{ font-size:15px; font-weight:600; color:#dbdee1; margin-bottom:6px; overflow-wrap:anywhere; word-break:break-word; }
.eb-embed-desc{ font-size:13px; color:#dbdee1; line-height:1.5; word-break:break-word; overflow-wrap:anywhere; }
.eb-embed-footer{ font-size:11.5px; color:#949ba4; margin-top:10px; overflow-wrap:anywhere; word-break:break-word; }
.eb-embed-thumb{ width:64px; height:64px; border-radius:6px; object-fit:cover; flex-shrink:0; }
.eb-buttons-row{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.eb-embed-btn{
  display:inline-flex; align-items:center; gap:6px;
  background:#2b2d31; border:1px solid #414248; border-radius:8px;
  padding:7px 12px; font-size:13px; color:#dbdee1;
}

.eb-mode-toggle{
  display:inline-flex; align-items:center; gap:2px;
  border:1px solid var(--line); border-radius:100px;
  padding:4px; margin-bottom:4px; align-self:flex-start;
}
.eb-mode-btn{
  background:none; border:none; cursor:pointer;
  font-family:'Inter', sans-serif; font-size:13px; color:var(--dim);
  letter-spacing:.02em;
  padding:9px 20px; border-radius:100px;
  transition:background .3s ease, color .3s ease;
}
.eb-mode-btn:hover{ color:var(--ink); }
.eb-mode-btn.active{ background:var(--ink); color:#0a0a0b; font-weight:500; }
.eb-mode-sep{ color:var(--line); font-size:13px; user-select:none; }

.eb-select-wrap{
  position:relative;
  z-index:5;
  width:min(100%, 360px);
  margin-bottom:4px;
}
.eb-select-trigger{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  width:100%;
  min-height:54px;
  padding:10px 16px;
  border:1px solid var(--line);
  border-radius:14px;
  background:linear-gradient(135deg, rgba(var(--accent-rgb),.13), var(--panel) 70%);
  color:var(--ink);
  text-align:left;
  cursor:pointer;
  transition:border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.eb-select-trigger:hover,
.eb-select-wrap.is-open .eb-select-trigger{
  border-color:var(--red);
  box-shadow:0 0 0 3px rgba(var(--accent-rgb),.1);
}
.eb-select-trigger:active{ transform:scale(.99); }
.eb-select-trigger-copy{ display:flex; flex-direction:column; gap:3px; }
.eb-select-eyebrow{
  color:var(--dim);
  font-size:9px;
  letter-spacing:.17em;
  line-height:1;
  text-transform:uppercase;
}
.eb-select-trigger #eb-mode-current,
.eb-action-select .eb-select-current{
  color:var(--ink);
  font-family:'Fraunces',serif;
  font-size:17px;
}
.eb-select-chevron{
  width:18px;
  height:18px;
  flex:0 0 auto;
  color:var(--red);
  transition:transform .22s ease;
}
.eb-select-wrap.is-open .eb-select-chevron{ transform:rotate(180deg); }
.eb-select-menu{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  z-index:30;
  display:grid;
  gap:4px;
  width:100%;
  max-height:min(360px, 65vh);
  padding:6px;
  overflow-y:auto;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--panel);
  box-shadow:0 18px 50px rgba(0,0,0,.45);
  opacity:0;
  visibility:hidden;
  transform:translateY(-7px) scale(.985);
  transform-origin:top center;
  transition:opacity .18s ease, transform .18s ease, visibility .18s;
}
.eb-select-wrap.is-open .eb-select-menu{
  opacity:1;
  visibility:visible;
  transform:translateY(0) scale(1);
}
.eb-select-option{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  width:100%;
  min-height:42px;
  padding:9px 11px;
  border:1px solid transparent;
  border-radius:9px;
  background:transparent;
  color:var(--body);
  font-family:'Inter',sans-serif;
  font-size:12px;
  text-align:left;
  cursor:pointer;
  transition:background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.eb-select-option > span{ display:flex; align-items:center; gap:8px; }
.eb-select-option small{ color:var(--dim); font-size:10px; text-align:right; }
.eb-select-option:hover,
.eb-select-option:focus-visible{
  border-color:rgba(var(--accent-rgb),.28);
  background:rgba(var(--accent-rgb),.11);
  color:var(--ink);
  transform:translateX(2px);
  outline:none;
}
.eb-select-option.active{
  border-color:rgba(var(--accent-rgb),.34);
  background:rgba(var(--accent-rgb),.15);
  color:var(--ink);
}
.eb-action-select{ max-width:360px; }
.eb-action-select .eb-select-trigger{ min-height:46px; }
.eb-action-select .eb-select-menu{ grid-template-columns:repeat(2,minmax(0,1fr)); }
.eb-action-select .eb-select-option{ min-height:38px; }

.eb-add-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  align-self:flex-start;
  gap:8px;
  min-height:38px;
  padding:8px 16px;
  border:1px solid rgba(var(--accent-rgb),.55);
  border-radius:999px;
  background:rgba(var(--accent-rgb),.13);
  color:var(--ink);
  font-family:'Inter',sans-serif;
  font-size:12px;
  font-weight:600;
  letter-spacing:.02em;
  cursor:pointer;
  transition:background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.eb-add-btn > span{ color:var(--red); font-size:16px; line-height:1; }
.eb-add-btn:hover{
  border-color:var(--red);
  background:rgba(var(--accent-rgb),.24);
  box-shadow:0 0 0 3px rgba(var(--accent-rgb),.09);
  transform:translateY(-1px);
}
.eb-add-btn:active{ transform:translateY(0) scale(.98); }
.eb-add-btn[disabled]{ opacity:.45; cursor:not-allowed; transform:none; }
.eb-button-help{ margin:0; color:var(--dim); font-size:11px; line-height:1.5; }

.eb-output-wrap{
  display:flex; gap:8px; align-items:flex-start;
}
.eb-output{
  flex:1; min-width:0;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:10px;
  padding:16px;
  font-family:monospace;
  font-size:12px;
  line-height:1.6;
  color:var(--body);
  white-space:pre-wrap;
  word-break:break-word;
  max-height:220px;
  overflow-y:auto;
}
.eb-output-actions{
  display:flex; flex-direction:column; gap:8px;
  padding-top:12px;
  flex:0 0 auto;
}
.eb-copy-btn, .eb-action-btn{
  position:static;
  background:var(--ink); color:#0a0a0b; font-weight:500;
  border:none; border-radius:100px;
  padding:6px 14px; font-size:12px; cursor:pointer;
  transition:opacity .3s ease, transform .3s ease;
}
.eb-copy-btn:hover, .eb-action-btn:hover{ opacity:.9; transform:translateY(-1px); }
.eb-action-btn{
  background:transparent; color:var(--ink);
  border:1px solid var(--line);
  font-weight:500;
}

@media (max-width:900px){
  .eb-preview-col{ position:static; top:auto; }
}

@media (max-width:640px){
  .eb-mode-toggle{
    max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none;
  }
  .eb-mode-toggle::-webkit-scrollbar{ display:none; }
  .eb-mode-btn{ padding:9px 14px; white-space:nowrap; }
}