/* Presentation around the released designer, in Browser and PWA. */
/* The released legacy .dark rule can override the Dashboard palette by load
 * order. Bind this workspace explicitly to the approved dark app tokens. */
html.dark:has(:is([data-campaign-editor-shell],.em-start-magic-title)){
 --background:#0f0f10;--card:#18181a;--popover:#18181a;--secondary:#222225;--muted:#222225;
 --foreground:#e6e6e9;--card-foreground:#e6e6e9;--muted-foreground:#b5b5bd;
 --sidebar:#18181a;--sidebar-accent:#282828;
}
html.dark:has(:is([data-campaign-editor-shell],.em-start-magic-title)) :is(.heddy-dashboard-inset,.native-main){background-color:#0f0f10!important;}
:is(.em-campaign-shell,.em-sequence-panel,.em-calendar-panel,.em-actions-panel,.em-transactional-dialog){
 --em-panel:#fff;--em-raised:#f6f7f8;--em-text:#24262b;--em-muted:#555d68;--em-line:#d5d9de;
 --em-rim:inset 0 1px 0 #fff,inset 1px 0 0 #ffffff80,inset 0 -1px 0 #17191c09,0 4px 12px #17191c0b;
 color:var(--em-text);min-width:0;
}
.dark :is(.em-campaign-shell,.em-sequence-panel,.em-calendar-panel,.em-actions-panel,.em-transactional-dialog){
 --em-panel:#18181a;--em-raised:#202022;--em-text:#e6e6e9;--em-muted:#a1a1aa;--em-line:#ffffff1a;
 --em-rim:inset 0 1px 0 #ffffff21,inset 1px 0 0 #ffffff09,inset 0 -1px 0 #00000040,0 5px 18px #0000002b;
}
:is(.em-settings-panel,.em-single-content-panel,.em-sequence-panel,.em-calendar-panel,.em-actions-panel,.em-transactional-settings,.em-transactional-composer,.em-transactional-branding){
 position:relative;background:var(--em-panel)!important;border:1px solid var(--em-line)!important;border-radius:16px!important;
 box-shadow:var(--em-rim)!important;backdrop-filter:none!important;
}
.em-settings-panel,.em-single-content-panel,.em-sequence-panel{padding:24px!important;}
.em-campaign-shell{display:grid;gap:24px;}
.em-magic-brand{display:flex;align-items:center;gap:10px;font-family:"Space Grotesk",sans-serif;font-weight:700;font-size:24px;letter-spacing:-.6px;color:var(--em-text);}
.em-magic-brand svg,.em-magic-brand>span>span{color:#E63946;}
.dark .em-magic-brand>span{color:white;}
.em-campaign-title{min-width:0;white-space:nowrap;}
.em-start-magic-title{font-family:"Space Grotesk",sans-serif;font-weight:700;color:#24262b;}
.dark .em-start-magic-title{color:white;}
.em-magic-red{color:#E63946!important;}
.em-settings-panel{display:grid;gap:24px;}
.em-settings-panel>div:first-child{margin:0!important;}
.em-settings-panel input:not([type=file]),.em-settings-panel [role=combobox]{width:100%;min-height:44px;background:var(--em-raised)!important;border-color:var(--em-line)!important;color:var(--em-text)!important;border-radius:11px;}
.em-settings-columns{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;}
.em-recipient-group,.em-sender-group{display:flex;flex-direction:column;min-width:0;gap:14px;padding:20px;background:var(--em-raised);border:1px solid var(--em-line);border-radius:13px;}
.em-section-label{font-size:14px;font-weight:650;line-height:1.5;color:var(--em-text);}
.em-help{color:var(--em-muted);font-size:12px;line-height:1.6;}
.em-mode-choice{display:grid;gap:10px;}
.em-mode-buttons{display:flex;gap:4px;padding:4px;max-width:380px;border:1px solid var(--em-line);border-radius:12px;background:var(--em-raised);}
.em-mode-buttons button{flex:1;padding:10px 14px;border-radius:8px;font-size:13px;color:var(--em-muted);cursor:pointer;}
.em-mode-buttons button[aria-pressed=true]{background:#e6394618;color:var(--em-text);box-shadow:inset 0 0 0 1px #e6394650;}
.em-mode-buttons button:disabled{opacity:.5;cursor:not-allowed;}
.em-recipient-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:start;}
.em-recipient-actions>div{margin-top:0!important;min-width:0;}
.em-recipient-actions button{min-height:40px;border-radius:10px;font-size:12px;}
.em-recipient-actions>div:last-child{flex:1;}
.em-branding-toolbar{border-top:1px solid var(--em-line);padding-top:18px;}
.em-branding-toolbar:empty{display:none;}
.em-branding-toolbar>div{margin:0!important;padding-top:0!important;border-top:0!important;}
.em-branding-toolbar button{min-height:40px;border-radius:10px;}
.em-single-content-panel>div>div:first-child{margin-bottom:18px;}
.em-sequence-navigator{display:grid;gap:14px;min-width:0;}
.em-sequence-toolbar{display:flex;align-items:stretch;gap:12px;min-width:0;}
.em-sequence-tabs{display:flex!important;flex-wrap:nowrap!important;grid-template-columns:none!important;gap:8px;overflow-x:auto!important;min-width:0!important;max-width:100%;padding:2px 0 10px;overscroll-behavior-inline:contain;scrollbar-width:thin;position:relative;}
.em-sequence-tabs>[role=tab]{flex:0 0 145px!important;display:flex!important;flex-direction:row!important;align-items:center;gap:10px;min-width:145px!important;width:145px!important;border:1px solid var(--em-line);border-radius:12px;padding:13px 16px;background:var(--em-raised);color:var(--em-muted);font-size:13px;text-align:left;cursor:pointer;}
.em-sequence-tabs>[aria-selected=true]{border-color:#e6394670;background:#e6394614;color:var(--em-text);}
.em-step-number{display:grid;place-items:center;border:1px solid var(--em-line);border-radius:8px;min-width:26px;height:26px;font-size:12px;}
[aria-selected=true]>.em-step-number{background:#e63946;color:white;border-color:#e63946;}
.em-add-step{flex:none;padding-top:2px;}
.em-add-step button{min-height:54px;border-radius:12px;}
.em-step-panel[hidden]{display:none!important;}
.em-step-panel>[data-sequence-step]{background:transparent!important;border:0;padding:0;}
.em-actions-panel{padding:18px!important;}
.em-actions-panel button{min-height:42px;border-radius:10px;}
.em-transactional-dialog{background:var(--em-panel)!important;border-color:var(--em-line)!important;color:var(--em-text)!important;}
.em-transactional-dialog .em-actions-panel{border-radius:0!important;}
.em-transactional-dialog .em-transactional-branding{background:var(--em-raised)!important;}
/* Keep original content colors inside the actual e-mail preview and blocks. */
html:not(.dark) :is(.em-settings-panel,.em-sequence-panel,.em-calendar-panel,.em-transactional-dialog) :is(.text-white\/50,.text-white\/40,.text-white\/60){color:var(--em-muted)!important;}
html:not(.dark) [data-campaign-editor-shell] [data-slot=badge].bg-white\/10{background:#555d6812!important;color:#555d68!important;}
:is(.em-campaign-shell,.em-sequence-panel,.em-transactional-dialog) button:focus-visible{outline:2px solid #e63946;outline-offset:3px;}
@media(max-width:760px){
 .em-campaign-title{font-size:20px;line-height:1.25;gap:8px;}
 .em-campaign-title>svg{width:20px;height:20px;flex-shrink:0;}
 .em-settings-panel,.em-single-content-panel,.em-sequence-panel{padding:16px!important;}
 .em-campaign-shell{gap:18px;}
 .em-settings-columns{grid-template-columns:minmax(0,1fr);gap:16px;}
 .em-recipient-group,.em-sender-group{padding:16px;}
 .em-mode-buttons{max-width:none;}
 .em-mode-buttons button{padding:10px;}
 .em-recipient-actions{display:grid;grid-template-columns:minmax(0,1fr);width:100%;}
 .em-recipient-actions>div{width:100%;}
 .em-recipient-actions>div>button{width:100%;min-height:44px;justify-content:center;}
 .em-branding-toolbar>div{gap:10px;}
 .em-branding-toolbar>div>div{min-width:0;max-width:100%;flex-wrap:wrap;}
 .em-sequence-toolbar{flex-direction:column;}
 .em-sequence-tabs>[role=tab]{min-width:140px;}
 .em-add-step,.em-add-step button{width:100%;}
 .em-add-step button{min-height:44px;}
 .em-actions-panel{padding:14px!important;}
 .em-actions-panel button{width:100%;}
 /* Sequence metadata uses the whole mobile column. Only the surrounding
  * controls are aligned here; the email's own design stays independent. */
 .em-sequence-navigator>.em-help{text-align:center;}
 .em-step-panel [data-sequence-step]>div:first-child{display:flex;flex-direction:column;align-items:stretch!important;width:100%;}
 .em-step-panel [data-sequence-step]>div:first-child>p{width:100%;text-align:center;}
 .em-step-panel [data-sequence-step]>div:first-child>p>span{display:block;margin-left:0;}
 .em-step-panel [data-sequence-schedule]{display:grid!important;grid-template-columns:minmax(0,1fr) 44px;align-items:end;width:100%;gap:12px!important;}
 .em-step-panel [data-sequence-schedule]>div:first-child{grid-column:1/-1;display:grid!important;grid-template-columns:minmax(0,1fr);width:100%;gap:9px!important;text-align:center;justify-items:stretch;}
 .em-step-panel [data-sequence-schedule]>div:first-child>input{width:100%!important;max-width:none!important;min-height:44px;text-align:center;background:var(--em-raised);border-color:var(--em-line);}
 .em-step-panel [data-sequence-schedule]>div:nth-of-type(2){display:grid!important;grid-template-columns:28px minmax(0,1fr);align-items:center;width:100%;gap:8px;text-align:center;}
 .em-step-panel [data-sequence-schedule]>div:nth-of-type(2)>[role=combobox]{width:100%!important;min-height:44px;background:var(--em-raised);border-color:var(--em-line);}
 .em-step-panel [data-sequence-schedule]>div:nth-of-type(2)>[role=combobox]>span{flex:1;text-align:center;justify-content:center;}
 .em-step-panel [data-sequence-schedule]>button[aria-label$="entfernen"]{display:flex;align-items:center;justify-content:center;grid-column:2;width:44px;height:44px;min-height:44px;border:1px solid var(--em-line);border-radius:10px;background:var(--em-raised);}
 .em-step-panel [data-sequence-schedule]:not(:has(>div:nth-of-type(2)))>div:first-child{grid-column:1;}
 .em-step-panel [data-sequence-schedule]:not(:has(>button[aria-label$="entfernen"])){grid-template-columns:minmax(0,1fr);}
 .em-step-panel [data-sequence-step]>input[placeholder^="Betreff"]{width:100%!important;min-height:44px;text-align:center;}
 .em-step-panel [data-sequence-step]>div:nth-of-type(2){display:grid;grid-template-columns:minmax(0,1fr);width:100%;gap:9px;text-align:center;}
 .em-step-panel [data-sequence-step]>div:nth-of-type(2)>div{display:flex;width:100%;}
 .em-step-panel [data-sequence-step]>div:nth-of-type(2)>div>button{display:flex;flex:1;justify-content:center;min-height:40px;}
 .em-step-panel [data-sequence-step]>div:nth-of-type(3)>button,.em-step-panel [data-sequence-step]>button{width:100%;min-height:44px;justify-content:center;}
}

/* Light-theme controls on the Magic workspace, including its portaled dialogs. */
html[data-theme="light"] :is(
  [data-email-magic-conversation],
  [data-email-magic-credits],
  .email-magic-transcript-dialog,
  [data-campaign-editor-shell],
  .em-sequence-panel
) {
  --magic-ink: #24262b;
  --magic-muted: #4c5560;
  --magic-accent-ink: #ad1f31;
  --magic-action: #bd2638;
  --magic-action-hover: #a51f30;
}

html[data-theme="light"] [data-heddy-magic-name] {
  color: #ad1f31 !important;
}

html[data-theme="light"] [data-email-magic-conversation] .glass.rounded-full.text-white\/80 {
  color: var(--magic-ink) !important;
}

html[data-theme="light"] [data-email-magic-conversation] :is(
  .text-white\/70,
  [aria-label="Anhang entfernen"]
) {
  color: var(--magic-muted) !important;
}

html[data-theme="light"] [data-email-magic-conversation] :is(
  .tabular-nums.text-primary,
  .tabular-nums.text-red-400
) {
  color: var(--magic-accent-ink) !important;
}

html[data-theme="light"]:has([data-email-magic-conversation]) button:is(
  [aria-label="Datei anhängen"],
  [aria-label="Spracheingabe starten"],
  [aria-label="Aufnahme verwerfen"],
  [aria-label="Verwerfen"],
  [aria-label="Anhang entfernen"]
):hover:not(:disabled) {
  color: #24262b !important;
}

html[data-theme="light"] [data-email-magic-credits] {
  background: #fff !important;
  border-color: #d5d9de !important;
  color: var(--magic-ink) !important;
}

html[data-theme="light"] [data-email-magic-credits] :is(
  [data-slot="dialog-description"],
  .text-muted-foreground
) {
  color: var(--magic-muted) !important;
}

html[data-theme="light"] :is(
  [data-email-magic-conversation],
  [data-email-magic-credits],
  .email-magic-transcript-dialog
) :is(.bg-primary.text-primary-foreground, .glow-red, button.bg-primary) {
  background: var(--magic-action) !important;
  color: #fff !important;
}

html[data-theme="light"] :is(
  [data-email-magic-conversation],
  [data-email-magic-credits],
  .email-magic-transcript-dialog
) button:is(.glow-red, .bg-primary):hover:not(:disabled) {
  background: var(--magic-action-hover) !important;
}

/* Keep editing controls readable without changing the authored email. */
html[data-theme="light"] [data-campaign-editor-shell] :is(
  .text-muted-foreground\/60,
  .text-muted-foreground\/80
) {
  color: var(--magic-muted) !important;
}

html[data-theme="light"] .em-sequence-panel [aria-selected="true"] > .em-step-number {
  background: var(--magic-action);
  border-color: var(--magic-action);
}
