.auth-gate {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 680px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 56px clamp(22px, 6vw, 92px);
  background:
    radial-gradient(circle at 16% 16%, rgba(20,99,255,.36), transparent 28%),
    radial-gradient(circle at 86% 22%, rgba(10,164,246,.22), transparent 32%),
    radial-gradient(circle at 78% 86%, rgba(255,255,255,.12), transparent 30%),
    linear-gradient(135deg,#061630 0%,#071b3b 46%,#0b3475 100%);
}

.auth-gate::before,
.auth-gate::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.auth-gate::before {
  inset: 0;
  opacity: .32;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(90deg, rgba(0,0,0,.9), transparent 72%);
}

.auth-gate::after {
  right: -160px;
  top: -160px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(17,181,229,.16);
  filter: blur(12px);
}

.workspace-setup {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 18% 18%, rgba(20,99,255,.16), transparent 30%),
    radial-gradient(circle at 82% 28%, rgba(22,138,72,.12), transparent 32%),
    linear-gradient(135deg,#f8fbff,#edf4ff 58%,#f9fbff);
}

.workspace-setup-card {
  width: min(100%, 640px);
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid rgba(221,229,241,.95);
  border-radius: 28px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 28px 80px rgba(11,31,68,.14);
  backdrop-filter: blur(14px);
}

.workspace-setup h1 {
  color: var(--navy);
  font-size: clamp(36px, 5vw, 58px);
  line-height: .98;
  letter-spacing: -.06em;
  margin: 18px 0;
}

.workspace-setup p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
}

.workspace-setup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 28px;
}

.workspace-setup-form label {
  color: #52647d;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.workspace-setup-form input {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}

.workspace-setup-note {
  margin-top: 14px !important;
  font-size: 11px !important;
}

#workspace-setup-signout {
  margin-top: 18px;
  padding-left: 0;
}

.auth-gate-card {
  position: relative;
  z-index: 3;
  max-width: 620px;
  padding: clamp(34px, 4vw, 52px) clamp(28px, 4vw, 46px) clamp(28px, 4vw, 46px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 32px;
  background: linear-gradient(145deg,rgba(255,255,255,.12),rgba(255,255,255,.055));
  box-shadow: 0 32px 90px rgba(0,0,0,.24);
  backdrop-filter: blur(16px);
}

.auth-gate-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  margin-bottom: 34px;
}

.auth-gate-brand .brand-mark {
  color: #fff;
}

.auth-gate-brand strong,
.auth-gate-brand small {
  display: block;
}

.auth-gate-brand strong {
  font-size: 22px;
  line-height: 1;
  letter-spacing: -.04em;
}

.auth-gate-brand small {
  color: #6f83a0;
  font-size: 11px;
  margin-top: 3px;
}

.auth-gate-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.1);
  color: #bcd7ff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-gate-card > .auth-gate-pill {
  position: absolute;
  top: 22px;
  right: 22px;
  border-color: rgba(255,255,255,.92);
  background: #fff;
  color: #071b3b;
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
}

.auth-gate h1 {
  max-width: 580px;
  color: #fff;
  font-size: clamp(42px, 6vw, 72px);
  line-height: .95;
  letter-spacing: -.07em;
  margin: 18px 0;
}

.auth-gate h1 span {
  display: inline-block;
  background: linear-gradient(135deg,#2d7dff,#11b5e5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-gate p {
  max-width: 555px;
  color: #c3d4f0;
  font-size: 16px;
  line-height: 1.7;
  margin: 0;
}

.auth-gate-seo-summary {
  display: grid;
  gap: 18px;
  margin-top: 36px;
}

.auth-gate-seo-summary article {
  position: relative;
  display: grid;
  gap: 7px;
  padding: 0 0 0 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.auth-gate-seo-summary article::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  color: #1463ff;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(0,0,0,.14);
}

.auth-gate-seo-summary strong,
.auth-gate-seo-summary span {
  display: block;
}

.auth-gate-seo-summary strong {
  color: #fff;
  font-size: 13px;
  line-height: 1.28;
}

.auth-gate-seo-summary span {
  color: #bdd0ee;
  font-size: 11.5px;
  line-height: 1.62;
}

.auth-gate-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
}

#auth-gate-status {
  color: #abc2e6;
  font-size: 12px;
  font-weight: 800;
}

.auth-gate-preview-cta {
  border-color: rgba(255,255,255,.2);
  background: rgba(255,255,255,.1);
  color: #fff;
}

.auth-gate-preview-cta:hover,
.auth-gate-preview-cta:focus {
  border-color: rgba(119,170,255,.62);
  background: rgba(255,255,255,.13);
}

#owner-alert-preview-toggle-mobile {
  display: none;
}

.owner-alert-preview-popup.hidden {
  display: none;
}

.owner-alert-preview-popup {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: transparent;
  pointer-events: auto;
}

.owner-alert-preview-form {
  position: absolute;
  left: min(var(--popover-x, 64vw), calc(100% - min(360px, calc(100vw - 32px)) - 16px));
  top: min(var(--popover-y, 120px), calc(100% - 310px));
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid rgba(221,229,241,.95);
  border-radius: 20px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 22px 60px rgba(7,27,59,.22);
  transform: translateY(12px);
  backdrop-filter: blur(12px);
}

.owner-alert-preview-form::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 28px;
  width: 16px;
  height: 16px;
  border-left: 1px solid rgba(221,229,241,.95);
  border-top: 1px solid rgba(221,229,241,.95);
  background: rgba(255,255,255,.96);
  transform: rotate(45deg);
}

.owner-alert-preview-form h2 {
  margin: 0;
  color: #071b3b;
  font-size: 17px;
  line-height: 1.18;
  letter-spacing: -.035em;
}

.owner-alert-preview-form p {
  max-width: 100%;
  margin-top: 5px;
  color: #607089;
  font-size: 11px;
  line-height: 1.5;
}

.owner-alert-preview-form input[type="email"] {
  width: 100%;
  min-height: 42px;
  padding: 11px 13px;
  border: 1px solid #dbe5f3;
  border-radius: 14px;
  background: #fff;
  color: #071b3b;
  font-size: 12px;
  outline: none;
}

.owner-alert-preview-form input[type="email"]:focus {
  border-color: #77aaff;
  box-shadow: 0 0 0 4px rgba(119,170,255,.2);
}

.owner-alert-preview-consent {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: #607089;
  font-size: 10px;
  line-height: 1.45;
}

.owner-alert-preview-consent input {
  width: 14px;
  height: 14px;
  margin: 1px 0 0;
  accent-color: #1463ff;
}

.owner-alert-preview-form button {
  min-height: 40px;
  white-space: nowrap;
}

.owner-alert-preview-form #owner-alert-preview-status {
  color: #14763f;
  font-size: 11px;
  font-weight: 800;
}

.owner-alert-preview-form #owner-alert-preview-status.error {
  color: #b42318;
}

.owner-alert-preview-honey {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.owner-alert-preview-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
  min-height: 34px !important;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  background: #f3f7ff;
  color: #607089;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.owner-alert-preview-close:hover,
.owner-alert-preview-close:focus {
  outline: none;
  background: #eaf2ff;
  color: #1463ff;
}

.auth-gate-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-height: 100%;
  pointer-events: none;
}

.preview-window {
  display: contents;
}

.preview-bar {
  display: none;
}

.preview-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
}

.preview-workflow-head {
  position: absolute;
  left: min(52vw, calc(100% - 640px));
  right: clamp(22px, 6vw, 92px);
  top: 64px;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  width: auto;
  min-width: min(520px, 42vw);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: auto;
}

.preview-workflow-head small,
.preview-workflow-head strong,
.preview-workflow-head span {
  display: block;
}

.preview-workflow-head small {
  color: #77aaff;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.preview-workflow-head strong {
  color: #fff;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.04;
  letter-spacing: -.04em;
  margin-top: 6px;
}

.preview-workflow-head span {
  color: #bff5d0;
  font-size: 11px;
  font-weight: 900;
  margin-top: 8px;
}

.preview-workflow-head .auth-gate-preview-cta {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 11px 16px;
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
}

.preview-workflow-head,
.preview-flow-card {
  transition: opacity .22s ease, transform .22s ease, border-color .14s ease, box-shadow .14s ease;
}

.preview-flow-lines {
  transition: opacity .16s ease, transform .16s ease;
}

.auth-gate-preview.switching-workflow-lines .preview-flow-lines {
  opacity: 0;
  transform: translateY(4px);
}

.auth-gate-preview.switching-workflow .preview-workflow-head,
.auth-gate-preview.switching-workflow .preview-flow-card {
  opacity: 0;
  transform: translateY(8px);
}

.preview-workflow-nav,
.preview-workflow-next {
  position: absolute;
  top: 50%;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(221,229,241,.9);
  border-radius: 50%;
  background: rgba(255,255,255,.96);
  color: #1463ff;
  box-shadow: 0 18px 46px rgba(7,27,59,.18);
  backdrop-filter: blur(12px);
  cursor: pointer;
  pointer-events: auto;
  transform: translateY(-50%);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.preview-workflow-prev {
  left: calc(min(620px, calc(100vw - 48px)) + clamp(22px, 6vw, 92px) + 18px);
}

.preview-workflow-next {
  right: clamp(18px, 3vw, 44px);
}

.preview-workflow-nav::before,
.preview-workflow-next::before {
  position: absolute;
  top: 50%;
  width: max-content;
  max-width: 180px;
  padding: 8px 10px;
  border: 1px solid rgba(221,229,241,.95);
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  color: #071b3b;
  font-size: 11px;
  font-weight: 850;
  box-shadow: 0 14px 34px rgba(7,27,59,.16);
  opacity: 0;
  pointer-events: none;
  transform: translate(6px,-50%);
  transition: opacity .14s ease, transform .14s ease;
}

.preview-workflow-prev::before {
  content: "Previous workflow";
  left: calc(100% + 10px);
  transform: translate(-6px,-50%);
}

.preview-workflow-next::before {
  content: "Next workflow";
  right: calc(100% + 10px);
  transform: translate(6px,-50%);
}

.preview-workflow-nav.tooltip-muted::before,
.preview-workflow-next.tooltip-muted::before {
  opacity: 0 !important;
}

.preview-workflow-nav strong,
.preview-workflow-next strong {
  font-size: 20px;
  line-height: 1;
}

.preview-workflow-nav:hover,
.preview-workflow-nav:focus,
.preview-workflow-next:hover,
.preview-workflow-next:focus {
  outline: none;
  border-color: rgba(119,170,255,.72);
  box-shadow: 0 20px 52px rgba(20,99,255,.22);
}

.preview-workflow-prev:hover,
.preview-workflow-prev:focus {
  transform: translateY(-50%) translateX(2px);
}

.preview-workflow-next:hover,
.preview-workflow-next:focus {
  transform: translateY(-50%) translateX(-2px);
}

.preview-workflow-prev:hover::before,
.preview-workflow-prev:focus::before,
.preview-workflow-next:hover::before,
.preview-workflow-next:focus::before {
  opacity: 1;
  transform: translate(0,-50%);
}

.preview-flow-canvas {
  position: absolute;
  inset: 0;
  min-height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px),
    radial-gradient(circle at 72% 44%,rgba(20,99,255,.2),transparent 34%),
    transparent;
  background-size: 42px 42px, 42px 42px, auto, auto;
  pointer-events: auto;
}

.preview-flow-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.preview-flow-canvas:not(.layout-ready) .preview-flow-lines,
.preview-flow-canvas:not(.layout-ready) .preview-flow-card {
  opacity: 0;
}

.preview-flow-lines path {
  fill: none;
  stroke: rgba(145,190,255,.5);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 7 8;
  pointer-events: stroke;
  cursor: context-menu;
  transition: stroke .14s ease, stroke-width .14s ease, opacity .14s ease;
}

.preview-flow-lines path:hover {
  stroke: rgba(17,181,229,.95);
  stroke-width: 3.2;
}

.preview-flow-lines path.flowing {
  stroke: rgba(37,222,122,.95);
  stroke-width: 3;
  stroke-dasharray: 9 7;
  animation: previewDataFlow .62s linear infinite;
  filter: drop-shadow(0 0 8px rgba(37,222,122,.28));
}

@keyframes previewDataFlow {
  to { stroke-dashoffset: -32; }
}

.preview-flow-card {
  position: absolute;
  left: calc(var(--x) * 1px);
  top: calc(var(--y) * 1px);
  display: grid;
  gap: 4px;
  width: 178px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: linear-gradient(145deg,rgba(255,255,255,.2),rgba(255,255,255,.075));
  box-shadow: 0 22px 58px rgba(0,0,0,.22);
  backdrop-filter: blur(14px);
  cursor: grab;
  user-select: none;
  touch-action: none;
  opacity: 1;
  transition: opacity .18s ease, border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.preview-flow-card:hover,
.preview-flow-card.dragging {
  border-color: rgba(119,170,255,.65);
  box-shadow: 0 22px 56px rgba(20,99,255,.22);
}

.preview-flow-card.spotlight {
  border-color: rgba(119,170,255,.65);
  box-shadow: 0 22px 56px rgba(20,99,255,.22);
}

.preview-flow-card.dragging {
  cursor: grabbing;
  transform: scale(1.02);
}

.preview-flow-card::before {
  content: "";
  position: absolute;
  right: 12px;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #77aaff;
  box-shadow: 0 0 0 5px rgba(119,170,255,.12);
}

.preview-flow-card.trigger::before { background: #77aaff; }
.preview-flow-card.intelligence::before { background: #25de7a; box-shadow: 0 0 0 5px rgba(37,222,122,.12); }
.preview-flow-card.condition::before { background: #ffc857; box-shadow: 0 0 0 5px rgba(255,200,87,.13); }
.preview-flow-card.action::before { background: #11b5e5; box-shadow: 0 0 0 5px rgba(17,181,229,.13); }
.preview-flow-card.end::before { background: #bcd2f6; box-shadow: 0 0 0 5px rgba(188,210,246,.13); }

.preview-flow-card small {
  color: #bcd2f6;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.preview-flow-card strong {
  max-width: 135px;
  color: #fff;
  font-size: 13px;
  line-height: 1.22;
}

.preview-flow-card span {
  color: #c7d8f3;
  font-size: 10px;
  line-height: 1.35;
}

.preview-step-popover {
  position: absolute;
  z-index: 4;
  display: grid;
  width: max-content;
  max-width: min(260px, calc(100vw - 40px));
  padding: 10px 12px;
  border: 1px solid rgba(221,229,241,.95);
  border-radius: 16px;
  background: rgba(255,255,255,.96);
  color: #071b3b;
  box-shadow: 0 18px 44px rgba(7,27,59,.2);
  pointer-events: none;
  backdrop-filter: blur(12px);
}

.preview-step-popover.entering {
  animation: previewStepIn .18s ease both;
}

.preview-step-popover::before {
  content: "";
  position: absolute;
  left: 26px;
  top: -7px;
  width: 14px;
  height: 14px;
  border-left: 1px solid rgba(221,229,241,.95);
  border-top: 1px solid rgba(221,229,241,.95);
  background: rgba(255,255,255,.96);
  transform: rotate(45deg);
}

.preview-step-popover strong {
  color: #071b3b;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: 0;
}

@keyframes previewStepIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.preview-flow-menu {
  position: fixed;
  z-index: 4000;
  display: grid;
  gap: 4px;
  width: 210px;
  padding: 7px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(8,31,72,.96);
  box-shadow: 0 22px 60px rgba(0,0,0,.32);
  backdrop-filter: blur(14px);
}

.preview-flow-menu button {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #e6f0ff;
  text-align: left;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.preview-flow-menu button:hover,
.preview-flow-menu button:focus {
  outline: none;
  background: rgba(255,255,255,.1);
}

.preview-metric-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.preview-metric-row div,
.preview-pipeline {
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  background: rgba(255,255,255,.1);
}

.preview-metric-row div {
  padding: 18px;
}

.preview-metric-row small,
.preview-metric-row strong {
  display: block;
}

.preview-metric-row small {
  color: #bcd2f6;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.preview-metric-row strong {
  color: #fff;
  font-size: 38px;
  letter-spacing: -.05em;
  margin-top: 7px;
}

.preview-pipeline {
  padding: 18px;
}

.preview-pipeline span {
  display: block;
  height: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.13);
  margin: 12px 0;
}

.preview-pipeline span:nth-child(1) { width: 92%; background: rgba(188,215,255,.36); }
.preview-pipeline span:nth-child(2) { width: 76%; }
.preview-pipeline span:nth-child(3) { width: 84%; background: rgba(37,222,122,.28); }
.preview-pipeline span:nth-child(4) { width: 62%; }

.auth-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #315178;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.auth-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  background: currentColor;
}

.auth-status.online {
  background: #e7f7ed;
  color: #14763f;
}

.auth-status.syncing {
  background: #eef4ff;
  color: #315178;
}

.auth-status.local {
  background: #fff4df;
  color: #8a5600;
}

.auth-status.warning {
  background: #fff4df;
  color: #8a5600;
}

.auth-status.offline {
  background: #f0f3f8;
  color: #6d7d92;
}

.auth-status.error {
  background: #ffe9e9;
  color: #a13232;
}

.global-search {
  position: relative;
  min-width: 280px;
  width: min(34vw, 430px);
}

.global-search label {
  display: block;
}

.global-search label span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

.global-search input {
  width: 100%;
  padding: 11px 14px 11px 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(11,31,68,.05);
  font-size: 12px;
}

.global-search::before {
  content: "⌕";
  position: absolute;
  left: 14px;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  color: #7a8ba3;
  font-size: 13px;
  font-weight: 900;
  pointer-events: none;
}

.global-search input:focus {
  outline: none;
  border-color: #bfd0e8;
  box-shadow: 0 0 0 4px rgba(20,99,255,.08), 0 12px 26px rgba(11,31,68,.08);
}

.global-search-panel {
  position: absolute;
  top: calc(100% + 9px);
  left: 0;
  right: 0;
  z-index: 70;
  max-height: 430px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(11,31,68,.2);
}

.global-search-result {
  position: relative;
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 11px 78px 11px 12px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.global-search-result:hover,
.global-search-result:focus {
  outline: none;
  background: #f6f9ff;
}

.global-search-result span,
.global-search-result small,
.global-search-result strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-result span {
  color: #7a8ba3;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.global-search-result strong {
  color: var(--navy);
  font-size: 12px;
}

.global-search-result small {
  color: var(--muted);
  font-size: 10px;
}

.global-search-result em {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 7px;
  border-radius: 999px;
  background: #f0f3f8;
  color: #6d7d92;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.global-search-empty {
  padding: 18px;
  text-align: center;
}

.global-search-empty strong,
.global-search-empty small {
  display: block;
}

.global-search-empty strong {
  color: var(--navy);
  font-size: 12px;
}

.global-search-empty small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 1180px) {
  .global-search {
    width: min(38vw, 330px);
    min-width: 220px;
  }
}

@media (max-width: 860px) {
  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .global-search {
    order: 3;
    width: 100%;
    min-width: 100%;
  }
}

.account-menu {
  position: relative;
}

.account-menu-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 340px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 24px rgba(11,31,68,.06);
  cursor: pointer;
}

.account-menu-button:hover,
.account-menu-button[aria-expanded="true"] {
  border-color: #bfd0e8;
  background: #fff;
}

.account-copy {
  display: block;
  min-width: 0;
}

.account-copy strong,
.account-copy small {
  display: block;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  color: var(--navy);
  font-size: 11px;
}

.account-copy small {
  color: var(--muted);
  font-size: 9px;
  margin-top: 2px;
}

.account-menu-chevron {
  margin-left: auto;
  color: #7a8ba3;
  font-size: 14px;
  transition: transform .18s ease;
}

.account-menu-button[aria-expanded="true"] .account-menu-chevron {
  transform: rotate(180deg);
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: 300px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 55px rgba(11,31,68,.18);
}

.account-menu-heading {
  padding: 2px 2px 12px;
  border-bottom: 1px solid #edf1f6;
  margin-bottom: 12px;
}

.account-menu-heading strong,
.account-menu-heading small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-heading strong {
  color: var(--navy);
  font-size: 12px;
}

.account-menu-heading small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}

.role-permission-note {
  color: #60718a;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.45;
  margin: -4px 2px 12px;
}

.account-menu-link {
  width: 100%;
  margin: 0 0 12px;
  padding: 10px 11px;
  border: 1px solid #edf1f6;
  border-radius: 12px;
  background: #f8fbff;
  color: var(--navy);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  text-align: left;
}

.account-menu-link:hover {
  border-color: #bfd0e8;
  background: #eef4ff;
}

.account-profile-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #edf1f6;
  border-radius: 14px;
  background: #f8fbff;
  margin-bottom: 12px;
}

.account-profile-heading strong,
.account-profile-heading small,
.account-profile-grid span {
  display: block;
}

.account-profile-heading strong {
  color: var(--navy);
  font-size: 11px;
}

.account-profile-heading small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

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

.account-profile-grid span {
  margin-bottom: 4px;
  color: #52647d;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.account-profile-grid input {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
}

.account-profile-form .button {
  justify-self: start;
  padding: 8px 12px;
  font-size: 10px;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0,.85fr) minmax(320px,1fr);
  gap: 18px;
  align-items: start;
}

.profile-layout h4 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 15px;
}

.profile-layout p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.profile-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #edf1f6;
  border-radius: 15px;
  background: #fff;
}

.profile-preview-card strong,
.profile-preview-card small {
  display: block;
}

.profile-preview-card strong {
  color: var(--navy);
  font-size: 13px;
}

.profile-preview-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.role-disabled {
  cursor: not-allowed !important;
}

.sync-health-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -14px 0 22px;
  padding: 13px 15px;
  border: 1px solid #ffd99a;
  border-radius: 16px;
  background: #fffaf1;
  color: #855100;
  box-shadow: 0 10px 26px rgba(183, 107, 0, .08);
}

.sync-progress-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, .28fr);
  align-items: center;
  gap: 14px;
  margin: -14px 0 22px;
  padding: 13px 15px;
  border: 1px solid #cfe0ff;
  border-radius: 16px;
  background: linear-gradient(180deg, #f6f9ff, #fff);
  color: #315178;
  box-shadow: 0 10px 26px rgba(20, 99, 255, .08);
}

.sync-progress-copy {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.sync-progress-copy strong,
.sync-progress-copy small {
  display: block;
}

.sync-progress-copy strong {
  color: var(--navy);
  font-size: 12px;
}

.sync-progress-copy small {
  margin-top: 3px;
  color: #52647d;
  font-size: 11px;
  line-height: 1.45;
}

.sync-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 3px solid #dbe8ff;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: sync-spin .8s linear infinite;
}

.sync-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eefb;
}

.sync-progress-track span {
  display: block;
  width: var(--sync-progress, 8%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width .2s ease;
}

@keyframes sync-spin {
  to { transform: rotate(360deg); }
}

.sync-health-banner strong,
.sync-health-banner span {
  display: block;
}

.sync-health-banner strong {
  color: #7a4900;
  font-size: 12px;
}

.sync-health-banner span {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.45;
}

.sync-health-banner.offline {
  border-color: #f2b8b8;
  background: #fff1f1;
  color: #8f2424;
  box-shadow: 0 10px 26px rgba(198, 49, 49, .1);
}

.sync-health-banner.offline strong {
  color: #9e2929;
}

.sync-health-banner.offline .button.secondary {
  border-color: #efb2b2;
  background: #fff;
  color: #9e2929;
}

button.role-disabled,
input.role-disabled,
select.role-disabled,
textarea.role-disabled {
  opacity: .52;
}

.auth-action {
  white-space: nowrap;
}

.workspace-switcher {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 100%;
}

.workspace-switcher span {
  color: #7a8ba3;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.workspace-switcher select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 850;
}

.account-menu-panel .auth-status {
  display: flex;
  margin: 12px 0 2px;
  white-space: normal;
}

.account-signout {
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7f9fc;
  color: #a13232;
  text-align: left;
}

.account-signout:hover {
  background: #ffe9e9;
}

.notification-menu {
  position: relative;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 28;
  width: 360px;
  max-height: min(560px, calc(100vh - 120px));
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 55px rgba(11,31,68,.18);
}

.notification-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 12px;
  border-bottom: 1px solid #edf1f6;
  margin-bottom: 8px;
}

.notification-heading strong,
.notification-heading small {
  display: block;
}

.notification-heading strong {
  color: var(--navy);
  font-size: 13px;
}

.notification-heading small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}

.notification-heading .text-button:disabled {
  color: #9aa7b8;
  cursor: not-allowed;
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notification-item {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.notification-item:hover,
.notification-item.unread {
  border-color: #dce8f8;
  background: #f7faff;
}

.notification-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: #eef4ff;
  color: #315178;
  font-size: 12px;
  font-weight: 900;
}

.notification-icon.success {
  background: #e7f7ed;
  color: #14763f;
}

.notification-icon.warning {
  background: #fff4df;
  color: #9b5c00;
}

.notification-item strong,
.notification-item small,
.notification-item em {
  display: block;
  min-width: 0;
}

.notification-item strong {
  color: var(--navy);
  font-size: 11px;
  line-height: 1.35;
}

.notification-item small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  margin-top: 2px;
}

.notification-item em {
  color: #9aa7b8;
  font-size: 9px;
  font-style: normal;
  margin-top: 5px;
}

.notification-empty {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #8a99ae;
}

.notification-empty span {
  font-size: 26px;
  color: #a9b8ca;
}

.notification-empty p {
  color: var(--navy);
  font-size: 12px;
  font-weight: 850;
  margin: 8px 0 4px;
}

.notification-empty small {
  max-width: 230px;
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 850px) {
  .auth-gate {
    grid-template-columns: 1fr;
  }

  .auth-gate-preview {
    display: none;
  }

  #owner-alert-preview-toggle-mobile {
    display: inline-flex;
  }

  .owner-alert-preview-popup {
    padding: 0;
  }

  .owner-alert-preview-form {
    left: 16px;
    right: 16px;
    top: min(var(--popover-y, 160px), calc(100% - 310px));
    width: auto;
  }

  .auth-status {
    display: none;
  }

  .account-copy strong,
  .account-copy small {
    max-width: 135px;
  }

  .workspace-switcher {
    min-width: 140px;
  }

  .owner-alert-preview-form {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 851px) and (max-width: 1220px) {
  .preview-workflow-prev {
    left: calc(clamp(22px, 6vw, 92px) + min(620px, 44vw) + 16px);
  }
}

@media (max-width: 680px) {
  .sync-progress-banner {
    grid-template-columns: 1fr;
  }

  .account-copy {
    display: none;
  }

  .account-menu-button {
    min-width: 0;
    padding-right: 6px;
  }

  .account-menu-panel {
    right: -52px;
    width: min(300px, calc(100vw - 32px));
  }

  .notification-panel {
    right: -6px;
    width: min(360px, calc(100vw - 32px));
  }

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