:root { --bg:#111827; --panel:#ffffff; --ink:#111827; --muted:#6b7280; --line:#e5e7eb; --brand:#f6c544; --soft:#f9fafb; --danger:#b91c1c; }
* { box-sizing:border-box; }
body { margin:0; font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background:#f3f4f6; color:var(--ink); }
a { color:#1f2937; }
.topbar { background:var(--bg); color:white; padding:18px 28px; display:flex; justify-content:space-between; gap:24px; align-items:center; }
.topbar strong { display:block; font-size:20px; }.topbar span { color:#d1d5db; font-size:13px; }.topbar nav { display:flex; gap:16px; flex-wrap:wrap; }.topbar a { color:white; text-decoration:none; font-size:14px; }
.container { width:min(1180px, calc(100% - 32px)); margin:28px auto; }.panel { background:var(--panel); border:1px solid var(--line); border-radius:18px; padding:24px; box-shadow:0 10px 30px rgba(17,24,39,.08); margin-bottom:22px; }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:18px; }.card { background:white; border:1px solid var(--line); border-radius:18px; padding:22px; display:flex; flex-direction:column; gap:12px; min-height:190px; }.card h3 { margin:0; }.card p { color:var(--muted); margin:0; line-height:1.45; }
.badge { display:inline-flex; width:max-content; border-radius:999px; padding:5px 10px; font-size:12px; background:#e5e7eb; color:#374151; }.badge.active { background:#dcfce7; color:#166534; }.badge.soon { background:#fef3c7; color:#92400e; }
.btn, button { appearance:none; border:0; border-radius:10px; background:#111827; color:white; padding:10px 14px; text-decoration:none; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:8px; }.btn.secondary { background:#f3f4f6; color:#111827; border:1px solid var(--line); }.btn.danger { background:var(--danger); }.btn[aria-disabled="true"] { opacity:.45; pointer-events:none; }
.actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }.table { width:100%; border-collapse:collapse; }.table th, .table td { text-align:left; border-bottom:1px solid var(--line); padding:14px 8px; vertical-align:top; }.table th { font-size:13px; color:var(--muted); }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; } label { display:block; font-weight:700; font-size:14px; margin-bottom:7px; } input, select, textarea { width:100%; border:1px solid var(--line); border-radius:10px; padding:11px 12px; font:inherit; background:white; } textarea { min-height:96px; resize:vertical; }.full { grid-column:1/-1; }.help { color:var(--muted); font-size:13px; line-height:1.45; margin-top:6px; }.copybox { background:#0f172a; color:#e5e7eb; padding:18px; border-radius:14px; overflow:auto; font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:13px; }.preview-wrap { border:1px dashed #cbd5e1; border-radius:16px; padding:20px; background:var(--soft); }.notice { background:#fffbeb; border:1px solid #fde68a; border-radius:14px; padding:14px 16px; color:#92400e; margin-bottom:18px; }
@media (max-width:760px){ .topbar { align-items:flex-start; flex-direction:column; } .form-grid { grid-template-columns:1fr; } }
.fieldset { background:#f9fafb; border:1px solid var(--line); border-radius:14px; padding:16px; }
.fieldset h2 { margin:0 0 4px; font-size:15px; }

/* Widget builder UI */
.widget-editor-app { display:grid; grid-template-columns:360px minmax(0,1fr); gap:0; background:#fff; border:1px solid var(--line); border-radius:20px; overflow:hidden; min-height:calc(100vh - 150px); box-shadow:0 18px 45px rgba(17,24,39,.10); }
.widget-editor-sidebar { background:#18181b; color:#f9fafb; padding:18px; overflow:auto; max-height:calc(100vh - 150px); position:sticky; top:16px; }
.builder-title { display:flex; align-items:center; gap:12px; padding:6px 4px 18px; border-bottom:1px solid rgba(255,255,255,.08); margin-bottom:14px; }
.builder-title h1 { font-size:15px; margin:0; line-height:1.2; }
.builder-title p { margin:4px 0 0; color:#a1a1aa; font-size:13px; }
.builder-icon { width:34px; height:34px; border-radius:10px; display:grid; place-items:center; font-weight:900; background:#1877f2; color:white; font-family:Georgia,serif; }
.builder-form { display:block; }
.builder-section { border:1px solid rgba(255,255,255,.08); border-radius:14px; background:#222225; margin-bottom:12px; overflow:hidden; }
.builder-section summary { cursor:pointer; font-weight:800; padding:14px 14px; list-style:none; }
.builder-section summary::-webkit-details-marker { display:none; }
.builder-section summary:after { content:'›'; float:right; transform:rotate(90deg); color:#a1a1aa; }
.builder-section:not([open]) summary:after { transform:rotate(0deg); }
.builder-section .builder-field, .builder-section .builder-check { margin:0 14px 14px; }
.builder-field label, .builder-check { color:#e4e4e7; font-size:13px; font-weight:700; }
.builder-field input, .builder-field select, .builder-field textarea { background:#111113; border-color:#3f3f46; color:#f9fafb; border-radius:9px; padding:10px 11px; }
.builder-field textarea { min-height:82px; }
.builder-check { display:flex; align-items:center; gap:9px; line-height:1.3; }
.builder-check input { width:auto; accent-color:#f6c544; }
.builder-section .help, .widget-editor-sidebar .help { color:#a1a1aa; font-size:12px; }
.notice.mini { background:#3f2f10; color:#fde68a; border-color:#92400e; padding:10px 12px; font-size:13px; }
.builder-actions { display:flex; gap:10px; position:sticky; bottom:0; padding:14px 0 2px; background:linear-gradient(180deg, rgba(24,24,27,0), #18181b 25%); }
.builder-actions button { flex:1; background:#f6c544; color:#111827; }
.builder-actions .btn { flex:0 0 auto; }
.widget-editor-stage { min-width:0; background:#f8fafc; display:flex; flex-direction:column; }
.stage-toolbar { min-height:62px; background:white; border-bottom:1px solid var(--line); padding:12px 18px; display:flex; align-items:center; justify-content:space-between; gap:14px; }
.stage-toolbar strong { display:block; }
.stage-toolbar span { color:var(--muted); font-size:13px; }
.stage-canvas { flex:1; padding:36px; overflow:auto; }
.stage-site-demo { width:100%; min-height:520px; border:1px dashed #cbd5e1; background:white; border-radius:18px; padding:34px; box-shadow:inset 0 0 0 1px rgba(255,255,255,.65); }
.stage-site-demo h2 { margin:0 0 5px; font-size:19px; }
#bdm-editor-preview { margin-top:26px; }
@media (max-width:1000px){ .widget-editor-app { grid-template-columns:1fr; } .widget-editor-sidebar { position:relative; top:auto; max-height:none; } .stage-canvas { padding:18px; } .stage-site-demo { padding:20px; min-height:360px; } }


/* Fullscreen builder mode */
body.builder-mode { background:#f3f4f6; overflow:hidden; }
body.builder-mode .topbar { display:none; }
body.builder-mode .container { width:100%; max-width:none; margin:0; }
body.builder-mode .widget-editor-app { width:100vw; height:100vh; min-height:100vh; border:0; border-radius:0; box-shadow:none; grid-template-columns:390px minmax(0,1fr); }
body.builder-mode .widget-editor-sidebar { max-height:100vh; height:100vh; position:relative; top:auto; border-radius:0; padding:22px 18px 18px; }
body.builder-mode .widget-editor-stage { height:100vh; min-height:0; }
body.builder-mode .stage-toolbar { min-height:56px; padding:14px 22px; }
body.builder-mode .stage-canvas { padding:38px; min-height:0; }
body.builder-mode .stage-site-demo { max-width:1280px; margin:0 auto; min-height:calc(100vh - 144px); }
body.builder-mode .builder-actions { padding-bottom:10px; }
@media (max-width:1000px){
  body.builder-mode { overflow:auto; }
  body.builder-mode .widget-editor-app { width:100%; height:auto; min-height:100vh; grid-template-columns:1fr; }
  body.builder-mode .widget-editor-sidebar { height:auto; max-height:none; }
  body.builder-mode .widget-editor-stage { height:auto; min-height:540px; }
  body.builder-mode .stage-canvas { padding:18px; }
  body.builder-mode .stage-site-demo { min-height:420px; }
}

/* Advanced tabbed widget builder */
body.builder-mode .widget-editor-app.advanced-builder,
.widget-editor-app.advanced-builder { display:grid; grid-template-columns:400px minmax(0,1fr); background:#f4f6f8; }
.advanced-builder-form { display:grid; grid-template-columns:62px minmax(0,338px); min-height:100vh; background:#1b1b1d; color:#fff; }
.builder-rail { background:#121315; border-right:1px solid #000; display:flex; flex-direction:column; align-items:stretch; padding:0 0 12px; }
.rail-tab, .rail-help { appearance:none; border:0; background:transparent; color:#a7a7ad; min-height:62px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; text-decoration:none; cursor:pointer; border-left:3px solid transparent; border-radius:0; padding:6px 0; font-weight:700; }
.rail-tab span, .rail-help span { font-size:19px; line-height:1; font-weight:800; opacity:.9; }
.rail-tab b, .rail-help b { font-size:10px; font-weight:800; }
.rail-tab:hover, .rail-tab.active { color:#fff; background:#292a2d; border-left-color:#1d9bf0; }
.rail-help { margin-top:auto; }
.rail-help span { width:26px; height:26px; border-radius:999px; background:#8b8b91; color:#111; display:grid; place-items:center; font-size:15px; }
.builder-panel { background:#1f1f21; color:#fff; height:100vh; overflow:auto; padding:18px 20px 92px; box-shadow:inset -1px 0 0 rgba(255,255,255,.04); }
.builder-panel, .widget-editor-sidebar { scrollbar-width:thin; scrollbar-color:#4b4b50 #151517; }
.builder-panel::-webkit-scrollbar, .widget-editor-sidebar::-webkit-scrollbar { width:10px; height:10px; }
.builder-panel::-webkit-scrollbar-track, .widget-editor-sidebar::-webkit-scrollbar-track { background:#151517; }
.builder-panel::-webkit-scrollbar-thumb, .widget-editor-sidebar::-webkit-scrollbar-thumb { background:#4b4b50; border-radius:999px; border:2px solid #151517; }
.builder-panel::-webkit-scrollbar-thumb:hover, .widget-editor-sidebar::-webkit-scrollbar-thumb:hover { background:#62626a; }

.builder-panel-top { display:flex; align-items:center; gap:12px; margin-bottom:22px; }
.builder-panel-top h1 { margin:0; font-size:15px; line-height:1.15; }
.builder-panel-top p { margin:4px 0 0; color:#a7a7ad; font-size:13px; }
.builder-tab-panel { display:none; }
.builder-tab-panel.active { display:block; animation:fadeIn .12s ease-out; }
@keyframes fadeIn { from{opacity:.75;transform:translateY(2px)} to{opacity:1;transform:none} }
.builder-tab-panel h2 { margin:2px 0 22px; text-align:center; font-size:19px; letter-spacing:-.02em; }
.builder-kicker { margin:24px 0 10px; color:#d7d7dc; font-size:13px; letter-spacing:.04em; text-transform:uppercase; font-weight:700; }
.settings-card, .source-card, .source-add, .post-preview-card { background:#333335; border:1px solid rgba(255,255,255,.035); border-radius:6px; margin-bottom:18px; overflow:hidden; }
.source-card { display:grid; grid-template-columns:44px 1fr auto; align-items:center; gap:14px; padding:14px 18px; margin-bottom:0; border-radius:6px 6px 0 0; }
.source-card strong { display:block; font-size:16px; }
.source-card span { display:block; color:#a7a7ad; margin-top:2px; }
.source-card em { color:#b9b9bf; font-style:normal; letter-spacing:3px; }
.source-logo { width:38px; height:38px; background:#1877f2; color:#fff; border-radius:999px; display:grid; place-items:center; font-weight:900; font-size:26px; font-family:Georgia,serif; }
.source-add { border-top:1px solid #242426; border-radius:0 0 6px 6px; text-align:center; color:#1d9bf0; padding:15px; font-size:15px; }
.builder-row, .builder-switch-row { min-height:56px; display:grid; grid-template-columns:1fr auto; align-items:center; gap:16px; padding:0 16px; border-bottom:1px solid #242426; font-size:15px; }
.builder-row:last-child, .builder-switch-row:last-child { border-bottom:0; }
.builder-row > span, .builder-switch-row > span { color:#fff; }
.builder-row select, .compact-input input { width:auto; min-width:86px; max-width:170px; background:transparent; border:0; color:#1d9bf0; padding:8px 0; text-align:right; font:inherit; font-size:14px; appearance:auto; }
.builder-row select option { color:#111; }
.compact-input { display:flex; align-items:center; justify-content:flex-end; gap:3px; margin:0; font-weight:400; }
.compact-input input { border-bottom:1px solid transparent; }
.compact-input input:focus { outline:0; border-bottom-color:#1d9bf0; }
.compact-input em { color:#1d9bf0; font-style:normal; font-size:16px; }
.color-input { display:flex; align-items:center; gap:10px; margin:0; font-weight:400; }
.color-input input { width:34px; height:34px; border:0; border-radius:999px; padding:0; overflow:hidden; background:transparent; }
.color-input b { color:#1d9bf0; font-size:14px; font-weight:700; }
.builder-switch-row input { display:none; }
.builder-switch-row i { width:44px; height:26px; background:#85858a; border-radius:999px; position:relative; transition:.18s; }
.builder-switch-row i:before { content:''; position:absolute; width:20px; height:20px; left:3px; top:3px; border-radius:999px; background:#fff; transition:.18s; }
.builder-switch-row input:checked + i { background:#1d9bf0; }
.builder-switch-row input:checked + i:before { transform:translateX(18px); }
.builder-field { padding:12px 16px; border-bottom:1px solid #242426; margin:0; }
.builder-field:last-child { border-bottom:0; }
.builder-field label { color:#fff; font-size:14px; display:block; margin:0 0 9px; }
.builder-field input, .builder-field select, .builder-field textarea { background:#111113; border:1px solid #404045; color:#fff; border-radius:8px; min-height:42px; }
.builder-field textarea { min-height:96px; }
.builder-field .help, .builder-help, .builder-tab-panel .help { color:#a7a7ad; font-size:12px; line-height:1.35; margin:7px 0 0; }
.layout-tiles { background:#333335; border-radius:6px; padding:14px; display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.layout-tile { min-height:96px; border:2px solid transparent; border-radius:6px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; color:#a7a7ad; position:relative; cursor:pointer; margin:0; font-weight:500; }
.layout-tile input { position:absolute; opacity:0; pointer-events:none; }
.layout-tile strong { font-size:15px; font-weight:500; }
.layout-tile.selected { border-color:#1d9bf0; color:#1d9bf0; }
.layout-tile.selected:after { content:'✓'; position:absolute; top:-9px; right:-9px; width:22px; height:22px; border-radius:999px; background:#1d9bf0; color:#fff; display:grid; place-items:center; font-weight:900; }
.tile-icon { width:56px; height:46px; display:block; opacity:.9; }
.tile-icon.grid { background:linear-gradient(#aaa,#aaa) 0 0/15px 15px repeat; width:48px; height:48px; }
.tile-icon.masonry { background:linear-gradient(#aaa,#aaa) 0 0/18px 18px no-repeat,linear-gradient(#aaa,#aaa) 22px 0/14px 38px no-repeat,linear-gradient(#aaa,#aaa) 40px 0/18px 18px no-repeat,linear-gradient(#aaa,#aaa) 0 22px/18px 18px no-repeat,linear-gradient(#aaa,#aaa) 40px 22px/18px 18px no-repeat; }
.tile-icon.list { background:linear-gradient(#aaa,#aaa) 0 4px/56px 9px no-repeat,linear-gradient(#aaa,#aaa) 0 20px/56px 9px no-repeat,linear-gradient(#aaa,#aaa) 0 36px/56px 9px no-repeat; }
.tile-icon.carousel { background:linear-gradient(#1d9bf0,#1d9bf0) 8px 8px/14px 32px no-repeat,linear-gradient(#1d9bf0,#1d9bf0) 26px 8px/14px 32px no-repeat,linear-gradient(#1d9bf0,#1d9bf0) 44px 8px/14px 32px no-repeat; }
.tile-icon.slider { background:linear-gradient(#aaa,#aaa) center/54px 34px no-repeat; position:relative; }
.tile-icon.slider:after { content:'•••'; position:absolute; left:17px; top:36px; letter-spacing:3px; font-size:13px; color:#aaa; }
.post-preview-card { padding:24px 20px; text-align:center; }
.post-style-preview { width:170px; height:210px; background:#f5f5f5; border-radius:8px; margin:0 auto 14px; overflow:hidden; box-shadow:0 10px 26px rgba(0,0,0,.25); }
.fake-img { height:98px; background:linear-gradient(135deg,#84c5eb,#0f7cb3); }
.fake-lines { height:112px; background:linear-gradient(#222,#222) 16px 20px/115px 8px no-repeat,linear-gradient(#555,#555) 16px 40px/135px 5px no-repeat,linear-gradient(#777,#777) 16px 52px/105px 5px no-repeat,linear-gradient(#1d9bf0,#1d9bf0) 16px 78px/78px 18px no-repeat,#fff; }
.post-preview-card p { margin:0; color:#1d9bf0; font-size:15px; }
.segmented .builder-row select { min-width:140px; }
.builder-actions { position:fixed; left:62px; bottom:0; width:338px; padding:14px 18px; background:rgba(31,31,33,.98); border-top:1px solid #2b2b2d; display:flex; gap:10px; z-index:20; }
.builder-actions button { flex:1; background:#f6c544; color:#111; border-radius:10px; }
.builder-actions .btn { background:#f4f4f5; color:#111; }
.advanced-builder .widget-editor-stage { min-width:0; background:#f7f8fa; }
.advanced-builder .stage-toolbar { background:#fff; min-height:64px; border-bottom:1px solid #e5e7eb; }
.advanced-builder .stage-canvas { padding:40px; }
.advanced-builder .stage-site-demo { max-width:1280px; margin:0 auto; background:#fff; border:1px dashed #cbd5e1; border-radius:18px; padding:42px; min-height:calc(100vh - 144px); }
body.builder-mode .widget-editor-app.advanced-builder { grid-template-columns:400px minmax(0,1fr); }
body.builder-mode .advanced-builder-form { height:100vh; }
body.builder-mode .builder-panel { height:100vh; }
body.builder-mode .stage-site-demo { max-width:1320px; }
@media (max-width:1000px){
  body.builder-mode { overflow:auto; }
  body.builder-mode .widget-editor-app.advanced-builder, .widget-editor-app.advanced-builder { grid-template-columns:1fr; }
  .advanced-builder-form { grid-template-columns:62px minmax(0,1fr); min-height:720px; }
  .builder-panel { height:auto; min-height:720px; }
  .builder-actions { left:62px; width:calc(100% - 62px); }
  .advanced-builder .stage-canvas { padding:18px; }
  .advanced-builder .stage-site-demo { padding:20px; min-height:420px; }
}

/* Targeted builder sidebar size + scrollbar fix */
body.builder-mode .widget-editor-app.advanced-builder,
.widget-editor-app.advanced-builder {
  grid-template-columns: 320px minmax(0, 1fr) !important;
}

body.builder-mode .advanced-builder-form,
.advanced-builder-form {
  grid-template-columns: 52px minmax(0, 268px) !important;
  width: 320px !important;
  max-width: 320px !important;
}

body.builder-mode .builder-rail,
.builder-rail {
  width: 52px !important;
  min-width: 52px !important;
}

body.builder-mode .rail-tab,
body.builder-mode .rail-help,
.rail-tab,
.rail-help {
  min-height: 52px !important;
  gap: 4px !important;
  padding: 4px 0 !important;
}

body.builder-mode .rail-tab span,
body.builder-mode .rail-help span,
.rail-tab span,
.rail-help span {
  font-size: 16px !important;
}

body.builder-mode .rail-tab b,
body.builder-mode .rail-help b,
.rail-tab b,
.rail-help b {
  font-size: 9px !important;
}

body.builder-mode .builder-panel,
.builder-panel {
  width: 268px !important;
  max-width: 268px !important;
  padding: 14px 14px 86px !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: thin !important;
  scrollbar-color: #4b4b50 #151517 !important;
}

body.builder-mode .builder-panel-top h1,
.builder-panel-top h1 { font-size: 14px !important; }
body.builder-mode .builder-panel-top p,
.builder-panel-top p { font-size: 11px !important; }
body.builder-mode .builder-tab-panel h2,
.builder-tab-panel h2 { font-size: 17px !important; margin-bottom: 16px !important; }
body.builder-mode .builder-row,
body.builder-mode .builder-switch-row,
.builder-row,
.builder-switch-row {
  min-height: 48px !important;
  padding: 0 12px !important;
  gap: 10px !important;
  font-size: 13px !important;
}
body.builder-mode .builder-field,
.builder-field { padding: 10px 12px !important; }
body.builder-mode .builder-field label,
.builder-field label { font-size: 12px !important; }
body.builder-mode .builder-field input,
body.builder-mode .builder-field select,
body.builder-mode .builder-field textarea,
.builder-field input,
.builder-field select,
.builder-field textarea { min-height: 36px !important; font-size: 13px !important; }
body.builder-mode .layout-tile,
.layout-tile { min-height: 86px !important; padding: 10px 6px !important; }
body.builder-mode .layout-tile span,
.layout-tile span { font-size: 12px !important; }
body.builder-mode .builder-card,
.builder-card { border-radius: 10px !important; }
body.builder-mode .builder-actions,
.builder-actions {
  left: 52px !important;
  width: 268px !important;
  padding: 10px 12px !important;
}
body.builder-mode .builder-actions button,
body.builder-mode .builder-actions .btn,
.builder-actions button,
.builder-actions .btn {
  min-height: 38px !important;
  font-size: 13px !important;
  padding: 8px 10px !important;
}

/* Dark scrollbars for every scrolling surface in the builder. */
body.builder-mode,
body.builder-mode * {
  scrollbar-width: thin;
  scrollbar-color: #4b4b50 #151517;
}
body.builder-mode ::-webkit-scrollbar { width: 10px; height: 10px; }
body.builder-mode ::-webkit-scrollbar-track { background: #151517; }
body.builder-mode ::-webkit-scrollbar-thumb {
  background: #4b4b50;
  border-radius: 999px;
  border: 2px solid #151517;
}
body.builder-mode ::-webkit-scrollbar-thumb:hover { background: #686870; }

/* Keep mobile usable. */
@media (max-width: 900px) {
  body.builder-mode .widget-editor-app.advanced-builder,
  .widget-editor-app.advanced-builder { grid-template-columns: 1fr !important; }
  body.builder-mode .advanced-builder-form,
  .advanced-builder-form { width: 100% !important; max-width: none !important; grid-template-columns:52px minmax(0,1fr) !important; }
  body.builder-mode .builder-panel,
  .builder-panel { width: auto !important; max-width: none !important; }
  body.builder-mode .builder-actions,
  .builder-actions { left:52px !important; width:calc(100% - 52px) !important; }
}


/* 2026-06-28 tune: slightly wider builder panel, better layout tile fit, green publish button */
body.builder-mode .widget-editor-app.advanced-builder,
.widget-editor-app.advanced-builder {
  grid-template-columns: 345px minmax(0, 1fr) !important;
}

body.builder-mode .advanced-builder-form,
.advanced-builder-form {
  grid-template-columns: 56px minmax(0, 289px) !important;
  width: 345px !important;
  max-width: 345px !important;
}

body.builder-mode .builder-rail,
.builder-rail {
  width: 56px !important;
  min-width: 56px !important;
}

body.builder-mode .rail-tab,
body.builder-mode .rail-help,
.rail-tab,
.rail-help {
  min-height: 56px !important;
  gap: 5px !important;
}

body.builder-mode .rail-tab span,
body.builder-mode .rail-help span,
.rail-tab span,
.rail-help span {
  font-size: 17px !important;
}

body.builder-mode .rail-tab b,
body.builder-mode .rail-help b,
.rail-tab b,
.rail-help b {
  font-size: 9.5px !important;
}

body.builder-mode .builder-panel,
.builder-panel {
  width: 289px !important;
  max-width: 289px !important;
  padding: 15px 15px 88px !important;
}

body.builder-mode .layout-tiles,
.layout-tiles {
  padding: 12px !important;
  gap: 10px !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body.builder-mode .layout-tile,
.layout-tile {
  min-height: 88px !important;
  padding: 9px 5px !important;
  gap: 8px !important;
}

body.builder-mode .layout-tile svg,
body.builder-mode .layout-tile .layout-icon,
.layout-tile svg,
.layout-tile .layout-icon {
  max-width: 42px !important;
  max-height: 42px !important;
}

body.builder-mode .layout-tile strong,
.layout-tile strong {
  font-size: 13px !important;
  line-height: 1.1 !important;
}

body.builder-mode .builder-actions,
.builder-actions {
  left: 56px !important;
  width: 289px !important;
  padding: 10px 14px !important;
}

body.builder-mode .builder-actions button,
.builder-actions button {
  background: #22c55e !important;
  color: #06130a !important;
  border-color: #22c55e !important;
}
body.builder-mode .builder-actions button:hover,
.builder-actions button:hover {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #fff !important;
}

@media (max-width: 900px) {
  body.builder-mode .advanced-builder-form,
  .advanced-builder-form { grid-template-columns:56px minmax(0,1fr) !important; }
  body.builder-mode .builder-actions,
  .builder-actions { left:56px !important; width:calc(100% - 56px) !important; }
}

/* 2026-06-28 builder rail icon asset refresh */
.rail-icon {
  width: 22px !important;
  height: 22px !important;
  display: block !important;
  background: currentColor !important;
  opacity: .86 !important;
  margin: 0 auto !important;
  -webkit-mask-repeat: no-repeat !important;
  mask-repeat: no-repeat !important;
  -webkit-mask-position: center !important;
  mask-position: center !important;
  -webkit-mask-size: contain !important;
  mask-size: contain !important;
}
.rail-tab:hover .rail-icon,
.rail-tab.active .rail-icon { opacity: 1 !important; }
.rail-icon-sources { -webkit-mask-image:url('/assets/builder-icons/sources.svg'); mask-image:url('/assets/builder-icons/sources.svg'); }
.rail-icon-header { -webkit-mask-image:url('/assets/builder-icons/header.svg'); mask-image:url('/assets/builder-icons/header.svg'); }
.rail-icon-layout { -webkit-mask-image:url('/assets/builder-icons/layout.svg'); mask-image:url('/assets/builder-icons/layout.svg'); }
.rail-icon-post { -webkit-mask-image:url('/assets/builder-icons/post.svg'); mask-image:url('/assets/builder-icons/post.svg'); }
.rail-icon-style { -webkit-mask-image:url('/assets/builder-icons/style.svg'); mask-image:url('/assets/builder-icons/style.svg'); }
.rail-icon-settings { -webkit-mask-image:url('/assets/builder-icons/settings.svg'); mask-image:url('/assets/builder-icons/settings.svg'); }
body.builder-mode .rail-tab span.rail-icon,
body.builder-mode .rail-help span.rail-icon,
.rail-tab span.rail-icon,
.rail-help span.rail-icon { font-size: 0 !important; line-height: 1 !important; }
body.builder-mode .rail-tab,
.rail-tab { color:#a8a8ad !important; }
body.builder-mode .rail-tab:hover,
body.builder-mode .rail-tab.active,
.rail-tab:hover,
.rail-tab.active { color:#fff !important; }

/* 2026-06-28 inline builder rail icons + softer labels */
body.builder-mode .rail-tab b,
body.builder-mode .rail-help b,
.rail-tab b,
.rail-help b {
  font-weight: 500 !important;
  letter-spacing: .01em !important;
}
body.builder-mode .rail-icon-inline,
.rail-icon-inline {
  width: 22px !important;
  height: 22px !important;
  display: grid !important;
  place-items: center !important;
  color: currentColor !important;
  opacity: .82 !important;
}
body.builder-mode .rail-svg,
.rail-svg {
  width: 22px !important;
  height: 22px !important;
  display: block !important;
  fill: currentColor !important;
}
body.builder-mode .rail-tab:hover .rail-icon-inline,
body.builder-mode .rail-tab.active .rail-icon-inline,
.rail-tab:hover .rail-icon-inline,
.rail-tab.active .rail-icon-inline {
  opacity: 1 !important;
}

/* 2026-06-28 robust CSS-only builder rail icons
   Uses pseudo-elements so icons render even if SVG assets or inline markup do not. */
body.builder-mode .rail-tab,
.rail-tab {
  font-weight: 400 !important;
}
body.builder-mode .rail-tab b,
body.builder-mode .rail-help b,
.rail-tab b,
.rail-help b {
  font-weight: 400 !important;
  letter-spacing: 0 !important;
}
body.builder-mode .rail-tab .rail-icon,
body.builder-mode .rail-tab .rail-icon-inline,
body.builder-mode .rail-tab .rail-svg,
.rail-tab .rail-icon,
.rail-tab .rail-icon-inline,
.rail-tab .rail-svg {
  display: none !important;
}
body.builder-mode .rail-tab::before,
.rail-tab::before {
  content: "" !important;
  display: block !important;
  width: 24px !important;
  height: 24px !important;
  margin: 0 auto 6px !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 24px 24px !important;
  opacity: .88 !important;
}
body.builder-mode .rail-tab:hover::before,
body.builder-mode .rail-tab.active::before,
.rail-tab:hover::before,
.rail-tab.active::before {
  opacity: 1 !important;
}
body.builder-mode .rail-tab[data-builder-tab="sources"]::before,
.rail-tab[data-builder-tab="sources"]::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23a9a9ad' d='M8 2h2v6h4V2h2v6h2c.55 0 1 .45 1 1v3c0 3.53-2.61 6.45-6 6.93V22h-2v-3.07A7.01 7.01 0 0 1 5 12V9c0-.55.45-1 1-1h2V2Zm-1 8v2a5 5 0 0 0 10 0v-2H7Z'/%3E%3C/svg%3E") !important;
}
body.builder-mode .rail-tab[data-builder-tab="header"]::before,
.rail-tab[data-builder-tab="header"]::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23a9a9ad' d='M4 5h16v14H4V5Zm2 2v10h12V7H6Zm2 2h8v2H8V9Zm0 4h5v2H8v-2Z'/%3E%3C/svg%3E") !important;
}
body.builder-mode .rail-tab[data-builder-tab="layout"]::before,
.rail-tab[data-builder-tab="layout"]::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23a9a9ad' d='M4 4h7v7H4V4Zm9 0h7v4h-7V4Zm0 6h7v10h-7V10ZM4 13h7v7H4v-7Z'/%3E%3C/svg%3E") !important;
}
body.builder-mode .rail-tab[data-builder-tab="post"]::before,
.rail-tab[data-builder-tab="post"]::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23a9a9ad' d='M4 5h16v14H4V5Zm2 2v7l3.2-3.3 2.4 2.4 3.4-4.1 3 5V7H6Zm0 10h12l-3.3-5.5-3 3.6-2.4-2.4L6 16v1Z'/%3E%3C/svg%3E") !important;
}
body.builder-mode .rail-tab[data-builder-tab="style"]::before,
.rail-tab[data-builder-tab="style"]::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23a9a9ad' d='M12 3a9 9 0 0 0 0 18h1.2a2.4 2.4 0 0 0 1.7-4.1 1.4 1.4 0 0 1 1-2.4H18a6 6 0 0 0 0-12h-6Zm-4 8.2a1.6 1.6 0 1 1 0-3.2 1.6 1.6 0 0 1 0 3.2Zm3.4-3.6a1.6 1.6 0 1 1 0-3.2 1.6 1.6 0 0 1 0 3.2Zm4.2 0a1.6 1.6 0 1 1 0-3.2 1.6 1.6 0 0 1 0 3.2Zm2.4 4.2a1.6 1.6 0 1 1 0-3.2 1.6 1.6 0 0 1 0 3.2Z'/%3E%3C/svg%3E") !important;
}
body.builder-mode .rail-tab[data-builder-tab="settings"]::before,
.rail-tab[data-builder-tab="settings"]::before {
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23a9a9ad' d='M19.4 13.5c.1-.5.1-1 .1-1.5s0-1-.1-1.5l2-1.5-2-3.5-2.4 1a8 8 0 0 0-2.6-1.5L14 2h-4l-.4 3a8 8 0 0 0-2.6 1.5l-2.4-1-2 3.5 2 1.5c-.1.5-.1 1-.1 1.5s0 1 .1 1.5l-2 1.5 2 3.5 2.4-1a8 8 0 0 0 2.6 1.5l.4 3h4l.4-3a8 8 0 0 0 2.6-1.5l2.4 1 2-3.5-2-1.5ZM12 15.5A3.5 3.5 0 1 1 12 8a3.5 3.5 0 0 1 0 7.5Z'/%3E%3C/svg%3E") !important;
}
/* active/hover icon tint */
body.builder-mode .rail-tab.active[data-builder-tab]::before,
.rail-tab.active[data-builder-tab]::before,
body.builder-mode .rail-tab:hover[data-builder-tab]::before,
.rail-tab:hover[data-builder-tab]::before {
  filter: brightness(2.2) saturate(1.1) !important;
}


/* 2026-06-28 final rail icon repair: use unique inline SVG classes not affected by older hidden icon rules. */
body.builder-mode .rail-tab .rail-icon-live,
.rail-tab .rail-icon-live {
  display: grid !important;
  place-items: center !important;
  width: 22px !important;
  height: 22px !important;
  margin: 0 auto 4px !important;
  color: currentColor !important;
  opacity: .88 !important;
  line-height: 1 !important;
  font-size: 0 !important;
}
body.builder-mode .rail-tab .rail-svg-live,
.rail-tab .rail-svg-live {
  display: block !important;
  width: 22px !important;
  height: 22px !important;
  fill: currentColor !important;
  color: currentColor !important;
}
body.builder-mode .rail-tab::before,
.rail-tab::before {
  display: none !important;
  content: none !important;
  background-image: none !important;
}
body.builder-mode .rail-tab b,
body.builder-mode .rail-help b,
.rail-tab b,
.rail-help b {
  font-weight: 400 !important;
  letter-spacing: 0 !important;
}
body.builder-mode .rail-tab.active .rail-icon-live,
body.builder-mode .rail-tab:hover .rail-icon-live,
.rail-tab.active .rail-icon-live,
.rail-tab:hover .rail-icon-live {
  opacity: 1 !important;
}

/* 2026-06-28 builder topbar + mobile preview mode */
body.builder-mode .widget-editor-app.advanced-builder,
.widget-editor-app.advanced-builder {
  grid-template-columns: 345px minmax(0, 1fr) !important;
  grid-template-rows: 60px minmax(0, 1fr) !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
}
.builder-topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  height: 60px;
  min-height: 60px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 20px 0 14px;
  z-index: 50;
  box-shadow: 0 1px 9px rgba(15, 23, 42, .05);
}
.builder-topbar-brand { display:flex; align-items:center; gap:12px; min-width:0; }
.builder-app-mark { width:28px; height:28px; display:grid; grid-template-columns:repeat(2, 1fr); gap:2px; flex:0 0 28px; }
.builder-app-mark i { border-radius:3px; background:#ff3b7b; color:#fff; display:grid; place-items:center; font-size:7px; font-style:normal; font-weight:800; line-height:1; text-transform:uppercase; }
.builder-app-mark i:nth-child(2) { background:#ff4e8a; }
.builder-app-mark i:nth-child(3) { background:#ff316f; }
.builder-app-mark i:nth-child(4) { background:#ec2b62; }
.builder-topbar-brand strong { display:block; max-width:42vw; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:16px; line-height:1.1; color:#111827; }
.builder-topbar-brand span:not(.builder-app-mark):not(.builder-cloud) { display:block; color:#6b7280; font-size:12px; margin-top:3px; }
.builder-cloud { color:#9ca3af; font-size:19px; line-height:1; margin-left:6px; }
.builder-topbar-actions { display:flex; align-items:center; gap:10px; }
.builder-topbar-actions .btn,
.builder-device-toggle { min-height:38px; border-radius:9px; padding:9px 13px; font-size:14px; font-weight:700; }
.builder-device-toggle { background:#f3f4f6; color:#111827; border:1px solid #e5e7eb; display:inline-flex; align-items:center; gap:7px; cursor:pointer; }
.builder-device-toggle svg { width:17px; height:17px; fill:currentColor; color:#6b7280; }
.builder-device-toggle span { font-size:0; width:0; overflow:hidden; }
.builder-device-toggle.active { background:#e8f2ff; color:#1877f2; border-color:#bfdbfe; }
.builder-device-toggle.active svg { color:#1877f2; }
body.builder-mode .advanced-builder-form,
.advanced-builder-form {
  grid-column: 1;
  grid-row: 2;
  min-height: 0 !important;
  height: calc(100vh - 60px) !important;
}
body.builder-mode .builder-panel,
.builder-panel {
  height: calc(100vh - 60px) !important;
  max-height: calc(100vh - 60px) !important;
}
body.builder-mode .builder-rail,
.builder-rail { height: calc(100vh - 60px) !important; }
body.builder-mode .widget-editor-stage,
.advanced-builder .widget-editor-stage {
  grid-column: 2;
  grid-row: 2;
  height: calc(100vh - 60px) !important;
  min-height: 0 !important;
}
body.builder-mode .stage-toolbar,
.advanced-builder .stage-toolbar { display:none !important; }
body.builder-mode .stage-canvas,
.advanced-builder .stage-canvas {
  height: calc(100vh - 60px) !important;
  overflow: auto !important;
  padding: 32px !important;
  display:flex;
  justify-content:center;
  align-items:flex-start;
}
body.builder-mode .stage-site-demo,
.advanced-builder .stage-site-demo {
  width: 100%;
  transition: max-width .22s ease, border-radius .22s ease, min-height .22s ease, padding .22s ease;
}
body.builder-mobile-preview .stage-canvas { background: #eef1f5 !important; }
body.builder-mobile-preview .stage-site-demo {
  width: min(390px, calc(100vw - 40px)) !important;
  max-width: 390px !important;
  min-height: 720px !important;
  border-radius: 28px !important;
  border: 10px solid #111827 !important;
  padding: 18px !important;
  box-shadow: 0 24px 70px rgba(15,23,42,.28) !important;
  overflow:hidden;
}
body.builder-mobile-preview #bdm-editor-preview { margin-top: 0 !important; }
@media (max-width:900px) {
  .builder-topbar { position:sticky; top:0; }
  body.builder-mode .advanced-builder-form,
  .advanced-builder-form { grid-column:1; grid-row:2; width:100% !important; max-width:none !important; }
  body.builder-mode .widget-editor-stage,
  .advanced-builder .widget-editor-stage { grid-column:1; grid-row:3; height:auto !important; }
  body.builder-mode .widget-editor-app.advanced-builder,
  .widget-editor-app.advanced-builder { grid-template-rows:60px auto auto !important; height:auto !important; overflow:auto !important; }
  .builder-topbar-brand strong { max-width:50vw; }
}

/* 2026-06-28 topbar layout correction: fixed full-width builder header */
body.builder-mode {
  overflow: hidden !important;
  background: #f4f6f8 !important;
}
body.builder-mode .container {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.builder-mode .widget-editor-app.advanced-builder,
.widget-editor-app.advanced-builder {
  position: relative !important;
  display: grid !important;
  grid-template-columns: 345px minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  padding-top: 60px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.builder-topbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100vw !important;
  height: 60px !important;
  min-height: 60px !important;
  box-sizing: border-box !important;
  background: #ffffff !important;
  border-bottom: 1px solid #e5e7eb !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  padding: 0 20px 0 18px !important;
  z-index: 9999 !important;
  box-shadow: 0 1px 9px rgba(15, 23, 42, .05) !important;
}
.builder-topbar-brand {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}
.builder-topbar-brand > div {
  display: block !important;
  min-width: 0 !important;
}
.builder-topbar-brand strong {
  display: block !important;
  max-width: 48vw !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 15px !important;
  line-height: 1.15 !important;
  color: #111827 !important;
  font-weight: 700 !important;
}
.builder-topbar-brand span:not(.builder-app-mark):not(.builder-cloud) {
  display: block !important;
  color: #6b7280 !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  margin-top: 3px !important;
}
.builder-app-mark {
  width: 28px !important;
  height: 28px !important;
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 2px !important;
  flex: 0 0 28px !important;
}
.builder-app-mark i {
  border-radius: 3px !important;
  background: #ff3b7b !important;
  color: #fff !important;
  display: grid !important;
  place-items: center !important;
  font-size: 7px !important;
  font-style: normal !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
}
.builder-cloud { color: #9ca3af !important; font-size: 18px !important; line-height: 1 !important; margin-left: 4px !important; }
.builder-topbar-actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex: 0 0 auto !important;
}
.builder-topbar-actions .btn,
.builder-device-toggle {
  min-height: 38px !important;
  border-radius: 9px !important;
  padding: 9px 13px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  box-sizing: border-box !important;
}
.builder-device-toggle {
  background: #f3f4f6 !important;
  color: #111827 !important;
  border: 1px solid #e5e7eb !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  cursor: pointer !important;
  width: 42px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.builder-device-toggle svg { width: 18px !important; height: 18px !important; fill: currentColor !important; color: #6b7280 !important; }
.builder-device-toggle span { font-size: 0 !important; width: 0 !important; overflow: hidden !important; white-space: nowrap !important; }
.builder-device-toggle.active { background: #e8f2ff !important; color: #1877f2 !important; border-color: #bfdbfe !important; }
.builder-device-toggle.active svg { color: #1877f2 !important; }
body.builder-mode .advanced-builder-form,
.advanced-builder-form {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 345px !important;
  height: calc(100vh - 60px) !important;
  min-height: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}
body.builder-mode .builder-panel,
.builder-panel {
  height: calc(100vh - 60px) !important;
  max-height: calc(100vh - 60px) !important;
}
body.builder-mode .builder-rail,
.builder-rail {
  height: calc(100vh - 60px) !important;
  max-height: calc(100vh - 60px) !important;
}
body.builder-mode .widget-editor-stage,
.advanced-builder .widget-editor-stage {
  grid-column: 2 !important;
  grid-row: 1 !important;
  height: calc(100vh - 60px) !important;
  min-height: 0 !important;
  width: 100% !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
body.builder-mode .stage-toolbar,
.advanced-builder .stage-toolbar { display: none !important; }
body.builder-mode .stage-canvas,
.advanced-builder .stage-canvas {
  height: calc(100vh - 60px) !important;
  max-height: calc(100vh - 60px) !important;
  overflow: auto !important;
  padding: 32px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  box-sizing: border-box !important;
}
body.builder-mode .stage-site-demo,
.advanced-builder .stage-site-demo {
  width: 100% !important;
  max-width: 1280px !important;
  margin: 0 auto !important;
  transition: max-width .22s ease, border-radius .22s ease, min-height .22s ease, padding .22s ease !important;
}
body.builder-mobile-preview .stage-canvas { background: #eef1f5 !important; }
body.builder-mobile-preview .stage-site-demo {
  width: min(390px, calc(100vw - 40px)) !important;
  max-width: 390px !important;
  min-height: 720px !important;
  border-radius: 28px !important;
  border: 10px solid #111827 !important;
  padding: 18px !important;
  box-shadow: 0 24px 70px rgba(15,23,42,.28) !important;
  overflow: hidden !important;
}
@media (max-width: 900px) {
  body.builder-mode .widget-editor-app.advanced-builder,
  .widget-editor-app.advanced-builder {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    padding-top: 60px !important;
    overflow: auto !important;
    height: auto !important;
  }
  body.builder-mode .advanced-builder-form,
  .advanced-builder-form { grid-column: 1 !important; grid-row: 1 !important; width: 100% !important; height: auto !important; }
  body.builder-mode .widget-editor-stage,
  .advanced-builder .widget-editor-stage { grid-column: 1 !important; grid-row: 2 !important; height: auto !important; }
}

/* Apps index facelift */
body.app-index-mode { background:#fff; color:#111827; }
body.app-index-mode .topbar {
  height:58px; background:#fff; color:#111827; border-bottom:1px solid #e5e7eb;
  box-shadow:0 2px 10px rgba(15,23,42,.05); padding:0 28px; position:fixed; inset:0 0 auto 0; z-index:40;
}
body.app-index-mode .topbar > div { display:flex; align-items:center; gap:14px; }
body.app-index-mode .topbar > div strong { font-size:18px; letter-spacing:0; }
body.app-index-mode .topbar > div span { display:none; }
body.app-index-mode .topbar > div:before {
  content:'▦'; width:32px; height:32px; border-radius:9px; display:inline-flex; align-items:center; justify-content:center;
  background:#ff3f75; color:#fff; font-weight:800; font-size:18px;
}
body.app-index-mode .topbar nav { display:flex; height:100%; align-items:center; gap:34px; margin-left:auto; }
body.app-index-mode .topbar nav a { color:#4b5563; font-weight:600; padding:20px 0 17px; border-bottom:3px solid transparent; }
body.app-index-mode .topbar nav a:first-child { color:#111827; border-color:#111827; }
body.app-index-mode main.container { max-width:none; margin:0; padding:58px 0 0 302px; min-height:100vh; }
.app-sidebar {
  position:fixed; top:58px; left:0; bottom:0; width:302px; background:#f6f7f9; border-right:1px solid #eef0f3;
  padding:28px 14px; overflow:auto; box-sizing:border-box; z-index:30;
}
.app-sidebar-logo { display:none; }
.app-sidebar nav { display:flex; flex-direction:column; gap:5px; }
.app-sidebar a {
  display:flex; align-items:center; gap:13px; min-height:44px; padding:0 12px; border-radius:6px;
  color:#5b6470; font-weight:600; text-decoration:none; font-size:16px;
}
.app-sidebar a span {
  width:24px; min-width:24px; height:24px; display:inline-flex; align-items:center; justify-content:center;
  color:#9aa0a6; font-size:17px; font-weight:700;
}
.app-sidebar a.active { background:#e9eaec; color:#111827; }
.app-sidebar a.active span { color:#ff3f75; }
.app-sidebar a.add-app { color:#1877f2; margin-top:8px; font-size:17px; }
.app-sidebar a.add-app span { color:#1877f2; font-size:23px; }
.app-main { max-width:1060px; margin:0 auto; padding:66px 44px 80px; box-sizing:border-box; }
.app-topline, .app-page-head, .widget-toolbar { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.app-page-head { margin:0 0 52px; }
.app-page-head h1, .app-main h1 { font-size:30px; margin:0; font-weight:700; letter-spacing:-.02em; }
.pro-pill { display:inline-flex; align-items:center; font-size:11px; border:1px solid #d1d5db; border-radius:999px; padding:3px 8px; margin-left:8px; vertical-align:middle; color:#111827; background:#f8fafc; }
.app-stats { display:flex; gap:30px; color:#4b5563; }
.app-stats div { min-width:110px; }
.app-stats small { display:block; font-size:11px; text-transform:uppercase; color:#8b929c; font-weight:800; margin-bottom:6px; }
.app-stats strong { font-size:14px; color:#111827; }
.app-stats span { display:block; height:4px; margin-top:8px; border-radius:999px; background:linear-gradient(90deg,#22c55e 16%,#e5e7eb 16%); }
.app-tabs { display:flex; align-items:center; gap:38px; border-bottom:1px solid #e5e7eb; margin-bottom:25px; }
.app-tabs a { color:#6b7280; text-decoration:none; font-size:16px; padding:0 0 12px; font-weight:500; }
.app-tabs a.active { color:#111827; font-weight:700; border-bottom:2px solid #111827; margin-bottom:-1px; }
.widget-toolbar { margin:0 0 24px; }
.toolbar-icons { display:flex; gap:17px; color:#8b929c; font-size:22px; align-items:center; }
.widget-actions { display:flex; gap:12px; align-items:center; }
.search-form input { width:210px; height:42px; border:0; border-radius:6px; background:#f7f8fa; color:#6b7280; padding:0 16px; font-size:15px; }
.btn.soft-blue, .btn.pale { border:0; box-shadow:none; height:42px; display:inline-flex; align-items:center; justify-content:center; padding:0 18px; }
.btn.soft-blue { background:#eaf3ff; color:#1877f2; font-weight:700; }
.btn.pale { background:#f4f5f7; color:#111827; font-weight:700; }
.widgets-table-card { background:#fff; border:0; box-shadow:none; }
.widgets-table { width:100%; border-collapse:collapse; font-size:14px; }
.widgets-table th { text-align:left; color:#8b929c; text-transform:uppercase; font-size:12px; font-weight:800; padding:0 0 12px; border-bottom:1px solid #eceff3; }
.widgets-table td { padding:10px 0; border-bottom:1px solid #eceff3; vertical-align:middle; color:#8b929c; }
.widgets-table th:nth-child(2), .widgets-table td:nth-child(2) { width:170px; }
.widgets-table th:nth-child(3), .widgets-table td:nth-child(3) { width:110px; }
.widgets-table th:nth-child(4), .widgets-table td:nth-child(4) { width:210px; text-align:left; }
.widget-name-cell { display:flex; gap:16px; align-items:center; }
.widget-thumb { width:48px; height:36px; border-radius:4px; background:#f1f5f9 center/cover no-repeat; display:inline-block; position:relative; overflow:hidden; }
.widget-thumb:empty:before { content:'▦'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#c4c9d0; font-weight:900; }
.widget-link { color:#1877f2; font-size:17px; font-weight:700; text-decoration:none; }
.widget-name-cell p { margin:3px 0 0; color:#9aa0a6; font-size:13px; }
.row-actions { display:flex; gap:10px; justify-content:flex-start; align-items:center; }
.row-actions form { margin:0; }
.mini-btn { border:0; background:#f4f4f5; color:#111827; border-radius:5px; min-width:74px; height:38px; padding:0 14px; font-weight:800; font-size:15px; display:inline-flex; align-items:center; justify-content:center; text-decoration:none; cursor:pointer; }
.mini-btn.dots { min-width:38px; padding:0; }
.status-pill { display:inline-flex; align-items:center; border-radius:999px; padding:4px 10px; background:#ecfdf5; color:#159447; font-weight:700; font-size:12px; }
.status-pill.inactive { background:#f3f4f6; color:#6b7280; }
.app-card-grid { display:grid; gap:14px; margin-top:22px; }
.app-product-card { display:grid; grid-template-columns:56px 1fr auto; gap:16px; align-items:center; padding:18px; border:1px solid #eef0f3; border-radius:10px; background:#fff; }
.app-product-card h3 { margin:0 0 4px; font-size:18px; }
.app-product-card p { margin:0 0 8px; color:#6b7280; }
.app-product-card span { color:#9aa0a6; font-size:13px; }
.app-product-icon { width:48px; height:48px; border-radius:10px; background:#ff3f75; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:900; }
.app-product-card.is-soon { opacity:.65; }
.app-notice { margin-bottom:20px; }
@media (max-width: 980px) {
  body.app-index-mode main.container { padding-left:0; }
  .app-sidebar { position:relative; top:auto; bottom:auto; width:100%; height:auto; border-right:0; border-bottom:1px solid #eef0f3; display:block; padding:12px; }
  .app-sidebar nav { flex-direction:row; overflow:auto; }
  .app-sidebar a { white-space:nowrap; }
  .app-main { padding:32px 18px 60px; }
  .app-page-head, .widget-toolbar { align-items:flex-start; flex-direction:column; }
  .widget-actions { width:100%; flex-wrap:wrap; }
  .search-form input { width:100%; }
}

/* 2026-06-28 Bee Digital brand refresh: replace hot-pink app accents */
:root {
  --bdm-blue: #1877f2;
  --bdm-sky: #1d9bf0;
  --bdm-honey: #f6c544;
  --bdm-orange: #f59e0b;
  --bdm-ink: #111827;
}

/* Top builder app mark: blue / honey / orange instead of hot pink */
.builder-app-mark i,
body.builder-mode .builder-app-mark i {
  background: var(--bdm-blue) !important;
  color: #ffffff !important;
}
.builder-app-mark i:nth-child(2),
body.builder-mode .builder-app-mark i:nth-child(2) { background: var(--bdm-sky) !important; }
.builder-app-mark i:nth-child(3),
body.builder-mode .builder-app-mark i:nth-child(3) { background: var(--bdm-honey) !important; color: #111827 !important; }
.builder-app-mark i:nth-child(4),
body.builder-mode .builder-app-mark i:nth-child(4) { background: var(--bdm-orange) !important; color: #111827 !important; }

/* My Apps topbar logo mark */
body.app-index-mode .topbar > div:before {
  background: linear-gradient(135deg, var(--bdm-blue), var(--bdm-sky) 48%, var(--bdm-honey)) !important;
  color: #ffffff !important;
}

/* Sidebar active app icon, product icons, and primary app accents */
.app-sidebar a.active span {
  color: var(--bdm-orange) !important;
}
.app-product-icon {
  background: linear-gradient(135deg, var(--bdm-blue), var(--bdm-sky)) !important;
  color: #ffffff !important;
}

/* Keep add/create actions blue and reserve honey/orange for branding highlights */
.btn.soft-blue,
.app-sidebar a.add-app,
.app-sidebar a.add-app span,
.widget-link {
  color: var(--bdm-blue) !important;
}
.btn.soft-blue {
  background: #eaf3ff !important;
}
.pro-pill {
  border-color: rgba(246,197,68,.55) !important;
  background: rgba(246,197,68,.14) !important;
  color: #7a5200 !important;
}

/* Progress meter accent: honey to blue */
.app-stats span {
  background: linear-gradient(90deg, var(--bdm-honey) 16%, #e5e7eb 16%) !important;
}

/* Any old pink hard-coded fallback that sneaks through */
[style*="#ff3f75"],
[style*="#ff3b7b"] {
  background: var(--bdm-blue) !important;
}

/* 2026-06-28 Manual Facebook Page Source fallback */
.section-heading-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:26px 0 12px;
}
.section-heading-row h3 { margin:0; }
.source-badge {
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:5px 10px;
  font-size:12px;
  line-height:1;
  font-weight:700;
  border:1px solid #d1d5db;
  background:#f9fafb;
  color:#374151;
}
.source-badge.manual {
  border-color:#f6c544;
  background:#fff8db;
  color:#8a5b00;
}
.source-badge.oauth {
  border-color:#bfdbfe;
  background:#eff6ff;
  color:#1d4ed8;
}
.manual-source-callout {
  margin-top:18px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  border:1px solid #fde68a;
  background:#fffbeb;
  border-radius:16px;
  color:#374151;
}
.manual-source-callout strong { color:#111827; }
.manual-source-callout span { flex:1; color:#6b7280; }
.manual-source-callout a { color:#0b84ff; font-weight:700; text-decoration:none; }
.manual-source-panel { max-width:920px; }
.manual-source-form label { display:block; margin:16px 0 7px; font-weight:800; color:#111827; }
.manual-source-form textarea { width:100%; min-height:150px; resize:vertical; font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size:13px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.manual-token-help { margin:12px 0 18px; padding:12px 14px; border-radius:12px; background:#f3f4f6; color:#4b5563; }
.builder-field .help a { color:#2f9bff; font-weight:700; text-decoration:none; }
@media (max-width:720px) {
  .section-heading-row, .manual-source-callout { align-items:flex-start; flex-direction:column; }
  .form-grid { grid-template-columns:1fr; }
}

/* Manual Facebook token instructions */
.manual-token-instructions{margin-top:18px;border:1px solid #dbe3ef;border-radius:14px;background:#f8fbff;overflow:hidden}
.manual-token-instructions summary{cursor:pointer;padding:16px 18px;font-weight:800;color:#0f172a;list-style:none;display:flex;align-items:center;justify-content:space-between}
.manual-token-instructions summary::-webkit-details-marker{display:none}
.manual-token-instructions summary::after{content:'+';font-size:22px;color:#1877f2;font-weight:700}
.manual-token-instructions[open] summary::after{content:'–'}
.manual-token-instructions .instruction-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:22px;padding:0 18px 18px;color:#334155;line-height:1.55}
.manual-token-instructions h4,.manual-token-guide h3{margin:0 0 8px;color:#111827;font-size:15px}
.manual-token-instructions ol,.manual-token-instructions ul,.manual-token-guide ol{margin:8px 0 0;padding-left:20px}
.manual-token-instructions li,.manual-token-guide li{margin:6px 0}
.manual-token-instructions code,.manual-token-guide code{background:#eef4ff;border:1px solid #d7e6ff;color:#0f4ca8;border-radius:6px;padding:2px 5px;font-size:.92em}
.manual-token-guide{background:#fff8e8;border:1px solid #f6d78c;border-radius:14px;padding:16px 18px;margin:16px 0 18px;color:#3f3420;line-height:1.55}
.manual-token-guide p{margin:10px 0 0;color:#6b5840}
@media(max-width:850px){.manual-token-instructions .instruction-grid{grid-template-columns:1fr}}

/* 2026-06-28 widget list action refinement */
.widgets-table { table-layout:auto; }
.widgets-table th:first-child, .widgets-table td:first-child { width:auto; }
.widgets-table th:nth-child(2), .widgets-table td:nth-child(2) { width:120px; }
.widgets-table th:nth-child(3), .widgets-table td:nth-child(3) { width:90px; }
.widgets-table th:nth-child(4), .widgets-table td:nth-child(4) { width:188px; text-align:right; }
.widget-name-cell { gap:12px; min-width:0; }
.widget-name-cell > div { min-width:0; max-width:none; }
.widget-link { display:block; white-space:nowrap; overflow:visible; text-overflow:clip; max-width:none; font-weight:600; }
.widget-name-cell p { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:420px; }
.row-actions { justify-content:flex-end; gap:7px; white-space:nowrap; }
.row-actions form { display:inline-flex; margin:0; }
.mini-btn { min-width:0; height:34px; padding:0 12px; border-radius:8px; font-weight:500 !important; font-size:14px; letter-spacing:0; transition:background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.mini-btn:hover { transform:translateY(-1px); }
.mini-edit { background:#f5f6f8; color:#1f2937; border:1px solid #edf0f3; }
.mini-edit:hover { background:#e9edf2; }
.mini-install { background:#eaf3ff; color:#1877f2; border:1px solid #d9eaff; }
.mini-install:hover { background:#dcecff; }
.icon-btn { width:34px; min-width:34px; padding:0; border:1px solid #e5e7eb; background:#fff; color:#6b7280; position:relative; }
.icon-btn:hover { background:#f7fafc; color:#1877f2; border-color:#d9eaff; }
.refresh-icon { font-size:16px; }
.replicate-icon { border-radius:999px; }
.replicate-icon:before,
.replicate-icon:after { content:''; position:absolute; width:12px; height:12px; border:2px solid currentColor; border-radius:4px; background:transparent; }
.replicate-icon:before { left:9px; top:11px; opacity:.75; }
.replicate-icon:after { left:13px; top:7px; background:#fff; }
.replicate-icon:hover:after { background:#f7fafc; }
.sr-only { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important; }
@media (max-width: 1100px) {
  .widgets-table th:nth-child(2), .widgets-table td:nth-child(2),
  .widgets-table th:nth-child(3), .widgets-table td:nth-child(3) { display:none; }
  .widgets-table th:nth-child(4), .widgets-table td:nth-child(4) { width:172px; }
  .widget-name-cell p { max-width:300px; }
}

/* Source picker merge: make the top source card handle source replacement */
.source-picker-card{background:#333335;border:1px solid rgba(255,255,255,.035);border-radius:6px;margin-bottom:18px;overflow:hidden;}
.source-picker-card .source-card{border:0;border-radius:0;margin:0;background:transparent;grid-template-columns:44px 1fr;padding:14px 18px;}
.source-picker-card .source-card em{display:none!important;}
.source-picker-details{border-top:1px solid #242426;}
.source-picker-details summary{list-style:none;cursor:pointer;user-select:none;}
.source-picker-details summary::-webkit-details-marker{display:none;}
.source-picker-details[open] .source-add{border-bottom:1px solid #242426;}
.source-picker-body{padding:14px 18px 16px;}
.source-picker-body .builder-field{margin:0;}
.source-picker-body select{margin-top:6px;}
.source-picker-body .help{margin:10px 0 0;line-height:1.45;}
.source-picker-card + .settings-card{margin-top:18px;}

/* 2026-06-28 delete widget action */
.widgets-table th:nth-child(4), .widgets-table td:nth-child(4) { width:230px; }
.trash-icon { color:#9ca3af; }
.trash-icon:before,
.trash-icon:after { content:''; position:absolute; left:50%; transform:translateX(-50%); }
.trash-icon:before { width:14px; height:15px; top:12px; border:2px solid currentColor; border-top:0; border-radius:0 0 4px 4px; }
.trash-icon:after { width:16px; height:2px; top:8px; background:currentColor; border-radius:999px; box-shadow:0 -3px 0 -1px currentColor; }
.trash-icon:hover { color:#dc2626; background:#fff1f2; border-color:#fecdd3; }
@media (max-width: 1100px) {
  .widgets-table th:nth-child(4), .widgets-table td:nth-child(4) { width:210px; }
}

/* 2026-06-28 embed code polish: copy icon + quieter regenerate link */
.embed-panel-head { justify-content:space-between; align-items:flex-start; gap:18px; }
.embed-panel-actions { display:flex; align-items:center; gap:14px; }
.embed-panel-actions form { margin:0; }
.copy-code-btn { width:44px; height:44px; border-radius:999px; border:1px solid #d8dee8; background:#fff; color:#111827; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; position:relative; transition:background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.copy-code-btn:hover { background:#f8fafc; color:#1877f2; border-color:#cfe0ff; transform:translateY(-1px); box-shadow:0 8px 18px rgba(17,24,39,.08); }
.copy-code-btn.copied { background:#ecfdf3; color:#16a34a; border-color:#bbf7d0; }
.copy-code-icon:before,
.copy-code-icon:after { content:''; position:absolute; width:14px; height:16px; border:2px solid currentColor; border-radius:5px; background:transparent; }
.copy-code-icon:before { left:14px; top:16px; opacity:.75; }
.copy-code-icon:after { left:18px; top:11px; background:#fff; }
.copy-code-btn:hover .copy-code-icon:after { background:#f8fafc; }
.copy-code-btn.copied .copy-code-icon:after { background:#ecfdf3; }
.link-button { border:0; background:transparent; padding:0; color:#6b7280; font:inherit; font-size:14px; font-weight:500; cursor:pointer; text-decoration:none; }
.link-button:hover { color:#1877f2; text-decoration:underline; }
.link-button.subtle-danger:hover { color:#dc2626; }
.copy-status { min-height:18px; margin:10px 0 0; color:#16a34a; font-size:13px; font-weight:600; }
@media (max-width: 700px) {
  .embed-panel-head { align-items:flex-start; }
  .embed-panel-actions { flex-direction:column; align-items:flex-end; gap:10px; }
}

/* 2026-06-28 inline widget rename control */
.widget-title-line{display:flex;align-items:center;gap:7px;min-width:0;}
.widget-title-line .widget-link{display:inline-block;min-width:0;max-width:100%;}
.inline-rename-form{display:inline-flex;margin:0;flex:0 0 auto;}
.rename-widget-icon{width:24px;height:24px;border:0;background:transparent;border-radius:999px;color:#9aa0a6;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;position:relative;opacity:.72;transition:opacity .15s ease,color .15s ease,background .15s ease,transform .15s ease;}
.rename-widget-icon:before{content:'';width:14px;height:14px;display:block;background:currentColor;clip-path:path('M11.2 1.1c.4-.4 1-.4 1.4 0l.3.3c.4.4.4 1 0 1.4l-7.8 7.8-2.5.7.7-2.5 7.9-7.7ZM2.1 12.4h10.2v1.3H2.1v-1.3Z');}
.rename-widget-icon:hover{opacity:1;color:#1877f2;background:#eef6ff;transform:translateY(-1px);}
.widgets-table td:first-child{padding-right:26px;}
@media(max-width:1100px){.widget-title-line{max-width:100%;}.rename-widget-icon{width:22px;height:22px;}}

/* 2026-06-28 install/preview page polish */
.install-main { max-width:1120px; }
.install-topline { align-items:flex-start; margin-bottom:28px; }
.install-topline h1 { margin-top:6px; line-height:1.15; }
.crumb-link { color:#1877f2; font-weight:700; font-size:14px; text-decoration:none; }
.crumb-link:hover { text-decoration:underline; }
.install-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.install-actions form { margin:0; }
.install-actions .btn,
.install-actions button { height:40px; font-weight:600; border-radius:7px; }
.install-card { background:#fff; border:1px solid #eef0f3; border-radius:14px; padding:26px 30px; box-shadow:0 12px 32px rgba(15,23,42,.06); margin-bottom:24px; }
.install-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:18px; }
.install-card h2 { margin:2px 0 4px; font-size:24px; line-height:1.15; letter-spacing:-.015em; }
.section-kicker { display:block; color:#8b929c; font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; margin-bottom:4px; }
.install-copybox { margin:0; border-radius:12px; padding:20px 22px; line-height:1.45; border:1px solid #172033; box-shadow:inset 0 1px 0 rgba(255,255,255,.04); }
.install-meta-row { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-top:14px; color:#6b7280; font-size:13px; }
.install-meta-row form { margin:0; }
.install-meta-row code { background:#f4f7fb; color:#111827; border:1px solid #e5e7eb; border-radius:6px; padding:3px 6px; }
.install-preview-wrap { background:#f8fafc; border:1px dashed #cdd6e1; border-radius:14px; padding:28px; }
.install-preview-wrap .bdm-widget { margin:0 auto; }
.install-main .copy-status { margin-bottom:0; }
@media (max-width: 980px) {
  .install-topline, .install-card-head { flex-direction:column; }
  .install-actions { justify-content:flex-start; }
  .install-card { padding:20px; }
  .install-preview-wrap { padding:18px; }
}

/* 2026-06-28 wider app content + dashboard grid */
body.app-index-mode main.container{
  padding-left:302px;
}
.app-main{
  max-width:1480px;
  width:min(1480px, calc(100vw - 302px - 72px));
  margin:0 auto;
  padding:66px 36px 80px;
}
.install-main{
  max-width:1480px;
}
.app-topline{
  max-width:none;
}
.app-card-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));
  gap:20px;
  align-items:stretch;
  margin-top:28px;
}
.app-product-card{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  min-height:230px;
  padding:24px;
  border-radius:16px;
  position:relative;
  gap:16px;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.app-product-card:hover{
  transform:translateY(-2px);
  box-shadow:0 16px 36px rgba(15,23,42,.08);
  border-color:#dbeafe;
}
.app-product-card > div:nth-child(2){
  flex:1;
}
.app-product-card h3{
  font-size:20px;
  margin-bottom:8px;
  letter-spacing:-.01em;
}
.app-product-card p{
  line-height:1.45;
  margin-bottom:12px;
}
.app-product-card .btn{
  align-self:flex-start;
  margin-top:auto;
}
.app-product-icon{
  width:52px;
  height:52px;
  border-radius:14px;
}
.widgets-table-card,
.install-card{
  width:100%;
}
@media (min-width: 1500px){
  .widgets-table th:nth-child(1),
  .widgets-table td:nth-child(1){width:auto;}
  .widgets-table th:nth-child(4),
  .widgets-table td:nth-child(4){width:300px;}
}
@media (max-width: 980px){
  body.app-index-mode main.container{padding-left:0;}
  .app-main{
    width:100%;
    max-width:none;
    padding:32px 18px 60px;
  }
  .app-card-grid{
    grid-template-columns:1fr;
  }
  .app-product-card{
    min-height:0;
  }
}

/* Light install code + polished utility pages */
.copybox,
.install-copybox {
  background:#f8fafc !important;
  color:#0f172a !important;
  border:1px solid #e2e8f0 !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8) !important;
}
.install-copybox code,
.copybox code { color:inherit; }
.copy-status { color:#2563eb; font-weight:600; margin:.65rem 0 0; }

.login-polish-mode .topbar { border-bottom:0; background:transparent; box-shadow:none; }
.auth-shell {
  min-height:calc(100vh - 74px);
  display:grid;
  place-items:center;
  padding:54px 22px;
  background:radial-gradient(circle at top left, rgba(37,99,235,.08), transparent 34%), linear-gradient(180deg,#f8fafc 0%,#eef2f7 100%);
}
.auth-card {
  width:min(460px, 100%);
  background:#fff;
  border:1px solid #e8edf4;
  border-radius:24px;
  padding:38px;
  box-shadow:0 24px 70px rgba(15,23,42,.10);
}
.auth-mark {
  width:44px; height:44px;
  display:grid; place-items:center;
  border-radius:12px;
  color:#fff; font-weight:800;
  background:linear-gradient(135deg,#1877f2,#facc15);
  margin-bottom:18px;
}
.auth-card h1 { font-size:34px; line-height:1.06; margin:2px 0 8px; letter-spacing:-.035em; }
.auth-form { margin-top:24px; display:grid; gap:12px; }
.auth-form label { margin:0 0 -4px; }
.auth-submit { width:100%; justify-content:center; margin-top:6px; }
.auth-footnote { color:#94a3b8; font-size:12px; margin:18px 0 0; }

.connections-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; align-items:start; }
.connection-card { margin-bottom:0; }
.connection-card .install-card-head { align-items:flex-start; }
.connection-count {
  width:42px; height:42px; border-radius:999px;
  display:grid; place-items:center;
  background:#eff6ff; color:#1877f2;
  font-weight:800; border:1px solid #dbeafe;
}
.connection-list, .source-list { display:grid; gap:10px; margin-top:18px; }
.connection-row, .source-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:16px;
  align-items:center;
  padding:14px 0;
  border-top:1px solid #eef2f7;
}
.connection-row:first-child, .source-row:first-child { border-top:0; }
.connection-row strong, .source-row strong { display:block; font-size:15px; color:#0f172a; margin-bottom:4px; }
.connection-row span, .source-row span, .connection-row small, .source-row small { color:#64748b; font-size:12px; line-height:1.35; }
.connection-row code, .source-row code { background:#f1f5f9; color:#334155; padding:2px 6px; border-radius:6px; }
.empty-state { padding:18px; border:1px dashed #dbe3ed; border-radius:14px; color:#64748b; background:#f8fafc; }
.manual-source-callout.polished {
  margin-top:20px;
  background:linear-gradient(135deg,#fff7ed,#eff6ff);
  border:1px solid #fed7aa;
  color:#334155;
}
.manual-source-callout.polished a { color:#1877f2; font-weight:700; }
.muted-card { opacity:.82; }
@media (max-width:1100px) { .connections-grid { grid-template-columns:1fr; } }
@media (max-width:720px) {
  .auth-card { padding:28px; border-radius:18px; }
  .connection-row, .source-row { grid-template-columns:1fr; gap:8px; }
}

/* 2026-06-28 sitewide polish: light install code + dark theme toggle */
:root {
  --bdm-page:#f8fafc;
  --bdm-surface:#ffffff;
  --bdm-surface-2:#f1f5f9;
  --bdm-border:#e5eaf2;
  --bdm-text:#081427;
  --bdm-muted:#64748b;
  --bdm-link:#1877f2;
  --bdm-shadow:0 18px 55px rgba(15,23,42,.08);
  --bdm-code-bg:#f8fafc;
  --bdm-code-text:#0f172a;
  --bdm-code-border:#dbe4ef;
}
html[data-theme="dark"] {
  --bdm-page:#0b1220;
  --bdm-surface:#111827;
  --bdm-surface-2:#172033;
  --bdm-border:#263247;
  --bdm-text:#f8fafc;
  --bdm-muted:#a8b3c7;
  --bdm-link:#60a5fa;
  --bdm-shadow:0 18px 55px rgba(0,0,0,.38);
  --bdm-code-bg:#172033;
  --bdm-code-text:#e6edf7;
  --bdm-code-border:#2b3a52;
  color-scheme:dark;
}
html[data-theme="dark"] body,
html[data-theme="dark"] body.app-index-mode,
html[data-theme="dark"] body.login-polish-mode { background:var(--bdm-page) !important; color:var(--bdm-text) !important; }
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .install-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .app-product-card,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .connection-card,
html[data-theme="dark"] .widget-table-wrap,
html[data-theme="dark"] .app-list-card,
html[data-theme="dark"] .preview-shell { background:var(--bdm-surface) !important; border-color:var(--bdm-border) !important; color:var(--bdm-text) !important; box-shadow:var(--bdm-shadow); }
html[data-theme="dark"] .app-sidebar { background:#0f172a !important; border-color:#202b3f !important; }
html[data-theme="dark"] .app-sidebar a,
html[data-theme="dark"] .topbar nav a,
html[data-theme="dark"] .topbar-brand strong,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] .widget-title-link,
html[data-theme="dark"] .install-card h2,
html[data-theme="dark"] .connection-row strong,
html[data-theme="dark"] .source-row strong { color:var(--bdm-text) !important; }
html[data-theme="dark"] .help,
html[data-theme="dark"] .section-kicker,
html[data-theme="dark"] .topbar-brand em,
html[data-theme="dark"] .connection-row span,
html[data-theme="dark"] .source-row span,
html[data-theme="dark"] .connection-row small,
html[data-theme="dark"] .source-row small,
html[data-theme="dark"] .app-product-card p { color:var(--bdm-muted) !important; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { background:#0b1220 !important; border-color:#2c3a50 !important; color:var(--bdm-text) !important; }
html[data-theme="dark"] .btn.secondary,
html[data-theme="dark"] .btn.ghost,
html[data-theme="dark"] .action-btn,
html[data-theme="dark"] .widget-row-action,
html[data-theme="dark"] .copy-code-btn { background:var(--bdm-surface-2) !important; border-color:var(--bdm-border) !important; color:var(--bdm-text) !important; }
html[data-theme="dark"] .btn.primary,
html[data-theme="dark"] .auth-submit { background:#2563eb !important; color:#fff !important; }
.copybox,
.install-copybox,
pre.copybox,
pre.install-copybox,
.embed-panel pre,
.install-card pre { background:var(--bdm-code-bg) !important; color:var(--bdm-code-text) !important; border:1px solid var(--bdm-code-border) !important; border-radius:14px !important; box-shadow:inset 0 1px 0 rgba(255,255,255,.75) !important; white-space:pre-wrap; word-break:break-word; overflow:auto; }
.copybox code,
.install-copybox code,
.embed-panel pre code,
.install-card pre code { color:inherit !important; }
.install-meta-row code,
.connection-row code,
.source-row code { background:var(--bdm-surface-2) !important; color:var(--bdm-text) !important; border:1px solid var(--bdm-border) !important; }
.topbar { background:var(--bdm-surface) !important; border-bottom:1px solid var(--bdm-border) !important; box-shadow:0 1px 0 rgba(15,23,42,.02) !important; }
.topbar-brand { display:inline-flex; align-items:center; gap:12px; text-decoration:none; color:var(--bdm-text); }
.topbar-mark { width:34px; height:34px; display:grid; place-items:center; border-radius:10px; color:#fff; font-size:16px; font-weight:800; background:linear-gradient(135deg,#1877f2,#facc15); }
.topbar-brand span:last-child { display:grid; line-height:1.15; }
.topbar-brand em { font-style:normal; font-size:12px; color:var(--bdm-muted); font-weight:500; }
.login-polish-mode .topbar { background:transparent !important; border-bottom:0 !important; box-shadow:none !important; }
html[data-theme="dark"] .auth-shell { background:radial-gradient(circle at top left, rgba(37,99,235,.16), transparent 34%), linear-gradient(180deg,#0b1220 0%,#111827 100%) !important; }
.connections-grid .install-card,
.connection-card { border-radius:22px; }
.manual-source-callout.polished { border-radius:16px; }
html[data-theme="dark"] .manual-source-callout.polished { background:linear-gradient(135deg,rgba(250,204,21,.10),rgba(24,119,242,.12)) !important; border-color:#334155 !important; color:var(--bdm-text) !important; }
.theme-toggle { position:fixed; right:22px; bottom:22px; z-index:9999; width:52px; height:52px; border-radius:999px; border:1px solid var(--bdm-border); background:var(--bdm-surface); color:var(--bdm-text); display:flex; align-items:center; justify-content:center; gap:2px; cursor:pointer; box-shadow:0 16px 36px rgba(15,23,42,.16); transition:transform .15s ease, box-shadow .15s ease, background .15s ease; }
.theme-toggle:hover { transform:translateY(-2px); box-shadow:0 20px 44px rgba(15,23,42,.22); }
.theme-toggle span { line-height:1; font-weight:800; }
.theme-toggle-sun { color:#f59e0b; }
.theme-toggle-moon { color:#1877f2; margin-left:-2px; }
html[data-theme="dark"] .theme-toggle { box-shadow:0 16px 36px rgba(0,0,0,.42); }
html[data-theme="dark"] .theme-toggle-sun { opacity:.45; }
html[data-theme="dark"] .theme-toggle-moon { color:#dbeafe; opacity:1; }
@media (max-width:720px) { .theme-toggle { right:14px; bottom:14px; width:46px; height:46px; } }

/* 2026-06-28 universal topbar polish */
.topbar,
body.app-index-mode .topbar {
  height:58px !important;
  background:#ffffff !important;
  color:#111827 !important;
  border-bottom:1px solid #e5e7eb !important;
  box-shadow:0 2px 10px rgba(15,23,42,.045) !important;
  padding:0 28px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:24px !important;
}
body.app-index-mode .topbar { position:fixed !important; inset:0 0 auto 0 !important; z-index:40 !important; }
.topbar-brand,
body.app-index-mode .topbar-brand {
  display:inline-flex !important;
  align-items:center !important;
  gap:12px !important;
  text-decoration:none !important;
  color:#111827 !important;
}
.topbar-brand strong,
body.app-index-mode .topbar-brand strong {
  display:block !important;
  color:#111827 !important;
  font-size:18px !important;
  letter-spacing:0 !important;
  line-height:1.05 !important;
}
.topbar-brand em,
body.app-index-mode .topbar-brand em {
  display:block !important;
  color:#6b7280 !important;
  font-style:normal !important;
  font-size:12px !important;
  font-weight:500 !important;
  margin-top:3px !important;
}
.topbar-mark,
body.app-index-mode .topbar-mark {
  width:34px !important;
  height:34px !important;
  display:grid !important;
  place-items:center !important;
  border-radius:10px !important;
  color:#fff !important;
  font-size:16px !important;
  font-weight:800 !important;
  background:linear-gradient(135deg,#1877f2,#facc15) !important;
  flex:0 0 auto !important;
}
/* Disable older faux-logo rules that were attached to a div-based header. */
body.app-index-mode .topbar > div:before { content:none !important; display:none !important; }
body.app-index-mode .topbar > div span { display:initial !important; }
.topbar-nav,
body.app-index-mode .topbar nav,
body.app-index-mode .topbar-nav {
  display:flex !important;
  height:100% !important;
  align-items:center !important;
  gap:34px !important;
  margin-left:auto !important;
  flex-wrap:nowrap !important;
}
.topbar-nav a,
body.app-index-mode .topbar nav a,
body.app-index-mode .topbar-nav a {
  color:#4b5563 !important;
  font-weight:600 !important;
  text-decoration:none !important;
  padding:20px 0 17px !important;
  border-bottom:3px solid transparent !important;
}
body.app-index-mode .topbar nav a:first-child { color:#4b5563 !important; border-bottom-color:transparent !important; }
.topbar-nav a.active,
body.app-index-mode .topbar nav a.active,
body.app-index-mode .topbar-nav a.active {
  color:#111827 !important;
  border-bottom-color:#111827 !important;
}
html[data-theme="dark"] .topbar,
html[data-theme="dark"] body.app-index-mode .topbar {
  background:#111827 !important;
  border-bottom-color:#263244 !important;
  box-shadow:0 2px 12px rgba(0,0,0,.25) !important;
}
html[data-theme="dark"] .topbar-brand strong,
html[data-theme="dark"] body.app-index-mode .topbar-brand strong,
html[data-theme="dark"] .topbar-nav a,
html[data-theme="dark"] body.app-index-mode .topbar-nav a,
html[data-theme="dark"] body.app-index-mode .topbar nav a { color:#d1d5db !important; }
html[data-theme="dark"] .topbar-nav a.active,
html[data-theme="dark"] body.app-index-mode .topbar-nav a.active,
html[data-theme="dark"] body.app-index-mode .topbar nav a.active { color:#f9fafb !important; border-bottom-color:#f9fafb !important; }
html[data-theme="dark"] .topbar-brand em,
html[data-theme="dark"] body.app-index-mode .topbar-brand em { color:#94a3b8 !important; }
@media (max-width:760px){
  .topbar,
  body.app-index-mode .topbar { height:auto !important; min-height:58px !important; padding:12px 18px !important; align-items:flex-start !important; flex-direction:column !important; }
  .topbar-nav,
  body.app-index-mode .topbar nav,
  body.app-index-mode .topbar-nav { height:auto !important; gap:18px !important; }
  body.app-index-mode main.container { padding-top:112px !important; }
  body.app-index-mode .app-sidebar { top:112px !important; }
}

/* Styled widget rename modal */
.bdm-modal{position:fixed;inset:0;z-index:9999;display:none;align-items:center;justify-content:center;padding:24px;}
.bdm-modal.open{display:flex;}
.bdm-modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.42);backdrop-filter:blur(3px);}
.bdm-modal-card{position:relative;width:min(460px,calc(100vw - 32px));background:#fff;border:1px solid #e5e7eb;border-radius:22px;box-shadow:0 24px 80px rgba(15,23,42,.22);padding:28px;}
.bdm-modal-card .eyebrow{margin:0 0 8px;color:#8b95a5;font-size:12px;text-transform:uppercase;letter-spacing:.08em;font-weight:800;}
.bdm-modal-card h2{margin:0 0 8px;font-size:26px;line-height:1.1;color:#071327;}
.bdm-modal-card .modal-help{margin:0 0 22px;color:#667085;font-size:14px;line-height:1.45;}
.bdm-modal-card label{display:block;margin:0 0 8px;font-weight:700;color:#111827;font-size:13px;}
.bdm-modal-card input[type="text"], .bdm-modal-card input[name="name"]{width:100%;height:48px;border:1px solid #d9e0ea;border-radius:12px;background:#f8fafc;padding:0 14px;font-size:16px;color:#101828;outline:none;}
.bdm-modal-card input:focus{border-color:#1877f2;background:#fff;box-shadow:0 0 0 4px rgba(24,119,242,.12);}
.bdm-modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px;}
.bdm-modal-close{position:absolute;top:14px;right:14px;width:34px;height:34px;border:0;border-radius:999px;background:#f3f5f8;color:#667085;font-size:24px;line-height:1;cursor:pointer;}
.bdm-modal-close:hover{background:#e8edf5;color:#111827;}
body.bdm-dark .bdm-modal-card{background:#161c27;border-color:#273244;box-shadow:0 24px 80px rgba(0,0,0,.55);}
body.bdm-dark .bdm-modal-card h2, body.bdm-dark .bdm-modal-card label{color:#f8fafc;}
body.bdm-dark .bdm-modal-card .modal-help{color:#aab4c2;}
body.bdm-dark .bdm-modal-card input[type="text"], body.bdm-dark .bdm-modal-card input[name="name"]{background:#0f1520;border-color:#2b3545;color:#f8fafc;}
body.bdm-dark .bdm-modal-close{background:#232d3b;color:#c6ceda;}
body.bdm-dark .bdm-modal-close:hover{background:#2d394b;color:#fff;}
