/* ==========================================================================
   RANKHOUSE Module Studio v10.6.0
   A consistent high-end editor experience for module pages.
   ========================================================================== */
body.rh-module-studio .rh-module-studio-main {
  --studio-surface: rgba(19, 19, 27, .94);
  --studio-surface-soft: rgba(25, 25, 35, .86);
  --studio-border: rgba(255,255,255,.085);
  --studio-muted: #9898aa;
  padding-bottom: 110px;
}
body.rh-module-studio .rh-studio-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 24px;
  align-items: center;
  margin: 0 0 18px;
  border: 1px solid rgba(var(--rh-accent-rgb), .18);
  border-radius: 22px;
  padding: 22px 24px;
  background:
    radial-gradient(circle at 87% 0%, rgba(var(--rh-accent-rgb), .15), transparent 26rem),
    linear-gradient(135deg, rgba(22,22,31,.97), rgba(10,10,15,.97));
  box-shadow: inset 0 1px rgba(255,255,255,.04), 0 22px 55px rgba(0,0,0,.23);
  overflow: hidden;
}
body.rh-module-studio .rh-studio-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--rh-accent-bright), rgba(var(--rh-accent-rgb), .14) 42%, transparent 85%);
}
body.rh-module-studio .rh-studio-header-copy {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0,1fr);
  column-gap: 16px;
  align-items: center;
  min-width: 0;
}
body.rh-module-studio .rh-studio-header-copy > :not(.rh-studio-module-mark) { grid-column: 2; }
body.rh-module-studio .rh-studio-module-mark {
  grid-column: 1;
  grid-row: 1 / span 6;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--rh-accent-rgb), .32);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(var(--rh-accent-rgb), .24), rgba(var(--rh-accent-rgb), .045));
  color: #fff;
  font-size: 22px;
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 0 30px rgba(var(--rh-accent-rgb), .12);
}
body.rh-module-studio .rh-studio-header h1 { margin: 3px 0 5px; font-size: clamp(24px, 2.1vw, 36px); letter-spacing: -.025em; }
body.rh-module-studio .rh-studio-header p:not(.eyebrow) { max-width: 850px; margin: 0; color: var(--studio-muted); line-height: 1.55; }
body.rh-module-studio .rh-studio-header .topbar-actions { align-self: center; justify-content: flex-end; }
body.rh-module-studio .rh-studio-module-state {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 11px;
  padding: 0 11px;
  background: rgba(255,255,255,.025);
  color: #a9a9b8;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
body.rh-module-studio .rh-studio-module-state i { width: 7px; height: 7px; border-radius: 50%; background: #666674; }
body.rh-module-studio .rh-studio-module-state.is-online { color: #dff9e8; border-color: rgba(49,209,119,.22); background: rgba(49,209,119,.07); }
body.rh-module-studio .rh-studio-module-state.is-online i { background: #31d177; box-shadow: 0 0 11px rgba(49,209,119,.7); }
body.rh-module-studio .rh-page-nav {
  margin: 0 0 18px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 15px;
  padding: 6px;
  background: rgba(10,10,15,.78);
  box-shadow: inset 0 1px rgba(255,255,255,.025);
}
body.rh-module-studio .rh-page-nav-label { padding-left: 8px; }
body.rh-module-studio .rh-page-nav a { min-height: 36px; border-radius: 10px; }
body.rh-module-studio .panel {
  border-color: var(--studio-border);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--studio-surface), rgba(13,13,19,.95));
  box-shadow: inset 0 1px rgba(255,255,255,.025), 0 18px 42px rgba(0,0,0,.16);
}
body.rh-module-studio .panel > .panel-header {
  min-height: 70px;
  margin: -2px -2px 18px;
  border-bottom: 1px solid rgba(255,255,255,.065);
  padding: 17px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.018), transparent);
}
body.rh-module-studio .panel > .panel-header h2 { font-size: 17px; }
body.rh-module-studio .panel > .panel-header p { margin-top: 5px; color: #858597; line-height: 1.5; }
body.rh-module-studio .field > span,
body.rh-module-studio label.field > span { color: #aaaabb; font-size: 9px; font-weight: 850; letter-spacing: .03em; }
body.rh-module-studio input:not([type="checkbox"]):not([type="radio"]),
body.rh-module-studio select,
body.rh-module-studio textarea {
  border-color: rgba(255,255,255,.075);
  border-radius: 11px;
  background: rgba(7,7,12,.72);
  box-shadow: inset 0 1px rgba(255,255,255,.022);
}
body.rh-module-studio input:not([type="checkbox"]):not([type="radio"]):focus,
body.rh-module-studio select:focus,
body.rh-module-studio textarea:focus {
  border-color: rgba(var(--rh-accent-rgb), .42);
  box-shadow: 0 0 0 4px rgba(var(--rh-accent-rgb), .08), inset 0 1px rgba(255,255,255,.03);
}
body.rh-module-studio .module-toggle {
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 13px;
  padding: 12px 13px;
  background: rgba(255,255,255,.018);
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
body.rh-module-studio .module-toggle:hover { border-color: rgba(var(--rh-accent-rgb), .2); background: rgba(var(--rh-accent-rgb), .045); transform: translateY(-1px); }
body.rh-module-studio .form-actions,
body.rh-module-studio .module-action-row {
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 15px;
}
.rh-studio-launchpad { padding: 20px !important; }
.rh-studio-section-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:18px; }
.rh-studio-section-heading h2 { margin:5px 0 5px; font-size:21px; }
.rh-studio-section-heading p { margin:0; color:#8d8d9d; }
.rh-studio-kicker { color:var(--rh-accent-bright); font-size:9px; font-weight:900; letter-spacing:.14em; text-transform:uppercase; }
.rh-template-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.rh-template-grid-5 { grid-template-columns:repeat(5,minmax(0,1fr)); }
.rh-template-card {
  position:relative;
  min-height:150px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:8px;
  border:1px solid rgba(255,255,255,.075);
  border-radius:15px;
  padding:16px;
  background:linear-gradient(145deg,rgba(27,27,38,.9),rgba(13,13,19,.94));
  color:#fff;
  text-align:left;
  cursor:pointer;
  transition:transform .18s ease,border-color .18s ease,background .18s ease,box-shadow .18s ease;
}
.rh-template-card::after { content:'›'; position:absolute; top:14px; right:15px; color:#777787; font-size:22px; }
.rh-template-card:hover,.rh-template-card.is-selected { transform:translateY(-3px); border-color:rgba(var(--rh-accent-rgb),.35); background:linear-gradient(145deg,rgba(var(--rh-accent-rgb),.13),rgba(15,15,22,.96)); box-shadow:0 16px 28px rgba(0,0,0,.2); }
.rh-template-card.is-featured { border-color:rgba(var(--rh-accent-rgb),.2); }
.rh-template-card i { width:38px; height:38px; display:grid; place-items:center; border:1px solid rgba(var(--rh-accent-rgb),.24); border-radius:11px; background:rgba(var(--rh-accent-rgb),.1); color:var(--rh-accent-bright); font-size:18px; font-style:normal; }
.rh-template-card strong { margin-top:4px; font-size:13px; }
.rh-template-card span { color:#8d8d9e; font-size:9px; line-height:1.5; }
.rh-template-card small { margin-top:auto; color:var(--rh-accent-bright); font-size:7px; font-weight:900; letter-spacing:.13em; }
.rh-studio-editor { border-color:rgba(var(--rh-accent-rgb),.18)!important; }
.rh-studio-list-tools { display:flex; align-items:center; justify-content:space-between; gap:14px; margin:0 0 16px; border-bottom:1px solid rgba(255,255,255,.055); padding:0 0 16px; }
.rh-studio-list-tools label { flex:1 1 480px; max-width:680px; display:flex; align-items:center; gap:10px; border:1px solid rgba(255,255,255,.07); border-radius:12px; padding:0 12px; background:rgba(7,7,12,.62); }
.rh-studio-list-tools input { width:100%; min-height:42px; border:0!important; padding-left:0!important; background:transparent!important; box-shadow:none!important; }
.rh-studio-list-tools > strong { color:#cfcfda; font-size:12px; }
.rh-studio-tabs { display:flex; gap:6px; margin:0 0 18px; border-bottom:1px solid rgba(255,255,255,.075); padding:0 5px; overflow-x:auto; }
.rh-studio-tabs button { position:relative; min-height:46px; border:0; padding:0 14px; background:transparent; color:#7f7f91; font-size:11px; font-weight:850; cursor:pointer; white-space:nowrap; }
.rh-studio-tabs button::after { content:''; position:absolute; left:12px; right:12px; bottom:-1px; height:2px; border-radius:2px; background:var(--rh-accent-bright); transform:scaleX(0); transition:transform .16s ease; }
.rh-studio-tabs button:hover,.rh-studio-tabs button.is-active { color:#fff; }
.rh-studio-tabs button.is-active::after { transform:scaleX(1); }
.rh-studio-tabs button span { display:inline-flex; min-width:20px; justify-content:center; margin-left:6px; border-radius:999px; padding:2px 6px; background:rgba(255,255,255,.06); font-size:8px; }
[data-studio-panel][hidden] { display:none!important; }
/* Visual workflow editor */
body.rh-module-studio [data-rh-page="automations"] .automation-intro-panel { display:none; }
body.rh-module-studio .automation-builder-sections { position:relative; max-width:1180px; margin:20px auto 0; gap:22px; }
body.rh-module-studio .automation-builder-block { position:relative; border:1px solid rgba(255,255,255,.075); border-left-width:1px!important; border-radius:17px; padding:16px; background:rgba(15,15,22,.78); overflow:visible; }
body.rh-module-studio .automation-builder-block:not(:last-child)::after { content:''; position:absolute; left:50%; bottom:-23px; width:1px; height:22px; background:linear-gradient(180deg,rgba(var(--rh-accent-rgb),.7),rgba(var(--rh-accent-rgb),.15)); }
body.rh-module-studio .automation-builder-block.trigger-block { --workflow-color:117,94,255; }
body.rh-module-studio .automation-builder-block.condition-block { --workflow-color:245,120,70; }
body.rh-module-studio .automation-builder-block.action-block { --workflow-color:34,211,238; }
body.rh-module-studio .automation-builder-head > div > span { border-color:rgba(var(--workflow-color),.34); background:rgba(var(--workflow-color),.12); color:rgb(var(--workflow-color)); }
body.rh-module-studio .workflow-item { position:relative; border:1px solid rgba(255,255,255,.065); border-radius:14px; background:linear-gradient(145deg,rgba(26,26,36,.9),rgba(11,11,17,.92)); box-shadow:0 10px 24px rgba(0,0,0,.12); }
body.rh-module-studio .workflow-item::before { content:''; position:absolute; left:-1px; top:14px; bottom:14px; width:3px; border-radius:999px; background:rgb(var(--workflow-color)); opacity:.7; }
body.rh-module-studio .workflow-item-index { border-color:rgba(var(--workflow-color),.25); background:rgba(var(--workflow-color),.1); color:rgb(var(--workflow-color)); }
body.rh-module-studio .workflow-empty { width:100%; min-height:72px; display:grid; justify-items:start; gap:4px; border:1px dashed rgba(var(--workflow-color),.32); border-radius:13px; padding:15px 18px; background:rgba(var(--workflow-color),.035); color:#d9d9e2; text-align:left; cursor:pointer; }
body.rh-module-studio .workflow-empty span { color:#858595; font-size:9px; }
body.rh-module-studio .workflow-row-controls button { border-radius:8px; }
body.rh-module-studio .automation-rule-card { border-radius:15px; background:linear-gradient(145deg,rgba(20,20,29,.92),rgba(10,10,15,.92)); }
body.rh-module-studio .automation-rule-card:hover { border-color:rgba(var(--rh-accent-rgb),.21); }
/* Existing module editors */
body.rh-module-studio [data-rh-page="welcome"] .welcome-segment-card,
body.rh-module-studio [data-rh-page="role-buttons"] .module-entry-card { border-radius:15px; background:rgba(13,13,19,.8); }
body.rh-module-studio .rh-dirty-bar { border-radius:14px 14px 0 0; box-shadow:0 -18px 50px rgba(0,0,0,.36); }
@media (max-width:1280px) { .rh-template-grid-5 { grid-template-columns:repeat(3,minmax(0,1fr)); } .rh-template-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:900px) { body.rh-module-studio .rh-studio-header { grid-template-columns:1fr; padding:18px; } body.rh-module-studio .rh-studio-header .topbar-actions { justify-content:flex-start; } .rh-studio-section-heading { align-items:flex-start; flex-direction:column; } .rh-template-grid,.rh-template-grid-5 { grid-template-columns:1fr; } .rh-template-card { min-height:125px; } }
@media (max-width:620px) { body.rh-module-studio .rh-studio-header-copy { grid-template-columns:44px minmax(0,1fr); column-gap:11px; } body.rh-module-studio .rh-studio-module-mark { width:44px;height:44px;border-radius:13px;font-size:17px; } .rh-studio-list-tools { align-items:stretch; flex-direction:column; } }

body.rh-module-studio .rh-module-context-bar {
  justify-content: flex-end;
  margin: -8px 0 18px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
body.rh-module-studio .rh-module-context-bar > span:first-child,
body.rh-module-studio .rh-module-context-bar > .rh-module-context-copy,
body.rh-module-studio .rh-module-context-bar > .rh-module-context-spacer { display:none; }
body.rh-module-studio .rh-module-context-bar a,
body.rh-module-studio .rh-module-context-bar button {
  min-height: 34px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
}
body.rh-module-studio .main[data-rh-page="automod"] > .rh-page-nav { display:none; }
