.tools-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  min-height: calc(100vh - 80px);
}

.tools-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--panel-dark);
  padding: 1.5rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.02);
  align-self: start;
  position: sticky;
  top: 90px;
}

.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0 0.75rem;
  margin-bottom: 0.25rem;
}

.sidebar-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  width: 100%;
}

.sidebar-btn:hover { color: var(--text-main); background: rgba(255,255,255,0.02); }

.sidebar-btn.active {
  background: rgba(59,247,255,0.06);
  color: var(--accent-cyan);
}

.tool-stage { flex: 1; min-width: 0; }

.tool-panel {
  background: var(--panel-dark);
  border: 1px solid rgba(255,255,255,0.02);
  padding: 2rem;
  border-radius: 12px;
  display: none;
}

.tool-panel.active { display: block; }

.tool-panel h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.tool-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
  background: #030305;
  border: 1px solid rgba(255,255,255,0.06);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.92rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: rgba(59,247,255,0.3);
}

.form-group textarea { resize: vertical; }

.result-box {
  background: #030305;
  border: 1px solid rgba(255,255,255,0.04);
  padding: 1rem 1.2rem;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.result-box code {
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 0.95rem;
  word-break: break-all;
}

.copy-btn {
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--text-main);
  padding: 0.4rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.83rem;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
  transition: background 0.15s;
}

.copy-btn:hover { background: rgba(255,255,255,0.1); }

.ht-results { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }

.ht-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #030305;
  border: 1px solid rgba(255,255,255,0.03);
  padding: 0.7rem 1rem;
  border-radius: 6px;
}

.ht-code {
  color: var(--accent-cyan);
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 160px;
  cursor: pointer;
  flex-shrink: 0;
}

.ht-preview { color: var(--text-muted); font-size: 0.88rem; flex: 1; }

.ht-label {
  color: #555;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  min-width: 110px;
  text-align: right;
  flex-shrink: 0;
}

.color-picker-layout {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.color-wheel-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.color-preview-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  background: #5865F2;
}

.color-wheel-wrap {
  position: relative;
  width: 220px;
  height: 220px;
}

.color-wheel-wrap canvas {
  display: block;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  cursor: crosshair;
}

.color-wheel-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  pointer-events: none;
  /* JS sets left/top to the canvas coordinate; translate centres the dot
     on that point without any manual offset maths. */
  transform: translate(-50%, -50%);
  top: 0;
  left: 0;
}

.color-values-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 220px;
  padding-top: 1.5rem;
}

.color-val-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
}

.color-val-label { color: var(--text-muted); font-weight: 600; min-width: 55px; }
.color-val-text { color: var(--text-main); font-family: monospace; flex: 1; }

.color-hex-input {
  background: #030305;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  color: var(--accent-cyan);
  font-family: monospace;
  font-size: 0.9rem;
  width: 100px;
  outline: none;
  cursor: pointer;
}

/* ── Colour-picker layout classes used by the HTML ── */

.color-picker-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.color-picker-right {
  flex: 1;
  min-width: 240px;
}

.color-preview-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 220px;
}

.color-swatch {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  border: 3px solid rgba(255,255,255,0.15);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  flex-shrink: 0;
  transition: background 0.08s;
}

/* Output rows (HEX / RGB / HSL / INT) */
.color-outputs {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.color-output-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
}

.color-output-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 38px;
  flex-shrink: 0;
}

.color-output-value {
  color: var(--text-main);
  font-family: monospace;
  font-size: 0.875rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Manual-input section */
.manual-input-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.manual-type-btns {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.emoji-search-row {
  position: relative;
  margin-bottom: 1rem;
}

.emoji-search-row::before {
  content: '';
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8d93' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  transition: background-image 0.2s;
}

.emoji-search-row:focus-within::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233bf7ff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
}

#emojiSearch {
  width: 100%;
  box-sizing: border-box;
  background: #030305;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 0.7rem 1rem 0.7rem 2.4rem;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#emojiSearch::placeholder { color: var(--text-muted); }

#emojiSearch:focus {
  border-color: rgba(59,247,255,0.35);
  box-shadow: 0 0 0 3px rgba(59,247,255,0.06);
}

.emoji-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.emoji-cat-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}

.emoji-cat-btn:hover { color: var(--text-main); border-color: rgba(255,255,255,0.15); }

.emoji-cat-btn.active {
  background: rgba(59,247,255,0.08);
  color: var(--accent-cyan);
  border-color: rgba(59,247,255,0.25);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 0.35rem;
  max-height: 360px;
  overflow-y: auto;
}

.emoji-btn {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.03);
  color: #fff;
  padding: 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  text-align: center;
  transition: background 0.15s;
}

.emoji-btn:hover { background: rgba(255,255,255,0.07); }

.emoji-more-msg {
  margin-top: 0.6rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.perms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.perm-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.87rem;
  padding: 0.3rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s;
}

.perm-label:hover { color: var(--text-main); }
.perm-label input[type=checkbox] { accent-color: var(--accent-cyan); cursor: pointer; }

.embed-builder-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.embed-controls { display: flex; flex-direction: column; gap: 1rem; }

.embed-tab-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}

.embed-tab-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}

.embed-tab-btn.active {
  background: rgba(59,247,255,0.08);
  color: var(--accent-cyan);
  border-color: rgba(59,247,255,0.25);
}

.embed-tab-btn:hover:not(.active) { color: var(--text-main); border-color: rgba(255,255,255,0.15); }

.embed-add-btn {
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.15);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}

.embed-add-btn:hover { border-color: rgba(59,247,255,0.35); color: var(--accent-cyan); }

.embed-remove-btn {
  background: transparent;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
}

.embed-remove-btn:hover { background: rgba(255,107,107,0.1); }

.embed-fields-list { display: flex; flex-direction: column; gap: 0.5rem; }

.embed-field-row {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 0.75rem;
}

.embed-field-row .field-row-top {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 0.5rem;
  align-items: start;
  margin-bottom: 0.5rem;
}

.small-btn {
  background: rgba(255,255,255,0.05);
  border: none;
  color: var(--text-muted);
  border-radius: 4px;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  height: fit-content;
  margin-top: auto;
}

.small-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-main); }
.small-btn.danger:hover { background: rgba(255,107,107,0.15); color: #ff8080; }

.discord-preview {
  background: #36393f;
  border-radius: 8px;
  padding: 1.25rem;
}

.discord-msg-area { margin-bottom: 0.75rem; }

.discord-bot-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.discord-bot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.discord-bot-meta { flex: 1; }

.discord-bot-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.discord-bot-tag {
  background: #5865F2;
  font-size: 0.6rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.discord-msg-content {
  color: #dcddde;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.discord-embeds { display: flex; flex-direction: column; gap: 0.5rem; }

.discord-embed {
  border-left: 4px solid #5865F2;
  background: #2f3136;
  border-radius: 0 4px 4px 0;
  padding: 0.75rem 1rem;
}

.discord-embed-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.discord-embed-desc {
  font-size: 0.88rem;
  color: #dcddde;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 0.25rem;
}

.discord-embed-field-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.15rem;
}

.discord-embed-field-value { font-size: 0.82rem; color: #dcddde; }

.discord-embed-image {
  margin-top: 0.75rem;
  max-width: 100%;
  border-radius: 4px;
}

.discord-embed-footer {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: #72767d;
}

.discord-embed-timestamp {
  font-size: 0.75rem;
  color: #72767d;
  margin-top: 0.2rem;
}

.embed-json-box {
  margin-top: 1rem;
  position: relative;
}

.embed-json-area {
  background: #030305;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 1rem;
  color: var(--accent-cyan);
  font-family: monospace;
  font-size: 0.82rem;
  width: 100%;
  height: 160px;
  resize: vertical;
  outline: none;
  line-height: 1.5;
}

.font-gen-layout { display: flex; flex-direction: column; gap: 1.25rem; }

.font-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.font-tab-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}

.font-tab-btn:hover { color: var(--text-main); border-color: rgba(255,255,255,0.15); }

.font-tab-btn.active {
  background: rgba(59,247,255,0.08);
  color: var(--accent-cyan);
  border-color: rgba(59,247,255,0.25);
}

.font-result {
  background: #030305;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: 1.5rem;
  min-height: 3rem;
  word-break: break-all;
  cursor: pointer;
  color: var(--text-main);
  transition: border-color 0.15s;
  letter-spacing: 0.05em;
}

.font-result:hover { border-color: rgba(59,247,255,0.2); }

.font-char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 0.35rem;
  max-width: 100%;
}

.font-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.5rem;
}

.font-hint {
  font-size: 0.65rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.7;
}

@media (max-width: 1050px) {
  .embed-builder-layout { grid-template-columns: 1fr; }
  .eb-preview-sticky { position: static; }
}

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

@media (max-width: 640px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .perms-grid { grid-template-columns: 1fr 1fr; }
  .eb-field-inputs { grid-template-columns: 1fr; }
  .eb-field-opts { flex-direction: row; align-items: center; }
}

.eb-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.eb-muted {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

.eb-controls-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.eb-preview-col {
  min-width: 0;
}

.eb-preview-sticky {
  position: sticky;
  top: 90px;
}

.eb-section {
  border-top: 1px solid rgba(255,255,255,0.04);
  padding-top: 1rem;
  margin-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.eb-section .form-group:last-child,
.eb-section .form-row:last-child {
  margin-bottom: 0;
}

.eb-section .form-row .form-group {
  margin-bottom: 0;
}

.eb-section-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

.eb-color-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.eb-color-input {
  width: 44px;
  height: 38px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: #030305;
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
}

.eb-color-presets {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.color-preset {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  padding: 0;
  flex-shrink: 0;
}

.color-preset:hover {
  transform: scale(1.2);
  border-color: rgba(255,255,255,0.4);
}

.eb-fields-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.eb-field-row {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 0.75rem;
}

.eb-field-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  align-items: end;
}

.eb-field-opts {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
  padding-bottom: 0.3rem;
}

.eb-ar-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.eb-ar-item {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 0.75rem;
}

.eb-ar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.eb-ar-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 1;
}

.eb-ar-btns {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.eb-ar-btn-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 0.6rem;
}

.eb-ar-btn-types {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.eb-type-active {
  background: rgba(59,247,255,0.1);
  color: var(--accent-cyan);
}

.eb-danger-zone {
  display: flex;
  justify-content: flex-end;
  border-color: rgba(255,107,107,0.12);
}

.eb-remove-embed-btn {
  background: transparent;
  border: 1px solid rgba(255,107,107,0.35);
  color: #ff6b6b;
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}

.eb-remove-embed-btn:hover {
  background: rgba(255,107,107,0.12);
  border-color: rgba(255,107,107,0.6);
}

.eb-copy-btn {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.55rem;
  font-size: 0.9rem;
  text-align: center;
}

.discord-embed-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.discord-embed-field {
  flex: 0 0 100%;
}

.discord-embed-field.inline {
  flex: 1 1 calc(33.33% - 0.4rem);
  min-width: 80px;
}

.de-body {
  display: flex;
  gap: 0.75rem;
}

.de-content {
  flex: 1;
  min-width: 0;
}

.de-thumb-wrap {
  flex-shrink: 0;
}

.de-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.de-author {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.de-author-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.de-author-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

a.de-author-name:hover { text-decoration: underline; }

.de-footer-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.discord-embed-title a {
  color: #00aff4;
  text-decoration: none;
}

.discord-embed-title a:hover { text-decoration: underline; }

/* discord-embed-desc defined above */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.confirm-box {
  background: var(--panel-light);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 1.5rem 2rem;
  max-width: 380px;
  width: 90%;
}

.confirm-msg {
  color: var(--text-main);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.confirm-btn {
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--text-main);
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s;
}

.confirm-btn:hover { background: rgba(255,255,255,0.1); }

.confirm-ok {
  background: rgba(255,107,107,0.18);
  color: #ff8080;
}

.confirm-ok:hover { background: rgba(255,107,107,0.28); }

@media (max-width: 900px) {
  .eb-field-inputs { grid-template-columns: 1fr 1fr; }
  .eb-field-opts { flex-direction: row; align-items: center; grid-column: 1 / -1; }
}

.eb-no-embeds {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.7;
  border-top: 1px solid rgba(255,255,255,0.04);
  margin-top: 0.5rem;
}

.eb-no-embeds strong {
  color: var(--text-main);
}

.eb-preview-placeholder {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 1.25rem 0 0.25rem;
  line-height: 1.5;
}

/* ── Discord markdown preview elements ─────────────────── */
.de-code { background: rgba(0,0,0,0.3); border-radius: 3px; padding: 0.1em 0.3em; font-family: monospace; font-size: 0.85em; color: #e3e5e8; }
.de-code-block { background: rgba(0,0,0,0.35); border-radius: 4px; padding: 0.5rem 0.75rem; font-family: monospace; font-size: 0.82em; color: #e3e5e8; white-space: pre-wrap; margin: 0.25rem 0; }
.de-blockquote { border-left: 4px solid #4f545c; padding-left: 0.6rem; margin: 0.2rem 0; color: #dcddde; }
.de-spoiler { background: #202225; color: transparent; border-radius: 3px; cursor: pointer; }
.de-spoiler:hover { color: #dcddde; background: #40444b; }
.de-h1 { font-size: 1.2rem; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.15rem; margin: 0.2rem 0 0.1rem; line-height: 1.3; }
.de-h2 { font-size: 1rem; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 0.1rem; margin: 0.15rem 0 0.05rem; }
.de-h3 { font-size: 0.9rem; font-weight: 700; color: #fff; margin: 0.1rem 0; }
.de-subtext { font-size: 0.72rem; color: #72767d; display: block; }
.discord-msg-content code { background: rgba(0,0,0,0.3); border-radius: 3px; padding: 0.1em 0.3em; font-family: monospace; }
/* Hyperlinks inside the discord preview */
.de-link { color: #00aff4; text-decoration: none; }
.de-link:hover { text-decoration: underline; }

/* ── Webhook send section ───────────────────────────────── */
.eb-webhook-section {
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
}

.eb-webhook-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-top: 0.5rem;
}

.eb-webhook-row input {
  flex: 1;
  min-width: 0;
  background: #030305;
  border: 1px solid rgba(255,255,255,0.06);
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.eb-webhook-row input:focus { border-color: rgba(59,247,255,0.3); }

.eb-webhook-send-btn {
  flex-shrink: 0;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  white-space: nowrap;
}

/* ── Collapsible section headers ────────────────────────── */
details.eb-section { border-top: 1px solid rgba(255,255,255,0.04); padding-top: 0; margin-top: 0.25rem; }
details.eb-section > summary.eb-section-label {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
  padding: 0.65rem 0 0.55rem;
  color: var(--text-main);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 4px;
  transition: color 0.15s;
  margin-bottom: 0;
}
details.eb-section > summary.eb-section-label::-webkit-details-marker { display: none; }
details.eb-section > summary.eb-section-label::before {
  content: '▾';
  font-size: 0.85rem;
  line-height: 1;
  transition: transform 0.2s;
  color: var(--accent-cyan);
  display: inline-block;
}
details.eb-section:not([open]) > summary.eb-section-label::before { transform: rotate(-90deg); }
details.eb-section > summary.eb-section-label:hover { color: var(--text-main); }
details.eb-section > *:not(summary) { padding-bottom: 0.75rem; }
details.eb-section > .form-group:last-child,
details.eb-section > .form-row:last-child { padding-bottom: 0.25rem; }

/* ── Fields layout fix ──────────────────────────────────── */
.eb-field-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.eb-field-opts {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  padding-bottom: 0;
}
@media (max-width: 900px) {
  .eb-field-inputs { grid-template-columns: 1fr 1fr; }
  .eb-field-opts { flex-direction: row; align-items: center; grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 640px) {
  .eb-field-inputs { grid-template-columns: 1fr; }
}

/* ── Embed builder: preview action-row buttons ─────────────────────────── */
.discord-components {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.preview-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.preview-btn {
  font-size: 0.875rem;         /* 14 px — Discord's exact button label size */
  font-weight: 500;
  padding: 2px 16px;
  min-height: 32px;            /* Discord buttons are always 32 px tall */
  border-radius: 3px;          /* Discord uses 3 px, not 4 px */
  border: none;
  cursor: default;
  font-family: 'gg sans', 'Noto Sans', 'Inter', sans-serif;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  white-space: nowrap;
  line-height: 1;
  transition: background-color 0.17s ease, filter 0.17s ease;
}

.preview-btn-primary {
  background: #5865F2;         /* Discord blurple */
  color: #fff;
}

.preview-btn-primary:hover {
  background: #4752C4;         /* Discord blurple — hover state */
}

.preview-btn-link {
  background: #4e5058;         /* Discord secondary/link button colour */
  color: #fff;
  cursor: pointer;
}

.preview-btn-link:hover {
  background: #6d6f78;
}

.preview-btn-ext {
  font-size: 0.75rem;          /* slightly larger — more visible, like Discord */
  line-height: 1;
}

/* ── Permission calc: category grouping ─────────────────────────────────── */
.perms-category {
  margin-bottom: 1.5rem;
}

.perms-cat-label {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
