/* JoyJoy V511 — Shieldy welcome tabs, custom-message theme and unified selects.
   Local visual patch only: does not change API, saving, Manager contracts or bot logic. */

/* The section contains exactly two tools. The previous three-column grid left
   an empty third cell and made the buttons look misaligned. */
body[data-account-page="bots"] [data-module-panel="sh-welcome"] .shieldy-interaction-tabs{
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:stretch;
}
body[data-account-page="bots"] [data-module-panel="sh-welcome"] .shieldy-interaction-tab{
  width:100%;
  height:100%;
  min-height:72px;
  justify-content:flex-start;
}
body[data-account-page="bots"] [data-module-panel="sh-welcome"] .shieldy-interaction-tab-copy{
  align-content:center;
}

/* Custom-message builder inherits the current cabinet palette instead of
   forcing light backgrounds while the page is in dark mode. */
[data-module-panel="sh-custom-builder"]{
  color-scheme:light;
  --cm-accent:#2da44e;
  --cm-accent-strong:#1f883d;
  --cm-accent-soft:color-mix(in srgb,var(--cm-accent) 12%,var(--account-surface));
  --cm-border:var(--account-border,#d5e2ea);
  --cm-border-strong:var(--account-border-strong,#bcd1dd);
  --cm-text:var(--account-text,#17243a);
  --cm-muted:var(--account-muted,#68788f);
  --cm-surface:var(--account-surface,#fff);
  --cm-surface-soft:var(--account-surface-soft,#f3f7fa);
  --cm-surface-strong:var(--account-surface-strong,#eaf3f8);
  --cm-shadow:var(--account-shadow,0 12px 30px rgba(25,72,96,.08));
}
html[data-theme="dark"] [data-module-panel="sh-custom-builder"]{color-scheme:dark}

[data-module-panel="sh-custom-builder"] :is(.cm510-card-head h3,.cm510-messages-head strong,.cm510-message-copy strong,.cm510-toggle strong,.cm510-subsection-head strong,.cm510-embed h4,.cm510-embed-field strong,.cm510-banner span){
  color:var(--cm-text);
}
[data-module-panel="sh-custom-builder"] :is(.cm510-card-head p,.cm510-field small,.cm510-message-copy small,.cm510-toggle small,.cm510-embed p,.cm510-embed-field span,.cm510-embed-footer,.cm510-empty){
  color:var(--cm-muted);
}
[data-module-panel="sh-custom-builder"] .cm510-summary span,
[data-module-panel="sh-custom-builder"] .cm510-channel-tab,
[data-module-panel="sh-custom-builder"] .cm510-message-item,
[data-module-panel="sh-custom-builder"] .cm510-toggle,
[data-module-panel="sh-custom-builder"] .cm510-dynamic-row,
[data-module-panel="sh-custom-builder"] .cm510-preview-toolbar button,
[data-module-panel="sh-custom-builder"] .cm510-embed,
[data-module-panel="sh-custom-builder"] .cm510-preview-button,
[data-module-panel="sh-custom-builder"] .cm510-preview-reaction{
  background:var(--cm-surface);
  border-color:var(--cm-border);
  color:var(--cm-text);
}
[data-module-panel="sh-custom-builder"] .cm510-channel-tab strong,
[data-module-panel="sh-custom-builder"] .cm510-preview-author,
[data-module-panel="sh-custom-builder"] .cm510-preview-content{
  color:var(--cm-text);
}
[data-module-panel="sh-custom-builder"] .cm510-channel-tab.is-active{
  background:var(--cm-accent-soft);
  border-color:var(--cm-accent);
}
[data-module-panel="sh-custom-builder"] .cm510-add-channel{
  background:color-mix(in srgb,var(--cm-accent) 5%,var(--cm-surface));
  border-color:color-mix(in srgb,var(--cm-accent) 48%,var(--cm-border));
  color:color-mix(in srgb,var(--cm-accent) 78%,var(--cm-text));
}
[data-module-panel="sh-custom-builder"] .cm510-channel-settings,
[data-module-panel="sh-custom-builder"] .cm510-message-editor,
[data-module-panel="sh-custom-builder"] .cm510-preview-stage{
  background:var(--cm-surface-soft);
  border-color:var(--cm-border);
  color:var(--cm-text);
}
[data-module-panel="sh-custom-builder"] .cm510-message-editor,
[data-module-panel="sh-custom-builder"] .cm510-subsection{
  border-color:var(--cm-border);
}
[data-module-panel="sh-custom-builder"] .cm510-message-index,
[data-module-panel="sh-custom-builder"] .cm510-chip.is-on,
[data-module-panel="sh-custom-builder"] .cm510-preview-toolbar button.is-active,
[data-module-panel="sh-custom-builder"] .cm510-preview-reaction.is-role{
  background:var(--cm-accent-soft);
  color:color-mix(in srgb,var(--cm-accent) 72%,var(--cm-text));
  border-color:color-mix(in srgb,var(--cm-accent) 48%,var(--cm-border));
}
[data-module-panel="sh-custom-builder"] .cm510-chip,
[data-module-panel="sh-custom-builder"] .cm510-editor-tab{
  background:var(--cm-surface-strong);
  color:var(--cm-muted);
}
[data-module-panel="sh-custom-builder"] .cm510-editor-tab.is-active{
  background:var(--cm-accent-strong);
  color:#fff;
}
[data-module-panel="sh-custom-builder"] .cm510-icon-button{color:var(--cm-muted)}
[data-module-panel="sh-custom-builder"] .cm510-icon-button:hover{background:var(--cm-surface-strong);color:var(--cm-text)}
[data-module-panel="sh-custom-builder"] .cm510-banner{background:var(--cm-surface-strong);color:var(--cm-text)}
[data-module-panel="sh-custom-builder"] .cm510-preview-avatar{background:var(--cm-surface)}
[data-module-panel="sh-custom-builder"] .cm510-savebar{
  background:color-mix(in srgb,var(--cm-surface) 94%,transparent);
  border-color:var(--cm-border-strong);
  color:var(--cm-text);
  box-shadow:var(--cm-shadow);
}
[data-module-panel="sh-custom-builder"] .cm510-empty{border-color:var(--cm-border-strong)}
[data-module-panel="sh-custom-builder"] .cm510-warning{
  background:color-mix(in srgb,#f2b84b 12%,var(--cm-surface));
  border-color:color-mix(in srgb,#f2b84b 52%,var(--cm-border));
  color:color-mix(in srgb,#f2b84b 68%,var(--cm-text));
}

/* One deterministic visual system for every native dropdown created by the
   custom-message builder, including dynamically-added action and role rows. */
html body[data-account-page="bots"] [data-module-panel="sh-custom-builder"] .cm510-field select{
  appearance:auto!important;
  -webkit-appearance:menulist!important;
  min-height:42px!important;
  height:42px!important;
  width:100%!important;
  padding:10px 12px!important;
  border:1px solid var(--cm-border-strong)!important;
  border-radius:10px!important;
  background-color:var(--cm-surface)!important;
  color:var(--cm-text)!important;
  -webkit-text-fill-color:var(--cm-text)!important;
  font:700 13px/1.25 Nunito,sans-serif!important;
  cursor:pointer;
  box-shadow:none!important;
  transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease;
}
html[data-theme="dark"] body[data-account-page="bots"] [data-module-panel="sh-custom-builder"] .cm510-field select{color-scheme:dark}
html body[data-account-page="bots"] [data-module-panel="sh-custom-builder"] .cm510-field select:hover{border-color:color-mix(in srgb,var(--cm-accent) 48%,var(--cm-border-strong))}
html body[data-account-page="bots"] [data-module-panel="sh-custom-builder"] .cm510-field select:focus{
  outline:0;
  border-color:var(--cm-accent);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--cm-accent) 16%,transparent);
}
html body[data-account-page="bots"] [data-module-panel="sh-custom-builder"] .cm510-field select:disabled{
  cursor:not-allowed;
  opacity:.62;
  background-color:var(--cm-surface-strong);
}
html body[data-account-page="bots"] [data-module-panel="sh-custom-builder"] .cm510-field select option{
  background:var(--cm-surface);
  color:var(--cm-text);
}

/* Inputs and textareas use the same height, border and palette as selects. */
[data-module-panel="sh-custom-builder"] .cm510-field :is(input:not([type="checkbox"]):not([type="color"]),textarea){
  border-color:var(--cm-border-strong);
  background:var(--cm-surface);
  color:var(--cm-text);
  -webkit-text-fill-color:var(--cm-text);
}
[data-module-panel="sh-custom-builder"] .cm510-field input:not([type="checkbox"]):not([type="color"]){min-height:42px}
[data-module-panel="sh-custom-builder"] .cm510-field :is(input,textarea)::placeholder{color:color-mix(in srgb,var(--cm-muted) 78%,transparent);opacity:1}
[data-module-panel="sh-custom-builder"] .cm510-field :is(input,textarea):disabled{
  background:var(--cm-surface-strong);
  color:var(--cm-muted);
  -webkit-text-fill-color:var(--cm-muted);
  opacity:.72;
}

@media(max-width:720px){
  body[data-account-page="bots"] [data-module-panel="sh-welcome"] .shieldy-interaction-tabs{
    display:grid;
    grid-template-columns:1fr;
    overflow:visible;
  }
  body[data-account-page="bots"] [data-module-panel="sh-welcome"] .shieldy-interaction-tab{
    min-height:64px;
  }
}
