/* V11 workspace layout and history details. Loaded after app.css and theme.css. */
.layout{
  min-height:100vh;
  min-height:100svh;
  display:grid;
  grid-template-columns:250px minmax(0,1fr);
  align-items:start;
}
.main{
  align-self:start;
  justify-self:stretch;
  min-width:0;
  width:100%;
  max-width:1600px;
  min-height:100vh;
  min-height:100svh;
  margin:0 auto;
  padding:clamp(18px,2.4vw,34px) clamp(16px,3.6vw,55px) 42px;
}
.main>.topbar{margin:0 0 22px;align-items:center}
.main>.topbar h1{margin-top:6px}
.main>.panel,.main>.stats,.main>.grid-two{margin-top:0}
.sidebar{align-self:start;min-height:100vh;min-height:100svh}
.history-panel{width:100%;min-width:0}
.history-panel .panel-head{align-items:center}
.history-panel .table-wrap{width:100%;max-width:100%;overflow:auto;overscroll-behavior-inline:contain}
#history-table{min-width:1080px;table-layout:auto}
#history-table th,#history-table td{vertical-align:middle}
#history-table .history-message{max-width:220px;white-space:normal;overflow-wrap:anywhere;line-height:1.45}
.history-detail-trigger{white-space:nowrap;color:var(--text)!important}
.history-modal{
  width:min(860px,calc(100vw - 32px));
  max-width:860px;
  max-height:min(88svh,900px);
  padding:0;
  border:1px solid var(--line);
  border-radius:22px;
  background:var(--surface);
  color:var(--text);
  box-shadow:0 28px 90px #0006;
  overflow:hidden;
}
.history-modal::backdrop{background:rgba(3,8,20,.68);backdrop-filter:blur(7px)}
.history-modal[open]{animation:historyModalIn .18s ease-out both}
.history-modal-head,.history-modal-foot{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;border-bottom:1px solid var(--line)}
.history-modal-head h2{margin:5px 0 3px;color:var(--text)}
.history-modal-head p{margin:0;color:var(--muted);font-size:13px}
.history-modal-content{padding:22px 24px;overflow:auto;max-height:calc(88svh - 160px)}
.history-meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 20px}
.history-meta>div{min-width:0;padding:13px 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}
.history-meta dt{font-size:11px;color:var(--muted);margin-bottom:5px}
.history-meta dd{margin:0;color:var(--text);font-size:13px;font-weight:650;overflow-wrap:anywhere}
.history-detail-section{margin:16px 0 0;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--surface-2)}
.history-detail-section h3{font-size:13px;margin:0 0 10px;color:var(--text)}
.history-message-full,.history-detail-section>p{margin:0;color:var(--text-soft);font-size:13px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere}
.history-response{max-width:none;width:100%;max-height:300px;margin:0;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;background:var(--field-bg)!important;color:var(--text-soft)!important;border:1px solid var(--line);font:12px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace}
.history-modal-foot{justify-content:flex-end;border-top:1px solid var(--line);border-bottom:0}
@keyframes historyModalIn{from{opacity:0;transform:translateY(10px) scale(.99)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:900px){
  .layout{grid-template-columns:minmax(0,1fr)}
  .sidebar{min-height:0;height:auto;align-self:auto}
  .main{min-height:0;margin:0;width:100%;padding:20px 16px 34px}
}
@media(max-width:640px){
  .main{padding:16px 12px 28px}
  .main>.topbar{margin-bottom:17px}
  .history-panel{padding:15px}
  .history-panel .panel-head{align-items:flex-start;flex-direction:column}
  .history-meta{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .history-modal{width:calc(100vw - 18px);max-height:92svh;border-radius:17px}
  .history-modal-head,.history-modal-foot{padding:15px}
  .history-modal-content{padding:14px;max-height:calc(92svh - 140px)}
  .history-detail-section{padding:13px}
}
@media(max-width:380px){.history-meta{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.history-modal[open]{animation:none}}


/* V12: centered authentication screens, animated workspace surfaces and delivery flow. */
body.auth.auth-modern{
  display:grid!important;
  place-items:center!important;
  align-content:center!important;
  justify-content:center!important;
  min-height:100vh;
  min-height:100svh;
  padding:clamp(14px,3.5vh,34px) 16px!important;
  overflow-x:hidden;
}
body.auth.auth-modern>.auth-card{
  align-self:center;
  justify-self:center;
  margin:auto;
  max-height:calc(100svh - 28px);
  overflow-y:auto;
  overscroll-behavior:contain;
}
body.auth.auth-modern .otp-card{width:min(100%,520px)}
body.auth.auth-modern .otp-boxes{width:100%;max-width:420px;margin-inline:auto}
@media(max-height:680px){body.auth.auth-modern{align-content:start!important}body.auth.auth-modern>.auth-card{margin-block:0}}
@media(max-width:420px){body.auth.auth-modern{padding:12px!important}body.auth.auth-modern>.auth-card{padding:22px 18px;border-radius:18px}body.auth.auth-modern .otp-boxes{gap:6px}body.auth.auth-modern .otp-digit{height:52px;font-size:21px}}

/* Subtle entrance and hover motion for dashboard/workspace cards after sign-in. */
@keyframes workspaceCardIn{from{opacity:0;transform:translateY(14px) scale(.992)}to{opacity:1;transform:translateY(0) scale(1)}}
.main>.stats>.stat,.main>.panel,.main>.grid-two>.panel,.main>section.panel{
  animation:workspaceCardIn .48s cubic-bezier(.2,.75,.25,1) both;
}
.main>.stats>.stat:nth-child(2),.main>.grid-two>.panel:nth-child(2){animation-delay:.055s}
.main>.stats>.stat:nth-child(3){animation-delay:.11s}
.main>.stats>.stat:nth-child(4){animation-delay:.165s}
.main>.panel:hover,.main>.grid-two>.panel:hover,.main>.stats>.stat:hover{transform:translateY(-3px);box-shadow:var(--shadow),0 12px 32px color-mix(in srgb,var(--accent) 12%,transparent)}

.history-analytics{overflow:hidden}
.delivery-flow{display:grid;grid-template-columns:minmax(0,1fr) minmax(90px,.42fr) minmax(0,1fr);align-items:center;gap:14px;padding:8px 0 18px}
.delivery-node{min-width:0;display:flex;flex-direction:column;gap:5px;padding:18px 20px;border:1px solid var(--line);border-radius:16px;background:var(--surface-2);animation:workspaceCardIn .55s ease both}
.delivery-node-label{font-size:12px;font-weight:700;color:var(--muted)!important}
.delivery-node strong{font:700 clamp(25px,4vw,36px)/1.1 var(--global-font,Inter,system-ui,sans-serif);color:var(--text)!important}
.delivery-node small{font-size:11px;color:var(--muted)!important}
.success-node{border-color:color-mix(in srgb,#20b981 45%,var(--line));box-shadow:inset 3px 0 #20b981}
.failed-node{border-color:color-mix(in srgb,#ef596b 45%,var(--line));box-shadow:inset 3px 0 #ef596b}
.delivery-connector{height:28px;display:flex;align-items:center;justify-content:center;gap:0;position:relative}
.delivery-connector:before{content:"";height:2px;width:100%;background:linear-gradient(90deg,#20b981,#8b9bb5,#ef596b);border-radius:9px}
.delivery-connector span{position:absolute;width:10px;height:10px;border-radius:50%;background:var(--surface);border:2px solid #20b981;left:0}
.delivery-connector span:last-child{left:auto;right:0;border-color:#ef596b}
.delivery-connector i{position:absolute;width:8px;height:8px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 5px color-mix(in srgb,var(--accent) 16%,transparent);animation:flowPulse 1.8s ease-in-out infinite}
@keyframes flowPulse{0%,100%{transform:translateX(-24px);opacity:.55}50%{transform:translateX(24px);opacity:1}}
.delivery-progress{display:flex;width:100%;height:12px;overflow:hidden;border-radius:99px;background:var(--surface-3);gap:2px}
.delivery-progress span{display:block;height:100%;min-width:0;transition:width .7s ease}
.progress-success,.legend-success{background:#20b981}.progress-failed,.legend-failed{background:#ef596b}.progress-other,.legend-other{background:#8795aa}
.delivery-legend{display:flex;flex-wrap:wrap;gap:15px;margin-top:12px;color:var(--muted);font-size:11px}
.delivery-legend span{display:inline-flex;align-items:center;gap:7px}
.delivery-legend i{width:8px;height:8px;display:inline-block;border-radius:50%}
@media(max-width:640px){.delivery-flow{grid-template-columns:minmax(0,1fr) 38px minmax(0,1fr);gap:7px}.delivery-node{padding:14px 11px}.delivery-node-label{font-size:11px}.delivery-node small{font-size:10px}.delivery-legend{gap:9px;font-size:10px}}
@media(prefers-reduced-motion:reduce){.main>.stats>.stat,.main>.panel,.main>.grid-two>.panel,.delivery-node{animation:none!important}.delivery-connector i{animation:none!important}.main>.panel:hover,.main>.grid-two>.panel:hover,.main>.stats>.stat:hover{transform:none}}

/* V13 navigation split: Sender Servers is a first-class item; admin utilities live under Extra. */
.sidebar nav .nav-extra{min-width:0;border-radius:12px;overflow:hidden}
.sidebar nav .nav-extra>summary{list-style:none;display:flex;align-items:center;gap:11px;padding:12px 13px;border-radius:11px;color:var(--text);cursor:pointer;user-select:none;transition:background .2s ease,color .2s ease}
.sidebar nav .nav-extra>summary::-webkit-details-marker{display:none}
.sidebar nav .nav-extra>summary:hover,.sidebar nav .nav-extra[open]>summary{background:var(--surface-2);color:var(--text)}
.sidebar nav .nav-extra>summary .ui-icon{width:17px;height:17px;color:var(--accent)}
.sidebar nav .nav-chevron{margin-left:auto;color:var(--muted);transition:transform .2s ease}
.sidebar nav .nav-extra[open] .nav-chevron{transform:rotate(180deg)}
.sidebar nav .nav-extra-items{display:grid;gap:4px;padding:5px 0 5px 13px;margin:2px 0 4px 8px;border-left:1px solid var(--line)}
.sidebar nav .nav-extra-items a{padding:10px 11px;font-size:13px}
.sidebar nav .nav-extra-items a.active{background:var(--surface-3);color:var(--text)}
/* Keep explanatory content comfortably justified while preserving headings, labels and data alignment. */
.main .panel>p,.main .panel .callout p,.main .panel .muted-text,.main .panel .panel-head p{ text-align:justify;text-justify:inter-word }
.main .panel h2,.main .panel h3,.main .panel label,.main .panel th,.main .panel td{text-align:left}
@media(max-width:900px){
 .sidebar nav .nav-extra{flex:0 0 auto;overflow:visible}
 .sidebar nav .nav-extra>summary{white-space:nowrap;padding:10px 12px}
 .sidebar nav .nav-extra[open]{position:relative}
 .sidebar nav .nav-extra-items{position:absolute;z-index:30;top:100%;left:0;min-width:205px;padding:7px;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);margin:0}
 .sidebar nav .nav-extra-items a{white-space:normal}
}
@media(max-width:560px){
 .sidebar nav{align-items:flex-start}
 .sidebar nav .nav-extra>summary{font-size:12px}
 .main .panel>p,.main .panel .muted-text{text-align:left}
}


/* V14 shared branding: responsive, safe raster-only admin assets. */
.brand-mark img{display:block;width:100%;height:100%;object-fit:contain;border-radius:inherit}
.brand-banner-rotator{position:relative;width:100%;height:clamp(110px,20vw,230px);margin:0 0 22px;overflow:hidden;border:1px solid var(--line);border-radius:18px;background:var(--surface-2);box-shadow:var(--shadow)}
.brand-banner-rotator img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transform:scale(1.025);transition:opacity .8s ease,transform 6s ease;pointer-events:none}
.brand-banner-rotator img.active{opacity:1;transform:scale(1);pointer-events:auto}
.landing-banner{width:min(1180px,calc(100% - 40px));margin:18px auto 0;height:clamp(120px,22vw,260px)}
.settings-logo-preview{display:block;max-width:190px;max-height:90px;object-fit:contain;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}
.settings-favicon-preview{display:block;width:48px;height:48px;object-fit:contain;padding:6px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2)}
.settings-test-form{margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
@media(max-width:640px){.brand-banner-rotator{height:clamp(100px,34vw,170px);border-radius:13px;margin-bottom:16px}.landing-banner{width:calc(100% - 24px);margin-top:12px}.settings-logo-preview{max-width:140px}}
@media(prefers-reduced-motion:reduce){.brand-banner-rotator img{transition:none}}


/* V15 sender server actions: compact, wrap safely on narrow screens. */
.action-group{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:150px}
.action-group form{display:inline-flex;margin:0}
.action-group .btn{white-space:nowrap}
#server-form{scroll-margin-top:18px}
@media(max-width:760px){.action-group{min-width:0;gap:5px}.action-group .btn{padding:7px 9px;font-size:12px}}

/* Sender server create/edit modal */
.server-modal{width:min(900px,calc(100vw - 28px));max-width:900px;max-height:min(90dvh,920px);padding:0;border:1px solid var(--line);border-radius:20px;background:var(--surface);color:var(--text);box-shadow:0 28px 90px #0007;overflow:hidden}
.server-modal::backdrop{background:rgba(3,8,20,.68);backdrop-filter:blur(6px)}
.server-modal[open]{animation:historyModalIn .18s ease-out both}
.server-modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:20px 24px;border-bottom:1px solid var(--line);background:var(--surface)}
.server-modal-head h2{margin:5px 0;color:var(--text)}
.server-modal-head p{margin:0;color:var(--muted);font-size:13px}
.server-modal-body{padding:20px 24px 24px;max-height:calc(90dvh - 100px);overflow:auto;overscroll-behavior:contain}
.server-modal-body>.panel{width:100%;max-width:none;margin:0;padding:0;border:0;box-shadow:none;background:transparent}
.server-modal-body .callout{margin-bottom:18px}
.server-modal-body form{display:grid;gap:13px}
.server-modal-body .form-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.server-modal-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;padding-top:8px}
.server-modal .icon-btn{flex:0 0 auto}
@media(max-width:640px){.server-modal{width:calc(100vw - 16px);max-height:94dvh;border-radius:15px}.server-modal-head{padding:15px}.server-modal-body{padding:15px;max-height:calc(94dvh - 82px)}.server-modal-body .form-row{grid-template-columns:1fr}.server-modal-actions{display:grid;grid-template-columns:1fr}.server-modal-actions .btn{width:100%}}
.server-modal.dialog-fallback-open{display:block;position:fixed;inset:50% auto auto 50%;transform:translate(-50%,-50%);z-index:1000}
