/* CastleHosting design system. Loaded after app.css; application contracts stay intact. */
@font-face {
  font-family: Montserrat;
  src: url("/assets/fonts/montserrat-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root,
html[data-theme="light"] {
  color-scheme: light;
  --castle-green: #50f1c2;
  --castle-green-2: #60d9ff;
  --castle-green-dark: #087761;
  --castle-dark: #081c28;
  --castle-dark-2: #102d3d;
  --castle-sidebar: #081c28;
  --castle-bg: #f2f6f9;
  --castle-card: #ffffff;
  --castle-surface: #ffffff;
  --castle-surface-2: #f6f9fb;
  --castle-surface-3: #edf3f6;
  --castle-input: #ffffff;
  --castle-text: #163342;
  --castle-muted: #536c7c;
  --castle-line: #dce6ed;
  --castle-soft: #eaf9f3;
  --castle-hover: #edf9f5;
  --castle-danger: #ad293b;
  --castle-warn: #855516;
  --castle-ok: #087761;
  --cp-success-bg: #e9f8f1;
  --cp-warning-bg: #fff7e8;
  --cp-danger-bg: #fff0f2;
  --cp-info-bg: #edf5ff;
  --cp-info-text: #245f9d;
  --cp-focus: #087b9d;
  --cp-sidebar-width: 248px;
  --cp-content-gap: clamp(18px, 2.15vw, 36px);
  --cp-radius-sm: 8px;
  --radius: 12px;
  --shadow: 0 4px 18px rgba(16, 47, 66, .035);
  --line: var(--castle-line);
  --ink: var(--castle-text);
  --muted: var(--castle-muted);
  font-family: Montserrat, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --castle-green-dark: #72e7c5;
  --castle-bg: #0b1721;
  --castle-card: #12232f;
  --castle-surface: #12232f;
  --castle-surface-2: #172c39;
  --castle-surface-3: #1e3543;
  --castle-input: #10212d;
  --castle-text: #edf5fa;
  --castle-muted: #aec2cf;
  --castle-line: #2d4351;
  --castle-soft: #153b34;
  --castle-hover: #1b3b3c;
  --castle-danger: #ffa7b0;
  --castle-warn: #f2c581;
  --castle-ok: #72e7c5;
  --cp-success-bg: #153b34;
  --cp-warning-bg: #392e20;
  --cp-danger-bg: #3b222d;
  --cp-info-bg: #172f4a;
  --cp-info-text: #a5ceff;
  --cp-focus: #60d9ff;
  --shadow: 0 4px 18px rgba(0, 0, 0, .1);
}

html { scroll-padding-top: 100px; }
body.cp-redesign {
  margin: 0;
  background: var(--castle-bg);
  color: var(--castle-text);
  font-family: Montserrat, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.cp-redesign *, body.cp-redesign *::before, body.cp-redesign *::after { box-sizing: border-box; }
body.cp-redesign [hidden] { display: none !important; }
body.cp-redesign :is(button, input, select, textarea) { font-family: inherit; }
body.cp-redesign :is(h1, h2, h3, h4) { color: var(--castle-text); font-weight: 650; letter-spacing: -.025em; }
body.cp-redesign h1 { font-size: clamp(25px, 2.1vw, 32px); line-height: 1.2; margin-bottom: 8px; }
body.cp-redesign h2 { font-size: 18px; line-height: 1.4; }
body.cp-redesign h3 { font-size: 16px; line-height: 1.4; }
body.cp-redesign p { line-height: 1.65; }
body.cp-redesign small { font-size: 12px; line-height: 1.5; }
body.cp-redesign strong, body.cp-redesign b { font-weight: 650; }
body.cp-redesign :is(.muted, .scope-note) { color: var(--castle-muted); font-size: 13px; font-weight: 400; }
body.cp-redesign .eyebrow { color: var(--castle-green-dark); font-size: 11px; font-weight: 650; letter-spacing: .1em; }
body.cp-redesign a, body.cp-redesign button { -webkit-tap-highlight-color: transparent; }
body.cp-redesign :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--cp-focus);
  outline-offset: 3px;
}
body.cp-redesign :is(a, button, summary) { touch-action: manipulation; }
body.cp-redesign :is(button, [role="button"]):disabled { cursor: not-allowed; opacity: .55; }
body.cp-redesign :is(.cp-icon, .cp-icon svg) { flex-shrink: 0; }
body.cp-redesign .cp-icon svg { stroke-width: 1.8; }
body.cp-redesign img { max-width: 100%; }
body.cp-redesign :is(pre, code) { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; }
body.cp-redesign code { background: var(--castle-surface-3); color: var(--castle-text); border-radius: 5px; overflow-wrap: anywhere; }
body.cp-redesign ::selection { background: #50f1c250; color: var(--castle-text); }
body.cp-redesign .cp-skip-link { position: fixed; z-index: 200; left: 16px; top: 12px; transform: translateY(-180%); padding: 12px 18px; border-radius: 8px; background: var(--castle-card); color: var(--castle-text); box-shadow: var(--shadow); }
body.cp-redesign .cp-skip-link:focus { transform: translateY(0); }

/* Desktop workspace */
body.cp-redesign .app-shell { grid-template-columns: var(--cp-sidebar-width) minmax(0, 1fr); min-height: 100dvh; overflow: visible; background: var(--castle-bg); }
body.cp-redesign .sidebar { position: sticky; top: 0; align-self: start; height: 100dvh; min-height: 0; padding: 24px 14px 16px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: #081c28; border-right: 1px solid #243b48; color: #c2d5df; scrollbar-width: thin; scrollbar-color: #345363 transparent; }
body.cp-redesign .sidebar-brand { height: 48px; margin: 0 8px 22px; gap: 10px; justify-content: flex-start; }
body.cp-redesign .sidebar-logo-word { color: #eff8ff; font-size: 18px; font-weight: 650; letter-spacing: -.6px; }
body.cp-redesign .sidebar-logo-word b { color: #50f1c2; font-weight: 650; }
body.cp-redesign .sidebar-logo-crop { width: 38px; height: 38px; flex-basis: 38px; border-radius: 8px; background: transparent; }
body.cp-redesign .sidebar-logo-crop img { width: 110px !important; left: -37px; top: -6px; }
body.cp-redesign .sidebar-workspace { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0 5px 18px; padding: 12px 10px; border: 1px solid #29414e; border-radius: 9px; }
body.cp-redesign .sidebar-workspace > .cp-icon { color: #8bb7c8; font-size: 20px; }
body.cp-redesign .sidebar-workspace > div { min-width: 0; }
body.cp-redesign .sidebar-workspace strong, body.cp-redesign .sidebar-workspace small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.cp-redesign .sidebar-workspace strong { color: #edf7fd; font-size: 12px; font-weight: 550; }
body.cp-redesign .sidebar-workspace small { color: #a6bfcc; font-size: 11px; }
body.cp-redesign .sidebar-nav { display: block; padding: 0; overflow: visible; }
body.cp-redesign .sidebar-title { display: block; margin: 24px 12px 8px; color: #88a8ba; font-size: 10px; font-weight: 600; letter-spacing: .11em; }
body.cp-redesign :is(.sidebar-nav a, .nav-disabled, .sidebar-menu-group > summary) { display: flex; min-height: 44px; height: auto; gap: 10px; padding: 10px 12px; margin-bottom: 3px; border-radius: 8px; color: #c0d2dd; font-size: 12px; line-height: 1.4; font-weight: 500; }
body.cp-redesign .sidebar-nav a:hover, body.cp-redesign .sidebar-menu-group > summary:hover { color: #ffffff; background: #112e3d; }
body.cp-redesign .sidebar-nav a.active { background: #143c40; border-right: 0; color: #8af4d6; box-shadow: inset 3px 0 #50f1c2; }
body.cp-redesign .nav-icon { width: 22px; min-width: 22px; height: 24px; background: transparent; color: #8ab3c4; border-radius: 0; }
body.cp-redesign .nav-icon svg { font-size: 18px; }
body.cp-redesign .sidebar-nav a:hover .nav-icon, body.cp-redesign .sidebar-nav a.active .nav-icon { background: transparent; color: #72edcb; transform: none; }
body.cp-redesign .sidebar-menu-group { display: block; margin: 4px 0; }
body.cp-redesign .sidebar-menu-group > summary { cursor: pointer; }
body.cp-redesign .sidebar-menu-group[open] > summary { background: #112e3d; }
body.cp-redesign .sidebar-submenu { display: grid; gap: 2px; margin: 4px 0 8px 22px; padding: 0 0 0 10px; border-left: 1px solid #294350; }
body.cp-redesign .sidebar-submenu a { min-height: 38px; padding: 8px; font-size: 11px; }
body.cp-redesign .sidebar-safe { display: block; margin-top: 24px; padding: 13px; background: #102e36; border: 1px solid #28564d; border-radius: 9px; font-size: 12px; }
body.cp-redesign .sidebar-safe strong { color: #e1f6ee; }
body.cp-redesign .sidebar-safe small { margin-top: 5px; color: #a6bfcc; font-size: 11px; }
body.cp-redesign .sidebar-profile { display: flex; flex-direction: column; align-items: stretch; gap: 9px; margin: 22px 5px 0; padding: 16px 2px 8px; border-top: 1px solid #29414e; color: #ebf6fc; }
body.cp-redesign .sidebar-profile .profile-pill { max-width: 100%; }
body.cp-redesign .sidebar-profile .profile-pill b { background: #254a51; color: #b6f5df; }
body.cp-redesign .sidebar-profile .profile-pill span { color: #edf6fb; }
body.cp-redesign .sidebar-profile .profile-pill small { color: #a6bfcc; }
body.cp-redesign .sidebar-profile > b { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: #254a51; color: #b6f5df; font-size: 12px; }
body.cp-redesign .sidebar-profile > div { min-width: 0; }
body.cp-redesign .sidebar-profile strong, body.cp-redesign .sidebar-profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.cp-redesign .sidebar-profile strong { font-size: 12px; }
body.cp-redesign .sidebar-profile small { color: #a6bfcc; font-size: 11px; }
body.cp-redesign .sidebar-footer-links { display: flex; flex-wrap: wrap; gap: 7px 13px; padding: 10px 7px 0; color: #a6bfcc; font-size: 11px; }
body.cp-redesign .sidebar-footer-links a:hover { color: #8af4d6; }
body.cp-redesign .main-shell { min-width: 0; width: 100%; }
body.cp-redesign .topbar { display: flex; height: 76px; min-height: 76px; gap: 18px; padding: 0 var(--cp-content-gap); background: var(--castle-card); color: var(--castle-text); border-bottom: 1px solid var(--castle-line); z-index: 40; }
body.cp-redesign .topbar-title { flex: 0 1 auto; max-width: 210px; }
body.cp-redesign .topbar-title strong { color: var(--castle-text); font-size: 14px; font-weight: 600; }
body.cp-redesign .topbar-title small { color: var(--castle-muted); font-size: 11px; }
body.cp-redesign .topbar-search { position: relative; flex: 1 1 280px; max-width: 560px; height: 42px; margin-right: auto; gap: 9px; padding: 0 12px; background: var(--castle-surface-2); border: 1px solid var(--castle-line); border-radius: 9px; }
body.cp-redesign .topbar-search input { height: 100%; color: var(--castle-text); font-size: 12px; background: transparent; padding: 0; }
body.cp-redesign .topbar-search input::placeholder { color: var(--castle-muted); }
body.cp-redesign .topbar-search > span:not(.search-icon) { color: var(--castle-muted); background: var(--castle-surface-3); font-size: 10px; }
body.cp-redesign .topbar-search .search-icon { background: none; padding: 0; color: var(--castle-muted); font-size: 17px; }
body.cp-redesign .topbar-actions { flex: 0 0 auto; gap: 10px; overflow: visible; }
body.cp-redesign :is(.icon-button, [data-sidebar-toggle]) { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 40px; padding: 0; border: 1px solid var(--castle-line); border-radius: 9px; background: var(--castle-card); color: var(--castle-muted); cursor: pointer; }
body.cp-redesign .icon-button:hover, body.cp-redesign [data-sidebar-toggle]:hover { color: var(--castle-green-dark); background: var(--castle-hover); border-color: var(--castle-line); }
body.cp-redesign .top-icon { color: inherit; }
body.cp-redesign .top-icon svg { font-size: 18px; }
body.cp-redesign .notification-count { font-variant-numeric: tabular-nums; }
body.cp-redesign .profile-pill { height: 40px; max-width: 190px; gap: 9px; }
body.cp-redesign .profile-pill b { width: 34px; height: 34px; flex-shrink: 0; background: var(--castle-soft); color: var(--castle-green-dark); font-size: 12px; font-weight: 600; }
body.cp-redesign .profile-pill span { color: var(--castle-text); font-size: 12px; font-weight: 600; }
body.cp-redesign .profile-pill small { color: var(--castle-muted); font-size: 10px; font-weight: 400; }
body.cp-redesign .logout-link { color: var(--castle-muted); font-size: 12px; font-weight: 500; }
body.cp-redesign .workspace { width: 100%; min-width: 0; padding: 28px var(--cp-content-gap) 36px; overflow: visible; }
body.cp-redesign .workspace > * { max-width: 100%; }
body.cp-redesign .workspace :where(strong, b) { font-weight: 650; }
body.cp-redesign .workspace :where(p) { font-size: 13px; }
body.cp-redesign .workspace :where(small) { font-size: 12px; }
body.cp-redesign .cp-page-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 18px; color: var(--castle-muted); font-size: 11px; }
body.cp-redesign .cp-page-breadcrumb a:hover { color: var(--castle-green-dark); text-decoration: underline; }
body.cp-redesign .cp-page-breadcrumb .cp-icon { font-size: 13px; }
body.cp-redesign .main-shell > footer { padding: 20px var(--cp-content-gap); margin-top: auto; border-top: 1px solid var(--castle-line); color: var(--castle-muted); font-size: 11px; }
body.cp-redesign footer span { color: var(--castle-green-dark); font-weight: 600; }
body.cp-redesign :is(.mobile-menu-toggle, .sidebar-close, .sidebar-overlay, .mobile-nav, .mobile-agent-slot, .server-settings-mobile-nav) { display: none; }

/* Global search only lists destinations allowed by the current account. */
body.cp-redesign .global-search-results { position: absolute; z-index: 75; top: calc(100% + 9px); left: 0; right: 0; max-height: min(470px, 65dvh); overflow-y: auto; padding: 6px; border: 1px solid var(--castle-line); border-radius: 12px; background: var(--castle-card); box-shadow: 0 16px 40px #081c2824; }
body.cp-redesign .global-search-results a { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px; border-radius: 7px; color: var(--castle-text); font-size: 13px; }
body.cp-redesign .global-search-results a:hover, body.cp-redesign .global-search-results a:focus { background: var(--castle-soft); color: var(--castle-green-dark); }
body.cp-redesign .global-search-results .cp-icon { color: var(--castle-green-dark); font-size: 18px; }
body.cp-redesign .global-search-results p { padding: 10px; margin: 0; font-size: 12px; }
body.cp-redesign .global-search-results a { flex-direction: column; align-items: flex-start; gap: 2px; }
body.cp-redesign .global-search-results a strong { font-size: 13px; font-weight: 600; }
body.cp-redesign .global-search-results a small { color: var(--castle-muted); font-size: 11px; }
body.cp-redesign .global-search-heading { color: var(--castle-muted); font-size: 10px !important; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
body.cp-redesign .global-search-empty { color: var(--castle-muted); }

/* Consistent surfaces across hosting, support, operations and account modules. */
body.cp-redesign :is(.login-panel, .login-aside, .card, .stat-card, .metric, .monitor-card, .monitor-alert-card, .agent-op-card, .ai-site-project, .hardware-chart-card, .settings-module-group) {
  min-width: 0; background: var(--castle-card); border: 1px solid var(--castle-line); border-radius: var(--radius); box-shadow: var(--shadow);
}
html body.cp-redesign .workspace .card { background: var(--castle-card); border-color: var(--castle-line); box-shadow: var(--shadow); }
body.cp-redesign .card { padding: 22px; }
body.cp-redesign :is(.card-head, .section-head, .dashboard-head, .page-header) { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
body.cp-redesign .card-head { margin-bottom: 18px; }
body.cp-redesign :is(.card-head, .section-head) p { font-size: 13px; margin-top: 5px; }
body.cp-redesign .dashboard-head { margin-bottom: 24px; }
body.cp-redesign :is(.dashboard-head, .page-header) p { margin-top: 0; font-size: 13px; }
body.cp-redesign :is(.page-actions, .action-row, .row-actions, .domain-row-actions) { gap: 8px; }
body.cp-redesign :is(.dashboard-main, .dashboard-side, .domain-main, .domain-side) { min-width: 0; }
body.cp-redesign .stat-grid { gap: 14px; }
body.cp-redesign .stat-card { padding: 19px; gap: 12px; min-height: 118px; }
body.cp-redesign .stat-card small { color: var(--castle-muted); font-size: 12px; font-weight: 500; }
body.cp-redesign .stat-card strong { color: var(--castle-text); font-size: 29px; font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
body.cp-redesign .stat-card p { font-size: 12px; }
body.cp-redesign .stat-icon { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 10px; background: var(--castle-soft); color: var(--castle-green-dark); box-shadow: none; }
body.cp-redesign .stat-icon svg { font-size: 21px; }
body.cp-redesign .metric { padding: 18px; }
body.cp-redesign .metric span { color: var(--castle-muted); font-size: 11px; font-weight: 600; letter-spacing: .035em; }
body.cp-redesign .metric strong { color: var(--castle-text); font-size: 26px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
body.cp-redesign .metric small { font-size: 12px; }
body.cp-redesign :is(.system-pill, .quick-actions > a, .quick-actions > span, .shortcut-list > a, .shortcut-list > span, .activity-list > div, .service-list > div, .audit-list > div, .mini-table > div, .domain-mini-card, .site-row-card, .ssl-site-card, .production-check-item, .settings-category-grid > a, .settings-module-grid > a, .security-site-list > article, .reseller-portfolio-list > article) { min-width: 0; background: var(--castle-card); border-color: var(--castle-line); color: var(--castle-text); border-radius: 9px; }
body.cp-redesign :is(.quick-actions > a, .tool-tile, .site-link-grid > a, .settings-category-grid > a, .settings-module-grid > a, .production-check-item) { transition: background .15s, border-color .15s; }
body.cp-redesign :is(.quick-actions > a:hover, .tool-tile:hover, .site-link-grid > a:hover, .settings-category-grid > a:hover, .settings-module-grid > a:hover, .production-check-item:hover) { background: var(--castle-hover); border-color: color-mix(in srgb, var(--castle-green-dark) 40%, var(--castle-line)); transform: none; }
body.cp-redesign :is(.quick-icon, .tool-icon, .domain-module-icon, .shortcut-icon, .activity-icon) { background: var(--castle-soft); color: var(--castle-green-dark); box-shadow: none; border-radius: 9px; }
body.cp-redesign :is(.quick-actions strong, .tool-tile strong, .domain-module-item strong) { font-size: 13px; font-weight: 600; }
body.cp-redesign :is(.quick-actions small, .tool-tile small, .domain-module-item small, .site-link-grid small) { font-size: 12px; line-height: 1.5; }
body.cp-redesign :is(.domain-module-item, .customer-site-list a) { color: var(--castle-text); }
body.cp-redesign :is(.credential-grid > div, .basic-grid > div, .module-grid span, .server-service-grid > div, .monitor-grid > div, .agent-op-meta span, .agent-log-line, .integration-steps > div, .gdrive-test-output, .manual-token-box, .mini-check, .site-row-meta span, .domain-mini-meta span, .domain-root, .tool-tile, .php-current-grid > div, .site-page-item, .connection-grid > div, .side-summary-list > div, .sftp-scope-option, .node-app-facts > span, .domain-extra > div, .ssl-cert-panel > div, .mail-server-summary > div, .database-server-summary > div, .settings-toggle-grid > label, .detected-ip-grid > div, .hardware-summary-grid article, .hardware-detail-grid > div, .hardware-threshold-grid > article, .hardware-email-settings, .hardware-capacity-strip > div, .site-storage-breakdown > div, .git-repository-facts > div, .api-security-flow article, .api-scope-groups section, .api-client-facts) { background: var(--castle-surface-2); color: var(--castle-text); border-color: var(--castle-line); border-radius: 9px; }
body.cp-redesign :is(.backup-config-panel, .site-context-strip, .site-pages-toolbar, .production-ready-message, .sftp-limit-note, .sftp-folder-selected, .ssl-dns-panel, .settings-modules-intro, .security-health-strip, .reseller-create-note, .customer-account-grid > div, .customer-usage-pills span) { background: var(--castle-soft); color: var(--castle-text); border-color: color-mix(in srgb, var(--castle-green-dark) 24%, var(--castle-line)); }
body.cp-redesign :is(.dashboard-usage-strip, .dashboard-compute-strip, .friendly-list > div, .next-step-list > a, .site-context-nav, .database-meta > span, .technical-details, .mail-technical-details, .usage-meter, .usage-breakdown > div, .usage-resource-grid > div, .usage-domain-details, .service-compute-overview article, .service-compute-title, .service-compute-metrics article, .service-storage-components article, .storage-domain-list, .storage-total-meter, .security-empty, .account-access-row, .account-access-summary, .account-activity-details, .node-env-list > div, .mail-rate-review-card) { background: var(--castle-surface-2); border-color: var(--castle-line); color: var(--castle-text); border-radius: 9px; }
body.cp-redesign :is(.site-context-nav a:hover, .site-context-nav a.active, .file-view-tabs a.active) { background: var(--castle-soft); color: var(--castle-green-dark); }
body.cp-redesign :is(.two-factor-recovery-card, .mail-rate-consent, .ssl-attention-strip, .site-storage-warning, .settings-impact.warn) { background: var(--cp-warning-bg); border-color: color-mix(in srgb, var(--castle-warn) 30%, var(--castle-line)); color: var(--castle-warn); }
body.cp-redesign :is(.two-factor-enabled-summary, .mail-rate-policy, .mail-preview, .settings-impact) { background: var(--cp-success-bg); border-color: color-mix(in srgb, var(--castle-ok) 25%, var(--castle-line)); color: var(--castle-text); }
body.cp-redesign .recovery-codes code { background: var(--castle-card); color: var(--castle-text); border-color: var(--castle-line); }
body.cp-redesign :is(.credential-grid span, .basic-grid span, .connection-grid span, .side-summary-list span, .customer-account-grid span, .agent-op-meta b, .monitor-grid span) { font-size: 11px; font-weight: 600; }
body.cp-redesign :is(.customer-account-grid small, .customer-site-list small, .customer-usage-pills span) { font-size: 12px; }

/* Forms and actions */
body.cp-redesign :is(.form, .form-grid, .migration-source-form, .ai-site-settings-admin, .notification-filters) label { color: var(--castle-text); font-size: 13px; line-height: 1.5; font-weight: 550; }
body.cp-redesign :is(.workspace, .login-shell, .cp-modal, .modal-overlay) :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.modal-code-editor) { min-width: 0; max-width: 100%; border: 1px solid var(--castle-line); border-radius: 8px; background: var(--castle-input); color: var(--castle-text); font: inherit; font-size: 13px; box-shadow: none; }
body.cp-redesign :is(.workspace, .login-shell, .cp-modal, .modal-overlay) :is(input, select):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { min-height: 42px; padding: 9px 11px; }
body.cp-redesign :is(.workspace, .login-shell, .cp-modal, .modal-overlay) textarea:not(.modal-code-editor) { padding: 11px 12px; line-height: 1.6; }
body.cp-redesign :is(input, textarea)::placeholder { color: var(--castle-muted); opacity: .85; }
body.cp-redesign :is(input, select, textarea):focus-visible { border-color: var(--cp-focus); outline-offset: 1px; }
body.cp-redesign :is(input[type="checkbox"], input[type="radio"]) { accent-color: #087761; width: 17px; height: 17px; flex: 0 0 auto; }
body.cp-redesign input[type="file"] { height: auto; min-height: 42px; white-space: normal; }
body.cp-redesign input::file-selector-button { margin-right: 10px; border: 0; border-radius: 5px; padding: 7px 10px; background: var(--castle-surface-3); color: var(--castle-text); font: inherit; cursor: pointer; }
body.cp-redesign :is(button.primary, .primary-button, .button-link:not(.secondary), .dashboard-site-actions .is-primary, .ai-site-send-button) { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 10px 16px; border: 1px solid transparent; border-radius: 8px; background: linear-gradient(105deg, #50f1c2, #60d9ff); color: #082c38; font-size: 13px; line-height: 1.4; font-weight: 650; text-align: center; cursor: pointer; }
body.cp-redesign :is(button.primary, .primary-button, .button-link:not(.secondary), .dashboard-site-actions .is-primary):hover { background: linear-gradient(105deg, #83f5d3, #88e3ff); color: #082c38; }
body.cp-redesign :is(.button-link.secondary, .secondary-button, .mini-link, .domain-icon-action, .sftp-folder-tree-row button, .notification-page-head form button, .notification-filters > button) { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 12px; border: 1px solid var(--castle-line); border-radius: 8px; background: var(--castle-card); color: var(--castle-text); font: inherit; font-size: 12px; line-height: 1.4; font-weight: 550; cursor: pointer; }
body.cp-redesign :is(.button-link.secondary, .secondary-button, .mini-link, .domain-icon-action):hover { background: var(--castle-hover); border-color: color-mix(in srgb, var(--castle-green-dark) 40%, var(--castle-line)); }
body.cp-redesign .mini-button { min-height: 36px; height: auto; padding: 8px 12px; border: 1px solid var(--castle-line); border-radius: 8px; background: var(--castle-surface-3); color: var(--castle-text); font: inherit; font-size: 12px; font-weight: 600; }
body.cp-redesign .mini-button:hover { background: var(--castle-hover); }
body.cp-redesign :is(.danger-button, .mini-button.danger, .mini-button.danger-soft) { border-color: color-mix(in srgb, var(--castle-danger) 28%, var(--castle-line)); background: var(--cp-danger-bg); color: var(--castle-danger); }
body.cp-redesign :is(.alert, .notice) { padding: 13px 15px; border-radius: 9px; font-size: 13px; line-height: 1.6; font-weight: 500; overflow-wrap: anywhere; }
body.cp-redesign :is(.alert.success, .notice.success) { border-color: color-mix(in srgb, var(--castle-ok) 25%, var(--castle-line)); background: var(--cp-success-bg); color: var(--castle-ok); }
body.cp-redesign :is(.alert.danger, .notice.danger, .agent-error, .agent-log-line.error, .monitor-alert-item.critical, .monitor-alert-stack > div.critical, .ai-site-project .inline-alert.danger) { border-color: color-mix(in srgb, var(--castle-danger) 30%, var(--castle-line)); background: var(--cp-danger-bg); color: var(--castle-danger); }
body.cp-redesign :is(.alert.warning, .notice.warning, .agent-log-line.warning, .monitor-alert-item.warning, .monitor-alert-stack > div.warning, .ai-site-boundary) { border-color: color-mix(in srgb, var(--castle-warn) 30%, var(--castle-line)); background: var(--cp-warning-bg); color: var(--castle-warn); }
body.cp-redesign :is(.alert.info, .notice.info) { border-color: color-mix(in srgb, var(--cp-info-text) 25%, var(--castle-line)); background: var(--cp-info-bg); color: var(--cp-info-text); }
body.cp-redesign :is(.pill, .health-ok) { max-width: 100%; min-height: 24px; padding: 4px 8px; border-radius: 5px; font-size: 10px; line-height: 1.35; font-weight: 600; letter-spacing: .01em; overflow-wrap: anywhere; }
body.cp-redesign table :is(.pill, .health-ok) { max-width: none; white-space: nowrap; overflow-wrap: normal; word-break: normal; }
body.cp-redesign :is(.pill.ok, .health-ok) { background: var(--cp-success-bg); color: var(--castle-ok); }
body.cp-redesign .pill.warn { background: var(--cp-warning-bg); color: var(--castle-warn); }
body.cp-redesign .pill.danger { background: var(--cp-danger-bg); color: var(--castle-danger); }
body.cp-redesign .pill.neutral { background: var(--castle-surface-3); color: var(--castle-muted); }

/* Data tables retain horizontal scrolling locally; JS opts simple tables into cards. */
body.cp-redesign :is(.table-wrap, .monitor-table-wrap, .file-table-wrap) { max-width: 100%; min-width: 0; border-color: var(--castle-line); border-radius: 10px; overflow-x: auto; overscroll-behavior-x: contain; }
body.cp-redesign table { background: var(--castle-card); color: var(--castle-text); font-size: 13px; }
body.cp-redesign :is(th, td) { padding: 13px 15px; border-color: var(--castle-line); line-height: 1.55; }
body.cp-redesign th { background: var(--castle-surface-2); color: var(--castle-muted); font-size: 10px; font-weight: 600; letter-spacing: .045em; }
body.cp-redesign td small { color: var(--castle-muted); font-size: 12px; }
body.cp-redesign :is(.monitor-compact-table, .monitor-alert-compact-table) th { background: var(--castle-surface-2); color: var(--castle-muted); border-color: var(--castle-line); font-size: 11px; font-weight: 600; }
body.cp-redesign :is(.monitor-compact-table, .monitor-alert-compact-table) td { border-color: var(--castle-line); font-size: 13px; }
body.cp-redesign :is(.monitor-compact-table, .monitor-alert-compact-table, .file-directory-table) tbody tr:hover td { background: var(--castle-surface-2); }
body.cp-redesign .file-directory-table tbody tr:has([data-file-select]:checked) td { background: var(--castle-soft); }
body.cp-redesign :is(.monitor-alert-stack > div, .monitor-alert-item) { background: var(--castle-surface-2); border-color: var(--castle-line); }
body.cp-redesign :is(.monitor-alert-stack small, .monitor-alert-item small, .ua-text) { color: var(--castle-muted); }
body.cp-redesign .http-method { background: var(--castle-soft); color: var(--castle-green-dark); }
body.cp-redesign .dashboard-layout .ux-summary-row .card-head { flex-direction: column; gap: 6px; }

/* Dashboard prioritizes the hosting directory; secondary details remain one tap away. */
body.cp-redesign :is(.dashboard-primary-stats, .dashboard-secondary-stats) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.cp-redesign .dashboard-resource-details { margin: 0 0 20px; }
body.cp-redesign :is(.dashboard-resource-details, .dashboard-summary-details, .dashboard-more-details) > summary { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 10px 0; color: var(--castle-text); font-size: 13px; font-weight: 600; list-style: none; cursor: pointer; }
body.cp-redesign :is(.dashboard-resource-details, .dashboard-summary-details, .dashboard-more-details, .dashboard-quick-details, .dashboard-health-details) > summary::-webkit-details-marker { display: none; }
body.cp-redesign :is(.dashboard-resource-details, .dashboard-summary-details, .dashboard-more-details, .dashboard-quick-details, .dashboard-health-details) > summary::after { content: ""; width: 7px; height: 7px; flex: 0 0 7px; margin-left: auto; border-right: 1.5px solid var(--castle-muted); border-bottom: 1.5px solid var(--castle-muted); transform: rotate(45deg); transition: transform .15s; }
body.cp-redesign :is(.dashboard-resource-details, .dashboard-summary-details, .dashboard-more-details, .dashboard-quick-details, .dashboard-health-details)[open] > summary::after { transform: rotate(225deg); }
body.cp-redesign .dashboard-resource-details > summary > .cp-icon { flex: 0 0 18px; color: var(--castle-green-dark); font-size: 17px; }
body.cp-redesign .dashboard-resource-details > summary > small { margin-left: auto; color: var(--castle-muted); font-size: 12px; font-weight: 400; }
body.cp-redesign .dashboard-resource-details > summary::after { margin-left: 7px; }
body.cp-redesign .dashboard-resource-details > .dashboard-details-content { padding-top: 10px; }
body.cp-redesign .dashboard-resource-details .dashboard-compute-strip { margin-bottom: 0; }
body.cp-redesign :is(.dashboard-quick-details, .dashboard-health-details) { padding: 0; }
body.cp-redesign :is(.dashboard-quick-details, .dashboard-health-details) > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 18px 20px; list-style: none; cursor: pointer; }
body.cp-redesign :is(.dashboard-quick-details, .dashboard-health-details) > summary h2 { font-size: 17px; margin: 0; }
body.cp-redesign :is(.dashboard-quick-details, .dashboard-health-details) > summary > span { color: var(--castle-muted); font-size: 12px; }
body.cp-redesign :is(.dashboard-quick-details, .dashboard-health-details) > .dashboard-details-content { padding: 18px 20px 20px; border-top: 1px solid var(--castle-line); }
body.cp-redesign .dashboard-side-content { display: grid; gap: 16px; padding-top: 12px; }
body.cp-redesign .dashboard-summary-details > .ux-summary-row { margin-top: 10px; }
body.cp-redesign .dashboard-sites-table { table-layout: auto; }
body.cp-redesign .dashboard-sites-table td { vertical-align: middle; }
body.cp-redesign .dashboard-sites-table td:first-child { width: 51%; }
body.cp-redesign .dashboard-sites-table td:nth-child(2) { width: 29%; }
body.cp-redesign .dashboard-sites-table td:last-child { width: 20%; }
body.cp-redesign .dashboard-sites-table td > strong { color: var(--castle-text); font-size: 13px; overflow-wrap: anywhere; }
body.cp-redesign .dashboard-sites-table td > small { font-size: 11px; }
body.cp-redesign .dashboard-site-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 7px; }
body.cp-redesign .dashboard-site-badges > span:not(.pill) { display: inline-flex; align-items: center; gap: 5px; color: var(--castle-muted); font-size: 10px; white-space: nowrap; }
body.cp-redesign .dashboard-sites-table td:last-child .mini-link { white-space: nowrap; }
body.cp-redesign .dashboard-site-path { margin-top: 7px; }
body.cp-redesign .dashboard-site-path > summary { width: fit-content; color: var(--castle-green-dark); font-size: 10px; font-weight: 500; cursor: pointer; }
body.cp-redesign .dashboard-site-path code { display: block; max-width: 100%; margin-top: 6px; font-size: 10px; white-space: normal; overflow-wrap: anywhere; }

/* Settings becomes a stable local navigation, with a native selector on phones. */
body.cp-redesign .settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); align-items: start; gap: 22px; min-width: 0; }
body.cp-redesign .settings-content { min-width: 0; }
body.cp-redesign .settings-layout > .settings-tabs { position: sticky; top: 96px; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 4px; margin: 0; padding: 0 12px 0 0; border: 0; border-right: 1px solid var(--castle-line); border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
body.cp-redesign .settings-layout > .settings-tabs a { display: flex; gap: 9px; align-items: center; justify-content: flex-start; min-width: 0; min-height: 43px; padding: 10px 12px; margin: 0; border: 0; border-radius: 8px; background: transparent; color: var(--castle-muted); white-space: normal; font-size: 12px; font-weight: 500; }
body.cp-redesign .settings-layout > .settings-tabs a .cp-icon { color: inherit; font-size: 16px; }
body.cp-redesign .settings-layout > .settings-tabs a:hover, body.cp-redesign .settings-layout > .settings-tabs a.active { background: var(--castle-soft); color: var(--castle-green-dark); }
body.cp-redesign .settings-tabs:not(.settings-layout > .settings-tabs) { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; background: var(--castle-card); }
body.cp-redesign .settings-category-grid > a { padding: 18px; }
body.cp-redesign .settings-category-grid > a strong { font-size: 14px; font-weight: 600; }
body.cp-redesign .settings-category-grid > a small { font-size: 12px; }
body.cp-redesign .settings-toggle-grid > label { padding: 15px; }
body.cp-redesign .ip-security-tabs { gap: 8px; margin-bottom: 20px; }
body.cp-redesign .ip-security-tabs a { min-height: 46px; padding: 11px 13px; border-color: var(--castle-line); border-radius: 8px; background: var(--castle-card); color: var(--castle-muted); font-size: 12px; font-weight: 550; box-shadow: none; }
body.cp-redesign .ip-security-tabs a.active { border-color: color-mix(in srgb, var(--castle-green-dark) 40%, var(--castle-line)); background: var(--castle-soft); color: var(--castle-green-dark); }
body.cp-redesign .ip-security-tabs a strong { background: var(--castle-surface-3); color: var(--castle-text); font-size: 10px; }
body.cp-redesign .ip-security-tabs a.active strong { background: var(--castle-card); color: var(--castle-green-dark); }

/* Notification center */
body.cp-redesign .notification-center { top: 66px; right: var(--cp-content-gap); width: min(440px, calc(100vw - 28px)); max-height: min(720px, calc(100dvh - 90px)); border: 1px solid var(--castle-line); border-radius: 12px; background: var(--castle-card); box-shadow: 0 18px 50px #081c2830; }
body.cp-redesign .notification-center-head { padding: 17px; background: var(--castle-card); color: var(--castle-text); border-color: var(--castle-line); }
body.cp-redesign .notification-center-head strong { font-size: 16px; font-weight: 650; }
body.cp-redesign .notification-center-head small { color: var(--castle-muted); font-size: 12px; }
body.cp-redesign .notification-center-head > button { width: 36px; height: 36px; background: var(--castle-surface-2); color: var(--castle-muted); border-radius: 8px; }
body.cp-redesign .notification-center-list { padding: 12px; background: var(--castle-surface-2); gap: 9px; }
body.cp-redesign .notification-item { background: var(--castle-card); border-color: var(--castle-line); border-radius: 10px; padding: 13px; gap: 10px; }
body.cp-redesign .notification-item.is-unread { background: var(--castle-card); border-left-color: #0c9b80; }
body.cp-redesign .notification-item strong { color: var(--castle-text); font-size: 13px; font-weight: 600; }
body.cp-redesign .notification-item p { color: var(--castle-muted); font-size: 12px; line-height: 1.6; }
body.cp-redesign .notification-item small { color: var(--castle-muted); font-size: 11px; }
body.cp-redesign .notification-severity { background: var(--castle-surface-3); color: var(--castle-muted); }
body.cp-redesign .notification-item.is-critical .notification-severity { background: var(--cp-danger-bg); color: var(--castle-danger); }
body.cp-redesign .notification-item.is-warning .notification-severity { background: var(--cp-warning-bg); color: var(--castle-warn); }
body.cp-redesign .notification-item.is-success .notification-severity { background: var(--cp-success-bg); color: var(--castle-ok); }
body.cp-redesign .notification-item-actions a, body.cp-redesign .notification-item-actions button { min-height: 36px; min-width: 36px; padding: 7px 10px; background: var(--castle-card); color: var(--castle-text); border-color: var(--castle-line); font-size: 11px; font-weight: 550; }
body.cp-redesign .notification-center-foot { padding: 12px 14px; background: var(--castle-card); border-color: var(--castle-line); }
body.cp-redesign .notification-center-foot button { color: var(--castle-muted); font-size: 12px; font-weight: 550; }
body.cp-redesign .notification-center-foot > a { background: var(--castle-soft); color: var(--castle-green-dark); font-size: 12px; font-weight: 600; }
body.cp-redesign .notification-filters { background: var(--castle-surface-2); }
body.cp-redesign .agent-mini-panel { background: var(--castle-card); border-color: var(--castle-line); }
body.cp-redesign .agent-mini-toggle { background: #081c28; border-color: #29414e; border-radius: 10px; }
body.cp-redesign .agent-mini-toggle strong { font-size: 13px; font-weight: 600; }
body.cp-redesign .agent-mini-toggle small { color: #aec8d5; font-weight: 500; }
body.cp-redesign .agent-mini-launcher-icon { display: none; }
body.cp-redesign :is(.agent-mini-item, .agent-mini-summary span) { background: var(--castle-surface-2); border-color: var(--castle-line); color: var(--castle-text); }
body.cp-redesign :is(.agent-mini-item.is-running, .agent-mini-item.is-pending) { background: var(--cp-success-bg); border-color: color-mix(in srgb, var(--castle-ok) 28%, var(--castle-line)); }
body.cp-redesign .agent-mini-item.is-failed { background: var(--cp-danger-bg); border-color: color-mix(in srgb, var(--castle-danger) 30%, var(--castle-line)); }
body.cp-redesign .agent-mini-item.is-done { background: var(--castle-surface-2); }
body.cp-redesign .agent-mini-item em { color: var(--castle-muted); }
body.cp-redesign .agent-mini-link { color: var(--castle-green-dark); font-size: 12px; font-weight: 600; }
body.cp-redesign .impersonation-banner { position: sticky; top: 76px; z-index: 39; background: var(--cp-warning-bg); border-color: color-mix(in srgb, var(--castle-warn) 28%, var(--castle-line)); color: var(--castle-warn); }
body.cp-redesign .impersonation-banner small { color: var(--castle-warn); }

/* File manager and editor. Monaco's content/layout styles are intentionally untouched. */
body.cp-redesign .file-manager-shell { padding: 0; }
body.cp-redesign :is(.file-overview-bar, .file-browser-main, .file-directory-panel, .file-tree-panel, .file-command-bar, .file-tree-head, .file-breadcrumbs, .file-view-tabs, .file-path-bar, .file-tree-scroll) { background: var(--castle-card); color: var(--castle-text); border-color: var(--castle-line); }
body.cp-redesign .file-tree-panel { background: var(--castle-surface-2); }
body.cp-redesign .file-tree-head strong { color: var(--castle-text); font-weight: 600; font-size: 12px; }
body.cp-redesign .file-tree-head span { font-size: 10px; color: var(--castle-muted); }
body.cp-redesign :is(.file-tree-root, .file-tree-node summary a, .file-tree-leaf) { color: var(--castle-text); font-size: 12px; min-height: 34px; }
body.cp-redesign :is(.file-tree-root:hover, .file-tree-node summary a:hover, .file-tree-leaf:hover, .file-tree-root.active, .file-tree-node summary a.active, .file-tree-leaf.active) { background: var(--castle-soft); color: var(--castle-green-dark); }
body.cp-redesign .file-command-actions { flex-wrap: wrap; }
body.cp-redesign .file-command-actions button { min-height: 38px; }
body.cp-redesign .file-item-name strong { color: var(--castle-text); font-size: 13px; font-weight: 550; }
body.cp-redesign .file-item-name small { font-size: 11px; }
body.cp-redesign .file-item-icon { background: var(--castle-soft); color: var(--castle-green-dark); }
body.cp-redesign :is(.file-row-menu > div, .file-more-actions > div) { z-index: 90; border: 1px solid var(--castle-line); border-radius: 10px; background: var(--castle-card); color: var(--castle-text); box-shadow: 0 12px 35px #081c2826; }
body.cp-redesign .file-row-menu a, body.cp-redesign .file-row-menu button { min-height: 40px; color: var(--castle-text); font-size: 12px; }
body.cp-redesign .file-row-menu a:hover, body.cp-redesign .file-row-menu button:hover { background: var(--castle-hover); }
body.cp-redesign :is(.file-row-menu > summary, .modal-close) { background: var(--castle-surface-2); color: var(--castle-muted); border-color: var(--castle-line); }
body.cp-redesign :is(.file-row-menu button.is-danger, .text-danger) { color: var(--castle-danger); }
body.cp-redesign :is(.file-editor-modal, .file-preview-modal, .cp-modal, .modal-card, .modal-panel) { max-width: calc(100vw - 32px); background: var(--castle-card); color: var(--castle-text); border-color: var(--castle-line); border-radius: 14px; }
body.cp-redesign :is(.file-editor-head, .file-editor-actions, .code-editor-toolbar, .code-editor-statusbar, .file-preview-actions, .modal-head, .modal-actions) { background: var(--castle-surface-2); color: var(--castle-text); border-color: var(--castle-line); }
body.cp-redesign :is(.code-editor-toolbar, .code-editor-statusbar) { font-size: 12px; }
body.cp-redesign :is(.code-editor-chip, .code-editor-save-state) { background: var(--castle-card); color: var(--castle-muted); border-color: var(--castle-line); font-size: 11px; font-weight: 500; }
body.cp-redesign .modal-code-editor { background: var(--castle-input); color: var(--castle-text); font-size: 14px; line-height: 1.6; }
body.cp-redesign .monaco-editor-shell { background: var(--castle-input); }
body.cp-redesign :is(.file-drop-zone, .sftp-folder-tree, .sftp-folder-selected) { background: var(--castle-surface-2); color: var(--castle-text); border-color: var(--castle-line); }
body.cp-redesign .file-drop-zone:focus-within { outline: 3px solid var(--cp-focus); outline-offset: 3px; }

/* AI surfaces: body copy never drops to the former 8–10px size. */
body.cp-redesign :is(.ai-site-overview, .ai-site-advanced, .ai-site-project, .ai-site-chat, .ai-site-chat-header, .ai-site-chat-form, .ai-site-versions, .ai-site-version, .ai-site-preview-card, .ai-site-project-meta > span, .ai-site-auth-summary, .ai-integration-status > article, .ai-integration-boundaries > article) { border-color: var(--castle-line); border-radius: 10px; background: var(--castle-card); color: var(--castle-text); }
body.cp-redesign :is(.ai-site-chat, .ai-site-preview-card, .ai-site-versions, .ai-site-project-meta > span, .ai-site-advanced[open] > summary) { background: var(--castle-surface-2); }
body.cp-redesign .ai-site-chat-bubble { background: var(--castle-card); border-color: var(--castle-line); border-radius: 12px 12px 12px 3px; box-shadow: none; }
body.cp-redesign .ai-site-chat-message.is-customer .ai-site-chat-bubble { background: var(--castle-soft); border-color: color-mix(in srgb, var(--castle-green-dark) 28%, var(--castle-line)); border-radius: 12px 12px 3px 12px; }
body.cp-redesign .ai-site-chat-bubble p { color: var(--castle-text); font-size: 14px; line-height: 1.7; }
body.cp-redesign :is(.ai-site-chat-bubble header strong, .ai-site-chat-bubble header time, .ai-site-chat-header p, .ai-site-chat-status, .ai-site-chat-form > label, .ai-site-chat-suggestions > span, .ai-site-chat-form footer, .ai-site-chat-form footer small) { font-size: 11px; font-weight: 500; }
body.cp-redesign .ai-site-chat-bubble header strong { color: var(--castle-green-dark); }
body.cp-redesign .ai-site-chat-header h4 { font-size: 14px; }
body.cp-redesign :is(.ai-site-chat-suggestions button, .ai-site-project-meta small, .ai-site-advanced > summary small, .ai-site-advanced label small, .ai-site-preview-card small, .ai-site-versions > header p, .ai-site-version > div small, .ai-integration-status small, .ai-site-test-form small, .ai-integration-boundaries p) { font-size: 12px; line-height: 1.5; font-weight: 500; }
body.cp-redesign .ai-site-chat-suggestions button { min-height: 34px; padding: 7px 10px; background: var(--castle-card); color: var(--castle-green-dark); border-color: var(--castle-line); }
body.cp-redesign :is(.ai-site-project > header p, .ai-site-list > header p, .ai-site-project-meta strong, .ai-site-waiting p, .ai-site-boundary p, .ai-site-preview-card p, .ai-site-settings-admin > header p, .ai-site-auth-summary p, .ai-integration-status p) { font-size: 13px; line-height: 1.6; }
body.cp-redesign :is(.ai-site-submit p, .ai-site-settings-actions p, .ai-site-auth-summary small) { font-size: 12px; }
body.cp-redesign :is(.ai-site-overview strong, .ai-integration-status strong) { font-weight: 600; }
body.cp-redesign :is(.ai-site-overview small, .ai-site-advanced label) { font-size: 12px; }
body.cp-redesign .ai-site-chat-stream { padding: 20px; }
body.cp-redesign .ai-site-chat-form { gap: 11px; padding: 16px; }
body.cp-redesign .ai-site-progress { background: var(--castle-soft); border-color: color-mix(in srgb, var(--castle-green-dark) 30%, var(--castle-line)); color: var(--castle-text); font-size: 13px; }

/* Sign-in, password recovery and two-factor enrollment */
body.cp-redesign:has(.login-shell) { background: radial-gradient(ellipse at 15% 10%, #50f1c214, transparent 45%), var(--castle-bg); }
body.cp-redesign .login-shell { min-height: 100dvh; grid-template-columns: minmax(300px, 440px) minmax(0, 1fr); max-width: 1080px; gap: 44px; padding: 58px 32px; background: none; }
body.cp-redesign .login-panel { padding: 32px; box-shadow: 0 16px 55px #081c280b; }
body.cp-redesign .brand-card { height: 180px; margin: -8px 0 14px; background: var(--castle-surface-2); border-radius: 10px; }
body.cp-redesign .login-panel .form { gap: 17px; }
body.cp-redesign .login-panel button.primary { min-height: 46px; }
body.cp-redesign .login-aside { border: 0; background: none; box-shadow: none; padding: 0; }
body.cp-redesign .update-list article { background: var(--castle-card); border-color: var(--castle-line); padding: 18px; border-radius: 10px; }
body.cp-redesign .update-list article::before { display: none; }
body.cp-redesign .update-list strong { color: var(--castle-text); font-size: 14px; font-weight: 600; }
body.cp-redesign .update-list p { font-size: 13px; }
body.cp-redesign .update-list span { background: var(--castle-soft); color: var(--castle-green-dark); font-size: 10px; font-weight: 600; }
body.cp-redesign :is(.login-links a, .update-list a, .update-all) { color: var(--castle-green-dark); font-size: 12px; font-weight: 600; }
body.cp-redesign .theme-toggle-login { width: 42px; height: 42px; border-radius: 10px; background: var(--castle-card); color: var(--castle-text); border-color: var(--castle-line); }

/* Module colors are decorative. Operational status continues to use its own tokens. */
:root,
html[data-theme="light"] {
  --cp-blue: #397be6;
  --cp-blue-ink: #245da2;
  --cp-blue-soft: #e7f0ff;
  --cp-blue-wash: #f0f5ff;
  --cp-teal: #15a58e;
  --cp-teal-ink: #087761;
  --cp-teal-soft: #dff6ef;
  --cp-teal-wash: #edf9f4;
  --cp-violet: #8b6be8;
  --cp-violet-ink: #6942ad;
  --cp-violet-soft: #f0e9ff;
  --cp-violet-wash: #f6f1ff;
  --cp-amber: #d5a037;
  --cp-amber-ink: #865b17;
  --cp-amber-soft: #fff0cf;
  --cp-amber-wash: #fff8e9;
  --cp-cyan: #1aabc4;
  --cp-cyan-ink: #08718a;
  --cp-cyan-soft: #ddf4fb;
  --cp-cyan-wash: #edf9fd;
}
html[data-theme="dark"] {
  --cp-blue: #76aaff;
  --cp-blue-ink: #9bc2ff;
  --cp-blue-soft: #193858;
  --cp-blue-wash: #152d46;
  --cp-teal: #49d8b6;
  --cp-teal-ink: #8ae9cf;
  --cp-teal-soft: #17413d;
  --cp-teal-wash: #153431;
  --cp-violet: #b69aff;
  --cp-violet-ink: #cfbaff;
  --cp-violet-soft: #352951;
  --cp-violet-wash: #29233e;
  --cp-amber: #eac06a;
  --cp-amber-ink: #f3d59c;
  --cp-amber-soft: #463a24;
  --cp-amber-wash: #352e22;
  --cp-cyan: #58d4ee;
  --cp-cyan-ink: #98e5f5;
  --cp-cyan-soft: #173d4d;
  --cp-cyan-wash: #15323f;
}
body.cp-redesign {
  --cp-module-accent: var(--cp-blue);
  --cp-module-ink: var(--cp-blue-ink);
  --cp-module-soft: var(--cp-blue-soft);
  --cp-module-wash: var(--cp-blue-wash);
  --cp-accent: var(--cp-module-accent);
  --cp-accent-ink: var(--cp-module-ink);
  --cp-accent-soft: var(--cp-module-soft);
  --cp-accent-wash: var(--cp-module-wash);
}
body.cp-redesign:is([data-page="domains"], [data-page="site-dns"], [data-page="mail"], [data-page="monitoring"], [data-page="monitor-alerts"]) {
  --cp-module-accent: var(--cp-cyan);
  --cp-module-ink: var(--cp-cyan-ink);
  --cp-module-soft: var(--cp-cyan-soft);
  --cp-module-wash: var(--cp-cyan-wash);
}
body.cp-redesign:is([data-page="backups"], [data-page="databases"], [data-page="ai-site-builder"], [data-page="ai-integration-settings"], [data-page="account"], [data-page="reseller-clients"]) {
  --cp-module-accent: var(--cp-violet);
  --cp-module-ink: var(--cp-violet-ink);
  --cp-module-soft: var(--cp-violet-soft);
  --cp-module-wash: var(--cp-violet-wash);
}
body.cp-redesign:is([data-page="usage"], [data-page="agent-queue"], [data-page="logs"], [data-page="diagnostics"]) {
  --cp-module-accent: var(--cp-amber);
  --cp-module-ink: var(--cp-amber-ink);
  --cp-module-soft: var(--cp-amber-soft);
  --cp-module-wash: var(--cp-amber-wash);
}
body.cp-redesign:is([data-page="ssl"], [data-page="nodejs"], [data-page="updates"], [data-page="security"]) {
  --cp-module-accent: var(--cp-teal);
  --cp-module-ink: var(--cp-teal-ink);
  --cp-module-soft: var(--cp-teal-soft);
  --cp-module-wash: var(--cp-teal-wash);
}

/* Metric palettes repeat predictably without assigning a status to the number. */
body.cp-redesign :is(.stat-grid > .stat-card, .metric-grid > .metric, .ai-site-overview > div, .ai-integration-status > article):nth-child(5n + 1) {
  --cp-accent: var(--cp-blue); --cp-accent-ink: var(--cp-blue-ink); --cp-accent-soft: var(--cp-blue-soft); --cp-accent-wash: var(--cp-blue-wash);
}
body.cp-redesign :is(.stat-grid > .stat-card, .metric-grid > .metric, .ai-site-overview > div, .ai-integration-status > article):nth-child(5n + 2) {
  --cp-accent: var(--cp-teal); --cp-accent-ink: var(--cp-teal-ink); --cp-accent-soft: var(--cp-teal-soft); --cp-accent-wash: var(--cp-teal-wash);
}
body.cp-redesign :is(.stat-grid > .stat-card, .metric-grid > .metric, .ai-site-overview > div, .ai-integration-status > article):nth-child(5n + 3) {
  --cp-accent: var(--cp-violet); --cp-accent-ink: var(--cp-violet-ink); --cp-accent-soft: var(--cp-violet-soft); --cp-accent-wash: var(--cp-violet-wash);
}
body.cp-redesign :is(.stat-grid > .stat-card, .metric-grid > .metric, .ai-site-overview > div, .ai-integration-status > article):nth-child(5n + 4) {
  --cp-accent: var(--cp-amber); --cp-accent-ink: var(--cp-amber-ink); --cp-accent-soft: var(--cp-amber-soft); --cp-accent-wash: var(--cp-amber-wash);
}
body.cp-redesign :is(.stat-grid > .stat-card, .metric-grid > .metric, .ai-site-overview > div, .ai-integration-status > article):nth-child(5n + 5) {
  --cp-accent: var(--cp-cyan); --cp-accent-ink: var(--cp-cyan-ink); --cp-accent-soft: var(--cp-cyan-soft); --cp-accent-wash: var(--cp-cyan-wash);
}
body.cp-redesign :is(.dashboard-primary-stats > .stat-card:nth-child(2), .dashboard-secondary-stats > .stat-card:nth-child(1)) {
  --cp-accent: var(--cp-cyan); --cp-accent-ink: var(--cp-cyan-ink); --cp-accent-soft: var(--cp-cyan-soft); --cp-accent-wash: var(--cp-cyan-wash);
}
body.cp-redesign .dashboard-secondary-stats > .stat-card:nth-child(2) {
  --cp-accent: var(--cp-violet); --cp-accent-ink: var(--cp-violet-ink); --cp-accent-soft: var(--cp-violet-soft); --cp-accent-wash: var(--cp-violet-wash);
}
body.cp-redesign .dashboard-secondary-stats > .stat-card:nth-child(3) {
  --cp-accent: var(--cp-amber); --cp-accent-ink: var(--cp-amber-ink); --cp-accent-soft: var(--cp-amber-soft); --cp-accent-wash: var(--cp-amber-wash);
}
body.cp-redesign :is(.stat-grid > .stat-card, .metric-grid > .metric, .ai-site-overview > div, .ai-integration-status > article) {
  background: linear-gradient(120deg, var(--cp-accent-wash), var(--castle-card));
  border-color: color-mix(in srgb, var(--cp-accent) 27%, var(--castle-line));
  box-shadow: inset 0 3px 0 var(--cp-accent), var(--shadow);
}
body.cp-redesign .stat-icon,
body.cp-redesign .ai-site-overview > div > span,
body.cp-redesign .ai-integration-status > article > span {
  background: var(--cp-accent-soft); color: var(--cp-accent-ink);
}

/* Destination-based colors keep repeated shortcuts consistent throughout the panel. */
body.cp-redesign .workspace :is(.quick-actions > a, .site-link-grid > a, .tool-tile, .domain-module-item, .shortcut-list > a, .settings-category-grid > a, .settings-module-grid > a) {
  --cp-accent: var(--cp-module-accent); --cp-accent-ink: var(--cp-module-ink); --cp-accent-soft: var(--cp-module-soft); --cp-accent-wash: var(--cp-module-wash);
}
body.cp-redesign .workspace :is(.quick-actions > a, .site-link-grid > a, .tool-tile, .domain-module-item, .shortcut-list > a, .settings-category-grid > a, .settings-module-grid > a):is([href*="page=sites"], [href*="page=site-settings"], [href*="page=wordpress"], [href*="page=customers"], [href*="page=customer-services"], [href*="page=git"], [href*="section=overview"], [href*="section=general"]) {
  --cp-accent: var(--cp-blue); --cp-accent-ink: var(--cp-blue-ink); --cp-accent-soft: var(--cp-blue-soft); --cp-accent-wash: var(--cp-blue-wash);
}
body.cp-redesign .workspace :is(.quick-actions > a, .site-link-grid > a, .tool-tile, .domain-module-item, .shortcut-list > a, .settings-category-grid > a, .settings-module-grid > a):is([href*="page=domains"], [href*="page=site-dns"], [href*="page=mail"], [href*="page=monitoring"], [href*="section=network"], [href*="section=nginx"], [href*="section=mail"], [href*="section=monitoring"]) {
  --cp-accent: var(--cp-cyan); --cp-accent-ink: var(--cp-cyan-ink); --cp-accent-soft: var(--cp-cyan-soft); --cp-accent-wash: var(--cp-cyan-wash);
}
body.cp-redesign .workspace :is(.quick-actions > a, .site-link-grid > a, .tool-tile, .domain-module-item, .shortcut-list > a, .settings-category-grid > a, .settings-module-grid > a):is([href*="page=databases"], [href*="page=backups"], [href*="page=ai-"], [href*="page=account"], [href*="page=reseller-clients"], [href*="section=backup"], [href*="section=api"], [href*="section=modules"]) {
  --cp-accent: var(--cp-violet); --cp-accent-ink: var(--cp-violet-ink); --cp-accent-soft: var(--cp-violet-soft); --cp-accent-wash: var(--cp-violet-wash);
}
body.cp-redesign .workspace :is(.quick-actions > a, .site-link-grid > a, .tool-tile, .domain-module-item, .shortcut-list > a, .settings-category-grid > a, .settings-module-grid > a):is([href*="page=usage"], [href*="page=logs"], [href*="page=agent-queue"], [href*="section=diagnostics"], [href*="section=ip-security"]) {
  --cp-accent: var(--cp-amber); --cp-accent-ink: var(--cp-amber-ink); --cp-accent-soft: var(--cp-amber-soft); --cp-accent-wash: var(--cp-amber-wash);
}
body.cp-redesign .workspace :is(.quick-actions > a, .site-link-grid > a, .tool-tile, .domain-module-item, .shortcut-list > a, .settings-category-grid > a, .settings-module-grid > a):is([href*="page=ssl"], [href*="page=nodejs"], [href*="page=security"], [href*="section=security"], [href*="section=updates"]) {
  --cp-accent: var(--cp-teal); --cp-accent-ink: var(--cp-teal-ink); --cp-accent-soft: var(--cp-teal-soft); --cp-accent-wash: var(--cp-teal-wash);
}
html body.cp-redesign .workspace :is(.quick-actions > a, .site-link-grid > a, .tool-tile, .shortcut-list > a, .settings-category-grid > a, .settings-module-grid > a) {
  background: linear-gradient(115deg, var(--cp-accent-wash), var(--castle-card));
  border-color: color-mix(in srgb, var(--cp-accent) 27%, var(--castle-line));
  box-shadow: inset 0 2px 0 var(--cp-accent);
}
html body.cp-redesign .workspace :is(.quick-actions > a, .site-link-grid > a, .tool-tile, .shortcut-list > a, .settings-category-grid > a, .settings-module-grid > a):hover {
  background: var(--cp-accent-soft);
  border-color: color-mix(in srgb, var(--cp-accent) 60%, var(--castle-line));
}
html body.cp-redesign .workspace :is(.quick-actions > a, .site-link-grid > a, .tool-tile, .domain-module-item, .shortcut-list > a, .settings-category-grid > a, .settings-module-grid > a) :is(.quick-icon, .tool-icon, .domain-module-icon, .shortcut-icon, .settings-category-icon, .settings-module-icon, .cp-icon) {
  background: var(--cp-accent-soft); color: var(--cp-accent-ink);
}

/* Page panels retain white/deep surfaces with a visible module-color edge. */
html body.cp-redesign .workspace .card:where(:not(.metric, .stat-card, .alert, .notice, .danger, .warning, .warn, .success, .info, .is-critical, .is-error, .is-warning, .is-failed, .is-success, .two-factor-recovery-card, .danger-zone, .security-site-error, .monitor-alert-card, .api-credential-once)) {
  background: linear-gradient(135deg, color-mix(in srgb, var(--cp-module-wash) 52%, var(--castle-card)), var(--castle-card) 75%);
  box-shadow: inset 0 3px 0 color-mix(in srgb, var(--cp-module-accent) 72%, var(--castle-line)), var(--shadow);
}
body.cp-redesign :is(.dashboard-resource-details, .dashboard-summary-details, .dashboard-more-details) > summary {
  color: var(--cp-module-ink);
}
body.cp-redesign :is(.dashboard-quick-details, .dashboard-health-details) > summary {
  background: linear-gradient(105deg, var(--cp-module-wash), transparent);
}
body.cp-redesign :is(.dashboard-head, .page-header, .settings-head) { position: relative; isolation: isolate; }
body.cp-redesign :is(.dashboard-head, .page-header, .settings-head)::before {
  content: ""; position: absolute; z-index: -1; inset: -12px -14px; border-radius: 14px; pointer-events: none;
  background: linear-gradient(110deg, var(--cp-module-soft), var(--cp-module-wash) 52%, color-mix(in srgb, var(--cp-violet-soft) 48%, var(--castle-bg)));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--cp-module-accent) 20%, transparent);
}
body.cp-redesign .file-tree-head,
body.cp-redesign .ai-site-chat-header,
body.cp-redesign .ai-site-settings-admin > header {
  background: linear-gradient(110deg, var(--cp-module-soft), var(--castle-card));
}
body.cp-redesign .ai-site-chat-brand,
body.cp-redesign .ai-site-preview-icon,
body.cp-redesign .ai-site-chat-avatar {
  background: var(--cp-violet-soft); color: var(--cp-violet-ink);
}
body.cp-redesign .ai-site-chat-message.is-customer .ai-site-chat-bubble {
  background: var(--cp-cyan-soft); border-color: color-mix(in srgb, var(--cp-cyan) 35%, var(--castle-line));
}

@media (min-width: 1025px) {
  body.cp-redesign.nav-collapsed { --cp-sidebar-width: 80px; }
  body.cp-redesign.nav-collapsed .sidebar { padding-inline: 10px; }
  body.cp-redesign.nav-collapsed .sidebar-brand { margin-inline: 9px; }
  body.cp-redesign.nav-collapsed :is(.sidebar-logo-word, .sidebar-title, .sidebar-workspace, .sidebar-safe, .sidebar-profile > div, .sidebar-footer-links) { display: none; }
  body.cp-redesign.nav-collapsed .sidebar-nav > a, body.cp-redesign.nav-collapsed .sidebar-menu-group > summary { justify-content: center; padding: 11px 0; }
  body.cp-redesign.nav-collapsed .sidebar-nav a > span:not(.nav-icon), body.cp-redesign.nav-collapsed .sidebar-menu-group > summary > span:not(.nav-icon), body.cp-redesign.nav-collapsed .sidebar-menu-group > summary::after { display: none; }
  body.cp-redesign.nav-collapsed .sidebar-submenu { margin: 3px 0; padding: 0; border: 0; }
  body.cp-redesign.nav-collapsed .sidebar-submenu a { justify-content: center; }
  body.cp-redesign.nav-collapsed .sidebar-profile { justify-content: center; margin-inline: 0; }
  body.cp-redesign.nav-collapsed .sidebar-profile .profile-pill { justify-content: center; }
  body.cp-redesign.nav-collapsed .sidebar-profile .profile-pill span { display: none; }
}

@media (min-width: 901px) and (max-width: 1550px) {
  body.cp-redesign .account-access-row { grid-template-columns: 42px minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); }
  body.cp-redesign .account-access-main { grid-column: 2 / 4; }
  body.cp-redesign .account-access-status { grid-column: 4; grid-row: 1; }
  body.cp-redesign .account-access-detail { min-width: 0; }
}

@media (min-width: 1381px) {
  body.cp-redesign .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.cp-redesign .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1025px) and (max-width: 1279px) {
  body.cp-redesign { --cp-sidebar-width: 226px; --cp-content-gap: 22px; }
  body.cp-redesign .topbar-title { display: none; }
  body.cp-redesign .profile-pill span, body.cp-redesign .logout-link { display: none; }
  body.cp-redesign .stat-card { padding: 16px; }
  body.cp-redesign .settings-layout { grid-template-columns: 170px minmax(0, 1fr); gap: 16px; }
  body.cp-redesign .server-metrics, body.cp-redesign .hardware-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Mobile is its own navigation: compact header, drawer, persistent task shortcuts. */
@media (max-width: 1024px) {
  body.cp-redesign { --cp-content-gap: 22px; }
  body.cp-redesign .app-shell { grid-template-columns: minmax(0, 1fr); }
  body.cp-redesign .sidebar { position: fixed; z-index: 111; left: 0; top: 0; bottom: 0; width: min(310px, calc(100vw - 52px)); height: 100dvh; min-height: 0; padding-top: max(20px, env(safe-area-inset-top)); transform: translateX(-105%); visibility: hidden; transition: transform .2s ease, visibility .2s; box-shadow: 15px 0 50px #0003; overflow-y: auto; }
  body.cp-redesign.cp-nav-open .sidebar { transform: translateX(0); visibility: visible; }
  body.cp-redesign.cp-nav-open { overflow: hidden; }
  body.cp-redesign .sidebar-overlay { position: fixed; z-index: 110; inset: 0; background: #03131ab3; border: 0; padding: 0; cursor: pointer; }
  body.cp-redesign.cp-nav-open .sidebar-overlay { display: block; }
  body.cp-redesign .sidebar-close { display: grid; place-items: center; position: absolute; right: 12px; top: max(22px, env(safe-area-inset-top)); width: 34px; height: 34px; padding: 0; border: 1px solid #34505f; border-radius: 8px; background: #14313f; color: #d7e9f2; cursor: pointer; }
  body.cp-redesign .sidebar-brand { margin-right: 34px; }
  body.cp-redesign .sidebar-menu-group, body.cp-redesign .sidebar-nav, body.cp-redesign .sidebar-title, body.cp-redesign .sidebar-safe { display: block; }
  body.cp-redesign .sidebar-submenu { display: grid; }
  body.cp-redesign .topbar { height: 68px; min-height: 68px; padding: 0 var(--cp-content-gap); gap: 12px; }
  body.cp-redesign .mobile-menu-toggle { display: inline-flex; }
  body.cp-redesign [data-sidebar-toggle]:not(.mobile-menu-toggle) { display: none; }
  body.cp-redesign .topbar-title { flex: 1; max-width: none; }
  body.cp-redesign .topbar-search { flex: 1 1 180px; max-width: 360px; }
  body.cp-redesign .topbar-actions { gap: 8px; }
  body.cp-redesign .profile-pill > span, body.cp-redesign .logout-link { display: none; }
  body.cp-redesign .workspace { padding-top: 23px; padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  body.cp-redesign .main-shell > footer { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  body.cp-redesign .mobile-nav { display: block; position: fixed; z-index: 80; left: 0; right: 0; bottom: 0; padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--castle-line); background: var(--castle-card); box-shadow: 0 -4px 22px #081c2808; }
  body.cp-redesign .mobile-nav-items { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; max-width: 700px; margin: 0 auto; }
  body.cp-redesign .mobile-nav-items > :is(a, button) { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 51px; min-width: 0; padding: 6px 3px; border: 0; border-radius: 9px; background: transparent; color: var(--castle-muted); font: inherit; font-size: 10px; font-weight: 500; cursor: pointer; text-decoration: none; }
  body.cp-redesign .mobile-nav-items > :is(a, button) .cp-icon { font-size: 21px; }
  body.cp-redesign .mobile-nav-items > :is(a.active, a[aria-current="page"], button[aria-expanded="true"]) { background: var(--castle-soft); color: var(--castle-green-dark); }
  body.cp-redesign .mobile-agent-slot { display: flex; align-items: center; justify-content: center; min-width: 0; }
  body.cp-redesign .settings-layout { display: block; }
  body.cp-redesign .settings-layout > .settings-tabs { display: none; }
  body.cp-redesign .server-settings-mobile-nav { display: grid; gap: 7px; margin: 0 0 20px; color: var(--castle-muted); font-size: 12px; font-weight: 550; }
  body.cp-redesign .server-settings-mobile-nav select { width: 100%; min-height: 46px; background: var(--castle-card); color: var(--castle-text); }
  body.cp-redesign .site-context-nav[data-mobile-navigation="ready"] { display: none; }
  body.cp-redesign :is(.domain-console, .service-editor, .customer-day-panel) { grid-template-columns: minmax(0, 1fr); }
  body.cp-redesign .domain-side { position: static; }
  body.cp-redesign .ai-site-workspace { grid-template-columns: minmax(0, 1fr); }
  body.cp-redesign .file-browser-layout { grid-template-columns: 200px minmax(0, 1fr); }
  body.cp-redesign .notification-center { right: 16px; top: 60px; max-height: calc(100dvh - 145px - env(safe-area-inset-bottom)); }
  body.cp-redesign .agent-mini { position: relative; bottom: auto; right: auto; left: auto; width: 48px; z-index: auto; }
  body.cp-redesign .agent-mini-toggle { position: relative; display: grid; place-items: center; grid-template-columns: 1fr; width: 48px; height: 48px; min-height: 48px; padding: 0; border-radius: 14px; gap: 0; }
  body.cp-redesign .agent-mini-toggle > :is(strong, small) { display: none; }
  body.cp-redesign .agent-mini-launcher-icon { display: inline-grid; width: 24px; height: 24px; color: #d8ebf5; font-size: 22px; }
  body.cp-redesign .agent-mini-pulse { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; box-shadow: 0 0 0 2px #081c28; }
  body.cp-redesign .agent-mini.has-failed .agent-mini-pulse { background: #ff8796; box-shadow: 0 0 0 2px #081c28; animation: none; }
  body.cp-redesign .agent-mini:not(.is-mobile-open) .agent-mini-panel { display: none; }
  body.cp-redesign .agent-mini-panel { position: fixed; right: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); width: min(390px, calc(100vw - 28px)); margin-top: 0; max-height: min(410px, calc(100dvh - 165px - env(safe-area-inset-bottom))); }
  body.cp-redesign .impersonation-banner { top: 68px; }
  body.cp-redesign :is(.dashboard-resource-details, .dashboard-summary-details, .dashboard-more-details) > summary { padding: 14px 15px; border: 1px solid var(--castle-line); border-radius: 10px; background: var(--castle-card); }
  body.cp-redesign :is(.dashboard-resource-details, .dashboard-summary-details, .dashboard-more-details)[open] > summary { background: var(--castle-surface-2); }
  body.cp-redesign .dashboard-resource-details > summary > small { font-size: 11px; }
  body.cp-redesign .dashboard-resource-details { margin-bottom: 16px; }
}

@media (max-width: 700px) {
  html { scroll-padding-top: 84px; }
  body.cp-redesign { --cp-content-gap: 16px; font-size: 14px; }
  body.cp-redesign h1 { font-size: 26px; }
  body.cp-redesign h2 { font-size: 17px; }
  body.cp-redesign .topbar { gap: 9px; height: 64px; min-height: 64px; }
  body.cp-redesign .topbar-title strong { font-size: 14px; }
  body.cp-redesign .topbar-title small { font-size: 10px; }
  body.cp-redesign .topbar-search { display: none; }
  body.cp-redesign .impersonation-banner { top: 64px; }
  body.cp-redesign .topbar-actions { margin-left: auto; }
  body.cp-redesign .profile-pill { display: none; }
  body.cp-redesign .sidebar-profile .profile-pill { display: flex; }
  body.cp-redesign .sidebar-profile .profile-pill span { display: block; }
  body.cp-redesign .icon-button, body.cp-redesign .mobile-menu-toggle { width: 38px; height: 38px; border-radius: 9px; }
  body.cp-redesign .workspace { padding-top: 20px; }
  body.cp-redesign .cp-page-breadcrumb { margin-bottom: 15px; font-size: 10px; }
  body.cp-redesign .card { padding: 18px; }
  body.cp-redesign :is(.dashboard-head, .page-header, .card-head, .section-head, .monitor-head, .agent-op-head, .site-settings-head) { flex-direction: column; align-items: stretch; gap: 12px; }
  body.cp-redesign :is(.dashboard-head, .page-header) { margin-bottom: 20px; }
  body.cp-redesign :is(.page-actions, .action-row) { flex-wrap: wrap; }
  body.cp-redesign .page-actions > :is(a, button, form) { flex: 1 1 auto; }
  body.cp-redesign .page-actions form > button { width: 100%; }
  body.cp-redesign .system-pill { align-self: flex-start; margin-top: 0; font-size: 11px; padding: 9px 11px; min-height: 38px; }
  body.cp-redesign .stat-grid, body.cp-redesign .metric-grid, body.cp-redesign .customers-summary, body.cp-redesign .server-metrics, body.cp-redesign .monitor-summary, body.cp-redesign .monitor-alert-summary, body.cp-redesign .agent-summary, body.cp-redesign .notification-metrics, body.cp-redesign .site-log-summary, body.cp-redesign .access-log-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.cp-redesign .stat-card { display: block; padding: 15px; min-height: 128px; }
  body.cp-redesign .stat-icon { width: 32px; height: 32px; margin-bottom: 8px; border-radius: 8px; }
  body.cp-redesign .stat-icon svg { font-size: 18px; }
  body.cp-redesign .stat-card strong, body.cp-redesign .metric strong { font-size: 25px; }
  body.cp-redesign .stat-card small, body.cp-redesign .stat-card p { font-size: 11px; }
  body.cp-redesign .metric { padding: 15px; min-height: 110px; }
  body.cp-redesign .metric span { font-size: 10px; }
  body.cp-redesign .metric small { font-size: 11px; }
  body.cp-redesign .dashboard-primary-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  body.cp-redesign .dashboard-primary-stats .stat-card { min-height: 114px; padding: 12px; }
  body.cp-redesign .dashboard-primary-stats .stat-icon { display: none; }
  body.cp-redesign .dashboard-primary-stats .stat-card small { min-height: 30px; font-size: 11px; line-height: 1.4; }
  body.cp-redesign .dashboard-primary-stats .stat-card strong { margin: 4px 0; font-size: 26px; line-height: 1.15; }
  body.cp-redesign .dashboard-primary-stats .stat-card p { font-size: 10px; line-height: 1.45; }
  body.cp-redesign .dashboard-secondary-stats { grid-template-columns: minmax(0, 1fr); }
  body.cp-redesign .dashboard-secondary-stats .stat-card { display: flex; min-height: 100px; }
  body.cp-redesign .dashboard-secondary-stats .stat-icon { margin-bottom: 0; }
  body.cp-redesign :is(.dashboard-quick-details, .dashboard-health-details) { padding: 0; }
  body.cp-redesign :is(.dashboard-quick-details, .dashboard-health-details) > summary { padding: 15px 16px; }
  body.cp-redesign :is(.dashboard-quick-details, .dashboard-health-details) > summary h2 { font-size: 15px; }
  body.cp-redesign :is(.dashboard-quick-details, .dashboard-health-details) > summary > span { font-size: 10px; }
  body.cp-redesign :is(.dashboard-quick-details, .dashboard-health-details) > .dashboard-details-content { padding: 15px 16px; }
  body.cp-redesign :is(.dashboard-resource-details, .dashboard-summary-details, .dashboard-more-details) > summary { min-height: 48px; font-size: 12px; }
  body.cp-redesign .dashboard-resource-details > summary { flex-wrap: wrap; }
  body.cp-redesign .dashboard-resource-details > summary > span:not(.cp-icon) { flex: 1; min-width: 0; }
  body.cp-redesign .dashboard-resource-details > summary > small { display: none; }
  body.cp-redesign :is(.quick-actions, .health-row, .credential-grid, .basic-grid, .tool-grid, .domain-module-grid, .dashboard-site-bar .site-link-grid, .customer-account-grid, .hardware-summary-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.cp-redesign .quick-actions > a, body.cp-redesign .quick-actions > span { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; padding: 13px; gap: 7px; }
  body.cp-redesign .quick-actions small { margin: 0; font-size: 11px; }
  body.cp-redesign .quick-actions strong { font-size: 12px; }
  body.cp-redesign :is(.ux-summary-row, .dns-form, .backup-create-form, .backup-choice-grid, .backup-content-grid, .backup-schedule-grid, .server-service-grid, .logs-filter, .site-log-filter, .monitor-filter, .monitor-alert-filter, .agent-filter, .agent-technical-grid, .connection-grid, .production-checklist-grid, .service-form, .customer-day-panel, .form-grid.two, .form-grid.three, .settings-toggle-grid, .detected-ip-grid, .hardware-detail-grid, .hardware-threshold-grid) { grid-template-columns: minmax(0, 1fr); }
  body.cp-redesign :is(.credential-grid strong, .basic-grid strong) { font-size: 15px; }
  body.cp-redesign :is(.compact-site-row, .site-row-card, .domain-mini-card) { min-width: 0; }
  body.cp-redesign :is(.backup-choice-grid label, .backup-content-grid label, .drive-type-choice label, .sftp-scope-option) { padding: 14px; }
  body.cp-redesign :is(.workspace, .login-shell, .cp-modal, .modal-overlay) :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.modal-code-editor) { font-size: 16px; }
  body.cp-redesign :is(.workspace, .login-shell, .cp-modal) :is(input, select):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { min-height: 46px; }
  body.cp-redesign :is(button.primary, .primary-button, .button-link, .mini-button, .mini-link, .secondary-button) { min-height: 42px; white-space: normal; }
  body.cp-redesign .ip-security-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  body.cp-redesign .ip-security-tabs a { font-size: 11px; min-height: 49px; padding: 10px; }
  body.cp-redesign .settings-category-grid { grid-template-columns: minmax(0, 1fr); }
  body.cp-redesign .settings-category-grid > a { padding: 16px; }
  body.cp-redesign .notification-center { top: 58px; left: 10px; right: 10px; width: auto; }
  body.cp-redesign .notification-item, body.cp-redesign .notification-page-list .notification-item { grid-template-columns: 32px minmax(0, 1fr); }
  body.cp-redesign .notification-item-actions { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  body.cp-redesign .notification-item-actions :is(a, button) { min-height: 40px; min-width: 40px; }
  body.cp-redesign .notification-center-foot { flex-wrap: wrap; }
  body.cp-redesign .notification-filters { grid-template-columns: minmax(0, 1fr); padding: 15px; }
  body.cp-redesign .notification-page-list { padding: 10px; }
  body.cp-redesign :is(.monitor-compact-table, .monitor-alert-compact-table) tr { background: var(--castle-card); border-color: var(--castle-line); border-radius: 10px; }
  body.cp-redesign :is(.monitor-site-cell, .monitor-alerts-cell, .monitor-inline-badges, .monitor-row-actions-cell) { min-width: 0; }
  body.cp-redesign .monitor-alert-stack > div { grid-template-columns: minmax(0, 1fr); }
  body.cp-redesign .file-browser-layout { grid-template-columns: minmax(0, 1fr); }
  body.cp-redesign .file-tree-panel { border-right: 0; border-bottom: 1px solid var(--castle-line); }
  body.cp-redesign .file-tree-scroll { max-height: 160px; background: var(--castle-surface-2); }
  body.cp-redesign .file-command-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  body.cp-redesign .file-command-actions .mini-link, body.cp-redesign .file-command-actions button { padding: 8px 6px; font-size: 11px; }
  body.cp-redesign .file-search-box { min-width: 0; width: 100%; }
  body.cp-redesign .file-overview-bar { flex-wrap: wrap; }
  body.cp-redesign .file-breadcrumbs { flex-wrap: wrap; overflow-wrap: anywhere; font-size: 12px; }
  body.cp-redesign :is(.file-row-menu > div, .file-more-actions > div) { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(82px + env(safe-area-inset-bottom)); width: auto; max-height: 60dvh; overflow-y: auto; }
  body.cp-redesign :is(.file-editor-modal, .file-preview-modal, .cp-modal, .modal-card, .modal-panel) { max-width: calc(100vw - 20px); max-height: calc(100dvh - 24px); border-radius: 12px; }
  body.cp-redesign .file-editor-modal { width: calc(100vw - 20px); height: calc(100dvh - 24px); min-height: 0; }
  body.cp-redesign .file-editor-head { padding: 13px; }
  body.cp-redesign .file-editor-head p { max-width: calc(100vw - 110px); overflow-wrap: anywhere; }
  body.cp-redesign .code-editor-toolbar { flex-wrap: wrap; gap: 8px; padding: 10px; }
  body.cp-redesign .code-editor-shortcuts { display: none; }
  body.cp-redesign .file-editor-actions { padding: 10px; flex-wrap: wrap; }
  body.cp-redesign .file-editor-actions :is(.primary, .button-link) { flex: 1; }
  body.cp-redesign .code-editor-statusbar { gap: 8px; flex-wrap: wrap; font-size: 10px; }
  body.cp-redesign .ai-site-project { padding: 15px; }
  body.cp-redesign .ai-site-project-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.cp-redesign .ai-site-project-side { grid-template-columns: minmax(0, 1fr); }
  body.cp-redesign .ai-site-chat-header { flex-wrap: wrap; padding: 13px; }
  body.cp-redesign .ai-site-chat-status { margin-left: 48px; }
  body.cp-redesign .ai-site-chat-stream { padding: 13px; height: min(460px, 60dvh); min-height: 280px; }
  body.cp-redesign .ai-site-chat-message { width: 96%; }
  body.cp-redesign .ai-site-chat-bubble { padding: 11px; }
  body.cp-redesign .ai-site-chat-bubble header { flex-direction: column; align-items: flex-start; gap: 2px; }
  body.cp-redesign .ai-site-chat-form { padding: 13px; }
  body.cp-redesign .ai-site-chat-suggestions { flex-wrap: wrap; overflow: visible; }
  body.cp-redesign .ai-site-chat-suggestions button { min-height: 38px; }
  body.cp-redesign .ai-site-composer { grid-template-columns: minmax(0, 1fr); }
  body.cp-redesign .ai-site-send-button { min-height: 46px; width: 100%; }
  body.cp-redesign .login-shell { display: block; max-width: 500px; padding: 70px 18px 32px; }
  body.cp-redesign .login-panel { padding: 24px; }
  body.cp-redesign .login-aside { display: none; }
  body.cp-redesign .brand-card { height: 155px; }

  body.cp-redesign .cp-responsive-table { display: block; min-width: 0 !important; background: transparent; }
  body.cp-redesign .cp-responsive-table thead { display: none; }
  body.cp-redesign .cp-responsive-table tbody { display: grid; gap: 11px; padding: 10px; }
  body.cp-redesign .cp-responsive-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; padding: 8px 12px; border: 1px solid var(--castle-line); border-radius: 10px; background: var(--castle-card); }
  body.cp-redesign .cp-responsive-table td { display: grid; grid-template-columns: minmax(78px, .4fr) minmax(0, 1fr); align-items: start; gap: 3px 12px; min-width: 0; width: auto; padding: 9px 0; border: 0; border-bottom: 1px solid var(--castle-line); white-space: normal; overflow-wrap: anywhere; }
  body.cp-redesign .cp-responsive-table td:last-child { border-bottom: 0; }
  body.cp-redesign .cp-responsive-table td::before { content: attr(data-label); grid-column: 1; grid-row: 1 / span 8; color: var(--castle-muted); font-size: 11px; font-weight: 500; line-height: 1.6; }
  body.cp-redesign .cp-responsive-table td > * { grid-column: 2; min-width: 0; max-width: 100%; }
  body.cp-redesign .cp-responsive-table td > .action-row, body.cp-redesign .cp-responsive-table td > .domain-row-actions { justify-content: flex-start; flex-wrap: wrap; white-space: normal; }
  body.cp-redesign .cp-responsive-table td .mini-button, body.cp-redesign .cp-responsive-table td .mini-link { white-space: normal; }
  body.cp-redesign .dashboard-sites-card .table-wrap { overflow: visible; border: 0; border-radius: 0; }
  body.cp-redesign .dashboard-sites-table.cp-responsive-table tbody { gap: 10px; padding: 0; }
  body.cp-redesign .dashboard-sites-table.cp-responsive-table tbody tr { grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 13px; }
  body.cp-redesign .dashboard-sites-table.cp-responsive-table td { display: block; width: auto; padding: 0; border: 0; }
  body.cp-redesign .dashboard-sites-table.cp-responsive-table td::before { display: none; }
  body.cp-redesign .dashboard-sites-table.cp-responsive-table td:first-child { grid-column: 1 / -1; }
  body.cp-redesign .dashboard-sites-table.cp-responsive-table td:nth-child(2) { grid-column: 1; padding-top: 10px; }
  body.cp-redesign .dashboard-sites-table.cp-responsive-table td:last-child { grid-column: 2; align-self: end; padding-top: 10px; }
  body.cp-redesign .dashboard-sites-table.cp-responsive-table td > strong { font-size: 13px; }
  body.cp-redesign .dashboard-sites-table.cp-responsive-table td > small { font-size: 11px; }
  body.cp-redesign .dashboard-sites-table.cp-responsive-table .mini-link { min-height: 36px; padding: 8px 10px; font-size: 11px; white-space: nowrap; }
  body.cp-redesign .dashboard-site-badges { gap: 5px; }
  body.cp-redesign .dashboard-site-badges .pill { padding: 4px 6px; font-size: 9px; }
  body.cp-redesign .cp-responsive-table .cp-table-empty td { display: block; padding: 15px 0; }
  body.cp-redesign .cp-responsive-table .cp-table-empty td::before { display: none; }
  body.cp-redesign .cp-responsive-table .file-item-name { min-width: 0; }
  body.cp-redesign .cp-responsive-table .file-item-name strong { white-space: normal; overflow-wrap: anywhere; }
  body.cp-redesign .file-directory-table.cp-responsive-table tbody tr:not(.cp-table-empty) { grid-template-columns: 24px minmax(0, 1fr) 36px; align-items: start; column-gap: 7px; padding: 12px; }
  body.cp-redesign .file-directory-table.cp-responsive-table td { grid-column: 1 / -1; }
  body.cp-redesign .file-directory-table.cp-responsive-table td.file-check-column { grid-column: 1; grid-row: 1; display: flex; align-items: center; justify-content: center; padding: 5px 0; border: 0; }
  body.cp-redesign .file-directory-table.cp-responsive-table td:nth-child(2) { grid-column: 2; grid-row: 1; display: block; padding: 5px 0 12px; border: 0; }
  body.cp-redesign .file-directory-table.cp-responsive-table td.file-menu-column { grid-column: 3; grid-row: 1; display: flex; align-items: center; justify-content: flex-end; padding: 0; border: 0; }
  body.cp-redesign .file-directory-table.cp-responsive-table :is(td.file-check-column, td.file-menu-column, td:nth-child(2))::before { display: none; }
  body.cp-redesign .file-directory-table.cp-responsive-table .file-row-menu > summary { width: 34px; height: 34px; }
}

@media (max-width: 370px) {
  body.cp-redesign { --cp-content-gap: 12px; }
  body.cp-redesign :is(.dashboard-head, .page-header, .settings-head)::before { inset: -10px -10px; }
  body.cp-redesign .card { padding: 15px; }
  body.cp-redesign .topbar-title small { display: none; }
  body.cp-redesign .topbar-actions { gap: 5px; }
  body.cp-redesign .metric strong, body.cp-redesign .stat-card strong { font-size: 23px; }
  body.cp-redesign .ip-security-tabs a { font-size: 10px; }
  body.cp-redesign .cp-responsive-table td { grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body.cp-redesign *, body.cp-redesign *::before, body.cp-redesign *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (forced-colors: active) {
  body.cp-redesign :is(a.active, button[aria-expanded="true"], .pill) { border: 1px solid Highlight; }
  body.cp-redesign :is(button.primary, .primary-button, .button-link) { border: 1px solid ButtonText; }
}

@media print {
  body.cp-redesign :is(.sidebar, .topbar, .mobile-nav, .sidebar-overlay, .notification-center) { display: none !important; }
  body.cp-redesign .app-shell { display: block; }
  body.cp-redesign .workspace { padding: 0; }
  body.cp-redesign .table-wrap { overflow: visible; }
  body.cp-redesign :is(.card, .metric, .stat-card) { box-shadow: none; break-inside: avoid; }
}
