/* Production application stylesheet.
   Base tokens and components are followed by feature-specific responsive layouts. */

@keyframes fade { from{ opacity: .55; transform: translateY(4px); } to{ opacity: 1; transform: none; } }

@keyframes toastIn { from{ opacity: 0; transform: translateY(8px); } to{ opacity: 1; transform: none; } }

:root{
  color-scheme: dark;
  --font: "DanaFaNum", Tahoma, "Segoe UI", Arial, sans-serif;
  --bg: #0a0c11;
  --panel: rgba(20, 23, 31, 0.82);
  --panel-strong: #151922;
  --panel-soft: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.09);
  --text: #f7f8fb;
  --muted: #9ea5b3;
  --accent: #b39cff;
  --accent-strong: #8e6eff;
  --success: #5ed6a7;
  --danger: #ff7b8b;
  --warning: #f2c46d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --radius: 20px;
}

*{
  box-sizing: border-box;
}

html{
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
  background: var(--bg);
}

body{
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
  font-family: var(--font);
  color: var(--text);
}

button, input, textarea, select{
  font: inherit;
}

button{
  cursor: pointer;
}

a{
  color: inherit;
}

.hidden{
  display: none !important;
}

.glass-card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(22px);
}


.brand-mark{
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #0b0911;
  box-shadow: 0 14px 35px rgba(142, 110, 255, 0.28);
}

.brand-mark.small{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 13px;
}

h1, h2, h3, p{
  margin: 0;
}

h1{
  font-size: 30px;
  margin-top: 5px;
}

h2{
  font-size: 25px;
}

h3{
  font-size: 20px;
}

.eyebrow{
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
}

.muted{
  color: var(--muted);
  line-height: 1.8;
}

.stack-form{
  display: grid;
  gap: 16px;
}

.stack-form label, .form-grid label{
  display: grid;
  gap: 8px;
  color: #d9dde5;
  font-size: 13px;
  font-weight: 700;
}

.stack-form small, .form-grid small{
  color: var(--muted);
  font-weight: 400;
  line-height: 1.7;
}

input, textarea, select{
  width: 100%;
  color: var(--text);
  background: rgba(255,255,255,.045);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

input:focus, textarea:focus, select:focus{
  border-color: rgba(179,156,255,.7);
  background: rgba(255,255,255,.07);
  box-shadow: 0 0 0 4px rgba(142,110,255,.12);
}

textarea{
  resize: vertical;
  line-height: 1.8;
}

select option{
  background: #151922;
  color: var(--text);
}

.primary-button, .secondary-button, .ghost-button, .text-button, .icon-button{
  border: 0;
  border-radius: 12px;
  padding: 11px 15px;
  color: var(--text);
  transition: transform .15s, opacity .2s, background .2s;
}

.primary-button{
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #0c0913;
  font-weight: 900;
}

.secondary-button{
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border);
}

.ghost-button{
  background: transparent;
  border: 1px solid var(--border);
}

.text-button{
  background: transparent;
  color: var(--accent);
  padding-inline: 0;
}

.icon-button{
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.06);
  font-size: 22px;
}

button:hover{
  transform: translateY(-1px);
}

button:disabled{
  opacity: .5;
  cursor: wait;
  transform: none;
}

.full-width{
  width: 100%;
}

.form-error{
  color: var(--danger);
  font-size: 13px;
}

.app-shell{
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px 1fr;
}

.sidebar{
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 22px;
  border-left: 1px solid var(--border);
  background: rgba(8,10,15,.84);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.sidebar-brand{
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand div:last-child{
  display: grid;
  gap: 5px;
}

.sidebar-brand span{
  color: var(--muted);
  font-size: 12px;
  direction: ltr;
  text-align: right;
}

.nav-list{
  display: grid;
  gap: 8px;
}

.sidebar-footer{
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.connection-pill{
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 12px;
  text-align: center;
  background: rgba(255,255,255,.05);
  color: var(--muted);
}

.connection-pill.online{
  color: var(--success);
  background: rgba(94,214,167,.09);
}

.connection-pill.offline{
  color: var(--danger);
  background: rgba(255,123,139,.08);
}

.workspace{
  min-width: 0;
}

.topbar{
  min-height: 92px;
  padding: 18px 30px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
  position: sticky;
  top: 0;
  background: rgba(10,12,17,.84);
  backdrop-filter: blur(18px);
  z-index: 10;
}

.topbar > div:nth-child(2){
  display: grid;
  gap: 5px;
}

.topbar-actions{
  margin-right: auto;
  display: flex;
  gap: 10px;
}

.page-container{
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 28px 30px 50px;
}

.page-section{
  display: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.page-section.active{
  display: block;
  animation: fade .2s ease;
}

.stats-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card{
  padding: 20px;
  min-height: 128px;
  display: grid;
  align-content: space-between;
}

.stat-card .stat-label{
  color: var(--muted);
  font-size: 13px;
}

.stat-card .stat-value{
  font-size: 34px;
  font-weight: 900;
}

.stat-card .stat-note{
  color: var(--muted);
  font-size: 11px;
}

.two-column-grid{
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 20px;
}

.panel-card{
  padding: 22px;
}

.section-heading{
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading > div{
  min-width: 0;
  display: grid;
  gap: 5px;
}

.large-heading{
  margin-bottom: 20px;
}

.automation-list-header{
  align-items: flex-end;
}

.automation-list-header .section-heading-copy{
  flex: 1 1 260px;
}

.automation-list-header [data-create-rule]{
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.compact-list{
  display: grid;
  gap: 10px;
}

.compact-item{
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 13px;
  background: var(--panel-soft);
}

.compact-item .compact-icon{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(179,156,255,.11);
}

.compact-item strong{
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
}

.compact-item small{
  color: var(--muted);
}

.account-summary{
  display: grid;
  gap: 14px;
}

.account-head{
  display: flex;
  gap: 13px;
  align-items: center;
}

.account-avatar{
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-soft);
}

.account-avatar.placeholder{
  display: grid;
  place-items: center;
  color: var(--muted);
}

.account-meta{
  display: grid;
  gap: 4px;
}

.account-meta span{
  color: var(--muted);
  font-size: 12px;
}

.info-row{
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.info-row span{
  color: var(--muted);
}

.section-toolbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.segmented-control{
  display: inline-flex;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
}

.segment{
  border: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 10px;
  padding: 10px 14px;
}

.segment.active{
  background: rgba(179,156,255,.15);
  color: var(--text);
}

.rules-list{
  display: grid;
  gap: 13px;
}

.rule-card{
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(0,1fr) auto;
  gap: 15px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
}

.rule-thumb{
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--panel-soft);
}

.rule-thumb.placeholder{
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 24px;
}

.rule-main{
  min-width: 0;
  display: grid;
  gap: 8px;
}

.rule-title-line{
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.rule-title-line strong{
  font-size: 15px;
}

.tag{
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-size: 11px;
}

.tag.active{
  color: var(--success);
  background: rgba(94,214,167,.08);
}

.tag.inactive{
  color: var(--danger);
  background: rgba(255,123,139,.08);
}

.rule-status-tag{
  margin-inline-start: auto;
  flex: 0 0 auto;
}

.keyword-line{
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.keyword-line span{
  color: var(--text);
  font-weight: 700;
}

.rule-actions{
  min-width: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rule-actions > button{
  min-width: 86px;
  max-width: 100%;
}

.status-success{
  color: var(--success);
}

.status-failed{
  color: var(--danger);
}

.status-partial{
  color: var(--warning);
}

.status-neutral{
  color: var(--muted);
}

.settings-grid{
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 20px;
}

.button-row{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.info-box{
  padding: 13px 14px;
  border-radius: 13px;
  background: rgba(255,255,255,.045);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.copy-field{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 14px;
}

.copy-field span{
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.copy-field code{
  direction: ltr;
  text-align: left;
  overflow: auto;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: #dfe3ed;
}

.copy-field button{
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 0 13px;
}

.form-grid{
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.full-span{
  grid-column: 1 / -1;
}

.toggle-row{
  display: flex !important;
  grid-template-columns: auto 1fr !important;
  align-items: center;
  justify-content: flex-start;
}

.toggle-row input{
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.toast-root{
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 100;
  display: grid;
  gap: 9px;
  width: min(360px, calc(100% - 44px));
}

.toast{
  padding: 13px 15px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: #171b24;
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: toastIn .2s ease;
}

.toast.success{
  border-color: rgba(94,214,167,.3);
}

.toast.error{
  border-color: rgba(255,123,139,.35);
}

.empty-state{
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 18px;
  line-height: 1.9;
}

.loading{
  opacity: .65;
  pointer-events: none;
}

.mobile-only{
  display: none;
}







.response-editor{
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.025);
}

.builder-empty{
  padding: 14px;
  border-radius: 13px;
  background: rgba(255,255,255,.035);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.builder-header, .builder-subhead{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.builder-header > div:first-child, .builder-subhead > div:first-child{
  display: grid;
  gap: 4px;
}

.builder-header small, .builder-subhead small{
  color: var(--muted);
}

.builder-actions{
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.compact-action{
  padding: 8px 10px;
  min-height: 36px;
  font-size: 12px;
}

.compact-action:disabled{
  opacity: .38;
  cursor: not-allowed;
}

.single-image-fields{
  display: grid;
  gap: 13px;
}





.upload-control input[type="file"]{
  padding: 9px;
  cursor: pointer;
}

.button-builder-row{
  display: grid;
  gap: 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.cards-stack{
  display: grid;
  gap: 16px;
}









:root{
  --panel-elevated: rgba(24, 28, 38, .94);
  --border-strong: rgba(190, 174, 255, .22);
}

body{
  background: radial-gradient(circle at 88% 4%, rgba(116, 83, 255, .13), transparent 28%),
    radial-gradient(circle at 10% 92%, rgba(90, 65, 190, .08), transparent 30%),
    var(--bg);
}

.glass-card{
  box-shadow: 0 12px 42px rgba(0, 0, 0, .18);
}

.section-description{
  margin-top: 5px;
  font-size: 12px;
}













.builder-subhead > div{
  display: grid;
  gap: 5px;
}

.builder-subhead small{
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.button-builder-row{
  grid-template-columns: minmax(145px, .45fr) minmax(150px, .55fr) minmax(260px, 1.3fr) auto;
  align-items: start;
  padding: 13px;
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.025);
}

.button-builder-row label{
  min-width: 0;
}

#token-form{
  padding-bottom: 4px;
}

#token-form .button-row{
  margin-top: 3px;
  gap: 12px;
}

.settings-status{
  margin-top: 18px;
  min-height: 48px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.06);
}

.execution-heading{
  align-items: flex-end;
}



.execution-summary{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.execution-stat{
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 92px;
  padding: 16px;
}

.execution-stat-icon{
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  background: rgba(179,156,255,.11);
  color: var(--accent);
  font-weight: 900;
}

.execution-stat div{
  display: grid;
  gap: 4px;
}

.execution-stat strong{
  font-size: 25px;
}

.execution-stat span:last-child{
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.execution-list{
  display: grid;
  gap: 12px;
}

.execution-card{
  padding: 16px 18px;
  border: 1px solid var(--border);
}

.execution-card-head{
  display: grid;
  grid-template-columns: 44px minmax(0,1fr);
  gap: 13px;
  align-items: start;
}

.execution-icon{
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(179,156,255,.10);
}

.execution-main{
  min-width: 0;
  display: grid;
  gap: 7px;
}

.execution-title-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.execution-main p{
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.execution-main time{
  color: var(--muted);
  font-size: 11px;
}

.status-badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  font-size: 11px;
  white-space: nowrap;
}

.status-badge::before{
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.execution-details{
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
}

.execution-details summary{
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  width: fit-content;
}

.execution-detail-grid{
  display: grid;
  grid-template-columns: minmax(110px, .35fr) minmax(0, 1fr);
  gap: 9px 14px;
  margin-top: 13px;
  padding: 13px;
  border-radius: 13px;
  background: rgba(255,255,255,.025);
  font-size: 12px;
}

.execution-detail-grid span{
  color: var(--muted);
}

.execution-detail-grid strong{
  overflow-wrap: anywhere;
}

.activity-item{
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.activity-copy{
  min-width: 0;
  display: grid;
  gap: 4px;
}

.activity-copy small{
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.activity-copy time{
  color: var(--muted);
  font-size: 10px;
}









*{
  min-width: 0;
}









.builder-actions button, .button-builder-row button{
  min-height: 44px;
}







.auth-tabs{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(255,255,255,.045);
}

.auth-tab{
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.auth-tab.active{
  background: rgba(255,255,255,.09);
  color: var(--text);
}

.accounts-list{
  display: grid;
  gap: 14px;
}

.button-link{
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.danger-button{
  border: 1px solid rgba(255, 105, 120, .35);
  background: rgba(255, 80, 100, .1);
  color: #ff9aa6;
  border-radius: 12px;
  min-height: 42px;
  padding: 0 15px;
  cursor: pointer;
}

.small-button{
  min-height: 34px;
  padding-inline: 11px;
  font-size: 12px;
}

.admin-list{
  margin-top: 16px;
}

.admin-user-item{
  gap: 12px;
}

.compact-form-grid{
  grid-template-columns: 1fr 1fr;
}

#new-invite-result{
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

#new-invite-result code{
  direction: ltr;
  unicode-bidi: isolate;
  overflow-wrap: anywhere;
}



.status-text-success{
  color: var(--success, #76d7a8);
}

.status-text-warning{
  color: var(--warning, #f1c27d);
}

.toast.warning{
  border-color: rgba(241,194,125,.38);
}

.oauth-status-text{
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  max-width: 320px;
}

.disabled-button, .disabled-button:hover{
  cursor: not-allowed;
  opacity: .55;
  filter: saturate(.45);
  transform: none;
}

#oauth-app-id, #oauth-app-secret, #oauth-scopes, #oauth-redirect-url, #oauth-deauthorize-url, #oauth-data-deletion-url{
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

#oauth-config-status{
  margin-top: 14px;
  display: grid;
  gap: 6px;
}



:root[data-theme="light"]{
  color-scheme: light;
  --success: #168c64;
  --danger: #cf4054;
  --warning: #a66c08;
}

:root[data-theme="light"] .sidebar, :root[data-theme="light"] .topbar{
  background: rgba(248, 249, 253, 0.9);
}

:root[data-theme="light"] .stack-form label, :root[data-theme="light"] .form-grid label{
  color: #313544;
}

:root[data-theme="light"] select option{
  background: #fff;
}

:root[data-theme="light"] .toast{
  background: #fff;
}

:root[data-theme="light"] .primary-button{
  color: #fff;
}

:root[data-theme="light"] .copy-field code{
  color: #303544;
}

.sidebar{
  gap: 18px;
}

.subscription-card{
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid rgba(94, 214, 167, .2);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(94, 214, 167, .11), rgba(179, 156, 255, .06));
}

.subscription-card .subscription-label{
  color: var(--muted);
  font-size: 11px;
}

.subscription-card strong{
  font-size: 14px;
}

.subscription-card small{
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.subscription-card.warning{
  border-color: rgba(242, 196, 109, .28);
  background: rgba(242, 196, 109, .08);
}

.subscription-card.expired{
  border-color: rgba(255, 123, 139, .25);
  background: rgba(255, 123, 139, .08);
}

.subscription-card.warning strong{
  color: var(--warning);
}

.subscription-card.expired strong{
  color: var(--danger);
}

.topbar-account-status{
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.topbar-account-status.online{
  color: var(--success);
  background: rgba(94, 214, 167, .07);
  border-color: rgba(94, 214, 167, .18);
}

.topbar-account-status.offline{
  color: var(--danger);
  background: rgba(255, 123, 139, .06);
  border-color: rgba(255, 123, 139, .15);
}

.status-dot-mini{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 13%, transparent);
}

.auto-sync-note{
  color: var(--muted);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.auto-sync-note::before{
  content: "●";
  color: var(--success);
  font-size: 9px;
}

.dashboard-account-head .status-badge{
  margin-right: auto;
}

.friendly-connection-status{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.friendly-connection-status span{
  padding: 10px 11px;
  border-radius: 11px;
  background: rgba(94, 214, 167, .07);
  color: var(--success);
  font-size: 11px;
}

.dashboard-connect-empty{
  min-height: 250px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  gap: 12px;
}

.dashboard-connect-empty p{
  max-width: 350px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 12px;
}

.instagram-connect-page{
  max-width: 1060px;
  margin: 0 auto;
}

.connect-page-heading{
  margin-bottom: 24px;
}

.single-account-list{
  display: grid;
  margin-bottom: 20px;
}

.connect-hero{
  min-height: 510px;
  padding: 46px 34px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  gap: 20px;
  overflow: hidden;
  position: relative;
  background: radial-gradient(circle at 50% -10%, rgba(179, 156, 255, .22), transparent 38%),
    linear-gradient(145deg, var(--panel), rgba(20, 23, 31, .66));
}

.connect-hero::before, .connect-hero::after{
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .12;
  pointer-events: none;
}

.connect-hero::before{
  top: -100px;
  right: -50px;
  background: #ff4e88;
}

.connect-hero::after{
  bottom: -120px;
  left: -30px;
  background: #7c5cff;
}

.instagram-gradient-icon{
  width: 92px;
  height: 92px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  font-size: 48px;
  background: linear-gradient(145deg, #ff8a3d, #e8398f 48%, #7754ff);
  color: #fff;
  box-shadow: 0 18px 48px rgba(192, 63, 157, .26);
  position: relative;
  z-index: 1;
}

.connect-hero-copy{
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.connect-hero-copy h3{
  font-size: clamp(24px, 4vw, 34px);
}

.connect-hero-copy p{
  max-width: 660px;
  color: var(--muted);
  line-height: 2;
  font-size: 14px;
}

.connect-benefits{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  position: relative;
  z-index: 1;
}

.connect-benefits span{
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
}

.connect-primary-button{
  min-width: min(100%, 360px);
  min-height: 54px;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  position: relative;
  z-index: 1;
}

.connect-security-note, .oauth-status-text{
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.admin-manual-token-card{
  margin-top: 22px;
}

.connected-account-card{
  padding: 30px;
  display: grid;
  gap: 24px;
  background: radial-gradient(circle at 100% 0%, rgba(94, 214, 167, .1), transparent 36%),
    var(--panel);
  border-color: rgba(94, 214, 167, .22);
}

.connected-account-main{
  display: flex;
  align-items: center;
  gap: 18px;
}

.connected-profile-avatar{
  width: 88px;
  height: 88px;
  border-radius: 28px;
  object-fit: cover;
  border: 3px solid rgba(179, 156, 255, .34);
  background: var(--panel-soft);
}

.connected-profile-avatar.placeholder{
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--muted);
}

.connected-account-identity{
  display: grid;
  gap: 6px;
}

.connected-account-identity .status-badge{
  width: max-content;
}

.connected-account-identity p{
  color: var(--muted);
}

.connected-account-features{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}

.connected-account-features span{
  padding: 13px;
  border-radius: 13px;
  background: rgba(94, 214, 167, .065);
  color: var(--success);
  font-size: 12px;
  text-align: center;
}

.connected-account-meta{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}

.connected-account-meta > div{
  display: grid;
  gap: 6px;
  padding: 15px;
  border-radius: 14px;
  background: var(--panel-soft);
}

.connected-account-meta span{
  color: var(--muted);
  font-size: 11px;
}

.connected-account-actions{
  justify-content: flex-start;
}

.subtle-danger{
  margin-right: auto;
}

.admin-connection-details{
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.admin-connection-details summary{
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}

.subscription-admin-item{
  grid-template-columns: 1fr auto;
}

.admin-user-actions{
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}





:root{
  --surface-raised: rgba(23, 27, 37, .96);
  --surface-subtle: rgba(255,255,255,.045);
  --brand-gradient: linear-gradient(135deg, #8f73ff, #6f4be8);
}

:root[data-theme="light"]{
  --bg: #f6f7fc;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --panel-soft: #f3f4f9;
  --surface-raised: #ffffff;
  --surface-subtle: #f0f2f7;
  --border: #e3e6ef;
  --text: #171925;
  --muted: #697085;
  --accent: #7758e8;
  --accent-strong: #6543d5;
  --shadow: 0 18px 50px rgba(53, 48, 83, .09);
}

:root[data-theme="light"] body{
  background: radial-gradient(circle at 4% 4%, rgba(119, 88, 232, .09), transparent 28%),
    radial-gradient(circle at 100% 100%, rgba(47, 163, 255, .055), transparent 30%),
    #f6f7fc;
}

:root[data-theme="light"] .connect-hero{
  background: radial-gradient(circle at 20% 0%, rgba(255, 79, 139, .10), transparent 35%),
    radial-gradient(circle at 85% 100%, rgba(116, 78, 229, .12), transparent 38%),
    linear-gradient(145deg, #ffffff 0%, #f9f8ff 54%, #f4f5fb 100%);
  border-color: #e0e2ec;
  box-shadow: 0 22px 60px rgba(62, 52, 101, .10);
}

:root[data-theme="light"] .connect-hero::before, :root[data-theme="light"] .connect-hero::after{
  opacity: .07;
}

:root[data-theme="light"] input, :root[data-theme="light"] textarea, :root[data-theme="light"] select{
  background: #f8f9fc;
  border-color: #dfe2eb;
}

:root[data-theme="light"] input:focus, :root[data-theme="light"] textarea:focus, :root[data-theme="light"] select:focus{
  background: #fff;
  border-color: rgba(119,88,232,.55);
  box-shadow: 0 0 0 4px rgba(119,88,232,.10);
}

.ui-icon{
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: middle;
}

button .ui-icon, a .ui-icon{
  pointer-events: none;
}

.account-chip-wrap{
  position: relative;
  direction: ltr;
}

.topbar-account-status{
  cursor: pointer;
  direction: ltr;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.topbar-account-status:hover{
  transform: translateY(-1px);
}

.account-chip-name{
  font-weight: 700;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chip-instagram{
  color: #d93c86;
}

.topbar-account-status.online .account-chip-instagram{
  color: #d93c86;
}

.account-chip-menu{
  position: absolute;
  direction: rtl;
  left: 0;
  top: calc(100% + 10px);
  z-index: 90;
  width: 245px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.account-chip-menu button{
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  cursor: pointer;
}

.account-chip-menu button:hover{
  background: var(--panel-soft);
}

.account-chip-menu .menu-danger{
  color: var(--danger);
}

.instagram-brand-icon{
  color: #d93c86;
}

.rule-editor-page{
  max-width: 1480px;
  margin: 0 auto;
}

.rule-page-form{
  display: grid;
  gap: 20px;
  padding-bottom: 30px;
}

.rule-page-header{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.rule-page-header h3{
  margin: 3px 0;
}

.back-button{
  width: 46px;
  height: 46px;
}

.rule-builder-sections{
  display: grid;
  gap: 18px;
  min-width: 0;
}

.builder-section{
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
}

.builder-section.context-collapsed{
  padding: 16px 20px;
}

.builder-section.context-collapsed .form-grid{
  display: none;
}

.builder-section-title{
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.builder-section-title h4{
  margin: 0 0 5px;
  font-size: 17px;
}

.builder-section-title p{
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.step-badge{
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(119,88,232,.12);
  color: var(--accent);
  font-weight: 800;
}

.public-replies-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.public-replies-grid textarea{
  min-height: 120px;
  resize: vertical;
}

.compact-builder-section{
  padding-block: 16px;
}

.mobile-rule-footer{
  display: none;
}

.account-settings-shell{
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.settings-tabs{
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.settings-tabs button{
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  cursor: pointer;
}

.settings-tabs button.active{
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.account-settings-card{
  padding: 28px;
  min-height: 520px;
}

.account-tab-panel{
  display: none;
  max-width: 950px;
  margin: 0 auto;
}

.account-tab-panel.active{
  display: block;
}

.settings-section-title{
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 26px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.settings-section-title h4{
  margin: 0 0 5px;
  font-size: 18px;
}

.settings-section-title p{
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.fit-button{
  width: max-content;
  min-width: 160px;
}

.profile-meta-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}

.profile-meta-grid > div{
  padding: 14px;
  border-radius: 13px;
  background: var(--panel-soft);
  display: grid;
  gap: 5px;
}

.profile-meta-grid span{
  color: var(--muted);
  font-size: 11px;
}

.password-field{
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-soft);
  overflow: hidden;
}

.password-field input{
  flex: 1;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.password-field button{
  width: 48px;
  align-self: stretch;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.devices-toolbar{
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.sessions-list{
  display: grid;
  gap: 10px;
}

.session-card{
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel-soft);
}

.session-card.current{
  border-color: rgba(94,214,167,.28);
  background: rgba(94,214,167,.065);
}

.session-device-icon{
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--surface-raised);
  color: var(--accent);
}

.session-copy{
  min-width: 0;
  display: grid;
  gap: 3px;
}

.session-copy span, .session-copy small{
  color: var(--muted);
  direction: ltr;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
}









.connect-benefits span, .connect-security-note, .friendly-connection-status span, .connected-account-features span, .inline-instagram-identity, .connection-pill{
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.inline-instagram-identity{
  direction: ltr;
}

.inline-instagram-identity .ui-icon, .connection-pill .ui-icon{
  color: #d93c86;
}





/* Account identity: Instagram icon → username → connection state */
.account-chip-wrap{ direction: ltr; }
.topbar-account-status{ direction: ltr; flex-direction: row; }
.account-chip-instagram{ order: 1; flex: 0 0 auto; }
.account-chip-name{ order: 2; direction: ltr; unicode-bidi: isolate; flex: 0 1 auto; }
.status-dot-mini{ order: 3; flex: 0 0 auto; }

/* Content gallery, navigation, automation flow, preview and theme */

.nav-list{
  display: grid;
  gap: 7px;
  width: 100%;
}

.nav-item{
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  gap: 12px;
  padding: 12px 16px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
  text-align: right;
  direction: rtl;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav-item:hover{ color: var(--text); background: var(--surface-soft); }
.nav-item.active{ color: var(--text); background: var(--primary-soft); }
.nav-item:active{ transform: scale(.99); }
.nav-icon{ width: 26px; height: 26px; display: grid; place-items: center; }
.nav-item > span:last-child{ min-width: 0; line-height: 1.5; }

.content-tabs{ min-width: min(100%, 520px); }
.media-grid{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.media-grid > .empty-state{ grid-column: 1 / -1; }
.media-card{
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.media-preview{ position: relative; overflow: hidden; background: #08090d; width: 100%; }
.media-preview-post{ aspect-ratio: 4 / 5; }
.media-preview-reel, .media-preview-story{ aspect-ratio: 9 / 16; }
.media-preview img{ width: 100%; height: 100%; display: block; object-fit: cover; }
.media-preview-post img{ object-fit: contain; background: color-mix(in srgb, var(--surface) 88%, #000); }
.media-badge{
  position: absolute; top: 10px; right: 10px; z-index: 2;
  padding: 5px 9px; border-radius: 999px;
  color: #fff; background: rgba(10,11,16,.72); backdrop-filter: blur(10px);
  font-size: 11px;
}
.media-body{ min-height: 190px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.media-caption{
  margin: 0; line-height: 1.75; font-size: 13px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.media-meta{ margin-top: auto; color: var(--muted); font-size: 11px; }
.media-actions{ display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.media-actions > button:only-child{ grid-column: 1 / -1; }






.connected-account-username{
  display: inline-flex; align-items: center; gap: 10px;
  direction: ltr; unicode-bidi: isolate; margin: 8px 0 0;
}
.connected-account-username .instagram-brand-icon{ color: #d83f84; flex: 0 0 auto; }

.flow-builder-section{ overflow: visible; }
.follow-gate-card{
  margin-block: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}
.follow-gate-card > p{ color: var(--muted); line-height: 1.75; }



.flow-steps-editor{ display: grid; gap: 14px; }





.flow-media-step{ display: grid; grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }



.flow-empty{ min-height: 120px; display: grid; place-items: center; border: 1px dashed var(--border); border-radius: 16px; }
















.preview-audio{ display: flex; align-items: center; gap: 10px; }
.preview-audio div{ display: grid; gap: 2px; }
.preview-audio span{ color: var(--muted); font-size: 11px; }






































.mobile-editor-switch{
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface-soft);
}
.mobile-editor-switch button{
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.mobile-editor-switch button.active{
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.connection-pill, .inline-instagram-identity{
  direction: ltr;
  unicode-bidi: isolate;
}
.inline-instagram-identity bdi, .connected-account-username bdi, .account-chip-name{
  direction: ltr;
  unicode-bidi: isolate;
}





/* v2.1.1 automation editor and report UI — consolidated source styles */
.rule-empty-state{
  position: relative;
  min-height: 250px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 74px clamp(24px, 8vw, 96px) 46px;
  text-align: center;
  overflow: hidden;
}
.rule-empty-state strong{ font-size: clamp(20px, 2vw, 28px); }
.rule-empty-state span{ max-width: 700px; line-height: 1.95; color: var(--muted); }
.empty-state-arrow{
  position: absolute;
  left: 24px;
  top: 16px;
  width: 118px;
  height: 62px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: guideArrow 1.8s ease-in-out infinite;
}
@keyframes guideArrow{ 50%{ transform: translate(-4px, 3px); opacity: .72; } }

.flow-step-picker-shell{ display: grid; gap: 12px; margin-block: 18px; }
.flow-add-primary{ width: fit-content; min-width: 180px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.flow-step-picker{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}
.flow-step-picker button{
  min-height: 92px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  color: var(--text);
  background: var(--panel-soft);
  text-align: right;
}
.flow-step-picker button svg{ grid-row: 1 / 3; color: var(--accent); }
.flow-step-picker button strong{ font-size: 14px; }
.flow-step-picker button small{ color: var(--muted); }
.flow-step-picker button:hover{ border-color: color-mix(in srgb, var(--accent) 65%, var(--border)); background: color-mix(in srgb, var(--accent) 10%, var(--panel-soft)); }

.response-editor{ display: grid; gap: 12px; }
.flow-step-card{
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.flow-step-header{ display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 10px; }
.flow-step-summary{
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: right;
}
.flow-step-number{ width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--accent); background: var(--primary-soft); font-weight: 900; }
.flow-step-copy{ min-width: 0; display: grid; gap: 3px; }
.flow-step-copy strong{ font-size: 15px; }
.flow-step-copy small{ color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-step-menu{ display: flex; gap: 5px; }
.icon-action,.icon-danger-button{ width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); background: transparent; }
.icon-action.danger,.icon-danger-button{ color: var(--danger); }
.flow-step-body{ padding: 16px; border-top: 1px solid var(--border); background: var(--surface-soft); display: grid; gap: 14px; }
.flow-empty{ min-height: 150px; display: grid; place-items: center; align-content: center; gap: 8px; border: 1px dashed var(--border); border-radius: 18px; color: var(--muted); }
.flow-empty strong{ color: var(--text); }
.compact-empty{ min-height: 54px; }

.media-placeholder-card{
  min-height: 220px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 20px;
  border: 1px dashed color-mix(in srgb, var(--accent) 38%, var(--border));
  border-radius: 16px;
  color: var(--muted);
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface-soft));
  text-align: center;
}
.media-placeholder-card svg{ color: var(--accent); }
.media-placeholder-card strong{ color: var(--text); }
.media-placeholder-card span{ font-size: 12px; }
.response-image-preview{ width: min(100%, 420px); aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-soft); }
.flow-media-step{ display: grid; grid-template-columns: minmax(220px,.8fr) minmax(0,1.2fr); gap: 16px; align-items: start; }
.single-image-fields{ display: grid; gap: 12px; }
.file-button{ position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; overflow: hidden; }
.file-button input{ position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.audio-step-editor{ display: grid; gap: 14px; }
.audio-stage{ min-height: 170px; display: grid; place-content: center; justify-items: center; gap: 9px; padding: 22px; border: 1px dashed var(--border); border-radius: 17px; background: var(--surface); text-align: center; }
.audio-stage > span{ color: var(--muted); font-size: 12px; }
.audio-actions{ display: flex; flex-wrap: wrap; gap: 9px; }
.instagram-audio-message{
  width: min(100%, 330px);
  display: grid;
  grid-template-columns: auto minmax(120px,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 19px;
  background: color-mix(in srgb, var(--accent) 24%, var(--surface));
}
.instagram-audio-message.compact{ width: min(82%, 300px); }
.audio-play-button{ width: 35px; height: 35px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #fff; background: var(--accent-strong); }
.audio-play-button:disabled{ cursor: default; opacity: .55; }
.audio-waveform{ height: 32px; display: flex; align-items: center; gap: 2px; }
.audio-waveform i{ flex: 1; min-width: 2px; height: var(--wave); border-radius: 99px; background: currentColor; opacity: .72; }
.instagram-audio-message time{ font-size: 10px; color: var(--muted); direction: ltr; }

.cards-editor-heading{ display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); }
.cards-stack{ display: grid; gap: 10px; }
.product-card-builder{ border: 1px solid var(--border); border-radius: 17px; background: var(--surface); overflow: hidden; }
.product-card-summary{ width: 100%; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 10px 12px; border: 0; background: transparent; color: var(--text); text-align: right; }
.summary-thumb{ width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: var(--surface-soft); color: var(--accent); }
.summary-thumb img{ width: 100%; height: 100%; object-fit: cover; }
.product-card-summary > span:nth-child(2){ min-width: 0; display: grid; gap: 3px; }
.product-card-summary small{ color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-card-editor-layout{ display: grid; grid-template-columns: minmax(240px,.82fr) minmax(0,1.18fr); gap: 18px; padding: 16px; border-top: 1px solid var(--border); background: var(--surface-soft); }
.product-card-visual{ position: sticky; top: 10px; align-self: start; }
.product-card-fields{ display: grid; gap: 11px; }
.product-card-live-preview{ width: 100%; max-width: 330px; overflow: hidden; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-soft); }
.product-preview-image{ width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border: 0; border-radius: 0; }
.product-preview-copy{ padding: 12px; display: grid; gap: 5px; }
.product-preview-copy p{ margin: 0; color: var(--muted); line-height: 1.7; font-size: 12px; }
.product-preview-actions{ display: grid; border-top: 1px solid var(--border); }
.product-preview-actions span{ padding: 10px 12px; text-align: center; color: var(--accent); font-weight: 800; border-top: 1px solid var(--border); }
.product-preview-actions span:first-child{ border-top: 0; }
.button-builder-row{ display: grid; grid-template-columns: .8fr 1fr 1.3fr auto; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); }
.card-editor-actions{ display: flex; flex-wrap: wrap; gap: 8px; }

.rule-editor-layout{ display: grid; grid-template-columns: minmax(0,1fr) minmax(330px,36%); gap: 22px; align-items: start; }
.rule-preview-panel{ min-width: 0; }
.preview-sticky{ position: sticky; top: 18px; display: grid; gap: 12px; }
.instagram-preview{ min-height: 420px; max-height: calc(100dvh - 160px); overflow: auto; padding: 14px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); scrollbar-width: thin; }
.instagram-phone-preview{ min-height: 390px; display: grid; grid-template-rows: auto 1fr auto; border: 1px solid var(--border); border-radius: 22px; overflow: hidden; background: var(--bg); }
.preview-chat-head{ min-height: 54px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); direction: ltr; }
.preview-chat-head > div{ display: flex; align-items: center; justify-content: center; gap: 7px; }
.preview-chat-body{ min-width: 0; display: grid; align-content: end; gap: 10px; padding: 14px; }
.preview-composer{ margin: 9px; min-height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); }
.incoming-preview-row{ display: grid; gap: 5px; }
.incoming-context{ justify-self: end; color: var(--muted); font-size: 10px; }
.dm-message-row{ display: flex; min-width: 0; }
.dm-message-row.user{ justify-content: flex-end; }
.dm-message-row.business{ justify-content: flex-start; }
.dm-bubble{ width: fit-content; max-width: min(82%,420px); padding: 10px 13px; border-radius: 17px; line-height: 1.85; overflow-wrap: anywhere; white-space: pre-wrap; }
.user-bubble{ color: #fff; background: linear-gradient(145deg,var(--accent),var(--accent-strong)); border-bottom-right-radius: 5px; }
.business-bubble{ color: var(--text); background: var(--surface-soft); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.preview-flow-stack{ display: grid; gap: 10px; }
.preview-flow-divider{ display:flex; align-items:center; gap:10px; color:var(--muted); font-size:11px; margin:4px 0; }
.preview-flow-divider::before,.preview-flow-divider::after{ content:""; height:1px; flex:1; background:var(--border); }
.preview-button-message{ padding: 0; overflow: hidden; }
.preview-button-message p,.preview-follow p,.preview-entry p{ margin: 0; padding: 11px 13px; }
.preview-button-message span,.preview-follow span,.preview-entry span{ display: block; padding: 9px 12px; border-top: 1px solid var(--border); color: var(--accent); text-align: center; font-weight: 800; }
.preview-media{ max-width: min(82%,320px); padding: 0; overflow: hidden; }
.preview-image{ width: 100%; max-height: 380px; display: block; object-fit: cover; border-radius: 16px; }
.preview-carousel{ width: 100%; display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.preview-carousel .product-card-live-preview{ flex: 0 0 min(78%,260px); scroll-snap-align: start; }
.instagram-comment-preview{ display: grid; gap: 15px; }
.comment-preview-card{ display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px; padding: 13px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-soft); }
.comment-preview-card p{ margin: 4px 0; line-height: 1.8; overflow-wrap: anywhere; }
.comment-preview-card small{ color: var(--muted); }
.preview-avatar{ width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-strong); color: #fff; font-size: 11px; }
.preview-empty{ min-height: 120px; display: grid; place-items: center; color: var(--muted); text-align: center; }

.execution-loading,.execution-error{ min-height: 210px; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; color: var(--muted); }
.execution-error strong{ color: var(--text); }
.loading-skeleton{ min-height: 110px; background: linear-gradient(90deg,var(--surface-soft),color-mix(in srgb,var(--accent) 9%,var(--surface-soft)),var(--surface-soft)); background-size: 220% 100%; animation: skeletonMove 1.2s linear infinite; }
.spinner{ width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin{ to{ transform: rotate(360deg); } }
@keyframes skeletonMove{ to{ background-position: -220% 0; } }

.theme-toggle{ position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 25; width: 42px; height: 42px; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 50%; background: transparent; cursor: pointer; box-shadow: 0 10px 24px rgba(0,0,0,.2); transition: transform .2s ease, box-shadow .2s ease; }
.theme-toggle:hover{ transform: translateY(-2px); box-shadow: 0 14px 28px rgba(0,0,0,.25); }
.theme-scene{ position: absolute; inset: 0; border-radius: inherit; overflow: hidden; transition: opacity .28s ease, transform .32s ease; }
.theme-scene-day{ background: linear-gradient(180deg,#4fb9f4,#bfeeff); }
.theme-sun{ position: absolute; width: 16px; height: 16px; left: 7px; top: 6px; border-radius: 50%; background: #ffd34f; box-shadow: 0 0 0 3px rgba(255,211,79,.2),0 0 10px #ffe891; }
.theme-cloud{ position: absolute; height: 8px; border-radius: 99px; background: #fff; }
.theme-cloud::before,.theme-cloud::after{ content:""; position:absolute; border-radius:50%; background:#fff; }
.cloud-one{ width: 24px; right: 4px; bottom: 10px; }.cloud-one::before{ width:11px;height:11px;left:5px;top:-5px; }.cloud-one::after{ width:9px;height:9px;right:3px;top:-3px; }
.cloud-two{ width: 18px; left: 3px; bottom: 4px; opacity:.9; }.cloud-two::before{ width:9px;height:9px;left:4px;top:-4px; }.cloud-two::after{ width:7px;height:7px;right:2px;top:-3px; }
.theme-scene-night{ background: radial-gradient(circle at 70% 20%,#253b70,#101833 48%,#070b18); }
.theme-stars{ position:absolute;inset:0;background-image:radial-gradient(circle,#fff 0 1px,transparent 1.2px),radial-gradient(circle,#c9d7ff 0 1px,transparent 1.2px);background-size:13px 13px,18px 18px;background-position:2px 3px,7px 9px;opacity:.85; }
.theme-moon{ position:absolute;width:19px;height:19px;right:8px;top:8px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fffdf1,#e5e1d2 56%,#b9b5aa);box-shadow:0 0 10px rgba(241,238,220,.5); }
.theme-moon::before,.theme-moon::after{content:"";position:absolute;border-radius:50%;background:rgba(145,142,134,.22);}.theme-moon::before{width:6px;height:6px;left:5px;top:6px;}.theme-moon::after{width:4px;height:4px;right:5px;bottom:5px;}
.theme-toggle.show-sun .theme-scene-day,.theme-toggle.show-moon .theme-scene-night{opacity:1;transform:scale(1)}
.theme-toggle.show-sun .theme-scene-night,.theme-toggle.show-moon .theme-scene-day{opacity:0;transform:scale(.86) rotate(-12deg);pointer-events:none}


/* v2.3.1 — fluid responsive and mobile-first application system */
.sidebar-backdrop{
  position: fixed;
  inset: 0;
  z-index: 49;
  border: 0;
  padding: 0;
  background: rgba(4, 6, 12, .52);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}
body.drawer-open{ overflow: hidden; }
body.drawer-open .sidebar-backdrop{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.media-action-button{
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 13px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}
.media-action-button svg{ flex: 0 0 auto; }
.media-actions{ grid-template-columns: minmax(0,1.12fr) minmax(0,.88fr); }

.preview-shell{
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: color-mix(in srgb, var(--panel-strong) 92%, transparent);
  box-shadow: var(--shadow-soft);
}
.preview-heading{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.preview-heading-icon{
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: var(--accent);
  background: var(--primary-soft);
}
.preview-heading > div{ min-width: 0; display: grid; gap: 2px; }
.preview-heading strong{ font-size: 15px; }
.preview-heading small{ color: var(--muted); font-size: 11px; }
.preview-tabs{
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}
.preview-tabs button{
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}
.preview-tabs button.active{
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(0,0,0,.12);
}
.preview-shell .instagram-preview{
  min-height: 390px;
  padding: 10px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg) 72%, var(--surface));
}

:root[data-theme="light"] .preview-shell{
  border-color: rgba(86, 76, 137, .12);
  background: linear-gradient(155deg, rgba(255,255,255,.98), rgba(248,247,255,.94));
  box-shadow: 0 18px 44px rgba(53, 47, 91, .10);
}
:root[data-theme="light"] .preview-shell .instagram-preview{
  border-color: rgba(89, 82, 130, .11);
  background: linear-gradient(180deg, #fafaff, #f4f3fb);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
:root[data-theme="light"] .instagram-phone-preview{
  border-color: rgba(83,75,122,.13);
  background: #fff;
  box-shadow: 0 12px 32px rgba(48,43,75,.08);
}
:root[data-theme="light"] .preview-chat-head,
:root[data-theme="light"] .preview-composer{
  background: rgba(255,255,255,.88);
}
:root[data-theme="light"] .business-bubble,
:root[data-theme="light"] .comment-preview-card{
  border-color: rgba(89,82,130,.12);
  background: #fff;
  box-shadow: 0 8px 20px rgba(50,44,82,.07);
}
:root[data-theme="light"] .incoming-context{ color: #73798a; }
:root[data-theme="light"] .preview-tabs{ background: #f1effa; }
:root[data-theme="light"] .preview-tabs button.active{ background: #fff; }

.oauth-mobile-note{
  display: none;
  max-width: 360px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  text-align: center;
}
.oauth-bridge-page{
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 80% 10%, rgba(142,110,255,.16), transparent 35%),
    var(--bg);
}
.oauth-bridge-card{
  width: min(480px,100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 30px;
  text-align: center;
}
.oauth-bridge-card h1{ margin: 0; font-size: 25px; }
.oauth-bridge-card p{ margin: 0; color: var(--muted); line-height: 1.9; }
.oauth-bridge-card small{ color: var(--muted); line-height: 1.8; }
.oauth-bridge-card .button-link,
.oauth-bridge-card .ghost-button{ width: 100%; }
.oauth-bridge-icon{
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(145deg,#ff744c,#e43f91 52%,#8145e8);
  box-shadow: 0 18px 38px rgba(218,63,132,.25);
}

@media (max-width: 1280px){
  .stats-grid{ grid-template-columns: repeat(2,minmax(0,1fr)); }
  .execution-summary{ grid-template-columns: repeat(2,minmax(0,1fr)); }
  .media-grid{ grid-template-columns: repeat(4,minmax(0,1fr)); }
  .public-replies-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 1100px){
  .rule-card{ grid-template-columns: 56px minmax(0,1fr); }
  .rule-thumb{ width: 56px; height: 56px; }
  .rule-actions{
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  .rule-actions > button{ width: 100%; min-width: 0; }
  .rule-editor-layout{ grid-template-columns: minmax(0,1fr); }
  .preview-sticky{ position: static; }
  .instagram-preview{ max-height: none; }
  .media-grid{ grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 900px){
  .app-shell{ grid-template-columns: 1fr; }
  .workspace{ min-width: 0; }
  .sidebar{
    position: fixed;
    inset: 0 0 0 auto;
    width: min(86vw,330px);
    height: 100dvh;
    padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
    transform: translateX(110%);
    transition: transform .22s ease;
    box-shadow: -20px 0 55px rgba(0,0,0,.28);
    z-index: 50;
    overflow-y: auto;
  }
  .sidebar.open{ transform: translateX(0); }
  .sidebar-brand{ padding-bottom: 12px; border-bottom: 1px solid var(--border); }
  .subscription-card{ padding: 12px; }
  .nav-list{ gap: 6px; }
  .nav-item{ min-height: 50px; padding: 10px 12px; border-radius: 14px; }
  .sidebar-footer{ padding-top: 10px; }
  .mobile-only{ display: grid; }

  .topbar{
    position: sticky;
    top: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: 44px minmax(0,1fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 8px 10px;
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
    background: color-mix(in srgb, var(--bg) 91%, transparent);
    box-shadow: 0 10px 28px rgba(0,0,0,.10);
    z-index: 30;
  }
  #menu-button{ grid-column: 1; grid-row: 1; width: 42px; height: 42px; background: transparent; }
  .topbar > div:nth-child(2){ grid-column: 2; grid-row: 1; min-width: 0; gap: 2px; }
  .topbar h2{
    font-size: clamp(21px,5.8vw,29px);
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .topbar .eyebrow{ font-size: 10px; }
  .topbar-actions{
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin: 0;
    justify-content: flex-start;
  }
  .account-chip-wrap{ min-width: 0; }
  .topbar-account-status{
    min-height: 38px;
    max-width: min(100%,260px);
    padding: 0 11px;
    font-size: 11px;
  }
  .account-chip-name{ max-width: min(180px,52vw); }
  .account-chip-menu{
    position: fixed;
    top: calc(102px + env(safe-area-inset-top));
    left: 14px;
    right: 14px;
    width: auto;
  }

  .page-container{
    width: 100%;
    max-width: 100%;
    padding: 18px 14px calc(82px + env(safe-area-inset-bottom));
    overflow-x: clip;
  }
  .two-column-grid,.settings-grid{ grid-template-columns: 1fr; }
  .section-heading.large-heading{ align-items: flex-start; gap: 12px; }
  .panel-card{ padding: 18px; border-radius: 19px; }

  body[data-page="accounts"] .connect-page-heading,
  body[data-page="account-settings"] .account-settings-shell > .section-heading,
  body[data-page="executions"] .execution-heading h3,
  body[data-page="rules"] #page-rules > .section-heading .section-heading-copy{ display: none; }
  body[data-page="executions"] .execution-heading,
  body[data-page="rules"] #page-rules > .section-heading{ margin-bottom: 14px; }
  body[data-page="rules"] #page-rules > .automation-list-header{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  body[data-page="rules"] #page-rules > .automation-list-header [data-create-rule]{
    width: 100%;
    min-height: 46px;
  }

  .section-toolbar{ display: grid; gap: 10px; align-items: stretch; }
  .content-tabs{
    min-width: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 4px;
    padding: 4px;
    overflow: visible;
  }
  .content-tabs .segment{
    min-width: 0;
    min-height: 52px;
    padding: 8px 5px;
    line-height: 1.45;
    white-space: normal;
    font-size: 12px;
  }
  .auto-sync-note{ font-size: 11px; }
  .media-grid{ grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .media-card{ border-radius: 17px; }
  .media-body{ min-height: 158px; padding: 10px; gap: 8px; }
  .media-caption{ font-size: 12px; line-height: 1.7; -webkit-line-clamp: 3; }
  .media-actions{ gap: 6px; }
  .media-action-button{ min-height: 42px; padding: 8px 6px; font-size: 11px; }

  .rule-card{
    grid-template-columns: 52px minmax(0,1fr);
    gap: 12px;
    padding: 13px;
    border-radius: 16px;
  }
  .rule-thumb{ width: 52px; height: 52px; border-radius: 12px; }
  .rule-title-line strong{ font-size: 14px; }
  .rule-status-tag{ margin-inline-start: 0; }
  .keyword-line{ font-size: 11.5px; }
  .rule-actions{ gap: 7px; }
  .rule-actions > button{ min-height: 42px; padding-inline: 8px; }

  .rule-empty-state{ min-height: 300px; padding: 78px 20px 36px; }
  .rule-empty-state strong{ font-size: 22px; }
  .rule-empty-state span{ font-size: 14px; line-height: 2; }
  .empty-state-arrow{ top: 14px; left: 14px; width: 96px; height: 54px; }

  .mobile-editor-switch{ display: grid; }
  .rule-editor-layout[data-editor-view="builder"] .rule-preview-panel{ display: none; }
  .rule-editor-layout[data-editor-view="preview"] .rule-builder-sections{ display: none; }
  .rule-editor-layout[data-editor-view="preview"] .rule-preview-panel{ display: block; }
  .rule-editor-layout[data-editor-view="preview"] .instagram-preview{ min-height: min(560px,calc(100dvh - 250px)); }
  body[data-page="rule-editor"] .topbar{ display: none; }
  body[data-page="rule-editor"] .page-container{ padding-top: 0; }
  .rule-page-header{
    grid-template-columns: auto minmax(0,1fr);
    position: sticky;
    top: 0;
    z-index: 40;
    margin: 0 -14px;
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
    border-radius: 0 0 18px 18px;
  }
  .rule-page-header .section-description{ display: none; }
  .desktop-save-button{ display: none; }
  .mobile-rule-footer{
    display: grid;
    grid-template-columns: minmax(104px,.7fr) minmax(0,1.3fr);
    gap: 10px;
    position: fixed;
    inset: auto 0 0;
    z-index: 70;
    margin: 0;
    padding: 11px 14px calc(11px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: color-mix(in srgb,var(--bg) 94%,transparent);
    box-shadow: 0 -14px 34px rgba(0,0,0,.14);
    backdrop-filter: blur(18px);
  }
  .rule-page-form{ padding-bottom: 118px; }
  .builder-section{ padding: 16px; border-radius: 18px; }
  .flow-step-picker{ grid-template-columns: repeat(2,minmax(0,1fr)); }
  .flow-step-header{ grid-template-columns: minmax(0,1fr); }
  .flow-step-menu{ justify-content: flex-end; }
  .flow-media-step,.product-card-editor-layout{ grid-template-columns: minmax(0,1fr); }
  .product-card-visual{ position: static; }
  .button-builder-row{ grid-template-columns: minmax(0,1fr); }
  .cards-editor-heading{ align-items: stretch; flex-direction: column; }

  .preview-shell{ padding: 12px; border-radius: 20px; }
  .preview-sticky{ position: static; }
  .instagram-preview{ max-height: none; }

  .connect-hero{ min-height: 0; padding: 28px 18px; border-radius: 20px; }
  .connect-hero-copy h3{ font-size: 23px; }
  .connect-benefits{ display: grid; width: 100%; }
  .connect-benefits span{ width: 100%; }
  .oauth-mobile-note{ display: block; }
  .connected-account-features,.connected-account-meta,.friendly-connection-status{ grid-template-columns: 1fr; }
  .connected-account-actions{ display: grid; grid-template-columns: 1fr; }

  .account-settings-card{ padding: 17px; min-height: 0; }
  .settings-tabs{
    width: 100%;
    margin: 0;
    padding: 4px;
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 4px;
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-soft);
  }
  .settings-tabs button{
    min-width: 0;
    min-height: 50px;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3px;
    padding: 7px 4px;
    border: 0;
    border-radius: 12px;
    font-size: 11px;
    line-height: 1.35;
  }
  .settings-tabs button svg{ width: 19px; height: 19px; }
  .profile-meta-grid{ grid-template-columns: 1fr; }
  .session-card{ grid-template-columns: auto minmax(0,1fr); }
  .session-card > :last-child{ grid-column: 1 / -1; width: 100%; }

  .theme-toggle{
    left: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: 38px;
    height: 38px;
  }
  .connection-health-warning{ grid-template-columns: auto minmax(0,1fr); }
  .connection-health-warning button{ grid-column:1 / -1; width:100%; }
  body[data-page="accounts"] .connect-page-heading > div:first-child,
  body[data-page="account-settings"] .account-settings-shell > .section-heading{ display:none; }
}

@media (max-width: 680px){
  .stats-grid{ grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .stat-card{ min-height: 108px; padding: 13px; border-radius: 16px; }
  .stat-card .stat-value{ font-size: 27px; }
  .execution-summary{ grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .execution-card{ padding: 13px; }
  .form-grid,.compact-form-grid{ grid-template-columns: minmax(0,1fr); }
  .full-span{ grid-column: auto; }
  input,textarea,select{ font-size: 16px; }
  .flow-step-picker button{ min-height: 104px; padding: 12px; grid-template-columns: 34px minmax(0,1fr); align-content: center; }
  .flow-step-picker button svg{ width: 24px; height: 24px; align-self: start; margin-top: 2px; }
  .flow-step-picker button strong{ font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
  .flow-step-picker button small{ font-size: 11.5px; line-height: 1.55; overflow-wrap: anywhere; }
  .preview-chat-body{ padding: 12px; }
  .dm-bubble{ max-width: 88%; }
  .product-card-live-preview{ max-width: 100%; }
}

@media (max-width: 420px){
  .topbar{ padding-inline: 12px; }
  .page-container{ padding-inline: 11px; }
  .topbar h2{ font-size: 23px; }
  .topbar-account-status{ max-width: 100%; }
  .account-chip-name{ max-width: 58vw; }
  .panel-card{ padding: 15px; }
  .rule-actions{ grid-template-columns: repeat(3,minmax(0,1fr)); }
  .rule-actions > button{ font-size: 11px; }
  .content-tabs .segment{ font-size: 11px; }
  .media-grid{ gap: 9px; }
  .media-body{ min-height: 148px; padding: 9px; }
  .media-action-button{ min-height: 42px; font-size: 11.5px; gap: 5px; padding-inline: 8px; }
  .media-action-button svg{ width: 15px; height: 15px; }
  .flow-step-picker{ grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 8px; }
  .flow-step-picker button{ min-height: 104px; padding: 10px; column-gap: 8px; grid-template-columns: 30px minmax(0,1fr); grid-template-rows: auto auto; align-content: center; }
  .flow-step-picker button strong{ font-size: 12.5px; line-height: 1.45; max-height: 2.9em; overflow: hidden; }
  .flow-step-picker button small{ font-size: 10.5px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .flow-add-primary{ min-width: 0; width: min(100%,210px); padding-inline: 16px; }
  .settings-tabs button{ font-size: 10px; }
  .theme-toggle{ width: 36px; height: 36px; }
  .rule-page-header{ margin-inline: -11px; padding-inline: 11px; }
  .mobile-rule-footer{ padding-inline: 11px; }
}

@media (max-width: 350px){
  .media-grid{ grid-template-columns: minmax(0,1fr); }
  .stats-grid,.execution-summary{ grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce){
  .empty-state-arrow,.theme-toggle,.theme-scene,.loading-skeleton,.spinner,.sidebar,.sidebar-backdrop{ animation: none; transition: none; }
}

/* v2.3.1 stability and responsive component refinements */
body.drawer-open .theme-toggle,
body[data-page="rule-editor"] .theme-toggle{
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(.92);
}
.connection-health-warning{
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb,#f0ad4e 42%,var(--border));
  border-radius: 16px;
  background: color-mix(in srgb,#f0ad4e 10%,var(--panel-soft));
}
.connection-health-warning > svg{ color: #f0ad4e; }
.connection-health-warning > div{ min-width: 0; display: grid; gap: 3px; }
.connection-health-warning strong{ font-size: 13px; }
.connection-health-warning span{ color: var(--muted); font-size: 11.5px; line-height: 1.7; }
.connected-account-card.connection-warning{
  border-color: color-mix(in srgb,#f0ad4e 34%,var(--border));
  background: radial-gradient(circle at 100% 0%,rgba(240,173,78,.10),transparent 36%),var(--panel);
}
.status-warning{ color:#7b4d00; background:#ffe5b3; border-color:#f3bc58; }
.rule-page-header > div,
.automation-list-header > *,
.section-toolbar > *,
.connected-account-main > *{ min-width: 0; }
@media (max-width:380px){
  .media-grid{ grid-template-columns:minmax(0,1fr); }
  .media-body{ min-height:0; }
  .media-action-button{ font-size:12px; }
}

/* v2.3.1 — fluid responsive and mobile-first application system */

/* DirectBan 2.3.1 — unified brand and authentication experience */
:root{
  --accent:#5f75ff;
  --accent-strong:#7956ff;
  --brand-cyan:#21d4fd;
  --brand-indigo:#3147d8;
  --login-page-bg:#070b14;
  --login-grid:rgba(255,255,255,.028);
  --login-shell-bg:rgba(12,17,31,.82);
  --login-shell-border:rgba(255,255,255,.09);
  --login-form-bg:rgba(11,15,27,.92);
  --login-visual-bg:linear-gradient(150deg,rgba(47,55,153,.52),rgba(13,20,43,.72));
  --login-copy:#eef2ff;
  --login-copy-muted:#b4bdd2;
  --login-input-bg:rgba(255,255,255,.045);
  --login-tab-bg:rgba(255,255,255,.04);
  --login-chip-bg:rgba(255,255,255,.055);
  --login-chip-border:rgba(255,255,255,.08);
  --login-shadow:0 34px 100px rgba(0,0,0,.46);
}

:root[data-theme="light"]{
  --login-page-bg:#eef2fb;
  --login-grid:rgba(41,57,105,.055);
  --login-shell-bg:rgba(255,255,255,.84);
  --login-shell-border:rgba(65,76,119,.12);
  --login-form-bg:rgba(255,255,255,.96);
  --login-visual-bg:linear-gradient(150deg,#eef1ff,#e5f8ff 96%);
  --login-copy:#1d2440;
  --login-copy-muted:#606b86;
  --login-input-bg:#f6f8fc;
  --login-tab-bg:#eef1f8;
  --login-chip-bg:rgba(255,255,255,.72);
  --login-chip-border:rgba(73,89,143,.12);
  --login-shadow:0 30px 90px rgba(70,79,122,.17);
}

.brand-mark{
  overflow:hidden;
  padding:5px;
  background:linear-gradient(145deg,rgba(93,117,255,.18),rgba(33,212,253,.10));
  border:1px solid rgba(116,139,255,.24);
  box-shadow:0 14px 35px rgba(58,77,222,.20);
}
.brand-mark img{width:100%;height:100%;object-fit:contain;display:block}

.login-view{
  position:relative;
  isolation:isolate;
  min-height:100svh;
  display:grid;
  place-items:center;
  overflow:hidden;
  padding:clamp(18px,3vw,38px);
  background:
    radial-gradient(circle at 12% 10%,color-mix(in srgb,var(--accent) 24%,transparent),transparent 32%),
    radial-gradient(circle at 88% 88%,color-mix(in srgb,var(--brand-cyan) 15%,transparent),transparent 30%),
    var(--login-page-bg);
  transition:background .28s ease,color .28s ease;
}
.login-view::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:-3;
  background-image:linear-gradient(var(--login-grid) 1px,transparent 1px),linear-gradient(90deg,var(--login-grid) 1px,transparent 1px);
  background-size:42px 42px;
  mask-image:linear-gradient(to bottom,black,transparent 92%);
}
.login-orb{position:absolute;z-index:-2;border-radius:999px;filter:blur(10px);pointer-events:none;opacity:.72}
.login-orb-one{width:320px;height:320px;right:-120px;top:-100px;background:color-mix(in srgb,var(--accent) 24%,transparent)}
.login-orb-two{width:270px;height:270px;left:-90px;bottom:-90px;background:color-mix(in srgb,var(--brand-cyan) 15%,transparent)}
.login-shell{
  width:min(1060px,100%);
  min-height:min(620px,calc(100svh - 64px));
  display:grid;
  grid-template-columns:minmax(360px,.9fr) minmax(0,1.1fr);
  grid-template-areas:"visual form";
  direction:ltr;
  overflow:hidden;
  border:1px solid var(--login-shell-border);
  border-radius:30px;
  background:var(--login-shell-bg);
  box-shadow:var(--login-shadow);
  backdrop-filter:blur(24px);
  transition:background .28s ease,border-color .28s ease,box-shadow .28s ease;
}
.login-card{
  grid-area:form;
  direction:rtl;
  min-width:0;
  width:100%;
  display:grid;
  align-content:center;
  gap:20px;
  padding:clamp(32px,4.4vw,56px);
  background:var(--login-form-bg);
  color:var(--text);
  transition:background .28s ease,color .28s ease;
}
.login-card-header{display:grid;gap:22px}
.login-brand-lockup{display:flex;align-items:center;gap:13px;min-width:0}
.login-brand-lockup img{width:72px;height:72px;object-fit:contain;flex:none;filter:drop-shadow(0 13px 24px rgba(57,74,210,.22))}
.login-brand-lockup div{display:grid;gap:1px;direction:ltr;text-align:left}
.login-brand-lockup strong{font-family:Inter,"Segoe UI",Arial,sans-serif;font-size:27px;line-height:1;font-weight:800;letter-spacing:-.045em;color:var(--text)}
.login-brand-lockup span{direction:rtl;text-align:left;color:var(--muted);font-size:11px;font-weight:700}
.login-heading{display:grid;gap:8px}
.login-heading h1{font-size:clamp(28px,3vw,38px);line-height:1.3;letter-spacing:-.035em}
.login-heading .muted{font-size:13px;line-height:1.9;max-width:430px}
.login-card .auth-tabs{
  padding:5px;
  border:1px solid var(--login-shell-border);
  border-radius:14px;
  background:var(--login-tab-bg);
}
.login-card .auth-tab{min-height:39px;border-radius:10px;color:var(--muted)}
.login-card .auth-tab.active{color:var(--text);background:var(--panel);box-shadow:0 7px 20px rgba(22,28,58,.10)}
.login-card .stack-form{gap:15px}
.login-card .stack-form label{color:var(--text)}
.login-card input{
  min-height:49px;
  background:var(--login-input-bg);
  border-color:var(--login-shell-border);
}
.login-card input::placeholder{color:color-mix(in srgb,var(--muted) 72%,transparent)}
.login-submit{
  min-height:50px;
  margin-top:2px;
  color:#fff;
  background:linear-gradient(135deg,#586fff,#7652ea 66%,#26bfe8);
  box-shadow:0 15px 32px rgba(63,82,218,.24);
}
.login-submit:hover{box-shadow:0 19px 38px rgba(63,82,218,.32)}
.login-card-footer{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
  font-size:11px;
  line-height:1.7;
}
.login-security-dot{width:8px;height:8px;flex:none;border-radius:50%;background:var(--success);box-shadow:0 0 0 4px color-mix(in srgb,var(--success) 12%,transparent)}

.login-brand-panel{
  grid-area:visual;
  direction:rtl;
  position:relative;
  min-width:0;
  display:grid;
  grid-template-rows:minmax(300px,1fr) auto;
  align-items:center;
  gap:22px;
  overflow:hidden;
  padding:clamp(36px,5vw,62px);
  background:var(--login-visual-bg);
  color:var(--login-copy);
  transition:background .28s ease,color .28s ease;
}
.login-brand-panel::after{
  content:"";
  position:absolute;
  width:460px;
  height:460px;
  top:-210px;
  left:-150px;
  border:1px solid color-mix(in srgb,var(--accent) 19%,transparent);
  border-radius:50%;
  box-shadow:0 0 0 75px color-mix(in srgb,var(--accent) 5%,transparent),0 0 0 150px color-mix(in srgb,var(--accent) 3%,transparent);
}
.guardian-visual{position:relative;z-index:1;width:min(360px,88%);aspect-ratio:1;display:grid;place-items:center;margin-inline:auto}
.guardian-ring{position:absolute;border-radius:50%;border:1px solid color-mix(in srgb,var(--accent) 30%,transparent)}
.guardian-ring-one{inset:4%}
.guardian-ring-two{inset:17%;border-style:dashed;opacity:.75}
.guardian-ring-three{inset:30%;opacity:.58}
.guardian-mark-wrap{
  position:relative;
  width:54%;
  aspect-ratio:1;
  display:grid;
  place-items:center;
  border-radius:34%;
  background:color-mix(in srgb,var(--panel) 48%,transparent);
  box-shadow:0 22px 55px rgba(35,55,190,.26),inset 0 0 0 1px color-mix(in srgb,var(--accent) 22%,transparent);
  backdrop-filter:blur(16px);
}
.guardian-mark-wrap img{width:88%;height:88%;object-fit:contain;display:block;filter:drop-shadow(0 16px 28px rgba(34,54,190,.22))}
.guardian-signal{position:absolute;width:9px;height:9px;border-radius:50%;background:var(--brand-cyan);box-shadow:0 0 0 7px color-mix(in srgb,var(--brand-cyan) 11%,transparent),0 0 18px var(--brand-cyan)}
.signal-one{top:13%;right:26%}.signal-two{bottom:25%;left:11%;width:7px;height:7px;opacity:.82}.signal-three{top:40%;left:4%;width:5px;height:5px;opacity:.66}
.login-brand-copy{position:relative;z-index:2;display:grid;gap:13px;max-width:520px}
.login-status{width:max-content;max-width:100%;display:inline-flex;align-items:center;gap:9px;padding:8px 12px;border:1px solid color-mix(in srgb,var(--success) 24%,transparent);border-radius:999px;background:color-mix(in srgb,var(--success) 8%,transparent);color:var(--success);font-size:11px;font-weight:800}
.login-status i{width:8px;height:8px;border-radius:50%;background:var(--success);box-shadow:0 0 0 5px color-mix(in srgb,var(--success) 10%,transparent),0 0 15px color-mix(in srgb,var(--success) 72%,transparent)}
.login-brand-copy h2{font-size:clamp(28px,3.2vw,43px);line-height:1.4;letter-spacing:-.04em}
.login-brand-copy p{color:var(--login-copy-muted);font-size:14px;line-height:2}
.login-feature-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:2px}
.login-feature-row span{padding:8px 11px;border:1px solid var(--login-chip-border);border-radius:10px;background:var(--login-chip-bg);color:var(--login-copy);font-size:10.5px;font-weight:700}

body.auth-screen .theme-toggle{
  top:calc(16px + env(safe-area-inset-top));
  bottom:auto;
  left:16px;
  z-index:100;
  border-color:var(--login-shell-border);
  box-shadow:0 12px 30px rgba(18,25,57,.18);
}

@media (max-width:860px){
  .login-view{overflow:auto;padding:20px}
  .login-shell{width:min(540px,100%);min-height:0;grid-template-columns:1fr;grid-template-areas:"form"}
  .login-brand-panel{display:none}
  .login-card{padding:clamp(30px,7vw,46px)}
}
@media (max-width:480px){
  .login-view{display:block;padding:0;background:var(--login-form-bg)}
  .login-view::before,.login-orb{display:none}
  .login-shell{width:100%;min-height:100svh;border:0;border-radius:0;box-shadow:none;background:var(--login-form-bg)}
  .login-card{min-height:100svh;padding:72px 22px 30px;align-content:center;gap:18px}
  .login-card-header{gap:20px}
  .login-brand-lockup img{width:66px;height:66px}
  .login-brand-lockup strong{font-size:25px}
  .login-heading h1{font-size:27px}
  .login-heading .muted{font-size:12px}
  .login-card .auth-tab{font-size:12px}
  body.auth-screen .theme-toggle{top:14px;left:14px}
}
