/* ============================================================
   CFFiddle Welcome Page — VS-Code-style shell
   ============================================================ */

:root {
  --cf-blue-primary: #0078d4;
  --cf-blue-deep:    #1d5fa3;
  --cf-blue-border:  #2f78c0;
  --cf-text-light:   #f2f6ff;
  --cf-red:          #dc4a38;
  --cf-red-hover:    #e85e4d;
}

/* Take over the full viewport when the welcome page is mounted */
body.cf-welcome-mounted {
  margin: 0;
  padding: 0;
  background: var(--vscode-bg-primary, #1e1e1e);
  color: var(--vscode-text-primary, #cccccc);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: normal;
  overflow: hidden;
}

body.cf-welcome-mounted .header-container,
body.cf-welcome-mounted .footer-component,
body.cf-welcome-mounted footer.footer {
  display: none !important;
}

.cf-welcome-shell {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: 33px 1fr 22px;
  background: var(--vscode-bg-primary, #1e1e1e);
  color: var(--vscode-text-primary, #cccccc);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  z-index: 100;
}

/* ─── window-bar (top header) ─────────────────────────────── */
.cf-window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 33px;
  padding: 0 12px;
  background: #323233;
  border-bottom: 1px solid #252526;
  color: var(--cf-text-light);
}

.cf-window-bar .window-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cf-window-bar .window-left img.cf-icon-mark {
  height: 33px;
  width: 33px;
  display: block;
  object-fit: contain;
}

.cf-window-bar .window-left .cf-brand-text {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.2px;
}

body.theme-light .cf-window-bar .window-left .cf-brand-text {
  color: #1f1f1f;
}

.cf-window-bar .window-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cf-header-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.cf-header-username {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

body.theme-light .cf-header-username {
  color: #1e1e1e;
}

.cf-header-auth-btn {
  min-width: 90px;
  height: 27px;
  padding: 0 16px;
  border: 0;
  border-radius: 4px;
  background: var(--cf-blue-primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
}

.cf-header-auth-btn:hover {
  background: #1f8be0;
}

.cf-header-auth-btn.cf-logout-btn {
  background: var(--cf-red);
}

.cf-header-auth-btn.cf-logout-btn:hover {
  background: var(--cf-red-hover);
}

/* ─── workspace (middle row) ──────────────────────────────── */
.cf-workspace {
  display: grid;
  grid-template-columns: 50px 260px 1fr;
  overflow: hidden;
  transition: grid-template-columns 220ms ease;
}

body.cf-projects-collapsed .cf-workspace {
  grid-template-columns: 50px 0 1fr;
}

/* ─── activity bar (left rail) ────────────────────────────── */
.cf-activity-bar {
  background: var(--vscode-bg-elevated, #333333);
  border-right: 1px solid var(--vscode-border-secondary, #1e1e1e);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  overflow: hidden;
}

.cf-activity-icon-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: #efefef;
  font-size: 18px;
  padding: 10px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cf-activity-icon-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

/* ─── sidebar (projects panel) ────────────────────────────── */
.cf-sidebar {
  background: var(--vscode-bg-secondary, #252526);
  color: var(--vscode-text-primary, #cccccc);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 220ms ease, opacity 220ms ease;
  width: 260px;
  opacity: 1;
}

body.cf-projects-collapsed .cf-sidebar {
  width: 0;
  opacity: 0;
  pointer-events: none;
}

.cf-sidebar-header {
  padding: 12px 14px;
  background: #2d2d2f;
  border-bottom: 1px solid #3a3a3a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cf-sidebar-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #cccccc;
}

.cf-sidebar-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.cf-sidebar-actions.cf-sidebar-actions-muted {
  font-size: 14px;
  color: #8f8f8f;
  letter-spacing: 1px;
  cursor: default;
  display: inline-block;
}

.cf-sidebar-actions .cf-icon-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #cccccc;
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cf-sidebar-actions .cf-icon-btn .codicon {
  font-size: 16px;
}

.cf-sidebar-actions .cf-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

body.theme-light .cf-sidebar-actions .cf-icon-btn {
  color: #5c5c5c;
}

body.theme-light .cf-sidebar-actions .cf-icon-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #1f1f1f;
}

/* logged-in sidebar block */
.cf-sidebar-block-loggedin {
  padding: 8px 0 12px !important;
  gap: 0 !important;
}

.cf-sidebar-empty {
  padding: 6px 14px;
  font-size: 12px;
  color: #8f8f8f;
  margin: 0;
}

.cf-sidebar-block-loggedin .cf-app-list {
  margin: 0 !important;
  padding: 0 4px !important;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cf-sidebar-block-loggedin .cf-app-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px !important;
  font-size: 13px;
  color: #cccccc;
  cursor: pointer;
  border-radius: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cf-sidebar-block-loggedin .cf-app-list li:hover {
  background: #2a2d2e;
}

.cf-app-list-icon {
  font-size: 16px !important;
  color: #858585;
  flex-shrink: 0;
}

.cf-sidebar-just-code {
  margin: 12px 14px 0;
  padding: 6px 10px;
  border: 1px dashed #3d3d3d;
  background: transparent;
  color: #cccccc;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: calc(100% - 28px);
  justify-content: center;
}

.cf-sidebar-just-code:hover {
  border-color: var(--cf-blue-primary);
  color: #ffffff;
}

.cf-sidebar-just-code .codicon {
  font-size: 14px;
}

body.theme-light .cf-sidebar-block-loggedin .cf-app-list li {
  color: #1f1f1f;
}

body.theme-light .cf-sidebar-block-loggedin .cf-app-list li:hover {
  background: #e8e8e8;
}

body.theme-light .cf-sidebar-just-code {
  color: #1f1f1f;
  border-color: #d0d0d0;
}

.cf-sidebar-block {
  padding: 14px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.cf-sidebar-block h2 {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #cccccc;
}

.cf-sidebar-block p {
  margin: 0 0 8px;
  font-size: 12px;
  color: #a7a7a7;
  line-height: 1.5;
}

.cf-sidebar-block .cf-app-list {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cf-sidebar-block .cf-app-list li {
  padding: 5px 8px;
  font-size: 13px;
  color: #cccccc;
  cursor: pointer;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cf-sidebar-block .cf-app-list li:hover {
  background: #2a2d2e;
}

.cf-primary-btn {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: var(--cf-blue-primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cf-primary-btn:hover {
  background: #1f8be0;
}

.cf-primary-btn.cf-btn-secondary {
  background: #3a3a3a;
  color: #f2f2f2;
}

.cf-primary-btn.cf-btn-secondary:hover {
  background: #4a4a4a;
}

/* ─── main area (welcome column) ──────────────────────────── */
.cf-main-area {
  background: var(--vscode-bg-primary, #1e1e1e);
  overflow: auto;
  display: flex;
  justify-content: center;
  padding: 40px 32px;
}

.cf-welcome-column {
  width: 100%;
  max-width: 912px;
}

.cf-welcome-column h1 {
  margin: 0 0 4px;
  font-size: 32px;
  font-weight: 400;
  color: #e2e2e2;
  letter-spacing: 0.2px;
}

.cf-hero {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin: 4px 0 32px;
  padding: 16px 20px;
  background: #00215c;
  border: 1px solid #00215c;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
}

.cf-hero-logo {
  height: 58px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

.cf-welcome-column .subtitle {
  margin: 0 0 28px;
  font-size: 22px;
  font-weight: 300;
  color: #9a9a9a;
  letter-spacing: 0.2px;
}

.cf-hero .subtitle {
  margin: 0;
  padding-bottom: 2px;
  font-size: 22px;
  color: #cfd8e6;
  line-height: 1;
}

body.theme-light .cf-hero {
  background: #00215c;
  border-color: #00215c;
}

body.theme-light .cf-hero .subtitle {
  color: #cfd8e6;
}

.cf-ai-highlight {
  font-size: 32px;
  font-weight: 700;
  color: var(--cf-blue-primary);
  background: linear-gradient(90deg, #4fa6ff 0%, #b16cff 50%, #ff6ad5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
  padding-right: 4px;
  vertical-align: -2px;
}

body.theme-light .cf-ai-highlight {
  background: linear-gradient(90deg, #1d5fa3 0%, #6c2bd9 50%, #c41a8a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cf-welcome-group {
  margin-bottom: 28px;
}

.cf-welcome-column h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: #d4d4d4;
}

.cf-welcome-column ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cf-welcome-column ul li {
  padding: 4px 0;
  font-size: 14px;
  color: var(--cf-blue-primary);
  cursor: pointer;
}

.cf-welcome-column ul li:hover {
  color: #1f8be0;
  text-decoration: underline;
}

.cf-walk-card {
  background: #252526;
  border: 1px solid #2c2c2c;
  border-radius: 6px;
  padding: 14px 16px;
  margin-top: 6px;
}

.cf-walk-card.cf-walk-card-featured {
  border-left: 4px solid var(--cf-blue-primary);
  padding-left: 12px;
}

.cf-walk-card .card-title {
  font-size: 14px;
  color: #d4d4d4;
  font-weight: 600;
  margin: 0;
}

.cf-walk-card p {
  margin: 4px 0 10px;
  font-size: 12px;
  color: #a7a7a7;
}

.cf-walk-card a {
  color: var(--cf-blue-primary);
  text-decoration: none;
  font-size: 13px;
}

.cf-walk-card a:hover {
  text-decoration: underline;
}

.cf-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
  flex-wrap: nowrap;
}

.cf-search-row input {
  flex: 1 1 auto;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #3d3d3d;
  border-radius: 4px;
  background: #1f1f1f;
  color: #cccccc;
  font-size: 13px;
  outline: none;
}

.cf-search-row input:focus {
  border-color: var(--cf-blue-primary);
}

.cf-search-row .cf-primary-btn,
.cf-search-row .cf-btn-sm {
  flex: 0 0 auto;
  width: auto !important;
  height: 32px;
  padding: 0 14px;
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

body.theme-light .cf-search-row input {
  background: #ffffff;
  border-color: #d0d0d0;
  color: #1f1f1f;
}

.cf-walk-card-divider {
  height: 1px;
  background: #2c2c2c;
  margin: 14px 0;
}

/* ─── template list (prominent cards) ─────────────────────── */
.cf-template-list {
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* Square (n×n) variant — applied when item count is a perfect square. Inline
   style supplies `grid-template-columns: repeat(N, minmax(0, 1fr))` so cells
   scale with container width. Horizontal padding keeps cells inset from the
   container edge. */
.cf-template-list.cf-template-list-square {
  width: 100%;
  box-sizing: border-box;
  padding-left: 24px;
  padding-right: 24px;
}

.cf-template-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #e2e2e2;
  background: linear-gradient(135deg, #2a2d2e 0%, #2f3236 100%);
  border: 1px solid #3a3a3a;
  border-left: 3px solid var(--cf-blue-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  line-height: 1.35;
}

.cf-template-list .cf-template-icon {
  margin-left: 8px;
  margin-right: 7px;
  font-size: 20px !important;
  color: var(--cf-blue-primary);
  flex-shrink: 0;
}

/* Per-module tile tints. Each category gets its own left-border accent +
   icon colour so the welcome page's template grid reads at a glance — same
   palette the in-IDE template picker uses, so the categorisation is consistent
   between the welcome page and the template browser. */
.cf-template-list li.cf-template-module-ai           { border-left-color: #8b5cf6; }
.cf-template-list li.cf-template-module-ai          .cf-template-icon { color: #8b5cf6; }
.cf-template-list li.cf-template-module-rag          { border-left-color: #0ea5b7; }
.cf-template-list li.cf-template-module-rag         .cf-template-icon { color: #0ea5b7; }
.cf-template-list li.cf-template-module-guardrails   { border-left-color: #d97706; }
.cf-template-list li.cf-template-module-guardrails  .cf-template-icon { color: #d97706; }
.cf-template-list li.cf-template-module-vectorstore  { border-left-color: #4f46e5; }
.cf-template-list li.cf-template-module-vectorstore .cf-template-icon { color: #4f46e5; }
.cf-template-list li.cf-template-module-core         { border-left-color: #6b7280; }
.cf-template-list li.cf-template-module-core        .cf-template-icon { color: #6b7280; }

.cf-template-list .cf-template-label {
  flex: 1;
}

.cf-template-list li:hover {
  background: linear-gradient(135deg, #303335 0%, #383b40 100%);
  border-color: var(--cf-blue-primary);
  border-left-color: #4fa6ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.18);
  color: #ffffff;
}

body.theme-light .cf-template-list li {
  background: #ffffff;
  border-color: #d0d0d0;
  border-left-color: var(--cf-blue-primary);
  color: #1f1f1f;
}

body.theme-light .cf-template-list li:hover {
  background: #f3f7fc;
  border-color: var(--cf-blue-primary);
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.12);
}

/* ─── resource cards (Documentation & Resources) ──────────── */
.cf-resource-card {
  background: #252526;
  border: 1px solid #2c2c2c;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 12px;
}

.cf-resource-card-header {
  margin-bottom: 12px;
}

.cf-resource-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #e2e2e2;
  margin: 0 0 4px;
}

.cf-resource-card-sub {
  font-size: 12px;
  color: #a7a7a7;
  margin: 0;
}

.cf-link-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.cf-link-chip {
  padding: 8px 16px;
  background: #2f3338;
  border: 1px solid #4a4f55;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #4fa6ff;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.cf-link-chip:hover {
  background: #303335;
  border-color: var(--cf-blue-primary);
  color: #4fa6ff;
  text-decoration: none;
}

.cf-resource-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 4px;
  background: var(--cf-blue-primary);
  color: #ffffff !important;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
  letter-spacing: 0.2px;
}

.cf-resource-cta:hover {
  background: #1f8be0;
}

.cf-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.cf-tag-button {
  padding: 3px 9px;
  background: transparent;
  border: 1px solid #3a3a3a;
  border-radius: 3px;
  color: #cccccc;
  font-size: 12px;
  font-family: 'Menlo', 'Consolas', monospace;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cf-tag-button:hover {
  background: #2a2d2e;
  color: var(--cf-blue-primary);
  border-color: var(--cf-blue-primary);
}

.cf-community-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.cf-community-card {
  display: block;
  padding: 12px 14px;
  background: #2a2d2e;
  border: 1px solid #3a3a3a;
  border-radius: 5px;
  text-decoration: none !important;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cf-community-card:hover {
  background: #303335;
  border-color: var(--cf-blue-primary);
}

.cf-community-card-title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #cccccc;
}

.cf-community-card:hover .cf-community-card-title {
  color: #ffffff;
}

/* ─── light theme overrides for new resource section ──────── */
body.theme-light .cf-template-list li {
  background: #f3f3f3;
  border-color: #d0d0d0;
  color: var(--cf-blue-primary);
}

body.theme-light .cf-template-list li:hover {
  background: #e8e8e8;
  border-color: var(--cf-blue-primary);
}

body.theme-light .cf-resource-card {
  background: #f8f8f8;
  border-color: #e2e2e2;
}

body.theme-light .cf-resource-card-title {
  color: #1f1f1f;
}

body.theme-light .cf-resource-card-sub {
  color: #5c5c5c;
}

body.theme-light .cf-link-chip {
  background: #ffffff;
  border-color: #d0d0d0;
}

body.theme-light .cf-link-chip:hover {
  background: #ececec;
}

body.theme-light .cf-tag-button {
  border-color: #d0d0d0;
  color: #1f1f1f;
}

body.theme-light .cf-tag-button:hover {
  background: #ececec;
}

body.theme-light .cf-community-card {
  background: #ffffff;
  border-color: #d0d0d0;
}

body.theme-light .cf-community-card:hover {
  background: #ececec;
}

body.theme-light .cf-community-card-title {
  color: #1f1f1f;
}

/* ─── status bar (footer) ─────────────────────────────────── */
.cf-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 22px;
  padding: 0 12px;
  background: var(--cf-blue-primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
}

/* ─── light theme overrides ───────────────────────────────── */
body.theme-light.cf-welcome-mounted {
  background: #ffffff;
  color: #252526;
}

body.theme-light .cf-welcome-shell {
  background: #ffffff;
  color: #252526;
}

body.theme-light .cf-window-bar {
  background: #f3f3f3;
  border-bottom: 1px solid #d0d0d0;
  color: #1f1f1f;
}

body.theme-light .cf-activity-bar {
  background: #2c2c2c;
}

body.theme-light .cf-sidebar {
  background: #f3f3f3;
  color: #252526;
}

body.theme-light .cf-sidebar-header {
  background: #ececec;
  border-bottom: 1px solid #d0d0d0;
}

body.theme-light .cf-sidebar-title {
  color: #252526;
}

body.theme-light .cf-sidebar-block h2 {
  color: #252526;
}

body.theme-light .cf-sidebar-block p {
  color: #5c5c5c;
}

body.theme-light .cf-sidebar-block .cf-app-list li {
  color: #252526;
}

body.theme-light .cf-sidebar-block .cf-app-list li:hover {
  background: #e8e8e8;
}

body.theme-light .cf-main-area {
  background: #ffffff;
}

body.theme-light .cf-welcome-column h1 {
  color: #1f1f1f;
}

body.theme-light .cf-welcome-column .subtitle {
  color: #5c5c5c;
}

body.theme-light .cf-welcome-column h3 {
  color: #1f1f1f;
}

body.theme-light .cf-walk-card {
  background: #f8f8f8;
  border-color: #e2e2e2;
}

body.theme-light .cf-walk-card .card-title {
  color: #1f1f1f;
}

body.theme-light .cf-walk-card p {
  color: #5c5c5c;
}

body.theme-light .cf-walk-card .cf-search-row input {
  background: #ffffff;
  color: #252526;
  border-color: #d0d0d0;
}

body.theme-light .cf-walk-card-divider {
  background: #e2e2e2;
}

/* ─── login modal restyle (overrides existing .buttons-background) ─── */
.buttons-background {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.6) !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 1001 !important;
}

.buttons-background .buttons {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  margin: 0 !important;
  width: min(420px, calc(100vw - 40px));
  max-height: calc(100vh - 80px);
  overflow: hidden;
  background: #252526;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  padding: 0 !important;
  display: flex !important;
  flex-direction: column;
  gap: 0 !important;
}

/* modal header */
.buttons-background .login-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #3a3a3a;
  background: #2a2a2c;
}

.buttons-background .login-modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #f2f2f2;
  letter-spacing: 0.2px;
}

.buttons-background .login-modal-close {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: #b0b0b0;
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.buttons-background .login-modal-close:hover {
  background: #3a3a3a;
  color: #ffffff;
}

/* modal body */
.buttons-background .login-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.buttons-background .connect-buttons {
  margin: 0 !important;
  width: 100% !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.buttons-background .connect-button {
  width: 100% !important;
  border: 1px solid #3d3d3d !important;
  border-radius: 5px !important;
  background: #1f1f1f !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #cccccc !important;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.buttons-background .connect-button.fb,
.buttons-background .connect-button.gp,
.buttons-background .connect-button.gh {
  background: #1f1f1f !important;
}

.buttons-background .connect-button form {
  display: flex !important;
  align-items: center;
  padding: 10px 12px;
  margin: 0;
}

.buttons-background .connect-button .login-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 10px;
  background: transparent !important;
}

.buttons-background .connect-button .login-tab svg {
  display: block;
}

.buttons-background .connect-button .connect-link {
  color: #cccccc !important;
  font-size: 13px;
  text-decoration: none;
  flex: 1;
  font-weight: 500;
}

.buttons-background .connect-button:hover {
  border-color: var(--cf-blue-primary) !important;
  background: #232325 !important;
}

.buttons-background .connect-button:hover .connect-link {
  color: #ffffff !important;
}

/* divider */
.buttons-background .login-modal-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8f8f8f;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 4px 0;
}

.buttons-background .login-modal-divider::before,
.buttons-background .login-modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #3a3a3a;
}

/* dev login fallback */
.buttons-background .login-dev-btn {
  width: 100%;
  height: 32px;
  background: transparent;
  border: 1px dashed #3d3d3d;
  border-radius: 5px;
  color: #8f8f8f;
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 0.2px;
}

.buttons-background .login-dev-btn:hover {
  border-color: #5d5d5d;
  color: #cccccc;
}

body.theme-light .buttons-background .login-modal-header {
  background: #f3f3f3;
  border-bottom-color: #d0d0d0;
}

body.theme-light .buttons-background .login-modal-title {
  color: #1f1f1f;
}

body.theme-light .buttons-background .login-modal-close {
  color: #5c5c5c;
}

body.theme-light .buttons-background .login-modal-close:hover {
  background: #e2e2e2;
  color: #1f1f1f;
}

body.theme-light .buttons-background .connect-button {
  background: #ffffff !important;
  border-color: #d0d0d0 !important;
}

body.theme-light .buttons-background .connect-button .connect-link {
  color: #1f1f1f !important;
}

body.theme-light .buttons-background .login-modal-divider {
  color: #5c5c5c;
}

body.theme-light .buttons-background .login-modal-divider::before,
body.theme-light .buttons-background .login-modal-divider::after {
  background: #d0d0d0;
}

.buttons-background .connect-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.buttons-background .connect-button {
  background: #1f1f1f !important;
  border: 1px solid #3d3d3d;
  border-radius: 5px;
  padding: 0;
  margin: 0;
}

.buttons-background .connect-button form {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  margin: 0;
}

.buttons-background .connect-button .login-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 10px;
}

.buttons-background .connect-button .login-tab img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.buttons-background .connect-button .connect-link {
  color: #cccccc;
  font-size: 13px;
  text-decoration: none;
  flex: 1;
}

.buttons-background .connect-button:hover {
  border-color: var(--cf-blue-primary);
}

.buttons-background .connect-button:hover .connect-link {
  color: #ffffff;
}

body.theme-light .buttons-background .buttons {
  background: #ffffff;
  border-color: #d0d0d0;
  color: #252526;
}

body.theme-light .buttons-background .connect-button {
  background: #f3f3f3 !important;
  border-color: #d0d0d0;
}

body.theme-light .buttons-background .connect-button .connect-link {
  color: #252526;
}

/* ============================================================
   Split layout (2-column welcome)
   ============================================================ */
.cf-welcome-split {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.cf-welcome-split-left {
  flex: 1;
  padding: 36px 40px;
  overflow-y: auto;
  border-right: 1px solid #2d2d2d;
}

.cf-welcome-split-right {
  width: 360px;
  flex-shrink: 0;
  padding: 28px 24px;
  overflow-y: auto;
  background: #252526;
}

.cf-split-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #858585;
  margin: 24px 0 12px;
}

/* In split mode the sidebar + activity bar remain visible. Only the
   main-area content switches between single-column and 2-col split. */

/* Layout toggle button in the window-bar. */
.cf-layout-toggle {
  background: transparent;
  border: none;
  color: #858585;
  font-size: 16px;
  cursor: pointer;
  margin-left: 12px;
  padding: 2px 4px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
}
.cf-layout-toggle:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* Docs section (shared between layouts — inside split-right or inside classic main-area) */
.cf-docs-section .cf-resource-card {
  margin-bottom: 16px;
}

/* Light theme */
body.theme-light .cf-welcome-split-left { border-right-color: #e4e4e4; }
body.theme-light .cf-welcome-split-right { background: #f3f3f3; }
body.theme-light .cf-split-section-title { color: #616161; }
body.theme-light .cf-layout-toggle { color: #616161; }
body.theme-light .cf-layout-toggle:hover { color: #111; background: rgba(0,0,0,0.06); }
