/* PixelForge console design tokens and shared interaction/accessibility rules. */
html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  --pf-accent: #d93645;
  --pf-accent-hover: #b92b39;
  --pf-bg: #f4f6f8;
  --pf-panel: #ffffff;
  --pf-panel-2: #f8f9fb;
  --pf-line: #dfe3e8;
  --pf-text: #20252d;
  --pf-muted: #657080;
  --pf-shadow: 0 8px 24px rgb(27 39 54 / 6%);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: var(--pf-bg) !important;
  --panel: var(--pf-panel) !important;
  --panel2: var(--pf-panel-2) !important;
  --line: var(--pf-line) !important;
  --text: var(--pf-text) !important;
  --muted: var(--pf-muted) !important;
  --red: var(--pf-accent) !important;
  --accent: var(--pf-accent) !important;
  --link: #b82e3b !important;
  --glow: #f8e8ea !important;
  --ink: #20252d !important;
  --mute: #657080 !important;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --pf-bg: #0d1015;
  --pf-panel: #151920;
  --pf-panel-2: #1b2028;
  --pf-line: #303844;
  --pf-text: #eef2f7;
  --pf-muted: #a0aab8;
  --pf-shadow: 0 12px 32px rgb(0 0 0 / 20%);
}
*, *::before, *::after { box-sizing: border-box; }
body {
  min-width: 320px;
  background-color: var(--bg, var(--pf-bg));
  color: var(--text, var(--pf-text));
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pf-accent) 58%, transparent);
  outline-offset: 2px;
}
button:not(:disabled), a, summary { touch-action: manipulation; }
button, .btn, .button, .primary, .secondary, .submit {
  transition: color .16s ease, background-color .16s ease, border-color .16s ease,
    box-shadow .16s ease, transform .12s ease;
}
button:not(:disabled):active, .btn:not(:disabled):active { transform: translateY(1px); }
button:disabled, .btn:disabled { cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

html[data-theme="light"] body { background: var(--pf-bg) !important; color: var(--pf-text) !important; }
html[data-theme="light"] body { font-family: Inter, "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
html[data-theme="light"] :is(.side, .sidebar, .cloud-sidebar, .topbar, .top, .dashboard-top, .dashboard-header, .hosting-top) {
  background-color: rgb(255 255 255 / 96%) !important;
  color: var(--pf-text) !important;
  border-color: var(--pf-line) !important;
  box-shadow: 0 1px 4px rgb(27 39 54 / 4%);
}
html[data-theme="light"] :is(.side, .sidebar, .cloud-sidebar) :is(a, button, .brand, .cloud-user, .cloud-brand) { color: var(--pf-text) !important; }
html[data-theme="light"] :is(.nav a, .cloud-nav a, .side-bottom a) { color: #4c5868 !important; }
html[data-theme="light"] :is(.nav a:hover, .nav a.active, .cloud-nav a:hover, .cloud-nav a[aria-current="page"]) {
  background: #fff0f1 !important;
  color: #a92331 !important;
  border-color: #f0c8cd !important;
}
html[data-theme="light"] :is(.card, .panel, .app, .stat, .service, .detail, .activity-card,
  .info-card, .health > div, .server-grid > *, .capability-card, .activity-row, .rule-row,
  .zone-card, .worker-card, .file, .radio, .auth-card, .empty:not(.blank), .table-wrap) {
  background: var(--pf-panel) !important;
  color: var(--pf-text);
  border-color: var(--pf-line) !important;
  box-shadow: var(--pf-shadow);
}
html[data-theme="light"] :is(.card, .panel, .app, .stat, .service, .detail, .activity-card,
  .info-card, .health > div, .server-grid > *, .capability-card, .rule-row) :is(h1, h2, h3, h4, b, strong, label) { color: var(--pf-text); }
html[data-theme="light"] :is(.muted, .small, .hint, .panel-note, .crumb, .stat-label, .stat-sub,
  .server-facts, .field-wrap, .field, .meta, .activity-row small) { color: var(--pf-muted); }
html[data-theme="light"] :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea, .field, .select) {
  background-color: #fff !important;
  color: var(--pf-text) !important;
  border-color: var(--pf-line) !important;
}
html[data-theme="light"] :is(input, select, textarea)::placeholder { color: #8993a1; opacity: 1; }
html[data-theme="light"] :is(button, .btn, .button, .secondary, .ghost, .back) {
  border-color: var(--pf-line);
}
html[data-theme="light"] :is(button, .btn, .button, .secondary, .ghost, .back):not(.primary):not(.danger):not(.submit) {
  background-color: #fff;
  color: #303946;
}
html[data-theme="light"] :is(.primary, .btn.primary, .submit, .new-server, .primary-action) {
  background: var(--pf-accent) !important;
  border-color: var(--pf-accent) !important;
  color: #fff !important;
}
html[data-theme="light"] :is(.primary, .btn.primary, .submit, .new-server, .primary-action):hover:not(:disabled) {
  background: var(--pf-accent-hover) !important;
  border-color: var(--pf-accent-hover) !important;
}
html[data-theme="light"] :is(.danger, .btn.danger, .delete, .danger-action) {
  color: #b42332 !important;
  border-color: #e6b9bf !important;
  background-color: #fff7f8 !important;
}
html[data-theme="light"] :is(.pill.ok, .badge.online, .state.running) { color: #08734a; background: #e8f7ef; border-color: #b9e4cc; }
html[data-theme="light"] :is(.pill.warn, .badge.failed, .state.failed) { color: #9a5a00; background: #fff6e5; border-color: #f0d7a6; }
html[data-theme="light"] :is(.pill.info, .badge, .state) { border-color: var(--pf-line); }
html[data-theme="light"] :is(table, .table) { color: var(--pf-text); }
html[data-theme="light"] :is(th, td, .table th, .table td) { border-color: var(--pf-line) !important; color: inherit; }
html[data-theme="light"] :is(dialog, .modal, .dash-dialog) {
  background: var(--pf-panel) !important;
  color: var(--pf-text) !important;
  border-color: var(--pf-line) !important;
  box-shadow: 0 24px 70px rgb(25 35 48 / 22%);
}
html[data-theme="light"] :is(.side, .sidebar, .cloud-sidebar) :is(.cloud-logout, .cloud-theme) {
  background: #fff !important;
  color: #303946 !important;
  border-color: var(--pf-line) !important;
}
html[data-theme="light"] .cloud-avatar { background: #fdebed; color: #a92331; }
html[data-theme="light"] .auth-card { background: #fff !important; }
html[data-theme="light"] .brand-side { border-color: var(--pf-line); }
html[data-theme="light"] :is(.security-note, .foot, .sub, .status) { color: var(--pf-muted); }
html[data-theme="light"] .setup { background: #fff8ed; color: #704d1f; border-color: #ead8b9; }
html[data-theme="light"] .setup a { color: #8b5c18; }
html[data-theme="light"] .cloud-brand-mark, html[data-theme="light"] .mark { background: var(--pf-accent); }
html[data-theme="light"] .cloud-collapse,
html[data-theme="light"] .cloud-mobile-toggle { background: #fff; color: #303946; border-color: var(--pf-line); }
html[data-theme="light"] .server-card, html[data-theme="light"] .services-card,
html[data-theme="light"] .card { background-image: none !important; }
html[data-theme="light"] .service, html[data-theme="light"] .service b,
html[data-theme="light"] .stat-value, html[data-theme="light"] .server-facts b { color: var(--pf-text); }
html[data-theme="light"] .banner.error { background: #fff1f2; color: #a92331; border-color: #e8bbc1; }
html[data-theme="light"] .banner.success { background: #edf8f1; color: #137146; border-color: #bfe3cc; }
html[data-theme="light"] .banner.info { background: #edf5ff; color: #24568d; border-color: #c8ddf5; }
html[data-theme="light"] pre, html[data-theme="light"] .output, html[data-theme="light"] .job-logs {
  background: #171b22 !important;
  color: #e2e9f1 !important;
  border-color: #303844 !important;
}
html[data-theme="light"] img, html[data-theme="light"] video, html[data-theme="light"] canvas { max-width: 100%; }
@media (max-width: 720px) {
  html[data-theme="light"] :is(.table-wrap, .table-responsive) { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  html[data-theme="light"] :is(.dialog, dialog) { width: min(100% - 20px, 680px); max-height: min(90dvh, 900px); }
  html[data-theme="light"] :is(.actions, .form-actions, .row-actions) > button { min-height: 40px; }
}
