/* Coordinator Workspace — Jump Grades
   Palette: cream #fff9f0 · brown #3b2318 · red #dc5744 · amber #f1b35c
   Fonts: Nunito (display 800/900) + DM Sans (body) */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --cream: #fff9f0;
  --panel: #fbf2e7;
  --brown: #3b2318;
  --ink: #4a2c20;
  --red: #dc5744;
  --red-dark: #c44130;
  --amber: #f1b35c;
  --border: #efe2d3;
  --border-2: #ece1d6;
  --muted: #9a8576;
  --muted-2: #7a6256;
  --muted-3: #8a7565;
  --faint: #bcab9c;
  --green: #2f8f6f;
  --green-soft: #dcefe7;
}

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: 'Nunito', sans-serif; font-weight: 800; color: var(--ink); }
button { font-family: inherit; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #e2d2c2; border-radius: 9999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #d2bda8; background-clip: content-box; }

.pill {
  font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  border-radius: 9999px; padding: 2px 8px; white-space: nowrap;
}

/* ============ LOGIN ============ */
.login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--cream);
}
.login-card {
  width: 380px; max-width: 100%; background: #fff; border: 1px solid var(--border);
  border-radius: 20px; padding: 30px 28px 26px; text-align: center;
  box-shadow: 0 14px 40px rgba(59,35,24,.08);
}
.login-badge {
  width: 52px; height: 52px; border-radius: 9999px; background: var(--amber); color: var(--brown);
  font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 19px;
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.login-title { font-size: 21px; margin: 0; font-weight: 900; }
.login-sub {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #cf8f2f; margin: 5px 0 22px;
}
.login-label {
  display: block; text-align: left; font-size: 11px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
#login-email {
  width: 100%; border: 1px solid var(--border-2); border-radius: 11px; background: var(--cream);
  padding: 11px 13px; font-family: inherit; font-size: 14px; color: var(--ink); outline: none;
}
#login-email:focus { border-color: var(--red); background: #fff; }
#login-btn {
  width: 100%; margin-top: 12px; background: var(--red); color: #fff; border: none; border-radius: 11px;
  padding: 12px 14px; font-weight: 700; font-size: 12.5px; letter-spacing: .07em; text-transform: uppercase;
  cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
#login-btn:hover { background: var(--red-dark); }
#login-btn:disabled { opacity: .6; cursor: default; }
.login-msg { font-size: 12.5px; color: var(--green); background: var(--green-soft); border-radius: 10px; padding: 10px 12px; margin: 14px 0 0; line-height: 1.5; }
.login-msg.is-error { color: #c0492f; background: #fbe4de; }

/* ============ APP SHELL ============ */
.app { display: flex; height: 100vh; width: 100%; overflow: hidden; }

/* ---- sidebar ---- */
.sidebar {
  width: 236px; flex: none; background: var(--brown);
  display: flex; flex-direction: column; padding: 18px 14px; gap: 6px;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; }
.side-logo {
  width: 38px; height: 38px; border-radius: 9999px; background: var(--amber); color: var(--brown);
  font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 14px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.side-brand-text { line-height: 1.1; }
.side-brand-title { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 15px; color: #fff; }
.side-brand-sub { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); }

.side-nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 11px; width: 100%;
  border: none; border-radius: 11px; cursor: pointer; font-size: 13.5px; font-weight: 600;
  background: transparent; color: rgba(255,255,255,.66); text-align: left;
}
.nav-item:hover:not(:disabled) { background: rgba(255,255,255,.08); }
.nav-item.is-active { background: rgba(241,179,92,.16); color: #fff; font-weight: 700; }
.nav-item.is-disabled { opacity: .45; cursor: default; }
.nav-ico { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: none; }
.nav-label { flex: 1; }
.nav-soon {
  font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brown); background: var(--amber); border-radius: 9999px; padding: 2px 7px;
}
.nav-badge {
  font-size: 10.5px; font-weight: 800; color: #fff; background: var(--red); border-radius: 9999px;
  min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}
.side-spacer { flex: 1; }

.side-card { background: rgba(255,255,255,.06); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.side-user { display: flex; align-items: center; gap: 9px; }
.side-avatar {
  width: 34px; height: 34px; border-radius: 9999px; background: var(--amber); color: var(--brown);
  font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.side-user-text { line-height: 1.15; min-width: 0; }
.side-user-name { font-weight: 700; font-size: 13px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-role { font-size: 10.5px; color: rgba(255,255,255,.55); }
.side-rule { height: 1px; background: rgba(255,255,255,.09); }
.side-earn-label { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.side-earn-amt { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 24px; color: var(--amber); line-height: 1.1; margin-top: 2px; }
.side-earn-sub { font-size: 11px; color: rgba(255,255,255,.6); margin-top: 1px; }
.side-signout {
  align-self: flex-start; background: none; border: none; padding: 0; cursor: pointer;
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,.45); text-decoration: underline;
}
.side-signout:hover { color: rgba(255,255,255,.8); }

/* ---- main / header ---- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.header { flex: none; padding: 16px 22px 0; background: var(--cream); }
.header-row { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.header-titles { flex: 1 1 220px; min-width: 180px; }
.header-titles h3 { font-size: 21px; margin: 0; line-height: 1.1; }
.header-titles p { font-size: 13px; color: var(--muted-2); margin: 3px 0 0; }
.header-tools { display: flex; align-items: center; gap: 10px; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; }

.view-toggle { display: flex; background: #fff; border: 1px solid var(--border-2); border-radius: 9999px; padding: 3px; }
.view-toggle button {
  border: none; border-radius: 9999px; padding: 6px 13px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; background: transparent; color: var(--muted-3);
}
.view-toggle button.is-active { background: var(--brown); color: #fff; }

.searchbox {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border-2);
  border-radius: 9999px; padding: 8px 13px; flex: 0 1 190px; min-width: 120px;
}
.search-ico { display: flex; color: #b7a394; }
.searchbox input {
  border: none; outline: none; background: transparent; font-family: inherit; font-size: 13px;
  color: var(--ink); width: 100%;
}

.chips-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; padding-bottom: 2px; }
.brand-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chips-spacer { flex: 1; }
.brand-chip {
  display: flex; align-items: center; gap: 7px; border-radius: 9999px; padding: 6px 11px 6px 10px;
  font-size: 12.5px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--border-2); background: var(--cream); color: var(--muted-3);
}
.brand-chip .dot { width: 8px; height: 8px; border-radius: 9999px; flex: none; }
.brand-chip .count {
  font-size: 11px; font-weight: 800; color: #a99685; background: #f0e7dc; border-radius: 9999px;
  min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}
.brand-chip.is-active { background: #fff; color: var(--ink); }

.esc-banner {
  display: flex; align-items: center; gap: 7px; background: #fcecdb; border: 1px solid #f1c98e;
  color: #9a5a16; border-radius: 9999px; padding: 6px 13px; font-size: 12.5px; font-weight: 700;
}
.esc-ico { display: flex; }

/* ---- content ---- */
.content { flex: 1; min-height: 0; padding: 16px 22px 22px; display: flex; flex-direction: column; }
.loading { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 700; }
.spinner {
  width: 18px; height: 18px; border-radius: 9999px; border: 3px solid #f0e4d6; border-top-color: var(--red);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-note { text-align: center; padding: 22px 10px; color: var(--faint); font-size: 12px; }

/* ============ PIPELINE (kanban) ============ */
.board { flex: 1; min-height: 0; display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.col {
  flex: none; width: 284px; display: flex; flex-direction: column;
  background: var(--panel); border-radius: 16px; border: 1px solid var(--border); min-height: 0;
}
.col-head { padding: 12px 13px 10px; border-top: 3px solid transparent; border-radius: 16px 16px 0 0; }
.col-head-row { display: flex; align-items: center; gap: 8px; }
.col-dot { width: 8px; height: 8px; border-radius: 9999px; flex: none; }
.col-title { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13.5px; }
.col-count {
  margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); background: #fff;
  border: 1px solid var(--border-2); border-radius: 9999px; min-width: 22px; height: 21px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 6px;
}
.col-hint { font-size: 11px; color: var(--muted); margin-top: 3px; padding-left: 16px; }
.col-cards { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 9px 12px; display: flex; flex-direction: column; gap: 9px; }

.card {
  background: #fff; border-radius: 13px; border: 1px solid var(--border); border-left: 3px solid transparent;
  padding: 11px 12px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: 0 8px 18px rgba(0,0,0,.09); transform: translateY(-1px); }
.card-top { display: flex; align-items: center; gap: 7px; }
.card-level { font-size: 11px; font-weight: 700; color: var(--muted-2); }
.card-flag { margin-left: auto; display: flex; color: #cf7a1a; }
.card-student { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 15px; margin-top: 7px; line-height: 1.15; }
.card-parent { font-size: 11.5px; color: var(--muted-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-preview { display: flex; align-items: center; gap: 6px; margin-top: 8px; background: var(--panel); border-radius: 9px; padding: 6px 8px; }
.card-preview .p-ico { display: flex; flex: none; color: var(--green); }
.card-preview .p-text { font-size: 11.5px; color: #6f594d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-progress { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.bar { flex: 1; height: 5px; background: #f0e4d6; border-radius: 9999px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 9999px; }
.card-progress .frac { font-size: 10.5px; font-weight: 700; color: var(--muted); flex: none; }
.card-foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; }
.card-foot .c-ico { display: flex; color: #b7a394; }
.card-wait { font-size: 11px; color: var(--muted); }
.btn-advance {
  margin-left: auto; display: flex; align-items: center; gap: 4px; background: var(--panel);
  border: 1px solid var(--border-2); color: #6f594d; border-radius: 9999px; padding: 4px 9px;
  font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.btn-advance:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ============ TABLE view ============ */
.tablewrap { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.table-min { min-width: 860px; }
.trow, .thead { display: grid; grid-template-columns: 1.6fr .55fr 1fr 1.4fr .9fr .95fr; align-items: center; }
.thead { position: sticky; top: 0; background: var(--panel); border-bottom: 1px solid var(--border); z-index: 2; }
.thead > div { padding: 10px 13px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tgroup-head { display: flex; align-items: center; gap: 8px; padding: 7px 13px; border-bottom: 1px solid var(--border); }
.tgroup-head .dot { width: 8px; height: 8px; border-radius: 9999px; }
.tgroup-head .g-label { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 12.5px; }
.tgroup-head .g-count { font-size: 11px; font-weight: 700; color: var(--muted); }
.trow { border-bottom: 1px solid #f2e8dc; cursor: pointer; }
.trow:hover { background: #fffaf2; }
.trow > div { padding: 9px 13px; min-width: 0; }
.t-student { font-weight: 800; font-size: 13.5px; font-family: 'Nunito', sans-serif; }
.t-parent { font-size: 11px; color: var(--muted-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-level { font-size: 12.5px; font-weight: 700; color: var(--muted-2); }
.t-stage { font-size: 11px; font-weight: 700; border-radius: 9999px; padding: 3px 10px; white-space: nowrap; }
.t-preview { display: flex; align-items: center; gap: 6px; }
.t-preview span { font-size: 12px; color: #6f594d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-wait { font-size: 11.5px; color: var(--muted); }
.t-flag { display: inline-flex; color: #cf7a1a; vertical-align: -2px; margin-left: 5px; }

/* ============ TRIAGE ============ */
.triage { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; max-width: 780px; }
.tri-group-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.tri-group-head .g-ico { display: flex; }
.tri-group-head .g-label { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 14.5px; }
.tri-group-head .g-count {
  font-size: 11.5px; font-weight: 800; color: #fff; border-radius: 9999px; min-width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 6px;
}
.tri-group-head .g-hint { font-size: 11.5px; color: var(--muted); margin-left: 2px; }
.tri-rows { display: flex; flex-direction: column; gap: 8px; }
.tri-row {
  display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border);
  border-left: 4px solid transparent; border-radius: 13px; padding: 12px 14px; cursor: pointer;
}
.tri-row:hover { box-shadow: 0 6px 16px rgba(0,0,0,.07); }
.tri-main { flex: 1; min-width: 0; }
.tri-name-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tri-student { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 14.5px; }
.tri-level { font-size: 11px; font-weight: 700; color: var(--muted-2); }
.tri-action { font-size: 12.5px; color: #6f594d; margin-top: 3px; }
.tri-side { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.tri-wait { font-size: 11px; color: var(--muted); }
.tri-cta { border: none; color: #fff; border-radius: 9999px; padding: 6px 13px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.tri-empty { text-align: center; padding: 14px; color: var(--faint); font-size: 12px; background: var(--panel); border-radius: 11px; }

/* ============ REPLIES ============ */
.replies { flex: 1; min-height: 0; overflow-y: auto; }
.replies-tip {
  background: #fcedd9; border: 1px solid #f1ddbe; border-radius: 14px; padding: 13px 16px;
  display: flex; align-items: center; gap: 11px; margin-bottom: 16px;
}
.replies-tip .tip-ico { display: flex; color: #cf8f2f; flex: none; }
.replies-tip .tip-text { font-size: 12.5px; color: #7a5a2a; }
.reply-group { margin-bottom: 20px; }
.reply-group-label { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
.reply-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 11px; }
.reply-card {
  background: #fff; border: 1px solid var(--border); border-radius: 13px; padding: 13px 14px;
  display: flex; flex-direction: column; gap: 8px; cursor: pointer; text-align: left; font-family: inherit;
}
.reply-card:hover { border-color: var(--red); background: #fffdfa; }
.reply-card-top { display: flex; align-items: center; gap: 8px; }
.reply-shortcut {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; font-weight: 700;
  color: var(--red); background: #fbe8e3; border-radius: 6px; padding: 2px 7px; flex: none;
}
.reply-title { font-size: 13px; font-weight: 700; }
.reply-copy-hint { margin-left: auto; display: flex; color: var(--faint); }
.reply-body { font-size: 12px; color: var(--muted-2); line-height: 1.5; white-space: pre-wrap; max-height: 104px; overflow: hidden; }

/* ============ DRAWER ============ */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(59,35,24,.32); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 430px; max-width: 92vw;
  background: var(--cream); z-index: 41; box-shadow: -12px 0 40px rgba(59,35,24,.18);
  display: flex; flex-direction: column;
}
.drawer-head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 11px; }
.drawer-head-main { flex: 1; min-width: 0; }
.drawer-pills { display: flex; align-items: center; gap: 7px; }
.drawer-level { font-size: 11.5px; font-weight: 700; color: var(--muted-2); }
.drawer-student { font-size: 20px; margin: 8px 0 0; }
.drawer-contact { font-size: 12.5px; color: var(--muted-3); margin-top: 2px; word-break: break-word; }
.btn-close {
  background: var(--panel); border: 1px solid var(--border-2); border-radius: 9999px; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted-2); flex: none;
}
.btn-close:hover { background: #f0e4d6; }

.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 18px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.sec-label { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.sec-meta { font-size: 11.5px; font-weight: 700; }

.journey-steps { display: flex; flex-direction: column; gap: 2px; }
.j-step { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.j-dot {
  width: 20px; height: 20px; border-radius: 9999px; display: flex; align-items: center; justify-content: center;
  flex: none; color: #fff; background: #e6d8c8;
}
.j-label { flex: 1; font-size: 13px; }
.j-meta { font-size: 11px; color: var(--muted); }

.journey-events { margin-top: 10px; border-left: 2px solid #f0e4d6; padding-left: 12px; display: flex; flex-direction: column; gap: 8px; }
.j-ev { line-height: 1.35; }
.j-ev-text { font-size: 12px; color: #6f594d; }
.j-ev-meta { font-size: 10.5px; color: var(--faint); margin-top: 1px; }

.subs { display: flex; flex-direction: column; gap: 7px; }
.sub-item { background: #fff; border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.sub-head { display: flex; align-items: center; gap: 9px; padding: 9px 11px; cursor: pointer; width: 100%; background: none; border: none; text-align: left; }
.sub-head:hover { background: #fffaf2; }
.sub-ico { display: flex; color: var(--muted); flex: none; }
.sub-type { font-size: 12.5px; font-weight: 700; color: #5a4438; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-date { font-size: 11px; color: var(--muted); flex: none; }
.sub-caret { display: flex; color: var(--faint); flex: none; transition: transform .15s; }
.sub-item.is-open .sub-caret { transform: rotate(90deg); }
.sub-payload { border-top: 1px solid #f2e8dc; padding: 8px 11px 10px; display: flex; flex-direction: column; gap: 4px; background: #fffdfa; }
.kv { display: flex; gap: 9px; font-size: 11.5px; line-height: 1.4; }
.kv .k { flex: none; width: 108px; color: var(--muted); font-weight: 700; overflow-wrap: anywhere; }
.kv .v { flex: 1; color: #5a4438; overflow-wrap: anywhere; white-space: pre-wrap; }

.qr-list { display: flex; flex-direction: column; gap: 7px; }
.qr-btn {
  text-align: left; background: #fff; border: 1px solid var(--border); border-radius: 11px; padding: 9px 11px;
  cursor: pointer; display: flex; align-items: center; gap: 9px; font-family: inherit;
}
.qr-btn:hover { border-color: var(--red); background: #fffdfa; }
.qr-shortcut {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 700;
  color: var(--red); background: #fbe8e3; border-radius: 6px; padding: 2px 6px; flex: none;
}
.qr-preview { font-size: 12.5px; color: #5a4438; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.note-box textarea {
  width: 100%; border: 1px solid var(--border-2); border-radius: 11px; background: #fff; resize: vertical;
  min-height: 62px; padding: 9px 11px; font-family: inherit; font-size: 12.5px; color: var(--ink); outline: none;
}
.note-box textarea:focus { border-color: var(--red); }
.note-actions { display: flex; justify-content: flex-end; margin-top: 7px; }
.btn-note {
  background: var(--panel); border: 1px solid var(--border-2); color: #6f594d; border-radius: 9999px;
  padding: 6px 13px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.btn-note:hover { background: var(--brown); color: #fff; border-color: var(--brown); }

.drawer-foot { flex: none; padding: 13px 18px; border-top: 1px solid var(--border); background: #fff; display: flex; gap: 9px; }
.btn-escalate {
  flex: none; background: var(--panel); border: 1px solid var(--border-2); color: var(--muted-2);
  border-radius: 11px; padding: 11px 14px; font-weight: 700; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.btn-escalate:hover { background: #fcecdb; color: #9a5a16; border-color: #f1c98e; }
.btn-next {
  flex: 1; background: var(--red); border: none; color: #fff; border-radius: 11px; padding: 11px 14px;
  font-weight: 700; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-next:hover:not(:disabled) { background: var(--red-dark); }
.btn-next:disabled { background: var(--green); cursor: default; }
.drawer-loading { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 700; }

/* ============ TOAST ============ */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--green); color: #fff; border-radius: 9999px; padding: 11px 20px;
  font-weight: 700; font-size: 13px; box-shadow: 0 8px 24px rgba(47,143,111,.35);
  display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 40px);
}
.toast.is-error { background: #c0492f; box-shadow: 0 8px 24px rgba(192,73,47,.35); }
.toast .t-ico { display: flex; flex: none; }

/* ============ MOBILE (<800px): sidebar → top bar ============ */
@media (max-width: 799px) {
  .app { flex-direction: column; height: 100dvh; }
  .sidebar {
    width: 100%; flex-direction: row; align-items: center; padding: 10px 12px; gap: 10px;
    overflow-x: auto; overflow-y: hidden;
  }
  .side-brand { padding: 0; flex: none; }
  .side-brand-sub { display: none; }
  .side-nav { flex-direction: row; gap: 4px; flex: none; }
  .nav-item { padding: 8px 10px; white-space: nowrap; width: auto; }
  .nav-item .nav-ico { display: none; }
  .side-spacer { flex: 1; min-width: 8px; }
  .side-card { flex: none; flex-direction: row; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 12px; }
  .side-user, .side-rule, .side-signout, .side-earn-label { display: none; }
  .side-earn { display: flex; align-items: baseline; gap: 6px; }
  .side-earn-amt { font-size: 16px; margin: 0; }
  .side-earn-sub { margin: 0; white-space: nowrap; }
  .header { padding: 12px 14px 0; }
  .content { padding: 12px 14px 14px; }
  .col { width: 262px; }
  .header-tools { justify-content: flex-start; width: 100%; }
  .searchbox { flex: 1 1 auto; }
  .triage { max-width: none; }
}

/* ===== Forms admin ===== */
.formsview { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }

.forms-stats { display: grid; grid-template-columns: repeat(3, minmax(140px, 220px)); gap: 12px; }
.fstat { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.fstat-num { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 26px; line-height: 1.1; }
.fstat-label { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.forms-list-head { display: flex; align-items: center; gap: 10px; }
.forms-list-label { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.forms-list-spacer { flex: 1; }
.btn-newform {
  background: var(--red); color: #fff; border: none; border-radius: 9999px; padding: 9px 16px;
  font-weight: 700; font-size: 12.5px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.btn-newform:hover { background: var(--red-dark); }

.forms-list { display: flex; flex-direction: column; gap: 9px; }
.form-row {
  display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border);
  border-radius: 13px; padding: 12px 14px; flex-wrap: wrap;
}
.form-ico { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.form-main { flex: 1; min-width: 180px; }
.form-title { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 14.5px; }
.form-meta { font-size: 11.5px; color: var(--muted-3); margin-top: 2px; }
.form-badge { flex: none; }
.form-badge.is-live { color: var(--green); background: var(--green-soft); }
.form-badge.is-draft { color: var(--muted-2); background: #f0e7dc; }
.form-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.fbtn {
  background: var(--panel); border: 1px solid var(--border-2); color: #6f594d; border-radius: 9999px;
  padding: 5px 11px; font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.fbtn:hover:not(:disabled) { background: var(--brown); color: #fff; border-color: var(--brown); }
.fbtn:disabled { opacity: .55; cursor: default; }
.fbtn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.fbtn-primary:hover:not(:disabled) { background: var(--red-dark); border-color: var(--red-dark); }
.fbtn-danger { color: #c0492f; border-color: #e6b8ab; }
.fbtn-danger:hover:not(:disabled) { background: #c0492f; border-color: #c0492f; color: #fff; }

/* form editor */
.fedit { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 18px; max-width: 780px; }
.fedit-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.fedit-head h4 { margin: 0; font-size: 16px; }
.btn-back {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--muted-2); font-weight: 700; font-size: 12.5px; font-family: inherit;
}
.btn-back:hover { color: var(--red); }
.fedit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fedit-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fedit-field.is-wide { grid-column: 1 / -1; }
.fedit-field label { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fedit-field input, .fedit-field select, .fedit-field textarea {
  border: 1px solid var(--border-2); border-radius: 10px; background: var(--cream);
  padding: 9px 11px; font-family: inherit; font-size: 13px; color: var(--ink); outline: none;
}
.fedit-field input:focus, .fedit-field select:focus, .fedit-field textarea:focus { border-color: var(--red); background: #fff; }
.fedit-field select:disabled { opacity: .6; cursor: not-allowed; }
textarea.fedit-json {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.55;
  min-height: 220px; resize: vertical; background: #fff; white-space: pre;
}
.fedit-error { font-size: 12px; color: #c0492f; background: #fbe4de; border-radius: 8px; padding: 7px 10px; overflow-wrap: anywhere; }
.fedit-note { font-size: 11px; color: var(--faint); }
.fedit-cheat { margin-top: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 11px; padding: 11px 13px; }
.fedit-cheat-label { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #cf8f2f; margin-bottom: 6px; }
.fedit-cheat pre {
  margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
  color: #6f594d; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
}
.fedit-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 14px; }
.btn-save {
  background: var(--red); color: #fff; border: none; border-radius: 11px; padding: 10px 18px;
  font-weight: 700; font-size: 13px; cursor: pointer;
}
.btn-save:hover:not(:disabled) { background: var(--red-dark); }
.btn-save:disabled { opacity: .6; cursor: default; }
.btn-cancel {
  background: var(--panel); border: 1px solid var(--border-2); color: var(--muted-2); border-radius: 11px;
  padding: 10px 16px; font-weight: 700; font-size: 13px; cursor: pointer;
}
.btn-cancel:hover { background: #f0e4d6; }

/* clone mini-dialog */
.mini-backdrop {
  position: fixed; inset: 0; background: rgba(59,35,24,.32); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.mini-modal {
  background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 20px;
  width: 340px; max-width: 100%; box-shadow: 0 18px 50px rgba(59,35,24,.22);
}
.mini-title { margin: 0 0 12px; font-size: 15px; overflow-wrap: anywhere; }
.mini-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.mini-field label { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mini-field input, .mini-field select {
  border: 1px solid var(--border-2); border-radius: 10px; background: var(--cream);
  padding: 9px 11px; font-family: inherit; font-size: 13px; color: var(--ink); outline: none;
}
.mini-field input:focus, .mini-field select:focus { border-color: var(--red); background: #fff; }
.mini-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* drawer: pre-filled registration link */
.drawer-prefill { flex: none; padding: 11px 18px; border-top: 1px solid var(--border); background: #fff; }
.btn-prefill {
  width: 100%; background: var(--panel); border: 1px solid var(--border-2); color: #6f594d;
  border-radius: 11px; padding: 10px 12px; font-weight: 700; font-size: 12.5px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-prefill:hover:not(:disabled) { background: var(--brown); color: #fff; border-color: var(--brown); }
.btn-prefill:disabled { opacity: .6; cursor: default; }

@media (max-width: 799px) {
  .forms-stats { grid-template-columns: repeat(2, 1fr); }
  .fedit-grid { grid-template-columns: 1fr; }
  .form-actions { width: 100%; }
}

/* ===== Forms Dashboard polish (Phase 8.5) ===== */
.forms-subtabs { display: flex; gap: 4px; margin-bottom: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 9999px; padding: 3px; width: fit-content; }
.forms-subtab { border: none; background: transparent; color: var(--muted-2); border-radius: 9999px; padding: 7px 18px; font-weight: 800; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.forms-subtab.on { background: #fff; color: var(--red); box-shadow: 0 1px 4px rgba(0,0,0,.10); }
.forms-panel { display: flex; flex-direction: column; gap: 14px; }

.forms-stats { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
.fstat-brands { display: flex; flex-direction: column; gap: 8px; }
.fstat-brandrow { display: flex; flex-wrap: wrap; gap: 6px; }
.fstat-brandchip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: #6f594d; background: var(--cream); border-radius: 9999px; padding: 4px 9px; }
.fstat-brandchip .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

/* cards */
.form-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 13px; }
.form-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 15px 16px; display: flex; flex-direction: column; gap: 9px; box-shadow: 0 1px 2px rgba(59,35,24,.05); }
.form-card-top { display: flex; align-items: center; gap: 6px; }
.form-brandpill { display: inline-flex; align-items: center; gap: 6px; border-radius: 9999px; padding: 4px 11px; font-size: 11px; font-weight: 800; }
.form-brandpill .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.form-card-title { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 15px; line-height: 1.25; }
.form-card-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; border-top: 1px solid var(--border); padding-top: 9px; }
.fcstat { display: flex; flex-direction: column; gap: 1px; }
.fcstat-num { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 17px; }
.fcstat-k { font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.form-card-subs { font-size: 11px; font-weight: 600; color: var(--muted-3); }
.form-card .form-actions { margin-top: 2px; }

/* rebrand popover */
.rebrand-menu { position: absolute; z-index: 60; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 40px rgba(59,35,24,.20); padding: 7px; min-width: 190px; display: flex; flex-direction: column; gap: 2px; }
.rebrand-menu-hd { font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 5px 9px 4px; }
.rebrand-item { display: flex; align-items: center; gap: 9px; border: none; background: transparent; text-align: left; border-radius: 8px; padding: 8px 10px; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer; }
.rebrand-item:hover:not(:disabled) { background: var(--cream); }
.rebrand-item:disabled { opacity: .55; cursor: default; }
.rebrand-item .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.rebrand-more { border-top: 1px solid var(--border); margin-top: 3px; color: var(--muted-2); font-weight: 600; font-size: 12px; }

/* templates gallery */
.tpl-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.tpl-rail { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 3px; }
.tpl-rail-hd { font-weight: 900; font-size: 14px; padding: 2px 8px; }
.tpl-rail-note { font-size: 11.5px; font-weight: 600; color: var(--muted-3); padding: 0 8px 10px; line-height: 1.45; }
.tpl-cat { display: flex; align-items: center; gap: 8px; border: none; background: transparent; text-align: left; border-radius: 9px; padding: 9px 11px; font-family: inherit; font-weight: 800; font-size: 13px; color: #6f594d; cursor: pointer; }
.tpl-cat:hover { background: var(--cream); }
.tpl-cat.on { background: var(--brown); color: #fff; }
.tpl-cat-label { flex: 1; }
.tpl-cat-count { font-size: 11.5px; font-weight: 700; opacity: .7; }
.tpl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 13px; }
.tpl-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(59,35,24,.05); }
.tpl-tile { height: 88px; display: flex; align-items: center; justify-content: center; }
.tpl-tile-ic { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.9); display: flex; align-items: center; justify-content: center; }
.tpl-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 7px; }
.tpl-name { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 14px; line-height: 1.25; }
.tpl-cat-tag { font-size: 11px; font-weight: 700; color: var(--muted); }
.tpl-desc { font-size: 12px; font-weight: 600; color: var(--muted-3); line-height: 1.45; flex: 1; }
.tpl-acts { display: flex; gap: 6px; margin-top: 2px; }
.tpl-blank { border: 1.5px dashed var(--border-2); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 190px; cursor: pointer; font-family: inherit; color: #6f594d; }
.tpl-blank:hover { border-color: var(--red); color: var(--red); }
.tpl-blank-plus { width: 46px; height: 46px; border-radius: 50%; background: var(--red-soft, #fbe8e3); color: var(--red); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; }
.tpl-blank-txt { font-weight: 800; font-size: 13.5px; }

/* analytics */
.analytics-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.analytics-title { font-weight: 900; font-size: 18px; }
.analytics-sub { font-size: 12px; font-weight: 600; color: var(--muted-3); }
.analytics-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 1px 2px rgba(59,35,24,.05); }
.analytics-card-hd { font-weight: 900; font-size: 14.5px; }
.analytics-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; }
.analytics-kpi { display: flex; flex-direction: column; gap: 4px; }
.analytics-kpi-num { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 28px; line-height: 1; }
.analytics-kpi-k { font-size: 11.5px; font-weight: 700; color: var(--muted-2); }
.analytics-bars { display: flex; flex-direction: column; gap: 9px; }
.analytics-bar-row { display: flex; align-items: center; gap: 10px; }
.analytics-bar-label { width: 96px; flex: none; font-size: 12px; font-weight: 700; color: #6f594d; }
.analytics-bar-track { flex: 1; height: 9px; border-radius: 9999px; background: var(--cream); overflow: hidden; }
.analytics-bar-fill { height: 100%; border-radius: 9999px; min-width: 2px; }
.analytics-bar-val { width: 52px; flex: none; text-align: right; font-size: 12px; font-weight: 800; }
.analytics-toplist { display: flex; flex-direction: column; }
.analytics-toprow { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.analytics-toprow:last-child { border-bottom: none; }
.analytics-toprow .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.analytics-topname { font-size: 13px; font-weight: 700; }
.analytics-topval { font-size: 12px; font-weight: 800; color: #6f594d; }

/* ---- Analytics view (Phase 9 W7) ---- */
.analyticsview { display: flex; flex-direction: column; gap: 16px; }
.an-head { display: flex; align-items: center; gap: 12px; }
.an-range { display: inline-flex; background: var(--cream); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.an-range-btn { border: none; background: transparent; cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 700; color: var(--muted-3); padding: 5px 12px; border-radius: 8px; }
.an-range-btn.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(59,35,24,.08); }
.an-card-head { display: flex; align-items: baseline; gap: 10px; }
.an-card-sub { font-size: 11.5px; font-weight: 600; color: var(--muted-3); }
.an-series { display: flex; flex-direction: column; gap: 16px; }
.an-series-blk { display: flex; flex-direction: column; gap: 4px; }
.an-series-cap { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.an-series-blk svg, .analytics-card svg { display: block; max-width: 100%; }
.an-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.an-table { display: flex; flex-direction: column; font-size: 13px; }
.an-tr { display: grid; grid-template-columns: 2fr 1.2fr 0.8fr 0.8fr 0.8fr; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.an-tr:last-child { border-bottom: none; }
.an-th { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.an-formname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.an-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.an-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--cream); border-radius: 9999px; padding: 5px 11px; }
.an-chip-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.an-chip-n { font-weight: 900; font-family: 'Nunito', sans-serif; font-size: 14px; }
.an-chip-k { font-size: 11.5px; font-weight: 700; color: var(--muted-2); }
.an-mini-row { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12.5px; }
.an-mini-k { font-weight: 600; color: var(--muted-2); }
.an-mini-v { font-weight: 800; }
.an-foot { font-size: 12px; color: var(--muted-3); text-align: center; padding: 4px 0 8px; }
@media (max-width: 799px) { .an-grid2 { grid-template-columns: 1fr; } }

@media (max-width: 799px) {
  .tpl-wrap { grid-template-columns: 1fr; }
  .form-cards { grid-template-columns: 1fr; }
}

/* ===== Fees ===== */
.feesview { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }

.fee-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.fee-stat { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.fee-stat-label { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.fee-stat-num { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 26px; color: var(--brown); line-height: 1.1; margin-top: 5px; }
.fee-stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.fee-barcard { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.fee-barhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.fee-bartitle { font-size: 12.5px; font-weight: 800; font-family: 'Nunito', sans-serif; }
.fee-barpct { font-size: 12.5px; font-weight: 800; color: var(--green); }
.fee-bar { height: 9px; background: #f0e4d6; border-radius: 9999px; overflow: hidden; }
.fee-bar > i { display: block; height: 100%; background: var(--green); border-radius: 9999px; }

.fee-tablewrap { border: 1px solid var(--border); border-radius: 14px; background: #fff; overflow: auto; }
.fee-table { min-width: 760px; }
.fee-thead, .fee-row { display: grid; grid-template-columns: 1.7fr .7fr .8fr .9fr .9fr 1fr; align-items: center; }
.fee-thead { position: sticky; top: 0; background: var(--panel); border-bottom: 1px solid var(--border); z-index: 2; }
.fee-thead > div { padding: 10px 13px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fee-row { border-bottom: 1px solid #f2e8dc; }
.fee-row > div { padding: 9px 13px; min-width: 0; }
.fee-customer { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fee-created { font-size: 11px; color: var(--muted-3); margin-top: 1px; }
.fee-num { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 700; color: var(--muted-2); }
.fee-amt { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 14px; }
.fee-due-note { font-size: 10.5px; font-weight: 700; color: #cf8f2f; }
.fee-status { font-size: 10.5px; padding: 3px 10px; }
.fee-status.is-paid { color: var(--green); background: var(--green-soft); }
.fee-status.is-due { color: #cf8f2f; background: #f7ecd6; }
.fee-status.is-overdue { color: #c0492f; background: #fbe4de; }
.fee-status.is-draftinv { color: var(--muted-2); background: #f0e7dc; }
.fee-status.is-other { color: #3f7fc4; background: #dde8f4; }
.fee-status-note { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.fee-duedate { font-size: 12px; color: var(--muted-2); }
.fee-action { display: flex; align-items: center; }
.fee-remind {
  display: flex; align-items: center; gap: 5px; background: var(--panel); border: 1px solid var(--border-2);
  color: #6f594d; border-radius: 9999px; padding: 5px 11px; font-family: inherit; font-size: 11.5px;
  font-weight: 700; cursor: pointer; white-space: nowrap;
}
.fee-remind:hover { background: #25a564; color: #fff; border-color: #25a564; }
.fee-hint { font-size: 11.5px; color: var(--faint); font-style: italic; white-space: nowrap; }
.fee-received { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--green); white-space: nowrap; }

@media (max-width: 799px) {
  .fee-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Ops (admin) ===== */
.opsview { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; max-width: 900px; }

.ops-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px;
  font-size: 12.5px; font-weight: 700; color: var(--muted-2);
}

.ops-table { border: 1px solid var(--border); border-radius: 14px; background: #fff; overflow: hidden; }
.ops-thead, .ops-row { display: grid; grid-template-columns: 1.1fr .45fr .45fr .45fr .55fr 2fr; align-items: center; }
.ops-thead { background: var(--panel); border-bottom: 1px solid var(--border); }
.ops-thead > div { padding: 9px 13px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ops-row { border-bottom: 1px solid #f2e8dc; }
.ops-row:last-child { border-bottom: none; }
.ops-row > div { padding: 9px 13px; min-width: 0; }
.ops-target { display: flex; align-items: center; gap: 8px; }
.ops-dot { width: 9px; height: 9px; border-radius: 9999px; flex: none; }
.ops-target-name { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13px; }
.ops-n { font-size: 13px; font-weight: 800; font-family: 'Nunito', sans-serif; color: var(--muted-2); }
.ops-skip { color: var(--faint); }
.ops-err { font-size: 11px; color: var(--muted-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ops-deadlist { display: flex; flex-direction: column; gap: 8px; }
.ops-dead-row {
  display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border);
  border-left: 4px solid transparent; border-radius: 13px; padding: 11px 14px;
}
.ops-dead-main { flex: 1; min-width: 0; }
.ops-dead-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ops-dead-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.ops-dead-target { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13.5px; }
.ops-dead-status.is-dead { color: #c0492f; background: #fbe4de; }
.ops-dead-status.is-failed { color: #cf8f2f; background: #f7ecd6; }
.ops-dead-meta { font-size: 11.5px; color: var(--muted-3); }
.ops-dead-err { font-size: 11.5px; color: #6f594d; margin-top: 3px; overflow-wrap: anywhere; }
.ops-dead-next { font-size: 10.5px; color: var(--faint); margin-top: 2px; }
.ops-dead-side { flex: none; }
.ops-retry {
  display: flex; align-items: center; gap: 5px; background: var(--panel); border: 1px solid var(--border-2);
  color: #6f594d; border-radius: 9999px; padding: 6px 12px; font-family: inherit; font-size: 12px;
  font-weight: 700; cursor: pointer; white-space: nowrap;
}
.ops-retry:hover:not(:disabled) { background: var(--red); color: #fff; border-color: var(--red); }
.ops-retry:disabled { opacity: .55; cursor: default; }
.ops-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; padding: 0 2px; }

/* ===== Approvals ===== */
.approvalsview { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; max-width: 900px; }

.appr-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px;
  font-size: 12.5px; font-weight: 700; color: var(--muted-2);
}

.appr-list { display: flex; flex-direction: column; gap: 10px; }
.appr-card {
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--red);
  border-radius: 14px; padding: 13px 15px;
}
.appr-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.appr-type { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13px; color: var(--muted-2); }
.appr-time { margin-left: auto; font-size: 11px; color: var(--faint); }
.appr-name { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 16px; color: var(--ink); margin-top: 7px; }
.appr-contact { font-size: 12px; color: var(--muted-2); margin-top: 2px; }

.appr-fields {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid #f2e8dc;
}
.appr-kv { display: flex; gap: 6px; min-width: 0; font-size: 11.5px; }
.appr-k { color: var(--muted); font-weight: 700; text-transform: capitalize; flex: none; }
.appr-v { color: #4a2c20; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.appr-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.appr-btn {
  display: flex; align-items: center; gap: 5px; border-radius: 9999px; padding: 7px 15px;
  font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border-2); background: var(--panel); color: #6f594d;
}
.appr-btn:disabled { opacity: .55; cursor: default; }
.appr-decline:hover:not(:disabled) { background: var(--red); color: #fff; border-color: var(--red); }
.appr-approve { background: var(--green); color: #fff; border-color: var(--green); }
.appr-approve:hover:not(:disabled) { background: #25794f; border-color: #25794f; }

.appr-recent { display: flex; flex-direction: column; gap: 6px; }
.appr-recent-row {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border);
  border-radius: 11px; padding: 8px 12px; font-size: 12px;
}
.appr-recent-name { font-weight: 800; font-family: 'Nunito', sans-serif; color: var(--ink); }
.appr-recent-type { color: var(--muted-2); }
.appr-recent-time { margin-left: auto; font-size: 11px; color: var(--faint); }
.appr-decided.is-approved { color: var(--green); background: var(--green-soft); }
.appr-decided.is-declined { color: #c0492f; background: #fbe4de; }

@media (max-width: 799px) {
  .appr-fields { grid-template-columns: 1fr; }
}

/* ===== Payments ===== */
.paymentsview { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }

.pay-subtabs {
  display: inline-flex; gap: 2px; background: var(--panel); border-radius: 9999px; padding: 3px;
  align-self: flex-start;
}
.pay-subtab {
  border: none; cursor: pointer; border-radius: 9999px; padding: 7px 16px; white-space: nowrap;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 12.5px; color: var(--muted-2);
  background: transparent;
}
.pay-subtab.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(59,35,24,.1); }

.pay-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pay-stat { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 13px 16px; }
.pay-stat-v { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 21px; color: var(--ink); letter-spacing: -.01em; }
.pay-stat-l { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.pay-tools { display: flex; align-items: center; gap: 12px; }
.pay-filter { display: flex; align-items: center; gap: 8px; }
.pay-filter-l { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pay-select {
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: #fff;
  font-family: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer;
}
.pay-count { font-size: 12.5px; font-weight: 700; color: var(--muted-2); }
.pay-mode {
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em; border-radius: 9999px; padding: 4px 10px;
  color: #635BFF; background: #EEF1FD; text-transform: uppercase;
}
.pay-mode.is-test { color: #a06d1e; background: rgba(241,179,92,.22); }

.pay-table { border: 1px solid var(--border); border-radius: 14px; background: #fff; overflow: hidden; }
.pay-thead, .pay-row { display: grid; grid-template-columns: 90px 1.5fr 1.2fr .8fr .7fr .7fr .7fr; align-items: center; }
.coupon-table .pay-thead, .coupon-table .pay-row { grid-template-columns: 1fr 1.4fr .8fr 1.4fr .7fr .7fr auto; }
.pay-thead { background: var(--panel); border-bottom: 1px solid var(--border); }
.pay-thead > div { padding: 9px 13px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pay-row { border-bottom: 1px solid #f2e8dc; }
.pay-row:last-child { border-bottom: none; }
.pay-row > div { padding: 11px 13px; min-width: 0; }

.pay-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 700; color: var(--red); overflow: hidden; text-overflow: ellipsis; }
.pay-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pay-sku { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 12.5px; color: var(--ink); }
.pay-ftype { font-size: 11px; color: var(--muted); }
.pay-cust { font-size: 12.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-amt { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 13.5px; color: var(--ink); display: flex; align-items: baseline; gap: 6px; }
.pay-coupon { font-family: ui-monospace, Menlo, monospace; font-size: 10px; font-weight: 700; color: #8a5cc4; background: #efe6fa; border-radius: 6px; padding: 1px 6px; }
.pay-src { }
.pay-stripe { display: inline-flex; align-items: center; gap: 5px; background: #EEF1FD; color: #635BFF; border-radius: 9999px; padding: 4px 10px; font-weight: 700; font-size: 11px; }
.pay-time { font-size: 11.5px; color: var(--faint); }

.coupon-code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; font-weight: 700; color: var(--red); }
.coupon-title { font-size: 12.5px; color: var(--ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coupon-amt { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 13px; color: var(--ink); }
.coupon-skus { font-size: 11.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coupon-used { font-size: 12px; color: var(--muted-2); font-weight: 700; }
.coupon-actions { display: flex; justify-content: flex-end; }

.coupon-form { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.cf-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 18px; }
.cf-field { display: flex; flex-direction: column; gap: 5px; }
.cf-label { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cf-input { border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-family: inherit; font-size: 13px; color: var(--ink); background: #fff; }
.cf-input:focus { outline: none; border-color: var(--green); }
.cf-hint { font-size: 10.5px; color: var(--faint); }
.cf-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

@media (max-width: 799px) {
  .pay-stats { grid-template-columns: repeat(2, 1fr); }
  .pay-thead { display: none; }
  .pay-row, .coupon-table .pay-row { grid-template-columns: 1fr 1fr; }
  .cf-grid { grid-template-columns: 1fr; }
}

/* ============ VISUAL FORM BUILDER (Phase 8.1) ============ */
.bld { background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; min-height: 560px; }
.bld-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: #fff; }
.bld-title-wrap { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 1px; }
.bld-title-input { border: none; background: transparent; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 17px; color: var(--ink); padding: 2px 0; outline: none; }
.bld-title-input:focus { border-bottom: 1.5px solid var(--red); }
.bld-slug { font-size: 11px; color: var(--faint); font-family: ui-monospace, Menlo, monospace; }
.bld-mini-sel { border: 1px solid var(--border-2); border-radius: 8px; background: var(--cream); padding: 6px 8px; font-family: inherit; font-size: 12px; color: var(--ink); }
.bld-mini-sel:disabled { opacity: .6; }
.bld-status { border: 1px solid var(--border-2); border-radius: 999px; padding: 6px 13px; font-weight: 800; font-size: 12px; cursor: pointer; background: #fff; }
.bld-status.is-live { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.bld-status.is-draft { color: var(--muted-2); }
.bld-save { background: var(--red); color: #fff; border: none; border-radius: 999px; padding: 8px 18px; font-weight: 800; font-size: 13px; cursor: pointer; }
.bld-save:hover:not(:disabled) { background: var(--red-dark); }
.bld-save:disabled { opacity: .6; }
.bld-ghost { background: transparent; border: 1.5px solid var(--border-2); color: var(--muted-2); border-radius: 999px; padding: 7px 15px; font-weight: 700; font-size: 13px; cursor: pointer; }
.bld-ghost:hover { border-color: var(--red); color: var(--red); }
.bld-tabs { display: flex; gap: 2px; padding: 8px 16px; border-bottom: 1px solid var(--border); background: var(--panel); }
.bld-tab { border: none; background: transparent; color: var(--muted-2); border-radius: 999px; padding: 7px 16px; font-weight: 800; font-size: 13px; cursor: pointer; }
.bld-tab.on { background: #fff; color: var(--red); box-shadow: 0 1px 4px rgba(0,0,0,.10); }
.bld-body { flex: 1; min-height: 0; }
.bld-build { display: grid; grid-template-columns: 220px 1fr 300px; }
.bld-scroll { overflow-y: auto; }
.bld-palette { border-right: 1px solid var(--border); padding: 14px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.bld-palette-hd { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 2px 2px; }
.bld-pal-group { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-top: 8px; padding: 0 2px; }
.bld-pal-item { display: flex; align-items: center; gap: 9px; border: 1px solid var(--border-2); background: #fff; border-radius: 10px; padding: 8px 10px; cursor: pointer; text-align: left; }
.bld-pal-item:hover { border-color: var(--red); background: var(--cream); }
.bld-pal-ico { width: 28px; height: 28px; border-radius: 8px; background: var(--panel); display: flex; align-items: center; justify-content: center; color: var(--muted-2); flex: none; }
.bld-pal-tx { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.bld-pal-lb { font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 13px; color: var(--ink); }
.bld-pal-hint { font-size: 10.5px; color: var(--muted); }
.bld-canvas { padding: 18px 20px; overflow-y: auto; }
.bld-steps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.bld-step { display: flex; align-items: center; gap: 7px; border: 1px solid var(--border-2); background: #fff; color: var(--muted-2); border-radius: 999px; padding: 6px 12px 6px 6px; font-weight: 700; font-size: 13px; cursor: pointer; }
.bld-step.on { background: var(--brown); color: #fff; border-color: var(--brown); }
.bld-step-n { width: 19px; height: 19px; border-radius: 50%; background: var(--panel); color: var(--muted-2); display: flex; align-items: center; justify-content: center; font-size: 11px; flex: none; }
.bld-step.on .bld-step-n { background: rgba(255,255,255,.2); color: #fff; }
.bld-step-c { font-size: 11px; font-weight: 400; opacity: .7; }
.bld-step-add { border: 1px dashed var(--border-2); background: transparent; color: var(--muted-2); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 13px; cursor: pointer; }
.bld-step-add:hover { border-color: var(--red); color: var(--red); }
.bld-stephd { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; align-items: end; }
.bld-fields { display: flex; flex-direction: column; gap: 9px; }
.bld-empty { border: 1px dashed var(--border-2); border-radius: 12px; padding: 20px; text-align: center; color: var(--muted); font-size: 12.5px; }
.bld-fcard { background: #fff; border: 1px solid var(--border-2); border-radius: 13px; padding: 11px 13px; cursor: pointer; }
.bld-fcard.on { border: 1.5px solid var(--red); box-shadow: 0 3px 12px rgba(220,87,68,.14); }
.bld-fcard-top { display: flex; align-items: center; gap: 9px; }
.bld-fcard-ico { width: 26px; height: 26px; border-radius: 7px; background: var(--panel); display: flex; align-items: center; justify-content: center; color: var(--muted-2); flex: none; }
.bld-fcard-lb { font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 14px; }
.bld-req { color: var(--red); font-weight: 800; }
.bld-fcard-chips { display: flex; gap: 5px; margin-left: 4px; }
.bld-chip { background: var(--panel); color: var(--muted-2); border-radius: 6px; padding: 2px 7px; font-size: 10px; font-weight: 800; }
.bld-chip.data { background: #dcefe7; color: var(--green); }
.bld-chip.cond { background: #f7ecd6; color: #a06d1e; }
.bld-fcard-tools { display: flex; gap: 2px; margin-left: auto; }
.bld-tool { border: none; background: transparent; color: var(--muted); cursor: pointer; padding: 3px 5px; font-size: 12px; border-radius: 6px; }
.bld-tool:hover { background: var(--panel); color: var(--ink); }
.bld-tool.danger:hover { color: var(--red); }
.bld-fcard-ghost { background: var(--cream); border: 1px dashed var(--border-2); border-radius: 8px; padding: 7px 11px; font-size: 12px; color: var(--muted); margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bld-settings { border-left: 1px solid var(--border); padding: 16px 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.bld-settings-hd, .bld-settings-hd2 { display: flex; align-items: center; gap: 9px; }
.bld-settings-hd { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bld-set-ico { width: 28px; height: 28px; border-radius: 8px; background: #fbe8e3; display: flex; align-items: center; justify-content: center; color: var(--red); flex: none; }
.bld-set-type { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 14px; }
.bld-set-sub { font-size: 11px; color: var(--muted); }
.bld-nosel { border: 1px dashed var(--border-2); border-radius: 12px; padding: 18px 14px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.bld-nosel-ico { font-size: 22px; color: var(--faint); margin-bottom: 6px; }
.bld-field { display: flex; flex-direction: column; gap: 5px; }
.bld-field label { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.bld-field input, .bld-field select, .bld-field textarea { border: 1px solid var(--border-2); border-radius: 9px; background: var(--cream); padding: 8px 10px; font-family: inherit; font-size: 13px; color: var(--ink); outline: none; width: 100%; }
.bld-field input:focus, .bld-field select:focus, .bld-field textarea:focus { border-color: var(--red); background: #fff; }
.bld-field input.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.bld-field textarea { resize: vertical; }
.bld-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border-2); border-radius: 10px; padding: 9px 11px; }
.bld-row-tx { display: flex; flex-direction: column; gap: 1px; }
.bld-row-lb { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.bld-row-sub { font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.bld-tog { width: 38px; height: 21px; border-radius: 999px; background: #d9c7b8; position: relative; cursor: pointer; transition: background .15s; flex: none; }
.bld-tog.on { background: var(--green); }
.bld-knob { position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.bld-tog.on .bld-knob { left: 19px; }
.bld-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.bld-triple { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.bld-sub-hd { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--border); padding-top: 11px; }
.bld-cond { display: flex; flex-direction: column; gap: 9px; background: var(--cream); border-radius: 10px; padding: 11px; }
/* Phase 9 W6 — multi-condition / grouped condition editor */
.bld-condgroup { display: flex; flex-direction: column; gap: 7px; background: #fff; border: 1px solid var(--border-2); border-radius: 10px; padding: 9px; }
.bld-condgroup-hd { display: flex; align-items: center; justify-content: space-between; }
.bld-condgroup-lb { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.bld-condrule { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bld-condrule select, .bld-condrule input { border: 1px solid var(--border-2); border-radius: 8px; background: var(--cream); padding: 6px 8px; font-family: inherit; font-size: 12.5px; outline: none; min-width: 0; }
.bld-condrule select { flex: 1 1 40%; }
.bld-condrule input { flex: 1 1 30%; }
.bld-cond-join { font-size: 10px; font-weight: 800; color: var(--red); background: #fbe8e3; border-radius: 5px; padding: 2px 6px; }
.bld-cond-x { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.bld-cond-x:hover { color: var(--red); }
.bld-cond-addrow { display: flex; gap: 12px; }
.bld-cond-preview { font-size: 11.5px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; line-height: 1.45; padding-top: 2px; }
.bld-chip.cond { background: #fbe8e3; color: var(--red); }
.bld-note { font-size: 11.5px; color: var(--muted); line-height: 1.45; background: var(--cream); border-radius: 8px; padding: 8px 10px; }
.bld-cart-items { display: flex; flex-direction: column; gap: 7px; }
.bld-cart-row { display: grid; grid-template-columns: 1fr 84px 28px; gap: 7px; align-items: center; }
.bld-cart-row .bld-cart-price { text-align: right; }
.bld-linkbtn { background: transparent; border: none; color: var(--red); font-weight: 700; font-size: 12.5px; cursor: pointer; text-align: left; padding: 4px 0; font-family: inherit; }
.bld-linkbtn.danger { color: #c0492f; }
.bld-facts { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border-2); border-radius: 11px; padding: 11px; }
.bld-fact { display: flex; justify-content: space-between; font-size: 12px; }
.bld-fact-k { color: var(--muted); font-weight: 700; }
.bld-fact-v { color: var(--ink); font-weight: 700; }
.bld-tabwrap { max-width: 780px; margin: 0 auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.bld-h { margin: 10px 0 0; font-size: 16px; }
.bld-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.bld-rule { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border-2); border-radius: 12px; padding: 11px 13px; flex-wrap: wrap; }
.bld-rule-tx { font-weight: 700; font-size: 13.5px; }
.bld-rule-when { font-size: 12px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.bld-rule .bld-linkbtn { margin-left: auto; }
.bld-badge { border-radius: 6px; padding: 3px 8px; font-size: 10.5px; font-weight: 800; }
.bld-badge.show, .bld-badge.if { background: #fbe8e3; color: var(--red); }
.bld-confcard { background: #fff; border: 1px solid var(--border-2); border-radius: 13px; padding: 13px; display: flex; flex-direction: column; gap: 10px; }
.bld-conf-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bld-conf-top input { flex: 1; min-width: 120px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--cream); padding: 7px 9px; font-family: inherit; font-size: 12.5px; outline: none; }
.bld-inline-sel { border: 1px solid var(--border-2); border-radius: 8px; background: #fff; padding: 7px 9px; font-family: inherit; font-size: 12.5px; }
.bld-dashbtn { border: 1px dashed var(--border-2); background: transparent; color: var(--muted-2); border-radius: 12px; padding: 12px; font-weight: 700; font-size: 13px; cursor: pointer; }
.bld-dashbtn:hover { border-color: var(--red); color: var(--red); }
.bld-intgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.bld-intcard { background: #fff; border: 1px solid var(--border-2); border-radius: 13px; padding: 13px; display: flex; flex-direction: column; gap: 8px; }
.bld-intcard.off { opacity: .62; }
.bld-int-top { display: flex; align-items: center; gap: 8px; }
.bld-int-name { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 14.5px; }
.bld-int-def { margin-left: auto; font-size: 10.5px; color: var(--muted); font-weight: 700; }
.bld-int-desc { font-size: 12px; color: var(--muted-2); line-height: 1.45; }
/* Phase 9 W3 — email-notification editor */
.bld-desc.warn { color: var(--red); }
.bld-smartcodes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: -2px; }
.bld-smart-lb { font-size: 11px; color: var(--muted); font-weight: 700; }
.bld-smartchip { border: 1px solid var(--border-2); background: var(--cream); border-radius: 7px; padding: 3px 7px; font-size: 11px; font-family: ui-monospace, Menlo, monospace; color: var(--muted-2); cursor: pointer; }
.bld-smartchip:hover { border-color: var(--red); color: var(--red); }
.bld-confcard textarea { border: 1px solid var(--border-2); border-radius: 8px; background: var(--cream); padding: 8px 9px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; outline: none; resize: vertical; width: 100%; box-sizing: border-box; }
.bld-sharebox, .bld-jsonbox { width: 520px; max-width: 100%; }
.bld-jsonbox { width: 640px; }
.bld-sharetabs { display: flex; gap: 4px; margin-bottom: 12px; background: var(--panel); border-radius: 999px; padding: 3px; }
.bld-sharetab { flex: 1; border: none; background: transparent; color: var(--muted-2); border-radius: 999px; padding: 7px; font-weight: 700; font-size: 12.5px; cursor: pointer; }
.bld-sharetab.on { background: #fff; color: var(--red); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.bld-copybox { display: flex; align-items: stretch; gap: 8px; margin: 8px 0; }
.bld-copytext { flex: 1; background: var(--cream); border: 1px solid var(--border-2); border-radius: 9px; padding: 10px 11px; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--ink); overflow-x: auto; white-space: nowrap; }
.bld-modeseg { margin-top: 10px; }
.bld-modenote { min-height: 32px; margin-top: 4px; }
.bld-jsonbox textarea { width: 100%; min-height: 340px; }

/* ---- Quiz builder (Phase 8.3) ---- */
.bld-qhd { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bld-pts { width: 62px; text-align: center; }
.bld-qcard { background: #fff; border: 1px solid var(--border-2); border-radius: 13px; padding: 13px; display: flex; flex-direction: column; gap: 8px; }
.bld-qcard-top { display: flex; align-items: center; gap: 9px; }
.bld-qcard-n { width: 22px; height: 22px; border-radius: 50%; background: var(--panel); color: var(--muted-2); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; flex: none; }
.bld-qcard-text { flex: 1; font-weight: 700; }
.bld-optrow { display: grid; grid-template-columns: 1fr 62px 24px; gap: 8px; align-items: center; }
.bld-opthead { padding: 0 2px; }
.bld-opthead span { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.bld-optpts-h { text-align: center; }
.bld-bandcard { background: #fff; border: 1px solid var(--border-2); border-radius: 13px; padding: 13px; display: flex; flex-direction: column; gap: 9px; }
.bld-band-top { display: flex; align-items: center; gap: 10px; }
.bld-band-tag { background: #fbe8e3; color: var(--red); border-radius: 6px; padding: 3px 9px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; }
.bld-band-range { display: flex; gap: 8px; margin-left: auto; }
.bld-band-range span { display: flex; align-items: center; gap: 5px; }
.bld-minlbl { font-size: 10.5px; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.bld-bandtargets { display: flex; flex-direction: column; gap: 2px; }
.drawer-diag { font-size: 11px; font-weight: 800; color: var(--red); background: #fbe8e3; border-radius: 6px; padding: 3px 8px; }

@media (max-width: 899px) {
  .bld-build { grid-template-columns: 1fr; }
  .bld-palette { border-right: none; border-bottom: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; }
  .bld-settings { border-left: none; border-top: 1px solid var(--border); }
  .bld-stephd { grid-template-columns: 1fr; }
}

/* ===== Entries ===== */
.entriesview { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }

.ent-filters { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.ent-filter { display: flex; flex-direction: column; gap: 5px; }
.ent-filter .pay-filter-l { margin-bottom: 1px; }
.ent-count { font-size: 12.5px; font-weight: 700; color: var(--muted-2); }

.ent-table { border: 1px solid var(--border); border-radius: 14px; background: #fff; overflow: hidden; }
.ent-thead, .ent-row { display: grid; grid-template-columns: 36px 84px 1.5fr 1.1fr 1.4fr .8fr .8fr .8fr 54px; align-items: center; }
.ent-check { display: flex; align-items: center; justify-content: center; }
.ent-check input { width: 15px; height: 15px; cursor: pointer; }
/* Phase 9 W8 — bulk action bar (shows when rows are selected) */
.ent-bulkbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.ent-bulkbar .ent-bulk-count { font-size: 12.5px; font-weight: 800; color: var(--ink); }
.ent-bulkbar .ent-bulk-spacer { flex: 1; }
.ent-thead { background: var(--panel); border-bottom: 1px solid var(--border); }
.ent-thead > div { padding: 9px 12px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ent-row { border-bottom: 1px solid #f2e8dc; cursor: pointer; }
.ent-row:last-child { border-bottom: none; }
.ent-row:hover { background: var(--cream); }
.ent-row > div { padding: 11px 12px; min-width: 0; }

.ent-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 700; color: var(--red); overflow: hidden; text-overflow: ellipsis; }
.ent-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ent-ftitle { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-ftype { font-size: 10.5px; color: var(--muted); }
.ent-name { font-size: 12.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-email { font-size: 12px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-time { font-size: 11.5px; color: var(--faint); }
.ent-dash { color: var(--faint); }
.ent-health { display: flex; justify-content: center; }
.ent-dot { width: 11px; height: 11px; border-radius: 9999px; flex: none; }

/* entry detail drawer */
.ent-topact { display: flex; gap: 8px; }
.ent-data { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border-2); border-radius: 12px; overflow: hidden; }
.ent-kv { display: flex; flex-direction: column; gap: 3px; padding: 10px 13px; border-bottom: 1px solid #f5e9dc; }
.ent-kv:last-child { border-bottom: none; }
.ent-k { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 12px; color: var(--ink); }
.ent-v { font-size: 12.5px; color: var(--muted-2); overflow-wrap: anywhere; }

.ent-appr-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ent-appr-actions { display: flex; gap: 8px; margin-left: auto; }

.ent-pay-card { background: #fff; border: 1px solid var(--border-2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ent-pay-top { display: flex; align-items: center; gap: 9px; }
.ent-pay-amt { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 16px; color: var(--ink); }
.ent-pay-grid { display: grid; grid-template-columns: 118px 1fr; gap: 7px 12px; font-size: 12px; }
.ent-pay-k { font-weight: 700; color: var(--muted); }
.ent-pay-v { color: var(--muted-2); overflow-wrap: anywhere; }
.ent-pay-v.mono { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: #2e8c84; }

.ent-logs { display: flex; flex-direction: column; gap: 8px; }
.ent-log { background: #fff; border: 1px solid var(--border-2); border-left: 3px solid var(--muted); border-radius: 11px; padding: 10px 12px; }
.ent-log-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ent-log-target { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13px; color: var(--ink); }
.ent-log-att { font-size: 11px; color: var(--muted); }
.ent-replay {
  margin-left: auto; display: flex; align-items: center; gap: 5px; background: var(--panel);
  border: 1px solid var(--border-2); color: #6f594d; border-radius: 9999px; padding: 5px 11px;
  font-family: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.ent-replay:hover:not(:disabled) { background: var(--red); color: #fff; border-color: var(--red); }
.ent-replay:disabled { opacity: .55; cursor: default; }
.ent-log-err {
  font-size: 11px; color: #6f594d; margin-top: 6px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ent-log-err.open { white-space: normal; overflow-wrap: anywhere; }
.ent-log-next { font-size: 10.5px; color: var(--faint); margin-top: 4px; }

.ent-info { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 12px; }
.ent-info-k { font-weight: 700; color: var(--muted); }
.ent-info-v { color: var(--muted-2); overflow-wrap: anywhere; line-height: 1.45; }

@media (max-width: 799px) {
  .ent-thead { display: none; }
  .ent-row { grid-template-columns: 1fr 1fr auto; }
  .ent-row .ent-email, .ent-row .ent-time { display: none; }
}

/* ============================================================
   FORMS STUDIO v2 — faithful to the owner's three v2 designs.
   Palette: #fff9f0 cream · #faede0 panel · #e8d7c8 border ·
   #f5e9dc hairline · #4a2c20 ink · #5f4a41 sub · #9b8579 muted ·
   #dc5744 terracotta · #4ab0a7 teal · #f1b35c amber · #3b2318 brown
   ============================================================ */
:root {
  --fx-bg: #fff9f0;
  --fx-panel: #faede0;
  --fx-border: #e8d7c8;
  --fx-hair: #f5e9dc;
  --fx-ink: #4a2c20;
  --fx-sub: #5f4a41;
  --fx-muted: #9b8579;
  --fx-red: #dc5744;
  --fx-red-dark: #c44130;
  --fx-red-soft: #fbeae7;
  --fx-teal: #4ab0a7;
  --fx-teal-dark: #2f7a73;
  --fx-teal-soft: rgba(74,176,167,.14);
  --fx-amber: #f1b35c;
  --fx-amber-dark: #a06d1e;
  --fx-amber-soft: rgba(241,179,92,.25);
  --fx-brown: #3b2318;
}
@media (prefers-reduced-motion: reduce) {
  .fxroot *, .fx-modal * { transition: none !important; animation: none !important; }
}

/* the Studio owns its whole area — hide the shared header, drop padding */
body.in-forms .header { display: none; }
body.in-forms .content { padding: 0; overflow: hidden; }
.fxroot { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--fx-bg); font-family: 'Nunito', sans-serif; color: var(--fx-ink); }
.fx-spacer { flex: 1 1 auto; }
.fx-vrule { width: 1px; height: 22px; background: var(--fx-hair); margin: 0 4px; flex: none; }
.fx-hr { height: 1px; background: var(--fx-hair); margin: 4px 0; }
.fx-empty { font-size: 12.5px; font-weight: 600; color: var(--fx-muted); padding: 18px 8px; text-align: center; }
.fxroot .dot, .fx-modal .dot { width: 7px; height: 7px; border-radius: 999px; flex: none; display: inline-block; }

/* ---- pill tabs ---- */
.fx-pilltabs { display: flex; gap: 2px; background: var(--fx-panel); border-radius: 999px; padding: 3px; flex: none; }
.fx-pilltab { display: inline-flex; align-items: center; gap: 6px; border: none; cursor: pointer; border-radius: 999px; padding: 7px 16px; white-space: nowrap; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13px; background: transparent; color: var(--fx-sub); }
.fx-pilltab.on { background: #fff; color: var(--fx-red); box-shadow: 0 1px 4px rgba(0,0,0,.10); }

/* ---- buttons ---- */
.fx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: none; cursor: pointer; border-radius: 999px; padding: 10px 18px; white-space: nowrap; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13px; background: var(--fx-panel); color: var(--fx-ink); }
.fx-btn:disabled { opacity: .55; cursor: default; }
.fx-btn-ico { display: inline-flex; align-items: center; }
.fx-btn-primary { background: var(--fx-red); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.fx-btn-primary:hover:not(:disabled) { background: var(--fx-red-dark); }
.fx-btn-saved { background: var(--fx-teal); color: #fff; }
.fx-btn-dark { background: var(--fx-brown); color: #fff; }
.fx-btn-dark:hover:not(:disabled) { background: var(--fx-red); }
.fx-btn-soft { background: var(--fx-panel); color: var(--fx-sub); }
.fx-btn-soft:hover:not(:disabled) { background: var(--fx-amber); color: var(--fx-ink); }
.fx-btn-outline { background: transparent; color: var(--fx-red); border: 1.5px solid var(--fx-red); padding: 8.5px 16.5px; }
.fx-btn-outline:hover:not(:disabled) { background: var(--fx-red-soft); }
.fx-btn-outline-soft { background: #fff; color: var(--fx-ink); border: 1.5px solid var(--fx-border); padding: 8.5px 16.5px; }
.fx-btn-outline-soft:hover:not(:disabled) { border-color: var(--fx-red); color: var(--fx-red); }
.fx-btn-teal { background: var(--fx-teal); color: #fff; }
.fx-btn-teal:hover:not(:disabled) { filter: brightness(1.08); }
.fx-btn-teal-outline { background: transparent; color: var(--fx-teal); border: 1.5px solid var(--fx-teal); padding: 8.5px 16.5px; }
.fx-btn-teal-outline:hover:not(:disabled) { background: var(--fx-teal); color: #fff; }
.fx-btn-block { width: 100%; }
.fx-btn-sm { padding: 8px 15px; font-size: 12.5px; }
.fx-btn-sm.fx-btn-outline-soft, .fx-btn-sm.fx-btn-outline { padding: 6.5px 13.5px; }
.fx-btn-xs { padding: 6px 14px; font-size: 12px; }
.fx-btn-grow { flex: 1; }
.fx-mini { border: 1px solid var(--fx-border); background: #fff; color: var(--fx-sub); cursor: pointer; border-radius: 999px; padding: 4px 11px; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 10.5px; white-space: nowrap; }
.fx-mini:hover:not(:disabled) { border-color: var(--fx-teal); color: var(--fx-teal-dark); }
.fx-mini.danger:hover { border-color: var(--fx-red); color: var(--fx-red); }
.fx-mini:disabled { opacity: .5; cursor: default; }
.fx-iconbtn { border: none; background: transparent; cursor: pointer; padding: 8px; border-radius: 9px; color: var(--fx-sub); display: inline-flex; align-items: center; }
.fx-iconbtn:hover:not(:disabled) { background: var(--fx-panel); }
.fx-iconbtn:disabled { color: #d9c7b8; cursor: default; }
.fx-iconbtn.danger:hover { color: var(--fx-red); background: var(--fx-red-soft); }
.fx-circle-btn { width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--fx-border); background: var(--fx-bg); color: var(--fx-ink); cursor: pointer; display: flex; align-items: center; justify-content: center; flex: none; }
.fx-circle-btn:disabled { opacity: .5; cursor: default; }
.fx-sqbtn { width: 28px; height: 28px; border: none; background: var(--fx-panel); color: var(--fx-sub); cursor: pointer; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.fx-sqbtn.teal { background: var(--fx-teal-soft); color: var(--fx-teal); }
.fx-sqbtn.teal:hover { background: var(--fx-teal); color: #fff; }
.fx-sqbtn.amber { background: var(--fx-amber-soft); color: var(--fx-amber-dark); }
.fx-sqbtn.amber:hover { background: var(--fx-amber); color: var(--fx-ink); }
.fx-sqbtn.red { background: var(--fx-red-soft); color: var(--fx-red); }
.fx-sqbtn.red:hover { background: var(--fx-red); color: #fff; }

/* ---- topbar ---- */
.fx-topbar { height: 64px; flex: none; background: #fff; border-bottom: 1px solid var(--fx-border); display: flex; align-items: center; gap: 18px; padding: 0 22px; z-index: 5; }
.fx-topbar-title { font-weight: 900; font-size: 20px; white-space: nowrap; }
.fx-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ---- overview: 3 columns ---- */
.fx-overview { display: flex; flex: 1; min-height: 0; }
.fx-rail { flex: none; background: #fff; display: flex; flex-direction: column; min-height: 0; }
.fx-rail-left { width: 232px; border-right: 1px solid var(--fx-border); }
.fx-rail-right { width: 292px; border-left: 1px solid var(--fx-border); }
.fx-rail-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px; }
.fx-rail-title { font-weight: 900; font-size: 14.5px; }
.fx-rail-note { font-size: 11.5px; font-weight: 600; color: var(--fx-muted); padding: 0 16px 10px; line-height: 1.45; }
.fx-rail-list { flex: 1; overflow-y: auto; padding: 4px 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.fx-ws { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 12px; border-radius: 12px; border: none; cursor: pointer; text-align: left; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13px; background: transparent; color: var(--fx-sub); }
.fx-ws:hover { background: var(--fx-panel); }
.fx-ws.on { background: var(--fx-brown); color: #fff; }
.fx-ws.on:hover { background: var(--fx-brown); }
.fx-ws-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-ws-count { font-weight: 700; font-size: 11.5px; color: var(--fx-muted); }
.fx-ws.on .fx-ws-count { color: rgba(255,255,255,.6); }

.fx-main { flex: 1; min-width: 0; overflow-y: auto; padding: 22px 24px; }
.fx-main-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.fx-main-title { font-weight: 900; font-size: 18px; white-space: nowrap; }
.fx-brand-chip { color: #fff; border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 11px; white-space: nowrap; }
.fx-search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--fx-border); border-radius: 999px; padding: 9px 15px; width: 250px; max-width: 100%; }
.fx-search-ico { color: var(--fx-muted); display: flex; }
.fx-search input { border: none; background: none; outline: none; font-family: 'Nunito', sans-serif; font-weight: 600; font-size: 13px; color: var(--fx-ink); width: 100%; }
.fx-status-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 15px; }
.fx-chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--fx-border); cursor: pointer; border-radius: 999px; padding: 7px 14px; white-space: nowrap; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 12px; background: #fff; color: var(--fx-sub); }
.fx-chip.on { border-color: var(--fx-red); background: rgba(220,87,68,.12); color: #b8412f; }
.fx-chip-n { font-weight: 700; font-size: 10.5px; opacity: .7; }

/* form cards */
.fx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.fx-card { background: #fff; border: 1px solid var(--fx-border); border-radius: 1.5rem; padding: 17px 19px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 2px rgba(59,35,24,.05); }
.fx-card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fx-status { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3.5px 11px 3.5px 8px; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.fx-status .dot { width: 6px; height: 6px; }
.fx-status.is-live { background: var(--fx-teal-soft); color: var(--fx-teal-dark); }
.fx-status.is-live .dot { background: var(--fx-teal); }
.fx-status.is-draft { background: rgba(95,74,65,.12); color: var(--fx-sub); }
.fx-status.is-draft .dot { background: var(--fx-muted); }
.fx-transform { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--fx-border); background: var(--fx-bg); color: var(--fx-sub); cursor: pointer; border-radius: 999px; padding: 5px 10px; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 10.5px; white-space: nowrap; }
.fx-transform:hover { border-color: var(--fx-teal); color: var(--fx-teal-dark); }
.fx-card-title { font-weight: 800; font-size: 15px; line-height: 1.25; }
.fx-card-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 11.5px; font-weight: 600; color: var(--fx-muted); }
.fx-card-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; border-top: 1px solid var(--fx-hair); padding-top: 9px; }
.fx-cstat { display: flex; flex-direction: column; gap: 1px; }
.fx-cstat-k { font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--fx-muted); }
.fx-cstat-v { font-weight: 900; font-size: 16px; }
.fx-cstat-v.teal { color: var(--fx-teal-dark); }
.fx-card-acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* latest submissions rail */
.fx-subs-head { border-bottom: 1px solid var(--fx-hair); gap: 8px; justify-content: flex-start; padding: 16px 18px 12px; }
.fx-subs-ico { color: var(--fx-red); display: flex; }
.fx-subs-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.fx-sub-row { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-bottom: 1px solid var(--fx-hair); cursor: pointer; }
.fx-sub-row:hover { background: var(--fx-bg); }
.fx-sub-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fx-sub-form { font-weight: 700; font-size: 12px; line-height: 1.35; }
.fx-sub-meta { display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; color: var(--fx-muted); }
.fx-sub-meta .dot { width: 6px; height: 6px; }
.fx-sub-chip { flex: none; background: var(--fx-panel); border-radius: 999px; padding: 3.5px 10px; font-weight: 800; font-size: 11px; white-space: nowrap; }
.fx-subs-foot { padding: 12px 18px; border-top: 1px solid var(--fx-hair); }

/* ---- templates ---- */
.fx-tplrail-hd { padding: 16px 16px 4px; display: block; }
.fx-tplsearch { width: 440px; max-width: 100%; margin-bottom: 15px; padding: 10px 16px; }
.fx-tplcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.fx-tplblank { background: #fff; border: 1.5px dashed #d9c7b8; border-radius: 1.5rem; min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: pointer; color: var(--fx-sub); font-family: 'Nunito', sans-serif; }
.fx-tplblank:hover { border-color: var(--fx-red); color: var(--fx-red); }
.fx-tplblank-circle { width: 52px; height: 52px; border-radius: 999px; background: rgba(220,87,68,.1); display: flex; align-items: center; justify-content: center; color: var(--fx-red); }
.fx-tplblank-tx { font-weight: 800; font-size: 14px; }
.fx-tplcard { background: #fff; border: 1px solid var(--fx-border); border-radius: 1.5rem; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(59,35,24,.05); transition: box-shadow .15s; }
.fx-tplcard:hover { box-shadow: 0 10px 24px rgba(59,35,24,.10); }
.fx-tpltile { height: 110px; display: flex; align-items: center; justify-content: center; flex: none; }
.fx-tpltile-circle { width: 52px; height: 52px; border-radius: 999px; background: rgba(255,255,255,.9); display: flex; align-items: center; justify-content: center; }
.fx-tpltile-ic { display: flex; }
.fx-tplbody { padding: 13px 16px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.fx-tplname { font-weight: 800; font-size: 14px; line-height: 1.3; }
.fx-tplmeta { font-size: 11.5px; font-weight: 600; color: var(--fx-muted); }
.fx-tpldesc { font-size: 12px; font-weight: 600; color: var(--fx-sub); line-height: 1.45; flex: 1; }
.fx-tplacts { display: flex; gap: 6px; margin-top: auto; }
.fx-tplacts .fx-btn { flex: 1; }

/* ---- all forms table ---- */
.fx-tablewrap { flex: 1; overflow-y: auto; padding: 22px 26px; }
.fx-table { max-width: 980px; margin: 0 auto; background: #fff; border: 1px solid var(--fx-border); border-radius: 1.5rem; overflow: hidden; box-shadow: 0 1px 2px rgba(59,35,24,.05); }
.fx-thead { display: grid; grid-template-columns: 64px 1fr 250px 90px; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--fx-border); background: var(--fx-bg); }
.fx-thead span { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--fx-muted); }
.fx-trow { display: grid; grid-template-columns: 64px 1fr 250px 90px; gap: 14px; padding: 15px 22px; border-bottom: 1px solid var(--fx-hair); align-items: center; }
.fx-trow:hover { background: var(--fx-bg); }
.fx-tid { font-size: 12px; font-weight: 700; color: var(--fx-muted); font-family: ui-monospace, Menlo, monospace; }
.fx-ttitle { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fx-tlink { border: none; background: none; padding: 0; cursor: pointer; text-align: left; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 14px; color: var(--fx-ink); line-height: 1.3; }
.fx-tlink:hover { color: var(--fx-red); }
.fx-tmeta { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--fx-muted); }
.fx-tmeta .dot { width: 6px; height: 6px; }
.fx-shortcode { justify-self: start; background: var(--fx-panel); border: 1px solid var(--fx-border); border-radius: .6rem; padding: 5px 10px; font: 11px ui-monospace, Menlo, monospace; color: var(--fx-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; cursor: pointer; }
.fx-shortcode:hover { border-color: var(--fx-teal); color: var(--fx-teal-dark); }
.fx-tentries { font-weight: 800; font-size: 13px; color: var(--fx-teal-dark); }
.fx-tentries.zero { color: var(--fx-muted); }

/* ---- analytics ---- */
.fx-anwrap { flex: 1; overflow-y: auto; padding: 22px 26px; display: flex; flex-direction: column; gap: 16px; }
.fx-anwrap > * { max-width: 980px; margin-left: auto; margin-right: auto; width: 100%; }
.fx-anhead { display: flex; align-items: baseline; gap: 12px; }
.fx-anhead-title { font-weight: 900; font-size: 19px; }
.fx-anhead-sub { font-size: 12px; font-weight: 600; color: var(--fx-muted); }
.fx-ancard { background: #fff; border: 1px solid var(--fx-border); border-radius: 1.5rem; padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 1px 2px rgba(59,35,24,.05); }
.fx-ancard-hd { font-weight: 900; font-size: 15.5px; }
.fx-anbig { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.fx-anbig-cell { display: flex; flex-direction: column; gap: 8px; }
.fx-anbig-k { font-size: 12.5px; font-weight: 700; color: var(--fx-sub); }
.fx-anbig-v { font-weight: 900; font-size: 34px; line-height: 1; }
.fx-anbig-sub { font-size: 11.5px; font-weight: 600; color: var(--fx-teal-dark); min-height: 14px; }
.fx-anbig-rule { border-bottom: 3px dotted var(--fx-teal); opacity: .55; margin-top: 6px; }
.fx-anrule { height: 1px; background: var(--fx-hair); }
.fx-ansec { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px; }
.fx-ansec-cell { display: flex; flex-direction: column; gap: 5px; }
.fx-ansec-k { font-size: 12px; font-weight: 700; color: var(--fx-sub); }
.fx-ansec-v { font-weight: 900; font-size: 26px; line-height: 1; }
.fx-anusage { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.fx-anuse-cell { display: flex; flex-direction: column; gap: 6px; }
.fx-anuse-row { display: flex; align-items: baseline; gap: 5px; }
.fx-anuse-v { font-weight: 900; font-size: 22px; line-height: 1; }
.fx-anuse-lim { font-size: 12px; font-weight: 600; color: var(--fx-muted); }
.fx-annote { font-size: 11.5px; font-weight: 600; color: var(--fx-muted); }
.fx-anbars { display: flex; flex-direction: column; gap: 10px; }
.fx-anbar-row { display: flex; align-items: center; gap: 12px; }
.fx-anbar-label { width: 110px; flex: none; font-size: 12px; font-weight: 700; color: var(--fx-sub); }
.fx-anbar-track { flex: 1; height: 8px; border-radius: 999px; background: var(--fx-panel); overflow: hidden; }
.fx-anbar-fill { height: 100%; border-radius: 999px; }
.fx-anbar-val { width: 56px; flex: none; text-align: right; font-weight: 800; font-size: 12.5px; }

/* ---- integrations ---- */
.fx-intwrap, .fx-intdetail { flex: 1; overflow-y: auto; padding: 22px 26px; display: flex; flex-direction: column; gap: 16px; }
.fx-intwrap > *, .fx-intdetail > * { max-width: 1020px; margin-left: auto; margin-right: auto; width: 100%; }
.fx-inthead { display: flex; flex-direction: column; gap: 4px; }
.fx-inthead-title { font-weight: 900; font-size: 19px; }
.fx-inthead-sub { font-size: 13px; font-weight: 600; color: var(--fx-muted); }
.fx-intcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.fx-intcard { background: #fff; border: 1px solid var(--fx-border); border-radius: 1.5rem; padding: 18px 20px; display: flex; flex-direction: column; gap: 11px; box-shadow: 0 1px 2px rgba(59,35,24,.05); transition: box-shadow .15s; }
.fx-intcard:hover { box-shadow: 0 10px 24px rgba(59,35,24,.10); }
.fx-intcard-top { display: flex; align-items: center; gap: 11px; }
.fx-int-circle { width: 40px; height: 40px; border-radius: 999px; display: flex; align-items: center; justify-content: center; flex: none; }
.fx-int-circle.lg { width: 46px; height: 46px; }
.fx-int-circle.sm { width: 36px; height: 36px; }
.fx-int-ic { display: flex; }
.fx-intcard-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fx-int-name { font-weight: 800; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-int-connected { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--fx-teal-dark); }
.fx-int-connected .dot { width: 6px; height: 6px; background: var(--fx-teal); }
.fx-int-badge { align-self: flex-start; background: var(--fx-amber-soft); color: var(--fx-amber-dark); border-radius: 999px; padding: 2px 9px; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.fx-int-desc { font-size: 12.5px; font-weight: 600; color: var(--fx-sub); line-height: 1.5; flex: 1; }
.fx-intcard-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-intdetail-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fx-intdetail-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fx-intdetail-name { font-weight: 900; font-size: 20px; }
.fx-intdetail-desc { font-size: 12.5px; font-weight: 600; color: var(--fx-muted); }
.fx-intcardbox { background: #fff; border: 1px solid var(--fx-border); border-radius: 1.5rem; overflow: hidden; box-shadow: 0 1px 2px rgba(59,35,24,.05); display: flex; flex-direction: column; }
.fx-intcardbox-head { display: flex; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--fx-border); background: var(--fx-bg); }
.fx-intcardbox-hd { font-weight: 900; font-size: 15.5px; }
.fx-intcardbox > .fx-intcardbox-hd { padding: 18px 22px 4px; }
.fx-conn-row { display: flex; align-items: center; gap: 12px; padding: 15px 22px; border-bottom: 1px solid var(--fx-hair); }
.fx-conn-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fx-conn-title { font-weight: 800; font-size: 14px; }
.fx-conn-sub { font-size: 12px; font-weight: 600; color: var(--fx-muted); }
.fx-conn-used { font-size: 12px; font-weight: 700; color: var(--fx-sub); white-space: nowrap; }
.fx-conn-note { margin: 14px 22px 4px; background: var(--fx-bg); border: 1px solid var(--fx-hair); border-radius: 1rem; padding: 13px 16px; display: flex; flex-direction: column; gap: 5px; }
.fx-conn-note-hd { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--fx-amber-dark); }
.fx-conn-note-tx { font-size: 12.5px; font-weight: 600; color: var(--fx-sub); line-height: 1.5; }
.fx-connforms { padding: 12px 22px 18px; display: flex; flex-direction: column; gap: 6px; }
.fx-connforms-hd { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--fx-muted); padding: 4px 0; }
.fx-connform { display: flex; align-items: center; gap: 7px; border: none; background: transparent; padding: 3px 0; cursor: pointer; font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700; color: var(--fx-ink); text-align: left; }
.fx-connform:hover { color: var(--fx-red); }
.fx-connform-ic { color: var(--fx-muted); display: flex; }
.fx-chatwoot-hero { background: var(--fx-brown); border-radius: 1.5rem; padding: 22px 24px; display: flex; flex-direction: column; gap: 8px; }
.fx-cw-eyebrow { align-self: flex-start; background: var(--fx-amber-soft); color: var(--fx-amber); border-radius: 999px; padding: 4px 12px; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.fx-cw-title { font-weight: 900; font-size: 20px; color: #fff; line-height: 1.2; }
.fx-cw-sub { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.7); line-height: 1.5; max-width: 560px; }
.fx-cw-channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 11px; padding: 12px 22px 18px; }
.fx-cw-channel { display: flex; align-items: center; gap: 11px; border: 1px solid #f0e2d4; border-radius: 1rem; padding: 11px 14px; }
.fx-cw-channel-tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fx-cw-channel-name { font-weight: 800; font-size: 13.5px; }
.fx-cw-channel-via { font-size: 11px; font-weight: 600; color: var(--fx-muted); }
.fx-cw-unlock { display: flex; align-items: flex-start; gap: 10px; padding: 5px 22px; }
.fx-cw-check { color: var(--fx-teal); flex: none; display: flex; margin-top: 2px; }
.fx-cw-unlock-tx { font-size: 13.5px; font-weight: 600; line-height: 1.5; }
.fx-intcardbox .fx-intcard-acts { padding: 12px 22px 18px; }

/* ============ BUILDER ============ */
.fx-bld { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.fx-bldbar { display: flex; align-items: center; gap: 8px; background: #fff; border-bottom: 1px solid var(--fx-border); padding: 8px 16px; flex: none; z-index: 8; flex-wrap: wrap; }
.fx-backcaret svg { transform: rotate(180deg); }
.fx-bldtitle { display: inline-flex; align-items: center; gap: 7px; padding: 0 6px; min-width: 0; }
.fx-bldtitle-pen { color: var(--fx-muted); cursor: pointer; display: flex; }
.fx-bldtitle-tx { font-weight: 800; font-size: 14.5px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; cursor: text; border-radius: 8px; padding: 4px 6px; }
.fx-bldtitle-tx:hover { background: var(--fx-panel); }
.fx-bldtitle-input { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 14.5px; color: var(--fx-ink); border: 1px solid var(--fx-teal); border-radius: 8px; padding: 4px 8px; outline: none; width: 190px; background: #fff; }
.fx-minisel { border: 1px solid var(--fx-border); border-radius: 999px; background: #fff; padding: 6px 10px; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 12px; color: var(--fx-sub); outline: none; max-width: 130px; }
.fx-minisel:disabled { opacity: .65; }
.fx-livepill { border: none; cursor: pointer; border-radius: 999px; padding: 6px 13px; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 11.5px; }
.fx-livepill.is-live { background: var(--fx-teal-soft); color: var(--fx-teal-dark); }
.fx-livepill.is-draft { background: rgba(95,74,65,.12); color: var(--fx-sub); }
.fx-bldtabs { margin: 0 6px; }
.fx-bldslug { flex: none; display: flex; align-items: center; gap: 8px; padding: 5px 18px; font-size: 11px; font-weight: 600; color: var(--fx-muted); font-family: ui-monospace, Menlo, monospace; background: var(--fx-bg); border-bottom: 1px solid var(--fx-hair); }
.fx-bldbody { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.fx-quizbody { display: block; overflow-y: auto; }

/* editor canvas */
.fx-editor { display: flex; }
.fx-canvas { flex: 1; min-width: 0; overflow-y: auto; padding: 28px 32px 70px; }
.fx-canvas-inner { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; }
.fx-steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.fx-step { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--fx-border); background: #fff; color: var(--fx-sub); cursor: pointer; border-radius: 999px; padding: 6px 13px 6px 6px; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 12px; }
.fx-step.on { border-color: var(--fx-red); color: var(--fx-red); background: var(--fx-red-soft); }
.fx-step-n { width: 20px; height: 20px; border-radius: 999px; background: var(--fx-panel); color: var(--fx-sub); display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 900; }
.fx-step.on .fx-step-n { background: var(--fx-red); color: #fff; }
.fx-step-c { font-size: 10px; font-weight: 700; opacity: .65; }
.fx-step-add { border: 1.5px dashed var(--fx-border); background: transparent; color: var(--fx-muted); cursor: pointer; border-radius: 999px; padding: 7px 13px; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 12px; }
.fx-step-add:hover { border-color: var(--fx-red); color: var(--fx-red); }
.fx-stephd { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.fx-stephd-f { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 180px; }
.fx-stephd-f label { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--fx-muted); }
.fx-stephd-f input { border: 1px solid var(--fx-border); border-radius: 10px; background: #fff; padding: 8px 11px; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 13px; color: var(--fx-ink); outline: none; }
.fx-stephd-f input:focus { border-color: var(--fx-teal); }
.fx-rows { display: flex; flex-direction: column; }
.fx-canvas-empty { border: 1.5px dashed var(--fx-border); border-radius: 14px; background: #fff; padding: 40px 24px; text-align: center; color: var(--fx-muted); font-weight: 700; font-size: 13px; }
.fx-canvas-empty.droptarget { border-color: var(--fx-teal); background: rgba(74,176,167,.08); }
.fx-row { position: relative; width: 100%; border: 1.5px dashed var(--fx-border); border-radius: 14px; background: #fff; padding: 20px 24px; display: grid; grid-template-columns: 1fr; }
.fx-row:hover { border-color: var(--fx-red); }
.fx-row.two { grid-template-columns: 1fr 1px 1fr; gap: 0 24px; }
.fx-row-div { background: #f0e4d6; width: 1px; }
.fx-fcell { position: relative; display: flex; flex-direction: column; gap: 9px; cursor: grab; border-left: 3px solid transparent; margin-left: -14px; padding: 4px 0 4px 11px; border-radius: 2px; min-width: 0; }
.fx-fcell.on { border-left-color: var(--fx-red); background: #fffaf5; }
.fx-fcell.droptarget { box-shadow: 0 -2px 0 0 var(--fx-teal); }
.fx-ftools { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; background: var(--fx-brown); border-radius: 10px; padding: 4px; box-shadow: 0 4px 12px rgba(59,35,24,.25); opacity: 0; pointer-events: none; z-index: 3; transition: opacity .15s; }
.fx-fcell:hover .fx-ftools { opacity: 1; pointer-events: auto; }
.fx-ftool { border: none; background: transparent; cursor: pointer; padding: 5px 8px; border-radius: 7px; color: #fff9f0; display: inline-flex; align-items: center; }
.fx-ftool:hover { background: rgba(255,255,255,.14); }
.fx-ftool.danger:hover { background: rgba(220,87,68,.5); }
.fx-ftool.grab { color: var(--fx-amber); cursor: grab; }
.fx-ftool.grab svg { transform: rotate(90deg); }
.fx-frow-label { display: flex; align-items: center; gap: 6px; }
.fx-freq { color: var(--fx-red); font-weight: 800; font-size: 14px; line-height: 1; }
.fx-flabel { font-weight: 700; font-size: 14.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fx-fchips { display: flex; gap: 7px; margin-left: auto; align-items: center; flex: none; }
.fx-fchip-ic { color: var(--fx-amber); display: flex; }
.fx-fchip { font-size: 9.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; background: var(--fx-panel); color: var(--fx-sub); border-radius: 5px; padding: 2px 7px; white-space: nowrap; }
.fx-fprev { min-width: 0; }
.fx-ghostinput { display: flex; align-items: center; border: 1px solid var(--fx-border); border-radius: 10px; padding: 11px 13px; background: #fff; min-height: 40px; }
.fx-ghostinput.tall { min-height: 70px; align-items: flex-start; }
.fx-ghost-ph { font-size: 13.5px; color: #b3a294; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-ghost-caret { margin-left: auto; color: var(--fx-sub); display: flex; }
.fx-ghostopts { display: flex; flex-direction: column; gap: 10px; padding-top: 2px; }
.fx-ghostopt { display: flex; align-items: center; gap: 9px; min-width: 0; }
.fx-ghostopt.consent { align-items: flex-start; }
.fx-ghostopt-tx { font-size: 13.5px; color: var(--fx-sub); font-weight: 400; line-height: 1.4; min-width: 0; }
.fx-ghostmark { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #c9b8a9; flex: none; box-sizing: border-box; }
.fx-ghostmark.round { border-radius: 999px; }
.fx-ghostmore { font-size: 11.5px; font-weight: 700; color: var(--fx-muted); padding-left: 25px; }
.fx-ghostprice { margin-left: auto; font-weight: 800; font-size: 12.5px; color: var(--fx-red); white-space: nowrap; }
.fx-ghostcoupon { display: flex; gap: 8px; align-items: center; }
.fx-ghostcoupon .fx-ghostinput { flex: 1; }
.fx-ghostapply { background: var(--fx-panel); border-radius: 999px; padding: 8px 15px; font-weight: 800; font-size: 11.5px; color: var(--fx-sub); }
.fx-ghosthidden { border: 1.5px dashed var(--fx-border); border-radius: 10px; padding: 10px 13px; font-size: 12px; font-weight: 600; color: var(--fx-muted); background: var(--fx-bg); }
.fx-ghostinfo { border: 1px solid var(--fx-border); border-left: 4px solid #4ab0a7; border-radius: 10px; padding: 10px 13px; font-size: 12px; font-weight: 600; color: var(--fx-sub); background: var(--fx-bg); line-height: 1.5; }
.fx-ghostpair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fx-ghostdrop { border: 1.5px dashed #ccc; border-radius: 12px; padding: 12px 14px; color: var(--fx-muted); font-size: 12.5px; font-weight: 600; background: #fafafa; }
.fx-dropzone { display: flex; align-items: center; justify-content: center; margin: 5px 0; border: 1.5px dashed transparent; border-radius: 12px; transition: background .12s; }
.fx-dropzone .fx-drop-plus { width: 26px; height: 26px; border-radius: 999px; border: none; background: var(--fx-border); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; margin: 4px 0; flex: none; opacity: 0; transition: opacity .12s; }
.fx-dropzone:hover .fx-drop-plus { opacity: 1; }
.fx-dropzone .fx-drop-plus:hover { background: var(--fx-red); }
.fx-dropzone.droptarget { border-color: var(--fx-teal); background: rgba(74,176,167,.10); min-height: 40px; }
.fx-dropzone.droptarget .fx-drop-plus { opacity: 1; }

/* builder right sidebar */
.fx-side { width: 392px; flex: none; background: #fff; border-left: 1px solid var(--fx-border); display: flex; flex-direction: column; min-height: 0; }
.fx-sidetabs { display: flex; gap: 4px; border-bottom: 1px solid var(--fx-hair); padding: 0 16px; flex: none; }
.fx-sidetab { border: none; background: transparent; cursor: pointer; padding: 14px 9px 11px; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13px; color: var(--fx-sub); border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.fx-sidetab.on { color: var(--fx-red); border-bottom-color: var(--fx-red); }
.fx-sidebody { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.fx-palsearch { width: 100%; border-radius: 10px; padding: 9px 13px; }
.fx-palgroups { display: flex; flex-direction: column; gap: 12px; }
.fx-palgroup { border: 1px solid var(--fx-hair); border-radius: 14px; padding: 13px 14px; display: flex; flex-direction: column; gap: 11px; background: #fffdf9; }
.fx-palgroup-hd { display: flex; align-items: center; justify-content: space-between; border: none; background: transparent; cursor: pointer; padding: 0; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13px; color: var(--fx-red); }
.fx-palgroup-caret { display: flex; color: inherit; }
.fx-palgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fx-palitem { display: flex; align-items: center; gap: 8px; border: 1px solid var(--fx-border); background: #fff; border-radius: 10px; padding: 10px 11px; cursor: grab; text-align: left; min-width: 0; }
.fx-palitem:hover { border-color: var(--fx-red); background: var(--fx-bg); }
.fx-palitem-ic { color: var(--fx-sub); flex: none; display: flex; }
.fx-palitem-lb { font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 12px; color: var(--fx-ink); line-height: 1.25; min-width: 0; }
.fx-nosel { border: 1.5px dashed var(--fx-border); border-radius: 14px; padding: 26px 18px; text-align: center; color: var(--fx-muted); font-size: 12.5px; font-weight: 600; line-height: 1.55; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.fx-nosel-ico { font-size: 22px; color: #d9c7b8; }

/* input customization */
.fx-custom { gap: 14px; }
.fx-custom-hd { display: flex; align-items: center; gap: 9px; }
.fx-custom-ico { width: 30px; height: 30px; border-radius: 9px; background: rgba(220,87,68,.12); display: flex; align-items: center; justify-content: center; flex: none; color: var(--fx-red); }
.fx-custom-type { font-weight: 800; font-size: 14px; }
.fx-minipills { display: inline-flex; background: var(--fx-panel); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; align-self: flex-start; }
.fx-minipill { border: none; cursor: pointer; border-radius: 999px; padding: 6px 11px; white-space: nowrap; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 11.5px; background: transparent; color: var(--fx-sub); }
.fx-minipill.on { background: #fff; color: var(--fx-red); box-shadow: 0 1px 4px rgba(0,0,0,.10); }
.fx-minipills.disabled { opacity: .55; }
.fx-minipills.disabled .fx-minipill { cursor: not-allowed; }
.fx-sub-hd { font-weight: 800; font-size: 13.5px; }
.fx-sub-hd.inline { display: inline; }
.fx-optsec { display: flex; flex-direction: column; gap: 10px; }
.fx-togglecard { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--fx-panel); border-radius: 12px; padding: 12px 14px; }
.fx-togglecard.disabled { opacity: .6; }
.fx-togglecard-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fx-togglecard-lb { font-weight: 800; font-size: 13px; }
.fx-togglecard-sub { font-size: 11.5px; font-weight: 600; color: var(--fx-muted); line-height: 1.4; }
.bld-tog.disabled { opacity: .55; cursor: not-allowed; }
.fx-checkline { display: flex; gap: 16px; flex-wrap: wrap; }
.fx-checkrow { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.fx-checkrow.disabled { cursor: not-allowed; opacity: .65; }
.fx-checkbox { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid #c9b8a9; background: transparent; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; color: #fff; flex: none; }
.fx-checkbox svg { opacity: 0; }
.fx-checkbox.on { border-color: var(--fx-teal); background: var(--fx-teal); }
.fx-checkbox.on svg { opacity: 1; }
.fx-checkrow-lb { font-size: 12.5px; font-weight: 700; color: var(--fx-sub); }
.fx-soon { font-size: 8.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; background: var(--fx-amber-soft); color: var(--fx-amber-dark); border-radius: 999px; padding: 1px 6px; }
.fx-dsnote { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; color: var(--fx-sub); background: var(--fx-bg); border: 1px solid var(--fx-hair); border-radius: 10px; padding: 9px 12px; line-height: 1.45; }
.fx-dsnote > span { flex: 1; }
.fx-optlist { display: flex; flex-direction: column; gap: 7px; max-height: 270px; overflow-y: auto; padding-right: 4px; }
.fx-optrow { display: flex; align-items: center; gap: 8px; }
.fx-optrow .fx-ghostmark { width: 15px; height: 15px; }
.fx-optgrab { color: #c9b8a9; cursor: grab; flex: none; display: flex; }
.fx-optrow input { flex: 1; min-width: 0; padding: 8px 11px; border-radius: 9px; border: 1px solid var(--fx-border); font-family: 'Nunito', sans-serif; font-size: 12.5px; color: var(--fx-ink); outline: none; }
.fx-optrow input:focus { border-color: var(--fx-teal); }
.fx-optbtn { width: 22px; height: 22px; border-radius: 999px; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; color: #fff; }
.fx-optbtn.add { background: var(--fx-teal); }
.fx-optbtn.rm { background: var(--fx-red); }
.fx-optbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-radiosec { display: flex; flex-direction: column; gap: 9px; }
.fx-radiorow { display: flex; gap: 18px; }
.fx-radio { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--fx-sub); }
.fx-radio.on { color: var(--fx-red); }
.fx-radiodot { width: 16px; height: 16px; border-radius: 999px; border: 1.5px solid #c9b8a9; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
.fx-radio.on .fx-radiodot { border-color: var(--fx-red); background: var(--fx-red); box-shadow: inset 0 0 0 3px var(--fx-red), inset 0 0 0 5px #fff; }
.fx-condhd { display: flex; align-items: center; gap: 6px; }
.fx-condhd-ic { color: var(--fx-amber); display: flex; }
.fx-condsub { font-size: 12px; font-weight: 700; color: var(--fx-sub); }
.fx-advbox { border: 1px solid var(--fx-hair); border-radius: 14px; background: #fffdf9; overflow: hidden; }
.fx-advhd { display: flex; align-items: center; justify-content: space-between; width: 100%; border: none; background: transparent; cursor: pointer; padding: 13px 15px; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13.5px; color: var(--fx-red); }
.fx-advbody { padding: 2px 15px 16px; display: flex; flex-direction: column; gap: 13px; }
.fx-histbox { border: 1px solid var(--fx-hair); border-radius: 14px; background: #fffdf9; overflow: hidden; }
.fx-histbox-hd { display: flex; align-items: center; padding: 13px 15px; border-bottom: 1px solid var(--fx-hair); }
.fx-histbox-title { font-weight: 800; font-size: 14px; color: var(--fx-red); }
.fx-histrow { display: flex; align-items: center; gap: 11px; padding: 12px 15px; border-bottom: 1px solid var(--fx-hair); }
.fx-histrow.current { background: var(--fx-bg); }
.fx-histdot { width: 9px; height: 9px; border-radius: 999px; background: var(--fx-border); flex: none; }
.fx-histrow.current .fx-histdot { background: var(--fx-teal); }
.fx-histtx { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fx-histwhat { font-weight: 800; font-size: 12.5px; }
.fx-histwhen { font-size: 11.5px; font-weight: 600; color: var(--fx-muted); }
.fx-histnote { font-size: 11px; font-weight: 600; color: var(--fx-muted); padding: 11px 15px; line-height: 1.45; }

/* ============ builder settings & integrations ============ */
.fx-settings { display: flex; }
.fx-setnav { width: 250px; flex: none; background: #fff; border-right: 1px solid var(--fx-border); overflow-y: auto; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.fx-setnav-gh { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; font-weight: 800; font-size: 13.5px; color: var(--fx-ink); }
.fx-setnav-gh .fx-palgroup-caret { color: var(--fx-muted); }
.fx-setnav-sub { display: flex; border: none; cursor: pointer; text-align: left; padding: 8.5px 12px 8.5px 22px; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 12.5px; background: transparent; color: var(--fx-sub); border-left: 2px solid var(--fx-hair); margin-left: 12px; border-radius: 0 10px 10px 0; }
.fx-setnav-sub:hover { color: var(--fx-red); }
.fx-setnav-sub.on { background: var(--fx-brown); color: #fff; border-left-color: var(--fx-brown); }
.fx-setnav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.fx-setnav-item { display: flex; border: none; cursor: pointer; text-align: left; border-radius: 10px; padding: 9.5px 12px; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 13px; background: transparent; color: var(--fx-sub); }
.fx-setnav-item:hover { color: var(--fx-red); }
.fx-setnav-item.on { background: var(--fx-brown); color: #fff; }
.fx-setnav-item.mono { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; margin-top: auto; color: var(--fx-muted); }
.fx-setstage { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 28px 60px; background: var(--fx-bg); }
.fx-setcard { max-width: 960px; margin: 0 auto; background: #fff; border: 1px solid var(--fx-border); border-radius: 1.5rem; padding: 24px 28px; box-shadow: 0 1px 3px rgba(59,35,24,.04); }
.fx-set-head { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--fx-hair); padding-bottom: 16px; margin-bottom: 18px; }
.fx-set-title { font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.fx-set-body { display: flex; flex-direction: column; gap: 16px; }
.fx-set-lb { font-weight: 800; font-size: 13.5px; }
.fx-set-lb.sm { font-size: 12.5px; }
.fx-set-lb.req::before { content: '* '; color: var(--fx-red); }
.fx-set-body > input, .fx-indent input, .fx-set-body select { border: 1px solid var(--fx-border); border-radius: 10px; background: #fff; padding: 10px 13px; font-family: 'Nunito', sans-serif; font-size: 13.5px; color: var(--fx-ink); outline: none; width: 100%; }
.fx-set-body > input:focus { border-color: var(--fx-teal); }
.fx-radiopills { display: flex; gap: 9px; flex-wrap: wrap; }
.fx-radiopill { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--fx-border); background: #fff; color: var(--fx-sub); cursor: pointer; border-radius: 999px; padding: 9px 17px; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 13px; }
.fx-radiopill.on { border-color: var(--fx-red); background: var(--fx-red-soft); color: var(--fx-red); }
.fx-radiopill.disabled { opacity: .55; cursor: not-allowed; }
.fx-radiodot2 { width: 15px; height: 15px; border-radius: 999px; border: 1.5px solid #c9b8a9; box-sizing: border-box; }
.fx-radiodot2.on { border-color: var(--fx-red); background: var(--fx-red); box-shadow: inset 0 0 0 2.5px var(--fx-red), inset 0 0 0 4.5px #fff; }
.fx-msged { border: 1px solid var(--fx-border); border-radius: 14px; overflow: hidden; }
.fx-msged-tb { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--fx-hair); background: #fffdf9; }
.fx-msged-tab { border-radius: 8px; padding: 5px 12px; font-weight: 700; font-size: 12px; color: var(--fx-muted); cursor: pointer; }
.fx-msged-tab.on { background: var(--fx-panel); color: var(--fx-ink); font-weight: 800; }
.fx-msged-tab.disabled { cursor: not-allowed; opacity: .6; }
.fx-msged-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--fx-border); color: var(--fx-sub); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 11.5px; cursor: pointer; }
.fx-msged-btn:hover { border-color: var(--fx-teal); color: var(--fx-teal-dark); }
.fx-msged-fmt { display: flex; align-items: center; gap: 3px; padding: 7px 12px; border-bottom: 1px solid var(--fx-hair); background: #fffdf9; }
.fx-fmtbtn { border: 1px solid var(--fx-border); background: #fff; border-radius: 7px; padding: 4px 9px; font-size: 11.5px; font-weight: 700; color: var(--fx-sub); cursor: pointer; font-family: 'Nunito', sans-serif; }
.fx-fmtbtn:hover { border-color: var(--fx-red); color: var(--fx-red); }
.fx-msged-body textarea { width: 100%; border: none; outline: none; padding: 14px 16px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; line-height: 1.6; color: var(--fx-ink); resize: vertical; display: block; }
.fx-msged-visual { min-height: 140px; padding: 14px 16px; font-size: 13.5px; line-height: 1.6; color: var(--fx-ink); outline: none; }
.fx-msged-codes { padding: 9px 12px; border-top: 1px solid var(--fx-hair); background: #fffdf9; }
.fx-indent { border-left: 2px solid var(--fx-hair); padding-left: 16px; display: flex; flex-direction: column; gap: 8px; }
.fx-callout { font-size: 12px; font-weight: 600; color: var(--fx-muted); line-height: 1.55; background: var(--fx-bg); border-radius: 12px; padding: 12px 14px; }
.fx-callout.warn { background: var(--fx-amber-soft); color: var(--fx-amber-dark); font-weight: 700; }
.fx-mapgrid { display: grid; grid-template-columns: 220px 1fr; gap: 12px 24px; align-items: center; }
.fx-mapgrid.disabled { opacity: .6; }
.fx-map-h { font-weight: 800; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--fx-muted); padding: 10px 0 2px; }
.fx-map-k { font-size: 13px; font-weight: 700; }
.fx-req-star { color: var(--fx-red); }
.fx-notiflist { display: grid; grid-template-columns: 130px 1fr 1fr 118px; gap: 0 16px; align-items: stretch; }
.fx-feedlist { display: grid; grid-template-columns: 130px 60px 1fr 90px; gap: 0 16px; align-items: center; }
.fx-nl-cell { display: flex; align-items: center; gap: 9px; padding: 13px 0; border-top: 1px solid var(--fx-hair); font-size: 12.5px; color: var(--fx-sub); min-width: 0; }
.fx-nl-status { justify-content: flex-start; }
.fx-nl-statustx { font-weight: 700; font-size: 12.5px; color: var(--fx-red); }
.fx-nl-statustx.ok { color: var(--fx-teal); }
.fx-nl-name { font-size: 13px; font-weight: 700; color: var(--fx-ink); line-height: 1.4; flex-direction: column; align-items: flex-start; gap: 2px; justify-content: center; }
.fx-nl-name.clicky { cursor: pointer; }
.fx-nl-name.clicky:hover { color: var(--fx-red); }
.fx-nl-subject { line-height: 1.4; overflow: hidden; }
.fx-nl-subject.mono { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.fx-nl-acts { gap: 6px; }
.fx-feedic { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.fx-feed-sub { font-size: 11px; font-weight: 600; color: var(--fx-muted); }
.fx-addint { position: relative; }
.fx-addint-menu { position: absolute; top: 44px; right: 0; width: 280px; background: #fff; border: 1px solid var(--fx-border); border-radius: 16px; box-shadow: 0 12px 32px rgba(59,35,24,.14); padding: 10px; display: flex; flex-direction: column; gap: 3px; z-index: 20; max-height: 320px; overflow-y: auto; }
.fx-addint-item { border: none; background: transparent; cursor: pointer; text-align: left; border-radius: 8px; padding: 8px 10px; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 12.5px; color: var(--fx-sub); }
.fx-addint-item:hover { background: var(--fx-bg); color: var(--fx-red); }
.fx-addint-none { font-size: 12px; font-weight: 600; color: var(--fx-muted); padding: 8px 10px; line-height: 1.4; }
.fx-confcard { border: 1px solid var(--fx-hair); border-radius: 14px; padding: 15px 16px; display: flex; flex-direction: column; gap: 12px; background: #fffdf9; }
.fx-condline { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.fx-condline-tx { font-size: 13px; font-weight: 600; color: var(--fx-sub); }
.fx-condline select, .fx-condline input { border: 1px solid var(--fx-border); border-radius: 9px; background: #fff; padding: 8px 11px; font-family: 'Nunito', sans-serif; font-size: 12.5px; color: var(--fx-ink); outline: none; max-width: 220px; }
.fx-portal select { background: var(--fx-panel); }

/* ============ builder entries + payments ============ */
.fx-entriesbody { display: block; overflow-y: auto; padding: 24px 28px 60px; background: var(--fx-bg); }
.fx-entrycard { max-width: 1040px; }
.fx-countchip { background: var(--fx-teal-soft); color: var(--fx-teal); border-radius: 999px; padding: 6px 13px; font-weight: 800; font-size: 12px; white-space: nowrap; }
.fx-entrylist { display: grid; grid-template-columns: 84px 1.2fr 1.2fr 1fr .8fr; gap: 0 16px; align-items: center; }
.fx-paylist { display: grid; grid-template-columns: 84px 1fr 1fr 90px 84px 100px 100px; gap: 0 14px; align-items: center; margin-top: 8px; }
.fx-entrynum { border: none; background: none; padding: 13px 0; cursor: pointer; text-align: left; font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 800; color: var(--fx-red); border-top: 1px solid var(--fx-hair); }
.fx-entpill { display: inline-flex; align-items: center; background: var(--fx-panel); border-radius: 999px; padding: 4px 11px; font-weight: 700; font-size: 11px; white-space: nowrap; }
.fx-stripechip { display: inline-flex; align-items: center; gap: 5px; background: #EEF1FD; color: #635BFF; border-radius: 999px; padding: 4px 11px; font-weight: 700; font-size: 11.5px; }
.fx-entrydetail { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.fx-entrybc { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fx-entrybc-link { border: none; background: none; padding: 0; cursor: pointer; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 17px; color: var(--fx-red); }
.fx-entrybc-sep { color: #c9b8a9; font-weight: 700; }
.fx-entrybc-cur { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.fx-entrygrid { display: grid; grid-template-columns: 1fr 350px; gap: 16px; align-items: start; }
.fx-entryleft { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.fx-entcard { background: #fff; border: 1px solid var(--fx-border); border-radius: 1.5rem; padding: 20px 24px; }
.fx-entcard-hd { display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--fx-hair); padding-bottom: 13px; margin-bottom: 4px; }
.fx-entcard-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--fx-panel); display: inline-flex; align-items: center; justify-content: center; color: var(--fx-sub); flex: none; }
.fx-entcard-title { font-weight: 800; font-size: 16px; }
.fx-entkv { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--fx-hair); }
.fx-entk { font-weight: 800; font-size: 13px; }
.fx-entv { font-size: 13px; color: var(--fx-sub); line-height: 1.5; word-break: break-word; }
.fx-ordertbl { display: grid; grid-template-columns: 1fr 60px 110px 110px; border: 1px solid var(--fx-hair); border-radius: 12px; overflow: hidden; margin-top: 12px; }
.fx-ordertbl-h { font-weight: 800; font-size: 12.5px; background: var(--fx-bg); padding: 11px 14px; }
.fx-ordertbl-c { font-size: 13px; color: var(--fx-sub); padding: 11px 14px; border-top: 1px solid var(--fx-hair); }
.fx-ordertbl-t { font-weight: 800; font-size: 12.5px; padding: 11px 14px; border-top: 1px solid var(--fx-hair); background: var(--fx-bg); }
.fx-ordertbl-t.right { text-align: right; }
.fx-payamt { display: flex; align-items: center; gap: 9px; padding: 12px 0 4px; }
.fx-payamt-v { font-weight: 800; font-size: 17px; }
.fx-paygrid { display: grid; grid-template-columns: 150px 1fr; gap: 11px 16px; font-size: 13px; padding-top: 10px; }
.fx-payk { font-weight: 800; }
.fx-payv { color: var(--fx-sub); word-break: break-all; }
.fx-payv.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.fx-payv.teal { color: var(--fx-teal); }
.fx-logrow { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--fx-hair); align-items: flex-start; }
.fx-logbadge { border-radius: 999px; padding: 3px 10px; font-weight: 800; font-size: 10.5px; flex: none; margin-top: 1px; text-transform: capitalize; }
.fx-logtx { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.fx-logtitle { font-size: 13px; }
.fx-logtitle b { font-weight: 800; }
.fx-logerr { font-size: 12px; color: var(--fx-sub); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; font-family: ui-monospace, Menlo, monospace; max-width: 100%; }
.fx-logerr.open { white-space: normal; word-break: break-word; }
.fx-lognext { font-size: 11.5px; font-weight: 700; color: var(--fx-amber-dark); }
.fx-entactions { display: flex; gap: 10px; flex-wrap: wrap; }
.fx-entinfo { position: sticky; top: 0; }
.fx-inforow { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--fx-hair); font-size: 12.5px; }
.fx-infok { font-weight: 800; width: 110px; flex: none; }
.fx-infov { color: var(--fx-sub); word-break: break-word; line-height: 1.45; min-width: 0; }
.fx-infov.teal { color: var(--fx-teal); }
.fx-entstatusrow { display: flex; gap: 8px; padding-top: 14px; }

/* ============ modals ============ */
.fx-modal { max-width: 720px; width: 100%; border-radius: 1.5rem; padding: 24px 28px; display: flex; flex-direction: column; gap: 14px; font-family: 'Nunito', sans-serif; color: var(--fx-ink); }
.fx-modal-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fx-modal-title { font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.fx-modal-sub { font-size: 13px; font-weight: 600; color: var(--fx-sub); margin-top: 4px; }
.fx-modal-note { font-size: 12px; font-weight: 600; color: var(--fx-muted); line-height: 1.55; }
.fx-modal-acts { display: flex; gap: 9px; justify-content: flex-end; }
.fx-modal-acts.left { justify-content: flex-start; }
.fx-bulkmodal { max-width: 760px; }
.fx-dschips { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-dschip { border: 1px solid var(--fx-border); background: #fff; color: var(--fx-sub); cursor: pointer; border-radius: 999px; padding: 8px 15px; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.fx-dschip:hover { border-color: var(--fx-red); color: var(--fx-red); }
.fx-dschip.on { border-color: var(--fx-red); background: var(--fx-red-soft); color: var(--fx-red); }
.fx-bulkta { width: 100%; border: 1px solid var(--fx-border); border-radius: 14px; outline: none; padding: 14px 16px; font-family: 'Nunito', sans-serif; font-size: 13.5px; line-height: 1.65; color: var(--fx-ink); resize: vertical; }
.fx-bulkta:focus { border-color: var(--fx-teal); }
.fx-bulkta:disabled { background: var(--fx-panel); color: var(--fx-muted); }
.fx-sharebox { max-width: 720px; }
.fx-sharetabs { align-self: flex-start; }
.fx-share-hd { font-weight: 800; font-size: 14px; }
.fx-share-desc { font-size: 12.5px; font-weight: 600; color: var(--fx-sub); line-height: 1.55; margin-top: 4px; }
.fx-share-extra { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.fx-share-extra:empty { display: none; }
.fx-codebox { position: relative; background: var(--fx-brown); border-radius: 14px; padding: 16px 18px; max-height: 280px; overflow-y: auto; }
.fx-code { margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: 12px; line-height: 1.6; color: #fff9f0; white-space: pre-wrap; word-break: break-all; padding-right: 84px; }
.fx-copybtn { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; border: none; background: var(--fx-bg); color: var(--fx-ink); cursor: pointer; border-radius: 999px; padding: 7px 13px; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 12px; }
.fx-copybtn.copied { background: var(--fx-teal); color: #fff; }
.fx-replaymodal { max-width: 860px; }
.fx-replaygrid { display: grid; grid-template-columns: 52px 1.4fr 100px 90px 110px; gap: 0 14px; align-items: center; border: 1px solid var(--fx-hair); border-radius: 14px; padding: 4px 18px; }

/* ===== Connectors (Phase 10) ===== */
.connectorsview { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; max-width: 780px; }

.conn-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conn-spacer { flex: 1; }
.conn-brandtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.conn-brandtab {
  border: 1px solid var(--border); background: #fff; color: var(--muted-2); cursor: pointer;
  border-radius: 9999px; padding: 6px 14px; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 12.5px;
}
.conn-brandtab.on { background: var(--panel); }
.conn-hint { font-size: 11.5px; color: var(--muted); line-height: 1.5; padding: 0 2px; }

.conn-list { display: flex; flex-direction: column; gap: 8px; }
.conn-card { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--green); border-radius: 13px; padding: 11px 14px; }
.conn-card.is-off { border-left-color: var(--faint); opacity: .78; }
.conn-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.conn-name { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 15px; color: var(--ink); }
.conn-badge.is-on { color: var(--green); background: var(--green-soft); }
.conn-badge.is-off { color: #a06d1e; background: #f7ecd6; }
.conn-method { color: var(--muted-2); background: var(--panel); }
.conn-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.conn-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted-2); overflow-wrap: anywhere; }
.conn-tag { font-size: 11px; font-weight: 700; color: var(--muted-3); background: var(--panel); border-radius: 9999px; padding: 2px 9px; }

.conn-iconbtn {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none;
  border: 1px solid var(--border); background: #fff; color: var(--muted-2); border-radius: 9px; cursor: pointer;
}
.conn-iconbtn:hover { border-color: var(--red); color: var(--red); }
.conn-editor-title { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 16px; color: var(--ink); }

.conn-form { display: flex; flex-direction: column; gap: 14px; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.conn-field { display: flex; flex-direction: column; gap: 6px; }
.conn-field > label, .conn-secret-row > label, .conn-sublabel {
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 12.5px; color: var(--muted-2);
}
.conn-form input, .conn-form select, .conn-textarea {
  border: 1px solid var(--border); border-radius: 10px; background: var(--cream); padding: 10px 13px;
  font-family: 'DM Sans', sans-serif; font-size: 13.5px; color: var(--ink); outline: none; width: 100%;
}
.conn-form input:focus, .conn-form select:focus, .conn-textarea:focus { border-color: var(--red); background: #fff; }
.conn-textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5; resize: vertical; }
.conn-note { font-size: 11px; color: var(--muted); line-height: 1.5; }

.conn-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; align-self: flex-start; }
.conn-segbtn { border: none; background: #fff; color: var(--muted-2); cursor: pointer; padding: 8px 16px; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 12.5px; border-right: 1px solid var(--border); }
.conn-segbtn:last-child { border-right: none; }
.conn-segbtn.on { background: var(--red); color: #fff; }

.conn-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--panel); border-radius: 12px; padding: 11px 14px; }
.conn-toggle-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.conn-toggle-lb { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13px; color: var(--ink); }
.conn-toggle-sub { font-size: 11.5px; color: var(--muted-2); line-height: 1.4; }

.conn-sub { display: flex; flex-direction: column; gap: 8px; }
.conn-hrow { display: flex; align-items: center; gap: 8px; }
.conn-hrow > input { flex: 1; }
.conn-secret-row { display: flex; flex-direction: column; gap: 6px; }

.conn-ref { border: 1px solid var(--border); border-radius: 10px; background: var(--cream); padding: 4px 12px; }
.conn-ref > summary { cursor: pointer; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 12.5px; color: var(--muted-2); padding: 8px 0; }
.conn-ref-body { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 10px; }
.conn-ref-tbl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; align-items: baseline; }
.conn-ref-k { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--red-dark); }
.conn-ref-v { font-size: 11.5px; color: var(--muted-2); }

.conn-test { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); padding-top: 14px; }
.conn-result { border-radius: 11px; padding: 11px 13px; border: 1px solid var(--border); }
.conn-result.ok { border-color: #bfe3d3; background: var(--green-soft); }
.conn-result.warn { border-color: #ecd3a0; background: #f7ecd6; }
.conn-result.err { border-color: #e6b8ab; background: #fbe4de; }
.conn-result-head { display: flex; align-items: center; gap: 8px; }
.conn-result-status { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13px; color: var(--muted-2); }
.conn-result-err { font-size: 12px; color: #c0492f; margin-top: 4px; overflow-wrap: anywhere; }
.conn-snippet { margin: 8px 0 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; line-height: 1.5; color: #4a2c20; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow-y: auto; }

/* Connectors picker inside the form builder Settings tab */
.fx-connpick { display: flex; flex-direction: column; gap: 8px; }
.fx-connpick-row { display: flex; align-items: center; gap: 11px; border: 1px solid var(--fx-border); border-radius: 12px; padding: 10px 13px; background: #fff; cursor: pointer; }
.fx-connpick-row.on { border-color: var(--fx-teal); background: var(--fx-hair); }
.fx-connpick-row.off { opacity: .72; }
.fx-connpick-row.stale { cursor: default; border-style: dashed; }
.fx-connpick-row > input[type="checkbox"] { width: 17px; height: 17px; flex: none; accent-color: var(--fx-teal); }
.fx-connpick-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fx-connpick-name { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13.5px; color: var(--fx-ink); display: flex; align-items: center; gap: 8px; }
.fx-connpick-pill { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #a06d1e; background: #f7ecd6; border-radius: 9999px; padding: 2px 8px; }
.fx-connpick-sub { font-size: 11.5px; color: var(--fx-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }

/* responsive */
@media (max-width: 1250px) { .fx-rail-right { display: none; } }
@media (max-width: 1020px) { .fx-rail-left { display: none; } .fx-side { width: 320px; } }
@media (max-width: 860px) {
  .fx-editor { flex-direction: column; overflow-y: auto; }
  .fx-side { width: 100%; border-left: none; border-top: 1px solid var(--fx-border); }
  .fx-canvas { overflow: visible; }
  .fx-entrygrid { grid-template-columns: 1fr; }
  .fx-settings { flex-direction: column; overflow-y: auto; }
  .fx-setnav { width: 100%; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--fx-border); }
}
