/* Builder layout and Discord preview; site theme and navigation come from styles.css. */
.page-wrap{position:relative;z-index:1;width:min(1500px,100%);margin:0 auto;padding:92px 24px 60px}
.page-header{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:22px}
.page-header h1{font-family:"DM Sans",sans-serif;font-size:clamp(30px,5vw,54px);line-height:1.05;margin-bottom:8px;background:linear-gradient(135deg,#fff 30%,var(--accent));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.page-header p{max-width:680px;color:var(--muted);line-height:1.65}
.builder-layout{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(360px,.95fr);gap:22px;align-items:start}
.panel{background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:20px;backdrop-filter:blur(20px);box-shadow:0 24px 90px rgba(0,0,0,.24)}
.preview-panel{position:sticky;top:78px}
.panel-title{display:flex;align-items:center;gap:9px;margin-bottom:16px;color:var(--dim);font-family:"DM Sans",sans-serif;font-size:11px;font-weight:800;letter-spacing:.14em;text-transform:uppercase}.panel-title::after{content:"";height:1px;flex:1;background:var(--border)}
.tabs,.toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.tab-btn,.mini-btn,.icon-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid rgba(99,179,167,.22);background:rgba(99,179,167,.07);color:#bae6fd;border-radius:6px;min-height:38px;padding:8px 12px;font:inherit;font-size:13px;font-weight:700;cursor:pointer}
.tab-btn.active{background:linear-gradient(135deg,rgba(99,179,167,.28),rgba(129,140,248,.2));color:#fff;border-color:rgba(99,179,167,.46)}
.icon-btn{width:40px;padding:0}.danger{border-color:rgba(248,113,113,.28);background:rgba(248,113,113,.1);color:#fecaca}.success{border-color:rgba(52,211,153,.28);background:rgba(52,211,153,.1);color:#bbf7d0}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.wide{grid-column:1/-1}
.form-group{display:grid;gap:7px}.form-group label{color:#cbd5e1;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
input,textarea,select{width:100%;border:1px solid rgba(148,163,184,.18);border-radius:6px;background:rgba(2,6,23,.52);color:var(--text);font:inherit;font-size:14px;padding:12px 13px;outline:none}
textarea{min-height:92px;resize:vertical}input:focus,textarea:focus,select:focus{border-color:rgba(99,179,167,.55);box-shadow:0 0 0 3px rgba(99,179,167,.1)}
.hint{color:var(--dim);font-size:12px;line-height:1.5}.divider{display:flex;align-items:center;gap:9px;margin:20px 0 14px;color:#7dd3fc;font-size:12px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}.divider::after{content:"";height:1px;flex:1;background:rgba(255,255,255,.07)}
.color-row{display:grid;grid-template-columns:56px minmax(0,1fr);gap:10px}.color-row input[type=color]{height:45px;padding:4px;cursor:pointer}
.field-list{display:grid;gap:10px}.field-item{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:10px;align-items:end;padding:12px;border:1px solid rgba(99,179,167,.1);border-radius:8px;background:rgba(2,6,23,.28)}.field-inline{grid-column:1/-1;display:flex;align-items:center;gap:8px;color:var(--muted);font-size:13px}.field-inline input{width:auto}
.embed-tabs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}.embed-pill{display:inline-flex;align-items:center;gap:8px;min-height:36px;padding:7px 10px;border-radius:999px;border:1px solid rgba(99,179,167,.18);background:rgba(255,255,255,.035);color:#cbd5e1;cursor:pointer}.embed-pill.active{color:#fff;background:rgba(99,179,167,.14);border-color:rgba(99,179,167,.4)}
.json-editor{min-height:520px;font-family:"Courier New",monospace;font-size:13px;line-height:1.55;white-space:pre}
.send-btn{width:100%;min-height:48px;margin-top:18px;border:0;border-radius:6px;background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;font-family:"DM Sans",sans-serif;font-weight:800;letter-spacing:.05em;cursor:pointer}.send-btn:disabled{opacity:.55;cursor:not-allowed}
.discord-preview{background:#313338;border-radius:14px;padding:16px;color:#dbdee1}.discord-msg{display:flex;gap:14px;align-items:flex-start}.discord-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto;background:linear-gradient(135deg,#5865f2,#7289da);overflow:hidden}.discord-avatar img{width:100%;height:100%;object-fit:cover}.discord-right{min-width:0;flex:1}.discord-username{display:flex;align-items:center;gap:6px;margin-bottom:4px;color:#fff;font-weight:800}.bot-tag{padding:1px 5px;border-radius:4px;background:#5865f2;color:#fff;font-size:9px;font-weight:800;text-transform:uppercase}.discord-content{margin:0 0 8px;white-space:pre-wrap;word-break:break-word}.embed{max-width:560px;margin-top:8px;border-left:4px solid var(--accent);border-radius:6px;background:#2b2d31;overflow:hidden}.embed-inner{padding:12px 14px}.embed-top{display:flex;gap:12px;align-items:flex-start}.embed-left{min-width:0;flex:1}.embed-author,.embed-footer{display:flex;align-items:center;gap:6px;color:#dbdee1;font-size:12px;font-weight:700}.embed-author img,.embed-footer img{width:18px;height:18px;border-radius:50%;object-fit:cover}.embed-title{margin-top:6px;color:#fff;font-weight:800;word-break:break-word}.embed-title a{color:#00aff4;text-decoration:none}.embed-desc{margin-top:6px;color:#dbdee1;font-size:13px;line-height:1.5;white-space:pre-wrap;word-break:break-word}.embed-thumb{width:76px;height:76px;border-radius:6px;object-fit:cover;flex:0 0 auto}.embed-image{display:block;width:100%;max-height:320px;object-fit:cover}.embed-fields{display:grid;gap:8px;margin-top:10px}.embed-field-name{font-size:12px;color:#fff;font-weight:800}.embed-field-value{font-size:12px;white-space:pre-wrap;word-break:break-word}.embed-footer{margin-top:10px;color:#949ba4;font-weight:500}.empty-preview{padding:28px 0;color:#6b7280;text-align:center;font-size:13px}
.toast{position:fixed;left:50%;bottom:24px;z-index:9999;transform:translateX(-50%) translateY(16px);opacity:0;pointer-events:none;display:flex;align-items:center;gap:9px;padding:12px 18px;border-radius:6px;font-weight:800;transition:.2s}.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}.toast.ok{background:rgba(52,211,153,.14);border:1px solid rgba(52,211,153,.32);color:#bbf7d0}.toast.err{background:rgba(248,113,113,.14);border:1px solid rgba(248,113,113,.32);color:#fecaca}
.hidden{display:none!important}
@media(max-width:980px){.builder-layout{grid-template-columns:1fr}.preview-panel{position:static}.page-header{display:block}.form-grid{grid-template-columns:1fr}.field-item{grid-template-columns:1fr}.page-wrap{padding:96px 16px 48px}}
@media(max-width:620px){.tabs,.toolbar{display:grid;grid-template-columns:1fr 1fr}.tab-btn,.mini-btn{width:100%}.discord-preview{padding:12px}.embed-top{display:block}.embed-thumb{margin-top:10px}.page-header h1{font-size:34px}}

/* Match the shared public theme while retaining Discord's message rendering. */
.webhook-page { --dim: #98a3ad; }
.webhook-page .page-wrap { max-width: 1160px; padding: 64px 24px 72px; }
.webhook-page .page-header { align-items: center; margin-bottom: 32px; }
.webhook-page .page-header h1 { color: #f1f3f5; background: none; -webkit-text-fill-color: initial; font-size: clamp(32px, 5vw, 52px); letter-spacing: -.04em; margin: 12px 0; }
.builder-kicker { color: #8fc8c0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; border-left: 3px solid var(--accent); padding-left: 12px; }
.webhook-page .page-header p { max-width: 640px; }
.webhook-page .builder-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 24px; }
.webhook-page .panel { min-width: 0; background: #11171e; border-color: #28333d; box-shadow: none; backdrop-filter: none; padding: 24px; }
.webhook-page .panel-title { color: #8fc8c0; letter-spacing: .08em; }
.webhook-page .preview-panel { top: 92px; }
.webhook-page :is(input, textarea, select) { background: #0b1016; border-color: #34404b; }
.webhook-page :is(input, textarea, select):focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,179,167,.12); }
.webhook-page .form-group > span:first-child { font-size: 13px; font-weight: 600; color: #d8dfe4; }
.webhook-page :is(.tab-btn,.mini-btn,.icon-btn,.embed-pill) { background: #19212a; border-color: #34404b; color: #d8dfe4; border-radius: 6px; }
.webhook-page :is(.tab-btn,.mini-btn,.icon-btn,.embed-pill):hover { background: #222e38; border-color: #52616d; }
.webhook-page :is(.tab-btn.active,.embed-pill.active) { background: #203e3a; border-color: #63b3a7; color: #c6e8e2; }
.webhook-page .danger { color: #fecaca; background: #352126; border-color: #704049; }
.webhook-page .success { color: #bbf7d0; background: #1b332b; border-color: #365d4d; }
.webhook-page .divider { color: #8fc8c0; letter-spacing: .06em; }
.webhook-page .field-item { background: #151d25; border-color: #29343e; }
.webhook-page .send-btn { background: #4b9188; font-family: inherit; letter-spacing: 0; border-radius: 6px; }
.webhook-page .send-btn:hover:not(:disabled) { background: #3f7d75; }
.webhook-page .toast { max-width: calc(100vw - 32px); background: #19212a; }
.webhook-page .discord-preview { font-size: 14px; line-height: 1.45; }
@media(max-width:980px) {
  .webhook-page .builder-layout { grid-template-columns: minmax(0, 1fr); }
  .webhook-page .preview-panel { position: static; }
  .webhook-page .page-header .btn { margin-top: 18px; }
}
@media(max-width:620px) {
  .webhook-page .page-wrap { padding: 36px 16px 48px; }
  .webhook-page .panel { padding: 18px; }
  .webhook-page .toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Draft workspace and advanced composer. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.webhook-page .workspace-bar { margin-bottom: 24px; }
.workspace-heading { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.webhook-page .workspace-actions { margin-bottom: 0; }
.workspace-actions select { flex: 1; min-width: 160px; width: auto; }
.builder-details { border-top: 1px solid #29343e; margin-top: 20px; padding-top: 16px; }
.builder-details summary { cursor: pointer; color: #bdd8d2; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.builder-details .toolbar { margin-top: 14px; }
.builder-details .toolbar select { width: auto; min-width: 180px; }
.webhook-page .connection-fields { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid #29343e; }
.webhook-page .reveal-webhook { justify-self: start; min-height: 30px; padding: 3px 10px; font-size: 12px; }
.webhook-page .message-name { margin-bottom: 16px; }
.webhook-page :is(.mini-btn,.icon-btn,.tab-btn):disabled { opacity: .4; cursor: not-allowed; }
.webhook-page .embed-pill { max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.webhook-page .field-item { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.field-actions { display: flex; gap: 6px; }
.webhook-page .field-inline { display: flex; align-items: center; gap: 8px; }
.webhook-page .field-inline input { width: auto; flex-shrink: 0; }
.webhook-page .file-drop { display: grid; gap: 10px; padding: 18px; border: 1px dashed #4a6662; border-radius: 6px; color: #b3cec9; font-size: 13px; }
.webhook-page .file-drop.dragging { background: #203e3a; }
.webhook-page .file-drop input { padding: 8px; font-size: 12px; }
.attachment-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0; font-size: 13px; }
.attachment-row span { overflow-wrap: anywhere; min-width: 0; }
.attachment-row small { display: block; color: #98a3ad; }
.component-editor { padding: 14px; margin-top: 12px; border: 1px solid #34404b; border-radius: 6px; }
.validation { padding: 14px; margin-top: 20px; border: 1px solid #365d4d; border-radius: 6px; background: #172821; font-size: 12px; color: #a7d6c2; }
.validation.invalid { border-color: #755d3d; background: #2c251b; color: #e8c99c; }
.validation ul { padding-left: 18px; margin-top: 8px; }
.delivery-result { font-size: 13px; color: #d2dce2; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 12px; }
.webhook-page .delete-message { margin-top: 12px; width: 100%; }
.preview-note { margin-bottom: 12px; }
.preview-jump { display: none; }
#previewPanel { scroll-margin-top: 90px; }
#discordPreview.mobile-preview { max-width: 340px; margin-inline: auto; }
.discord-preview :is(.component-text,.embed-desc,.embed-field-value,.discord-content) { white-space: pre-wrap; overflow-wrap: anywhere; }
.discord-preview a { color: #72b6f5; text-decoration: none; }
.discord-preview a:hover { text-decoration: underline; }
.discord-preview code { background: #1e1f22; border-radius: 3px; padding: 2px 4px; font-family: monospace; }
.discord-preview pre { background: #1e1f22; padding: 10px; border-radius: 5px; overflow-x: auto; }
.discord-preview pre code { padding: 0; }
.discord-preview .spoiler { color: transparent; background: #1e1f22; border: 0; border-radius: 3px; font: inherit; cursor: pointer; }
.discord-preview .spoiler.revealed { color: inherit; background: #45474c; }
.discord-preview .custom-emoji { width: 22px; height: 22px; vertical-align: middle; }
.discord-preview .mention { background: #414675; color: #c9cdfb; border-radius: 3px; padding: 1px 3px; }
.md-heading { display: block; font-weight: 700; line-height: 1.3; margin: 5px 0; }.md-h1 { font-size: 24px; }.md-h2 { font-size: 20px; }.md-h3 { font-size: 17px; }
.md-quote { display: block; border-left: 3px solid #65666c; padding-left: 10px; }
.component-layout { margin: 8px 0; }.component-type-17 { padding: 14px; border: 1px solid #42454a; background: #2b2d31; border-radius: 8px; }.component-type-1 { display: flex; flex-wrap: wrap; gap: 8px; }.component-type-9 { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.preview-link-button { display: inline-flex; padding: 8px 12px; border-radius: 4px; background: #4e5058; margin: 4px 0; font-size: 13px; }
.discord-preview .preview-link-button a { color: #fff; }
.component-divider { border: 0; border-top: 1px solid #505258; margin: 16px 0; }
.component-gallery { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); }.component-gallery img { width: 100%; border-radius: 6px; }
.attachment-chip { border: 1px solid #45474d; border-radius: 6px; padding: 10px; margin-top: 10px; font-size: 12px; overflow-wrap: anywhere; }.attachment-chip img { display: block; max-width: 100%; max-height: 220px; margin-bottom: 8px; }
.webhook-page dialog { margin: auto; width: min(480px,calc(100vw - 32px)); border: 1px solid #43534f; border-radius: 10px; background: #11171e; color: #e8ecef; padding: 24px; }
.webhook-page dialog::backdrop { background: rgba(0,0,0,.7); }.webhook-page dialog h2 { font-size: 22px; }.webhook-page dialog p { margin: 14px 0 22px; }.webhook-page dialog .toolbar { margin: 0; justify-content: end; }
@media(max-width:980px) { .preview-jump { display: inline-flex; } }
@media(max-width:620px) { .workspace-actions select { grid-column: 1/-1; width: 100%; }.webhook-page .field-item { grid-template-columns: minmax(0,1fr); }.webhook-page .builder-details .toolbar { display: flex; }.webhook-page .builder-details .toolbar > * { flex: 1; }.webhook-page .preview-panel { padding: 14px; } }

.webhook-page .format-toolbar { display: flex; flex-wrap: wrap; gap: 5px; }
.webhook-page .format-toolbar .mini-btn { min-height: 28px; padding: 3px 7px; font-size: 11px; width: auto; }
.webhook-page .embed-details { margin: 0; padding: 12px 0 0; }
.webhook-page .embed-details summary { margin-bottom: 12px; }
.webhook-page .input-counter { text-align: right; font-size: 11px; }
.webhook-page #previewPanel { max-height: calc(100dvh - 116px); overflow: auto; }
@media(max-width:980px) { .webhook-page #previewPanel { max-height: none; overflow: visible; } }

.webhook-page [hidden] { display: none !important; }
