:root {
  --ink: #172033;
  --muted: #6c7486;
  --line: #e7e9f0;
  --surface: #ffffff;
  --page: #f5f6fa;
  --primary: #5b5bd6;
  --primary-dark: #4747bd;
  --primary-soft: #efefff;
  --danger: #d34b5b;
  --success: #1d9a6c;
  --warning: #c78018;
  --shadow: 0 12px 35px rgba(33, 39, 61, .07);
  --sidebar-width: 254px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.icon { width: 19px; height: 19px; flex: 0 0 auto; }
.is-hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 5px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.button {
  min-height: 41px; border: 1px solid transparent; border-radius: 9px; padding: 0 16px; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px; font-weight: 720; font-size: 13px; cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 8px 20px rgba(91, 91, 214, .22); }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { color: #30364a; background: #fff; border-color: #dddfea; }
.button-secondary:hover, .button-ghost:hover { border-color: #c9cbe0; background: #fafaff; }
.button-ghost { min-height: 38px; padding: 0 10px; color: var(--muted); background: transparent; }
.button-danger { color: var(--danger); border-color: #f2ccd1; background: #fff7f8; }
.button-large { min-height: 49px; font-size: 14px; }
.button-block { width: 100%; }
.danger-text { color: var(--danger) !important; }

.icon-button {
  width: 37px; height: 37px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #e1e3eb;
  border-radius: 9px; color: #626a7d; background: #fff; cursor: pointer; transition: .16s ease;
}
.icon-button:hover { color: var(--primary); border-color: #c7c7ee; background: #f7f7ff; }
.icon-button-accent { color: #fff; background: var(--primary); border-color: var(--primary); }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span, .field-heading > span { color: #3a4052; font-size: 12px; font-weight: 750; }
.field small { color: #8990a0; font-size: 11px; line-height: 1.45; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 42px; border: 1px solid #dfe2ea; border-radius: 8px; padding: 10px 12px; outline: none;
  color: #252b3d; background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #8d8de5; box-shadow: 0 0 0 3px rgba(91, 91, 214, .1); }
.form-grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-span { grid-column: 1 / -1; }
.form-divider { position: relative; border-top: 1px solid var(--line); margin: 9px 0 0; }
.form-divider span { position: relative; top: -9px; padding-right: 12px; color: #70778a; background: #fff; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }

.alert { margin: 0 0 18px; border: 1px solid; border-radius: 9px; padding: 13px 15px; font-size: 13px; line-height: 1.5; }
.alert-error { color: #a23845; border-color: #f1cbd0; background: #fff4f5; }
.alert-success { color: #14744f; border-color: #bfe4d5; background: #f0fbf6; }

/* Authentication and installer */
.auth-page { display: grid; min-height: 100vh; background: #f2f3f8; }
.login-wrap { width: min(1160px, calc(100% - 48px)); min-height: 690px; margin: auto; display: grid; grid-template-columns: .88fr 1.12fr; overflow: hidden; border-radius: 22px; background: #fff; box-shadow: 0 28px 80px rgba(31, 36, 59, .14); }
.login-panel { padding: 54px 68px; display: flex; flex-direction: column; justify-content: center; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(140deg, #7676ee, #4c4cc7); box-shadow: 0 8px 18px rgba(91, 91, 214, .24); font-weight: 850; font-size: 18px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.02em; }
.brand small { margin-top: 2px; color: #8b91a1; font-size: 10px; }
.brand-login { position: absolute; top: 56px; }
.login-panel { position: relative; }
.login-copy { margin-bottom: 28px; }
.login-copy h1 { margin: 0 0 10px; font-size: clamp(30px, 4vw, 42px); letter-spacing: -.04em; }
.login-copy > p:last-child { max-width: 420px; margin: 0; color: var(--muted); line-height: 1.65; }
.login-form { display: grid; gap: 18px; }
.password-field { position: relative; display: flex; }
.password-field input { padding-right: 76px; }
.password-field button { position: absolute; right: 8px; top: 7px; bottom: 7px; border: 0; color: var(--primary); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.login-art { position: relative; overflow: hidden; background: linear-gradient(145deg, #202352 0%, #5b5bd6 63%, #7c72e8 100%); }
.login-art::before { content: ""; position: absolute; width: 470px; height: 470px; border-radius: 50%; top: -150px; right: -130px; background: rgba(255, 255, 255, .08); }
.art-orbit { position: absolute; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; }
.orbit-one { width: 520px; height: 520px; left: 60px; top: 84px; }
.orbit-two { width: 370px; height: 370px; left: 135px; top: 159px; }
.art-card { position: absolute; border: 1px solid rgba(255,255,255,.24); border-radius: 16px; color: #fff; background: rgba(255,255,255,.13); box-shadow: 0 24px 65px rgba(11, 14, 57, .28); backdrop-filter: blur(18px); }
.art-card-main { width: 340px; left: 50%; top: 50%; padding: 28px; transform: translate(-50%, -50%) rotate(-2deg); }
.art-card-main strong { display: block; margin: 7px 0; font-size: 19px; }
.mini-label { color: #d9d9ff; font-size: 10px; letter-spacing: .1em; font-weight: 800; }
.flow-line { display: block; width: 2px; height: 34px; margin: 12px 0 12px 8px; background: rgba(255,255,255,.5); }
.art-card-small { right: 28px; bottom: 80px; padding: 15px 18px; display: flex; align-items: center; gap: 20px; font-size: 12px; transform: rotate(3deg); }
.art-card-small b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #326d57; background: #a9f0d4; }

.install-layout { width: min(1180px, calc(100% - 48px)); margin: auto; display: grid; grid-template-columns: .78fr 1.22fr; overflow: hidden; border-radius: 22px; box-shadow: var(--shadow); }
.install-intro { padding: 60px; color: #fff; background: linear-gradient(155deg, #272957, #5b5bd6); }
.brand-mark-large { width: 50px; height: 50px; margin-bottom: 50px; font-size: 22px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); }
.install-intro .eyebrow { color: #cfcfff; }
.install-intro h1 { margin: 0 0 18px; font-size: 38px; line-height: 1.12; letter-spacing: -.04em; }
.install-intro > p:not(.eyebrow) { color: #d9d9ee; line-height: 1.7; }
.feature-checklist { margin: 36px 0 0; padding: 0; list-style: none; display: grid; gap: 15px; }
.feature-checklist li::before { content: "✓"; margin-right: 10px; color: #a9f0d4; font-weight: 900; }
.install-card { padding: 46px 54px; background: #fff; }
.section-heading { margin-bottom: 26px; }
.section-heading h2 { margin: 0; font-size: 25px; }

/* Admin shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 20px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fff; z-index: 30; }
.sidebar .brand { padding: 0 8px 26px; border-bottom: 1px solid var(--line); }
.nav-list { padding-top: 22px; display: grid; gap: 6px; }
.nav-item { padding: 11px 12px; display: flex; align-items: center; gap: 11px; border-radius: 9px; color: #697084; font-size: 13px; font-weight: 680; }
.nav-item:hover { color: #353b50; background: #f6f7fa; }
.nav-item.is-active { color: var(--primary); background: var(--primary-soft); }
.sidebar-user { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 35px minmax(0, 1fr) 34px; gap: 9px; align-items: center; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 11px; }
.sidebar-user small { margin-top: 2px; color: #969baa; font-size: 9px; }
.sidebar-user .icon-button { width: 33px; height: 33px; border: 0; }
.avatar { width: 35px; height: 35px; border-radius: 9px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 850; }
.main-column { min-width: 0; }
.topbar { min-height: 84px; padding: 18px 34px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.mobile-menu { display: none; }
.content { padding: 28px 34px 48px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 20px; }
.stat-card { min-height: 112px; padding: 22px; display: flex; align-items: center; gap: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 4px 16px rgba(31,36,59,.025); }
.stat-card small, .stat-card strong { display: block; }
.stat-card small { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.stat-card strong { font-size: 28px; letter-spacing: -.04em; }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; }
.stat-purple { color: #5b5bd6; background: #efefff; }.stat-green { color: #18865e; background: #e8f8f1; }.stat-blue { color: #2470b7; background: #ebf4fc; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 5px 20px rgba(31,36,59,.03); }
.panel-header { min-height: 88px; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.panel-header.compact { min-height: 78px; }
.panel-header h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.02em; }
.panel-header p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; }
.panel-footer { padding: 18px 24px; display: flex; justify-content: flex-end; border-top: 1px solid var(--line); }
.empty-state { min-height: 330px; padding: 50px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-icon { width: 58px; height: 58px; margin-bottom: 16px; border-radius: 16px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); }
.empty-icon .icon { width: 25px; height: 25px; }
.empty-state h3 { margin: 0 0 8px; font-size: 17px; }.empty-state p { max-width: 390px; margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 20px; color: #898f9f; background: #fafbfc; font-size: 10px; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 16px 20px; border-top: 1px solid #eff0f4; color: #555d70; font-size: 12px; vertical-align: middle; }
.data-table tbody tr:hover { background: #fcfcfe; }
.table-primary { display: flex; align-items: center; gap: 12px; min-width: 230px; }
.form-color { width: 8px; height: 38px; border-radius: 5px; background: var(--form-color); }
.table-primary strong, .table-primary small, .table-date { display: block; }
.table-primary strong { color: #242a3d; font-size: 13px; }.table-primary small, .table-date { margin-top: 3px; color: #989dac; font-size: 10px; }
.response-link { color: var(--primary); font-weight: 750; }
.actions-column { width: 230px; text-align: right !important; }.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.badge { width: max-content; padding: 5px 9px; display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-published { color: #167451; background: #eaf8f2; }.badge-draft { color: #6c7486; background: #eff1f4; }.badge-warning { color: #9b6414; background: #fff4df; }.badge-error { color: #ab3f4c; background: #fff0f2; }
.action-menu { position: relative; }
.action-menu summary { list-style: none; font-weight: 800; }
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu-popover { position: absolute; right: 0; top: 43px; width: 150px; padding: 5px; z-index: 12; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow); }
.action-menu-popover.is-ported { position: fixed; width: 165px; z-index: 1000; box-shadow: 0 18px 45px rgba(31,36,59,.18); }
.action-menu-popover button { width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; text-align: left; background: transparent; color: #555d70; font-size: 11px; cursor: pointer; }.action-menu-popover button:hover { background: #f5f6f9; }

/* Builder */
.builder-topbar { margin: -28px -34px 0; min-height: 71px; padding: 12px 22px; display: grid; grid-template-columns: auto minmax(180px,1fr) auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); background: #fff; }
.builder-name-fields { min-width: 0; }
.builder-title-input { width: min(440px, 100%); padding: 2px 4px; border: 1px solid transparent; border-radius: 6px; outline: none; color: #242a3d; background: transparent; font-weight: 780; }
.builder-title-input:focus { border-color: #d7d8e9; background: #fafaff; }
.save-state { display: block; padding-left: 5px; color: #a0a5b3; font-size: 9px; }.save-state.is-saved { color: var(--success); }
.builder-actions { display: flex; gap: 8px; }
.builder-shell { height: calc(100vh - 155px); margin: 0 -34px -48px; display: grid; grid-template-columns: 220px minmax(410px, 1fr) 330px; overflow: hidden; }
.builder-palette, .builder-inspector { overflow-y: auto; background: #fff; }
.builder-palette { padding: 24px 15px; border-right: 1px solid var(--line); }
.palette-heading { padding: 0 8px 18px; }.palette-heading h2 { margin: 0; font-size: 15px; }
.palette-group { display: grid; gap: 6px; margin-bottom: 22px; }
.palette-label { padding: 0 8px 4px; color: #9aa0ae; font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.palette-item { width: 100%; padding: 9px; display: grid; grid-template-columns: 39px 1fr; gap: 11px; align-items: center; border: 1px solid transparent; border-radius: 9px; color: #42495d; background: transparent; text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.palette-item:hover { border-color: #dddff5; background: #f9f9ff; transform: translateX(2px); }
.palette-symbol { width: 39px; height: 39px; border: 1px solid #dedfff; border-radius: 10px; display: grid; place-items: center; color: #5b5bd6; background: linear-gradient(145deg, #f8f8ff, #eeeeff); box-shadow: 0 3px 9px rgba(91,91,214,.07); transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.palette-symbol .icon { width: 18px; height: 18px; stroke-width: 1.75; }
.palette-item:hover .palette-symbol { color: #fff; border-color: var(--primary); background: linear-gradient(145deg, #7777ec, #5656d2); box-shadow: 0 7px 16px rgba(91,91,214,.2); transform: scale(1.03); }
.palette-item strong, .palette-item small { display: block; }.palette-item strong { font-size: 11px; }.palette-item small { margin-top: 2px; color: #999ead; font-size: 9px; }
.builder-canvas-wrap { overflow-y: auto; padding: 20px clamp(20px, 4vw, 62px) 60px; background: var(--preview-bg); }
.canvas-toolbar { max-width: 720px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: space-between; color: #7c8393; font-size: 10px; }
.canvas-toolbar span { display: flex; align-items: center; gap: 7px; font-weight: 700; }.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #24aa79; box-shadow: 0 0 0 3px rgba(36,170,121,.12); }
.form-preview { position: relative; max-width: 720px; min-height: 550px; margin: auto; overflow: hidden; border: 1px solid rgba(32,38,60,.08); border-radius: 14px; background: #fff; box-shadow: 0 18px 55px rgba(31,36,59,.09); }
.preview-header { position: relative; padding: 34px 40px 27px; border-bottom: 1px solid var(--line); }
.preview-accent { position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--preview-accent); }
.preview-header > p:first-of-type { margin: 0 0 7px; color: var(--preview-accent); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.preview-header h2 { margin: 0 0 9px; font-size: 26px; letter-spacing: -.035em; }.preview-header > p:last-child { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.elements-list { padding: 22px 28px 5px; display: grid; gap: 9px; }
.builder-element { position: relative; min-height: 74px; padding: 21px 18px 17px 30px; border: 1px solid transparent; border-radius: 10px; background: #fff; cursor: pointer; transition: .14s ease; }
.builder-element:hover { border-color: #dddfee; background: #fdfdff; }.builder-element.is-selected { border-color: var(--preview-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--preview-accent) 12%, transparent); }
.builder-element.is-dragging { opacity: .4; }.builder-element.is-drag-over { border-top-color: var(--primary); transform: translateY(3px); }
.drag-handle { position: absolute; left: 9px; top: 28px; color: #bdc1cc; font-size: 13px; cursor: grab; }
.element-type-badge { position: absolute; right: 11px; top: 8px; padding: 3px 6px; border-radius: 5px; color: #8e94a2; background: #f1f2f5; font-size: 8px; font-weight: 750; opacity: 0; transition: .15s; }.builder-element:hover .element-type-badge, .builder-element.is-selected .element-type-badge { opacity: 1; }
.element-actions { position: absolute; right: 10px; bottom: -17px; display: none; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; box-shadow: 0 7px 20px rgba(31,36,59,.12); z-index: 3; }.builder-element.is-selected .element-actions { display: flex; }
.element-actions button { width: 31px; height: 30px; border: 0; border-right: 1px solid var(--line); color: #747b8d; background: #fff; cursor: pointer; }.element-actions button:last-child { border: 0; }.element-actions button:hover { background: #f6f6fb; }
.element-content h3 { margin: 0; font-size: 22px; letter-spacing: -.03em; }.element-content h4 { margin: 0; font-size: 16px; }.preview-paragraph { margin: 0; color: #686f80; font-size: 12px; line-height: 1.65; white-space: pre-line; }
.preview-question { display: grid; gap: 7px; }.preview-question strong { color: #343a4c; font-size: 12px; }.preview-question strong em { color: var(--preview-accent); font-style: normal; }.preview-question small { color: #969ba8; font-size: 10px; }
.preview-question input, .preview-question textarea, .preview-question select { width: 100%; min-height: 39px; border: 1px solid #e0e2e9; border-radius: 7px; padding: 9px 11px; color: #a0a4af; background: #fafbfc; font-size: 11px; resize: none; }
.calculated-preview-note { width: max-content; margin-top: -2px; padding: 3px 7px; border-radius: 20px; color: #5555c4 !important; background: #f0f0ff; font-size: 8px !important; font-weight: 800; letter-spacing: .02em; }
.radio-preview { display: flex; gap: 20px; padding: 8px 0; color: #6f7688; font-size: 11px; }
.canvas-empty { min-height: 285px; margin: 20px 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #d8dae3; border-radius: 10px; color: #9297a5; text-align: center; }.canvas-empty > span { width: 44px; height: 44px; margin-bottom: 12px; border-radius: 50%; display: grid; place-items: center; color: var(--preview-accent); background: color-mix(in srgb, var(--preview-accent) 10%, white); font-size: 24px; }.canvas-empty strong { color: #555c6e; font-size: 13px; }.canvas-empty p { margin: 6px 0 0; font-size: 10px; }
.preview-submit { min-width: 150px; min-height: 42px; margin: 24px 40px 34px; border: 0; border-radius: 8px; color: #fff; background: var(--preview-accent); font-size: 11px; font-weight: 800; }
.builder-inspector { border-left: 1px solid var(--line); }
.inspector-tabs { height: 54px; padding: 0 12px; display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 5; }
.inspector-tabs button { position: relative; border: 0; color: #8b91a1; background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }.inspector-tabs button.is-active { color: var(--primary); }.inspector-tabs button.is-active::after { content: ""; position: absolute; height: 2px; left: 12px; right: 12px; bottom: -1px; background: var(--primary); }.inspector-tabs button span { padding: 2px 5px; border-radius: 20px; background: #eef0f4; font-size: 8px; }
.inspector-panel { display: none; padding: 20px; }.inspector-panel.is-active { display: block; }
.inspector-empty { min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #9aa0af; text-align: center; }.inspector-empty > span { font-size: 30px; color: #c5c8d1; }.inspector-empty h3 { margin: 14px 0 6px; color: #555c6e; font-size: 13px; }.inspector-empty p { max-width: 230px; margin: 0; font-size: 10px; line-height: 1.55; }
.inspector-form { display: grid; gap: 17px; }.inspector-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 5px; }.inspector-section-heading h3 { margin: 0 0 4px; font-size: 14px; }.inspector-section-heading p { margin: 0; color: #8c92a0; font-size: 10px; line-height: 1.45; }.element-kind { color: var(--primary); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.calculation-editor { padding: 13px; display: grid; gap: 13px; border: 1px solid #ddddf2; border-radius: 9px; background: #f9f9ff; }
.calculation-warning { margin: 0; padding: 10px; border-radius: 7px; color: #8a651f; background: #fff7e8; font-size: 9px; line-height: 1.5; }
.switch-row { padding: 13px; display: grid; grid-template-columns: 1fr 35px; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; }.switch-row strong, .switch-row small { display: block; }.switch-row strong { font-size: 11px; }.switch-row small { margin-top: 3px; color: #979cab; font-size: 9px; }.switch-row input { display: none; }.switch-row i { position: relative; width: 34px; height: 19px; border-radius: 30px; background: #cfd2da; cursor: pointer; transition: .15s; }.switch-row i::after { content: ""; position: absolute; width: 15px; height: 15px; left: 2px; top: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: .15s; }.switch-row input:checked + i { background: var(--primary); }.switch-row input:checked + i::after { transform: translateX(15px); }
.field-heading { margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }.field-heading button { border: 0; color: var(--primary); background: transparent; font-size: 9px; font-weight: 800; cursor: pointer; }
.option-row { display: grid; grid-template-columns: 22px 1fr 26px; align-items: center; gap: 5px; margin-bottom: 6px; }.option-row > span { color: #a2a7b4; font-size: 9px; }.option-row input { min-width: 0; height: 36px; border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; font-size: 10px; }.option-row button { height: 30px; border: 0; color: var(--danger); background: transparent; cursor: pointer; }
.rules-list { display: grid; gap: 16px; margin-top: 18px; }.rule-card { overflow: hidden; border: 1px solid #dedfea; border-radius: 10px; background: #fbfbfd; }.rule-card-header { padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; color: #6e7587; background: #f1f2f6; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }.rule-card-header button { border: 0; color: #9ba0ae; background: transparent; cursor: pointer; font-size: 18px; }.rule-card-header button:hover { color: var(--danger); }
.rule-step { padding: 13px; display: grid; gap: 11px; }.rule-step > b { width: max-content; padding: 3px 7px; border-radius: 5px; color: var(--primary); background: var(--primary-soft); font-size: 8px; letter-spacing: .1em; }.rule-connector { padding: 0 13px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 7px; align-items: center; color: #9298a7; font-size: 8px; letter-spacing: .08em; }.rule-connector span { height: 1px; background: #dedfe7; }.rule-action { padding-top: 9px; }.rule-hint { margin: 0; color: #9499a7; font-size: 9px; font-style: italic; }.template-help { display: block; color: #858b9b; font-size: 9px; line-height: 1.55; word-break: break-word; }
.ciro-rules-button { min-height: 38px; margin-top: 14px; border-color: #d7d7f2; color: var(--primary); background: #f8f8ff; font-size: 10px; }
.rule-logic-field { padding: 10px; border: 1px solid #dfe0eb; border-radius: 8px; background: #fff; }
.rule-conditions { display: grid; gap: 9px; }
.rule-condition { padding: 11px; display: grid; gap: 9px; border: 1px solid #e3e4eb; border-radius: 8px; background: #fff; }
.rule-question-picker { overflow: hidden; border: 1px solid #dfe1e9; border-radius: 8px; background: #fff; }
.rule-question-picker > summary { min-height: 39px; padding: 9px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #4e5568; background: #fbfbfd; font-size: 9px; font-weight: 700; cursor: pointer; list-style: none; }.rule-question-picker > summary::-webkit-details-marker { display: none; }.rule-question-picker > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.rule-question-picker > summary b { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 20px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); font-size: 8px; }
.rule-question-options { max-height: 230px; overflow-y: auto; padding: 6px; display: grid; gap: 3px; border-top: 1px solid #e8e9ef; }
.rule-question-options label { min-width: 0; padding: 8px; display: grid; grid-template-columns: 17px minmax(0, 1fr); gap: 8px; align-items: start; border-radius: 6px; cursor: pointer; }.rule-question-options label:hover { background: #f7f7fd; }.rule-question-options input { width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--primary); }.rule-question-options strong, .rule-question-options small { display: block; }.rule-question-options strong { overflow: hidden; color: #4d5466; font-size: 9px; line-height: 1.35; text-overflow: ellipsis; }.rule-question-options small { margin-top: 2px; color: #9a9fad; font-size: 8px; }
.condition-heading { display: flex; align-items: center; justify-content: space-between; }
.condition-heading span { padding: 3px 7px; border-radius: 5px; color: #5757c9; background: #efefff; font-size: 8px; font-weight: 850; letter-spacing: .08em; }
.condition-heading button { width: 24px; height: 24px; border: 0; border-radius: 5px; color: var(--danger); background: #fff4f5; cursor: pointer; }
.add-condition-button { width: 100%; min-height: 34px; border: 1px dashed #cfd0e6; border-radius: 7px; color: var(--primary); background: #fafaff; font-size: 9px; font-weight: 800; cursor: pointer; }
.add-condition-button:hover { border-color: var(--primary); background: var(--primary-soft); }
.mini-empty { padding: 34px 16px; color: #8d93a2; text-align: center; }.mini-empty strong { color: #5e6577; font-size: 11px; }.mini-empty p { margin: 6px 0 0; font-size: 9px; line-height: 1.55; }
.slug-field { min-height: 42px; display: flex; align-items: stretch; overflow: hidden; border: 1px solid #dfe2ea; border-radius: 8px; }.slug-field > span { max-width: 118px; padding: 11px 9px; overflow: hidden; color: #999eac; background: #f5f6f8; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }.slug-field input { min-width: 0; border: 0; border-radius: 0; box-shadow: none !important; }
.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.color-field { display: flex; align-items: center; gap: 8px; }.color-field input { width: 43px; height: 38px; padding: 3px; }.color-field code { color: #777e90; font-size: 9px; }

/* Users */
.users-panel-header { border-bottom: 0; }
.users-toolbar { padding: 16px 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fcfcfe; }
.users-search { display: flex; align-items: flex-end; gap: 8px; }
.users-search .field { width: min(340px, 46vw); }
.search-input { position: relative; display: block; }
.search-input .icon { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; color: #979cac; transform: translateY(-50%); pointer-events: none; }
.search-input input { padding-left: 38px; }
.users-access-note { max-width: 310px; margin: 0; display: flex; align-items: center; gap: 9px; color: #7b8293; font-size: 10px; line-height: 1.45; }.users-access-note .icon { width: 17px; height: 17px; color: var(--primary); }
.users-table .actions-column { width: 120px; }.users-table .table-actions form { margin: 0; }
.user-table-primary { min-width: 250px; display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 39px; height: 39px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); font-size: 13px; font-weight: 850; }
.user-table-primary strong, .user-table-primary small { display: block; }.user-table-primary strong { color: #242a3d; font-size: 13px; }.user-table-primary small { margin-top: 4px; color: #9298a7; font-size: 10px; }
.user-table-primary em { margin-left: 7px; padding: 3px 6px; border-radius: 20px; color: #5555c4; background: #efefff; font-size: 8px; font-style: normal; text-transform: uppercase; }
.user-disable-button:hover { color: var(--danger); border-color: #efc5cb; background: #fff5f6; }.user-enable-button { color: var(--success); }.user-enable-button:hover { color: #147a55; border-color: #bce5d5; background: #f1fbf7; }
.user-form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.user-form-fields { padding: 24px; }.user-access-card { padding: 26px; }.user-access-card h2 { margin: 17px 0 7px; font-size: 17px; }.user-access-card > p { margin: 0 0 22px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.user-active-switch { margin-top: 18px; }.user-meta-list { margin: 22px 0 0; border-top: 1px solid var(--line); }.user-meta-list > div { padding: 13px 0; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }.user-meta-list dt { color: #8b91a0; font-size: 10px; }.user-meta-list dd { margin: 0; color: #3c4356; font-size: 10px; font-weight: 750; text-align: right; }

/* Responses and settings */
.page-actionbar { margin-bottom: 20px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; }.page-context h2 { margin: 0; font-size: 16px; }
.page-context small { display: block; margin-top: 4px; color: #969cac; font-size: 10px; }
.responses-dashboard-button { color: var(--primary); border-color: #d7d7f2; background: #f7f7ff; }.responses-dashboard-button:hover { color: #fff; border-color: var(--primary); background: var(--primary); }
.response-stats-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.response-stat-card { min-height: 128px; padding: 20px; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 4px 16px rgba(31,36,59,.025); }
.response-stat-icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; }.response-stat-icon .icon { width: 20px; height: 20px; }
.response-stat-card small, .response-stat-card strong { display: block; }.response-stat-card small { margin: 2px 0 4px; color: #767d90; font-size: 10px; font-weight: 750; }.response-stat-card strong { color: #20263a; font-size: 27px; line-height: 1; letter-spacing: -.04em; }.response-stat-card p { margin: 9px 0 0; color: #969cac; font-size: 9px; line-height: 1.4; }
.stat-total .response-stat-icon { color: #5b5bd6; background: #efefff; }.stat-triggered .response-stat-icon { color: #2470b7; background: #ebf4fc; }.stat-sent .response-stat-icon { color: #18865e; background: #e8f8f1; }.stat-failed .response-stat-icon { color: #b64251; background: #fff0f2; }
.response-charts-grid { margin-bottom: 20px; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 18px; }
.chart-panel { min-width: 0; overflow: hidden; }.chart-panel-full { grid-column: 1 / -1; }.chart-heading { min-height: 78px; padding: 19px 21px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }.chart-heading h2 { margin: 0; font-size: 15px; letter-spacing: -.02em; }.chart-heading p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); font-size: 10px; }.chart-legend-note { padding: 5px 8px; border-radius: 20px; color: #6d6db5; background: #f1f1ff; font-size: 8px; font-weight: 800; }
.response-chart { width: 100%; height: 290px; padding: 0 10px 10px; }.response-chart-bar { height: 330px; }.chart-load-error { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #8c92a1; text-align: center; }.chart-load-error strong { color: #555d70; font-size: 12px; }.chart-load-error span { max-width: 300px; margin-top: 6px; font-size: 9px; line-height: 1.5; }
.responses-panel { overflow: hidden; }.responses-panel-header { min-height: 82px; border-bottom: 0; }.response-filters { padding: 16px 20px; display: grid; grid-template-columns: minmax(120px, .7fr) minmax(150px, 1fr) minmax(210px, 1.35fr) minmax(130px, .8fr) minmax(130px, .8fr) auto; gap: 12px; align-items: end; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fafbfc; }.response-filters .field { gap: 5px; }.response-filters .field > span { font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }.response-filters input, .response-filters select { min-height: 39px; padding: 8px 10px; font-size: 10px; }.response-filter-actions { display: flex; gap: 7px; }.response-filter-actions .button { min-height: 39px; padding-inline: 12px; font-size: 10px; white-space: nowrap; }
.responses-table tbody tr.has-email { background: #fdfdff; }.responses-table tbody tr.has-email:hover { background: #f9f9ff; }.protocol-link { color: var(--primary); font-size: 12px; font-weight: 850; }.protocol-link:hover { text-decoration: underline; }.table-metric { display: block; color: #343b50; font-size: 13px; }.table-metric-label { display: block; margin-top: 2px; color: #9a9fad; font-size: 9px; }.email-none { color: #a0a5b1; font-size: 10px; }.email-count-cell strong, .email-count-cell span { display: block; }.email-count-cell strong { color: #363d51; font-size: 10px; }.email-count-cell span { margin-top: 4px; color: #858b9a; font-size: 9px; white-space: nowrap; }.email-sent-dot, .email-failed-dot { width: 6px; height: 6px; margin: 0 5px 0 0; display: inline-block; border-radius: 50%; vertical-align: 0; }.email-failed-dot { margin-left: 9px; }.email-sent-dot { background: var(--success); }.email-failed-dot { background: var(--danger); }.response-open-button { min-height: 35px; padding-inline: 11px; font-size: 10px; white-space: nowrap; }.response-open-button .icon { width: 15px; height: 15px; }
.pagination { padding: 17px 20px; display: flex; justify-content: flex-end; gap: 5px; border-top: 1px solid var(--line); }.pagination-button { min-width: 34px; height: 34px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #e0e2ea; border-radius: 7px; color: #697084; background: #fff; font-size: 10px; font-weight: 750; }.pagination-button:hover { color: var(--primary); border-color: #c9c9ed; background: #f8f8ff; }.pagination-button.is-active { color: #fff; border-color: var(--primary); background: var(--primary); }.pagination-button.is-disabled { opacity: .4; pointer-events: none; }
.filter-inline .field { min-width: 180px; }.filter-inline .field span { display: none; }.filter-inline select { min-height: 38px; padding-block: 7px; }
.details-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 20px; align-items: start; }.answer-list { margin: 0; }.answer-list > div { padding: 20px 24px; border-bottom: 1px solid var(--line); }.answer-list > div:last-child { border: 0; }.answer-list dt { margin-bottom: 8px; color: #767d8e; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }.answer-list dd { margin: 0; color: #2d3448; font-size: 13px; line-height: 1.65; }
.email-log-list { padding: 8px 18px 18px; }.email-log-list article { padding: 12px 0; display: grid; grid-template-columns: 28px 1fr; gap: 9px; border-bottom: 1px solid var(--line); }.email-log-list article:last-child { border: 0; }.status-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 900; }.status-icon.success { color: #147451; background: #e9f8f1; }.status-icon.error { color: #ad3e4b; background: #fff0f2; }.email-log-list strong, .email-log-list small, .email-log-meta { display: block; }.email-log-list strong { font-size: 10px; }.email-log-list small { margin-top: 3px; color: #8f95a3; font-size: 9px; word-break: break-all; }.email-log-meta { margin-top: 5px; color: #a0a5b2; font-size: 8px; }.email-log-list p { margin: 7px 0 0; color: var(--danger); font-size: 9px; line-height: 1.45; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }.settings-form { padding: 24px; }.smtp-fields { transition: opacity .15s; }.smtp-fields.is-muted { opacity: .45; }.test-email-card { padding: 26px; }.test-email-card h2 { margin: 17px 0 7px; font-size: 17px; }.test-email-card > p { margin: 0 0 22px; color: var(--muted); font-size: 11px; line-height: 1.6; }.test-email-card .button { margin-top: 12px; }.security-note { margin-top: 24px; padding: 14px; border-radius: 9px; color: #5e6680; background: #f5f5fd; }.security-note strong { font-size: 10px; }.security-note p { margin: 5px 0 0; font-size: 9px; line-height: 1.55; }

.toast-container { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }.toast { min-width: 260px; max-width: 390px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 9px; color: #42495b; background: #fff; box-shadow: 0 16px 40px rgba(31,36,59,.16); font-size: 11px; opacity: 0; transform: translateY(8px); transition: .2s; }.toast.is-visible { opacity: 1; transform: translateY(0); }.toast-success { border-left: 4px solid var(--success); }.toast-error { border-left: 4px solid var(--danger); }

@media (max-width: 1100px) {
  .builder-shell { grid-template-columns: 190px minmax(370px, 1fr) 300px; }
  .builder-palette { padding-inline: 10px; }.palette-item { grid-template-columns: 35px 1fr; padding-inline: 6px; }.palette-symbol { width: 35px; height: 35px; }.palette-symbol .icon { width: 16px; height: 16px; }
  .settings-layout, .user-form-layout { grid-template-columns: 1fr; }.test-email-card, .user-access-card { max-width: none; }
  .response-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.response-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }.response-filter-actions { grid-column: span 3; justify-content: flex-end; }
}
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; max-width: 560px; }.login-art { display: none; }.login-panel { min-height: 660px; }
  .install-layout { grid-template-columns: 1fr; }.install-intro { padding: 40px; }.brand-mark-large { margin-bottom: 24px; }.install-intro h1 { font-size: 30px; }
  .app-shell { grid-template-columns: 1fr; }.sidebar { position: fixed; left: -270px; width: var(--sidebar-width); box-shadow: 15px 0 40px rgba(31,36,59,.15); transition: left .2s ease; }.sidebar.is-open { left: 0; }.mobile-menu { display: inline-flex; }
  .builder-shell { height: auto; min-height: calc(100vh - 155px); grid-template-columns: 180px 1fr; overflow: visible; }.builder-inspector { grid-column: 1 / -1; min-height: 480px; border: 1px solid var(--line); }.builder-canvas-wrap { min-height: 700px; }
  .details-layout { grid-template-columns: 1fr; }
  .response-charts-grid { grid-template-columns: 1fr; }.chart-panel-full { grid-column: auto; }
}
@media (max-width: 680px) {
  .content { padding: 20px 16px 40px; }.topbar { padding-inline: 16px; }.stats-grid, .response-stats-grid { grid-template-columns: 1fr; }.panel-header { align-items: flex-start; flex-direction: column; }.panel-header .button { width: 100%; }
  .two-columns { grid-template-columns: 1fr; }.full-span { grid-column: auto; }
  .login-wrap, .install-layout { width: 100%; min-height: 100vh; border-radius: 0; }.login-panel { padding: 105px 28px 40px; }.brand-login { top: 34px; }.install-card { padding: 34px 24px; }.install-intro { display: none; }
  .builder-topbar { margin: -20px -16px 0; padding: 10px; grid-template-columns: auto 1fr; }.builder-actions { grid-column: 1 / -1; }.builder-actions .button { flex: 1; padding-inline: 9px; }.builder-shell { margin: 0 -16px -40px; display: flex; flex-direction: column; }.builder-palette { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }.palette-group { grid-template-columns: 1fr 1fr; }.palette-label { grid-column: 1 / -1; }.builder-canvas-wrap { padding-inline: 12px; }.preview-header { padding-inline: 24px; }.elements-list { padding-inline: 12px; }.preview-submit { margin-inline: 24px; }.builder-inspector { border-inline: 0; }
  .page-actionbar { grid-template-columns: auto 1fr; }.page-actionbar > :last-child { grid-column: 1 / -1; width: 100%; }.actions-column { width: auto; }
  .response-filters { grid-template-columns: 1fr; }.response-filter-actions { grid-column: auto; }.response-filter-actions .button { flex: 1; }.response-chart { height: 260px; }.response-chart-bar { height: 310px; }.chart-legend-note { display: none; }.pagination { justify-content: center; overflow-x: auto; }
  .users-toolbar { align-items: stretch; flex-direction: column; }.users-search { align-items: stretch; flex-wrap: wrap; }.users-search .field { width: 100%; }.users-search .button { flex: 1; }.users-access-note { max-width: none; }
  .color-grid { grid-template-columns: 1fr; }
}
